@kong-ui-public/entities-consumers 4.1.8-pr.2363.eb8ab08a3.0 → 4.1.8-pr.2402.92359608a.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
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 = {
1
+ import { defineComponent as ue, ref as C, computed as I, watch as ye, resolveComponent as K, createBlock as Y, openBlock as D, unref as o, withCtx as l, createElementVNode as k, createVNode as u, createElementBlock as H, createCommentVNode as J, toDisplayString as y, Fragment as Qe, renderList as We, onBeforeMount as ze, createSlots as ge, createTextVNode as L, Teleport as Ye, renderSlot as Ge, reactive as Me } from "vue";
2
+ import { useRouter as Fe } from "vue-router";
3
+ import { BookIcon as De, AddIcon as xe, TeamIcon as Xe } from "@kong/icons";
4
+ import { createI18n as Ze, i18nTComponent as et } from "@kong-ui-public/i18n";
5
+ import { useAxios as he, useDebouncedFilter as tt, useTableState as ot, useFetcher as st, useDeleteUrlBuilder as nt, FetcherStatus as rt, EntityBaseTable as at, PermissionsWrapper as le, TableTags as it, EntityFilter as lt, EntityDeleteModal as ut, EntityTypes as ct, useErrors as dt, EntityBaseFormType as Re, EntityBaseForm as mt, SupportedEntityType as Pe, EntityFormSection as pt, ConfigurationSchemaSection as Ae, EntityBaseConfigCard as ft } from "@kong-ui-public/entities-shared";
6
+ const gt = {
7
7
  list: {
8
8
  table_headers: {
9
9
  username: "Username",
@@ -19,7 +19,8 @@ const ft = "#00abd2", gt = "24px", vt = {
19
19
  empty_state_v2: {
20
20
  title: "Configure your first consumer",
21
21
  group: "Consumers created in gateways within this group will automatically appear here.",
22
- description: "Consumers represent users or apps accessing your APIs, allowing for tailored authentication and individual access control."
22
+ description: "Consumers represent users or apps accessing your APIs, allowing for tailored authentication and individual access control.",
23
+ learn_more: "Learn more"
23
24
  },
24
25
  toolbar_actions: {
25
26
  new_consumer: "New consumer"
@@ -103,51 +104,51 @@ const ft = "#00abd2", gt = "24px", vt = {
103
104
  tooltip: "An optional set of strings associated with the Consumer for grouping and filtering."
104
105
  }
105
106
  }
106
- }, yt = {
107
- consumers: vt
107
+ }, vt = {
108
+ consumers: gt
108
109
  };
109
- function ht() {
110
- const e = Ye("en-us", yt);
110
+ function yt() {
111
+ const e = Ze("en-us", vt);
111
112
  return {
112
113
  i18n: e,
113
- i18nT: Xe(e)
114
+ i18nT: et(e)
114
115
  // Translation component <i18n-t>
115
116
  };
116
117
  }
117
118
  const ce = {
118
- useI18n: ht
119
- }, oe = "/v2/control-planes/{controlPlaneId}/core-entities", se = "/{workspace}", W = {
119
+ useI18n: yt
120
+ }, se = "/v2/control-planes/{controlPlaneId}/core-entities", ne = "/{workspace}", X = {
120
121
  list: {
121
122
  konnect: {
122
- all: `${oe}/consumers`,
123
- forConsumerGroup: `${oe}/consumer_groups/{consumerGroupId}/consumers`,
124
- oneForConsumerGroup: `${oe}/consumer_groups/{consumerGroupId}/consumers/{consumerId}`
125
- },
126
- kongManager: {
127
123
  all: `${se}/consumers`,
128
124
  forConsumerGroup: `${se}/consumer_groups/{consumerGroupId}/consumers`,
129
125
  oneForConsumerGroup: `${se}/consumer_groups/{consumerGroupId}/consumers/{consumerId}`
126
+ },
127
+ kongManager: {
128
+ all: `${ne}/consumers`,
129
+ forConsumerGroup: `${ne}/consumer_groups/{consumerGroupId}/consumers`,
130
+ oneForConsumerGroup: `${ne}/consumer_groups/{consumerGroupId}/consumers/{consumerId}`
130
131
  }
131
132
  },
132
133
  form: {
133
134
  konnect: {
134
- validate: `${oe}/v1/schemas/json/consumer/validate`,
135
- create: `${oe}/consumers`,
136
- edit: `${oe}/consumers/{id}`
137
- },
138
- kongManager: {
139
- validate: `${se}/schemas/consumers/validate`,
135
+ validate: `${se}/v1/schemas/json/consumer/validate`,
140
136
  create: `${se}/consumers`,
141
137
  edit: `${se}/consumers/{id}`
138
+ },
139
+ kongManager: {
140
+ validate: `${ne}/schemas/consumers/validate`,
141
+ create: `${ne}/consumers`,
142
+ edit: `${ne}/consumers/{id}`
142
143
  }
143
144
  }
144
- }, bt = { class: "add-consumer-form-container" }, Ct = { class: "add-consumer-form-cta" }, _t = { class: "select-item-label" }, kt = {
145
+ }, ht = { class: "add-consumer-form-container" }, bt = { class: "add-consumer-form-cta" }, _t = { class: "select-item-label" }, Ct = {
145
146
  key: 0,
146
147
  class: "select-item-desc"
147
- }, It = {
148
+ }, kt = {
148
149
  key: 0,
149
150
  class: "kong-ui-entity-add-consumers-error"
150
- }, wt = { key: 0 }, $t = /* @__PURE__ */ ue({
151
+ }, It = { key: 0 }, wt = /* @__PURE__ */ ue({
151
152
  __name: "AddConsumerModal",
152
153
  props: {
153
154
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -164,135 +165,135 @@ const ce = {
164
165
  },
165
166
  emits: ["cancel", "add:success", "add:partial-success", "error"],
166
167
  setup(e, { emit: p }) {
167
- var v;
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
- loading: U,
171
- allRecords: B,
168
+ var h;
169
+ const { i18n: { t: r } } = ce.useI18n(), t = e, w = p, { axiosInstance: n } = he((h = t.config) == null ? void 0 : h.axiosRequestConfig), $ = C([]), {
170
+ debouncedQueryChange: M,
171
+ loading: F,
172
+ allRecords: q,
172
173
  error: m,
173
- loadItems: Y,
174
- results: H
175
- } = Ze(
174
+ loadItems: Z,
175
+ results: Q
176
+ } = tt(
176
177
  t.config,
177
- W.list[t.config.app].all,
178
+ X.list[t.config.app].all,
178
179
  "",
179
180
  {
180
181
  fetchedItemsKey: "data",
181
182
  searchKeys: ["username", "id"]
182
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
- label: u.username || u.customId,
185
- value: u.id,
186
- selected: E.value.includes(u.id),
187
- data: u
184
+ ), j = (c) => c, P = I(() => m.value ? r("consumers.errors.general") : ""), re = C(0), W = I(() => q.value === void 0), z = I(() => Q.value.map((c) => ({
185
+ label: c.username || c.customId,
186
+ value: c.id,
187
+ selected: $.value.includes(c.id),
188
+ data: c
188
189
  // we need this to determine whether or not to show the description text
189
- }))), K = (u) => {
190
- var y;
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
- return C ? C.username || C.custom_id : u;
193
- }, A = () => {
194
- F.value = "", P.value = [], g.value = [], $("cancel");
195
- }, P = k([]), R = k(!1), F = k(""), X = async () => {
196
- if (!E.value.length) {
197
- F.value = "", g.value = [], $("cancel");
190
+ }))), N = (c) => {
191
+ var b;
192
+ const _ = W.value ? Q.value.find((E) => E.id === c) : (b = q.value) == null ? void 0 : b.find((E) => E.id === c);
193
+ return _ ? _.username || _.custom_id : c;
194
+ }, x = () => {
195
+ T.value = "", B.value = [], g.value = [], w("cancel");
196
+ }, B = C([]), A = C(!1), T = C(""), ee = async () => {
197
+ if (!$.value.length) {
198
+ T.value = "", g.value = [], w("cancel");
198
199
  return;
199
200
  }
200
- R.value = !0, F.value = "", P.value = [], g.value = [];
201
+ A.value = !0, T.value = "", B.value = [], g.value = [];
201
202
  try {
202
- const u = E.value.map((S) => i(S)), C = await Promise.allSettled(u);
203
- let y = !0;
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));
203
+ const c = $.value.map((E) => i(E)), _ = await Promise.allSettled(c);
204
+ let b = !0;
205
+ _.forEach((E) => {
206
+ E.status !== "fulfilled" && (b = !1);
207
+ }), b ? (B.value = [], g.value = [], w("add:success", $.value), $.value = []) : (B.value.length && w("add:partial-success", B.value), $.value = [], V(_));
207
208
  } catch {
208
- F.value = r("consumers.errors.add"), $("error", F.value);
209
+ T.value = r("consumers.errors.add"), w("error", T.value);
209
210
  } finally {
210
- R.value = !1;
211
+ A.value = !1;
211
212
  }
212
213
  }, a = I(() => {
213
- var C, y, S, Z;
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, (S = t.config) != null && S.workspace ? `/${t.config.workspace}` : "").replace(/{consumerGroupId}/gi, ((Z = t.config) == null ? void 0 : Z.consumerGroupId) || "")), u;
216
- }), i = async (u) => {
217
- const C = {
218
- consumer: u
214
+ var _, b, E, te;
215
+ let c = `${t.config.apiBaseUrl}${X.list[t.config.app].forConsumerGroup}`;
216
+ return t.config.app === "konnect" ? c = c.replace(/{controlPlaneId}/gi, ((_ = t.config) == null ? void 0 : _.controlPlaneId) || "").replace(/{consumerGroupId}/gi, ((b = t.config) == null ? void 0 : b.consumerGroupId) || "") : t.config.app === "kongManager" && (c = c.replace(/\/{workspace}/gi, (E = t.config) != null && E.workspace ? `/${t.config.workspace}` : "").replace(/{consumerGroupId}/gi, ((te = t.config) == null ? void 0 : te.consumerGroupId) || "")), c;
217
+ }), i = async (c) => {
218
+ const _ = {
219
+ consumer: c
219
220
  };
220
221
  try {
221
- const y = await n.post(a.value, C);
222
- return P.value.push(u), y;
223
- } catch (y) {
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));
222
+ const b = await n.post(a.value, _);
223
+ return B.value.push(c), b;
224
+ } catch (b) {
225
+ let E = `${N(c)} - ${b.message}`;
226
+ return b.response.status === 409 && (E = `${N(c)} - ${r("consumers.errors.already_added")}`), Promise.reject(Error(E));
226
227
  }
227
- }, g = k([]), T = (u) => {
228
- g.value = u.map((C) => {
229
- var y;
230
- return (y = C.reason) == null ? void 0 : y.message;
228
+ }, g = C([]), V = (c) => {
229
+ g.value = c.map((_) => {
230
+ var b;
231
+ return (b = _.reason) == null ? void 0 : b.message;
231
232
  }).filter(Boolean);
232
233
  };
233
- return ve(Q, () => {
234
+ return ye(z, () => {
234
235
  re.value++;
235
- }, { immediate: !0, deep: !0 }), ve(() => t.visible, () => {
236
- t.visible && Y();
237
- }, { immediate: !0 }), (u, C) => {
238
- const y = N("KMultiselect"), S = N("KAlert"), Z = N("KPrompt");
239
- return D(), ne(Z, {
240
- "action-button-disabled": R.value,
236
+ }, { immediate: !0, deep: !0 }), ye(() => t.visible, () => {
237
+ t.visible && Z();
238
+ }, { immediate: !0 }), (c, _) => {
239
+ const b = K("KMultiselect"), E = K("KAlert"), te = K("KPrompt");
240
+ return D(), Y(te, {
241
+ "action-button-disabled": A.value,
241
242
  class: "kong-ui-entities-add-consumers-modal",
242
243
  "data-testid": "add-consumer-modal",
243
244
  title: o(r)("consumers.consumer_groups.add.title"),
244
245
  visible: e.visible,
245
- onCancel: A,
246
- onProceed: X
246
+ onCancel: x,
247
+ onProceed: ee
247
248
  }, {
248
249
  default: l(() => [
249
- _("div", bt, [
250
- _("p", Ct, b(o(r)("consumers.consumer_groups.add.ctaText")), 1),
251
- c(y, {
252
- modelValue: E.value,
253
- "onUpdate:modelValue": C[0] || (C[0] = (G) => E.value = G),
250
+ k("div", ht, [
251
+ k("p", bt, y(o(r)("consumers.consumer_groups.add.ctaText")), 1),
252
+ u(b, {
253
+ modelValue: $.value,
254
+ "onUpdate:modelValue": _[0] || (_[0] = (S) => $.value = S),
254
255
  autosuggest: "",
255
256
  "data-testid": "add-consumers-multiselect",
256
- "dropdown-footer-text": J.value ? o(r)("consumers.consumer_groups.add.footer") : void 0,
257
- items: Q.value,
257
+ "dropdown-footer-text": W.value ? o(r)("consumers.consumer_groups.add.footer") : void 0,
258
+ items: z.value,
258
259
  label: o(r)("consumers.consumer_groups.add.consumers_label"),
259
- loading: o(U),
260
+ loading: o(F),
260
261
  placeholder: o(r)("consumers.consumer_groups.add.consumer_placeholder"),
261
- readonly: R.value,
262
+ readonly: A.value,
262
263
  required: "",
263
264
  width: "100%",
264
- onQueryChange: o(x)
265
+ onQueryChange: o(M)
265
266
  }, {
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)
267
+ "item-template": l(({ item: S }) => [
268
+ k("div", _t, y(S.label), 1),
269
+ j(S).data.username && j(S).data.custom_id ? (D(), H("div", Ct, y(j(S).data.custom_id), 1)) : J("", !0)
269
270
  ]),
270
271
  _: 1
271
272
  }, 8, ["modelValue", "dropdown-footer-text", "items", "label", "loading", "placeholder", "readonly", "onQueryChange"]),
272
- F.value || V.value || g.value.length ? (D(), L("div", It, [
273
- c(S, { appearance: "danger" }, {
273
+ T.value || P.value || g.value.length ? (D(), H("div", kt, [
274
+ u(E, { appearance: "danger" }, {
274
275
  default: l(() => [
275
- _("p", null, b(o(r)("consumers.errors.add")), 1),
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
- ])) : z("", !0),
279
- _("div", null, b(F.value || V.value), 1)
276
+ k("p", null, y(o(r)("consumers.errors.add")), 1),
277
+ g.value.length ? (D(), H("ul", It, [
278
+ (D(!0), H(Qe, null, We(g.value, (S, oe) => (D(), H("li", { key: oe }, y(S), 1))), 128))
279
+ ])) : J("", !0),
280
+ k("div", null, y(T.value || P.value), 1)
280
281
  ]),
281
282
  _: 1
282
283
  })
283
- ])) : z("", !0)
284
+ ])) : J("", !0)
284
285
  ])
285
286
  ]),
286
287
  _: 1
287
288
  }, 8, ["action-button-disabled", "title", "visible"]);
288
289
  };
289
290
  }
290
- }), he = (e, p) => {
291
+ }), be = (e, p) => {
291
292
  const r = e.__vccOpts || e;
292
- for (const [t, $] of p)
293
- r[t] = $;
293
+ for (const [t, w] of p)
294
+ r[t] = w;
294
295
  return r;
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
+ }, $t = /* @__PURE__ */ be(wt, [["__scopeId", "data-v-d54468ab"]]), Et = { class: "kong-ui-entities-consumers-list" }, St = { class: "button-row" }, Gt = { class: "empty-state-wrapper" }, Mt = /* @__PURE__ */ ue({
296
297
  __name: "ConsumerList",
297
298
  props: {
298
299
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -338,21 +339,21 @@ const ce = {
338
339
  },
339
340
  emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success", "add:success", "remove:success"],
340
341
  setup(e, { emit: p }) {
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 = {
342
+ var Ee;
343
+ const r = p, t = e, { i18nT: w, i18n: { t: n } } = ce.useI18n(), $ = Fe(), { axiosInstance: M } = he((Ee = t.config) == null ? void 0 : Ee.axiosRequestConfig), F = I(() => t.config.app !== "kongManager" || !!t.config.disableSorting), q = {
343
344
  // the Username column is non-hidable
344
345
  username: { label: n("consumers.list.table_headers.username"), searchable: !0, sortable: !0, hidable: !1 },
345
346
  custom_id: { label: n("consumers.list.table_headers.custom_id"), searchable: !0, sortable: !0 },
346
347
  tags: { label: n("consumers.list.table_headers.tags"), sortable: !1 }
347
- }, m = B, Y = (s) => ({
348
+ }, m = q, Z = (s) => ({
348
349
  "data-testid": s.username ?? s.custom_id ?? s.id
349
- }), H = () => {
350
- t.config.consumerGroupId ? Ce() : E.push(t.config.createRoute);
351
- }, O = I(() => {
352
- var d, h, w, j;
353
- let s = `${t.config.apiBaseUrl}${W.list[t.config.app][A.value ? "forConsumerGroup" : "all"]}`;
354
- 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;
355
- }), V = k(""), re = I(() => {
350
+ }), Q = () => {
351
+ t.config.consumerGroupId ? Ce() : $.push(t.config.createRoute);
352
+ }, j = I(() => {
353
+ var d, v, R, U;
354
+ let s = `${t.config.apiBaseUrl}${X.list[t.config.app][x.value ? "forConsumerGroup" : "all"]}`;
355
+ return t.config.app === "konnect" ? s = s.replace(/{controlPlaneId}/gi, ((d = t.config) == null ? void 0 : d.controlPlaneId) || "").replace(/{consumerGroupId}/gi, ((v = t.config) == null ? void 0 : v.consumerGroupId) || "") : t.config.app === "kongManager" && (s = s.replace(/\/{workspace}/gi, (R = t.config) != null && R.workspace ? `/${t.config.workspace}` : "").replace(/{consumerGroupId}/gi, ((U = t.config) == null ? void 0 : U.consumerGroupId) || "")), s;
356
+ }), P = C(""), re = I(() => {
356
357
  const s = t.config.app === "konnect" || t.config.isExactMatch;
357
358
  return s ? {
358
359
  isExactMatch: s,
@@ -360,24 +361,24 @@ const ce = {
360
361
  } : {
361
362
  isExactMatch: s,
362
363
  fields: {
363
- username: B.username,
364
- custom_id: B.custom_id
364
+ username: q.username,
365
+ custom_id: q.custom_id
365
366
  },
366
367
  schema: t.config.filterSchema
367
368
  };
368
- }), { hasRecords: J, handleStateChange: Q } = et(V), K = I(() => J.value && t.config.app === "konnect"), A = I(() => !!t.config.consumerGroupId), P = I(
369
- () => A.value ? "kong-ui-entities-consumers-list-in-group-page" : "kong-ui-entities-consumers-list"
370
- ), R = I(() => A.value && !t.config.paginatedEndpoint ? "consumers" : void 0), {
371
- fetcher: F,
372
- fetcherState: X,
369
+ }), { hasRecords: W, handleStateChange: z } = ot(P), N = I(() => W.value && t.config.app === "konnect"), x = I(() => !!t.config.consumerGroupId), B = I(
370
+ () => x.value ? "kong-ui-entities-consumers-list-in-group-page" : "kong-ui-entities-consumers-list"
371
+ ), A = I(() => x.value && !t.config.paginatedEndpoint ? "consumers" : void 0), {
372
+ fetcher: T,
373
+ fetcherState: ee,
373
374
  fetcherCacheKey: a
374
- } = tt(I(() => ({ ...t.config, cacheIdentifier: t.cacheIdentifier })), O, R), i = () => {
375
- V.value = "";
375
+ } = st(I(() => ({ ...t.config, cacheIdentifier: t.cacheIdentifier })), j, A), i = () => {
376
+ P.value = "";
376
377
  }, g = () => {
377
378
  a.value++;
378
- }, T = (s) => s ?? "-", v = k(null), u = async (s, d) => {
379
- const h = s.id;
380
- if (!await d(h)) {
379
+ }, V = (s) => s ?? "-", h = C(null), c = async (s, d) => {
380
+ const v = s.id;
381
+ if (!await d(v)) {
381
382
  r("copy:error", {
382
383
  entity: s,
383
384
  field: "id",
@@ -388,11 +389,11 @@ const ce = {
388
389
  r("copy:success", {
389
390
  entity: s,
390
391
  field: "id",
391
- message: n("consumers.copy.success", { val: h })
392
+ message: n("consumers.copy.success", { val: v })
392
393
  });
393
- }, C = (s, d) => {
394
- const h = JSON.stringify(s);
395
- if (!d(h)) {
394
+ }, _ = (s, d) => {
395
+ const v = JSON.stringify(s);
396
+ if (!d(v)) {
396
397
  r("copy:error", {
397
398
  entity: s,
398
399
  message: n("consumers.errors.copy")
@@ -403,117 +404,117 @@ const ce = {
403
404
  entity: s,
404
405
  message: n("consumers.copy.success_brief")
405
406
  });
406
- }, y = async (s) => {
407
- var h;
408
- await ((h = t.canRetrieve) == null ? void 0 : h.call(t, s)) && E.push(t.config.getViewRoute(s.id));
409
- }, S = (s) => ({
407
+ }, b = async (s) => {
408
+ var v;
409
+ await ((v = t.canRetrieve) == null ? void 0 : v.call(t, s)) && $.push(t.config.getViewRoute(s.id));
410
+ }, E = (s) => ({
410
411
  label: n("consumers.actions.view"),
411
412
  to: t.config.getViewRoute(s)
412
- }), Z = (s) => ({
413
+ }), te = (s) => ({
413
414
  label: n("consumers.actions.edit"),
414
415
  to: t.config.getEditRoute(s)
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
- ee.value = !1;
419
- }, Ve = async () => {
420
- var s, d, h;
421
- if ((s = G.value) != null && s.id) {
416
+ }), S = C(void 0), oe = C(!1), ae = C(!1), _e = C(""), Te = nt(t.config, j.value), Ue = (s) => {
417
+ S.value = s, oe.value = !0;
418
+ }, Be = () => {
419
+ oe.value = !1;
420
+ }, Ke = async () => {
421
+ var s, d, v;
422
+ if ((s = S.value) != null && s.id) {
422
423
  ae.value = !0;
423
424
  try {
424
- await x.delete(Re(G.value.id)), ae.value = !1, ee.value = !1, a.value++, r("delete:success", G.value);
425
- } catch (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);
425
+ await M.delete(Te(S.value.id)), ae.value = !1, oe.value = !1, a.value++, r("delete:success", S.value);
426
+ } catch (R) {
427
+ _e.value = ((v = (d = R.response) == null ? void 0 : d.data) == null ? void 0 : v.message) || R.message || n("consumers.errors.delete"), r("error", R);
427
428
  } finally {
428
429
  ae.value = !1;
429
430
  }
430
431
  }
431
- }, de = k(!1), Ce = () => {
432
+ }, de = C(!1), Ce = () => {
432
433
  de.value = !0;
433
- }, _e = () => {
434
+ }, ke = () => {
434
435
  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
- var d, h, w, j;
445
- let s = `${t.config.apiBaseUrl}${W.list[t.config.app].oneForConsumerGroup}`;
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
- }), we = k(!1), qe = async () => {
448
- if (q.value) {
449
- we.value = !0;
436
+ }, Ie = (s, d) => {
437
+ d || ke(), a.value++, r("add:success", s);
438
+ }, qe = () => {
439
+ x.value && Ce();
440
+ }, O = C(void 0), me = C(!1), Ne = C(""), Oe = (s) => {
441
+ O.value = s, me.value = !0;
442
+ }, we = () => {
443
+ me.value = !1, O.value = void 0;
444
+ }, je = I(() => {
445
+ var d, v, R, U;
446
+ let s = `${t.config.apiBaseUrl}${X.list[t.config.app].oneForConsumerGroup}`;
447
+ return t.config.app === "konnect" ? s = s.replace(/{controlPlaneId}/gi, ((d = t.config) == null ? void 0 : d.controlPlaneId) || "").replace(/{consumerGroupId}/gi, ((v = t.config) == null ? void 0 : v.consumerGroupId) || "") : t.config.app === "kongManager" && (s = s.replace(/\/{workspace}/gi, (R = t.config) != null && R.workspace ? `/${t.config.workspace}` : "").replace(/{consumerGroupId}/gi, ((U = t.config) == null ? void 0 : U.consumerGroupId) || "")), s;
448
+ }), $e = C(!1), Le = async () => {
449
+ if (O.value) {
450
+ $e.value = !0;
450
451
  try {
451
- const s = Ke.value.replace(/{consumerId}/gi, q.value.id);
452
- await x.delete(s), r("remove:success", q.value), Ie(), a.value++;
452
+ const s = je.value.replace(/{consumerId}/gi, O.value.id);
453
+ await M.delete(s), r("remove:success", O.value), we(), a.value++;
453
454
  } catch (s) {
454
- Pe.value = s.message || n("consumers.errors.delete"), r("error", s);
455
+ Ne.value = s.message || n("consumers.errors.delete"), r("error", s);
455
456
  } finally {
456
- we.value = !1;
457
+ $e.value = !1;
457
458
  }
458
459
  }
459
460
  };
460
- ve(X, (s) => {
461
- var d, h, w;
462
- if (s.status === st.Error) {
463
- v.value = {
461
+ ye(ee, (s) => {
462
+ var d, v, R;
463
+ if (s.status === rt.Error) {
464
+ h.value = {
464
465
  title: n("consumers.errors.general")
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);
466
+ }, (R = (v = (d = s.error) == null ? void 0 : d.response) == null ? void 0 : v.data) != null && R.message && (h.value.message = s.error.response.data.message), r("error", s.error);
466
467
  return;
467
468
  }
468
- v.value = null;
469
+ h.value = null;
469
470
  });
470
- const pe = k({
471
- ctaPath: A.value ? void 0 : t.config.createRoute,
471
+ const pe = C({
472
+ ctaPath: x.value ? void 0 : t.config.createRoute,
472
473
  ctaText: void 0,
473
474
  message: `${n("consumers.list.empty_state.description")}${t.config.additionMessageForEmptyState ? ` ${t.config.additionMessageForEmptyState}` : ""}`,
474
475
  title: n("consumers.title")
475
- });
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"));
476
+ }), fe = C(!1);
477
+ return ze(async () => {
478
+ fe.value = await t.canCreate(), fe.value && (pe.value.title = x.value ? n("consumers.list.empty_state.title_for_consumer_group") : n("consumers.list.empty_state.title"), pe.value.ctaText = x.value ? n("consumers.actions.add_consumer") : n("consumers.actions.create"));
478
479
  }), (s, d) => {
479
- const h = N("KButton"), w = N("KDropdownItem"), j = N("KClipboardProvider"), Ne = N("KPrompt");
480
- return D(), L("div", St, [
481
- c(o(nt), {
480
+ const v = K("KButton"), R = K("KEmptyState"), U = K("KDropdownItem"), Se = K("KClipboardProvider"), He = K("KPrompt");
481
+ return D(), H("div", Et, [
482
+ u(o(at), {
482
483
  "cache-identifier": e.cacheIdentifier,
483
- "disable-sorting": U.value,
484
+ "disable-sorting": F.value,
484
485
  "empty-state-options": pe.value,
485
486
  "enable-entity-actions": "",
486
- "error-message": v.value,
487
- fetcher: o(F),
487
+ "error-message": h.value,
488
+ fetcher: o(T),
488
489
  "fetcher-cache-key": o(a),
489
- "hide-pagination": A.value && !e.config.paginatedEndpoint,
490
+ "hide-pagination": x.value && !e.config.paginatedEndpoint,
490
491
  "pagination-type": "offset",
491
- "preferences-storage-key": P.value,
492
- query: V.value,
493
- "row-attributes": Y,
492
+ "preferences-storage-key": B.value,
493
+ query: P.value,
494
+ "row-attributes": Z,
494
495
  "table-headers": o(m),
495
496
  onClearSearchInput: i,
496
- "onClick:row": d[3] || (d[3] = (f) => y(f)),
497
- onEmptyStateCtaClicked: Fe,
497
+ "onClick:row": d[3] || (d[3] = (f) => b(f)),
498
+ onEmptyStateCtaClicked: qe,
498
499
  onSort: g,
499
- onState: o(Q)
500
- }, fe({
500
+ onState: o(z)
501
+ }, ge({
501
502
  "toolbar-filter": l(() => [
502
- Ee(s.$slots, "toolbar-filter", {}, void 0, !0),
503
- A.value ? z("", !0) : (D(), ne(o(at), {
503
+ Ge(s.$slots, "toolbar-filter", {}, void 0, !0),
504
+ x.value ? J("", !0) : (D(), Y(o(lt), {
504
505
  key: 0,
505
- modelValue: V.value,
506
- "onUpdate:modelValue": d[0] || (d[0] = (f) => V.value = f),
506
+ modelValue: P.value,
507
+ "onUpdate:modelValue": d[0] || (d[0] = (f) => P.value = f),
507
508
  config: re.value
508
509
  }, null, 8, ["modelValue", "config"]))
509
510
  ]),
510
511
  "toolbar-button": l(() => [
511
- (D(), ne(Je, {
512
+ (D(), Y(Ye, {
512
513
  disabled: !e.useActionOutside,
513
514
  to: "#kong-ui-app-page-header-action-button"
514
515
  }, [
515
- _("div", Gt, [
516
- !A.value && K.value ? (D(), ne(h, {
516
+ k("div", St, [
517
+ !x.value && N.value ? (D(), Y(v, {
517
518
  key: 0,
518
519
  appearance: "secondary",
519
520
  class: "open-learning-hub",
@@ -522,23 +523,23 @@ const ce = {
522
523
  onClick: d[1] || (d[1] = (f) => s.$emit("click:learn-more"))
523
524
  }, {
524
525
  default: l(() => [
525
- c(o(Qe), { decorative: "" })
526
+ u(o(De), { decorative: "" })
526
527
  ]),
527
528
  _: 1
528
- })) : z("", !0),
529
- c(o(le), {
529
+ })) : J("", !0),
530
+ u(o(le), {
530
531
  "auth-function": () => e.canCreate()
531
532
  }, {
532
533
  default: l(() => [
533
- c(h, {
534
+ u(v, {
534
535
  appearance: "primary",
535
536
  "data-testid": "toolbar-add-consumer",
536
537
  size: e.useActionOutside ? "medium" : "large",
537
- onClick: H
538
+ onClick: Q
538
539
  }, {
539
540
  default: l(() => [
540
- c(o(ze)),
541
- te(" " + b(e.config.consumerGroupId ? o(n)("consumers.actions.add_consumer") : o(n)("consumers.list.toolbar_actions.new_consumer")), 1)
541
+ u(o(xe)),
542
+ L(" " + y(e.config.consumerGroupId ? o(n)("consumers.actions.add_consumer") : o(n)("consumers.list.toolbar_actions.new_consumer")), 1)
542
543
  ]),
543
544
  _: 1
544
545
  }, 8, ["size"])
@@ -549,78 +550,78 @@ const ce = {
549
550
  ], 8, ["disabled"]))
550
551
  ]),
551
552
  username: l(({ rowValue: f }) => [
552
- _("b", null, b(T(f)), 1)
553
+ k("b", null, y(V(f)), 1)
553
554
  ]),
554
555
  custom_id: l(({ rowValue: f }) => [
555
- te(b(T(f)), 1)
556
+ L(y(V(f)), 1)
556
557
  ]),
557
558
  tags: l(({ rowValue: f }) => [
558
- c(o(rt), { tags: f }, null, 8, ["tags"])
559
+ u(o(it), { tags: f }, null, 8, ["tags"])
559
560
  ]),
560
561
  actions: l(({ row: f }) => [
561
- c(j, null, {
562
+ u(Se, null, {
562
563
  default: l(({ copyToClipboard: ie }) => [
563
- c(w, {
564
+ u(U, {
564
565
  "data-testid": "action-entity-copy-id",
565
- onClick: (Oe) => u(f, ie)
566
+ onClick: (Je) => c(f, ie)
566
567
  }, {
567
568
  default: l(() => [
568
- te(b(o(n)("consumers.actions.copy_id")), 1)
569
+ L(y(o(n)("consumers.actions.copy_id")), 1)
569
570
  ]),
570
571
  _: 2
571
572
  }, 1032, ["onClick"])
572
573
  ]),
573
574
  _: 2
574
575
  }, 1024),
575
- c(j, null, {
576
+ u(Se, null, {
576
577
  default: l(({ copyToClipboard: ie }) => [
577
- c(w, {
578
+ u(U, {
578
579
  "data-testid": "action-entity-copy-json",
579
- onClick: (Oe) => C(f, ie)
580
+ onClick: (Je) => _(f, ie)
580
581
  }, {
581
582
  default: l(() => [
582
- te(b(o(n)("consumers.actions.copy_json")), 1)
583
+ L(y(o(n)("consumers.actions.copy_json")), 1)
583
584
  ]),
584
585
  _: 2
585
586
  }, 1032, ["onClick"])
586
587
  ]),
587
588
  _: 2
588
589
  }, 1024),
589
- c(o(le), {
590
+ u(o(le), {
590
591
  "auth-function": () => e.canRetrieve(f)
591
592
  }, {
592
593
  default: l(() => [
593
- c(w, {
594
+ u(U, {
594
595
  "data-testid": "action-entity-view",
595
596
  "has-divider": "",
596
- item: S(f.id)
597
+ item: E(f.id)
597
598
  }, null, 8, ["item"])
598
599
  ]),
599
600
  _: 2
600
601
  }, 1032, ["auth-function"]),
601
- c(o(le), {
602
+ u(o(le), {
602
603
  "auth-function": () => e.canEdit(f)
603
604
  }, {
604
605
  default: l(() => [
605
- c(w, {
606
+ u(U, {
606
607
  "data-testid": "action-entity-edit",
607
- item: Z(f.id)
608
+ item: te(f.id)
608
609
  }, null, 8, ["item"])
609
610
  ]),
610
611
  _: 2
611
612
  }, 1032, ["auth-function"]),
612
- c(o(le), {
613
+ u(o(le), {
613
614
  "auth-function": () => e.canDelete(f)
614
615
  }, {
615
616
  default: l(() => [
616
- c(w, {
617
+ u(U, {
617
618
  danger: "",
618
619
  "data-testid": "action-entity-delete",
619
620
  "has-divider": "",
620
- onClick: () => e.config.consumerGroupId ? Be(f) : Te(f)
621
+ onClick: () => e.config.consumerGroupId ? Oe(f) : Ue(f)
621
622
  }, {
622
623
  default: l(() => [
623
- te(b(e.config.consumerGroupId ? o(n)("consumers.actions.remove") : o(n)("consumers.actions.delete")), 1)
624
+ L(y(e.config.consumerGroupId ? o(n)("consumers.actions.remove") : o(n)("consumers.actions.delete")), 1)
624
625
  ]),
625
626
  _: 2
626
627
  }, 1032, ["onClick"])
@@ -630,132 +631,146 @@ const ce = {
630
631
  ]),
631
632
  _: 2
632
633
  }, [
633
- !V.value && e.config.app === "konnect" ? {
634
+ !P.value && e.config.app === "konnect" ? {
634
635
  name: "empty-state",
635
636
  fn: l(() => {
636
637
  var f;
637
638
  return [
638
- _("div", Mt, [
639
- Ee(s.$slots, "empty-state-toolbar", {}, void 0, !0),
640
- c(o(it), {
641
- "action-button-text": o(n)("consumers.list.toolbar_actions.new_consumer"),
642
- appearance: "secondary",
643
- "can-create": () => e.canCreate(),
639
+ k("div", Gt, [
640
+ Ge(s.$slots, "empty-state-toolbar", {}, void 0, !0),
641
+ u(R, {
644
642
  "data-testid": e.config.consumerGroupId ? "nested-consumers-entity-empty-state" : "consumers-entity-empty-state",
645
- description: o(n)("consumers.list.empty_state_v2.description"),
646
- "learn-more": e.config.app === "konnect",
647
- title: o(n)("consumers.list.empty_state_v2.title"),
648
- "onClick:create": H,
649
- "onClick:learnMore": d[2] || (d[2] = (ie) => s.$emit("click:learn-more"))
650
- }, fe({
651
- image: l(() => [
652
- _("div", xt, [
653
- c(o(We), {
654
- color: o(ft),
655
- size: o(gt)
656
- }, null, 8, ["color", "size"])
657
- ])
643
+ "icon-background": "",
644
+ message: o(n)("consumers.list.empty_state_v2.description"),
645
+ title: o(n)("consumers.list.empty_state_v2.title")
646
+ }, ge({
647
+ icon: l(() => [
648
+ u(o(Xe), { decorative: "" })
649
+ ]),
650
+ action: l(() => [
651
+ fe.value ? (D(), Y(v, {
652
+ key: 0,
653
+ "data-testid": "entity-create-button",
654
+ onClick: Q
655
+ }, {
656
+ default: l(() => [
657
+ u(o(xe), { decorative: "" }),
658
+ L(" " + y(o(n)("consumers.list.toolbar_actions.new_consumer")), 1)
659
+ ]),
660
+ _: 1
661
+ })) : J("", !0),
662
+ u(v, {
663
+ appearance: "secondary",
664
+ "data-testid": "entity-learn-more-button",
665
+ onClick: d[2] || (d[2] = (ie) => s.$emit("click:learn-more"))
666
+ }, {
667
+ default: l(() => [
668
+ u(o(De), { decorative: "" }),
669
+ L(" " + y(o(n)("consumers.list.empty_state_v2.learn_more")), 1)
670
+ ]),
671
+ _: 1
672
+ })
658
673
  ]),
659
674
  _: 2
660
675
  }, [
661
676
  (f = e.config) != null && f.isControlPlaneGroup ? {
662
- name: "message",
677
+ name: "default",
663
678
  fn: l(() => [
664
- te(b(o(n)("consumers.list.empty_state_v2.group")), 1)
679
+ L(y(o(n)("consumers.list.empty_state_v2.group")), 1)
665
680
  ]),
666
681
  key: "0"
667
682
  } : void 0
668
- ]), 1032, ["action-button-text", "can-create", "data-testid", "description", "learn-more", "title"])
683
+ ]), 1032, ["data-testid", "message", "title"])
669
684
  ])
670
685
  ];
671
686
  }),
672
687
  key: "0"
673
688
  } : void 0
674
689
  ]), 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(lt), {
690
+ u(o(ut), {
676
691
  "action-button-disabled": ae.value,
677
692
  "data-testid": "delete-consumer-modal",
678
693
  description: o(n)("consumers.delete.description"),
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,
694
+ "entity-name": S.value && (S.value.username || S.value.custom_id || S.value.id),
695
+ "entity-type": o(ct).Consumer,
696
+ error: _e.value,
682
697
  title: o(n)("consumers.delete.title"),
683
- visible: ee.value,
684
- onCancel: Ue,
685
- onProceed: Ve
698
+ visible: oe.value,
699
+ onCancel: Be,
700
+ onProceed: Ke
686
701
  }, null, 8, ["action-button-disabled", "description", "entity-name", "entity-type", "error", "title", "visible"]),
687
- e.config.consumerGroupId ? (D(), ne(Et, {
702
+ e.config.consumerGroupId ? (D(), Y($t, {
688
703
  key: 0,
689
704
  config: e.config,
690
705
  "data-testid": "add-consumer-modal",
691
706
  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
- }, null, 8, ["config", "visible"])) : z("", !0),
696
- e.config.consumerGroupId && q.value ? (D(), ne(Ne, {
707
+ "onAdd:partialSuccess": d[4] || (d[4] = (f) => Ie(f, !0)),
708
+ "onAdd:success": d[5] || (d[5] = (f) => Ie(f)),
709
+ onCancel: ke
710
+ }, null, 8, ["config", "visible"])) : J("", !0),
711
+ e.config.consumerGroupId && O.value ? (D(), Y(He, {
697
712
  key: 1,
698
713
  "action-button-appearance": "danger",
699
714
  "data-testid": "remove-consumer-modal",
700
715
  title: o(n)("consumers.consumer_groups.remove.title"),
701
716
  visible: me.value,
702
- onCancel: Ie,
703
- onProceed: qe
717
+ onCancel: we,
718
+ onProceed: Le
704
719
  }, {
705
720
  default: l(() => [
706
- c(o($), {
721
+ u(o(w), {
707
722
  class: "message",
708
723
  keypath: e.config.consumerGroupName ? "consumers.consumer_groups.remove.confirmation" : "consumers.consumer_groups.remove.confirmationNoCG",
709
724
  tag: "p"
710
- }, fe({
725
+ }, ge({
711
726
  consumer: l(() => [
712
- _("strong", null, b(q.value.username || q.value.custom_id || q.value.id), 1)
727
+ k("strong", null, y(O.value.username || O.value.custom_id || O.value.id), 1)
713
728
  ]),
714
729
  _: 2
715
730
  }, [
716
731
  e.config.consumerGroupName ? {
717
732
  name: "consumerGroup",
718
733
  fn: l(() => [
719
- _("strong", null, b(e.config.consumerGroupName), 1)
734
+ k("strong", null, y(e.config.consumerGroupName), 1)
720
735
  ]),
721
736
  key: "0"
722
737
  } : void 0
723
738
  ]), 1032, ["keypath"]),
724
- _("p", null, b(o(n)("consumers.consumer_groups.remove.description")), 1)
739
+ k("p", null, y(o(n)("consumers.consumer_groups.remove.description")), 1)
725
740
  ]),
726
741
  _: 1
727
- }, 8, ["title", "visible"])) : z("", !0)
742
+ }, 8, ["title", "visible"])) : J("", !0)
728
743
  ]);
729
744
  };
730
745
  }
731
- }), Qt = /* @__PURE__ */ he(At, [["__scopeId", "data-v-c5be280d"]]), M = [];
746
+ }), Ht = /* @__PURE__ */ be(Mt, [["__scopeId", "data-v-4737bfb9"]]), G = [];
732
747
  for (let e = 0; e < 256; ++e)
733
- M.push((e + 256).toString(16).slice(1));
748
+ G.push((e + 256).toString(16).slice(1));
734
749
  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();
750
+ 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();
736
751
  }
737
- let ge;
738
- const Rt = new Uint8Array(16);
739
- function Tt() {
740
- if (!ge) {
752
+ let ve;
753
+ const xt = new Uint8Array(16);
754
+ function Rt() {
755
+ if (!ve) {
741
756
  if (typeof crypto > "u" || !crypto.getRandomValues)
742
757
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
743
- ge = crypto.getRandomValues.bind(crypto);
758
+ ve = crypto.getRandomValues.bind(crypto);
744
759
  }
745
- return ge(Rt);
760
+ return ve(xt);
746
761
  }
747
- const Ut = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), xe = { randomUUID: Ut };
762
+ const At = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ve = { randomUUID: At };
748
763
  function Vt(e, p, r) {
749
- var $;
750
- if (xe.randomUUID && !e)
751
- return xe.randomUUID();
764
+ var w;
765
+ if (Ve.randomUUID && !e)
766
+ return Ve.randomUUID();
752
767
  e = e || {};
753
- const t = e.random ?? (($ = e.rng) == null ? void 0 : $.call(e)) ?? Tt();
768
+ const t = e.random ?? ((w = e.rng) == null ? void 0 : w.call(e)) ?? Rt();
754
769
  if (t.length < 16)
755
770
  throw new Error("Random bytes length must be >= 16");
756
771
  return t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128, Dt(t);
757
772
  }
758
- const Ft = { class: "kong-ui-entities-consumer-form" }, Pt = ["id"], Bt = { class: "fields-group-text" }, Kt = ["aria-labelledby"], qt = /* @__PURE__ */ ue({
773
+ const Ft = { class: "kong-ui-entities-consumer-form" }, Pt = ["id"], Tt = { class: "fields-group-text" }, Ut = ["aria-labelledby"], Bt = /* @__PURE__ */ ue({
759
774
  __name: "ConsumerForm",
760
775
  props: {
761
776
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -773,8 +788,8 @@ const Ft = { class: "kong-ui-entities-consumer-form" }, Pt = ["id"], Bt = { clas
773
788
  },
774
789
  emits: ["update", "error", "loading"],
775
790
  setup(e, { emit: p }) {
776
- var X;
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({
791
+ var ee;
792
+ const r = e, t = p, { i18nT: w, i18n: { t: n } } = ce.useI18n(), $ = Fe(), { axiosInstance: M } = he((ee = r.config) == null ? void 0 : ee.axiosRequestConfig), { getMessageFromError: F } = dt(), q = Vt(), m = Me({
778
793
  fields: {
779
794
  username: "",
780
795
  customId: "",
@@ -782,89 +797,89 @@ const Ft = { class: "kong-ui-entities-consumer-form" }, Pt = ["id"], Bt = { clas
782
797
  },
783
798
  readonly: !1,
784
799
  errorMessage: ""
785
- }), Y = Se({
800
+ }), Z = Me({
786
801
  username: "",
787
802
  customId: "",
788
803
  tags: ""
789
- }), H = I(() => {
804
+ }), Q = I(() => {
790
805
  var a, i;
791
- return (i = W.form[(a = r.config) == null ? void 0 : a.app]) == null ? void 0 : i.edit;
792
- }), O = () => {
806
+ return (i = X.form[(a = r.config) == null ? void 0 : a.app]) == null ? void 0 : i.edit;
807
+ }), j = () => {
793
808
  var a;
794
- E.push(((a = r.config) == null ? void 0 : a.cancelRoute) || { name: "consumer-list" });
795
- }, V = (a) => {
809
+ $.push(((a = r.config) == null ? void 0 : a.cancelRoute) || { name: "consumer-list" });
810
+ }, P = (a) => {
796
811
  t("loading", a);
797
812
  }, re = (a) => {
798
813
  t("error", a);
799
- }, J = (a) => {
800
- var g, T, v;
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) || "";
802
- const i = ((v = a == null ? void 0 : a.item) == null ? void 0 : v.tags) || (a == null ? void 0 : a.tags) || [];
803
- m.fields.tags = (i == null ? void 0 : i.join(", ")) || "", Object.assign(Y, m.fields);
804
- }, Q = I(() => r.consumerId ? Ge.Edit : Ge.Create), K = (a) => {
805
- var g, T, v, u, C, y;
806
- let i = `${(g = r.config) == null ? void 0 : g.apiBaseUrl}${W.form[(T = r.config) == null ? void 0 : T.app][a]}`;
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;
808
- }, A = I(() => !!m.fields.username || !!m.fields.customId), P = I(() => JSON.stringify(m.fields) !== JSON.stringify(Y)), R = I(() => {
814
+ }, W = (a) => {
815
+ var g, V, h;
816
+ m.fields.username = ((g = a == null ? void 0 : a.item) == null ? void 0 : g.username) || (a == null ? void 0 : a.username) || "", m.fields.customId = ((V = a == null ? void 0 : a.item) == null ? void 0 : V.custom_id) || (a == null ? void 0 : a.custom_id) || "";
817
+ const i = ((h = a == null ? void 0 : a.item) == null ? void 0 : h.tags) || (a == null ? void 0 : a.tags) || [];
818
+ m.fields.tags = (i == null ? void 0 : i.join(", ")) || "", Object.assign(Z, m.fields);
819
+ }, z = I(() => r.consumerId ? Re.Edit : Re.Create), N = (a) => {
820
+ var g, V, h, c, _, b;
821
+ let i = `${(g = r.config) == null ? void 0 : g.apiBaseUrl}${X.form[(V = r.config) == null ? void 0 : V.app][a]}`;
822
+ return ((h = r.config) == null ? void 0 : h.app) === "konnect" ? i = i.replace(/{controlPlaneId}/gi, ((c = r.config) == null ? void 0 : c.controlPlaneId) || "") : ((_ = r.config) == null ? void 0 : _.app) === "kongManager" && (i = i.replace(/\/{workspace}/gi, (b = r.config) != null && b.workspace ? `/${r.config.workspace}` : "")), i = i.replace(/{id}/gi, r.consumerId), i;
823
+ }, x = I(() => !!m.fields.username || !!m.fields.customId), B = I(() => JSON.stringify(m.fields) !== JSON.stringify(Z)), A = I(() => {
809
824
  var a, i;
810
825
  return {
811
826
  username: m.fields.username || null,
812
827
  custom_id: m.fields.customId || null,
813
828
  tags: (i = (a = m.fields.tags.split(",")) == null ? void 0 : a.map((g) => String(g || "").trim())) == null ? void 0 : i.filter((g) => g !== "")
814
829
  };
815
- }), F = async () => {
830
+ }), T = async () => {
816
831
  var a;
817
832
  try {
818
833
  m.readonly = !0;
819
834
  let i;
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);
835
+ await M.post(N("validate"), A.value), z.value === "create" ? i = await M.post(N("create"), A.value) : z.value === "edit" && (i = ((a = r.config) == null ? void 0 : a.app) === "konnect" ? await M.put(N("edit"), A.value) : await M.patch(N("edit"), A.value)), W(i == null ? void 0 : i.data), t("update", i == null ? void 0 : i.data);
821
836
  } catch (i) {
822
- m.errorMessage = U(i), t("error", i);
837
+ m.errorMessage = F(i), t("error", i);
823
838
  } finally {
824
839
  m.readonly = !1;
825
840
  }
826
841
  };
827
842
  return (a, i) => {
828
- const g = N("KInput"), T = N("KCard");
829
- return D(), L("div", Ft, [
830
- c(o(dt), {
831
- "can-submit": A.value && P.value,
843
+ const g = K("KInput"), V = K("KCard");
844
+ return D(), H("div", Ft, [
845
+ u(o(mt), {
846
+ "can-submit": x.value && B.value,
832
847
  config: e.config,
833
848
  "edit-id": e.consumerId,
834
- "entity-type": o(De).Consumer,
849
+ "entity-type": o(Pe).Consumer,
835
850
  "error-message": m.errorMessage,
836
- "fetch-url": H.value,
837
- "form-fields": R.value,
851
+ "fetch-url": Q.value,
852
+ "form-fields": A.value,
838
853
  "is-readonly": m.readonly,
839
- onCancel: O,
840
- "onFetch:error": i[3] || (i[3] = (v) => re(v)),
841
- "onFetch:success": J,
842
- onLoading: i[4] || (i[4] = (v) => V(v)),
843
- onSubmit: F
854
+ onCancel: j,
855
+ "onFetch:error": i[3] || (i[3] = (h) => re(h)),
856
+ "onFetch:success": W,
857
+ onLoading: i[4] || (i[4] = (h) => P(h)),
858
+ onSubmit: T
844
859
  }, {
845
860
  default: l(() => [
846
- _("div", null, [
847
- c(o(mt), {
861
+ k("div", null, [
862
+ u(o(pt), {
848
863
  description: o(n)("consumers.form.info.description"),
849
864
  "has-divider": "",
850
865
  title: o(n)("consumers.form.info.title")
851
866
  }, {
852
867
  default: l(() => [
853
- _("div", null, [
854
- _("h3", {
855
- id: `fields-group-title-${o(B)}`,
868
+ k("div", null, [
869
+ k("h3", {
870
+ id: `fields-group-title-${o(q)}`,
856
871
  class: "fields-group-title"
857
- }, b(o(n)("consumers.form.consumer_identification.title")) + "* ", 9, Pt),
858
- _("p", Bt, b(o(n)("consumers.form.consumer_identification.description")), 1)
872
+ }, y(o(n)("consumers.form.consumer_identification.title")) + "* ", 9, Pt),
873
+ k("p", Tt, y(o(n)("consumers.form.consumer_identification.description")), 1)
859
874
  ]),
860
- c(T, null, {
875
+ u(V, null, {
861
876
  default: l(() => [
862
- _("fieldset", {
863
- "aria-labelledby": `fields-group-title-${o(B)}`
877
+ k("fieldset", {
878
+ "aria-labelledby": `fields-group-title-${o(q)}`
864
879
  }, [
865
- c(g, {
880
+ u(g, {
866
881
  modelValue: m.fields.username,
867
- "onUpdate:modelValue": i[0] || (i[0] = (v) => m.fields.username = v),
882
+ "onUpdate:modelValue": i[0] || (i[0] = (h) => m.fields.username = h),
868
883
  modelModifiers: { trim: !0 },
869
884
  autocomplete: "off",
870
885
  class: "username-field",
@@ -876,21 +891,21 @@ const Ft = { class: "kong-ui-entities-consumer-form" }, Pt = ["id"], Bt = { clas
876
891
  type: "text"
877
892
  }, {
878
893
  "label-tooltip": l(() => [
879
- c(o($), {
894
+ u(o(w), {
880
895
  keypath: "consumers.fields.username.tooltip",
881
896
  scope: "global"
882
897
  }, {
883
898
  custom_id: l(() => [
884
- _("code", null, b(o(n)("consumers.fields.username.custom_id")), 1)
899
+ k("code", null, y(o(n)("consumers.fields.username.custom_id")), 1)
885
900
  ]),
886
901
  _: 1
887
902
  })
888
903
  ]),
889
904
  _: 1
890
905
  }, 8, ["modelValue", "label", "placeholder", "readonly"]),
891
- c(g, {
906
+ u(g, {
892
907
  modelValue: m.fields.customId,
893
- "onUpdate:modelValue": i[1] || (i[1] = (v) => m.fields.customId = v),
908
+ "onUpdate:modelValue": i[1] || (i[1] = (h) => m.fields.customId = h),
894
909
  modelModifiers: { trim: !0 },
895
910
  autocomplete: "off",
896
911
  "data-testid": "consumer-form-custom-id",
@@ -901,25 +916,25 @@ const Ft = { class: "kong-ui-entities-consumer-form" }, Pt = ["id"], Bt = { clas
901
916
  type: "text"
902
917
  }, {
903
918
  "label-tooltip": l(() => [
904
- c(o($), {
919
+ u(o(w), {
905
920
  keypath: "consumers.fields.custom_id.tooltip",
906
921
  scope: "global"
907
922
  }, {
908
923
  username: l(() => [
909
- _("code", null, b(o(n)("consumers.fields.custom_id.username")), 1)
924
+ k("code", null, y(o(n)("consumers.fields.custom_id.username")), 1)
910
925
  ]),
911
926
  _: 1
912
927
  })
913
928
  ]),
914
929
  _: 1
915
930
  }, 8, ["modelValue", "label", "placeholder", "readonly"])
916
- ], 8, Kt)
931
+ ], 8, Ut)
917
932
  ]),
918
933
  _: 1
919
934
  }),
920
- c(g, {
935
+ u(g, {
921
936
  modelValue: m.fields.tags,
922
- "onUpdate:modelValue": i[2] || (i[2] = (v) => m.fields.tags = v),
937
+ "onUpdate:modelValue": i[2] || (i[2] = (h) => m.fields.tags = h),
923
938
  modelModifiers: { trim: !0 },
924
939
  autocomplete: "off",
925
940
  "data-testid": "consumer-form-tags",
@@ -943,7 +958,7 @@ const Ft = { class: "kong-ui-entities-consumer-form" }, Pt = ["id"], Bt = { clas
943
958
  ]);
944
959
  };
945
960
  }
946
- }), zt = /* @__PURE__ */ he(qt, [["__scopeId", "data-v-ab3e5b9b"]]), Nt = { class: "kong-ui-consumer-entity-config-card" }, Wt = /* @__PURE__ */ ue({
961
+ }), Jt = /* @__PURE__ */ be(Bt, [["__scopeId", "data-v-ab3e5b9b"]]), Kt = { class: "kong-ui-consumer-entity-config-card" }, Qt = /* @__PURE__ */ ue({
947
962
  __name: "ConsumerConfigCard",
948
963
  props: {
949
964
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -970,15 +985,15 @@ const Ft = { class: "kong-ui-entities-consumer-form" }, Pt = ["id"], Bt = { clas
970
985
  },
971
986
  emits: ["loading", "fetch:error", "fetch:success"],
972
987
  setup(e) {
973
- const p = e, { i18n: { t: r }, i18nT: t } = ce.useI18n(), $ = I(() => W.form[p.config.app].edit), n = k({
988
+ const p = e, { i18n: { t: r }, i18nT: t } = ce.useI18n(), w = I(() => X.form[p.config.app].edit), n = C({
974
989
  id: {},
975
990
  username: {
976
- section: Me.Basic,
991
+ section: Ae.Basic,
977
992
  tooltip: r("consumers.fields.username.tooltip"),
978
993
  order: 1
979
994
  },
980
995
  custom_id: {
981
- section: Me.Basic,
996
+ section: Ae.Basic,
982
997
  tooltip: r("consumers.fields.custom_id.tooltip"),
983
998
  label: r("consumers.fields.custom_id.label"),
984
999
  order: 2
@@ -995,36 +1010,36 @@ const Ft = { class: "kong-ui-entities-consumer-form" }, Pt = ["id"], Bt = { clas
995
1010
  hidden: !0
996
1011
  }
997
1012
  });
998
- return (E, x) => (D(), L("div", Nt, [
999
- c(o(pt), {
1013
+ return ($, M) => (D(), H("div", Kt, [
1014
+ u(o(ft), {
1000
1015
  config: e.config,
1001
1016
  "config-card-doc": e.configCardDoc,
1002
1017
  "config-schema": n.value,
1003
- "entity-type": o(De).Consumer,
1004
- "fetch-url": $.value,
1018
+ "entity-type": o(Pe).Consumer,
1019
+ "fetch-url": w.value,
1005
1020
  "hide-title": e.hideTitle,
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))
1021
+ "onFetch:error": M[0] || (M[0] = (F) => $.$emit("fetch:error", F)),
1022
+ "onFetch:success": M[1] || (M[1] = (F) => $.$emit("fetch:success", F)),
1023
+ onLoading: M[2] || (M[2] = (F) => $.$emit("loading", F))
1009
1024
  }, {
1010
1025
  "username-label-tooltip": l(() => [
1011
- c(o(t), {
1026
+ u(o(t), {
1012
1027
  keypath: "consumers.fields.username.tooltip",
1013
1028
  scope: "global"
1014
1029
  }, {
1015
1030
  custom_id: l(() => [
1016
- _("code", null, b(o(r)("consumers.fields.username.custom_id")), 1)
1031
+ k("code", null, y(o(r)("consumers.fields.username.custom_id")), 1)
1017
1032
  ]),
1018
1033
  _: 1
1019
1034
  })
1020
1035
  ]),
1021
1036
  "custom_id-label-tooltip": l(() => [
1022
- c(o(t), {
1037
+ u(o(t), {
1023
1038
  keypath: "consumers.fields.custom_id.tooltip",
1024
1039
  scope: "global"
1025
1040
  }, {
1026
1041
  username: l(() => [
1027
- _("code", null, b(o(r)("consumers.fields.custom_id.username")), 1)
1042
+ k("code", null, y(o(r)("consumers.fields.custom_id.username")), 1)
1028
1043
  ]),
1029
1044
  _: 1
1030
1045
  })
@@ -1035,7 +1050,7 @@ const Ft = { class: "kong-ui-entities-consumer-form" }, Pt = ["id"], Bt = { clas
1035
1050
  }
1036
1051
  });
1037
1052
  export {
1038
- Wt as ConsumerConfigCard,
1039
- zt as ConsumerForm,
1040
- Qt as ConsumerList
1053
+ Qt as ConsumerConfigCard,
1054
+ Jt as ConsumerForm,
1055
+ Ht as ConsumerList
1041
1056
  };