@kong-ui-public/entities-gateway-services 3.10.6-pr.2001.32eec306e.0 → 3.10.6-pr.2001.5ce0ac0bb.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { defineComponent as Ke, computed as h, ref as W, watch as $e, onBeforeMount as lt, resolveComponent as D, openBlock as C, createElementBlock as F, createVNode as u, unref as o, createSlots as Te, withCtx as v, createBlock as Fe, Teleport as je, createElementVNode as S, createCommentVNode as R, createTextVNode as z, toDisplayString as P, withModifiers as Le, reactive as Re, onMounted as Je, renderSlot as Qe, toValue as ze, Transition as We, Fragment as ot, renderList as it } from "vue";
1
+ import { defineComponent as Ke, computed as h, ref as W, watch as $e, onBeforeMount as lt, resolveComponent as D, openBlock as C, createElementBlock as F, createVNode as u, unref as o, createSlots as Re, withCtx as v, createBlock as Fe, Teleport as je, createElementVNode as S, createCommentVNode as M, createTextVNode as z, toDisplayString as P, withModifiers as Le, reactive as Te, onMounted as Ze, renderSlot as Qe, toValue as ze, Transition as We, Fragment as ot, renderList as it } from "vue";
2
2
  import { useRouter as qe } from "vue-router";
3
3
  import { BookIcon as He, AddIcon as rt, ServicesIcon as st } from "@kong/icons";
4
4
  import { createI18n as at, i18nTComponent as nt } from "@kong-ui-public/i18n";
@@ -231,11 +231,11 @@ function $t() {
231
231
  }
232
232
  function Ut() {
233
233
  return {
234
- getPortFromProtocol: (M, y) => {
234
+ getPortFromProtocol: (B, y) => {
235
235
  const p = [80, 443], a = Number(y);
236
236
  if ((a || a === 0) && !p.includes(a))
237
237
  return a;
238
- switch (M) {
238
+ switch (B) {
239
239
  case "grpcs":
240
240
  case "tls":
241
241
  case "https":
@@ -251,48 +251,52 @@ function Ut() {
251
251
  }
252
252
  };
253
253
  }
254
- function At() {
254
+ function xt() {
255
255
  const { i18n: { t: n } } = ge.useI18n();
256
256
  return {
257
- validateHost: (b) => !b || b.trim() === "" ? n("gateway_services.form.errors.host.empty") : /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$|^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(b) ? "" : n("gateway_services.form.errors.host.invalid"),
258
- validateProtocol: (b, B) => !b || b.trim() === "" ? n("gateway_services.form.errors.protocol.empty") : (b = b.slice(0, -1), B.find((r) => {
257
+ validateHost: (b) => {
258
+ if (!b || b.trim() === "") return n("gateway_services.form.errors.host.empty");
259
+ const T = /^(?!:\/\/)([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/;
260
+ return /^((25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])$/.test(b) || T.test(b) ? "" : n("gateway_services.form.errors.host.invalid");
261
+ },
262
+ validateProtocol: (b, T) => !b || b.trim() === "" ? n("gateway_services.form.errors.protocol.empty") : (b = b.slice(0, -1), T.find((r) => {
259
263
  if (r.value === b) return r;
260
264
  }) === void 0 ? n("gateway_services.form.errors.protocol.invalid") : ""),
261
265
  validatePath: (b) => !b || b === "" ? "" : b.startsWith("/") ? /[^A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=%]/.test(b) ? n("gateway_services.form.errors.path.invalid") : "" : n("gateway_services.form.errors.path.prefix"),
262
266
  validatePort: (b) => {
263
267
  if (b == null || b === "")
264
268
  return "";
265
- const B = typeof b == "string" ? parseInt(b, 10) : b;
266
- return isNaN(B) ? n("gateway_services.form.errors.port.type") : B < 0 || B > 65535 ? n("gateway_services.form.errors.port.invalid") : "";
269
+ const T = typeof b == "string" ? parseInt(b, 10) : b;
270
+ return isNaN(T) ? n("gateway_services.form.errors.port.type") : T < 0 || T > 65535 ? n("gateway_services.form.errors.port.invalid") : "";
267
271
  }
268
272
  };
269
273
  }
270
274
  const ge = {
271
275
  useI18n: $t,
272
276
  usePortFromProtocol: Ut,
273
- useUrlValidators: At
274
- }, Ae = "/v2/control-planes/{controlPlaneId}/core-entities", xe = "/{workspace}", ye = {
277
+ useUrlValidators: xt
278
+ }, xe = "/v2/control-planes/{controlPlaneId}/core-entities", Ae = "/{workspace}", ye = {
275
279
  list: {
276
280
  konnect: {
277
- all: `${Ae}/services`
281
+ all: `${xe}/services`
278
282
  },
279
283
  kongManager: {
280
- all: `${xe}/services`
284
+ all: `${Ae}/services`
281
285
  }
282
286
  },
283
287
  form: {
284
288
  konnect: {
285
- create: `${Ae}/services`,
286
- validate: `${Ae}/v1/schemas/json/service/validate`,
287
- edit: `${Ae}/services/{id}`
288
- },
289
- kongManager: {
290
289
  create: `${xe}/services`,
291
- validate: `${xe}/schemas/services/validate`,
290
+ validate: `${xe}/v1/schemas/json/service/validate`,
292
291
  edit: `${xe}/services/{id}`
292
+ },
293
+ kongManager: {
294
+ create: `${Ae}/services`,
295
+ validate: `${Ae}/schemas/services/validate`,
296
+ edit: `${Ae}/services/{id}`
293
297
  }
294
298
  }
295
- }, xt = "#00abd2", Tt = "24px", Rt = { class: "kong-ui-entities-gateway-services-list" }, Mt = { class: "button-row" }, Bt = { class: "empty-state-icon-gateway" }, Kt = { key: 1 }, Lt = /* @__PURE__ */ Ke({
299
+ }, At = "#00abd2", Rt = "24px", Tt = { class: "kong-ui-entities-gateway-services-list" }, Mt = { class: "button-row" }, Bt = { class: "empty-state-icon-gateway" }, Kt = { key: 1 }, Lt = /* @__PURE__ */ Ke({
296
300
  __name: "GatewayServiceList",
297
301
  props: {
298
302
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -350,9 +354,9 @@ const ge = {
350
354
  }
351
355
  },
352
356
  emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success", "toggle:success"],
353
- setup(n, { emit: M }) {
357
+ setup(n, { emit: B }) {
354
358
  var c;
355
- const y = M, p = n, { i18n: { t: a, formatUnixTimeStamp: b } } = ge.useI18n(), B = qe(), { axiosInstance: Z } = Oe((c = p.config) == null ? void 0 : c.axiosRequestConfig), { hasRecords: r, handleStateChange: L } = ct(() => ee.value), I = h(() => r.value && p.config.app === "konnect"), ie = h(() => !p.enableV2EmptyStates && p.config.app === "konnect"), de = h(() => p.config.app !== "kongManager" || !!p.config.disableSorting), X = {
359
+ const y = B, p = n, { i18n: { t: a, formatUnixTimeStamp: b } } = ge.useI18n(), T = qe(), { axiosInstance: H } = Oe((c = p.config) == null ? void 0 : c.axiosRequestConfig), { hasRecords: r, handleStateChange: L } = ct(() => ee.value), I = h(() => r.value && p.config.app === "konnect"), ie = h(() => !p.enableV2EmptyStates && p.config.app === "konnect"), de = h(() => p.config.app !== "kongManager" || !!p.config.disableSorting), X = {
356
360
  // the Name column is non-hidable
357
361
  name: { label: a("gateway_services.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
358
362
  ...p.config.showControlPlaneColumn ? { control_plane: { label: a("gateway_services.list.table_headers.control_plane") } } : {},
@@ -368,11 +372,11 @@ const ge = {
368
372
  columnVisibility: {
369
373
  created_at: !1
370
374
  }
371
- }, fe = X, A = h(() => {
375
+ }, fe = X, x = h(() => {
372
376
  var m, w;
373
377
  let g = `${p.config.apiBaseUrl}${ye.list[p.config.app].all}`;
374
378
  return p.config.app === "konnect" ? g = g.replace(/{controlPlaneId}/gi, ((m = p.config) == null ? void 0 : m.controlPlaneId) || "") : p.config.app === "kongManager" && (g = g.replace(/\/{workspace}/gi, (w = p.config) != null && w.workspace ? `/${p.config.workspace}` : "")), g;
375
- }), Y = h(() => p.config.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${A.value}`) : new URL(A.value)), ee = W(""), re = h(() => {
379
+ }), Y = h(() => p.config.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${x.value}`) : new URL(x.value)), ee = W(""), re = h(() => {
376
380
  const g = p.config.app === "konnect" || p.config.isExactMatch;
377
381
  if (g)
378
382
  return {
@@ -387,9 +391,9 @@ const ge = {
387
391
  };
388
392
  }), {
389
393
  fetcher: l,
390
- fetcherState: x,
394
+ fetcherState: A,
391
395
  fetcherCacheKey: se
392
- } = ut({ ...p.config, cacheIdentifier: p.cacheIdentifier }, A.value), Pe = () => {
396
+ } = ut({ ...p.config, cacheIdentifier: p.cacheIdentifier }, x.value), Pe = () => {
393
397
  ee.value = "";
394
398
  }, t = () => {
395
399
  se.value++;
@@ -419,13 +423,13 @@ const ge = {
419
423
  return;
420
424
  const m = `${Y.value.href}/${q.value.id}`, w = !q.value.enabled;
421
425
  try {
422
- const { data: j } = ((Q = p.config) == null ? void 0 : Q.app) === "konnect" ? await Z.put(m, { ...q.value, enabled: w }) : await Z.patch(m, { ...q.value, enabled: w });
426
+ const { data: j } = ((Q = p.config) == null ? void 0 : Q.app) === "konnect" ? await H.put(m, { ...q.value, enabled: w }) : await H.patch(m, { ...q.value, enabled: w });
423
427
  y("toggle:success", j), q.value.enabled = w;
424
428
  } catch (j) {
425
429
  y("error", j);
426
430
  }
427
431
  }, Ce = (g) => {
428
- p.config.getControlPlaneRoute && B.push(p.config.getControlPlaneRoute(g));
432
+ p.config.getControlPlaneRoute && T.push(p.config.getControlPlaneRoute(g));
429
433
  }, me = (g, m) => {
430
434
  const w = g.id;
431
435
  if (!m(w)) {
@@ -456,23 +460,23 @@ const ge = {
456
460
  });
457
461
  }, Se = async (g) => {
458
462
  var w;
459
- await ((w = p.canRetrieve) == null ? void 0 : w.call(p, g)) && B.push(p.config.getViewRoute(g.id));
463
+ await ((w = p.canRetrieve) == null ? void 0 : w.call(p, g)) && T.push(p.config.getViewRoute(g.id));
460
464
  }, ue = (g) => ({
461
465
  label: a("actions.view"),
462
466
  to: p.config.getViewRoute(g)
463
467
  }), le = (g) => ({
464
468
  label: a("actions.edit"),
465
469
  to: p.config.getEditRoute(g)
466
- }), N = W(void 0), J = W(!1), oe = W(!1), ve = W(""), i = dt(p.config, A.value), f = (g) => {
467
- N.value = g, J.value = !0, ve.value = "";
470
+ }), N = W(void 0), Z = W(!1), oe = W(!1), ve = W(""), i = dt(p.config, x.value), f = (g) => {
471
+ N.value = g, Z.value = !0, ve.value = "";
468
472
  }, k = () => {
469
- J.value = !1, N.value = void 0;
470
- }, H = async () => {
473
+ Z.value = !1, N.value = void 0;
474
+ }, J = async () => {
471
475
  var g, m, w;
472
476
  if ((g = N.value) != null && g.id) {
473
477
  oe.value = !0;
474
478
  try {
475
- await Z.delete(i(N.value.id)), y("delete:success", N.value), k(), se.value++;
479
+ await H.delete(i(N.value.id)), y("delete:success", N.value), k(), se.value++;
476
480
  } catch (O) {
477
481
  ve.value = ((w = (m = O.response) == null ? void 0 : m.data) == null ? void 0 : w.message) || O.message || a("errors.delete"), y("error", O);
478
482
  } finally {
@@ -480,9 +484,9 @@ const ge = {
480
484
  }
481
485
  }
482
486
  }, K = () => {
483
- B.push(p.config.createRoute);
487
+ T.push(p.config.createRoute);
484
488
  };
485
- $e(x, (g) => {
489
+ $e(A, (g) => {
486
490
  var m, w, O;
487
491
  if (g.status === ft.Error) {
488
492
  $.value = {
@@ -497,7 +501,7 @@ const ge = {
497
501
  U.value = await p.canCreate();
498
502
  }), (g, m) => {
499
503
  const w = D("KButton"), O = D("KBadge"), Q = D("KInputSwitch"), j = D("KDropdownItem"), he = D("KClipboardProvider");
500
- return C(), F("div", Rt, [
504
+ return C(), F("div", Tt, [
501
505
  u(o(pt), {
502
506
  "cache-identifier": n.cacheIdentifier,
503
507
  "default-table-preferences": ke,
@@ -515,7 +519,7 @@ const ge = {
515
519
  "onClick:row": m[5] || (m[5] = (e) => Se(e)),
516
520
  onSort: t,
517
521
  onState: o(L)
518
- }, Te({
522
+ }, Re({
519
523
  "toolbar-filter": v(() => [
520
524
  u(o(mt), {
521
525
  modelValue: ee.value,
@@ -541,7 +545,7 @@ const ge = {
541
545
  u(o(He), { decorative: "" })
542
546
  ]),
543
547
  _: 1
544
- })) : R("", !0),
548
+ })) : M("", !0),
545
549
  u(o(Ee), {
546
550
  "auth-function": () => n.canCreate()
547
551
  }, {
@@ -725,12 +729,12 @@ const ge = {
725
729
  title: o(a)("gateway_services.empty_state_v2.title"),
726
730
  "onClick:create": K,
727
731
  "onClick:learnMore": m[3] || (m[3] = (s) => g.$emit("click:learn-more"))
728
- }, Te({
732
+ }, Re({
729
733
  image: v(() => [
730
734
  S("div", Bt, [
731
735
  u(o(st), {
732
- color: o(xt),
733
- size: o(Tt)
736
+ color: o(At),
737
+ size: o(Rt)
734
738
  }, null, 8, ["color", "size"])
735
739
  ])
736
740
  ]),
@@ -766,16 +770,16 @@ const ge = {
766
770
  "entity-type": o(bt).GatewayService,
767
771
  error: ve.value,
768
772
  title: o(a)("actions.delete.title"),
769
- visible: J.value,
773
+ visible: Z.value,
770
774
  onCancel: k,
771
- onProceed: H
775
+ onProceed: J
772
776
  }, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
773
777
  ]);
774
778
  };
775
779
  }
776
- }), Ne = (n, M) => {
780
+ }), Ne = (n, B) => {
777
781
  const y = n.__vccOpts || n;
778
- for (const [p, a] of M)
782
+ for (const [p, a] of B)
779
783
  y[p] = a;
780
784
  return y;
781
785
  }, Ul = /* @__PURE__ */ Ne(Lt, [["__scopeId", "data-v-ee4f8a6d"]]), Wt = { class: "kong-ui-entities-gateway-service-form" }, Dt = { key: 0 }, qt = { class: "gateway-service-form-traffic-label" }, Ot = { class: "gateway-service-form-margin-bottom" }, Gt = {
@@ -784,7 +788,7 @@ const ge = {
784
788
  }, Nt = {
785
789
  key: 1,
786
790
  class: "gateway-service-form-group-fields"
787
- }, jt = { key: 0 }, zt = { class: "gateway-service-form-margin-top" }, Ht = { class: "gateway-service-form-margin-bottom" }, Zt = { class: "gateway-service-form-margin-bottom" }, Jt = { class: "gateway-service-form-margin-bottom" }, Qt = { class: "gateway-service-form-margin-bottom" }, Xt = {
791
+ }, jt = { key: 0 }, zt = { class: "gateway-service-form-margin-top" }, Ht = { class: "gateway-service-form-margin-bottom" }, Jt = { class: "gateway-service-form-margin-bottom" }, Zt = { class: "gateway-service-form-margin-bottom" }, Qt = { class: "gateway-service-form-margin-bottom" }, Xt = {
788
792
  key: 0,
789
793
  class: "gateway-service-form-margin-bottom"
790
794
  }, Yt = {
@@ -822,9 +826,9 @@ const ge = {
822
826
  }
823
827
  },
824
828
  emits: ["update", "error", "url-valid:success", "url-valid:error", "loading", "model-updated"],
825
- setup(n, { expose: M, emit: y }) {
829
+ setup(n, { expose: B, emit: y }) {
826
830
  var ve;
827
- const p = y, a = n, b = W(!0), B = qe(), { i18nT: Z, i18n: { t: r } } = ge.useI18n(), { getMessageFromError: L } = Xe(), { axiosInstance: I } = Oe((ve = a.config) == null ? void 0 : ve.axiosRequestConfig), ie = Ye(), de = h(() => ye.form[a.config.app].edit), X = h(() => a.gatewayServiceId ? Me.Edit : Me.Create), ke = W(!1), fe = h(() => !!a.gatewayServiceId), A = W(fe.value ? "protocol" : "url"), Y = ge.usePortFromProtocol(), ee = W(""), re = h(() => !!ee.value), l = Re({
831
+ const p = y, a = n, b = W(!0), T = qe(), { i18nT: H, i18n: { t: r } } = ge.useI18n(), { getMessageFromError: L } = Xe(), { axiosInstance: I } = Oe((ve = a.config) == null ? void 0 : ve.axiosRequestConfig), ie = Ye(), de = h(() => ye.form[a.config.app].edit), X = h(() => a.gatewayServiceId ? Me.Edit : Me.Create), ke = W(!1), fe = h(() => !!a.gatewayServiceId), x = W(fe.value ? "protocol" : "url"), Y = ge.usePortFromProtocol(), ee = W(""), re = h(() => !!ee.value), l = Te({
828
832
  fields: {
829
833
  name: "",
830
834
  protocol: "http",
@@ -844,7 +848,7 @@ const ge = {
844
848
  },
845
849
  isReadonly: !1,
846
850
  errorMessage: ""
847
- }), x = Re({
851
+ }), A = Te({
848
852
  name: "",
849
853
  protocol: "http",
850
854
  host: "",
@@ -922,9 +926,9 @@ const ge = {
922
926
  ], t = { url: "url", protocol: "protocol" }, $ = (i, f) => {
923
927
  f.value;
924
928
  }, ae = (i) => i ? parseFloat(i) : 0, ne = () => {
925
- b.value = !0, l.errorMessage = "", l.fields.host = x.host, l.fields.path = x.path, l.fields.port = x.port, l.fields.protocol = x.protocol, l.fields.url = x.url, l.fields.retries = x.retries, l.fields.connect_timeout = x.connect_timeout, l.fields.write_timeout = x.write_timeout, l.fields.read_timeout = x.read_timeout, l.fields.client_certificate = x.client_certificate, l.fields.ca_certificates = x.ca_certificates, l.fields.tls_verify_enabled = x.tls_verify_enabled, l.fields.tls_verify_value = x.tls_verify_value;
929
+ b.value = !0, l.errorMessage = "", l.fields.host = A.host, l.fields.path = A.path, l.fields.port = A.port, l.fields.protocol = A.protocol, l.fields.url = A.url, l.fields.retries = A.retries, l.fields.connect_timeout = A.connect_timeout, l.fields.write_timeout = A.write_timeout, l.fields.read_timeout = A.read_timeout, l.fields.client_certificate = A.client_certificate, l.fields.ca_certificates = A.ca_certificates, l.fields.tls_verify_enabled = A.tls_verify_enabled, l.fields.tls_verify_value = A.tls_verify_value;
926
930
  }, q = () => {
927
- if (l.fields.url && A.value === "url")
931
+ if (l.fields.url && x.value === "url")
928
932
  try {
929
933
  const i = new URL(l.fields.url);
930
934
  l.errorMessage = "", l.fields.protocol = i.protocol.slice(0, -1), l.fields.host = i.hostname, l.fields.path = i.pathname;
@@ -936,27 +940,27 @@ const ge = {
936
940
  else
937
941
  p("url-valid:success"), l.errorMessage = "";
938
942
  }, pe = h(() => !["tcp", "tls", "tls_passthrough", "grpc", "grpcs", "udp"].includes(l.fields.protocol)), ce = h(() => {
939
- if (A.value === "url")
943
+ if (x.value === "url")
940
944
  return !0;
941
945
  const i = ["https", "wss", "tls"].includes(l.fields.protocol);
942
- return A.value === "protocol" && i;
946
+ return x.value === "protocol" && i;
943
947
  }), _e = h(() => {
944
- if (A.value === "url")
948
+ if (x.value === "url")
945
949
  return !0;
946
950
  const i = ["https", "tls"].includes(l.fields.protocol);
947
- return A.value === "protocol" && i;
951
+ return x.value === "protocol" && i;
948
952
  }), Ve = h(() => {
949
- if (A.value === "url")
953
+ if (x.value === "url")
950
954
  return !0;
951
955
  const i = ["https", "wss", "tls"].includes(l.fields.protocol);
952
- return A.value === "protocol" && i;
956
+ return x.value === "protocol" && i;
953
957
  }), Ce = (i) => {
954
958
  ee.value = ie.utf8Name(i);
955
- }, me = h(() => fe.value && JSON.stringify(l.fields) !== JSON.stringify(x) || A.value === "url" && !!l.fields.url || A.value === "protocol" && !!l.fields.host), be = (i) => {
956
- var f, k, H;
957
- l.fields.name = (i == null ? void 0 : i.name) || "", l.fields.tags = ((f = i == null ? void 0 : i.tags) == null ? void 0 : f.join(", ")) || "", l.fields.protocol = (i == null ? void 0 : i.protocol) || "http", l.fields.path = (i == null ? void 0 : i.path) || "", l.fields.read_timeout = i != null && i.read_timeout || (i == null ? void 0 : i.read_timeout) === 0 ? i == null ? void 0 : i.read_timeout : 6e4, l.fields.retries = i != null && i.retries || (i == null ? void 0 : i.retries) === 0 ? i == null ? void 0 : i.retries : 5, l.fields.host = (i == null ? void 0 : i.host) || "", l.fields.connect_timeout = i != null && i.connect_timeout || (i == null ? void 0 : i.connect_timeout) === 0 ? i == null ? void 0 : i.connect_timeout : 6e4, l.fields.tls_verify_enabled = (i == null ? void 0 : i.tls_verify) !== "" && (i == null ? void 0 : i.tls_verify) !== null && (i == null ? void 0 : i.tls_verify) !== void 0, l.fields.tls_verify_value = i != null && i.tls_verify ? i == null ? void 0 : i.tls_verify : !1, l.fields.ca_certificates = ((k = i == null ? void 0 : i.ca_certificates) == null ? void 0 : k.join(",")) || "", l.fields.client_certificate = ((H = i == null ? void 0 : i.client_certificate) == null ? void 0 : H.id) || "", l.fields.write_timeout = i != null && i.write_timeout || (i == null ? void 0 : i.write_timeout) === 0 ? i == null ? void 0 : i.write_timeout : 6e4, l.fields.port = i != null && i.port || (i == null ? void 0 : i.port) === 0 ? i == null ? void 0 : i.port : 80, Object.assign(x, l.fields);
959
+ }, me = h(() => fe.value && JSON.stringify(l.fields) !== JSON.stringify(A) || x.value === "url" && !!l.fields.url || x.value === "protocol" && !!l.fields.host), be = (i) => {
960
+ var f, k, J;
961
+ l.fields.name = (i == null ? void 0 : i.name) || "", l.fields.tags = ((f = i == null ? void 0 : i.tags) == null ? void 0 : f.join(", ")) || "", l.fields.protocol = (i == null ? void 0 : i.protocol) || "http", l.fields.path = (i == null ? void 0 : i.path) || "", l.fields.read_timeout = i != null && i.read_timeout || (i == null ? void 0 : i.read_timeout) === 0 ? i == null ? void 0 : i.read_timeout : 6e4, l.fields.retries = i != null && i.retries || (i == null ? void 0 : i.retries) === 0 ? i == null ? void 0 : i.retries : 5, l.fields.host = (i == null ? void 0 : i.host) || "", l.fields.connect_timeout = i != null && i.connect_timeout || (i == null ? void 0 : i.connect_timeout) === 0 ? i == null ? void 0 : i.connect_timeout : 6e4, l.fields.tls_verify_enabled = (i == null ? void 0 : i.tls_verify) !== "" && (i == null ? void 0 : i.tls_verify) !== null && (i == null ? void 0 : i.tls_verify) !== void 0, l.fields.tls_verify_value = i != null && i.tls_verify ? i == null ? void 0 : i.tls_verify : !1, l.fields.ca_certificates = ((k = i == null ? void 0 : i.ca_certificates) == null ? void 0 : k.join(",")) || "", l.fields.client_certificate = ((J = i == null ? void 0 : i.client_certificate) == null ? void 0 : J.id) || "", l.fields.write_timeout = i != null && i.write_timeout || (i == null ? void 0 : i.write_timeout) === 0 ? i == null ? void 0 : i.write_timeout : 6e4, l.fields.port = i != null && i.port || (i == null ? void 0 : i.port) === 0 ? i == null ? void 0 : i.port : 80, Object.assign(A, l.fields);
958
962
  }, Se = () => {
959
- B.push(a.config.cancelRoute);
963
+ T.push(a.config.cancelRoute);
960
964
  }, ue = h(() => {
961
965
  var f, k;
962
966
  let i = `${a.config.apiBaseUrl}${ye.form[a.config.app].validate}`;
@@ -968,11 +972,11 @@ const ge = {
968
972
  }), N = (i) => {
969
973
  let f = "";
970
974
  i.url && (f = new URL(i.url).protocol), (["https", "wss", "tls"].includes(i.protocol) || ["https", "wss", "tls"].includes(f)) && (i.tls_verify = i.tls_verify_enabled ? i.tls_verify_value : null), delete i.tls_verify_enabled, delete i.tls_verify_value;
971
- }, J = h(() => {
972
- var f, k, H, K;
975
+ }, Z = h(() => {
976
+ var f, k, J, K;
973
977
  const i = {
974
978
  name: l.fields.name || null,
975
- tags: l.fields.tags ? (H = (k = (f = l.fields.tags) == null ? void 0 : f.split(",")) == null ? void 0 : k.map((U) => String(U || "").trim())) == null ? void 0 : H.filter((U) => U !== "") : null,
979
+ tags: l.fields.tags ? (J = (k = (f = l.fields.tags) == null ? void 0 : f.split(",")) == null ? void 0 : k.map((U) => String(U || "").trim())) == null ? void 0 : J.filter((U) => U !== "") : null,
976
980
  protocol: l.fields.protocol,
977
981
  path: l.fields.path || null,
978
982
  read_timeout: l.fields.read_timeout,
@@ -987,17 +991,17 @@ const ge = {
987
991
  port: l.fields.port,
988
992
  url: l.fields.url
989
993
  };
990
- return l.fields.client_certificate && ["https", "wss", "tls"].includes(l.fields.protocol) && (i.client_certificate = { id: l.fields.client_certificate }), l.fields.tls_verify_enabled && ["https", "wss", "tls"].includes(l.fields.protocol) && (i.tls_verify = l.fields.tls_verify_value), pe.value || (i.path = null), X.value === "create" ? A.value === "url" ? (delete i.protocol, delete i.host, delete i.path, a.config.app === "konnect" && delete i.port) : delete i.url : X.value === "edit" && delete i.url, i;
994
+ return l.fields.client_certificate && ["https", "wss", "tls"].includes(l.fields.protocol) && (i.client_certificate = { id: l.fields.client_certificate }), l.fields.tls_verify_enabled && ["https", "wss", "tls"].includes(l.fields.protocol) && (i.tls_verify = l.fields.tls_verify_value), pe.value || (i.path = null), X.value === "create" ? x.value === "url" ? (delete i.protocol, delete i.host, delete i.path, a.config.app === "konnect" && delete i.port) : delete i.url : X.value === "edit" && delete i.url, i;
991
995
  }), oe = async () => {
992
- var i, f, k, H;
996
+ var i, f, k, J;
993
997
  try {
994
998
  l.isReadonly = !0, q();
995
- const K = J.value;
999
+ const K = Z.value;
996
1000
  N(K);
997
1001
  let U;
998
1002
  if (await I.post(ue.value, K), X.value === "create" ? U = await I.post(le.value, K) : X.value === "edit" && (U = ((i = a.config) == null ? void 0 : i.app) === "konnect" ? await I.put(le.value, K) : await I.patch(le.value, K)), U) {
999
1003
  const { data: c } = U;
1000
- l.fields.name = (c == null ? void 0 : c.name) || "", l.fields.port = c.port || Y.getPortFromProtocol(c.protocol), l.fields.protocol = (c == null ? void 0 : c.protocol) || "http", l.fields.host = (c == null ? void 0 : c.host) || "", l.fields.path = (c == null ? void 0 : c.path) || "", l.fields.url = (c == null ? void 0 : c.url) || "", l.fields.retries = c != null && c.retries || (c == null ? void 0 : c.retries) === 0 ? c == null ? void 0 : c.retries : 5, l.fields.connect_timeout = c != null && c.connect_timeout || (c == null ? void 0 : c.connect_timeout) === 0 ? c == null ? void 0 : c.connect_timeout : 6e4, l.fields.write_timeout = c != null && c.write_timeout || (c == null ? void 0 : c.write_timeout) === 0 ? c == null ? void 0 : c.write_timeout : 6e4, l.fields.read_timeout = c != null && c.read_timeout || (c == null ? void 0 : c.read_timeout) === 0 ? c == null ? void 0 : c.read_timeout : 6e4, l.fields.client_certificate = ((f = c == null ? void 0 : c.client_certificate) == null ? void 0 : f.id) || "", l.fields.ca_certificates = (k = c == null ? void 0 : c.ca_certificates) != null && k.length ? c == null ? void 0 : c.ca_certificates.join(",") : "", l.fields.tls_verify_enabled = (c == null ? void 0 : c.tls_verify) !== "" && (c == null ? void 0 : c.tls_verify) !== null && (c == null ? void 0 : c.tls_verify) !== void 0, l.fields.tls_verify_value = l.fields.tls_verify_enabled && (c == null ? void 0 : c.tls_verify), l.fields.tags = (H = c == null ? void 0 : c.tags) != null && H.length ? c.tags.join(", ") : "", Object.assign(x, l.fields), p("update", U == null ? void 0 : U.data);
1004
+ l.fields.name = (c == null ? void 0 : c.name) || "", l.fields.port = c.port || Y.getPortFromProtocol(c.protocol), l.fields.protocol = (c == null ? void 0 : c.protocol) || "http", l.fields.host = (c == null ? void 0 : c.host) || "", l.fields.path = (c == null ? void 0 : c.path) || "", l.fields.url = (c == null ? void 0 : c.url) || "", l.fields.retries = c != null && c.retries || (c == null ? void 0 : c.retries) === 0 ? c == null ? void 0 : c.retries : 5, l.fields.connect_timeout = c != null && c.connect_timeout || (c == null ? void 0 : c.connect_timeout) === 0 ? c == null ? void 0 : c.connect_timeout : 6e4, l.fields.write_timeout = c != null && c.write_timeout || (c == null ? void 0 : c.write_timeout) === 0 ? c == null ? void 0 : c.write_timeout : 6e4, l.fields.read_timeout = c != null && c.read_timeout || (c == null ? void 0 : c.read_timeout) === 0 ? c == null ? void 0 : c.read_timeout : 6e4, l.fields.client_certificate = ((f = c == null ? void 0 : c.client_certificate) == null ? void 0 : f.id) || "", l.fields.ca_certificates = (k = c == null ? void 0 : c.ca_certificates) != null && k.length ? c == null ? void 0 : c.ca_certificates.join(",") : "", l.fields.tls_verify_enabled = (c == null ? void 0 : c.tls_verify) !== "" && (c == null ? void 0 : c.tls_verify) !== null && (c == null ? void 0 : c.tls_verify) !== void 0, l.fields.tls_verify_value = l.fields.tls_verify_enabled && (c == null ? void 0 : c.tls_verify), l.fields.tags = (J = c == null ? void 0 : c.tags) != null && J.length ? c.tags.join(", ") : "", Object.assign(A, l.fields), p("update", U == null ? void 0 : U.data);
1001
1005
  }
1002
1006
  return U;
1003
1007
  } catch (K) {
@@ -1007,19 +1011,19 @@ const ge = {
1007
1011
  }
1008
1012
  };
1009
1013
  return $e(() => a.gatewayServiceId, () => {
1010
- Object.assign(l.fields, x);
1014
+ Object.assign(l.fields, A);
1011
1015
  }), $e(l.fields, (i) => {
1012
- l.fields.port = Y.getPortFromProtocol(i.protocol, String(i.port)), p("model-updated", J.value);
1013
- }), Je(() => {
1014
- p("model-updated", J.value);
1015
- }), M({
1016
+ l.fields.port = Y.getPortFromProtocol(i.protocol, String(i.port)), p("model-updated", Z.value);
1017
+ }), Ze(() => {
1018
+ p("model-updated", Z.value);
1019
+ }), B({
1016
1020
  validateUrl: q,
1017
- getPayload: J,
1021
+ getPayload: Z,
1018
1022
  saveFormData: oe,
1019
1023
  canSubmit: me,
1020
1024
  initForm: be
1021
1025
  }), (i, f) => {
1022
- const k = D("KInput"), H = D("KLabel"), K = D("KRadio"), U = D("KSelect"), c = D("KCheckbox"), g = D("KCollapse");
1026
+ const k = D("KInput"), J = D("KLabel"), K = D("KRadio"), U = D("KSelect"), c = D("KCheckbox"), g = D("KCollapse");
1023
1027
  return C(), F("div", Wt, [
1024
1028
  u(o(tt), {
1025
1029
  "can-submit": me.value,
@@ -1028,7 +1032,7 @@ const ge = {
1028
1032
  "entity-type": o(Ge).GatewayService,
1029
1033
  "error-message": l.errorMessage,
1030
1034
  "fetch-url": de.value,
1031
- "form-fields": J.value,
1035
+ "form-fields": Z.value,
1032
1036
  "is-readonly": l.isReadonly,
1033
1037
  onCancel: Se,
1034
1038
  "onFetch:error": f[25] || (f[25] = (m) => i.$emit("error", m)),
@@ -1095,9 +1099,9 @@ const ge = {
1095
1099
  title: o(r)("gateway_services.form.sections.keys.title")
1096
1100
  }, {
1097
1101
  default: v(() => [
1098
- fe.value ? R("", !0) : (C(), F("div", Dt, [
1102
+ fe.value ? M("", !0) : (C(), F("div", Dt, [
1099
1103
  S("div", qt, [
1100
- u(H, { required: "" }, {
1104
+ u(J, { required: "" }, {
1101
1105
  default: v(() => [
1102
1106
  z(P(o(r)("gateway_services.form.sections.keys.checkedGroupLabel")), 1)
1103
1107
  ]),
@@ -1106,8 +1110,8 @@ const ge = {
1106
1110
  ]),
1107
1111
  S("div", Ot, [
1108
1112
  u(K, {
1109
- modelValue: A.value,
1110
- "onUpdate:modelValue": f[2] || (f[2] = (m) => A.value = m),
1113
+ modelValue: x.value,
1114
+ "onUpdate:modelValue": f[2] || (f[2] = (m) => x.value = m),
1111
1115
  "data-testid": "gateway-service-url-radio",
1112
1116
  "selected-value": t.url,
1113
1117
  onChange: ne
@@ -1118,7 +1122,7 @@ const ge = {
1118
1122
  _: 1
1119
1123
  }, 8, ["modelValue", "selected-value"])
1120
1124
  ]),
1121
- A.value === "url" ? (C(), F("div", Gt, [
1125
+ x.value === "url" ? (C(), F("div", Gt, [
1122
1126
  u(k, {
1123
1127
  modelValue: l.fields.url,
1124
1128
  "onUpdate:modelValue": f[3] || (f[3] = (m) => l.fields.url = m),
@@ -1134,10 +1138,10 @@ const ge = {
1134
1138
  placeholder: o(r)("gateway_services.form.fields.upstream_url.placeholder"),
1135
1139
  required: ""
1136
1140
  }, null, 8, ["modelValue", "label", "label-attributes", "placeholder"])
1137
- ])) : R("", !0),
1141
+ ])) : M("", !0),
1138
1142
  u(K, {
1139
- modelValue: A.value,
1140
- "onUpdate:modelValue": f[4] || (f[4] = (m) => A.value = m),
1143
+ modelValue: x.value,
1144
+ "onUpdate:modelValue": f[4] || (f[4] = (m) => x.value = m),
1141
1145
  "checked-group": "protocol",
1142
1146
  "data-testid": "gateway-service-protocol-radio",
1143
1147
  "selected-value": t.protocol,
@@ -1149,7 +1153,7 @@ const ge = {
1149
1153
  _: 1
1150
1154
  }, 8, ["modelValue", "selected-value"])
1151
1155
  ])),
1152
- A.value === "protocol" || fe.value ? (C(), F("div", Nt, [
1156
+ x.value === "protocol" || fe.value ? (C(), F("div", Nt, [
1153
1157
  u(U, {
1154
1158
  modelValue: l.fields.protocol,
1155
1159
  "onUpdate:modelValue": f[5] || (f[5] = (m) => l.fields.protocol = m),
@@ -1195,7 +1199,7 @@ const ge = {
1195
1199
  name: "path",
1196
1200
  placeholder: o(r)("gateway_services.form.fields.path.placeholder")
1197
1201
  }, null, 8, ["modelValue", "label", "label-attributes", "placeholder"])
1198
- ])) : R("", !0),
1202
+ ])) : M("", !0),
1199
1203
  u(k, {
1200
1204
  modelValue: l.fields.port,
1201
1205
  "onUpdate:modelValue": [
@@ -1214,7 +1218,7 @@ const ge = {
1214
1218
  name: "port",
1215
1219
  type: "number"
1216
1220
  }, null, 8, ["modelValue", "label", "label-attributes"])
1217
- ])) : R("", !0),
1221
+ ])) : M("", !0),
1218
1222
  u(g, {
1219
1223
  modelValue: b.value,
1220
1224
  "onUpdate:modelValue": f[24] || (f[24] = (m) => b.value = m),
@@ -1245,7 +1249,7 @@ const ge = {
1245
1249
  type: "number"
1246
1250
  }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
1247
1251
  ]),
1248
- S("div", Zt, [
1252
+ S("div", Jt, [
1249
1253
  u(k, {
1250
1254
  modelValue: l.fields.connect_timeout,
1251
1255
  "onUpdate:modelValue": [
@@ -1266,7 +1270,7 @@ const ge = {
1266
1270
  type: "number"
1267
1271
  }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
1268
1272
  ]),
1269
- S("div", Jt, [
1273
+ S("div", Zt, [
1270
1274
  u(k, {
1271
1275
  modelValue: l.fields.write_timeout,
1272
1276
  "onUpdate:modelValue": [
@@ -1325,7 +1329,7 @@ const ge = {
1325
1329
  readonly: l.isReadonly,
1326
1330
  type: "text"
1327
1331
  }, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"])
1328
- ])) : R("", !0),
1332
+ ])) : M("", !0),
1329
1333
  _e.value ? (C(), F("div", Yt, [
1330
1334
  u(k, {
1331
1335
  modelValue: l.fields.ca_certificates,
@@ -1340,7 +1344,7 @@ const ge = {
1340
1344
  type: "text"
1341
1345
  }, {
1342
1346
  "label-tooltip": v(() => [
1343
- u(o(Z), {
1347
+ u(o(H), {
1344
1348
  keypath: "gateway_services.form.fields.ca_certificates.tooltip",
1345
1349
  scope: "global"
1346
1350
  }, {
@@ -1355,7 +1359,7 @@ const ge = {
1355
1359
  ]),
1356
1360
  _: 1
1357
1361
  }, 8, ["modelValue", "label", "placeholder", "readonly"])
1358
- ])) : R("", !0),
1362
+ ])) : M("", !0),
1359
1363
  Ve.value ? (C(), F("div", el, [
1360
1364
  u(c, {
1361
1365
  modelValue: l.fields.tls_verify_enabled,
@@ -1366,7 +1370,7 @@ const ge = {
1366
1370
  "label-attributes": { tooltipAttributes: { maxWidth: "400" } }
1367
1371
  }, {
1368
1372
  tooltip: v(() => [
1369
- u(o(Z), {
1373
+ u(o(H), {
1370
1374
  keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
1371
1375
  scope: "global"
1372
1376
  }, {
@@ -1386,7 +1390,7 @@ const ge = {
1386
1390
  label: o(r)("gateway_services.form.fields.tls_verify_option.true.label"),
1387
1391
  "selected-value": !0
1388
1392
  }, null, 8, ["modelValue", "label"])
1389
- ])) : R("", !0),
1393
+ ])) : M("", !0),
1390
1394
  l.fields.tls_verify_enabled ? (C(), F("div", ll, [
1391
1395
  u(K, {
1392
1396
  modelValue: l.fields.tls_verify_value,
@@ -1395,8 +1399,8 @@ const ge = {
1395
1399
  label: o(r)("gateway_services.form.fields.tls_verify_option.false.label"),
1396
1400
  "selected-value": !1
1397
1401
  }, null, 8, ["modelValue", "label"])
1398
- ])) : R("", !0)
1399
- ])) : R("", !0)
1402
+ ])) : M("", !0)
1403
+ ])) : M("", !0)
1400
1404
  ])
1401
1405
  ]),
1402
1406
  _: 1
@@ -1410,7 +1414,7 @@ const ge = {
1410
1414
  ]);
1411
1415
  };
1412
1416
  }
1413
- }), Al = /* @__PURE__ */ Ne(ol, [["__scopeId", "data-v-c2c5e1f0"]]), il = { class: "kong-ui-gateway-service-entity-config-card" }, xl = /* @__PURE__ */ Ke({
1417
+ }), xl = /* @__PURE__ */ Ne(ol, [["__scopeId", "data-v-c2c5e1f0"]]), il = { class: "kong-ui-gateway-service-entity-config-card" }, Al = /* @__PURE__ */ Ke({
1414
1418
  __name: "GatewayServiceConfigCard",
1415
1419
  props: {
1416
1420
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -1437,7 +1441,7 @@ const ge = {
1437
1441
  },
1438
1442
  emits: ["loading", "fetch:error", "fetch:success"],
1439
1443
  setup(n) {
1440
- const M = n, { i18n: { t: y }, i18nT: p } = ge.useI18n(), a = h(() => ye.form[M.config.app].edit), { getPropValue: b } = ht(), B = (r, L) => b(r, L) === !0 ? y("gateway_services.form.fields.tls_verify_option.true.display") : y("gateway_services.form.fields.tls_verify_option.false.display"), Z = W({
1444
+ const B = n, { i18n: { t: y }, i18nT: p } = ge.useI18n(), a = h(() => ye.form[B.config.app].edit), { getPropValue: b } = ht(), T = (r, L) => b(r, L) === !0 ? y("gateway_services.form.fields.tls_verify_option.true.display") : y("gateway_services.form.fields.tls_verify_option.false.display"), H = W({
1441
1445
  id: {},
1442
1446
  name: {
1443
1447
  tooltip: y("gateway_services.form.fields.name.tooltip")
@@ -1501,7 +1505,7 @@ const ge = {
1501
1505
  u(o(kt), {
1502
1506
  config: n.config,
1503
1507
  "config-card-doc": n.configCardDoc,
1504
- "config-schema": Z.value,
1508
+ "config-schema": H.value,
1505
1509
  "entity-type": o(Ge).GatewayService,
1506
1510
  "fetch-url": a.value,
1507
1511
  "hide-title": n.hideTitle,
@@ -1549,7 +1553,7 @@ const ge = {
1549
1553
  })
1550
1554
  ]),
1551
1555
  tls_verify: v((I) => [
1552
- z(P(typeof o(b)("rowValue", I) == "boolean" ? B("rowValue", I) : o(y)("gateway_services.form.fields.tls_verify_option.unset.display")), 1)
1556
+ z(P(typeof o(b)("rowValue", I) == "boolean" ? T("rowValue", I) : o(y)("gateway_services.form.fields.tls_verify_option.unset.display")), 1)
1553
1557
  ]),
1554
1558
  client_certificate: v((I) => [
1555
1559
  z(P(o(b)("rowValue", I) ? o(b)("rowValue", I).id : "–"), 1)
@@ -1560,36 +1564,36 @@ const ge = {
1560
1564
  }
1561
1565
  });
1562
1566
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
1563
- const Ze = () => {
1567
+ const Je = () => {
1564
1568
  };
1565
- function rl(n, M) {
1569
+ function rl(n, B) {
1566
1570
  function y(...p) {
1567
1571
  return new Promise((a, b) => {
1568
- Promise.resolve(n(() => M.apply(this, p), { fn: M, thisArg: this, args: p })).then(a).catch(b);
1572
+ Promise.resolve(n(() => B.apply(this, p), { fn: B, thisArg: this, args: p })).then(a).catch(b);
1569
1573
  });
1570
1574
  }
1571
1575
  return y;
1572
1576
  }
1573
- function sl(n, M = {}) {
1574
- let y, p, a = Ze;
1577
+ function sl(n, B = {}) {
1578
+ let y, p, a = Je;
1575
1579
  const b = (r) => {
1576
- clearTimeout(r), a(), a = Ze;
1580
+ clearTimeout(r), a(), a = Je;
1577
1581
  };
1578
- let B;
1582
+ let T;
1579
1583
  return (r) => {
1580
- const L = ze(n), I = ze(M.maxWait);
1584
+ const L = ze(n), I = ze(B.maxWait);
1581
1585
  return y && b(y), L <= 0 || I !== void 0 && I <= 0 ? (p && (b(p), p = null), Promise.resolve(r())) : new Promise((ie, de) => {
1582
- a = M.rejectOnCancel ? de : ie, B = r, I && !p && (p = setTimeout(() => {
1583
- y && b(y), p = null, ie(B());
1586
+ a = B.rejectOnCancel ? de : ie, T = r, I && !p && (p = setTimeout(() => {
1587
+ y && b(y), p = null, ie(T());
1584
1588
  }, I)), y = setTimeout(() => {
1585
1589
  p && b(p), p = null, ie(r());
1586
1590
  }, L);
1587
1591
  });
1588
1592
  };
1589
1593
  }
1590
- function De(n, M = 200, y = {}) {
1594
+ function De(n, B = 200, y = {}) {
1591
1595
  return rl(
1592
- sl(M, y),
1596
+ sl(B, y),
1593
1597
  n
1594
1598
  );
1595
1599
  }
@@ -1667,9 +1671,9 @@ const te = {
1667
1671
  }
1668
1672
  },
1669
1673
  emits: ["update", "error", "url-valid:success", "url-valid:error", "loading", "model-updated", "try-sample-api"],
1670
- setup(n, { expose: M, emit: y }) {
1674
+ setup(n, { expose: B, emit: y }) {
1671
1675
  var he;
1672
- const p = y, a = n, b = W(!0), B = qe(), { i18nT: Z, i18n: { t: r } } = ge.useI18n(), { getErrorFieldsFromError: L } = Xe(), { axiosInstance: I } = Oe((he = a.config) == null ? void 0 : he.axiosRequestConfig), ie = Ye(), { validateHost: de, validatePath: X, validatePort: ke, validateProtocol: fe } = ge.useUrlValidators(), A = h(() => ye.form[a.config.app].edit), Y = h(() => a.gatewayServiceId ? Me.Edit : Me.Create), ee = W(!1), re = h(() => !!a.gatewayServiceId), l = W(re.value ? "protocol" : "url"), x = ge.usePortFromProtocol(), se = W(""), Pe = h(() => !!se.value || !!ue("name")), t = Re({
1676
+ const p = y, a = n, b = W(!0), T = qe(), { i18nT: H, i18n: { t: r } } = ge.useI18n(), { getErrorFieldsFromError: L } = Xe(), { axiosInstance: I } = Oe((he = a.config) == null ? void 0 : he.axiosRequestConfig), ie = Ye(), { validateHost: de, validatePath: X, validatePort: ke, validateProtocol: fe } = ge.useUrlValidators(), x = h(() => ye.form[a.config.app].edit), Y = h(() => a.gatewayServiceId ? Me.Edit : Me.Create), ee = W(!1), re = h(() => !!a.gatewayServiceId), l = W(re.value ? "protocol" : "url"), A = ge.usePortFromProtocol(), se = W(""), Pe = h(() => !!se.value || !!ue("name")), t = Te({
1673
1677
  fields: {
1674
1678
  name: "",
1675
1679
  protocol: "http",
@@ -1705,7 +1709,7 @@ const te = {
1705
1709
  tls_verify_enabled: "",
1706
1710
  tls_verify_value: ""
1707
1711
  }
1708
- }), $ = Re({
1712
+ }), $ = Te({
1709
1713
  name: "",
1710
1714
  protocol: "http",
1711
1715
  host: "",
@@ -1811,8 +1815,8 @@ const te = {
1811
1815
  t.fields.path = e.pathname;
1812
1816
  const E = ke(e.port);
1813
1817
  if (E) throw new Error(E);
1814
- const T = Number(e.port);
1815
- ee.value = !!T, t.fields.port = T || x.getPortFromProtocol(t.fields.protocol), p("url-valid:success");
1818
+ const R = Number(e.port);
1819
+ ee.value = !!R, t.fields.port = R || A.getPortFromProtocol(t.fields.protocol), p("url-valid:success");
1816
1820
  } catch (e) {
1817
1821
  p("url-valid:error", e.message || r("gateway_services.form.errors.url.invalid")), t.formFieldErrors.url = e.message || r("gateway_services.form.errors.url.invalid");
1818
1822
  }
@@ -1829,7 +1833,7 @@ const te = {
1829
1833
  const V = X(t.fields.path);
1830
1834
  V && (t.formFieldErrors.path = V);
1831
1835
  const G = ke(t.fields.port);
1832
- G && (t.formFieldErrors.port = G), J.value ? p("url-valid:success") : p("url-valid:error", t.errorMessages.join(",") || r("gateway_services.form.errors.url.invalid"));
1836
+ G && (t.formFieldErrors.port = G), Z.value ? p("url-valid:success") : p("url-valid:error", t.errorMessages.join(",") || r("gateway_services.form.errors.url.invalid"));
1833
1837
  }, 300), N = (e) => {
1834
1838
  if (e)
1835
1839
  t.formFieldErrors[e] = "";
@@ -1837,7 +1841,7 @@ const te = {
1837
1841
  for (let s in t.formFieldErrors)
1838
1842
  t.formFieldErrors[s] = "";
1839
1843
  t.errorMessages = [];
1840
- }, J = h(() => {
1844
+ }, Z = h(() => {
1841
1845
  for (let e in t.formFieldErrors)
1842
1846
  if (t.formFieldErrors[e].length)
1843
1847
  return !1;
@@ -1854,7 +1858,7 @@ const te = {
1854
1858
  return !0;
1855
1859
  const e = ["https", "tls"].includes(t.fields.protocol);
1856
1860
  return l.value === "protocol" && e;
1857
- }), H = h(() => {
1861
+ }), J = h(() => {
1858
1862
  if (l.value === "url")
1859
1863
  return !0;
1860
1864
  const e = ["https", "wss", "tls"].includes(t.fields.protocol);
@@ -1864,13 +1868,13 @@ const te = {
1864
1868
  }, U = h(() => {
1865
1869
  if (re.value)
1866
1870
  return JSON.stringify(t.fields) !== JSON.stringify($);
1867
- const e = l.value === "url" && !!t.fields.url && J.value, s = l.value === "protocol" && !!t.fields.host && J.value;
1871
+ const e = l.value === "url" && !!t.fields.url && Z.value, s = l.value === "protocol" && !!t.fields.host && Z.value;
1868
1872
  return e || s;
1869
1873
  }), c = (e) => {
1870
1874
  var s, V, G;
1871
1875
  t.fields.name = (e == null ? void 0 : e.name) || "", t.fields.tags = ((s = e == null ? void 0 : e.tags) == null ? void 0 : s.join(", ")) || "", t.fields.protocol = (e == null ? void 0 : e.protocol) || "http", t.fields.path = (e == null ? void 0 : e.path) || "", t.fields.read_timeout = e != null && e.read_timeout || (e == null ? void 0 : e.read_timeout) === 0 ? e == null ? void 0 : e.read_timeout : 6e4, t.fields.retries = e != null && e.retries || (e == null ? void 0 : e.retries) === 0 ? e == null ? void 0 : e.retries : 5, t.fields.host = (e == null ? void 0 : e.host) || "", t.fields.connect_timeout = e != null && e.connect_timeout || (e == null ? void 0 : e.connect_timeout) === 0 ? e == null ? void 0 : e.connect_timeout : 6e4, t.fields.tls_verify_enabled = (e == null ? void 0 : e.tls_verify) !== "" && (e == null ? void 0 : e.tls_verify) !== null && (e == null ? void 0 : e.tls_verify) !== void 0, t.fields.tls_verify_value = e != null && e.tls_verify ? e == null ? void 0 : e.tls_verify : !1, t.fields.ca_certificates = ((V = e == null ? void 0 : e.ca_certificates) == null ? void 0 : V.join(",")) || "", t.fields.client_certificate = ((G = e == null ? void 0 : e.client_certificate) == null ? void 0 : G.id) || "", t.fields.write_timeout = e != null && e.write_timeout || (e == null ? void 0 : e.write_timeout) === 0 ? e == null ? void 0 : e.write_timeout : 6e4, t.fields.port = e != null && e.port || (e == null ? void 0 : e.port) === 0 ? e == null ? void 0 : e.port : 80, Object.assign($, t.fields);
1872
1876
  }, g = () => {
1873
- B.push(a.config.cancelRoute);
1877
+ T.push(a.config.cancelRoute);
1874
1878
  }, m = h(() => {
1875
1879
  var s, V;
1876
1880
  let e = `${a.config.apiBaseUrl}${ye.form[a.config.app].validate}`;
@@ -1886,7 +1890,7 @@ const te = {
1886
1890
  var s, V, G, E;
1887
1891
  const e = {
1888
1892
  name: t.fields.name || null,
1889
- tags: t.fields.tags ? (G = (V = (s = t.fields.tags) == null ? void 0 : s.split(",")) == null ? void 0 : V.map((T) => String(T || "").trim())) == null ? void 0 : G.filter((T) => T !== "") : null,
1893
+ tags: t.fields.tags ? (G = (V = (s = t.fields.tags) == null ? void 0 : s.split(",")) == null ? void 0 : V.map((R) => String(R || "").trim())) == null ? void 0 : G.filter((R) => R !== "") : null,
1890
1894
  protocol: t.fields.protocol,
1891
1895
  path: t.fields.path || null,
1892
1896
  read_timeout: t.fields.read_timeout,
@@ -1895,7 +1899,7 @@ const te = {
1895
1899
  connect_timeout: t.fields.connect_timeout,
1896
1900
  tls_verify_value: t.fields.tls_verify_value,
1897
1901
  tls_verify_enabled: t.fields.tls_verify_enabled,
1898
- ca_certificates: t.fields.ca_certificates ? (E = t.fields.ca_certificates) == null ? void 0 : E.split(",").filter((T) => T !== "") : null,
1902
+ ca_certificates: t.fields.ca_certificates ? (E = t.fields.ca_certificates) == null ? void 0 : E.split(",").filter((R) => R !== "") : null,
1899
1903
  client_certificate: t.fields.client_certificate ? { id: t.fields.client_certificate } : null,
1900
1904
  write_timeout: t.fields.write_timeout,
1901
1905
  port: t.fields.port,
@@ -1908,15 +1912,15 @@ const te = {
1908
1912
  t.isReadonly = !0, oe();
1909
1913
  const E = Q.value;
1910
1914
  O(E);
1911
- let T;
1912
- if (await I.post(m.value, E), Y.value === "create" ? T = await I.post(w.value, E) : Y.value === "edit" && (T = ((e = a.config) == null ? void 0 : e.app) === "konnect" ? await I.put(w.value, E) : await I.patch(w.value, E)), T) {
1913
- const { data: d } = T;
1914
- t.fields.name = (d == null ? void 0 : d.name) || "", t.fields.port = d.port || x.getPortFromProtocol(d.protocol), t.fields.protocol = (d == null ? void 0 : d.protocol) || "http", t.fields.host = (d == null ? void 0 : d.host) || "", t.fields.path = (d == null ? void 0 : d.path) || "", t.fields.url = (d == null ? void 0 : d.url) || "", t.fields.retries = d != null && d.retries || (d == null ? void 0 : d.retries) === 0 ? d == null ? void 0 : d.retries : 5, t.fields.connect_timeout = d != null && d.connect_timeout || (d == null ? void 0 : d.connect_timeout) === 0 ? d == null ? void 0 : d.connect_timeout : 6e4, t.fields.write_timeout = d != null && d.write_timeout || (d == null ? void 0 : d.write_timeout) === 0 ? d == null ? void 0 : d.write_timeout : 6e4, t.fields.read_timeout = d != null && d.read_timeout || (d == null ? void 0 : d.read_timeout) === 0 ? d == null ? void 0 : d.read_timeout : 6e4, t.fields.client_certificate = ((s = d == null ? void 0 : d.client_certificate) == null ? void 0 : s.id) || "", t.fields.ca_certificates = (V = d == null ? void 0 : d.ca_certificates) != null && V.length ? d == null ? void 0 : d.ca_certificates.join(",") : "", t.fields.tls_verify_enabled = (d == null ? void 0 : d.tls_verify) !== "" && (d == null ? void 0 : d.tls_verify) !== null && (d == null ? void 0 : d.tls_verify) !== void 0, t.fields.tls_verify_value = t.fields.tls_verify_enabled && (d == null ? void 0 : d.tls_verify), t.fields.tags = (G = d == null ? void 0 : d.tags) != null && G.length ? d.tags.join(", ") : "", Object.assign($, t.fields), p("update", T == null ? void 0 : T.data);
1915
+ let R;
1916
+ if (await I.post(m.value, E), Y.value === "create" ? R = await I.post(w.value, E) : Y.value === "edit" && (R = ((e = a.config) == null ? void 0 : e.app) === "konnect" ? await I.put(w.value, E) : await I.patch(w.value, E)), R) {
1917
+ const { data: d } = R;
1918
+ t.fields.name = (d == null ? void 0 : d.name) || "", t.fields.port = d.port || A.getPortFromProtocol(d.protocol), t.fields.protocol = (d == null ? void 0 : d.protocol) || "http", t.fields.host = (d == null ? void 0 : d.host) || "", t.fields.path = (d == null ? void 0 : d.path) || "", t.fields.url = (d == null ? void 0 : d.url) || "", t.fields.retries = d != null && d.retries || (d == null ? void 0 : d.retries) === 0 ? d == null ? void 0 : d.retries : 5, t.fields.connect_timeout = d != null && d.connect_timeout || (d == null ? void 0 : d.connect_timeout) === 0 ? d == null ? void 0 : d.connect_timeout : 6e4, t.fields.write_timeout = d != null && d.write_timeout || (d == null ? void 0 : d.write_timeout) === 0 ? d == null ? void 0 : d.write_timeout : 6e4, t.fields.read_timeout = d != null && d.read_timeout || (d == null ? void 0 : d.read_timeout) === 0 ? d == null ? void 0 : d.read_timeout : 6e4, t.fields.client_certificate = ((s = d == null ? void 0 : d.client_certificate) == null ? void 0 : s.id) || "", t.fields.ca_certificates = (V = d == null ? void 0 : d.ca_certificates) != null && V.length ? d == null ? void 0 : d.ca_certificates.join(",") : "", t.fields.tls_verify_enabled = (d == null ? void 0 : d.tls_verify) !== "" && (d == null ? void 0 : d.tls_verify) !== null && (d == null ? void 0 : d.tls_verify) !== void 0, t.fields.tls_verify_value = t.fields.tls_verify_enabled && (d == null ? void 0 : d.tls_verify), t.fields.tags = (G = d == null ? void 0 : d.tags) != null && G.length ? d.tags.join(", ") : "", Object.assign($, t.fields), p("update", R == null ? void 0 : R.data);
1915
1919
  }
1916
- return T;
1920
+ return R;
1917
1921
  } catch (E) {
1918
- const { fields: T, messages: d } = L(E);
1919
- t.errorMessages = d, T.length && T.forEach((we) => {
1922
+ const { fields: R, messages: d } = L(E);
1923
+ t.errorMessages = d, R.length && R.forEach((we) => {
1920
1924
  const Ie = we.field;
1921
1925
  Ie === "client_certificate.id" ? t.formFieldErrors.client_certificate = we.message : Ie.startsWith("ca_certificates") ? t.formFieldErrors.ca_certificates = we.message : Object.keys(t.formFieldErrors).includes(Ie) && (t.formFieldErrors = {
1922
1926
  ...t.formFieldErrors,
@@ -1930,24 +1934,24 @@ const te = {
1930
1934
  return $e(() => a.gatewayServiceId, () => {
1931
1935
  Object.assign(t.fields, $);
1932
1936
  }), $e(t.fields, (e) => {
1933
- t.fields.port = x.getPortFromProtocol(e.protocol, String(e.port)), p("model-updated", Q.value);
1934
- }), Je(() => {
1937
+ t.fields.port = A.getPortFromProtocol(e.protocol, String(e.port)), p("model-updated", Q.value);
1938
+ }), Ze(() => {
1935
1939
  p("model-updated", Q.value), re.value || (t.fields.name = ve());
1936
- }), M({
1940
+ }), B({
1937
1941
  validateUrl: oe,
1938
1942
  getPayload: Q,
1939
1943
  saveFormData: j,
1940
1944
  canSubmit: U,
1941
1945
  initForm: c
1942
1946
  }), (e, s) => {
1943
- const V = D("KRadio"), G = D("KButton"), E = D("KInput"), T = D("KSelect"), d = D("KCheckbox"), we = D("KCollapse"), Ie = D("KAlert");
1947
+ const V = D("KRadio"), G = D("KButton"), E = D("KInput"), R = D("KSelect"), d = D("KCheckbox"), we = D("KCollapse"), Ie = D("KAlert");
1944
1948
  return C(), F("div", al, [
1945
1949
  u(o(tt), {
1946
1950
  "can-submit": U.value,
1947
1951
  config: n.config,
1948
1952
  "edit-id": n.gatewayServiceId,
1949
1953
  "entity-type": o(Ge).GatewayService,
1950
- "fetch-url": A.value,
1954
+ "fetch-url": x.value,
1951
1955
  "form-fields": Q.value,
1952
1956
  "is-readonly": t.isReadonly,
1953
1957
  onCancel: g,
@@ -1970,7 +1974,7 @@ const te = {
1970
1974
  title: o(r)("gateway_services.form.sections.keys.title")
1971
1975
  }, {
1972
1976
  default: v(() => [
1973
- re.value ? R("", !0) : (C(), F("div", nl, [
1977
+ re.value ? M("", !0) : (C(), F("div", nl, [
1974
1978
  S("div", cl, [
1975
1979
  u(V, {
1976
1980
  modelValue: l.value,
@@ -2016,7 +2020,7 @@ const te = {
2016
2020
  placeholder: o(r)("gateway_services.form.fields.upstream_url.placeholder"),
2017
2021
  required: "",
2018
2022
  onInput: o(me)
2019
- }, Te({ _: 2 }, [
2023
+ }, Re({ _: 2 }, [
2020
2024
  n.hideTrySampleApiButton ? void 0 : {
2021
2025
  name: "after",
2022
2026
  fn: v(() => [
@@ -2034,7 +2038,7 @@ const te = {
2034
2038
  key: "0"
2035
2039
  }
2036
2040
  ]), 1032, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder", "onInput"])
2037
- ])) : R("", !0)
2041
+ ])) : M("", !0)
2038
2042
  ]),
2039
2043
  _: 1
2040
2044
  })
@@ -2042,7 +2046,7 @@ const te = {
2042
2046
  u(We, { name: "slide-fade" }, {
2043
2047
  default: v(() => [
2044
2048
  l.value === "protocol" || re.value ? (C(), F("div", dl, [
2045
- u(T, {
2049
+ u(R, {
2046
2050
  modelValue: t.fields.protocol,
2047
2051
  "onUpdate:modelValue": s[3] || (s[3] = (_) => t.fields.protocol = _),
2048
2052
  "data-testid": "gateway-service-protocol-select",
@@ -2074,7 +2078,7 @@ const te = {
2074
2078
  placeholder: o(r)("gateway_services.form.fields.host.placeholder"),
2075
2079
  required: "",
2076
2080
  onInput: s[6] || (s[6] = (_) => o(le)("host"))
2077
- }, Te({ _: 2 }, [
2081
+ }, Re({ _: 2 }, [
2078
2082
  n.hideTrySampleApiButton ? void 0 : {
2079
2083
  name: "after",
2080
2084
  fn: v(() => [
@@ -2110,7 +2114,7 @@ const te = {
2110
2114
  placeholder: o(r)("gateway_services.form.fields.path.placeholder"),
2111
2115
  onInput: s[8] || (s[8] = (_) => o(le)("path"))
2112
2116
  }, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"])
2113
- ])) : R("", !0),
2117
+ ])) : M("", !0),
2114
2118
  u(E, {
2115
2119
  modelValue: t.fields.port,
2116
2120
  "onUpdate:modelValue": [
@@ -2132,7 +2136,7 @@ const te = {
2132
2136
  type: "number",
2133
2137
  onInput: s[10] || (s[10] = (_) => o(le)("port"))
2134
2138
  }, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes"])
2135
- ])) : R("", !0)
2139
+ ])) : M("", !0)
2136
2140
  ]),
2137
2141
  _: 1
2138
2142
  }),
@@ -2146,7 +2150,7 @@ const te = {
2146
2150
  default: v(() => [
2147
2151
  u(We, { name: "slide-fade" }, {
2148
2152
  default: v(() => [
2149
- b.value ? R("", !0) : (C(), F("div", pl, [
2153
+ b.value ? M("", !0) : (C(), F("div", pl, [
2150
2154
  S("div", ml, [
2151
2155
  u(E, {
2152
2156
  modelValue: t.fields.retries,
@@ -2250,7 +2254,7 @@ const te = {
2250
2254
  type: "text",
2251
2255
  onInput: s[21] || (s[21] = (_) => o(be)("client_certificate"))
2252
2256
  }, null, 8, ["modelValue", "error", "label", "label-attributes", "placeholder", "readonly"])
2253
- ])) : R("", !0),
2257
+ ])) : M("", !0),
2254
2258
  k.value ? (C(), F("div", bl, [
2255
2259
  u(E, {
2256
2260
  modelValue: t.fields.ca_certificates,
@@ -2267,7 +2271,7 @@ const te = {
2267
2271
  onInput: s[23] || (s[23] = (_) => o(be)("ca_certificates"))
2268
2272
  }, {
2269
2273
  "label-tooltip": v(() => [
2270
- u(o(Z), {
2274
+ u(o(H), {
2271
2275
  keypath: "gateway_services.form.fields.ca_certificates.tooltip",
2272
2276
  scope: "global"
2273
2277
  }, {
@@ -2282,8 +2286,8 @@ const te = {
2282
2286
  ]),
2283
2287
  _: 1
2284
2288
  }, 8, ["modelValue", "error", "label", "placeholder", "readonly"])
2285
- ])) : R("", !0),
2286
- H.value ? (C(), F("div", hl, [
2289
+ ])) : M("", !0),
2290
+ J.value ? (C(), F("div", hl, [
2287
2291
  u(d, {
2288
2292
  modelValue: t.fields.tls_verify_enabled,
2289
2293
  "onUpdate:modelValue": s[24] || (s[24] = (_) => t.fields.tls_verify_enabled = _),
@@ -2293,7 +2297,7 @@ const te = {
2293
2297
  "label-attributes": { tooltipAttributes: { maxWidth: "400" } }
2294
2298
  }, {
2295
2299
  tooltip: v(() => [
2296
- u(o(Z), {
2300
+ u(o(H), {
2297
2301
  keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
2298
2302
  scope: "global"
2299
2303
  }, {
@@ -2313,7 +2317,7 @@ const te = {
2313
2317
  label: o(r)("gateway_services.form.fields.tls_verify_option.true.label"),
2314
2318
  "selected-value": !0
2315
2319
  }, null, 8, ["modelValue", "label"])
2316
- ])) : R("", !0),
2320
+ ])) : M("", !0),
2317
2321
  t.fields.tls_verify_enabled ? (C(), F("div", kl, [
2318
2322
  u(V, {
2319
2323
  modelValue: t.fields.tls_verify_value,
@@ -2322,8 +2326,8 @@ const te = {
2322
2326
  label: o(r)("gateway_services.form.fields.tls_verify_option.false.label"),
2323
2327
  "selected-value": !1
2324
2328
  }, null, 8, ["modelValue", "label"])
2325
- ])) : R("", !0)
2326
- ])) : R("", !0)
2329
+ ])) : M("", !0)
2330
+ ])) : M("", !0)
2327
2331
  ]))
2328
2332
  ]),
2329
2333
  _: 1
@@ -2400,17 +2404,17 @@ const te = {
2400
2404
  ])
2401
2405
  ]),
2402
2406
  _: 1
2403
- })) : R("", !0)
2407
+ })) : M("", !0)
2404
2408
  ]),
2405
2409
  _: 3
2406
2410
  }, 8, ["can-submit", "config", "edit-id", "entity-type", "fetch-url", "form-fields", "is-readonly"])
2407
2411
  ]);
2408
2412
  };
2409
2413
  }
2410
- }), Tl = /* @__PURE__ */ Ne(Sl, [["__scopeId", "data-v-a378ebc2"]]);
2414
+ }), Rl = /* @__PURE__ */ Ne(Sl, [["__scopeId", "data-v-a378ebc2"]]);
2411
2415
  export {
2412
- xl as GatewayServiceConfigCard,
2413
- Tl as GatewayServiceForm,
2416
+ Al as GatewayServiceConfigCard,
2417
+ Rl as GatewayServiceForm,
2414
2418
  Ul as GatewayServiceList,
2415
- Al as LegacyGatewayServiceForm
2419
+ xl as LegacyGatewayServiceForm
2416
2420
  };