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