@kong-ui-public/entities-consumers 4.1.3 → 4.1.4

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,9 +1,9 @@
1
- import { defineComponent as ce, ref as k, computed as I, watch as ye, resolveComponent as N, createBlock as ne, openBlock as D, unref as o, withCtx as l, createElementVNode as _, createVNode as c, createElementBlock as L, createCommentVNode as z, toDisplayString as b, Fragment as Le, renderList as He, onBeforeMount as Je, createSlots as ge, createTextVNode as te, Teleport as Qe, renderSlot as Se, reactive as Ge } from "vue";
2
- import { useRouter as De } from "vue-router";
3
- import { BookIcon as ze, AddIcon as We, TeamIcon as Ye } from "@kong/icons";
4
- import { createI18n as Xe, i18nTComponent as Ze } from "@kong-ui-public/i18n";
5
- import { useAxios as he, useDebouncedFilter as et, useTableState as tt, useFetcher as ot, useDeleteUrlBuilder as st, FetcherStatus as nt, EntityBaseTable as rt, PermissionsWrapper as le, TableTags as at, EntityFilter as it, EntityEmptyState as lt, EntityDeleteModal as ut, EntityTypes as ct, useErrors as dt, EntityBaseFormType as Me, EntityBaseForm as mt, SupportedEntityType as Re, EntityFormSection as pt, ConfigurationSchemaSection as xe, EntityBaseConfigCard as ft } from "@kong-ui-public/entities-shared";
6
- const gt = "#00abd2", vt = "24px", yt = {
1
+ import { defineComponent as ue, ref as k, computed as I, watch as ve, resolveComponent as N, createBlock as ne, openBlock as D, unref as o, withCtx as l, createElementVNode as _, createVNode as c, createElementBlock as L, createCommentVNode as z, toDisplayString as b, Fragment as je, renderList as Le, onBeforeMount as He, createSlots as fe, createTextVNode as te, Teleport as Je, renderSlot as Ee, reactive as Se } from "vue";
2
+ import { useRouter as Ae } from "vue-router";
3
+ import { BookIcon as Qe, AddIcon as ze, TeamIcon as We } from "@kong/icons";
4
+ import { createI18n as Ye, i18nTComponent as Xe } from "@kong-ui-public/i18n";
5
+ import { useAxios as ye, useDebouncedFilter as Ze, useTableState as et, useFetcher as tt, useDeleteUrlBuilder as ot, FetcherStatus as st, EntityBaseTable as nt, PermissionsWrapper as le, TableTags as rt, EntityFilter as at, EntityEmptyState as it, EntityDeleteModal as lt, EntityTypes as ut, useErrors as ct, EntityBaseFormType as Ge, EntityBaseForm as dt, SupportedEntityType as De, EntityFormSection as mt, ConfigurationSchemaSection as Me, EntityBaseConfigCard as pt } from "@kong-ui-public/entities-shared";
6
+ const ft = "#00abd2", gt = "24px", vt = {
7
7
  list: {
8
8
  table_headers: {
9
9
  username: "Username",
@@ -103,19 +103,19 @@ const gt = "#00abd2", vt = "24px", yt = {
103
103
  tooltip: "An optional set of strings associated with the Consumer for grouping and filtering."
104
104
  }
105
105
  }
106
- }, ht = {
107
- consumers: yt
106
+ }, yt = {
107
+ consumers: vt
108
108
  };
109
- function bt() {
110
- const e = Xe("en-us", ht);
109
+ function ht() {
110
+ const e = Ye("en-us", yt);
111
111
  return {
112
112
  i18n: e,
113
- i18nT: Ze(e)
113
+ i18nT: Xe(e)
114
114
  // Translation component <i18n-t>
115
115
  };
116
116
  }
117
- const de = {
118
- useI18n: bt
117
+ const ce = {
118
+ useI18n: ht
119
119
  }, oe = "/v2/control-planes/{controlPlaneId}/core-entities", se = "/{workspace}", W = {
120
120
  list: {
121
121
  konnect: {
@@ -141,13 +141,13 @@ const de = {
141
141
  edit: `${se}/consumers/{id}`
142
142
  }
143
143
  }
144
- }, Ct = { class: "add-consumer-form-container" }, _t = { class: "add-consumer-form-cta" }, kt = { class: "select-item-label" }, It = {
144
+ }, bt = { class: "add-consumer-form-container" }, Ct = { class: "add-consumer-form-cta" }, _t = { class: "select-item-label" }, kt = {
145
145
  key: 0,
146
146
  class: "select-item-desc"
147
- }, wt = {
147
+ }, It = {
148
148
  key: 0,
149
149
  class: "kong-ui-entity-add-consumers-error"
150
- }, $t = { key: 0 }, Et = /* @__PURE__ */ ce({
150
+ }, wt = { key: 0 }, $t = /* @__PURE__ */ ue({
151
151
  __name: "AddConsumerModal",
152
152
  props: {
153
153
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -165,14 +165,14 @@ const de = {
165
165
  emits: ["cancel", "add:success", "add:partial-success", "error"],
166
166
  setup(e, { emit: p }) {
167
167
  var v;
168
- const { i18n: { t: r } } = de.useI18n(), t = e, x = p, { axiosInstance: n } = he((v = t.config) == null ? void 0 : v.axiosRequestConfig), $ = k([]), {
169
- debouncedQueryChange: M,
168
+ const { i18n: { t: r } } = ce.useI18n(), t = e, $ = p, { axiosInstance: n } = ye((v = t.config) == null ? void 0 : v.axiosRequestConfig), E = k([]), {
169
+ debouncedQueryChange: x,
170
170
  loading: U,
171
171
  allRecords: B,
172
172
  error: m,
173
173
  loadItems: Y,
174
174
  results: H
175
- } = et(
175
+ } = Ze(
176
176
  t.config,
177
177
  W.list[t.config.app].all,
178
178
  "",
@@ -183,36 +183,36 @@ const de = {
183
183
  ), O = (u) => u, V = I(() => m.value ? r("consumers.errors.general") : ""), re = k(0), J = I(() => B.value === void 0), Q = I(() => H.value.map((u) => ({
184
184
  label: u.username || u.customId,
185
185
  value: u.id,
186
- selected: $.value.includes(u.id),
186
+ selected: E.value.includes(u.id),
187
187
  data: u
188
188
  // we need this to determine whether or not to show the description text
189
189
  }))), K = (u) => {
190
190
  var y;
191
- const C = J.value ? H.value.find((E) => E.id === u) : (y = B.value) == null ? void 0 : y.find((E) => E.id === u);
191
+ const C = J.value ? H.value.find((S) => S.id === u) : (y = B.value) == null ? void 0 : y.find((S) => S.id === u);
192
192
  return C ? C.username || C.custom_id : u;
193
193
  }, A = () => {
194
- F.value = "", P.value = [], g.value = [], x("cancel");
194
+ F.value = "", P.value = [], g.value = [], $("cancel");
195
195
  }, P = k([]), R = k(!1), F = k(""), X = async () => {
196
- if (!$.value.length) {
197
- F.value = "", g.value = [], x("cancel");
196
+ if (!E.value.length) {
197
+ F.value = "", g.value = [], $("cancel");
198
198
  return;
199
199
  }
200
200
  R.value = !0, F.value = "", P.value = [], g.value = [];
201
201
  try {
202
- const u = $.value.map((E) => i(E)), C = await Promise.allSettled(u);
202
+ const u = E.value.map((S) => i(S)), C = await Promise.allSettled(u);
203
203
  let y = !0;
204
- C.forEach((E) => {
205
- E.status !== "fulfilled" && (y = !1);
206
- }), y ? (P.value = [], g.value = [], x("add:success", $.value), $.value = []) : (P.value.length && x("add:partial-success", P.value), $.value = [], T(C));
204
+ C.forEach((S) => {
205
+ S.status !== "fulfilled" && (y = !1);
206
+ }), y ? (P.value = [], g.value = [], $("add:success", E.value), E.value = []) : (P.value.length && $("add:partial-success", P.value), E.value = [], T(C));
207
207
  } catch {
208
- F.value = r("consumers.errors.add"), x("error", F.value);
208
+ F.value = r("consumers.errors.add"), $("error", F.value);
209
209
  } finally {
210
210
  R.value = !1;
211
211
  }
212
212
  }, a = I(() => {
213
- var C, y, E, Z;
213
+ var C, y, S, Z;
214
214
  let u = `${t.config.apiBaseUrl}${W.list[t.config.app].forConsumerGroup}`;
215
- return t.config.app === "konnect" ? u = u.replace(/{controlPlaneId}/gi, ((C = t.config) == null ? void 0 : C.controlPlaneId) || "").replace(/{consumerGroupId}/gi, ((y = t.config) == null ? void 0 : y.consumerGroupId) || "") : t.config.app === "kongManager" && (u = u.replace(/\/{workspace}/gi, (E = t.config) != null && E.workspace ? `/${t.config.workspace}` : "").replace(/{consumerGroupId}/gi, ((Z = t.config) == null ? void 0 : Z.consumerGroupId) || "")), u;
215
+ return t.config.app === "konnect" ? u = u.replace(/{controlPlaneId}/gi, ((C = t.config) == null ? void 0 : C.controlPlaneId) || "").replace(/{consumerGroupId}/gi, ((y = t.config) == null ? void 0 : y.consumerGroupId) || "") : t.config.app === "kongManager" && (u = u.replace(/\/{workspace}/gi, (S = t.config) != null && S.workspace ? `/${t.config.workspace}` : "").replace(/{consumerGroupId}/gi, ((Z = t.config) == null ? void 0 : Z.consumerGroupId) || "")), u;
216
216
  }), i = async (u) => {
217
217
  const C = {
218
218
  consumer: u
@@ -221,8 +221,8 @@ const de = {
221
221
  const y = await n.post(a.value, C);
222
222
  return P.value.push(u), y;
223
223
  } catch (y) {
224
- let E = `${K(u)} - ${y.message}`;
225
- return y.response.status === 409 && (E = `${K(u)} - ${r("consumers.errors.already_added")}`), Promise.reject(Error(E));
224
+ let S = `${K(u)} - ${y.message}`;
225
+ return y.response.status === 409 && (S = `${K(u)} - ${r("consumers.errors.already_added")}`), Promise.reject(Error(S));
226
226
  }
227
227
  }, g = k([]), T = (u) => {
228
228
  g.value = u.map((C) => {
@@ -230,12 +230,12 @@ const de = {
230
230
  return (y = C.reason) == null ? void 0 : y.message;
231
231
  }).filter(Boolean);
232
232
  };
233
- return ye(Q, () => {
233
+ return ve(Q, () => {
234
234
  re.value++;
235
- }, { immediate: !0, deep: !0 }), ye(() => t.visible, () => {
235
+ }, { immediate: !0, deep: !0 }), ve(() => t.visible, () => {
236
236
  t.visible && Y();
237
237
  }, { immediate: !0 }), (u, C) => {
238
- const y = N("KMultiselect"), E = N("KAlert"), Z = N("KPrompt");
238
+ const y = N("KMultiselect"), S = N("KAlert"), Z = N("KPrompt");
239
239
  return D(), ne(Z, {
240
240
  "action-button-disabled": R.value,
241
241
  class: "kong-ui-entities-add-consumers-modal",
@@ -246,11 +246,11 @@ const de = {
246
246
  onProceed: X
247
247
  }, {
248
248
  default: l(() => [
249
- _("div", Ct, [
250
- _("p", _t, b(o(r)("consumers.consumer_groups.add.ctaText")), 1),
249
+ _("div", bt, [
250
+ _("p", Ct, b(o(r)("consumers.consumer_groups.add.ctaText")), 1),
251
251
  c(y, {
252
- modelValue: $.value,
253
- "onUpdate:modelValue": C[0] || (C[0] = (S) => $.value = S),
252
+ modelValue: E.value,
253
+ "onUpdate:modelValue": C[0] || (C[0] = (G) => E.value = G),
254
254
  autosuggest: "",
255
255
  "data-testid": "add-consumers-multiselect",
256
256
  "dropdown-footer-text": J.value ? o(r)("consumers.consumer_groups.add.footer") : void 0,
@@ -261,20 +261,20 @@ const de = {
261
261
  readonly: R.value,
262
262
  required: "",
263
263
  width: "100%",
264
- onQueryChange: o(M)
264
+ onQueryChange: o(x)
265
265
  }, {
266
- "item-template": l(({ item: S }) => [
267
- _("div", kt, b(S.label), 1),
268
- O(S).data.username && O(S).data.custom_id ? (D(), L("div", It, b(O(S).data.custom_id), 1)) : z("", !0)
266
+ "item-template": l(({ item: G }) => [
267
+ _("div", _t, b(G.label), 1),
268
+ O(G).data.username && O(G).data.custom_id ? (D(), L("div", kt, b(O(G).data.custom_id), 1)) : z("", !0)
269
269
  ]),
270
270
  _: 1
271
271
  }, 8, ["modelValue", "dropdown-footer-text", "items", "label", "loading", "placeholder", "readonly", "onQueryChange"]),
272
- F.value || V.value || g.value.length ? (D(), L("div", wt, [
273
- c(E, { appearance: "danger" }, {
272
+ F.value || V.value || g.value.length ? (D(), L("div", It, [
273
+ c(S, { appearance: "danger" }, {
274
274
  default: l(() => [
275
275
  _("p", null, b(o(r)("consumers.errors.add")), 1),
276
- g.value.length ? (D(), L("ul", $t, [
277
- (D(!0), L(Le, null, He(g.value, (S, ee) => (D(), L("li", { key: ee }, b(S), 1))), 128))
276
+ g.value.length ? (D(), L("ul", wt, [
277
+ (D(!0), L(je, null, Le(g.value, (G, ee) => (D(), L("li", { key: ee }, b(G), 1))), 128))
278
278
  ])) : z("", !0),
279
279
  _("div", null, b(F.value || V.value), 1)
280
280
  ]),
@@ -287,12 +287,12 @@ const de = {
287
287
  }, 8, ["action-button-disabled", "title", "visible"]);
288
288
  };
289
289
  }
290
- }), be = (e, p) => {
290
+ }), he = (e, p) => {
291
291
  const r = e.__vccOpts || e;
292
- for (const [t, x] of p)
293
- r[t] = x;
292
+ for (const [t, $] of p)
293
+ r[t] = $;
294
294
  return r;
295
- }, St = /* @__PURE__ */ be(Et, [["__scopeId", "data-v-d54468ab"]]), Gt = { class: "kong-ui-entities-consumers-list" }, Mt = { class: "button-row" }, xt = { class: "empty-state-wrapper" }, At = { class: "empty-state-icon-gateway" }, Dt = /* @__PURE__ */ ce({
295
+ }, Et = /* @__PURE__ */ he($t, [["__scopeId", "data-v-d54468ab"]]), St = { class: "kong-ui-entities-consumers-list" }, Gt = { class: "button-row" }, Mt = { class: "empty-state-wrapper" }, xt = { class: "empty-state-icon-gateway" }, At = /* @__PURE__ */ ue({
296
296
  __name: "ConsumerList",
297
297
  props: {
298
298
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -338,8 +338,8 @@ const de = {
338
338
  },
339
339
  emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success", "add:success", "remove:success"],
340
340
  setup(e, { emit: p }) {
341
- var Ee;
342
- const r = p, t = e, { i18nT: x, i18n: { t: n } } = de.useI18n(), $ = De(), { axiosInstance: M } = he((Ee = t.config) == null ? void 0 : Ee.axiosRequestConfig), U = I(() => t.config.app !== "kongManager" || !!t.config.disableSorting), B = {
341
+ var $e;
342
+ const r = p, t = e, { i18nT: $, i18n: { t: n } } = ce.useI18n(), E = Ae(), { axiosInstance: x } = ye(($e = t.config) == null ? void 0 : $e.axiosRequestConfig), U = I(() => t.config.app !== "kongManager" || !!t.config.disableSorting), B = {
343
343
  // the Username column is non-hidable
344
344
  username: { label: n("consumers.list.table_headers.username"), searchable: !0, sortable: !0, hidable: !1 },
345
345
  custom_id: { label: n("consumers.list.table_headers.custom_id"), searchable: !0, sortable: !0 },
@@ -347,7 +347,7 @@ const de = {
347
347
  }, m = B, Y = (s) => ({
348
348
  "data-testid": s.username ?? s.custom_id ?? s.id
349
349
  }), H = () => {
350
- t.config.consumerGroupId ? _e() : $.push(t.config.createRoute);
350
+ t.config.consumerGroupId ? Ce() : E.push(t.config.createRoute);
351
351
  }, O = I(() => {
352
352
  var d, h, w, j;
353
353
  let s = `${t.config.apiBaseUrl}${W.list[t.config.app][A.value ? "forConsumerGroup" : "all"]}`;
@@ -365,13 +365,13 @@ const de = {
365
365
  },
366
366
  schema: t.config.filterSchema
367
367
  };
368
- }), { hasRecords: J, handleStateChange: Q } = tt(V), K = I(() => J.value && t.config.app === "konnect"), A = I(() => !!t.config.consumerGroupId), P = I(
368
+ }), { hasRecords: J, handleStateChange: Q } = et(V), K = I(() => J.value && t.config.app === "konnect"), A = I(() => !!t.config.consumerGroupId), P = I(
369
369
  () => A.value ? "kong-ui-entities-consumers-list-in-group-page" : "kong-ui-entities-consumers-list"
370
370
  ), R = I(() => A.value && !t.config.paginatedEndpoint ? "consumers" : void 0), {
371
371
  fetcher: F,
372
372
  fetcherState: X,
373
373
  fetcherCacheKey: a
374
- } = ot(I(() => ({ ...t.config, cacheIdentifier: t.cacheIdentifier })), O, R), i = () => {
374
+ } = tt(I(() => ({ ...t.config, cacheIdentifier: t.cacheIdentifier })), O, R), i = () => {
375
375
  V.value = "";
376
376
  }, g = () => {
377
377
  a.value++;
@@ -405,61 +405,61 @@ const de = {
405
405
  });
406
406
  }, y = async (s) => {
407
407
  var h;
408
- await ((h = t.canRetrieve) == null ? void 0 : h.call(t, s)) && $.push(t.config.getViewRoute(s.id));
409
- }, E = (s) => ({
408
+ await ((h = t.canRetrieve) == null ? void 0 : h.call(t, s)) && E.push(t.config.getViewRoute(s.id));
409
+ }, S = (s) => ({
410
410
  label: n("consumers.actions.view"),
411
411
  to: t.config.getViewRoute(s)
412
412
  }), Z = (s) => ({
413
413
  label: n("consumers.actions.edit"),
414
414
  to: t.config.getEditRoute(s)
415
- }), S = k(void 0), ee = k(!1), ae = k(!1), Ce = k(""), Te = st(t.config, O.value), Ue = (s) => {
416
- S.value = s, ee.value = !0;
417
- }, Ve = () => {
415
+ }), G = k(void 0), ee = k(!1), ae = k(!1), be = k(""), Re = ot(t.config, O.value), Te = (s) => {
416
+ G.value = s, ee.value = !0;
417
+ }, Ue = () => {
418
418
  ee.value = !1;
419
- }, Fe = async () => {
419
+ }, Ve = async () => {
420
420
  var s, d, h;
421
- if ((s = S.value) != null && s.id) {
421
+ if ((s = G.value) != null && s.id) {
422
422
  ae.value = !0;
423
423
  try {
424
- await M.delete(Te(S.value.id)), ae.value = !1, ee.value = !1, a.value++, r("delete:success", S.value);
424
+ await x.delete(Re(G.value.id)), ae.value = !1, ee.value = !1, a.value++, r("delete:success", G.value);
425
425
  } catch (w) {
426
- Ce.value = ((h = (d = w.response) == null ? void 0 : d.data) == null ? void 0 : h.message) || w.message || n("consumers.errors.delete"), r("error", w);
426
+ be.value = ((h = (d = w.response) == null ? void 0 : d.data) == null ? void 0 : h.message) || w.message || n("consumers.errors.delete"), r("error", w);
427
427
  } finally {
428
428
  ae.value = !1;
429
429
  }
430
430
  }
431
- }, me = k(!1), _e = () => {
432
- me.value = !0;
433
- }, ke = () => {
434
- me.value = !1;
435
- }, Ie = (s, d) => {
436
- d || ke(), a.value++, r("add:success", s);
437
- }, Pe = () => {
438
- A.value && _e();
439
- }, q = k(void 0), pe = k(!1), Be = k(""), Ke = (s) => {
440
- q.value = s, pe.value = !0;
441
- }, we = () => {
442
- pe.value = !1, q.value = void 0;
443
- }, qe = I(() => {
431
+ }, de = k(!1), Ce = () => {
432
+ de.value = !0;
433
+ }, _e = () => {
434
+ de.value = !1;
435
+ }, ke = (s, d) => {
436
+ d || _e(), a.value++, r("add:success", s);
437
+ }, Fe = () => {
438
+ A.value && Ce();
439
+ }, q = k(void 0), me = k(!1), Pe = k(""), Be = (s) => {
440
+ q.value = s, me.value = !0;
441
+ }, Ie = () => {
442
+ me.value = !1, q.value = void 0;
443
+ }, Ke = I(() => {
444
444
  var d, h, w, j;
445
445
  let s = `${t.config.apiBaseUrl}${W.list[t.config.app].oneForConsumerGroup}`;
446
446
  return t.config.app === "konnect" ? s = s.replace(/{controlPlaneId}/gi, ((d = t.config) == null ? void 0 : d.controlPlaneId) || "").replace(/{consumerGroupId}/gi, ((h = t.config) == null ? void 0 : h.consumerGroupId) || "") : t.config.app === "kongManager" && (s = s.replace(/\/{workspace}/gi, (w = t.config) != null && w.workspace ? `/${t.config.workspace}` : "").replace(/{consumerGroupId}/gi, ((j = t.config) == null ? void 0 : j.consumerGroupId) || "")), s;
447
- }), $e = k(!1), Ne = async () => {
447
+ }), we = k(!1), qe = async () => {
448
448
  if (q.value) {
449
- $e.value = !0;
449
+ we.value = !0;
450
450
  try {
451
- const s = qe.value.replace(/{consumerId}/gi, q.value.id);
452
- await M.delete(s), r("remove:success", q.value), we(), a.value++;
451
+ const s = Ke.value.replace(/{consumerId}/gi, q.value.id);
452
+ await x.delete(s), r("remove:success", q.value), Ie(), a.value++;
453
453
  } catch (s) {
454
- Be.value = s.message || n("consumers.errors.delete"), r("error", s);
454
+ Pe.value = s.message || n("consumers.errors.delete"), r("error", s);
455
455
  } finally {
456
- $e.value = !1;
456
+ we.value = !1;
457
457
  }
458
458
  }
459
459
  };
460
- ye(X, (s) => {
460
+ ve(X, (s) => {
461
461
  var d, h, w;
462
- if (s.status === nt.Error) {
462
+ if (s.status === st.Error) {
463
463
  v.value = {
464
464
  title: n("consumers.errors.general")
465
465
  }, (w = (h = (d = s.error) == null ? void 0 : d.response) == null ? void 0 : h.data) != null && w.message && (v.value.message = s.error.response.data.message), r("error", s.error);
@@ -467,21 +467,21 @@ const de = {
467
467
  }
468
468
  v.value = null;
469
469
  });
470
- const fe = k({
470
+ const pe = k({
471
471
  ctaPath: A.value ? void 0 : t.config.createRoute,
472
472
  ctaText: void 0,
473
473
  message: `${n("consumers.list.empty_state.description")}${t.config.additionMessageForEmptyState ? ` ${t.config.additionMessageForEmptyState}` : ""}`,
474
474
  title: n("consumers.title")
475
475
  });
476
- return Je(async () => {
477
- await t.canCreate() && (fe.value.title = A.value ? n("consumers.list.empty_state.title_for_consumer_group") : n("consumers.list.empty_state.title"), fe.value.ctaText = A.value ? n("consumers.actions.add_consumer") : n("consumers.actions.create"));
476
+ return He(async () => {
477
+ await t.canCreate() && (pe.value.title = A.value ? n("consumers.list.empty_state.title_for_consumer_group") : n("consumers.list.empty_state.title"), pe.value.ctaText = A.value ? n("consumers.actions.add_consumer") : n("consumers.actions.create"));
478
478
  }), (s, d) => {
479
- const h = N("KButton"), w = N("KDropdownItem"), j = N("KClipboardProvider"), Oe = N("KPrompt");
480
- return D(), L("div", Gt, [
481
- c(o(rt), {
479
+ const h = N("KButton"), w = N("KDropdownItem"), j = N("KClipboardProvider"), Ne = N("KPrompt");
480
+ return D(), L("div", St, [
481
+ c(o(nt), {
482
482
  "cache-identifier": e.cacheIdentifier,
483
483
  "disable-sorting": U.value,
484
- "empty-state-options": fe.value,
484
+ "empty-state-options": pe.value,
485
485
  "enable-entity-actions": "",
486
486
  "error-message": v.value,
487
487
  fetcher: o(F),
@@ -494,13 +494,13 @@ const de = {
494
494
  "table-headers": o(m),
495
495
  onClearSearchInput: i,
496
496
  "onClick:row": d[3] || (d[3] = (f) => y(f)),
497
- onEmptyStateCtaClicked: Pe,
497
+ onEmptyStateCtaClicked: Fe,
498
498
  onSort: g,
499
499
  onState: o(Q)
500
- }, ge({
500
+ }, fe({
501
501
  "toolbar-filter": l(() => [
502
- Se(s.$slots, "toolbar-filter", {}, void 0, !0),
503
- A.value ? z("", !0) : (D(), ne(o(it), {
502
+ Ee(s.$slots, "toolbar-filter", {}, void 0, !0),
503
+ A.value ? z("", !0) : (D(), ne(o(at), {
504
504
  key: 0,
505
505
  modelValue: V.value,
506
506
  "onUpdate:modelValue": d[0] || (d[0] = (f) => V.value = f),
@@ -508,11 +508,11 @@ const de = {
508
508
  }, null, 8, ["modelValue", "config"]))
509
509
  ]),
510
510
  "toolbar-button": l(() => [
511
- (D(), ne(Qe, {
511
+ (D(), ne(Je, {
512
512
  disabled: !e.useActionOutside,
513
513
  to: "#kong-ui-app-page-header-action-button"
514
514
  }, [
515
- _("div", Mt, [
515
+ _("div", Gt, [
516
516
  !A.value && K.value ? (D(), ne(h, {
517
517
  key: 0,
518
518
  appearance: "secondary",
@@ -522,7 +522,7 @@ const de = {
522
522
  onClick: d[1] || (d[1] = (f) => s.$emit("click:learn-more"))
523
523
  }, {
524
524
  default: l(() => [
525
- c(o(ze), { decorative: "" })
525
+ c(o(Qe), { decorative: "" })
526
526
  ]),
527
527
  _: 1
528
528
  })) : z("", !0),
@@ -537,7 +537,7 @@ const de = {
537
537
  onClick: H
538
538
  }, {
539
539
  default: l(() => [
540
- c(o(We)),
540
+ c(o(ze)),
541
541
  te(" " + b(e.config.consumerGroupId ? o(n)("consumers.actions.add_consumer") : o(n)("consumers.list.toolbar_actions.new_consumer")), 1)
542
542
  ]),
543
543
  _: 1
@@ -555,14 +555,14 @@ const de = {
555
555
  te(b(T(f)), 1)
556
556
  ]),
557
557
  tags: l(({ rowValue: f }) => [
558
- c(o(at), { tags: f }, null, 8, ["tags"])
558
+ c(o(rt), { tags: f }, null, 8, ["tags"])
559
559
  ]),
560
560
  actions: l(({ row: f }) => [
561
561
  c(j, null, {
562
562
  default: l(({ copyToClipboard: ie }) => [
563
563
  c(w, {
564
564
  "data-testid": "action-entity-copy-id",
565
- onClick: (je) => u(f, ie)
565
+ onClick: (Oe) => u(f, ie)
566
566
  }, {
567
567
  default: l(() => [
568
568
  te(b(o(n)("consumers.actions.copy_id")), 1)
@@ -576,7 +576,7 @@ const de = {
576
576
  default: l(({ copyToClipboard: ie }) => [
577
577
  c(w, {
578
578
  "data-testid": "action-entity-copy-json",
579
- onClick: (je) => C(f, ie)
579
+ onClick: (Oe) => C(f, ie)
580
580
  }, {
581
581
  default: l(() => [
582
582
  te(b(o(n)("consumers.actions.copy_json")), 1)
@@ -593,7 +593,7 @@ const de = {
593
593
  c(w, {
594
594
  "data-testid": "action-entity-view",
595
595
  "has-divider": "",
596
- item: E(f.id)
596
+ item: S(f.id)
597
597
  }, null, 8, ["item"])
598
598
  ]),
599
599
  _: 2
@@ -617,7 +617,7 @@ const de = {
617
617
  danger: "",
618
618
  "data-testid": "action-entity-delete",
619
619
  "has-divider": "",
620
- onClick: () => e.config.consumerGroupId ? Ke(f) : Ue(f)
620
+ onClick: () => e.config.consumerGroupId ? Be(f) : Te(f)
621
621
  }, {
622
622
  default: l(() => [
623
623
  te(b(e.config.consumerGroupId ? o(n)("consumers.actions.remove") : o(n)("consumers.actions.delete")), 1)
@@ -635,9 +635,9 @@ const de = {
635
635
  fn: l(() => {
636
636
  var f;
637
637
  return [
638
- _("div", xt, [
639
- Se(s.$slots, "empty-state-toolbar", {}, void 0, !0),
640
- c(o(lt), {
638
+ _("div", Mt, [
639
+ Ee(s.$slots, "empty-state-toolbar", {}, void 0, !0),
640
+ c(o(it), {
641
641
  "action-button-text": o(n)("consumers.list.toolbar_actions.new_consumer"),
642
642
  appearance: "secondary",
643
643
  "can-create": () => e.canCreate(),
@@ -647,12 +647,12 @@ const de = {
647
647
  title: o(n)("consumers.list.empty_state_v2.title"),
648
648
  "onClick:create": H,
649
649
  "onClick:learnMore": d[2] || (d[2] = (ie) => s.$emit("click:learn-more"))
650
- }, ge({
650
+ }, fe({
651
651
  image: l(() => [
652
- _("div", At, [
653
- c(o(Ye), {
654
- color: o(gt),
655
- size: o(vt)
652
+ _("div", xt, [
653
+ c(o(We), {
654
+ color: o(ft),
655
+ size: o(gt)
656
656
  }, null, 8, ["color", "size"])
657
657
  ])
658
658
  ]),
@@ -672,42 +672,42 @@ const de = {
672
672
  key: "0"
673
673
  } : void 0
674
674
  ]), 1032, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "hide-pagination", "preferences-storage-key", "query", "table-headers", "onState"]),
675
- c(o(ut), {
675
+ c(o(lt), {
676
676
  "action-button-disabled": ae.value,
677
677
  "data-testid": "delete-consumer-modal",
678
678
  description: o(n)("consumers.delete.description"),
679
- "entity-name": S.value && (S.value.username || S.value.custom_id || S.value.id),
680
- "entity-type": o(ct).Consumer,
681
- error: Ce.value,
679
+ "entity-name": G.value && (G.value.username || G.value.custom_id || G.value.id),
680
+ "entity-type": o(ut).Consumer,
681
+ error: be.value,
682
682
  title: o(n)("consumers.delete.title"),
683
683
  visible: ee.value,
684
- onCancel: Ve,
685
- onProceed: Fe
684
+ onCancel: Ue,
685
+ onProceed: Ve
686
686
  }, null, 8, ["action-button-disabled", "description", "entity-name", "entity-type", "error", "title", "visible"]),
687
- e.config.consumerGroupId ? (D(), ne(St, {
687
+ e.config.consumerGroupId ? (D(), ne(Et, {
688
688
  key: 0,
689
689
  config: e.config,
690
690
  "data-testid": "add-consumer-modal",
691
- visible: me.value,
692
- "onAdd:partialSuccess": d[4] || (d[4] = (f) => Ie(f, !0)),
693
- "onAdd:success": d[5] || (d[5] = (f) => Ie(f)),
694
- onCancel: ke
691
+ visible: de.value,
692
+ "onAdd:partialSuccess": d[4] || (d[4] = (f) => ke(f, !0)),
693
+ "onAdd:success": d[5] || (d[5] = (f) => ke(f)),
694
+ onCancel: _e
695
695
  }, null, 8, ["config", "visible"])) : z("", !0),
696
- e.config.consumerGroupId && q.value ? (D(), ne(Oe, {
696
+ e.config.consumerGroupId && q.value ? (D(), ne(Ne, {
697
697
  key: 1,
698
698
  "action-button-appearance": "danger",
699
699
  "data-testid": "remove-consumer-modal",
700
700
  title: o(n)("consumers.consumer_groups.remove.title"),
701
- visible: pe.value,
702
- onCancel: we,
703
- onProceed: Ne
701
+ visible: me.value,
702
+ onCancel: Ie,
703
+ onProceed: qe
704
704
  }, {
705
705
  default: l(() => [
706
- c(o(x), {
706
+ c(o($), {
707
707
  class: "message",
708
708
  keypath: e.config.consumerGroupName ? "consumers.consumer_groups.remove.confirmation" : "consumers.consumer_groups.remove.confirmationNoCG",
709
709
  tag: "p"
710
- }, ge({
710
+ }, fe({
711
711
  consumer: l(() => [
712
712
  _("strong", null, b(q.value.username || q.value.custom_id || q.value.id), 1)
713
713
  ]),
@@ -728,31 +728,34 @@ const de = {
728
728
  ]);
729
729
  };
730
730
  }
731
- }), zt = /* @__PURE__ */ be(Dt, [["__scopeId", "data-v-c5be280d"]]);
732
- var G = [];
733
- for (var ve = 0; ve < 256; ++ve)
734
- G.push((ve + 256).toString(16).slice(1));
735
- function Rt(e, p = 0) {
736
- return (G[e[p + 0]] + G[e[p + 1]] + G[e[p + 2]] + G[e[p + 3]] + "-" + G[e[p + 4]] + G[e[p + 5]] + "-" + G[e[p + 6]] + G[e[p + 7]] + "-" + G[e[p + 8]] + G[e[p + 9]] + "-" + G[e[p + 10]] + G[e[p + 11]] + G[e[p + 12]] + G[e[p + 13]] + G[e[p + 14]] + G[e[p + 15]]).toLowerCase();
731
+ }), Qt = /* @__PURE__ */ he(At, [["__scopeId", "data-v-c5be280d"]]), M = [];
732
+ for (let e = 0; e < 256; ++e)
733
+ M.push((e + 256).toString(16).slice(1));
734
+ function Dt(e, p = 0) {
735
+ return (M[e[p + 0]] + M[e[p + 1]] + M[e[p + 2]] + M[e[p + 3]] + "-" + M[e[p + 4]] + M[e[p + 5]] + "-" + M[e[p + 6]] + M[e[p + 7]] + "-" + M[e[p + 8]] + M[e[p + 9]] + "-" + M[e[p + 10]] + M[e[p + 11]] + M[e[p + 12]] + M[e[p + 13]] + M[e[p + 14]] + M[e[p + 15]]).toLowerCase();
737
736
  }
738
- var ue, Tt = new Uint8Array(16);
739
- function Ut() {
740
- if (!ue && (ue = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ue))
741
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
742
- return ue(Tt);
737
+ let ge;
738
+ const Rt = new Uint8Array(16);
739
+ function Tt() {
740
+ if (!ge) {
741
+ if (typeof crypto > "u" || !crypto.getRandomValues)
742
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
743
+ ge = crypto.getRandomValues.bind(crypto);
744
+ }
745
+ return ge(Rt);
743
746
  }
744
- var Vt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
745
- const Ae = {
746
- randomUUID: Vt
747
- };
748
- function Ft(e, p, r) {
749
- if (Ae.randomUUID && !e)
750
- return Ae.randomUUID();
747
+ const Ut = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), xe = { randomUUID: Ut };
748
+ function Vt(e, p, r) {
749
+ var $;
750
+ if (xe.randomUUID && !e)
751
+ return xe.randomUUID();
751
752
  e = e || {};
752
- var t = e.random || (e.rng || Ut)();
753
- return t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128, Rt(t);
753
+ const t = e.random ?? (($ = e.rng) == null ? void 0 : $.call(e)) ?? Tt();
754
+ if (t.length < 16)
755
+ throw new Error("Random bytes length must be >= 16");
756
+ return t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128, Dt(t);
754
757
  }
755
- const Pt = { class: "kong-ui-entities-consumer-form" }, Bt = ["id"], Kt = { class: "fields-group-text" }, qt = ["aria-labelledby"], Nt = /* @__PURE__ */ ce({
758
+ const Ft = { class: "kong-ui-entities-consumer-form" }, Pt = ["id"], Bt = { class: "fields-group-text" }, Kt = ["aria-labelledby"], qt = /* @__PURE__ */ ue({
756
759
  __name: "ConsumerForm",
757
760
  props: {
758
761
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -771,7 +774,7 @@ const Pt = { class: "kong-ui-entities-consumer-form" }, Bt = ["id"], Kt = { clas
771
774
  emits: ["update", "error", "loading"],
772
775
  setup(e, { emit: p }) {
773
776
  var X;
774
- const r = e, t = p, { i18nT: x, i18n: { t: n } } = de.useI18n(), $ = De(), { axiosInstance: M } = he((X = r.config) == null ? void 0 : X.axiosRequestConfig), { getMessageFromError: U } = dt(), B = Ft(), m = Ge({
777
+ const r = e, t = p, { i18nT: $, i18n: { t: n } } = ce.useI18n(), E = Ae(), { axiosInstance: x } = ye((X = r.config) == null ? void 0 : X.axiosRequestConfig), { getMessageFromError: U } = ct(), B = Vt(), m = Se({
775
778
  fields: {
776
779
  username: "",
777
780
  customId: "",
@@ -779,7 +782,7 @@ const Pt = { class: "kong-ui-entities-consumer-form" }, Bt = ["id"], Kt = { clas
779
782
  },
780
783
  readonly: !1,
781
784
  errorMessage: ""
782
- }), Y = Ge({
785
+ }), Y = Se({
783
786
  username: "",
784
787
  customId: "",
785
788
  tags: ""
@@ -788,7 +791,7 @@ const Pt = { class: "kong-ui-entities-consumer-form" }, Bt = ["id"], Kt = { clas
788
791
  return (i = W.form[(a = r.config) == null ? void 0 : a.app]) == null ? void 0 : i.edit;
789
792
  }), O = () => {
790
793
  var a;
791
- $.push(((a = r.config) == null ? void 0 : a.cancelRoute) || { name: "consumer-list" });
794
+ E.push(((a = r.config) == null ? void 0 : a.cancelRoute) || { name: "consumer-list" });
792
795
  }, V = (a) => {
793
796
  t("loading", a);
794
797
  }, re = (a) => {
@@ -798,7 +801,7 @@ const Pt = { class: "kong-ui-entities-consumer-form" }, Bt = ["id"], Kt = { clas
798
801
  m.fields.username = ((g = a == null ? void 0 : a.item) == null ? void 0 : g.username) || (a == null ? void 0 : a.username) || "", m.fields.customId = ((T = a == null ? void 0 : a.item) == null ? void 0 : T.custom_id) || (a == null ? void 0 : a.custom_id) || "";
799
802
  const i = ((v = a == null ? void 0 : a.item) == null ? void 0 : v.tags) || (a == null ? void 0 : a.tags) || [];
800
803
  m.fields.tags = (i == null ? void 0 : i.join(", ")) || "", Object.assign(Y, m.fields);
801
- }, Q = I(() => r.consumerId ? Me.Edit : Me.Create), K = (a) => {
804
+ }, Q = I(() => r.consumerId ? Ge.Edit : Ge.Create), K = (a) => {
802
805
  var g, T, v, u, C, y;
803
806
  let i = `${(g = r.config) == null ? void 0 : g.apiBaseUrl}${W.form[(T = r.config) == null ? void 0 : T.app][a]}`;
804
807
  return ((v = r.config) == null ? void 0 : v.app) === "konnect" ? i = i.replace(/{controlPlaneId}/gi, ((u = r.config) == null ? void 0 : u.controlPlaneId) || "") : ((C = r.config) == null ? void 0 : C.app) === "kongManager" && (i = i.replace(/\/{workspace}/gi, (y = r.config) != null && y.workspace ? `/${r.config.workspace}` : "")), i = i.replace(/{id}/gi, r.consumerId), i;
@@ -814,7 +817,7 @@ const Pt = { class: "kong-ui-entities-consumer-form" }, Bt = ["id"], Kt = { clas
814
817
  try {
815
818
  m.readonly = !0;
816
819
  let i;
817
- await M.post(K("validate"), R.value), Q.value === "create" ? i = await M.post(K("create"), R.value) : Q.value === "edit" && (i = ((a = r.config) == null ? void 0 : a.app) === "konnect" ? await M.put(K("edit"), R.value) : await M.patch(K("edit"), R.value)), J(i == null ? void 0 : i.data), t("update", i == null ? void 0 : i.data);
820
+ await x.post(K("validate"), R.value), Q.value === "create" ? i = await x.post(K("create"), R.value) : Q.value === "edit" && (i = ((a = r.config) == null ? void 0 : a.app) === "konnect" ? await x.put(K("edit"), R.value) : await x.patch(K("edit"), R.value)), J(i == null ? void 0 : i.data), t("update", i == null ? void 0 : i.data);
818
821
  } catch (i) {
819
822
  m.errorMessage = U(i), t("error", i);
820
823
  } finally {
@@ -823,12 +826,12 @@ const Pt = { class: "kong-ui-entities-consumer-form" }, Bt = ["id"], Kt = { clas
823
826
  };
824
827
  return (a, i) => {
825
828
  const g = N("KInput"), T = N("KCard");
826
- return D(), L("div", Pt, [
827
- c(o(mt), {
829
+ return D(), L("div", Ft, [
830
+ c(o(dt), {
828
831
  "can-submit": A.value && P.value,
829
832
  config: e.config,
830
833
  "edit-id": e.consumerId,
831
- "entity-type": o(Re).Consumer,
834
+ "entity-type": o(De).Consumer,
832
835
  "error-message": m.errorMessage,
833
836
  "fetch-url": H.value,
834
837
  "form-fields": R.value,
@@ -841,7 +844,7 @@ const Pt = { class: "kong-ui-entities-consumer-form" }, Bt = ["id"], Kt = { clas
841
844
  }, {
842
845
  default: l(() => [
843
846
  _("div", null, [
844
- c(o(pt), {
847
+ c(o(mt), {
845
848
  description: o(n)("consumers.form.info.description"),
846
849
  "has-divider": "",
847
850
  title: o(n)("consumers.form.info.title")
@@ -851,8 +854,8 @@ const Pt = { class: "kong-ui-entities-consumer-form" }, Bt = ["id"], Kt = { clas
851
854
  _("h3", {
852
855
  id: `fields-group-title-${o(B)}`,
853
856
  class: "fields-group-title"
854
- }, b(o(n)("consumers.form.consumer_identification.title")) + "* ", 9, Bt),
855
- _("p", Kt, b(o(n)("consumers.form.consumer_identification.description")), 1)
857
+ }, b(o(n)("consumers.form.consumer_identification.title")) + "* ", 9, Pt),
858
+ _("p", Bt, b(o(n)("consumers.form.consumer_identification.description")), 1)
856
859
  ]),
857
860
  c(T, null, {
858
861
  default: l(() => [
@@ -873,7 +876,7 @@ const Pt = { class: "kong-ui-entities-consumer-form" }, Bt = ["id"], Kt = { clas
873
876
  type: "text"
874
877
  }, {
875
878
  "label-tooltip": l(() => [
876
- c(o(x), {
879
+ c(o($), {
877
880
  keypath: "consumers.fields.username.tooltip",
878
881
  scope: "global"
879
882
  }, {
@@ -898,7 +901,7 @@ const Pt = { class: "kong-ui-entities-consumer-form" }, Bt = ["id"], Kt = { clas
898
901
  type: "text"
899
902
  }, {
900
903
  "label-tooltip": l(() => [
901
- c(o(x), {
904
+ c(o($), {
902
905
  keypath: "consumers.fields.custom_id.tooltip",
903
906
  scope: "global"
904
907
  }, {
@@ -910,7 +913,7 @@ const Pt = { class: "kong-ui-entities-consumer-form" }, Bt = ["id"], Kt = { clas
910
913
  ]),
911
914
  _: 1
912
915
  }, 8, ["modelValue", "label", "placeholder", "readonly"])
913
- ], 8, qt)
916
+ ], 8, Kt)
914
917
  ]),
915
918
  _: 1
916
919
  }),
@@ -940,7 +943,7 @@ const Pt = { class: "kong-ui-entities-consumer-form" }, Bt = ["id"], Kt = { clas
940
943
  ]);
941
944
  };
942
945
  }
943
- }), Wt = /* @__PURE__ */ be(Nt, [["__scopeId", "data-v-ab3e5b9b"]]), Ot = { class: "kong-ui-consumer-entity-config-card" }, Yt = /* @__PURE__ */ ce({
946
+ }), zt = /* @__PURE__ */ he(qt, [["__scopeId", "data-v-ab3e5b9b"]]), Nt = { class: "kong-ui-consumer-entity-config-card" }, Wt = /* @__PURE__ */ ue({
944
947
  __name: "ConsumerConfigCard",
945
948
  props: {
946
949
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -967,15 +970,15 @@ const Pt = { class: "kong-ui-entities-consumer-form" }, Bt = ["id"], Kt = { clas
967
970
  },
968
971
  emits: ["loading", "fetch:error", "fetch:success"],
969
972
  setup(e) {
970
- const p = e, { i18n: { t: r }, i18nT: t } = de.useI18n(), x = I(() => W.form[p.config.app].edit), n = k({
973
+ const p = e, { i18n: { t: r }, i18nT: t } = ce.useI18n(), $ = I(() => W.form[p.config.app].edit), n = k({
971
974
  id: {},
972
975
  username: {
973
- section: xe.Basic,
976
+ section: Me.Basic,
974
977
  tooltip: r("consumers.fields.username.tooltip"),
975
978
  order: 1
976
979
  },
977
980
  custom_id: {
978
- section: xe.Basic,
981
+ section: Me.Basic,
979
982
  tooltip: r("consumers.fields.custom_id.tooltip"),
980
983
  label: r("consumers.fields.custom_id.label"),
981
984
  order: 2
@@ -992,17 +995,17 @@ const Pt = { class: "kong-ui-entities-consumer-form" }, Bt = ["id"], Kt = { clas
992
995
  hidden: !0
993
996
  }
994
997
  });
995
- return ($, M) => (D(), L("div", Ot, [
996
- c(o(ft), {
998
+ return (E, x) => (D(), L("div", Nt, [
999
+ c(o(pt), {
997
1000
  config: e.config,
998
1001
  "config-card-doc": e.configCardDoc,
999
1002
  "config-schema": n.value,
1000
- "entity-type": o(Re).Consumer,
1001
- "fetch-url": x.value,
1003
+ "entity-type": o(De).Consumer,
1004
+ "fetch-url": $.value,
1002
1005
  "hide-title": e.hideTitle,
1003
- "onFetch:error": M[0] || (M[0] = (U) => $.$emit("fetch:error", U)),
1004
- "onFetch:success": M[1] || (M[1] = (U) => $.$emit("fetch:success", U)),
1005
- onLoading: M[2] || (M[2] = (U) => $.$emit("loading", U))
1006
+ "onFetch:error": x[0] || (x[0] = (U) => E.$emit("fetch:error", U)),
1007
+ "onFetch:success": x[1] || (x[1] = (U) => E.$emit("fetch:success", U)),
1008
+ onLoading: x[2] || (x[2] = (U) => E.$emit("loading", U))
1006
1009
  }, {
1007
1010
  "username-label-tooltip": l(() => [
1008
1011
  c(o(t), {
@@ -1032,7 +1035,7 @@ const Pt = { class: "kong-ui-entities-consumer-form" }, Bt = ["id"], Kt = { clas
1032
1035
  }
1033
1036
  });
1034
1037
  export {
1035
- Yt as ConsumerConfigCard,
1036
- Wt as ConsumerForm,
1037
- zt as ConsumerList
1038
+ Wt as ConsumerConfigCard,
1039
+ zt as ConsumerForm,
1040
+ Qt as ConsumerList
1038
1041
  };
@@ -1 +1 @@
1
- (function(E,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/entities-shared")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/entities-shared"],e):(E=typeof globalThis<"u"?globalThis:E||self,e(E["kong-ui-public-entities-consumers"]={},E.Vue,E.VueRouter,E.KongIcons,E["kong-ui-public-i18n"],E["kong-ui-public-entities-shared"]))})(this,function(E,e,ae,ee,ie,d){"use strict";const ye="#00abd2",he="24px",Ce={consumers:{list:{table_headers:{username:"Username",custom_id:"Custom ID",tags:"Tags",id:"ID"},empty_state:{title:"Configure a New Consumer",description:"Consumers are the end users of a service.",title_for_consumer_group:"Configure a New Consumer"},empty_state_v2:{title:"Configure your first consumer",group:"Consumers created in gateways within this group will automatically appear here.",description:"Consumers represent users or apps accessing your APIs, allowing for tailored authentication and individual access control."},toolbar_actions:{new_consumer:"New consumer"}},title:"Consumers",search:{placeholder:{konnect:"Filter by name",kongManager:"Filter by exact username or ID"}},actions:{add_consumer:"Add Consumer",create:"New Consumer",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",remove:"Remove",view:"View Details"},delete:{title:"Delete a Consumer",description:"Deleting this consumer will also remove this consumer from any associated consumer group and delete all its plugins. This action cannot be reversed."},consumer_groups:{add:{title:"Add Consumers",ctaText:"Add consumers to this group",consumers_label:"Consumers",consumer_placeholder:"Add consumer",footer:"Search by exact name or ID to find consumers not included in the list"},remove:{title:"Remove a Consumer",confirmation:"Are you sure you want to remove this consumer {consumer} from consumer group {consumerGroup}?",confirmationNoCG:"Are you sure you want to remove this consumer {consumer} from this consumer group?",description:"Removing this consumer from the group could change the rate limit policy applied to this consumer."}},errors:{general:"Consumers could not be retrieved",delete:"The consumer could not be deleted at this time.",copy:"Failed to copy to clipboard",add:"Some consumers could not be added at this time.",already_added:"This consumer has already been added to the consumer group"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{title:"Consumer Identification",info:{title:"General Information",description:"General information will help identify and manage added consumer."},consumer_identification:{title:"Consumer Identification",description:"A consumer can have both unique username and unique custom ID or one of them."}},fields:{username:{label:"Username",placeholder:"Enter a unique username",tooltip:"The unique username of the Consumer. You must send either this field or {custom_id} with the request.",custom_id:"custom_id"},custom_id:{label:"Custom ID",placeholder:"Enter a unique custom ID",tooltip:"Field for storing an existing unique ID for the Consumer - useful for mapping Kong with users in your existing database. You must send either this field or {username} with the request.",username:"username"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings associated with the Consumer for grouping and filtering."}}}};function be(){const t=ie.createI18n("en-us",Ce);return{i18n:t,i18nT:ie.i18nTComponent(t)}}const Y={useI18n:be},j="/v2/control-planes/{controlPlaneId}/core-entities",L="/{workspace}",F={list:{konnect:{all:`${j}/consumers`,forConsumerGroup:`${j}/consumer_groups/{consumerGroupId}/consumers`,oneForConsumerGroup:`${j}/consumer_groups/{consumerGroupId}/consumers/{consumerId}`},kongManager:{all:`${L}/consumers`,forConsumerGroup:`${L}/consumer_groups/{consumerGroupId}/consumers`,oneForConsumerGroup:`${L}/consumer_groups/{consumerGroupId}/consumers/{consumerId}`}},form:{konnect:{validate:`${j}/v1/schemas/json/consumer/validate`,create:`${j}/consumers`,edit:`${j}/consumers/{id}`},kongManager:{validate:`${L}/schemas/consumers/validate`,create:`${L}/consumers`,edit:`${L}/consumers/{id}`}}},ke={class:"add-consumer-form-container"},_e={class:"add-consumer-form-cta"},we={class:"select-item-label"},Ie={key:0,class:"select-item-desc"},Ve={key:0,class:"kong-ui-entity-add-consumers-error"},Ne={key:0},xe=e.defineComponent({__name:"AddConsumerModal",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||!t.consumerGroupId)},visible:{type:Boolean,required:!0,default:!1}},emits:["cancel","add:success","add:partial-success","error"],setup(t,{emit:m}){var g;const{i18n:{t:s}}=Y.useI18n(),o=t,N=m,{axiosInstance:r}=d.useAxios((g=o.config)==null?void 0:g.axiosRequestConfig),_=e.ref([]),{debouncedQueryChange:V,loading:B,allRecords:T,error:u,loadItems:H,results:q}=d.useDebouncedFilter(o.config,F.list[o.config.app].all,"",{fetchedItemsKey:"data",searchKeys:["username","id"]}),P=l=>l,S=e.computed(()=>u.value?s("consumers.errors.general"):""),z=e.ref(0),K=e.computed(()=>T.value===void 0),O=e.computed(()=>q.value.map(l=>({label:l.username||l.customId,value:l.id,selected:_.value.includes(l.id),data:l}))),A=l=>{var y;const C=K.value?q.value.find(w=>w.id===l):(y=T.value)==null?void 0:y.find(w=>w.id===l);return C?C.username||C.custom_id:l},x=()=>{G.value="",M.value=[],f.value=[],N("cancel")},M=e.ref([]),$=e.ref(!1),G=e.ref(""),W=async()=>{if(!_.value.length){G.value="",f.value=[],N("cancel");return}$.value=!0,G.value="",M.value=[],f.value=[];try{const l=_.value.map(w=>i(w)),C=await Promise.allSettled(l);let y=!0;C.forEach(w=>{w.status!=="fulfilled"&&(y=!1)}),y?(M.value=[],f.value=[],N("add:success",_.value),_.value=[]):(M.value.length&&N("add:partial-success",M.value),_.value=[],D(C))}catch{G.value=s("consumers.errors.add"),N("error",G.value)}finally{$.value=!1}},a=e.computed(()=>{var C,y,w,J;let l=`${o.config.apiBaseUrl}${F.list[o.config.app].forConsumerGroup}`;return o.config.app==="konnect"?l=l.replace(/{controlPlaneId}/gi,((C=o.config)==null?void 0:C.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((y=o.config)==null?void 0:y.consumerGroupId)||""):o.config.app==="kongManager"&&(l=l.replace(/\/{workspace}/gi,(w=o.config)!=null&&w.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((J=o.config)==null?void 0:J.consumerGroupId)||"")),l}),i=async l=>{const C={consumer:l};try{const y=await r.post(a.value,C);return M.value.push(l),y}catch(y){let w=`${A(l)} - ${y.message}`;return y.response.status===409&&(w=`${A(l)} - ${s("consumers.errors.already_added")}`),Promise.reject(Error(w))}},f=e.ref([]),D=l=>{f.value=l.map(C=>{var y;return(y=C.reason)==null?void 0:y.message}).filter(Boolean)};return e.watch(O,()=>{z.value++},{immediate:!0,deep:!0}),e.watch(()=>o.visible,()=>{o.visible&&H()},{immediate:!0}),(l,C)=>{const y=e.resolveComponent("KMultiselect"),w=e.resolveComponent("KAlert"),J=e.resolveComponent("KPrompt");return e.openBlock(),e.createBlock(J,{"action-button-disabled":$.value,class:"kong-ui-entities-add-consumers-modal","data-testid":"add-consumer-modal",title:e.unref(s)("consumers.consumer_groups.add.title"),visible:t.visible,onCancel:x,onProceed:W},{default:e.withCtx(()=>[e.createElementVNode("div",ke,[e.createElementVNode("p",_e,e.toDisplayString(e.unref(s)("consumers.consumer_groups.add.ctaText")),1),e.createVNode(y,{modelValue:_.value,"onUpdate:modelValue":C[0]||(C[0]=I=>_.value=I),autosuggest:"","data-testid":"add-consumers-multiselect","dropdown-footer-text":K.value?e.unref(s)("consumers.consumer_groups.add.footer"):void 0,items:O.value,label:e.unref(s)("consumers.consumer_groups.add.consumers_label"),loading:e.unref(B),placeholder:e.unref(s)("consumers.consumer_groups.add.consumer_placeholder"),readonly:$.value,required:"",width:"100%",onQueryChange:e.unref(V)},{"item-template":e.withCtx(({item:I})=>[e.createElementVNode("div",we,e.toDisplayString(I.label),1),P(I).data.username&&P(I).data.custom_id?(e.openBlock(),e.createElementBlock("div",Ie,e.toDisplayString(P(I).data.custom_id),1)):e.createCommentVNode("",!0)]),_:1},8,["modelValue","dropdown-footer-text","items","label","loading","placeholder","readonly","onQueryChange"]),G.value||S.value||f.value.length?(e.openBlock(),e.createElementBlock("div",Ve,[e.createVNode(w,{appearance:"danger"},{default:e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(e.unref(s)("consumers.errors.add")),1),f.value.length?(e.openBlock(),e.createElementBlock("ul",Ne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(I,Q)=>(e.openBlock(),e.createElementBlock("li",{key:Q},e.toDisplayString(I),1))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(G.value||S.value),1)]),_:1})])):e.createCommentVNode("",!0)])]),_:1},8,["action-button-disabled","title","visible"])}}}),te=(t,m)=>{const s=t.__vccOpts||t;for(const[o,N]of m)s[o]=N;return s},Ee=te(xe,[["__scopeId","data-v-d54468ab"]]),$e={class:"kong-ui-entities-consumers-list"},De={class:"button-row"},Be={class:"empty-state-wrapper"},Se={class:"empty-state-icon-gateway"},Ge=te(e.defineComponent({__name:"ConsumerList",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||!t.createRoute||!t.getViewRoute||!t.getEditRoute||t.app==="kongManager"&&!t.isExactMatch&&!t.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success","add:success","remove:success"],setup(t,{emit:m}){var ge;const s=m,o=t,{i18nT:N,i18n:{t:r}}=Y.useI18n(),_=ae.useRouter(),{axiosInstance:V}=d.useAxios((ge=o.config)==null?void 0:ge.axiosRequestConfig),B=e.computed(()=>o.config.app!=="kongManager"||!!o.config.disableSorting),T={username:{label:r("consumers.list.table_headers.username"),searchable:!0,sortable:!0,hidable:!1},custom_id:{label:r("consumers.list.table_headers.custom_id"),searchable:!0,sortable:!0},tags:{label:r("consumers.list.table_headers.tags"),sortable:!1}},u=T,H=n=>({"data-testid":n.username??n.custom_id??n.id}),q=()=>{o.config.consumerGroupId?de():_.push(o.config.createRoute)},P=e.computed(()=>{var c,h,b,U;let n=`${o.config.apiBaseUrl}${F.list[o.config.app][x.value?"forConsumerGroup":"all"]}`;return o.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((c=o.config)==null?void 0:c.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((h=o.config)==null?void 0:h.consumerGroupId)||""):o.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(b=o.config)!=null&&b.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((U=o.config)==null?void 0:U.consumerGroupId)||"")),n}),S=e.ref(""),z=e.computed(()=>{const n=o.config.app==="konnect"||o.config.isExactMatch;return n?{isExactMatch:n,placeholder:r(`consumers.search.placeholder.${o.config.app}`)}:{isExactMatch:n,fields:{username:T.username,custom_id:T.custom_id},schema:o.config.filterSchema}}),{hasRecords:K,handleStateChange:O}=d.useTableState(S),A=e.computed(()=>K.value&&o.config.app==="konnect"),x=e.computed(()=>!!o.config.consumerGroupId),M=e.computed(()=>x.value?"kong-ui-entities-consumers-list-in-group-page":"kong-ui-entities-consumers-list"),$=e.computed(()=>x.value&&!o.config.paginatedEndpoint?"consumers":void 0),{fetcher:G,fetcherState:W,fetcherCacheKey:a}=d.useFetcher(e.computed(()=>({...o.config,cacheIdentifier:o.cacheIdentifier})),P,$),i=()=>{S.value=""},f=()=>{a.value++},D=n=>n??"-",g=e.ref(null),l=async(n,c)=>{const h=n.id;if(!await c(h)){s("copy:error",{entity:n,field:"id",message:r("consumers.errors.copy")});return}s("copy:success",{entity:n,field:"id",message:r("consumers.copy.success",{val:h})})},C=(n,c)=>{const h=JSON.stringify(n);if(!c(h)){s("copy:error",{entity:n,message:r("consumers.errors.copy")});return}s("copy:success",{entity:n,message:r("consumers.copy.success_brief")})},y=async n=>{var h;await((h=o.canRetrieve)==null?void 0:h.call(o,n))&&_.push(o.config.getViewRoute(n.id))},w=n=>({label:r("consumers.actions.view"),to:o.config.getViewRoute(n)}),J=n=>({label:r("consumers.actions.edit"),to:o.config.getEditRoute(n)}),I=e.ref(void 0),Q=e.ref(!1),Z=e.ref(!1),ce=e.ref(""),He=d.useDeleteUrlBuilder(o.config,P.value),We=n=>{I.value=n,Q.value=!0},Je=()=>{Q.value=!1},Qe=async()=>{var n,c,h;if((n=I.value)!=null&&n.id){Z.value=!0;try{await V.delete(He(I.value.id)),Z.value=!1,Q.value=!1,a.value++,s("delete:success",I.value)}catch(b){ce.value=((h=(c=b.response)==null?void 0:c.data)==null?void 0:h.message)||b.message||r("consumers.errors.delete"),s("error",b)}finally{Z.value=!1}}},ne=e.ref(!1),de=()=>{ne.value=!0},ue=()=>{ne.value=!1},me=(n,c)=>{c||ue(),a.value++,s("add:success",n)},ze=()=>{x.value&&de()},R=e.ref(void 0),re=e.ref(!1),Ye=e.ref(""),Xe=n=>{R.value=n,re.value=!0},pe=()=>{re.value=!1,R.value=void 0},Ze=e.computed(()=>{var c,h,b,U;let n=`${o.config.apiBaseUrl}${F.list[o.config.app].oneForConsumerGroup}`;return o.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((c=o.config)==null?void 0:c.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((h=o.config)==null?void 0:h.consumerGroupId)||""):o.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(b=o.config)!=null&&b.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((U=o.config)==null?void 0:U.consumerGroupId)||"")),n}),fe=e.ref(!1),ve=async()=>{if(R.value){fe.value=!0;try{const n=Ze.value.replace(/{consumerId}/gi,R.value.id);await V.delete(n),s("remove:success",R.value),pe(),a.value++}catch(n){Ye.value=n.message||r("consumers.errors.delete"),s("error",n)}finally{fe.value=!1}}};e.watch(W,n=>{var c,h,b;if(n.status===d.FetcherStatus.Error){g.value={title:r("consumers.errors.general")},(b=(h=(c=n.error)==null?void 0:c.response)==null?void 0:h.data)!=null&&b.message&&(g.value.message=n.error.response.data.message),s("error",n.error);return}g.value=null});const se=e.ref({ctaPath:x.value?void 0:o.config.createRoute,ctaText:void 0,message:`${r("consumers.list.empty_state.description")}${o.config.additionMessageForEmptyState?` ${o.config.additionMessageForEmptyState}`:""}`,title:r("consumers.title")});return e.onBeforeMount(async()=>{await o.canCreate()&&(se.value.title=x.value?r("consumers.list.empty_state.title_for_consumer_group"):r("consumers.list.empty_state.title"),se.value.ctaText=x.value?r("consumers.actions.add_consumer"):r("consumers.actions.create"))}),(n,c)=>{const h=e.resolveComponent("KButton"),b=e.resolveComponent("KDropdownItem"),U=e.resolveComponent("KClipboardProvider"),et=e.resolveComponent("KPrompt");return e.openBlock(),e.createElementBlock("div",$e,[e.createVNode(e.unref(d.EntityBaseTable),{"cache-identifier":t.cacheIdentifier,"disable-sorting":B.value,"empty-state-options":se.value,"enable-entity-actions":"","error-message":g.value,fetcher:e.unref(G),"fetcher-cache-key":e.unref(a),"hide-pagination":x.value&&!t.config.paginatedEndpoint,"pagination-type":"offset","preferences-storage-key":M.value,query:S.value,"row-attributes":H,"table-headers":e.unref(u),onClearSearchInput:i,"onClick:row":c[3]||(c[3]=p=>y(p)),onEmptyStateCtaClicked:ze,onSort:f,onState:e.unref(O)},e.createSlots({"toolbar-filter":e.withCtx(()=>[e.renderSlot(n.$slots,"toolbar-filter",{},void 0,!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(d.EntityFilter),{key:0,modelValue:S.value,"onUpdate:modelValue":c[0]||(c[0]=p=>S.value=p),config:z.value},null,8,["modelValue","config"]))]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!t.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createElementVNode("div",De,[!x.value&&A.value?(e.openBlock(),e.createBlock(h,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"consumers-learn-more-button",icon:"",onClick:c[1]||(c[1]=p=>n.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.BookIcon),{decorative:""})]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(d.PermissionsWrapper),{"auth-function":()=>t.canCreate()},{default:e.withCtx(()=>[e.createVNode(h,{appearance:"primary","data-testid":"toolbar-add-consumer",size:t.useActionOutside?"medium":"large",onClick:q},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.AddIcon)),e.createTextVNode(" "+e.toDisplayString(t.config.consumerGroupId?e.unref(r)("consumers.actions.add_consumer"):e.unref(r)("consumers.list.toolbar_actions.new_consumer")),1)]),_:1},8,["size"])]),_:1},8,["auth-function"])])],8,["disabled"]))]),username:e.withCtx(({rowValue:p})=>[e.createElementVNode("b",null,e.toDisplayString(D(p)),1)]),custom_id:e.withCtx(({rowValue:p})=>[e.createTextVNode(e.toDisplayString(D(p)),1)]),tags:e.withCtx(({rowValue:p})=>[e.createVNode(e.unref(d.TableTags),{tags:p},null,8,["tags"])]),actions:e.withCtx(({row:p})=>[e.createVNode(U,null,{default:e.withCtx(({copyToClipboard:v})=>[e.createVNode(b,{"data-testid":"action-entity-copy-id",onClick:tt=>l(p,v)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("consumers.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(U,null,{default:e.withCtx(({copyToClipboard:v})=>[e.createVNode(b,{"data-testid":"action-entity-copy-json",onClick:tt=>C(p,v)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("consumers.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(d.PermissionsWrapper),{"auth-function":()=>t.canRetrieve(p)},{default:e.withCtx(()=>[e.createVNode(b,{"data-testid":"action-entity-view","has-divider":"",item:w(p.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(d.PermissionsWrapper),{"auth-function":()=>t.canEdit(p)},{default:e.withCtx(()=>[e.createVNode(b,{"data-testid":"action-entity-edit",item:J(p.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(d.PermissionsWrapper),{"auth-function":()=>t.canDelete(p)},{default:e.withCtx(()=>[e.createVNode(b,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:()=>t.config.consumerGroupId?Xe(p):We(p)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.config.consumerGroupId?e.unref(r)("consumers.actions.remove"):e.unref(r)("consumers.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!S.value&&t.config.app==="konnect"?{name:"empty-state",fn:e.withCtx(()=>{var p;return[e.createElementVNode("div",Be,[e.renderSlot(n.$slots,"empty-state-toolbar",{},void 0,!0),e.createVNode(e.unref(d.EntityEmptyState),{"action-button-text":e.unref(r)("consumers.list.toolbar_actions.new_consumer"),appearance:"secondary","can-create":()=>t.canCreate(),"data-testid":t.config.consumerGroupId?"nested-consumers-entity-empty-state":"consumers-entity-empty-state",description:e.unref(r)("consumers.list.empty_state_v2.description"),"learn-more":t.config.app==="konnect",title:e.unref(r)("consumers.list.empty_state_v2.title"),"onClick:create":q,"onClick:learnMore":c[2]||(c[2]=v=>n.$emit("click:learn-more"))},e.createSlots({image:e.withCtx(()=>[e.createElementVNode("div",Se,[e.createVNode(e.unref(ee.TeamIcon),{color:e.unref(ye),size:e.unref(he)},null,8,["color","size"])])]),_:2},[(p=t.config)!=null&&p.isControlPlaneGroup?{name:"message",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("consumers.list.empty_state_v2.group")),1)]),key:"0"}:void 0]),1032,["action-button-text","can-create","data-testid","description","learn-more","title"])])]}),key:"0"}:void 0]),1032,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","hide-pagination","preferences-storage-key","query","table-headers","onState"]),e.createVNode(e.unref(d.EntityDeleteModal),{"action-button-disabled":Z.value,"data-testid":"delete-consumer-modal",description:e.unref(r)("consumers.delete.description"),"entity-name":I.value&&(I.value.username||I.value.custom_id||I.value.id),"entity-type":e.unref(d.EntityTypes).Consumer,error:ce.value,title:e.unref(r)("consumers.delete.title"),visible:Q.value,onCancel:Je,onProceed:Qe},null,8,["action-button-disabled","description","entity-name","entity-type","error","title","visible"]),t.config.consumerGroupId?(e.openBlock(),e.createBlock(Ee,{key:0,config:t.config,"data-testid":"add-consumer-modal",visible:ne.value,"onAdd:partialSuccess":c[4]||(c[4]=p=>me(p,!0)),"onAdd:success":c[5]||(c[5]=p=>me(p)),onCancel:ue},null,8,["config","visible"])):e.createCommentVNode("",!0),t.config.consumerGroupId&&R.value?(e.openBlock(),e.createBlock(et,{key:1,"action-button-appearance":"danger","data-testid":"remove-consumer-modal",title:e.unref(r)("consumers.consumer_groups.remove.title"),visible:re.value,onCancel:pe,onProceed:ve},{default:e.withCtx(()=>[e.createVNode(e.unref(N),{class:"message",keypath:t.config.consumerGroupName?"consumers.consumer_groups.remove.confirmation":"consumers.consumer_groups.remove.confirmationNoCG",tag:"p"},e.createSlots({consumer:e.withCtx(()=>[e.createElementVNode("strong",null,e.toDisplayString(R.value.username||R.value.custom_id||R.value.id),1)]),_:2},[t.config.consumerGroupName?{name:"consumerGroup",fn:e.withCtx(()=>[e.createElementVNode("strong",null,e.toDisplayString(t.config.consumerGroupName),1)]),key:"0"}:void 0]),1032,["keypath"]),e.createElementVNode("p",null,e.toDisplayString(e.unref(r)("consumers.consumer_groups.remove.description")),1)]),_:1},8,["title","visible"])):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-c5be280d"]]);for(var k=[],oe=0;oe<256;++oe)k.push((oe+256).toString(16).slice(1));function Me(t,m=0){return(k[t[m+0]]+k[t[m+1]]+k[t[m+2]]+k[t[m+3]]+"-"+k[t[m+4]]+k[t[m+5]]+"-"+k[t[m+6]]+k[t[m+7]]+"-"+k[t[m+8]]+k[t[m+9]]+"-"+k[t[m+10]]+k[t[m+11]]+k[t[m+12]]+k[t[m+13]]+k[t[m+14]]+k[t[m+15]]).toLowerCase()}var X,Te=new Uint8Array(16);function Ae(){if(!X&&(X=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!X))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return X(Te)}var Re=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const le={randomUUID:Re};function Pe(t,m,s){if(le.randomUUID&&!t)return le.randomUUID();t=t||{};var o=t.random||(t.rng||Ae)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,Me(o)}const Ue={class:"kong-ui-entities-consumer-form"},Fe=["id"],qe={class:"fields-group-text"},Ke=["aria-labelledby"],Oe=te(e.defineComponent({__name:"ConsumerForm",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||(t==null?void 0:t.app)==="konnect"&&!(t!=null&&t.controlPlaneId)||(t==null?void 0:t.app)==="kongManager"&&typeof(t==null?void 0:t.workspace)!="string"||!(t!=null&&t.cancelRoute))},consumerId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(t,{emit:m}){var W;const s=t,o=m,{i18nT:N,i18n:{t:r}}=Y.useI18n(),_=ae.useRouter(),{axiosInstance:V}=d.useAxios((W=s.config)==null?void 0:W.axiosRequestConfig),{getMessageFromError:B}=d.useErrors(),T=Pe(),u=e.reactive({fields:{username:"",customId:"",tags:""},readonly:!1,errorMessage:""}),H=e.reactive({username:"",customId:"",tags:""}),q=e.computed(()=>{var a,i;return(i=F.form[(a=s.config)==null?void 0:a.app])==null?void 0:i.edit}),P=()=>{var a;_.push(((a=s.config)==null?void 0:a.cancelRoute)||{name:"consumer-list"})},S=a=>{o("loading",a)},z=a=>{o("error",a)},K=a=>{var f,D,g;u.fields.username=((f=a==null?void 0:a.item)==null?void 0:f.username)||(a==null?void 0:a.username)||"",u.fields.customId=((D=a==null?void 0:a.item)==null?void 0:D.custom_id)||(a==null?void 0:a.custom_id)||"";const i=((g=a==null?void 0:a.item)==null?void 0:g.tags)||(a==null?void 0:a.tags)||[];u.fields.tags=(i==null?void 0:i.join(", "))||"",Object.assign(H,u.fields)},O=e.computed(()=>s.consumerId?d.EntityBaseFormType.Edit:d.EntityBaseFormType.Create),A=a=>{var f,D,g,l,C,y;let i=`${(f=s.config)==null?void 0:f.apiBaseUrl}${F.form[(D=s.config)==null?void 0:D.app][a]}`;return((g=s.config)==null?void 0:g.app)==="konnect"?i=i.replace(/{controlPlaneId}/gi,((l=s.config)==null?void 0:l.controlPlaneId)||""):((C=s.config)==null?void 0:C.app)==="kongManager"&&(i=i.replace(/\/{workspace}/gi,(y=s.config)!=null&&y.workspace?`/${s.config.workspace}`:"")),i=i.replace(/{id}/gi,s.consumerId),i},x=e.computed(()=>!!u.fields.username||!!u.fields.customId),M=e.computed(()=>JSON.stringify(u.fields)!==JSON.stringify(H)),$=e.computed(()=>{var a,i;return{username:u.fields.username||null,custom_id:u.fields.customId||null,tags:(i=(a=u.fields.tags.split(","))==null?void 0:a.map(f=>String(f||"").trim()))==null?void 0:i.filter(f=>f!=="")}}),G=async()=>{var a;try{u.readonly=!0;let i;await V.post(A("validate"),$.value),O.value==="create"?i=await V.post(A("create"),$.value):O.value==="edit"&&(i=((a=s.config)==null?void 0:a.app)==="konnect"?await V.put(A("edit"),$.value):await V.patch(A("edit"),$.value)),K(i==null?void 0:i.data),o("update",i==null?void 0:i.data)}catch(i){u.errorMessage=B(i),o("error",i)}finally{u.readonly=!1}};return(a,i)=>{const f=e.resolveComponent("KInput"),D=e.resolveComponent("KCard");return e.openBlock(),e.createElementBlock("div",Ue,[e.createVNode(e.unref(d.EntityBaseForm),{"can-submit":x.value&&M.value,config:t.config,"edit-id":t.consumerId,"entity-type":e.unref(d.SupportedEntityType).Consumer,"error-message":u.errorMessage,"fetch-url":q.value,"form-fields":$.value,"is-readonly":u.readonly,onCancel:P,"onFetch:error":i[3]||(i[3]=g=>z(g)),"onFetch:success":K,onLoading:i[4]||(i[4]=g=>S(g)),onSubmit:G},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(e.unref(d.EntityFormSection),{description:e.unref(r)("consumers.form.info.description"),"has-divider":"",title:e.unref(r)("consumers.form.info.title")},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("h3",{id:`fields-group-title-${e.unref(T)}`,class:"fields-group-title"},e.toDisplayString(e.unref(r)("consumers.form.consumer_identification.title"))+"* ",9,Fe),e.createElementVNode("p",qe,e.toDisplayString(e.unref(r)("consumers.form.consumer_identification.description")),1)]),e.createVNode(D,null,{default:e.withCtx(()=>[e.createElementVNode("fieldset",{"aria-labelledby":`fields-group-title-${e.unref(T)}`},[e.createVNode(f,{modelValue:u.fields.username,"onUpdate:modelValue":i[0]||(i[0]=g=>u.fields.username=g),modelModifiers:{trim:!0},autocomplete:"off",class:"username-field","data-testid":"consumer-form-username",label:e.unref(r)("consumers.fields.username.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(r)("consumers.fields.username.placeholder"),readonly:u.readonly,type:"text"},{"label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(N),{keypath:"consumers.fields.username.tooltip",scope:"global"},{custom_id:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(r)("consumers.fields.username.custom_id")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"]),e.createVNode(f,{modelValue:u.fields.customId,"onUpdate:modelValue":i[1]||(i[1]=g=>u.fields.customId=g),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-form-custom-id",label:e.unref(r)("consumers.fields.custom_id.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(r)("consumers.fields.custom_id.placeholder"),readonly:u.readonly,type:"text"},{"label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(N),{keypath:"consumers.fields.custom_id.tooltip",scope:"global"},{username:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(r)("consumers.fields.custom_id.username")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"])],8,Ke)]),_:1}),e.createVNode(f,{modelValue:u.fields.tags,"onUpdate:modelValue":i[2]||(i[2]=g=>u.fields.tags=g),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-form-tags",help:e.unref(r)("consumers.fields.tags.help"),label:e.unref(r)("consumers.fields.tags.label"),"label-attributes":{info:e.unref(r)("consumers.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(r)("consumers.fields.tags.placeholder"),readonly:u.readonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])])]),_:1},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-ab3e5b9b"]]),je={class:"kong-ui-consumer-entity-config-card"},Le=e.defineComponent({__name:"ConsumerConfigCard",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||t.app==="konnect"&&!t.controlPlaneId||t.app==="kongManager"&&typeof t.workspace!="string"||!t.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(t){const m=t,{i18n:{t:s},i18nT:o}=Y.useI18n(),N=e.computed(()=>F.form[m.config.app].edit),r=e.ref({id:{},username:{section:d.ConfigurationSchemaSection.Basic,tooltip:s("consumers.fields.username.tooltip"),order:1},custom_id:{section:d.ConfigurationSchemaSection.Basic,tooltip:s("consumers.fields.custom_id.tooltip"),label:s("consumers.fields.custom_id.label"),order:2},updated_at:{},created_at:{},tags:{tooltip:s("consumers.fields.tags.tooltip")},username_lower:{hidden:!0},type:{hidden:!0}});return(_,V)=>(e.openBlock(),e.createElementBlock("div",je,[e.createVNode(e.unref(d.EntityBaseConfigCard),{config:t.config,"config-card-doc":t.configCardDoc,"config-schema":r.value,"entity-type":e.unref(d.SupportedEntityType).Consumer,"fetch-url":N.value,"hide-title":t.hideTitle,"onFetch:error":V[0]||(V[0]=B=>_.$emit("fetch:error",B)),"onFetch:success":V[1]||(V[1]=B=>_.$emit("fetch:success",B)),onLoading:V[2]||(V[2]=B=>_.$emit("loading",B))},{"username-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(o),{keypath:"consumers.fields.username.tooltip",scope:"global"},{custom_id:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("consumers.fields.username.custom_id")),1)]),_:1})]),"custom_id-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(o),{keypath:"consumers.fields.custom_id.tooltip",scope:"global"},{username:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("consumers.fields.custom_id.username")),1)]),_:1})]),_:1},8,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])]))}});E.ConsumerConfigCard=Le,E.ConsumerForm=Oe,E.ConsumerList=Ge,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
1
+ (function(E,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/entities-shared")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/entities-shared"],e):(E=typeof globalThis<"u"?globalThis:E||self,e(E["kong-ui-public-entities-consumers"]={},E.Vue,E.VueRouter,E.KongIcons,E["kong-ui-public-i18n"],E["kong-ui-public-entities-shared"]))})(this,function(E,e,se,v,ae,d){"use strict";const ge="#00abd2",ye="24px",he={consumers:{list:{table_headers:{username:"Username",custom_id:"Custom ID",tags:"Tags",id:"ID"},empty_state:{title:"Configure a New Consumer",description:"Consumers are the end users of a service.",title_for_consumer_group:"Configure a New Consumer"},empty_state_v2:{title:"Configure your first consumer",group:"Consumers created in gateways within this group will automatically appear here.",description:"Consumers represent users or apps accessing your APIs, allowing for tailored authentication and individual access control."},toolbar_actions:{new_consumer:"New consumer"}},title:"Consumers",search:{placeholder:{konnect:"Filter by name",kongManager:"Filter by exact username or ID"}},actions:{add_consumer:"Add Consumer",create:"New Consumer",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",remove:"Remove",view:"View Details"},delete:{title:"Delete a Consumer",description:"Deleting this consumer will also remove this consumer from any associated consumer group and delete all its plugins. This action cannot be reversed."},consumer_groups:{add:{title:"Add Consumers",ctaText:"Add consumers to this group",consumers_label:"Consumers",consumer_placeholder:"Add consumer",footer:"Search by exact name or ID to find consumers not included in the list"},remove:{title:"Remove a Consumer",confirmation:"Are you sure you want to remove this consumer {consumer} from consumer group {consumerGroup}?",confirmationNoCG:"Are you sure you want to remove this consumer {consumer} from this consumer group?",description:"Removing this consumer from the group could change the rate limit policy applied to this consumer."}},errors:{general:"Consumers could not be retrieved",delete:"The consumer could not be deleted at this time.",copy:"Failed to copy to clipboard",add:"Some consumers could not be added at this time.",already_added:"This consumer has already been added to the consumer group"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{title:"Consumer Identification",info:{title:"General Information",description:"General information will help identify and manage added consumer."},consumer_identification:{title:"Consumer Identification",description:"A consumer can have both unique username and unique custom ID or one of them."}},fields:{username:{label:"Username",placeholder:"Enter a unique username",tooltip:"The unique username of the Consumer. You must send either this field or {custom_id} with the request.",custom_id:"custom_id"},custom_id:{label:"Custom ID",placeholder:"Enter a unique custom ID",tooltip:"Field for storing an existing unique ID for the Consumer - useful for mapping Kong with users in your existing database. You must send either this field or {username} with the request.",username:"username"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings associated with the Consumer for grouping and filtering."}}}};function Ce(){const t=ae.createI18n("en-us",he);return{i18n:t,i18nT:ae.i18nTComponent(t)}}const Y={useI18n:Ce},j="/v2/control-planes/{controlPlaneId}/core-entities",L="/{workspace}",F={list:{konnect:{all:`${j}/consumers`,forConsumerGroup:`${j}/consumer_groups/{consumerGroupId}/consumers`,oneForConsumerGroup:`${j}/consumer_groups/{consumerGroupId}/consumers/{consumerId}`},kongManager:{all:`${L}/consumers`,forConsumerGroup:`${L}/consumer_groups/{consumerGroupId}/consumers`,oneForConsumerGroup:`${L}/consumer_groups/{consumerGroupId}/consumers/{consumerId}`}},form:{konnect:{validate:`${j}/v1/schemas/json/consumer/validate`,create:`${j}/consumers`,edit:`${j}/consumers/{id}`},kongManager:{validate:`${L}/schemas/consumers/validate`,create:`${L}/consumers`,edit:`${L}/consumers/{id}`}}},be={class:"add-consumer-form-container"},ke={class:"add-consumer-form-cta"},_e={class:"select-item-label"},we={key:0,class:"select-item-desc"},Ie={key:0,class:"kong-ui-entity-add-consumers-error"},Ve={key:0},Ne=e.defineComponent({__name:"AddConsumerModal",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||!t.consumerGroupId)},visible:{type:Boolean,required:!0,default:!1}},emits:["cancel","add:success","add:partial-success","error"],setup(t,{emit:m}){var g;const{i18n:{t:s}}=Y.useI18n(),o=t,_=m,{axiosInstance:r}=d.useAxios((g=o.config)==null?void 0:g.axiosRequestConfig),w=e.ref([]),{debouncedQueryChange:N,loading:B,allRecords:T,error:u,loadItems:H,results:q}=d.useDebouncedFilter(o.config,F.list[o.config.app].all,"",{fetchedItemsKey:"data",searchKeys:["username","id"]}),U=l=>l,S=e.computed(()=>u.value?s("consumers.errors.general"):""),z=e.ref(0),K=e.computed(()=>T.value===void 0),O=e.computed(()=>q.value.map(l=>({label:l.username||l.customId,value:l.id,selected:w.value.includes(l.id),data:l}))),A=l=>{var y;const C=K.value?q.value.find(I=>I.id===l):(y=T.value)==null?void 0:y.find(I=>I.id===l);return C?C.username||C.custom_id:l},x=()=>{G.value="",M.value=[],f.value=[],_("cancel")},M=e.ref([]),D=e.ref(!1),G=e.ref(""),W=async()=>{if(!w.value.length){G.value="",f.value=[],_("cancel");return}D.value=!0,G.value="",M.value=[],f.value=[];try{const l=w.value.map(I=>i(I)),C=await Promise.allSettled(l);let y=!0;C.forEach(I=>{I.status!=="fulfilled"&&(y=!1)}),y?(M.value=[],f.value=[],_("add:success",w.value),w.value=[]):(M.value.length&&_("add:partial-success",M.value),w.value=[],$(C))}catch{G.value=s("consumers.errors.add"),_("error",G.value)}finally{D.value=!1}},a=e.computed(()=>{var C,y,I,J;let l=`${o.config.apiBaseUrl}${F.list[o.config.app].forConsumerGroup}`;return o.config.app==="konnect"?l=l.replace(/{controlPlaneId}/gi,((C=o.config)==null?void 0:C.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((y=o.config)==null?void 0:y.consumerGroupId)||""):o.config.app==="kongManager"&&(l=l.replace(/\/{workspace}/gi,(I=o.config)!=null&&I.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((J=o.config)==null?void 0:J.consumerGroupId)||"")),l}),i=async l=>{const C={consumer:l};try{const y=await r.post(a.value,C);return M.value.push(l),y}catch(y){let I=`${A(l)} - ${y.message}`;return y.response.status===409&&(I=`${A(l)} - ${s("consumers.errors.already_added")}`),Promise.reject(Error(I))}},f=e.ref([]),$=l=>{f.value=l.map(C=>{var y;return(y=C.reason)==null?void 0:y.message}).filter(Boolean)};return e.watch(O,()=>{z.value++},{immediate:!0,deep:!0}),e.watch(()=>o.visible,()=>{o.visible&&H()},{immediate:!0}),(l,C)=>{const y=e.resolveComponent("KMultiselect"),I=e.resolveComponent("KAlert"),J=e.resolveComponent("KPrompt");return e.openBlock(),e.createBlock(J,{"action-button-disabled":D.value,class:"kong-ui-entities-add-consumers-modal","data-testid":"add-consumer-modal",title:e.unref(s)("consumers.consumer_groups.add.title"),visible:t.visible,onCancel:x,onProceed:W},{default:e.withCtx(()=>[e.createElementVNode("div",be,[e.createElementVNode("p",ke,e.toDisplayString(e.unref(s)("consumers.consumer_groups.add.ctaText")),1),e.createVNode(y,{modelValue:w.value,"onUpdate:modelValue":C[0]||(C[0]=V=>w.value=V),autosuggest:"","data-testid":"add-consumers-multiselect","dropdown-footer-text":K.value?e.unref(s)("consumers.consumer_groups.add.footer"):void 0,items:O.value,label:e.unref(s)("consumers.consumer_groups.add.consumers_label"),loading:e.unref(B),placeholder:e.unref(s)("consumers.consumer_groups.add.consumer_placeholder"),readonly:D.value,required:"",width:"100%",onQueryChange:e.unref(N)},{"item-template":e.withCtx(({item:V})=>[e.createElementVNode("div",_e,e.toDisplayString(V.label),1),U(V).data.username&&U(V).data.custom_id?(e.openBlock(),e.createElementBlock("div",we,e.toDisplayString(U(V).data.custom_id),1)):e.createCommentVNode("",!0)]),_:1},8,["modelValue","dropdown-footer-text","items","label","loading","placeholder","readonly","onQueryChange"]),G.value||S.value||f.value.length?(e.openBlock(),e.createElementBlock("div",Ie,[e.createVNode(I,{appearance:"danger"},{default:e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(e.unref(s)("consumers.errors.add")),1),f.value.length?(e.openBlock(),e.createElementBlock("ul",Ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(V,Q)=>(e.openBlock(),e.createElementBlock("li",{key:Q},e.toDisplayString(V),1))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(G.value||S.value),1)]),_:1})])):e.createCommentVNode("",!0)])]),_:1},8,["action-button-disabled","title","visible"])}}}),ee=(t,m)=>{const s=t.__vccOpts||t;for(const[o,_]of m)s[o]=_;return s},xe=ee(Ne,[["__scopeId","data-v-d54468ab"]]),Ee={class:"kong-ui-entities-consumers-list"},De={class:"button-row"},$e={class:"empty-state-wrapper"},Be={class:"empty-state-icon-gateway"},Se=ee(e.defineComponent({__name:"ConsumerList",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||!t.createRoute||!t.getViewRoute||!t.getEditRoute||t.app==="kongManager"&&!t.isExactMatch&&!t.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success","add:success","remove:success"],setup(t,{emit:m}){var fe;const s=m,o=t,{i18nT:_,i18n:{t:r}}=Y.useI18n(),w=se.useRouter(),{axiosInstance:N}=d.useAxios((fe=o.config)==null?void 0:fe.axiosRequestConfig),B=e.computed(()=>o.config.app!=="kongManager"||!!o.config.disableSorting),T={username:{label:r("consumers.list.table_headers.username"),searchable:!0,sortable:!0,hidable:!1},custom_id:{label:r("consumers.list.table_headers.custom_id"),searchable:!0,sortable:!0},tags:{label:r("consumers.list.table_headers.tags"),sortable:!1}},u=T,H=n=>({"data-testid":n.username??n.custom_id??n.id}),q=()=>{o.config.consumerGroupId?ce():w.push(o.config.createRoute)},U=e.computed(()=>{var c,h,b,P;let n=`${o.config.apiBaseUrl}${F.list[o.config.app][x.value?"forConsumerGroup":"all"]}`;return o.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((c=o.config)==null?void 0:c.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((h=o.config)==null?void 0:h.consumerGroupId)||""):o.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(b=o.config)!=null&&b.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((P=o.config)==null?void 0:P.consumerGroupId)||"")),n}),S=e.ref(""),z=e.computed(()=>{const n=o.config.app==="konnect"||o.config.isExactMatch;return n?{isExactMatch:n,placeholder:r(`consumers.search.placeholder.${o.config.app}`)}:{isExactMatch:n,fields:{username:T.username,custom_id:T.custom_id},schema:o.config.filterSchema}}),{hasRecords:K,handleStateChange:O}=d.useTableState(S),A=e.computed(()=>K.value&&o.config.app==="konnect"),x=e.computed(()=>!!o.config.consumerGroupId),M=e.computed(()=>x.value?"kong-ui-entities-consumers-list-in-group-page":"kong-ui-entities-consumers-list"),D=e.computed(()=>x.value&&!o.config.paginatedEndpoint?"consumers":void 0),{fetcher:G,fetcherState:W,fetcherCacheKey:a}=d.useFetcher(e.computed(()=>({...o.config,cacheIdentifier:o.cacheIdentifier})),U,D),i=()=>{S.value=""},f=()=>{a.value++},$=n=>n??"-",g=e.ref(null),l=async(n,c)=>{const h=n.id;if(!await c(h)){s("copy:error",{entity:n,field:"id",message:r("consumers.errors.copy")});return}s("copy:success",{entity:n,field:"id",message:r("consumers.copy.success",{val:h})})},C=(n,c)=>{const h=JSON.stringify(n);if(!c(h)){s("copy:error",{entity:n,message:r("consumers.errors.copy")});return}s("copy:success",{entity:n,message:r("consumers.copy.success_brief")})},y=async n=>{var h;await((h=o.canRetrieve)==null?void 0:h.call(o,n))&&w.push(o.config.getViewRoute(n.id))},I=n=>({label:r("consumers.actions.view"),to:o.config.getViewRoute(n)}),J=n=>({label:r("consumers.actions.edit"),to:o.config.getEditRoute(n)}),V=e.ref(void 0),Q=e.ref(!1),X=e.ref(!1),le=e.ref(""),je=d.useDeleteUrlBuilder(o.config,U.value),Le=n=>{V.value=n,Q.value=!0},He=()=>{Q.value=!1},We=async()=>{var n,c,h;if((n=V.value)!=null&&n.id){X.value=!0;try{await N.delete(je(V.value.id)),X.value=!1,Q.value=!1,a.value++,s("delete:success",V.value)}catch(b){le.value=((h=(c=b.response)==null?void 0:c.data)==null?void 0:h.message)||b.message||r("consumers.errors.delete"),s("error",b)}finally{X.value=!1}}},oe=e.ref(!1),ce=()=>{oe.value=!0},de=()=>{oe.value=!1},ue=(n,c)=>{c||de(),a.value++,s("add:success",n)},Je=()=>{x.value&&ce()},R=e.ref(void 0),ne=e.ref(!1),Qe=e.ref(""),ze=n=>{R.value=n,ne.value=!0},me=()=>{ne.value=!1,R.value=void 0},Ye=e.computed(()=>{var c,h,b,P;let n=`${o.config.apiBaseUrl}${F.list[o.config.app].oneForConsumerGroup}`;return o.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((c=o.config)==null?void 0:c.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((h=o.config)==null?void 0:h.consumerGroupId)||""):o.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(b=o.config)!=null&&b.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((P=o.config)==null?void 0:P.consumerGroupId)||"")),n}),pe=e.ref(!1),Xe=async()=>{if(R.value){pe.value=!0;try{const n=Ye.value.replace(/{consumerId}/gi,R.value.id);await N.delete(n),s("remove:success",R.value),me(),a.value++}catch(n){Qe.value=n.message||r("consumers.errors.delete"),s("error",n)}finally{pe.value=!1}}};e.watch(W,n=>{var c,h,b;if(n.status===d.FetcherStatus.Error){g.value={title:r("consumers.errors.general")},(b=(h=(c=n.error)==null?void 0:c.response)==null?void 0:h.data)!=null&&b.message&&(g.value.message=n.error.response.data.message),s("error",n.error);return}g.value=null});const re=e.ref({ctaPath:x.value?void 0:o.config.createRoute,ctaText:void 0,message:`${r("consumers.list.empty_state.description")}${o.config.additionMessageForEmptyState?` ${o.config.additionMessageForEmptyState}`:""}`,title:r("consumers.title")});return e.onBeforeMount(async()=>{await o.canCreate()&&(re.value.title=x.value?r("consumers.list.empty_state.title_for_consumer_group"):r("consumers.list.empty_state.title"),re.value.ctaText=x.value?r("consumers.actions.add_consumer"):r("consumers.actions.create"))}),(n,c)=>{const h=e.resolveComponent("KButton"),b=e.resolveComponent("KDropdownItem"),P=e.resolveComponent("KClipboardProvider"),Ze=e.resolveComponent("KPrompt");return e.openBlock(),e.createElementBlock("div",Ee,[e.createVNode(e.unref(d.EntityBaseTable),{"cache-identifier":t.cacheIdentifier,"disable-sorting":B.value,"empty-state-options":re.value,"enable-entity-actions":"","error-message":g.value,fetcher:e.unref(G),"fetcher-cache-key":e.unref(a),"hide-pagination":x.value&&!t.config.paginatedEndpoint,"pagination-type":"offset","preferences-storage-key":M.value,query:S.value,"row-attributes":H,"table-headers":e.unref(u),onClearSearchInput:i,"onClick:row":c[3]||(c[3]=p=>y(p)),onEmptyStateCtaClicked:Je,onSort:f,onState:e.unref(O)},e.createSlots({"toolbar-filter":e.withCtx(()=>[e.renderSlot(n.$slots,"toolbar-filter",{},void 0,!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(d.EntityFilter),{key:0,modelValue:S.value,"onUpdate:modelValue":c[0]||(c[0]=p=>S.value=p),config:z.value},null,8,["modelValue","config"]))]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!t.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createElementVNode("div",De,[!x.value&&A.value?(e.openBlock(),e.createBlock(h,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"consumers-learn-more-button",icon:"",onClick:c[1]||(c[1]=p=>n.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(v.BookIcon),{decorative:""})]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(d.PermissionsWrapper),{"auth-function":()=>t.canCreate()},{default:e.withCtx(()=>[e.createVNode(h,{appearance:"primary","data-testid":"toolbar-add-consumer",size:t.useActionOutside?"medium":"large",onClick:q},{default:e.withCtx(()=>[e.createVNode(e.unref(v.AddIcon)),e.createTextVNode(" "+e.toDisplayString(t.config.consumerGroupId?e.unref(r)("consumers.actions.add_consumer"):e.unref(r)("consumers.list.toolbar_actions.new_consumer")),1)]),_:1},8,["size"])]),_:1},8,["auth-function"])])],8,["disabled"]))]),username:e.withCtx(({rowValue:p})=>[e.createElementVNode("b",null,e.toDisplayString($(p)),1)]),custom_id:e.withCtx(({rowValue:p})=>[e.createTextVNode(e.toDisplayString($(p)),1)]),tags:e.withCtx(({rowValue:p})=>[e.createVNode(e.unref(d.TableTags),{tags:p},null,8,["tags"])]),actions:e.withCtx(({row:p})=>[e.createVNode(P,null,{default:e.withCtx(({copyToClipboard:Z})=>[e.createVNode(b,{"data-testid":"action-entity-copy-id",onClick:ve=>l(p,Z)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("consumers.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(P,null,{default:e.withCtx(({copyToClipboard:Z})=>[e.createVNode(b,{"data-testid":"action-entity-copy-json",onClick:ve=>C(p,Z)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("consumers.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(d.PermissionsWrapper),{"auth-function":()=>t.canRetrieve(p)},{default:e.withCtx(()=>[e.createVNode(b,{"data-testid":"action-entity-view","has-divider":"",item:I(p.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(d.PermissionsWrapper),{"auth-function":()=>t.canEdit(p)},{default:e.withCtx(()=>[e.createVNode(b,{"data-testid":"action-entity-edit",item:J(p.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(d.PermissionsWrapper),{"auth-function":()=>t.canDelete(p)},{default:e.withCtx(()=>[e.createVNode(b,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:()=>t.config.consumerGroupId?ze(p):Le(p)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.config.consumerGroupId?e.unref(r)("consumers.actions.remove"):e.unref(r)("consumers.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!S.value&&t.config.app==="konnect"?{name:"empty-state",fn:e.withCtx(()=>{var p;return[e.createElementVNode("div",$e,[e.renderSlot(n.$slots,"empty-state-toolbar",{},void 0,!0),e.createVNode(e.unref(d.EntityEmptyState),{"action-button-text":e.unref(r)("consumers.list.toolbar_actions.new_consumer"),appearance:"secondary","can-create":()=>t.canCreate(),"data-testid":t.config.consumerGroupId?"nested-consumers-entity-empty-state":"consumers-entity-empty-state",description:e.unref(r)("consumers.list.empty_state_v2.description"),"learn-more":t.config.app==="konnect",title:e.unref(r)("consumers.list.empty_state_v2.title"),"onClick:create":q,"onClick:learnMore":c[2]||(c[2]=Z=>n.$emit("click:learn-more"))},e.createSlots({image:e.withCtx(()=>[e.createElementVNode("div",Be,[e.createVNode(e.unref(v.TeamIcon),{color:e.unref(ge),size:e.unref(ye)},null,8,["color","size"])])]),_:2},[(p=t.config)!=null&&p.isControlPlaneGroup?{name:"message",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("consumers.list.empty_state_v2.group")),1)]),key:"0"}:void 0]),1032,["action-button-text","can-create","data-testid","description","learn-more","title"])])]}),key:"0"}:void 0]),1032,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","hide-pagination","preferences-storage-key","query","table-headers","onState"]),e.createVNode(e.unref(d.EntityDeleteModal),{"action-button-disabled":X.value,"data-testid":"delete-consumer-modal",description:e.unref(r)("consumers.delete.description"),"entity-name":V.value&&(V.value.username||V.value.custom_id||V.value.id),"entity-type":e.unref(d.EntityTypes).Consumer,error:le.value,title:e.unref(r)("consumers.delete.title"),visible:Q.value,onCancel:He,onProceed:We},null,8,["action-button-disabled","description","entity-name","entity-type","error","title","visible"]),t.config.consumerGroupId?(e.openBlock(),e.createBlock(xe,{key:0,config:t.config,"data-testid":"add-consumer-modal",visible:oe.value,"onAdd:partialSuccess":c[4]||(c[4]=p=>ue(p,!0)),"onAdd:success":c[5]||(c[5]=p=>ue(p)),onCancel:de},null,8,["config","visible"])):e.createCommentVNode("",!0),t.config.consumerGroupId&&R.value?(e.openBlock(),e.createBlock(Ze,{key:1,"action-button-appearance":"danger","data-testid":"remove-consumer-modal",title:e.unref(r)("consumers.consumer_groups.remove.title"),visible:ne.value,onCancel:me,onProceed:Xe},{default:e.withCtx(()=>[e.createVNode(e.unref(_),{class:"message",keypath:t.config.consumerGroupName?"consumers.consumer_groups.remove.confirmation":"consumers.consumer_groups.remove.confirmationNoCG",tag:"p"},e.createSlots({consumer:e.withCtx(()=>[e.createElementVNode("strong",null,e.toDisplayString(R.value.username||R.value.custom_id||R.value.id),1)]),_:2},[t.config.consumerGroupName?{name:"consumerGroup",fn:e.withCtx(()=>[e.createElementVNode("strong",null,e.toDisplayString(t.config.consumerGroupName),1)]),key:"0"}:void 0]),1032,["keypath"]),e.createElementVNode("p",null,e.toDisplayString(e.unref(r)("consumers.consumer_groups.remove.description")),1)]),_:1},8,["title","visible"])):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-c5be280d"]]),k=[];for(let t=0;t<256;++t)k.push((t+256).toString(16).slice(1));function Ge(t,m=0){return(k[t[m+0]]+k[t[m+1]]+k[t[m+2]]+k[t[m+3]]+"-"+k[t[m+4]]+k[t[m+5]]+"-"+k[t[m+6]]+k[t[m+7]]+"-"+k[t[m+8]]+k[t[m+9]]+"-"+k[t[m+10]]+k[t[m+11]]+k[t[m+12]]+k[t[m+13]]+k[t[m+14]]+k[t[m+15]]).toLowerCase()}let te;const Me=new Uint8Array(16);function Te(){if(!te){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");te=crypto.getRandomValues.bind(crypto)}return te(Me)}const ie={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ae(t,m,s){var _;if(ie.randomUUID&&!t)return ie.randomUUID();t=t||{};const o=t.random??((_=t.rng)==null?void 0:_.call(t))??Te();if(o.length<16)throw new Error("Random bytes length must be >= 16");return o[6]=o[6]&15|64,o[8]=o[8]&63|128,Ge(o)}const Re={class:"kong-ui-entities-consumer-form"},Ue=["id"],Pe={class:"fields-group-text"},Fe=["aria-labelledby"],qe=ee(e.defineComponent({__name:"ConsumerForm",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||(t==null?void 0:t.app)==="konnect"&&!(t!=null&&t.controlPlaneId)||(t==null?void 0:t.app)==="kongManager"&&typeof(t==null?void 0:t.workspace)!="string"||!(t!=null&&t.cancelRoute))},consumerId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(t,{emit:m}){var W;const s=t,o=m,{i18nT:_,i18n:{t:r}}=Y.useI18n(),w=se.useRouter(),{axiosInstance:N}=d.useAxios((W=s.config)==null?void 0:W.axiosRequestConfig),{getMessageFromError:B}=d.useErrors(),T=Ae(),u=e.reactive({fields:{username:"",customId:"",tags:""},readonly:!1,errorMessage:""}),H=e.reactive({username:"",customId:"",tags:""}),q=e.computed(()=>{var a,i;return(i=F.form[(a=s.config)==null?void 0:a.app])==null?void 0:i.edit}),U=()=>{var a;w.push(((a=s.config)==null?void 0:a.cancelRoute)||{name:"consumer-list"})},S=a=>{o("loading",a)},z=a=>{o("error",a)},K=a=>{var f,$,g;u.fields.username=((f=a==null?void 0:a.item)==null?void 0:f.username)||(a==null?void 0:a.username)||"",u.fields.customId=(($=a==null?void 0:a.item)==null?void 0:$.custom_id)||(a==null?void 0:a.custom_id)||"";const i=((g=a==null?void 0:a.item)==null?void 0:g.tags)||(a==null?void 0:a.tags)||[];u.fields.tags=(i==null?void 0:i.join(", "))||"",Object.assign(H,u.fields)},O=e.computed(()=>s.consumerId?d.EntityBaseFormType.Edit:d.EntityBaseFormType.Create),A=a=>{var f,$,g,l,C,y;let i=`${(f=s.config)==null?void 0:f.apiBaseUrl}${F.form[($=s.config)==null?void 0:$.app][a]}`;return((g=s.config)==null?void 0:g.app)==="konnect"?i=i.replace(/{controlPlaneId}/gi,((l=s.config)==null?void 0:l.controlPlaneId)||""):((C=s.config)==null?void 0:C.app)==="kongManager"&&(i=i.replace(/\/{workspace}/gi,(y=s.config)!=null&&y.workspace?`/${s.config.workspace}`:"")),i=i.replace(/{id}/gi,s.consumerId),i},x=e.computed(()=>!!u.fields.username||!!u.fields.customId),M=e.computed(()=>JSON.stringify(u.fields)!==JSON.stringify(H)),D=e.computed(()=>{var a,i;return{username:u.fields.username||null,custom_id:u.fields.customId||null,tags:(i=(a=u.fields.tags.split(","))==null?void 0:a.map(f=>String(f||"").trim()))==null?void 0:i.filter(f=>f!=="")}}),G=async()=>{var a;try{u.readonly=!0;let i;await N.post(A("validate"),D.value),O.value==="create"?i=await N.post(A("create"),D.value):O.value==="edit"&&(i=((a=s.config)==null?void 0:a.app)==="konnect"?await N.put(A("edit"),D.value):await N.patch(A("edit"),D.value)),K(i==null?void 0:i.data),o("update",i==null?void 0:i.data)}catch(i){u.errorMessage=B(i),o("error",i)}finally{u.readonly=!1}};return(a,i)=>{const f=e.resolveComponent("KInput"),$=e.resolveComponent("KCard");return e.openBlock(),e.createElementBlock("div",Re,[e.createVNode(e.unref(d.EntityBaseForm),{"can-submit":x.value&&M.value,config:t.config,"edit-id":t.consumerId,"entity-type":e.unref(d.SupportedEntityType).Consumer,"error-message":u.errorMessage,"fetch-url":q.value,"form-fields":D.value,"is-readonly":u.readonly,onCancel:U,"onFetch:error":i[3]||(i[3]=g=>z(g)),"onFetch:success":K,onLoading:i[4]||(i[4]=g=>S(g)),onSubmit:G},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(e.unref(d.EntityFormSection),{description:e.unref(r)("consumers.form.info.description"),"has-divider":"",title:e.unref(r)("consumers.form.info.title")},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("h3",{id:`fields-group-title-${e.unref(T)}`,class:"fields-group-title"},e.toDisplayString(e.unref(r)("consumers.form.consumer_identification.title"))+"* ",9,Ue),e.createElementVNode("p",Pe,e.toDisplayString(e.unref(r)("consumers.form.consumer_identification.description")),1)]),e.createVNode($,null,{default:e.withCtx(()=>[e.createElementVNode("fieldset",{"aria-labelledby":`fields-group-title-${e.unref(T)}`},[e.createVNode(f,{modelValue:u.fields.username,"onUpdate:modelValue":i[0]||(i[0]=g=>u.fields.username=g),modelModifiers:{trim:!0},autocomplete:"off",class:"username-field","data-testid":"consumer-form-username",label:e.unref(r)("consumers.fields.username.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(r)("consumers.fields.username.placeholder"),readonly:u.readonly,type:"text"},{"label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(_),{keypath:"consumers.fields.username.tooltip",scope:"global"},{custom_id:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(r)("consumers.fields.username.custom_id")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"]),e.createVNode(f,{modelValue:u.fields.customId,"onUpdate:modelValue":i[1]||(i[1]=g=>u.fields.customId=g),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-form-custom-id",label:e.unref(r)("consumers.fields.custom_id.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(r)("consumers.fields.custom_id.placeholder"),readonly:u.readonly,type:"text"},{"label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(_),{keypath:"consumers.fields.custom_id.tooltip",scope:"global"},{username:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(r)("consumers.fields.custom_id.username")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"])],8,Fe)]),_:1}),e.createVNode(f,{modelValue:u.fields.tags,"onUpdate:modelValue":i[2]||(i[2]=g=>u.fields.tags=g),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-form-tags",help:e.unref(r)("consumers.fields.tags.help"),label:e.unref(r)("consumers.fields.tags.label"),"label-attributes":{info:e.unref(r)("consumers.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(r)("consumers.fields.tags.placeholder"),readonly:u.readonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])])]),_:1},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-ab3e5b9b"]]),Ke={class:"kong-ui-consumer-entity-config-card"},Oe=e.defineComponent({__name:"ConsumerConfigCard",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||t.app==="konnect"&&!t.controlPlaneId||t.app==="kongManager"&&typeof t.workspace!="string"||!t.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(t){const m=t,{i18n:{t:s},i18nT:o}=Y.useI18n(),_=e.computed(()=>F.form[m.config.app].edit),r=e.ref({id:{},username:{section:d.ConfigurationSchemaSection.Basic,tooltip:s("consumers.fields.username.tooltip"),order:1},custom_id:{section:d.ConfigurationSchemaSection.Basic,tooltip:s("consumers.fields.custom_id.tooltip"),label:s("consumers.fields.custom_id.label"),order:2},updated_at:{},created_at:{},tags:{tooltip:s("consumers.fields.tags.tooltip")},username_lower:{hidden:!0},type:{hidden:!0}});return(w,N)=>(e.openBlock(),e.createElementBlock("div",Ke,[e.createVNode(e.unref(d.EntityBaseConfigCard),{config:t.config,"config-card-doc":t.configCardDoc,"config-schema":r.value,"entity-type":e.unref(d.SupportedEntityType).Consumer,"fetch-url":_.value,"hide-title":t.hideTitle,"onFetch:error":N[0]||(N[0]=B=>w.$emit("fetch:error",B)),"onFetch:success":N[1]||(N[1]=B=>w.$emit("fetch:success",B)),onLoading:N[2]||(N[2]=B=>w.$emit("loading",B))},{"username-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(o),{keypath:"consumers.fields.username.tooltip",scope:"global"},{custom_id:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("consumers.fields.username.custom_id")),1)]),_:1})]),"custom_id-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(o),{keypath:"consumers.fields.custom_id.tooltip",scope:"global"},{username:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("consumers.fields.custom_id.username")),1)]),_:1})]),_:1},8,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])]))}});E.ConsumerConfigCard=Oe,E.ConsumerForm=qe,E.ConsumerList=Se,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .config-card-fieldset[data-v-f7096c33]{border:solid 1px #e0e4ea;border-radius:4px;margin-bottom:8px;margin-top:4px}.config-card-fieldset-title[data-v-f7096c33]{font-size:14px;padding:0 8px;width:auto}fieldset.config-card-fieldset .config-card-details-row{width:unset}.config-card-json-item .config-card-details-row,fieldset.config-card-fieldset .config-card-details-row{margin:0 16px}.config-card-json-item .config-card-details-row:last-of-type,fieldset.config-card-fieldset .config-card-details-row:last-of-type{border-bottom:none}[data-v-2feb8c2e] .k-button.navigation-button{font-size:14px;font-weight:400}.config-card-details-row[data-v-5f9aa0e8]{align-items:center;border-bottom:var(--2f90d7f7);box-sizing:border-box;display:var(--668a792a);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-5f9aa0e8]{box-sizing:border-box;padding-right:16px;width:var(--5bc9ad14)}.config-card-details-row .config-card-details-label label[data-v-5f9aa0e8]{color:#3a3f51;display:inline-flex;max-width:100%}.config-card-details-row .config-card-details-label label .label-content[data-v-5f9aa0e8]{line-height:initial;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.config-card-details-row .config-card-details-label label .k-popover[data-v-5f9aa0e8]{min-width:0}.config-card-details-row .config-card-details-value[data-v-5f9aa0e8]{box-sizing:border-box;width:var(--5bc5215e)}.config-card-details-row .config-card-details-value .truncated[data-v-5f9aa0e8]{display:inline-block;line-height:initial;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.config-card-details-row .config-card-details-value span.attrs-data-text[data-v-5f9aa0e8]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-5f9aa0e8] .k-copy:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-5f9aa0e8]{display:flex;flex-wrap:wrap;row-gap:10px}.config-card-details-row .config-badge[data-v-5f9aa0e8]{margin-right:4px}.config-card-details-row[data-v-5f9aa0e8] .k-label{margin-bottom:0}.config-card-details-row[data-v-5f9aa0e8] .k-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-5f9aa0e8] .config-card-details-row{width:auto}.json-content.k-code-block{border-top-left-radius:0;border-top-right-radius:0}.json-endpoint{align-items:baseline;background-color:#000933;border-bottom:1px solid rgba(255,255,255,.2);border-top-left-radius:8px;border-top-right-radius:8px;display:flex;padding:8px 0 8px 12px}.json-endpoint .k-code-block{flex:auto;z-index:2}.json-endpoint .k-code-block .code-block-content{padding-bottom:0;padding-top:0}.json-endpoint .k-code-block .code-block-secondary-actions{margin-top:0!important}.json-endpoint code{direction:rtl;max-width:var(--eca0976a);overflow:hidden!important;text-align:left;text-overflow:ellipsis;white-space:nowrap}.config-card-prop-section-title[data-v-d67757a9]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card .config-card-actions[data-v-9b9ea6f9]{align-items:center;display:flex}.kong-ui-entity-base-config-card .config-card-actions .config-format-select-label[data-v-9b9ea6f9]{margin-bottom:0;margin-right:8px}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-9b9ea6f9]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-9b9ea6f9] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-config-card .book-icon[data-v-9b9ea6f9]{margin-left:8px;padding:0}.kong-ui-entity-base-form[data-v-612b1eac]{box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form[data-v-612b1eac] .k-slideout-title{color:#000933!important;font-size:24px!important;font-weight:700!important;line-height:32px!important;margin-bottom:16px!important}.kong-ui-entity-base-form[data-v-612b1eac] .k-card.content-card{padding:0 16px!important}.kong-ui-entity-base-form[data-v-612b1eac] .tab-item>div.tab-link.has-panels{color:#6c7489!important;font-size:14px!important;font-weight:700!important;line-height:24px!important}.kong-ui-entity-base-form[data-v-612b1eac] .tab-item.active>div.tab-link.has-panels{color:#000933!important;font-weight:600!important}.form-actions[data-v-612b1eac]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.form-actions[data-v-612b1eac] .k-button:last-of-type,.form-actions[data-v-612b1eac] .k-button:nth-last-of-type(2){margin-left:16px}.form-actions-reverted[data-v-612b1eac]{direction:rtl}.content-wrapper[data-v-a3a65cac] .k-tooltip{word-break:break-all}.kong-ui-entity-base-table .toolbar-container[data-v-d86d3e31]{align-items:center;display:flex;width:100%}.kong-ui-entity-base-table .toolbar-button-container[data-v-d86d3e31]{margin-left:auto}.kong-ui-entity-base-table .hidden[data-v-d86d3e31]{display:none}.kong-ui-entity-base-table[data-v-d86d3e31] .empty-state-icon-gateway{background-color:#ecfcff;border-radius:4px;padding:8px}.kong-ui-entity-base-table :deep(.k-table){table-layout:fixed}.kong-ui-entity-delete-modal .message[data-v-4361d622],.kong-ui-entity-delete-modal .description[data-v-4361d622]{line-height:24px;margin:0}.kong-ui-entity-delete-modal .message strong[data-v-4361d622]{font-weight:600}.kong-ui-entity-delete-modal .description[data-v-4361d622]{margin-top:32px}.kong-ui-entity-delete-error[data-v-4361d622]{margin-bottom:16px}.kong-ui-entity-filter-input[data-v-084f7978]{width:100%}.kong-ui-entity-filter-clear[data-v-084f7978]{cursor:pointer}.kong-ui-entity-filter[data-v-084f7978]{display:flex;position:relative}.kong-ui-entity-filter[data-v-084f7978] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-084f7978] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-084f7978]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-084f7978]{background-color:#fff;border:1px solid #afb7c5;border-radius:4px;box-shadow:0 4px 20px #e0e4ea;left:0;margin-top:16px;padding:8px 0 12px;position:absolute;top:100%;width:300px;z-index:1060}.kong-ui-entity-filter-menu-item[data-v-084f7978]{border-bottom:1px solid #e0e4ea;color:#6c7489;font-size:12px;font-weight:400;line-height:16px;list-style:none;margin:0 20px;padding:16px 0;position:relative;white-space:nowrap}.menu-item-title[data-v-084f7978]{align-items:center;cursor:pointer;display:flex;line-height:24px}.menu-item-title.expanded[data-v-084f7978]{color:#232633}.menu-item-expand-icon[data-v-084f7978]{margin-left:auto}.menu-item-expand-icon.expanded[data-v-084f7978]{transform:rotate(180deg)}.menu-item-indicator[data-v-084f7978]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-084f7978]{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.menu-item-body[data-v-084f7978] .input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-084f7978] .k-input{width:100%}.menu-item-body[data-v-084f7978] .k-select-input .input{font-size:12px}.menu-item-body[data-v-084f7978] .k-select-input .input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-084f7978]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-084f7978]{display:flex;justify-content:space-between;margin:10px 0 6px}.filter-clear-button-container[data-v-084f7978]{padding:12px 20px 0}fieldset[data-v-b1f74200]{margin:0;min-width:0;padding:0}.kong-ui-entity-form-section[data-v-b1f74200]{border:0}.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{column-gap:16px;display:flex;flex-direction:column;padding-bottom:64px;row-gap:12px;width:100%}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{flex-direction:row}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{flex:1}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{max-width:350px}.kong-ui-entity-form-section .form-section-wrapper .form-section-info.sticky[data-v-b1f74200]{height:fit-content;margin-bottom:16px;position:sticky;top:16px}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-title[data-v-b1f74200]{color:#000933;font-size:16px;font-weight:700;line-height:20px;margin-bottom:8px;margin-top:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description p[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200] p{color:#000933;font-size:14px;font-weight:400;line-height:20px;margin:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-footer[data-v-b1f74200]{margin-top:32px}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]{flex:1}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]>*:not(:first-child){margin-top:24px}.kong-ui-entity-form-section.has-divider .form-section-wrapper[data-v-b1f74200]{border-bottom:1px solid #e0e4ea}.ff-form-section .header[data-v-cb6d2e95]{align-items:flex-start;display:flex;gap:8px}.ff-form-section .step[data-v-cb6d2e95]{align-items:center;background:#fff;border:1px solid #afb7c5;border-radius:100px;display:flex;flex:0 0 auto;height:32px;justify-content:center;padding:4px;width:32px}.ff-form-section .header-content[data-v-cb6d2e95]{align-items:flex-start;display:flex;flex:1 1 auto;flex-direction:column;gap:8px;padding-top:4px}.ff-form-section .header-title[data-v-cb6d2e95]{color:#000933;font-size:18px;font-weight:700;line-height:24px;margin:0}.ff-form-section .header-description[data-v-cb6d2e95]{color:#52596e;font-size:14px;line-height:20px;margin:0}.ff-form-section .header-extra[data-v-cb6d2e95]{align-items:center;display:flex;flex:0 0 auto;gap:8px;justify-content:flex-end}.ff-form-section .content[data-v-cb6d2e95]{background:#f9fafb;border:1px solid #e0e4ea;border-radius:6px;display:flex;flex-direction:column;gap:20px;margin-left:16px;margin-top:20px;padding:20px 24px}.kong-ui-public-entity-link[data-v-96efdfa5]{align-items:center;display:flex}.kong-ui-public-entity-link .deleted-entity[data-v-96efdfa5]{font-style:italic}.kong-ui-public-entity-link .entity-link[data-v-96efdfa5]{display:flex;flex:1}.kong-ui-public-entity-link .entity-link[data-v-96efdfa5] .external-link-icon{color:#0044f4;margin-left:4px;padding:2px}.kong-ui-public-entity-link .entity-link-label[data-v-96efdfa5]{display:inline-block;font-weight:400;max-width:90%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kong-ui-public-entity-link .copy-uuid-tooltip[data-v-96efdfa5]{align-items:center;cursor:pointer;display:flex}.kong-ui-public-entity-link .copy-uuid-tooltip .entity-link-copy-id[data-v-96efdfa5]{margin-left:2px}.kong-ui-public-entity-empty-state[data-v-b6376b66]{align-items:center;background-color:#fff;box-sizing:border-box;display:flex;flex-direction:column;font-family:Inter,Roboto,Helvetica,sans-serif;gap:24px;padding:64px 0;width:100%}@media (min-width: 640px){.kong-ui-public-entity-empty-state[data-v-b6376b66]{padding:64px 96px}}.kong-ui-public-entity-empty-state .empty-state-image[data-v-b6376b66]{margin-bottom:8px}.kong-ui-public-entity-empty-state .entity-empty-state-content[data-v-b6376b66]{align-items:center;display:flex;flex-direction:column;gap:8px;text-align:center;width:100%}.kong-ui-public-entity-empty-state .entity-empty-state-content .entity-empty-state-title h1[data-v-b6376b66]{align-items:center;color:#000933;display:flex;font-size:24px;font-weight:700;gap:8px;line-height:32px;margin:0}.kong-ui-public-entity-empty-state .entity-empty-state-content .entity-empty-state-title h1.secondary[data-v-b6376b66]{font-size:18px}.kong-ui-public-entity-empty-state .entity-empty-state-description[data-v-b6376b66],.kong-ui-public-entity-empty-state .entity-empty-state-pricing[data-v-b6376b66]{color:#52596e;font-size:14px;font-weight:400;line-height:20px;max-width:640px}.kong-ui-public-entity-empty-state .entity-empty-state-description p[data-v-b6376b66],.kong-ui-public-entity-empty-state .entity-empty-state-pricing p[data-v-b6376b66]{margin:0}.kong-ui-public-entity-empty-state .entity-empty-state-pricing[data-v-b6376b66]{margin-top:16px}.kong-ui-public-entity-empty-state .entity-empty-state-message[data-v-b6376b66]{color:#52596e}.kong-ui-public-entity-empty-state .entity-empty-state-action[data-v-b6376b66]{align-items:center;display:flex;gap:12px}.kong-ui-public-entity-empty-state .entity-empty-state-card-container[data-v-b6376b66]{display:flex;flex-wrap:wrap;gap:16px;justify-content:space-around;margin-top:8px;width:312px}@media (min-width: 640px){.kong-ui-public-entity-empty-state .entity-empty-state-card-container[data-v-b6376b66]{width:640px}}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card[data-v-b6376b66]{background-color:#f9fafb;border:1px solid #e0e4ea;border-radius:6px;color:#afb7c5;gap:8px;height:160px;padding:20px;width:312px}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card .feature-icon[data-v-b6376b66]{color:#3a3f51;display:flex;margin-bottom:12px}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card .feature-icon[data-v-b6376b66] .kui-icon{height:20px!important;width:20px!important}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card[data-v-b6376b66] .card-title{font-size:14px;font-weight:600}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card[data-v-b6376b66] .card-content{-webkit-box-orient:vertical;color:#6c7489;display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;overflow:hidden}.kong-ui-public-entity-empty-state .entity-empty-state-bottom-container[data-v-b6376b66]{border-top:1px solid #e0e4ea;display:flex;flex-direction:column;gap:16px;padding-top:48px;width:100%}@media (min-width: 640px){.kong-ui-public-entity-empty-state .entity-empty-state-bottom-container[data-v-b6376b66]{width:640px}}.kong-ui-entities-add-consumers-modal .add-consumer-form-cta[data-v-d54468ab]{margin-top:0}.kong-ui-entities-add-consumers-modal .add-consumer-form-container[data-v-d54468ab]{margin-bottom:20px}.kong-ui-entities-add-consumers-modal .add-consumer-form-container .kong-ui-entity-add-consumers-error[data-v-d54468ab]{margin-top:16px}.button-row[data-v-c5be280d]{align-items:center;display:flex;gap:12px}.kong-ui-entities-consumers-list[data-v-c5be280d]{width:100%}.kong-ui-entities-consumers-list .empty-state-wrapper[data-v-c5be280d]{display:flex;flex-direction:column;gap:4px;padding:4px 4px 0}.kong-ui-entities-consumers-list .message[data-v-c5be280d]{margin-top:0}.kong-ui-entities-consumers-list .kong-ui-entity-filter-input[data-v-c5be280d]{margin-right:12px}.kong-ui-entities-consumer-form[data-v-ab3e5b9b]{width:100%}@media screen and (min-width: 1280px){.kong-ui-entities-consumer-form[data-v-ab3e5b9b] .form-section-wrapper{column-gap:64px}}.kong-ui-entities-consumer-form fieldset[data-v-ab3e5b9b]{border:none;margin:0;padding:0}.fields-group-title[data-v-ab3e5b9b]{color:#232633;font-size:16px;font-weight:600;line-height:20px;margin-bottom:4px;margin-top:0}.fields-group-text[data-v-ab3e5b9b]{color:#00000073;font-size:14px;line-height:20px;margin-bottom:0;margin-top:0}.username-field[data-v-ab3e5b9b]{margin-bottom:16px}
1
+ .config-card-fieldset[data-v-dc1e39a1]{border:solid 1px #e0e4ea;border-radius:4px;margin-bottom:8px;margin-top:4px}.config-card-fieldset-title[data-v-dc1e39a1]{font-size:14px;padding:0 8px;width:auto}fieldset.config-card-fieldset .config-card-details-row{width:unset}.config-card-json-item .config-card-details-row,fieldset.config-card-fieldset .config-card-details-row{margin:0 16px}.config-card-json-item .config-card-details-row:last-of-type,fieldset.config-card-fieldset .config-card-details-row:last-of-type{border-bottom:none}[data-v-2feb8c2e] .k-button.navigation-button{font-size:14px;font-weight:400}.config-card-details-row[data-v-5f9aa0e8]{align-items:center;border-bottom:var(--2f90d7f7);box-sizing:border-box;display:var(--668a792a);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-5f9aa0e8]{box-sizing:border-box;padding-right:16px;width:var(--5bc9ad14)}.config-card-details-row .config-card-details-label label[data-v-5f9aa0e8]{color:#3a3f51;display:inline-flex;max-width:100%}.config-card-details-row .config-card-details-label label .label-content[data-v-5f9aa0e8]{line-height:initial;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.config-card-details-row .config-card-details-label label .k-popover[data-v-5f9aa0e8]{min-width:0}.config-card-details-row .config-card-details-value[data-v-5f9aa0e8]{box-sizing:border-box;width:var(--5bc5215e)}.config-card-details-row .config-card-details-value .truncated[data-v-5f9aa0e8]{display:inline-block;line-height:initial;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.config-card-details-row .config-card-details-value span.attrs-data-text[data-v-5f9aa0e8]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-5f9aa0e8] .k-copy:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-5f9aa0e8]{display:flex;flex-wrap:wrap;row-gap:10px}.config-card-details-row .config-badge[data-v-5f9aa0e8]{margin-right:4px}.config-card-details-row[data-v-5f9aa0e8] .k-label{margin-bottom:0}.config-card-details-row[data-v-5f9aa0e8] .k-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-5f9aa0e8] .config-card-details-row{width:auto}.json-content.k-code-block{border-top-left-radius:0;border-top-right-radius:0}.json-endpoint{align-items:baseline;background-color:#000933;border-bottom:1px solid rgba(255,255,255,.2);border-top-left-radius:8px;border-top-right-radius:8px;display:flex;padding:8px 0 8px 12px}.json-endpoint .k-code-block{flex:auto;z-index:2}.json-endpoint .k-code-block .code-block-content{padding-bottom:0;padding-top:0}.json-endpoint .k-code-block .code-block-secondary-actions{margin-top:0!important}.json-endpoint code{direction:rtl;max-width:var(--eca0976a);overflow:hidden!important;text-align:left;text-overflow:ellipsis;white-space:nowrap}.config-card-prop-section-title[data-v-d67757a9]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card .config-card-actions[data-v-9b9ea6f9]{align-items:center;display:flex}.kong-ui-entity-base-config-card .config-card-actions .config-format-select-label[data-v-9b9ea6f9]{margin-bottom:0;margin-right:8px}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-9b9ea6f9]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-9b9ea6f9] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-config-card .book-icon[data-v-9b9ea6f9]{margin-left:8px;padding:0}.kong-ui-entity-base-form[data-v-612b1eac]{box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form[data-v-612b1eac] .k-slideout-title{color:#000933!important;font-size:24px!important;font-weight:700!important;line-height:32px!important;margin-bottom:16px!important}.kong-ui-entity-base-form[data-v-612b1eac] .k-card.content-card{padding:0 16px!important}.kong-ui-entity-base-form[data-v-612b1eac] .tab-item>div.tab-link.has-panels{color:#6c7489!important;font-size:14px!important;font-weight:700!important;line-height:24px!important}.kong-ui-entity-base-form[data-v-612b1eac] .tab-item.active>div.tab-link.has-panels{color:#000933!important;font-weight:600!important}.form-actions[data-v-612b1eac]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.form-actions[data-v-612b1eac] .k-button:last-of-type,.form-actions[data-v-612b1eac] .k-button:nth-last-of-type(2){margin-left:16px}.form-actions-reverted[data-v-612b1eac]{direction:rtl}.content-wrapper[data-v-a3a65cac] .k-tooltip{word-break:break-all}.kong-ui-entity-base-table .toolbar-container[data-v-d86d3e31]{align-items:center;display:flex;width:100%}.kong-ui-entity-base-table .toolbar-button-container[data-v-d86d3e31]{margin-left:auto}.kong-ui-entity-base-table .hidden[data-v-d86d3e31]{display:none}.kong-ui-entity-base-table[data-v-d86d3e31] .empty-state-icon-gateway{background-color:#ecfcff;border-radius:4px;padding:8px}.kong-ui-entity-base-table :deep(.k-table){table-layout:fixed}.kong-ui-entity-delete-modal .message[data-v-4361d622],.kong-ui-entity-delete-modal .description[data-v-4361d622]{line-height:24px;margin:0}.kong-ui-entity-delete-modal .message strong[data-v-4361d622]{font-weight:600}.kong-ui-entity-delete-modal .description[data-v-4361d622]{margin-top:32px}.kong-ui-entity-delete-error[data-v-4361d622]{margin-bottom:16px}.kong-ui-entity-filter-input[data-v-084f7978]{width:100%}.kong-ui-entity-filter-clear[data-v-084f7978]{cursor:pointer}.kong-ui-entity-filter[data-v-084f7978]{display:flex;position:relative}.kong-ui-entity-filter[data-v-084f7978] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-084f7978] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-084f7978]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-084f7978]{background-color:#fff;border:1px solid #afb7c5;border-radius:4px;box-shadow:0 4px 20px #e0e4ea;left:0;margin-top:16px;padding:8px 0 12px;position:absolute;top:100%;width:300px;z-index:1060}.kong-ui-entity-filter-menu-item[data-v-084f7978]{border-bottom:1px solid #e0e4ea;color:#6c7489;font-size:12px;font-weight:400;line-height:16px;list-style:none;margin:0 20px;padding:16px 0;position:relative;white-space:nowrap}.menu-item-title[data-v-084f7978]{align-items:center;cursor:pointer;display:flex;line-height:24px}.menu-item-title.expanded[data-v-084f7978]{color:#232633}.menu-item-expand-icon[data-v-084f7978]{margin-left:auto}.menu-item-expand-icon.expanded[data-v-084f7978]{transform:rotate(180deg)}.menu-item-indicator[data-v-084f7978]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-084f7978]{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.menu-item-body[data-v-084f7978] .input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-084f7978] .k-input{width:100%}.menu-item-body[data-v-084f7978] .k-select-input .input{font-size:12px}.menu-item-body[data-v-084f7978] .k-select-input .input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-084f7978]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-084f7978]{display:flex;justify-content:space-between;margin:10px 0 6px}.filter-clear-button-container[data-v-084f7978]{padding:12px 20px 0}fieldset[data-v-b1f74200]{margin:0;min-width:0;padding:0}.kong-ui-entity-form-section[data-v-b1f74200]{border:0}.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{column-gap:16px;display:flex;flex-direction:column;padding-bottom:64px;row-gap:12px;width:100%}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{flex-direction:row}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{flex:1}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{max-width:350px}.kong-ui-entity-form-section .form-section-wrapper .form-section-info.sticky[data-v-b1f74200]{height:fit-content;margin-bottom:16px;position:sticky;top:16px}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-title[data-v-b1f74200]{color:#000933;font-size:16px;font-weight:700;line-height:20px;margin-bottom:8px;margin-top:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description p[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200] p{color:#000933;font-size:14px;font-weight:400;line-height:20px;margin:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-footer[data-v-b1f74200]{margin-top:32px}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]{flex:1}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]>*:not(:first-child){margin-top:24px}.kong-ui-entity-form-section.has-divider .form-section-wrapper[data-v-b1f74200]{border-bottom:1px solid #e0e4ea}.ff-form-section .header[data-v-cb6d2e95]{align-items:flex-start;display:flex;gap:8px}.ff-form-section .step[data-v-cb6d2e95]{align-items:center;background:#fff;border:1px solid #afb7c5;border-radius:100px;display:flex;flex:0 0 auto;height:32px;justify-content:center;padding:4px;width:32px}.ff-form-section .header-content[data-v-cb6d2e95]{align-items:flex-start;display:flex;flex:1 1 auto;flex-direction:column;gap:8px;padding-top:4px}.ff-form-section .header-title[data-v-cb6d2e95]{color:#000933;font-size:18px;font-weight:700;line-height:24px;margin:0}.ff-form-section .header-description[data-v-cb6d2e95]{color:#52596e;font-size:14px;line-height:20px;margin:0}.ff-form-section .header-extra[data-v-cb6d2e95]{align-items:center;display:flex;flex:0 0 auto;gap:8px;justify-content:flex-end}.ff-form-section .content[data-v-cb6d2e95]{background:#f9fafb;border:1px solid #e0e4ea;border-radius:6px;display:flex;flex-direction:column;gap:20px;margin-left:16px;margin-top:20px;padding:20px 24px}.kong-ui-public-entity-link[data-v-96efdfa5]{align-items:center;display:flex}.kong-ui-public-entity-link .deleted-entity[data-v-96efdfa5]{font-style:italic}.kong-ui-public-entity-link .entity-link[data-v-96efdfa5]{display:flex;flex:1}.kong-ui-public-entity-link .entity-link[data-v-96efdfa5] .external-link-icon{color:#0044f4;margin-left:4px;padding:2px}.kong-ui-public-entity-link .entity-link-label[data-v-96efdfa5]{display:inline-block;font-weight:400;max-width:90%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kong-ui-public-entity-link .copy-uuid-tooltip[data-v-96efdfa5]{align-items:center;cursor:pointer;display:flex}.kong-ui-public-entity-link .copy-uuid-tooltip .entity-link-copy-id[data-v-96efdfa5]{margin-left:2px}.kong-ui-public-entity-empty-state[data-v-b6376b66]{align-items:center;background-color:#fff;box-sizing:border-box;display:flex;flex-direction:column;font-family:Inter,Roboto,Helvetica,sans-serif;gap:24px;padding:64px 0;width:100%}@media (min-width: 640px){.kong-ui-public-entity-empty-state[data-v-b6376b66]{padding:64px 96px}}.kong-ui-public-entity-empty-state .empty-state-image[data-v-b6376b66]{margin-bottom:8px}.kong-ui-public-entity-empty-state .entity-empty-state-content[data-v-b6376b66]{align-items:center;display:flex;flex-direction:column;gap:8px;text-align:center;width:100%}.kong-ui-public-entity-empty-state .entity-empty-state-content .entity-empty-state-title h1[data-v-b6376b66]{align-items:center;color:#000933;display:flex;font-size:24px;font-weight:700;gap:8px;line-height:32px;margin:0}.kong-ui-public-entity-empty-state .entity-empty-state-content .entity-empty-state-title h1.secondary[data-v-b6376b66]{font-size:18px}.kong-ui-public-entity-empty-state .entity-empty-state-description[data-v-b6376b66],.kong-ui-public-entity-empty-state .entity-empty-state-pricing[data-v-b6376b66]{color:#52596e;font-size:14px;font-weight:400;line-height:20px;max-width:640px}.kong-ui-public-entity-empty-state .entity-empty-state-description p[data-v-b6376b66],.kong-ui-public-entity-empty-state .entity-empty-state-pricing p[data-v-b6376b66]{margin:0}.kong-ui-public-entity-empty-state .entity-empty-state-pricing[data-v-b6376b66]{margin-top:16px}.kong-ui-public-entity-empty-state .entity-empty-state-message[data-v-b6376b66]{color:#52596e}.kong-ui-public-entity-empty-state .entity-empty-state-action[data-v-b6376b66]{align-items:center;display:flex;gap:12px}.kong-ui-public-entity-empty-state .entity-empty-state-card-container[data-v-b6376b66]{display:flex;flex-wrap:wrap;gap:16px;justify-content:space-around;margin-top:8px;width:312px}@media (min-width: 640px){.kong-ui-public-entity-empty-state .entity-empty-state-card-container[data-v-b6376b66]{width:640px}}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card[data-v-b6376b66]{background-color:#f9fafb;border:1px solid #e0e4ea;border-radius:6px;color:#afb7c5;gap:8px;height:160px;padding:20px;width:312px}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card .feature-icon[data-v-b6376b66]{color:#3a3f51;display:flex;margin-bottom:12px}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card .feature-icon[data-v-b6376b66] .kui-icon{height:20px!important;width:20px!important}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card[data-v-b6376b66] .card-title{font-size:14px;font-weight:600}.kong-ui-public-entity-empty-state .entity-empty-state-card-container .entity-empty-state-card[data-v-b6376b66] .card-content{-webkit-box-orient:vertical;color:#6c7489;display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;overflow:hidden}.kong-ui-public-entity-empty-state .entity-empty-state-bottom-container[data-v-b6376b66]{border-top:1px solid #e0e4ea;display:flex;flex-direction:column;gap:16px;padding-top:48px;width:100%}@media (min-width: 640px){.kong-ui-public-entity-empty-state .entity-empty-state-bottom-container[data-v-b6376b66]{width:640px}}.kong-ui-entities-add-consumers-modal .add-consumer-form-cta[data-v-d54468ab]{margin-top:0}.kong-ui-entities-add-consumers-modal .add-consumer-form-container[data-v-d54468ab]{margin-bottom:20px}.kong-ui-entities-add-consumers-modal .add-consumer-form-container .kong-ui-entity-add-consumers-error[data-v-d54468ab]{margin-top:16px}.button-row[data-v-c5be280d]{align-items:center;display:flex;gap:12px}.kong-ui-entities-consumers-list[data-v-c5be280d]{width:100%}.kong-ui-entities-consumers-list .empty-state-wrapper[data-v-c5be280d]{display:flex;flex-direction:column;gap:4px;padding:4px 4px 0}.kong-ui-entities-consumers-list .message[data-v-c5be280d]{margin-top:0}.kong-ui-entities-consumers-list .kong-ui-entity-filter-input[data-v-c5be280d]{margin-right:12px}.kong-ui-entities-consumer-form[data-v-ab3e5b9b]{width:100%}@media screen and (min-width: 1280px){.kong-ui-entities-consumer-form[data-v-ab3e5b9b] .form-section-wrapper{column-gap:64px}}.kong-ui-entities-consumer-form fieldset[data-v-ab3e5b9b]{border:none;margin:0;padding:0}.fields-group-title[data-v-ab3e5b9b]{color:#232633;font-size:16px;font-weight:600;line-height:20px;margin-bottom:4px;margin-top:0}.fields-group-text[data-v-ab3e5b9b]{color:#00000073;font-size:14px;line-height:20px;margin-bottom:0;margin-top:0}.username-field[data-v-ab3e5b9b]{margin-bottom:16px}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/entities-consumers",
3
- "version": "4.1.3",
3
+ "version": "4.1.4",
4
4
  "type": "module",
5
5
  "main": "./dist/entities-consumers.umd.js",
6
6
  "module": "./dist/entities-consumers.es.js",
@@ -26,8 +26,8 @@
26
26
  "axios": "^1.11.0",
27
27
  "vue": "^3.5.13",
28
28
  "vue-router": "^4.4.5",
29
- "@kong-ui-public/entities-shared": "^3.27.3",
30
- "@kong-ui-public/i18n": "^2.4.1"
29
+ "@kong-ui-public/i18n": "^2.4.2",
30
+ "@kong-ui-public/entities-shared": "^3.27.4"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@kong/design-tokens": "^1.18.0",
@@ -36,8 +36,8 @@
36
36
  "axios": "^1.11.0",
37
37
  "vue": "^3.5.13",
38
38
  "vue-router": "^4.4.5",
39
- "@kong-ui-public/entities-shared": "^3.27.3",
40
- "@kong-ui-public/i18n": "^2.4.1"
39
+ "@kong-ui-public/entities-shared": "^3.27.4",
40
+ "@kong-ui-public/i18n": "^2.4.2"
41
41
  },
42
42
  "repository": {
43
43
  "type": "git",