@kong-ui-public/entities-consumer-groups 2.3.2 → 2.3.3-pr.1054.75830ca1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as ae, ref as F, computed as x, watch as Te, renderSlot as X, createCommentVNode as z, unref as m, useSlots as ct, onBeforeMount as dt, resolveComponent as q, openBlock as d, createBlock as P, createSlots as je, withCtx as g, createElementVNode as V, createTextVNode as Z, toDisplayString as N, createVNode as E, createElementBlock as j, renderList as ve, Fragment as Ce, normalizeClass as Ee, withModifiers as rt, withDirectives as Je, vShow as Ye, useCssVars as gn, reactive as ot, resolveDynamicComponent as Be, normalizeProps as Cr, guardReactiveProps as kr, mergeProps as bt, onMounted as
|
|
1
|
+
import { defineComponent as ae, ref as F, computed as x, watch as Te, renderSlot as X, createCommentVNode as z, unref as m, useSlots as ct, onBeforeMount as dt, resolveComponent as q, openBlock as d, createBlock as P, createSlots as je, withCtx as g, createElementVNode as V, createTextVNode as Z, toDisplayString as N, createVNode as E, createElementBlock as j, renderList as ve, Fragment as Ce, normalizeClass as Ee, withModifiers as rt, withDirectives as Je, vShow as Ye, useCssVars as gn, reactive as ot, resolveDynamicComponent as Be, normalizeProps as Cr, guardReactiveProps as kr, mergeProps as bt, onMounted as wr, onUnmounted as _r, normalizeStyle as yn, inject as Ir, pushScopeId as hn, popScopeId as vn } from "vue";
|
|
2
2
|
import { useRouter as At } from "vue-router";
|
|
3
3
|
import { createI18n as St, i18nTComponent as bn } from "@kong-ui-public/i18n";
|
|
4
4
|
import Ar from "axios";
|
|
@@ -364,8 +364,8 @@ function Vr(e, n, t, r = {
|
|
|
364
364
|
headers: e.requestHeaders
|
|
365
365
|
}), { i18n: { t: i } } = Tt(), { debounce: a } = jr(), s = a(async (v) => {
|
|
366
366
|
await L(v);
|
|
367
|
-
}, 200), l = F(!1), u = F(""), p = F(""), c = F([]), y = F([]), f = F(void 0),
|
|
368
|
-
let h = `${e.apiBaseUrl}${
|
|
367
|
+
}, 200), l = F(!1), u = F(""), p = F(""), c = F([]), y = F([]), f = F(void 0), _ = m(n);
|
|
368
|
+
let h = `${e.apiBaseUrl}${_}`;
|
|
369
369
|
e.app === "konnect" ? h = h.replace(/{controlPlaneId}/gi, (e == null ? void 0 : e.controlPlaneId) || "") : e.app === "kongManager" && (h = h.replace(/\/{workspace}/gi, e != null && e.workspace ? `/${e.workspace}` : ""));
|
|
370
370
|
const { isValidUuid: A } = kn(), b = async () => {
|
|
371
371
|
try {
|
|
@@ -377,10 +377,10 @@ function Vr(e, n, t, r = {
|
|
|
377
377
|
} finally {
|
|
378
378
|
l.value = !1;
|
|
379
379
|
}
|
|
380
|
-
},
|
|
380
|
+
}, w = F(""), L = async (v) => {
|
|
381
381
|
var S, D, re;
|
|
382
|
-
if (
|
|
383
|
-
if (
|
|
382
|
+
if (w.value !== v)
|
|
383
|
+
if (w.value = v || "", f.value === void 0)
|
|
384
384
|
try {
|
|
385
385
|
if (l.value = !0, u.value = "", p.value = "", e.app === "konnect") {
|
|
386
386
|
let R = h + "";
|
|
@@ -443,25 +443,27 @@ function Gr() {
|
|
|
443
443
|
const { i18n: { t: e } } = Tt();
|
|
444
444
|
return {
|
|
445
445
|
getMessageFromError: (n) => {
|
|
446
|
-
var t, r, o;
|
|
446
|
+
var t, r, o, i;
|
|
447
447
|
if (!n)
|
|
448
448
|
return e("errors.unexpected");
|
|
449
|
-
if ((t = n == null ? void 0 : n.response)
|
|
449
|
+
if (((t = n == null ? void 0 : n.response) == null ? void 0 : t.status) === 401)
|
|
450
|
+
return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."), "";
|
|
451
|
+
if ((r = n == null ? void 0 : n.response) != null && r.data) {
|
|
450
452
|
if (n.response.data.detail)
|
|
451
453
|
return n.response.data.detail;
|
|
452
|
-
if ((
|
|
453
|
-
return n.response.data.details.map((
|
|
454
|
-
let
|
|
455
|
-
return
|
|
454
|
+
if ((o = n.response.data.details) != null && o.length)
|
|
455
|
+
return n.response.data.details.map((a) => {
|
|
456
|
+
let s = e("errors.unexpected");
|
|
457
|
+
return a.messages && typeof a.messages == "object" && a.messages.length && (s = a.messages.join(", ")), a.field ? `${a.field} - ${s}` : s;
|
|
456
458
|
}).join("; ");
|
|
457
459
|
if (n.response.data.message) {
|
|
458
|
-
const { message:
|
|
459
|
-
return Array.isArray(
|
|
460
|
+
const { message: a } = n.response.data;
|
|
461
|
+
return Array.isArray(a) ? (i = a[0]) != null && i.constraints ? Object.values(a[0].constraints)[0] : a[0] : a;
|
|
460
462
|
}
|
|
461
463
|
if (typeof n.response.data == "string")
|
|
462
464
|
return n.response.data;
|
|
463
465
|
if (typeof n.response.data == "object")
|
|
464
|
-
return Object.keys(n.response.data).map((
|
|
466
|
+
return Object.keys(n.response.data).map((a) => `${a} ${n.response.data[a]}`).join(", ");
|
|
465
467
|
}
|
|
466
468
|
return n.message || e("errors.unexpected");
|
|
467
469
|
}
|
|
@@ -478,7 +480,7 @@ function Hr(e) {
|
|
|
478
480
|
return console.warn("Failed to build valid URL:", r), "";
|
|
479
481
|
}
|
|
480
482
|
}
|
|
481
|
-
function
|
|
483
|
+
function wn(e, n) {
|
|
482
484
|
const t = F(m(e)), r = F(m(n)), o = x(
|
|
483
485
|
() => !!(t.value.app === "konnect" || t.value.isExactMatch)
|
|
484
486
|
), i = x(
|
|
@@ -488,8 +490,8 @@ function _n(e, n) {
|
|
|
488
490
|
const { page: s, pageSize: l, offset: u, sortColumnKey: p, sortColumnOrder: c, query: y } = a;
|
|
489
491
|
try {
|
|
490
492
|
let f = new URL(i.value.href);
|
|
491
|
-
return o.value && y ? (f.search = "", f = t.value.app === "konnect" ? new URL(`${f.href}?filter[name][contains]=${y}`) : new URL(`${f.href}/${y}/`)) : (o.value || new URLSearchParams(y).forEach((
|
|
492
|
-
f.searchParams.append(h,
|
|
493
|
+
return o.value && y ? (f.search = "", f = t.value.app === "konnect" ? new URL(`${f.href}?filter[name][contains]=${y}`) : new URL(`${f.href}/${y}/`)) : (o.value || new URLSearchParams(y).forEach((_, h) => {
|
|
494
|
+
f.searchParams.append(h, _);
|
|
493
495
|
}), p && f.searchParams.append("sort_by", p), c === "desc" && f.searchParams.append("sort_desc", "1"), f.searchParams.append("size", String(l))), u && s !== 1 && f.searchParams.append("offset", String(u)), f.href;
|
|
494
496
|
} catch (f) {
|
|
495
497
|
return console.error("RouteList(fetcher)", f), r.value;
|
|
@@ -499,7 +501,7 @@ function _n(e, n) {
|
|
|
499
501
|
function zr(e, n, t = "data") {
|
|
500
502
|
const r = m(n), { axiosInstance: o } = xt({
|
|
501
503
|
headers: e.requestHeaders
|
|
502
|
-
}), i =
|
|
504
|
+
}), i = wn(e, r), a = F({
|
|
503
505
|
status: Ke.Idle
|
|
504
506
|
});
|
|
505
507
|
return { fetcher: async (s) => {
|
|
@@ -547,10 +549,10 @@ function Jr() {
|
|
|
547
549
|
convertKeyToTitle: e
|
|
548
550
|
};
|
|
549
551
|
}
|
|
550
|
-
const
|
|
552
|
+
const _n = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, Dt = (e) => {
|
|
551
553
|
if (typeof e != "string")
|
|
552
554
|
throw new TypeError("Invalid argument expected string");
|
|
553
|
-
const n = e.match(
|
|
555
|
+
const n = e.match(_n);
|
|
554
556
|
if (!n)
|
|
555
557
|
throw new Error(`Invalid argument not valid semver ('${e}' received)`);
|
|
556
558
|
return n.shift(), n;
|
|
@@ -588,7 +590,7 @@ const wn = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-(
|
|
|
588
590
|
throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);
|
|
589
591
|
if (zt.indexOf(e) === -1)
|
|
590
592
|
throw new Error(`Invalid operator, expected one of ${zt.join("|")}`);
|
|
591
|
-
}, Xr = (e) => typeof e == "string" && /^[v\d]/.test(e) &&
|
|
593
|
+
}, Xr = (e) => typeof e == "string" && /^[v\d]/.test(e) && _n.test(e);
|
|
592
594
|
function eo(e) {
|
|
593
595
|
const { gatewayInfo: n, supportedRange: t } = e;
|
|
594
596
|
if (!n)
|
|
@@ -617,7 +619,7 @@ const ce = {
|
|
|
617
619
|
useErrors: Gr,
|
|
618
620
|
useExternalLinkCreator: Hr,
|
|
619
621
|
useFetcher: zr,
|
|
620
|
-
useFetchUrlBuilder:
|
|
622
|
+
useFetchUrlBuilder: wn,
|
|
621
623
|
useHelpers: kn,
|
|
622
624
|
useStringHelpers: Jr,
|
|
623
625
|
useI18n: Tt,
|
|
@@ -800,7 +802,7 @@ const ce = {
|
|
|
800
802
|
l.value = r.tooltip;
|
|
801
803
|
}, 1800);
|
|
802
804
|
}, y = (f) => {
|
|
803
|
-
var
|
|
805
|
+
var _, h;
|
|
804
806
|
if (!f(r.uuid)) {
|
|
805
807
|
typeof i == "function" && i({
|
|
806
808
|
type: "error",
|
|
@@ -808,13 +810,13 @@ const ce = {
|
|
|
808
810
|
}), s.value ? c(t("message.fail")) : o("error", r.uuid);
|
|
809
811
|
return;
|
|
810
812
|
}
|
|
811
|
-
const A = ((
|
|
813
|
+
const A = ((_ = r.uuid) == null ? void 0 : _.length) > Yt, b = r.format === "hidden" || r.format === "redacted" ? t("message.success.prefix") : `"${((h = r.uuid) == null ? void 0 : h.substring(0, Yt)) + (A ? "..." : "")}"`;
|
|
812
814
|
typeof i == "function" && i({
|
|
813
815
|
type: "success",
|
|
814
816
|
message: `${b}${t("message.success.content")}`
|
|
815
817
|
}), s.value ? c(r.successTooltip) : o("success", r.uuid);
|
|
816
818
|
};
|
|
817
|
-
return (f,
|
|
819
|
+
return (f, _) => {
|
|
818
820
|
const h = q("KClipboardProvider");
|
|
819
821
|
return d(), j("div", go, [
|
|
820
822
|
e.format !== "hidden" ? (d(), P(Be(e.idTooltip ? "KTooltip" : "div"), bt({ key: 0 }, a.value, { "data-testid": "copy-id" }), {
|
|
@@ -907,12 +909,12 @@ const ce = {
|
|
|
907
909
|
_: 1
|
|
908
910
|
}, 8, ["class"]));
|
|
909
911
|
}
|
|
910
|
-
}),
|
|
912
|
+
}), we = (e, n) => {
|
|
911
913
|
const t = e.__vccOpts || e;
|
|
912
914
|
for (const [r, o] of n)
|
|
913
915
|
t[r] = o;
|
|
914
916
|
return t;
|
|
915
|
-
}, Sn = /* @__PURE__ */
|
|
917
|
+
}, Sn = /* @__PURE__ */ we(Co, [["__scopeId", "data-v-68ca83ec"]]), ko = /* @__PURE__ */ ae({
|
|
916
918
|
__name: "InternalLinkItem",
|
|
917
919
|
props: {
|
|
918
920
|
item: {
|
|
@@ -939,7 +941,7 @@ const ce = {
|
|
|
939
941
|
]);
|
|
940
942
|
};
|
|
941
943
|
}
|
|
942
|
-
}),
|
|
944
|
+
}), wo = /* @__PURE__ */ we(ko, [["__scopeId", "data-v-c96811e5"]]), _o = /* @__PURE__ */ ae({
|
|
943
945
|
__name: "StatusBadge",
|
|
944
946
|
props: {
|
|
945
947
|
status: {
|
|
@@ -963,7 +965,7 @@ const ce = {
|
|
|
963
965
|
}
|
|
964
966
|
}), Io = "#0044f4", Ao = "#e0e4ea", So = "#3a3f51", xo = "1px", To = "20px", $o = { class: "config-card-details-row" }, jo = ["data-testid"], Mo = ["data-testid"], Oo = ["data-testid"], Eo = ["data-testid"], Fo = { key: 1 }, No = ["data-testid"], Ko = ["data-testid"], qo = ["data-testid"], Bo = ["data-testid"], Lo = {
|
|
965
967
|
name: "ConfigCardItem",
|
|
966
|
-
components: { CopyUuid: An, JsonCardItem: Sn, StatusBadge:
|
|
968
|
+
components: { CopyUuid: An, JsonCardItem: Sn, StatusBadge: _o, InternalLinkItem: wo }
|
|
967
969
|
}, Uo = /* @__PURE__ */ ae({
|
|
968
970
|
...Lo,
|
|
969
971
|
props: {
|
|
@@ -984,7 +986,7 @@ const ce = {
|
|
|
984
986
|
},
|
|
985
987
|
emits: ["navigation-click"],
|
|
986
988
|
setup(e, { emit: n }) {
|
|
987
|
-
gn((
|
|
989
|
+
gn((_) => ({
|
|
988
990
|
"0da74440": p.value ? "none" : `solid ${m(xo)} ${m(Ao)}`,
|
|
989
991
|
"02a039da": u.value && s.value ? "block" : "flex",
|
|
990
992
|
"690f3ced": u.value && s.value ? "100%" : t.slim ? "50%" : "25%",
|
|
@@ -1076,8 +1078,8 @@ const ce = {
|
|
|
1076
1078
|
attrs: {
|
|
1077
1079
|
"data-testid": `${t.item.key}-internal-link`,
|
|
1078
1080
|
item: t.item,
|
|
1079
|
-
onNavigationClick: (
|
|
1080
|
-
r("navigation-click",
|
|
1081
|
+
onNavigationClick: (_) => {
|
|
1082
|
+
r("navigation-click", _);
|
|
1081
1083
|
}
|
|
1082
1084
|
}
|
|
1083
1085
|
};
|
|
@@ -1117,14 +1119,14 @@ const ce = {
|
|
|
1117
1119
|
};
|
|
1118
1120
|
}
|
|
1119
1121
|
}), y = F(), { isTruncated: f } = ce.useTruncationDetector(y);
|
|
1120
|
-
return (
|
|
1121
|
-
const A = q("KLabel"), b = q("KBadge"),
|
|
1122
|
+
return (_, h) => {
|
|
1123
|
+
const A = q("KLabel"), b = q("KBadge"), w = q("KTooltip");
|
|
1122
1124
|
return d(), j("div", $o, [
|
|
1123
1125
|
V("div", {
|
|
1124
1126
|
class: "config-card-details-label",
|
|
1125
1127
|
"data-testid": `${e.item.key}-label`
|
|
1126
1128
|
}, [
|
|
1127
|
-
X(
|
|
1129
|
+
X(_.$slots, "label", { item: e.item }, () => [
|
|
1128
1130
|
E(A, { "tooltip-attributes": { maxWidth: "500px" } }, je({
|
|
1129
1131
|
default: g(() => [
|
|
1130
1132
|
Z(N(e.item.label) + " ", 1)
|
|
@@ -1137,7 +1139,7 @@ const ce = {
|
|
|
1137
1139
|
V("div", {
|
|
1138
1140
|
"data-testid": `${e.item.key}-label-tooltip`
|
|
1139
1141
|
}, [
|
|
1140
|
-
X(
|
|
1142
|
+
X(_.$slots, "label-tooltip", {}, () => [
|
|
1141
1143
|
Z(N(e.item.tooltip), 1)
|
|
1142
1144
|
], !0)
|
|
1143
1145
|
], 8, Mo)
|
|
@@ -1151,7 +1153,7 @@ const ce = {
|
|
|
1151
1153
|
class: "config-card-details-value",
|
|
1152
1154
|
"data-testid": `${e.item.key}-property-value`
|
|
1153
1155
|
}, [
|
|
1154
|
-
X(
|
|
1156
|
+
X(_.$slots, e.item.key, {
|
|
1155
1157
|
rowValue: e.item.value
|
|
1156
1158
|
}, () => [
|
|
1157
1159
|
s.value ? (d(), j("div", Fo, [
|
|
@@ -1211,7 +1213,7 @@ const ce = {
|
|
|
1211
1213
|
"is-array-item": "",
|
|
1212
1214
|
item: L
|
|
1213
1215
|
}, null, 8, ["index", "item"]))), 128))
|
|
1214
|
-
], 8, Bo)) : (d(), P(
|
|
1216
|
+
], 8, Bo)) : (d(), P(w, {
|
|
1215
1217
|
key: 4,
|
|
1216
1218
|
label: m(f) ? e.item.value : ""
|
|
1217
1219
|
}, {
|
|
@@ -1236,7 +1238,7 @@ const ce = {
|
|
|
1236
1238
|
]);
|
|
1237
1239
|
};
|
|
1238
1240
|
}
|
|
1239
|
-
}), $t = /* @__PURE__ */
|
|
1241
|
+
}), $t = /* @__PURE__ */ we(Uo, [["__scopeId", "data-v-9c87856b"]]), Po = { class: "json-config" }, Do = {
|
|
1240
1242
|
key: 0,
|
|
1241
1243
|
class: "json-endpoint"
|
|
1242
1244
|
}, xn = /* @__PURE__ */ ae({
|
|
@@ -1693,8 +1695,8 @@ function ka(e) {
|
|
|
1693
1695
|
var n, t;
|
|
1694
1696
|
return n = e.replace(/_/g, "").toLowerCase(), t = n[0] === "-" ? -1 : 1, "+-".indexOf(n[0]) >= 0 && (n = n.slice(1)), n === ".inf" ? t === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : n === ".nan" ? NaN : t * parseFloat(n, 10);
|
|
1695
1697
|
}
|
|
1696
|
-
var
|
|
1697
|
-
function
|
|
1698
|
+
var wa = /^[-+]?[0-9]+e/;
|
|
1699
|
+
function _a(e, n) {
|
|
1698
1700
|
var t;
|
|
1699
1701
|
if (isNaN(e))
|
|
1700
1702
|
switch (n) {
|
|
@@ -1725,7 +1727,7 @@ function wa(e, n) {
|
|
|
1725
1727
|
}
|
|
1726
1728
|
else if (ue.isNegativeZero(e))
|
|
1727
1729
|
return "-0.0";
|
|
1728
|
-
return t = e.toString(10),
|
|
1730
|
+
return t = e.toString(10), wa.test(t) ? t.replace("e", ".e") : t;
|
|
1729
1731
|
}
|
|
1730
1732
|
function Ia(e) {
|
|
1731
1733
|
return Object.prototype.toString.call(e) === "[object Number]" && (e % 1 !== 0 || ue.isNegativeZero(e));
|
|
@@ -1735,7 +1737,7 @@ var Bn = new pe("tag:yaml.org,2002:float", {
|
|
|
1735
1737
|
resolve: Ca,
|
|
1736
1738
|
construct: ka,
|
|
1737
1739
|
predicate: Ia,
|
|
1738
|
-
represent:
|
|
1740
|
+
represent: _a,
|
|
1739
1741
|
defaultStyle: "lowercase"
|
|
1740
1742
|
}), Ln = Fn.extend({
|
|
1741
1743
|
implicit: [
|
|
@@ -2103,17 +2105,17 @@ function ei(e, n) {
|
|
|
2103
2105
|
M(e, "unexpected end of the stream within a double quoted scalar");
|
|
2104
2106
|
}
|
|
2105
2107
|
function ti(e, n) {
|
|
2106
|
-
var t = !0, r, o, i, a = e.tag, s, l = e.anchor, u, p, c, y, f,
|
|
2107
|
-
if (
|
|
2108
|
+
var t = !0, r, o, i, a = e.tag, s, l = e.anchor, u, p, c, y, f, _ = /* @__PURE__ */ Object.create(null), h, A, b, w;
|
|
2109
|
+
if (w = e.input.charCodeAt(e.position), w === 91)
|
|
2108
2110
|
p = 93, f = !1, s = [];
|
|
2109
|
-
else if (
|
|
2111
|
+
else if (w === 123)
|
|
2110
2112
|
p = 125, f = !0, s = {};
|
|
2111
2113
|
else
|
|
2112
2114
|
return !1;
|
|
2113
|
-
for (e.anchor !== null && (e.anchorMap[e.anchor] = s),
|
|
2114
|
-
if (le(e, !0, n),
|
|
2115
|
+
for (e.anchor !== null && (e.anchorMap[e.anchor] = s), w = e.input.charCodeAt(++e.position); w !== 0; ) {
|
|
2116
|
+
if (le(e, !0, n), w = e.input.charCodeAt(e.position), w === p)
|
|
2115
2117
|
return e.position++, e.tag = a, e.anchor = l, e.kind = f ? "mapping" : "sequence", e.result = s, !0;
|
|
2116
|
-
t ?
|
|
2118
|
+
t ? w === 44 && M(e, "expected the node content, but found ','") : M(e, "missed comma between flow collection entries"), A = h = b = null, c = y = !1, w === 63 && (u = e.input.charCodeAt(e.position + 1), be(u) && (c = y = !0, e.position++, le(e, !0, n))), r = e.line, o = e.lineStart, i = e.position, Ge(e, n, at, !1, !0), A = e.tag, h = e.result, le(e, !0, n), w = e.input.charCodeAt(e.position), (y || e.line === r) && w === 58 && (c = !0, w = e.input.charCodeAt(++e.position), le(e, !0, n), Ge(e, n, at, !1, !0), b = e.result), f ? Re(e, s, _, A, h, b, r, o, i) : c ? s.push(Re(e, null, _, A, h, b, r, o, i)) : s.push(h), le(e, !0, n), w = e.input.charCodeAt(e.position), w === 44 ? (t = !0, w = e.input.charCodeAt(++e.position)) : t = !1;
|
|
2117
2119
|
}
|
|
2118
2120
|
M(e, "unexpected end of the stream within a flow collection");
|
|
2119
2121
|
}
|
|
@@ -2181,20 +2183,20 @@ function nn(e, n) {
|
|
|
2181
2183
|
return s ? (e.tag = r, e.anchor = o, e.kind = "sequence", e.result = i, !0) : !1;
|
|
2182
2184
|
}
|
|
2183
2185
|
function ri(e, n, t) {
|
|
2184
|
-
var r, o, i, a, s, l, u = e.tag, p = e.anchor, c = {}, y = /* @__PURE__ */ Object.create(null), f = null,
|
|
2186
|
+
var r, o, i, a, s, l, u = e.tag, p = e.anchor, c = {}, y = /* @__PURE__ */ Object.create(null), f = null, _ = null, h = null, A = !1, b = !1, w;
|
|
2185
2187
|
if (e.firstTabInLine !== -1)
|
|
2186
2188
|
return !1;
|
|
2187
|
-
for (e.anchor !== null && (e.anchorMap[e.anchor] = c),
|
|
2188
|
-
if (!A && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, M(e, "tab characters must not be used in indentation")), r = e.input.charCodeAt(e.position + 1), i = e.line, (
|
|
2189
|
-
|
|
2189
|
+
for (e.anchor !== null && (e.anchorMap[e.anchor] = c), w = e.input.charCodeAt(e.position); w !== 0; ) {
|
|
2190
|
+
if (!A && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, M(e, "tab characters must not be used in indentation")), r = e.input.charCodeAt(e.position + 1), i = e.line, (w === 63 || w === 58) && be(r))
|
|
2191
|
+
w === 63 ? (A && (Re(e, c, y, f, _, null, a, s, l), f = _ = h = null), b = !0, A = !0, o = !0) : A ? (A = !1, o = !0) : M(e, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), e.position += 1, w = r;
|
|
2190
2192
|
else {
|
|
2191
2193
|
if (a = e.line, s = e.lineStart, l = e.position, !Ge(e, t, Yn, !1, !0))
|
|
2192
2194
|
break;
|
|
2193
2195
|
if (e.line === i) {
|
|
2194
|
-
for (
|
|
2195
|
-
|
|
2196
|
-
if (
|
|
2197
|
-
|
|
2196
|
+
for (w = e.input.charCodeAt(e.position); qe(w); )
|
|
2197
|
+
w = e.input.charCodeAt(++e.position);
|
|
2198
|
+
if (w === 58)
|
|
2199
|
+
w = e.input.charCodeAt(++e.position), be(w) || M(e, "a whitespace character is expected after the key-value separator within a block mapping"), A && (Re(e, c, y, f, _, null, a, s, l), f = _ = h = null), b = !0, A = !1, o = !1, f = e.tag, _ = e.result;
|
|
2198
2200
|
else if (b)
|
|
2199
2201
|
M(e, "can not read an implicit mapping pair; a colon is missed");
|
|
2200
2202
|
else
|
|
@@ -2204,12 +2206,12 @@ function ri(e, n, t) {
|
|
|
2204
2206
|
else
|
|
2205
2207
|
return e.tag = u, e.anchor = p, !0;
|
|
2206
2208
|
}
|
|
2207
|
-
if ((e.line === i || e.lineIndent > n) && (A && (a = e.line, s = e.lineStart, l = e.position), Ge(e, n, it, !0, o) && (A ?
|
|
2209
|
+
if ((e.line === i || e.lineIndent > n) && (A && (a = e.line, s = e.lineStart, l = e.position), Ge(e, n, it, !0, o) && (A ? _ = e.result : h = e.result), A || (Re(e, c, y, f, _, h, a, s, l), f = _ = h = null), le(e, !0, -1), w = e.input.charCodeAt(e.position)), (e.line === i || e.lineIndent > n) && w !== 0)
|
|
2208
2210
|
M(e, "bad indentation of a mapping entry");
|
|
2209
2211
|
else if (e.lineIndent < n)
|
|
2210
2212
|
break;
|
|
2211
2213
|
}
|
|
2212
|
-
return A && Re(e, c, y, f,
|
|
2214
|
+
return A && Re(e, c, y, f, _, null, a, s, l), b && (e.tag = u, e.anchor = p, e.kind = "mapping", e.result = c), b;
|
|
2213
2215
|
}
|
|
2214
2216
|
function oi(e) {
|
|
2215
2217
|
var n, t = !1, r = !1, o, i, a;
|
|
@@ -2250,7 +2252,7 @@ function ii(e) {
|
|
|
2250
2252
|
return e.position === n && M(e, "name of an alias node must contain at least one character"), t = e.input.slice(n, e.position), Fe.call(e.anchorMap, t) || M(e, 'unidentified alias "' + t + '"'), e.result = e.anchorMap[t], le(e, !0, -1), !0;
|
|
2251
2253
|
}
|
|
2252
2254
|
function Ge(e, n, t, r, o) {
|
|
2253
|
-
var i, a, s, l = 1, u = !1, p = !1, c, y, f,
|
|
2255
|
+
var i, a, s, l = 1, u = !1, p = !1, c, y, f, _, h, A;
|
|
2254
2256
|
if (e.listener !== null && e.listener("open", e), e.tag = null, e.anchor = null, e.kind = null, e.result = null, i = a = s = it === t || Wn === t, r && le(e, !0, -1) && (u = !0, e.lineIndent > n ? l = 1 : e.lineIndent === n ? l = 0 : e.lineIndent < n && (l = -1)), l === 1)
|
|
2255
2257
|
for (; oi(e) || ai(e); )
|
|
2256
2258
|
le(e, !0, -1) ? (u = !0, s = i, e.lineIndent > n ? l = 1 : e.lineIndent === n ? l = 0 : e.lineIndent < n && (l = -1)) : s = !1;
|
|
@@ -2258,20 +2260,20 @@ function Ge(e, n, t, r, o) {
|
|
|
2258
2260
|
e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
|
|
2259
2261
|
else if (e.tag === "?") {
|
|
2260
2262
|
for (e.result !== null && e.kind !== "scalar" && M(e, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + e.kind + '"'), c = 0, y = e.implicitTypes.length; c < y; c += 1)
|
|
2261
|
-
if (
|
|
2262
|
-
e.result =
|
|
2263
|
+
if (_ = e.implicitTypes[c], _.resolve(e.result)) {
|
|
2264
|
+
e.result = _.construct(e.result), e.tag = _.tag, e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
|
|
2263
2265
|
break;
|
|
2264
2266
|
}
|
|
2265
2267
|
} else if (e.tag !== "!") {
|
|
2266
2268
|
if (Fe.call(e.typeMap[e.kind || "fallback"], e.tag))
|
|
2267
|
-
|
|
2269
|
+
_ = e.typeMap[e.kind || "fallback"][e.tag];
|
|
2268
2270
|
else
|
|
2269
|
-
for (
|
|
2271
|
+
for (_ = null, f = e.typeMap.multi[e.kind || "fallback"], c = 0, y = f.length; c < y; c += 1)
|
|
2270
2272
|
if (e.tag.slice(0, f[c].tag.length) === f[c].tag) {
|
|
2271
|
-
|
|
2273
|
+
_ = f[c];
|
|
2272
2274
|
break;
|
|
2273
2275
|
}
|
|
2274
|
-
|
|
2276
|
+
_ || M(e, "unknown tag !<" + e.tag + ">"), e.result !== null && _.kind !== e.kind && M(e, "unacceptable node kind for !<" + e.tag + '> tag; it should be "' + _.kind + '", not "' + e.kind + '"'), _.resolve(e.result, e.tag) ? (e.result = _.construct(e.result, e.tag), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : M(e, "cannot resolve a node with !<" + e.tag + "> explicit tag");
|
|
2275
2277
|
}
|
|
2276
2278
|
return e.listener !== null && e.listener("close", e), e.tag !== null || e.anchor !== null || p;
|
|
2277
2279
|
}
|
|
@@ -2335,7 +2337,7 @@ function ui(e, n) {
|
|
|
2335
2337
|
var ci = li, di = ui, rr = {
|
|
2336
2338
|
loadAll: ci,
|
|
2337
2339
|
load: di
|
|
2338
|
-
}, or = Object.prototype.toString, ar = Object.prototype.hasOwnProperty, Ft = 65279, pi = 9, Ze = 10, fi = 13, mi = 32, gi = 33, yi = 34, kt = 35, hi = 37, vi = 38, bi = 39, Ci = 42, ir = 44, ki = 45, lt = 58,
|
|
2340
|
+
}, or = Object.prototype.toString, ar = Object.prototype.hasOwnProperty, Ft = 65279, pi = 9, Ze = 10, fi = 13, mi = 32, gi = 33, yi = 34, kt = 35, hi = 37, vi = 38, bi = 39, Ci = 42, ir = 44, ki = 45, lt = 58, wi = 61, _i = 62, Ii = 63, Ai = 64, sr = 91, lr = 93, Si = 96, ur = 123, xi = 124, cr = 125, ge = {};
|
|
2339
2341
|
ge[0] = "\\0";
|
|
2340
2342
|
ge[7] = "\\a";
|
|
2341
2343
|
ge[8] = "\\b";
|
|
@@ -2400,7 +2402,7 @@ function rn(e, n) {
|
|
|
2400
2402
|
` && (i += t), i += a;
|
|
2401
2403
|
return i;
|
|
2402
2404
|
}
|
|
2403
|
-
function
|
|
2405
|
+
function wt(e, n) {
|
|
2404
2406
|
return `
|
|
2405
2407
|
` + ue.repeat(" ", e.indent * n);
|
|
2406
2408
|
}
|
|
@@ -2431,7 +2433,7 @@ function an(e, n, t) {
|
|
|
2431
2433
|
);
|
|
2432
2434
|
}
|
|
2433
2435
|
function Ni(e) {
|
|
2434
|
-
return Xe(e) && e !== Ft && !ut(e) && e !== ki && e !== Ii && e !== lt && e !== ir && e !== sr && e !== lr && e !== ur && e !== cr && e !== kt && e !== vi && e !== Ci && e !== gi && e !== xi && e !==
|
|
2436
|
+
return Xe(e) && e !== Ft && !ut(e) && e !== ki && e !== Ii && e !== lt && e !== ir && e !== sr && e !== lr && e !== ur && e !== cr && e !== kt && e !== vi && e !== Ci && e !== gi && e !== xi && e !== wi && e !== _i && e !== bi && e !== yi && e !== hi && e !== Ai && e !== Si;
|
|
2435
2437
|
}
|
|
2436
2438
|
function Ki(e) {
|
|
2437
2439
|
return !ut(e) && e !== lt;
|
|
@@ -2444,9 +2446,9 @@ function dr(e) {
|
|
|
2444
2446
|
var n = /^\n* /;
|
|
2445
2447
|
return n.test(e);
|
|
2446
2448
|
}
|
|
2447
|
-
var pr = 1,
|
|
2449
|
+
var pr = 1, _t = 2, fr = 3, mr = 4, De = 5;
|
|
2448
2450
|
function qi(e, n, t, r, o, i, a, s) {
|
|
2449
|
-
var l, u = 0, p = null, c = !1, y = !1, f = r !== -1,
|
|
2451
|
+
var l, u = 0, p = null, c = !1, y = !1, f = r !== -1, _ = -1, h = Ni(ze(e, 0)) && Ki(ze(e, e.length - 1));
|
|
2450
2452
|
if (n || a)
|
|
2451
2453
|
for (l = 0; l < e.length; u >= 65536 ? l += 2 : l++) {
|
|
2452
2454
|
if (u = ze(e, l), !Xe(u))
|
|
@@ -2457,14 +2459,14 @@ function qi(e, n, t, r, o, i, a, s) {
|
|
|
2457
2459
|
for (l = 0; l < e.length; u >= 65536 ? l += 2 : l++) {
|
|
2458
2460
|
if (u = ze(e, l), u === Ze)
|
|
2459
2461
|
c = !0, f && (y = y || // Foldable line = too long, and not more-indented.
|
|
2460
|
-
l -
|
|
2462
|
+
l - _ - 1 > r && e[_ + 1] !== " ", _ = l);
|
|
2461
2463
|
else if (!Xe(u))
|
|
2462
2464
|
return De;
|
|
2463
2465
|
h = h && an(u, p, s), p = u;
|
|
2464
2466
|
}
|
|
2465
|
-
y = y || f && l -
|
|
2467
|
+
y = y || f && l - _ - 1 > r && e[_ + 1] !== " ";
|
|
2466
2468
|
}
|
|
2467
|
-
return !c && !y ? h && !a && !o(e) ? pr : i === Qe ? De :
|
|
2469
|
+
return !c && !y ? h && !a && !o(e) ? pr : i === Qe ? De : _t : t > 9 && dr(e) ? De : a ? i === Qe ? De : _t : y ? mr : fr;
|
|
2468
2470
|
}
|
|
2469
2471
|
function Bi(e, n, t, r, o) {
|
|
2470
2472
|
e.dump = function() {
|
|
@@ -2488,7 +2490,7 @@ function Bi(e, n, t, r, o) {
|
|
|
2488
2490
|
)) {
|
|
2489
2491
|
case pr:
|
|
2490
2492
|
return n;
|
|
2491
|
-
case
|
|
2493
|
+
case _t:
|
|
2492
2494
|
return "'" + n.replace(/'/g, "''") + "'";
|
|
2493
2495
|
case fr:
|
|
2494
2496
|
return "|" + sn(n, e.indent) + ln(rn(n, i));
|
|
@@ -2550,7 +2552,7 @@ function Pi(e, n, t) {
|
|
|
2550
2552
|
function cn(e, n, t, r) {
|
|
2551
2553
|
var o = "", i = e.tag, a, s, l;
|
|
2552
2554
|
for (a = 0, s = t.length; a < s; a += 1)
|
|
2553
|
-
l = t[a], e.replacer && (l = e.replacer.call(t, String(a), l)), ($e(e, n + 1, l, !0, !0, !1, !0) || typeof l > "u" && $e(e, n + 1, null, !0, !0, !1, !0)) && ((!r || o !== "") && (o +=
|
|
2555
|
+
l = t[a], e.replacer && (l = e.replacer.call(t, String(a), l)), ($e(e, n + 1, l, !0, !0, !1, !0) || typeof l > "u" && $e(e, n + 1, null, !0, !0, !1, !0)) && ((!r || o !== "") && (o += wt(e, n)), e.dump && Ze === e.dump.charCodeAt(0) ? o += "-" : o += "- ", o += e.dump);
|
|
2554
2556
|
e.tag = i, e.dump = o || "[]";
|
|
2555
2557
|
}
|
|
2556
2558
|
function Di(e, n, t) {
|
|
@@ -2568,7 +2570,7 @@ function Vi(e, n, t, r) {
|
|
|
2568
2570
|
else if (e.sortKeys)
|
|
2569
2571
|
throw new ye("sortKeys must be a boolean or a function");
|
|
2570
2572
|
for (s = 0, l = a.length; s < l; s += 1)
|
|
2571
|
-
y = "", (!r || o !== "") && (y +=
|
|
2573
|
+
y = "", (!r || o !== "") && (y += wt(e, n)), u = a[s], p = t[u], e.replacer && (p = e.replacer.call(t, u, p)), $e(e, n + 1, u, !0, !0, !0) && (c = e.tag !== null && e.tag !== "?" || e.dump && e.dump.length > 1024, c && (e.dump && Ze === e.dump.charCodeAt(0) ? y += "?" : y += "? "), y += e.dump, c && (y += wt(e, n)), $e(e, n + 1, p, !0, c) && (e.dump && Ze === e.dump.charCodeAt(0) ? y += ":" : y += ": ", y += e.dump, o += y));
|
|
2572
2574
|
e.tag = i, e.dump = o || "{}";
|
|
2573
2575
|
}
|
|
2574
2576
|
function dn(e, n, t) {
|
|
@@ -2798,7 +2800,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
2798
2800
|
}, null, 8, ["yaml-record"])) : z("", !0)
|
|
2799
2801
|
], 64));
|
|
2800
2802
|
}
|
|
2801
|
-
}), ms = /* @__PURE__ */
|
|
2803
|
+
}), ms = /* @__PURE__ */ we(fs, [["__scopeId", "data-v-2b74ac63"]]), pn = "24px", gs = (e, n) => {
|
|
2802
2804
|
const t = e.__vccOpts || e;
|
|
2803
2805
|
for (const [r, o] of n)
|
|
2804
2806
|
t[r] = o;
|
|
@@ -2902,7 +2904,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
2902
2904
|
_: 1
|
|
2903
2905
|
}, 8, ["aria-hidden", "style"]));
|
|
2904
2906
|
}
|
|
2905
|
-
}), ks = /* @__PURE__ */ gs(Cs, [["__scopeId", "data-v-84d5ee61"]]),
|
|
2907
|
+
}), ks = /* @__PURE__ */ gs(Cs, [["__scopeId", "data-v-84d5ee61"]]), ws = { "data-testid": "config-card-title" }, _s = { class: "config-card-actions" }, Is = ["href"], As = {
|
|
2906
2908
|
key: 2,
|
|
2907
2909
|
class: "config-card-details-section"
|
|
2908
2910
|
}, Ss = {
|
|
@@ -3038,7 +3040,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3038
3040
|
// the last property displayed
|
|
3039
3041
|
section: ke.Basic
|
|
3040
3042
|
}
|
|
3041
|
-
},
|
|
3043
|
+
}, _ = F(!1), h = F(!1), A = F(""), b = F({}), w = x(() => {
|
|
3042
3044
|
var C, G, K;
|
|
3043
3045
|
if (!b.value)
|
|
3044
3046
|
return [];
|
|
@@ -3091,9 +3093,9 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3091
3093
|
}), v = x(() => {
|
|
3092
3094
|
var C, G, K, I;
|
|
3093
3095
|
return {
|
|
3094
|
-
basic: (C =
|
|
3095
|
-
advanced: (G =
|
|
3096
|
-
plugin: (I = L.value) == null ? void 0 : I.concat((K =
|
|
3096
|
+
basic: (C = w.value) == null ? void 0 : C.filter((T) => T.section === ke.Basic),
|
|
3097
|
+
advanced: (G = w.value) == null ? void 0 : G.filter((T) => T.section === ke.Advanced),
|
|
3098
|
+
plugin: (I = L.value) == null ? void 0 : I.concat((K = w.value) == null ? void 0 : K.filter((T) => T.section === ke.Plugin))
|
|
3097
3099
|
};
|
|
3098
3100
|
}), S = x(() => {
|
|
3099
3101
|
const C = [];
|
|
@@ -3105,10 +3107,10 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3105
3107
|
}), R = (C) => {
|
|
3106
3108
|
b.value && C(JSON.stringify(b.value)) ? r("copy:success", b.value) : r("copy:error");
|
|
3107
3109
|
};
|
|
3108
|
-
return Te(
|
|
3110
|
+
return Te(_, (C) => {
|
|
3109
3111
|
r("loading", C);
|
|
3110
3112
|
}, { immediate: !0 }), dt(async () => {
|
|
3111
|
-
h.value = !1,
|
|
3113
|
+
h.value = !1, _.value = !0;
|
|
3112
3114
|
try {
|
|
3113
3115
|
const { data: C } = await u.get(re.value);
|
|
3114
3116
|
if (o.dataKey)
|
|
@@ -3125,13 +3127,13 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3125
3127
|
const G = s(C);
|
|
3126
3128
|
A.value = G.startsWith("code") ? a("baseConfigCard.errors.load") : G, h.value = !0, r("fetch:error", C);
|
|
3127
3129
|
} finally {
|
|
3128
|
-
|
|
3130
|
+
_.value = !1;
|
|
3129
3131
|
}
|
|
3130
3132
|
}), (C, G) => {
|
|
3131
3133
|
const K = q("KLabel"), I = q("KSelect"), T = q("KButton"), O = q("KClipboardProvider"), B = q("KSkeleton"), W = q("KEmptyState"), ee = q("KCard");
|
|
3132
3134
|
return d(), P(ee, { class: "kong-ui-entity-base-config-card" }, je({
|
|
3133
3135
|
actions: g(() => [
|
|
3134
|
-
V("div",
|
|
3136
|
+
V("div", _s, [
|
|
3135
3137
|
X(C.$slots, "actions", {}, void 0, !0),
|
|
3136
3138
|
e.config.jsonYamlEnabled ? (d(), P(K, {
|
|
3137
3139
|
key: 0,
|
|
@@ -3169,7 +3171,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3169
3171
|
})) : z("", !0),
|
|
3170
3172
|
e.config.jsonYamlEnabled ? z("", !0) : (d(), P(O, { key: 3 }, {
|
|
3171
3173
|
default: g(({ copyToClipboard: te }) => [
|
|
3172
|
-
!
|
|
3174
|
+
!_.value && !h.value ? (d(), P(T, {
|
|
3173
3175
|
key: 0,
|
|
3174
3176
|
appearance: "tertiary",
|
|
3175
3177
|
"data-testid": "json-copy-button",
|
|
@@ -3186,7 +3188,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3186
3188
|
])
|
|
3187
3189
|
]),
|
|
3188
3190
|
default: g(() => [
|
|
3189
|
-
|
|
3191
|
+
_.value ? (d(), P(B, {
|
|
3190
3192
|
key: 0,
|
|
3191
3193
|
"data-testid": "config-card-loader",
|
|
3192
3194
|
"table-columns": 2,
|
|
@@ -3258,7 +3260,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3258
3260
|
e.hideTitle ? void 0 : {
|
|
3259
3261
|
name: "title",
|
|
3260
3262
|
fn: g(() => [
|
|
3261
|
-
V("div",
|
|
3263
|
+
V("div", ws, [
|
|
3262
3264
|
X(C.$slots, "title", {}, () => [
|
|
3263
3265
|
Z(N(m(a)("baseConfigCard.title")), 1)
|
|
3264
3266
|
], !0)
|
|
@@ -3269,7 +3271,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3269
3271
|
]), 1024);
|
|
3270
3272
|
};
|
|
3271
3273
|
}
|
|
3272
|
-
}), js = /* @__PURE__ */
|
|
3274
|
+
}), js = /* @__PURE__ */ we($s, [["__scopeId", "data-v-068b819b"]]), Ms = {
|
|
3273
3275
|
class: "form-actions",
|
|
3274
3276
|
"data-testid": "form-actions"
|
|
3275
3277
|
}, Os = { key: 0 }, Es = /* @__PURE__ */ ae({
|
|
@@ -3329,7 +3331,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3329
3331
|
var t;
|
|
3330
3332
|
const r = n, o = e, i = At(), { i18n: { t: a } } = ce.useI18n(), { getMessageFromError: s } = ce.useErrors(), { axiosInstance: l } = ce.useAxios({
|
|
3331
3333
|
headers: (t = o.config) == null ? void 0 : t.requestHeaders
|
|
3332
|
-
}), u = F(!1), p = F(!1), c = F(""), y = x(() => o.canSubmit === !1 || o.isReadonly), f = F(!1),
|
|
3334
|
+
}), u = F(!1), p = F(!1), c = F(""), y = x(() => o.canSubmit === !1 || o.isReadonly), f = F(!1), _ = x(() => {
|
|
3333
3335
|
var v, S;
|
|
3334
3336
|
let D = `${o.config.apiBaseUrl}${o.fetchUrl}`;
|
|
3335
3337
|
return o.config.app === "konnect" ? D = D.replace(/{controlPlaneId}/gi, ((v = o.config) == null ? void 0 : v.controlPlaneId) || "") : o.config.app === "kongManager" && (D = D.replace(/\/{workspace}/gi, (S = o.config) != null && S.workspace ? `/${o.config.workspace}` : "")), o.editId ? (D = D.replace(/{id}/gi, o.editId), D) : (D = D.replace(/\/{id}/gi, ""), D);
|
|
@@ -3339,7 +3341,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3339
3341
|
o.config.cancelRoute ? i.push(o.config.cancelRoute) : b();
|
|
3340
3342
|
}, b = () => {
|
|
3341
3343
|
r("cancel");
|
|
3342
|
-
},
|
|
3344
|
+
}, w = () => {
|
|
3343
3345
|
y.value || r("submit");
|
|
3344
3346
|
}, L = F([
|
|
3345
3347
|
{
|
|
@@ -3357,7 +3359,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3357
3359
|
if (o.editId)
|
|
3358
3360
|
try {
|
|
3359
3361
|
p.value = !1, u.value = !0;
|
|
3360
|
-
const { data: v } = await l.get(
|
|
3362
|
+
const { data: v } = await l.get(_.value);
|
|
3361
3363
|
r("fetch:success", v);
|
|
3362
3364
|
} catch (v) {
|
|
3363
3365
|
const S = s(v);
|
|
@@ -3387,7 +3389,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3387
3389
|
key: 2,
|
|
3388
3390
|
"data-testid": "form-content",
|
|
3389
3391
|
onReset: rt(b, ["prevent"]),
|
|
3390
|
-
onSubmit: rt(
|
|
3392
|
+
onSubmit: rt(w, ["prevent"])
|
|
3391
3393
|
}, [
|
|
3392
3394
|
X(v.$slots, "default", {}, void 0, !0),
|
|
3393
3395
|
e.errorMessage ? (d(), P(R, {
|
|
@@ -3453,7 +3455,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3453
3455
|
json: g(() => [
|
|
3454
3456
|
E(xn, {
|
|
3455
3457
|
config: e.config,
|
|
3456
|
-
"fetcher-url":
|
|
3458
|
+
"fetcher-url": _.value,
|
|
3457
3459
|
"json-record": o.formFields,
|
|
3458
3460
|
"request-method": o.editId ? "put" : "post"
|
|
3459
3461
|
}, null, 8, ["config", "fetcher-url", "json-record", "request-method"])
|
|
@@ -3473,7 +3475,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3473
3475
|
});
|
|
3474
3476
|
};
|
|
3475
3477
|
}
|
|
3476
|
-
}), Fs = /* @__PURE__ */
|
|
3478
|
+
}), Fs = /* @__PURE__ */ we(Es, [["__scopeId", "data-v-41712e71"]]), Ns = {
|
|
3477
3479
|
key: 0,
|
|
3478
3480
|
"data-testid": "first-col"
|
|
3479
3481
|
}, Ks = /* @__PURE__ */ ae({
|
|
@@ -3520,10 +3522,10 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3520
3522
|
}
|
|
3521
3523
|
},
|
|
3522
3524
|
{ immediate: !0, flush: "post", deep: !0 }
|
|
3523
|
-
),
|
|
3524
|
-
return
|
|
3525
|
+
), _ = x(() => o.value ? u.value > p.value : !1);
|
|
3526
|
+
return wr(() => {
|
|
3525
3527
|
s();
|
|
3526
|
-
}),
|
|
3528
|
+
}), _r(() => {
|
|
3527
3529
|
f();
|
|
3528
3530
|
}), (h, A) => {
|
|
3529
3531
|
const b = q("KTooltip");
|
|
@@ -3534,7 +3536,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3534
3536
|
}, [
|
|
3535
3537
|
o.value ? (d(), j("span", Ns, [
|
|
3536
3538
|
E(b, {
|
|
3537
|
-
label:
|
|
3539
|
+
label: _.value ? c.value : "",
|
|
3538
3540
|
"max-width": "300",
|
|
3539
3541
|
placement: "bottomStart"
|
|
3540
3542
|
}, {
|
|
@@ -3547,7 +3549,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3547
3549
|
], 512);
|
|
3548
3550
|
};
|
|
3549
3551
|
}
|
|
3550
|
-
}), qs = /* @__PURE__ */
|
|
3552
|
+
}), qs = /* @__PURE__ */ we(Ks, [["__scopeId", "data-v-e42a20c9"]]), Bs = { class: "toolbar-container" }, Ls = {
|
|
3551
3553
|
key: 0,
|
|
3552
3554
|
class: "toolbar-button-container"
|
|
3553
3555
|
}, Us = ["data-testid"], Ps = /* @__PURE__ */ ae({
|
|
@@ -3702,15 +3704,15 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3702
3704
|
textOverflow: "ellipsis"
|
|
3703
3705
|
}), D;
|
|
3704
3706
|
}, f = () => {
|
|
3705
|
-
r("empty-state-cta-clicked"),
|
|
3706
|
-
},
|
|
3707
|
+
r("empty-state-cta-clicked"), _();
|
|
3708
|
+
}, _ = () => {
|
|
3707
3709
|
r("clear-search-input");
|
|
3708
3710
|
}, h = x(() => t.disableRowClick ? void 0 : (S, D) => {
|
|
3709
3711
|
r("click:row", D);
|
|
3710
3712
|
}), A = (S) => {
|
|
3711
3713
|
r("sort", S);
|
|
3712
|
-
}, { setTablePreferences: b, getTablePreferences:
|
|
3713
|
-
const S =
|
|
3714
|
+
}, { setTablePreferences: b, getTablePreferences: w } = Or(), L = x(() => {
|
|
3715
|
+
const S = w(t.preferencesStorageKey);
|
|
3714
3716
|
return {
|
|
3715
3717
|
...t.initialFetcherParams,
|
|
3716
3718
|
...S
|
|
@@ -3831,7 +3833,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3831
3833
|
}, 8, ["title"]);
|
|
3832
3834
|
};
|
|
3833
3835
|
}
|
|
3834
|
-
}), Ds = /* @__PURE__ */
|
|
3836
|
+
}), Ds = /* @__PURE__ */ we(Ps, [["__scopeId", "data-v-57b5a97b"]]), Vs = {
|
|
3835
3837
|
key: 0,
|
|
3836
3838
|
class: "kong-ui-entity-delete-error"
|
|
3837
3839
|
}, Rs = {
|
|
@@ -3931,7 +3933,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3931
3933
|
}, 8, ["action-pending", "confirmation-text", "is-visible", "title"]);
|
|
3932
3934
|
};
|
|
3933
3935
|
}
|
|
3934
|
-
}), Hs = /* @__PURE__ */
|
|
3936
|
+
}), Hs = /* @__PURE__ */ we(Gs, [["__scopeId", "data-v-1c9a2a07"]]), zs = {
|
|
3935
3937
|
fill: "none",
|
|
3936
3938
|
height: "20",
|
|
3937
3939
|
viewBox: "0 0 20 20",
|
|
@@ -3995,19 +3997,19 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
3995
3997
|
setup(e, { emit: n }) {
|
|
3996
3998
|
const { i18n: { t } } = ce.useI18n(), r = e, o = n, i = F(!1), a = F({}), s = x(() => {
|
|
3997
3999
|
const b = [];
|
|
3998
|
-
return new URLSearchParams(r.modelValue).forEach((
|
|
3999
|
-
|
|
4000
|
+
return new URLSearchParams(r.modelValue).forEach((w, L) => {
|
|
4001
|
+
w !== "" && b.push(L);
|
|
4000
4002
|
}), b;
|
|
4001
4003
|
}), l = x(() => {
|
|
4002
4004
|
const b = r.config.fields;
|
|
4003
|
-
return Object.keys(b).filter((
|
|
4004
|
-
label: b[
|
|
4005
|
-
value:
|
|
4005
|
+
return Object.keys(b).filter((w) => b[w].searchable).map((w) => ({
|
|
4006
|
+
label: b[w].label || w,
|
|
4007
|
+
value: w
|
|
4006
4008
|
}));
|
|
4007
4009
|
});
|
|
4008
4010
|
Te(() => r.modelValue, (b) => {
|
|
4009
|
-
a.value = {}, new URLSearchParams(b).forEach((
|
|
4010
|
-
a.value[L] =
|
|
4011
|
+
a.value = {}, new URLSearchParams(b).forEach((w, L) => {
|
|
4012
|
+
a.value[L] = w;
|
|
4011
4013
|
});
|
|
4012
4014
|
});
|
|
4013
4015
|
const u = () => {
|
|
@@ -4015,15 +4017,15 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4015
4017
|
}, p = (b) => {
|
|
4016
4018
|
o("update:modelValue", b);
|
|
4017
4019
|
}, c = (b) => `filter-${b}`, y = (b) => {
|
|
4018
|
-
var
|
|
4019
|
-
return (((L = (
|
|
4020
|
+
var w, L;
|
|
4021
|
+
return (((L = (w = r.config.schema) == null ? void 0 : w[b]) == null ? void 0 : L.values) ?? []).map((v) => ({
|
|
4020
4022
|
value: v,
|
|
4021
4023
|
label: v
|
|
4022
4024
|
}));
|
|
4023
4025
|
}, f = (b) => {
|
|
4024
|
-
var
|
|
4025
|
-
return ((L = (
|
|
4026
|
-
},
|
|
4026
|
+
var w, L;
|
|
4027
|
+
return ((L = (w = r.config.schema) == null ? void 0 : w[b]) == null ? void 0 : L.type) ?? "text";
|
|
4028
|
+
}, _ = (b) => {
|
|
4027
4029
|
a.value = {
|
|
4028
4030
|
...a.value,
|
|
4029
4031
|
[b]: ""
|
|
@@ -4031,10 +4033,10 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4031
4033
|
}, h = () => {
|
|
4032
4034
|
a.value = {}, A(!0);
|
|
4033
4035
|
}, A = (b = !1) => {
|
|
4034
|
-
const
|
|
4035
|
-
b && (i.value = !1), o("update:modelValue", new URLSearchParams(
|
|
4036
|
+
const w = Object.keys(a.value).reduce((L, v) => (a.value[v] && (L[v] = `${a.value[v]}`), L), {});
|
|
4037
|
+
b && (i.value = !1), o("update:modelValue", new URLSearchParams(w).toString());
|
|
4036
4038
|
};
|
|
4037
|
-
return (b,
|
|
4039
|
+
return (b, w) => {
|
|
4038
4040
|
const L = q("KInput"), v = q("KButton"), S = q("KSelect"), D = q("KMenuItem"), re = q("KMenu");
|
|
4039
4041
|
return e.config.isExactMatch ? (d(), P(L, {
|
|
4040
4042
|
key: 0,
|
|
@@ -4114,7 +4116,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4114
4116
|
appearance: "tertiary",
|
|
4115
4117
|
"data-testid": "apply-filter",
|
|
4116
4118
|
size: "small",
|
|
4117
|
-
onClick:
|
|
4119
|
+
onClick: w[0] || (w[0] = (I) => A(!0))
|
|
4118
4120
|
}, {
|
|
4119
4121
|
default: g(() => [
|
|
4120
4122
|
Z(N(m(t)("filter.applyButtonText")), 1)
|
|
@@ -4125,7 +4127,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4125
4127
|
appearance: "tertiary",
|
|
4126
4128
|
"data-testid": "clear-filter",
|
|
4127
4129
|
size: "small",
|
|
4128
|
-
onClick: (I) =>
|
|
4130
|
+
onClick: (I) => _(R.value)
|
|
4129
4131
|
}, {
|
|
4130
4132
|
default: g(() => [
|
|
4131
4133
|
Z(N(m(t)("filter.clearButtonText")), 1)
|
|
@@ -4159,7 +4161,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4159
4161
|
]));
|
|
4160
4162
|
};
|
|
4161
4163
|
}
|
|
4162
|
-
}), il = /* @__PURE__ */
|
|
4164
|
+
}), il = /* @__PURE__ */ we(al, [["__scopeId", "data-v-15962ee2"]]), tt = /* @__PURE__ */ ae({
|
|
4163
4165
|
__name: "PermissionsWrapper",
|
|
4164
4166
|
props: {
|
|
4165
4167
|
/**
|
|
@@ -4248,7 +4250,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4248
4250
|
])
|
|
4249
4251
|
], 2));
|
|
4250
4252
|
}
|
|
4251
|
-
}), mn = /* @__PURE__ */
|
|
4253
|
+
}), mn = /* @__PURE__ */ we(pl, [["__scopeId", "data-v-3565daa7"]]), { useAxios: Kt, useDeleteUrlBuilder: fl, useErrors: ml, useExternalLinkCreator: Nl, useFetchUrlBuilder: Kl, useFetcher: gl, useDebouncedFilter: yr, useStringHelpers: ql, useHelpers: Bl, useGatewayFeatureSupported: Ll, useTruncationDetector: Ul } = ce, yl = { class: "add-to-group-form-container" }, hl = { class: "add-to-group-cta-text" }, vl = {
|
|
4252
4254
|
key: 0,
|
|
4253
4255
|
class: "kong-ui-entity-add-to-groups-error"
|
|
4254
4256
|
}, bl = { key: 0 }, Cl = /* @__PURE__ */ ae({
|
|
@@ -4286,7 +4288,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4286
4288
|
fetchedItemsKey: "data",
|
|
4287
4289
|
searchKeys: ["name", "id"]
|
|
4288
4290
|
}
|
|
4289
|
-
), f = x(() => p.value ? t("consumer_groups.errors.general") : ""),
|
|
4291
|
+
), f = x(() => p.value ? t("consumer_groups.errors.general") : ""), _ = F(0), h = x(() => u.value === void 0), A = x(() => y.value.map((I) => ({
|
|
4290
4292
|
label: I.name,
|
|
4291
4293
|
value: I.id,
|
|
4292
4294
|
selected: a.value.includes(I.id),
|
|
@@ -4296,7 +4298,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4296
4298
|
var O;
|
|
4297
4299
|
const T = h.value ? y.value.find((B) => B.id === I) : (O = u.value) == null ? void 0 : O.find((B) => B.id === I);
|
|
4298
4300
|
return T ? T.name : I;
|
|
4299
|
-
},
|
|
4301
|
+
}, w = () => {
|
|
4300
4302
|
S.value = "", L.value = [], C.value = [], o("cancel");
|
|
4301
4303
|
}, L = F([]), v = F(!1), S = F(""), D = async () => {
|
|
4302
4304
|
if (!a.value.length) {
|
|
@@ -4337,7 +4339,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4337
4339
|
}).filter(Boolean);
|
|
4338
4340
|
};
|
|
4339
4341
|
return Te(A, () => {
|
|
4340
|
-
|
|
4342
|
+
_.value++;
|
|
4341
4343
|
}, { immediate: !0, deep: !0 }), Te(() => r.visible, () => {
|
|
4342
4344
|
r.visible && c();
|
|
4343
4345
|
}, { immediate: !0 }), (I, T) => {
|
|
@@ -4348,7 +4350,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4348
4350
|
"data-testid": "add-to-group-modal",
|
|
4349
4351
|
"is-visible": e.visible,
|
|
4350
4352
|
title: m(t)("consumer_groups.consumers.add.title"),
|
|
4351
|
-
onCanceled:
|
|
4353
|
+
onCanceled: w,
|
|
4352
4354
|
onProceed: D
|
|
4353
4355
|
}, {
|
|
4354
4356
|
"body-content": g(() => [
|
|
@@ -4392,7 +4394,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4392
4394
|
for (const [r, o] of n)
|
|
4393
4395
|
t[r] = o;
|
|
4394
4396
|
return t;
|
|
4395
|
-
}, kl = /* @__PURE__ */ qt(Cl, [["__scopeId", "data-v-3808b4c0"]]),
|
|
4397
|
+
}, kl = /* @__PURE__ */ qt(Cl, [["__scopeId", "data-v-3808b4c0"]]), wl = { class: "kong-ui-entities-consumer-groups-list" }, _l = { key: 1 }, Il = /* @__PURE__ */ ae({
|
|
4396
4398
|
__name: "ConsumerGroupList",
|
|
4397
4399
|
props: {
|
|
4398
4400
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -4447,7 +4449,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4447
4449
|
name: { label: i("consumer_groups.list.table_headers.name"), searchable: !0, sortable: !0 }
|
|
4448
4450
|
};
|
|
4449
4451
|
r.config.app === "kongManager" && (y.consumers_count = { label: i("consumer_groups.list.table_headers.consumers_count"), searchable: !1, sortable: !1 }), y.tags = { label: i("consumer_groups.list.table_headers.tags"), sortable: !1 };
|
|
4450
|
-
const f = y,
|
|
4452
|
+
const f = y, _ = ($) => ({
|
|
4451
4453
|
"data-testid": $.username ?? $.custom_id ?? $.id
|
|
4452
4454
|
}), h = x(() => {
|
|
4453
4455
|
var Y, se, he, Ie;
|
|
@@ -4469,7 +4471,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4469
4471
|
},
|
|
4470
4472
|
schema: r.config.filterSchema
|
|
4471
4473
|
};
|
|
4472
|
-
}),
|
|
4474
|
+
}), w = x(() => u.value && !r.config.paginatedEndpoint ? "consumer_groups" : void 0), { fetcher: L, fetcherState: v } = gl(r.config, h.value, w.value), S = () => {
|
|
4473
4475
|
A.value = "";
|
|
4474
4476
|
}, D = () => {
|
|
4475
4477
|
l.value++;
|
|
@@ -4534,7 +4536,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4534
4536
|
Y || U(), l.value++, t("add:success", $);
|
|
4535
4537
|
}, J = () => {
|
|
4536
4538
|
u.value && k();
|
|
4537
|
-
}, H = F(void 0), fe = F(!1),
|
|
4539
|
+
}, H = F(void 0), fe = F(!1), _e = F(""), me = ($) => {
|
|
4538
4540
|
H.value = $, fe.value = !0;
|
|
4539
4541
|
}, Ne = () => {
|
|
4540
4542
|
fe.value = !1, H.value = void 0;
|
|
@@ -4549,7 +4551,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4549
4551
|
const $ = et.value.replace(/{consumerGroupId}/gi, H.value.id);
|
|
4550
4552
|
await s.delete($), t("remove:success", H.value), Ne(), l.value++;
|
|
4551
4553
|
} catch ($) {
|
|
4552
|
-
|
|
4554
|
+
_e.value = $.message || i("consumer_groups.errors.delete"), t("error", $);
|
|
4553
4555
|
} finally {
|
|
4554
4556
|
Bt.value = !1;
|
|
4555
4557
|
}
|
|
@@ -4575,7 +4577,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4575
4577
|
await r.canCreate() && (mt.value.title = u.value ? i("consumer_groups.list.empty_state.title_for_consumer") : i("consumer_groups.list.empty_state.title"), mt.value.ctaText = u.value ? i("consumer_groups.actions.add_to_group") : i("consumer_groups.actions.create"));
|
|
4576
4578
|
}), ($, Y) => {
|
|
4577
4579
|
const se = q("KButton"), he = q("KBadge"), Ie = q("KTruncate"), He = q("KDropdownItem"), Pt = q("KClipboardProvider"), vr = q("KPrompt");
|
|
4578
|
-
return d(), j("div",
|
|
4580
|
+
return d(), j("div", wl, [
|
|
4579
4581
|
E(m(Ds), {
|
|
4580
4582
|
"cache-identifier": e.cacheIdentifier,
|
|
4581
4583
|
"disable-pagination": u.value && !e.config.paginatedEndpoint,
|
|
@@ -4589,7 +4591,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4589
4591
|
"pagination-type": "offset",
|
|
4590
4592
|
"preferences-storage-key": p.value,
|
|
4591
4593
|
query: A.value,
|
|
4592
|
-
"row-attributes":
|
|
4594
|
+
"row-attributes": _,
|
|
4593
4595
|
"table-headers": m(f),
|
|
4594
4596
|
"use-action-outside": e.useActionOutside,
|
|
4595
4597
|
onClearSearchInput: S,
|
|
@@ -4656,7 +4658,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4656
4658
|
}, 1024))), 128))
|
|
4657
4659
|
]),
|
|
4658
4660
|
_: 2
|
|
4659
|
-
}, 1024)) : (d(), j("span",
|
|
4661
|
+
}, 1024)) : (d(), j("span", _l, "-"))
|
|
4660
4662
|
]),
|
|
4661
4663
|
actions: g(({ row: Q }) => [
|
|
4662
4664
|
E(Pt, null, {
|
|
@@ -4832,7 +4834,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4832
4834
|
searchKeys: ["username", "custom_id", "id"]
|
|
4833
4835
|
}), { axiosInstance: f } = Kt({
|
|
4834
4836
|
headers: (Le = t.config) == null ? void 0 : Le.requestHeaders
|
|
4835
|
-
}), { getMessageFromError:
|
|
4837
|
+
}), { getMessageFromError: _ } = ml(), h = x(() => y.value.map((k) => ({
|
|
4836
4838
|
label: k.username || k.custom_id,
|
|
4837
4839
|
value: k.id,
|
|
4838
4840
|
selected: a.fields.consumers.includes(k.id),
|
|
@@ -4841,10 +4843,10 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4841
4843
|
}))), A = x(() => {
|
|
4842
4844
|
var k, U;
|
|
4843
4845
|
return (U = Me.form[(k = t.config) == null ? void 0 : k.app]) == null ? void 0 : U.edit;
|
|
4844
|
-
}), b = x(() => t.consumerGroupId ? nt.Edit : nt.Create),
|
|
4845
|
-
var H, fe,
|
|
4846
|
+
}), b = x(() => t.consumerGroupId ? nt.Edit : nt.Create), w = x(() => !!a.fields.name && !C.value), L = x(() => JSON.stringify(a.fields) !== JSON.stringify(s)), v = (k, U = "", ie = "") => {
|
|
4847
|
+
var H, fe, _e, me, Ne, et;
|
|
4846
4848
|
let J = `${(H = t.config) == null ? void 0 : H.apiBaseUrl}${Me.form[(fe = t.config) == null ? void 0 : fe.app][k]}`;
|
|
4847
|
-
return ((
|
|
4849
|
+
return ((_e = t.config) == null ? void 0 : _e.app) === "konnect" ? J = J.replace(/{controlPlaneId}/gi, ((me = t.config) == null ? void 0 : me.controlPlaneId) || "") : ((Ne = t.config) == null ? void 0 : Ne.app) === "kongManager" && (J = J.replace(/\/{workspace}/gi, (et = t.config) != null && et.workspace ? `/${t.config.workspace}` : "")), J = J.replace(/{id}/gi, U || t.consumerGroupId), (k === "addConsumer" || k === "removeConsumer") && (J = J.replace(/{consumerId}/gi, ie)), J;
|
|
4848
4850
|
}, S = () => {
|
|
4849
4851
|
var k;
|
|
4850
4852
|
i.push(((k = t.config) == null ? void 0 : k.cancelRoute) || { name: "consumer-group-list" });
|
|
@@ -4853,7 +4855,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4853
4855
|
}, re = (k) => {
|
|
4854
4856
|
r("loading", k);
|
|
4855
4857
|
}, R = async (k) => {
|
|
4856
|
-
var ie, J, H, fe,
|
|
4858
|
+
var ie, J, H, fe, _e;
|
|
4857
4859
|
a.fields.name = ((ie = k == null ? void 0 : k.item) == null ? void 0 : ie.name) || ((J = k == null ? void 0 : k.consumer_group) == null ? void 0 : J.name) || (k == null ? void 0 : k.name) || "";
|
|
4858
4860
|
const U = ((H = k == null ? void 0 : k.item) == null ? void 0 : H.tags) || (k == null ? void 0 : k.consumer_group.tags) || (k == null ? void 0 : k.tags) || [];
|
|
4859
4861
|
if (a.fields.tags = (U == null ? void 0 : U.join(", ")) || "", "consumers" in k)
|
|
@@ -4861,7 +4863,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4861
4863
|
else
|
|
4862
4864
|
try {
|
|
4863
4865
|
const { data: me } = await f.get(v("getConsumers"));
|
|
4864
|
-
a.fields.consumers = "consumers" in me ? (
|
|
4866
|
+
a.fields.consumers = "consumers" in me ? (_e = me == null ? void 0 : me.consumers) == null ? void 0 : _e.map((Ne) => Ne.id) : [];
|
|
4865
4867
|
} catch (me) {
|
|
4866
4868
|
T(me);
|
|
4867
4869
|
}
|
|
@@ -4873,7 +4875,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4873
4875
|
tags: (U = (k = a.fields.tags.split(",")) == null ? void 0 : k.map((ie) => String(ie || "").trim())) == null ? void 0 : U.filter((ie) => ie !== "")
|
|
4874
4876
|
};
|
|
4875
4877
|
}, K = async (k, U = "") => await f.post(v("addConsumer", U, k), { consumer: k }), I = async (k, U = "") => await f.delete(v("removeConsumer", U, k)), T = (k) => {
|
|
4876
|
-
a.errorMessage =
|
|
4878
|
+
a.errorMessage = _(k), r("error", k);
|
|
4877
4879
|
}, O = (k = t.consumerGroupId) => {
|
|
4878
4880
|
Object.assign(s, a.fields), r("update", { ...a.fields, id: k });
|
|
4879
4881
|
}, B = (k, U, ie = t.consumerGroupId) => {
|
|
@@ -4938,7 +4940,7 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
4938
4940
|
const ie = q("KInput"), J = q("KMultiselect");
|
|
4939
4941
|
return d(), j("div", Al, [
|
|
4940
4942
|
E(m(Fs), {
|
|
4941
|
-
"can-submit":
|
|
4943
|
+
"can-submit": w.value && L.value,
|
|
4942
4944
|
config: e.config,
|
|
4943
4945
|
"edit-id": e.consumerGroupId,
|
|
4944
4946
|
"error-message": a.errorMessage || m(p) || C.value,
|
|
@@ -5006,10 +5008,10 @@ const us = { class: "yaml-config" }, gr = /* @__PURE__ */ ae({
|
|
|
5006
5008
|
onQueryChange: m(l)
|
|
5007
5009
|
}, {
|
|
5008
5010
|
"item-template": g(({ item: H }) => {
|
|
5009
|
-
var fe,
|
|
5011
|
+
var fe, _e, me;
|
|
5010
5012
|
return [
|
|
5011
5013
|
V("div", Sl, N(H.label), 1),
|
|
5012
|
-
(fe = H == null ? void 0 : H.data) != null && fe.username && ((
|
|
5014
|
+
(fe = H == null ? void 0 : H.data) != null && fe.username && ((_e = H == null ? void 0 : H.data) != null && _e.custom_id) ? (d(), j("div", xl, N((me = H == null ? void 0 : H.data) == null ? void 0 : me.custom_id), 1)) : z("", !0)
|
|
5013
5015
|
];
|
|
5014
5016
|
}),
|
|
5015
5017
|
_: 1
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(ae,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n","axios","@kong/kongponents"],t):(ae=typeof globalThis<"u"?globalThis:ae||self,t(ae["kong-ui-public-entities-consumer-groups"]={},ae.Vue,ae.VueRouter,ae["kong-ui-public-i18n"],ae.axios,ae.Kongponents))})(this,function(ae,t,Re,Ae,Ln,vn){"use strict";const Un={consumer_groups:{list:{table_headers:{name:"Name",consumers_count:"Consumers",tags:"Tags",id:"ID"},empty_state:{title:"Configure a New Consumer Group",description:"Use consumer groups to manage custom rate limiting configuration for subsets of consumers.",title_for_consumer:"Add to a Consumer Group"},toolbar_actions:{new_consumer_group:"New Consumer Group"}},title:"Consumer Groups",search:{placeholder:"Filter by exact name or ID"},actions:{add_to_group:"Add to Consumer Group",create:"New Consumer Group",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",exit:"Exit",view:"View Details"},delete:{title:"Delete a Consumer Group",description:"Deleting this group will remove this group from all plugins and its rate limit configuration. This action cannot be reversed."},consumers:{add:{title:"Add To Consumer Groups",ctaText:"Add this consumer to consumer groups",consumer_groups_label:"Consumer Groups",consumer_group_placeholder:"Add to consumer groups",footer:"Search by exact name or ID to find consumer groups not included in the list"},exit:{title:"Exit from a Consumer Group",confirmation:"Are you sure you want to remove consumer {consumer} from consumer group {consumerGroup}?",confirmationNoUsername:"Are you sure you want this consumer to exit from consumer group {consumerGroup}?",description:"Exiting from the group could change the rate limit policy applied to this consumer."}},errors:{general:"Consumer Groups could not be retrieved",delete:"The consumer group could not be deleted at this time.",copy:"Failed to copy to clipboard",add:"The consumer could not be added to some groups at this time.",already_added:"The consumer is already in this consumer group",add_consumer:"An unexpected error occurred while adding consumers. Please try again.",remove_consumer:"An unexpected error occurred while removing consumers. Please try again."},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{general_info:{title:"General Information",description:"General information will help identify and manage this consumer group."},consumers:{title:"Consumers",description:"Add or remove consumers from this group"},fields:{name:{label:"Name",placeholder:"Enter a unique name for this consumer group "},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."},consumers:{label:"Consumers",placeholder:"Select one or more consumers"}},validation_errors:{name:"The name can be any string containing letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."}}}};function Pn(){const e=Ae.createI18n("en-us",Un);return{i18n:e,i18nT:Ae.i18nTComponent(e)}}const Me={useI18n:Pn},ue="/api/runtime_groups/{controlPlaneId}",pe="/{workspace}",me={list:{konnect:{all:`${ue}/consumer_groups`,forConsumer:`${ue}/consumers/{consumerId}/consumer_groups`,oneForConsumer:`${ue}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`},kongManager:{all:`${pe}/consumer_groups?counter=true`,forConsumer:`${pe}/consumers/{consumerId}/consumer_groups`,oneForConsumer:`${pe}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`}},form:{konnect:{consumersList:`${ue}/consumers`,create:`${ue}/consumer_groups`,edit:`${ue}/consumer_groups/{id}`,addConsumer:`${ue}/consumer_groups/{id}/consumers`,removeConsumer:`${ue}/consumer_groups/{id}/consumers/{consumerId}`,getConsumers:`${ue}/consumer_groups/{id}/consumers`},kongManager:{consumersList:`${pe}/consumers`,create:`${pe}/consumer_groups`,edit:`${pe}/consumer_groups/{id}`,addConsumer:`${pe}/consumer_groups/{id}/consumers`,removeConsumer:`${pe}/consumer_groups/{id}/consumers/{consumerId}`,getConsumers:`${pe}/consumer_groups/{id}/consumers`}}};var pt=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e))(pt||{}),Oe=(e=>(e.Edit="edit",e.Create="create",e))(Oe||{}),ye=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(ye||{}),R=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(R||{}),ie=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(ie||{});function Ge(e={}){return{axiosInstance:Ln.create({withCredentials:!0,timeout:3e4,...e})}}function Rn(){return{debounce:(e,o)=>{let n;return(...r)=>{clearTimeout(n),n=window==null?void 0:window.setTimeout(()=>{e(...r)},o)}}}}const ze="khcp-user-table-preferences",Gn={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function zn(){const e=n=>{if(typeof n=="string")try{return JSON.parse(n)}catch(r){console.error("useTablePreferences(tryParseJson)",r);return}},o=()=>{const n=e(localStorage.getItem(ze));return!n||!Object.keys(n).length?new Map:new Map(Object.entries(n))};return{setTablePreferences:(n,r)=>{try{const a=o();a.set(n,r),localStorage.setItem(ze,JSON.stringify(Object.fromEntries(a.entries())))}catch(a){console.error("useTablePreferences(setTablePreferences)",a)}},getTablePreferences:n=>{const r=o();return(r==null?void 0:r.get(n))||void 0||Gn},deleteAllTablePreferences:()=>{localStorage.removeItem(ze)}}}const Hn={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},Jn={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Yn={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Configuring your API has never been easier. Use YAML for human-friendly simplicity or JSON for machine-readability. Streamline your settings effortlessly.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},Wn={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Zn={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"}},Qn={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Xn={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},eo={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},to={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"}},no={global:Hn,deleteModal:Jn,baseForm:Yn,baseTable:Wn,baseConfigCard:Zn,filter:Qn,debouncedFilter:Xn,errors:eo,toggleModal:to};function He(){const e=Ae.createI18n("en-us",no);return{i18n:e,i18nT:Ae.i18nTComponent(e)}}function ft(){const e=(n,r)=>(r==null?void 0:r[n])??void 0,o=(n,r)=>{if(n.length!==r.length)return!1;const a=new Set([...n,...r]);for(const l of a){const i=n.filter(c=>c===l).length,s=r.filter(c=>c===l).length;if(i!==s)return!1}return!0};return{getPropValue:e,objectsAreEqual:(n,r,a)=>{if(a){if(Object.keys(n).length===Object.keys(r).length)for(const l in n)if(Array.isArray(n[l])&&Array.isArray(r[l])){if(o(n[l],r[l]))continue;return!1}else{if(n[l]===r[l])continue;return!1}else return!1;return!0}try{return JSON.stringify(n)===JSON.stringify(r)}catch{return!1}},sortAlpha:n=>(r,a)=>{let l=r[n]===void 0||r[n]===null?"":r[n],i=a[n]===void 0||a[n]===null?"":a[n];return Array.isArray(r[n])&&(l=r[n][0]),Array.isArray(a[n])&&(i=a[n][0]),l.localeCompare(i)},isValidUuid:n=>n?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(n):!1}}function oo(e,o,n,r={fetchedItemsKey:"data",searchKeys:["id"]}){n||(n="100");const{axiosInstance:a}=Ge({headers:e.requestHeaders}),{i18n:{t:l}}=He(),{debounce:i}=Rn(),s=i(async h=>{await T(h)},200),c=t.ref(!1),d=t.ref(""),p=t.ref(""),u=t.ref([]),m=t.ref([]),f=t.ref(void 0),w=t.unref(o);let g=`${e.apiBaseUrl}${w}`;e.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:S}=ft(),y=async()=>{try{c.value=!0;const{data:h}=await a.get(`${g}?size=${n}`);h!=null&&h.next||(f.value=r.fetchedItemsKey in h?h[r.fetchedItemsKey]:[]),m.value=r.fetchedItemsKey in h?h[r.fetchedItemsKey]:[],u.value=m.value}catch{u.value=[],d.value=l("debouncedFilter.errors.fetch")}finally{c.value=!1}},b=t.ref(""),T=async h=>{var _,j,G;if(b.value!==h)if(b.value=h||"",f.value===void 0)try{if(c.value=!0,d.value="",p.value="",e.app==="konnect"){let M=g+"";h&&(M+=`/${h}`);const{data:C}=await a.get(`${M}?size=${n}`);r.fetchedItemsKey in C?u.value=C[r.fetchedItemsKey]:C!=null&&C.id?u.value=[C]:u.value=[]}else if(h){const M=[];S(h)&&r.searchKeys.includes("id")?M.push((async()=>{const{data:E}=await a.get(`${g}/${h}`);return[E[r.fetchedItemsKey]??E]})()):M.push(...r.searchKeys.filter(E=>E!=="id").map(async E=>{const{data:x}=await a.get(`${g}?${E}=${h}`);return x[r.fetchedItemsKey]}));const C=await Promise.all(M),O=new Set;u.value=[],(_=C==null?void 0:C.forEach)==null||_.call(C,E=>{var x;(x=E==null?void 0:E.forEach)==null||x.call(E,B=>{O.has(B.id)||(O.add(B.id),u.value.push(B))})})}else u.value=m.value}catch(M){((j=M==null?void 0:M.response)==null?void 0:j.status)===404?p.value=l("debouncedFilter.errors.invalid"):(u.value=[],d.value=l("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,p.value="",h?(u.value=(G=f.value)==null?void 0:G.filter(M=>{var C;let O=!1;for(const E of r.searchKeys){const x=typeof M[E]=="string"?(C=M[E])==null?void 0:C.toLowerCase():M[E];x!=null&&x.includes(h.toLowerCase())&&(O=!0)}return O}),(!u.value||!u.value.length)&&(p.value=l("debouncedFilter.errors.invalid"))):u.value=f.value,c.value=!1};return{loading:c,error:d,validationError:p,results:u,allRecords:f,loadItems:y,debouncedQueryChange:s}}function ro(e,o){const n=t.unref(o),r=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${n}`):new URL(n));return r.value.search="",a=>`${r.value.href}/${a}`}function ao(){const{i18n:{t:e}}=He();return{getMessageFromError:o=>{var n,r,a;if(!o)return e("errors.unexpected");if((n=o==null?void 0:o.response)!=null&&n.data){if(o.response.data.detail)return o.response.data.detail;if((r=o.response.data.details)!=null&&r.length)return o.response.data.details.map(l=>{let i=e("errors.unexpected");return l.messages&&typeof l.messages=="object"&&l.messages.length&&(i=l.messages.join(", ")),l.field?`${l.field} - ${i}`:i}).join("; ");if(o.response.data.message){const{message:l}=o.response.data;return Array.isArray(l)?(a=l[0])!=null&&a.constraints?Object.values(l[0].constraints)[0]:l[0]:l}if(typeof o.response.data=="string")return o.response.data;if(typeof o.response.data=="object")return Object.keys(o.response.data).map(l=>`${l} ${o.response.data[l]}`).join(", ")}return o.message||e("errors.unexpected")}}}function io(e){const o=window.location.origin,n=o.endsWith("/")?o:`${o}/`;try{const r=e.join("/"),a=`${n}${r}`,l=e.some(i=>i.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(a)&&!l&&new URL(a))return`${n}${r}`;throw new Error("Invalid url")}catch(r){return console.warn("Failed to build valid URL:",r),""}}function mt(e,o){const n=t.ref(t.unref(e)),r=t.ref(t.unref(o)),a=t.computed(()=>!!(n.value.app==="konnect"||n.value.isExactMatch)),l=t.computed(()=>r.value.startsWith("/")?new URL(`${window.location.origin}${r.value}`):new URL(r.value));return i=>{const{page:s,pageSize:c,offset:d,sortColumnKey:p,sortColumnOrder:u,query:m}=i;try{let f=new URL(l.value.href);return a.value&&m?(f.search="",f=n.value.app==="konnect"?new URL(`${f.href}?filter[name][contains]=${m}`):new URL(`${f.href}/${m}/`)):(a.value||new URLSearchParams(m).forEach((w,g)=>{f.searchParams.append(g,w)}),p&&f.searchParams.append("sort_by",p),u==="desc"&&f.searchParams.append("sort_desc","1"),f.searchParams.append("size",String(c))),d&&s!==1&&f.searchParams.append("offset",String(d)),f.href}catch(f){return console.error("RouteList(fetcher)",f),r.value}}}function lo(e,o,n="data"){const r=t.unref(o),{axiosInstance:a}=Ge({headers:e.requestHeaders}),l=mt(e,r),i=t.ref({status:ye.Idle});return{fetcher:async s=>{try{i.value={status:ye.Loading};let c=l(s);c.includes("filter[name]")&&(c=`${c}&page[size]=${s.pageSize}&page[number]=${s.page}`);const{data:d}=await a.get(c),p=n&&n.replace(/[^\w-_]/gi,"");let u;d[p]&&Array.isArray(d[p])?u=d[p]:Array.isArray(d)?u=d:u=Object.keys(d).length?[d]:[];const m={data:u,total:u.length,...d.offset?{pagination:{offset:d.offset}}:null};return i.value={status:ye.Idle,response:m},m}catch(c){const d={data:[],total:0};return s.query&&c.response.status===404?(i.value={status:ye.NoResults,response:d,error:c},d):(i.value={status:ye.Error,response:d,error:c},d)}},fetcherState:i}}function so(){const e=(n,r="_")=>n?n.split(r).map(a=>a.toLowerCase()==="id"?a.toUpperCase():a.charAt(0).toUpperCase()+a.substring(1)).join(" "):"",o=/(?:^|[\s-:'"])\w/g;return{capitalize:n=>n?n.replace(o,r=>r.toUpperCase()):"",convertKeyToTitle:e}}const gt=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,ht=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const o=e.match(gt);if(!o)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return o.shift(),o},yt=e=>e==="*"||e==="x"||e==="X",Ct=e=>{const o=parseInt(e,10);return isNaN(o)?e:o},co=(e,o)=>typeof e!=typeof o?[String(e),String(o)]:[e,o],uo=(e,o)=>{if(yt(e)||yt(o))return 0;const[n,r]=co(Ct(e),Ct(o));return n>r?1:n<r?-1:0},kt=(e,o)=>{for(let n=0;n<Math.max(e.length,o.length);n++){const r=uo(e[n]||"0",o[n]||"0");if(r!==0)return r}return 0},po=(e,o)=>{const n=ht(e),r=ht(o),a=n.pop(),l=r.pop(),i=kt(n,r);return i!==0?i:a&&l?kt(a.split("."),l.split(".")):a||l?a?-1:1:0},bt=(e,o,n)=>{fo(n);const r=po(e,o);return wt[n].includes(r)},wt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},xt=Object.keys(wt),fo=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(xt.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${xt.join("|")}`)},mo=e=>typeof e=="string"&&/^[v\d]/.test(e)&>.test(e);function go(e){const{gatewayInfo:o,supportedRange:n}=e;if(!o)return!0;const{edition:r,version:a}=o;if(!mo(a))return console.error("Invalid version"),!1;const l=n[r];if(!l)return!1;const[i,s]=l;return!(i&&bt(a,i,"<")||s&&bt(a,s,">"))}function ho(e){const o=t.ref(0),n=t.ref(0),r=t.ref(!1);return t.watch(e,a=>{a&&!r.value&&(o.value=a.offsetWidth,n.value=a.scrollWidth,r.value=!0)}),{isTruncated:t.computed(()=>o.value<n.value)}}const W={useAxios:Ge,useDebouncedFilter:oo,useDeleteUrlBuilder:ro,useErrors:ao,useExternalLinkCreator:io,useFetcher:lo,useFetchUrlBuilder:mt,useHelpers:ft,useStringHelpers:so,useI18n:He,useGatewayFeatureSupported:go,useTruncationDetector:ho},yo={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Co="Copy to clipboard",ko={message:yo,iconTitle:Co},bo="kong-ui-copy-uuid-notify",St="24px",wo=(e,o)=>{const n=e.__vccOpts||e;for(const[r,a]of o)n[r]=a;return n},xo=e=>(t.pushScopeId("data-v-ac7fcfb4"),e=e(),t.popScopeId(),e),So=["aria-hidden"],_o={key:0,"data-testid":"kui-icon-svg-title"},Bo=xo(()=>t.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)),Io=t.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:St,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const o=String(e).replace(/px/gi,""),n=Number(o);if(n&&!isNaN(n)&&Number.isInteger(n)&&n>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const o=e,n=t.computed(()=>{if(typeof o.size=="number"&&o.size>0)return`${o.size}px`;if(typeof o.size=="string"){const a=String(o.size).replace(/px/gi,""),l=Number(a);if(l&&!isNaN(l)&&Number.isInteger(l)&&l>0)return`${l}px`}return St}),r=t.computed(()=>({boxSizing:"border-box",color:o.color,display:o.display,height:n.value,lineHeight:"0",width:n.value}));return(a,l)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.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?(t.openBlock(),t.createElementBlock("title",_o,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Bo],8,So))]),_:1},8,["aria-hidden","style"]))}}),Ao=wo(Io,[["__scopeId","data-v-ac7fcfb4"]]),No="16px",Eo={class:"kong-ui-copy-uuid"},Vo=["onClick"],_t=15,To=t.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:o}){const{t:n}=Ae.createI18n("en-us",ko),r=e,a=o,l=r.notify||t.inject(bo,()=>{}),i=t.computed(()=>r.idTooltip?{label:r.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:r.uuid}),s=t.computed(()=>!!(r.tooltip&&r.successTooltip)),c=t.ref(r.tooltip),d=t.computed(()=>r.tooltip?{label:c.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),p=t.computed(()=>{var f;return r.format==="redacted"?"*****":r.format==="deleted"?`*${(f=r.uuid)==null?void 0:f.substring(0,5)}`:r.uuid}),u=f=>{c.value=f,setTimeout(()=>{c.value=r.tooltip},1800)},m=f=>{var w,g;if(!f(r.uuid)){typeof l=="function"&&l({type:"error",message:n("message.fail")}),s.value?u(n("message.fail")):a("error",r.uuid);return}const S=((w=r.uuid)==null?void 0:w.length)>_t,y=r.format==="hidden"||r.format==="redacted"?n("message.success.prefix"):`"${((g=r.uuid)==null?void 0:g.substring(0,_t))+(S?"...":"")}"`;typeof l=="function"&&l({type:"success",message:`${y}${n("message.success.content")}`}),s.value?u(r.successTooltip):a("success",r.uuid)};return(f,w)=>{const g=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Eo,[e.format!=="hidden"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),t.mergeProps({key:0},i.value,{"data-testid":"copy-id"}),{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},t.toDisplayString(p.value),3)]),_:1},16)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),t.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:t.withCtx(()=>[t.createVNode(g,null,{default:t.withCtx(({copyToClipboard:S})=>[t.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:t.withModifiers(y=>m(S),["stop"])},[t.createVNode(t.unref(Ao),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:t.unref(No),title:t.unref(n)("iconTitle")},null,8,["color","decorative","size","title"])],8,Vo)]),_:1})]),_:1},16))])}}}),$o=(e,o)=>{const n=e.__vccOpts||e;for(const[r,a]of o)n[r]=a;return n},Bt=$o(To,[["__scopeId","data-v-0c07874b"]]),jo={key:0,class:"config-card-fieldset-title"},Mo=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const o=e,{i18n:{t:n}}=W.useI18n(),{convertKeyToTitle:r}=W.useStringHelpers(),a=t.computed(()=>o.item.key??"json-array-item"),l=t.computed(()=>o.item.value??o.item),i=t.computed(()=>{const c=JSON.parse(JSON.stringify(l.value));return o.isArrayItem&&delete c.name,c}),s=t.computed(()=>{var c;return o.isArrayItem?(c=l.value)!=null&&c.name?r(l.value.name,"_"):n("baseConfigCard.general.entryTitle",{index:o.index}):""});return(c,d)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:t.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:t.withCtx(()=>[e.isArrayItem?(t.openBlock(),t.createElementBlock("legend",jo,[t.createElementVNode("b",null,t.toDisplayString(s.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(i.value),(p,u)=>(t.openBlock(),t.createBlock(Je,{key:`${a.value}-property-${u}`,item:{key:p,label:t.unref(r)(p),value:i.value[p]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),le=(e,o)=>{const n=e.__vccOpts||e;for(const[r,a]of o)n[r]=a;return n},It=le(Mo,[["__scopeId","data-v-68ca83ec"]]),Oo=t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:o}}=W.useI18n();return(n,r)=>{const a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(a,{appearance:"tertiary",class:"navigation-button",onClick:r[0]||(r[0]=l=>n.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(o)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),Fo=le(Oo,[["__scopeId","data-v-c96811e5"]]),Do=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:o}}=W.useI18n();return(n,r)=>{const a=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(a,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(o)("baseConfigCard.statusBadge.enabledLabel"):t.unref(o)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),Ko="#0044f4",qo="#e0e4ea",Lo="#3a3f51",vo="1px",Uo="20px",Po={class:"config-card-details-row"},Ro=["data-testid"],Go=["data-testid"],zo=["data-testid"],Ho=["data-testid"],Jo={key:1},Yo=["data-testid"],Wo=["data-testid"],Zo=["data-testid"],Qo=["data-testid"],Xo={name:"ConfigCardItem",components:{CopyUuid:Bt,JsonCardItem:It,StatusBadge:Do,InternalLinkItem:Fo}},er=t.defineComponent({...Xo,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:o}){t.useCssVars(w=>({"0da74440":p.value?"none":`solid ${t.unref(vo)} ${t.unref(qo)}`,"02a039da":d.value&&s.value?"block":"flex","690f3ced":d.value&&s.value?"100%":n.slim?"50%":"25%","691182c8":d.value&&s.value?"100%":n.slim?"50%":"75%"}));const n=e,r=o,a=t.useSlots(),{i18n:{t:l,formatUnixTimeStamp:i}}=W.useI18n(),s=t.computed(()=>n.item.value!==void 0&&n.item.value!==null&&n.item.value!==""),c=t.computed(()=>!!(n.item.tooltip||a["label-tooltip"])),d=t.computed(()=>n.item.type===R.Json||n.item.type===R.JsonArray),p=t.computed(()=>n.item.type===R.JsonArray),u=t.computed(()=>{switch(n.item.type){case R.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${n.item.key}-copy-uuid`,"success-tooltip":l("baseConfigCard.copy.success"),tooltip:l("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,uuid:n.item.value,notify:()=>{}}};case R.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":l("baseConfigCard.copy.success"),tooltip:l("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,notify:()=>{}}};case R.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${n.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":l("baseConfigCard.copy.success"),tooltip:l("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,uuid:n.item.value,notify:()=>{}}};case R.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":l("baseConfigCard.copy.success"),tooltip:l("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,notify:()=>{}}};case R.Date:return{tag:"div",attrs:{"data-testid":`${n.item.key}-date`},text:i(n.item.value)};case R.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${n.item.key}-badge-status`,status:n.item.value}};case R.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case R.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case R.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${n.item.key}-internal-link`,item:n.item,onNavigationClick:w=>{r("navigation-click",w)}}};case R.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${n.item.key}-external-link`,href:n.item.value},text:n.item.value};case R.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${n.item.key}-json-content`,item:n.item}};case R.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${n.item.key}-json-array-content`,item:n.item}};default:return{tag:"div",attrs:{"data-testid":`${n.item.key}-plain-text`},text:n.item.value}}}),m=t.ref(),{isTruncated:f}=W.useTruncationDetector(m);return(w,g)=>{const S=t.resolveComponent("KLabel"),y=t.resolveComponent("KBadge"),b=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",Po,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(w.$slots,"label",{item:e.item},()=>[t.createVNode(S,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.label)+" ",1)]),_:2},[c.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(w.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,Go)]),key:"0"}:void 0]),1024)],!0)],8,Ro),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(w.$slots,e.item.key,{rowValue:e.item.value},()=>[s.value?(t.openBlock(),t.createElementBlock("div",Jo,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(u.value.tag),t.normalizeProps(t.guardReactiveProps(u.value.attrs)),{default:t.withCtx(()=>[u.value.additionalComponent==="KBadge"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(T,h)=>(t.openBlock(),t.createBlock(y,{key:`${e.item.key}-badge-tag-${h}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${h}`,tooltip:T,"truncation-tooltip":""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(T),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,Yo)):t.createCommentVNode("",!0),u.value.additionalComponent==="CopyUuid"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(T,h)=>(t.openBlock(),t.createBlock(t.unref(Bt),t.mergeProps(u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${h}`,"data-testid":`${e.item.key}-copy-uuid-${h}`,uuid:T}),null,16,["data-testid","uuid"]))),128))],8,Wo)):u.value.additionalComponent==="KMethodBadge"?(t.openBlock(),t.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(T,h)=>(t.openBlock(),t.createBlock(y,{key:`${e.item.key}-badge-method-${h}`,appearance:Object.values(t.unref(vn.BadgeMethodAppearances)).includes(T.toLowerCase())?T.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${h}`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(T),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,Zo)):t.createCommentVNode("",!0),u.value.additionalComponent==="JsonCardItem"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-testid":`${n.item.key}-json-array-content`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(T,h)=>(t.openBlock(),t.createBlock(It,{key:`json-array-item-${h}`,index:h,"is-array-item":"",item:T},null,8,["index","item"]))),128))],8,Qo)):(t.openBlock(),t.createBlock(b,{key:4,label:t.unref(f)?e.item.value:""},{default:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"textContent",ref:m,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},t.toDisplayString(u.value.text),3)]),_:1},8,["label"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,Ho))],!0)],8,zo)])}}}),Je=le(er,[["__scopeId","data-v-9c87856b"]]),tr={class:"json-config"},nr={key:0,class:"json-endpoint"},At=t.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},jsonRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){t.useCssVars(a=>({cd7a6ba0:`${r.value}ch`}));const o=e,n=t.reactive(o.jsonRecord),r=t.computed(()=>{var a;if(!o.fetcherUrl)return 0;const l=(a=o.fetcherUrl)==null?void 0:a.split("/");return l.length<2?0:41+(o.requestMethod==="post"?l[l.length-1]:l[l.length-2]).length});return(a,l)=>{var i;const s=t.resolveComponent("KBadge"),c=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",tr,[o.fetcherUrl&&(i=o.config)!=null&&i.jsonYamlMilestone2Enabled?(t.openBlock(),t.createElementBlock("div",nr,[t.createVNode(s,{appearance:o.requestMethod},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(o.requestMethod),1)]),_:1},8,["appearance"]),t.createVNode(c,{id:"json-endpoint-codeblock",code:o.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),o.jsonRecord?(t.openBlock(),t.createBlock(c,{key:1,id:"json-codeblock",class:t.normalizeClass({"json-content":o.fetcherUrl}),code:JSON.stringify(n,null,2),language:"json",theme:"dark"},null,8,["class","code"])):t.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Nt(e){return typeof e>"u"||e===null}function or(e){return typeof e=="object"&&e!==null}function rr(e){return Array.isArray(e)?e:Nt(e)?[]:[e]}function ar(e,o){var n,r,a,l;if(o)for(l=Object.keys(o),n=0,r=l.length;n<r;n+=1)a=l[n],e[a]=o[a];return e}function ir(e,o){var n="",r;for(r=0;r<o;r+=1)n+=e;return n}function lr(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var sr=Nt,cr=or,dr=rr,ur=ir,pr=lr,fr=ar,Y={isNothing:sr,isObject:cr,toArray:dr,repeat:ur,isNegativeZero:pr,extend:fr};function Et(e,o){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!o&&e.mark.snippet&&(n+=`
|
|
1
|
+
(function(ae,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n","axios","@kong/kongponents"],t):(ae=typeof globalThis<"u"?globalThis:ae||self,t(ae["kong-ui-public-entities-consumer-groups"]={},ae.Vue,ae.VueRouter,ae["kong-ui-public-i18n"],ae.axios,ae.Kongponents))})(this,function(ae,t,Re,Ae,Ln,vn){"use strict";const Un={consumer_groups:{list:{table_headers:{name:"Name",consumers_count:"Consumers",tags:"Tags",id:"ID"},empty_state:{title:"Configure a New Consumer Group",description:"Use consumer groups to manage custom rate limiting configuration for subsets of consumers.",title_for_consumer:"Add to a Consumer Group"},toolbar_actions:{new_consumer_group:"New Consumer Group"}},title:"Consumer Groups",search:{placeholder:"Filter by exact name or ID"},actions:{add_to_group:"Add to Consumer Group",create:"New Consumer Group",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",exit:"Exit",view:"View Details"},delete:{title:"Delete a Consumer Group",description:"Deleting this group will remove this group from all plugins and its rate limit configuration. This action cannot be reversed."},consumers:{add:{title:"Add To Consumer Groups",ctaText:"Add this consumer to consumer groups",consumer_groups_label:"Consumer Groups",consumer_group_placeholder:"Add to consumer groups",footer:"Search by exact name or ID to find consumer groups not included in the list"},exit:{title:"Exit from a Consumer Group",confirmation:"Are you sure you want to remove consumer {consumer} from consumer group {consumerGroup}?",confirmationNoUsername:"Are you sure you want this consumer to exit from consumer group {consumerGroup}?",description:"Exiting from the group could change the rate limit policy applied to this consumer."}},errors:{general:"Consumer Groups could not be retrieved",delete:"The consumer group could not be deleted at this time.",copy:"Failed to copy to clipboard",add:"The consumer could not be added to some groups at this time.",already_added:"The consumer is already in this consumer group",add_consumer:"An unexpected error occurred while adding consumers. Please try again.",remove_consumer:"An unexpected error occurred while removing consumers. Please try again."},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{general_info:{title:"General Information",description:"General information will help identify and manage this consumer group."},consumers:{title:"Consumers",description:"Add or remove consumers from this group"},fields:{name:{label:"Name",placeholder:"Enter a unique name for this consumer group "},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."},consumers:{label:"Consumers",placeholder:"Select one or more consumers"}},validation_errors:{name:"The name can be any string containing letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."}}}};function Pn(){const e=Ae.createI18n("en-us",Un);return{i18n:e,i18nT:Ae.i18nTComponent(e)}}const Me={useI18n:Pn},ue="/api/runtime_groups/{controlPlaneId}",pe="/{workspace}",me={list:{konnect:{all:`${ue}/consumer_groups`,forConsumer:`${ue}/consumers/{consumerId}/consumer_groups`,oneForConsumer:`${ue}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`},kongManager:{all:`${pe}/consumer_groups?counter=true`,forConsumer:`${pe}/consumers/{consumerId}/consumer_groups`,oneForConsumer:`${pe}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`}},form:{konnect:{consumersList:`${ue}/consumers`,create:`${ue}/consumer_groups`,edit:`${ue}/consumer_groups/{id}`,addConsumer:`${ue}/consumer_groups/{id}/consumers`,removeConsumer:`${ue}/consumer_groups/{id}/consumers/{consumerId}`,getConsumers:`${ue}/consumer_groups/{id}/consumers`},kongManager:{consumersList:`${pe}/consumers`,create:`${pe}/consumer_groups`,edit:`${pe}/consumer_groups/{id}`,addConsumer:`${pe}/consumer_groups/{id}/consumers`,removeConsumer:`${pe}/consumer_groups/{id}/consumers/{consumerId}`,getConsumers:`${pe}/consumer_groups/{id}/consumers`}}};var pt=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e))(pt||{}),Oe=(e=>(e.Edit="edit",e.Create="create",e))(Oe||{}),ye=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(ye||{}),R=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(R||{}),ie=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(ie||{});function Ge(e={}){return{axiosInstance:Ln.create({withCredentials:!0,timeout:3e4,...e})}}function Rn(){return{debounce:(e,o)=>{let n;return(...r)=>{clearTimeout(n),n=window==null?void 0:window.setTimeout(()=>{e(...r)},o)}}}}const ze="khcp-user-table-preferences",Gn={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function zn(){const e=n=>{if(typeof n=="string")try{return JSON.parse(n)}catch(r){console.error("useTablePreferences(tryParseJson)",r);return}},o=()=>{const n=e(localStorage.getItem(ze));return!n||!Object.keys(n).length?new Map:new Map(Object.entries(n))};return{setTablePreferences:(n,r)=>{try{const a=o();a.set(n,r),localStorage.setItem(ze,JSON.stringify(Object.fromEntries(a.entries())))}catch(a){console.error("useTablePreferences(setTablePreferences)",a)}},getTablePreferences:n=>{const r=o();return(r==null?void 0:r.get(n))||void 0||Gn},deleteAllTablePreferences:()=>{localStorage.removeItem(ze)}}}const Hn={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},Jn={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Yn={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Configuring your API has never been easier. Use YAML for human-friendly simplicity or JSON for machine-readability. Streamline your settings effortlessly.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},Wn={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Zn={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"}},Qn={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Xn={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},eo={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},to={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"}},no={global:Hn,deleteModal:Jn,baseForm:Yn,baseTable:Wn,baseConfigCard:Zn,filter:Qn,debouncedFilter:Xn,errors:eo,toggleModal:to};function He(){const e=Ae.createI18n("en-us",no);return{i18n:e,i18nT:Ae.i18nTComponent(e)}}function ft(){const e=(n,r)=>(r==null?void 0:r[n])??void 0,o=(n,r)=>{if(n.length!==r.length)return!1;const a=new Set([...n,...r]);for(const l of a){const i=n.filter(c=>c===l).length,s=r.filter(c=>c===l).length;if(i!==s)return!1}return!0};return{getPropValue:e,objectsAreEqual:(n,r,a)=>{if(a){if(Object.keys(n).length===Object.keys(r).length)for(const l in n)if(Array.isArray(n[l])&&Array.isArray(r[l])){if(o(n[l],r[l]))continue;return!1}else{if(n[l]===r[l])continue;return!1}else return!1;return!0}try{return JSON.stringify(n)===JSON.stringify(r)}catch{return!1}},sortAlpha:n=>(r,a)=>{let l=r[n]===void 0||r[n]===null?"":r[n],i=a[n]===void 0||a[n]===null?"":a[n];return Array.isArray(r[n])&&(l=r[n][0]),Array.isArray(a[n])&&(i=a[n][0]),l.localeCompare(i)},isValidUuid:n=>n?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(n):!1}}function oo(e,o,n,r={fetchedItemsKey:"data",searchKeys:["id"]}){n||(n="100");const{axiosInstance:a}=Ge({headers:e.requestHeaders}),{i18n:{t:l}}=He(),{debounce:i}=Rn(),s=i(async h=>{await T(h)},200),c=t.ref(!1),d=t.ref(""),p=t.ref(""),u=t.ref([]),m=t.ref([]),f=t.ref(void 0),w=t.unref(o);let g=`${e.apiBaseUrl}${w}`;e.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:S}=ft(),y=async()=>{try{c.value=!0;const{data:h}=await a.get(`${g}?size=${n}`);h!=null&&h.next||(f.value=r.fetchedItemsKey in h?h[r.fetchedItemsKey]:[]),m.value=r.fetchedItemsKey in h?h[r.fetchedItemsKey]:[],u.value=m.value}catch{u.value=[],d.value=l("debouncedFilter.errors.fetch")}finally{c.value=!1}},b=t.ref(""),T=async h=>{var _,j,G;if(b.value!==h)if(b.value=h||"",f.value===void 0)try{if(c.value=!0,d.value="",p.value="",e.app==="konnect"){let M=g+"";h&&(M+=`/${h}`);const{data:C}=await a.get(`${M}?size=${n}`);r.fetchedItemsKey in C?u.value=C[r.fetchedItemsKey]:C!=null&&C.id?u.value=[C]:u.value=[]}else if(h){const M=[];S(h)&&r.searchKeys.includes("id")?M.push((async()=>{const{data:E}=await a.get(`${g}/${h}`);return[E[r.fetchedItemsKey]??E]})()):M.push(...r.searchKeys.filter(E=>E!=="id").map(async E=>{const{data:x}=await a.get(`${g}?${E}=${h}`);return x[r.fetchedItemsKey]}));const C=await Promise.all(M),O=new Set;u.value=[],(_=C==null?void 0:C.forEach)==null||_.call(C,E=>{var x;(x=E==null?void 0:E.forEach)==null||x.call(E,B=>{O.has(B.id)||(O.add(B.id),u.value.push(B))})})}else u.value=m.value}catch(M){((j=M==null?void 0:M.response)==null?void 0:j.status)===404?p.value=l("debouncedFilter.errors.invalid"):(u.value=[],d.value=l("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,p.value="",h?(u.value=(G=f.value)==null?void 0:G.filter(M=>{var C;let O=!1;for(const E of r.searchKeys){const x=typeof M[E]=="string"?(C=M[E])==null?void 0:C.toLowerCase():M[E];x!=null&&x.includes(h.toLowerCase())&&(O=!0)}return O}),(!u.value||!u.value.length)&&(p.value=l("debouncedFilter.errors.invalid"))):u.value=f.value,c.value=!1};return{loading:c,error:d,validationError:p,results:u,allRecords:f,loadItems:y,debouncedQueryChange:s}}function ro(e,o){const n=t.unref(o),r=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${n}`):new URL(n));return r.value.search="",a=>`${r.value.href}/${a}`}function ao(){const{i18n:{t:e}}=He();return{getMessageFromError:o=>{var n,r,a,l;if(!o)return e("errors.unexpected");if(((n=o==null?void 0:o.response)==null?void 0:n.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((r=o==null?void 0:o.response)!=null&&r.data){if(o.response.data.detail)return o.response.data.detail;if((a=o.response.data.details)!=null&&a.length)return o.response.data.details.map(i=>{let s=e("errors.unexpected");return i.messages&&typeof i.messages=="object"&&i.messages.length&&(s=i.messages.join(", ")),i.field?`${i.field} - ${s}`:s}).join("; ");if(o.response.data.message){const{message:i}=o.response.data;return Array.isArray(i)?(l=i[0])!=null&&l.constraints?Object.values(i[0].constraints)[0]:i[0]:i}if(typeof o.response.data=="string")return o.response.data;if(typeof o.response.data=="object")return Object.keys(o.response.data).map(i=>`${i} ${o.response.data[i]}`).join(", ")}return o.message||e("errors.unexpected")}}}function io(e){const o=window.location.origin,n=o.endsWith("/")?o:`${o}/`;try{const r=e.join("/"),a=`${n}${r}`,l=e.some(i=>i.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(a)&&!l&&new URL(a))return`${n}${r}`;throw new Error("Invalid url")}catch(r){return console.warn("Failed to build valid URL:",r),""}}function mt(e,o){const n=t.ref(t.unref(e)),r=t.ref(t.unref(o)),a=t.computed(()=>!!(n.value.app==="konnect"||n.value.isExactMatch)),l=t.computed(()=>r.value.startsWith("/")?new URL(`${window.location.origin}${r.value}`):new URL(r.value));return i=>{const{page:s,pageSize:c,offset:d,sortColumnKey:p,sortColumnOrder:u,query:m}=i;try{let f=new URL(l.value.href);return a.value&&m?(f.search="",f=n.value.app==="konnect"?new URL(`${f.href}?filter[name][contains]=${m}`):new URL(`${f.href}/${m}/`)):(a.value||new URLSearchParams(m).forEach((w,g)=>{f.searchParams.append(g,w)}),p&&f.searchParams.append("sort_by",p),u==="desc"&&f.searchParams.append("sort_desc","1"),f.searchParams.append("size",String(c))),d&&s!==1&&f.searchParams.append("offset",String(d)),f.href}catch(f){return console.error("RouteList(fetcher)",f),r.value}}}function lo(e,o,n="data"){const r=t.unref(o),{axiosInstance:a}=Ge({headers:e.requestHeaders}),l=mt(e,r),i=t.ref({status:ye.Idle});return{fetcher:async s=>{try{i.value={status:ye.Loading};let c=l(s);c.includes("filter[name]")&&(c=`${c}&page[size]=${s.pageSize}&page[number]=${s.page}`);const{data:d}=await a.get(c),p=n&&n.replace(/[^\w-_]/gi,"");let u;d[p]&&Array.isArray(d[p])?u=d[p]:Array.isArray(d)?u=d:u=Object.keys(d).length?[d]:[];const m={data:u,total:u.length,...d.offset?{pagination:{offset:d.offset}}:null};return i.value={status:ye.Idle,response:m},m}catch(c){const d={data:[],total:0};return s.query&&c.response.status===404?(i.value={status:ye.NoResults,response:d,error:c},d):(i.value={status:ye.Error,response:d,error:c},d)}},fetcherState:i}}function so(){const e=(n,r="_")=>n?n.split(r).map(a=>a.toLowerCase()==="id"?a.toUpperCase():a.charAt(0).toUpperCase()+a.substring(1)).join(" "):"",o=/(?:^|[\s-:'"])\w/g;return{capitalize:n=>n?n.replace(o,r=>r.toUpperCase()):"",convertKeyToTitle:e}}const gt=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,ht=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const o=e.match(gt);if(!o)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return o.shift(),o},yt=e=>e==="*"||e==="x"||e==="X",Ct=e=>{const o=parseInt(e,10);return isNaN(o)?e:o},co=(e,o)=>typeof e!=typeof o?[String(e),String(o)]:[e,o],uo=(e,o)=>{if(yt(e)||yt(o))return 0;const[n,r]=co(Ct(e),Ct(o));return n>r?1:n<r?-1:0},kt=(e,o)=>{for(let n=0;n<Math.max(e.length,o.length);n++){const r=uo(e[n]||"0",o[n]||"0");if(r!==0)return r}return 0},po=(e,o)=>{const n=ht(e),r=ht(o),a=n.pop(),l=r.pop(),i=kt(n,r);return i!==0?i:a&&l?kt(a.split("."),l.split(".")):a||l?a?-1:1:0},bt=(e,o,n)=>{fo(n);const r=po(e,o);return wt[n].includes(r)},wt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},xt=Object.keys(wt),fo=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(xt.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${xt.join("|")}`)},mo=e=>typeof e=="string"&&/^[v\d]/.test(e)&>.test(e);function go(e){const{gatewayInfo:o,supportedRange:n}=e;if(!o)return!0;const{edition:r,version:a}=o;if(!mo(a))return console.error("Invalid version"),!1;const l=n[r];if(!l)return!1;const[i,s]=l;return!(i&&bt(a,i,"<")||s&&bt(a,s,">"))}function ho(e){const o=t.ref(0),n=t.ref(0),r=t.ref(!1);return t.watch(e,a=>{a&&!r.value&&(o.value=a.offsetWidth,n.value=a.scrollWidth,r.value=!0)}),{isTruncated:t.computed(()=>o.value<n.value)}}const W={useAxios:Ge,useDebouncedFilter:oo,useDeleteUrlBuilder:ro,useErrors:ao,useExternalLinkCreator:io,useFetcher:lo,useFetchUrlBuilder:mt,useHelpers:ft,useStringHelpers:so,useI18n:He,useGatewayFeatureSupported:go,useTruncationDetector:ho},yo={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Co="Copy to clipboard",ko={message:yo,iconTitle:Co},bo="kong-ui-copy-uuid-notify",St="24px",wo=(e,o)=>{const n=e.__vccOpts||e;for(const[r,a]of o)n[r]=a;return n},xo=e=>(t.pushScopeId("data-v-ac7fcfb4"),e=e(),t.popScopeId(),e),So=["aria-hidden"],_o={key:0,"data-testid":"kui-icon-svg-title"},Bo=xo(()=>t.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)),Io=t.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:St,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const o=String(e).replace(/px/gi,""),n=Number(o);if(n&&!isNaN(n)&&Number.isInteger(n)&&n>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const o=e,n=t.computed(()=>{if(typeof o.size=="number"&&o.size>0)return`${o.size}px`;if(typeof o.size=="string"){const a=String(o.size).replace(/px/gi,""),l=Number(a);if(l&&!isNaN(l)&&Number.isInteger(l)&&l>0)return`${l}px`}return St}),r=t.computed(()=>({boxSizing:"border-box",color:o.color,display:o.display,height:n.value,lineHeight:"0",width:n.value}));return(a,l)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.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?(t.openBlock(),t.createElementBlock("title",_o,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Bo],8,So))]),_:1},8,["aria-hidden","style"]))}}),Ao=wo(Io,[["__scopeId","data-v-ac7fcfb4"]]),No="16px",Eo={class:"kong-ui-copy-uuid"},Vo=["onClick"],_t=15,To=t.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:o}){const{t:n}=Ae.createI18n("en-us",ko),r=e,a=o,l=r.notify||t.inject(bo,()=>{}),i=t.computed(()=>r.idTooltip?{label:r.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:r.uuid}),s=t.computed(()=>!!(r.tooltip&&r.successTooltip)),c=t.ref(r.tooltip),d=t.computed(()=>r.tooltip?{label:c.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),p=t.computed(()=>{var f;return r.format==="redacted"?"*****":r.format==="deleted"?`*${(f=r.uuid)==null?void 0:f.substring(0,5)}`:r.uuid}),u=f=>{c.value=f,setTimeout(()=>{c.value=r.tooltip},1800)},m=f=>{var w,g;if(!f(r.uuid)){typeof l=="function"&&l({type:"error",message:n("message.fail")}),s.value?u(n("message.fail")):a("error",r.uuid);return}const S=((w=r.uuid)==null?void 0:w.length)>_t,y=r.format==="hidden"||r.format==="redacted"?n("message.success.prefix"):`"${((g=r.uuid)==null?void 0:g.substring(0,_t))+(S?"...":"")}"`;typeof l=="function"&&l({type:"success",message:`${y}${n("message.success.content")}`}),s.value?u(r.successTooltip):a("success",r.uuid)};return(f,w)=>{const g=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Eo,[e.format!=="hidden"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),t.mergeProps({key:0},i.value,{"data-testid":"copy-id"}),{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},t.toDisplayString(p.value),3)]),_:1},16)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),t.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:t.withCtx(()=>[t.createVNode(g,null,{default:t.withCtx(({copyToClipboard:S})=>[t.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:t.withModifiers(y=>m(S),["stop"])},[t.createVNode(t.unref(Ao),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:t.unref(No),title:t.unref(n)("iconTitle")},null,8,["color","decorative","size","title"])],8,Vo)]),_:1})]),_:1},16))])}}}),$o=(e,o)=>{const n=e.__vccOpts||e;for(const[r,a]of o)n[r]=a;return n},Bt=$o(To,[["__scopeId","data-v-0c07874b"]]),jo={key:0,class:"config-card-fieldset-title"},Mo=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const o=e,{i18n:{t:n}}=W.useI18n(),{convertKeyToTitle:r}=W.useStringHelpers(),a=t.computed(()=>o.item.key??"json-array-item"),l=t.computed(()=>o.item.value??o.item),i=t.computed(()=>{const c=JSON.parse(JSON.stringify(l.value));return o.isArrayItem&&delete c.name,c}),s=t.computed(()=>{var c;return o.isArrayItem?(c=l.value)!=null&&c.name?r(l.value.name,"_"):n("baseConfigCard.general.entryTitle",{index:o.index}):""});return(c,d)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:t.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:t.withCtx(()=>[e.isArrayItem?(t.openBlock(),t.createElementBlock("legend",jo,[t.createElementVNode("b",null,t.toDisplayString(s.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(i.value),(p,u)=>(t.openBlock(),t.createBlock(Je,{key:`${a.value}-property-${u}`,item:{key:p,label:t.unref(r)(p),value:i.value[p]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),le=(e,o)=>{const n=e.__vccOpts||e;for(const[r,a]of o)n[r]=a;return n},It=le(Mo,[["__scopeId","data-v-68ca83ec"]]),Oo=t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:o}}=W.useI18n();return(n,r)=>{const a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(a,{appearance:"tertiary",class:"navigation-button",onClick:r[0]||(r[0]=l=>n.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(o)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),Fo=le(Oo,[["__scopeId","data-v-c96811e5"]]),Do=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:o}}=W.useI18n();return(n,r)=>{const a=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(a,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(o)("baseConfigCard.statusBadge.enabledLabel"):t.unref(o)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),Ko="#0044f4",qo="#e0e4ea",Lo="#3a3f51",vo="1px",Uo="20px",Po={class:"config-card-details-row"},Ro=["data-testid"],Go=["data-testid"],zo=["data-testid"],Ho=["data-testid"],Jo={key:1},Yo=["data-testid"],Wo=["data-testid"],Zo=["data-testid"],Qo=["data-testid"],Xo={name:"ConfigCardItem",components:{CopyUuid:Bt,JsonCardItem:It,StatusBadge:Do,InternalLinkItem:Fo}},er=t.defineComponent({...Xo,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:o}){t.useCssVars(w=>({"0da74440":p.value?"none":`solid ${t.unref(vo)} ${t.unref(qo)}`,"02a039da":d.value&&s.value?"block":"flex","690f3ced":d.value&&s.value?"100%":n.slim?"50%":"25%","691182c8":d.value&&s.value?"100%":n.slim?"50%":"75%"}));const n=e,r=o,a=t.useSlots(),{i18n:{t:l,formatUnixTimeStamp:i}}=W.useI18n(),s=t.computed(()=>n.item.value!==void 0&&n.item.value!==null&&n.item.value!==""),c=t.computed(()=>!!(n.item.tooltip||a["label-tooltip"])),d=t.computed(()=>n.item.type===R.Json||n.item.type===R.JsonArray),p=t.computed(()=>n.item.type===R.JsonArray),u=t.computed(()=>{switch(n.item.type){case R.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${n.item.key}-copy-uuid`,"success-tooltip":l("baseConfigCard.copy.success"),tooltip:l("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,uuid:n.item.value,notify:()=>{}}};case R.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":l("baseConfigCard.copy.success"),tooltip:l("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,notify:()=>{}}};case R.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${n.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":l("baseConfigCard.copy.success"),tooltip:l("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,uuid:n.item.value,notify:()=>{}}};case R.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":l("baseConfigCard.copy.success"),tooltip:l("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,notify:()=>{}}};case R.Date:return{tag:"div",attrs:{"data-testid":`${n.item.key}-date`},text:i(n.item.value)};case R.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${n.item.key}-badge-status`,status:n.item.value}};case R.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case R.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case R.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${n.item.key}-internal-link`,item:n.item,onNavigationClick:w=>{r("navigation-click",w)}}};case R.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${n.item.key}-external-link`,href:n.item.value},text:n.item.value};case R.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${n.item.key}-json-content`,item:n.item}};case R.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${n.item.key}-json-array-content`,item:n.item}};default:return{tag:"div",attrs:{"data-testid":`${n.item.key}-plain-text`},text:n.item.value}}}),m=t.ref(),{isTruncated:f}=W.useTruncationDetector(m);return(w,g)=>{const S=t.resolveComponent("KLabel"),y=t.resolveComponent("KBadge"),b=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",Po,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(w.$slots,"label",{item:e.item},()=>[t.createVNode(S,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.label)+" ",1)]),_:2},[c.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(w.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,Go)]),key:"0"}:void 0]),1024)],!0)],8,Ro),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(w.$slots,e.item.key,{rowValue:e.item.value},()=>[s.value?(t.openBlock(),t.createElementBlock("div",Jo,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(u.value.tag),t.normalizeProps(t.guardReactiveProps(u.value.attrs)),{default:t.withCtx(()=>[u.value.additionalComponent==="KBadge"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(T,h)=>(t.openBlock(),t.createBlock(y,{key:`${e.item.key}-badge-tag-${h}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${h}`,tooltip:T,"truncation-tooltip":""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(T),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,Yo)):t.createCommentVNode("",!0),u.value.additionalComponent==="CopyUuid"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(T,h)=>(t.openBlock(),t.createBlock(t.unref(Bt),t.mergeProps(u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${h}`,"data-testid":`${e.item.key}-copy-uuid-${h}`,uuid:T}),null,16,["data-testid","uuid"]))),128))],8,Wo)):u.value.additionalComponent==="KMethodBadge"?(t.openBlock(),t.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(T,h)=>(t.openBlock(),t.createBlock(y,{key:`${e.item.key}-badge-method-${h}`,appearance:Object.values(t.unref(vn.BadgeMethodAppearances)).includes(T.toLowerCase())?T.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${h}`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(T),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,Zo)):t.createCommentVNode("",!0),u.value.additionalComponent==="JsonCardItem"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-testid":`${n.item.key}-json-array-content`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(T,h)=>(t.openBlock(),t.createBlock(It,{key:`json-array-item-${h}`,index:h,"is-array-item":"",item:T},null,8,["index","item"]))),128))],8,Qo)):(t.openBlock(),t.createBlock(b,{key:4,label:t.unref(f)?e.item.value:""},{default:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"textContent",ref:m,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},t.toDisplayString(u.value.text),3)]),_:1},8,["label"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,Ho))],!0)],8,zo)])}}}),Je=le(er,[["__scopeId","data-v-9c87856b"]]),tr={class:"json-config"},nr={key:0,class:"json-endpoint"},At=t.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},jsonRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){t.useCssVars(a=>({cd7a6ba0:`${r.value}ch`}));const o=e,n=t.reactive(o.jsonRecord),r=t.computed(()=>{var a;if(!o.fetcherUrl)return 0;const l=(a=o.fetcherUrl)==null?void 0:a.split("/");return l.length<2?0:41+(o.requestMethod==="post"?l[l.length-1]:l[l.length-2]).length});return(a,l)=>{var i;const s=t.resolveComponent("KBadge"),c=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",tr,[o.fetcherUrl&&(i=o.config)!=null&&i.jsonYamlMilestone2Enabled?(t.openBlock(),t.createElementBlock("div",nr,[t.createVNode(s,{appearance:o.requestMethod},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(o.requestMethod),1)]),_:1},8,["appearance"]),t.createVNode(c,{id:"json-endpoint-codeblock",code:o.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),o.jsonRecord?(t.openBlock(),t.createBlock(c,{key:1,id:"json-codeblock",class:t.normalizeClass({"json-content":o.fetcherUrl}),code:JSON.stringify(n,null,2),language:"json",theme:"dark"},null,8,["class","code"])):t.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Nt(e){return typeof e>"u"||e===null}function or(e){return typeof e=="object"&&e!==null}function rr(e){return Array.isArray(e)?e:Nt(e)?[]:[e]}function ar(e,o){var n,r,a,l;if(o)for(l=Object.keys(o),n=0,r=l.length;n<r;n+=1)a=l[n],e[a]=o[a];return e}function ir(e,o){var n="",r;for(r=0;r<o;r+=1)n+=e;return n}function lr(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var sr=Nt,cr=or,dr=rr,ur=ir,pr=lr,fr=ar,Y={isNothing:sr,isObject:cr,toArray:dr,repeat:ur,isNegativeZero:pr,extend:fr};function Et(e,o){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!o&&e.mark.snippet&&(n+=`
|
|
2
2
|
|
|
3
3
|
`+e.mark.snippet),r+" "+n):r}function Ne(e,o){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=o,this.message=Et(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ne.prototype=Object.create(Error.prototype),Ne.prototype.constructor=Ne,Ne.prototype.toString=function(e){return this.name+": "+Et(this,e)};var ne=Ne;function Ye(e,o,n,r,a){var l="",i="",s=Math.floor(a/2)-1;return r-o>s&&(l=" ... ",o=r-s+l.length),n-r>s&&(i=" ...",n=r+s-i.length),{str:l+e.slice(o,n).replace(/\t/g,"→")+i,pos:r-o+l.length}}function We(e,o){return Y.repeat(" ",o-e.length)+e}function mr(e,o){if(o=Object.create(o||null),!e.buffer)return null;o.maxLength||(o.maxLength=79),typeof o.indent!="number"&&(o.indent=1),typeof o.linesBefore!="number"&&(o.linesBefore=3),typeof o.linesAfter!="number"&&(o.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],a=[],l,i=-1;l=n.exec(e.buffer);)a.push(l.index),r.push(l.index+l[0].length),e.position<=l.index&&i<0&&(i=r.length-2);i<0&&(i=r.length-1);var s="",c,d,p=Math.min(e.line+o.linesAfter,a.length).toString().length,u=o.maxLength-(o.indent+p+3);for(c=1;c<=o.linesBefore&&!(i-c<0);c++)d=Ye(e.buffer,r[i-c],a[i-c],e.position-(r[i]-r[i-c]),u),s=Y.repeat(" ",o.indent)+We((e.line-c+1).toString(),p)+" | "+d.str+`
|
|
4
4
|
`+s;for(d=Ye(e.buffer,r[i],a[i],e.position,u),s+=Y.repeat(" ",o.indent)+We((e.line+1).toString(),p)+" | "+d.str+`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/entities-consumer-groups",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3-pr.1054.75830ca1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/entities-consumer-groups.umd.js",
|
|
6
6
|
"module": "./dist/entities-consumer-groups.es.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"errorLimit": "500KB"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@kong-ui-public/entities-shared": "^2.4.
|
|
53
|
+
"@kong-ui-public/entities-shared": "^2.4.3-pr.1054.75830ca1.0"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"dev": "cross-env USE_SANDBOX=true vite",
|