@kong-ui-public/entities-shared 3.73.8 → 3.73.9-pr.4150.2e925f324.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.
- package/dist/{_plugin-vue_export-helper-CzCSHAcC.js → _plugin-vue_export-helper-BiPB3h_p.js} +211 -201
- package/dist/_plugin-vue_export-helper-Co-spHNg.cjs +1 -0
- package/dist/deck-editor.cjs.js +1 -1
- package/dist/deck-editor.es.js +1 -1
- package/dist/entities-shared.cjs.js +1 -1
- package/dist/entities-shared.es.js +2 -2
- package/dist/types/composables/useFetchUrlBuilder.d.ts.map +1 -1
- package/dist/types/composables/useFetcher.d.ts +7 -0
- package/dist/types/composables/useFetcher.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/_plugin-vue_export-helper-DLkhKvEr.cjs +0 -1
package/dist/{_plugin-vue_export-helper-CzCSHAcC.js → _plugin-vue_export-helper-BiPB3h_p.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { inject as
|
|
3
|
-
import { createI18n as
|
|
4
|
-
const
|
|
1
|
+
import T from "axios";
|
|
2
|
+
import { inject as L, ref as h, computed as b, unref as V, toValue as m, watch as oe, provide as W } from "vue";
|
|
3
|
+
import { createI18n as H, i18nTComponent as ie } from "@kong-ui-public/i18n";
|
|
4
|
+
const rt = /* @__PURE__ */ Symbol("PLUGIN_FORM_LAYOUT_STATE"), ot = /* @__PURE__ */ Symbol("CONFIG_CARD_SHOW_SENSITIVE_FIELDS"), Y = /* @__PURE__ */ Symbol("DECK_COMMAND_EDITOR"), J = "[entities-shared] DeckCommandEditor was not provided. Provide it via the `DECK_COMMAND_EDITOR_KEY` injection key or the `provideDeckCommandEditor` helper (see @kong-ui-public/entities-shared/deck-editor).", it = "50vh", ct = 2e5, ce = {
|
|
5
5
|
/** Surfaces the `managed_by` ownership field in entity lists and detail cards. */
|
|
6
6
|
MANAGED_BY: "KM-3018-entity-managed-by"
|
|
7
7
|
};
|
|
@@ -9,14 +9,14 @@ function le() {
|
|
|
9
9
|
return {
|
|
10
10
|
getAxiosInstance: (e = {}) => {
|
|
11
11
|
try {
|
|
12
|
-
const
|
|
13
|
-
return typeof
|
|
12
|
+
const a = L("get-axios-instance", void 0);
|
|
13
|
+
return typeof a == "function" ? a(e) : T.create({
|
|
14
14
|
withCredentials: !0,
|
|
15
15
|
timeout: 3e4,
|
|
16
16
|
...e
|
|
17
17
|
});
|
|
18
|
-
} catch (
|
|
19
|
-
return console.warn("getAxiosInstance:",
|
|
18
|
+
} catch (a) {
|
|
19
|
+
return console.warn("getAxiosInstance:", a.message || a), T.create({
|
|
20
20
|
withCredentials: !0,
|
|
21
21
|
timeout: 3e4,
|
|
22
22
|
...e
|
|
@@ -24,19 +24,19 @@ function le() {
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
getTraceIdFromError: (e) => {
|
|
27
|
-
const
|
|
28
|
-
return
|
|
27
|
+
const a = e?.response?.headers || {};
|
|
28
|
+
return a["x-trace-id"] || a["x-datadog-trace-id"] || "";
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
function ue() {
|
|
33
33
|
return {
|
|
34
|
-
debounce: (e,
|
|
34
|
+
debounce: (e, a) => {
|
|
35
35
|
let o;
|
|
36
36
|
return (...t) => {
|
|
37
37
|
clearTimeout(o), o = window?.setTimeout(() => {
|
|
38
38
|
e(...t);
|
|
39
|
-
},
|
|
39
|
+
}, a);
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
};
|
|
@@ -47,7 +47,7 @@ const K = "khcp-user-table-preferences", de = {
|
|
|
47
47
|
sortColumnOrder: void 0,
|
|
48
48
|
columnVisibility: {}
|
|
49
49
|
};
|
|
50
|
-
function
|
|
50
|
+
function lt() {
|
|
51
51
|
const e = (o) => {
|
|
52
52
|
if (typeof o == "string")
|
|
53
53
|
try {
|
|
@@ -56,29 +56,29 @@ function ct() {
|
|
|
56
56
|
console.error("useTablePreferences(tryParseJson)", t);
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
},
|
|
59
|
+
}, a = () => {
|
|
60
60
|
const o = e(localStorage.getItem(K));
|
|
61
61
|
return !o || !Object.keys(o).length ? /* @__PURE__ */ new Map() : new Map(Object.entries(o));
|
|
62
62
|
};
|
|
63
63
|
return {
|
|
64
64
|
setTablePreferences: (o, t) => {
|
|
65
65
|
try {
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
} catch (
|
|
69
|
-
console.error("useTablePreferences(setTablePreferences)",
|
|
66
|
+
const n = a();
|
|
67
|
+
n.set(o, t), localStorage.setItem(K, JSON.stringify(Object.fromEntries(n.entries())));
|
|
68
|
+
} catch (n) {
|
|
69
|
+
console.error("useTablePreferences(setTablePreferences)", n);
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
|
-
getTablePreferences: (o, t) =>
|
|
72
|
+
getTablePreferences: (o, t) => a()?.get(o) || void 0 || t || de,
|
|
73
73
|
deleteAllTablePreferences: () => {
|
|
74
74
|
localStorage.removeItem(K);
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
function P(e = {}) {
|
|
79
|
-
const { getAxiosInstance:
|
|
79
|
+
const { getAxiosInstance: a } = le();
|
|
80
80
|
return {
|
|
81
|
-
axiosInstance:
|
|
81
|
+
axiosInstance: a(e)
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
84
|
const fe = { actions: { copyId: "Copy ID", copied_id: 'Copied "{id}" to the clipboard', copyToClipboard: "Copied successfully!", copyToClipboardFailed: "Failed to copy to the clipboard" } }, pe = { message: "Are you sure you want to delete this {entityType}?", messageWithName: "Are you sure you want to delete this {entityType} {entityName}?" }, ge = { actions: { viewConfiguration: "View configuration", hideConfiguration: "Hide configuration", save: "Save", cancel: "Cancel", back: "Back" }, configuration: { title: "Configuration", message: "Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.", yaml: "YAML", json: "JSON", terraform: "Terraform", deck: "decK" }, errors: { edit: "The entity could not be edited at this time." } }, me = { emptyState: { noSearchResultsTitle: "No results found", noSearchResultsMessage: "Please adjust the criteria and try again.", noSearchResultsCtaText: "Clear" } }, ye = { title: "Configuration", actions: { copy: "Copy JSON", deck_customize: "Customize before copying to CLI", deck_customize_cancel: "Cancel", sensitive_fields: "Show sensitive fields", sensitive_fields_tooltip: "View masked sensitive data in your configurations if any field values have been redacted." }, sections: { advanced: "Advanced", plugin: "Plugin specific configuration", policy: "Policy specific configuration" }, commonFields: { id_label: "ID", name_label: "Name", enabled_label: "Enabled", enabled_tooltip: "Enabled is FTW", updated_at_label: "Last updated", created_at_label: "Created", managed_by_label: "Managed By", tags_label: "Tags", link: "Link", partial_label: "Redis configuration" }, statusBadge: { enabledLabel: "Enabled", disabledLabel: "Disabled" }, copy: { tooltip: "Copy {label}", success: "Copied!" }, errors: { load: "The entity configuration data could not be loaded at this time.", copy: "Failed to copy to clipboard" }, general: { formatLabel: "Format:", entryTitle: "Entry {index}", structuredFormat: "Structured" } }, he = { learnMore: "Learn more", pricingTitle: "Pricing: " }, be = { filterButtonText: "Filter", fieldLabel: "Filter by:", inputPlaceholder: "Enter a value", selectPlaceholder: "Select an item", applyButtonText: "Apply", clearButtonText: "Clear", clearAllButtonText: "Clear all filters" }, ve = { errors: { fetch: "Could not fetch available items", invalid: "Please select a valid value" } }, _e = { unexpected: "An unexpected error has occurred", dataKeyUndefined: 'The data key "{dataKey}" does not exist in the response.' }, Ae = { utf8Name: "The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces." }, Ce = { enable: { title: "Enable {entityType}", message: "Are you sure you want to enable the {entityType} {entityName}?", confirmText: "Yes, enable" }, disable: { title: "Disable {entityType}", message: "Are you sure you want to disable the {entityType} {entityName}?", confirmText: "Yes, disable" } }, ke = { copy_url: "Copy URL" }, we = { hint: { konnect: "The {token} environment variable must be added first. See {link} for details.", kongManager: "If your Admin API is secured, set up authentication following {link}." }, documentation: "the documentation", steps: { step_1: "Step 1: Export token", step_2: "Step 2: Apply configuration" }, customization: { title: "Customize before copying to CLI", copy_pat: "Make sure to copy your personal access token now. You won't be able to see it again.", reuse_pat: "Use an existing PAT if you've already generated one.", generate_pat: "Generate PAT", footer_reminder: "Changes you make here won't affect your configuration. After you apply changes with decK in the CLI, refresh the page to view them.", secret_advise: "Command may contain sensitive values. Treat it as a secret." }, copy_tooltip: "Copy" }, Ie = { body: "Want a ready-to-use CLI command? {cta} to view this configuration as a decK sync snippet you can copy directly.", cta: "Switch to decK format" }, xe = { title: "Generate a Personal Access Token", description: "Personal access tokens are used to authenticate decK commands and Konnect API requests.", fields: { name: { label: "Name", placeholder: "Enter token name" }, expiresAt: { label: "Expiration date", placeholder: "Select an expiration date", n_days: "{n} days" } }, actions: { cancel: "Cancel", generate: "Generate", generating: "Generating…" } }, Ee = { dismissLabel: "Dismiss" }, De = { rotateKey: "Rotate key", generateKey: "Generate key", placeholder: "Enter or generate a key", oneTimeHint: "The key is shown only once. Copy it now and store it securely.", copy: "Copy", showKey: "Show key", hideKey: "Hide key" }, Q = {
|
|
@@ -100,8 +100,8 @@ const fe = { actions: { copyId: "Copy ID", copied_id: 'Copied "{id}" to the clip
|
|
|
100
100
|
onboardingCard: Ee,
|
|
101
101
|
sensitiveInput: De
|
|
102
102
|
};
|
|
103
|
-
function
|
|
104
|
-
const e =
|
|
103
|
+
function O() {
|
|
104
|
+
const e = H("en-us", Q);
|
|
105
105
|
return {
|
|
106
106
|
i18n: e,
|
|
107
107
|
i18nT: ie(e)
|
|
@@ -109,7 +109,7 @@ function L() {
|
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
var I = /* @__PURE__ */ ((e) => (e[e.InitialLoad = 0] = "InitialLoad", e[e.Loading = 1] = "Loading", e[e.Idle = 2] = "Idle", e[e.NoResults = 3] = "NoResults", e[e.NoRecords = 4] = "NoRecords", e[e.Error = 5] = "Error", e))(I || {}), X = /* @__PURE__ */ ((e) => (e.CaCertificate = "ca_certificate", e.Certificate = "certificate", e.Consumer = "consumer", e.ConsumerGroup = "consumer_group", e.GatewayService = "service", e.Key = "key", e.KeySet = "set", e.Plugin = "plugin", e.Route = "route", e.SNI = "sni", e.Upstream = "upstream", e.Target = "target", e.Vault = "vault", e.Partial = "partial", e.CloudGatewayAddon = "cloud_gateway_addon", e.BackendCluster = "backend_cluster", e.VirtualCluster = "virtual_cluster", e.Listener = "listener", e.ProducePolicy = "produce_policy", e.ConsumePolicy = "consume_policy", e.ClusterPolicy = "cluster_policy", e.ListenerPolicy = "listener_policy", e.SchemaRegistry = "schema_registry", e.StaticKey = "static_key", e.TlsTrustBundle = "tls_trust_bundle", e.AuthServer = "auth_server", e.AuthServerScopes = "auth_server_scopes", e.AuthServerClaims = "auth_server_claims", e.AuthServerClients = "auth_server_clients", e.Other = "other", e.PluginSchema = "plugin_schema", e.CustomPlugin = "custom_plugin", e.ClonedPlugin = "cloned_plugin", e))(X || {});
|
|
112
|
-
const
|
|
112
|
+
const ut = Object.values(X), Le = [
|
|
113
113
|
"ca_certificate",
|
|
114
114
|
"certificate",
|
|
115
115
|
"consumer",
|
|
@@ -129,18 +129,18 @@ const lt = Object.values(X), Oe = [
|
|
|
129
129
|
/* Partial */
|
|
130
130
|
];
|
|
131
131
|
function Z(e) {
|
|
132
|
-
return
|
|
132
|
+
return Le.includes(e);
|
|
133
133
|
}
|
|
134
|
-
const
|
|
135
|
-
var R = /* @__PURE__ */ ((e) => (e.ID = "id", e.IdArray = "id-array", e.Text = "plain-text", e.Date = "date", e.Redacted = "redacted", e.RedactedArray = "redacted-array", e.Json = "json", e.JsonArray = "json-array", e.BadgeTag = "badge-tag", e.CopyBadge = "copy-badge", e.BadgeStatus = "badge-status", e.BadgeMethod = "badge-method", e.LinkInternal = "link-internal", e.LinkExternal = "link-external", e.ManagedBy = "managed-by", e))(R || {}),
|
|
136
|
-
const
|
|
134
|
+
const dt = ["backend_cluster", "virtual_cluster", "listener", "produce_policy", "consume_policy", "cluster_policy", "listener_policy", "schema_registry", "static_key", "tls_trust_bundle"], ft = ["auth_server", "auth_server_scopes", "auth_server_claims", "auth_server_clients"];
|
|
135
|
+
var R = /* @__PURE__ */ ((e) => (e.ID = "id", e.IdArray = "id-array", e.Text = "plain-text", e.Date = "date", e.Redacted = "redacted", e.RedactedArray = "redacted-array", e.Json = "json", e.JsonArray = "json-array", e.BadgeTag = "badge-tag", e.CopyBadge = "copy-badge", e.BadgeStatus = "badge-status", e.BadgeMethod = "badge-method", e.LinkInternal = "link-internal", e.LinkExternal = "link-external", e.ManagedBy = "managed-by", e))(R || {}), Oe = /* @__PURE__ */ ((e) => (e.Basic = "basic", e.Advanced = "advanced", e.Plugin = "plugin", e.Policy = "policy", e))(Oe || {});
|
|
136
|
+
const pt = ["structured", "yaml", "json", "terraform", "deck"];
|
|
137
137
|
function q() {
|
|
138
|
-
const e = (i, r) => r?.[i] ?? void 0,
|
|
138
|
+
const e = (i, r) => r?.[i] ?? void 0, a = (i, r) => {
|
|
139
139
|
if (i.length !== r.length) return !1;
|
|
140
140
|
const d = /* @__PURE__ */ new Set([...i, ...r]);
|
|
141
141
|
for (const c of d) {
|
|
142
|
-
const f = i.filter((
|
|
143
|
-
if (f !==
|
|
142
|
+
const f = i.filter((_) => _ === c).length, y = r.filter((_) => _ === c).length;
|
|
143
|
+
if (f !== y) return !1;
|
|
144
144
|
}
|
|
145
145
|
return !0;
|
|
146
146
|
}, o = (i, r, d) => {
|
|
@@ -148,7 +148,7 @@ function q() {
|
|
|
148
148
|
if (Object.keys(i).length === Object.keys(r).length)
|
|
149
149
|
for (const c in i)
|
|
150
150
|
if (Array.isArray(i[c]) && Array.isArray(r[c])) {
|
|
151
|
-
if (
|
|
151
|
+
if (a(i[c], r[c]))
|
|
152
152
|
continue;
|
|
153
153
|
return !1;
|
|
154
154
|
} else {
|
|
@@ -168,7 +168,7 @@ function q() {
|
|
|
168
168
|
}, t = (i) => (r, d) => {
|
|
169
169
|
let c = r[i] === void 0 || r[i] === null ? "" : r[i], f = d[i] === void 0 || d[i] === null ? "" : d[i];
|
|
170
170
|
return Array.isArray(r[i]) && (c = r[i][0]), Array.isArray(d[i]) && (f = d[i][0]), c.localeCompare(f);
|
|
171
|
-
},
|
|
171
|
+
}, n = (i) => i ? /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(i) : !1, l = "********", s = (i) => !!i && typeof i == "object" && !Array.isArray(i), u = (i, r) => i?.find((c) => Object.keys(c)?.[0] === r)?.[r], p = (i, r) => {
|
|
172
172
|
if (!r || i === null || i === void 0)
|
|
173
173
|
return i;
|
|
174
174
|
if (r.type === "string")
|
|
@@ -224,34 +224,34 @@ function q() {
|
|
|
224
224
|
getPropValue: e,
|
|
225
225
|
objectsAreEqual: o,
|
|
226
226
|
sortAlpha: t,
|
|
227
|
-
isValidUuid:
|
|
227
|
+
isValidUuid: n,
|
|
228
228
|
isObjectRecord: s,
|
|
229
229
|
getApiSchemaField: u,
|
|
230
230
|
redactByApiSchema: p,
|
|
231
231
|
redactByConfigSchema: v
|
|
232
232
|
};
|
|
233
233
|
}
|
|
234
|
-
function Ke(e,
|
|
234
|
+
function Ke(e, a, o, t = {
|
|
235
235
|
fetchedItemsKey: "data",
|
|
236
236
|
searchKeys: ["id"]
|
|
237
237
|
}) {
|
|
238
238
|
o || (o = "1000");
|
|
239
|
-
const { axiosInstance:
|
|
239
|
+
const { axiosInstance: n } = P(e.axiosRequestConfig), { i18n: { t: l } } = O(), { debounce: s } = ue(), u = s(async (g) => {
|
|
240
240
|
await x(g);
|
|
241
|
-
}, 200), p =
|
|
242
|
-
let g = `${e.apiBaseUrl}${
|
|
241
|
+
}, 200), p = h(!1), v = h(""), i = h(""), r = h([]), d = h([]), c = h(void 0), f = b(() => {
|
|
242
|
+
let g = `${e.apiBaseUrl}${V(a)}`;
|
|
243
243
|
return e.app === "konnect" && (g = g.replace(/{controlPlaneId}/gi, e?.controlPlaneId || "")), g.replace(/\/{workspace}/gi, e?.workspace ? `/${e.workspace}` : "");
|
|
244
|
-
}), { isValidUuid:
|
|
244
|
+
}), { isValidUuid: y } = q(), _ = async () => {
|
|
245
245
|
try {
|
|
246
246
|
p.value = !0;
|
|
247
|
-
const { data: g } = await
|
|
247
|
+
const { data: g } = await n.get(`${f.value}?size=${o}`);
|
|
248
248
|
g?.next || (c.value = t.fetchedItemsKey in g ? g[t.fetchedItemsKey] : []), d.value = t.fetchedItemsKey in g ? g[t.fetchedItemsKey] : [], r.value = d.value;
|
|
249
249
|
} catch {
|
|
250
250
|
r.value = [], v.value = l("debouncedFilter.errors.fetch");
|
|
251
251
|
} finally {
|
|
252
252
|
p.value = !1;
|
|
253
253
|
}
|
|
254
|
-
}, w =
|
|
254
|
+
}, w = h(""), x = async (g) => {
|
|
255
255
|
if (w.value !== g) {
|
|
256
256
|
if (w.value = g ?? "", !g) {
|
|
257
257
|
r.value = d.value;
|
|
@@ -260,36 +260,36 @@ function Ke(e, n, o, t = {
|
|
|
260
260
|
if (c.value === void 0)
|
|
261
261
|
try {
|
|
262
262
|
if (p.value = !0, v.value = "", i.value = "", e.app === "konnect") {
|
|
263
|
-
const
|
|
263
|
+
const A = `${f.value}/${g}`, { data: C } = await n.get(`${A}?size=${o}`);
|
|
264
264
|
t.fetchedItemsKey in C ? r.value = C[t.fetchedItemsKey] : C?.[t.exactMatchKey ?? "id"] ? r.value = [C] : r.value = [];
|
|
265
265
|
} else {
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
const { data: k } = await
|
|
266
|
+
const A = [];
|
|
267
|
+
y(g) && t.searchKeys.includes("id") ? A.push((async () => {
|
|
268
|
+
const { data: k } = await n.get(`${f.value}/${g}`);
|
|
269
269
|
return [k[t.fetchedItemsKey] ?? k];
|
|
270
|
-
})()) :
|
|
270
|
+
})()) : A.push(
|
|
271
271
|
...t.searchKeys.filter((k) => k !== "id").map(async (k) => {
|
|
272
|
-
const { data: D } = await
|
|
272
|
+
const { data: D } = await n.get(`${f.value}?${k}=${g}`);
|
|
273
273
|
return D[t.fetchedItemsKey];
|
|
274
274
|
})
|
|
275
275
|
);
|
|
276
|
-
const C = await Promise.all(
|
|
276
|
+
const C = await Promise.all(A), E = /* @__PURE__ */ new Set();
|
|
277
277
|
r.value = [], C?.forEach?.((k) => {
|
|
278
278
|
k?.forEach?.((D) => {
|
|
279
279
|
E.has(D.id) || (E.add(D.id), r.value.push(D));
|
|
280
280
|
});
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
|
-
} catch (
|
|
284
|
-
|
|
283
|
+
} catch (A) {
|
|
284
|
+
A?.response?.status === 404 ? i.value = l("debouncedFilter.errors.invalid") : (r.value = [], v.value = l("debouncedFilter.errors.fetch"));
|
|
285
285
|
} finally {
|
|
286
286
|
p.value = !1;
|
|
287
287
|
}
|
|
288
288
|
else
|
|
289
|
-
p.value = !0, i.value = "", r.value = c.value?.filter((
|
|
289
|
+
p.value = !0, i.value = "", r.value = c.value?.filter((A) => {
|
|
290
290
|
let C = !1;
|
|
291
291
|
for (const E of t.searchKeys)
|
|
292
|
-
(typeof
|
|
292
|
+
(typeof A[E] == "string" ? A[E]?.toLowerCase() : A[E])?.includes(g.toLowerCase()) && (C = !0);
|
|
293
293
|
return C;
|
|
294
294
|
}), (!r.value || !r.value.length) && (i.value = l("debouncedFilter.errors.invalid")), p.value = !1;
|
|
295
295
|
}
|
|
@@ -300,60 +300,60 @@ function Ke(e, n, o, t = {
|
|
|
300
300
|
validationError: i,
|
|
301
301
|
results: r,
|
|
302
302
|
allRecords: c,
|
|
303
|
-
loadItems:
|
|
303
|
+
loadItems: _,
|
|
304
304
|
debouncedQueryChange: u
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
|
-
function Me(e,
|
|
308
|
-
const o =
|
|
309
|
-
const s = m(e), u = s.app === "kongManager" || !!(s.app === "konnect" && s.enableDeckConfig), p = m(
|
|
307
|
+
function Me(e, a) {
|
|
308
|
+
const o = L(Y, null), t = b(() => {
|
|
309
|
+
const s = m(e), u = s.app === "kongManager" || !!(s.app === "konnect" && s.enableDeckConfig), p = m(a);
|
|
310
310
|
return u && p !== void 0 && Z(p);
|
|
311
|
-
}),
|
|
311
|
+
}), n = b(() => {
|
|
312
312
|
const s = m(e), u = s.app === "konnect" && s.enableDeckConfig && typeof s.enableDeckConfig != "boolean" ? s.enableDeckConfig.customization : void 0;
|
|
313
313
|
if (u && !o) {
|
|
314
314
|
console.warn(J);
|
|
315
315
|
return;
|
|
316
316
|
}
|
|
317
317
|
return u;
|
|
318
|
-
}), l =
|
|
318
|
+
}), l = b(() => {
|
|
319
319
|
const s = m(e);
|
|
320
320
|
return s.app === "konnect" && s.enableDeckConfig && typeof s.enableDeckConfig != "boolean" ? s.enableDeckConfig.calloutPreferenceKey : s.app === "kongManager" ? s.deckCalloutPreferenceKey : void 0;
|
|
321
321
|
});
|
|
322
322
|
return {
|
|
323
323
|
isDeckEnabled: t,
|
|
324
|
-
deckCustomizationOptions:
|
|
324
|
+
deckCustomizationOptions: n,
|
|
325
325
|
deckCalloutPreferenceKey: l
|
|
326
326
|
};
|
|
327
327
|
}
|
|
328
|
-
function Re(e,
|
|
329
|
-
const o =
|
|
328
|
+
function Re(e, a) {
|
|
329
|
+
const o = L(Y, null), t = b(() => {
|
|
330
330
|
const s = m(e);
|
|
331
|
-
return (s.app === "kongManager" || !!(s.app === "konnect" && s.enableDeckTab)) && Z(m(
|
|
332
|
-
}),
|
|
331
|
+
return (s.app === "kongManager" || !!(s.app === "konnect" && s.enableDeckTab)) && Z(m(a));
|
|
332
|
+
}), n = b(() => {
|
|
333
333
|
const s = m(e), u = s.app === "konnect" && s.enableDeckTab && typeof s.enableDeckTab != "boolean" ? s.enableDeckTab.customization : void 0;
|
|
334
334
|
if (u && !o) {
|
|
335
335
|
console.warn(J);
|
|
336
336
|
return;
|
|
337
337
|
}
|
|
338
338
|
return u;
|
|
339
|
-
}), l =
|
|
339
|
+
}), l = b(() => {
|
|
340
340
|
const s = m(e);
|
|
341
341
|
return s.app === "konnect" && s.enableDeckTab && typeof s.enableDeckTab != "boolean" ? s.enableDeckTab.calloutPreferenceKey : s.app === "kongManager" ? s.deckCalloutPreferenceKey : void 0;
|
|
342
342
|
});
|
|
343
343
|
return {
|
|
344
344
|
isDeckEnabled: t,
|
|
345
|
-
deckCustomizationOptions:
|
|
345
|
+
deckCustomizationOptions: n,
|
|
346
346
|
deckCalloutPreferenceKey: l
|
|
347
347
|
};
|
|
348
348
|
}
|
|
349
|
-
function Pe(e,
|
|
350
|
-
const o =
|
|
349
|
+
function Pe(e, a) {
|
|
350
|
+
const o = V(a), t = b(
|
|
351
351
|
() => e.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${o}`) : new URL(o)
|
|
352
352
|
);
|
|
353
|
-
return t.value.search = "", (
|
|
353
|
+
return t.value.search = "", (n) => `${t.value.href}/${n}`;
|
|
354
354
|
}
|
|
355
|
-
function
|
|
356
|
-
const { i18n: { t: e } } =
|
|
355
|
+
function Ne() {
|
|
356
|
+
const { i18n: { t: e } } = O();
|
|
357
357
|
return {
|
|
358
358
|
getErrorFieldsFromError: (t) => {
|
|
359
359
|
if (!t)
|
|
@@ -366,30 +366,30 @@ function Te() {
|
|
|
366
366
|
messages: [],
|
|
367
367
|
fields: []
|
|
368
368
|
};
|
|
369
|
-
let
|
|
369
|
+
let n = [e("errors.unexpected")];
|
|
370
370
|
const l = [];
|
|
371
371
|
if (t?.response?.data) {
|
|
372
372
|
if (t.response.data.details?.length)
|
|
373
|
-
return
|
|
373
|
+
return n = [], t.response.data.details.forEach((s) => {
|
|
374
374
|
let u = e("errors.unexpected");
|
|
375
|
-
s.messages && Array.isArray(s.messages) && s.messages.length && (u = s.messages.join(", ")), s.field && l.push({ field: s.field, message: u }),
|
|
376
|
-
}), { messages:
|
|
375
|
+
s.messages && Array.isArray(s.messages) && s.messages.length && (u = s.messages.join(", ")), s.field && l.push({ field: s.field, message: u }), n.push(`${s.field ?? ""} ${u}`);
|
|
376
|
+
}), { messages: n, fields: l };
|
|
377
377
|
if (t.response.data.message && Array.isArray(t.response.data.message))
|
|
378
|
-
return
|
|
378
|
+
return n = [], t.response.data.message.forEach((s) => {
|
|
379
379
|
if (s?.constraints) {
|
|
380
380
|
const u = Object.values(s.constraints).join(", ");
|
|
381
|
-
|
|
382
|
-
} else s?.property && s?.message ? (l.push({ field: s.property, message: s.message }),
|
|
383
|
-
}), { messages:
|
|
381
|
+
n.push(u), s.property && l.push({ field: s.property, message: u });
|
|
382
|
+
} else s?.property && s?.message ? (l.push({ field: s.property, message: s.message }), n.push(s.message)) : n.push(s);
|
|
383
|
+
}), { messages: n, fields: l };
|
|
384
384
|
if (typeof t.response.data.message == "string" || typeof t.response.data == "string")
|
|
385
385
|
return {
|
|
386
386
|
messages: [t.response.data.message],
|
|
387
387
|
fields: []
|
|
388
388
|
};
|
|
389
389
|
if (typeof t.response.data == "object")
|
|
390
|
-
return
|
|
391
|
-
l.push({ field: s, message: t.response.data[s] }),
|
|
392
|
-
}), { messages:
|
|
390
|
+
return n = [], Object.keys(t.response.data).forEach((s) => {
|
|
391
|
+
l.push({ field: s, message: t.response.data[s] }), n.push(t.response.data[s]);
|
|
392
|
+
}), { messages: n, fields: l };
|
|
393
393
|
}
|
|
394
394
|
return {
|
|
395
395
|
messages: [t.message || e("errors.unexpected")],
|
|
@@ -405,81 +405,81 @@ function Te() {
|
|
|
405
405
|
if (t.response.data.detail)
|
|
406
406
|
return t.response.data.detail;
|
|
407
407
|
if (t.response.data.details?.length)
|
|
408
|
-
return t.response.data.details.map((
|
|
408
|
+
return t.response.data.details.map((n) => {
|
|
409
409
|
let l = e("errors.unexpected");
|
|
410
|
-
return
|
|
410
|
+
return n.messages && typeof n.messages == "object" && n.messages.length && (l = n.messages.join(", ")), n.field ? `${n.field} - ${l}` : l;
|
|
411
411
|
}).join("; ");
|
|
412
412
|
if (t.response.data.message) {
|
|
413
|
-
const { message:
|
|
414
|
-
return Array.isArray(
|
|
413
|
+
const { message: n } = t.response.data;
|
|
414
|
+
return Array.isArray(n) ? n[0]?.constraints ? Object.values(n[0].constraints)[0] : n[0] : n;
|
|
415
415
|
}
|
|
416
416
|
if (typeof t.response.data == "string")
|
|
417
417
|
return t.response.data;
|
|
418
418
|
if (typeof t.response.data == "object")
|
|
419
|
-
return Object.keys(t.response.data).map((
|
|
419
|
+
return Object.keys(t.response.data).map((n) => `${n} ${t.response.data[n]}`).join(", ");
|
|
420
420
|
}
|
|
421
421
|
return t.message || e("errors.unexpected");
|
|
422
422
|
}
|
|
423
423
|
};
|
|
424
424
|
}
|
|
425
|
-
function
|
|
426
|
-
const
|
|
425
|
+
function Te(e) {
|
|
426
|
+
const a = window.location.origin, o = a.endsWith("/") ? a : `${a}/`;
|
|
427
427
|
try {
|
|
428
|
-
const t = e.join("/"),
|
|
429
|
-
if (/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(
|
|
428
|
+
const t = e.join("/"), n = `${o}${t}`, l = e.some((u) => u.trim() === "");
|
|
429
|
+
if (/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(n) && !l && new URL(n))
|
|
430
430
|
return `${o}${t}`;
|
|
431
431
|
throw new Error("Invalid url");
|
|
432
432
|
} catch (t) {
|
|
433
433
|
return console.warn("Failed to build valid URL:", t), "";
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
function ee(e,
|
|
437
|
-
const o =
|
|
438
|
-
const
|
|
439
|
-
return typeof
|
|
440
|
-
}), t =
|
|
441
|
-
const
|
|
442
|
-
return
|
|
436
|
+
function ee(e, a) {
|
|
437
|
+
const o = b(() => {
|
|
438
|
+
const n = m(e);
|
|
439
|
+
return typeof n.isExactMatch == "boolean" ? n.isExactMatch : n.app === "konnect";
|
|
440
|
+
}), t = b(() => {
|
|
441
|
+
const n = m(a);
|
|
442
|
+
return n.startsWith("/") ? new URL(`${window.location.origin}${n}`) : new URL(n);
|
|
443
443
|
});
|
|
444
|
-
return (
|
|
445
|
-
const { page: l, pageSize: s, offset: u, sortColumnKey: p, sortColumnOrder: v, query: i } =
|
|
444
|
+
return (n) => {
|
|
445
|
+
const { page: l, pageSize: s, offset: u, sortColumnKey: p, sortColumnOrder: v, query: i } = n;
|
|
446
446
|
try {
|
|
447
447
|
let r = new URL(t.value.href);
|
|
448
448
|
if (o.value && i) {
|
|
449
449
|
const d = new URLSearchParams(t.value.search);
|
|
450
|
-
r.search = ""
|
|
450
|
+
r.search = "";
|
|
451
|
+
const c = !m(e).isExactMatch, f = c && r.pathname.endsWith("/search");
|
|
452
|
+
r = c ? new URL(`${r.href}?filter[name][contains]=${i}`) : new URL(`${r.href}/${i}`), d.forEach((y, _) => r.searchParams.append(_, y)), f && r.searchParams.append("size", String(s));
|
|
451
453
|
} else
|
|
452
454
|
o.value || new URLSearchParams(i).forEach((d, c) => {
|
|
453
455
|
r.searchParams.append(c, d);
|
|
454
456
|
}), p && r.searchParams.append("sort_by", p), v === "desc" && r.searchParams.append("sort_desc", "1"), r.searchParams.append("size", String(s));
|
|
455
457
|
return u && l !== 1 && r.searchParams.append("offset", String(u)), r.href;
|
|
456
458
|
} catch (r) {
|
|
457
|
-
return console.error("RouteList(fetcher)", r), m(
|
|
459
|
+
return console.error("RouteList(fetcher)", r), m(a);
|
|
458
460
|
}
|
|
459
461
|
};
|
|
460
462
|
}
|
|
461
463
|
const $ = /* @__PURE__ */ new Map();
|
|
462
|
-
function $e(e,
|
|
463
|
-
const t =
|
|
464
|
+
function $e(e, a, o) {
|
|
465
|
+
const t = h(!0), n = m(e), { axiosInstance: l } = P(n.axiosRequestConfig), s = ee(e, a), u = h({
|
|
464
466
|
status: I.Idle
|
|
465
467
|
}), p = async (r) => {
|
|
466
468
|
const d = m(o) || "data";
|
|
467
469
|
try {
|
|
468
470
|
u.value = t.value ? { status: I.InitialLoad } : { status: I.Loading }, t.value = !1;
|
|
469
|
-
|
|
470
|
-
c.includes("filter[name]") && (c = `${c}&page[size]=${r.pageSize}&page[number]=${r.page}`);
|
|
471
|
-
const f = await l.get(c);
|
|
471
|
+
const c = Be(s(r), r), f = await l.get(c);
|
|
472
472
|
if (f.status >= 400)
|
|
473
473
|
throw f;
|
|
474
|
-
const
|
|
474
|
+
const y = f.data, _ = d && d.replace(/[^\w-_]/gi, "");
|
|
475
475
|
let w;
|
|
476
|
-
|
|
476
|
+
y[_] ? w = Array.isArray(y[_]) ? y[_] : [y[_]] : Array.isArray(y) ? w = y : w = Object.keys(y).length ? [y] : [];
|
|
477
477
|
const x = {
|
|
478
478
|
data: w,
|
|
479
479
|
total: w.length,
|
|
480
|
-
...
|
|
480
|
+
...y.offset ? {
|
|
481
481
|
pagination: {
|
|
482
|
-
offset:
|
|
482
|
+
offset: y.offset
|
|
483
483
|
}
|
|
484
484
|
} : null
|
|
485
485
|
};
|
|
@@ -505,51 +505,61 @@ function $e(e, n, o) {
|
|
|
505
505
|
error: c.response ? c : { response: c }
|
|
506
506
|
}, f);
|
|
507
507
|
}
|
|
508
|
-
}, v =
|
|
508
|
+
}, v = n.cacheIdentifier, i = te(v);
|
|
509
509
|
return { fetcher: p, fetcherState: u, fetcherCacheKey: i };
|
|
510
510
|
}
|
|
511
|
+
function Be(e, { pageSize: a, page: o }) {
|
|
512
|
+
if (!e.includes("filter[name]"))
|
|
513
|
+
return e;
|
|
514
|
+
try {
|
|
515
|
+
if (new URL(e, window.location.origin).pathname.endsWith("/search"))
|
|
516
|
+
return e;
|
|
517
|
+
} catch {
|
|
518
|
+
}
|
|
519
|
+
return `${e}&page[size]=${a}&page[number]=${o}`;
|
|
520
|
+
}
|
|
511
521
|
function te(e) {
|
|
512
522
|
if (e) {
|
|
513
|
-
let
|
|
514
|
-
return
|
|
523
|
+
let a = $.get(e);
|
|
524
|
+
return a || (a = h(1), $.set(e, a)), a;
|
|
515
525
|
}
|
|
516
|
-
return
|
|
526
|
+
return h(1);
|
|
517
527
|
}
|
|
518
|
-
function
|
|
519
|
-
const e = (t,
|
|
528
|
+
function Fe() {
|
|
529
|
+
const e = (t, n = "_") => t ? t.split(n).map((l) => l.toLowerCase() === "id" ? l.toUpperCase() : l.charAt(0).toUpperCase() + l.substring(1)).join(" ") : "", a = /(?:^|[\s-:'"])\w/g;
|
|
520
530
|
return {
|
|
521
|
-
capitalize: (t) => t ? t.replace(
|
|
531
|
+
capitalize: (t) => t ? t.replace(a, (n) => n.toUpperCase()) : "",
|
|
522
532
|
convertKeyToTitle: e
|
|
523
533
|
};
|
|
524
534
|
}
|
|
525
|
-
const se = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,
|
|
535
|
+
const se = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, B = (e) => {
|
|
526
536
|
if (typeof e != "string")
|
|
527
537
|
throw new TypeError("Invalid argument expected string");
|
|
528
|
-
const
|
|
529
|
-
if (!
|
|
538
|
+
const a = e.match(se);
|
|
539
|
+
if (!a)
|
|
530
540
|
throw new Error(`Invalid argument not valid semver ('${e}' received)`);
|
|
531
|
-
return
|
|
532
|
-
},
|
|
533
|
-
const
|
|
534
|
-
return isNaN(
|
|
535
|
-
},
|
|
536
|
-
if (
|
|
541
|
+
return a.shift(), a;
|
|
542
|
+
}, F = (e) => e === "*" || e === "x" || e === "X", U = (e) => {
|
|
543
|
+
const a = parseInt(e, 10);
|
|
544
|
+
return isNaN(a) ? e : a;
|
|
545
|
+
}, Ue = (e, a) => typeof e != typeof a ? [String(e), String(a)] : [e, a], je = (e, a) => {
|
|
546
|
+
if (F(e) || F(a))
|
|
537
547
|
return 0;
|
|
538
|
-
const [o, t] =
|
|
548
|
+
const [o, t] = Ue(U(e), U(a));
|
|
539
549
|
return o > t ? 1 : o < t ? -1 : 0;
|
|
540
|
-
}, j = (e,
|
|
541
|
-
for (let o = 0; o < Math.max(e.length,
|
|
542
|
-
const t =
|
|
550
|
+
}, j = (e, a) => {
|
|
551
|
+
for (let o = 0; o < Math.max(e.length, a.length); o++) {
|
|
552
|
+
const t = je(e[o] || "0", a[o] || "0");
|
|
543
553
|
if (t !== 0)
|
|
544
554
|
return t;
|
|
545
555
|
}
|
|
546
556
|
return 0;
|
|
547
|
-
},
|
|
548
|
-
const o =
|
|
549
|
-
return s !== 0 ? s :
|
|
550
|
-
}, G = (e,
|
|
551
|
-
|
|
552
|
-
const t =
|
|
557
|
+
}, Ge = (e, a) => {
|
|
558
|
+
const o = B(e), t = B(a), n = o.pop(), l = t.pop(), s = j(o, t);
|
|
559
|
+
return s !== 0 ? s : n && l ? j(n.split("."), l.split(".")) : n || l ? n ? -1 : 1 : 0;
|
|
560
|
+
}, G = (e, a, o) => {
|
|
561
|
+
ze(o);
|
|
562
|
+
const t = Ge(e, a);
|
|
553
563
|
return ae[o].includes(t);
|
|
554
564
|
}, ae = {
|
|
555
565
|
">": [1],
|
|
@@ -558,45 +568,45 @@ const se = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-(
|
|
|
558
568
|
"<=": [-1, 0],
|
|
559
569
|
"<": [-1],
|
|
560
570
|
"!=": [-1, 1]
|
|
561
|
-
}, z = Object.keys(ae),
|
|
571
|
+
}, z = Object.keys(ae), ze = (e) => {
|
|
562
572
|
if (typeof e != "string")
|
|
563
573
|
throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);
|
|
564
574
|
if (z.indexOf(e) === -1)
|
|
565
575
|
throw new Error(`Invalid operator, expected one of ${z.join("|")}`);
|
|
566
|
-
},
|
|
576
|
+
}, Se = (e) => typeof e == "string" && /^[v\d]/.test(e) && se.test(e);
|
|
567
577
|
function Ve(e) {
|
|
568
|
-
const { gatewayInfo:
|
|
569
|
-
if (!
|
|
578
|
+
const { gatewayInfo: a, supportedRange: o } = e;
|
|
579
|
+
if (!a)
|
|
570
580
|
return !0;
|
|
571
|
-
const { edition: t, version:
|
|
572
|
-
if (!
|
|
581
|
+
const { edition: t, version: n } = a;
|
|
582
|
+
if (!Se(n))
|
|
573
583
|
return console.error("Invalid version"), !1;
|
|
574
584
|
const l = o[t];
|
|
575
585
|
if (!l)
|
|
576
586
|
return !1;
|
|
577
587
|
const [s, u] = l;
|
|
578
|
-
return !(s && G(
|
|
588
|
+
return !(s && G(n, s, "<") || u && G(n, u, ">"));
|
|
579
589
|
}
|
|
580
|
-
function
|
|
581
|
-
const
|
|
590
|
+
function We(e) {
|
|
591
|
+
const a = h(0), o = h(0), t = h(!1);
|
|
582
592
|
return oe(e, (l) => {
|
|
583
|
-
l && !t.value && (
|
|
593
|
+
l && !t.value && (a.value = l.offsetWidth, o.value = l.scrollWidth, t.value = !0);
|
|
584
594
|
}), {
|
|
585
|
-
isTruncated:
|
|
595
|
+
isTruncated: b(() => a.value < o.value)
|
|
586
596
|
};
|
|
587
597
|
}
|
|
588
598
|
function He() {
|
|
589
|
-
const { i18n: { t: e } } =
|
|
599
|
+
const { i18n: { t: e } } = O();
|
|
590
600
|
return {
|
|
591
601
|
utf8Name: (o) => /^[\p{N}\p{L}.\-_~]*$/u.test(o) ? "" : e("validationErrors.utf8Name")
|
|
592
602
|
};
|
|
593
603
|
}
|
|
594
|
-
const
|
|
595
|
-
|
|
596
|
-
}, ne = () =>
|
|
597
|
-
const
|
|
598
|
-
const t =
|
|
599
|
-
if ((t?.type === "array" || t?.type === "set") &&
|
|
604
|
+
const N = /* @__PURE__ */ Symbol("schema"), Ye = (e) => {
|
|
605
|
+
W(N, e);
|
|
606
|
+
}, ne = () => L(N, void 0), Je = (e) => /^\d+$/.test(e), Qe = (e) => {
|
|
607
|
+
const a = ne(), o = b(() => {
|
|
608
|
+
const t = a?.value, n = e();
|
|
609
|
+
if ((t?.type === "array" || t?.type === "set") && Je(n)) {
|
|
600
610
|
const s = t.elements;
|
|
601
611
|
return s && {
|
|
602
612
|
...s,
|
|
@@ -604,30 +614,30 @@ const T = /* @__PURE__ */ Symbol("schema"), We = (e) => {
|
|
|
604
614
|
encrypted: !!(t.encrypted || s.encrypted)
|
|
605
615
|
};
|
|
606
616
|
}
|
|
607
|
-
return t?.fields?.find((s) => Object.keys(s)[0] ===
|
|
617
|
+
return t?.fields?.find((s) => Object.keys(s)[0] === n)?.[n];
|
|
608
618
|
});
|
|
609
|
-
return
|
|
619
|
+
return W(N, o), o;
|
|
610
620
|
};
|
|
611
|
-
function
|
|
612
|
-
let
|
|
613
|
-
const o =
|
|
621
|
+
function Xe(e) {
|
|
622
|
+
let a = "";
|
|
623
|
+
const o = h(!1), t = h(null), n = b(() => {
|
|
614
624
|
let s;
|
|
615
625
|
return o.value ? s = !0 : t.value ? s = t.value.hasData || e && m(e) : s = !1, !s;
|
|
616
626
|
});
|
|
617
627
|
return {
|
|
618
628
|
tableState: t,
|
|
619
629
|
hasRecords: o,
|
|
620
|
-
hideTableToolbar:
|
|
630
|
+
hideTableToolbar: n,
|
|
621
631
|
handleStateChange: (s) => {
|
|
622
|
-
s.hasData ? o.value = !0 : s.state === "success" && !s.hasData && (!e || !
|
|
632
|
+
s.hasData ? o.value = !0 : s.state === "success" && !s.hasData && (!e || !a) && (o.value = !1), e && (a = m(e)), t.value = { ...s };
|
|
623
633
|
}
|
|
624
634
|
};
|
|
625
635
|
}
|
|
626
636
|
function re() {
|
|
627
|
-
const e =
|
|
628
|
-
return
|
|
637
|
+
const e = L(ce.MANAGED_BY, !1);
|
|
638
|
+
return b(() => !!m(e));
|
|
629
639
|
}
|
|
630
|
-
const
|
|
640
|
+
const Ze = (e) => e?.service || e?.tool || null, qe = "Custom", S = {
|
|
631
641
|
"terraform-provider-konnect": "Terraform",
|
|
632
642
|
deck: "decK",
|
|
633
643
|
"kong-gateway-operator": "Kong Gateway Operator",
|
|
@@ -636,79 +646,79 @@ const Xe = (e) => e?.service || e?.tool || null, Ze = "Custom", V = {
|
|
|
636
646
|
"gw-manager": "Konnect UI",
|
|
637
647
|
"ai-manager": "AI Manager",
|
|
638
648
|
"dev-portal": "Dev Portal"
|
|
639
|
-
},
|
|
640
|
-
const
|
|
641
|
-
return
|
|
649
|
+
}, gt = (e) => {
|
|
650
|
+
const a = Ze(e);
|
|
651
|
+
return a ? Object.hasOwn(S, a) ? S[a] : qe : null;
|
|
642
652
|
};
|
|
643
653
|
let M;
|
|
644
|
-
const
|
|
645
|
-
function
|
|
654
|
+
const et = () => (M === void 0 && (M = H("en-us", Q).t("baseConfigCard.commonFields.managed_by_label")), M);
|
|
655
|
+
function tt(e, a = {}) {
|
|
646
656
|
const o = re();
|
|
647
657
|
return {
|
|
648
658
|
defaultTablePreferences: {
|
|
649
659
|
columnVisibility: {
|
|
650
660
|
managed_by: !1,
|
|
651
|
-
...
|
|
661
|
+
...a
|
|
652
662
|
}
|
|
653
663
|
},
|
|
654
|
-
tableHeaders:
|
|
664
|
+
tableHeaders: b(() => ({
|
|
655
665
|
...m(e),
|
|
656
|
-
...o.value ? { managed_by: { label:
|
|
666
|
+
...o.value ? { managed_by: { label: et(), sortable: !1 } } : {}
|
|
657
667
|
}))
|
|
658
668
|
};
|
|
659
669
|
}
|
|
660
|
-
const
|
|
670
|
+
const mt = {
|
|
661
671
|
useAxios: P,
|
|
662
672
|
useDebouncedFilter: Ke,
|
|
663
673
|
useDeleteUrlBuilder: Pe,
|
|
664
674
|
useBaseEntityDeckOptions: Me,
|
|
665
675
|
useBaseFormDeckOptions: Re,
|
|
666
|
-
useErrors:
|
|
667
|
-
useExternalLinkCreator:
|
|
676
|
+
useErrors: Ne,
|
|
677
|
+
useExternalLinkCreator: Te,
|
|
668
678
|
useFetcher: $e,
|
|
669
679
|
useFetcherCacheKey: te,
|
|
670
680
|
useFetchUrlBuilder: ee,
|
|
671
681
|
useHelpers: q,
|
|
672
|
-
useStringHelpers:
|
|
673
|
-
useI18n:
|
|
682
|
+
useStringHelpers: Fe,
|
|
683
|
+
useI18n: O,
|
|
674
684
|
useGatewayFeatureSupported: Ve,
|
|
675
|
-
useTruncationDetector:
|
|
685
|
+
useTruncationDetector: We,
|
|
676
686
|
useValidators: He,
|
|
677
687
|
useSchema: ne,
|
|
678
|
-
useSchemaProvider:
|
|
679
|
-
useSubSchema:
|
|
680
|
-
useTableState:
|
|
688
|
+
useSchemaProvider: Ye,
|
|
689
|
+
useSubSchema: Qe,
|
|
690
|
+
useTableState: Xe,
|
|
681
691
|
useManagedByEnabled: re,
|
|
682
|
-
useManagedByColumn:
|
|
683
|
-
},
|
|
692
|
+
useManagedByColumn: tt
|
|
693
|
+
}, yt = (e, a) => {
|
|
684
694
|
const o = e.__vccOpts || e;
|
|
685
|
-
for (const [t,
|
|
686
|
-
o[t] =
|
|
695
|
+
for (const [t, n] of a)
|
|
696
|
+
o[t] = n;
|
|
687
697
|
return o;
|
|
688
698
|
};
|
|
689
699
|
export {
|
|
690
700
|
R as C,
|
|
691
701
|
Y as D,
|
|
692
|
-
|
|
702
|
+
dt as E,
|
|
693
703
|
I as F,
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
704
|
+
ft as I,
|
|
705
|
+
S as M,
|
|
706
|
+
rt as P,
|
|
707
|
+
ct as S,
|
|
708
|
+
yt as _,
|
|
709
|
+
ot as a,
|
|
710
|
+
it as b,
|
|
711
|
+
mt as c,
|
|
702
712
|
X as d,
|
|
703
|
-
|
|
713
|
+
ut as e,
|
|
704
714
|
J as f,
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
715
|
+
gt as g,
|
|
716
|
+
Le as h,
|
|
717
|
+
pt as i,
|
|
718
|
+
Oe as j,
|
|
719
|
+
lt as k,
|
|
710
720
|
ce as l,
|
|
711
|
-
|
|
721
|
+
et as m,
|
|
712
722
|
de as n,
|
|
713
723
|
Z as o,
|
|
714
724
|
q as u
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const U=require("axios"),c=require("vue"),M=require("@kong-ui-public/i18n"),oe=Symbol("PLUGIN_FORM_LAYOUT_STATE"),ie=Symbol("CONFIG_CARD_SHOW_SENSITIVE_FIELDS"),x=Symbol("DECK_COMMAND_EDITOR"),K="[entities-shared] DeckCommandEditor was not provided. Provide it via the `DECK_COMMAND_EDITOR_KEY` injection key or the `provideDeckCommandEditor` helper (see @kong-ui-public/entities-shared/deck-editor).",ce="50vh",le=2e5,Y={MANAGED_BY:"KM-3018-entity-managed-by"};function ue(){return{getAxiosInstance:(e={})=>{try{const n=c.inject("get-axios-instance",void 0);return typeof n=="function"?n(e):U.create({withCredentials:!0,timeout:3e4,...e})}catch(n){return console.warn("getAxiosInstance:",n.message||n),U.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{const n=e?.response?.headers||{};return n["x-trace-id"]||n["x-datadog-trace-id"]||""}}}function de(){return{debounce:(e,n)=>{let o;return(...t)=>{clearTimeout(o),o=window?.setTimeout(()=>{e(...t)},n)}}}}const L="khcp-user-table-preferences",J={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0,columnVisibility:{}};function fe(){const e=o=>{if(typeof o=="string")try{return JSON.parse(o)}catch(t){console.error("useTablePreferences(tryParseJson)",t);return}},n=()=>{const o=e(localStorage.getItem(L));return!o||!Object.keys(o).length?new Map:new Map(Object.entries(o))};return{setTablePreferences:(o,t)=>{try{const s=n();s.set(o,t),localStorage.setItem(L,JSON.stringify(Object.fromEntries(s.entries())))}catch(s){console.error("useTablePreferences(setTablePreferences)",s)}},getTablePreferences:(o,t)=>n()?.get(o)||void 0||t||J,deleteAllTablePreferences:()=>{localStorage.removeItem(L)}}}function N(e={}){const{getAxiosInstance:n}=ue();return{axiosInstance:n(e)}}const pe={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},ge={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},me={actions:{viewConfiguration:"View configuration",hideConfiguration:"Hide configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON",terraform:"Terraform",deck:"decK"},errors:{edit:"The entity could not be edited at this time."}},ye={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},he={title:"Configuration",actions:{copy:"Copy JSON",deck_customize:"Customize before copying to CLI",deck_customize_cancel:"Cancel",sensitive_fields:"Show sensitive fields",sensitive_fields_tooltip:"View masked sensitive data in your configurations if any field values have been redacted."},sections:{advanced:"Advanced",plugin:"Plugin specific configuration",policy:"Policy specific configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last updated",created_at_label:"Created",managed_by_label:"Managed By",tags_label:"Tags",link:"Link",partial_label:"Redis configuration"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{formatLabel:"Format:",entryTitle:"Entry {index}",structuredFormat:"Structured"}},be={learnMore:"Learn more",pricingTitle:"Pricing: "},_e={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},ve={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Ae={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Ce={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},Ie={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},ke={copy_url:"Copy URL"},we={hint:{konnect:"The {token} environment variable must be added first. See {link} for details.",kongManager:"If your Admin API is secured, set up authentication following {link}."},documentation:"the documentation",steps:{step_1:"Step 1: Export token",step_2:"Step 2: Apply configuration"},customization:{title:"Customize before copying to CLI",copy_pat:"Make sure to copy your personal access token now. You won't be able to see it again.",reuse_pat:"Use an existing PAT if you've already generated one.",generate_pat:"Generate PAT",footer_reminder:"Changes you make here won't affect your configuration. After you apply changes with decK in the CLI, refresh the page to view them.",secret_advise:"Command may contain sensitive values. Treat it as a secret."},copy_tooltip:"Copy"},Ee={body:"Want a ready-to-use CLI command? {cta} to view this configuration as a decK sync snippet you can copy directly.",cta:"Switch to decK format"},De={title:"Generate a Personal Access Token",description:"Personal access tokens are used to authenticate decK commands and Konnect API requests.",fields:{name:{label:"Name",placeholder:"Enter token name"},expiresAt:{label:"Expiration date",placeholder:"Select an expiration date",n_days:"{n} days"}},actions:{cancel:"Cancel",generate:"Generate",generating:"Generating…"}},Oe={dismissLabel:"Dismiss"},Le={rotateKey:"Rotate key",generateKey:"Generate key",placeholder:"Enter or generate a key",oneTimeHint:"The key is shown only once. Copy it now and store it securely.",copy:"Copy",showKey:"Show key",hideKey:"Hide key"},X={global:pe,deleteModal:ge,baseForm:me,baseTable:ye,baseConfigCard:he,emptyState:be,filter:_e,debouncedFilter:ve,errors:Ae,validationErrors:Ce,toggleModal:Ie,jsonCodeBlock:ke,deckCodeBlock:we,deckCallout:Ee,generatePatModal:De,onboardingCard:Oe,sensitiveInput:Le};function O(){const e=M.createI18n("en-us",X);return{i18n:e,i18nT:M.i18nTComponent(e)}}var C=(e=>(e[e.InitialLoad=0]="InitialLoad",e[e.Loading=1]="Loading",e[e.Idle=2]="Idle",e[e.NoResults=3]="NoResults",e[e.NoRecords=4]="NoRecords",e[e.Error=5]="Error",e))(C||{}),P=(e=>(e.CaCertificate="ca_certificate",e.Certificate="certificate",e.Consumer="consumer",e.ConsumerGroup="consumer_group",e.GatewayService="service",e.Key="key",e.KeySet="set",e.Plugin="plugin",e.Route="route",e.SNI="sni",e.Upstream="upstream",e.Target="target",e.Vault="vault",e.Partial="partial",e.CloudGatewayAddon="cloud_gateway_addon",e.BackendCluster="backend_cluster",e.VirtualCluster="virtual_cluster",e.Listener="listener",e.ProducePolicy="produce_policy",e.ConsumePolicy="consume_policy",e.ClusterPolicy="cluster_policy",e.ListenerPolicy="listener_policy",e.SchemaRegistry="schema_registry",e.StaticKey="static_key",e.TlsTrustBundle="tls_trust_bundle",e.AuthServer="auth_server",e.AuthServerScopes="auth_server_scopes",e.AuthServerClaims="auth_server_claims",e.AuthServerClients="auth_server_clients",e.Other="other",e.PluginSchema="plugin_schema",e.CustomPlugin="custom_plugin",e.ClonedPlugin="cloned_plugin",e))(P||{});const Te=Object.values(P),Q=["ca_certificate","certificate","consumer","consumer_group","service","key","set","plugin","plugin_schema","custom_plugin","cloned_plugin","route","upstream","target","vault","partial"];function F(e){return Q.includes(e)}const Me=["backend_cluster","virtual_cluster","listener","produce_policy","consume_policy","cluster_policy","listener_policy","schema_registry","static_key","tls_trust_bundle"],Re=["auth_server","auth_server_scopes","auth_server_claims","auth_server_clients"];var D=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.CopyBadge="copy-badge",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e.ManagedBy="managed-by",e))(D||{}),Z=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e.Policy="policy",e))(Z||{});const xe=["structured","yaml","json","terraform","deck"];function B(){const e=(i,r)=>r?.[i]??void 0,n=(i,r)=>{if(i.length!==r.length)return!1;const f=new Set([...i,...r]);for(const l of f){const p=i.filter(b=>b===l).length,y=r.filter(b=>b===l).length;if(p!==y)return!1}return!0},o=(i,r,f)=>{if(f){if(Object.keys(i).length===Object.keys(r).length)for(const l in i)if(Array.isArray(i[l])&&Array.isArray(r[l])){if(n(i[l],r[l]))continue;return!1}else{if(i[l]===r[l])continue;return!1}else return!1;return!0}try{return JSON.stringify(i)===JSON.stringify(r)}catch{return!1}},t=i=>(r,f)=>{let l=r[i]===void 0||r[i]===null?"":r[i],p=f[i]===void 0||f[i]===null?"":f[i];return Array.isArray(r[i])&&(l=r[i][0]),Array.isArray(f[i])&&(p=f[i][0]),l.localeCompare(p)},s=i=>i?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(i):!1,u="********",a=i=>!!i&&typeof i=="object"&&!Array.isArray(i),d=(i,r)=>i?.find(l=>Object.keys(l)?.[0]===r)?.[r],g=(i,r)=>{if(!r||i===null||i===void 0)return i;if(r.type==="string")return r.encrypted?u:i;if(r.type==="record"||r.type==="map"){if(!a(i))return i;if(r.type==="map"&&!r.values)return{...i};const f={};for(const l in i)if(r.type==="record"){const p=d(r.fields,l);f[l]=p?g(i[l],p):i[l]}else if(r.type==="map"){const p=r.values;f[l]=g(i[l],{...p,encrypted:!!(r.encrypted||p.encrypted)})}return f}if((r.type==="array"||r.type==="set")&&Array.isArray(i)){const f=r.elements;return f?i.map(l=>g(l,{...f,encrypted:!!(r.encrypted||f.encrypted)})):i.slice()}return i},h=(i,r)=>{if(Array.isArray(i))return i.map(l=>h(l,r));if(!a(i))return i;const f={};for(const l in i){if(r[l]?.type===D.Redacted){f[l]=u;continue}if(r[l]?.type===D.RedactedArray&&Array.isArray(i[l])){f[l]=i[l].map(()=>u);continue}f[l]=h(i[l],r)}return f};return{getPropValue:e,objectsAreEqual:o,sortAlpha:t,isValidUuid:s,isObjectRecord:a,getApiSchemaField:d,redactByApiSchema:g,redactByConfigSchema:h}}function Ke(e,n,o,t={fetchedItemsKey:"data",searchKeys:["id"]}){o||(o="1000");const{axiosInstance:s}=N(e.axiosRequestConfig),{i18n:{t:u}}=O(),{debounce:a}=de(),d=a(async m=>{await k(m)},200),g=c.ref(!1),h=c.ref(""),i=c.ref(""),r=c.ref([]),f=c.ref([]),l=c.ref(void 0),p=c.computed(()=>{let m=`${e.apiBaseUrl}${c.unref(n)}`;return e.app==="konnect"&&(m=m.replace(/{controlPlaneId}/gi,e?.controlPlaneId||"")),m.replace(/\/{workspace}/gi,e?.workspace?`/${e.workspace}`:"")}),{isValidUuid:y}=B(),b=async()=>{try{g.value=!0;const{data:m}=await s.get(`${p.value}?size=${o}`);m?.next||(l.value=t.fetchedItemsKey in m?m[t.fetchedItemsKey]:[]),f.value=t.fetchedItemsKey in m?m[t.fetchedItemsKey]:[],r.value=f.value}catch{r.value=[],h.value=u("debouncedFilter.errors.fetch")}finally{g.value=!1}},I=c.ref(""),k=async m=>{if(I.value!==m){if(I.value=m??"",!m){r.value=f.value;return}if(l.value===void 0)try{if(g.value=!0,h.value="",i.value="",e.app==="konnect"){const _=`${p.value}/${m}`,{data:v}=await s.get(`${_}?size=${o}`);t.fetchedItemsKey in v?r.value=v[t.fetchedItemsKey]:v?.[t.exactMatchKey??"id"]?r.value=[v]:r.value=[]}else{const _=[];y(m)&&t.searchKeys.includes("id")?_.push((async()=>{const{data:A}=await s.get(`${p.value}/${m}`);return[A[t.fetchedItemsKey]??A]})()):_.push(...t.searchKeys.filter(A=>A!=="id").map(async A=>{const{data:E}=await s.get(`${p.value}?${A}=${m}`);return E[t.fetchedItemsKey]}));const v=await Promise.all(_),w=new Set;r.value=[],v?.forEach?.(A=>{A?.forEach?.(E=>{w.has(E.id)||(w.add(E.id),r.value.push(E))})})}}catch(_){_?.response?.status===404?i.value=u("debouncedFilter.errors.invalid"):(r.value=[],h.value=u("debouncedFilter.errors.fetch"))}finally{g.value=!1}else g.value=!0,i.value="",r.value=l.value?.filter(_=>{let v=!1;for(const w of t.searchKeys)(typeof _[w]=="string"?_[w]?.toLowerCase():_[w])?.includes(m.toLowerCase())&&(v=!0);return v}),(!r.value||!r.value.length)&&(i.value=u("debouncedFilter.errors.invalid")),g.value=!1}};return{loading:g,error:h,validationError:i,results:r,allRecords:l,loadItems:b,debouncedQueryChange:d}}function Ne(e,n){const o=c.inject(x,null),t=c.computed(()=>{const a=c.toValue(e),d=a.app==="kongManager"||!!(a.app==="konnect"&&a.enableDeckConfig),g=c.toValue(n);return d&&g!==void 0&&F(g)}),s=c.computed(()=>{const a=c.toValue(e),d=a.app==="konnect"&&a.enableDeckConfig&&typeof a.enableDeckConfig!="boolean"?a.enableDeckConfig.customization:void 0;if(d&&!o){console.warn(K);return}return d}),u=c.computed(()=>{const a=c.toValue(e);return a.app==="konnect"&&a.enableDeckConfig&&typeof a.enableDeckConfig!="boolean"?a.enableDeckConfig.calloutPreferenceKey:a.app==="kongManager"?a.deckCalloutPreferenceKey:void 0});return{isDeckEnabled:t,deckCustomizationOptions:s,deckCalloutPreferenceKey:u}}function Pe(e,n){const o=c.inject(x,null),t=c.computed(()=>{const a=c.toValue(e);return(a.app==="kongManager"||!!(a.app==="konnect"&&a.enableDeckTab))&&F(c.toValue(n))}),s=c.computed(()=>{const a=c.toValue(e),d=a.app==="konnect"&&a.enableDeckTab&&typeof a.enableDeckTab!="boolean"?a.enableDeckTab.customization:void 0;if(d&&!o){console.warn(K);return}return d}),u=c.computed(()=>{const a=c.toValue(e);return a.app==="konnect"&&a.enableDeckTab&&typeof a.enableDeckTab!="boolean"?a.enableDeckTab.calloutPreferenceKey:a.app==="kongManager"?a.deckCalloutPreferenceKey:void 0});return{isDeckEnabled:t,deckCustomizationOptions:s,deckCalloutPreferenceKey:u}}function Fe(e,n){const o=c.unref(n),t=c.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${o}`):new URL(o));return t.value.search="",s=>`${t.value.href}/${s}`}function Be(){const{i18n:{t:e}}=O();return{getErrorFieldsFromError:t=>{if(!t)return{messages:[e("errors.unexpected")],fields:[]};if(t?.response?.status===401)return{messages:[],fields:[]};let s=[e("errors.unexpected")];const u=[];if(t?.response?.data){if(t.response.data.details?.length)return s=[],t.response.data.details.forEach(a=>{let d=e("errors.unexpected");a.messages&&Array.isArray(a.messages)&&a.messages.length&&(d=a.messages.join(", ")),a.field&&u.push({field:a.field,message:d}),s.push(`${a.field??""} ${d}`)}),{messages:s,fields:u};if(t.response.data.message&&Array.isArray(t.response.data.message))return s=[],t.response.data.message.forEach(a=>{if(a?.constraints){const d=Object.values(a.constraints).join(", ");s.push(d),a.property&&u.push({field:a.property,message:d})}else a?.property&&a?.message?(u.push({field:a.property,message:a.message}),s.push(a.message)):s.push(a)}),{messages:s,fields:u};if(typeof t.response.data.message=="string"||typeof t.response.data=="string")return{messages:[t.response.data.message],fields:[]};if(typeof t.response.data=="object")return s=[],Object.keys(t.response.data).forEach(a=>{u.push({field:a,message:t.response.data[a]}),s.push(t.response.data[a])}),{messages:s,fields:u}}return{messages:[t.message||e("errors.unexpected")],fields:[]}},getMessageFromError:t=>{if(!t)return e("errors.unexpected");if(t?.response?.status===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if(t?.response?.data){if(t.response.data.detail)return t.response.data.detail;if(t.response.data.details?.length)return t.response.data.details.map(s=>{let u=e("errors.unexpected");return s.messages&&typeof s.messages=="object"&&s.messages.length&&(u=s.messages.join(", ")),s.field?`${s.field} - ${u}`:u}).join("; ");if(t.response.data.message){const{message:s}=t.response.data;return Array.isArray(s)?s[0]?.constraints?Object.values(s[0].constraints)[0]:s[0]:s}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(s=>`${s} ${t.response.data[s]}`).join(", ")}return t.message||e("errors.unexpected")}}}function $e(e){const n=window.location.origin,o=n.endsWith("/")?n:`${n}/`;try{const t=e.join("/"),s=`${o}${t}`,u=e.some(d=>d.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(s)&&!u&&new URL(s))return`${o}${t}`;throw new Error("Invalid url")}catch(t){return console.warn("Failed to build valid URL:",t),""}}function q(e,n){const o=c.computed(()=>{const s=c.toValue(e);return typeof s.isExactMatch=="boolean"?s.isExactMatch:s.app==="konnect"}),t=c.computed(()=>{const s=c.toValue(n);return s.startsWith("/")?new URL(`${window.location.origin}${s}`):new URL(s)});return s=>{const{page:u,pageSize:a,offset:d,sortColumnKey:g,sortColumnOrder:h,query:i}=s;try{let r=new URL(t.value.href);if(o.value&&i){const f=new URLSearchParams(t.value.search);r.search="";const l=!c.toValue(e).isExactMatch,p=l&&r.pathname.endsWith("/search");r=l?new URL(`${r.href}?filter[name][contains]=${i}`):new URL(`${r.href}/${i}`),f.forEach((y,b)=>r.searchParams.append(b,y)),p&&r.searchParams.append("size",String(a))}else o.value||new URLSearchParams(i).forEach((f,l)=>{r.searchParams.append(l,f)}),g&&r.searchParams.append("sort_by",g),h==="desc"&&r.searchParams.append("sort_desc","1"),r.searchParams.append("size",String(a));return d&&u!==1&&r.searchParams.append("offset",String(d)),r.href}catch(r){return console.error("RouteList(fetcher)",r),c.toValue(n)}}}const j=new Map;function Ue(e,n,o){const t=c.ref(!0),s=c.toValue(e),{axiosInstance:u}=N(s.axiosRequestConfig),a=q(e,n),d=c.ref({status:C.Idle}),g=async r=>{const f=c.toValue(o)||"data";try{d.value=t.value?{status:C.InitialLoad}:{status:C.Loading},t.value=!1;const l=je(a(r),r),p=await u.get(l);if(p.status>=400)throw p;const y=p.data,b=f&&f.replace(/[^\w-_]/gi,"");let I;y[b]?I=Array.isArray(y[b])?y[b]:[y[b]]:Array.isArray(y)?I=y:I=Object.keys(y).length?[y]:[];const k={data:I,total:I.length,...y.offset?{pagination:{offset:y.offset}}:null};return k.data.length===0&&!r.query?d.value={status:C.NoRecords,response:k}:d.value={status:C.Idle,response:k},k}catch(l){const p={data:[],total:0};return r.query&&(l.response?.status===404||l.status===404)?(d.value={status:C.NoResults,response:p,error:l.response?l:{response:l}},p):(d.value={status:C.Error,response:p,error:l.response?l:{response:l}},p)}},h=s.cacheIdentifier,i=ee(h);return{fetcher:g,fetcherState:d,fetcherCacheKey:i}}function je(e,{pageSize:n,page:o}){if(!e.includes("filter[name]"))return e;try{if(new URL(e,window.location.origin).pathname.endsWith("/search"))return e}catch{}return`${e}&page[size]=${n}&page[number]=${o}`}function ee(e){if(e){let n=j.get(e);return n||(n=c.ref(1),j.set(e,n)),n}return c.ref(1)}function Ge(){const e=(t,s="_")=>t?t.split(s).map(u=>u.toLowerCase()==="id"?u.toUpperCase():u.charAt(0).toUpperCase()+u.substring(1)).join(" "):"",n=/(?:^|[\s-:'"])\w/g;return{capitalize:t=>t?t.replace(n,s=>s.toUpperCase()):"",convertKeyToTitle:e}}const te=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,G=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const n=e.match(te);if(!n)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return n.shift(),n},S=e=>e==="*"||e==="x"||e==="X",V=e=>{const n=parseInt(e,10);return isNaN(n)?e:n},Se=(e,n)=>typeof e!=typeof n?[String(e),String(n)]:[e,n],Ve=(e,n)=>{if(S(e)||S(n))return 0;const[o,t]=Se(V(e),V(n));return o>t?1:o<t?-1:0},H=(e,n)=>{for(let o=0;o<Math.max(e.length,n.length);o++){const t=Ve(e[o]||"0",n[o]||"0");if(t!==0)return t}return 0},He=(e,n)=>{const o=G(e),t=G(n),s=o.pop(),u=t.pop(),a=H(o,t);return a!==0?a:s&&u?H(s.split("."),u.split(".")):s||u?s?-1:1:0},z=(e,n,o)=>{ze(o);const t=He(e,n);return ae[o].includes(t)},ae={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},W=Object.keys(ae),ze=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(W.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${W.join("|")}`)},We=e=>typeof e=="string"&&/^[v\d]/.test(e)&&te.test(e);function Ye(e){const{gatewayInfo:n,supportedRange:o}=e;if(!n)return!0;const{edition:t,version:s}=n;if(!We(s))return console.error("Invalid version"),!1;const u=o[t];if(!u)return!1;const[a,d]=u;return!(a&&z(s,a,"<")||d&&z(s,d,">"))}function Je(e){const n=c.ref(0),o=c.ref(0),t=c.ref(!1);return c.watch(e,u=>{u&&!t.value&&(n.value=u.offsetWidth,o.value=u.scrollWidth,t.value=!0)}),{isTruncated:c.computed(()=>n.value<o.value)}}function Xe(){const{i18n:{t:e}}=O();return{utf8Name:o=>/^[\p{N}\p{L}.\-_~]*$/u.test(o)?"":e("validationErrors.utf8Name")}}const $=Symbol("schema"),Qe=e=>{c.provide($,e)},ne=()=>c.inject($,void 0),Ze=e=>/^\d+$/.test(e),qe=e=>{const n=ne(),o=c.computed(()=>{const t=n?.value,s=e();if((t?.type==="array"||t?.type==="set")&&Ze(s)){const a=t.elements;return a&&{...a,encrypted:!!(t.encrypted||a.encrypted)}}return t?.fields?.find(a=>Object.keys(a)[0]===s)?.[s]});return c.provide($,o),o};function et(e){let n="";const o=c.ref(!1),t=c.ref(null),s=c.computed(()=>{let a;return o.value?a=!0:t.value?a=t.value.hasData||e&&c.toValue(e):a=!1,!a});return{tableState:t,hasRecords:o,hideTableToolbar:s,handleStateChange:a=>{a.hasData?o.value=!0:a.state==="success"&&!a.hasData&&(!e||!n)&&(o.value=!1),e&&(n=c.toValue(e)),t.value={...a}}}}function se(){const e=c.inject(Y.MANAGED_BY,!1);return c.computed(()=>!!c.toValue(e))}const tt=e=>e?.service||e?.tool||null,at="Custom",R={"terraform-provider-konnect":"Terraform",deck:"decK","kong-gateway-operator":"Kong Gateway Operator",kongctl:"kongctl","kong-ingress-controller":"Kong Ingress Controller","gw-manager":"Konnect UI","ai-manager":"AI Manager","dev-portal":"Dev Portal"},nt=e=>{const n=tt(e);return n?Object.hasOwn(R,n)?R[n]:at:null};let T;const re=()=>(T===void 0&&(T=M.createI18n("en-us",X).t("baseConfigCard.commonFields.managed_by_label")),T);function st(e,n={}){const o=se();return{defaultTablePreferences:{columnVisibility:{managed_by:!1,...n}},tableHeaders:c.computed(()=>({...c.toValue(e),...o.value?{managed_by:{label:re(),sortable:!1}}:{}}))}}const rt={useAxios:N,useDebouncedFilter:Ke,useDeleteUrlBuilder:Fe,useBaseEntityDeckOptions:Ne,useBaseFormDeckOptions:Pe,useErrors:Be,useExternalLinkCreator:$e,useFetcher:Ue,useFetcherCacheKey:ee,useFetchUrlBuilder:q,useHelpers:B,useStringHelpers:Ge,useI18n:O,useGatewayFeatureSupported:Ye,useTruncationDetector:Je,useValidators:Xe,useSchema:ne,useSchemaProvider:Qe,useSubSchema:qe,useTableState:et,useManagedByEnabled:se,useManagedByColumn:st},ot=(e,n)=>{const o=e.__vccOpts||e;for(const[t,s]of n)o[t]=s;return o};exports.CONFIG_CARD_CODE_BLOCK_MAX_HEIGHT=ce;exports.CONFIG_CARD_FORMATS=xe;exports.CONFIG_CARD_SHOW_SENSITIVE_FIELDS=ie;exports.ConfigurationSchemaSection=Z;exports.ConfigurationSchemaType=D;exports.DECK_COMMAND_EDITOR_KEY=x;exports.DECK_COMMAND_EDITOR_MISSING_WARNING=K;exports.ENTITIES_FEATURE_FLAGS=Y;exports.EventGatewayTypesArray=Me;exports.FetcherStatus=C;exports.IdentityTypesArray=Re;exports.MANAGED_BY_LABELS=R;exports.PLUGIN_FORM_LAYOUT_STATE=oe;exports.SHIKI_MAX_HIGHLIGHT_LENGTH=le;exports.SupportedEntityDeckArray=Q;exports.SupportedEntityType=P;exports.SupportedEntityTypesArray=Te;exports._export_sfc=ot;exports.composables=rt;exports.de=fe;exports.getManagedByFieldLabel=re;exports.getManagedByLabel=nt;exports.isSupportedDeckEntityType=F;exports.ne=J;exports.useHelpers=B;
|
package/dist/deck-editor.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./_plugin-vue_export-helper-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./_plugin-vue_export-helper-Co-spHNg.cjs"),p=require("@kong-ui-public/monaco-editor"),k=require("@kong/icons"),y=require("@kong/kongponents");require("@kong-ui-public/monaco-editor/dist/runtime/style.css");const _={class:"deck-command-editor-wrapper"},f={class:"deck-command-copy-button"},C=e.defineComponent({__name:"DeckCommandEditor",props:e.mergeModels({language:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const d=e.inject("app:konnectColorMode",e.computed(()=>"light")),n=e.useModel(r,"modelValue"),{i18n:{t:c}}=a.composables.useI18n(),s={scrollbar:{alwaysConsumeMouseWheel:!1},autoIndent:"keep",editContext:!1};async function u(){await m(n.value)}async function m(l){if(navigator.clipboard)try{return await navigator.clipboard.writeText(l),!0}catch{}const o=document?.createElement("textarea");o&&(o.style.position="fixed",o.style.top="0",o.style.left="0",o.style.width="32px",o.style.height="32px",o.style.padding="0",o.style.border="none",o.style.outline="none",o.style.boxShadow="none",o.style.background="transparent",o.value=l,document?.body?.appendChild(o),o.focus(),o.select());let t;try{t=document?.execCommand("copy")}catch{t=!1}finally{document?.body?.removeChild(o)}return t}return(l,o)=>(e.openBlock(),e.createElementBlock("div",_,[(e.openBlock(),e.createBlock(e.unref(p.MonacoEditor),{key:e.unref(d),modelValue:n.value,"onUpdate:modelValue":o[0]||(o[0]=t=>n.value=t),appearance:"standalone",class:"deck-command-editor",language:r.language,options:s,theme:e.unref(d)},null,8,["modelValue","language","theme"])),e.createElementVNode("div",f,[e.createVNode(e.unref(y.KCodeBlockIconButton),{"aria-label":e.unref(c)("deckCodeBlock.copy_tooltip"),"copy-tooltip":e.unref(c)("deckCodeBlock.copy_tooltip"),theme:"light",onClick:o[1]||(o[1]=t=>u())},{default:e.withCtx(()=>[e.createVNode(e.unref(k.CopyIcon),{decorative:""})]),_:1},8,["aria-label","copy-tooltip"])])]))}}),i=a._export_sfc(C,[["__scopeId","data-v-2da602e1"]]),g={},v={class:"editor-skeleton"};function b(r,d){const n=e.resolveComponent("KSkeleton");return e.openBlock(),e.createElementBlock("div",v,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,c=>e.createVNode(n,{key:c})),64))])}const E=a._export_sfc(g,[["render",b],["__scopeId","data-v-ec59bbd1"]]);function h(){e.provide(a.DECK_COMMAND_EDITOR_KEY,i)}exports.DeckCommandEditor=i;exports.DeckCommandEditorLoading=E;exports.provideDeckCommandEditor=h;
|
package/dist/deck-editor.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as _, inject as f, computed as k, useModel as C, openBlock as c, createElementBlock as i, createBlock as g, unref as o, createElementVNode as v, createVNode as s, withCtx as h, mergeModels as b, resolveComponent as x, Fragment as E, renderList as D, provide as M } from "vue";
|
|
2
|
-
import { c as w, _ as m, D as V } from "./_plugin-vue_export-helper-
|
|
2
|
+
import { c as w, _ as m, D as V } from "./_plugin-vue_export-helper-BiPB3h_p.js";
|
|
3
3
|
import { MonacoEditor as B } from "@kong-ui-public/monaco-editor";
|
|
4
4
|
import { CopyIcon as I } from "@kong/icons";
|
|
5
5
|
import { KCodeBlockIconButton as K } from "@kong/kongponents";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),d=require("./_plugin-vue_export-helper-DLkhKvEr.cjs"),G=require("@kong/kongponents"),wt=require("@shikijs/core"),xt=require("@shikijs/engine-javascript"),Lt=require("@shikijs/langs/json"),Ft=require("@shikijs/langs/yaml"),Rt=require("@shikijs/langs/terraform"),Vt=require("@shikijs/langs/shellscript"),Dt=require("@shikijs/langs/powershell"),Kt=require("@shikijs/themes/material-theme-darker"),Pt=require("@shikijs/themes/catppuccin-latte"),V=require("@kong/icons"),Mt=require("@vueuse/core"),Ut=require("vue-router"),qt=require("@kong-ui-public/misc-widgets");require("@kong-ui-public/misc-widgets/dist/style.css");var Je=(t=>(t.GatewayService="service",t.Route="route",t.Consumer="consumer",t.ConsumerGroup="consumer group",t.Plugin="plugin",t.Upstream="upstream",t.Certificate="certificate",t.CACertificate="ca certificate",t.SNI="SNI",t.Key="key",t.KeySet="key set",t.Vault="vault",t.Application="application",t.Developer="developer",t.acls="ACL Credential",t["basic-auth"]="Basic Auth Credential",t["key-auth"]="Key Auth Credential",t["key-auth-enc"]="Key Auth Encrypted Credential",t.oauth2="OAuth 2.0 Credential",t["hmac-auth"]="HMAC Credential",t.jwt="JWT Credential",t.Target="target",t.Policy="policy",t.Secret="secret",t.RedisConfiguration="redis configuration",t))(Je||{}),Qe=(t=>(t.Edit="edit",t.Create="create",t))(Qe||{});const jt=["json","yaml","terraform","deck"],pe=["primary","secondary"];function Xe(t,n){const o={...t};for(const a of Object.keys(n))n[a].forceShow&&o[a]===void 0&&(o[a]=null);return o}function Ze(t,n,o){const{redactByApiSchema:a,redactByConfigSchema:r,getApiSchemaField:i,isObjectRecord:l}=d.useHelpers();let s=t;return l(t)&&Array.isArray(n?.fields)&&(s=Object.fromEntries(Object.entries(t).map(([u,f])=>{const c=i(n.fields,u);return[u,c?a(f,c):f]}))),r(s,o)}const zt={key:0,class:"config-card-fieldset-title"},Gt=e.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(t){const n=t,{i18n:{t:o}}=d.composables.useI18n(),{convertKeyToTitle:a}=d.composables.useStringHelpers();n.isArrayItem&&d.composables.useSubSchema(()=>String(n.index));const r=e.computed(()=>n.item.key??"json-array-item"),i=e.computed(()=>n.item.value??n.item),l=e.computed(()=>{const u=JSON.parse(JSON.stringify(i.value));return n.isArrayItem&&delete u.name,u}),s=e.computed(()=>n.isArrayItem?i.value?.name?a(i.value.name,"_"):o("baseConfigCard.general.entryTitle",{index:n.index}):"");return(u,f)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.isArrayItem?"fieldset":"div"),{class:e.normalizeClass(t.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:e.withCtx(()=>[t.isArrayItem?(e.openBlock(),e.createElementBlock("legend",zt,[e.createElementVNode("b",null,e.toDisplayString(s.value),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(l.value),(c,k)=>(e.openBlock(),e.createBlock(Se,{key:`${r.value}-property-${k}`,item:{key:c,label:e.unref(a)(c),value:l.value[c]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),et=d._export_sfc(Gt,[["__scopeId","data-v-32504351"]]),Ht={key:3,class:"navigation-subtitle"},Yt=e.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(t){const{i18n:{t:n}}=d.composables.useI18n();return(o,a)=>{const r=e.resolveComponent("router-link"),i=e.resolveComponent("KButton"),l=e.resolveComponent("KSkeleton");return e.openBlock(),e.createElementBlock("div",null,[t.item.to?(e.openBlock(),e.createBlock(r,{key:0,class:"navigation-link",to:t.item.to},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.item.value||e.unref(n)("baseConfigCard.commonFields.link")),1)]),_:1},8,["to"])):(e.openBlock(),e.createBlock(i,{key:1,appearance:"tertiary",class:"navigation-button",onClick:a[0]||(a[0]=s=>o.$emit("navigation-click",t.item))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.item.value||e.unref(n)("baseConfigCard.commonFields.link")),1)]),_:1})),t.item.subtitleLoading?(e.openBlock(),e.createBlock(l,{key:2,"data-testid":"navigation-subtitle-loader",type:"spinner"})):t.item.subtitle?(e.openBlock(),e.createElementBlock("div",Ht,e.toDisplayString(t.item.subtitle),1)):e.createCommentVNode("",!0)])}}}),tt=d._export_sfc(Yt,[["__scopeId","data-v-6996418f"]]),Wt=e.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(t){const{i18n:{t:n}}=d.composables.useI18n();return(o,a)=>{const r=e.resolveComponent("KBadge");return e.openBlock(),e.createBlock(r,{appearance:t.status?"success":"neutral"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.status?e.unref(n)("baseConfigCard.statusBadge.enabledLabel"):e.unref(n)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}});let se=null;function Jt(){return se||(se=wt.createHighlighterCoreSync({langs:[Lt,Ft,Rt,Vt,Dt],themes:[Kt,Pt],engine:xt.createJavaScriptRegexEngine(),langAlias:{bash:"shellscript",sh:"shellscript",shell:"shellscript",zsh:"shellscript"}})),se}function Qt(t,n){return Jt().codeToHtml(t,n)}function Y({codeElement:t,code:n,language:o}){n.length>d.SHIKI_MAX_HIGHLIGHT_LENGTH||(t.innerHTML=Qt(n,{lang:o,themes:{light:"catppuccin-latte",dark:"material-theme-darker"},structure:"inline"}))}const Xt=["data-testid"],Zt=["data-testid"],en=["data-testid"],tn=["data-testid"],nn={key:1},on=["data-testid"],an=["data-testid"],rn=["data-testid"],ln=["data-testid"],sn={name:"ConfigCardItem",components:{JsonCardItem:et,StatusBadge:Wt,InternalLinkItem:tt}},cn=e.defineComponent({...sn,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(t,{emit:n}){const o=t,a=n,r=e.useId(),i=e.useSlots(),{i18n:{t:l,formatIsoDate:s,formatUnixTimeStamp:u}}=d.composables.useI18n(),f=e.computed(()=>o.item.value!==void 0&&o.item.value!==null&&o.item.value!==""),c=e.computed(()=>!!(o.item.tooltip||i["label-tooltip"])),k=e.computed(()=>o.item.type===d.ConfigurationSchemaType.Json||o.item.type===d.ConfigurationSchemaType.JsonArray),h=e.computed(()=>o.item.type===d.ConfigurationSchemaType.JsonArray),S=d.composables.useSubSchema(()=>o.item.key),{redactByApiSchema:$}=d.composables.useHelpers(),g=e.inject(d.CONFIG_CARD_SHOW_SENSITIVE_FIELDS,e.ref(!1)),m=e.computed(()=>g.value?"default":"redacted"),T=e.computed(()=>o.item.type?o.item.type:S?.value?.encrypted?d.ConfigurationSchemaType.Redacted:void 0),p=e.computed(()=>{switch(T.value){case d.ConfigurationSchemaType.ID:return{tag:"KCopy",attrs:{"data-testid":`${o.item.key}-copy-uuid`,"copy-tooltip":l("baseConfigCard.copy.tooltip",{label:o.item.label}),text:o.item.value}};case d.ConfigurationSchemaType.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":l("baseConfigCard.copy.tooltip",{label:o.item.label})}};case d.ConfigurationSchemaType.Redacted:return{tag:"KCopy",attrs:{"data-testid":`${o.item.key}-copy-uuid-redacted`,"data-dd-privacy":"mask",format:m.value,"copy-tooltip":l("baseConfigCard.copy.tooltip",{label:o.item.label}),text:o.item.value}};case d.ConfigurationSchemaType.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"data-dd-privacy":"mask",format:m.value,"copy-tooltip":l("baseConfigCard.copy.tooltip",{label:o.item.label})}};case d.ConfigurationSchemaType.Date:return{tag:"div",attrs:{"data-testid":`${o.item.key}-date`},text:isNaN(Number(o.item.value))?s(o.item.value):u(o.item.value)};case d.ConfigurationSchemaType.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${o.item.key}-badge-status`,status:o.item.value}};case d.ConfigurationSchemaType.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case d.ConfigurationSchemaType.CopyBadge:return{tag:"div",additionalComponent:"KCopy",childAttrs:{badge:!0,truncate:!0,truncationLimit:"auto",text:o.item.value}};case d.ConfigurationSchemaType.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case d.ConfigurationSchemaType.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${o.item.key}-internal-link`,item:o.item,onNavigationClick:B=>{a("navigation-click",B)}}};case d.ConfigurationSchemaType.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${o.item.key}-external-link`,href:o.item.value},text:o.item.value};case d.ConfigurationSchemaType.ManagedBy:return{tag:"div",attrs:{"data-testid":`${o.item.key}-managed-by`},text:d.getManagedByLabel(o.item.value)??"–"};case d.ConfigurationSchemaType.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${o.item.key}-json-content`,item:o.item}};case d.ConfigurationSchemaType.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${o.item.key}-json-array-content`,item:o.item}};default:return o.item.value!=null&&typeof o.item.value=="object"?{tag:"KCodeBlock",attrs:{"data-testid":`${o.item.key}-json-code`,"data-dd-privacy":"mask",id:`json-code-${r}`,language:"json",code:JSON.stringify(g.value?o.item.value:$(o.item.value,S.value),null," "),copyCode:JSON.stringify(o.item.value,null," "),maxHeight:"480px",showLineNumbers:!1,onCodeBlockRender:Y}}:{tag:"div",attrs:{"data-testid":`${o.item.key}-plain-text`},text:o.item.value}}}),y=e.ref(),N=e.ref(),{isTruncated:I}=d.composables.useTruncationDetector(y),{isTruncated:L}=d.composables.useTruncationDetector(N);return(B,E)=>{const O=e.resolveComponent("KTooltip"),v=e.resolveComponent("KLabel"),b=e.resolveComponent("KBadge"),C=e.resolveComponent("KCopy");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["config-card-details-row",{"json-array-item":h.value,"json-item":k.value&&f.value}])},[e.createElementVNode("div",{class:e.normalizeClass(["config-card-details-label",{"json-item-label":k.value&&f.value,"slim-label":t.slim}]),"data-testid":`${t.item.key}-label`},[e.renderSlot(B.$slots,"label",{item:t.item},()=>[e.createVNode(v,{"tooltip-attributes":{maxWidth:"500px"}},e.createSlots({default:e.withCtx(()=>[e.createVNode(O,{text:e.unref(I)?t.item.label:""},{default:e.withCtx(()=>[e.createElementVNode("span",{ref_key:"labelContent",ref:y,class:"label-content"},e.toDisplayString(t.item.label),513)]),_:1},8,["text"])]),_:2},[c.value?{name:"tooltip",fn:e.withCtx(()=>[e.createElementVNode("div",{"data-testid":`${t.item.key}-label-tooltip`},[e.renderSlot(B.$slots,"label-tooltip",{},()=>[e.createTextVNode(e.toDisplayString(t.item.tooltip),1)],!0)],8,Zt)]),key:"0"}:void 0]),1024)],!0)],10,Xt),e.createElementVNode("div",{class:e.normalizeClass(["config-card-details-value",{"json-item-value":k.value&&f.value,"slim-value":t.slim}]),"data-testid":`${t.item.key}-property-value`},[e.renderSlot(B.$slots,t.item.key,{rowValue:t.item.value},()=>[f.value?(e.openBlock(),e.createElementBlock("div",nn,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p.value.tag),e.normalizeProps(e.guardReactiveProps(p.value.attrs)),{default:e.withCtx(()=>[p.value.additionalComponent==="KBadge"?(e.openBlock(),e.createElementBlock("div",{key:0,"data-testid":`${t.item.key}-badge-tags`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.value,(_,F)=>(e.openBlock(),e.createBlock(b,{key:`${t.item.key}-badge-tag-${F}`,class:"config-badge","data-testid":`${t.item.key}-badge-tag-${F}`,tooltip:_,"truncation-tooltip":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,on)):p.value.additionalComponent==="KCopy"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${t.item.key}-copy-uuid-array`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.value,(_,F)=>(e.openBlock(),e.createBlock(C,e.mergeProps({ref_for:!0},p.value.childAttrs,{key:`${t.item.key}-copy-uuid-${F}`,"data-testid":`${t.item.key}-copy-uuid-${F}`,text:_}),null,16,["data-testid","text"]))),128))],8,an)):p.value.additionalComponent==="KMethodBadge"?(e.openBlock(),e.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${t.item.key}-badge-methods`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.value,(_,F)=>(e.openBlock(),e.createBlock(b,{key:`${t.item.key}-badge-method-${F}`,appearance:Object.values(e.unref(G.BadgeMethodAppearances)).includes(_.toLowerCase())?_.toLowerCase():"custom",class:"config-badge","data-testid":`${t.item.key}-badge-method-${F}`},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,rn)):p.value.additionalComponent==="JsonCardItem"?(e.openBlock(),e.createElementBlock("div",{key:3,"data-testid":`${o.item.key}-json-array-content`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.value,(_,F)=>(e.openBlock(),e.createBlock(et,{key:`json-array-item-${F}`,index:Number(F),"is-array-item":"",item:_},null,8,["index","item"]))),128))],8,ln)):(e.openBlock(),e.createBlock(O,{key:4,text:e.unref(L)?t.item.value:""},{default:e.withCtx(()=>[e.createElementVNode("span",{ref_key:"textContent",ref:N,class:e.normalizeClass(["attrs-data-text",{truncated:t.truncated}])},e.toDisplayString(p.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(e.openBlock(),e.createElementBlock("div",{key:0,"data-testid":`${t.item.key}-no-value`}," – ",8,tn))],!0)],10,en)],2)}}}),Se=d._export_sfc(cn,[["__scopeId","data-v-2270c941"]]),nt=Symbol("config-card-row-schema"),dn=e.defineComponent({__name:"ConfigCardRowSchemaScope",props:{item:{type:Object,required:!0}},setup(t){const n=t,o=e.inject(nt,void 0);if(o){const a=d.composables.useSchema();d.composables.useSchemaProvider(e.computed(()=>{const r=o(n.item);return r?r.schema:a?.value}))}return(a,r)=>e.renderSlot(a.$slots,"default")}}),un={class:"json-config config-card-code-block"},fn=["title"],pn=e.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},requestMethod:{type:String,required:!1,default:""},entityRecord:{type:Object,required:!0},unredactedRecord:{type:Object,default:null}},setup(t){e.useCssVars(i=>({v6e8a5e62:`${r.value}ch`}));const n=t,{i18n:{t:o}}=d.composables.useI18n(),a=e.computed(()=>n.entityRecord),r=e.computed(()=>{if(!n.fetcherUrl)return 0;const i=n.fetcherUrl?.split("/");return i.length<2?0:41+(n.requestMethod==="post"?i[i.length-1]:i[i.length-2]).length});return(i,l)=>{const s=e.resolveComponent("KBadge"),u=e.resolveComponent("KClipboardProvider"),f=e.resolveComponent("KCodeBlock");return e.openBlock(),e.createElementBlock("div",un,[t.entityRecord?(e.openBlock(),e.createBlock(f,{key:0,id:"json-codeblock",code:JSON.stringify(a.value,null,2),"copy-code":JSON.stringify(t.unredactedRecord||a.value,null,2),"data-dd-privacy":"mask",language:"json","max-height":e.unref(d.CONFIG_CARD_CODE_BLOCK_MAX_HEIGHT),theme:"dark",onCodeBlockRender:e.unref(Y)},e.createSlots({_:2},[t.fetcherUrl?{name:"actions",fn:e.withCtx(()=>[e.createVNode(s,{appearance:t.requestMethod,class:"json-endpoint-method","data-testid":"json-endpoint-method"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.requestMethod),1)]),_:1},8,["appearance"]),e.createElementVNode("code",{id:"json-endpoint-codeblock",class:"json-endpoint-url",title:t.fetcherUrl},e.toDisplayString(t.fetcherUrl),9,fn),e.createVNode(u,null,{default:e.withCtx(({copyToClipboard:c})=>[e.createVNode(e.unref(G.KCodeBlockIconButton),{"aria-label":e.unref(o)("jsonCodeBlock.copy_url"),"copy-tooltip":e.unref(o)("jsonCodeBlock.copy_url"),"data-testid":"code-block-copy-button-json-endpoint-codeblock",onClick:k=>c(t.fetcherUrl)},{default:e.withCtx(()=>[e.createVNode(e.unref(V.CopyIcon),{decorative:""})]),_:1},8,["aria-label","copy-tooltip","onClick"])]),_:1})]),key:"0"}:void 0]),1032,["code","copy-code","max-height","onCodeBlockRender"])):e.createCommentVNode("",!0)])}}}),Be=d._export_sfc(pn,[["__scopeId","data-v-8736ff0c"]]);var x=Symbol("NOT_RESOLVED");function P(t,n){return{tagName:t,nodeKind:"scalar",implicit:n.implicit??!1,matchByTagPrefix:n.matchByTagPrefix??!1,implicitFirstChars:n.implicitFirstChars??null,resolve:n.resolve,identify:n.identify,represent:n.represent??(o=>String(o)),representTagName:n.representTagName??(()=>t)}}function Te(t,n){const o=n.finalize===void 0;return{tagName:t,nodeKind:"sequence",implicit:!1,matchByTagPrefix:n.matchByTagPrefix??!1,create:n.create,addItem:n.addItem,finalize:n.finalize??(a=>a),carrierIsResult:o,identify:n.identify,represent:n.represent??(a=>a),representTagName:n.representTagName??(()=>t)}}function oe(t,n){const o=n.finalize===void 0;return{tagName:t,nodeKind:"mapping",implicit:!1,matchByTagPrefix:n.matchByTagPrefix??!1,create:n.create,addPair:n.addPair,has:n.has,keys:n.keys,get:n.get,finalize:n.finalize??(a=>a),carrierIsResult:o,identify:n.identify,represent:n.represent??(a=>a),representTagName:n.representTagName??(()=>t)}}var mn=P("tag:yaml.org,2002:str",{resolve:t=>t,identify:t=>typeof t=="string"}),yn=["","~","null","Null","NULL"],gn=P("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:t=>yn.indexOf(t)!==-1?null:x,identify:t=>t===null,represent:()=>"null"}),vn=P("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:(t,n)=>t==="null"||n&&t===""?null:x,identify:t=>t===null,represent:()=>"null"}),kn=["","~","null","Null","NULL"],hn=P("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:t=>kn.indexOf(t)!==-1?null:x,identify:t=>t===null,represent:()=>"null"}),Cn=["true","True","TRUE"],bn=["false","False","FALSE"],Sn=P("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:t=>Cn.indexOf(t)!==-1?!0:bn.indexOf(t)!==-1?!1:x,identify:t=>Object.prototype.toString.call(t)==="[object Boolean]",represent:t=>t?"true":"false"}),Bn=["true"],Tn=["false"],En=P("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:t=>Bn.indexOf(t)!==-1?!0:Tn.indexOf(t)!==-1?!1:x,identify:t=>Object.prototype.toString.call(t)==="[object Boolean]",represent:t=>t?"true":"false"}),Nn=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],_n=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],$n=P("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:t=>Nn.indexOf(t)!==-1?!0:_n.indexOf(t)!==-1?!1:x,identify:t=>Object.prototype.toString.call(t)==="[object Boolean]",represent:t=>t?"true":"false"}),In=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),On=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function An(t){let n=t,o=1;return(n[0]==="-"||n[0]==="+")&&(n[0]==="-"&&(o=-1),n=n.slice(1)),n.startsWith("0b")?o*parseInt(n.slice(2),2):n.startsWith("0o")?o*parseInt(n.slice(2),8):n.startsWith("0x")?o*parseInt(n.slice(2),16):o*parseInt(n,10)}function wn(t,n){if(n){if(!On.test(t))return x}else if(!In.test(t))return x;const o=An(t);return Number.isFinite(o)?o:x}var ot=P("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:wn,identify:t=>Number.isInteger(t)&&!Object.is(t,-0)&&t.toString(10).indexOf("e")<0,represent:t=>t.toString(10)}),xn=new RegExp("^-?(?:0|[1-9][0-9]*)$"),Ln=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function Fn(t){let n=t,o=1;return(n[0]==="-"||n[0]==="+")&&(n[0]==="-"&&(o=-1),n=n.slice(1)),n.startsWith("0b")?o*parseInt(n.slice(2),2):n.startsWith("0o")?o*parseInt(n.slice(2),8):n.startsWith("0x")?o*parseInt(n.slice(2),16):o*parseInt(n,10)}function Rn(t,n){if(n){if(!Ln.test(t))return x}else if(!xn.test(t))return x;const o=Fn(t);return Number.isFinite(o)?o:x}var Vn=P("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Rn,identify:t=>Number.isInteger(t)&&!Object.is(t,-0)&&t.toString(10).indexOf("e")<0,represent:t=>t.toString(10)}),Dn=new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");function Kn(t){let n=t.replace(/_/g,""),o=1;if((n[0]==="-"||n[0]==="+")&&(n[0]==="-"&&(o=-1),n=n.slice(1)),n.startsWith("0b"))return o*parseInt(n.slice(2),2);if(n.startsWith("0x"))return o*parseInt(n.slice(2),16);if(n.includes(":")){let a=0;for(const r of n.split(":"))a=a*60+Number(r);return o*a}return n!=="0"&&n[0]==="0"?o*parseInt(n,8):o*parseInt(n,10)}function Pn(t){if(!Dn.test(t))return x;const n=Kn(t);return Number.isFinite(n)?n:x}var me=P("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:Pn,identify:t=>Number.isInteger(t)&&!Object.is(t,-0)&&t.toString(10).indexOf("e")<0,represent:t=>t.toString(10)}),Mn=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Un=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function qn(t){if(!Mn.test(t))return x;let n=t.toLowerCase();const o=n[0]==="-"?-1:1;if("+-".includes(n[0])&&(n=n.slice(1)),n===".inf")return o===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(n===".nan")return NaN;const a=o*parseFloat(n);return Number.isFinite(a)||Un.test(t)?a:x}function jn(t){if(isNaN(t))return".nan";if(t===Number.POSITIVE_INFINITY)return".inf";if(t===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(t,-0))return"-0.0";const n=t.toString(10);return/^[-+]?[0-9]+e/.test(n)?n.replace("e",".e"):n}var at=P("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:qn,identify:t=>typeof t=="number"&&(!Number.isInteger(t)||Object.is(t,-0)||t.toString(10).indexOf("e")>=0),represent:jn}),zn=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),Gn=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Hn(t,n){if(n){if(!Gn.test(t))return x;let a=t.toLowerCase();const r=a[0]==="-"?-1:1;if("+-".includes(a[0])&&(a=a.slice(1)),a===".inf")return r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(a===".nan")return NaN;const i=r*parseFloat(a);return Number.isFinite(i)?i:x}if(!zn.test(t))return x;const o=Number(t);return Number.isFinite(o)?o:x}function Yn(t){if(isNaN(t))return".nan";if(t===Number.POSITIVE_INFINITY)return".inf";if(t===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(t,-0))return"-0.0";const n=t.toString(10);return/^[-+]?[0-9]+e/.test(n)?n.replace("e",".e"):n}var Wn=P("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Hn,identify:t=>typeof t=="number"&&(!Number.isInteger(t)||Object.is(t,-0)||t.toString(10).indexOf("e")>=0),represent:Yn}),Jn=new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Qn=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Xn(t){if(!Jn.test(t))return x;let n=t.toLowerCase().replace(/_/g,"");const o=n[0]==="-"?-1:1;if("+-".includes(n[0])&&(n=n.slice(1)),n===".inf")return o===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(n===".nan")return NaN;let a=0;if(n.includes(":")){for(const r of n.split(":"))a=a*60+Number(r);a*=o}else a=o*parseFloat(n);return Number.isFinite(a)||Qn.test(t)?a:x}function Zn(t){if(isNaN(t))return".nan";if(t===Number.POSITIVE_INFINITY)return".inf";if(t===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(t,-0))return"-0.0";const n=t.toString(10);return/^[-+]?[0-9]+e/.test(n)?n.replace("e",".e"):n}var ye=P("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:Xn,identify:t=>typeof t=="number"&&(!Number.isInteger(t)||Object.is(t,-0)||t.toString(10).indexOf("e")>=0),represent:Zn}),eo=P("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:(t,n)=>t==="<<"||n&&t===""?"<<":x,identify:()=>!1}),to=/^[A-Za-z0-9+/]*={0,2}$/;function no(t){const n=t.replace(/\s/g,"");if(n.length%4!==0||!to.test(n))return x;const o=atob(n),a=new Uint8Array(o.length);for(let r=0;r<o.length;r++)a[r]=o.charCodeAt(r);return a}function oo(t){let n="";for(let o=0;o<t.length;o++)n+=String.fromCharCode(t[o]);return btoa(n)}var ao=P("tag:yaml.org,2002:binary",{resolve:no,identify:t=>Object.prototype.toString.call(t)==="[object Uint8Array]",represent:oo}),ro=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),io=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Fe(t,n,o,a=0,r=0,i=0,l=0){const s=new Date(Date.UTC(t,n,o,a,r,i,l));return s.setUTCFullYear(t,n,o),s}function lo(t){let n=ro.exec(t);if(n===null&&(n=io.exec(t)),n===null)return x;const o=+n[1],a=+n[2]-1,r=+n[3];if(!n[4]){const c=Fe(o,a,r);return c.getUTCFullYear()!==o||c.getUTCMonth()!==a||c.getUTCDate()!==r?x:c}const i=+n[4],l=+n[5],s=+n[6];let u=0;if(i>23||l>59||s>59)return x;if(n[7]){let c=n[7].slice(0,3);for(;c.length<3;)c+="0";u=+c}const f=Fe(o,a,r,i,l,s,u);if(f.getUTCFullYear()!==o||f.getUTCMonth()!==a||f.getUTCDate()!==r)return x;if(n[9]){const c=+n[10],k=+(n[11]||0);if(c>23||k>59)return x;const h=(c*60+k)*6e4;f.setTime(f.getTime()-(n[9]==="-"?-h:h))}return f}var so=P("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:lo,identify:t=>t instanceof Date,represent:t=>t.toISOString()}),co=Te("tag:yaml.org,2002:seq",{create:()=>[],addItem:(t,n)=>{t.push(n)},identify:Array.isArray});function ae(t){if(t===null||typeof t!="object"||Array.isArray(t))return!1;const n=Object.getPrototypeOf(t);return n===null||n===Object.prototype}function uo(t,n){const o={};for(const a of n)t[a]!==void 0&&(o[a]=t[a]);return o}var fo=Te("tag:yaml.org,2002:omap",{create:()=>({list:[],seen:new Set}),addItem:(t,n)=>{let o;if(n instanceof Map){if(n.size!==1)return"cannot resolve an ordered map item";o=n.keys().next().value}else if(ae(n)){const a=Object.keys(n);if(a.length!==1)return"cannot resolve an ordered map item";o=a[0]}else return"cannot resolve an ordered map item";return t.seen.has(o)?"duplicate key in ordered map":(t.seen.add(o),t.list.push(n),"")},finalize:t=>t.list,identify:()=>!1}),po=Te("tag:yaml.org,2002:pairs",{create:()=>[],addItem:(t,n)=>{if(n instanceof Map)return n.size!==1?"cannot resolve a pairs item":(t.push(n.entries().next().value),"");if(Object.prototype.toString.call(n)!=="[object Object]")return"cannot resolve a pairs item";const o=n,a=Object.keys(o);return a.length!==1?"cannot resolve a pairs item":(t.push([a[0],o[a[0]]]),"")},identify:()=>!1}),mo=oe("tag:yaml.org,2002:map",{create:()=>({}),identify:ae,represent:t=>{const n=new Map;for(const o of Object.keys(t))n.set(o,t[o]);return n},addPair:(t,n,o)=>{if(n!==null&&typeof n=="object")return"object-based map does not support complex keys";const a=String(n);return a==="__proto__"?Object.defineProperty(t,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[a]=o,""},has:(t,n)=>n!==null&&typeof n=="object"?!1:Object.prototype.hasOwnProperty.call(t,String(n)),keys:t=>Object.keys(t),get:(t,n)=>{const o=String(n);return Object.prototype.hasOwnProperty.call(t,o)?t[o]:null}}),yo=oe("tag:yaml.org,2002:set",{create:()=>new Set,identify:t=>t instanceof Set,represent:t=>{const n=new Map;for(const o of t)n.set(o,null);return n},addPair:(t,n,o)=>o!==null?"cannot resolve a set item":(t.add(n),""),has:(t,n)=>t.has(n),keys:t=>t.keys(),get:()=>null});function go(){return{scalar:Object.create(null),sequence:Object.create(null),mapping:Object.create(null)}}function vo(){return{scalar:[],sequence:[],mapping:[]}}function ko(t){const n=[];for(const o of t){let a=n.length;for(let r=0;r<n.length;r++){const i=n[r];if(i.nodeKind===o.nodeKind&&i.tagName===o.tagName&&i.matchByTagPrefix===o.matchByTagPrefix){a=r;break}}n[a]=o}return n}var re=class rt{tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(n){const o=ko(n),a=[],r=go(),i=vo();for(const c of o){if(c.nodeKind==="scalar"&&c.implicit){if(c.matchByTagPrefix)throw new Error("Implicit scalar tags cannot match by tag prefix");a.push(c)}switch(c.nodeKind){case"scalar":c.matchByTagPrefix?i.scalar.push(c):r.scalar[c.tagName]=c;break;case"sequence":c.matchByTagPrefix?i.sequence.push(c):r.sequence[c.tagName]=c;break;case"mapping":c.matchByTagPrefix?i.mapping.push(c):r.mapping[c.tagName]=c}}const l=a.filter(c=>c.implicitFirstChars===null),s=new Set;for(const c of a)if(c.implicitFirstChars!==null)for(const k of c.implicitFirstChars)s.add(k);const u=new Map;for(const c of s)u.set(c,a.filter(k=>k.implicitFirstChars===null||k.implicitFirstChars.indexOf(c)!==-1));const f=r.scalar["tag:yaml.org,2002:str"];if(!f)throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");this.tags=o,this.implicitScalarTags=a,this.implicitScalarByFirstChar=u,this.implicitScalarAnyFirstChar=l,this.defaultScalarTag=f,this.defaultSequenceTag=r.sequence["tag:yaml.org,2002:seq"],this.defaultMappingTag=r.mapping["tag:yaml.org,2002:map"],this.exact=r,this.prefix=i}lookupScalarTag(n){const o=this.exact.scalar[n];if(o)return o;for(const a of this.prefix.scalar)if(n.startsWith(a.tagName))return a}lookupSequenceTag(n){const o=this.exact.sequence[n];if(o)return o;for(const a of this.prefix.sequence)if(n.startsWith(a.tagName))return a}lookupMappingTag(n){const o=this.exact.mapping[n];if(o)return o;for(const a of this.prefix.mapping)if(n.startsWith(a.tagName))return a}resolveImplicitScalarTag(n){const o=this.implicitScalarByFirstChar.get(n.charAt(0))??this.implicitScalarAnyFirstChar;for(const r of o){const i=r.resolve(n,!1,r.tagName);if(i!==x)return{value:i,tag:r}}const a=this.defaultScalarTag;return{value:a.resolve(n,!1,a.tagName),tag:a}}withTags(...n){let o=[];for(const a of n)o=o.concat(a);return new rt([...this.tags,...o])}},Ee=new re([mn,co,mo]);new re([...Ee.tags,vn,En,Vn,Wn]);new re([...Ee.tags,gn,Sn,ot,at]);var ho=new re([...Ee.tags,hn,$n,me,ye,so,eo,ao,fo,po,yo]),Co=ho.withTags({...me,resolve:(t,n,o)=>{const a=me.resolve(t,n,o);return a===x?ot.resolve(t,n,o):a}},{...ye,resolve:(t,n,o)=>{const a=ye.resolve(t,n,o);return a===x?at.resolve(t,n,o):a}});oe("tag:yaml.org,2002:map",{create:()=>new Map,addPair:(t,n,o)=>(t.set(n,o),""),has:(t,n)=>t.has(n),keys:t=>t.keys(),get:(t,n)=>t.get(n),identify:t=>t instanceof Map||ae(t),represent:t=>{if(t instanceof Map)return t;const n=new Map,o=t;for(const a of Object.keys(o))n.set(a,o[a]);return n}});function Re(t){if(Array.isArray(t)){const n=Array.prototype.slice.call(t);for(let o=0;o<n.length;o++){if(Array.isArray(n[o]))return null;typeof n[o]=="object"&&Object.prototype.toString.call(n[o])==="[object Object]"&&(n[o]="[object Object]")}return String(n)}return typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"?"[object Object]":String(t)}oe("tag:yaml.org,2002:map",{create:()=>({}),identify:ae,represent:t=>{const n=new Map;for(const o of Object.keys(t))n.set(o,t[o]);return n},addPair:(t,n,o)=>{const a=Re(n);return a===null?"nested arrays are not supported inside keys":(a==="__proto__"?Object.defineProperty(t,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[a]=o,"")},has:(t,n)=>{const o=Re(n);return o!==null&&Object.prototype.hasOwnProperty.call(t,o)},keys:t=>Object.keys(t),get:(t,n)=>{const o=String(n);return Object.prototype.hasOwnProperty.call(t,o)?t[o]:null}});var bo={maxLength:79,indent:1,linesBefore:3,linesAfter:2};function ce(t,n,o,a,r){let i="",l="";const s=Math.floor(r/2)-1;return a-n>s&&(i=" ... ",n=a-s+i.length),o-a>s&&(l=" ...",o=a+s-l.length),{str:i+t.slice(n,o).replace(/\t/g,"→")+l,pos:a-n+i.length}}function de(t,n){return" ".repeat(Math.max(n-t.length,0))+t}function So(t,n){if(!t.buffer)return null;const o={...bo,...n},a=/\r?\n|\r|\0/g,r=[0],i=[];let l,s=-1;for(;l=a.exec(t.buffer);)i.push(l.index),r.push(l.index+l[0].length),t.position<=l.index&&s<0&&(s=r.length-2);s<0&&(s=r.length-1);let u="";const f=Math.min(t.line+o.linesAfter,i.length).toString().length,c=o.maxLength-(o.indent+f+3);for(let h=1;h<=o.linesBefore&&!(s-h<0);h++){const S=ce(t.buffer,r[s-h],i[s-h],t.position-(r[s]-r[s-h]),c);u=`${" ".repeat(o.indent)}${de((t.line-h+1).toString(),f)} | ${S.str}
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),d=require("./_plugin-vue_export-helper-Co-spHNg.cjs"),G=require("@kong/kongponents"),wt=require("@shikijs/core"),xt=require("@shikijs/engine-javascript"),Lt=require("@shikijs/langs/json"),Ft=require("@shikijs/langs/yaml"),Rt=require("@shikijs/langs/terraform"),Vt=require("@shikijs/langs/shellscript"),Dt=require("@shikijs/langs/powershell"),Kt=require("@shikijs/themes/material-theme-darker"),Pt=require("@shikijs/themes/catppuccin-latte"),V=require("@kong/icons"),Mt=require("@vueuse/core"),Ut=require("vue-router"),qt=require("@kong-ui-public/misc-widgets");require("@kong-ui-public/misc-widgets/dist/style.css");var Je=(t=>(t.GatewayService="service",t.Route="route",t.Consumer="consumer",t.ConsumerGroup="consumer group",t.Plugin="plugin",t.Upstream="upstream",t.Certificate="certificate",t.CACertificate="ca certificate",t.SNI="SNI",t.Key="key",t.KeySet="key set",t.Vault="vault",t.Application="application",t.Developer="developer",t.acls="ACL Credential",t["basic-auth"]="Basic Auth Credential",t["key-auth"]="Key Auth Credential",t["key-auth-enc"]="Key Auth Encrypted Credential",t.oauth2="OAuth 2.0 Credential",t["hmac-auth"]="HMAC Credential",t.jwt="JWT Credential",t.Target="target",t.Policy="policy",t.Secret="secret",t.RedisConfiguration="redis configuration",t))(Je||{}),Qe=(t=>(t.Edit="edit",t.Create="create",t))(Qe||{});const jt=["json","yaml","terraform","deck"],pe=["primary","secondary"];function Xe(t,n){const o={...t};for(const a of Object.keys(n))n[a].forceShow&&o[a]===void 0&&(o[a]=null);return o}function Ze(t,n,o){const{redactByApiSchema:a,redactByConfigSchema:r,getApiSchemaField:i,isObjectRecord:l}=d.useHelpers();let s=t;return l(t)&&Array.isArray(n?.fields)&&(s=Object.fromEntries(Object.entries(t).map(([u,f])=>{const c=i(n.fields,u);return[u,c?a(f,c):f]}))),r(s,o)}const zt={key:0,class:"config-card-fieldset-title"},Gt=e.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(t){const n=t,{i18n:{t:o}}=d.composables.useI18n(),{convertKeyToTitle:a}=d.composables.useStringHelpers();n.isArrayItem&&d.composables.useSubSchema(()=>String(n.index));const r=e.computed(()=>n.item.key??"json-array-item"),i=e.computed(()=>n.item.value??n.item),l=e.computed(()=>{const u=JSON.parse(JSON.stringify(i.value));return n.isArrayItem&&delete u.name,u}),s=e.computed(()=>n.isArrayItem?i.value?.name?a(i.value.name,"_"):o("baseConfigCard.general.entryTitle",{index:n.index}):"");return(u,f)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.isArrayItem?"fieldset":"div"),{class:e.normalizeClass(t.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:e.withCtx(()=>[t.isArrayItem?(e.openBlock(),e.createElementBlock("legend",zt,[e.createElementVNode("b",null,e.toDisplayString(s.value),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(l.value),(c,k)=>(e.openBlock(),e.createBlock(Se,{key:`${r.value}-property-${k}`,item:{key:c,label:e.unref(a)(c),value:l.value[c]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),et=d._export_sfc(Gt,[["__scopeId","data-v-32504351"]]),Ht={key:3,class:"navigation-subtitle"},Yt=e.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(t){const{i18n:{t:n}}=d.composables.useI18n();return(o,a)=>{const r=e.resolveComponent("router-link"),i=e.resolveComponent("KButton"),l=e.resolveComponent("KSkeleton");return e.openBlock(),e.createElementBlock("div",null,[t.item.to?(e.openBlock(),e.createBlock(r,{key:0,class:"navigation-link",to:t.item.to},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.item.value||e.unref(n)("baseConfigCard.commonFields.link")),1)]),_:1},8,["to"])):(e.openBlock(),e.createBlock(i,{key:1,appearance:"tertiary",class:"navigation-button",onClick:a[0]||(a[0]=s=>o.$emit("navigation-click",t.item))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.item.value||e.unref(n)("baseConfigCard.commonFields.link")),1)]),_:1})),t.item.subtitleLoading?(e.openBlock(),e.createBlock(l,{key:2,"data-testid":"navigation-subtitle-loader",type:"spinner"})):t.item.subtitle?(e.openBlock(),e.createElementBlock("div",Ht,e.toDisplayString(t.item.subtitle),1)):e.createCommentVNode("",!0)])}}}),tt=d._export_sfc(Yt,[["__scopeId","data-v-6996418f"]]),Wt=e.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(t){const{i18n:{t:n}}=d.composables.useI18n();return(o,a)=>{const r=e.resolveComponent("KBadge");return e.openBlock(),e.createBlock(r,{appearance:t.status?"success":"neutral"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.status?e.unref(n)("baseConfigCard.statusBadge.enabledLabel"):e.unref(n)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}});let se=null;function Jt(){return se||(se=wt.createHighlighterCoreSync({langs:[Lt,Ft,Rt,Vt,Dt],themes:[Kt,Pt],engine:xt.createJavaScriptRegexEngine(),langAlias:{bash:"shellscript",sh:"shellscript",shell:"shellscript",zsh:"shellscript"}})),se}function Qt(t,n){return Jt().codeToHtml(t,n)}function Y({codeElement:t,code:n,language:o}){n.length>d.SHIKI_MAX_HIGHLIGHT_LENGTH||(t.innerHTML=Qt(n,{lang:o,themes:{light:"catppuccin-latte",dark:"material-theme-darker"},structure:"inline"}))}const Xt=["data-testid"],Zt=["data-testid"],en=["data-testid"],tn=["data-testid"],nn={key:1},on=["data-testid"],an=["data-testid"],rn=["data-testid"],ln=["data-testid"],sn={name:"ConfigCardItem",components:{JsonCardItem:et,StatusBadge:Wt,InternalLinkItem:tt}},cn=e.defineComponent({...sn,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(t,{emit:n}){const o=t,a=n,r=e.useId(),i=e.useSlots(),{i18n:{t:l,formatIsoDate:s,formatUnixTimeStamp:u}}=d.composables.useI18n(),f=e.computed(()=>o.item.value!==void 0&&o.item.value!==null&&o.item.value!==""),c=e.computed(()=>!!(o.item.tooltip||i["label-tooltip"])),k=e.computed(()=>o.item.type===d.ConfigurationSchemaType.Json||o.item.type===d.ConfigurationSchemaType.JsonArray),h=e.computed(()=>o.item.type===d.ConfigurationSchemaType.JsonArray),S=d.composables.useSubSchema(()=>o.item.key),{redactByApiSchema:$}=d.composables.useHelpers(),g=e.inject(d.CONFIG_CARD_SHOW_SENSITIVE_FIELDS,e.ref(!1)),m=e.computed(()=>g.value?"default":"redacted"),T=e.computed(()=>o.item.type?o.item.type:S?.value?.encrypted?d.ConfigurationSchemaType.Redacted:void 0),p=e.computed(()=>{switch(T.value){case d.ConfigurationSchemaType.ID:return{tag:"KCopy",attrs:{"data-testid":`${o.item.key}-copy-uuid`,"copy-tooltip":l("baseConfigCard.copy.tooltip",{label:o.item.label}),text:o.item.value}};case d.ConfigurationSchemaType.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":l("baseConfigCard.copy.tooltip",{label:o.item.label})}};case d.ConfigurationSchemaType.Redacted:return{tag:"KCopy",attrs:{"data-testid":`${o.item.key}-copy-uuid-redacted`,"data-dd-privacy":"mask",format:m.value,"copy-tooltip":l("baseConfigCard.copy.tooltip",{label:o.item.label}),text:o.item.value}};case d.ConfigurationSchemaType.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"data-dd-privacy":"mask",format:m.value,"copy-tooltip":l("baseConfigCard.copy.tooltip",{label:o.item.label})}};case d.ConfigurationSchemaType.Date:return{tag:"div",attrs:{"data-testid":`${o.item.key}-date`},text:isNaN(Number(o.item.value))?s(o.item.value):u(o.item.value)};case d.ConfigurationSchemaType.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${o.item.key}-badge-status`,status:o.item.value}};case d.ConfigurationSchemaType.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case d.ConfigurationSchemaType.CopyBadge:return{tag:"div",additionalComponent:"KCopy",childAttrs:{badge:!0,truncate:!0,truncationLimit:"auto",text:o.item.value}};case d.ConfigurationSchemaType.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case d.ConfigurationSchemaType.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${o.item.key}-internal-link`,item:o.item,onNavigationClick:B=>{a("navigation-click",B)}}};case d.ConfigurationSchemaType.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${o.item.key}-external-link`,href:o.item.value},text:o.item.value};case d.ConfigurationSchemaType.ManagedBy:return{tag:"div",attrs:{"data-testid":`${o.item.key}-managed-by`},text:d.getManagedByLabel(o.item.value)??"–"};case d.ConfigurationSchemaType.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${o.item.key}-json-content`,item:o.item}};case d.ConfigurationSchemaType.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${o.item.key}-json-array-content`,item:o.item}};default:return o.item.value!=null&&typeof o.item.value=="object"?{tag:"KCodeBlock",attrs:{"data-testid":`${o.item.key}-json-code`,"data-dd-privacy":"mask",id:`json-code-${r}`,language:"json",code:JSON.stringify(g.value?o.item.value:$(o.item.value,S.value),null," "),copyCode:JSON.stringify(o.item.value,null," "),maxHeight:"480px",showLineNumbers:!1,onCodeBlockRender:Y}}:{tag:"div",attrs:{"data-testid":`${o.item.key}-plain-text`},text:o.item.value}}}),y=e.ref(),N=e.ref(),{isTruncated:I}=d.composables.useTruncationDetector(y),{isTruncated:L}=d.composables.useTruncationDetector(N);return(B,E)=>{const O=e.resolveComponent("KTooltip"),v=e.resolveComponent("KLabel"),b=e.resolveComponent("KBadge"),C=e.resolveComponent("KCopy");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["config-card-details-row",{"json-array-item":h.value,"json-item":k.value&&f.value}])},[e.createElementVNode("div",{class:e.normalizeClass(["config-card-details-label",{"json-item-label":k.value&&f.value,"slim-label":t.slim}]),"data-testid":`${t.item.key}-label`},[e.renderSlot(B.$slots,"label",{item:t.item},()=>[e.createVNode(v,{"tooltip-attributes":{maxWidth:"500px"}},e.createSlots({default:e.withCtx(()=>[e.createVNode(O,{text:e.unref(I)?t.item.label:""},{default:e.withCtx(()=>[e.createElementVNode("span",{ref_key:"labelContent",ref:y,class:"label-content"},e.toDisplayString(t.item.label),513)]),_:1},8,["text"])]),_:2},[c.value?{name:"tooltip",fn:e.withCtx(()=>[e.createElementVNode("div",{"data-testid":`${t.item.key}-label-tooltip`},[e.renderSlot(B.$slots,"label-tooltip",{},()=>[e.createTextVNode(e.toDisplayString(t.item.tooltip),1)],!0)],8,Zt)]),key:"0"}:void 0]),1024)],!0)],10,Xt),e.createElementVNode("div",{class:e.normalizeClass(["config-card-details-value",{"json-item-value":k.value&&f.value,"slim-value":t.slim}]),"data-testid":`${t.item.key}-property-value`},[e.renderSlot(B.$slots,t.item.key,{rowValue:t.item.value},()=>[f.value?(e.openBlock(),e.createElementBlock("div",nn,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p.value.tag),e.normalizeProps(e.guardReactiveProps(p.value.attrs)),{default:e.withCtx(()=>[p.value.additionalComponent==="KBadge"?(e.openBlock(),e.createElementBlock("div",{key:0,"data-testid":`${t.item.key}-badge-tags`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.value,(_,F)=>(e.openBlock(),e.createBlock(b,{key:`${t.item.key}-badge-tag-${F}`,class:"config-badge","data-testid":`${t.item.key}-badge-tag-${F}`,tooltip:_,"truncation-tooltip":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,on)):p.value.additionalComponent==="KCopy"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${t.item.key}-copy-uuid-array`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.value,(_,F)=>(e.openBlock(),e.createBlock(C,e.mergeProps({ref_for:!0},p.value.childAttrs,{key:`${t.item.key}-copy-uuid-${F}`,"data-testid":`${t.item.key}-copy-uuid-${F}`,text:_}),null,16,["data-testid","text"]))),128))],8,an)):p.value.additionalComponent==="KMethodBadge"?(e.openBlock(),e.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${t.item.key}-badge-methods`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.value,(_,F)=>(e.openBlock(),e.createBlock(b,{key:`${t.item.key}-badge-method-${F}`,appearance:Object.values(e.unref(G.BadgeMethodAppearances)).includes(_.toLowerCase())?_.toLowerCase():"custom",class:"config-badge","data-testid":`${t.item.key}-badge-method-${F}`},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,rn)):p.value.additionalComponent==="JsonCardItem"?(e.openBlock(),e.createElementBlock("div",{key:3,"data-testid":`${o.item.key}-json-array-content`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.value,(_,F)=>(e.openBlock(),e.createBlock(et,{key:`json-array-item-${F}`,index:Number(F),"is-array-item":"",item:_},null,8,["index","item"]))),128))],8,ln)):(e.openBlock(),e.createBlock(O,{key:4,text:e.unref(L)?t.item.value:""},{default:e.withCtx(()=>[e.createElementVNode("span",{ref_key:"textContent",ref:N,class:e.normalizeClass(["attrs-data-text",{truncated:t.truncated}])},e.toDisplayString(p.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(e.openBlock(),e.createElementBlock("div",{key:0,"data-testid":`${t.item.key}-no-value`}," – ",8,tn))],!0)],10,en)],2)}}}),Se=d._export_sfc(cn,[["__scopeId","data-v-2270c941"]]),nt=Symbol("config-card-row-schema"),dn=e.defineComponent({__name:"ConfigCardRowSchemaScope",props:{item:{type:Object,required:!0}},setup(t){const n=t,o=e.inject(nt,void 0);if(o){const a=d.composables.useSchema();d.composables.useSchemaProvider(e.computed(()=>{const r=o(n.item);return r?r.schema:a?.value}))}return(a,r)=>e.renderSlot(a.$slots,"default")}}),un={class:"json-config config-card-code-block"},fn=["title"],pn=e.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},requestMethod:{type:String,required:!1,default:""},entityRecord:{type:Object,required:!0},unredactedRecord:{type:Object,default:null}},setup(t){e.useCssVars(i=>({v6e8a5e62:`${r.value}ch`}));const n=t,{i18n:{t:o}}=d.composables.useI18n(),a=e.computed(()=>n.entityRecord),r=e.computed(()=>{if(!n.fetcherUrl)return 0;const i=n.fetcherUrl?.split("/");return i.length<2?0:41+(n.requestMethod==="post"?i[i.length-1]:i[i.length-2]).length});return(i,l)=>{const s=e.resolveComponent("KBadge"),u=e.resolveComponent("KClipboardProvider"),f=e.resolveComponent("KCodeBlock");return e.openBlock(),e.createElementBlock("div",un,[t.entityRecord?(e.openBlock(),e.createBlock(f,{key:0,id:"json-codeblock",code:JSON.stringify(a.value,null,2),"copy-code":JSON.stringify(t.unredactedRecord||a.value,null,2),"data-dd-privacy":"mask",language:"json","max-height":e.unref(d.CONFIG_CARD_CODE_BLOCK_MAX_HEIGHT),theme:"dark",onCodeBlockRender:e.unref(Y)},e.createSlots({_:2},[t.fetcherUrl?{name:"actions",fn:e.withCtx(()=>[e.createVNode(s,{appearance:t.requestMethod,class:"json-endpoint-method","data-testid":"json-endpoint-method"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.requestMethod),1)]),_:1},8,["appearance"]),e.createElementVNode("code",{id:"json-endpoint-codeblock",class:"json-endpoint-url",title:t.fetcherUrl},e.toDisplayString(t.fetcherUrl),9,fn),e.createVNode(u,null,{default:e.withCtx(({copyToClipboard:c})=>[e.createVNode(e.unref(G.KCodeBlockIconButton),{"aria-label":e.unref(o)("jsonCodeBlock.copy_url"),"copy-tooltip":e.unref(o)("jsonCodeBlock.copy_url"),"data-testid":"code-block-copy-button-json-endpoint-codeblock",onClick:k=>c(t.fetcherUrl)},{default:e.withCtx(()=>[e.createVNode(e.unref(V.CopyIcon),{decorative:""})]),_:1},8,["aria-label","copy-tooltip","onClick"])]),_:1})]),key:"0"}:void 0]),1032,["code","copy-code","max-height","onCodeBlockRender"])):e.createCommentVNode("",!0)])}}}),Be=d._export_sfc(pn,[["__scopeId","data-v-8736ff0c"]]);var x=Symbol("NOT_RESOLVED");function P(t,n){return{tagName:t,nodeKind:"scalar",implicit:n.implicit??!1,matchByTagPrefix:n.matchByTagPrefix??!1,implicitFirstChars:n.implicitFirstChars??null,resolve:n.resolve,identify:n.identify,represent:n.represent??(o=>String(o)),representTagName:n.representTagName??(()=>t)}}function Te(t,n){const o=n.finalize===void 0;return{tagName:t,nodeKind:"sequence",implicit:!1,matchByTagPrefix:n.matchByTagPrefix??!1,create:n.create,addItem:n.addItem,finalize:n.finalize??(a=>a),carrierIsResult:o,identify:n.identify,represent:n.represent??(a=>a),representTagName:n.representTagName??(()=>t)}}function oe(t,n){const o=n.finalize===void 0;return{tagName:t,nodeKind:"mapping",implicit:!1,matchByTagPrefix:n.matchByTagPrefix??!1,create:n.create,addPair:n.addPair,has:n.has,keys:n.keys,get:n.get,finalize:n.finalize??(a=>a),carrierIsResult:o,identify:n.identify,represent:n.represent??(a=>a),representTagName:n.representTagName??(()=>t)}}var mn=P("tag:yaml.org,2002:str",{resolve:t=>t,identify:t=>typeof t=="string"}),yn=["","~","null","Null","NULL"],gn=P("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:t=>yn.indexOf(t)!==-1?null:x,identify:t=>t===null,represent:()=>"null"}),vn=P("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:(t,n)=>t==="null"||n&&t===""?null:x,identify:t=>t===null,represent:()=>"null"}),kn=["","~","null","Null","NULL"],hn=P("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:t=>kn.indexOf(t)!==-1?null:x,identify:t=>t===null,represent:()=>"null"}),Cn=["true","True","TRUE"],bn=["false","False","FALSE"],Sn=P("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:t=>Cn.indexOf(t)!==-1?!0:bn.indexOf(t)!==-1?!1:x,identify:t=>Object.prototype.toString.call(t)==="[object Boolean]",represent:t=>t?"true":"false"}),Bn=["true"],Tn=["false"],En=P("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:t=>Bn.indexOf(t)!==-1?!0:Tn.indexOf(t)!==-1?!1:x,identify:t=>Object.prototype.toString.call(t)==="[object Boolean]",represent:t=>t?"true":"false"}),Nn=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],_n=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],$n=P("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:t=>Nn.indexOf(t)!==-1?!0:_n.indexOf(t)!==-1?!1:x,identify:t=>Object.prototype.toString.call(t)==="[object Boolean]",represent:t=>t?"true":"false"}),In=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),On=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function An(t){let n=t,o=1;return(n[0]==="-"||n[0]==="+")&&(n[0]==="-"&&(o=-1),n=n.slice(1)),n.startsWith("0b")?o*parseInt(n.slice(2),2):n.startsWith("0o")?o*parseInt(n.slice(2),8):n.startsWith("0x")?o*parseInt(n.slice(2),16):o*parseInt(n,10)}function wn(t,n){if(n){if(!On.test(t))return x}else if(!In.test(t))return x;const o=An(t);return Number.isFinite(o)?o:x}var ot=P("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:wn,identify:t=>Number.isInteger(t)&&!Object.is(t,-0)&&t.toString(10).indexOf("e")<0,represent:t=>t.toString(10)}),xn=new RegExp("^-?(?:0|[1-9][0-9]*)$"),Ln=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function Fn(t){let n=t,o=1;return(n[0]==="-"||n[0]==="+")&&(n[0]==="-"&&(o=-1),n=n.slice(1)),n.startsWith("0b")?o*parseInt(n.slice(2),2):n.startsWith("0o")?o*parseInt(n.slice(2),8):n.startsWith("0x")?o*parseInt(n.slice(2),16):o*parseInt(n,10)}function Rn(t,n){if(n){if(!Ln.test(t))return x}else if(!xn.test(t))return x;const o=Fn(t);return Number.isFinite(o)?o:x}var Vn=P("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Rn,identify:t=>Number.isInteger(t)&&!Object.is(t,-0)&&t.toString(10).indexOf("e")<0,represent:t=>t.toString(10)}),Dn=new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");function Kn(t){let n=t.replace(/_/g,""),o=1;if((n[0]==="-"||n[0]==="+")&&(n[0]==="-"&&(o=-1),n=n.slice(1)),n.startsWith("0b"))return o*parseInt(n.slice(2),2);if(n.startsWith("0x"))return o*parseInt(n.slice(2),16);if(n.includes(":")){let a=0;for(const r of n.split(":"))a=a*60+Number(r);return o*a}return n!=="0"&&n[0]==="0"?o*parseInt(n,8):o*parseInt(n,10)}function Pn(t){if(!Dn.test(t))return x;const n=Kn(t);return Number.isFinite(n)?n:x}var me=P("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:Pn,identify:t=>Number.isInteger(t)&&!Object.is(t,-0)&&t.toString(10).indexOf("e")<0,represent:t=>t.toString(10)}),Mn=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Un=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function qn(t){if(!Mn.test(t))return x;let n=t.toLowerCase();const o=n[0]==="-"?-1:1;if("+-".includes(n[0])&&(n=n.slice(1)),n===".inf")return o===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(n===".nan")return NaN;const a=o*parseFloat(n);return Number.isFinite(a)||Un.test(t)?a:x}function jn(t){if(isNaN(t))return".nan";if(t===Number.POSITIVE_INFINITY)return".inf";if(t===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(t,-0))return"-0.0";const n=t.toString(10);return/^[-+]?[0-9]+e/.test(n)?n.replace("e",".e"):n}var at=P("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:qn,identify:t=>typeof t=="number"&&(!Number.isInteger(t)||Object.is(t,-0)||t.toString(10).indexOf("e")>=0),represent:jn}),zn=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),Gn=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Hn(t,n){if(n){if(!Gn.test(t))return x;let a=t.toLowerCase();const r=a[0]==="-"?-1:1;if("+-".includes(a[0])&&(a=a.slice(1)),a===".inf")return r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(a===".nan")return NaN;const i=r*parseFloat(a);return Number.isFinite(i)?i:x}if(!zn.test(t))return x;const o=Number(t);return Number.isFinite(o)?o:x}function Yn(t){if(isNaN(t))return".nan";if(t===Number.POSITIVE_INFINITY)return".inf";if(t===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(t,-0))return"-0.0";const n=t.toString(10);return/^[-+]?[0-9]+e/.test(n)?n.replace("e",".e"):n}var Wn=P("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Hn,identify:t=>typeof t=="number"&&(!Number.isInteger(t)||Object.is(t,-0)||t.toString(10).indexOf("e")>=0),represent:Yn}),Jn=new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Qn=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Xn(t){if(!Jn.test(t))return x;let n=t.toLowerCase().replace(/_/g,"");const o=n[0]==="-"?-1:1;if("+-".includes(n[0])&&(n=n.slice(1)),n===".inf")return o===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(n===".nan")return NaN;let a=0;if(n.includes(":")){for(const r of n.split(":"))a=a*60+Number(r);a*=o}else a=o*parseFloat(n);return Number.isFinite(a)||Qn.test(t)?a:x}function Zn(t){if(isNaN(t))return".nan";if(t===Number.POSITIVE_INFINITY)return".inf";if(t===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(t,-0))return"-0.0";const n=t.toString(10);return/^[-+]?[0-9]+e/.test(n)?n.replace("e",".e"):n}var ye=P("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:Xn,identify:t=>typeof t=="number"&&(!Number.isInteger(t)||Object.is(t,-0)||t.toString(10).indexOf("e")>=0),represent:Zn}),eo=P("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:(t,n)=>t==="<<"||n&&t===""?"<<":x,identify:()=>!1}),to=/^[A-Za-z0-9+/]*={0,2}$/;function no(t){const n=t.replace(/\s/g,"");if(n.length%4!==0||!to.test(n))return x;const o=atob(n),a=new Uint8Array(o.length);for(let r=0;r<o.length;r++)a[r]=o.charCodeAt(r);return a}function oo(t){let n="";for(let o=0;o<t.length;o++)n+=String.fromCharCode(t[o]);return btoa(n)}var ao=P("tag:yaml.org,2002:binary",{resolve:no,identify:t=>Object.prototype.toString.call(t)==="[object Uint8Array]",represent:oo}),ro=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),io=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Fe(t,n,o,a=0,r=0,i=0,l=0){const s=new Date(Date.UTC(t,n,o,a,r,i,l));return s.setUTCFullYear(t,n,o),s}function lo(t){let n=ro.exec(t);if(n===null&&(n=io.exec(t)),n===null)return x;const o=+n[1],a=+n[2]-1,r=+n[3];if(!n[4]){const c=Fe(o,a,r);return c.getUTCFullYear()!==o||c.getUTCMonth()!==a||c.getUTCDate()!==r?x:c}const i=+n[4],l=+n[5],s=+n[6];let u=0;if(i>23||l>59||s>59)return x;if(n[7]){let c=n[7].slice(0,3);for(;c.length<3;)c+="0";u=+c}const f=Fe(o,a,r,i,l,s,u);if(f.getUTCFullYear()!==o||f.getUTCMonth()!==a||f.getUTCDate()!==r)return x;if(n[9]){const c=+n[10],k=+(n[11]||0);if(c>23||k>59)return x;const h=(c*60+k)*6e4;f.setTime(f.getTime()-(n[9]==="-"?-h:h))}return f}var so=P("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:lo,identify:t=>t instanceof Date,represent:t=>t.toISOString()}),co=Te("tag:yaml.org,2002:seq",{create:()=>[],addItem:(t,n)=>{t.push(n)},identify:Array.isArray});function ae(t){if(t===null||typeof t!="object"||Array.isArray(t))return!1;const n=Object.getPrototypeOf(t);return n===null||n===Object.prototype}function uo(t,n){const o={};for(const a of n)t[a]!==void 0&&(o[a]=t[a]);return o}var fo=Te("tag:yaml.org,2002:omap",{create:()=>({list:[],seen:new Set}),addItem:(t,n)=>{let o;if(n instanceof Map){if(n.size!==1)return"cannot resolve an ordered map item";o=n.keys().next().value}else if(ae(n)){const a=Object.keys(n);if(a.length!==1)return"cannot resolve an ordered map item";o=a[0]}else return"cannot resolve an ordered map item";return t.seen.has(o)?"duplicate key in ordered map":(t.seen.add(o),t.list.push(n),"")},finalize:t=>t.list,identify:()=>!1}),po=Te("tag:yaml.org,2002:pairs",{create:()=>[],addItem:(t,n)=>{if(n instanceof Map)return n.size!==1?"cannot resolve a pairs item":(t.push(n.entries().next().value),"");if(Object.prototype.toString.call(n)!=="[object Object]")return"cannot resolve a pairs item";const o=n,a=Object.keys(o);return a.length!==1?"cannot resolve a pairs item":(t.push([a[0],o[a[0]]]),"")},identify:()=>!1}),mo=oe("tag:yaml.org,2002:map",{create:()=>({}),identify:ae,represent:t=>{const n=new Map;for(const o of Object.keys(t))n.set(o,t[o]);return n},addPair:(t,n,o)=>{if(n!==null&&typeof n=="object")return"object-based map does not support complex keys";const a=String(n);return a==="__proto__"?Object.defineProperty(t,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[a]=o,""},has:(t,n)=>n!==null&&typeof n=="object"?!1:Object.prototype.hasOwnProperty.call(t,String(n)),keys:t=>Object.keys(t),get:(t,n)=>{const o=String(n);return Object.prototype.hasOwnProperty.call(t,o)?t[o]:null}}),yo=oe("tag:yaml.org,2002:set",{create:()=>new Set,identify:t=>t instanceof Set,represent:t=>{const n=new Map;for(const o of t)n.set(o,null);return n},addPair:(t,n,o)=>o!==null?"cannot resolve a set item":(t.add(n),""),has:(t,n)=>t.has(n),keys:t=>t.keys(),get:()=>null});function go(){return{scalar:Object.create(null),sequence:Object.create(null),mapping:Object.create(null)}}function vo(){return{scalar:[],sequence:[],mapping:[]}}function ko(t){const n=[];for(const o of t){let a=n.length;for(let r=0;r<n.length;r++){const i=n[r];if(i.nodeKind===o.nodeKind&&i.tagName===o.tagName&&i.matchByTagPrefix===o.matchByTagPrefix){a=r;break}}n[a]=o}return n}var re=class rt{tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(n){const o=ko(n),a=[],r=go(),i=vo();for(const c of o){if(c.nodeKind==="scalar"&&c.implicit){if(c.matchByTagPrefix)throw new Error("Implicit scalar tags cannot match by tag prefix");a.push(c)}switch(c.nodeKind){case"scalar":c.matchByTagPrefix?i.scalar.push(c):r.scalar[c.tagName]=c;break;case"sequence":c.matchByTagPrefix?i.sequence.push(c):r.sequence[c.tagName]=c;break;case"mapping":c.matchByTagPrefix?i.mapping.push(c):r.mapping[c.tagName]=c}}const l=a.filter(c=>c.implicitFirstChars===null),s=new Set;for(const c of a)if(c.implicitFirstChars!==null)for(const k of c.implicitFirstChars)s.add(k);const u=new Map;for(const c of s)u.set(c,a.filter(k=>k.implicitFirstChars===null||k.implicitFirstChars.indexOf(c)!==-1));const f=r.scalar["tag:yaml.org,2002:str"];if(!f)throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");this.tags=o,this.implicitScalarTags=a,this.implicitScalarByFirstChar=u,this.implicitScalarAnyFirstChar=l,this.defaultScalarTag=f,this.defaultSequenceTag=r.sequence["tag:yaml.org,2002:seq"],this.defaultMappingTag=r.mapping["tag:yaml.org,2002:map"],this.exact=r,this.prefix=i}lookupScalarTag(n){const o=this.exact.scalar[n];if(o)return o;for(const a of this.prefix.scalar)if(n.startsWith(a.tagName))return a}lookupSequenceTag(n){const o=this.exact.sequence[n];if(o)return o;for(const a of this.prefix.sequence)if(n.startsWith(a.tagName))return a}lookupMappingTag(n){const o=this.exact.mapping[n];if(o)return o;for(const a of this.prefix.mapping)if(n.startsWith(a.tagName))return a}resolveImplicitScalarTag(n){const o=this.implicitScalarByFirstChar.get(n.charAt(0))??this.implicitScalarAnyFirstChar;for(const r of o){const i=r.resolve(n,!1,r.tagName);if(i!==x)return{value:i,tag:r}}const a=this.defaultScalarTag;return{value:a.resolve(n,!1,a.tagName),tag:a}}withTags(...n){let o=[];for(const a of n)o=o.concat(a);return new rt([...this.tags,...o])}},Ee=new re([mn,co,mo]);new re([...Ee.tags,vn,En,Vn,Wn]);new re([...Ee.tags,gn,Sn,ot,at]);var ho=new re([...Ee.tags,hn,$n,me,ye,so,eo,ao,fo,po,yo]),Co=ho.withTags({...me,resolve:(t,n,o)=>{const a=me.resolve(t,n,o);return a===x?ot.resolve(t,n,o):a}},{...ye,resolve:(t,n,o)=>{const a=ye.resolve(t,n,o);return a===x?at.resolve(t,n,o):a}});oe("tag:yaml.org,2002:map",{create:()=>new Map,addPair:(t,n,o)=>(t.set(n,o),""),has:(t,n)=>t.has(n),keys:t=>t.keys(),get:(t,n)=>t.get(n),identify:t=>t instanceof Map||ae(t),represent:t=>{if(t instanceof Map)return t;const n=new Map,o=t;for(const a of Object.keys(o))n.set(a,o[a]);return n}});function Re(t){if(Array.isArray(t)){const n=Array.prototype.slice.call(t);for(let o=0;o<n.length;o++){if(Array.isArray(n[o]))return null;typeof n[o]=="object"&&Object.prototype.toString.call(n[o])==="[object Object]"&&(n[o]="[object Object]")}return String(n)}return typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"?"[object Object]":String(t)}oe("tag:yaml.org,2002:map",{create:()=>({}),identify:ae,represent:t=>{const n=new Map;for(const o of Object.keys(t))n.set(o,t[o]);return n},addPair:(t,n,o)=>{const a=Re(n);return a===null?"nested arrays are not supported inside keys":(a==="__proto__"?Object.defineProperty(t,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[a]=o,"")},has:(t,n)=>{const o=Re(n);return o!==null&&Object.prototype.hasOwnProperty.call(t,o)},keys:t=>Object.keys(t),get:(t,n)=>{const o=String(n);return Object.prototype.hasOwnProperty.call(t,o)?t[o]:null}});var bo={maxLength:79,indent:1,linesBefore:3,linesAfter:2};function ce(t,n,o,a,r){let i="",l="";const s=Math.floor(r/2)-1;return a-n>s&&(i=" ... ",n=a-s+i.length),o-a>s&&(l=" ...",o=a+s-l.length),{str:i+t.slice(n,o).replace(/\t/g,"→")+l,pos:a-n+i.length}}function de(t,n){return" ".repeat(Math.max(n-t.length,0))+t}function So(t,n){if(!t.buffer)return null;const o={...bo,...n},a=/\r?\n|\r|\0/g,r=[0],i=[];let l,s=-1;for(;l=a.exec(t.buffer);)i.push(l.index),r.push(l.index+l[0].length),t.position<=l.index&&s<0&&(s=r.length-2);s<0&&(s=r.length-1);let u="";const f=Math.min(t.line+o.linesAfter,i.length).toString().length,c=o.maxLength-(o.indent+f+3);for(let h=1;h<=o.linesBefore&&!(s-h<0);h++){const S=ce(t.buffer,r[s-h],i[s-h],t.position-(r[s]-r[s-h]),c);u=`${" ".repeat(o.indent)}${de((t.line-h+1).toString(),f)} | ${S.str}
|
|
2
2
|
${u}`}const k=ce(t.buffer,r[s],i[s],t.position,c);u+=`${" ".repeat(o.indent)}${de((t.line+1).toString(),f)} | ${k.str}
|
|
3
3
|
`,u+=`${"-".repeat(o.indent+f+3+k.pos)}^
|
|
4
4
|
`;for(let h=1;h<=o.linesAfter&&!(s+h>=i.length);h++){const S=ce(t.buffer,r[s+h],i[s+h],t.position-(r[s]-r[s+h]),c);u+=`${" ".repeat(o.indent)}${de((t.line+h+1).toString(),f)} | ${S.str}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as H, computed as S, openBlock as d, createBlock as E, resolveDynamicComponent as pe, normalizeClass as Z, withCtx as g, createElementBlock as $, createElementVNode as F, toDisplayString as T, createCommentVNode as L, Fragment as ee, renderList as ie, unref as c, resolveComponent as R, createTextVNode as K, useId as Tn, useSlots as Fe, inject as ke, ref as P, renderSlot as x, createVNode as O, createSlots as se, normalizeProps as At, guardReactiveProps as Nt, mergeProps as ye, useCssVars as Bt, watch as le, watchEffect as $n, provide as Ne, onMounted as Oe, normalizeStyle as In, onBeforeMount as Ze, withModifiers as Ee, Teleport as Lt, onUnmounted as _n, withDirectives as he, vShow as be, withKeys as Ft, shallowRef as En, onBeforeUnmount as Rt, warn as On, useTemplateRef as An } from "vue";
|
|
2
|
-
import { u as Nn, c as U, _ as X, S as Bn, C as G, a as wt, g as Ln, b as Re, d as ge, E as Fn, I as Rn, e as Ae, D as Kt, f as wn, h as Kn, i as xn, j as oe, P as Pn, k as Dn, n as Un } from "./_plugin-vue_export-helper-
|
|
3
|
-
import { l as nc, F as ac, M as ic, m as rc, o as oc } from "./_plugin-vue_export-helper-
|
|
2
|
+
import { u as Nn, c as U, _ as X, S as Bn, C as G, a as wt, g as Ln, b as Re, d as ge, E as Fn, I as Rn, e as Ae, D as Kt, f as wn, h as Kn, i as xn, j as oe, P as Pn, k as Dn, n as Un } from "./_plugin-vue_export-helper-BiPB3h_p.js";
|
|
3
|
+
import { l as nc, F as ac, M as ic, m as rc, o as oc } from "./_plugin-vue_export-helper-BiPB3h_p.js";
|
|
4
4
|
import { BadgeMethodAppearances as Mn, KCodeBlockIconButton as qn, KExternalLink as jn, KButton as ct, KInput as zn, KTruncate as Vn, KBadge as Yn } from "@kong/kongponents";
|
|
5
5
|
import { createHighlighterCoreSync as Wn } from "@shikijs/core";
|
|
6
6
|
import { createJavaScriptRegexEngine as Hn } from "@shikijs/engine-javascript";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchUrlBuilder.d.ts","sourceRoot":"","sources":["../../../src/composables/useFetchUrlBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAC9D,OAAO,KAAK,EACV,0BAA0B,EAC1B,sBAAsB,EACvB,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAE/D,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,MAAM,EAAE,gBAAgB,CAAC,sBAAsB,GAAG,0BAA0B,CAAC,EAC7E,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,IAmBjB,eAAe,sBAAsB,
|
|
1
|
+
{"version":3,"file":"useFetchUrlBuilder.d.ts","sourceRoot":"","sources":["../../../src/composables/useFetchUrlBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAC9D,OAAO,KAAK,EACV,0BAA0B,EAC1B,sBAAsB,EACvB,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAE/D,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,MAAM,EAAE,gBAAgB,CAAC,sBAAsB,GAAG,0BAA0B,CAAC,EAC7E,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,IAmBjB,eAAe,sBAAsB,YAuD9C"}
|
|
@@ -36,5 +36,12 @@ dataKeyNameRef?: MaybeRefOrGetter<string | undefined>): {
|
|
|
36
36
|
}>;
|
|
37
37
|
fetcherCacheKey: Ref<number, number>;
|
|
38
38
|
};
|
|
39
|
+
/**
|
|
40
|
+
* Add `page[size]`/`page[number]` to a name-filtered request.
|
|
41
|
+
*
|
|
42
|
+
* Konnect `/search` endpoints (KSearch) ignore these params and page with `size` and an
|
|
43
|
+
* `offset` cursor instead, which the url builder adds, so `/search` requests are left as-is.
|
|
44
|
+
*/
|
|
45
|
+
export declare function withFilterPagination(requestUrl: string, { pageSize, page }: TableDataFetcherParams): string;
|
|
39
46
|
export declare function useFetcherCacheKey(cacheId?: string): Ref<number, number>;
|
|
40
47
|
//# sourceMappingURL=useFetcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFetcher.d.ts","sourceRoot":"","sources":["../../../src/composables/useFetcher.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAChD,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,0BAA0B,EAC1B,sBAAsB,EACtB,QAAQ,EACT,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAGxC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAK/D,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,SAAS,EAAE,gBAAgB,CAAC,sBAAsB,GAAG,0BAA0B,CAAC,EAChF,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC;AACzB;;;;;GAKG;AACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC;6BAYf,sBAAsB,KAAG,OAAO,CAAC,eAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useFetcher.d.ts","sourceRoot":"","sources":["../../../src/composables/useFetcher.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAChD,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,0BAA0B,EAC1B,sBAAsB,EACtB,QAAQ,EACT,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAGxC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAK/D,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,SAAS,EAAE,gBAAgB,CAAC,sBAAsB,GAAG,0BAA0B,CAAC,EAChF,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC;AACzB;;;;;GAKG;AACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC;6BAYf,sBAAsB,KAAG,OAAO,CAAC,eAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;EAuFxF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,sBAAsB,GAAG,MAAM,CAc3G;AAED,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,uBAWlD"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const $=require("axios"),i=require("vue"),M=require("@kong-ui-public/i18n"),oe=Symbol("PLUGIN_FORM_LAYOUT_STATE"),ce=Symbol("CONFIG_CARD_SHOW_SENSITIVE_FIELDS"),R=Symbol("DECK_COMMAND_EDITOR"),K="[entities-shared] DeckCommandEditor was not provided. Provide it via the `DECK_COMMAND_EDITOR_KEY` injection key or the `provideDeckCommandEditor` helper (see @kong-ui-public/entities-shared/deck-editor).",ie="50vh",le=2e5,Y={MANAGED_BY:"KM-3018-entity-managed-by"};function ue(){return{getAxiosInstance:(e={})=>{try{const n=i.inject("get-axios-instance",void 0);return typeof n=="function"?n(e):$.create({withCredentials:!0,timeout:3e4,...e})}catch(n){return console.warn("getAxiosInstance:",n.message||n),$.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{const n=e?.response?.headers||{};return n["x-trace-id"]||n["x-datadog-trace-id"]||""}}}function de(){return{debounce:(e,n)=>{let o;return(...t)=>{clearTimeout(o),o=window?.setTimeout(()=>{e(...t)},n)}}}}const L="khcp-user-table-preferences",J={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0,columnVisibility:{}};function fe(){const e=o=>{if(typeof o=="string")try{return JSON.parse(o)}catch(t){console.error("useTablePreferences(tryParseJson)",t);return}},n=()=>{const o=e(localStorage.getItem(L));return!o||!Object.keys(o).length?new Map:new Map(Object.entries(o))};return{setTablePreferences:(o,t)=>{try{const a=n();a.set(o,t),localStorage.setItem(L,JSON.stringify(Object.fromEntries(a.entries())))}catch(a){console.error("useTablePreferences(setTablePreferences)",a)}},getTablePreferences:(o,t)=>n()?.get(o)||void 0||t||J,deleteAllTablePreferences:()=>{localStorage.removeItem(L)}}}function N(e={}){const{getAxiosInstance:n}=ue();return{axiosInstance:n(e)}}const pe={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},ge={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},ye={actions:{viewConfiguration:"View configuration",hideConfiguration:"Hide configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON",terraform:"Terraform",deck:"decK"},errors:{edit:"The entity could not be edited at this time."}},me={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},he={title:"Configuration",actions:{copy:"Copy JSON",deck_customize:"Customize before copying to CLI",deck_customize_cancel:"Cancel",sensitive_fields:"Show sensitive fields",sensitive_fields_tooltip:"View masked sensitive data in your configurations if any field values have been redacted."},sections:{advanced:"Advanced",plugin:"Plugin specific configuration",policy:"Policy specific configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last updated",created_at_label:"Created",managed_by_label:"Managed By",tags_label:"Tags",link:"Link",partial_label:"Redis configuration"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{formatLabel:"Format:",entryTitle:"Entry {index}",structuredFormat:"Structured"}},be={learnMore:"Learn more",pricingTitle:"Pricing: "},_e={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},ve={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Ae={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Ce={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},Ie={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},ke={copy_url:"Copy URL"},we={hint:{konnect:"The {token} environment variable must be added first. See {link} for details.",kongManager:"If your Admin API is secured, set up authentication following {link}."},documentation:"the documentation",steps:{step_1:"Step 1: Export token",step_2:"Step 2: Apply configuration"},customization:{title:"Customize before copying to CLI",copy_pat:"Make sure to copy your personal access token now. You won't be able to see it again.",reuse_pat:"Use an existing PAT if you've already generated one.",generate_pat:"Generate PAT",footer_reminder:"Changes you make here won't affect your configuration. After you apply changes with decK in the CLI, refresh the page to view them.",secret_advise:"Command may contain sensitive values. Treat it as a secret."},copy_tooltip:"Copy"},Ee={body:"Want a ready-to-use CLI command? {cta} to view this configuration as a decK sync snippet you can copy directly.",cta:"Switch to decK format"},De={title:"Generate a Personal Access Token",description:"Personal access tokens are used to authenticate decK commands and Konnect API requests.",fields:{name:{label:"Name",placeholder:"Enter token name"},expiresAt:{label:"Expiration date",placeholder:"Select an expiration date",n_days:"{n} days"}},actions:{cancel:"Cancel",generate:"Generate",generating:"Generating…"}},Oe={dismissLabel:"Dismiss"},Le={rotateKey:"Rotate key",generateKey:"Generate key",placeholder:"Enter or generate a key",oneTimeHint:"The key is shown only once. Copy it now and store it securely.",copy:"Copy",showKey:"Show key",hideKey:"Hide key"},X={global:pe,deleteModal:ge,baseForm:ye,baseTable:me,baseConfigCard:he,emptyState:be,filter:_e,debouncedFilter:ve,errors:Ae,validationErrors:Ce,toggleModal:Ie,jsonCodeBlock:ke,deckCodeBlock:we,deckCallout:Ee,generatePatModal:De,onboardingCard:Oe,sensitiveInput:Le};function O(){const e=M.createI18n("en-us",X);return{i18n:e,i18nT:M.i18nTComponent(e)}}var C=(e=>(e[e.InitialLoad=0]="InitialLoad",e[e.Loading=1]="Loading",e[e.Idle=2]="Idle",e[e.NoResults=3]="NoResults",e[e.NoRecords=4]="NoRecords",e[e.Error=5]="Error",e))(C||{}),P=(e=>(e.CaCertificate="ca_certificate",e.Certificate="certificate",e.Consumer="consumer",e.ConsumerGroup="consumer_group",e.GatewayService="service",e.Key="key",e.KeySet="set",e.Plugin="plugin",e.Route="route",e.SNI="sni",e.Upstream="upstream",e.Target="target",e.Vault="vault",e.Partial="partial",e.CloudGatewayAddon="cloud_gateway_addon",e.BackendCluster="backend_cluster",e.VirtualCluster="virtual_cluster",e.Listener="listener",e.ProducePolicy="produce_policy",e.ConsumePolicy="consume_policy",e.ClusterPolicy="cluster_policy",e.ListenerPolicy="listener_policy",e.SchemaRegistry="schema_registry",e.StaticKey="static_key",e.TlsTrustBundle="tls_trust_bundle",e.AuthServer="auth_server",e.AuthServerScopes="auth_server_scopes",e.AuthServerClaims="auth_server_claims",e.AuthServerClients="auth_server_clients",e.Other="other",e.PluginSchema="plugin_schema",e.CustomPlugin="custom_plugin",e.ClonedPlugin="cloned_plugin",e))(P||{});const Te=Object.values(P),q=["ca_certificate","certificate","consumer","consumer_group","service","key","set","plugin","plugin_schema","custom_plugin","cloned_plugin","route","upstream","target","vault","partial"];function B(e){return q.includes(e)}const Me=["backend_cluster","virtual_cluster","listener","produce_policy","consume_policy","cluster_policy","listener_policy","schema_registry","static_key","tls_trust_bundle"],xe=["auth_server","auth_server_scopes","auth_server_claims","auth_server_clients"];var D=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.CopyBadge="copy-badge",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e.ManagedBy="managed-by",e))(D||{}),Q=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e.Policy="policy",e))(Q||{});const Re=["structured","yaml","json","terraform","deck"];function F(){const e=(c,r)=>r?.[c]??void 0,n=(c,r)=>{if(c.length!==r.length)return!1;const f=new Set([...c,...r]);for(const l of f){const p=c.filter(_=>_===l).length,m=r.filter(_=>_===l).length;if(p!==m)return!1}return!0},o=(c,r,f)=>{if(f){if(Object.keys(c).length===Object.keys(r).length)for(const l in c)if(Array.isArray(c[l])&&Array.isArray(r[l])){if(n(c[l],r[l]))continue;return!1}else{if(c[l]===r[l])continue;return!1}else return!1;return!0}try{return JSON.stringify(c)===JSON.stringify(r)}catch{return!1}},t=c=>(r,f)=>{let l=r[c]===void 0||r[c]===null?"":r[c],p=f[c]===void 0||f[c]===null?"":f[c];return Array.isArray(r[c])&&(l=r[c][0]),Array.isArray(f[c])&&(p=f[c][0]),l.localeCompare(p)},a=c=>c?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(c):!1,u="********",s=c=>!!c&&typeof c=="object"&&!Array.isArray(c),d=(c,r)=>c?.find(l=>Object.keys(l)?.[0]===r)?.[r],g=(c,r)=>{if(!r||c===null||c===void 0)return c;if(r.type==="string")return r.encrypted?u:c;if(r.type==="record"||r.type==="map"){if(!s(c))return c;if(r.type==="map"&&!r.values)return{...c};const f={};for(const l in c)if(r.type==="record"){const p=d(r.fields,l);f[l]=p?g(c[l],p):c[l]}else if(r.type==="map"){const p=r.values;f[l]=g(c[l],{...p,encrypted:!!(r.encrypted||p.encrypted)})}return f}if((r.type==="array"||r.type==="set")&&Array.isArray(c)){const f=r.elements;return f?c.map(l=>g(l,{...f,encrypted:!!(r.encrypted||f.encrypted)})):c.slice()}return c},h=(c,r)=>{if(Array.isArray(c))return c.map(l=>h(l,r));if(!s(c))return c;const f={};for(const l in c){if(r[l]?.type===D.Redacted){f[l]=u;continue}if(r[l]?.type===D.RedactedArray&&Array.isArray(c[l])){f[l]=c[l].map(()=>u);continue}f[l]=h(c[l],r)}return f};return{getPropValue:e,objectsAreEqual:o,sortAlpha:t,isValidUuid:a,isObjectRecord:s,getApiSchemaField:d,redactByApiSchema:g,redactByConfigSchema:h}}function Ke(e,n,o,t={fetchedItemsKey:"data",searchKeys:["id"]}){o||(o="1000");const{axiosInstance:a}=N(e.axiosRequestConfig),{i18n:{t:u}}=O(),{debounce:s}=de(),d=s(async y=>{await k(y)},200),g=i.ref(!1),h=i.ref(""),c=i.ref(""),r=i.ref([]),f=i.ref([]),l=i.ref(void 0),p=i.computed(()=>{let y=`${e.apiBaseUrl}${i.unref(n)}`;return e.app==="konnect"&&(y=y.replace(/{controlPlaneId}/gi,e?.controlPlaneId||"")),y.replace(/\/{workspace}/gi,e?.workspace?`/${e.workspace}`:"")}),{isValidUuid:m}=F(),_=async()=>{try{g.value=!0;const{data:y}=await a.get(`${p.value}?size=${o}`);y?.next||(l.value=t.fetchedItemsKey in y?y[t.fetchedItemsKey]:[]),f.value=t.fetchedItemsKey in y?y[t.fetchedItemsKey]:[],r.value=f.value}catch{r.value=[],h.value=u("debouncedFilter.errors.fetch")}finally{g.value=!1}},I=i.ref(""),k=async y=>{if(I.value!==y){if(I.value=y??"",!y){r.value=f.value;return}if(l.value===void 0)try{if(g.value=!0,h.value="",c.value="",e.app==="konnect"){const b=`${p.value}/${y}`,{data:v}=await a.get(`${b}?size=${o}`);t.fetchedItemsKey in v?r.value=v[t.fetchedItemsKey]:v?.[t.exactMatchKey??"id"]?r.value=[v]:r.value=[]}else{const b=[];m(y)&&t.searchKeys.includes("id")?b.push((async()=>{const{data:A}=await a.get(`${p.value}/${y}`);return[A[t.fetchedItemsKey]??A]})()):b.push(...t.searchKeys.filter(A=>A!=="id").map(async A=>{const{data:E}=await a.get(`${p.value}?${A}=${y}`);return E[t.fetchedItemsKey]}));const v=await Promise.all(b),w=new Set;r.value=[],v?.forEach?.(A=>{A?.forEach?.(E=>{w.has(E.id)||(w.add(E.id),r.value.push(E))})})}}catch(b){b?.response?.status===404?c.value=u("debouncedFilter.errors.invalid"):(r.value=[],h.value=u("debouncedFilter.errors.fetch"))}finally{g.value=!1}else g.value=!0,c.value="",r.value=l.value?.filter(b=>{let v=!1;for(const w of t.searchKeys)(typeof b[w]=="string"?b[w]?.toLowerCase():b[w])?.includes(y.toLowerCase())&&(v=!0);return v}),(!r.value||!r.value.length)&&(c.value=u("debouncedFilter.errors.invalid")),g.value=!1}};return{loading:g,error:h,validationError:c,results:r,allRecords:l,loadItems:_,debouncedQueryChange:d}}function Ne(e,n){const o=i.inject(R,null),t=i.computed(()=>{const s=i.toValue(e),d=s.app==="kongManager"||!!(s.app==="konnect"&&s.enableDeckConfig),g=i.toValue(n);return d&&g!==void 0&&B(g)}),a=i.computed(()=>{const s=i.toValue(e),d=s.app==="konnect"&&s.enableDeckConfig&&typeof s.enableDeckConfig!="boolean"?s.enableDeckConfig.customization:void 0;if(d&&!o){console.warn(K);return}return d}),u=i.computed(()=>{const s=i.toValue(e);return s.app==="konnect"&&s.enableDeckConfig&&typeof s.enableDeckConfig!="boolean"?s.enableDeckConfig.calloutPreferenceKey:s.app==="kongManager"?s.deckCalloutPreferenceKey:void 0});return{isDeckEnabled:t,deckCustomizationOptions:a,deckCalloutPreferenceKey:u}}function Pe(e,n){const o=i.inject(R,null),t=i.computed(()=>{const s=i.toValue(e);return(s.app==="kongManager"||!!(s.app==="konnect"&&s.enableDeckTab))&&B(i.toValue(n))}),a=i.computed(()=>{const s=i.toValue(e),d=s.app==="konnect"&&s.enableDeckTab&&typeof s.enableDeckTab!="boolean"?s.enableDeckTab.customization:void 0;if(d&&!o){console.warn(K);return}return d}),u=i.computed(()=>{const s=i.toValue(e);return s.app==="konnect"&&s.enableDeckTab&&typeof s.enableDeckTab!="boolean"?s.enableDeckTab.calloutPreferenceKey:s.app==="kongManager"?s.deckCalloutPreferenceKey:void 0});return{isDeckEnabled:t,deckCustomizationOptions:a,deckCalloutPreferenceKey:u}}function Be(e,n){const o=i.unref(n),t=i.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${o}`):new URL(o));return t.value.search="",a=>`${t.value.href}/${a}`}function Fe(){const{i18n:{t:e}}=O();return{getErrorFieldsFromError:t=>{if(!t)return{messages:[e("errors.unexpected")],fields:[]};if(t?.response?.status===401)return{messages:[],fields:[]};let a=[e("errors.unexpected")];const u=[];if(t?.response?.data){if(t.response.data.details?.length)return a=[],t.response.data.details.forEach(s=>{let d=e("errors.unexpected");s.messages&&Array.isArray(s.messages)&&s.messages.length&&(d=s.messages.join(", ")),s.field&&u.push({field:s.field,message:d}),a.push(`${s.field??""} ${d}`)}),{messages:a,fields:u};if(t.response.data.message&&Array.isArray(t.response.data.message))return a=[],t.response.data.message.forEach(s=>{if(s?.constraints){const d=Object.values(s.constraints).join(", ");a.push(d),s.property&&u.push({field:s.property,message:d})}else s?.property&&s?.message?(u.push({field:s.property,message:s.message}),a.push(s.message)):a.push(s)}),{messages:a,fields:u};if(typeof t.response.data.message=="string"||typeof t.response.data=="string")return{messages:[t.response.data.message],fields:[]};if(typeof t.response.data=="object")return a=[],Object.keys(t.response.data).forEach(s=>{u.push({field:s,message:t.response.data[s]}),a.push(t.response.data[s])}),{messages:a,fields:u}}return{messages:[t.message||e("errors.unexpected")],fields:[]}},getMessageFromError:t=>{if(!t)return e("errors.unexpected");if(t?.response?.status===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if(t?.response?.data){if(t.response.data.detail)return t.response.data.detail;if(t.response.data.details?.length)return t.response.data.details.map(a=>{let u=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(u=a.messages.join(", ")),a.field?`${a.field} - ${u}`:u}).join("; ");if(t.response.data.message){const{message:a}=t.response.data;return Array.isArray(a)?a[0]?.constraints?Object.values(a[0].constraints)[0]:a[0]:a}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(a=>`${a} ${t.response.data[a]}`).join(", ")}return t.message||e("errors.unexpected")}}}function Ue(e){const n=window.location.origin,o=n.endsWith("/")?n:`${n}/`;try{const t=e.join("/"),a=`${o}${t}`,u=e.some(d=>d.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(a)&&!u&&new URL(a))return`${o}${t}`;throw new Error("Invalid url")}catch(t){return console.warn("Failed to build valid URL:",t),""}}function Z(e,n){const o=i.computed(()=>{const a=i.toValue(e);return typeof a.isExactMatch=="boolean"?a.isExactMatch:a.app==="konnect"}),t=i.computed(()=>{const a=i.toValue(n);return a.startsWith("/")?new URL(`${window.location.origin}${a}`):new URL(a)});return a=>{const{page:u,pageSize:s,offset:d,sortColumnKey:g,sortColumnOrder:h,query:c}=a;try{let r=new URL(t.value.href);if(o.value&&c){const f=new URLSearchParams(t.value.search);r.search="",r=i.toValue(e).isExactMatch?new URL(`${r.href}/${c}`):new URL(`${r.href}?filter[name][contains]=${c}`),f.forEach((l,p)=>r.searchParams.append(p,l))}else o.value||new URLSearchParams(c).forEach((f,l)=>{r.searchParams.append(l,f)}),g&&r.searchParams.append("sort_by",g),h==="desc"&&r.searchParams.append("sort_desc","1"),r.searchParams.append("size",String(s));return d&&u!==1&&r.searchParams.append("offset",String(d)),r.href}catch(r){return console.error("RouteList(fetcher)",r),i.toValue(n)}}}const j=new Map;function $e(e,n,o){const t=i.ref(!0),a=i.toValue(e),{axiosInstance:u}=N(a.axiosRequestConfig),s=Z(e,n),d=i.ref({status:C.Idle}),g=async r=>{const f=i.toValue(o)||"data";try{d.value=t.value?{status:C.InitialLoad}:{status:C.Loading},t.value=!1;let l=s(r);l.includes("filter[name]")&&(l=`${l}&page[size]=${r.pageSize}&page[number]=${r.page}`);const p=await u.get(l);if(p.status>=400)throw p;const m=p.data,_=f&&f.replace(/[^\w-_]/gi,"");let I;m[_]?I=Array.isArray(m[_])?m[_]:[m[_]]:Array.isArray(m)?I=m:I=Object.keys(m).length?[m]:[];const k={data:I,total:I.length,...m.offset?{pagination:{offset:m.offset}}:null};return k.data.length===0&&!r.query?d.value={status:C.NoRecords,response:k}:d.value={status:C.Idle,response:k},k}catch(l){const p={data:[],total:0};return r.query&&(l.response?.status===404||l.status===404)?(d.value={status:C.NoResults,response:p,error:l.response?l:{response:l}},p):(d.value={status:C.Error,response:p,error:l.response?l:{response:l}},p)}},h=a.cacheIdentifier,c=ee(h);return{fetcher:g,fetcherState:d,fetcherCacheKey:c}}function ee(e){if(e){let n=j.get(e);return n||(n=i.ref(1),j.set(e,n)),n}return i.ref(1)}function je(){const e=(t,a="_")=>t?t.split(a).map(u=>u.toLowerCase()==="id"?u.toUpperCase():u.charAt(0).toUpperCase()+u.substring(1)).join(" "):"",n=/(?:^|[\s-:'"])\w/g;return{capitalize:t=>t?t.replace(n,a=>a.toUpperCase()):"",convertKeyToTitle:e}}const te=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,G=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const n=e.match(te);if(!n)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return n.shift(),n},S=e=>e==="*"||e==="x"||e==="X",V=e=>{const n=parseInt(e,10);return isNaN(n)?e:n},Ge=(e,n)=>typeof e!=typeof n?[String(e),String(n)]:[e,n],Se=(e,n)=>{if(S(e)||S(n))return 0;const[o,t]=Ge(V(e),V(n));return o>t?1:o<t?-1:0},H=(e,n)=>{for(let o=0;o<Math.max(e.length,n.length);o++){const t=Se(e[o]||"0",n[o]||"0");if(t!==0)return t}return 0},Ve=(e,n)=>{const o=G(e),t=G(n),a=o.pop(),u=t.pop(),s=H(o,t);return s!==0?s:a&&u?H(a.split("."),u.split(".")):a||u?a?-1:1:0},z=(e,n,o)=>{He(o);const t=Ve(e,n);return se[o].includes(t)},se={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},W=Object.keys(se),He=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(W.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${W.join("|")}`)},ze=e=>typeof e=="string"&&/^[v\d]/.test(e)&&te.test(e);function We(e){const{gatewayInfo:n,supportedRange:o}=e;if(!n)return!0;const{edition:t,version:a}=n;if(!ze(a))return console.error("Invalid version"),!1;const u=o[t];if(!u)return!1;const[s,d]=u;return!(s&&z(a,s,"<")||d&&z(a,d,">"))}function Ye(e){const n=i.ref(0),o=i.ref(0),t=i.ref(!1);return i.watch(e,u=>{u&&!t.value&&(n.value=u.offsetWidth,o.value=u.scrollWidth,t.value=!0)}),{isTruncated:i.computed(()=>n.value<o.value)}}function Je(){const{i18n:{t:e}}=O();return{utf8Name:o=>/^[\p{N}\p{L}.\-_~]*$/u.test(o)?"":e("validationErrors.utf8Name")}}const U=Symbol("schema"),Xe=e=>{i.provide(U,e)},ae=()=>i.inject(U,void 0),qe=e=>/^\d+$/.test(e),Qe=e=>{const n=ae(),o=i.computed(()=>{const t=n?.value,a=e();if((t?.type==="array"||t?.type==="set")&&qe(a)){const s=t.elements;return s&&{...s,encrypted:!!(t.encrypted||s.encrypted)}}return t?.fields?.find(s=>Object.keys(s)[0]===a)?.[a]});return i.provide(U,o),o};function Ze(e){let n="";const o=i.ref(!1),t=i.ref(null),a=i.computed(()=>{let s;return o.value?s=!0:t.value?s=t.value.hasData||e&&i.toValue(e):s=!1,!s});return{tableState:t,hasRecords:o,hideTableToolbar:a,handleStateChange:s=>{s.hasData?o.value=!0:s.state==="success"&&!s.hasData&&(!e||!n)&&(o.value=!1),e&&(n=i.toValue(e)),t.value={...s}}}}function ne(){const e=i.inject(Y.MANAGED_BY,!1);return i.computed(()=>!!i.toValue(e))}const et=e=>e?.service||e?.tool||null,tt="Custom",x={"terraform-provider-konnect":"Terraform",deck:"decK","kong-gateway-operator":"Kong Gateway Operator",kongctl:"kongctl","kong-ingress-controller":"Kong Ingress Controller","gw-manager":"Konnect UI","ai-manager":"AI Manager","dev-portal":"Dev Portal"},st=e=>{const n=et(e);return n?Object.hasOwn(x,n)?x[n]:tt:null};let T;const re=()=>(T===void 0&&(T=M.createI18n("en-us",X).t("baseConfigCard.commonFields.managed_by_label")),T);function at(e,n={}){const o=ne();return{defaultTablePreferences:{columnVisibility:{managed_by:!1,...n}},tableHeaders:i.computed(()=>({...i.toValue(e),...o.value?{managed_by:{label:re(),sortable:!1}}:{}}))}}const nt={useAxios:N,useDebouncedFilter:Ke,useDeleteUrlBuilder:Be,useBaseEntityDeckOptions:Ne,useBaseFormDeckOptions:Pe,useErrors:Fe,useExternalLinkCreator:Ue,useFetcher:$e,useFetcherCacheKey:ee,useFetchUrlBuilder:Z,useHelpers:F,useStringHelpers:je,useI18n:O,useGatewayFeatureSupported:We,useTruncationDetector:Ye,useValidators:Je,useSchema:ae,useSchemaProvider:Xe,useSubSchema:Qe,useTableState:Ze,useManagedByEnabled:ne,useManagedByColumn:at},rt=(e,n)=>{const o=e.__vccOpts||e;for(const[t,a]of n)o[t]=a;return o};exports.CONFIG_CARD_CODE_BLOCK_MAX_HEIGHT=ie;exports.CONFIG_CARD_FORMATS=Re;exports.CONFIG_CARD_SHOW_SENSITIVE_FIELDS=ce;exports.ConfigurationSchemaSection=Q;exports.ConfigurationSchemaType=D;exports.DECK_COMMAND_EDITOR_KEY=R;exports.DECK_COMMAND_EDITOR_MISSING_WARNING=K;exports.ENTITIES_FEATURE_FLAGS=Y;exports.EventGatewayTypesArray=Me;exports.FetcherStatus=C;exports.IdentityTypesArray=xe;exports.MANAGED_BY_LABELS=x;exports.PLUGIN_FORM_LAYOUT_STATE=oe;exports.SHIKI_MAX_HIGHLIGHT_LENGTH=le;exports.SupportedEntityDeckArray=q;exports.SupportedEntityType=P;exports.SupportedEntityTypesArray=Te;exports._export_sfc=rt;exports.composables=nt;exports.de=fe;exports.getManagedByFieldLabel=re;exports.getManagedByLabel=st;exports.isSupportedDeckEntityType=B;exports.ne=J;exports.useHelpers=F;
|