@kong-ui-public/dashboard-renderer 0.13.0 → 0.13.1
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.
|
@@ -15,7 +15,7 @@ const Z = {
|
|
|
15
15
|
type: "string"
|
|
16
16
|
}, Oe = {
|
|
17
17
|
type: "boolean"
|
|
18
|
-
},
|
|
18
|
+
}, Re = {
|
|
19
19
|
type: ["object", "array"],
|
|
20
20
|
items: {
|
|
21
21
|
type: "string"
|
|
@@ -53,7 +53,7 @@ const Z = {
|
|
|
53
53
|
stacked: {
|
|
54
54
|
type: "boolean"
|
|
55
55
|
},
|
|
56
|
-
chartDatasetColors:
|
|
56
|
+
chartDatasetColors: Re,
|
|
57
57
|
syntheticsDataKey: Z,
|
|
58
58
|
chartTitle: W,
|
|
59
59
|
allowCsvExport: Oe
|
|
@@ -73,7 +73,7 @@ const Z = {
|
|
|
73
73
|
stacked: {
|
|
74
74
|
type: "boolean"
|
|
75
75
|
},
|
|
76
|
-
chartDatasetColors:
|
|
76
|
+
chartDatasetColors: Re,
|
|
77
77
|
syntheticsDataKey: Z,
|
|
78
78
|
chartTitle: W,
|
|
79
79
|
allowCsvExport: Oe
|
|
@@ -408,7 +408,7 @@ const Z = {
|
|
|
408
408
|
required: ["tiles", "gridSize"],
|
|
409
409
|
additionalProperties: !1
|
|
410
410
|
};
|
|
411
|
-
var
|
|
411
|
+
var Le = /* @__PURE__ */ ((e) => (e.VALIDATING = "VALIDATING", e.VALIDATING_HAS_DATA = "VALIDATING_HAS_DATA", e.PENDING = "PENDING", e.SUCCESS = "SUCCESS", e.SUCCESS_HAS_DATA = "SUCCESS_HAS_DATA", e.ERROR = "ERROR", e.STALE_IF_ERROR = "STALE_IF_ERROR", e))(Le || {});
|
|
412
412
|
const Tt = (e) => {
|
|
413
413
|
var t, r, i, n, o;
|
|
414
414
|
return e ? !!// TODO: revisit: currently only the first check ever matters?
|
|
@@ -448,7 +448,7 @@ function At(e = m({}), t, r, i = Tt) {
|
|
|
448
448
|
e.value === void 0 && t && (n.value = "ERROR");
|
|
449
449
|
}), {
|
|
450
450
|
state: n,
|
|
451
|
-
swrvState:
|
|
451
|
+
swrvState: Le
|
|
452
452
|
};
|
|
453
453
|
}
|
|
454
454
|
const Ct = {
|
|
@@ -527,7 +527,7 @@ const De = {
|
|
|
527
527
|
}) : B("", !0);
|
|
528
528
|
};
|
|
529
529
|
}
|
|
530
|
-
}), Ot = { class: "analytics-chart" },
|
|
530
|
+
}), Ot = { class: "analytics-chart" }, Rt = /* @__PURE__ */ C({
|
|
531
531
|
__name: "SimpleChartRenderer",
|
|
532
532
|
props: {
|
|
533
533
|
query: {},
|
|
@@ -568,7 +568,7 @@ const De = {
|
|
|
568
568
|
for (const [i, n] of t)
|
|
569
569
|
r[i] = n;
|
|
570
570
|
return r;
|
|
571
|
-
},
|
|
571
|
+
}, Lt = /* @__PURE__ */ D(Rt, [["__scopeId", "data-v-f0f6ed41"]]), Dt = { class: "analytics-chart" }, jt = /* @__PURE__ */ C({
|
|
572
572
|
__name: "BarChartRenderer",
|
|
573
573
|
props: {
|
|
574
574
|
query: {},
|
|
@@ -944,14 +944,14 @@ function tr(e, t, r, i = {
|
|
|
944
944
|
return [w[i.fetchedItemsKey] ?? w];
|
|
945
945
|
})()) : S.push(
|
|
946
946
|
...i.searchKeys.filter((w) => w !== "id").map(async (w) => {
|
|
947
|
-
const { data:
|
|
948
|
-
return
|
|
947
|
+
const { data: R } = await n.get(`${b}?${w}=${u}`);
|
|
948
|
+
return R[i.fetchedItemsKey];
|
|
949
949
|
})
|
|
950
950
|
);
|
|
951
951
|
const T = await Promise.all(S), V = /* @__PURE__ */ new Set();
|
|
952
952
|
p.value = [], (H = T == null ? void 0 : T.forEach) == null || H.call(T, (w) => {
|
|
953
|
-
var
|
|
954
|
-
(
|
|
953
|
+
var R;
|
|
954
|
+
(R = w == null ? void 0 : w.forEach) == null || R.call(w, (Q) => {
|
|
955
955
|
V.has(Q.id) || (V.add(Q.id), p.value.push(Q));
|
|
956
956
|
});
|
|
957
957
|
});
|
|
@@ -967,8 +967,8 @@ function tr(e, t, r, i = {
|
|
|
967
967
|
var T;
|
|
968
968
|
let V = !1;
|
|
969
969
|
for (const w of i.searchKeys) {
|
|
970
|
-
const
|
|
971
|
-
|
|
970
|
+
const R = typeof S[w] == "string" ? (T = S[w]) == null ? void 0 : T.toLowerCase() : S[w];
|
|
971
|
+
R != null && R.includes(u.toLowerCase()) && (V = !0);
|
|
972
972
|
}
|
|
973
973
|
return V;
|
|
974
974
|
}), (!p.value || !p.value.length) && (v.value = o("debouncedFilter.errors.invalid"))) : p.value = d.value, s.value = !1;
|
|
@@ -1229,7 +1229,7 @@ G.prototype.constructor = G;
|
|
|
1229
1229
|
G.prototype.toString = function(e) {
|
|
1230
1230
|
return this.name + ": " + Ke(this, e);
|
|
1231
1231
|
};
|
|
1232
|
-
var
|
|
1232
|
+
var L = G, Cr = [
|
|
1233
1233
|
"kind",
|
|
1234
1234
|
"multi",
|
|
1235
1235
|
"resolve",
|
|
@@ -1256,13 +1256,13 @@ function qr(e) {
|
|
|
1256
1256
|
function Nr(e, t) {
|
|
1257
1257
|
if (t = t || {}, Object.keys(t).forEach(function(r) {
|
|
1258
1258
|
if (Cr.indexOf(r) === -1)
|
|
1259
|
-
throw new
|
|
1259
|
+
throw new L('Unknown option "' + r + '" is met in definition of "' + e + '" YAML type.');
|
|
1260
1260
|
}), this.options = t, this.tag = e, this.kind = t.kind || null, this.resolve = t.resolve || function() {
|
|
1261
1261
|
return !0;
|
|
1262
1262
|
}, this.construct = t.construct || function(r) {
|
|
1263
1263
|
return r;
|
|
1264
1264
|
}, this.instanceOf = t.instanceOf || null, this.predicate = t.predicate || null, this.represent = t.represent || null, this.representName = t.representName || null, this.defaultStyle = t.defaultStyle || null, this.multi = t.multi || !1, this.styleAliases = qr(t.styleAliases || null), Er.indexOf(this.kind) === -1)
|
|
1265
|
-
throw new
|
|
1265
|
+
throw new L('Unknown kind "' + this.kind + '" is specified for "' + e + '" YAML type.');
|
|
1266
1266
|
}
|
|
1267
1267
|
var _ = Nr;
|
|
1268
1268
|
function we(e, t) {
|
|
@@ -1306,22 +1306,22 @@ te.prototype.extend = function(e) {
|
|
|
1306
1306
|
else if (e && (Array.isArray(e.implicit) || Array.isArray(e.explicit)))
|
|
1307
1307
|
e.implicit && (t = t.concat(e.implicit)), e.explicit && (r = r.concat(e.explicit));
|
|
1308
1308
|
else
|
|
1309
|
-
throw new
|
|
1309
|
+
throw new L("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
|
|
1310
1310
|
t.forEach(function(n) {
|
|
1311
1311
|
if (!(n instanceof _))
|
|
1312
|
-
throw new
|
|
1312
|
+
throw new L("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
1313
1313
|
if (n.loadKind && n.loadKind !== "scalar")
|
|
1314
|
-
throw new
|
|
1314
|
+
throw new L("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
|
1315
1315
|
if (n.multi)
|
|
1316
|
-
throw new
|
|
1316
|
+
throw new L("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
|
|
1317
1317
|
}), r.forEach(function(n) {
|
|
1318
1318
|
if (!(n instanceof _))
|
|
1319
|
-
throw new
|
|
1319
|
+
throw new L("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
1320
1320
|
});
|
|
1321
1321
|
var i = Object.create(te.prototype);
|
|
1322
1322
|
return i.implicit = (this.implicit || []).concat(t), i.explicit = (this.explicit || []).concat(r), i.compiledImplicit = we(i, "implicit"), i.compiledExplicit = we(i, "explicit"), i.compiledTypeMap = Or(i.compiledImplicit, i.compiledExplicit), i;
|
|
1323
1323
|
};
|
|
1324
|
-
var
|
|
1324
|
+
var Rr = te, Lr = new _("tag:yaml.org,2002:str", {
|
|
1325
1325
|
kind: "scalar",
|
|
1326
1326
|
construct: function(e) {
|
|
1327
1327
|
return e !== null ? e : "";
|
|
@@ -1336,9 +1336,9 @@ var Lr = te, Rr = new _("tag:yaml.org,2002:str", {
|
|
|
1336
1336
|
construct: function(e) {
|
|
1337
1337
|
return e !== null ? e : {};
|
|
1338
1338
|
}
|
|
1339
|
-
}), $r = new
|
|
1339
|
+
}), $r = new Rr({
|
|
1340
1340
|
explicit: [
|
|
1341
|
-
|
|
1341
|
+
Lr,
|
|
1342
1342
|
Dr,
|
|
1343
1343
|
jr
|
|
1344
1344
|
]
|
|
@@ -1733,9 +1733,9 @@ function ke(e) {
|
|
|
1733
1733
|
return e === 48 ? "\0" : e === 97 ? "\x07" : e === 98 ? "\b" : e === 116 || e === 9 ? " " : e === 110 ? `
|
|
1734
1734
|
` : e === 118 ? "\v" : e === 102 ? "\f" : e === 114 ? "\r" : e === 101 ? "\x1B" : e === 32 ? " " : e === 34 ? '"' : e === 47 ? "/" : e === 92 ? "\\" : e === 78 ? "
" : e === 95 ? " " : e === 76 ? "\u2028" : e === 80 ? "\u2029" : "";
|
|
1735
1735
|
}
|
|
1736
|
-
var
|
|
1736
|
+
var Rn = new Array(256), Ln = new Array(256);
|
|
1737
1737
|
for (var z = 0; z < 256; z++)
|
|
1738
|
-
|
|
1738
|
+
Rn[z] = ke(z) ? 1 : 0, Ln[z] = ke(z);
|
|
1739
1739
|
const Se = "24px", Dn = (e, t) => {
|
|
1740
1740
|
const r = e.__vccOpts || e;
|
|
1741
1741
|
for (const [i, n] of t)
|
|
@@ -1997,7 +1997,7 @@ const Se = "24px", Dn = (e, t) => {
|
|
|
1997
1997
|
[x.TimeseriesLine]: Pt,
|
|
1998
1998
|
[x.HorizontalBar]: ye,
|
|
1999
1999
|
[x.VerticalBar]: ye,
|
|
2000
|
-
[x.Gauge]:
|
|
2000
|
+
[x.Gauge]: Lt,
|
|
2001
2001
|
[x.GoldenSignals]: Kt,
|
|
2002
2002
|
[x.TopN]: Yn,
|
|
2003
2003
|
[x.Slottable]: void 0
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(f,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("@kong-ui-public/analytics-chart"),require("swrv"),require("axios"),require("@kong-ui-public/i18n"),require("@kong-ui-public/analytics-metric-provider"),require("@kong-ui-public/analytics-utilities"),require("@kong/kongponents"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/analytics-chart","swrv","axios","@kong-ui-public/i18n","@kong-ui-public/analytics-metric-provider","@kong-ui-public/analytics-utilities","@kong/kongponents","vue-router"],n):(f=typeof globalThis<"u"?globalThis:f||self,n(f["kong-ui-public-dashboard-renderer"]={},f.Vue,f["kong-ui-public-analytics-chart"],f.swrv,f.axios,f["kong-ui-public-i18n"],f["kong-ui-public-analytics-metric-provider"],f["kong-ui-public-analytics-utilities"]))})(this,function(f,n,T,Be,W,B,J,j){"use strict";const U="analytics-query-provider",F="{entity-id}",Q="{cp-id}";var _=(e=>(e.HorizontalBar="horizontal_bar",e.VerticalBar="vertical_bar",e.Gauge="gauge",e.TimeseriesLine="timeseries_line",e.GoldenSignals="golden_signals",e.TopN="top_n",e.Slottable="slottable",e))(_||{});const $={type:"string"},z={type:"string"},X={type:"boolean"},ee={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},te={type:"object",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},re={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chartDatasetColors:ee,syntheticsDataKey:$,chartTitle:z,allowCsvExport:X},required:["type"],additionalProperties:!1},ne={type:"object",properties:{type:{type:"string",enum:["timeseries_line"]},stacked:{type:"boolean"},chartDatasetColors:ee,syntheticsDataKey:$,chartTitle:z,allowCsvExport:X},required:["type"],additionalProperties:!1},ie={type:"object",properties:{type:{type:"string",enum:["gauge"]},metricDisplay:{type:"string",enum:Object.values(T.ChartMetricDisplay)},reverseDataset:{type:"boolean"},numerator:{type:"number"},syntheticsDataKey:$,chartTitle:z},required:["type"],additionalProperties:!1},oe={type:"object",properties:{chartTitle:z,syntheticsDataKey:$,type:{type:"string",enum:["top_n"]},description:{type:"string"},entityLink:{type:"string"}},required:["type"],additionalProperties:!1},ae={type:"object",properties:{type:{type:"string",enum:["golden_signals"]},longCardTitles:{type:"boolean"},description:{type:"string"}},required:["type"]},se={type:"object",description:"A query to launch at the API",properties:{metrics:{type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:["request_count","request_per_minute","response_latency_p99","response_latency_p95","response_latency_p50","response_latency_average","upstream_latency_p99","upstream_latency_p95","upstream_latency_p50","upstream_latency_average","kong_latency_p99","kong_latency_p95","kong_latency_p50","kong_latency_average","response_size_p99","response_size_p95","response_size_p50","request_size_p99","request_size_p95","request_size_p50","request_size_average","response_size_average"]}},dimensions:{type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:["api_product","api_product_version","application","consumer","control_plane","control_plane_group","data_plane_node","gateway_service","route","status_code","status_code_grouped","time"]}},filters:{type:"array",description:"A list of filters to apply to the query.",items:{type:"object",description:"A filter that specifies which data to include in the query",properties:{dimension:{type:"string",enum:["api_product","api_product_version","application","consumer","control_plane","control_plane_group","data_plane_node","gateway_service","route","status_code","status_code_grouped","time"]},type:{type:"string",enum:["in","not_in","selector"]},values:{type:"array",items:{type:"string"}}},required:["dimension","type","values"]}},granularity_ms:{type:"number",description:'Force time grouping into buckets of this duration in milliseconds. Only has an effect if "time" is in the "dimensions" list.',minimum:6e4},time_range:{description:"The time range to query.",oneOf:[{type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:["15m","1h","6h","12h","24h","7d","30d","current_week","current_month","previous_week","previous_month"],default:"1h"}},required:["type","time_range"]},{type:"object",description:"A duration representing an exact start and end time.",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["absolute"]},start:{type:"string"},end:{type:"string"}},required:["type"]}],default:{type:"relative",time_range:"1h"}},meta:{type:"object"}}},le={type:"object",properties:{query:se,chart:{oneOf:[re,ie,ne,ae,oe,te]}},required:["query","chart"],additionalProperties:!1},ce={type:"object",properties:{position:{type:"object",properties:{col:{type:"number"},row:{type:"number"}},description:"Position of the tile in the grid.",required:["col","row"],additionalProperties:!1},size:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"}},description:"Number of columns and rows the tile occupies.",required:["cols","rows"],additionalProperties:!1}},required:["position","size"],additionalProperties:!1},ue={type:"object",properties:{definition:le,layout:ce},required:["definition","layout"],additionalProperties:!1},je={type:"object",properties:{tiles:{type:"array",items:ue},tileHeight:{type:"number",description:"Height of each tile in pixels. Default: 170"},gridSize:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"}},description:"Number of columns and rows in the grid.",required:["cols","rows"],additionalProperties:!1}},required:["tiles","gridSize"],additionalProperties:!1};var pe=(e=>(e.VALIDATING="VALIDATING",e.VALIDATING_HAS_DATA="VALIDATING_HAS_DATA",e.PENDING="PENDING",e.SUCCESS="SUCCESS",e.SUCCESS_HAS_DATA="SUCCESS_HAS_DATA",e.ERROR="ERROR",e.STALE_IF_ERROR="STALE_IF_ERROR",e))(pe||{});const $e=e=>{var t,r,o,i,s;return e?!!((t=Object.keys(e))!=null&&t.length||(r=e.data)!=null&&r.length||(i=(o=e.data)==null?void 0:o.data)!=null&&i.length||!((s=e.data)!=null&&s.data)&&typeof e.data=="object"&&Object.keys(e==null?void 0:e.data).length):!1};function ze(e=n.ref({}),t,r,o=$e){const i=n.ref("PENDING");return n.watchEffect(()=>{const s=o(e.value);if(e.value&&s&&r.value){i.value="VALIDATING_HAS_DATA";return}if(e.value&&r.value){i.value="VALIDATING";return}if(e.value&&t.value){i.value="STALE_IF_ERROR";return}if(e.value===void 0&&!t.value){i.value="PENDING";return}if(e.value&&!t.value&&s){i.value="SUCCESS_HAS_DATA";return}if(e.value&&!t.value){i.value="SUCCESS";return}e.value===void 0&&t&&(i.value="ERROR")}),{state:i,swrvState:pe}}const Ve={renderer:{noQueryBridge:"No query bridge provided. Unable to render dashboard."},queryDataProvider:{timeRangeExceeded:"The time range for this report is outside of your organization's data retention period"}};function Pe(){const e=B.createI18n("en-us",Ve);return{i18n:e,i18nT:B.i18nTComponent(e)}}const de={useI18n:Pe},V=n.defineComponent({__name:"QueryDataProvider",props:{context:{},query:{},queryReady:{type:Boolean}},emits:["queryComplete"],setup(e,{emit:t}){const r=e,o=t,{i18n:i}=de.useI18n(),s=n.inject(U),a=()=>r.queryReady&&s?JSON.stringify([r.query,r.context]):null,c=new AbortController;n.onUnmounted(()=>{c.abort()});const{data:l,error:u,isValidating:h}=Be(a,async()=>{var E,O,x,L;try{const p=[];r.query.filters&&p.push(...r.query.filters),p.push(...r.context.filters);const P={...r.query,time_range:{...r.context.timeSpec,tz:r.context.tz},filters:p};return s==null?void 0:s.queryFn(P,c)}catch(p){y.value=((O=(E=p==null?void 0:p.response)==null?void 0:E.data)==null?void 0:O.message)==="Range not allowed for this tier"?i.t("queryDataProvider.timeRangeExceeded"):((L=(x=p==null?void 0:p.response)==null?void 0:x.data)==null?void 0:L.message)||(p==null?void 0:p.message)}finally{o("queryComplete")}},{refreshInterval:0,revalidateOnFocus:!1}),{state:d,swrvState:m}=ze(l,u,h),y=n.ref(null),C=n.computed(()=>d.value===m.ERROR||!!y.value),b=n.computed(()=>!r.queryReady||d.value===m.PENDING);return(E,O)=>{const x=n.resolveComponent("KSkeleton"),L=n.resolveComponent("KEmptyState");return b.value||!n.unref(l)&&!C.value?(n.openBlock(),n.createBlock(x,{key:0,class:"chart-skeleton",type:"table"})):C.value?(n.openBlock(),n.createBlock(L,{key:1,"action-button-visible":!1,"data-testid":"chart-empty-state","icon-variant":"error"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(y.value),1)]),_:1})):n.unref(l)?n.renderSlot(E.$slots,"default",{key:2,data:n.unref(l)}):n.createCommentVNode("",!0)}}}),Ue={class:"analytics-chart"},Fe=n.defineComponent({__name:"SimpleChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{}},setup(e){n.useCssVars(i=>({"8c62ff26":`${i.height}px`}));const t=e,r={[_.Gauge]:T.ChartTypesSimple.GAUGE},o=n.computed(()=>({...t.chartOptions,type:r[t.chartOptions.type]}));return(i,s)=>(n.openBlock(),n.createBlock(V,{context:i.context,query:i.query,"query-ready":i.queryReady},{default:n.withCtx(({data:a})=>[n.createElementVNode("div",Ue,[n.createVNode(n.unref(T.SimpleChart),{"chart-data":a,"chart-options":o.value,"synthetics-data-key":i.chartOptions.syntheticsDataKey},null,8,["chart-data","chart-options","synthetics-data-key"])])]),_:1},8,["context","query","query-ready"]))}}),I=(e,t)=>{const r=e.__vccOpts||e;for(const[o,i]of t)r[o]=i;return r},Ke=I(Fe,[["__scopeId","data-v-f0f6ed41"]]),Ge={class:"analytics-chart"},fe=I(n.defineComponent({__name:"BarChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{}},setup(e){n.useCssVars(i=>({"1eed717c":`${i.height}px`}));const t=e,r={[_.HorizontalBar]:T.ChartTypes.HORIZONTAL_BAR,[_.VerticalBar]:T.ChartTypes.VERTICAL_BAR},o=n.computed(()=>({type:r[t.chartOptions.type],stacked:t.chartOptions.stacked,chartDatasetColors:t.chartOptions.chartDatasetColors}));return(i,s)=>(n.openBlock(),n.createBlock(V,{context:i.context,query:i.query,"query-ready":i.queryReady},{default:n.withCtx(({data:a})=>[n.createElementVNode("div",Ge,[n.createVNode(n.unref(T.AnalyticsChart),{"allow-csv-export":i.chartOptions.allowCsvExport,"chart-data":a,"chart-options":o.value,"chart-title":i.chartOptions.chartTitle,"legend-position":"bottom","show-annotations":!1,"synthetics-data-key":i.chartOptions.syntheticsDataKey,"tooltip-title":""},null,8,["allow-csv-export","chart-data","chart-options","chart-title","synthetics-data-key"])])]),_:1},8,["context","query","query-ready"]))}}),[["__scopeId","data-v-36598a1b"]]),He={class:"analytics-chart"},Me=I(n.defineComponent({__name:"TimeseriesChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{}},setup(e){n.useCssVars(i=>({"24c2946a":`${i.height}px`}));const t=e,r={[_.TimeseriesLine]:T.ChartTypes.TIMESERIES_LINE},o=n.computed(()=>{const i=t.chartOptions.stacked??!1;return{type:r[t.chartOptions.type],fill:i,stacked:i,chartDatasetColors:t.chartOptions.chartDatasetColors}});return(i,s)=>(n.openBlock(),n.createBlock(V,{context:i.context,query:i.query,"query-ready":i.queryReady},{default:n.withCtx(({data:a})=>[n.createElementVNode("div",He,[n.createVNode(n.unref(T.AnalyticsChart),{"allow-csv-export":i.chartOptions.allowCsvExport,"chart-data":a,"chart-options":o.value,"chart-title":i.chartOptions.chartTitle,"legend-position":"bottom","synthetics-data-key":i.chartOptions.syntheticsDataKey,"tooltip-title":""},null,8,["allow-csv-export","chart-data","chart-options","chart-title","synthetics-data-key"])])]),_:1},8,["context","query","query-ready"]))}}),[["__scopeId","data-v-93ab34da"]]),Ye={class:"metric-card-tile-wrapper"},Ze=I(n.defineComponent({__name:"GoldenSignalsRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{}},setup(e){const t=e,r=n.computed(()=>{const i=t.context.timeSpec;if(i.type==="absolute")return new j.Timeframe({key:"custom",timeframeText:"custom",display:"custom",startCustom:i.start,endCustom:i.end,timeframeLength:()=>0,defaultResponseGranularity:j.GranularityKeys.DAILY,dataGranularity:j.GranularityKeys.DAILY,isRelative:!1,allowedTiers:["free","plus","enterprise"]});const s=j.TimePeriods.get(i.time_range);if(!s)throw new Error("Unknown time range");return s}),o=n.computed(()=>({overrideTimeframe:r.value,tz:t.context.tz,additionalFilter:t.context.filters,longCardTitles:t.chartOptions.longCardTitles,description:t.chartOptions.description,hasTrendAccess:!0,refreshInterval:0}));return(i,s)=>(n.openBlock(),n.createElementBlock("div",Ye,[n.createVNode(n.unref(J.MetricsProviderInternal),n.normalizeProps(n.guardReactiveProps(o.value)),{default:n.withCtx(()=>[n.createVNode(n.unref(J.MetricsConsumer),{class:"metric-consumer"})]),_:1},16)]))}}),[["__scopeId","data-v-52746db6"]]),ye="20px";var N=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(N||{});function We(){return{getAxiosInstance:(e={})=>{try{const t=n.inject("get-axios-instance",void 0);return typeof t=="function"?t(e):W.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),W.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var t;return((t=e==null?void 0:e.response)==null?void 0:t.headers["x-datadog-trace-id"])||""}}}function Je(){return{debounce:(e,t)=>{let r;return(...o)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...o)},t)}}}}function K(e={}){const{getAxiosInstance:t}=We();return{axiosInstance:t(e)}}const Qe={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},Xe={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},et={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},tt={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},rt={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},nt={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},it={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},ot={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},at={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},st={global:Qe,deleteModal:Xe,baseForm:et,baseTable:tt,baseConfigCard:rt,filter:nt,debouncedFilter:it,errors:ot,toggleModal:at};function G(){const e=B.createI18n("en-us",st);return{i18n:e,i18nT:B.i18nTComponent(e)}}function me(){const e=(r,o)=>(o==null?void 0:o[r])??void 0,t=(r,o)=>{if(r.length!==o.length)return!1;const i=new Set([...r,...o]);for(const s of i){const a=r.filter(l=>l===s).length,c=o.filter(l=>l===s).length;if(a!==c)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,o,i)=>{if(i){if(Object.keys(r).length===Object.keys(o).length)for(const s in r)if(Array.isArray(r[s])&&Array.isArray(o[s])){if(t(r[s],o[s]))continue;return!1}else{if(r[s]===o[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(o)}catch{return!1}},sortAlpha:r=>(o,i)=>{let s=o[r]===void 0||o[r]===null?"":o[r],a=i[r]===void 0||i[r]===null?"":i[r];return Array.isArray(o[r])&&(s=o[r][0]),Array.isArray(i[r])&&(a=i[r][0]),s.localeCompare(a)},isValidUuid:r=>r?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r):!1}}function lt(e,t,r,o={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:i}=K({headers:e.requestHeaders}),{i18n:{t:s}}=G(),{debounce:a}=Je(),c=a(async p=>{await L(p)},200),l=n.ref(!1),u=n.ref(""),h=n.ref(""),d=n.ref([]),m=n.ref([]),y=n.ref(void 0),C=n.unref(t);let b=`${e.apiBaseUrl}${C}`;e.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(b=b.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:E}=me(),O=async()=>{try{l.value=!0;const{data:p}=await i.get(`${b}?size=${r}`);p!=null&&p.next||(y.value=o.fetchedItemsKey in p?p[o.fetchedItemsKey]:[]),m.value=o.fetchedItemsKey in p?p[o.fetchedItemsKey]:[],d.value=m.value}catch{d.value=[],u.value=s("debouncedFilter.errors.fetch")}finally{l.value=!1}},x=n.ref(""),L=async p=>{var P,De,Re;if(x.value!==p)if(x.value=p||"",y.value===void 0)try{if(l.value=!0,u.value="",h.value="",e.app==="konnect"){let w=b+"";p&&(w+=`/${p}`);const{data:S}=await i.get(`${w}?size=${r}`);o.fetchedItemsKey in S?d.value=S[o.fetchedItemsKey]:S!=null&&S.id?d.value=[S]:d.value=[]}else if(p){const w=[];E(p)&&o.searchKeys.includes("id")?w.push((async()=>{const{data:k}=await i.get(`${b}/${p}`);return[k[o.fetchedItemsKey]??k]})()):w.push(...o.searchKeys.filter(k=>k!=="id").map(async k=>{const{data:A}=await i.get(`${b}?${k}=${p}`);return A[o.fetchedItemsKey]}));const S=await Promise.all(w),R=new Set;d.value=[],(P=S==null?void 0:S.forEach)==null||P.call(S,k=>{var A;(A=k==null?void 0:k.forEach)==null||A.call(k,Z=>{R.has(Z.id)||(R.add(Z.id),d.value.push(Z))})})}else d.value=m.value}catch(w){((De=w==null?void 0:w.response)==null?void 0:De.status)===404?h.value=s("debouncedFilter.errors.invalid"):(d.value=[],u.value=s("debouncedFilter.errors.fetch"))}finally{l.value=!1}else l.value=!0,h.value="",p?(d.value=(Re=y.value)==null?void 0:Re.filter(w=>{var S;let R=!1;for(const k of o.searchKeys){const A=typeof w[k]=="string"?(S=w[k])==null?void 0:S.toLowerCase():w[k];A!=null&&A.includes(p.toLowerCase())&&(R=!0)}return R}),(!d.value||!d.value.length)&&(h.value=s("debouncedFilter.errors.invalid"))):d.value=y.value,l.value=!1};return{loading:l,error:u,validationError:h,results:d,allRecords:y,loadItems:O,debouncedQueryChange:c}}function ct(e,t){const r=n.unref(t),o=n.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return o.value.search="",i=>`${o.value.href}/${i}`}function ut(){const{i18n:{t:e}}=G();return{getMessageFromError:t=>{var r,o,i,s;if(!t)return e("errors.unexpected");if(((r=t==null?void 0:t.response)==null?void 0:r.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((o=t==null?void 0:t.response)!=null&&o.data){if(t.response.data.detail)return t.response.data.detail;if((i=t.response.data.details)!=null&&i.length)return t.response.data.details.map(a=>{let c=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(c=a.messages.join(", ")),a.field?`${a.field} - ${c}`:c}).join("; ");if(t.response.data.message){const{message:a}=t.response.data;return Array.isArray(a)?(s=a[0])!=null&&s.constraints?Object.values(a[0].constraints)[0]:a[0]:a}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(a=>`${a} ${t.response.data[a]}`).join(", ")}return t.message||e("errors.unexpected")}}}function pt(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const o=e.join("/"),i=`${r}${o}`,s=e.some(a=>a.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(i)&&!s&&new URL(i))return`${r}${o}`;throw new Error("Invalid url")}catch(o){return console.warn("Failed to build valid URL:",o),""}}function he(e,t){const r=n.ref(n.unref(e)),o=n.ref(n.unref(t)),i=n.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),s=n.computed(()=>o.value.startsWith("/")?new URL(`${window.location.origin}${o.value}`):new URL(o.value));return a=>{const{page:c,pageSize:l,offset:u,sortColumnKey:h,sortColumnOrder:d,query:m}=a;try{let y=new URL(s.value.href);return i.value&&m?(y.search="",y=r.value.isExactMatch?new URL(`${y.href}/${m}/`):new URL(`${y.href}?filter[name][contains]=${m}`)):(i.value||new URLSearchParams(m).forEach((C,b)=>{y.searchParams.append(b,C)}),h&&y.searchParams.append("sort_by",h),d==="desc"&&y.searchParams.append("sort_desc","1"),y.searchParams.append("size",String(l))),u&&c!==1&&y.searchParams.append("offset",String(u)),y.href}catch(y){return console.error("RouteList(fetcher)",y),o.value}}}function dt(e,t,r="data"){const o=n.unref(t),{axiosInstance:i}=K({headers:e.requestHeaders}),s=he(e,o),a=n.ref({status:N.Idle});return{fetcher:async c=>{try{a.value={status:N.Loading};let l=s(c);l.includes("filter[name]")&&(l=`${l}&page[size]=${c.pageSize}&page[number]=${c.page}`);const{data:u}=await i.get(l),h=r&&r.replace(/[^\w-_]/gi,"");let d;u[h]&&Array.isArray(u[h])?d=u[h]:Array.isArray(u)?d=u:d=Object.keys(u).length?[u]:[];const m={data:d,total:d.length,...u.offset?{pagination:{offset:u.offset}}:null};return a.value={status:N.Idle,response:m},m}catch(l){const u={data:[],total:0};return c.query&&l.response.status===404?(a.value={status:N.NoResults,response:u,error:l},u):(a.value={status:N.Error,response:u,error:l},u)}},fetcherState:a}}function ft(){const e=(r,o="_")=>r?r.split(o).map(i=>i.toLowerCase()==="id"?i.toUpperCase():i.charAt(0).toUpperCase()+i.substring(1)).join(" "):"",t=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(t,o=>o.toUpperCase()):"",convertKeyToTitle:e}}const ge=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,_e=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(ge);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},be=e=>e==="*"||e==="x"||e==="X",ke=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},yt=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],mt=(e,t)=>{if(be(e)||be(t))return 0;const[r,o]=yt(ke(e),ke(t));return r>o?1:r<o?-1:0},we=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const o=mt(e[r]||"0",t[r]||"0");if(o!==0)return o}return 0},ht=(e,t)=>{const r=_e(e),o=_e(t),i=r.pop(),s=o.pop(),a=we(r,o);return a!==0?a:i&&s?we(i.split("."),s.split(".")):i||s?i?-1:1:0},Se=(e,t,r)=>{gt(r);const o=ht(e,t);return Te[r].includes(o)},Te={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Ce=Object.keys(Te),gt=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Ce.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Ce.join("|")}`)},_t=e=>typeof e=="string"&&/^[v\d]/.test(e)&&ge.test(e);function bt(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:o,version:i}=t;if(!_t(i))return console.error("Invalid version"),!1;const s=r[o];if(!s)return!1;const[a,c]=s;return!(a&&Se(i,a,"<")||c&&Se(i,c,">"))}function kt(e){const t=n.ref(0),r=n.ref(0),o=n.ref(!1);return n.watch(e,i=>{i&&!o.value&&(t.value=i.offsetWidth,r.value=i.scrollWidth,o.value=!0)}),{isTruncated:n.computed(()=>t.value<r.value)}}const Ee={useAxios:K,useDebouncedFilter:lt,useDeleteUrlBuilder:ct,useErrors:ut,useExternalLinkCreator:pt,useFetcher:dt,useFetchUrlBuilder:he,useHelpers:me,useStringHelpers:ft,useI18n:G,useGatewayFeatureSupported:bt,useTruncationDetector:kt},wt=(e,t)=>{const r=e.__vccOpts||e;for(const[o,i]of t)r[o]=i;return r},St="#0044f4",Tt="16px";/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Ie(e){return typeof e>"u"||e===null}function Ct(e){return typeof e=="object"&&e!==null}function Et(e){return Array.isArray(e)?e:Ie(e)?[]:[e]}function It(e,t){var r,o,i,s;if(t)for(s=Object.keys(t),r=0,o=s.length;r<o;r+=1)i=s[r],e[i]=t[i];return e}function vt(e,t){var r="",o;for(o=0;o<t;o+=1)r+=e;return r}function xt(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var At=Ie,Nt=Ct,qt=Et,Ot=vt,Lt=xt,Dt=It,H={isNothing:At,isObject:Nt,toArray:qt,repeat:Ot,isNegativeZero:Lt,extend:Dt};function ve(e,t){var r="",o=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
1
|
+
(function(f,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("@kong-ui-public/analytics-chart"),require("swrv"),require("axios"),require("@kong-ui-public/i18n"),require("@kong-ui-public/analytics-metric-provider"),require("@kong-ui-public/analytics-utilities"),require("@kong/kongponents"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/analytics-chart","swrv","axios","@kong-ui-public/i18n","@kong-ui-public/analytics-metric-provider","@kong-ui-public/analytics-utilities","@kong/kongponents","vue-router"],n):(f=typeof globalThis<"u"?globalThis:f||self,n(f["kong-ui-public-dashboard-renderer"]={},f.Vue,f["kong-ui-public-analytics-chart"],f.swrv,f.axios,f["kong-ui-public-i18n"],f["kong-ui-public-analytics-metric-provider"],f["kong-ui-public-analytics-utilities"]))})(this,function(f,n,T,Be,W,B,J,j){"use strict";const U="analytics-query-provider",F="{entity-id}",Q="{cp-id}";var _=(e=>(e.HorizontalBar="horizontal_bar",e.VerticalBar="vertical_bar",e.Gauge="gauge",e.TimeseriesLine="timeseries_line",e.GoldenSignals="golden_signals",e.TopN="top_n",e.Slottable="slottable",e))(_||{});const $={type:"string"},V={type:"string"},X={type:"boolean"},ee={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},te={type:"object",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},re={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chartDatasetColors:ee,syntheticsDataKey:$,chartTitle:V,allowCsvExport:X},required:["type"],additionalProperties:!1},ne={type:"object",properties:{type:{type:"string",enum:["timeseries_line"]},stacked:{type:"boolean"},chartDatasetColors:ee,syntheticsDataKey:$,chartTitle:V,allowCsvExport:X},required:["type"],additionalProperties:!1},ie={type:"object",properties:{type:{type:"string",enum:["gauge"]},metricDisplay:{type:"string",enum:Object.values(T.ChartMetricDisplay)},reverseDataset:{type:"boolean"},numerator:{type:"number"},syntheticsDataKey:$,chartTitle:V},required:["type"],additionalProperties:!1},oe={type:"object",properties:{chartTitle:V,syntheticsDataKey:$,type:{type:"string",enum:["top_n"]},description:{type:"string"},entityLink:{type:"string"}},required:["type"],additionalProperties:!1},ae={type:"object",properties:{type:{type:"string",enum:["golden_signals"]},longCardTitles:{type:"boolean"},description:{type:"string"}},required:["type"]},se={type:"object",description:"A query to launch at the API",properties:{metrics:{type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:["request_count","request_per_minute","response_latency_p99","response_latency_p95","response_latency_p50","response_latency_average","upstream_latency_p99","upstream_latency_p95","upstream_latency_p50","upstream_latency_average","kong_latency_p99","kong_latency_p95","kong_latency_p50","kong_latency_average","response_size_p99","response_size_p95","response_size_p50","request_size_p99","request_size_p95","request_size_p50","request_size_average","response_size_average"]}},dimensions:{type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:["api_product","api_product_version","application","consumer","control_plane","control_plane_group","data_plane_node","gateway_service","route","status_code","status_code_grouped","time"]}},filters:{type:"array",description:"A list of filters to apply to the query.",items:{type:"object",description:"A filter that specifies which data to include in the query",properties:{dimension:{type:"string",enum:["api_product","api_product_version","application","consumer","control_plane","control_plane_group","data_plane_node","gateway_service","route","status_code","status_code_grouped","time"]},type:{type:"string",enum:["in","not_in","selector"]},values:{type:"array",items:{type:"string"}}},required:["dimension","type","values"]}},granularity_ms:{type:"number",description:'Force time grouping into buckets of this duration in milliseconds. Only has an effect if "time" is in the "dimensions" list.',minimum:6e4},time_range:{description:"The time range to query.",oneOf:[{type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:["15m","1h","6h","12h","24h","7d","30d","current_week","current_month","previous_week","previous_month"],default:"1h"}},required:["type","time_range"]},{type:"object",description:"A duration representing an exact start and end time.",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["absolute"]},start:{type:"string"},end:{type:"string"}},required:["type"]}],default:{type:"relative",time_range:"1h"}},meta:{type:"object"}}},le={type:"object",properties:{query:se,chart:{oneOf:[re,ie,ne,ae,oe,te]}},required:["query","chart"],additionalProperties:!1},ce={type:"object",properties:{position:{type:"object",properties:{col:{type:"number"},row:{type:"number"}},description:"Position of the tile in the grid.",required:["col","row"],additionalProperties:!1},size:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"}},description:"Number of columns and rows the tile occupies.",required:["cols","rows"],additionalProperties:!1}},required:["position","size"],additionalProperties:!1},ue={type:"object",properties:{definition:le,layout:ce},required:["definition","layout"],additionalProperties:!1},je={type:"object",properties:{tiles:{type:"array",items:ue},tileHeight:{type:"number",description:"Height of each tile in pixels. Default: 170"},gridSize:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"}},description:"Number of columns and rows in the grid.",required:["cols","rows"],additionalProperties:!1}},required:["tiles","gridSize"],additionalProperties:!1};var pe=(e=>(e.VALIDATING="VALIDATING",e.VALIDATING_HAS_DATA="VALIDATING_HAS_DATA",e.PENDING="PENDING",e.SUCCESS="SUCCESS",e.SUCCESS_HAS_DATA="SUCCESS_HAS_DATA",e.ERROR="ERROR",e.STALE_IF_ERROR="STALE_IF_ERROR",e))(pe||{});const $e=e=>{var t,r,o,i,s;return e?!!((t=Object.keys(e))!=null&&t.length||(r=e.data)!=null&&r.length||(i=(o=e.data)==null?void 0:o.data)!=null&&i.length||!((s=e.data)!=null&&s.data)&&typeof e.data=="object"&&Object.keys(e==null?void 0:e.data).length):!1};function Ve(e=n.ref({}),t,r,o=$e){const i=n.ref("PENDING");return n.watchEffect(()=>{const s=o(e.value);if(e.value&&s&&r.value){i.value="VALIDATING_HAS_DATA";return}if(e.value&&r.value){i.value="VALIDATING";return}if(e.value&&t.value){i.value="STALE_IF_ERROR";return}if(e.value===void 0&&!t.value){i.value="PENDING";return}if(e.value&&!t.value&&s){i.value="SUCCESS_HAS_DATA";return}if(e.value&&!t.value){i.value="SUCCESS";return}e.value===void 0&&t&&(i.value="ERROR")}),{state:i,swrvState:pe}}const ze={renderer:{noQueryBridge:"No query bridge provided. Unable to render dashboard."},queryDataProvider:{timeRangeExceeded:"The time range for this report is outside of your organization's data retention period"}};function Pe(){const e=B.createI18n("en-us",ze);return{i18n:e,i18nT:B.i18nTComponent(e)}}const de={useI18n:Pe},z=n.defineComponent({__name:"QueryDataProvider",props:{context:{},query:{},queryReady:{type:Boolean}},emits:["queryComplete"],setup(e,{emit:t}){const r=e,o=t,{i18n:i}=de.useI18n(),s=n.inject(U),a=()=>r.queryReady&&s?JSON.stringify([r.query,r.context]):null,c=new AbortController;n.onUnmounted(()=>{c.abort()});const{data:l,error:u,isValidating:h}=Be(a,async()=>{var E,O,x,L;try{const p=[];r.query.filters&&p.push(...r.query.filters),p.push(...r.context.filters);const P={...r.query,time_range:{...r.context.timeSpec,tz:r.context.tz},filters:p};return s==null?void 0:s.queryFn(P,c)}catch(p){y.value=((O=(E=p==null?void 0:p.response)==null?void 0:E.data)==null?void 0:O.message)==="Range not allowed for this tier"?i.t("queryDataProvider.timeRangeExceeded"):((L=(x=p==null?void 0:p.response)==null?void 0:x.data)==null?void 0:L.message)||(p==null?void 0:p.message)}finally{o("queryComplete")}},{refreshInterval:0,revalidateOnFocus:!1}),{state:d,swrvState:m}=Ve(l,u,h),y=n.ref(null),C=n.computed(()=>d.value===m.ERROR||!!y.value),b=n.computed(()=>!r.queryReady||d.value===m.PENDING);return(E,O)=>{const x=n.resolveComponent("KSkeleton"),L=n.resolveComponent("KEmptyState");return b.value||!n.unref(l)&&!C.value?(n.openBlock(),n.createBlock(x,{key:0,class:"chart-skeleton",type:"table"})):C.value?(n.openBlock(),n.createBlock(L,{key:1,"action-button-visible":!1,"data-testid":"chart-empty-state","icon-variant":"error"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(y.value),1)]),_:1})):n.unref(l)?n.renderSlot(E.$slots,"default",{key:2,data:n.unref(l)}):n.createCommentVNode("",!0)}}}),Ue={class:"analytics-chart"},Fe=n.defineComponent({__name:"SimpleChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{}},setup(e){n.useCssVars(i=>({"8c62ff26":`${i.height}px`}));const t=e,r={[_.Gauge]:T.ChartTypesSimple.GAUGE},o=n.computed(()=>({...t.chartOptions,type:r[t.chartOptions.type]}));return(i,s)=>(n.openBlock(),n.createBlock(z,{context:i.context,query:i.query,"query-ready":i.queryReady},{default:n.withCtx(({data:a})=>[n.createElementVNode("div",Ue,[n.createVNode(n.unref(T.SimpleChart),{"chart-data":a,"chart-options":o.value,"synthetics-data-key":i.chartOptions.syntheticsDataKey},null,8,["chart-data","chart-options","synthetics-data-key"])])]),_:1},8,["context","query","query-ready"]))}}),I=(e,t)=>{const r=e.__vccOpts||e;for(const[o,i]of t)r[o]=i;return r},Ke=I(Fe,[["__scopeId","data-v-f0f6ed41"]]),Ge={class:"analytics-chart"},fe=I(n.defineComponent({__name:"BarChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{}},setup(e){n.useCssVars(i=>({"1eed717c":`${i.height}px`}));const t=e,r={[_.HorizontalBar]:T.ChartTypes.HORIZONTAL_BAR,[_.VerticalBar]:T.ChartTypes.VERTICAL_BAR},o=n.computed(()=>({type:r[t.chartOptions.type],stacked:t.chartOptions.stacked,chartDatasetColors:t.chartOptions.chartDatasetColors}));return(i,s)=>(n.openBlock(),n.createBlock(z,{context:i.context,query:i.query,"query-ready":i.queryReady},{default:n.withCtx(({data:a})=>[n.createElementVNode("div",Ge,[n.createVNode(n.unref(T.AnalyticsChart),{"allow-csv-export":i.chartOptions.allowCsvExport,"chart-data":a,"chart-options":o.value,"chart-title":i.chartOptions.chartTitle,"legend-position":"bottom","show-annotations":!1,"synthetics-data-key":i.chartOptions.syntheticsDataKey,"tooltip-title":""},null,8,["allow-csv-export","chart-data","chart-options","chart-title","synthetics-data-key"])])]),_:1},8,["context","query","query-ready"]))}}),[["__scopeId","data-v-36598a1b"]]),He={class:"analytics-chart"},Me=I(n.defineComponent({__name:"TimeseriesChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{}},setup(e){n.useCssVars(i=>({"24c2946a":`${i.height}px`}));const t=e,r={[_.TimeseriesLine]:T.ChartTypes.TIMESERIES_LINE},o=n.computed(()=>{const i=t.chartOptions.stacked??!1;return{type:r[t.chartOptions.type],fill:i,stacked:i,chartDatasetColors:t.chartOptions.chartDatasetColors}});return(i,s)=>(n.openBlock(),n.createBlock(z,{context:i.context,query:i.query,"query-ready":i.queryReady},{default:n.withCtx(({data:a})=>[n.createElementVNode("div",He,[n.createVNode(n.unref(T.AnalyticsChart),{"allow-csv-export":i.chartOptions.allowCsvExport,"chart-data":a,"chart-options":o.value,"chart-title":i.chartOptions.chartTitle,"legend-position":"bottom","synthetics-data-key":i.chartOptions.syntheticsDataKey,"tooltip-title":""},null,8,["allow-csv-export","chart-data","chart-options","chart-title","synthetics-data-key"])])]),_:1},8,["context","query","query-ready"]))}}),[["__scopeId","data-v-93ab34da"]]),Ye={class:"metric-card-tile-wrapper"},Ze=I(n.defineComponent({__name:"GoldenSignalsRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{}},setup(e){const t=e,r=n.computed(()=>{const i=t.context.timeSpec;if(i.type==="absolute")return new j.Timeframe({key:"custom",timeframeText:"custom",display:"custom",startCustom:i.start,endCustom:i.end,timeframeLength:()=>0,defaultResponseGranularity:j.GranularityKeys.DAILY,dataGranularity:j.GranularityKeys.DAILY,isRelative:!1,allowedTiers:["free","plus","enterprise"]});const s=j.TimePeriods.get(i.time_range);if(!s)throw new Error("Unknown time range");return s}),o=n.computed(()=>({overrideTimeframe:r.value,tz:t.context.tz,additionalFilter:t.context.filters,longCardTitles:t.chartOptions.longCardTitles,description:t.chartOptions.description,hasTrendAccess:!0,refreshInterval:0}));return(i,s)=>(n.openBlock(),n.createElementBlock("div",Ye,[n.createVNode(n.unref(J.MetricsProviderInternal),n.normalizeProps(n.guardReactiveProps(o.value)),{default:n.withCtx(()=>[n.createVNode(n.unref(J.MetricsConsumer),{class:"metric-consumer"})]),_:1},16)]))}}),[["__scopeId","data-v-52746db6"]]),ye="20px";var N=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(N||{});function We(){return{getAxiosInstance:(e={})=>{try{const t=n.inject("get-axios-instance",void 0);return typeof t=="function"?t(e):W.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),W.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var t;return((t=e==null?void 0:e.response)==null?void 0:t.headers["x-datadog-trace-id"])||""}}}function Je(){return{debounce:(e,t)=>{let r;return(...o)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...o)},t)}}}}function K(e={}){const{getAxiosInstance:t}=We();return{axiosInstance:t(e)}}const Qe={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},Xe={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},et={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},tt={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},rt={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},nt={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},it={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},ot={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},at={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},st={global:Qe,deleteModal:Xe,baseForm:et,baseTable:tt,baseConfigCard:rt,filter:nt,debouncedFilter:it,errors:ot,toggleModal:at};function G(){const e=B.createI18n("en-us",st);return{i18n:e,i18nT:B.i18nTComponent(e)}}function me(){const e=(r,o)=>(o==null?void 0:o[r])??void 0,t=(r,o)=>{if(r.length!==o.length)return!1;const i=new Set([...r,...o]);for(const s of i){const a=r.filter(l=>l===s).length,c=o.filter(l=>l===s).length;if(a!==c)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,o,i)=>{if(i){if(Object.keys(r).length===Object.keys(o).length)for(const s in r)if(Array.isArray(r[s])&&Array.isArray(o[s])){if(t(r[s],o[s]))continue;return!1}else{if(r[s]===o[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(o)}catch{return!1}},sortAlpha:r=>(o,i)=>{let s=o[r]===void 0||o[r]===null?"":o[r],a=i[r]===void 0||i[r]===null?"":i[r];return Array.isArray(o[r])&&(s=o[r][0]),Array.isArray(i[r])&&(a=i[r][0]),s.localeCompare(a)},isValidUuid:r=>r?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r):!1}}function lt(e,t,r,o={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:i}=K({headers:e.requestHeaders}),{i18n:{t:s}}=G(),{debounce:a}=Je(),c=a(async p=>{await L(p)},200),l=n.ref(!1),u=n.ref(""),h=n.ref(""),d=n.ref([]),m=n.ref([]),y=n.ref(void 0),C=n.unref(t);let b=`${e.apiBaseUrl}${C}`;e.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(b=b.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:E}=me(),O=async()=>{try{l.value=!0;const{data:p}=await i.get(`${b}?size=${r}`);p!=null&&p.next||(y.value=o.fetchedItemsKey in p?p[o.fetchedItemsKey]:[]),m.value=o.fetchedItemsKey in p?p[o.fetchedItemsKey]:[],d.value=m.value}catch{d.value=[],u.value=s("debouncedFilter.errors.fetch")}finally{l.value=!1}},x=n.ref(""),L=async p=>{var P,De,Re;if(x.value!==p)if(x.value=p||"",y.value===void 0)try{if(l.value=!0,u.value="",h.value="",e.app==="konnect"){let w=b+"";p&&(w+=`/${p}`);const{data:S}=await i.get(`${w}?size=${r}`);o.fetchedItemsKey in S?d.value=S[o.fetchedItemsKey]:S!=null&&S.id?d.value=[S]:d.value=[]}else if(p){const w=[];E(p)&&o.searchKeys.includes("id")?w.push((async()=>{const{data:k}=await i.get(`${b}/${p}`);return[k[o.fetchedItemsKey]??k]})()):w.push(...o.searchKeys.filter(k=>k!=="id").map(async k=>{const{data:A}=await i.get(`${b}?${k}=${p}`);return A[o.fetchedItemsKey]}));const S=await Promise.all(w),R=new Set;d.value=[],(P=S==null?void 0:S.forEach)==null||P.call(S,k=>{var A;(A=k==null?void 0:k.forEach)==null||A.call(k,Z=>{R.has(Z.id)||(R.add(Z.id),d.value.push(Z))})})}else d.value=m.value}catch(w){((De=w==null?void 0:w.response)==null?void 0:De.status)===404?h.value=s("debouncedFilter.errors.invalid"):(d.value=[],u.value=s("debouncedFilter.errors.fetch"))}finally{l.value=!1}else l.value=!0,h.value="",p?(d.value=(Re=y.value)==null?void 0:Re.filter(w=>{var S;let R=!1;for(const k of o.searchKeys){const A=typeof w[k]=="string"?(S=w[k])==null?void 0:S.toLowerCase():w[k];A!=null&&A.includes(p.toLowerCase())&&(R=!0)}return R}),(!d.value||!d.value.length)&&(h.value=s("debouncedFilter.errors.invalid"))):d.value=y.value,l.value=!1};return{loading:l,error:u,validationError:h,results:d,allRecords:y,loadItems:O,debouncedQueryChange:c}}function ct(e,t){const r=n.unref(t),o=n.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return o.value.search="",i=>`${o.value.href}/${i}`}function ut(){const{i18n:{t:e}}=G();return{getMessageFromError:t=>{var r,o,i,s;if(!t)return e("errors.unexpected");if(((r=t==null?void 0:t.response)==null?void 0:r.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((o=t==null?void 0:t.response)!=null&&o.data){if(t.response.data.detail)return t.response.data.detail;if((i=t.response.data.details)!=null&&i.length)return t.response.data.details.map(a=>{let c=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(c=a.messages.join(", ")),a.field?`${a.field} - ${c}`:c}).join("; ");if(t.response.data.message){const{message:a}=t.response.data;return Array.isArray(a)?(s=a[0])!=null&&s.constraints?Object.values(a[0].constraints)[0]:a[0]:a}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(a=>`${a} ${t.response.data[a]}`).join(", ")}return t.message||e("errors.unexpected")}}}function pt(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const o=e.join("/"),i=`${r}${o}`,s=e.some(a=>a.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(i)&&!s&&new URL(i))return`${r}${o}`;throw new Error("Invalid url")}catch(o){return console.warn("Failed to build valid URL:",o),""}}function he(e,t){const r=n.ref(n.unref(e)),o=n.ref(n.unref(t)),i=n.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),s=n.computed(()=>o.value.startsWith("/")?new URL(`${window.location.origin}${o.value}`):new URL(o.value));return a=>{const{page:c,pageSize:l,offset:u,sortColumnKey:h,sortColumnOrder:d,query:m}=a;try{let y=new URL(s.value.href);return i.value&&m?(y.search="",y=r.value.isExactMatch?new URL(`${y.href}/${m}/`):new URL(`${y.href}?filter[name][contains]=${m}`)):(i.value||new URLSearchParams(m).forEach((C,b)=>{y.searchParams.append(b,C)}),h&&y.searchParams.append("sort_by",h),d==="desc"&&y.searchParams.append("sort_desc","1"),y.searchParams.append("size",String(l))),u&&c!==1&&y.searchParams.append("offset",String(u)),y.href}catch(y){return console.error("RouteList(fetcher)",y),o.value}}}function dt(e,t,r="data"){const o=n.unref(t),{axiosInstance:i}=K({headers:e.requestHeaders}),s=he(e,o),a=n.ref({status:N.Idle});return{fetcher:async c=>{try{a.value={status:N.Loading};let l=s(c);l.includes("filter[name]")&&(l=`${l}&page[size]=${c.pageSize}&page[number]=${c.page}`);const{data:u}=await i.get(l),h=r&&r.replace(/[^\w-_]/gi,"");let d;u[h]&&Array.isArray(u[h])?d=u[h]:Array.isArray(u)?d=u:d=Object.keys(u).length?[u]:[];const m={data:d,total:d.length,...u.offset?{pagination:{offset:u.offset}}:null};return a.value={status:N.Idle,response:m},m}catch(l){const u={data:[],total:0};return c.query&&l.response.status===404?(a.value={status:N.NoResults,response:u,error:l},u):(a.value={status:N.Error,response:u,error:l},u)}},fetcherState:a}}function ft(){const e=(r,o="_")=>r?r.split(o).map(i=>i.toLowerCase()==="id"?i.toUpperCase():i.charAt(0).toUpperCase()+i.substring(1)).join(" "):"",t=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(t,o=>o.toUpperCase()):"",convertKeyToTitle:e}}const ge=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,_e=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(ge);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},be=e=>e==="*"||e==="x"||e==="X",ke=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},yt=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],mt=(e,t)=>{if(be(e)||be(t))return 0;const[r,o]=yt(ke(e),ke(t));return r>o?1:r<o?-1:0},we=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const o=mt(e[r]||"0",t[r]||"0");if(o!==0)return o}return 0},ht=(e,t)=>{const r=_e(e),o=_e(t),i=r.pop(),s=o.pop(),a=we(r,o);return a!==0?a:i&&s?we(i.split("."),s.split(".")):i||s?i?-1:1:0},Se=(e,t,r)=>{gt(r);const o=ht(e,t);return Te[r].includes(o)},Te={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Ce=Object.keys(Te),gt=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Ce.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Ce.join("|")}`)},_t=e=>typeof e=="string"&&/^[v\d]/.test(e)&&ge.test(e);function bt(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:o,version:i}=t;if(!_t(i))return console.error("Invalid version"),!1;const s=r[o];if(!s)return!1;const[a,c]=s;return!(a&&Se(i,a,"<")||c&&Se(i,c,">"))}function kt(e){const t=n.ref(0),r=n.ref(0),o=n.ref(!1);return n.watch(e,i=>{i&&!o.value&&(t.value=i.offsetWidth,r.value=i.scrollWidth,o.value=!0)}),{isTruncated:n.computed(()=>t.value<r.value)}}const Ee={useAxios:K,useDebouncedFilter:lt,useDeleteUrlBuilder:ct,useErrors:ut,useExternalLinkCreator:pt,useFetcher:dt,useFetchUrlBuilder:he,useHelpers:me,useStringHelpers:ft,useI18n:G,useGatewayFeatureSupported:bt,useTruncationDetector:kt},wt=(e,t)=>{const r=e.__vccOpts||e;for(const[o,i]of t)r[o]=i;return r},St="#0044f4",Tt="16px";/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Ie(e){return typeof e>"u"||e===null}function Ct(e){return typeof e=="object"&&e!==null}function Et(e){return Array.isArray(e)?e:Ie(e)?[]:[e]}function It(e,t){var r,o,i,s;if(t)for(s=Object.keys(t),r=0,o=s.length;r<o;r+=1)i=s[r],e[i]=t[i];return e}function vt(e,t){var r="",o;for(o=0;o<t;o+=1)r+=e;return r}function xt(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var At=Ie,Nt=Ct,qt=Et,Ot=vt,Lt=xt,Dt=It,H={isNothing:At,isObject:Nt,toArray:qt,repeat:Ot,isNegativeZero:Lt,extend:Dt};function ve(e,t){var r="",o=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
2
2
|
|
|
3
|
-
`+e.mark.snippet),o+" "+r):o}function D(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=ve(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}D.prototype=Object.create(Error.prototype),D.prototype.constructor=D,D.prototype.toString=function(e){return this.name+": "+ve(this,e)};var v=D,Rt=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Bt=["scalar","sequence","mapping"];function jt(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(o){t[String(o)]=r})}),t}function $t(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Rt.indexOf(r)===-1)throw new v('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=jt(t.styleAliases||null),Bt.indexOf(this.kind)===-1)throw new v('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var g=$t;function xe(e,t){var r=[];return e[t].forEach(function(o){var i=r.length;r.forEach(function(s,a){s.tag===o.tag&&s.kind===o.kind&&s.multi===o.multi&&(i=a)}),r[i]=o}),r}function
|
|
3
|
+
`+e.mark.snippet),o+" "+r):o}function D(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=ve(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}D.prototype=Object.create(Error.prototype),D.prototype.constructor=D,D.prototype.toString=function(e){return this.name+": "+ve(this,e)};var v=D,Rt=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Bt=["scalar","sequence","mapping"];function jt(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(o){t[String(o)]=r})}),t}function $t(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Rt.indexOf(r)===-1)throw new v('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=jt(t.styleAliases||null),Bt.indexOf(this.kind)===-1)throw new v('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var g=$t;function xe(e,t){var r=[];return e[t].forEach(function(o){var i=r.length;r.forEach(function(s,a){s.tag===o.tag&&s.kind===o.kind&&s.multi===o.multi&&(i=a)}),r[i]=o}),r}function Vt(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function o(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(o);return e}function M(e){return this.extend(e)}M.prototype.extend=function(e){var t=[],r=[];if(e instanceof g)r.push(e);else if(Array.isArray(e))r=r.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(r=r.concat(e.explicit));else throw new v("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(i){if(!(i instanceof g))throw new v("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(i.loadKind&&i.loadKind!=="scalar")throw new v("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(i.multi)throw new v("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(i){if(!(i instanceof g))throw new v("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var o=Object.create(M.prototype);return o.implicit=(this.implicit||[]).concat(t),o.explicit=(this.explicit||[]).concat(r),o.compiledImplicit=xe(o,"implicit"),o.compiledExplicit=xe(o,"explicit"),o.compiledTypeMap=Vt(o.compiledImplicit,o.compiledExplicit),o};var zt=M,Pt=new g("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Ut=new g("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Ft=new g("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Kt=new zt({explicit:[Pt,Ut,Ft]});function Gt(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Ht(){return null}function Mt(e){return e===null}var Yt=new g("tag:yaml.org,2002:null",{kind:"scalar",resolve:Gt,construct:Ht,predicate:Mt,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Zt(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function Wt(e){return e==="true"||e==="True"||e==="TRUE"}function Jt(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Qt=new g("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Zt,construct:Wt,predicate:Jt,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Xt(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function er(e){return 48<=e&&e<=55}function tr(e){return 48<=e&&e<=57}function rr(e){if(e===null)return!1;var t=e.length,r=0,o=!1,i;if(!t)return!1;if(i=e[r],(i==="-"||i==="+")&&(i=e[++r]),i==="0"){if(r+1===t)return!0;if(i=e[++r],i==="b"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(i!=="0"&&i!=="1")return!1;o=!0}return o&&i!=="_"}if(i==="x"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(!Xt(e.charCodeAt(r)))return!1;o=!0}return o&&i!=="_"}if(i==="o"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(!er(e.charCodeAt(r)))return!1;o=!0}return o&&i!=="_"}}if(i==="_")return!1;for(;r<t;r++)if(i=e[r],i!=="_"){if(!tr(e.charCodeAt(r)))return!1;o=!0}return!(!o||i==="_")}function nr(e){var t=e,r=1,o;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),o=t[0],(o==="-"||o==="+")&&(o==="-"&&(r=-1),t=t.slice(1),o=t[0]),t==="0")return 0;if(o==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function ir(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!H.isNegativeZero(e)}var or=new g("tag:yaml.org,2002:int",{kind:"scalar",resolve:rr,construct:nr,predicate:ir,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),ar=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function sr(e){return!(e===null||!ar.test(e)||e[e.length-1]==="_")}function lr(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}var cr=/^[-+]?[0-9]+e/;function ur(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(H.isNegativeZero(e))return"-0.0";return r=e.toString(10),cr.test(r)?r.replace("e",".e"):r}function pr(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||H.isNegativeZero(e))}var dr=new g("tag:yaml.org,2002:float",{kind:"scalar",resolve:sr,construct:lr,predicate:pr,represent:ur,defaultStyle:"lowercase"}),fr=Kt.extend({implicit:[Yt,Qt,or,dr]}),yr=fr,Ae=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ne=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function mr(e){return e===null?!1:Ae.exec(e)!==null||Ne.exec(e)!==null}function hr(e){var t,r,o,i,s,a,c,l=0,u=null,h,d,m;if(t=Ae.exec(e),t===null&&(t=Ne.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],o=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(r,o,i));if(s=+t[4],a=+t[5],c=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(h=+t[10],d=+(t[11]||0),u=(h*60+d)*6e4,t[9]==="-"&&(u=-u)),m=new Date(Date.UTC(r,o,i,s,a,c,l)),u&&m.setTime(m.getTime()-u),m}function gr(e){return e.toISOString()}var _r=new g("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:mr,construct:hr,instanceOf:Date,represent:gr});function br(e){return e==="<<"||e===null}var kr=new g("tag:yaml.org,2002:merge",{kind:"scalar",resolve:br}),Y=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
4
4
|
\r`;function wr(e){if(e===null)return!1;var t,r,o=0,i=e.length,s=Y;for(r=0;r<i;r++)if(t=s.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;o+=6}return o%8===0}function Sr(e){var t,r,o=e.replace(/[\r\n=]/g,""),i=o.length,s=Y,a=0,c=[];for(t=0;t<i;t++)t%4===0&&t&&(c.push(a>>16&255),c.push(a>>8&255),c.push(a&255)),a=a<<6|s.indexOf(o.charAt(t));return r=i%4*6,r===0?(c.push(a>>16&255),c.push(a>>8&255),c.push(a&255)):r===18?(c.push(a>>10&255),c.push(a>>2&255)):r===12&&c.push(a>>4&255),new Uint8Array(c)}function Tr(e){var t="",r=0,o,i,s=e.length,a=Y;for(o=0;o<s;o++)o%3===0&&o&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[o];return i=s%3,i===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):i===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):i===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}function Cr(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Er=new g("tag:yaml.org,2002:binary",{kind:"scalar",resolve:wr,construct:Sr,predicate:Cr,represent:Tr}),Ir=Object.prototype.hasOwnProperty,vr=Object.prototype.toString;function xr(e){if(e===null)return!0;var t=[],r,o,i,s,a,c=e;for(r=0,o=c.length;r<o;r+=1){if(i=c[r],a=!1,vr.call(i)!=="[object Object]")return!1;for(s in i)if(Ir.call(i,s))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}function Ar(e){return e!==null?e:[]}var Nr=new g("tag:yaml.org,2002:omap",{kind:"sequence",resolve:xr,construct:Ar}),qr=Object.prototype.toString;function Or(e){if(e===null)return!0;var t,r,o,i,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(o=a[t],qr.call(o)!=="[object Object]"||(i=Object.keys(o),i.length!==1))return!1;s[t]=[i[0],o[i[0]]]}return!0}function Lr(e){if(e===null)return[];var t,r,o,i,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1)o=a[t],i=Object.keys(o),s[t]=[i[0],o[i[0]]];return s}var Dr=new g("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Or,construct:Lr}),Rr=Object.prototype.hasOwnProperty;function Br(e){if(e===null)return!0;var t,r=e;for(t in r)if(Rr.call(r,t)&&r[t]!==null)return!1;return!0}function jr(e){return e!==null?e:{}}var $r=new g("tag:yaml.org,2002:set",{kind:"mapping",resolve:Br,construct:jr});yr.extend({implicit:[_r,kr],explicit:[Er,Nr,Dr,$r]});function qe(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
5
|
-
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}for(var zr=new Array(256),Vr=new Array(256),q=0;q<256;q++)zr[q]=qe(q)?1:0,Vr[q]=qe(q);const Oe="24px",Pr=(e,t)=>{const r=e.__vccOpts||e;for(const[o,i]of t)r[o]=i;return r},Ur=e=>(n.pushScopeId("data-v-13f41aa3"),e=e(),n.popScopeId(),e),Fr=["aria-hidden"],Kr={key:0,"data-testid":"kui-icon-svg-title"},Gr=Ur(()=>n.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),Hr=n.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Oe,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const i=String(t.size).replace(/px/gi,""),s=Number(i);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Oe}),o=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(i,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:n.normalizeStyle(o.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",Kr,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Gr],8,Fr))]),_:1},8,["aria-hidden","style"]))}}),Mr=Pr(Hr,[["__scopeId","data-v-13f41aa3"]]),Yr={class:"kong-ui-public-entity-link","data-testid":"entity-link-parent"},Zr={key:0,class:"deleted-entity"},Wr={key:1},Jr=["onClick"],Qr=n.defineComponent({__name:"EntityLink",props:{entityLinkData:{type:Object,required:!0},externalLink:{type:String,required:!1,default:""},newWindow:{type:Boolean,required:!1,default:!1},allowCopy:{type:Boolean,required:!1,default:!1}},setup(e){const t=e,r=n.ref(),{isTruncated:o}=Ee.useTruncationDetector(r),{i18n:{t:i}}=Ee.useI18n(),s=i("global.actions.copyId"),a=n.ref(s),c=n.computed(()=>t.entityLinkData.deleted??!1),l=n.computed(()=>t.entityLinkData.id.toString().includes(":")?t.entityLinkData.id.toString().split(":")[1]:t.entityLinkData.id),u=n.computed(()=>`${l.value.toString().slice(0,5)} (deleted)`),h=async d=>{await d(l.value||"")&&(a.value=i("global.actions.copyToClipboard"),setTimeout(()=>{a.value=s},1800))};return(d,m)=>{const y=n.resolveComponent("KTooltip"),C=n.resolveComponent("KExternalLink"),b=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",Yr,[c.value?(n.openBlock(),n.createElementBlock("div",Zr,n.toDisplayString(u.value),1)):l.value?l.value?(n.openBlock(),n.createBlock(C,{key:2,class:"entity-link","hide-icon":!e.newWindow,href:e.externalLink,target:e.newWindow?"_blank":"_self"},{default:n.withCtx(()=>[n.createVNode(y,{text:n.unref(o)&&e.entityLinkData.label||""},{default:n.withCtx(()=>[n.createElementVNode("span",{ref_key:"textContent",ref:r,class:"entity-link-label"},n.toDisplayString(e.entityLinkData.label),513)]),_:1},8,["text"])]),_:1},8,["hide-icon","href","target"])):n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",Wr,n.toDisplayString(" – "))),l.value&&e.allowCopy?(n.openBlock(),n.createBlock(y,{key:a.value,class:"copy-uuid-tooltip","max-width":"160",placement:"bottomEnd",text:a.value},{default:n.withCtx(()=>[n.createVNode(b,null,{default:n.withCtx(({copyToClipboard:E})=>[n.createElementVNode("span",{class:"entity-link-copy-id",onClick:n.withModifiers(O=>h(E),["stop"])},[n.createVNode(n.unref(Mr),{class:"copy-icon",color:n.unref(St),"data-testid":"copy-id",size:n.unref(Tt)},null,8,["color","size"])],8,Jr)]),_:1})]),_:1},8,["text"])):n.createCommentVNode("",!0)])}}}),Xr=wt(Qr,[["__scopeId","data-v-ff8e5179"]]),en=n.defineComponent({__name:"TopNTableRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{}},setup(e){const t=e,r=o=>{var i;if((i=t.chartOptions)!=null&&i.entityLink)if(o.id.includes(":")){const[s,a]=o.id.split(":");return t.chartOptions.entityLink.replace(Q,s).replace(F,a)}else return t.chartOptions.entityLink.replace(F,o.id);return""};return(o,i)=>(n.openBlock(),n.createBlock(V,{context:o.context,query:o.query,"query-ready":o.queryReady},{default:n.withCtx(({data:s})=>[n.createVNode(n.unref(T.TopNTable),{data:s,description:o.chartOptions.description,"synthetics-data-key":o.chartOptions.syntheticsDataKey,title:o.chartOptions.chartTitle||""},n.createSlots({_:2},[t.chartOptions.entityLink?{name:"name",fn:n.withCtx(({record:a})=>[n.createVNode(n.unref(Xr),{"entity-link-data":{id:a.id,label:a.name,deleted:a.deleted},"external-link":r(a)},null,8,["entity-link-data","external-link"])]),key:"0"}:void 0]),1032,["data","description","synthetics-data-key","title"])]),_:1},8,["context","query","query-ready"]))}}),tn={class:"tile-boundary"},rn=I(n.defineComponent({__name:"DashboardTile",props:{definition:{},context:{},height:{default:170}},setup(e){n.useCssVars(s=>({a16bb866:`${s.height}px`}));const t=parseInt(ye,10),r=e,o={[_.TimeseriesLine]:Me,[_.HorizontalBar]:fe,[_.VerticalBar]:fe,[_.Gauge]:Ke,[_.GoldenSignals]:Ze,[_.TopN]:en,[_.Slottable]:void 0},i=n.computed(()=>{const s=o[r.definition.chart.type];return s&&{component:s,rendererProps:{query:r.definition.query,context:r.context,queryReady:!0,chartOptions:r.definition.chart,height:r.height-t*2}}});return(s,a)=>(n.openBlock(),n.createElementBlock("div",tn,[i.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.value.component),n.normalizeProps(n.mergeProps({key:0},i.value.rendererProps)),null,16)):n.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-3d6e352f"]]),Le=I(n.defineComponent({__name:"GridLayout",props:{gridSize:{type:Object,required:!0},tileHeight:{type:Number,required:!1,default:()=>170},tiles:{type:Array,required:!0}},setup(e){n.useCssVars(a=>({"1490bbaa":e.gridSize.cols,"14978e90":e.gridSize.rows,"70cb8937":`${e.tileHeight}px`}));const t=e,r=n.ref(null),o=n.ref(0),i=new ResizeObserver(a=>{o.value=a[0].contentRect.width});n.onMounted(()=>{r.value&&i.observe(r.value)}),n.onUnmounted(()=>{r.value&&i.unobserve(r.value)});const s=n.computed(()=>t.tiles.map((a,c)=>({key:`tile-${c}`,tile:a,style:{"grid-column-start":a.layout.position.col+1,"grid-column-end":a.layout.position.col+1+a.layout.size.cols,"grid-row-start":a.layout.position.row+1,"grid-row-end":a.layout.position.row+1+a.layout.size.rows}})));return(a,c)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"gridContainer",ref:r,class:"kong-ui-public-grid-layout"},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.value,l=>(n.openBlock(),n.createElementBlock("div",{key:l.key,class:n.normalizeClass(["grid-cell",{"empty-cell":!l.tile}]),style:n.normalizeStyle(l.style)},[n.renderSlot(a.$slots,"tile",{style:n.normalizeStyle(l.style),tile:l.tile},void 0,!0)],6))),128))],512))}}),[["__scopeId","data-v-371c2765"]]),nn={class:"kong-ui-public-dashboard-renderer"},on={key:0,class:"tile-container"},an=I(n.defineComponent({__name:"DashboardRenderer",props:{context:{},config:{}},setup(e){const t=e,{i18n:r}=de.useI18n(),o=n.inject(U);o||(console.warn("Analytics dashboards require a query bridge supplied via provide / inject."),console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"),console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/README.md#requirements"));const i=n.computed(()=>t.config.tiles.map((a,c)=>({layout:a.layout,meta:a.definition,id:c}))),s=n.computed(()=>t.context.tz?t.context:{...t.context,tz:new Intl.DateTimeFormat().resolvedOptions().timeZone});return(a,c)=>{const l=n.resolveComponent("KAlert");return n.openBlock(),n.createElementBlock("div",nn,[n.unref(o)?(n.openBlock(),n.createBlock(Le,{key:1,"grid-size":a.config.gridSize,"tile-height":a.config.tileHeight,tiles:i.value},{tile:n.withCtx(({tile:u})=>[u.meta.chart.type===n.unref(_).Slottable?(n.openBlock(),n.createElementBlock("div",on,[n.renderSlot(a.$slots,u.meta.chart.id,{},void 0,!0)])):(n.openBlock(),n.createBlock(rn,{key:1,class:"tile-container",context:s.value,definition:u.meta,height:u.layout.size.rows*(a.config.tileHeight||n.unref(170))+parseInt(n.unref(ye),10)},null,8,["context","definition","height"]))]),_:3},8,["grid-size","tile-height","tiles"])):(n.openBlock(),n.createBlock(l,{key:0,appearance:"danger"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r).t("renderer.noQueryBridge")),1)]),_:1}))])}}}),[["__scopeId","data-v-1af70010"]]);f.CP_ID_TOKEN=Q,f.ChartTypes=_,f.DEFAULT_TILE_HEIGHT=170,f.DashboardRenderer=an,f.ENTITY_ID_TOKEN=F,f.GridLayout=Le,f.INJECT_QUERY_PROVIDER=U,f.barChartSchema=re,f.dashboardConfigSchema=je,f.exploreV4QuerySchema=se,f.gaugeChartSchema=ie,f.metricCardSchema=ae,f.slottableSchema=te,f.tileConfigSchema=ue,f.tileDefinitionSchema=le,f.tileLayoutSchema=ce,f.timeseriesChartSchema=ne,f.topNTableSchema=oe,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
|
5
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}for(var Vr=new Array(256),zr=new Array(256),q=0;q<256;q++)Vr[q]=qe(q)?1:0,zr[q]=qe(q);const Oe="24px",Pr=(e,t)=>{const r=e.__vccOpts||e;for(const[o,i]of t)r[o]=i;return r},Ur=e=>(n.pushScopeId("data-v-13f41aa3"),e=e(),n.popScopeId(),e),Fr=["aria-hidden"],Kr={key:0,"data-testid":"kui-icon-svg-title"},Gr=Ur(()=>n.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),Hr=n.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Oe,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const i=String(t.size).replace(/px/gi,""),s=Number(i);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Oe}),o=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(i,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:n.normalizeStyle(o.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",Kr,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Gr],8,Fr))]),_:1},8,["aria-hidden","style"]))}}),Mr=Pr(Hr,[["__scopeId","data-v-13f41aa3"]]),Yr={class:"kong-ui-public-entity-link","data-testid":"entity-link-parent"},Zr={key:0,class:"deleted-entity"},Wr={key:1},Jr=["onClick"],Qr=n.defineComponent({__name:"EntityLink",props:{entityLinkData:{type:Object,required:!0},externalLink:{type:String,required:!1,default:""},newWindow:{type:Boolean,required:!1,default:!1},allowCopy:{type:Boolean,required:!1,default:!1}},setup(e){const t=e,r=n.ref(),{isTruncated:o}=Ee.useTruncationDetector(r),{i18n:{t:i}}=Ee.useI18n(),s=i("global.actions.copyId"),a=n.ref(s),c=n.computed(()=>t.entityLinkData.deleted??!1),l=n.computed(()=>t.entityLinkData.id.toString().includes(":")?t.entityLinkData.id.toString().split(":")[1]:t.entityLinkData.id),u=n.computed(()=>`${l.value.toString().slice(0,5)} (deleted)`),h=async d=>{await d(l.value||"")&&(a.value=i("global.actions.copyToClipboard"),setTimeout(()=>{a.value=s},1800))};return(d,m)=>{const y=n.resolveComponent("KTooltip"),C=n.resolveComponent("KExternalLink"),b=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",Yr,[c.value?(n.openBlock(),n.createElementBlock("div",Zr,n.toDisplayString(u.value),1)):l.value?l.value?(n.openBlock(),n.createBlock(C,{key:2,class:"entity-link","hide-icon":!e.newWindow,href:e.externalLink,target:e.newWindow?"_blank":"_self"},{default:n.withCtx(()=>[n.createVNode(y,{text:n.unref(o)&&e.entityLinkData.label||""},{default:n.withCtx(()=>[n.createElementVNode("span",{ref_key:"textContent",ref:r,class:"entity-link-label"},n.toDisplayString(e.entityLinkData.label),513)]),_:1},8,["text"])]),_:1},8,["hide-icon","href","target"])):n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",Wr,n.toDisplayString(" – "))),l.value&&e.allowCopy?(n.openBlock(),n.createBlock(y,{key:a.value,class:"copy-uuid-tooltip","max-width":"160",placement:"bottomEnd",text:a.value},{default:n.withCtx(()=>[n.createVNode(b,null,{default:n.withCtx(({copyToClipboard:E})=>[n.createElementVNode("span",{class:"entity-link-copy-id",onClick:n.withModifiers(O=>h(E),["stop"])},[n.createVNode(n.unref(Mr),{class:"copy-icon",color:n.unref(St),"data-testid":"copy-id",size:n.unref(Tt)},null,8,["color","size"])],8,Jr)]),_:1})]),_:1},8,["text"])):n.createCommentVNode("",!0)])}}}),Xr=wt(Qr,[["__scopeId","data-v-ff8e5179"]]),en=n.defineComponent({__name:"TopNTableRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{}},setup(e){const t=e,r=o=>{var i;if((i=t.chartOptions)!=null&&i.entityLink)if(o.id.includes(":")){const[s,a]=o.id.split(":");return t.chartOptions.entityLink.replace(Q,s).replace(F,a)}else return t.chartOptions.entityLink.replace(F,o.id);return""};return(o,i)=>(n.openBlock(),n.createBlock(z,{context:o.context,query:o.query,"query-ready":o.queryReady},{default:n.withCtx(({data:s})=>[n.createVNode(n.unref(T.TopNTable),{data:s,description:o.chartOptions.description,"synthetics-data-key":o.chartOptions.syntheticsDataKey,title:o.chartOptions.chartTitle||""},n.createSlots({_:2},[t.chartOptions.entityLink?{name:"name",fn:n.withCtx(({record:a})=>[n.createVNode(n.unref(Xr),{"entity-link-data":{id:a.id,label:a.name,deleted:a.deleted},"external-link":r(a)},null,8,["entity-link-data","external-link"])]),key:"0"}:void 0]),1032,["data","description","synthetics-data-key","title"])]),_:1},8,["context","query","query-ready"]))}}),tn={class:"tile-boundary"},rn=I(n.defineComponent({__name:"DashboardTile",props:{definition:{},context:{},height:{default:170}},setup(e){n.useCssVars(s=>({a16bb866:`${s.height}px`}));const t=parseInt(ye,10),r=e,o={[_.TimeseriesLine]:Me,[_.HorizontalBar]:fe,[_.VerticalBar]:fe,[_.Gauge]:Ke,[_.GoldenSignals]:Ze,[_.TopN]:en,[_.Slottable]:void 0},i=n.computed(()=>{const s=o[r.definition.chart.type];return s&&{component:s,rendererProps:{query:r.definition.query,context:r.context,queryReady:!0,chartOptions:r.definition.chart,height:r.height-t*2}}});return(s,a)=>(n.openBlock(),n.createElementBlock("div",tn,[i.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.value.component),n.normalizeProps(n.mergeProps({key:0},i.value.rendererProps)),null,16)):n.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-3d6e352f"]]),Le=I(n.defineComponent({__name:"GridLayout",props:{gridSize:{type:Object,required:!0},tileHeight:{type:Number,required:!1,default:()=>170},tiles:{type:Array,required:!0}},setup(e){n.useCssVars(a=>({"1490bbaa":e.gridSize.cols,"14978e90":e.gridSize.rows,"70cb8937":`${e.tileHeight}px`}));const t=e,r=n.ref(null),o=n.ref(0),i=new ResizeObserver(a=>{o.value=a[0].contentRect.width});n.onMounted(()=>{r.value&&i.observe(r.value)}),n.onUnmounted(()=>{r.value&&i.unobserve(r.value)});const s=n.computed(()=>t.tiles.map((a,c)=>({key:`tile-${c}`,tile:a,style:{"grid-column-start":a.layout.position.col+1,"grid-column-end":a.layout.position.col+1+a.layout.size.cols,"grid-row-start":a.layout.position.row+1,"grid-row-end":a.layout.position.row+1+a.layout.size.rows}})));return(a,c)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"gridContainer",ref:r,class:"kong-ui-public-grid-layout"},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.value,l=>(n.openBlock(),n.createElementBlock("div",{key:l.key,class:n.normalizeClass(["grid-cell",{"empty-cell":!l.tile}]),style:n.normalizeStyle(l.style)},[n.renderSlot(a.$slots,"tile",{style:n.normalizeStyle(l.style),tile:l.tile},void 0,!0)],6))),128))],512))}}),[["__scopeId","data-v-371c2765"]]),nn={class:"kong-ui-public-dashboard-renderer"},on={key:0,class:"tile-container"},an=I(n.defineComponent({__name:"DashboardRenderer",props:{context:{},config:{}},setup(e){const t=e,{i18n:r}=de.useI18n(),o=n.inject(U);o||(console.warn("Analytics dashboards require a query bridge supplied via provide / inject."),console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"),console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/README.md#requirements"));const i=n.computed(()=>t.config.tiles.map((a,c)=>({layout:a.layout,meta:a.definition,id:c}))),s=n.computed(()=>t.context.tz?t.context:{...t.context,tz:new Intl.DateTimeFormat().resolvedOptions().timeZone});return(a,c)=>{const l=n.resolveComponent("KAlert");return n.openBlock(),n.createElementBlock("div",nn,[n.unref(o)?(n.openBlock(),n.createBlock(Le,{key:1,"grid-size":a.config.gridSize,"tile-height":a.config.tileHeight,tiles:i.value},{tile:n.withCtx(({tile:u})=>[u.meta.chart.type===n.unref(_).Slottable?(n.openBlock(),n.createElementBlock("div",on,[n.renderSlot(a.$slots,u.meta.chart.id,{},void 0,!0)])):(n.openBlock(),n.createBlock(rn,{key:1,class:"tile-container",context:s.value,definition:u.meta,height:u.layout.size.rows*(a.config.tileHeight||n.unref(170))+parseInt(n.unref(ye),10)},null,8,["context","definition","height"]))]),_:3},8,["grid-size","tile-height","tiles"])):(n.openBlock(),n.createBlock(l,{key:0,appearance:"danger"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r).t("renderer.noQueryBridge")),1)]),_:1}))])}}}),[["__scopeId","data-v-1af70010"]]);f.CP_ID_TOKEN=Q,f.ChartTypes=_,f.DEFAULT_TILE_HEIGHT=170,f.DashboardRenderer=an,f.ENTITY_ID_TOKEN=F,f.GridLayout=Le,f.INJECT_QUERY_PROVIDER=U,f.barChartSchema=re,f.dashboardConfigSchema=je,f.exploreV4QuerySchema=se,f.gaugeChartSchema=ie,f.metricCardSchema=ae,f.slottableSchema=te,f.tileConfigSchema=ue,f.tileDefinitionSchema=le,f.tileLayoutSchema=ce,f.timeseriesChartSchema=ne,f.topNTableSchema=oe,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/dashboard-renderer",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/dashboard-renderer.umd.js",
|
|
6
6
|
"module": "./dist/dashboard-renderer.es.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"vue": "^3.4.21",
|
|
30
30
|
"@kong-ui-public/analytics-chart": "^2.5.0",
|
|
31
31
|
"@kong-ui-public/analytics-metric-provider": "^4.1.7",
|
|
32
|
-
"@kong-ui-public/analytics-utilities": "^1.4.0",
|
|
33
32
|
"@kong-ui-public/i18n": "^2.1.3",
|
|
33
|
+
"@kong-ui-public/analytics-utilities": "^1.4.0",
|
|
34
34
|
"@kong-ui-public/sandbox-layout": "^2.0.43"
|
|
35
35
|
},
|
|
36
36
|
"repository": {
|
|
@@ -55,14 +55,14 @@
|
|
|
55
55
|
"swrv": "^1.0.4",
|
|
56
56
|
"vue": ">= 3.3.13 < 4",
|
|
57
57
|
"@kong-ui-public/analytics-chart": "^2.5.0",
|
|
58
|
-
"@kong-ui-public/analytics-metric-provider": "^4.1.7",
|
|
59
58
|
"@kong-ui-public/analytics-utilities": "^1.4.0",
|
|
59
|
+
"@kong-ui-public/analytics-metric-provider": "^4.1.7",
|
|
60
60
|
"@kong-ui-public/i18n": "^2.1.3"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"ajv": "^8.12.0",
|
|
64
64
|
"@kong-ui-public/core": "^1.5.7",
|
|
65
|
-
"@kong-ui-public/entities-shared": "^2.
|
|
65
|
+
"@kong-ui-public/entities-shared": "^2.11.0"
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
68
68
|
"dev": "cross-env USE_SANDBOX=true vite",
|