@kong-ui-public/entities-gateway-services 3.10.5-pr.2005.e9e725032.0 → 3.10.6-pr.2001.dfcf418cd.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 Te, computed as b, ref as E, watch as Ie, onBeforeMount as Le, resolveComponent as F, openBlock as S, createElementBlock as U, createVNode as d, unref as o, createSlots as Ee, withCtx as f, createBlock as ue, Teleport as Pe, createElementVNode as w, createCommentVNode as L, createTextVNode as M, toDisplayString as y, withModifiers as Se, reactive as Ue, onMounted as De, renderSlot as Ge } from "vue";
2
- import { useRouter as xe } from "vue-router";
3
- import { BookIcon as Re, AddIcon as Ke, ServicesIcon as qe } from "@kong/icons";
4
- import { createI18n as Oe, i18nTComponent as Ne } from "@kong-ui-public/i18n";
5
- import { useAxios as Ae, useTableState as We, useFetcher as je, useDeleteUrlBuilder as He, FetcherStatus as Je, EntityBaseTable as ze, EntityFilter as Qe, PermissionsWrapper as ie, TableTags as Xe, EntityEmptyState as Ze, EntityToggleModal as Ye, EntityDeleteModal as et, EntityTypes as tt, useErrors as ot, useValidators as lt, EntityBaseFormType as Me, useGatewayFeatureSupported as it, EntityBaseForm as st, SupportedEntityType as Fe, EntityFormSection as $e, useHelpers as rt, ConfigurationSchemaSection as fe, ConfigurationSchemaType as at, EntityBaseConfigCard as nt } from "@kong-ui-public/entities-shared";
6
- const ct = {
1
+ import { defineComponent as Le, computed as h, ref as W, watch as Ue, onBeforeMount as lt, resolveComponent as D, openBlock as C, createElementBlock as E, createVNode as d, unref as o, createSlots as Re, withCtx as v, createBlock as Fe, Teleport as je, createElementVNode as S, createCommentVNode as x, createTextVNode as z, toDisplayString as F, withModifiers as Ke, reactive as xe, onMounted as Je, renderSlot as Qe, toValue as ze, Transition as We, Fragment as ot, renderList as it } from "vue";
2
+ import { useRouter as qe } from "vue-router";
3
+ import { BookIcon as He, AddIcon as rt, ServicesIcon as st } from "@kong/icons";
4
+ import { createI18n as at, i18nTComponent as nt } from "@kong-ui-public/i18n";
5
+ import { useAxios as Ge, useTableState as ct, useFetcher as dt, useDeleteUrlBuilder as ut, FetcherStatus as ft, EntityBaseTable as pt, EntityFilter as mt, PermissionsWrapper as Ee, TableTags as vt, EntityEmptyState as gt, EntityToggleModal as yt, EntityDeleteModal as _t, EntityTypes as bt, useErrors as Xe, useValidators as Ye, EntityBaseFormType as Me, useGatewayFeatureSupported as et, EntityBaseForm as tt, SupportedEntityType as Oe, EntityFormSection as Be, useHelpers as ht, ConfigurationSchemaSection as $e, ConfigurationSchemaType as wt, EntityBaseConfigCard as kt } from "@kong-ui-public/entities-shared";
6
+ const Vt = {
7
7
  create: "New gateway service",
8
8
  serverless_create: "Add a Service",
9
9
  copy_id: "Copy ID",
@@ -16,12 +16,12 @@ const ct = {
16
16
  description: "Deleting this Gateway Service will also remove any associated plugins. This action cannot be reversed.",
17
17
  menu_label: "Delete"
18
18
  }
19
- }, dt = {
19
+ }, Ct = {
20
20
  placeholder: {
21
21
  konnect: "Filter by name",
22
22
  kongManager: "Filter by exact name or ID"
23
23
  }
24
- }, ut = {
24
+ }, St = {
25
25
  title: "Gateway Services",
26
26
  list: {
27
27
  toolbar_actions: {
@@ -53,24 +53,50 @@ const ct = {
53
53
  description: "Gateway services represent backend APIs or microservices that receive traffic routed through the gateway."
54
54
  },
55
55
  form: {
56
+ errors: {
57
+ host: {
58
+ empty: "host cannot be empty",
59
+ invalid: "invalid host"
60
+ },
61
+ port: {
62
+ type: "Port must be a number",
63
+ invalid: "Port must be between 0 and 65535"
64
+ },
65
+ path: {
66
+ prefix: "Path must begin with /",
67
+ invalid: "Path should not include characters outside of the reserved list of RFC 3986"
68
+ },
69
+ protocol: {
70
+ empty: "protocol cannot be empty",
71
+ invalid: "protocol - value must be one of http, https, grpc, grpcs, tcp, udp, tls, tls_passthrough, ws, wss"
72
+ }
73
+ },
56
74
  sections: {
57
75
  general: {
58
76
  title: "General Information",
59
- description: "General information will help identify and manage this Gateway Service."
77
+ description: "Provide a name and tags to help identify and manage this service."
60
78
  },
61
79
  keys: {
62
80
  title: "Service Endpoint",
63
- description: "Define the endpoint for this service by specifying the full URL or by its separate elements.",
81
+ description: "Define where this service should send requests.",
64
82
  checkedGroupLabel: "Choose how and where to send traffic",
65
83
  urlLabel: "Full URL",
66
84
  checkedGroupAltLabel: "Protocol, Host, Port and Path",
85
+ url: {
86
+ label: "Full URL",
87
+ description: "Define the service using a single, complete API URL for simple setup."
88
+ },
89
+ protocol: {
90
+ label: "Protocol, host, port, and path",
91
+ description: "Manually specify each component of the API’s URL for advanced configurations."
92
+ },
67
93
  viewAdvancedFields: "View Advanced Fields"
68
94
  }
69
95
  },
70
96
  fields: {
71
97
  upstream_url: {
72
- label: "Upstream URL",
73
- placeholder: "Enter a URL",
98
+ label: "Full URL",
99
+ placeholder: "e.g. https://www.myapi.com/",
74
100
  tooltip_for_konnect: "This is the URL of the API you will manage in Konnect.",
75
101
  tooltip_for_km: "This is the URL of the API you will manage in Kong Gateway."
76
102
  },
@@ -97,12 +123,12 @@ const ct = {
97
123
  },
98
124
  host: {
99
125
  label: "Host",
100
- placeholder: "Enter a host",
126
+ placeholder: "e.g. www.myapi.com, 127.0.0.1",
101
127
  tooltip: "The host of the upstream server. Note that the host value is case sensitive."
102
128
  },
103
129
  path: {
104
130
  label: "Path",
105
- placeholder: "Enter a path",
131
+ placeholder: "e.g. /sample",
106
132
  tooltip: "The path to be used in request to the upstream server."
107
133
  },
108
134
  port: {
@@ -160,7 +186,8 @@ const ct = {
160
186
  label: "Tags",
161
187
  tooltip: "An optional set of strings associated with the Service for grouping and filtering.",
162
188
  placeholder: "Enter a list of tags separated by comma",
163
- help: "e.g. tag1, tag2, tag3"
189
+ help: "e.g. tag1, tag2, tag3",
190
+ collapse: "Add tags"
164
191
  },
165
192
  enabled: {
166
193
  label: "Enabled",
@@ -170,39 +197,39 @@ const ct = {
170
197
  }
171
198
  }
172
199
  }
173
- }, ft = {
200
+ }, It = {
174
201
  general: "Gateway Services could not be retrieved",
175
202
  delete: "The gateway service could not be deleted at this time.",
176
203
  copy: "Failed to copy to clipboard",
177
204
  urlErrorMessage: "Error: invalid URL"
178
- }, pt = {
205
+ }, Pt = {
179
206
  success: "Copied {val} to clipboard",
180
207
  success_brief: "Successfully copied to clipboard"
181
- }, mt = {
208
+ }, Et = {
182
209
  gateway_services: "gateway services"
183
- }, vt = {
184
- actions: ct,
185
- search: dt,
186
- gateway_services: ut,
187
- errors: ft,
188
- copy: pt,
189
- glossary: mt
210
+ }, Ft = {
211
+ actions: Vt,
212
+ search: Ct,
213
+ gateway_services: St,
214
+ errors: It,
215
+ copy: Pt,
216
+ glossary: Et
190
217
  };
191
- function gt() {
192
- const n = Oe("en-us", vt);
218
+ function Ut() {
219
+ const n = at("en-us", Ft);
193
220
  return {
194
221
  i18n: n,
195
- i18nT: Ne(n)
222
+ i18nT: nt(n)
196
223
  // Translation component <i18n-t>
197
224
  };
198
225
  }
199
- function yt() {
226
+ function $t() {
200
227
  return {
201
- getPortFromProtocol: (D, p) => {
202
- const c = [80, 443], r = Number(p);
203
- if ((r || r === 0) && !c.includes(r))
204
- return r;
205
- switch (D) {
228
+ getPortFromProtocol: (M, y) => {
229
+ const p = [80, 443], a = Number(y);
230
+ if ((a || a === 0) && !p.includes(a))
231
+ return a;
232
+ switch (M) {
206
233
  case "grpcs":
207
234
  case "tls":
208
235
  case "https":
@@ -218,31 +245,48 @@ function yt() {
218
245
  }
219
246
  };
220
247
  }
221
- const ve = {
222
- useI18n: gt,
223
- usePortFromProtocol: yt
224
- }, pe = "/v2/control-planes/{controlPlaneId}/core-entities", me = "/{workspace}", se = {
248
+ function At() {
249
+ const { i18n: { t: n } } = ge.useI18n();
250
+ return {
251
+ 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"),
252
+ validateProtocol: (b, B) => !b || b.trim() === "" ? n("gateway_services.form.errors.protocol.empty") : (b = b.slice(0, -1), B.find((r) => {
253
+ if (r.value === b) return r;
254
+ }) === void 0 ? n("gateway_services.form.errors.protocol.invalid") : ""),
255
+ 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"),
256
+ validatePort: (b) => {
257
+ if (b == null || b === "")
258
+ return "";
259
+ const B = typeof b == "string" ? parseInt(b, 10) : b;
260
+ return isNaN(B) ? n("gateway_services.form.errors.port.type") : B < 0 || B > 65535 ? n("gateway_services.form.errors.port.invalid") : "";
261
+ }
262
+ };
263
+ }
264
+ const ge = {
265
+ useI18n: Ut,
266
+ usePortFromProtocol: $t,
267
+ useUrlValidators: At
268
+ }, Ae = "/v2/control-planes/{controlPlaneId}/core-entities", Te = "/{workspace}", ye = {
225
269
  list: {
226
270
  konnect: {
227
- all: `${pe}/services`
271
+ all: `${Ae}/services`
228
272
  },
229
273
  kongManager: {
230
- all: `${me}/services`
274
+ all: `${Te}/services`
231
275
  }
232
276
  },
233
277
  form: {
234
278
  konnect: {
235
- create: `${pe}/services`,
236
- validate: `${pe}/v1/schemas/json/service/validate`,
237
- edit: `${pe}/services/{id}`
279
+ create: `${Ae}/services`,
280
+ validate: `${Ae}/v1/schemas/json/service/validate`,
281
+ edit: `${Ae}/services/{id}`
238
282
  },
239
283
  kongManager: {
240
- create: `${me}/services`,
241
- validate: `${me}/schemas/services/validate`,
242
- edit: `${me}/services/{id}`
284
+ create: `${Te}/services`,
285
+ validate: `${Te}/schemas/services/validate`,
286
+ edit: `${Te}/services/{id}`
243
287
  }
244
288
  }
245
- }, _t = "#00abd2", bt = "24px", ht = { class: "kong-ui-entities-gateway-services-list" }, wt = { class: "button-row" }, kt = { class: "empty-state-icon-gateway" }, Ct = { class: "control-group-message" }, Vt = { key: 1 }, St = /* @__PURE__ */ Te({
289
+ }, Tt = "#00abd2", Rt = "24px", xt = { class: "kong-ui-entities-gateway-services-list" }, Mt = { class: "button-row" }, Bt = { class: "empty-state-icon-gateway" }, Lt = { key: 1 }, Kt = /* @__PURE__ */ Le({
246
290
  __name: "GatewayServiceList",
247
291
  props: {
248
292
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -290,11 +334,6 @@ const ve = {
290
334
  type: Boolean,
291
335
  default: !1
292
336
  },
293
- /** identifies if type control group or not */
294
- isControlPlaneGroup: {
295
- type: Boolean,
296
- default: !1
297
- },
298
337
  /**
299
338
  * Enables the new empty state design, this prop can be removed when
300
339
  * the khcp-14756-empty-states-m2 FF is removed.
@@ -305,211 +344,211 @@ const ve = {
305
344
  }
306
345
  },
307
346
  emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success", "toggle:success"],
308
- setup(n, { emit: D }) {
309
- var l;
310
- const p = D, c = n, { i18n: { t: r, formatUnixTimeStamp: $ } } = ve.useI18n(), N = xe(), { axiosInstance: q } = Ae((l = c.config) == null ? void 0 : l.axiosRequestConfig), { hasRecords: a, handleStateChange: P } = We(() => G.value), C = b(() => a.value && c.config.app === "konnect"), ge = b(() => !c.enableV2EmptyStates && c.config.app === "konnect"), ye = b(() => c.config.app !== "kongManager" || !!c.config.disableSorting), O = {
347
+ setup(n, { emit: M }) {
348
+ var c;
349
+ const y = M, p = n, { i18n: { t: a, formatUnixTimeStamp: b } } = ge.useI18n(), B = qe(), { axiosInstance: Z } = Ge((c = p.config) == null ? void 0 : c.axiosRequestConfig), { hasRecords: r, handleStateChange: K } = ct(() => ee.value), I = h(() => r.value && p.config.app === "konnect"), ie = h(() => !p.enableV2EmptyStates && p.config.app === "konnect"), ue = h(() => p.config.app !== "kongManager" || !!p.config.disableSorting), X = {
311
350
  // the Name column is non-hidable
312
- name: { label: r("gateway_services.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
313
- ...c.config.showControlPlaneColumn ? { control_plane: { label: r("gateway_services.list.table_headers.control_plane") } } : {},
314
- protocol: { label: r("gateway_services.list.table_headers.protocol"), searchable: !0, sortable: !0 },
315
- host: { label: r("gateway_services.list.table_headers.host"), searchable: !0, sortable: !0 },
316
- port: { label: r("gateway_services.list.table_headers.port"), searchable: !0, sortable: !0 },
317
- path: { label: r("gateway_services.list.table_headers.path"), searchable: !0, sortable: !0 },
318
- enabled: { label: r("gateway_services.list.table_headers.enabled"), searchable: !0, sortable: !0 },
319
- tags: { label: r("gateway_services.list.table_headers.tags"), sortable: !1 },
320
- updated_at: { label: r("gateway_services.list.table_headers.updated_at"), sortable: !0 },
321
- created_at: { label: r("gateway_services.list.table_headers.created_at"), sortable: !0 }
322
- }, _e = {
351
+ name: { label: a("gateway_services.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
352
+ ...p.config.showControlPlaneColumn ? { control_plane: { label: a("gateway_services.list.table_headers.control_plane") } } : {},
353
+ protocol: { label: a("gateway_services.list.table_headers.protocol"), searchable: !0, sortable: !0 },
354
+ host: { label: a("gateway_services.list.table_headers.host"), searchable: !0, sortable: !0 },
355
+ port: { label: a("gateway_services.list.table_headers.port"), searchable: !0, sortable: !0 },
356
+ path: { label: a("gateway_services.list.table_headers.path"), searchable: !0, sortable: !0 },
357
+ enabled: { label: a("gateway_services.list.table_headers.enabled"), searchable: !0, sortable: !0 },
358
+ tags: { label: a("gateway_services.list.table_headers.tags"), sortable: !1 },
359
+ updated_at: { label: a("gateway_services.list.table_headers.updated_at"), sortable: !0 },
360
+ created_at: { label: a("gateway_services.list.table_headers.created_at"), sortable: !0 }
361
+ }, ke = {
323
362
  columnVisibility: {
324
363
  created_at: !1
325
364
  }
326
- }, H = O, _ = b(() => {
327
- var s, g;
328
- let u = `${c.config.apiBaseUrl}${se.list[c.config.app].all}`;
329
- return c.config.app === "konnect" ? u = u.replace(/{controlPlaneId}/gi, ((s = c.config) == null ? void 0 : s.controlPlaneId) || "") : c.config.app === "kongManager" && (u = u.replace(/\/{workspace}/gi, (g = c.config) != null && g.workspace ? `/${c.config.workspace}` : "")), u;
330
- }), Y = b(() => c.config.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${_.value}`) : new URL(_.value)), G = E(""), be = b(() => {
331
- const u = c.config.app === "konnect" || c.config.isExactMatch;
332
- if (u)
365
+ }, fe = X, A = h(() => {
366
+ var m, w;
367
+ let g = `${p.config.apiBaseUrl}${ye.list[p.config.app].all}`;
368
+ 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;
369
+ }), Y = h(() => p.config.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${A.value}`) : new URL(A.value)), ee = W(""), re = h(() => {
370
+ const g = p.config.app === "konnect" || p.config.isExactMatch;
371
+ if (g)
333
372
  return {
334
- isExactMatch: u,
335
- placeholder: r(`search.placeholder.${c.config.app}`)
373
+ isExactMatch: g,
374
+ placeholder: a(`search.placeholder.${p.config.app}`)
336
375
  };
337
- const { name: s, enabled: g, protocol: I, host: Z, port: x, path: de } = O;
376
+ const { name: m, enabled: w, protocol: G, host: Q, port: j, path: he } = X;
338
377
  return {
339
- isExactMatch: u,
340
- fields: { name: s, enabled: g, protocol: I, host: Z, port: x, path: de },
341
- schema: c.config.filterSchema
378
+ isExactMatch: g,
379
+ fields: { name: m, enabled: w, protocol: G, host: Q, port: j, path: he },
380
+ schema: p.config.filterSchema
342
381
  };
343
382
  }), {
344
- fetcher: e,
345
- fetcherState: k,
346
- fetcherCacheKey: ee
347
- } = je({ ...c.config, cacheIdentifier: c.cacheIdentifier }, _.value), he = () => {
348
- G.value = "";
349
- }, re = () => {
350
- ee.value++;
351
- }, J = E(null), W = b(() => ({
352
- ctaPath: c.config.createRoute,
353
- ctaText: h.value ? c.isServerless ? r("actions.serverless_create") : r("actions.create") : void 0,
354
- message: `${r("gateway_services.list.empty_state.description")}${c.config.additionMessageForEmptyState ? ` ${c.config.additionMessageForEmptyState}` : ""}`,
355
- title: h.value ? c.isServerless ? r("gateway_services.list.empty_state.serverless_title") : r("gateway_services.list.empty_state.title") : r("gateway_services.title")
356
- })), z = E(!1), T = E(null), Q = b(() => {
357
- const u = {
383
+ fetcher: l,
384
+ fetcherState: T,
385
+ fetcherCacheKey: se
386
+ } = dt({ ...p.config, cacheIdentifier: p.cacheIdentifier }, A.value), Pe = () => {
387
+ ee.value = "";
388
+ }, t = () => {
389
+ se.value++;
390
+ }, U = W(null), ae = h(() => ({
391
+ ctaPath: p.config.createRoute,
392
+ ctaText: $.value ? p.isServerless ? a("actions.serverless_create") : a("actions.create") : void 0,
393
+ message: `${a("gateway_services.list.empty_state.description")}${p.config.additionMessageForEmptyState ? ` ${p.config.additionMessageForEmptyState}` : ""}`,
394
+ title: $.value ? p.isServerless ? a("gateway_services.list.empty_state.serverless_title") : a("gateway_services.list.empty_state.title") : a("gateway_services.title")
395
+ })), ne = W(!1), q = W(null), pe = h(() => {
396
+ const g = {
358
397
  action: "disable",
359
398
  id: "",
360
399
  name: ""
361
400
  };
362
- if (T.value) {
363
- const { enabled: s, id: g, name: I } = T.value;
364
- u.action = s ? "disable" : "enable", u.id = g, u.name = I || g;
401
+ if (q.value) {
402
+ const { enabled: m, id: w, name: G } = q.value;
403
+ g.action = m ? "disable" : "enable", g.id = w, g.name = G || w;
365
404
  }
366
- return u;
367
- }), we = (u) => {
368
- z.value = !0, T.value = u;
369
- }, ae = () => {
370
- z.value = !1, T.value = null;
371
- }, ke = async () => {
372
- var I, Z;
373
- if (!await ((I = c.canEdit) == null ? void 0 : I.call(c, T.value)) || !T.value)
405
+ return g;
406
+ }), ce = (g) => {
407
+ ne.value = !0, q.value = g;
408
+ }, _e = () => {
409
+ ne.value = !1, q.value = null;
410
+ }, Ve = async () => {
411
+ var G, Q;
412
+ if (!await ((G = p.canEdit) == null ? void 0 : G.call(p, q.value)) || !q.value)
374
413
  return;
375
- const s = `${Y.value.href}/${T.value.id}`, g = !T.value.enabled;
414
+ const m = `${Y.value.href}/${q.value.id}`, w = !q.value.enabled;
376
415
  try {
377
- const { data: x } = ((Z = c.config) == null ? void 0 : Z.app) === "konnect" ? await q.put(s, { ...T.value, enabled: g }) : await q.patch(s, { ...T.value, enabled: g });
378
- p("toggle:success", x), T.value.enabled = g;
379
- } catch (x) {
380
- p("error", x);
416
+ 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 });
417
+ y("toggle:success", j), q.value.enabled = w;
418
+ } catch (j) {
419
+ y("error", j);
381
420
  }
382
- }, Ce = (u) => {
383
- c.config.getControlPlaneRoute && N.push(c.config.getControlPlaneRoute(u));
384
- }, te = (u, s) => {
385
- const g = u.id;
386
- if (!s(g)) {
387
- p("copy:error", {
388
- entity: u,
421
+ }, Ce = (g) => {
422
+ p.config.getControlPlaneRoute && B.push(p.config.getControlPlaneRoute(g));
423
+ }, me = (g, m) => {
424
+ const w = g.id;
425
+ if (!m(w)) {
426
+ y("copy:error", {
427
+ entity: g,
389
428
  field: "id",
390
- message: r("errors.copy")
429
+ message: a("errors.copy")
391
430
  });
392
431
  return;
393
432
  }
394
- p("copy:success", {
395
- entity: u,
433
+ y("copy:success", {
434
+ entity: g,
396
435
  field: "id",
397
- message: r("copy.success", { val: g })
436
+ message: a("copy.success", { val: w })
398
437
  });
399
- }, ne = (u, s) => {
400
- const g = JSON.stringify(u);
401
- if (!s(g)) {
402
- p("copy:error", {
403
- entity: u,
404
- message: r("errors.copy")
438
+ }, be = (g, m) => {
439
+ const w = JSON.stringify(g);
440
+ if (!m(w)) {
441
+ y("copy:error", {
442
+ entity: g,
443
+ message: a("errors.copy")
405
444
  });
406
445
  return;
407
446
  }
408
- p("copy:success", {
409
- entity: u,
410
- message: r("copy.success_brief")
447
+ y("copy:success", {
448
+ entity: g,
449
+ message: a("copy.success_brief")
411
450
  });
412
- }, ce = async (u) => {
413
- var g;
414
- await ((g = c.canRetrieve) == null ? void 0 : g.call(c, u)) && N.push(c.config.getViewRoute(u.id));
415
- }, Ve = (u) => ({
416
- label: r("actions.view"),
417
- to: c.config.getViewRoute(u)
418
- }), oe = (u) => ({
419
- label: r("actions.edit"),
420
- to: c.config.getEditRoute(u)
421
- }), B = E(void 0), K = E(!1), j = E(!1), X = E(""), t = He(c.config, _.value), i = (u) => {
422
- B.value = u, K.value = !0, X.value = "";
423
- }, v = () => {
424
- K.value = !1, B.value = void 0;
425
- }, R = async () => {
426
- var u, s, g;
427
- if ((u = B.value) != null && u.id) {
428
- j.value = !0;
451
+ }, Se = async (g) => {
452
+ var w;
453
+ await ((w = p.canRetrieve) == null ? void 0 : w.call(p, g)) && B.push(p.config.getViewRoute(g.id));
454
+ }, de = (g) => ({
455
+ label: a("actions.view"),
456
+ to: p.config.getViewRoute(g)
457
+ }), le = (g) => ({
458
+ label: a("actions.edit"),
459
+ to: p.config.getEditRoute(g)
460
+ }), N = W(void 0), J = W(!1), oe = W(!1), ve = W(""), i = ut(p.config, A.value), f = (g) => {
461
+ N.value = g, J.value = !0, ve.value = "";
462
+ }, k = () => {
463
+ J.value = !1, N.value = void 0;
464
+ }, H = async () => {
465
+ var g, m, w;
466
+ if ((g = N.value) != null && g.id) {
467
+ oe.value = !0;
429
468
  try {
430
- await q.delete(t(B.value.id)), p("delete:success", B.value), v(), ee.value++;
431
- } catch (I) {
432
- X.value = ((g = (s = I.response) == null ? void 0 : s.data) == null ? void 0 : g.message) || I.message || r("errors.delete"), p("error", I);
469
+ await Z.delete(i(N.value.id)), y("delete:success", N.value), k(), se.value++;
470
+ } catch (G) {
471
+ ve.value = ((w = (m = G.response) == null ? void 0 : m.data) == null ? void 0 : w.message) || G.message || a("errors.delete"), y("error", G);
433
472
  } finally {
434
- j.value = !1;
473
+ oe.value = !1;
435
474
  }
436
475
  }
437
- }, V = () => {
438
- N.push(c.config.createRoute);
476
+ }, L = () => {
477
+ B.push(p.config.createRoute);
439
478
  };
440
- Ie(k, (u) => {
441
- var s, g, I;
442
- if (u.status === Je.Error) {
443
- J.value = {
444
- title: r("errors.general")
445
- }, (I = (g = (s = u.error) == null ? void 0 : s.response) == null ? void 0 : g.data) != null && I.message && (J.value.message = u.error.response.data.message), p("error", u.error);
479
+ Ue(T, (g) => {
480
+ var m, w, G;
481
+ if (g.status === ft.Error) {
482
+ U.value = {
483
+ title: a("errors.general")
484
+ }, (G = (w = (m = g.error) == null ? void 0 : m.response) == null ? void 0 : w.data) != null && G.message && (U.value.message = g.error.response.data.message), y("error", g.error);
446
485
  return;
447
486
  }
448
- J.value = null;
487
+ U.value = null;
449
488
  });
450
- const h = E(!1);
451
- return Le(async () => {
452
- h.value = await c.canCreate();
453
- }), (u, s) => {
454
- const g = F("KButton"), I = F("KBadge"), Z = F("KInputSwitch"), x = F("KDropdownItem"), de = F("KClipboardProvider");
455
- return S(), U("div", ht, [
456
- d(o(ze), {
489
+ const $ = W(!1);
490
+ return lt(async () => {
491
+ $.value = await p.canCreate();
492
+ }), (g, m) => {
493
+ const w = D("KButton"), G = D("KBadge"), Q = D("KInputSwitch"), j = D("KDropdownItem"), he = D("KClipboardProvider");
494
+ return C(), E("div", xt, [
495
+ d(o(pt), {
457
496
  "cache-identifier": n.cacheIdentifier,
458
- "default-table-preferences": _e,
459
- "disable-sorting": ye.value,
460
- "empty-state-options": W.value,
497
+ "default-table-preferences": ke,
498
+ "disable-sorting": ue.value,
499
+ "empty-state-options": ae.value,
461
500
  "enable-entity-actions": "",
462
- "error-message": J.value,
463
- fetcher: o(e),
464
- "fetcher-cache-key": o(ee),
501
+ "error-message": U.value,
502
+ fetcher: o(l),
503
+ "fetcher-cache-key": o(se),
465
504
  "pagination-type": "offset",
466
505
  "preferences-storage-key": "kong-ui-entities-gateway-services-list",
467
- query: G.value,
468
- "table-headers": o(H),
469
- onClearSearchInput: he,
470
- "onClick:row": s[5] || (s[5] = (m) => ce(m)),
471
- onSort: re,
472
- onState: o(P)
473
- }, Ee({
474
- "toolbar-filter": f(() => [
475
- d(o(Qe), {
476
- modelValue: G.value,
477
- "onUpdate:modelValue": s[0] || (s[0] = (m) => G.value = m),
478
- config: be.value
506
+ query: ee.value,
507
+ "table-headers": o(fe),
508
+ onClearSearchInput: Pe,
509
+ "onClick:row": m[5] || (m[5] = (e) => Se(e)),
510
+ onSort: t,
511
+ onState: o(K)
512
+ }, Re({
513
+ "toolbar-filter": v(() => [
514
+ d(o(mt), {
515
+ modelValue: ee.value,
516
+ "onUpdate:modelValue": m[0] || (m[0] = (e) => ee.value = e),
517
+ config: re.value
479
518
  }, null, 8, ["modelValue", "config"])
480
519
  ]),
481
- "toolbar-button": f(() => [
482
- (S(), ue(Pe, {
520
+ "toolbar-button": v(() => [
521
+ (C(), Fe(je, {
483
522
  disabled: !n.useActionOutside,
484
523
  to: "#kong-ui-app-page-header-action-button"
485
524
  }, [
486
- w("div", wt, [
487
- C.value ? (S(), ue(g, {
525
+ S("div", Mt, [
526
+ I.value ? (C(), Fe(w, {
488
527
  key: 0,
489
528
  appearance: "secondary",
490
529
  class: "open-learning-hub",
491
530
  "data-testid": "gateway-services-learn-more-button",
492
531
  icon: "",
493
- onClick: s[1] || (s[1] = (m) => u.$emit("click:learn-more"))
532
+ onClick: m[1] || (m[1] = (e) => g.$emit("click:learn-more"))
494
533
  }, {
495
- default: f(() => [
496
- d(o(Re), { decorative: "" })
534
+ default: v(() => [
535
+ d(o(He), { decorative: "" })
497
536
  ]),
498
537
  _: 1
499
- })) : L("", !0),
500
- d(o(ie), {
538
+ })) : x("", !0),
539
+ d(o(Ee), {
501
540
  "auth-function": () => n.canCreate()
502
541
  }, {
503
- default: f(() => [
504
- d(g, {
542
+ default: v(() => [
543
+ d(w, {
505
544
  appearance: "primary",
506
545
  "data-testid": "toolbar-add-gateway-service",
507
546
  size: n.useActionOutside ? "medium" : "large",
508
547
  to: n.config.createRoute
509
548
  }, {
510
- default: f(() => [
511
- d(o(Ke)),
512
- M(" " + y(o(r)("gateway_services.list.toolbar_actions.new_gateway_service")), 1)
549
+ default: v(() => [
550
+ d(o(rt)),
551
+ z(" " + F(o(a)("gateway_services.list.toolbar_actions.new_gateway_service")), 1)
513
552
  ]),
514
553
  _: 1
515
554
  }, 8, ["size", "to"])
@@ -519,120 +558,120 @@ const ve = {
519
558
  ])
520
559
  ], 8, ["disabled"]))
521
560
  ]),
522
- name: f(({ rowValue: m }) => [
523
- w("b", null, y(m ?? "-"), 1)
561
+ name: v(({ rowValue: e }) => [
562
+ S("b", null, F(e ?? "-"), 1)
524
563
  ]),
525
- control_plane: f(({ row: m }) => {
526
- var A;
564
+ control_plane: v(({ row: e }) => {
565
+ var s;
527
566
  return [
528
- (A = m.x_meta) != null && A.cluster_id ? (S(), ue(I, {
567
+ (s = e.x_meta) != null && s.cluster_id ? (C(), Fe(G, {
529
568
  key: 0,
530
- tooltip: m.x_meta.cluster_id,
569
+ tooltip: e.x_meta.cluster_id,
531
570
  "truncation-tooltip": "",
532
- onClick: Se((le) => Ce(m.x_meta.cluster_id), ["stop"])
571
+ onClick: Ke((V) => Ce(e.x_meta.cluster_id), ["stop"])
533
572
  }, {
534
- default: f(() => [
535
- M(y(m.x_meta.cluster_id), 1)
573
+ default: v(() => [
574
+ z(F(e.x_meta.cluster_id), 1)
536
575
  ]),
537
576
  _: 2
538
- }, 1032, ["tooltip", "onClick"])) : (S(), U("b", Vt, "-"))
577
+ }, 1032, ["tooltip", "onClick"])) : (C(), E("b", Lt, "-"))
539
578
  ];
540
579
  }),
541
- enabled: f(({ row: m }) => [
542
- d(o(ie), {
543
- "auth-function": () => n.canEdit(m),
580
+ enabled: v(({ row: e }) => [
581
+ d(o(Ee), {
582
+ "auth-function": () => n.canEdit(e),
544
583
  "force-show": ""
545
584
  }, {
546
- default: f(({ isAllowed: A }) => [
547
- w("div", {
548
- onClick: s[4] || (s[4] = Se(() => {
585
+ default: v(({ isAllowed: s }) => [
586
+ S("div", {
587
+ onClick: m[4] || (m[4] = Ke(() => {
549
588
  }, ["stop"]))
550
589
  }, [
551
- d(Z, {
552
- modelValue: m.enabled,
553
- "onUpdate:modelValue": (le) => m.enabled = le,
554
- "data-testid": `row-${m.id}-toggle-input`,
555
- disabled: !A,
556
- onClick: Se((le) => we(m), ["prevent"])
590
+ d(Q, {
591
+ modelValue: e.enabled,
592
+ "onUpdate:modelValue": (V) => e.enabled = V,
593
+ "data-testid": `row-${e.id}-toggle-input`,
594
+ disabled: !s,
595
+ onClick: Ke((V) => ce(e), ["prevent"])
557
596
  }, null, 8, ["modelValue", "onUpdate:modelValue", "data-testid", "disabled", "onClick"])
558
597
  ])
559
598
  ]),
560
599
  _: 2
561
600
  }, 1032, ["auth-function"])
562
601
  ]),
563
- tags: f(({ rowValue: m }) => [
564
- d(o(Xe), { tags: m }, null, 8, ["tags"])
602
+ tags: v(({ rowValue: e }) => [
603
+ d(o(vt), { tags: e }, null, 8, ["tags"])
565
604
  ]),
566
- created_at: f(({ rowValue: m }) => [
567
- M(y(o($)(m)), 1)
605
+ created_at: v(({ rowValue: e }) => [
606
+ z(F(o(b)(e)), 1)
568
607
  ]),
569
- updated_at: f(({ row: m, rowValue: A }) => [
570
- M(y(o($)(A ?? m.created_at)), 1)
608
+ updated_at: v(({ row: e, rowValue: s }) => [
609
+ z(F(o(b)(s ?? e.created_at)), 1)
571
610
  ]),
572
- actions: f(({ row: m }) => [
573
- d(de, null, {
574
- default: f(({ copyToClipboard: A }) => [
575
- d(x, {
611
+ actions: v(({ row: e }) => [
612
+ d(he, null, {
613
+ default: v(({ copyToClipboard: s }) => [
614
+ d(j, {
576
615
  "data-testid": "action-entity-copy-id",
577
- onClick: (le) => te(m, A)
616
+ onClick: (V) => me(e, s)
578
617
  }, {
579
- default: f(() => [
580
- M(y(o(r)("actions.copy_id")), 1)
618
+ default: v(() => [
619
+ z(F(o(a)("actions.copy_id")), 1)
581
620
  ]),
582
621
  _: 2
583
622
  }, 1032, ["onClick"])
584
623
  ]),
585
624
  _: 2
586
625
  }, 1024),
587
- d(de, null, {
588
- default: f(({ copyToClipboard: A }) => [
589
- d(x, {
626
+ d(he, null, {
627
+ default: v(({ copyToClipboard: s }) => [
628
+ d(j, {
590
629
  "data-testid": "action-entity-copy-json",
591
- onClick: (le) => ne(m, A)
630
+ onClick: (V) => be(e, s)
592
631
  }, {
593
- default: f(() => [
594
- M(y(o(r)("actions.copy_json")), 1)
632
+ default: v(() => [
633
+ z(F(o(a)("actions.copy_json")), 1)
595
634
  ]),
596
635
  _: 2
597
636
  }, 1032, ["onClick"])
598
637
  ]),
599
638
  _: 2
600
639
  }, 1024),
601
- d(o(ie), {
602
- "auth-function": () => n.canRetrieve(m)
640
+ d(o(Ee), {
641
+ "auth-function": () => n.canRetrieve(e)
603
642
  }, {
604
- default: f(() => [
605
- d(x, {
643
+ default: v(() => [
644
+ d(j, {
606
645
  "data-testid": "action-entity-view",
607
646
  "has-divider": "",
608
- item: Ve(m.id)
647
+ item: de(e.id)
609
648
  }, null, 8, ["item"])
610
649
  ]),
611
650
  _: 2
612
651
  }, 1032, ["auth-function"]),
613
- d(o(ie), {
614
- "auth-function": () => n.canEdit(m)
652
+ d(o(Ee), {
653
+ "auth-function": () => n.canEdit(e)
615
654
  }, {
616
- default: f(() => [
617
- d(x, {
655
+ default: v(() => [
656
+ d(j, {
618
657
  "data-testid": "action-entity-edit",
619
- item: oe(m.id)
658
+ item: le(e.id)
620
659
  }, null, 8, ["item"])
621
660
  ]),
622
661
  _: 2
623
662
  }, 1032, ["auth-function"]),
624
- d(o(ie), {
625
- "auth-function": () => n.canDelete(m)
663
+ d(o(Ee), {
664
+ "auth-function": () => n.canDelete(e)
626
665
  }, {
627
- default: f(() => [
628
- d(x, {
666
+ default: v(() => [
667
+ d(j, {
629
668
  danger: "",
630
669
  "data-testid": "action-entity-delete",
631
670
  "has-divider": "",
632
- onClick: (A) => i(m)
671
+ onClick: (s) => f(e)
633
672
  }, {
634
- default: f(() => [
635
- M(y(o(r)("actions.delete.menu_label")), 1)
673
+ default: v(() => [
674
+ z(F(o(a)("actions.delete.menu_label")), 1)
636
675
  ]),
637
676
  _: 2
638
677
  }, 1032, ["onClick"])
@@ -642,22 +681,22 @@ const ve = {
642
681
  ]),
643
682
  _: 2
644
683
  }, [
645
- !o(a) && ge.value ? {
684
+ !o(r) && ie.value ? {
646
685
  name: "outside-actions",
647
- fn: f(() => [
648
- (S(), ue(Pe, {
686
+ fn: v(() => [
687
+ (C(), Fe(je, {
649
688
  disabled: !n.useActionOutside,
650
689
  to: "#kong-ui-app-page-header-action-button"
651
690
  }, [
652
- d(g, {
691
+ d(w, {
653
692
  appearance: "secondary",
654
693
  class: "open-learning-hub",
655
694
  "data-testid": "gateway-services-more-button",
656
695
  icon: "",
657
- onClick: s[2] || (s[2] = (m) => u.$emit("click:learn-more"))
696
+ onClick: m[2] || (m[2] = (e) => g.$emit("click:learn-more"))
658
697
  }, {
659
- default: f(() => [
660
- d(o(Re), { decorative: "" })
698
+ default: v(() => [
699
+ d(o(He), { decorative: "" })
661
700
  ]),
662
701
  _: 1
663
702
  })
@@ -667,92 +706,95 @@ const ve = {
667
706
  } : void 0,
668
707
  n.enableV2EmptyStates && n.config.app === "konnect" ? {
669
708
  name: "empty-state",
670
- fn: f(() => [
671
- d(o(Ze), {
672
- "action-button-text": o(r)("gateway_services.empty_state_v2.create"),
673
- appearance: "secondary",
674
- "can-create": () => n.canCreate(),
675
- "data-testid": "gateway-services-entity-empty-state",
676
- description: o(r)("gateway_services.empty_state_v2.description"),
677
- "learn-more": n.config.app === "konnect",
678
- title: o(r)("gateway_services.empty_state_v2.title"),
679
- "onClick:create": V,
680
- "onClick:learnMore": s[3] || (s[3] = (m) => u.$emit("click:learn-more"))
681
- }, Ee({
682
- image: f(() => [
683
- w("div", kt, [
684
- d(o(qe), {
685
- color: o(_t),
686
- size: o(bt)
687
- }, null, 8, ["color", "size"])
688
- ])
689
- ]),
690
- _: 2
691
- }, [
692
- n.isControlPlaneGroup ? {
693
- name: "message",
694
- fn: f(() => [
695
- w("p", Ct, y(o(r)("gateway_services.empty_state_v2.group")), 1)
709
+ fn: v(() => {
710
+ var e;
711
+ return [
712
+ d(o(gt), {
713
+ "action-button-text": o(a)("gateway_services.empty_state_v2.create"),
714
+ appearance: "secondary",
715
+ "can-create": () => n.canCreate(),
716
+ "data-testid": "gateway-services-entity-empty-state",
717
+ description: o(a)("gateway_services.empty_state_v2.description"),
718
+ "learn-more": n.config.app === "konnect",
719
+ title: o(a)("gateway_services.empty_state_v2.title"),
720
+ "onClick:create": L,
721
+ "onClick:learnMore": m[3] || (m[3] = (s) => g.$emit("click:learn-more"))
722
+ }, Re({
723
+ image: v(() => [
724
+ S("div", Bt, [
725
+ d(o(st), {
726
+ color: o(Tt),
727
+ size: o(Rt)
728
+ }, null, 8, ["color", "size"])
729
+ ])
696
730
  ]),
697
- key: "0"
698
- } : void 0
699
- ]), 1032, ["action-button-text", "can-create", "description", "learn-more", "title"])
700
- ]),
731
+ _: 2
732
+ }, [
733
+ (e = n.config) != null && e.isControlPlaneGroup ? {
734
+ name: "message",
735
+ fn: v(() => [
736
+ z(F(o(a)("gateway_services.empty_state_v2.group")), 1)
737
+ ]),
738
+ key: "0"
739
+ } : void 0
740
+ ]), 1032, ["action-button-text", "can-create", "description", "learn-more", "title"])
741
+ ];
742
+ }),
701
743
  key: "1"
702
744
  } : void 0
703
745
  ]), 1032, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers", "onState"]),
704
- d(o(Ye), {
705
- action: Q.value.action,
706
- "entity-id": Q.value.id,
707
- "entity-name": Q.value.name,
708
- "entity-type": o(r)("glossary.gateway_services"),
709
- "on-confirm": ke,
710
- visible: z.value,
711
- onCancel: ae,
712
- onProceed: ae
746
+ d(o(yt), {
747
+ action: pe.value.action,
748
+ "entity-id": pe.value.id,
749
+ "entity-name": pe.value.name,
750
+ "entity-type": o(a)("glossary.gateway_services"),
751
+ "on-confirm": Ve,
752
+ visible: ne.value,
753
+ onCancel: _e,
754
+ onProceed: _e
713
755
  }, null, 8, ["action", "entity-id", "entity-name", "entity-type", "visible"]),
714
- d(o(et), {
715
- "action-pending": j.value,
716
- description: o(r)("actions.delete.description"),
717
- "entity-name": B.value && (B.value.name || B.value.id),
718
- "entity-type": o(tt).GatewayService,
719
- error: X.value,
720
- title: o(r)("actions.delete.title"),
721
- visible: K.value,
722
- onCancel: v,
723
- onProceed: R
756
+ d(o(_t), {
757
+ "action-pending": oe.value,
758
+ description: o(a)("actions.delete.description"),
759
+ "entity-name": N.value && (N.value.name || N.value.id),
760
+ "entity-type": o(bt).GatewayService,
761
+ error: ve.value,
762
+ title: o(a)("actions.delete.title"),
763
+ visible: J.value,
764
+ onCancel: k,
765
+ onProceed: H
724
766
  }, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
725
767
  ]);
726
768
  };
727
769
  }
728
- }), Be = (n, D) => {
729
- const p = n.__vccOpts || n;
730
- for (const [c, r] of D)
731
- p[c] = r;
732
- return p;
733
- }, Qt = /* @__PURE__ */ Be(St, [["__scopeId", "data-v-e23d7666"]]), It = { class: "kong-ui-entities-gateway-service-form" }, Tt = { key: 0 }, Et = { class: "gateway-service-form-traffic-label" }, Pt = { class: "gateway-service-form-margin-bottom" }, Ut = {
770
+ }), Ne = (n, M) => {
771
+ const y = n.__vccOpts || n;
772
+ for (const [p, a] of M)
773
+ y[p] = a;
774
+ return y;
775
+ }, $l = /* @__PURE__ */ Ne(Kt, [["__scopeId", "data-v-ee4f8a6d"]]), Wt = { class: "kong-ui-entities-gateway-service-form" }, Dt = { key: 0 }, qt = { class: "gateway-service-form-traffic-label" }, Gt = { class: "gateway-service-form-margin-bottom" }, Ot = {
734
776
  key: 0,
735
777
  class: "gateway-service-form-group-fields"
736
- }, Rt = {
778
+ }, Nt = {
737
779
  key: 1,
738
780
  class: "gateway-service-form-group-fields"
739
- }, Mt = { key: 0 }, $t = { class: "gateway-service-form-margin-top" }, xt = { class: "gateway-service-form-margin-bottom" }, At = { class: "gateway-service-form-margin-bottom" }, Ft = { class: "gateway-service-form-margin-bottom" }, Bt = { class: "gateway-service-form-margin-bottom" }, Lt = {
781
+ }, 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 = {
740
782
  key: 0,
741
783
  class: "gateway-service-form-margin-bottom"
742
- }, Dt = {
784
+ }, Yt = {
743
785
  key: 1,
744
786
  class: "gateway-service-form-margin-bottom"
745
- }, Gt = {
787
+ }, el = {
746
788
  key: 2,
747
789
  class: "gateway-service-form-margin-bottom"
748
- }, Kt = {
790
+ }, tl = {
749
791
  key: 0,
750
792
  class: "checkbox-aligned-radio"
751
- }, qt = {
793
+ }, ll = {
752
794
  key: 1,
753
795
  class: "checkbox-aligned-radio"
754
- }, Ot = /* @__PURE__ */ Te({
755
- __name: "GatewayServiceForm",
796
+ }, ol = /* @__PURE__ */ Le({
797
+ __name: "LegacyGatewayServiceForm",
756
798
  props: {
757
799
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
758
800
  config: {
@@ -774,9 +816,9 @@ const ve = {
774
816
  }
775
817
  },
776
818
  emits: ["update", "error", "url-valid:success", "url-valid:error", "loading", "model-updated"],
777
- setup(n, { expose: D, emit: p }) {
778
- var X;
779
- const c = p, r = n, $ = E(!0), N = xe(), { i18nT: q, i18n: { t: a } } = ve.useI18n(), { getMessageFromError: P } = ot(), { axiosInstance: C } = Ae((X = r.config) == null ? void 0 : X.axiosRequestConfig), ge = lt(), ye = b(() => se.form[r.config.app].edit), O = b(() => r.gatewayServiceId ? Me.Edit : Me.Create), _e = E(!1), H = b(() => !!r.gatewayServiceId), _ = E(H.value ? "protocol" : "url"), Y = ve.usePortFromProtocol(), G = E(""), be = b(() => !!G.value), e = Ue({
819
+ setup(n, { expose: M, emit: y }) {
820
+ var ve;
821
+ const p = y, a = n, b = W(!0), B = qe(), { i18nT: Z, i18n: { t: r } } = ge.useI18n(), { getMessageFromError: K } = Xe(), { axiosInstance: I } = Ge((ve = a.config) == null ? void 0 : ve.axiosRequestConfig), ie = Ye(), ue = 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 = xe({
780
822
  fields: {
781
823
  name: "",
782
824
  protocol: "http",
@@ -796,7 +838,7 @@ const ve = {
796
838
  },
797
839
  isReadonly: !1,
798
840
  errorMessage: ""
799
- }), k = Ue({
841
+ }), T = xe({
800
842
  name: "",
801
843
  protocol: "http",
802
844
  host: "",
@@ -812,543 +854,543 @@ const ve = {
812
854
  tls_verify_enabled: !1,
813
855
  tls_verify_value: !1,
814
856
  tags: ""
815
- }), ee = r.config.app === "konnect" || it({
816
- gatewayInfo: r.config.gatewayInfo,
857
+ }), se = a.config.app === "konnect" || et({
858
+ gatewayInfo: a.config.gatewayInfo,
817
859
  // 'ws' and 'wss' are not valid values for the protocol field in Gateway Community Edition or before Gateway Enterprise Edition 3.0
818
860
  supportedRange: {
819
861
  enterprise: ["3.0"]
820
862
  }
821
- }), he = [
863
+ }), Pe = [
822
864
  {
823
- label: a("gateway_services.form.fields.protocol.options.http"),
865
+ label: r("gateway_services.form.fields.protocol.options.http"),
824
866
  value: "http",
825
867
  group: "http"
826
868
  },
827
869
  {
828
- label: a("gateway_services.form.fields.protocol.options.https"),
870
+ label: r("gateway_services.form.fields.protocol.options.https"),
829
871
  value: "https",
830
872
  group: "http"
831
873
  },
832
874
  {
833
- label: a("gateway_services.form.fields.protocol.options.tcp"),
875
+ label: r("gateway_services.form.fields.protocol.options.tcp"),
834
876
  value: "tcp",
835
877
  group: "tcp"
836
878
  },
837
879
  {
838
- label: a("gateway_services.form.fields.protocol.options.tls"),
880
+ label: r("gateway_services.form.fields.protocol.options.tls"),
839
881
  value: "tls",
840
882
  group: "tcp"
841
883
  },
842
884
  {
843
- label: a("gateway_services.form.fields.protocol.options.tls_passthrough"),
885
+ label: r("gateway_services.form.fields.protocol.options.tls_passthrough"),
844
886
  value: "tls_passthrough",
845
887
  group: "tcp"
846
888
  },
847
889
  {
848
- label: a("gateway_services.form.fields.protocol.options.grpc"),
890
+ label: r("gateway_services.form.fields.protocol.options.grpc"),
849
891
  value: "grpc",
850
892
  group: "grpc"
851
893
  },
852
894
  {
853
- label: a("gateway_services.form.fields.protocol.options.grpcs"),
895
+ label: r("gateway_services.form.fields.protocol.options.grpcs"),
854
896
  value: "grpcs",
855
897
  group: "grpc"
856
898
  },
857
- ...ee ? [
899
+ ...se ? [
858
900
  {
859
- label: a("gateway_services.form.fields.protocol.options.ws"),
901
+ label: r("gateway_services.form.fields.protocol.options.ws"),
860
902
  value: "ws",
861
903
  group: "websocket"
862
904
  },
863
905
  {
864
- label: a("gateway_services.form.fields.protocol.options.wss"),
906
+ label: r("gateway_services.form.fields.protocol.options.wss"),
865
907
  value: "wss",
866
908
  group: "websocket"
867
909
  }
868
910
  ] : [],
869
911
  {
870
- label: a("gateway_services.form.fields.protocol.options.udp"),
912
+ label: r("gateway_services.form.fields.protocol.options.udp"),
871
913
  value: "udp",
872
914
  group: "udp"
873
915
  }
874
- ], re = { url: "url", protocol: "protocol" }, J = (t, i) => {
875
- i.value;
876
- }, W = (t) => t ? parseFloat(t) : 0, z = () => {
877
- $.value = !0, e.errorMessage = "", e.fields.host = k.host, e.fields.path = k.path, e.fields.port = k.port, e.fields.protocol = k.protocol, e.fields.url = k.url, e.fields.retries = k.retries, e.fields.connect_timeout = k.connect_timeout, e.fields.write_timeout = k.write_timeout, e.fields.read_timeout = k.read_timeout, e.fields.client_certificate = k.client_certificate, e.fields.ca_certificates = k.ca_certificates, e.fields.tls_verify_enabled = k.tls_verify_enabled, e.fields.tls_verify_value = k.tls_verify_value;
878
- }, T = () => {
879
- if (e.fields.url && _.value === "url")
916
+ ], t = { url: "url", protocol: "protocol" }, U = (i, f) => {
917
+ f.value;
918
+ }, ae = (i) => i ? parseFloat(i) : 0, ne = () => {
919
+ b.value = !0, l.errorMessage = "", l.fields.host = T.host, l.fields.path = T.path, l.fields.port = T.port, l.fields.protocol = T.protocol, l.fields.url = T.url, l.fields.retries = T.retries, l.fields.connect_timeout = T.connect_timeout, l.fields.write_timeout = T.write_timeout, l.fields.read_timeout = T.read_timeout, l.fields.client_certificate = T.client_certificate, l.fields.ca_certificates = T.ca_certificates, l.fields.tls_verify_enabled = T.tls_verify_enabled, l.fields.tls_verify_value = T.tls_verify_value;
920
+ }, q = () => {
921
+ if (l.fields.url && A.value === "url")
880
922
  try {
881
- const t = new URL(e.fields.url);
882
- e.errorMessage = "", e.fields.protocol = t.protocol.slice(0, -1), e.fields.host = t.hostname, e.fields.path = t.pathname;
883
- const i = Number(t.port);
884
- _e.value = !!i, e.fields.port = i || Y.getPortFromProtocol(e.fields.protocol), e.errorMessage = "", c("url-valid:success");
885
- } catch (t) {
886
- e.errorMessage = a("errors.urlErrorMessage"), c("url-valid:error", P(t));
923
+ const i = new URL(l.fields.url);
924
+ l.errorMessage = "", l.fields.protocol = i.protocol.slice(0, -1), l.fields.host = i.hostname, l.fields.path = i.pathname;
925
+ const f = Number(i.port);
926
+ ke.value = !!f, l.fields.port = f || Y.getPortFromProtocol(l.fields.protocol), l.errorMessage = "", p("url-valid:success");
927
+ } catch (i) {
928
+ l.errorMessage = r("errors.urlErrorMessage"), p("url-valid:error", K(i));
887
929
  }
888
930
  else
889
- c("url-valid:success"), e.errorMessage = "";
890
- }, Q = b(() => !["tcp", "tls", "tls_passthrough", "grpc", "grpcs", "udp"].includes(e.fields.protocol)), we = b(() => {
891
- if (_.value === "url")
931
+ p("url-valid:success"), l.errorMessage = "";
932
+ }, pe = h(() => !["tcp", "tls", "tls_passthrough", "grpc", "grpcs", "udp"].includes(l.fields.protocol)), ce = h(() => {
933
+ if (A.value === "url")
892
934
  return !0;
893
- const t = ["https", "wss", "tls"].includes(e.fields.protocol);
894
- return _.value === "protocol" && t;
895
- }), ae = b(() => {
896
- if (_.value === "url")
935
+ const i = ["https", "wss", "tls"].includes(l.fields.protocol);
936
+ return A.value === "protocol" && i;
937
+ }), _e = h(() => {
938
+ if (A.value === "url")
897
939
  return !0;
898
- const t = ["https", "tls"].includes(e.fields.protocol);
899
- return _.value === "protocol" && t;
900
- }), ke = b(() => {
901
- if (_.value === "url")
940
+ const i = ["https", "tls"].includes(l.fields.protocol);
941
+ return A.value === "protocol" && i;
942
+ }), Ve = h(() => {
943
+ if (A.value === "url")
902
944
  return !0;
903
- const t = ["https", "wss", "tls"].includes(e.fields.protocol);
904
- return _.value === "protocol" && t;
905
- }), Ce = (t) => {
906
- G.value = ge.utf8Name(t);
907
- }, te = b(() => H.value && JSON.stringify(e.fields) !== JSON.stringify(k) || _.value === "url" && !!e.fields.url || _.value === "protocol" && !!e.fields.host), ne = (t) => {
908
- var i, v, R;
909
- e.fields.name = (t == null ? void 0 : t.name) || "", e.fields.tags = ((i = t == null ? void 0 : t.tags) == null ? void 0 : i.join(", ")) || "", e.fields.protocol = (t == null ? void 0 : t.protocol) || "http", e.fields.path = (t == null ? void 0 : t.path) || "", e.fields.read_timeout = t != null && t.read_timeout || (t == null ? void 0 : t.read_timeout) === 0 ? t == null ? void 0 : t.read_timeout : 6e4, e.fields.retries = t != null && t.retries || (t == null ? void 0 : t.retries) === 0 ? t == null ? void 0 : t.retries : 5, e.fields.host = (t == null ? void 0 : t.host) || "", e.fields.connect_timeout = t != null && t.connect_timeout || (t == null ? void 0 : t.connect_timeout) === 0 ? t == null ? void 0 : t.connect_timeout : 6e4, e.fields.tls_verify_enabled = (t == null ? void 0 : t.tls_verify) !== "" && (t == null ? void 0 : t.tls_verify) !== null && (t == null ? void 0 : t.tls_verify) !== void 0, e.fields.tls_verify_value = t != null && t.tls_verify ? t == null ? void 0 : t.tls_verify : !1, e.fields.ca_certificates = ((v = t == null ? void 0 : t.ca_certificates) == null ? void 0 : v.join(",")) || "", e.fields.client_certificate = ((R = t == null ? void 0 : t.client_certificate) == null ? void 0 : R.id) || "", e.fields.write_timeout = t != null && t.write_timeout || (t == null ? void 0 : t.write_timeout) === 0 ? t == null ? void 0 : t.write_timeout : 6e4, e.fields.port = t != null && t.port || (t == null ? void 0 : t.port) === 0 ? t == null ? void 0 : t.port : 80, Object.assign(k, e.fields);
910
- }, ce = () => {
911
- N.push(r.config.cancelRoute);
912
- }, Ve = b(() => {
913
- var i, v;
914
- let t = `${r.config.apiBaseUrl}${se.form[r.config.app].validate}`;
915
- return r.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((i = r.config) == null ? void 0 : i.controlPlaneId) || "") : r.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (v = r.config) != null && v.workspace ? `/${r.config.workspace}` : "")), t = t.replace(/{id}/gi, r.gatewayServiceId), t;
916
- }), oe = b(() => {
917
- var i, v;
918
- let t = `${r.config.apiBaseUrl}${se.form[r.config.app][O.value]}`;
919
- return r.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((i = r.config) == null ? void 0 : i.controlPlaneId) || "") : r.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (v = r.config) != null && v.workspace ? `/${r.config.workspace}` : "")), t = t.replace(/{id}/gi, r.gatewayServiceId), t;
920
- }), B = (t) => {
921
- let i = "";
922
- t.url && (i = new URL(t.url).protocol), (["https", "wss", "tls"].includes(t.protocol) || ["https", "wss", "tls"].includes(i)) && (t.tls_verify = t.tls_verify_enabled ? t.tls_verify_value : null), delete t.tls_verify_enabled, delete t.tls_verify_value;
923
- }, K = b(() => {
924
- var i, v, R, V;
925
- const t = {
926
- name: e.fields.name || null,
927
- tags: e.fields.tags ? (R = (v = (i = e.fields.tags) == null ? void 0 : i.split(",")) == null ? void 0 : v.map((h) => String(h || "").trim())) == null ? void 0 : R.filter((h) => h !== "") : null,
928
- protocol: e.fields.protocol,
929
- path: e.fields.path || null,
930
- read_timeout: e.fields.read_timeout,
931
- retries: e.fields.retries,
932
- host: e.fields.host,
933
- connect_timeout: e.fields.connect_timeout,
934
- tls_verify_value: e.fields.tls_verify_value,
935
- tls_verify_enabled: e.fields.tls_verify_enabled,
936
- ca_certificates: e.fields.ca_certificates ? (V = e.fields.ca_certificates) == null ? void 0 : V.split(",").filter((h) => h !== "") : null,
937
- client_certificate: e.fields.client_certificate ? { id: e.fields.client_certificate } : null,
938
- write_timeout: e.fields.write_timeout,
939
- port: e.fields.port,
940
- url: e.fields.url
945
+ const i = ["https", "wss", "tls"].includes(l.fields.protocol);
946
+ return A.value === "protocol" && i;
947
+ }), Ce = (i) => {
948
+ ee.value = ie.utf8Name(i);
949
+ }, me = h(() => fe.value && JSON.stringify(l.fields) !== JSON.stringify(T) || A.value === "url" && !!l.fields.url || A.value === "protocol" && !!l.fields.host), be = (i) => {
950
+ var f, k, H;
951
+ 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(T, l.fields);
952
+ }, Se = () => {
953
+ B.push(a.config.cancelRoute);
954
+ }, de = h(() => {
955
+ var f, k;
956
+ let i = `${a.config.apiBaseUrl}${ye.form[a.config.app].validate}`;
957
+ return a.config.app === "konnect" ? i = i.replace(/{controlPlaneId}/gi, ((f = a.config) == null ? void 0 : f.controlPlaneId) || "") : a.config.app === "kongManager" && (i = i.replace(/\/{workspace}/gi, (k = a.config) != null && k.workspace ? `/${a.config.workspace}` : "")), i = i.replace(/{id}/gi, a.gatewayServiceId), i;
958
+ }), le = h(() => {
959
+ var f, k;
960
+ let i = `${a.config.apiBaseUrl}${ye.form[a.config.app][X.value]}`;
961
+ return a.config.app === "konnect" ? i = i.replace(/{controlPlaneId}/gi, ((f = a.config) == null ? void 0 : f.controlPlaneId) || "") : a.config.app === "kongManager" && (i = i.replace(/\/{workspace}/gi, (k = a.config) != null && k.workspace ? `/${a.config.workspace}` : "")), i = i.replace(/{id}/gi, a.gatewayServiceId), i;
962
+ }), N = (i) => {
963
+ let f = "";
964
+ 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;
965
+ }, J = h(() => {
966
+ var f, k, H, L;
967
+ const i = {
968
+ name: l.fields.name || null,
969
+ tags: l.fields.tags ? (H = (k = (f = l.fields.tags) == null ? void 0 : f.split(",")) == null ? void 0 : k.map(($) => String($ || "").trim())) == null ? void 0 : H.filter(($) => $ !== "") : null,
970
+ protocol: l.fields.protocol,
971
+ path: l.fields.path || null,
972
+ read_timeout: l.fields.read_timeout,
973
+ retries: l.fields.retries,
974
+ host: l.fields.host,
975
+ connect_timeout: l.fields.connect_timeout,
976
+ tls_verify_value: l.fields.tls_verify_value,
977
+ tls_verify_enabled: l.fields.tls_verify_enabled,
978
+ ca_certificates: l.fields.ca_certificates ? (L = l.fields.ca_certificates) == null ? void 0 : L.split(",").filter(($) => $ !== "") : null,
979
+ client_certificate: l.fields.client_certificate ? { id: l.fields.client_certificate } : null,
980
+ write_timeout: l.fields.write_timeout,
981
+ port: l.fields.port,
982
+ url: l.fields.url
941
983
  };
942
- return e.fields.client_certificate && ["https", "wss", "tls"].includes(e.fields.protocol) && (t.client_certificate = { id: e.fields.client_certificate }), e.fields.tls_verify_enabled && ["https", "wss", "tls"].includes(e.fields.protocol) && (t.tls_verify = e.fields.tls_verify_value), Q.value || (t.path = null), O.value === "create" ? _.value === "url" ? (delete t.protocol, delete t.host, delete t.path, r.config.app === "konnect" && delete t.port) : delete t.url : O.value === "edit" && delete t.url, t;
943
- }), j = async () => {
944
- var t, i, v, R;
984
+ 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;
985
+ }), oe = async () => {
986
+ var i, f, k, H;
945
987
  try {
946
- e.isReadonly = !0, T();
947
- const V = K.value;
948
- B(V);
949
- let h;
950
- if (await C.post(Ve.value, V), O.value === "create" ? h = await C.post(oe.value, V) : O.value === "edit" && (h = ((t = r.config) == null ? void 0 : t.app) === "konnect" ? await C.put(oe.value, V) : await C.patch(oe.value, V)), h) {
951
- const { data: l } = h;
952
- e.fields.name = (l == null ? void 0 : l.name) || "", e.fields.port = l.port || Y.getPortFromProtocol(l.protocol), e.fields.protocol = (l == null ? void 0 : l.protocol) || "http", e.fields.host = (l == null ? void 0 : l.host) || "", e.fields.path = (l == null ? void 0 : l.path) || "", e.fields.url = (l == null ? void 0 : l.url) || "", e.fields.retries = l != null && l.retries || (l == null ? void 0 : l.retries) === 0 ? l == null ? void 0 : l.retries : 5, e.fields.connect_timeout = l != null && l.connect_timeout || (l == null ? void 0 : l.connect_timeout) === 0 ? l == null ? void 0 : l.connect_timeout : 6e4, e.fields.write_timeout = l != null && l.write_timeout || (l == null ? void 0 : l.write_timeout) === 0 ? l == null ? void 0 : l.write_timeout : 6e4, e.fields.read_timeout = l != null && l.read_timeout || (l == null ? void 0 : l.read_timeout) === 0 ? l == null ? void 0 : l.read_timeout : 6e4, e.fields.client_certificate = ((i = l == null ? void 0 : l.client_certificate) == null ? void 0 : i.id) || "", e.fields.ca_certificates = (v = l == null ? void 0 : l.ca_certificates) != null && v.length ? l == null ? void 0 : l.ca_certificates.join(",") : "", e.fields.tls_verify_enabled = (l == null ? void 0 : l.tls_verify) !== "" && (l == null ? void 0 : l.tls_verify) !== null && (l == null ? void 0 : l.tls_verify) !== void 0, e.fields.tls_verify_value = e.fields.tls_verify_enabled && (l == null ? void 0 : l.tls_verify), e.fields.tags = (R = l == null ? void 0 : l.tags) != null && R.length ? l.tags.join(", ") : "", Object.assign(k, e.fields), c("update", h == null ? void 0 : h.data);
988
+ l.isReadonly = !0, q();
989
+ const L = J.value;
990
+ N(L);
991
+ let $;
992
+ if (await I.post(de.value, L), X.value === "create" ? $ = await I.post(le.value, L) : X.value === "edit" && ($ = ((i = a.config) == null ? void 0 : i.app) === "konnect" ? await I.put(le.value, L) : await I.patch(le.value, L)), $) {
993
+ const { data: c } = $;
994
+ 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(T, l.fields), p("update", $ == null ? void 0 : $.data);
953
995
  }
954
- return h;
955
- } catch (V) {
956
- e.errorMessage = P(V), c("error", V);
996
+ return $;
997
+ } catch (L) {
998
+ l.errorMessage = K(L), p("error", L);
957
999
  } finally {
958
- e.isReadonly = !1;
1000
+ l.isReadonly = !1;
959
1001
  }
960
1002
  };
961
- return Ie(() => r.gatewayServiceId, () => {
962
- Object.assign(e.fields, k);
963
- }), Ie(e.fields, (t) => {
964
- e.fields.port = Y.getPortFromProtocol(t.protocol, String(t.port)), c("model-updated", K.value);
965
- }), De(() => {
966
- c("model-updated", K.value);
967
- }), D({
968
- validateUrl: T,
969
- getPayload: K,
970
- saveFormData: j,
971
- canSubmit: te,
972
- initForm: ne
973
- }), (t, i) => {
974
- const v = F("KInput"), R = F("KLabel"), V = F("KRadio"), h = F("KSelect"), l = F("KCheckbox"), u = F("KCollapse");
975
- return S(), U("div", It, [
976
- d(o(st), {
977
- "can-submit": te.value,
1003
+ return Ue(() => a.gatewayServiceId, () => {
1004
+ Object.assign(l.fields, T);
1005
+ }), Ue(l.fields, (i) => {
1006
+ l.fields.port = Y.getPortFromProtocol(i.protocol, String(i.port)), p("model-updated", J.value);
1007
+ }), Je(() => {
1008
+ p("model-updated", J.value);
1009
+ }), M({
1010
+ validateUrl: q,
1011
+ getPayload: J,
1012
+ saveFormData: oe,
1013
+ canSubmit: me,
1014
+ initForm: be
1015
+ }), (i, f) => {
1016
+ const k = D("KInput"), H = D("KLabel"), L = D("KRadio"), $ = D("KSelect"), c = D("KCheckbox"), g = D("KCollapse");
1017
+ return C(), E("div", Wt, [
1018
+ d(o(tt), {
1019
+ "can-submit": me.value,
978
1020
  config: n.config,
979
1021
  "edit-id": n.gatewayServiceId,
980
- "entity-type": o(Fe).GatewayService,
981
- "error-message": e.errorMessage,
982
- "fetch-url": ye.value,
983
- "form-fields": K.value,
984
- "is-readonly": e.isReadonly,
985
- onCancel: ce,
986
- "onFetch:error": i[25] || (i[25] = (s) => t.$emit("error", s)),
987
- "onFetch:success": ne,
988
- onLoading: i[26] || (i[26] = (s) => t.$emit("loading", s)),
989
- onSubmit: j
1022
+ "entity-type": o(Oe).GatewayService,
1023
+ "error-message": l.errorMessage,
1024
+ "fetch-url": ue.value,
1025
+ "form-fields": J.value,
1026
+ "is-readonly": l.isReadonly,
1027
+ onCancel: Se,
1028
+ "onFetch:error": f[25] || (f[25] = (m) => i.$emit("error", m)),
1029
+ "onFetch:success": be,
1030
+ onLoading: f[26] || (f[26] = (m) => i.$emit("loading", m)),
1031
+ onSubmit: oe
990
1032
  }, {
991
- "form-actions": f(() => [
992
- Ge(t.$slots, "form-actions", {
993
- canSubmit: te.value,
994
- cancel: ce,
995
- submit: j
1033
+ "form-actions": v(() => [
1034
+ Qe(i.$slots, "form-actions", {
1035
+ canSubmit: me.value,
1036
+ cancel: Se,
1037
+ submit: oe
996
1038
  }, void 0, !0)
997
1039
  ]),
998
- default: f(() => [
999
- d(o($e), {
1000
- description: o(a)("gateway_services.form.sections.general.description"),
1040
+ default: v(() => [
1041
+ d(o(Be), {
1042
+ description: o(r)("gateway_services.form.sections.general.description"),
1001
1043
  "hide-info-header": n.hideSectionsInfo,
1002
- title: o(a)("gateway_services.form.sections.general.title")
1044
+ title: o(r)("gateway_services.form.sections.general.title")
1003
1045
  }, {
1004
- default: f(() => [
1005
- d(v, {
1006
- modelValue: e.fields.name,
1007
- "onUpdate:modelValue": i[0] || (i[0] = (s) => e.fields.name = s),
1046
+ default: v(() => [
1047
+ d(k, {
1048
+ modelValue: l.fields.name,
1049
+ "onUpdate:modelValue": f[0] || (f[0] = (m) => l.fields.name = m),
1008
1050
  modelModifiers: { trim: !0 },
1009
1051
  autocomplete: "off",
1010
1052
  "data-testid": "gateway-service-name-input",
1011
- error: be.value,
1012
- "error-message": G.value,
1013
- label: o(a)("gateway_services.form.fields.name.label"),
1053
+ error: re.value,
1054
+ "error-message": ee.value,
1055
+ label: o(r)("gateway_services.form.fields.name.label"),
1014
1056
  "label-attributes": {
1015
- info: o(a)("gateway_services.form.fields.name.tooltip"),
1057
+ info: o(r)("gateway_services.form.fields.name.tooltip"),
1016
1058
  tooltipAttributes: { maxWidth: "400" }
1017
1059
  },
1018
1060
  name: "name",
1019
- placeholder: o(a)("gateway_services.form.fields.name.placeholder"),
1020
- readonly: e.isReadonly,
1061
+ placeholder: o(r)("gateway_services.form.fields.name.placeholder"),
1062
+ readonly: l.isReadonly,
1021
1063
  type: "text",
1022
1064
  onInput: Ce
1023
1065
  }, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder", "readonly"]),
1024
- d(v, {
1025
- modelValue: e.fields.tags,
1026
- "onUpdate:modelValue": i[1] || (i[1] = (s) => e.fields.tags = s),
1066
+ d(k, {
1067
+ modelValue: l.fields.tags,
1068
+ "onUpdate:modelValue": f[1] || (f[1] = (m) => l.fields.tags = m),
1027
1069
  modelModifiers: { trim: !0 },
1028
1070
  autocomplete: "off",
1029
1071
  "data-testid": "gateway-service-tags-input",
1030
- help: o(a)("gateway_services.form.fields.tags.help"),
1031
- label: o(a)("gateway_services.form.fields.tags.label"),
1072
+ help: o(r)("gateway_services.form.fields.tags.help"),
1073
+ label: o(r)("gateway_services.form.fields.tags.label"),
1032
1074
  "label-attributes": {
1033
- info: o(a)("gateway_services.form.fields.tags.tooltip"),
1075
+ info: o(r)("gateway_services.form.fields.tags.tooltip"),
1034
1076
  tooltipAttributes: { maxWidth: "400" }
1035
1077
  },
1036
1078
  name: "tags",
1037
- placeholder: o(a)("gateway_services.form.fields.tags.placeholder"),
1038
- readonly: e.isReadonly,
1079
+ placeholder: o(r)("gateway_services.form.fields.tags.placeholder"),
1080
+ readonly: l.isReadonly,
1039
1081
  type: "text"
1040
1082
  }, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])
1041
1083
  ]),
1042
1084
  _: 1
1043
1085
  }, 8, ["description", "hide-info-header", "title"]),
1044
- d(o($e), {
1045
- description: o(a)("gateway_services.form.sections.keys.description"),
1086
+ d(o(Be), {
1087
+ description: o(r)("gateway_services.form.sections.keys.description"),
1046
1088
  "hide-info-header": n.hideSectionsInfo,
1047
- title: o(a)("gateway_services.form.sections.keys.title")
1089
+ title: o(r)("gateway_services.form.sections.keys.title")
1048
1090
  }, {
1049
- default: f(() => [
1050
- H.value ? L("", !0) : (S(), U("div", Tt, [
1051
- w("div", Et, [
1052
- d(R, { required: "" }, {
1053
- default: f(() => [
1054
- M(y(o(a)("gateway_services.form.sections.keys.checkedGroupLabel")), 1)
1091
+ default: v(() => [
1092
+ fe.value ? x("", !0) : (C(), E("div", Dt, [
1093
+ S("div", qt, [
1094
+ d(H, { required: "" }, {
1095
+ default: v(() => [
1096
+ z(F(o(r)("gateway_services.form.sections.keys.checkedGroupLabel")), 1)
1055
1097
  ]),
1056
1098
  _: 1
1057
1099
  })
1058
1100
  ]),
1059
- w("div", Pt, [
1060
- d(V, {
1061
- modelValue: _.value,
1062
- "onUpdate:modelValue": i[2] || (i[2] = (s) => _.value = s),
1101
+ S("div", Gt, [
1102
+ d(L, {
1103
+ modelValue: A.value,
1104
+ "onUpdate:modelValue": f[2] || (f[2] = (m) => A.value = m),
1063
1105
  "data-testid": "gateway-service-url-radio",
1064
- "selected-value": re.url,
1065
- onChange: z
1106
+ "selected-value": t.url,
1107
+ onChange: ne
1066
1108
  }, {
1067
- default: f(() => [
1068
- M(y(o(a)("gateway_services.form.sections.keys.urlLabel")), 1)
1109
+ default: v(() => [
1110
+ z(F(o(r)("gateway_services.form.sections.keys.urlLabel")), 1)
1069
1111
  ]),
1070
1112
  _: 1
1071
1113
  }, 8, ["modelValue", "selected-value"])
1072
1114
  ]),
1073
- _.value === "url" ? (S(), U("div", Ut, [
1074
- d(v, {
1075
- modelValue: e.fields.url,
1076
- "onUpdate:modelValue": i[3] || (i[3] = (s) => e.fields.url = s),
1115
+ A.value === "url" ? (C(), E("div", Ot, [
1116
+ d(k, {
1117
+ modelValue: l.fields.url,
1118
+ "onUpdate:modelValue": f[3] || (f[3] = (m) => l.fields.url = m),
1077
1119
  modelModifiers: { trim: !0 },
1078
1120
  class: "gateway-service-url-input gateway-service-form-margin-bottom",
1079
1121
  "data-testid": "gateway-service-url-input",
1080
- label: o(a)("gateway_services.form.fields.upstream_url.label"),
1122
+ label: o(r)("gateway_services.form.fields.upstream_url.label"),
1081
1123
  "label-attributes": {
1082
- info: n.config.app === "konnect" ? o(a)("gateway_services.form.fields.upstream_url.tooltip_for_konnect") : o(a)("gateway_services.form.fields.upstream_url.tooltip_for_km"),
1124
+ info: n.config.app === "konnect" ? o(r)("gateway_services.form.fields.upstream_url.tooltip_for_konnect") : o(r)("gateway_services.form.fields.upstream_url.tooltip_for_km"),
1083
1125
  tooltipAttributes: { maxWidth: "400" }
1084
1126
  },
1085
1127
  name: "url",
1086
- placeholder: o(a)("gateway_services.form.fields.upstream_url.placeholder"),
1128
+ placeholder: o(r)("gateway_services.form.fields.upstream_url.placeholder"),
1087
1129
  required: ""
1088
1130
  }, null, 8, ["modelValue", "label", "label-attributes", "placeholder"])
1089
- ])) : L("", !0),
1090
- d(V, {
1091
- modelValue: _.value,
1092
- "onUpdate:modelValue": i[4] || (i[4] = (s) => _.value = s),
1131
+ ])) : x("", !0),
1132
+ d(L, {
1133
+ modelValue: A.value,
1134
+ "onUpdate:modelValue": f[4] || (f[4] = (m) => A.value = m),
1093
1135
  "checked-group": "protocol",
1094
1136
  "data-testid": "gateway-service-protocol-radio",
1095
- "selected-value": re.protocol,
1096
- onChange: z
1137
+ "selected-value": t.protocol,
1138
+ onChange: ne
1097
1139
  }, {
1098
- default: f(() => [
1099
- M(y(o(a)("gateway_services.form.sections.keys.checkedGroupAltLabel")), 1)
1140
+ default: v(() => [
1141
+ z(F(o(r)("gateway_services.form.sections.keys.checkedGroupAltLabel")), 1)
1100
1142
  ]),
1101
1143
  _: 1
1102
1144
  }, 8, ["modelValue", "selected-value"])
1103
1145
  ])),
1104
- _.value === "protocol" || H.value ? (S(), U("div", Rt, [
1105
- d(h, {
1106
- modelValue: e.fields.protocol,
1107
- "onUpdate:modelValue": i[5] || (i[5] = (s) => e.fields.protocol = s),
1146
+ A.value === "protocol" || fe.value ? (C(), E("div", Nt, [
1147
+ d($, {
1148
+ modelValue: l.fields.protocol,
1149
+ "onUpdate:modelValue": f[5] || (f[5] = (m) => l.fields.protocol = m),
1108
1150
  "data-testid": "gateway-service-protocol-select",
1109
- items: he,
1110
- label: o(a)("gateway_services.form.fields.protocol.label"),
1151
+ items: Pe,
1152
+ label: o(r)("gateway_services.form.fields.protocol.label"),
1111
1153
  "label-attributes": {
1112
- info: o(a)("gateway_services.form.fields.protocol.tooltip"),
1154
+ info: o(r)("gateway_services.form.fields.protocol.tooltip"),
1113
1155
  tooltipAttributes: { maxWidth: "400" }
1114
1156
  },
1115
- readonly: e.isReadonly,
1157
+ readonly: l.isReadonly,
1116
1158
  required: "",
1117
1159
  width: "100%",
1118
- onSelected: i[6] || (i[6] = (s) => J(e.fields.protocol, s))
1160
+ onSelected: f[6] || (f[6] = (m) => U(l.fields.protocol, m))
1119
1161
  }, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
1120
- d(v, {
1121
- modelValue: e.fields.host,
1122
- "onUpdate:modelValue": i[7] || (i[7] = (s) => e.fields.host = s),
1162
+ d(k, {
1163
+ modelValue: l.fields.host,
1164
+ "onUpdate:modelValue": f[7] || (f[7] = (m) => l.fields.host = m),
1123
1165
  modelModifiers: { trim: !0 },
1124
1166
  class: "gateway-service-form-margin-top",
1125
1167
  "data-testid": "gateway-service-host-input",
1126
- label: o(a)("gateway_services.form.fields.host.label"),
1168
+ label: o(r)("gateway_services.form.fields.host.label"),
1127
1169
  "label-attributes": {
1128
- info: o(a)("gateway_services.form.fields.host.tooltip"),
1170
+ info: o(r)("gateway_services.form.fields.host.tooltip"),
1129
1171
  tooltipAttributes: { maxWidth: "400" }
1130
1172
  },
1131
1173
  name: "host",
1132
- placeholder: o(a)("gateway_services.form.fields.host.placeholder"),
1174
+ placeholder: o(r)("gateway_services.form.fields.host.placeholder"),
1133
1175
  required: ""
1134
1176
  }, null, 8, ["modelValue", "label", "label-attributes", "placeholder"]),
1135
- Q.value ? (S(), U("div", Mt, [
1136
- d(v, {
1137
- modelValue: e.fields.path,
1138
- "onUpdate:modelValue": i[8] || (i[8] = (s) => e.fields.path = s),
1177
+ pe.value ? (C(), E("div", jt, [
1178
+ d(k, {
1179
+ modelValue: l.fields.path,
1180
+ "onUpdate:modelValue": f[8] || (f[8] = (m) => l.fields.path = m),
1139
1181
  modelModifiers: { trim: !0 },
1140
1182
  class: "gateway-service-form-margin-top",
1141
1183
  "data-testid": "gateway-service-path-input",
1142
- label: o(a)("gateway_services.form.fields.path.label"),
1184
+ label: o(r)("gateway_services.form.fields.path.label"),
1143
1185
  "label-attributes": {
1144
- info: o(a)("gateway_services.form.fields.path.tooltip"),
1186
+ info: o(r)("gateway_services.form.fields.path.tooltip"),
1145
1187
  tooltipAttributes: { maxWidth: "400" }
1146
1188
  },
1147
1189
  name: "path",
1148
- placeholder: o(a)("gateway_services.form.fields.path.placeholder")
1190
+ placeholder: o(r)("gateway_services.form.fields.path.placeholder")
1149
1191
  }, null, 8, ["modelValue", "label", "label-attributes", "placeholder"])
1150
- ])) : L("", !0),
1151
- d(v, {
1152
- modelValue: e.fields.port,
1192
+ ])) : x("", !0),
1193
+ d(k, {
1194
+ modelValue: l.fields.port,
1153
1195
  "onUpdate:modelValue": [
1154
- i[9] || (i[9] = (s) => e.fields.port = s),
1155
- i[10] || (i[10] = () => {
1156
- e.fields.port = W(e.fields.port + "");
1196
+ f[9] || (f[9] = (m) => l.fields.port = m),
1197
+ f[10] || (f[10] = () => {
1198
+ l.fields.port = ae(l.fields.port + "");
1157
1199
  })
1158
1200
  ],
1159
1201
  class: "gateway-service-form-margin-top",
1160
1202
  "data-testid": "gateway-service-port-input",
1161
- label: o(a)("gateway_services.form.fields.port.label"),
1203
+ label: o(r)("gateway_services.form.fields.port.label"),
1162
1204
  "label-attributes": {
1163
- info: o(a)("gateway_services.form.fields.port.tooltip"),
1205
+ info: o(r)("gateway_services.form.fields.port.tooltip"),
1164
1206
  tooltipAttributes: { maxWidth: "400" }
1165
1207
  },
1166
1208
  name: "port",
1167
1209
  type: "number"
1168
1210
  }, null, 8, ["modelValue", "label", "label-attributes"])
1169
- ])) : L("", !0),
1170
- d(u, {
1171
- modelValue: $.value,
1172
- "onUpdate:modelValue": i[24] || (i[24] = (s) => $.value = s),
1211
+ ])) : x("", !0),
1212
+ d(g, {
1213
+ modelValue: b.value,
1214
+ "onUpdate:modelValue": f[24] || (f[24] = (m) => b.value = m),
1173
1215
  "data-testid": "advanced-fields-collapse",
1174
1216
  "trigger-alignment": "leading",
1175
- "trigger-label": o(a)("gateway_services.form.sections.keys.viewAdvancedFields")
1217
+ "trigger-label": o(r)("gateway_services.form.sections.keys.viewAdvancedFields")
1176
1218
  }, {
1177
- default: f(() => [
1178
- w("div", $t, [
1179
- w("div", xt, [
1180
- d(v, {
1181
- modelValue: e.fields.retries,
1219
+ default: v(() => [
1220
+ S("div", zt, [
1221
+ S("div", Ht, [
1222
+ d(k, {
1223
+ modelValue: l.fields.retries,
1182
1224
  "onUpdate:modelValue": [
1183
- i[11] || (i[11] = (s) => e.fields.retries = s),
1184
- i[12] || (i[12] = () => {
1185
- e.fields.retries = W(e.fields.retries + "");
1225
+ f[11] || (f[11] = (m) => l.fields.retries = m),
1226
+ f[12] || (f[12] = () => {
1227
+ l.fields.retries = ae(l.fields.retries + "");
1186
1228
  })
1187
1229
  ],
1188
1230
  autocomplete: "off",
1189
1231
  "data-testid": "gateway-service-retries-input",
1190
- label: o(a)("gateway_services.form.fields.retries.label"),
1232
+ label: o(r)("gateway_services.form.fields.retries.label"),
1191
1233
  "label-attributes": {
1192
- info: o(a)("gateway_services.form.fields.retries.tooltip"),
1234
+ info: o(r)("gateway_services.form.fields.retries.tooltip"),
1193
1235
  tooltipAttributes: { maxWidth: "400" }
1194
1236
  },
1195
1237
  name: "retries",
1196
- readonly: e.isReadonly,
1238
+ readonly: l.isReadonly,
1197
1239
  type: "number"
1198
1240
  }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
1199
1241
  ]),
1200
- w("div", At, [
1201
- d(v, {
1202
- modelValue: e.fields.connect_timeout,
1242
+ S("div", Zt, [
1243
+ d(k, {
1244
+ modelValue: l.fields.connect_timeout,
1203
1245
  "onUpdate:modelValue": [
1204
- i[13] || (i[13] = (s) => e.fields.connect_timeout = s),
1205
- i[14] || (i[14] = () => {
1206
- e.fields.connect_timeout = W(e.fields.connect_timeout + "");
1246
+ f[13] || (f[13] = (m) => l.fields.connect_timeout = m),
1247
+ f[14] || (f[14] = () => {
1248
+ l.fields.connect_timeout = ae(l.fields.connect_timeout + "");
1207
1249
  })
1208
1250
  ],
1209
1251
  autocomplete: "off",
1210
1252
  "data-testid": "gateway-service-connTimeout-input",
1211
- label: o(a)("gateway_services.form.fields.connect_timeout.label"),
1253
+ label: o(r)("gateway_services.form.fields.connect_timeout.label"),
1212
1254
  "label-attributes": {
1213
- info: o(a)("gateway_services.form.fields.connect_timeout.tooltip"),
1255
+ info: o(r)("gateway_services.form.fields.connect_timeout.tooltip"),
1214
1256
  tooltipAttributes: { maxWidth: "400" }
1215
1257
  },
1216
1258
  name: "connTimeout",
1217
- readonly: e.isReadonly,
1259
+ readonly: l.isReadonly,
1218
1260
  type: "number"
1219
1261
  }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
1220
1262
  ]),
1221
- w("div", Ft, [
1222
- d(v, {
1223
- modelValue: e.fields.write_timeout,
1263
+ S("div", Jt, [
1264
+ d(k, {
1265
+ modelValue: l.fields.write_timeout,
1224
1266
  "onUpdate:modelValue": [
1225
- i[15] || (i[15] = (s) => e.fields.write_timeout = s),
1226
- i[16] || (i[16] = () => {
1227
- e.fields.write_timeout = W(e.fields.write_timeout + "");
1267
+ f[15] || (f[15] = (m) => l.fields.write_timeout = m),
1268
+ f[16] || (f[16] = () => {
1269
+ l.fields.write_timeout = ae(l.fields.write_timeout + "");
1228
1270
  })
1229
1271
  ],
1230
1272
  autocomplete: "off",
1231
1273
  "data-testid": "gateway-service-writeTimeout-input",
1232
- label: o(a)("gateway_services.form.fields.write_timeout.label"),
1274
+ label: o(r)("gateway_services.form.fields.write_timeout.label"),
1233
1275
  "label-attributes": {
1234
- info: o(a)("gateway_services.form.fields.write_timeout.tooltip"),
1276
+ info: o(r)("gateway_services.form.fields.write_timeout.tooltip"),
1235
1277
  tooltipAttributes: { maxWidth: "400" }
1236
1278
  },
1237
1279
  name: "writeTimeout",
1238
- readonly: e.isReadonly,
1280
+ readonly: l.isReadonly,
1239
1281
  type: "number"
1240
1282
  }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
1241
1283
  ]),
1242
- w("div", Bt, [
1243
- d(v, {
1244
- modelValue: e.fields.read_timeout,
1284
+ S("div", Qt, [
1285
+ d(k, {
1286
+ modelValue: l.fields.read_timeout,
1245
1287
  "onUpdate:modelValue": [
1246
- i[17] || (i[17] = (s) => e.fields.read_timeout = s),
1247
- i[18] || (i[18] = () => {
1248
- e.fields.read_timeout = W(e.fields.read_timeout + "");
1288
+ f[17] || (f[17] = (m) => l.fields.read_timeout = m),
1289
+ f[18] || (f[18] = () => {
1290
+ l.fields.read_timeout = ae(l.fields.read_timeout + "");
1249
1291
  })
1250
1292
  ],
1251
1293
  autocomplete: "off",
1252
1294
  "data-testid": "gateway-service-readTimeout-input",
1253
- label: o(a)("gateway_services.form.fields.read_timeout.label"),
1295
+ label: o(r)("gateway_services.form.fields.read_timeout.label"),
1254
1296
  "label-attributes": {
1255
- info: o(a)("gateway_services.form.fields.read_timeout.tooltip"),
1297
+ info: o(r)("gateway_services.form.fields.read_timeout.tooltip"),
1256
1298
  tooltipAttributes: { maxWidth: "400" }
1257
1299
  },
1258
1300
  name: "readTimeout",
1259
- readonly: e.isReadonly,
1301
+ readonly: l.isReadonly,
1260
1302
  type: "number"
1261
1303
  }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
1262
1304
  ]),
1263
- we.value ? (S(), U("div", Lt, [
1264
- d(v, {
1265
- modelValue: e.fields.client_certificate,
1266
- "onUpdate:modelValue": i[19] || (i[19] = (s) => e.fields.client_certificate = s),
1305
+ ce.value ? (C(), E("div", Xt, [
1306
+ d(k, {
1307
+ modelValue: l.fields.client_certificate,
1308
+ "onUpdate:modelValue": f[19] || (f[19] = (m) => l.fields.client_certificate = m),
1267
1309
  modelModifiers: { trim: !0 },
1268
1310
  autocomplete: "off",
1269
1311
  "data-testid": "gateway-service-clientCert-input",
1270
- label: o(a)("gateway_services.form.fields.client_certificate.label"),
1312
+ label: o(r)("gateway_services.form.fields.client_certificate.label"),
1271
1313
  "label-attributes": {
1272
- info: o(a)("gateway_services.form.fields.client_certificate.tooltip"),
1314
+ info: o(r)("gateway_services.form.fields.client_certificate.tooltip"),
1273
1315
  tooltipAttributes: { maxWidth: "400" }
1274
1316
  },
1275
1317
  name: "clientCert",
1276
- placeholder: o(a)("gateway_services.form.fields.client_certificate.placeholder"),
1277
- readonly: e.isReadonly,
1318
+ placeholder: o(r)("gateway_services.form.fields.client_certificate.placeholder"),
1319
+ readonly: l.isReadonly,
1278
1320
  type: "text"
1279
1321
  }, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"])
1280
- ])) : L("", !0),
1281
- ae.value ? (S(), U("div", Dt, [
1282
- d(v, {
1283
- modelValue: e.fields.ca_certificates,
1284
- "onUpdate:modelValue": i[20] || (i[20] = (s) => e.fields.ca_certificates = s),
1322
+ ])) : x("", !0),
1323
+ _e.value ? (C(), E("div", Yt, [
1324
+ d(k, {
1325
+ modelValue: l.fields.ca_certificates,
1326
+ "onUpdate:modelValue": f[20] || (f[20] = (m) => l.fields.ca_certificates = m),
1285
1327
  modelModifiers: { trim: !0 },
1286
1328
  autocomplete: "off",
1287
1329
  "data-testid": "gateway-service-ca-certs-input",
1288
- label: o(a)("gateway_services.form.fields.ca_certificates.label"),
1330
+ label: o(r)("gateway_services.form.fields.ca_certificates.label"),
1289
1331
  "label-attributes": { tooltipAttributes: { maxWidth: "400" } },
1290
- placeholder: o(a)("gateway_services.form.fields.ca_certificates.placeholder"),
1291
- readonly: e.isReadonly,
1332
+ placeholder: o(r)("gateway_services.form.fields.ca_certificates.placeholder"),
1333
+ readonly: l.isReadonly,
1292
1334
  type: "text"
1293
1335
  }, {
1294
- "label-tooltip": f(() => [
1295
- d(o(q), {
1336
+ "label-tooltip": v(() => [
1337
+ d(o(Z), {
1296
1338
  keypath: "gateway_services.form.fields.ca_certificates.tooltip",
1297
1339
  scope: "global"
1298
1340
  }, {
1299
- code1: f(() => [
1300
- w("code", null, y(o(a)("gateway_services.form.fields.ca_certificates.code1")), 1)
1341
+ code1: v(() => [
1342
+ S("code", null, F(o(r)("gateway_services.form.fields.ca_certificates.code1")), 1)
1301
1343
  ]),
1302
- code2: f(() => [
1303
- w("code", null, y(o(a)("gateway_services.form.fields.ca_certificates.code2")), 1)
1344
+ code2: v(() => [
1345
+ S("code", null, F(o(r)("gateway_services.form.fields.ca_certificates.code2")), 1)
1304
1346
  ]),
1305
1347
  _: 1
1306
1348
  })
1307
1349
  ]),
1308
1350
  _: 1
1309
1351
  }, 8, ["modelValue", "label", "placeholder", "readonly"])
1310
- ])) : L("", !0),
1311
- ke.value ? (S(), U("div", Gt, [
1312
- d(l, {
1313
- modelValue: e.fields.tls_verify_enabled,
1314
- "onUpdate:modelValue": i[21] || (i[21] = (s) => e.fields.tls_verify_enabled = s),
1352
+ ])) : x("", !0),
1353
+ Ve.value ? (C(), E("div", el, [
1354
+ d(c, {
1355
+ modelValue: l.fields.tls_verify_enabled,
1356
+ "onUpdate:modelValue": f[21] || (f[21] = (m) => l.fields.tls_verify_enabled = m),
1315
1357
  "data-testid": "gateway-service-tls-verify-checkbox",
1316
- description: o(a)("gateway_services.form.fields.tls_verify_enabled.help"),
1317
- label: o(a)("gateway_services.form.fields.tls_verify_enabled.label"),
1358
+ description: o(r)("gateway_services.form.fields.tls_verify_enabled.help"),
1359
+ label: o(r)("gateway_services.form.fields.tls_verify_enabled.label"),
1318
1360
  "label-attributes": { tooltipAttributes: { maxWidth: "400" } }
1319
1361
  }, {
1320
- tooltip: f(() => [
1321
- d(o(q), {
1362
+ tooltip: v(() => [
1363
+ d(o(Z), {
1322
1364
  keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
1323
1365
  scope: "global"
1324
1366
  }, {
1325
- code1: f(() => [
1326
- w("code", null, y(o(a)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
1367
+ code1: v(() => [
1368
+ S("code", null, F(o(r)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
1327
1369
  ]),
1328
1370
  _: 1
1329
1371
  })
1330
1372
  ]),
1331
1373
  _: 1
1332
1374
  }, 8, ["modelValue", "description", "label"]),
1333
- e.fields.tls_verify_enabled ? (S(), U("div", Kt, [
1334
- d(V, {
1335
- modelValue: e.fields.tls_verify_value,
1336
- "onUpdate:modelValue": i[22] || (i[22] = (s) => e.fields.tls_verify_value = s),
1375
+ l.fields.tls_verify_enabled ? (C(), E("div", tl, [
1376
+ d(L, {
1377
+ modelValue: l.fields.tls_verify_value,
1378
+ "onUpdate:modelValue": f[22] || (f[22] = (m) => l.fields.tls_verify_value = m),
1337
1379
  "data-testid": "gateway-service-tls-verify-true-option",
1338
- label: o(a)("gateway_services.form.fields.tls_verify_option.true.label"),
1380
+ label: o(r)("gateway_services.form.fields.tls_verify_option.true.label"),
1339
1381
  "selected-value": !0
1340
1382
  }, null, 8, ["modelValue", "label"])
1341
- ])) : L("", !0),
1342
- e.fields.tls_verify_enabled ? (S(), U("div", qt, [
1343
- d(V, {
1344
- modelValue: e.fields.tls_verify_value,
1345
- "onUpdate:modelValue": i[23] || (i[23] = (s) => e.fields.tls_verify_value = s),
1383
+ ])) : x("", !0),
1384
+ l.fields.tls_verify_enabled ? (C(), E("div", ll, [
1385
+ d(L, {
1386
+ modelValue: l.fields.tls_verify_value,
1387
+ "onUpdate:modelValue": f[23] || (f[23] = (m) => l.fields.tls_verify_value = m),
1346
1388
  "data-testid": "gateway-service-tls-verify-false-option",
1347
- label: o(a)("gateway_services.form.fields.tls_verify_option.false.label"),
1389
+ label: o(r)("gateway_services.form.fields.tls_verify_option.false.label"),
1348
1390
  "selected-value": !1
1349
1391
  }, null, 8, ["modelValue", "label"])
1350
- ])) : L("", !0)
1351
- ])) : L("", !0)
1392
+ ])) : x("", !0)
1393
+ ])) : x("", !0)
1352
1394
  ])
1353
1395
  ]),
1354
1396
  _: 1
@@ -1362,7 +1404,7 @@ const ve = {
1362
1404
  ]);
1363
1405
  };
1364
1406
  }
1365
- }), Xt = /* @__PURE__ */ Be(Ot, [["__scopeId", "data-v-35e0db56"]]), Nt = { class: "kong-ui-gateway-service-entity-config-card" }, Zt = /* @__PURE__ */ Te({
1407
+ }), Al = /* @__PURE__ */ Ne(ol, [["__scopeId", "data-v-c2c5e1f0"]]), il = { class: "kong-ui-gateway-service-entity-config-card" }, Tl = /* @__PURE__ */ Le({
1366
1408
  __name: "GatewayServiceConfigCard",
1367
1409
  props: {
1368
1410
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -1389,130 +1431,983 @@ const ve = {
1389
1431
  },
1390
1432
  emits: ["loading", "fetch:error", "fetch:success"],
1391
1433
  setup(n) {
1392
- const D = n, { i18n: { t: p }, i18nT: c } = ve.useI18n(), r = b(() => se.form[D.config.app].edit), { getPropValue: $ } = rt(), N = (a, P) => $(a, P) === !0 ? p("gateway_services.form.fields.tls_verify_option.true.display") : p("gateway_services.form.fields.tls_verify_option.false.display"), q = E({
1434
+ const M = n, { i18n: { t: y }, i18nT: p } = ge.useI18n(), a = h(() => ye.form[M.config.app].edit), { getPropValue: b } = ht(), B = (r, K) => b(r, K) === !0 ? y("gateway_services.form.fields.tls_verify_option.true.display") : y("gateway_services.form.fields.tls_verify_option.false.display"), Z = W({
1393
1435
  id: {},
1394
1436
  name: {
1395
- tooltip: p("gateway_services.form.fields.name.tooltip")
1437
+ tooltip: y("gateway_services.form.fields.name.tooltip")
1396
1438
  },
1397
1439
  enabled: {},
1398
1440
  updated_at: {},
1399
1441
  created_at: {},
1400
1442
  protocol: {
1401
- section: fe.Basic,
1402
- tooltip: p("gateway_services.form.fields.protocol.tooltip")
1443
+ section: $e.Basic,
1444
+ tooltip: y("gateway_services.form.fields.protocol.tooltip")
1403
1445
  },
1404
1446
  host: {
1405
- section: fe.Basic,
1406
- tooltip: p("gateway_services.form.fields.host.tooltip")
1447
+ section: $e.Basic,
1448
+ tooltip: y("gateway_services.form.fields.host.tooltip")
1407
1449
  },
1408
1450
  path: {
1409
- section: fe.Basic,
1410
- tooltip: p("gateway_services.form.fields.path.tooltip")
1451
+ section: $e.Basic,
1452
+ tooltip: y("gateway_services.form.fields.path.tooltip")
1411
1453
  },
1412
1454
  port: {
1413
- section: fe.Basic,
1414
- tooltip: p("gateway_services.form.fields.port.tooltip")
1455
+ section: $e.Basic,
1456
+ tooltip: y("gateway_services.form.fields.port.tooltip")
1415
1457
  },
1416
1458
  tags: {
1417
- tooltip: p("gateway_services.form.fields.tags.tooltip")
1459
+ tooltip: y("gateway_services.form.fields.tags.tooltip")
1418
1460
  },
1419
1461
  // advanced fields
1420
1462
  retries: {
1421
1463
  order: 1,
1422
- tooltip: p("gateway_services.form.fields.retries.tooltip")
1464
+ tooltip: y("gateway_services.form.fields.retries.tooltip")
1423
1465
  },
1424
1466
  connect_timeout: {
1425
1467
  order: 2,
1426
- tooltip: p("gateway_services.form.fields.connect_timeout.tooltip")
1468
+ tooltip: y("gateway_services.form.fields.connect_timeout.tooltip")
1427
1469
  },
1428
1470
  write_timeout: {
1429
1471
  order: 3,
1430
- tooltip: p("gateway_services.form.fields.write_timeout.tooltip")
1472
+ tooltip: y("gateway_services.form.fields.write_timeout.tooltip")
1431
1473
  },
1432
1474
  read_timeout: {
1433
1475
  order: 4,
1434
- tooltip: p("gateway_services.form.fields.read_timeout.tooltip")
1476
+ tooltip: y("gateway_services.form.fields.read_timeout.tooltip")
1435
1477
  },
1436
1478
  client_certificate: {
1437
1479
  order: 5,
1438
- tooltip: p("gateway_services.form.fields.client_certificate.tooltip")
1480
+ tooltip: y("gateway_services.form.fields.client_certificate.tooltip")
1439
1481
  },
1440
1482
  ca_certificates: {
1441
- type: at.BadgeTag,
1442
- label: p("gateway_services.form.fields.ca_certificates.label"),
1483
+ type: wt.BadgeTag,
1484
+ label: y("gateway_services.form.fields.ca_certificates.label"),
1443
1485
  order: 6
1444
1486
  },
1445
1487
  tls_verify: {
1446
- label: p("gateway_services.form.fields.tls_verify_enabled.label")
1488
+ label: y("gateway_services.form.fields.tls_verify_enabled.label")
1447
1489
  },
1448
1490
  tls_verify_depth: {
1449
1491
  hidden: !0
1450
1492
  }
1451
1493
  });
1452
- return (a, P) => (S(), U("div", Nt, [
1453
- d(o(nt), {
1494
+ return (r, K) => (C(), E("div", il, [
1495
+ d(o(kt), {
1454
1496
  config: n.config,
1455
1497
  "config-card-doc": n.configCardDoc,
1456
- "config-schema": q.value,
1457
- "entity-type": o(Fe).GatewayService,
1458
- "fetch-url": r.value,
1498
+ "config-schema": Z.value,
1499
+ "entity-type": o(Oe).GatewayService,
1500
+ "fetch-url": a.value,
1459
1501
  "hide-title": n.hideTitle,
1460
- "onFetch:error": P[0] || (P[0] = (C) => a.$emit("fetch:error", C)),
1461
- "onFetch:success": P[1] || (P[1] = (C) => a.$emit("fetch:success", C)),
1462
- onLoading: P[2] || (P[2] = (C) => a.$emit("loading", C))
1502
+ "onFetch:error": K[0] || (K[0] = (I) => r.$emit("fetch:error", I)),
1503
+ "onFetch:success": K[1] || (K[1] = (I) => r.$emit("fetch:success", I)),
1504
+ onLoading: K[2] || (K[2] = (I) => r.$emit("loading", I))
1463
1505
  }, {
1464
- "enabled-label-tooltip": f(() => [
1465
- d(o(c), {
1506
+ "enabled-label-tooltip": v(() => [
1507
+ d(o(p), {
1466
1508
  keypath: "gateway_services.form.fields.enabled.tooltip",
1467
1509
  scope: "global"
1468
1510
  }, {
1469
- false: f(() => [
1470
- w("code", null, y(o(p)("gateway_services.form.fields.enabled.false")), 1)
1511
+ false: v(() => [
1512
+ S("code", null, F(o(y)("gateway_services.form.fields.enabled.false")), 1)
1471
1513
  ]),
1472
- true: f(() => [
1473
- w("code", null, y(o(p)("gateway_services.form.fields.enabled.true")), 1)
1514
+ true: v(() => [
1515
+ S("code", null, F(o(y)("gateway_services.form.fields.enabled.true")), 1)
1474
1516
  ]),
1475
1517
  _: 1
1476
1518
  })
1477
1519
  ]),
1478
- "ca_certificates-label-tooltip": f(() => [
1479
- d(o(c), {
1520
+ "ca_certificates-label-tooltip": v(() => [
1521
+ d(o(p), {
1480
1522
  keypath: "gateway_services.form.fields.ca_certificates.tooltip",
1481
1523
  scope: "global"
1482
1524
  }, {
1483
- code1: f(() => [
1484
- w("code", null, y(o(p)("gateway_services.form.fields.ca_certificates.code1")), 1)
1525
+ code1: v(() => [
1526
+ S("code", null, F(o(y)("gateway_services.form.fields.ca_certificates.code1")), 1)
1485
1527
  ]),
1486
- code2: f(() => [
1487
- w("code", null, y(o(p)("gateway_services.form.fields.ca_certificates.code2")), 1)
1528
+ code2: v(() => [
1529
+ S("code", null, F(o(y)("gateway_services.form.fields.ca_certificates.code2")), 1)
1488
1530
  ]),
1489
1531
  _: 1
1490
1532
  })
1491
1533
  ]),
1492
- "tls_verify-label-tooltip": f(() => [
1493
- d(o(c), {
1534
+ "tls_verify-label-tooltip": v(() => [
1535
+ d(o(p), {
1494
1536
  keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
1495
1537
  scope: "global"
1496
1538
  }, {
1497
- code1: f(() => [
1498
- w("code", null, y(o(p)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
1539
+ code1: v(() => [
1540
+ S("code", null, F(o(y)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
1499
1541
  ]),
1500
1542
  _: 1
1501
1543
  })
1502
1544
  ]),
1503
- tls_verify: f((C) => [
1504
- M(y(typeof o($)("rowValue", C) == "boolean" ? N("rowValue", C) : o(p)("gateway_services.form.fields.tls_verify_option.unset.display")), 1)
1545
+ tls_verify: v((I) => [
1546
+ z(F(typeof o(b)("rowValue", I) == "boolean" ? B("rowValue", I) : o(y)("gateway_services.form.fields.tls_verify_option.unset.display")), 1)
1505
1547
  ]),
1506
- client_certificate: f((C) => [
1507
- M(y(o($)("rowValue", C) ? o($)("rowValue", C).id : "–"), 1)
1548
+ client_certificate: v((I) => [
1549
+ z(F(o(b)("rowValue", I) ? o(b)("rowValue", I).id : "–"), 1)
1508
1550
  ]),
1509
1551
  _: 1
1510
1552
  }, 8, ["config", "config-card-doc", "config-schema", "entity-type", "fetch-url", "hide-title"])
1511
1553
  ]));
1512
1554
  }
1513
1555
  });
1556
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
1557
+ const Ze = () => {
1558
+ };
1559
+ function rl(n, M) {
1560
+ function y(...p) {
1561
+ return new Promise((a, b) => {
1562
+ Promise.resolve(n(() => M.apply(this, p), { fn: M, thisArg: this, args: p })).then(a).catch(b);
1563
+ });
1564
+ }
1565
+ return y;
1566
+ }
1567
+ function sl(n, M = {}) {
1568
+ let y, p, a = Ze;
1569
+ const b = (r) => {
1570
+ clearTimeout(r), a(), a = Ze;
1571
+ };
1572
+ let B;
1573
+ return (r) => {
1574
+ const K = ze(n), I = ze(M.maxWait);
1575
+ return y && b(y), K <= 0 || I !== void 0 && I <= 0 ? (p && (b(p), p = null), Promise.resolve(r())) : new Promise((ie, ue) => {
1576
+ a = M.rejectOnCancel ? ue : ie, B = r, I && !p && (p = setTimeout(() => {
1577
+ y && b(y), p = null, ie(B());
1578
+ }, I)), y = setTimeout(() => {
1579
+ p && b(p), p = null, ie(r());
1580
+ }, K);
1581
+ });
1582
+ };
1583
+ }
1584
+ function De(n, M = 200, y = {}) {
1585
+ return rl(
1586
+ sl(M, y),
1587
+ n
1588
+ );
1589
+ }
1590
+ const te = {
1591
+ name: "WeatherApi-quickstart-demo",
1592
+ tags: [],
1593
+ protocol: "https",
1594
+ path: "/flights",
1595
+ read_timeout: 6e4,
1596
+ retries: 5,
1597
+ host: "api.kong-air.com",
1598
+ connect_timeout: 6e4,
1599
+ ca_certificates: null,
1600
+ client_certificate: null,
1601
+ write_timeout: 6e4,
1602
+ port: 443
1603
+ }, al = { class: "kong-ui-entities-gateway-service-form" }, nl = {
1604
+ key: 0,
1605
+ class: "gateway-service-form-general-info"
1606
+ }, cl = { class: "gateway-service-form-group-selection-wrapper" }, dl = {
1607
+ key: 0,
1608
+ class: "gateway-service-form-group-fields"
1609
+ }, ul = {
1610
+ key: 0,
1611
+ class: "gateway-service-form-group-fields"
1612
+ }, fl = { key: 0 }, pl = {
1613
+ key: 0,
1614
+ class: "gateway-service-form-advanced-fields"
1615
+ }, ml = { class: "gateway-service-form-margin-bottom" }, vl = { class: "gateway-service-form-margin-bottom" }, gl = { class: "gateway-service-form-margin-bottom" }, yl = { class: "gateway-service-form-margin-bottom" }, _l = {
1616
+ key: 0,
1617
+ class: "gateway-service-form-margin-bottom"
1618
+ }, bl = {
1619
+ key: 1,
1620
+ class: "gateway-service-form-margin-bottom"
1621
+ }, hl = {
1622
+ key: 2,
1623
+ class: "gateway-service-form-margin-bottom"
1624
+ }, wl = {
1625
+ key: 0,
1626
+ class: "checkbox-aligned-radio"
1627
+ }, kl = {
1628
+ key: 1,
1629
+ class: "checkbox-aligned-radio"
1630
+ }, Vl = { class: "gateway-service-form-tags" }, Cl = { class: "form-error-list" }, Sl = /* @__PURE__ */ Le({
1631
+ __name: "GatewayServiceForm",
1632
+ props: {
1633
+ /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
1634
+ config: {
1635
+ type: Object,
1636
+ required: !0,
1637
+ validator: (n) => !(!n || !["konnect", "kongManager"].includes(n == null ? void 0 : n.app) || n.app === "konnect" && !n.controlPlaneId || n.app === "kongManager" && typeof n.workspace != "string" || !n.cancelRoute)
1638
+ },
1639
+ /** If a valid Gateway Service ID is provided, it will put the form in Edit mode instead of Create */
1640
+ gatewayServiceId: {
1641
+ type: String,
1642
+ required: !1,
1643
+ default: ""
1644
+ },
1645
+ /** Whether show or hide EntityFormSection info column */
1646
+ hideSectionsInfo: {
1647
+ type: Boolean,
1648
+ required: !1,
1649
+ default: !1
1650
+ },
1651
+ /** Whether show or hide Try sample API button */
1652
+ hideTrySampleApiButton: {
1653
+ type: Boolean,
1654
+ required: !1,
1655
+ default: !1
1656
+ },
1657
+ sampleApiList: {
1658
+ type: Array,
1659
+ required: !1,
1660
+ default: () => []
1661
+ }
1662
+ },
1663
+ emits: ["update", "error", "url-valid:success", "url-valid:error", "loading", "model-updated", "try-sample-api"],
1664
+ setup(n, { expose: M, emit: y }) {
1665
+ var he;
1666
+ const p = y, a = n, b = W(!0), B = qe(), { i18nT: Z, i18n: { t: r } } = ge.useI18n(), { getErrorFieldsFromError: K } = Xe(), { axiosInstance: I } = Ge((he = a.config) == null ? void 0 : he.axiosRequestConfig), ie = Ye(), { validateHost: ue, 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"), T = ge.usePortFromProtocol(), se = W(""), Pe = h(() => !!se.value || !!de("name")), t = xe({
1667
+ fields: {
1668
+ name: "",
1669
+ protocol: "http",
1670
+ host: "",
1671
+ path: "",
1672
+ port: 80,
1673
+ url: "",
1674
+ retries: 5,
1675
+ connect_timeout: 6e4,
1676
+ write_timeout: 6e4,
1677
+ read_timeout: 6e4,
1678
+ client_certificate: "",
1679
+ ca_certificates: "",
1680
+ tls_verify_enabled: !1,
1681
+ tls_verify_value: !1,
1682
+ tags: ""
1683
+ },
1684
+ isReadonly: !1,
1685
+ errorMessages: [],
1686
+ formFieldErrors: {
1687
+ host: "",
1688
+ port: "",
1689
+ path: "",
1690
+ name: "",
1691
+ url: "",
1692
+ tags: "",
1693
+ retries: "",
1694
+ connect_timeout: "",
1695
+ write_timeout: "",
1696
+ read_timeout: "",
1697
+ client_certificate: "",
1698
+ ca_certificates: "",
1699
+ tls_verify_enabled: "",
1700
+ tls_verify_value: ""
1701
+ }
1702
+ }), U = xe({
1703
+ name: "",
1704
+ protocol: "http",
1705
+ host: "",
1706
+ path: "",
1707
+ port: 80,
1708
+ url: "",
1709
+ retries: 5,
1710
+ connect_timeout: 6e4,
1711
+ write_timeout: 6e4,
1712
+ read_timeout: 6e4,
1713
+ client_certificate: "",
1714
+ ca_certificates: "",
1715
+ tls_verify_enabled: !1,
1716
+ tls_verify_value: !1,
1717
+ tags: ""
1718
+ }), ae = a.config.app === "konnect" || et({
1719
+ gatewayInfo: a.config.gatewayInfo,
1720
+ // 'ws' and 'wss' are not valid values for the protocol field in Gateway Community Edition or before Gateway Enterprise Edition 3.0
1721
+ supportedRange: {
1722
+ enterprise: ["3.0"]
1723
+ }
1724
+ }), ne = [
1725
+ {
1726
+ label: r("gateway_services.form.fields.protocol.options.http"),
1727
+ value: "http",
1728
+ group: "http"
1729
+ },
1730
+ {
1731
+ label: r("gateway_services.form.fields.protocol.options.https"),
1732
+ value: "https",
1733
+ group: "http"
1734
+ },
1735
+ {
1736
+ label: r("gateway_services.form.fields.protocol.options.tcp"),
1737
+ value: "tcp",
1738
+ group: "tcp"
1739
+ },
1740
+ {
1741
+ label: r("gateway_services.form.fields.protocol.options.tls"),
1742
+ value: "tls",
1743
+ group: "tcp"
1744
+ },
1745
+ {
1746
+ label: r("gateway_services.form.fields.protocol.options.tls_passthrough"),
1747
+ value: "tls_passthrough",
1748
+ group: "tcp"
1749
+ },
1750
+ {
1751
+ label: r("gateway_services.form.fields.protocol.options.grpc"),
1752
+ value: "grpc",
1753
+ group: "grpc"
1754
+ },
1755
+ {
1756
+ label: r("gateway_services.form.fields.protocol.options.grpcs"),
1757
+ value: "grpcs",
1758
+ group: "grpc"
1759
+ },
1760
+ ...ae ? [
1761
+ {
1762
+ label: r("gateway_services.form.fields.protocol.options.ws"),
1763
+ value: "ws",
1764
+ group: "websocket"
1765
+ },
1766
+ {
1767
+ label: r("gateway_services.form.fields.protocol.options.wss"),
1768
+ value: "wss",
1769
+ group: "websocket"
1770
+ }
1771
+ ] : [],
1772
+ {
1773
+ label: r("gateway_services.form.fields.protocol.options.udp"),
1774
+ value: "udp",
1775
+ group: "udp"
1776
+ }
1777
+ ], q = { url: "url", protocol: "protocol" }, pe = (e, s) => {
1778
+ s.value;
1779
+ }, ce = (e) => e ? parseFloat(e) : 0, _e = () => {
1780
+ t.fields.host = U.host, t.fields.path = U.path, t.fields.port = U.port, t.fields.protocol = U.protocol, t.fields.url = U.url, t.fields.retries = U.retries, t.fields.connect_timeout = U.connect_timeout, t.fields.write_timeout = U.write_timeout, t.fields.read_timeout = U.read_timeout, t.fields.client_certificate = U.client_certificate, t.fields.ca_certificates = U.ca_certificates, t.fields.tls_verify_enabled = U.tls_verify_enabled, t.fields.tls_verify_value = U.tls_verify_value;
1781
+ }, Ve = () => {
1782
+ b.value = !0, N(), t.errorMessages = [], _e();
1783
+ }, Ce = () => {
1784
+ switch (_e(), t.fields.name = te.name, l.value) {
1785
+ case "url":
1786
+ t.fields.url = `${te.protocol}://${te.host}${te.path}`;
1787
+ break;
1788
+ case "protocol":
1789
+ t.fields.host = te.host, t.fields.path = te.path, t.fields.protocol = te.protocol, t.fields.port = te.port;
1790
+ break;
1791
+ default:
1792
+ t.fields.url = `${te.protocol}://${te.host}${te.path}`;
1793
+ }
1794
+ }, me = De(() => {
1795
+ if (N(), t.fields.url.length)
1796
+ try {
1797
+ const e = new URL(t.fields.url), s = fe(e.protocol, ne);
1798
+ if (s) throw new Error(s);
1799
+ t.fields.protocol = e.protocol.slice(0, -1);
1800
+ const V = ue(e.hostname);
1801
+ if (V) throw new Error(V);
1802
+ t.fields.host = e.hostname;
1803
+ const O = X(e.pathname);
1804
+ if (O) throw new Error(O);
1805
+ t.fields.path = e.pathname;
1806
+ const P = ke(e.port);
1807
+ if (P) throw new Error(P);
1808
+ const R = Number(e.port);
1809
+ ee.value = !!R, t.fields.port = R || T.getPortFromProtocol(t.fields.protocol), p("url-valid:success");
1810
+ } catch (e) {
1811
+ p("url-valid:error", e.message || "URL validation failed"), t.formFieldErrors.url = e.message || "URL validation failed";
1812
+ }
1813
+ }, 300), be = De((e) => {
1814
+ N(e ?? void 0);
1815
+ }, 300), Se = h(() => !!t.formFieldErrors.url || !!t.formFieldErrors.host || !!t.formFieldErrors.port), de = (e) => {
1816
+ if (t.errorMessages.length) return "";
1817
+ const s = t.formFieldErrors;
1818
+ return s[e] ? s[e] : "";
1819
+ }, le = De((e) => {
1820
+ N(e ?? void 0);
1821
+ const s = ue(t.fields.host);
1822
+ s && (t.formFieldErrors.host = s);
1823
+ const V = X(t.fields.path);
1824
+ V && (t.formFieldErrors.path = V);
1825
+ const O = ke(t.fields.port);
1826
+ O && (t.formFieldErrors.port = O), J.value ? p("url-valid:success") : p("url-valid:error", t.errorMessages.join(",") || "URL validation failed");
1827
+ }, 300), N = (e) => {
1828
+ if (e)
1829
+ t.formFieldErrors[e] = "";
1830
+ else
1831
+ for (let s in t.formFieldErrors)
1832
+ t.formFieldErrors[s] = "";
1833
+ t.errorMessages = [];
1834
+ }, J = h(() => {
1835
+ let e = !0;
1836
+ for (let s in t.formFieldErrors)
1837
+ if (t.formFieldErrors[s].length) {
1838
+ e = !1;
1839
+ break;
1840
+ }
1841
+ return e;
1842
+ }), oe = () => {
1843
+ t.fields.url && l.value === "url" ? me() : le();
1844
+ }, ve = () => `new-service-${(/* @__PURE__ */ new Date()).toISOString().replace(/\D/g, "").slice(0, 17)}`, i = h(() => !["tcp", "tls", "tls_passthrough", "grpc", "grpcs", "udp"].includes(t.fields.protocol)), f = h(() => {
1845
+ if (l.value === "url")
1846
+ return !0;
1847
+ const e = ["https", "wss", "tls"].includes(t.fields.protocol);
1848
+ return l.value === "protocol" && e;
1849
+ }), k = h(() => {
1850
+ if (l.value === "url")
1851
+ return !0;
1852
+ const e = ["https", "tls"].includes(t.fields.protocol);
1853
+ return l.value === "protocol" && e;
1854
+ }), H = h(() => {
1855
+ if (l.value === "url")
1856
+ return !0;
1857
+ const e = ["https", "wss", "tls"].includes(t.fields.protocol);
1858
+ return l.value === "protocol" && e;
1859
+ }), L = (e) => {
1860
+ se.value = ie.utf8Name(e);
1861
+ }, $ = h(() => {
1862
+ if (re.value)
1863
+ return JSON.stringify(t.fields) !== JSON.stringify(U);
1864
+ const e = l.value === "url" && !!t.fields.url && J.value, s = l.value === "protocol" && !!t.fields.host && J.value;
1865
+ return e || s;
1866
+ }), c = (e) => {
1867
+ var s, V, O;
1868
+ 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 = ((O = e == null ? void 0 : e.client_certificate) == null ? void 0 : O.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(U, t.fields);
1869
+ }, g = () => {
1870
+ B.push(a.config.cancelRoute);
1871
+ }, m = h(() => {
1872
+ var s, V;
1873
+ let e = `${a.config.apiBaseUrl}${ye.form[a.config.app].validate}`;
1874
+ return a.config.app === "konnect" ? e = e.replace(/{controlPlaneId}/gi, ((s = a.config) == null ? void 0 : s.controlPlaneId) || "") : a.config.app === "kongManager" && (e = e.replace(/\/{workspace}/gi, (V = a.config) != null && V.workspace ? `/${a.config.workspace}` : "")), e = e.replace(/{id}/gi, a.gatewayServiceId), e;
1875
+ }), w = h(() => {
1876
+ var s, V;
1877
+ let e = `${a.config.apiBaseUrl}${ye.form[a.config.app][Y.value]}`;
1878
+ return a.config.app === "konnect" ? e = e.replace(/{controlPlaneId}/gi, ((s = a.config) == null ? void 0 : s.controlPlaneId) || "") : a.config.app === "kongManager" && (e = e.replace(/\/{workspace}/gi, (V = a.config) != null && V.workspace ? `/${a.config.workspace}` : "")), e = e.replace(/{id}/gi, a.gatewayServiceId), e;
1879
+ }), G = (e) => {
1880
+ let s = "";
1881
+ e.url && (s = new URL(e.url).protocol), (["https", "wss", "tls"].includes(e.protocol) || ["https", "wss", "tls"].includes(s)) && (e.tls_verify = e.tls_verify_enabled ? e.tls_verify_value : null), delete e.tls_verify_enabled, delete e.tls_verify_value;
1882
+ }, Q = h(() => {
1883
+ var s, V, O, P;
1884
+ const e = {
1885
+ name: t.fields.name || null,
1886
+ tags: t.fields.tags ? (O = (V = (s = t.fields.tags) == null ? void 0 : s.split(",")) == null ? void 0 : V.map((R) => String(R || "").trim())) == null ? void 0 : O.filter((R) => R !== "") : null,
1887
+ protocol: t.fields.protocol,
1888
+ path: t.fields.path || null,
1889
+ read_timeout: t.fields.read_timeout,
1890
+ retries: t.fields.retries,
1891
+ host: t.fields.host,
1892
+ connect_timeout: t.fields.connect_timeout,
1893
+ tls_verify_value: t.fields.tls_verify_value,
1894
+ tls_verify_enabled: t.fields.tls_verify_enabled,
1895
+ ca_certificates: t.fields.ca_certificates ? (P = t.fields.ca_certificates) == null ? void 0 : P.split(",").filter((R) => R !== "") : null,
1896
+ client_certificate: t.fields.client_certificate ? { id: t.fields.client_certificate } : null,
1897
+ write_timeout: t.fields.write_timeout,
1898
+ port: t.fields.port,
1899
+ url: t.fields.url
1900
+ };
1901
+ return t.fields.client_certificate && ["https", "wss", "tls"].includes(t.fields.protocol) && (e.client_certificate = { id: t.fields.client_certificate }), t.fields.tls_verify_enabled && ["https", "wss", "tls"].includes(t.fields.protocol) && (e.tls_verify = t.fields.tls_verify_value), i.value || (e.path = null), Y.value === "create" ? l.value === "url" ? (delete e.protocol, delete e.host, delete e.path, a.config.app === "konnect" && delete e.port) : delete e.url : Y.value === "edit" && delete e.url, e;
1902
+ }), j = async () => {
1903
+ var e, s, V, O;
1904
+ try {
1905
+ t.isReadonly = !0, oe();
1906
+ const P = Q.value;
1907
+ G(P);
1908
+ let R;
1909
+ if (await I.post(m.value, P), Y.value === "create" ? R = await I.post(w.value, P) : Y.value === "edit" && (R = ((e = a.config) == null ? void 0 : e.app) === "konnect" ? await I.put(w.value, P) : await I.patch(w.value, P)), R) {
1910
+ const { data: u } = R;
1911
+ t.fields.name = (u == null ? void 0 : u.name) || "", t.fields.port = u.port || T.getPortFromProtocol(u.protocol), t.fields.protocol = (u == null ? void 0 : u.protocol) || "http", t.fields.host = (u == null ? void 0 : u.host) || "", t.fields.path = (u == null ? void 0 : u.path) || "", t.fields.url = (u == null ? void 0 : u.url) || "", t.fields.retries = u != null && u.retries || (u == null ? void 0 : u.retries) === 0 ? u == null ? void 0 : u.retries : 5, t.fields.connect_timeout = u != null && u.connect_timeout || (u == null ? void 0 : u.connect_timeout) === 0 ? u == null ? void 0 : u.connect_timeout : 6e4, t.fields.write_timeout = u != null && u.write_timeout || (u == null ? void 0 : u.write_timeout) === 0 ? u == null ? void 0 : u.write_timeout : 6e4, t.fields.read_timeout = u != null && u.read_timeout || (u == null ? void 0 : u.read_timeout) === 0 ? u == null ? void 0 : u.read_timeout : 6e4, t.fields.client_certificate = ((s = u == null ? void 0 : u.client_certificate) == null ? void 0 : s.id) || "", t.fields.ca_certificates = (V = u == null ? void 0 : u.ca_certificates) != null && V.length ? u == null ? void 0 : u.ca_certificates.join(",") : "", t.fields.tls_verify_enabled = (u == null ? void 0 : u.tls_verify) !== "" && (u == null ? void 0 : u.tls_verify) !== null && (u == null ? void 0 : u.tls_verify) !== void 0, t.fields.tls_verify_value = t.fields.tls_verify_enabled && (u == null ? void 0 : u.tls_verify), t.fields.tags = (O = u == null ? void 0 : u.tags) != null && O.length ? u.tags.join(", ") : "", Object.assign(U, t.fields), p("update", R == null ? void 0 : R.data);
1912
+ }
1913
+ return R;
1914
+ } catch (P) {
1915
+ const { fields: R, messages: u } = K(P);
1916
+ t.errorMessages = u, R.length && R.forEach((we) => {
1917
+ const Ie = we.field;
1918
+ 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 = {
1919
+ ...t.formFieldErrors,
1920
+ [Ie]: we.message
1921
+ });
1922
+ }), p("error", P);
1923
+ } finally {
1924
+ t.isReadonly = !1;
1925
+ }
1926
+ };
1927
+ return Ue(() => a.gatewayServiceId, () => {
1928
+ Object.assign(t.fields, U);
1929
+ }), Ue(t.fields, (e) => {
1930
+ t.fields.port = T.getPortFromProtocol(e.protocol, String(e.port)), p("model-updated", Q.value);
1931
+ }), Je(() => {
1932
+ p("model-updated", Q.value), re.value || (t.fields.name = ve());
1933
+ }), M({
1934
+ validateUrl: oe,
1935
+ getPayload: Q,
1936
+ saveFormData: j,
1937
+ canSubmit: $,
1938
+ initForm: c
1939
+ }), (e, s) => {
1940
+ const V = D("KRadio"), O = D("KButton"), P = D("KInput"), R = D("KSelect"), u = D("KCheckbox"), we = D("KCollapse"), Ie = D("KAlert");
1941
+ return C(), E("div", al, [
1942
+ d(o(tt), {
1943
+ "can-submit": $.value,
1944
+ config: n.config,
1945
+ "edit-id": n.gatewayServiceId,
1946
+ "entity-type": o(Oe).GatewayService,
1947
+ "fetch-url": A.value,
1948
+ "form-fields": Q.value,
1949
+ "is-readonly": t.isReadonly,
1950
+ onCancel: g,
1951
+ "onFetch:error": s[30] || (s[30] = (_) => e.$emit("error", _)),
1952
+ "onFetch:success": c,
1953
+ onLoading: s[31] || (s[31] = (_) => e.$emit("loading", _)),
1954
+ onSubmit: j
1955
+ }, {
1956
+ "form-actions": v(() => [
1957
+ Qe(e.$slots, "form-actions", {
1958
+ canSubmit: $.value,
1959
+ cancel: g,
1960
+ submit: j
1961
+ }, void 0, !0)
1962
+ ]),
1963
+ default: v(() => [
1964
+ d(o(Be), {
1965
+ description: o(r)("gateway_services.form.sections.keys.description"),
1966
+ "hide-info-header": n.hideSectionsInfo,
1967
+ title: o(r)("gateway_services.form.sections.keys.title")
1968
+ }, {
1969
+ default: v(() => [
1970
+ re.value ? x("", !0) : (C(), E("div", nl, [
1971
+ S("div", cl, [
1972
+ d(V, {
1973
+ modelValue: l.value,
1974
+ "onUpdate:modelValue": s[0] || (s[0] = (_) => l.value = _),
1975
+ card: "",
1976
+ "card-orientation": "horizontal",
1977
+ "data-testid": "gateway-service-url-radio",
1978
+ description: o(r)("gateway_services.form.sections.keys.url.description"),
1979
+ label: o(r)("gateway_services.form.sections.keys.url.label"),
1980
+ "selected-value": q.url,
1981
+ onChange: Ve
1982
+ }, null, 8, ["modelValue", "description", "label", "selected-value"]),
1983
+ d(V, {
1984
+ modelValue: l.value,
1985
+ "onUpdate:modelValue": s[1] || (s[1] = (_) => l.value = _),
1986
+ card: "",
1987
+ "card-orientation": "horizontal",
1988
+ "checked-group": "protocol",
1989
+ "data-testid": "gateway-service-protocol-radio",
1990
+ description: o(r)("gateway_services.form.sections.keys.protocol.description"),
1991
+ label: o(r)("gateway_services.form.sections.keys.protocol.label"),
1992
+ "selected-value": q.protocol,
1993
+ onChange: Ve
1994
+ }, null, 8, ["modelValue", "description", "label", "selected-value"])
1995
+ ]),
1996
+ d(We, { name: "slide-fade" }, {
1997
+ default: v(() => [
1998
+ l.value === "url" ? (C(), E("div", dl, [
1999
+ d(P, {
2000
+ modelValue: t.fields.url,
2001
+ "onUpdate:modelValue": s[2] || (s[2] = (_) => t.fields.url = _),
2002
+ modelModifiers: { trim: !0 },
2003
+ class: "gateway-service-url-input gateway-service-form-margin-bottom",
2004
+ "data-testid": "gateway-service-url-input",
2005
+ error: Se.value,
2006
+ "error-message": de("url"),
2007
+ label: o(r)("gateway_services.form.fields.upstream_url.label"),
2008
+ "label-attributes": {
2009
+ info: n.config.app === "konnect" ? o(r)("gateway_services.form.fields.upstream_url.tooltip_for_konnect") : o(r)("gateway_services.form.fields.upstream_url.tooltip_for_km"),
2010
+ tooltipAttributes: { maxWidth: "400" }
2011
+ },
2012
+ name: "url",
2013
+ placeholder: o(r)("gateway_services.form.fields.upstream_url.placeholder"),
2014
+ required: "",
2015
+ onInput: o(me)
2016
+ }, Re({ _: 2 }, [
2017
+ n.hideTrySampleApiButton ? void 0 : {
2018
+ name: "after",
2019
+ fn: v(() => [
2020
+ d(O, {
2021
+ appearance: "tertiary",
2022
+ size: "small",
2023
+ onClick: Ce
2024
+ }, {
2025
+ default: v(() => s[32] || (s[32] = [
2026
+ z(" Try Sample API ")
2027
+ ])),
2028
+ _: 1
2029
+ })
2030
+ ]),
2031
+ key: "0"
2032
+ }
2033
+ ]), 1032, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder", "onInput"])
2034
+ ])) : x("", !0)
2035
+ ]),
2036
+ _: 1
2037
+ })
2038
+ ])),
2039
+ d(We, { name: "slide-fade" }, {
2040
+ default: v(() => [
2041
+ l.value === "protocol" || re.value ? (C(), E("div", ul, [
2042
+ d(R, {
2043
+ modelValue: t.fields.protocol,
2044
+ "onUpdate:modelValue": s[3] || (s[3] = (_) => t.fields.protocol = _),
2045
+ "data-testid": "gateway-service-protocol-select",
2046
+ items: ne,
2047
+ label: o(r)("gateway_services.form.fields.protocol.label"),
2048
+ "label-attributes": {
2049
+ info: o(r)("gateway_services.form.fields.protocol.tooltip"),
2050
+ tooltipAttributes: { maxWidth: "400" }
2051
+ },
2052
+ readonly: t.isReadonly,
2053
+ required: "",
2054
+ width: "100%",
2055
+ onSelected: s[4] || (s[4] = (_) => pe(t.fields.protocol, _))
2056
+ }, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
2057
+ d(P, {
2058
+ modelValue: t.fields.host,
2059
+ "onUpdate:modelValue": s[5] || (s[5] = (_) => t.fields.host = _),
2060
+ modelModifiers: { trim: !0 },
2061
+ class: "gateway-service-form-margin-top",
2062
+ "data-testid": "gateway-service-host-input",
2063
+ error: !!t.formFieldErrors.host,
2064
+ "error-message": de("host"),
2065
+ label: o(r)("gateway_services.form.fields.host.label"),
2066
+ "label-attributes": {
2067
+ info: o(r)("gateway_services.form.fields.host.tooltip"),
2068
+ tooltipAttributes: { maxWidth: "400" }
2069
+ },
2070
+ name: "host",
2071
+ placeholder: o(r)("gateway_services.form.fields.host.placeholder"),
2072
+ required: "",
2073
+ onInput: s[6] || (s[6] = (_) => o(le)("host"))
2074
+ }, Re({ _: 2 }, [
2075
+ n.hideTrySampleApiButton ? void 0 : {
2076
+ name: "after",
2077
+ fn: v(() => [
2078
+ d(O, {
2079
+ appearance: "tertiary",
2080
+ size: "small",
2081
+ onClick: Ce
2082
+ }, {
2083
+ default: v(() => s[33] || (s[33] = [
2084
+ z(" Try Sample API ")
2085
+ ])),
2086
+ _: 1
2087
+ })
2088
+ ]),
2089
+ key: "0"
2090
+ }
2091
+ ]), 1032, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"]),
2092
+ i.value ? (C(), E("div", fl, [
2093
+ d(P, {
2094
+ modelValue: t.fields.path,
2095
+ "onUpdate:modelValue": s[7] || (s[7] = (_) => t.fields.path = _),
2096
+ modelModifiers: { trim: !0 },
2097
+ class: "gateway-service-form-margin-top",
2098
+ "data-testid": "gateway-service-path-input",
2099
+ error: !!t.formFieldErrors.path,
2100
+ "error-message": de("path"),
2101
+ label: o(r)("gateway_services.form.fields.path.label"),
2102
+ "label-attributes": {
2103
+ info: o(r)("gateway_services.form.fields.path.tooltip"),
2104
+ tooltipAttributes: { maxWidth: "400" }
2105
+ },
2106
+ name: "path",
2107
+ placeholder: o(r)("gateway_services.form.fields.path.placeholder"),
2108
+ onInput: s[8] || (s[8] = (_) => o(le)("path"))
2109
+ }, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"])
2110
+ ])) : x("", !0),
2111
+ d(P, {
2112
+ modelValue: t.fields.port,
2113
+ "onUpdate:modelValue": [
2114
+ s[9] || (s[9] = (_) => t.fields.port = _),
2115
+ s[11] || (s[11] = () => {
2116
+ t.fields.port = ce(t.fields.port + "");
2117
+ })
2118
+ ],
2119
+ class: "gateway-service-form-margin-top",
2120
+ "data-testid": "gateway-service-port-input",
2121
+ error: !!t.formFieldErrors.port,
2122
+ "error-message": de("port"),
2123
+ label: o(r)("gateway_services.form.fields.port.label"),
2124
+ "label-attributes": {
2125
+ info: o(r)("gateway_services.form.fields.port.tooltip"),
2126
+ tooltipAttributes: { maxWidth: "400" }
2127
+ },
2128
+ name: "port",
2129
+ type: "number",
2130
+ onInput: s[10] || (s[10] = (_) => o(le)("port"))
2131
+ }, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes"])
2132
+ ])) : x("", !0)
2133
+ ]),
2134
+ _: 1
2135
+ }),
2136
+ d(we, {
2137
+ modelValue: b.value,
2138
+ "onUpdate:modelValue": s[27] || (s[27] = (_) => b.value = _),
2139
+ "data-testid": "advanced-fields-collapse",
2140
+ "trigger-alignment": "leading",
2141
+ "trigger-label": o(r)("gateway_services.form.sections.keys.viewAdvancedFields")
2142
+ }, {
2143
+ default: v(() => [
2144
+ d(We, { name: "slide-fade" }, {
2145
+ default: v(() => [
2146
+ b.value ? x("", !0) : (C(), E("div", pl, [
2147
+ S("div", ml, [
2148
+ d(P, {
2149
+ modelValue: t.fields.retries,
2150
+ "onUpdate:modelValue": [
2151
+ s[12] || (s[12] = (_) => t.fields.retries = _),
2152
+ s[13] || (s[13] = () => {
2153
+ t.fields.retries = ce(t.fields.retries + "");
2154
+ })
2155
+ ],
2156
+ autocomplete: "off",
2157
+ "data-testid": "gateway-service-retries-input",
2158
+ label: o(r)("gateway_services.form.fields.retries.label"),
2159
+ "label-attributes": {
2160
+ info: o(r)("gateway_services.form.fields.retries.tooltip"),
2161
+ tooltipAttributes: { maxWidth: "400" }
2162
+ },
2163
+ name: "retries",
2164
+ readonly: t.isReadonly,
2165
+ type: "number"
2166
+ }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
2167
+ ]),
2168
+ S("div", vl, [
2169
+ d(P, {
2170
+ modelValue: t.fields.connect_timeout,
2171
+ "onUpdate:modelValue": [
2172
+ s[14] || (s[14] = (_) => t.fields.connect_timeout = _),
2173
+ s[15] || (s[15] = () => {
2174
+ t.fields.connect_timeout = ce(t.fields.connect_timeout + "");
2175
+ })
2176
+ ],
2177
+ autocomplete: "off",
2178
+ "data-testid": "gateway-service-connTimeout-input",
2179
+ label: o(r)("gateway_services.form.fields.connect_timeout.label"),
2180
+ "label-attributes": {
2181
+ info: o(r)("gateway_services.form.fields.connect_timeout.tooltip"),
2182
+ tooltipAttributes: { maxWidth: "400" }
2183
+ },
2184
+ name: "connTimeout",
2185
+ readonly: t.isReadonly,
2186
+ type: "number"
2187
+ }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
2188
+ ]),
2189
+ S("div", gl, [
2190
+ d(P, {
2191
+ modelValue: t.fields.write_timeout,
2192
+ "onUpdate:modelValue": [
2193
+ s[16] || (s[16] = (_) => t.fields.write_timeout = _),
2194
+ s[17] || (s[17] = () => {
2195
+ t.fields.write_timeout = ce(t.fields.write_timeout + "");
2196
+ })
2197
+ ],
2198
+ autocomplete: "off",
2199
+ "data-testid": "gateway-service-writeTimeout-input",
2200
+ label: o(r)("gateway_services.form.fields.write_timeout.label"),
2201
+ "label-attributes": {
2202
+ info: o(r)("gateway_services.form.fields.write_timeout.tooltip"),
2203
+ tooltipAttributes: { maxWidth: "400" }
2204
+ },
2205
+ name: "writeTimeout",
2206
+ readonly: t.isReadonly,
2207
+ type: "number"
2208
+ }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
2209
+ ]),
2210
+ S("div", yl, [
2211
+ d(P, {
2212
+ modelValue: t.fields.read_timeout,
2213
+ "onUpdate:modelValue": [
2214
+ s[18] || (s[18] = (_) => t.fields.read_timeout = _),
2215
+ s[19] || (s[19] = () => {
2216
+ t.fields.read_timeout = ce(t.fields.read_timeout + "");
2217
+ })
2218
+ ],
2219
+ autocomplete: "off",
2220
+ "data-testid": "gateway-service-readTimeout-input",
2221
+ label: o(r)("gateway_services.form.fields.read_timeout.label"),
2222
+ "label-attributes": {
2223
+ info: o(r)("gateway_services.form.fields.read_timeout.tooltip"),
2224
+ tooltipAttributes: { maxWidth: "400" }
2225
+ },
2226
+ name: "readTimeout",
2227
+ readonly: t.isReadonly,
2228
+ type: "number"
2229
+ }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
2230
+ ]),
2231
+ f.value ? (C(), E("div", _l, [
2232
+ d(P, {
2233
+ modelValue: t.fields.client_certificate,
2234
+ "onUpdate:modelValue": s[20] || (s[20] = (_) => t.fields.client_certificate = _),
2235
+ modelModifiers: { trim: !0 },
2236
+ autocomplete: "off",
2237
+ "data-testid": "gateway-service-clientCert-input",
2238
+ error: !!t.formFieldErrors.client_certificate,
2239
+ label: o(r)("gateway_services.form.fields.client_certificate.label"),
2240
+ "label-attributes": {
2241
+ info: o(r)("gateway_services.form.fields.client_certificate.tooltip"),
2242
+ tooltipAttributes: { maxWidth: "400" }
2243
+ },
2244
+ name: "clientCert",
2245
+ placeholder: o(r)("gateway_services.form.fields.client_certificate.placeholder"),
2246
+ readonly: t.isReadonly,
2247
+ type: "text",
2248
+ onInput: s[21] || (s[21] = (_) => o(be)("client_certificate"))
2249
+ }, null, 8, ["modelValue", "error", "label", "label-attributes", "placeholder", "readonly"])
2250
+ ])) : x("", !0),
2251
+ k.value ? (C(), E("div", bl, [
2252
+ d(P, {
2253
+ modelValue: t.fields.ca_certificates,
2254
+ "onUpdate:modelValue": s[22] || (s[22] = (_) => t.fields.ca_certificates = _),
2255
+ modelModifiers: { trim: !0 },
2256
+ autocomplete: "off",
2257
+ "data-testid": "gateway-service-ca-certs-input",
2258
+ error: !!t.formFieldErrors.ca_certificates,
2259
+ label: o(r)("gateway_services.form.fields.ca_certificates.label"),
2260
+ "label-attributes": { tooltipAttributes: { maxWidth: "400" } },
2261
+ placeholder: o(r)("gateway_services.form.fields.ca_certificates.placeholder"),
2262
+ readonly: t.isReadonly,
2263
+ type: "text",
2264
+ onInput: s[23] || (s[23] = (_) => o(be)("ca_certificates"))
2265
+ }, {
2266
+ "label-tooltip": v(() => [
2267
+ d(o(Z), {
2268
+ keypath: "gateway_services.form.fields.ca_certificates.tooltip",
2269
+ scope: "global"
2270
+ }, {
2271
+ code1: v(() => [
2272
+ S("code", null, F(o(r)("gateway_services.form.fields.ca_certificates.code1")), 1)
2273
+ ]),
2274
+ code2: v(() => [
2275
+ S("code", null, F(o(r)("gateway_services.form.fields.ca_certificates.code2")), 1)
2276
+ ]),
2277
+ _: 1
2278
+ })
2279
+ ]),
2280
+ _: 1
2281
+ }, 8, ["modelValue", "error", "label", "placeholder", "readonly"])
2282
+ ])) : x("", !0),
2283
+ H.value ? (C(), E("div", hl, [
2284
+ d(u, {
2285
+ modelValue: t.fields.tls_verify_enabled,
2286
+ "onUpdate:modelValue": s[24] || (s[24] = (_) => t.fields.tls_verify_enabled = _),
2287
+ "data-testid": "gateway-service-tls-verify-checkbox",
2288
+ description: o(r)("gateway_services.form.fields.tls_verify_enabled.help"),
2289
+ label: o(r)("gateway_services.form.fields.tls_verify_enabled.label"),
2290
+ "label-attributes": { tooltipAttributes: { maxWidth: "400" } }
2291
+ }, {
2292
+ tooltip: v(() => [
2293
+ d(o(Z), {
2294
+ keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
2295
+ scope: "global"
2296
+ }, {
2297
+ code1: v(() => [
2298
+ S("code", null, F(o(r)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
2299
+ ]),
2300
+ _: 1
2301
+ })
2302
+ ]),
2303
+ _: 1
2304
+ }, 8, ["modelValue", "description", "label"]),
2305
+ t.fields.tls_verify_enabled ? (C(), E("div", wl, [
2306
+ d(V, {
2307
+ modelValue: t.fields.tls_verify_value,
2308
+ "onUpdate:modelValue": s[25] || (s[25] = (_) => t.fields.tls_verify_value = _),
2309
+ "data-testid": "gateway-service-tls-verify-true-option",
2310
+ label: o(r)("gateway_services.form.fields.tls_verify_option.true.label"),
2311
+ "selected-value": !0
2312
+ }, null, 8, ["modelValue", "label"])
2313
+ ])) : x("", !0),
2314
+ t.fields.tls_verify_enabled ? (C(), E("div", kl, [
2315
+ d(V, {
2316
+ modelValue: t.fields.tls_verify_value,
2317
+ "onUpdate:modelValue": s[26] || (s[26] = (_) => t.fields.tls_verify_value = _),
2318
+ "data-testid": "gateway-service-tls-verify-false-option",
2319
+ label: o(r)("gateway_services.form.fields.tls_verify_option.false.label"),
2320
+ "selected-value": !1
2321
+ }, null, 8, ["modelValue", "label"])
2322
+ ])) : x("", !0)
2323
+ ])) : x("", !0)
2324
+ ]))
2325
+ ]),
2326
+ _: 1
2327
+ })
2328
+ ]),
2329
+ _: 1
2330
+ }, 8, ["modelValue", "trigger-label"])
2331
+ ]),
2332
+ _: 1
2333
+ }, 8, ["description", "hide-info-header", "title"]),
2334
+ d(o(Be), {
2335
+ description: o(r)("gateway_services.form.sections.general.description"),
2336
+ "hide-info-header": n.hideSectionsInfo,
2337
+ title: o(r)("gateway_services.form.sections.general.title")
2338
+ }, {
2339
+ default: v(() => [
2340
+ d(P, {
2341
+ modelValue: t.fields.name,
2342
+ "onUpdate:modelValue": s[28] || (s[28] = (_) => t.fields.name = _),
2343
+ modelModifiers: { trim: !0 },
2344
+ autocomplete: "off",
2345
+ "data-testid": "gateway-service-name-input",
2346
+ error: Pe.value,
2347
+ "error-message": se.value,
2348
+ label: o(r)("gateway_services.form.fields.name.label"),
2349
+ "label-attributes": {
2350
+ info: o(r)("gateway_services.form.fields.name.tooltip"),
2351
+ tooltipAttributes: { maxWidth: "400" }
2352
+ },
2353
+ name: "name",
2354
+ placeholder: o(r)("gateway_services.form.fields.name.placeholder"),
2355
+ readonly: t.isReadonly,
2356
+ type: "text",
2357
+ onInput: L
2358
+ }, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder", "readonly"]),
2359
+ d(we, {
2360
+ "data-testid": "tags-collapse",
2361
+ "trigger-alignment": "leading",
2362
+ "trigger-label": o(r)("gateway_services.form.fields.tags.collapse")
2363
+ }, {
2364
+ default: v(() => [
2365
+ S("div", Vl, [
2366
+ d(P, {
2367
+ modelValue: t.fields.tags,
2368
+ "onUpdate:modelValue": s[29] || (s[29] = (_) => t.fields.tags = _),
2369
+ modelModifiers: { trim: !0 },
2370
+ autocomplete: "off",
2371
+ "data-testid": "gateway-service-tags-input",
2372
+ help: o(r)("gateway_services.form.fields.tags.help"),
2373
+ label: o(r)("gateway_services.form.fields.tags.label"),
2374
+ "label-attributes": {
2375
+ info: o(r)("gateway_services.form.fields.tags.tooltip"),
2376
+ tooltipAttributes: { maxWidth: "400" }
2377
+ },
2378
+ name: "tags",
2379
+ placeholder: o(r)("gateway_services.form.fields.tags.placeholder"),
2380
+ readonly: t.isReadonly,
2381
+ type: "text"
2382
+ }, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])
2383
+ ])
2384
+ ]),
2385
+ _: 1
2386
+ }, 8, ["trigger-label"])
2387
+ ]),
2388
+ _: 1
2389
+ }, 8, ["description", "hide-info-header", "title"]),
2390
+ t.errorMessages.length ? (C(), Fe(Ie, {
2391
+ key: 0,
2392
+ appearance: "danger"
2393
+ }, {
2394
+ default: v(() => [
2395
+ S("ul", Cl, [
2396
+ (C(!0), E(ot, null, it(t.errorMessages, (_) => (C(), E("li", { key: _ }, F(_), 1))), 128))
2397
+ ])
2398
+ ]),
2399
+ _: 1
2400
+ })) : x("", !0)
2401
+ ]),
2402
+ _: 3
2403
+ }, 8, ["can-submit", "config", "edit-id", "entity-type", "fetch-url", "form-fields", "is-readonly"])
2404
+ ]);
2405
+ };
2406
+ }
2407
+ }), Rl = /* @__PURE__ */ Ne(Sl, [["__scopeId", "data-v-ba198a99"]]);
1514
2408
  export {
1515
- Zt as GatewayServiceConfigCard,
1516
- Xt as GatewayServiceForm,
1517
- Qt as GatewayServiceList
2409
+ Tl as GatewayServiceConfigCard,
2410
+ Rl as GatewayServiceForm,
2411
+ $l as GatewayServiceList,
2412
+ Al as LegacyGatewayServiceForm
1518
2413
  };