@kong-ui-public/entities-shared 3.43.3 → 3.44.1
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-BVLVXTg1.cjs +1 -0
- package/dist/_plugin-vue_export-helper-DD7nKH1E.js +747 -0
- package/dist/deck-editor.cjs.js +1 -0
- package/dist/deck-editor.es.js +86 -0
- package/dist/entities-shared.cjs.js +66 -0
- package/dist/entities-shared.es.js +4756 -53
- package/dist/style.css +1 -1
- package/dist/types/components/common/DeckCodeBlockInternal.vue.d.ts.map +1 -1
- package/dist/types/composables/useDeckOptions.d.ts.map +1 -1
- package/dist/types/constants.d.ts +21 -0
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/deck-editor.d.ts +18 -0
- package/dist/types/deck-editor.d.ts.map +1 -0
- package/dist/types/types/deck.d.ts +7 -0
- package/dist/types/types/deck.d.ts.map +1 -1
- package/package.json +10 -5
- package/dist/DeckCommandEditor-DeA1RUW0.js +0 -74
- package/dist/entities-shared.umd.js +0 -66
- package/dist/index-Bd4O1eIT.js +0 -5482
|
@@ -1,55 +1,4758 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineComponent as ee, computed as T, openBlock as f, createBlock as E, resolveDynamicComponent as je, normalizeClass as ue, withCtx as k, createElementBlock as A, createElementVNode as F, toDisplayString as S, createCommentVNode as B, Fragment as pe, renderList as he, unref as g, resolveComponent as L, createVNode as K, createTextVNode as P, useCssVars as Mt, useId as jn, useSlots as Ue, ref as q, renderSlot as M, createSlots as we, normalizeProps as Un, guardReactiveProps as qn, mergeProps as qe, watch as Ce, inject as jt, watchEffect as Hn, onMounted as ct, onBeforeMount as st, withModifiers as He, Teleport as Ut, onUnmounted as zn, withDirectives as $e, vShow as Ee, withKeys as Vn, warn as Yn } from "vue";
|
|
2
|
+
import { c as G, _ as se, C as Z, S as _e, E as Wn, I as Gn, a as Je, D as Jn, b as Qn, d as Xn, e as me, P as Zn, f as ei } from "./_plugin-vue_export-helper-DD7nKH1E.js";
|
|
3
|
+
import { F as Pc, g as Mc, i as jc } from "./_plugin-vue_export-helper-DD7nKH1E.js";
|
|
4
|
+
import { BadgeMethodAppearances as ti, KExternalLink as ni, KButton as vt, KTruncate as ii, KBadge as ri } from "@kong/kongponents";
|
|
5
|
+
import { createHighlighterCoreSync as oi } from "@shikijs/core";
|
|
6
|
+
import { createJavaScriptRegexEngine as ai } from "@shikijs/engine-javascript";
|
|
7
|
+
import li from "@shikijs/langs/json";
|
|
8
|
+
import ci from "@shikijs/langs/yaml";
|
|
9
|
+
import si from "@shikijs/langs/terraform";
|
|
10
|
+
import ui from "@shikijs/langs/shellscript";
|
|
11
|
+
import di from "@shikijs/langs/powershell";
|
|
12
|
+
import fi from "@shikijs/themes/catppuccin-mocha";
|
|
13
|
+
import pi from "@shikijs/themes/catppuccin-latte";
|
|
14
|
+
import { LanguageShellIcon as kt, LanguageBashIcon as bt, InfoIcon as mi, BookIcon as qt, AddIcon as Ht, CloseIcon as yi, ChevronDownIcon as gi, CopyIcon as hi } from "@kong/icons";
|
|
15
|
+
import { useRouter as vi } from "vue-router";
|
|
16
|
+
var ki = /* @__PURE__ */ ((e) => (e.GatewayService = "service", e.Route = "route", e.Consumer = "consumer", e.ConsumerGroup = "consumer group", e.Plugin = "plugin", e.Upstream = "upstream", e.Certificate = "certificate", e.CACertificate = "ca certificate", e.SNI = "SNI", e.Key = "key", e.KeySet = "key set", e.Vault = "vault", e.Application = "application", e.Developer = "developer", e.acls = "ACL Credential", e["basic-auth"] = "Basic Auth Credential", e["key-auth"] = "Key Auth Credential", e["key-auth-enc"] = "Key Auth Encrypted Credential", e.oauth2 = "OAuth 2.0 Credential", e["hmac-auth"] = "HMAC Credential", e.jwt = "JWT Credential", e.Target = "target", e.Policy = "policy", e.Secret = "secret", e.RedisConfiguration = "redis configuration", e))(ki || {}), bi = /* @__PURE__ */ ((e) => (e.Edit = "edit", e.Create = "create", e))(bi || {});
|
|
17
|
+
const Ct = [
|
|
18
|
+
"primary",
|
|
19
|
+
"secondary"
|
|
20
|
+
], Ci = {
|
|
21
|
+
key: 0,
|
|
22
|
+
class: "config-card-fieldset-title"
|
|
23
|
+
}, xi = /* @__PURE__ */ ee({
|
|
24
|
+
__name: "JsonCardItem",
|
|
25
|
+
props: {
|
|
26
|
+
item: {
|
|
27
|
+
type: Object,
|
|
28
|
+
required: !0
|
|
29
|
+
},
|
|
30
|
+
index: {
|
|
31
|
+
type: Number,
|
|
32
|
+
default: -1
|
|
33
|
+
},
|
|
34
|
+
isArrayItem: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: !1
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
setup(e) {
|
|
40
|
+
const t = e, { i18n: { t: n } } = G.useI18n(), { convertKeyToTitle: i } = G.useStringHelpers(), r = T(() => t.item.key ?? "json-array-item"), a = T(() => t.item.value ?? t.item), o = T(() => {
|
|
41
|
+
const c = JSON.parse(JSON.stringify(a.value));
|
|
42
|
+
return t.isArrayItem && delete c.name, c;
|
|
43
|
+
}), l = T(() => {
|
|
44
|
+
var c;
|
|
45
|
+
return t.isArrayItem ? (c = a.value) != null && c.name ? i(a.value.name, "_") : n("baseConfigCard.general.entryTitle", { index: t.index }) : "";
|
|
46
|
+
});
|
|
47
|
+
return (c, d) => (f(), E(je(e.isArrayItem ? "fieldset" : "div"), {
|
|
48
|
+
class: ue(e.isArrayItem ? "config-card-fieldset" : "config-card-json-item")
|
|
49
|
+
}, {
|
|
50
|
+
default: k(() => [
|
|
51
|
+
e.isArrayItem ? (f(), A("legend", Ci, [
|
|
52
|
+
F("b", null, S(l.value), 1)
|
|
53
|
+
])) : B("", !0),
|
|
54
|
+
(f(!0), A(pe, null, he(Object.keys(o.value), (y, u) => (f(), E(Vt, {
|
|
55
|
+
key: `${r.value}-property-${u}`,
|
|
56
|
+
item: {
|
|
57
|
+
key: y,
|
|
58
|
+
label: g(i)(y),
|
|
59
|
+
value: o.value[y]
|
|
60
|
+
}
|
|
61
|
+
}, null, 8, ["item"]))), 128))
|
|
62
|
+
]),
|
|
63
|
+
_: 1
|
|
64
|
+
}, 8, ["class"]));
|
|
65
|
+
}
|
|
66
|
+
}), zt = /* @__PURE__ */ se(xi, [["__scopeId", "data-v-5baf64ca"]]), Ai = /* @__PURE__ */ ee({
|
|
67
|
+
__name: "InternalLinkItem",
|
|
68
|
+
props: {
|
|
69
|
+
item: {
|
|
70
|
+
type: Object,
|
|
71
|
+
required: !0
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
emits: ["navigation-click"],
|
|
75
|
+
setup(e) {
|
|
76
|
+
const { i18n: { t } } = G.useI18n();
|
|
77
|
+
return (n, i) => {
|
|
78
|
+
const r = L("KButton");
|
|
79
|
+
return f(), A("div", null, [
|
|
80
|
+
K(r, {
|
|
81
|
+
appearance: "tertiary",
|
|
82
|
+
class: "navigation-button",
|
|
83
|
+
onClick: i[0] || (i[0] = (a) => n.$emit("navigation-click", e.item))
|
|
84
|
+
}, {
|
|
85
|
+
default: k(() => [
|
|
86
|
+
P(S(e.item.value || g(t)("baseConfigCard.commonFields.link")), 1)
|
|
87
|
+
]),
|
|
88
|
+
_: 1
|
|
89
|
+
})
|
|
90
|
+
]);
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}), Si = /* @__PURE__ */ se(Ai, [["__scopeId", "data-v-2feb8c2e"]]), _i = /* @__PURE__ */ ee({
|
|
94
|
+
__name: "StatusBadge",
|
|
95
|
+
props: {
|
|
96
|
+
status: {
|
|
97
|
+
type: Boolean,
|
|
98
|
+
default: !1
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
setup(e) {
|
|
102
|
+
const { i18n: { t } } = G.useI18n();
|
|
103
|
+
return (n, i) => {
|
|
104
|
+
const r = L("KBadge");
|
|
105
|
+
return f(), E(r, {
|
|
106
|
+
appearance: e.status ? "success" : "neutral"
|
|
107
|
+
}, {
|
|
108
|
+
default: k(() => [
|
|
109
|
+
P(S(e.status ? g(t)("baseConfigCard.statusBadge.enabledLabel") : g(t)("baseConfigCard.statusBadge.disabledLabel")), 1)
|
|
110
|
+
]),
|
|
111
|
+
_: 1
|
|
112
|
+
}, 8, ["appearance"]);
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}), Ti = "#0044f4", wi = "#e0e4ea", $i = "#afb7c5", Ei = "#0044f4", Ii = "1px", Fi = "16px", Oi = "20px";
|
|
116
|
+
let Xe = null;
|
|
117
|
+
function Bi() {
|
|
118
|
+
return Xe || (Xe = oi({
|
|
119
|
+
langs: [li, ci, si, ui, di],
|
|
120
|
+
themes: [fi, pi],
|
|
121
|
+
engine: ai(),
|
|
122
|
+
langAlias: {
|
|
123
|
+
bash: "shellscript",
|
|
124
|
+
sh: "shellscript",
|
|
125
|
+
shell: "shellscript",
|
|
126
|
+
zsh: "shellscript"
|
|
127
|
+
}
|
|
128
|
+
})), Xe;
|
|
129
|
+
}
|
|
130
|
+
function Ki(e, t) {
|
|
131
|
+
return Bi().codeToHtml(e, t);
|
|
132
|
+
}
|
|
133
|
+
function Ke({ codeElement: e, code: t, language: n, theme: i }) {
|
|
134
|
+
e.innerHTML = Ki(t, { lang: n, theme: i === "dark" ? "catppuccin-mocha" : "catppuccin-latte", structure: "inline" });
|
|
135
|
+
}
|
|
136
|
+
const Ri = { class: "config-card-details-row" }, Li = ["data-testid"], Di = ["data-testid"], Ni = ["data-testid"], Pi = ["data-testid"], Mi = { key: 1 }, ji = ["data-testid"], Ui = ["data-testid"], qi = ["data-testid"], Hi = ["data-testid"], zi = {
|
|
137
|
+
name: "ConfigCardItem",
|
|
138
|
+
components: { JsonCardItem: zt, StatusBadge: _i, InternalLinkItem: Si }
|
|
139
|
+
}, Vi = /* @__PURE__ */ ee({
|
|
140
|
+
...zi,
|
|
141
|
+
props: {
|
|
142
|
+
item: {
|
|
143
|
+
type: Object,
|
|
144
|
+
required: !0
|
|
145
|
+
},
|
|
146
|
+
slim: {
|
|
147
|
+
type: Boolean,
|
|
148
|
+
required: !1,
|
|
149
|
+
default: !1
|
|
150
|
+
},
|
|
151
|
+
truncated: {
|
|
152
|
+
type: Boolean,
|
|
153
|
+
required: !1,
|
|
154
|
+
default: !1
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
emits: ["navigation-click"],
|
|
158
|
+
setup(e, { emit: t }) {
|
|
159
|
+
Mt((z) => ({
|
|
160
|
+
v25a763c4: v.value ? "none" : `solid ${g(Ii)} ${g(wi)}`,
|
|
161
|
+
v1ac90e12: u.value && d.value ? "block" : "flex",
|
|
162
|
+
v45a716ee: u.value && d.value ? "100%" : n.slim ? "50%" : "25%",
|
|
163
|
+
v45a28b38: u.value && d.value ? "100%" : n.slim ? "50%" : "75%"
|
|
164
|
+
}));
|
|
165
|
+
const n = e, i = t, r = jn(), a = Ue(), { i18n: { t: o, formatIsoDate: l, formatUnixTimeStamp: c } } = G.useI18n(), d = T(() => n.item.value !== void 0 && n.item.value !== null && n.item.value !== ""), y = T(() => !!(n.item.tooltip || a["label-tooltip"])), u = T(() => n.item.type === Z.Json || n.item.type === Z.JsonArray), v = T(() => n.item.type === Z.JsonArray), s = G.useSubSchema(n.item.key), h = T(() => {
|
|
166
|
+
var z;
|
|
167
|
+
return n.item.type ? n.item.type : (z = s == null ? void 0 : s.value) != null && z.encrypted ? Z.Redacted : void 0;
|
|
168
|
+
}), m = T(() => {
|
|
169
|
+
switch (h.value) {
|
|
170
|
+
case Z.ID:
|
|
171
|
+
return {
|
|
172
|
+
tag: "KCopy",
|
|
173
|
+
attrs: {
|
|
174
|
+
"data-testid": `${n.item.key}-copy-uuid`,
|
|
175
|
+
"copy-tooltip": o("baseConfigCard.copy.tooltip", { label: n.item.label }),
|
|
176
|
+
text: n.item.value
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
case Z.IdArray:
|
|
180
|
+
return {
|
|
181
|
+
tag: "div",
|
|
182
|
+
additionalComponent: "KCopy",
|
|
183
|
+
childAttrs: {
|
|
184
|
+
"copy-tooltip": o("baseConfigCard.copy.tooltip", { label: n.item.label })
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
case Z.Redacted:
|
|
188
|
+
return {
|
|
189
|
+
tag: "KCopy",
|
|
190
|
+
attrs: {
|
|
191
|
+
"data-testid": `${n.item.key}-copy-uuid-redacted`,
|
|
192
|
+
format: "redacted",
|
|
193
|
+
"copy-tooltip": o("baseConfigCard.copy.tooltip", { label: n.item.label }),
|
|
194
|
+
text: n.item.value
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
case Z.RedactedArray:
|
|
198
|
+
return {
|
|
199
|
+
tag: "div",
|
|
200
|
+
additionalComponent: "KCopy",
|
|
201
|
+
childAttrs: {
|
|
202
|
+
format: "redacted",
|
|
203
|
+
"copy-tooltip": o("baseConfigCard.copy.tooltip", { label: n.item.label })
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
case Z.Date:
|
|
207
|
+
return {
|
|
208
|
+
tag: "div",
|
|
209
|
+
attrs: {
|
|
210
|
+
"data-testid": `${n.item.key}-date`
|
|
211
|
+
},
|
|
212
|
+
text: isNaN(Number(n.item.value)) ? l(n.item.value) : c(n.item.value)
|
|
213
|
+
};
|
|
214
|
+
case Z.BadgeStatus:
|
|
215
|
+
return {
|
|
216
|
+
tag: "StatusBadge",
|
|
217
|
+
attrs: {
|
|
218
|
+
"data-testid": `${n.item.key}-badge-status`,
|
|
219
|
+
status: n.item.value
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
case Z.BadgeTag:
|
|
223
|
+
return {
|
|
224
|
+
tag: "div",
|
|
225
|
+
additionalComponent: "KBadge"
|
|
226
|
+
};
|
|
227
|
+
case Z.CopyBadge:
|
|
228
|
+
return {
|
|
229
|
+
tag: "div",
|
|
230
|
+
additionalComponent: "KCopy",
|
|
231
|
+
childAttrs: {
|
|
232
|
+
badge: !0,
|
|
233
|
+
truncate: !0,
|
|
234
|
+
truncationLimit: "auto",
|
|
235
|
+
text: n.item.value
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
case Z.BadgeMethod:
|
|
239
|
+
return {
|
|
240
|
+
tag: "div",
|
|
241
|
+
additionalComponent: "KMethodBadge"
|
|
242
|
+
};
|
|
243
|
+
case Z.LinkInternal:
|
|
244
|
+
return {
|
|
245
|
+
tag: "InternalLinkItem",
|
|
246
|
+
attrs: {
|
|
247
|
+
"data-testid": `${n.item.key}-internal-link`,
|
|
248
|
+
item: n.item,
|
|
249
|
+
onNavigationClick: (z) => {
|
|
250
|
+
i("navigation-click", z);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
case Z.LinkExternal:
|
|
255
|
+
return {
|
|
256
|
+
tag: "KExternalLink",
|
|
257
|
+
attrs: {
|
|
258
|
+
"data-testid": `${n.item.key}-external-link`,
|
|
259
|
+
href: n.item.value
|
|
260
|
+
},
|
|
261
|
+
text: n.item.value
|
|
262
|
+
};
|
|
263
|
+
case Z.Json:
|
|
264
|
+
return {
|
|
265
|
+
tag: "JsonCardItem",
|
|
266
|
+
attrs: {
|
|
267
|
+
"data-testid": `${n.item.key}-json-content`,
|
|
268
|
+
item: n.item
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
case Z.JsonArray:
|
|
272
|
+
return {
|
|
273
|
+
tag: "div",
|
|
274
|
+
additionalComponent: "JsonCardItem",
|
|
275
|
+
attrs: {
|
|
276
|
+
"data-testid": `${n.item.key}-json-array-content`,
|
|
277
|
+
item: n.item
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
default:
|
|
281
|
+
return n.item.value != null && typeof n.item.value == "object" ? {
|
|
282
|
+
tag: "KCodeBlock",
|
|
283
|
+
attrs: {
|
|
284
|
+
"data-testid": `${n.item.key}-json-code`,
|
|
285
|
+
id: `json-code-${r}`,
|
|
286
|
+
language: "json",
|
|
287
|
+
code: JSON.stringify(n.item.value, null, " "),
|
|
288
|
+
maxHeight: "480px",
|
|
289
|
+
showLineNumbers: !1,
|
|
290
|
+
onCodeBlockRender: Ke
|
|
291
|
+
}
|
|
292
|
+
} : {
|
|
293
|
+
tag: "div",
|
|
294
|
+
attrs: {
|
|
295
|
+
"data-testid": `${n.item.key}-plain-text`
|
|
296
|
+
},
|
|
297
|
+
text: n.item.value
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
}), p = q(), b = q(), { isTruncated: C } = G.useTruncationDetector(p), { isTruncated: R } = G.useTruncationDetector(b);
|
|
301
|
+
return (z, Y) => {
|
|
302
|
+
const w = L("KTooltip"), $ = L("KLabel"), O = L("KBadge"), _ = L("KCopy");
|
|
303
|
+
return f(), A("div", Ri, [
|
|
304
|
+
F("div", {
|
|
305
|
+
class: "config-card-details-label",
|
|
306
|
+
"data-testid": `${e.item.key}-label`
|
|
307
|
+
}, [
|
|
308
|
+
M(z.$slots, "label", { item: e.item }, () => [
|
|
309
|
+
K($, { "tooltip-attributes": { maxWidth: "500px" } }, we({
|
|
310
|
+
default: k(() => [
|
|
311
|
+
K(w, {
|
|
312
|
+
text: g(C) ? e.item.label : ""
|
|
313
|
+
}, {
|
|
314
|
+
default: k(() => [
|
|
315
|
+
F("span", {
|
|
316
|
+
ref_key: "labelContent",
|
|
317
|
+
ref: p,
|
|
318
|
+
class: "label-content"
|
|
319
|
+
}, S(e.item.label), 513)
|
|
320
|
+
]),
|
|
321
|
+
_: 1
|
|
322
|
+
}, 8, ["text"])
|
|
323
|
+
]),
|
|
324
|
+
_: 2
|
|
325
|
+
}, [
|
|
326
|
+
y.value ? {
|
|
327
|
+
name: "tooltip",
|
|
328
|
+
fn: k(() => [
|
|
329
|
+
F("div", {
|
|
330
|
+
"data-testid": `${e.item.key}-label-tooltip`
|
|
331
|
+
}, [
|
|
332
|
+
M(z.$slots, "label-tooltip", {}, () => [
|
|
333
|
+
P(S(e.item.tooltip), 1)
|
|
334
|
+
], !0)
|
|
335
|
+
], 8, Di)
|
|
336
|
+
]),
|
|
337
|
+
key: "0"
|
|
338
|
+
} : void 0
|
|
339
|
+
]), 1024)
|
|
340
|
+
], !0)
|
|
341
|
+
], 8, Li),
|
|
342
|
+
F("div", {
|
|
343
|
+
class: "config-card-details-value",
|
|
344
|
+
"data-testid": `${e.item.key}-property-value`
|
|
345
|
+
}, [
|
|
346
|
+
M(z.$slots, e.item.key, {
|
|
347
|
+
rowValue: e.item.value
|
|
348
|
+
}, () => [
|
|
349
|
+
d.value ? (f(), A("div", Mi, [
|
|
350
|
+
(f(), E(je(m.value.tag), Un(qn(m.value.attrs)), {
|
|
351
|
+
default: k(() => [
|
|
352
|
+
m.value.additionalComponent === "KBadge" ? (f(), A("div", {
|
|
353
|
+
key: 0,
|
|
354
|
+
"data-testid": `${e.item.key}-badge-tags`
|
|
355
|
+
}, [
|
|
356
|
+
(f(!0), A(pe, null, he(e.item.value, (j, D) => (f(), E(O, {
|
|
357
|
+
key: `${e.item.key}-badge-tag-${D}`,
|
|
358
|
+
class: "config-badge",
|
|
359
|
+
"data-testid": `${e.item.key}-badge-tag-${D}`,
|
|
360
|
+
tooltip: j,
|
|
361
|
+
"truncation-tooltip": ""
|
|
362
|
+
}, {
|
|
363
|
+
default: k(() => [
|
|
364
|
+
P(S(j), 1)
|
|
365
|
+
]),
|
|
366
|
+
_: 2
|
|
367
|
+
}, 1032, ["data-testid", "tooltip"]))), 128))
|
|
368
|
+
], 8, ji)) : m.value.additionalComponent === "KCopy" ? (f(), A("div", {
|
|
369
|
+
key: 1,
|
|
370
|
+
class: "copy-uuid-array",
|
|
371
|
+
"data-testid": `${e.item.key}-copy-uuid-array`
|
|
372
|
+
}, [
|
|
373
|
+
(f(!0), A(pe, null, he(e.item.value, (j, D) => (f(), E(_, qe({ ref_for: !0 }, m.value.childAttrs, {
|
|
374
|
+
key: `${e.item.key}-copy-uuid-${D}`,
|
|
375
|
+
"data-testid": `${e.item.key}-copy-uuid-${D}`,
|
|
376
|
+
text: j
|
|
377
|
+
}), null, 16, ["data-testid", "text"]))), 128))
|
|
378
|
+
], 8, Ui)) : m.value.additionalComponent === "KMethodBadge" ? (f(), A("div", {
|
|
379
|
+
key: 2,
|
|
380
|
+
class: "method-badge-array",
|
|
381
|
+
"data-testid": `${e.item.key}-badge-methods`
|
|
382
|
+
}, [
|
|
383
|
+
(f(!0), A(pe, null, he(e.item.value, (j, D) => (f(), E(O, {
|
|
384
|
+
key: `${e.item.key}-badge-method-${D}`,
|
|
385
|
+
appearance: Object.values(g(ti)).includes(j.toLowerCase()) ? j.toLowerCase() : "custom",
|
|
386
|
+
class: "config-badge",
|
|
387
|
+
"data-testid": `${e.item.key}-badge-method-${D}`
|
|
388
|
+
}, {
|
|
389
|
+
default: k(() => [
|
|
390
|
+
P(S(j), 1)
|
|
391
|
+
]),
|
|
392
|
+
_: 2
|
|
393
|
+
}, 1032, ["appearance", "data-testid"]))), 128))
|
|
394
|
+
], 8, qi)) : m.value.additionalComponent === "JsonCardItem" ? (f(), A("div", {
|
|
395
|
+
key: 3,
|
|
396
|
+
"data-testid": `${n.item.key}-json-array-content`
|
|
397
|
+
}, [
|
|
398
|
+
(f(!0), A(pe, null, he(e.item.value, (j, D) => (f(), E(zt, {
|
|
399
|
+
key: `json-array-item-${D}`,
|
|
400
|
+
index: Number(D),
|
|
401
|
+
"is-array-item": "",
|
|
402
|
+
item: j
|
|
403
|
+
}, null, 8, ["index", "item"]))), 128))
|
|
404
|
+
], 8, Hi)) : (f(), E(w, {
|
|
405
|
+
key: 4,
|
|
406
|
+
text: g(R) ? e.item.value : ""
|
|
407
|
+
}, {
|
|
408
|
+
default: k(() => [
|
|
409
|
+
F("span", {
|
|
410
|
+
ref_key: "textContent",
|
|
411
|
+
ref: b,
|
|
412
|
+
class: ue(["attrs-data-text", { truncated: e.truncated }])
|
|
413
|
+
}, S(m.value.text), 3)
|
|
414
|
+
]),
|
|
415
|
+
_: 1
|
|
416
|
+
}, 8, ["text"]))
|
|
417
|
+
]),
|
|
418
|
+
_: 1
|
|
419
|
+
}, 16))
|
|
420
|
+
])) : (f(), A("div", {
|
|
421
|
+
key: 0,
|
|
422
|
+
"data-testid": `${e.item.key}-no-value`
|
|
423
|
+
}, " – ", 8, Pi))
|
|
424
|
+
], !0)
|
|
425
|
+
], 8, Ni)
|
|
426
|
+
]);
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
}), Vt = /* @__PURE__ */ se(Vi, [["__scopeId", "data-v-b6987b3c"]]), Yi = { class: "json-config config-card-code-block" }, Wi = {
|
|
430
|
+
key: 0,
|
|
431
|
+
class: "json-endpoint"
|
|
432
|
+
}, Yt = /* @__PURE__ */ ee({
|
|
433
|
+
__name: "JsonCodeBlock",
|
|
434
|
+
props: {
|
|
435
|
+
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
436
|
+
config: {
|
|
437
|
+
type: Object,
|
|
438
|
+
required: !1,
|
|
439
|
+
default: () => ({})
|
|
440
|
+
},
|
|
441
|
+
/** Fetcher url for the entity with the filled-in controlPlaneId, workspace, and entity id. */
|
|
442
|
+
fetcherUrl: {
|
|
443
|
+
type: String,
|
|
444
|
+
required: !1,
|
|
445
|
+
default: ""
|
|
446
|
+
},
|
|
447
|
+
/** A record to indicate the entity's configuration, used to populate the JSON code block */
|
|
448
|
+
entityRecord: {
|
|
449
|
+
type: Object,
|
|
450
|
+
required: !0
|
|
451
|
+
},
|
|
452
|
+
/** HTTP request method like GET, POST, PUT, used to make the api call. */
|
|
453
|
+
requestMethod: {
|
|
454
|
+
type: String,
|
|
455
|
+
required: !1,
|
|
456
|
+
default: ""
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
setup(e) {
|
|
460
|
+
Mt((r) => ({
|
|
461
|
+
v775b4bd8: `${i.value}ch`
|
|
462
|
+
}));
|
|
463
|
+
const t = e, n = T(() => t.entityRecord), i = T(() => {
|
|
464
|
+
var o;
|
|
465
|
+
if (!t.fetcherUrl)
|
|
466
|
+
return 0;
|
|
467
|
+
const r = (o = t.fetcherUrl) == null ? void 0 : o.split("/");
|
|
468
|
+
return r.length < 2 ? 0 : 41 + (t.requestMethod === "post" ? r[r.length - 1] : r[r.length - 2]).length;
|
|
469
|
+
});
|
|
470
|
+
return (r, a) => {
|
|
471
|
+
const o = L("KBadge"), l = L("KCodeBlock");
|
|
472
|
+
return f(), A("div", Yi, [
|
|
473
|
+
t.fetcherUrl ? (f(), A("div", Wi, [
|
|
474
|
+
K(o, {
|
|
475
|
+
appearance: t.requestMethod
|
|
476
|
+
}, {
|
|
477
|
+
default: k(() => [
|
|
478
|
+
P(S(t.requestMethod), 1)
|
|
479
|
+
]),
|
|
480
|
+
_: 1
|
|
481
|
+
}, 8, ["appearance"]),
|
|
482
|
+
K(l, {
|
|
483
|
+
id: "json-endpoint-codeblock",
|
|
484
|
+
code: t.fetcherUrl,
|
|
485
|
+
language: "plaintext",
|
|
486
|
+
"single-line": "",
|
|
487
|
+
theme: "dark"
|
|
488
|
+
}, null, 8, ["code"])
|
|
489
|
+
])) : B("", !0),
|
|
490
|
+
t.entityRecord ? (f(), E(l, {
|
|
491
|
+
key: 1,
|
|
492
|
+
id: "json-codeblock",
|
|
493
|
+
class: ue({ "json-content": t.fetcherUrl }),
|
|
494
|
+
code: JSON.stringify(n.value, null, 2),
|
|
495
|
+
language: "json",
|
|
496
|
+
theme: "dark",
|
|
497
|
+
onCodeBlockRender: g(Ke)
|
|
498
|
+
}, null, 8, ["class", "code", "onCodeBlockRender"])) : B("", !0)
|
|
499
|
+
]);
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
});
|
|
503
|
+
/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */
|
|
504
|
+
function Wt(e) {
|
|
505
|
+
return typeof e > "u" || e === null;
|
|
506
|
+
}
|
|
507
|
+
function Gi(e) {
|
|
508
|
+
return typeof e == "object" && e !== null;
|
|
509
|
+
}
|
|
510
|
+
function Ji(e) {
|
|
511
|
+
return Array.isArray(e) ? e : Wt(e) ? [] : [e];
|
|
512
|
+
}
|
|
513
|
+
function Qi(e, t) {
|
|
514
|
+
var n, i, r, a;
|
|
515
|
+
if (t)
|
|
516
|
+
for (a = Object.keys(t), n = 0, i = a.length; n < i; n += 1)
|
|
517
|
+
r = a[n], e[r] = t[r];
|
|
518
|
+
return e;
|
|
519
|
+
}
|
|
520
|
+
function Xi(e, t) {
|
|
521
|
+
var n = "", i;
|
|
522
|
+
for (i = 0; i < t; i += 1)
|
|
523
|
+
n += e;
|
|
524
|
+
return n;
|
|
525
|
+
}
|
|
526
|
+
function Zi(e) {
|
|
527
|
+
return e === 0 && Number.NEGATIVE_INFINITY === 1 / e;
|
|
528
|
+
}
|
|
529
|
+
var er = Wt, tr = Gi, nr = Ji, ir = Xi, rr = Zi, or = Qi, ae = {
|
|
530
|
+
isNothing: er,
|
|
531
|
+
isObject: tr,
|
|
532
|
+
toArray: nr,
|
|
533
|
+
repeat: ir,
|
|
534
|
+
isNegativeZero: rr,
|
|
535
|
+
extend: or
|
|
536
|
+
};
|
|
537
|
+
function Gt(e, t) {
|
|
538
|
+
var n = "", i = e.reason || "(unknown reason)";
|
|
539
|
+
return e.mark ? (e.mark.name && (n += 'in "' + e.mark.name + '" '), n += "(" + (e.mark.line + 1) + ":" + (e.mark.column + 1) + ")", !t && e.mark.snippet && (n += `
|
|
540
|
+
|
|
541
|
+
` + e.mark.snippet), i + " " + n) : i;
|
|
542
|
+
}
|
|
543
|
+
function De(e, t) {
|
|
544
|
+
Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = t, this.message = Gt(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || "";
|
|
545
|
+
}
|
|
546
|
+
De.prototype = Object.create(Error.prototype);
|
|
547
|
+
De.prototype.constructor = De;
|
|
548
|
+
De.prototype.toString = function(t) {
|
|
549
|
+
return this.name + ": " + Gt(this, t);
|
|
550
|
+
};
|
|
551
|
+
var fe = De;
|
|
552
|
+
function Ze(e, t, n, i, r) {
|
|
553
|
+
var a = "", o = "", l = Math.floor(r / 2) - 1;
|
|
554
|
+
return i - t > l && (a = " ... ", t = i - l + a.length), n - i > l && (o = " ...", n = i + l - o.length), {
|
|
555
|
+
str: a + e.slice(t, n).replace(/\t/g, "→") + o,
|
|
556
|
+
pos: i - t + a.length
|
|
557
|
+
// relative position
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
function et(e, t) {
|
|
561
|
+
return ae.repeat(" ", t - e.length) + e;
|
|
562
|
+
}
|
|
563
|
+
function ar(e, t) {
|
|
564
|
+
if (t = Object.create(t || null), !e.buffer) return null;
|
|
565
|
+
t.maxLength || (t.maxLength = 79), typeof t.indent != "number" && (t.indent = 1), typeof t.linesBefore != "number" && (t.linesBefore = 3), typeof t.linesAfter != "number" && (t.linesAfter = 2);
|
|
566
|
+
for (var n = /\r?\n|\r|\0/g, i = [0], r = [], a, o = -1; a = n.exec(e.buffer); )
|
|
567
|
+
r.push(a.index), i.push(a.index + a[0].length), e.position <= a.index && o < 0 && (o = i.length - 2);
|
|
568
|
+
o < 0 && (o = i.length - 1);
|
|
569
|
+
var l = "", c, d, y = Math.min(e.line + t.linesAfter, r.length).toString().length, u = t.maxLength - (t.indent + y + 3);
|
|
570
|
+
for (c = 1; c <= t.linesBefore && !(o - c < 0); c++)
|
|
571
|
+
d = Ze(
|
|
572
|
+
e.buffer,
|
|
573
|
+
i[o - c],
|
|
574
|
+
r[o - c],
|
|
575
|
+
e.position - (i[o] - i[o - c]),
|
|
576
|
+
u
|
|
577
|
+
), l = ae.repeat(" ", t.indent) + et((e.line - c + 1).toString(), y) + " | " + d.str + `
|
|
578
|
+
` + l;
|
|
579
|
+
for (d = Ze(e.buffer, i[o], r[o], e.position, u), l += ae.repeat(" ", t.indent) + et((e.line + 1).toString(), y) + " | " + d.str + `
|
|
580
|
+
`, l += ae.repeat("-", t.indent + y + 3 + d.pos) + `^
|
|
581
|
+
`, c = 1; c <= t.linesAfter && !(o + c >= r.length); c++)
|
|
582
|
+
d = Ze(
|
|
583
|
+
e.buffer,
|
|
584
|
+
i[o + c],
|
|
585
|
+
r[o + c],
|
|
586
|
+
e.position - (i[o] - i[o + c]),
|
|
587
|
+
u
|
|
588
|
+
), l += ae.repeat(" ", t.indent) + et((e.line + c + 1).toString(), y) + " | " + d.str + `
|
|
589
|
+
`;
|
|
590
|
+
return l.replace(/\n$/, "");
|
|
591
|
+
}
|
|
592
|
+
var lr = ar, cr = [
|
|
593
|
+
"kind",
|
|
594
|
+
"multi",
|
|
595
|
+
"resolve",
|
|
596
|
+
"construct",
|
|
597
|
+
"instanceOf",
|
|
598
|
+
"predicate",
|
|
599
|
+
"represent",
|
|
600
|
+
"representName",
|
|
601
|
+
"defaultStyle",
|
|
602
|
+
"styleAliases"
|
|
603
|
+
], sr = [
|
|
604
|
+
"scalar",
|
|
605
|
+
"sequence",
|
|
606
|
+
"mapping"
|
|
607
|
+
];
|
|
608
|
+
function ur(e) {
|
|
609
|
+
var t = {};
|
|
610
|
+
return e !== null && Object.keys(e).forEach(function(n) {
|
|
611
|
+
e[n].forEach(function(i) {
|
|
612
|
+
t[String(i)] = n;
|
|
613
|
+
});
|
|
614
|
+
}), t;
|
|
615
|
+
}
|
|
616
|
+
function dr(e, t) {
|
|
617
|
+
if (t = t || {}, Object.keys(t).forEach(function(n) {
|
|
618
|
+
if (cr.indexOf(n) === -1)
|
|
619
|
+
throw new fe('Unknown option "' + n + '" is met in definition of "' + e + '" YAML type.');
|
|
620
|
+
}), this.options = t, this.tag = e, this.kind = t.kind || null, this.resolve = t.resolve || function() {
|
|
621
|
+
return !0;
|
|
622
|
+
}, this.construct = t.construct || function(n) {
|
|
623
|
+
return n;
|
|
624
|
+
}, this.instanceOf = t.instanceOf || null, this.predicate = t.predicate || null, this.represent = t.represent || null, this.representName = t.representName || null, this.defaultStyle = t.defaultStyle || null, this.multi = t.multi || !1, this.styleAliases = ur(t.styleAliases || null), sr.indexOf(this.kind) === -1)
|
|
625
|
+
throw new fe('Unknown kind "' + this.kind + '" is specified for "' + e + '" YAML type.');
|
|
626
|
+
}
|
|
627
|
+
var ce = dr;
|
|
628
|
+
function xt(e, t) {
|
|
629
|
+
var n = [];
|
|
630
|
+
return e[t].forEach(function(i) {
|
|
631
|
+
var r = n.length;
|
|
632
|
+
n.forEach(function(a, o) {
|
|
633
|
+
a.tag === i.tag && a.kind === i.kind && a.multi === i.multi && (r = o);
|
|
634
|
+
}), n[r] = i;
|
|
635
|
+
}), n;
|
|
636
|
+
}
|
|
637
|
+
function fr() {
|
|
638
|
+
var e = {
|
|
639
|
+
scalar: {},
|
|
640
|
+
sequence: {},
|
|
641
|
+
mapping: {},
|
|
642
|
+
fallback: {},
|
|
643
|
+
multi: {
|
|
644
|
+
scalar: [],
|
|
645
|
+
sequence: [],
|
|
646
|
+
mapping: [],
|
|
647
|
+
fallback: []
|
|
648
|
+
}
|
|
649
|
+
}, t, n;
|
|
650
|
+
function i(r) {
|
|
651
|
+
r.multi ? (e.multi[r.kind].push(r), e.multi.fallback.push(r)) : e[r.kind][r.tag] = e.fallback[r.tag] = r;
|
|
652
|
+
}
|
|
653
|
+
for (t = 0, n = arguments.length; t < n; t += 1)
|
|
654
|
+
arguments[t].forEach(i);
|
|
655
|
+
return e;
|
|
656
|
+
}
|
|
657
|
+
function it(e) {
|
|
658
|
+
return this.extend(e);
|
|
659
|
+
}
|
|
660
|
+
it.prototype.extend = function(t) {
|
|
661
|
+
var n = [], i = [];
|
|
662
|
+
if (t instanceof ce)
|
|
663
|
+
i.push(t);
|
|
664
|
+
else if (Array.isArray(t))
|
|
665
|
+
i = i.concat(t);
|
|
666
|
+
else if (t && (Array.isArray(t.implicit) || Array.isArray(t.explicit)))
|
|
667
|
+
t.implicit && (n = n.concat(t.implicit)), t.explicit && (i = i.concat(t.explicit));
|
|
668
|
+
else
|
|
669
|
+
throw new fe("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
|
|
670
|
+
n.forEach(function(a) {
|
|
671
|
+
if (!(a instanceof ce))
|
|
672
|
+
throw new fe("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
673
|
+
if (a.loadKind && a.loadKind !== "scalar")
|
|
674
|
+
throw new fe("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
|
675
|
+
if (a.multi)
|
|
676
|
+
throw new fe("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
|
|
677
|
+
}), i.forEach(function(a) {
|
|
678
|
+
if (!(a instanceof ce))
|
|
679
|
+
throw new fe("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
680
|
+
});
|
|
681
|
+
var r = Object.create(it.prototype);
|
|
682
|
+
return r.implicit = (this.implicit || []).concat(n), r.explicit = (this.explicit || []).concat(i), r.compiledImplicit = xt(r, "implicit"), r.compiledExplicit = xt(r, "explicit"), r.compiledTypeMap = fr(r.compiledImplicit, r.compiledExplicit), r;
|
|
683
|
+
};
|
|
684
|
+
var Jt = it, Qt = new ce("tag:yaml.org,2002:str", {
|
|
685
|
+
kind: "scalar",
|
|
686
|
+
construct: function(e) {
|
|
687
|
+
return e !== null ? e : "";
|
|
688
|
+
}
|
|
689
|
+
}), Xt = new ce("tag:yaml.org,2002:seq", {
|
|
690
|
+
kind: "sequence",
|
|
691
|
+
construct: function(e) {
|
|
692
|
+
return e !== null ? e : [];
|
|
693
|
+
}
|
|
694
|
+
}), Zt = new ce("tag:yaml.org,2002:map", {
|
|
695
|
+
kind: "mapping",
|
|
696
|
+
construct: function(e) {
|
|
697
|
+
return e !== null ? e : {};
|
|
698
|
+
}
|
|
699
|
+
}), en = new Jt({
|
|
700
|
+
explicit: [
|
|
701
|
+
Qt,
|
|
702
|
+
Xt,
|
|
703
|
+
Zt
|
|
704
|
+
]
|
|
705
|
+
});
|
|
706
|
+
function pr(e) {
|
|
707
|
+
if (e === null) return !0;
|
|
708
|
+
var t = e.length;
|
|
709
|
+
return t === 1 && e === "~" || t === 4 && (e === "null" || e === "Null" || e === "NULL");
|
|
710
|
+
}
|
|
711
|
+
function mr() {
|
|
712
|
+
return null;
|
|
713
|
+
}
|
|
714
|
+
function yr(e) {
|
|
715
|
+
return e === null;
|
|
716
|
+
}
|
|
717
|
+
var tn = new ce("tag:yaml.org,2002:null", {
|
|
718
|
+
kind: "scalar",
|
|
719
|
+
resolve: pr,
|
|
720
|
+
construct: mr,
|
|
721
|
+
predicate: yr,
|
|
722
|
+
represent: {
|
|
723
|
+
canonical: function() {
|
|
724
|
+
return "~";
|
|
725
|
+
},
|
|
726
|
+
lowercase: function() {
|
|
727
|
+
return "null";
|
|
728
|
+
},
|
|
729
|
+
uppercase: function() {
|
|
730
|
+
return "NULL";
|
|
731
|
+
},
|
|
732
|
+
camelcase: function() {
|
|
733
|
+
return "Null";
|
|
734
|
+
},
|
|
735
|
+
empty: function() {
|
|
736
|
+
return "";
|
|
737
|
+
}
|
|
738
|
+
},
|
|
739
|
+
defaultStyle: "lowercase"
|
|
740
|
+
});
|
|
741
|
+
function gr(e) {
|
|
742
|
+
if (e === null) return !1;
|
|
743
|
+
var t = e.length;
|
|
744
|
+
return t === 4 && (e === "true" || e === "True" || e === "TRUE") || t === 5 && (e === "false" || e === "False" || e === "FALSE");
|
|
745
|
+
}
|
|
746
|
+
function hr(e) {
|
|
747
|
+
return e === "true" || e === "True" || e === "TRUE";
|
|
748
|
+
}
|
|
749
|
+
function vr(e) {
|
|
750
|
+
return Object.prototype.toString.call(e) === "[object Boolean]";
|
|
751
|
+
}
|
|
752
|
+
var nn = new ce("tag:yaml.org,2002:bool", {
|
|
753
|
+
kind: "scalar",
|
|
754
|
+
resolve: gr,
|
|
755
|
+
construct: hr,
|
|
756
|
+
predicate: vr,
|
|
757
|
+
represent: {
|
|
758
|
+
lowercase: function(e) {
|
|
759
|
+
return e ? "true" : "false";
|
|
760
|
+
},
|
|
761
|
+
uppercase: function(e) {
|
|
762
|
+
return e ? "TRUE" : "FALSE";
|
|
763
|
+
},
|
|
764
|
+
camelcase: function(e) {
|
|
765
|
+
return e ? "True" : "False";
|
|
766
|
+
}
|
|
767
|
+
},
|
|
768
|
+
defaultStyle: "lowercase"
|
|
769
|
+
});
|
|
770
|
+
function kr(e) {
|
|
771
|
+
return 48 <= e && e <= 57 || 65 <= e && e <= 70 || 97 <= e && e <= 102;
|
|
772
|
+
}
|
|
773
|
+
function br(e) {
|
|
774
|
+
return 48 <= e && e <= 55;
|
|
775
|
+
}
|
|
776
|
+
function Cr(e) {
|
|
777
|
+
return 48 <= e && e <= 57;
|
|
778
|
+
}
|
|
779
|
+
function xr(e) {
|
|
780
|
+
if (e === null) return !1;
|
|
781
|
+
var t = e.length, n = 0, i = !1, r;
|
|
782
|
+
if (!t) return !1;
|
|
783
|
+
if (r = e[n], (r === "-" || r === "+") && (r = e[++n]), r === "0") {
|
|
784
|
+
if (n + 1 === t) return !0;
|
|
785
|
+
if (r = e[++n], r === "b") {
|
|
786
|
+
for (n++; n < t; n++)
|
|
787
|
+
if (r = e[n], r !== "_") {
|
|
788
|
+
if (r !== "0" && r !== "1") return !1;
|
|
789
|
+
i = !0;
|
|
790
|
+
}
|
|
791
|
+
return i && r !== "_";
|
|
792
|
+
}
|
|
793
|
+
if (r === "x") {
|
|
794
|
+
for (n++; n < t; n++)
|
|
795
|
+
if (r = e[n], r !== "_") {
|
|
796
|
+
if (!kr(e.charCodeAt(n))) return !1;
|
|
797
|
+
i = !0;
|
|
798
|
+
}
|
|
799
|
+
return i && r !== "_";
|
|
800
|
+
}
|
|
801
|
+
if (r === "o") {
|
|
802
|
+
for (n++; n < t; n++)
|
|
803
|
+
if (r = e[n], r !== "_") {
|
|
804
|
+
if (!br(e.charCodeAt(n))) return !1;
|
|
805
|
+
i = !0;
|
|
806
|
+
}
|
|
807
|
+
return i && r !== "_";
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
if (r === "_") return !1;
|
|
811
|
+
for (; n < t; n++)
|
|
812
|
+
if (r = e[n], r !== "_") {
|
|
813
|
+
if (!Cr(e.charCodeAt(n)))
|
|
814
|
+
return !1;
|
|
815
|
+
i = !0;
|
|
816
|
+
}
|
|
817
|
+
return !(!i || r === "_");
|
|
818
|
+
}
|
|
819
|
+
function Ar(e) {
|
|
820
|
+
var t = e, n = 1, i;
|
|
821
|
+
if (t.indexOf("_") !== -1 && (t = t.replace(/_/g, "")), i = t[0], (i === "-" || i === "+") && (i === "-" && (n = -1), t = t.slice(1), i = t[0]), t === "0") return 0;
|
|
822
|
+
if (i === "0") {
|
|
823
|
+
if (t[1] === "b") return n * parseInt(t.slice(2), 2);
|
|
824
|
+
if (t[1] === "x") return n * parseInt(t.slice(2), 16);
|
|
825
|
+
if (t[1] === "o") return n * parseInt(t.slice(2), 8);
|
|
826
|
+
}
|
|
827
|
+
return n * parseInt(t, 10);
|
|
828
|
+
}
|
|
829
|
+
function Sr(e) {
|
|
830
|
+
return Object.prototype.toString.call(e) === "[object Number]" && e % 1 === 0 && !ae.isNegativeZero(e);
|
|
831
|
+
}
|
|
832
|
+
var rn = new ce("tag:yaml.org,2002:int", {
|
|
833
|
+
kind: "scalar",
|
|
834
|
+
resolve: xr,
|
|
835
|
+
construct: Ar,
|
|
836
|
+
predicate: Sr,
|
|
837
|
+
represent: {
|
|
838
|
+
binary: function(e) {
|
|
839
|
+
return e >= 0 ? "0b" + e.toString(2) : "-0b" + e.toString(2).slice(1);
|
|
840
|
+
},
|
|
841
|
+
octal: function(e) {
|
|
842
|
+
return e >= 0 ? "0o" + e.toString(8) : "-0o" + e.toString(8).slice(1);
|
|
843
|
+
},
|
|
844
|
+
decimal: function(e) {
|
|
845
|
+
return e.toString(10);
|
|
846
|
+
},
|
|
847
|
+
/* eslint-disable max-len */
|
|
848
|
+
hexadecimal: function(e) {
|
|
849
|
+
return e >= 0 ? "0x" + e.toString(16).toUpperCase() : "-0x" + e.toString(16).toUpperCase().slice(1);
|
|
850
|
+
}
|
|
851
|
+
},
|
|
852
|
+
defaultStyle: "decimal",
|
|
853
|
+
styleAliases: {
|
|
854
|
+
binary: [2, "bin"],
|
|
855
|
+
octal: [8, "oct"],
|
|
856
|
+
decimal: [10, "dec"],
|
|
857
|
+
hexadecimal: [16, "hex"]
|
|
858
|
+
}
|
|
859
|
+
}), _r = new RegExp(
|
|
860
|
+
// 2.5e4, 2.5 and integers
|
|
861
|
+
"^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
|
|
862
|
+
);
|
|
863
|
+
function Tr(e) {
|
|
864
|
+
return !(e === null || !_r.test(e) || // Quick hack to not allow integers end with `_`
|
|
865
|
+
// Probably should update regexp & check speed
|
|
866
|
+
e[e.length - 1] === "_");
|
|
867
|
+
}
|
|
868
|
+
function wr(e) {
|
|
869
|
+
var t, n;
|
|
870
|
+
return t = e.replace(/_/g, "").toLowerCase(), n = t[0] === "-" ? -1 : 1, "+-".indexOf(t[0]) >= 0 && (t = t.slice(1)), t === ".inf" ? n === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : t === ".nan" ? NaN : n * parseFloat(t, 10);
|
|
871
|
+
}
|
|
872
|
+
var $r = /^[-+]?[0-9]+e/;
|
|
873
|
+
function Er(e, t) {
|
|
874
|
+
var n;
|
|
875
|
+
if (isNaN(e))
|
|
876
|
+
switch (t) {
|
|
877
|
+
case "lowercase":
|
|
878
|
+
return ".nan";
|
|
879
|
+
case "uppercase":
|
|
880
|
+
return ".NAN";
|
|
881
|
+
case "camelcase":
|
|
882
|
+
return ".NaN";
|
|
883
|
+
}
|
|
884
|
+
else if (Number.POSITIVE_INFINITY === e)
|
|
885
|
+
switch (t) {
|
|
886
|
+
case "lowercase":
|
|
887
|
+
return ".inf";
|
|
888
|
+
case "uppercase":
|
|
889
|
+
return ".INF";
|
|
890
|
+
case "camelcase":
|
|
891
|
+
return ".Inf";
|
|
892
|
+
}
|
|
893
|
+
else if (Number.NEGATIVE_INFINITY === e)
|
|
894
|
+
switch (t) {
|
|
895
|
+
case "lowercase":
|
|
896
|
+
return "-.inf";
|
|
897
|
+
case "uppercase":
|
|
898
|
+
return "-.INF";
|
|
899
|
+
case "camelcase":
|
|
900
|
+
return "-.Inf";
|
|
901
|
+
}
|
|
902
|
+
else if (ae.isNegativeZero(e))
|
|
903
|
+
return "-0.0";
|
|
904
|
+
return n = e.toString(10), $r.test(n) ? n.replace("e", ".e") : n;
|
|
905
|
+
}
|
|
906
|
+
function Ir(e) {
|
|
907
|
+
return Object.prototype.toString.call(e) === "[object Number]" && (e % 1 !== 0 || ae.isNegativeZero(e));
|
|
908
|
+
}
|
|
909
|
+
var on = new ce("tag:yaml.org,2002:float", {
|
|
910
|
+
kind: "scalar",
|
|
911
|
+
resolve: Tr,
|
|
912
|
+
construct: wr,
|
|
913
|
+
predicate: Ir,
|
|
914
|
+
represent: Er,
|
|
915
|
+
defaultStyle: "lowercase"
|
|
916
|
+
}), an = en.extend({
|
|
917
|
+
implicit: [
|
|
918
|
+
tn,
|
|
919
|
+
nn,
|
|
920
|
+
rn,
|
|
921
|
+
on
|
|
922
|
+
]
|
|
923
|
+
}), ln = an, cn = new RegExp(
|
|
924
|
+
"^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
|
|
925
|
+
), sn = new RegExp(
|
|
926
|
+
"^([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]))?))?$"
|
|
927
|
+
);
|
|
928
|
+
function Fr(e) {
|
|
929
|
+
return e === null ? !1 : cn.exec(e) !== null || sn.exec(e) !== null;
|
|
930
|
+
}
|
|
931
|
+
function Or(e) {
|
|
932
|
+
var t, n, i, r, a, o, l, c = 0, d = null, y, u, v;
|
|
933
|
+
if (t = cn.exec(e), t === null && (t = sn.exec(e)), t === null) throw new Error("Date resolve error");
|
|
934
|
+
if (n = +t[1], i = +t[2] - 1, r = +t[3], !t[4])
|
|
935
|
+
return new Date(Date.UTC(n, i, r));
|
|
936
|
+
if (a = +t[4], o = +t[5], l = +t[6], t[7]) {
|
|
937
|
+
for (c = t[7].slice(0, 3); c.length < 3; )
|
|
938
|
+
c += "0";
|
|
939
|
+
c = +c;
|
|
940
|
+
}
|
|
941
|
+
return t[9] && (y = +t[10], u = +(t[11] || 0), d = (y * 60 + u) * 6e4, t[9] === "-" && (d = -d)), v = new Date(Date.UTC(n, i, r, a, o, l, c)), d && v.setTime(v.getTime() - d), v;
|
|
942
|
+
}
|
|
943
|
+
function Br(e) {
|
|
944
|
+
return e.toISOString();
|
|
945
|
+
}
|
|
946
|
+
var un = new ce("tag:yaml.org,2002:timestamp", {
|
|
947
|
+
kind: "scalar",
|
|
948
|
+
resolve: Fr,
|
|
949
|
+
construct: Or,
|
|
950
|
+
instanceOf: Date,
|
|
951
|
+
represent: Br
|
|
952
|
+
});
|
|
953
|
+
function Kr(e) {
|
|
954
|
+
return e === "<<" || e === null;
|
|
955
|
+
}
|
|
956
|
+
var dn = new ce("tag:yaml.org,2002:merge", {
|
|
957
|
+
kind: "scalar",
|
|
958
|
+
resolve: Kr
|
|
959
|
+
}), ut = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
960
|
+
\r`;
|
|
961
|
+
function Rr(e) {
|
|
962
|
+
if (e === null) return !1;
|
|
963
|
+
var t, n, i = 0, r = e.length, a = ut;
|
|
964
|
+
for (n = 0; n < r; n++)
|
|
965
|
+
if (t = a.indexOf(e.charAt(n)), !(t > 64)) {
|
|
966
|
+
if (t < 0) return !1;
|
|
967
|
+
i += 6;
|
|
968
|
+
}
|
|
969
|
+
return i % 8 === 0;
|
|
970
|
+
}
|
|
971
|
+
function Lr(e) {
|
|
972
|
+
var t, n, i = e.replace(/[\r\n=]/g, ""), r = i.length, a = ut, o = 0, l = [];
|
|
973
|
+
for (t = 0; t < r; t++)
|
|
974
|
+
t % 4 === 0 && t && (l.push(o >> 16 & 255), l.push(o >> 8 & 255), l.push(o & 255)), o = o << 6 | a.indexOf(i.charAt(t));
|
|
975
|
+
return n = r % 4 * 6, n === 0 ? (l.push(o >> 16 & 255), l.push(o >> 8 & 255), l.push(o & 255)) : n === 18 ? (l.push(o >> 10 & 255), l.push(o >> 2 & 255)) : n === 12 && l.push(o >> 4 & 255), new Uint8Array(l);
|
|
976
|
+
}
|
|
977
|
+
function Dr(e) {
|
|
978
|
+
var t = "", n = 0, i, r, a = e.length, o = ut;
|
|
979
|
+
for (i = 0; i < a; i++)
|
|
980
|
+
i % 3 === 0 && i && (t += o[n >> 18 & 63], t += o[n >> 12 & 63], t += o[n >> 6 & 63], t += o[n & 63]), n = (n << 8) + e[i];
|
|
981
|
+
return r = a % 3, r === 0 ? (t += o[n >> 18 & 63], t += o[n >> 12 & 63], t += o[n >> 6 & 63], t += o[n & 63]) : r === 2 ? (t += o[n >> 10 & 63], t += o[n >> 4 & 63], t += o[n << 2 & 63], t += o[64]) : r === 1 && (t += o[n >> 2 & 63], t += o[n << 4 & 63], t += o[64], t += o[64]), t;
|
|
982
|
+
}
|
|
983
|
+
function Nr(e) {
|
|
984
|
+
return Object.prototype.toString.call(e) === "[object Uint8Array]";
|
|
985
|
+
}
|
|
986
|
+
var fn = new ce("tag:yaml.org,2002:binary", {
|
|
987
|
+
kind: "scalar",
|
|
988
|
+
resolve: Rr,
|
|
989
|
+
construct: Lr,
|
|
990
|
+
predicate: Nr,
|
|
991
|
+
represent: Dr
|
|
992
|
+
}), Pr = Object.prototype.hasOwnProperty, Mr = Object.prototype.toString;
|
|
993
|
+
function jr(e) {
|
|
994
|
+
if (e === null) return !0;
|
|
995
|
+
var t = [], n, i, r, a, o, l = e;
|
|
996
|
+
for (n = 0, i = l.length; n < i; n += 1) {
|
|
997
|
+
if (r = l[n], o = !1, Mr.call(r) !== "[object Object]") return !1;
|
|
998
|
+
for (a in r)
|
|
999
|
+
if (Pr.call(r, a))
|
|
1000
|
+
if (!o) o = !0;
|
|
1001
|
+
else return !1;
|
|
1002
|
+
if (!o) return !1;
|
|
1003
|
+
if (t.indexOf(a) === -1) t.push(a);
|
|
1004
|
+
else return !1;
|
|
1005
|
+
}
|
|
1006
|
+
return !0;
|
|
1007
|
+
}
|
|
1008
|
+
function Ur(e) {
|
|
1009
|
+
return e !== null ? e : [];
|
|
1010
|
+
}
|
|
1011
|
+
var pn = new ce("tag:yaml.org,2002:omap", {
|
|
1012
|
+
kind: "sequence",
|
|
1013
|
+
resolve: jr,
|
|
1014
|
+
construct: Ur
|
|
1015
|
+
}), qr = Object.prototype.toString;
|
|
1016
|
+
function Hr(e) {
|
|
1017
|
+
if (e === null) return !0;
|
|
1018
|
+
var t, n, i, r, a, o = e;
|
|
1019
|
+
for (a = new Array(o.length), t = 0, n = o.length; t < n; t += 1) {
|
|
1020
|
+
if (i = o[t], qr.call(i) !== "[object Object]" || (r = Object.keys(i), r.length !== 1)) return !1;
|
|
1021
|
+
a[t] = [r[0], i[r[0]]];
|
|
1022
|
+
}
|
|
1023
|
+
return !0;
|
|
1024
|
+
}
|
|
1025
|
+
function zr(e) {
|
|
1026
|
+
if (e === null) return [];
|
|
1027
|
+
var t, n, i, r, a, o = e;
|
|
1028
|
+
for (a = new Array(o.length), t = 0, n = o.length; t < n; t += 1)
|
|
1029
|
+
i = o[t], r = Object.keys(i), a[t] = [r[0], i[r[0]]];
|
|
1030
|
+
return a;
|
|
1031
|
+
}
|
|
1032
|
+
var mn = new ce("tag:yaml.org,2002:pairs", {
|
|
1033
|
+
kind: "sequence",
|
|
1034
|
+
resolve: Hr,
|
|
1035
|
+
construct: zr
|
|
1036
|
+
}), Vr = Object.prototype.hasOwnProperty;
|
|
1037
|
+
function Yr(e) {
|
|
1038
|
+
if (e === null) return !0;
|
|
1039
|
+
var t, n = e;
|
|
1040
|
+
for (t in n)
|
|
1041
|
+
if (Vr.call(n, t) && n[t] !== null)
|
|
1042
|
+
return !1;
|
|
1043
|
+
return !0;
|
|
1044
|
+
}
|
|
1045
|
+
function Wr(e) {
|
|
1046
|
+
return e !== null ? e : {};
|
|
1047
|
+
}
|
|
1048
|
+
var yn = new ce("tag:yaml.org,2002:set", {
|
|
1049
|
+
kind: "mapping",
|
|
1050
|
+
resolve: Yr,
|
|
1051
|
+
construct: Wr
|
|
1052
|
+
}), dt = ln.extend({
|
|
1053
|
+
implicit: [
|
|
1054
|
+
un,
|
|
1055
|
+
dn
|
|
1056
|
+
],
|
|
1057
|
+
explicit: [
|
|
1058
|
+
fn,
|
|
1059
|
+
pn,
|
|
1060
|
+
mn,
|
|
1061
|
+
yn
|
|
1062
|
+
]
|
|
1063
|
+
}), xe = Object.prototype.hasOwnProperty, ze = 1, gn = 2, hn = 3, Ve = 4, tt = 1, Gr = 2, At = 3, Jr = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, Qr = /[\x85\u2028\u2029]/, Xr = /[,\[\]\{\}]/, vn = /^(?:!|!!|![a-z\-]+!)$/i, kn = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
|
1064
|
+
function St(e) {
|
|
1065
|
+
return Object.prototype.toString.call(e);
|
|
1066
|
+
}
|
|
1067
|
+
function ve(e) {
|
|
1068
|
+
return e === 10 || e === 13;
|
|
1069
|
+
}
|
|
1070
|
+
function Te(e) {
|
|
1071
|
+
return e === 9 || e === 32;
|
|
1072
|
+
}
|
|
1073
|
+
function ye(e) {
|
|
1074
|
+
return e === 9 || e === 32 || e === 10 || e === 13;
|
|
1075
|
+
}
|
|
1076
|
+
function Oe(e) {
|
|
1077
|
+
return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
|
|
1078
|
+
}
|
|
1079
|
+
function Zr(e) {
|
|
1080
|
+
var t;
|
|
1081
|
+
return 48 <= e && e <= 57 ? e - 48 : (t = e | 32, 97 <= t && t <= 102 ? t - 97 + 10 : -1);
|
|
1082
|
+
}
|
|
1083
|
+
function eo(e) {
|
|
1084
|
+
return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
|
|
1085
|
+
}
|
|
1086
|
+
function to(e) {
|
|
1087
|
+
return 48 <= e && e <= 57 ? e - 48 : -1;
|
|
1088
|
+
}
|
|
1089
|
+
function _t(e) {
|
|
1090
|
+
return e === 48 ? "\0" : e === 97 ? "\x07" : e === 98 ? "\b" : e === 116 || e === 9 ? " " : e === 110 ? `
|
|
1091
|
+
` : e === 118 ? "\v" : e === 102 ? "\f" : e === 114 ? "\r" : e === 101 ? "\x1B" : e === 32 ? " " : e === 34 ? '"' : e === 47 ? "/" : e === 92 ? "\\" : e === 78 ? "
" : e === 95 ? " " : e === 76 ? "\u2028" : e === 80 ? "\u2029" : "";
|
|
1092
|
+
}
|
|
1093
|
+
function no(e) {
|
|
1094
|
+
return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode(
|
|
1095
|
+
(e - 65536 >> 10) + 55296,
|
|
1096
|
+
(e - 65536 & 1023) + 56320
|
|
1097
|
+
);
|
|
1098
|
+
}
|
|
1099
|
+
function bn(e, t, n) {
|
|
1100
|
+
t === "__proto__" ? Object.defineProperty(e, t, {
|
|
1101
|
+
configurable: !0,
|
|
1102
|
+
enumerable: !0,
|
|
1103
|
+
writable: !0,
|
|
1104
|
+
value: n
|
|
1105
|
+
}) : e[t] = n;
|
|
1106
|
+
}
|
|
1107
|
+
var Cn = new Array(256), xn = new Array(256);
|
|
1108
|
+
for (var Ie = 0; Ie < 256; Ie++)
|
|
1109
|
+
Cn[Ie] = _t(Ie) ? 1 : 0, xn[Ie] = _t(Ie);
|
|
1110
|
+
function io(e, t) {
|
|
1111
|
+
this.input = e, this.filename = t.filename || null, this.schema = t.schema || dt, this.onWarning = t.onWarning || null, this.legacy = t.legacy || !1, this.json = t.json || !1, this.listener = t.listener || null, this.implicitTypes = this.schema.compiledImplicit, this.typeMap = this.schema.compiledTypeMap, this.length = e.length, this.position = 0, this.line = 0, this.lineStart = 0, this.lineIndent = 0, this.firstTabInLine = -1, this.documents = [];
|
|
1112
|
+
}
|
|
1113
|
+
function An(e, t) {
|
|
1114
|
+
var n = {
|
|
1115
|
+
name: e.filename,
|
|
1116
|
+
buffer: e.input.slice(0, -1),
|
|
1117
|
+
// omit trailing \0
|
|
1118
|
+
position: e.position,
|
|
1119
|
+
line: e.line,
|
|
1120
|
+
column: e.position - e.lineStart
|
|
1121
|
+
};
|
|
1122
|
+
return n.snippet = lr(n), new fe(t, n);
|
|
1123
|
+
}
|
|
1124
|
+
function I(e, t) {
|
|
1125
|
+
throw An(e, t);
|
|
1126
|
+
}
|
|
1127
|
+
function Ye(e, t) {
|
|
1128
|
+
e.onWarning && e.onWarning.call(null, An(e, t));
|
|
1129
|
+
}
|
|
1130
|
+
var Tt = {
|
|
1131
|
+
YAML: function(t, n, i) {
|
|
1132
|
+
var r, a, o;
|
|
1133
|
+
t.version !== null && I(t, "duplication of %YAML directive"), i.length !== 1 && I(t, "YAML directive accepts exactly one argument"), r = /^([0-9]+)\.([0-9]+)$/.exec(i[0]), r === null && I(t, "ill-formed argument of the YAML directive"), a = parseInt(r[1], 10), o = parseInt(r[2], 10), a !== 1 && I(t, "unacceptable YAML version of the document"), t.version = i[0], t.checkLineBreaks = o < 2, o !== 1 && o !== 2 && Ye(t, "unsupported YAML version of the document");
|
|
1134
|
+
},
|
|
1135
|
+
TAG: function(t, n, i) {
|
|
1136
|
+
var r, a;
|
|
1137
|
+
i.length !== 2 && I(t, "TAG directive accepts exactly two arguments"), r = i[0], a = i[1], vn.test(r) || I(t, "ill-formed tag handle (first argument) of the TAG directive"), xe.call(t.tagMap, r) && I(t, 'there is a previously declared suffix for "' + r + '" tag handle'), kn.test(a) || I(t, "ill-formed tag prefix (second argument) of the TAG directive");
|
|
1138
|
+
try {
|
|
1139
|
+
a = decodeURIComponent(a);
|
|
1140
|
+
} catch {
|
|
1141
|
+
I(t, "tag prefix is malformed: " + a);
|
|
1142
|
+
}
|
|
1143
|
+
t.tagMap[r] = a;
|
|
1144
|
+
}
|
|
1145
|
+
};
|
|
1146
|
+
function be(e, t, n, i) {
|
|
1147
|
+
var r, a, o, l;
|
|
1148
|
+
if (t < n) {
|
|
1149
|
+
if (l = e.input.slice(t, n), i)
|
|
1150
|
+
for (r = 0, a = l.length; r < a; r += 1)
|
|
1151
|
+
o = l.charCodeAt(r), o === 9 || 32 <= o && o <= 1114111 || I(e, "expected valid JSON character");
|
|
1152
|
+
else Jr.test(l) && I(e, "the stream contains non-printable characters");
|
|
1153
|
+
e.result += l;
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
function wt(e, t, n, i) {
|
|
1157
|
+
var r, a, o, l;
|
|
1158
|
+
for (ae.isObject(n) || I(e, "cannot merge mappings; the provided source object is unacceptable"), r = Object.keys(n), o = 0, l = r.length; o < l; o += 1)
|
|
1159
|
+
a = r[o], xe.call(t, a) || (bn(t, a, n[a]), i[a] = !0);
|
|
1160
|
+
}
|
|
1161
|
+
function Be(e, t, n, i, r, a, o, l, c) {
|
|
1162
|
+
var d, y;
|
|
1163
|
+
if (Array.isArray(r))
|
|
1164
|
+
for (r = Array.prototype.slice.call(r), d = 0, y = r.length; d < y; d += 1)
|
|
1165
|
+
Array.isArray(r[d]) && I(e, "nested arrays are not supported inside keys"), typeof r == "object" && St(r[d]) === "[object Object]" && (r[d] = "[object Object]");
|
|
1166
|
+
if (typeof r == "object" && St(r) === "[object Object]" && (r = "[object Object]"), r = String(r), t === null && (t = {}), i === "tag:yaml.org,2002:merge")
|
|
1167
|
+
if (Array.isArray(a))
|
|
1168
|
+
for (d = 0, y = a.length; d < y; d += 1)
|
|
1169
|
+
wt(e, t, a[d], n);
|
|
1170
|
+
else
|
|
1171
|
+
wt(e, t, a, n);
|
|
1172
|
+
else
|
|
1173
|
+
!e.json && !xe.call(n, r) && xe.call(t, r) && (e.line = o || e.line, e.lineStart = l || e.lineStart, e.position = c || e.position, I(e, "duplicated mapping key")), bn(t, r, a), delete n[r];
|
|
1174
|
+
return t;
|
|
1175
|
+
}
|
|
1176
|
+
function ft(e) {
|
|
1177
|
+
var t;
|
|
1178
|
+
t = e.input.charCodeAt(e.position), t === 10 ? e.position++ : t === 13 ? (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++) : I(e, "a line break is expected"), e.line += 1, e.lineStart = e.position, e.firstTabInLine = -1;
|
|
1179
|
+
}
|
|
1180
|
+
function oe(e, t, n) {
|
|
1181
|
+
for (var i = 0, r = e.input.charCodeAt(e.position); r !== 0; ) {
|
|
1182
|
+
for (; Te(r); )
|
|
1183
|
+
r === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), r = e.input.charCodeAt(++e.position);
|
|
1184
|
+
if (t && r === 35)
|
|
1185
|
+
do
|
|
1186
|
+
r = e.input.charCodeAt(++e.position);
|
|
1187
|
+
while (r !== 10 && r !== 13 && r !== 0);
|
|
1188
|
+
if (ve(r))
|
|
1189
|
+
for (ft(e), r = e.input.charCodeAt(e.position), i++, e.lineIndent = 0; r === 32; )
|
|
1190
|
+
e.lineIndent++, r = e.input.charCodeAt(++e.position);
|
|
1191
|
+
else
|
|
1192
|
+
break;
|
|
1193
|
+
}
|
|
1194
|
+
return n !== -1 && i !== 0 && e.lineIndent < n && Ye(e, "deficient indentation"), i;
|
|
1195
|
+
}
|
|
1196
|
+
function Qe(e) {
|
|
1197
|
+
var t = e.position, n;
|
|
1198
|
+
return n = e.input.charCodeAt(t), !!((n === 45 || n === 46) && n === e.input.charCodeAt(t + 1) && n === e.input.charCodeAt(t + 2) && (t += 3, n = e.input.charCodeAt(t), n === 0 || ye(n)));
|
|
1199
|
+
}
|
|
1200
|
+
function pt(e, t) {
|
|
1201
|
+
t === 1 ? e.result += " " : t > 1 && (e.result += ae.repeat(`
|
|
1202
|
+
`, t - 1));
|
|
1203
|
+
}
|
|
1204
|
+
function ro(e, t, n) {
|
|
1205
|
+
var i, r, a, o, l, c, d, y, u = e.kind, v = e.result, s;
|
|
1206
|
+
if (s = e.input.charCodeAt(e.position), ye(s) || Oe(s) || s === 35 || s === 38 || s === 42 || s === 33 || s === 124 || s === 62 || s === 39 || s === 34 || s === 37 || s === 64 || s === 96 || (s === 63 || s === 45) && (r = e.input.charCodeAt(e.position + 1), ye(r) || n && Oe(r)))
|
|
1207
|
+
return !1;
|
|
1208
|
+
for (e.kind = "scalar", e.result = "", a = o = e.position, l = !1; s !== 0; ) {
|
|
1209
|
+
if (s === 58) {
|
|
1210
|
+
if (r = e.input.charCodeAt(e.position + 1), ye(r) || n && Oe(r))
|
|
1211
|
+
break;
|
|
1212
|
+
} else if (s === 35) {
|
|
1213
|
+
if (i = e.input.charCodeAt(e.position - 1), ye(i))
|
|
1214
|
+
break;
|
|
1215
|
+
} else {
|
|
1216
|
+
if (e.position === e.lineStart && Qe(e) || n && Oe(s))
|
|
1217
|
+
break;
|
|
1218
|
+
if (ve(s))
|
|
1219
|
+
if (c = e.line, d = e.lineStart, y = e.lineIndent, oe(e, !1, -1), e.lineIndent >= t) {
|
|
1220
|
+
l = !0, s = e.input.charCodeAt(e.position);
|
|
1221
|
+
continue;
|
|
1222
|
+
} else {
|
|
1223
|
+
e.position = o, e.line = c, e.lineStart = d, e.lineIndent = y;
|
|
1224
|
+
break;
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
l && (be(e, a, o, !1), pt(e, e.line - c), a = o = e.position, l = !1), Te(s) || (o = e.position + 1), s = e.input.charCodeAt(++e.position);
|
|
1228
|
+
}
|
|
1229
|
+
return be(e, a, o, !1), e.result ? !0 : (e.kind = u, e.result = v, !1);
|
|
1230
|
+
}
|
|
1231
|
+
function oo(e, t) {
|
|
1232
|
+
var n, i, r;
|
|
1233
|
+
if (n = e.input.charCodeAt(e.position), n !== 39)
|
|
1234
|
+
return !1;
|
|
1235
|
+
for (e.kind = "scalar", e.result = "", e.position++, i = r = e.position; (n = e.input.charCodeAt(e.position)) !== 0; )
|
|
1236
|
+
if (n === 39)
|
|
1237
|
+
if (be(e, i, e.position, !0), n = e.input.charCodeAt(++e.position), n === 39)
|
|
1238
|
+
i = e.position, e.position++, r = e.position;
|
|
1239
|
+
else
|
|
1240
|
+
return !0;
|
|
1241
|
+
else ve(n) ? (be(e, i, r, !0), pt(e, oe(e, !1, t)), i = r = e.position) : e.position === e.lineStart && Qe(e) ? I(e, "unexpected end of the document within a single quoted scalar") : (e.position++, r = e.position);
|
|
1242
|
+
I(e, "unexpected end of the stream within a single quoted scalar");
|
|
1243
|
+
}
|
|
1244
|
+
function ao(e, t) {
|
|
1245
|
+
var n, i, r, a, o, l;
|
|
1246
|
+
if (l = e.input.charCodeAt(e.position), l !== 34)
|
|
1247
|
+
return !1;
|
|
1248
|
+
for (e.kind = "scalar", e.result = "", e.position++, n = i = e.position; (l = e.input.charCodeAt(e.position)) !== 0; ) {
|
|
1249
|
+
if (l === 34)
|
|
1250
|
+
return be(e, n, e.position, !0), e.position++, !0;
|
|
1251
|
+
if (l === 92) {
|
|
1252
|
+
if (be(e, n, e.position, !0), l = e.input.charCodeAt(++e.position), ve(l))
|
|
1253
|
+
oe(e, !1, t);
|
|
1254
|
+
else if (l < 256 && Cn[l])
|
|
1255
|
+
e.result += xn[l], e.position++;
|
|
1256
|
+
else if ((o = eo(l)) > 0) {
|
|
1257
|
+
for (r = o, a = 0; r > 0; r--)
|
|
1258
|
+
l = e.input.charCodeAt(++e.position), (o = Zr(l)) >= 0 ? a = (a << 4) + o : I(e, "expected hexadecimal character");
|
|
1259
|
+
e.result += no(a), e.position++;
|
|
1260
|
+
} else
|
|
1261
|
+
I(e, "unknown escape sequence");
|
|
1262
|
+
n = i = e.position;
|
|
1263
|
+
} else ve(l) ? (be(e, n, i, !0), pt(e, oe(e, !1, t)), n = i = e.position) : e.position === e.lineStart && Qe(e) ? I(e, "unexpected end of the document within a double quoted scalar") : (e.position++, i = e.position);
|
|
1264
|
+
}
|
|
1265
|
+
I(e, "unexpected end of the stream within a double quoted scalar");
|
|
1266
|
+
}
|
|
1267
|
+
function lo(e, t) {
|
|
1268
|
+
var n = !0, i, r, a, o = e.tag, l, c = e.anchor, d, y, u, v, s, h = /* @__PURE__ */ Object.create(null), m, p, b, C;
|
|
1269
|
+
if (C = e.input.charCodeAt(e.position), C === 91)
|
|
1270
|
+
y = 93, s = !1, l = [];
|
|
1271
|
+
else if (C === 123)
|
|
1272
|
+
y = 125, s = !0, l = {};
|
|
1273
|
+
else
|
|
1274
|
+
return !1;
|
|
1275
|
+
for (e.anchor !== null && (e.anchorMap[e.anchor] = l), C = e.input.charCodeAt(++e.position); C !== 0; ) {
|
|
1276
|
+
if (oe(e, !0, t), C = e.input.charCodeAt(e.position), C === y)
|
|
1277
|
+
return e.position++, e.tag = o, e.anchor = c, e.kind = s ? "mapping" : "sequence", e.result = l, !0;
|
|
1278
|
+
n ? C === 44 && I(e, "expected the node content, but found ','") : I(e, "missed comma between flow collection entries"), p = m = b = null, u = v = !1, C === 63 && (d = e.input.charCodeAt(e.position + 1), ye(d) && (u = v = !0, e.position++, oe(e, !0, t))), i = e.line, r = e.lineStart, a = e.position, Re(e, t, ze, !1, !0), p = e.tag, m = e.result, oe(e, !0, t), C = e.input.charCodeAt(e.position), (v || e.line === i) && C === 58 && (u = !0, C = e.input.charCodeAt(++e.position), oe(e, !0, t), Re(e, t, ze, !1, !0), b = e.result), s ? Be(e, l, h, p, m, b, i, r, a) : u ? l.push(Be(e, null, h, p, m, b, i, r, a)) : l.push(m), oe(e, !0, t), C = e.input.charCodeAt(e.position), C === 44 ? (n = !0, C = e.input.charCodeAt(++e.position)) : n = !1;
|
|
1279
|
+
}
|
|
1280
|
+
I(e, "unexpected end of the stream within a flow collection");
|
|
1281
|
+
}
|
|
1282
|
+
function co(e, t) {
|
|
1283
|
+
var n, i, r = tt, a = !1, o = !1, l = t, c = 0, d = !1, y, u;
|
|
1284
|
+
if (u = e.input.charCodeAt(e.position), u === 124)
|
|
1285
|
+
i = !1;
|
|
1286
|
+
else if (u === 62)
|
|
1287
|
+
i = !0;
|
|
1288
|
+
else
|
|
1289
|
+
return !1;
|
|
1290
|
+
for (e.kind = "scalar", e.result = ""; u !== 0; )
|
|
1291
|
+
if (u = e.input.charCodeAt(++e.position), u === 43 || u === 45)
|
|
1292
|
+
tt === r ? r = u === 43 ? At : Gr : I(e, "repeat of a chomping mode identifier");
|
|
1293
|
+
else if ((y = to(u)) >= 0)
|
|
1294
|
+
y === 0 ? I(e, "bad explicit indentation width of a block scalar; it cannot be less than one") : o ? I(e, "repeat of an indentation width identifier") : (l = t + y - 1, o = !0);
|
|
1295
|
+
else
|
|
1296
|
+
break;
|
|
1297
|
+
if (Te(u)) {
|
|
1298
|
+
do
|
|
1299
|
+
u = e.input.charCodeAt(++e.position);
|
|
1300
|
+
while (Te(u));
|
|
1301
|
+
if (u === 35)
|
|
1302
|
+
do
|
|
1303
|
+
u = e.input.charCodeAt(++e.position);
|
|
1304
|
+
while (!ve(u) && u !== 0);
|
|
1305
|
+
}
|
|
1306
|
+
for (; u !== 0; ) {
|
|
1307
|
+
for (ft(e), e.lineIndent = 0, u = e.input.charCodeAt(e.position); (!o || e.lineIndent < l) && u === 32; )
|
|
1308
|
+
e.lineIndent++, u = e.input.charCodeAt(++e.position);
|
|
1309
|
+
if (!o && e.lineIndent > l && (l = e.lineIndent), ve(u)) {
|
|
1310
|
+
c++;
|
|
1311
|
+
continue;
|
|
1312
|
+
}
|
|
1313
|
+
if (e.lineIndent < l) {
|
|
1314
|
+
r === At ? e.result += ae.repeat(`
|
|
1315
|
+
`, a ? 1 + c : c) : r === tt && a && (e.result += `
|
|
1316
|
+
`);
|
|
1317
|
+
break;
|
|
1318
|
+
}
|
|
1319
|
+
for (i ? Te(u) ? (d = !0, e.result += ae.repeat(`
|
|
1320
|
+
`, a ? 1 + c : c)) : d ? (d = !1, e.result += ae.repeat(`
|
|
1321
|
+
`, c + 1)) : c === 0 ? a && (e.result += " ") : e.result += ae.repeat(`
|
|
1322
|
+
`, c) : e.result += ae.repeat(`
|
|
1323
|
+
`, a ? 1 + c : c), a = !0, o = !0, c = 0, n = e.position; !ve(u) && u !== 0; )
|
|
1324
|
+
u = e.input.charCodeAt(++e.position);
|
|
1325
|
+
be(e, n, e.position, !1);
|
|
1326
|
+
}
|
|
1327
|
+
return !0;
|
|
1328
|
+
}
|
|
1329
|
+
function $t(e, t) {
|
|
1330
|
+
var n, i = e.tag, r = e.anchor, a = [], o, l = !1, c;
|
|
1331
|
+
if (e.firstTabInLine !== -1) return !1;
|
|
1332
|
+
for (e.anchor !== null && (e.anchorMap[e.anchor] = a), c = e.input.charCodeAt(e.position); c !== 0 && (e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, I(e, "tab characters must not be used in indentation")), !(c !== 45 || (o = e.input.charCodeAt(e.position + 1), !ye(o)))); ) {
|
|
1333
|
+
if (l = !0, e.position++, oe(e, !0, -1) && e.lineIndent <= t) {
|
|
1334
|
+
a.push(null), c = e.input.charCodeAt(e.position);
|
|
1335
|
+
continue;
|
|
1336
|
+
}
|
|
1337
|
+
if (n = e.line, Re(e, t, hn, !1, !0), a.push(e.result), oe(e, !0, -1), c = e.input.charCodeAt(e.position), (e.line === n || e.lineIndent > t) && c !== 0)
|
|
1338
|
+
I(e, "bad indentation of a sequence entry");
|
|
1339
|
+
else if (e.lineIndent < t)
|
|
1340
|
+
break;
|
|
1341
|
+
}
|
|
1342
|
+
return l ? (e.tag = i, e.anchor = r, e.kind = "sequence", e.result = a, !0) : !1;
|
|
1343
|
+
}
|
|
1344
|
+
function so(e, t, n) {
|
|
1345
|
+
var i, r, a, o, l, c, d = e.tag, y = e.anchor, u = {}, v = /* @__PURE__ */ Object.create(null), s = null, h = null, m = null, p = !1, b = !1, C;
|
|
1346
|
+
if (e.firstTabInLine !== -1) return !1;
|
|
1347
|
+
for (e.anchor !== null && (e.anchorMap[e.anchor] = u), C = e.input.charCodeAt(e.position); C !== 0; ) {
|
|
1348
|
+
if (!p && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, I(e, "tab characters must not be used in indentation")), i = e.input.charCodeAt(e.position + 1), a = e.line, (C === 63 || C === 58) && ye(i))
|
|
1349
|
+
C === 63 ? (p && (Be(e, u, v, s, h, null, o, l, c), s = h = m = null), b = !0, p = !0, r = !0) : p ? (p = !1, r = !0) : I(e, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), e.position += 1, C = i;
|
|
1350
|
+
else {
|
|
1351
|
+
if (o = e.line, l = e.lineStart, c = e.position, !Re(e, n, gn, !1, !0))
|
|
1352
|
+
break;
|
|
1353
|
+
if (e.line === a) {
|
|
1354
|
+
for (C = e.input.charCodeAt(e.position); Te(C); )
|
|
1355
|
+
C = e.input.charCodeAt(++e.position);
|
|
1356
|
+
if (C === 58)
|
|
1357
|
+
C = e.input.charCodeAt(++e.position), ye(C) || I(e, "a whitespace character is expected after the key-value separator within a block mapping"), p && (Be(e, u, v, s, h, null, o, l, c), s = h = m = null), b = !0, p = !1, r = !1, s = e.tag, h = e.result;
|
|
1358
|
+
else if (b)
|
|
1359
|
+
I(e, "can not read an implicit mapping pair; a colon is missed");
|
|
1360
|
+
else
|
|
1361
|
+
return e.tag = d, e.anchor = y, !0;
|
|
1362
|
+
} else if (b)
|
|
1363
|
+
I(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
1364
|
+
else
|
|
1365
|
+
return e.tag = d, e.anchor = y, !0;
|
|
1366
|
+
}
|
|
1367
|
+
if ((e.line === a || e.lineIndent > t) && (p && (o = e.line, l = e.lineStart, c = e.position), Re(e, t, Ve, !0, r) && (p ? h = e.result : m = e.result), p || (Be(e, u, v, s, h, m, o, l, c), s = h = m = null), oe(e, !0, -1), C = e.input.charCodeAt(e.position)), (e.line === a || e.lineIndent > t) && C !== 0)
|
|
1368
|
+
I(e, "bad indentation of a mapping entry");
|
|
1369
|
+
else if (e.lineIndent < t)
|
|
1370
|
+
break;
|
|
1371
|
+
}
|
|
1372
|
+
return p && Be(e, u, v, s, h, null, o, l, c), b && (e.tag = d, e.anchor = y, e.kind = "mapping", e.result = u), b;
|
|
1373
|
+
}
|
|
1374
|
+
function uo(e) {
|
|
1375
|
+
var t, n = !1, i = !1, r, a, o;
|
|
1376
|
+
if (o = e.input.charCodeAt(e.position), o !== 33) return !1;
|
|
1377
|
+
if (e.tag !== null && I(e, "duplication of a tag property"), o = e.input.charCodeAt(++e.position), o === 60 ? (n = !0, o = e.input.charCodeAt(++e.position)) : o === 33 ? (i = !0, r = "!!", o = e.input.charCodeAt(++e.position)) : r = "!", t = e.position, n) {
|
|
1378
|
+
do
|
|
1379
|
+
o = e.input.charCodeAt(++e.position);
|
|
1380
|
+
while (o !== 0 && o !== 62);
|
|
1381
|
+
e.position < e.length ? (a = e.input.slice(t, e.position), o = e.input.charCodeAt(++e.position)) : I(e, "unexpected end of the stream within a verbatim tag");
|
|
1382
|
+
} else {
|
|
1383
|
+
for (; o !== 0 && !ye(o); )
|
|
1384
|
+
o === 33 && (i ? I(e, "tag suffix cannot contain exclamation marks") : (r = e.input.slice(t - 1, e.position + 1), vn.test(r) || I(e, "named tag handle cannot contain such characters"), i = !0, t = e.position + 1)), o = e.input.charCodeAt(++e.position);
|
|
1385
|
+
a = e.input.slice(t, e.position), Xr.test(a) && I(e, "tag suffix cannot contain flow indicator characters");
|
|
1386
|
+
}
|
|
1387
|
+
a && !kn.test(a) && I(e, "tag name cannot contain such characters: " + a);
|
|
1388
|
+
try {
|
|
1389
|
+
a = decodeURIComponent(a);
|
|
1390
|
+
} catch {
|
|
1391
|
+
I(e, "tag name is malformed: " + a);
|
|
1392
|
+
}
|
|
1393
|
+
return n ? e.tag = a : xe.call(e.tagMap, r) ? e.tag = e.tagMap[r] + a : r === "!" ? e.tag = "!" + a : r === "!!" ? e.tag = "tag:yaml.org,2002:" + a : I(e, 'undeclared tag handle "' + r + '"'), !0;
|
|
1394
|
+
}
|
|
1395
|
+
function fo(e) {
|
|
1396
|
+
var t, n;
|
|
1397
|
+
if (n = e.input.charCodeAt(e.position), n !== 38) return !1;
|
|
1398
|
+
for (e.anchor !== null && I(e, "duplication of an anchor property"), n = e.input.charCodeAt(++e.position), t = e.position; n !== 0 && !ye(n) && !Oe(n); )
|
|
1399
|
+
n = e.input.charCodeAt(++e.position);
|
|
1400
|
+
return e.position === t && I(e, "name of an anchor node must contain at least one character"), e.anchor = e.input.slice(t, e.position), !0;
|
|
1401
|
+
}
|
|
1402
|
+
function po(e) {
|
|
1403
|
+
var t, n, i;
|
|
1404
|
+
if (i = e.input.charCodeAt(e.position), i !== 42) return !1;
|
|
1405
|
+
for (i = e.input.charCodeAt(++e.position), t = e.position; i !== 0 && !ye(i) && !Oe(i); )
|
|
1406
|
+
i = e.input.charCodeAt(++e.position);
|
|
1407
|
+
return e.position === t && I(e, "name of an alias node must contain at least one character"), n = e.input.slice(t, e.position), xe.call(e.anchorMap, n) || I(e, 'unidentified alias "' + n + '"'), e.result = e.anchorMap[n], oe(e, !0, -1), !0;
|
|
1408
|
+
}
|
|
1409
|
+
function Re(e, t, n, i, r) {
|
|
1410
|
+
var a, o, l, c = 1, d = !1, y = !1, u, v, s, h, m, p;
|
|
1411
|
+
if (e.listener !== null && e.listener("open", e), e.tag = null, e.anchor = null, e.kind = null, e.result = null, a = o = l = Ve === n || hn === n, i && oe(e, !0, -1) && (d = !0, e.lineIndent > t ? c = 1 : e.lineIndent === t ? c = 0 : e.lineIndent < t && (c = -1)), c === 1)
|
|
1412
|
+
for (; uo(e) || fo(e); )
|
|
1413
|
+
oe(e, !0, -1) ? (d = !0, l = a, e.lineIndent > t ? c = 1 : e.lineIndent === t ? c = 0 : e.lineIndent < t && (c = -1)) : l = !1;
|
|
1414
|
+
if (l && (l = d || r), (c === 1 || Ve === n) && (ze === n || gn === n ? m = t : m = t + 1, p = e.position - e.lineStart, c === 1 ? l && ($t(e, p) || so(e, p, m)) || lo(e, m) ? y = !0 : (o && co(e, m) || oo(e, m) || ao(e, m) ? y = !0 : po(e) ? (y = !0, (e.tag !== null || e.anchor !== null) && I(e, "alias node should not have any properties")) : ro(e, m, ze === n) && (y = !0, e.tag === null && (e.tag = "?")), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : c === 0 && (y = l && $t(e, p))), e.tag === null)
|
|
1415
|
+
e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
|
|
1416
|
+
else if (e.tag === "?") {
|
|
1417
|
+
for (e.result !== null && e.kind !== "scalar" && I(e, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + e.kind + '"'), u = 0, v = e.implicitTypes.length; u < v; u += 1)
|
|
1418
|
+
if (h = e.implicitTypes[u], h.resolve(e.result)) {
|
|
1419
|
+
e.result = h.construct(e.result), e.tag = h.tag, e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
|
|
1420
|
+
break;
|
|
1421
|
+
}
|
|
1422
|
+
} else if (e.tag !== "!") {
|
|
1423
|
+
if (xe.call(e.typeMap[e.kind || "fallback"], e.tag))
|
|
1424
|
+
h = e.typeMap[e.kind || "fallback"][e.tag];
|
|
1425
|
+
else
|
|
1426
|
+
for (h = null, s = e.typeMap.multi[e.kind || "fallback"], u = 0, v = s.length; u < v; u += 1)
|
|
1427
|
+
if (e.tag.slice(0, s[u].tag.length) === s[u].tag) {
|
|
1428
|
+
h = s[u];
|
|
1429
|
+
break;
|
|
1430
|
+
}
|
|
1431
|
+
h || I(e, "unknown tag !<" + e.tag + ">"), e.result !== null && h.kind !== e.kind && I(e, "unacceptable node kind for !<" + e.tag + '> tag; it should be "' + h.kind + '", not "' + e.kind + '"'), h.resolve(e.result, e.tag) ? (e.result = h.construct(e.result, e.tag), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : I(e, "cannot resolve a node with !<" + e.tag + "> explicit tag");
|
|
1432
|
+
}
|
|
1433
|
+
return e.listener !== null && e.listener("close", e), e.tag !== null || e.anchor !== null || y;
|
|
1434
|
+
}
|
|
1435
|
+
function mo(e) {
|
|
1436
|
+
var t = e.position, n, i, r, a = !1, o;
|
|
1437
|
+
for (e.version = null, e.checkLineBreaks = e.legacy, e.tagMap = /* @__PURE__ */ Object.create(null), e.anchorMap = /* @__PURE__ */ Object.create(null); (o = e.input.charCodeAt(e.position)) !== 0 && (oe(e, !0, -1), o = e.input.charCodeAt(e.position), !(e.lineIndent > 0 || o !== 37)); ) {
|
|
1438
|
+
for (a = !0, o = e.input.charCodeAt(++e.position), n = e.position; o !== 0 && !ye(o); )
|
|
1439
|
+
o = e.input.charCodeAt(++e.position);
|
|
1440
|
+
for (i = e.input.slice(n, e.position), r = [], i.length < 1 && I(e, "directive name must not be less than one character in length"); o !== 0; ) {
|
|
1441
|
+
for (; Te(o); )
|
|
1442
|
+
o = e.input.charCodeAt(++e.position);
|
|
1443
|
+
if (o === 35) {
|
|
1444
|
+
do
|
|
1445
|
+
o = e.input.charCodeAt(++e.position);
|
|
1446
|
+
while (o !== 0 && !ve(o));
|
|
1447
|
+
break;
|
|
1448
|
+
}
|
|
1449
|
+
if (ve(o)) break;
|
|
1450
|
+
for (n = e.position; o !== 0 && !ye(o); )
|
|
1451
|
+
o = e.input.charCodeAt(++e.position);
|
|
1452
|
+
r.push(e.input.slice(n, e.position));
|
|
1453
|
+
}
|
|
1454
|
+
o !== 0 && ft(e), xe.call(Tt, i) ? Tt[i](e, i, r) : Ye(e, 'unknown document directive "' + i + '"');
|
|
1455
|
+
}
|
|
1456
|
+
if (oe(e, !0, -1), e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 ? (e.position += 3, oe(e, !0, -1)) : a && I(e, "directives end mark is expected"), Re(e, e.lineIndent - 1, Ve, !1, !0), oe(e, !0, -1), e.checkLineBreaks && Qr.test(e.input.slice(t, e.position)) && Ye(e, "non-ASCII line breaks are interpreted as content"), e.documents.push(e.result), e.position === e.lineStart && Qe(e)) {
|
|
1457
|
+
e.input.charCodeAt(e.position) === 46 && (e.position += 3, oe(e, !0, -1));
|
|
1458
|
+
return;
|
|
1459
|
+
}
|
|
1460
|
+
if (e.position < e.length - 1)
|
|
1461
|
+
I(e, "end of the stream or a document separator is expected");
|
|
1462
|
+
else
|
|
1463
|
+
return;
|
|
1464
|
+
}
|
|
1465
|
+
function Sn(e, t) {
|
|
1466
|
+
e = String(e), t = t || {}, e.length !== 0 && (e.charCodeAt(e.length - 1) !== 10 && e.charCodeAt(e.length - 1) !== 13 && (e += `
|
|
1467
|
+
`), e.charCodeAt(0) === 65279 && (e = e.slice(1)));
|
|
1468
|
+
var n = new io(e, t), i = e.indexOf("\0");
|
|
1469
|
+
for (i !== -1 && (n.position = i, I(n, "null byte is not allowed in input")), n.input += "\0"; n.input.charCodeAt(n.position) === 32; )
|
|
1470
|
+
n.lineIndent += 1, n.position += 1;
|
|
1471
|
+
for (; n.position < n.length - 1; )
|
|
1472
|
+
mo(n);
|
|
1473
|
+
return n.documents;
|
|
1474
|
+
}
|
|
1475
|
+
function yo(e, t, n) {
|
|
1476
|
+
t !== null && typeof t == "object" && typeof n > "u" && (n = t, t = null);
|
|
1477
|
+
var i = Sn(e, n);
|
|
1478
|
+
if (typeof t != "function")
|
|
1479
|
+
return i;
|
|
1480
|
+
for (var r = 0, a = i.length; r < a; r += 1)
|
|
1481
|
+
t(i[r]);
|
|
1482
|
+
}
|
|
1483
|
+
function go(e, t) {
|
|
1484
|
+
var n = Sn(e, t);
|
|
1485
|
+
if (n.length !== 0) {
|
|
1486
|
+
if (n.length === 1)
|
|
1487
|
+
return n[0];
|
|
1488
|
+
throw new fe("expected a single document in the stream, but found more");
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
var ho = yo, vo = go, _n = {
|
|
1492
|
+
loadAll: ho,
|
|
1493
|
+
load: vo
|
|
1494
|
+
}, Tn = Object.prototype.toString, wn = Object.prototype.hasOwnProperty, mt = 65279, ko = 9, Ne = 10, bo = 13, Co = 32, xo = 33, Ao = 34, rt = 35, So = 37, _o = 38, To = 39, wo = 42, $n = 44, $o = 45, We = 58, Eo = 61, Io = 62, Fo = 63, Oo = 64, En = 91, In = 93, Bo = 96, Fn = 123, Ko = 124, On = 125, de = {};
|
|
1495
|
+
de[0] = "\\0";
|
|
1496
|
+
de[7] = "\\a";
|
|
1497
|
+
de[8] = "\\b";
|
|
1498
|
+
de[9] = "\\t";
|
|
1499
|
+
de[10] = "\\n";
|
|
1500
|
+
de[11] = "\\v";
|
|
1501
|
+
de[12] = "\\f";
|
|
1502
|
+
de[13] = "\\r";
|
|
1503
|
+
de[27] = "\\e";
|
|
1504
|
+
de[34] = '\\"';
|
|
1505
|
+
de[92] = "\\\\";
|
|
1506
|
+
de[133] = "\\N";
|
|
1507
|
+
de[160] = "\\_";
|
|
1508
|
+
de[8232] = "\\L";
|
|
1509
|
+
de[8233] = "\\P";
|
|
1510
|
+
var Ro = [
|
|
1511
|
+
"y",
|
|
1512
|
+
"Y",
|
|
1513
|
+
"yes",
|
|
1514
|
+
"Yes",
|
|
1515
|
+
"YES",
|
|
1516
|
+
"on",
|
|
1517
|
+
"On",
|
|
1518
|
+
"ON",
|
|
1519
|
+
"n",
|
|
1520
|
+
"N",
|
|
1521
|
+
"no",
|
|
1522
|
+
"No",
|
|
1523
|
+
"NO",
|
|
1524
|
+
"off",
|
|
1525
|
+
"Off",
|
|
1526
|
+
"OFF"
|
|
1527
|
+
], Lo = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
|
1528
|
+
function Do(e, t) {
|
|
1529
|
+
var n, i, r, a, o, l, c;
|
|
1530
|
+
if (t === null) return {};
|
|
1531
|
+
for (n = {}, i = Object.keys(t), r = 0, a = i.length; r < a; r += 1)
|
|
1532
|
+
o = i[r], l = String(t[o]), o.slice(0, 2) === "!!" && (o = "tag:yaml.org,2002:" + o.slice(2)), c = e.compiledTypeMap.fallback[o], c && wn.call(c.styleAliases, l) && (l = c.styleAliases[l]), n[o] = l;
|
|
1533
|
+
return n;
|
|
1534
|
+
}
|
|
1535
|
+
function No(e) {
|
|
1536
|
+
var t, n, i;
|
|
1537
|
+
if (t = e.toString(16).toUpperCase(), e <= 255)
|
|
1538
|
+
n = "x", i = 2;
|
|
1539
|
+
else if (e <= 65535)
|
|
1540
|
+
n = "u", i = 4;
|
|
1541
|
+
else if (e <= 4294967295)
|
|
1542
|
+
n = "U", i = 8;
|
|
1543
|
+
else
|
|
1544
|
+
throw new fe("code point within a string may not be greater than 0xFFFFFFFF");
|
|
1545
|
+
return "\\" + n + ae.repeat("0", i - t.length) + t;
|
|
1546
|
+
}
|
|
1547
|
+
var Po = 1, Pe = 2;
|
|
1548
|
+
function Mo(e) {
|
|
1549
|
+
this.schema = e.schema || dt, this.indent = Math.max(1, e.indent || 2), this.noArrayIndent = e.noArrayIndent || !1, this.skipInvalid = e.skipInvalid || !1, this.flowLevel = ae.isNothing(e.flowLevel) ? -1 : e.flowLevel, this.styleMap = Do(this.schema, e.styles || null), this.sortKeys = e.sortKeys || !1, this.lineWidth = e.lineWidth || 80, this.noRefs = e.noRefs || !1, this.noCompatMode = e.noCompatMode || !1, this.condenseFlow = e.condenseFlow || !1, this.quotingType = e.quotingType === '"' ? Pe : Po, this.forceQuotes = e.forceQuotes || !1, this.replacer = typeof e.replacer == "function" ? e.replacer : null, this.implicitTypes = this.schema.compiledImplicit, this.explicitTypes = this.schema.compiledExplicit, this.tag = null, this.result = "", this.duplicates = [], this.usedDuplicates = null;
|
|
1550
|
+
}
|
|
1551
|
+
function Et(e, t) {
|
|
1552
|
+
for (var n = ae.repeat(" ", t), i = 0, r = -1, a = "", o, l = e.length; i < l; )
|
|
1553
|
+
r = e.indexOf(`
|
|
1554
|
+
`, i), r === -1 ? (o = e.slice(i), i = l) : (o = e.slice(i, r + 1), i = r + 1), o.length && o !== `
|
|
1555
|
+
` && (a += n), a += o;
|
|
1556
|
+
return a;
|
|
1557
|
+
}
|
|
1558
|
+
function ot(e, t) {
|
|
1559
|
+
return `
|
|
1560
|
+
` + ae.repeat(" ", e.indent * t);
|
|
1561
|
+
}
|
|
1562
|
+
function jo(e, t) {
|
|
1563
|
+
var n, i, r;
|
|
1564
|
+
for (n = 0, i = e.implicitTypes.length; n < i; n += 1)
|
|
1565
|
+
if (r = e.implicitTypes[n], r.resolve(t))
|
|
1566
|
+
return !0;
|
|
1567
|
+
return !1;
|
|
1568
|
+
}
|
|
1569
|
+
function Ge(e) {
|
|
1570
|
+
return e === Co || e === ko;
|
|
1571
|
+
}
|
|
1572
|
+
function Me(e) {
|
|
1573
|
+
return 32 <= e && e <= 126 || 161 <= e && e <= 55295 && e !== 8232 && e !== 8233 || 57344 <= e && e <= 65533 && e !== mt || 65536 <= e && e <= 1114111;
|
|
1574
|
+
}
|
|
1575
|
+
function It(e) {
|
|
1576
|
+
return Me(e) && e !== mt && e !== bo && e !== Ne;
|
|
1577
|
+
}
|
|
1578
|
+
function Ft(e, t, n) {
|
|
1579
|
+
var i = It(e), r = i && !Ge(e);
|
|
1580
|
+
return (
|
|
1581
|
+
// ns-plain-safe
|
|
1582
|
+
(n ? (
|
|
1583
|
+
// c = flow-in
|
|
1584
|
+
i
|
|
1585
|
+
) : i && e !== $n && e !== En && e !== In && e !== Fn && e !== On) && e !== rt && !(t === We && !r) || It(t) && !Ge(t) && e === rt || t === We && r
|
|
1586
|
+
);
|
|
1587
|
+
}
|
|
1588
|
+
function Uo(e) {
|
|
1589
|
+
return Me(e) && e !== mt && !Ge(e) && e !== $o && e !== Fo && e !== We && e !== $n && e !== En && e !== In && e !== Fn && e !== On && e !== rt && e !== _o && e !== wo && e !== xo && e !== Ko && e !== Eo && e !== Io && e !== To && e !== Ao && e !== So && e !== Oo && e !== Bo;
|
|
1590
|
+
}
|
|
1591
|
+
function qo(e) {
|
|
1592
|
+
return !Ge(e) && e !== We;
|
|
1593
|
+
}
|
|
1594
|
+
function Le(e, t) {
|
|
1595
|
+
var n = e.charCodeAt(t), i;
|
|
1596
|
+
return n >= 55296 && n <= 56319 && t + 1 < e.length && (i = e.charCodeAt(t + 1), i >= 56320 && i <= 57343) ? (n - 55296) * 1024 + i - 56320 + 65536 : n;
|
|
1597
|
+
}
|
|
1598
|
+
function Bn(e) {
|
|
1599
|
+
var t = /^\n* /;
|
|
1600
|
+
return t.test(e);
|
|
1601
|
+
}
|
|
1602
|
+
var Kn = 1, at = 2, Rn = 3, Ln = 4, Fe = 5;
|
|
1603
|
+
function Ho(e, t, n, i, r, a, o, l) {
|
|
1604
|
+
var c, d = 0, y = null, u = !1, v = !1, s = i !== -1, h = -1, m = Uo(Le(e, 0)) && qo(Le(e, e.length - 1));
|
|
1605
|
+
if (t || o)
|
|
1606
|
+
for (c = 0; c < e.length; d >= 65536 ? c += 2 : c++) {
|
|
1607
|
+
if (d = Le(e, c), !Me(d))
|
|
1608
|
+
return Fe;
|
|
1609
|
+
m = m && Ft(d, y, l), y = d;
|
|
1610
|
+
}
|
|
1611
|
+
else {
|
|
1612
|
+
for (c = 0; c < e.length; d >= 65536 ? c += 2 : c++) {
|
|
1613
|
+
if (d = Le(e, c), d === Ne)
|
|
1614
|
+
u = !0, s && (v = v || // Foldable line = too long, and not more-indented.
|
|
1615
|
+
c - h - 1 > i && e[h + 1] !== " ", h = c);
|
|
1616
|
+
else if (!Me(d))
|
|
1617
|
+
return Fe;
|
|
1618
|
+
m = m && Ft(d, y, l), y = d;
|
|
1619
|
+
}
|
|
1620
|
+
v = v || s && c - h - 1 > i && e[h + 1] !== " ";
|
|
1621
|
+
}
|
|
1622
|
+
return !u && !v ? m && !o && !r(e) ? Kn : a === Pe ? Fe : at : n > 9 && Bn(e) ? Fe : o ? a === Pe ? Fe : at : v ? Ln : Rn;
|
|
1623
|
+
}
|
|
1624
|
+
function zo(e, t, n, i, r) {
|
|
1625
|
+
e.dump = function() {
|
|
1626
|
+
if (t.length === 0)
|
|
1627
|
+
return e.quotingType === Pe ? '""' : "''";
|
|
1628
|
+
if (!e.noCompatMode && (Ro.indexOf(t) !== -1 || Lo.test(t)))
|
|
1629
|
+
return e.quotingType === Pe ? '"' + t + '"' : "'" + t + "'";
|
|
1630
|
+
var a = e.indent * Math.max(1, n), o = e.lineWidth === -1 ? -1 : Math.max(Math.min(e.lineWidth, 40), e.lineWidth - a), l = i || e.flowLevel > -1 && n >= e.flowLevel;
|
|
1631
|
+
function c(d) {
|
|
1632
|
+
return jo(e, d);
|
|
1633
|
+
}
|
|
1634
|
+
switch (Ho(
|
|
1635
|
+
t,
|
|
1636
|
+
l,
|
|
1637
|
+
e.indent,
|
|
1638
|
+
o,
|
|
1639
|
+
c,
|
|
1640
|
+
e.quotingType,
|
|
1641
|
+
e.forceQuotes && !i,
|
|
1642
|
+
r
|
|
1643
|
+
)) {
|
|
1644
|
+
case Kn:
|
|
1645
|
+
return t;
|
|
1646
|
+
case at:
|
|
1647
|
+
return "'" + t.replace(/'/g, "''") + "'";
|
|
1648
|
+
case Rn:
|
|
1649
|
+
return "|" + Ot(t, e.indent) + Bt(Et(t, a));
|
|
1650
|
+
case Ln:
|
|
1651
|
+
return ">" + Ot(t, e.indent) + Bt(Et(Vo(t, o), a));
|
|
1652
|
+
case Fe:
|
|
1653
|
+
return '"' + Yo(t) + '"';
|
|
1654
|
+
default:
|
|
1655
|
+
throw new fe("impossible error: invalid scalar style");
|
|
1656
|
+
}
|
|
1657
|
+
}();
|
|
1658
|
+
}
|
|
1659
|
+
function Ot(e, t) {
|
|
1660
|
+
var n = Bn(e) ? String(t) : "", i = e[e.length - 1] === `
|
|
1661
|
+
`, r = i && (e[e.length - 2] === `
|
|
1662
|
+
` || e === `
|
|
1663
|
+
`), a = r ? "+" : i ? "" : "-";
|
|
1664
|
+
return n + a + `
|
|
1665
|
+
`;
|
|
1666
|
+
}
|
|
1667
|
+
function Bt(e) {
|
|
1668
|
+
return e[e.length - 1] === `
|
|
1669
|
+
` ? e.slice(0, -1) : e;
|
|
1670
|
+
}
|
|
1671
|
+
function Vo(e, t) {
|
|
1672
|
+
for (var n = /(\n+)([^\n]*)/g, i = function() {
|
|
1673
|
+
var d = e.indexOf(`
|
|
1674
|
+
`);
|
|
1675
|
+
return d = d !== -1 ? d : e.length, n.lastIndex = d, Kt(e.slice(0, d), t);
|
|
1676
|
+
}(), r = e[0] === `
|
|
1677
|
+
` || e[0] === " ", a, o; o = n.exec(e); ) {
|
|
1678
|
+
var l = o[1], c = o[2];
|
|
1679
|
+
a = c[0] === " ", i += l + (!r && !a && c !== "" ? `
|
|
1680
|
+
` : "") + Kt(c, t), r = a;
|
|
1681
|
+
}
|
|
1682
|
+
return i;
|
|
1683
|
+
}
|
|
1684
|
+
function Kt(e, t) {
|
|
1685
|
+
if (e === "" || e[0] === " ") return e;
|
|
1686
|
+
for (var n = / [^ ]/g, i, r = 0, a, o = 0, l = 0, c = ""; i = n.exec(e); )
|
|
1687
|
+
l = i.index, l - r > t && (a = o > r ? o : l, c += `
|
|
1688
|
+
` + e.slice(r, a), r = a + 1), o = l;
|
|
1689
|
+
return c += `
|
|
1690
|
+
`, e.length - r > t && o > r ? c += e.slice(r, o) + `
|
|
1691
|
+
` + e.slice(o + 1) : c += e.slice(r), c.slice(1);
|
|
1692
|
+
}
|
|
1693
|
+
function Yo(e) {
|
|
1694
|
+
for (var t = "", n = 0, i, r = 0; r < e.length; n >= 65536 ? r += 2 : r++)
|
|
1695
|
+
n = Le(e, r), i = de[n], !i && Me(n) ? (t += e[r], n >= 65536 && (t += e[r + 1])) : t += i || No(n);
|
|
1696
|
+
return t;
|
|
1697
|
+
}
|
|
1698
|
+
function Wo(e, t, n) {
|
|
1699
|
+
var i = "", r = e.tag, a, o, l;
|
|
1700
|
+
for (a = 0, o = n.length; a < o; a += 1)
|
|
1701
|
+
l = n[a], e.replacer && (l = e.replacer.call(n, String(a), l)), (ke(e, t, l, !1, !1) || typeof l > "u" && ke(e, t, null, !1, !1)) && (i !== "" && (i += "," + (e.condenseFlow ? "" : " ")), i += e.dump);
|
|
1702
|
+
e.tag = r, e.dump = "[" + i + "]";
|
|
1703
|
+
}
|
|
1704
|
+
function Rt(e, t, n, i) {
|
|
1705
|
+
var r = "", a = e.tag, o, l, c;
|
|
1706
|
+
for (o = 0, l = n.length; o < l; o += 1)
|
|
1707
|
+
c = n[o], e.replacer && (c = e.replacer.call(n, String(o), c)), (ke(e, t + 1, c, !0, !0, !1, !0) || typeof c > "u" && ke(e, t + 1, null, !0, !0, !1, !0)) && ((!i || r !== "") && (r += ot(e, t)), e.dump && Ne === e.dump.charCodeAt(0) ? r += "-" : r += "- ", r += e.dump);
|
|
1708
|
+
e.tag = a, e.dump = r || "[]";
|
|
1709
|
+
}
|
|
1710
|
+
function Go(e, t, n) {
|
|
1711
|
+
var i = "", r = e.tag, a = Object.keys(n), o, l, c, d, y;
|
|
1712
|
+
for (o = 0, l = a.length; o < l; o += 1)
|
|
1713
|
+
y = "", i !== "" && (y += ", "), e.condenseFlow && (y += '"'), c = a[o], d = n[c], e.replacer && (d = e.replacer.call(n, c, d)), ke(e, t, c, !1, !1) && (e.dump.length > 1024 && (y += "? "), y += e.dump + (e.condenseFlow ? '"' : "") + ":" + (e.condenseFlow ? "" : " "), ke(e, t, d, !1, !1) && (y += e.dump, i += y));
|
|
1714
|
+
e.tag = r, e.dump = "{" + i + "}";
|
|
1715
|
+
}
|
|
1716
|
+
function Jo(e, t, n, i) {
|
|
1717
|
+
var r = "", a = e.tag, o = Object.keys(n), l, c, d, y, u, v;
|
|
1718
|
+
if (e.sortKeys === !0)
|
|
1719
|
+
o.sort();
|
|
1720
|
+
else if (typeof e.sortKeys == "function")
|
|
1721
|
+
o.sort(e.sortKeys);
|
|
1722
|
+
else if (e.sortKeys)
|
|
1723
|
+
throw new fe("sortKeys must be a boolean or a function");
|
|
1724
|
+
for (l = 0, c = o.length; l < c; l += 1)
|
|
1725
|
+
v = "", (!i || r !== "") && (v += ot(e, t)), d = o[l], y = n[d], e.replacer && (y = e.replacer.call(n, d, y)), ke(e, t + 1, d, !0, !0, !0) && (u = e.tag !== null && e.tag !== "?" || e.dump && e.dump.length > 1024, u && (e.dump && Ne === e.dump.charCodeAt(0) ? v += "?" : v += "? "), v += e.dump, u && (v += ot(e, t)), ke(e, t + 1, y, !0, u) && (e.dump && Ne === e.dump.charCodeAt(0) ? v += ":" : v += ": ", v += e.dump, r += v));
|
|
1726
|
+
e.tag = a, e.dump = r || "{}";
|
|
1727
|
+
}
|
|
1728
|
+
function Lt(e, t, n) {
|
|
1729
|
+
var i, r, a, o, l, c;
|
|
1730
|
+
for (r = n ? e.explicitTypes : e.implicitTypes, a = 0, o = r.length; a < o; a += 1)
|
|
1731
|
+
if (l = r[a], (l.instanceOf || l.predicate) && (!l.instanceOf || typeof t == "object" && t instanceof l.instanceOf) && (!l.predicate || l.predicate(t))) {
|
|
1732
|
+
if (n ? l.multi && l.representName ? e.tag = l.representName(t) : e.tag = l.tag : e.tag = "?", l.represent) {
|
|
1733
|
+
if (c = e.styleMap[l.tag] || l.defaultStyle, Tn.call(l.represent) === "[object Function]")
|
|
1734
|
+
i = l.represent(t, c);
|
|
1735
|
+
else if (wn.call(l.represent, c))
|
|
1736
|
+
i = l.represent[c](t, c);
|
|
1737
|
+
else
|
|
1738
|
+
throw new fe("!<" + l.tag + '> tag resolver accepts not "' + c + '" style');
|
|
1739
|
+
e.dump = i;
|
|
1740
|
+
}
|
|
1741
|
+
return !0;
|
|
1742
|
+
}
|
|
1743
|
+
return !1;
|
|
1744
|
+
}
|
|
1745
|
+
function ke(e, t, n, i, r, a, o) {
|
|
1746
|
+
e.tag = null, e.dump = n, Lt(e, n, !1) || Lt(e, n, !0);
|
|
1747
|
+
var l = Tn.call(e.dump), c = i, d;
|
|
1748
|
+
i && (i = e.flowLevel < 0 || e.flowLevel > t);
|
|
1749
|
+
var y = l === "[object Object]" || l === "[object Array]", u, v;
|
|
1750
|
+
if (y && (u = e.duplicates.indexOf(n), v = u !== -1), (e.tag !== null && e.tag !== "?" || v || e.indent !== 2 && t > 0) && (r = !1), v && e.usedDuplicates[u])
|
|
1751
|
+
e.dump = "*ref_" + u;
|
|
1752
|
+
else {
|
|
1753
|
+
if (y && v && !e.usedDuplicates[u] && (e.usedDuplicates[u] = !0), l === "[object Object]")
|
|
1754
|
+
i && Object.keys(e.dump).length !== 0 ? (Jo(e, t, e.dump, r), v && (e.dump = "&ref_" + u + e.dump)) : (Go(e, t, e.dump), v && (e.dump = "&ref_" + u + " " + e.dump));
|
|
1755
|
+
else if (l === "[object Array]")
|
|
1756
|
+
i && e.dump.length !== 0 ? (e.noArrayIndent && !o && t > 0 ? Rt(e, t - 1, e.dump, r) : Rt(e, t, e.dump, r), v && (e.dump = "&ref_" + u + e.dump)) : (Wo(e, t, e.dump), v && (e.dump = "&ref_" + u + " " + e.dump));
|
|
1757
|
+
else if (l === "[object String]")
|
|
1758
|
+
e.tag !== "?" && zo(e, e.dump, t, a, c);
|
|
1759
|
+
else {
|
|
1760
|
+
if (l === "[object Undefined]")
|
|
1761
|
+
return !1;
|
|
1762
|
+
if (e.skipInvalid) return !1;
|
|
1763
|
+
throw new fe("unacceptable kind of an object to dump " + l);
|
|
1764
|
+
}
|
|
1765
|
+
e.tag !== null && e.tag !== "?" && (d = encodeURI(
|
|
1766
|
+
e.tag[0] === "!" ? e.tag.slice(1) : e.tag
|
|
1767
|
+
).replace(/!/g, "%21"), e.tag[0] === "!" ? d = "!" + d : d.slice(0, 18) === "tag:yaml.org,2002:" ? d = "!!" + d.slice(18) : d = "!<" + d + ">", e.dump = d + " " + e.dump);
|
|
1768
|
+
}
|
|
1769
|
+
return !0;
|
|
1770
|
+
}
|
|
1771
|
+
function Qo(e, t) {
|
|
1772
|
+
var n = [], i = [], r, a;
|
|
1773
|
+
for (lt(e, n, i), r = 0, a = i.length; r < a; r += 1)
|
|
1774
|
+
t.duplicates.push(n[i[r]]);
|
|
1775
|
+
t.usedDuplicates = new Array(a);
|
|
1776
|
+
}
|
|
1777
|
+
function lt(e, t, n) {
|
|
1778
|
+
var i, r, a;
|
|
1779
|
+
if (e !== null && typeof e == "object")
|
|
1780
|
+
if (r = t.indexOf(e), r !== -1)
|
|
1781
|
+
n.indexOf(r) === -1 && n.push(r);
|
|
1782
|
+
else if (t.push(e), Array.isArray(e))
|
|
1783
|
+
for (r = 0, a = e.length; r < a; r += 1)
|
|
1784
|
+
lt(e[r], t, n);
|
|
1785
|
+
else
|
|
1786
|
+
for (i = Object.keys(e), r = 0, a = i.length; r < a; r += 1)
|
|
1787
|
+
lt(e[i[r]], t, n);
|
|
1788
|
+
}
|
|
1789
|
+
function Xo(e, t) {
|
|
1790
|
+
t = t || {};
|
|
1791
|
+
var n = new Mo(t);
|
|
1792
|
+
n.noRefs || Qo(e, n);
|
|
1793
|
+
var i = e;
|
|
1794
|
+
return n.replacer && (i = n.replacer.call({ "": i }, "", i)), ke(n, 0, i, !0, !0) ? n.dump + `
|
|
1795
|
+
` : "";
|
|
1796
|
+
}
|
|
1797
|
+
var Zo = Xo, ea = {
|
|
1798
|
+
dump: Zo
|
|
1799
|
+
};
|
|
1800
|
+
function yt(e, t) {
|
|
1801
|
+
return function() {
|
|
1802
|
+
throw new Error("Function yaml." + e + " is removed in js-yaml 4. Use yaml." + t + " instead, which is now safe by default.");
|
|
1803
|
+
};
|
|
1804
|
+
}
|
|
1805
|
+
var ta = ce, na = Jt, ia = en, ra = an, oa = ln, aa = dt, la = _n.load, ca = _n.loadAll, sa = ea.dump, ua = fe, da = {
|
|
1806
|
+
binary: fn,
|
|
1807
|
+
float: on,
|
|
1808
|
+
map: Zt,
|
|
1809
|
+
null: tn,
|
|
1810
|
+
pairs: mn,
|
|
1811
|
+
set: yn,
|
|
1812
|
+
timestamp: un,
|
|
1813
|
+
bool: nn,
|
|
1814
|
+
int: rn,
|
|
1815
|
+
merge: dn,
|
|
1816
|
+
omap: pn,
|
|
1817
|
+
seq: Xt,
|
|
1818
|
+
str: Qt
|
|
1819
|
+
}, fa = yt("safeLoad", "load"), pa = yt("safeLoadAll", "loadAll"), ma = yt("safeDump", "dump"), Dn = {
|
|
1820
|
+
Type: ta,
|
|
1821
|
+
Schema: na,
|
|
1822
|
+
FAILSAFE_SCHEMA: ia,
|
|
1823
|
+
JSON_SCHEMA: ra,
|
|
1824
|
+
CORE_SCHEMA: oa,
|
|
1825
|
+
DEFAULT_SCHEMA: aa,
|
|
1826
|
+
load: la,
|
|
1827
|
+
loadAll: ca,
|
|
1828
|
+
dump: sa,
|
|
1829
|
+
YAMLException: ua,
|
|
1830
|
+
types: da,
|
|
1831
|
+
safeLoad: fa,
|
|
1832
|
+
safeLoadAll: pa,
|
|
1833
|
+
safeDump: ma
|
|
1834
|
+
};
|
|
1835
|
+
const ya = /* @__PURE__ */ ee({
|
|
1836
|
+
__name: "DeckCallout",
|
|
1837
|
+
emits: ["click-cta", "dismiss"],
|
|
1838
|
+
setup(e) {
|
|
1839
|
+
const { i18n: { t }, i18nT: n } = G.useI18n();
|
|
1840
|
+
return (i, r) => {
|
|
1841
|
+
const a = L("KAlert");
|
|
1842
|
+
return f(), E(a, {
|
|
1843
|
+
class: "deck-callout",
|
|
1844
|
+
dismissible: "",
|
|
1845
|
+
onDismiss: r[1] || (r[1] = (o) => i.$emit("dismiss"))
|
|
1846
|
+
}, {
|
|
1847
|
+
default: k(() => [
|
|
1848
|
+
K(g(n), { keypath: "deckCallout.body" }, {
|
|
1849
|
+
cta: k(() => [
|
|
1850
|
+
F("button", {
|
|
1851
|
+
class: "cta",
|
|
1852
|
+
type: "button",
|
|
1853
|
+
onClick: r[0] || (r[0] = (o) => i.$emit("click-cta"))
|
|
1854
|
+
}, S(g(t)("deckCallout.cta")), 1)
|
|
1855
|
+
]),
|
|
1856
|
+
_: 1
|
|
1857
|
+
})
|
|
1858
|
+
]),
|
|
1859
|
+
_: 1
|
|
1860
|
+
});
|
|
1861
|
+
};
|
|
1862
|
+
}
|
|
1863
|
+
}), ga = /* @__PURE__ */ se(ya, [["__scopeId", "data-v-0bf1334c"]]), Nn = /* @__PURE__ */ ee({
|
|
1864
|
+
inheritAttrs: !1,
|
|
1865
|
+
__name: "YamlCodeBlock",
|
|
1866
|
+
props: {
|
|
1867
|
+
/** A record to indicate the entity's configuration, used to populate the YAML code block */
|
|
1868
|
+
entityRecord: {
|
|
1869
|
+
type: Object,
|
|
1870
|
+
required: !0
|
|
1871
|
+
},
|
|
1872
|
+
/**
|
|
1873
|
+
* The localStorage key to use to persist the visibility preference for the decK format callout.
|
|
1874
|
+
* Omitting this will hide the callout in any case.
|
|
1875
|
+
*/
|
|
1876
|
+
deckCalloutPreferenceKey: {
|
|
1877
|
+
type: String,
|
|
1878
|
+
required: !1,
|
|
1879
|
+
default: ""
|
|
1880
|
+
}
|
|
1881
|
+
},
|
|
1882
|
+
emits: ["deck-callout:click-cta", "deck-callout:dismiss"],
|
|
1883
|
+
setup(e, { emit: t }) {
|
|
1884
|
+
const n = e, i = t, r = q("visible"), a = T(() => {
|
|
1885
|
+
const l = Object.fromEntries(Object.entries(n.entityRecord).filter(([, c]) => c !== null && c !== "" && (Array.isArray(c) ? c.length !== 0 : !0)));
|
|
1886
|
+
return Object.keys(l).length === 0 && l.constructor === Object ? "" : Dn.dump(l).trim();
|
|
1887
|
+
});
|
|
1888
|
+
Ce(() => n.deckCalloutPreferenceKey, (l) => {
|
|
1889
|
+
if (l) {
|
|
1890
|
+
const c = localStorage.getItem(l);
|
|
1891
|
+
r.value = c === "dismissed" ? "dismissed" : "visible";
|
|
1892
|
+
}
|
|
1893
|
+
}, { immediate: !0 }), Ce(r, (l) => {
|
|
1894
|
+
const c = n.deckCalloutPreferenceKey;
|
|
1895
|
+
c && localStorage.setItem(c, l);
|
|
1896
|
+
});
|
|
1897
|
+
function o() {
|
|
1898
|
+
r.value = "dismissed", i("deck-callout:dismiss");
|
|
1899
|
+
}
|
|
1900
|
+
return (l, c) => {
|
|
1901
|
+
const d = L("KCodeBlock");
|
|
1902
|
+
return f(), A(pe, null, [
|
|
1903
|
+
n.deckCalloutPreferenceKey && r.value === "visible" ? (f(), E(ga, {
|
|
1904
|
+
key: 0,
|
|
1905
|
+
onClickCta: c[0] || (c[0] = (y) => l.$emit("deck-callout:click-cta")),
|
|
1906
|
+
onDismiss: c[1] || (c[1] = (y) => o())
|
|
1907
|
+
})) : B("", !0),
|
|
1908
|
+
F("div", qe({ class: "yaml-config config-card-code-block" }, l.$attrs), [
|
|
1909
|
+
n.entityRecord ? (f(), E(d, {
|
|
1910
|
+
key: 0,
|
|
1911
|
+
id: "yaml-codeblock",
|
|
1912
|
+
code: a.value,
|
|
1913
|
+
language: "yaml",
|
|
1914
|
+
theme: "dark",
|
|
1915
|
+
onCodeBlockRender: g(Ke)
|
|
1916
|
+
}, null, 8, ["code", "onCodeBlockRender"])) : B("", !0)
|
|
1917
|
+
], 16)
|
|
1918
|
+
], 64);
|
|
1919
|
+
};
|
|
1920
|
+
}
|
|
1921
|
+
}), ha = { class: "terraform-config config-card-code-block" }, re = " ", Dt = "TF_MULTILINE_EOT", nt = "cloud_gateway_addon", Pn = /* @__PURE__ */ ee({
|
|
1922
|
+
__name: "TerraformCodeBlock",
|
|
1923
|
+
props: {
|
|
1924
|
+
/** A record to indicate the entity's configuration, used to populate the Terraform code block */
|
|
1925
|
+
entityRecord: {
|
|
1926
|
+
type: Object,
|
|
1927
|
+
required: !0
|
|
1928
|
+
},
|
|
1929
|
+
entityType: {
|
|
1930
|
+
type: String,
|
|
1931
|
+
required: !0,
|
|
1932
|
+
validator: (e) => Je.includes(e)
|
|
1933
|
+
},
|
|
1934
|
+
credentialType: {
|
|
1935
|
+
type: String,
|
|
1936
|
+
default: ""
|
|
1937
|
+
},
|
|
1938
|
+
subEntityType: {
|
|
1939
|
+
// only for event gateway entities
|
|
1940
|
+
type: String,
|
|
1941
|
+
default: ""
|
|
1942
|
+
}
|
|
1943
|
+
},
|
|
1944
|
+
setup(e) {
|
|
1945
|
+
const t = e, n = T(() => {
|
|
1946
|
+
const s = t.entityRecord;
|
|
1947
|
+
if (!s || typeof s != "object")
|
|
1948
|
+
return !1;
|
|
1949
|
+
const h = s.config;
|
|
1950
|
+
return !h || typeof h != "object" ? !1 : typeof h.managed_cache < "u" || typeof h.capacity_config < "u";
|
|
1951
|
+
}), i = T(() => typeof t.entityType == "string" && t.entityType.length > 0 ? t.entityType : n.value ? nt : _e.Partial), r = T(() => Wn.includes(i.value)), a = T(() => Gn.includes(i.value)), o = (s, h) => {
|
|
1952
|
+
if (s.includes(`
|
|
1953
|
+
`)) {
|
|
1954
|
+
const p = h + re, b = s.split(`
|
|
1955
|
+
`).map((C) => `${p}${C}`).join(`
|
|
1956
|
+
`);
|
|
1957
|
+
return `<<-${Dt}
|
|
1958
|
+
${b}
|
|
1959
|
+
${p}${Dt}`;
|
|
1960
|
+
}
|
|
1961
|
+
return `"${s.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
1962
|
+
}, l = (s, h) => {
|
|
1963
|
+
const m = re;
|
|
1964
|
+
let p = "";
|
|
1965
|
+
return typeof s == "string" ? p += `${m}${h} = ${o(s, m)}
|
|
1966
|
+
` : p += `${m}${h} = ${String(s ?? "")}
|
|
1967
|
+
`, p;
|
|
1968
|
+
}, c = (s, h, m = "") => {
|
|
1969
|
+
if (typeof s != "object")
|
|
1970
|
+
return "Invalid object";
|
|
1971
|
+
const p = re + m;
|
|
1972
|
+
let b = "";
|
|
1973
|
+
if (h && (b += `${p}${h} = {
|
|
1974
|
+
`), s === null)
|
|
1975
|
+
return h ? b += `${p}}` : b = "{}", b;
|
|
1976
|
+
const C = Object.fromEntries(Object.entries(s).filter(([, z]) => z !== null));
|
|
1977
|
+
let R = "";
|
|
1978
|
+
for (const [z, Y] of Object.entries(C))
|
|
1979
|
+
Array.isArray(Y) ? Y.length === 0 ? R = "[]" : (R = `[
|
|
1980
|
+
`, R += d(Y, void 0, p), R += `${p}${re}]`) : Y && typeof Y == "object" ? (R = `{
|
|
1981
|
+
`, R += c(Y, void 0, p), R += `${p}${re}}`) : typeof Y == "string" ? R = o(Y, p + re) : R = String(Y ?? ""), b += `${p}${re}${z} = ${R}
|
|
1982
|
+
`;
|
|
1983
|
+
return h ? b += `${p}}
|
|
1984
|
+
` : b;
|
|
1985
|
+
}, d = (s, h, m = "") => {
|
|
1986
|
+
if (!Array.isArray(s))
|
|
1987
|
+
return "Invalid array";
|
|
1988
|
+
const p = re + m;
|
|
1989
|
+
let b = "";
|
|
1990
|
+
h && (s.length === 0 ? b += `${p}${h} = [` : b += `${p}${h} = [
|
|
1991
|
+
`);
|
|
1992
|
+
for (let C = 0; C < s.length; C++) {
|
|
1993
|
+
const R = s[C];
|
|
1994
|
+
typeof R == "object" ? (b += `${p}${re}{
|
|
1995
|
+
`, b += c(R, void 0, p), b += `${p}${re}}`) : typeof R == "string" ? b += `${p}${re}${o(R, p + re)}` : b += `${p}${re}${String(R ?? "")}`, C < s.length - 1 && (b += ","), b += `
|
|
1996
|
+
`;
|
|
1997
|
+
}
|
|
1998
|
+
return h && (s.length === 0 ? b += `]
|
|
1999
|
+
` : b += `${p}]
|
|
2000
|
+
`), b;
|
|
2001
|
+
}, y = (s) => s.replace(/\$\{/g, () => "$${"), u = (s) => {
|
|
2002
|
+
let h = "";
|
|
2003
|
+
for (const [m, p] of Object.entries(s))
|
|
2004
|
+
Array.isArray(p) ? h += d(p, m) : typeof p == "object" ? h += c(p, m) : h += l(p, m);
|
|
2005
|
+
return y(h);
|
|
2006
|
+
}, v = T(() => {
|
|
2007
|
+
var b, C, R, z, Y, w, $;
|
|
2008
|
+
const s = Object.fromEntries(Object.entries(t.entityRecord).filter(([, O]) => O != null)), h = t.entityRecord.config ? Object.fromEntries(Object.entries((b = t.entityRecord) == null ? void 0 : b.config).filter(([, O]) => O != null)) : void 0;
|
|
2009
|
+
if (h && (s.config = h), Object.keys(s).length === 0)
|
|
2010
|
+
return "";
|
|
2011
|
+
delete s.id;
|
|
2012
|
+
let m = "", p = "";
|
|
2013
|
+
if ((C = s.service) != null && C.id ? (p = "service", delete s.service) : (R = s.route) != null && R.id ? (p = "route", delete s.route) : (z = s.consumer) != null && z.id ? (p = "consumer", delete s.consumer) : (Y = s.consumer_group) != null && Y.id ? (p = "consumer_group", delete s.consumer_group) : (w = s.certificate) != null && w.id ? (p = "certificate", delete s.certificate) : ($ = s.set) != null && $.id && (p = "set", delete s.set), r.value) {
|
|
2014
|
+
const O = t.subEntityType ? `${i.value}_${t.subEntityType}` : i.value;
|
|
2015
|
+
m += `resource "konnect_event_gateway_${O}" "my_eventgateway${O.replaceAll("_", "")}" {
|
|
2016
|
+
`, m += `${re}provider = konnect-beta
|
|
2017
|
+
`;
|
|
2018
|
+
} else if (i.value === _e.Plugin) {
|
|
2019
|
+
const O = t.credentialType.replace(/-/g, "_") || (s.name + "").replace(/-/g, "_");
|
|
2020
|
+
delete s.name, m += `resource "konnect_gateway_plugin_${O}" "my_${O}" {
|
|
2021
|
+
`;
|
|
2022
|
+
} else a.value ? (m += `resource "konnect_${i.value}" "my_${i.value}" {
|
|
2023
|
+
`, m += `${re}provider = konnect-beta
|
|
2024
|
+
`) : n.value || i.value === nt ? m += `resource "konnect_cloud_gateway_addon" "managed_cache" {
|
|
2025
|
+
` : m += `resource "konnect_gateway_${i.value}" "my_${i.value}" {
|
|
2026
|
+
`;
|
|
2027
|
+
return m += u(s), !r.value && !a.value && i.value !== nt ? m += `${re}control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
|
|
2028
|
+
` : p && (m += `${re}${p} = {
|
|
2029
|
+
`, m += `${re}${re}id = konnect_gateway_${p}.my_${p}.id
|
|
2030
|
+
`, m += `${re}}
|
|
2031
|
+
`), m += `}
|
|
2032
|
+
`, m;
|
|
2033
|
+
});
|
|
2034
|
+
return (s, h) => {
|
|
2035
|
+
const m = L("KCodeBlock");
|
|
2036
|
+
return f(), A("div", ha, [
|
|
2037
|
+
t.entityRecord ? (f(), E(m, {
|
|
2038
|
+
key: 0,
|
|
2039
|
+
id: "terraform-codeblock",
|
|
2040
|
+
code: v.value,
|
|
2041
|
+
language: "terraform",
|
|
2042
|
+
theme: "dark",
|
|
2043
|
+
onCodeBlockRender: g(Ke)
|
|
2044
|
+
}, null, 8, ["code", "onCodeBlockRender"])) : B("", !0)
|
|
2045
|
+
]);
|
|
2046
|
+
};
|
|
2047
|
+
}
|
|
2048
|
+
}), va = /* @__PURE__ */ ee({
|
|
2049
|
+
__name: "GeneratePatModal",
|
|
2050
|
+
props: {
|
|
2051
|
+
visible: { type: Boolean },
|
|
2052
|
+
generateKonnectPat: { type: Function }
|
|
2053
|
+
},
|
|
2054
|
+
emits: ["generated", "dismiss"],
|
|
2055
|
+
setup(e, { emit: t }) {
|
|
2056
|
+
const n = e, i = t, { i18n: { t: r } } = G.useI18n(), a = q(""), o = q("30"), l = q(!1), c = q(""), d = [
|
|
2057
|
+
{ value: "30", label: r("generatePatModal.fields.expiresAt.n_days", { n: 30 }) },
|
|
2058
|
+
{ value: "60", label: r("generatePatModal.fields.expiresAt.n_days", { n: 60 }) },
|
|
2059
|
+
{ value: "90", label: r("generatePatModal.fields.expiresAt.n_days", { n: 90 }) },
|
|
2060
|
+
{ value: "180", label: r("generatePatModal.fields.expiresAt.n_days", { n: 180 }) },
|
|
2061
|
+
{ value: "365", label: r("generatePatModal.fields.expiresAt.n_days", { n: 365 }) }
|
|
2062
|
+
], y = () => {
|
|
2063
|
+
i("dismiss");
|
|
2064
|
+
}, u = async () => {
|
|
2065
|
+
if (!a.value) return;
|
|
2066
|
+
c.value = "", l.value = !0;
|
|
2067
|
+
const v = /* @__PURE__ */ new Date();
|
|
2068
|
+
v.setDate(v.getDate() + Number(o.value));
|
|
2069
|
+
try {
|
|
2070
|
+
const s = await n.generateKonnectPat(a.value, v);
|
|
2071
|
+
i("generated", s);
|
|
2072
|
+
} catch (s) {
|
|
2073
|
+
console.error("Failed to create PAT:", s), c.value = s instanceof Error ? s.message : String(s);
|
|
2074
|
+
} finally {
|
|
2075
|
+
l.value = !1;
|
|
2076
|
+
}
|
|
2077
|
+
};
|
|
2078
|
+
return (v, s) => {
|
|
2079
|
+
const h = L("KInput"), m = L("KSelect"), p = L("KAlert"), b = L("KButton"), C = L("KModal");
|
|
2080
|
+
return f(), E(C, {
|
|
2081
|
+
class: "generate-pat-modal",
|
|
2082
|
+
"max-width": "640px",
|
|
2083
|
+
title: g(r)("generatePatModal.title"),
|
|
2084
|
+
visible: e.visible,
|
|
2085
|
+
onCancel: y,
|
|
2086
|
+
onProceed: u
|
|
2087
|
+
}, {
|
|
2088
|
+
"footer-actions": k(() => [
|
|
2089
|
+
K(b, {
|
|
2090
|
+
appearance: "tertiary",
|
|
2091
|
+
onClick: y
|
|
2092
|
+
}, {
|
|
2093
|
+
default: k(() => [
|
|
2094
|
+
P(S(g(r)("generatePatModal.actions.cancel")), 1)
|
|
2095
|
+
]),
|
|
2096
|
+
_: 1
|
|
2097
|
+
}),
|
|
2098
|
+
K(b, {
|
|
2099
|
+
appearance: "primary",
|
|
2100
|
+
disabled: !a.value || l.value,
|
|
2101
|
+
onClick: u
|
|
2102
|
+
}, {
|
|
2103
|
+
default: k(() => [
|
|
2104
|
+
P(S(l.value ? g(r)("generatePatModal.actions.generating") : g(r)("generatePatModal.actions.generate")), 1)
|
|
2105
|
+
]),
|
|
2106
|
+
_: 1
|
|
2107
|
+
}, 8, ["disabled"])
|
|
2108
|
+
]),
|
|
2109
|
+
default: k(() => [
|
|
2110
|
+
F("div", null, S(g(r)("generatePatModal.description")), 1),
|
|
2111
|
+
K(h, {
|
|
2112
|
+
modelValue: a.value,
|
|
2113
|
+
"onUpdate:modelValue": s[0] || (s[0] = (R) => a.value = R),
|
|
2114
|
+
label: g(r)("generatePatModal.fields.name.label"),
|
|
2115
|
+
placeholder: g(r)("generatePatModal.fields.name.placeholder"),
|
|
2116
|
+
required: ""
|
|
2117
|
+
}, null, 8, ["modelValue", "label", "placeholder"]),
|
|
2118
|
+
K(m, {
|
|
2119
|
+
modelValue: o.value,
|
|
2120
|
+
"onUpdate:modelValue": s[1] || (s[1] = (R) => o.value = R),
|
|
2121
|
+
items: d,
|
|
2122
|
+
label: g(r)("generatePatModal.fields.expiresAt.label"),
|
|
2123
|
+
placeholder: g(r)("generatePatModal.fields.expiresAt.placeholder"),
|
|
2124
|
+
required: ""
|
|
2125
|
+
}, null, 8, ["modelValue", "label", "placeholder"]),
|
|
2126
|
+
c.value ? (f(), E(p, {
|
|
2127
|
+
key: 0,
|
|
2128
|
+
appearance: "danger",
|
|
2129
|
+
message: c.value
|
|
2130
|
+
}, null, 8, ["message"])) : B("", !0)
|
|
2131
|
+
]),
|
|
2132
|
+
_: 1
|
|
2133
|
+
}, 8, ["title", "visible"]);
|
|
2134
|
+
};
|
|
2135
|
+
}
|
|
2136
|
+
}), ka = /* @__PURE__ */ se(va, [["__scopeId", "data-v-be3cd315"]]), ba = { class: "step-title" }, Ca = {
|
|
2137
|
+
key: 3,
|
|
2138
|
+
class: "konnect-pat-actions"
|
|
2139
|
+
}, xa = { class: "step-title" }, Aa = /* @__PURE__ */ ee({
|
|
2140
|
+
__name: "DeckCodeBlockInternal",
|
|
2141
|
+
props: {
|
|
2142
|
+
app: {},
|
|
2143
|
+
entityRecord: {},
|
|
2144
|
+
entityType: {},
|
|
2145
|
+
geoApiServerUrl: {},
|
|
2146
|
+
controlPlaneName: {},
|
|
2147
|
+
kongAdminApiUrl: {},
|
|
2148
|
+
workspace: {},
|
|
2149
|
+
isCustomizing: { type: Boolean },
|
|
2150
|
+
generateKonnectPat: { type: Function }
|
|
2151
|
+
},
|
|
2152
|
+
setup(e) {
|
|
2153
|
+
const t = jt(Jn, null), n = e;
|
|
2154
|
+
n.isCustomizing && !t && console.warn(Qn);
|
|
2155
|
+
const { i18n: i, i18nT: r } = G.useI18n(), { t: a } = i, o = q(""), l = q(""), c = q(!1), d = [
|
|
2156
|
+
{ value: "bash", label: "Linux / macOS Bash" },
|
|
2157
|
+
{ value: "powershell", label: "Windows PowerShell" }
|
|
2158
|
+
], y = q(navigator.userAgent.toLowerCase().includes("windows") ? "powershell" : "bash"), u = T(() => {
|
|
2159
|
+
const m = {
|
|
2160
|
+
_format_version: "3.0"
|
|
2161
|
+
};
|
|
2162
|
+
return n.controlPlaneName ? m._konnect = {
|
|
2163
|
+
control_plane_name: n.controlPlaneName
|
|
2164
|
+
} : n.workspace && (m._workspace = n.workspace), m;
|
|
2165
|
+
}), v = T(() => {
|
|
2166
|
+
var C, R, z, Y, w;
|
|
2167
|
+
const m = Object.fromEntries(Object.entries(n.entityRecord).filter(([, $]) => $ !== null && $ !== "" && (Array.isArray($) ? $.length !== 0 : !0)));
|
|
2168
|
+
n.entityType === _e.Plugin ? ((C = m.service) != null && C.id && (m.service = m.service.id), (R = m.route) != null && R.id && (m.route = m.route.id), (z = m.consumer) != null && z.id && (m.consumer = m.consumer.id), (Y = m.consumer_group) != null && Y.id && (m.consumer_group = m.consumer_group.id)) : n.entityType === _e.Key && (w = m.key_set) != null && w.id && (m.key_set = m.key_set.id);
|
|
2169
|
+
const p = n.entityType === _e.KeySet ? "key_sets" : n.entityType + "s", b = {
|
|
2170
|
+
...u.value,
|
|
2171
|
+
[p]: [m]
|
|
2172
|
+
};
|
|
2173
|
+
return Dn.dump(b, { quotingType: '"' }).trim();
|
|
2174
|
+
}), s = T(() => y.value === "bash" ? `export DECK_KONNECT_TOKEN='${o.value || "YOUR_KONNECT_PAT"}'` : `$env:DECK_KONNECT_TOKEN = "${o.value || "YOUR_KONNECT_PAT"}"`);
|
|
2175
|
+
function h(m) {
|
|
2176
|
+
o.value = m, c.value = !1;
|
|
2177
|
+
}
|
|
2178
|
+
return Hn(() => {
|
|
2179
|
+
let m = "deck gateway apply -";
|
|
2180
|
+
n.geoApiServerUrl ? m += ` --konnect-addr ${n.geoApiServerUrl}` : n.kongAdminApiUrl && (m += ` --kong-addr ${n.kongAdminApiUrl}`), y.value === "bash" ? l.value = `echo '
|
|
2181
|
+
${v.value}
|
|
2182
|
+
' | ${m}` : l.value = `@'
|
|
2183
|
+
${v.value}
|
|
2184
|
+
'@ | ${m}`;
|
|
2185
|
+
}), (m, p) => {
|
|
2186
|
+
const b = L("KSelect"), C = L("KBadge"), R = L("KCodeBlock"), z = L("KAlert"), Y = L("KButton");
|
|
2187
|
+
return f(), A(pe, null, [
|
|
2188
|
+
F("div", qe({ class: "deck-config config-card-code-block" }, m.$attrs), [
|
|
2189
|
+
K(b, {
|
|
2190
|
+
modelValue: y.value,
|
|
2191
|
+
"onUpdate:modelValue": p[0] || (p[0] = (w) => y.value = w),
|
|
2192
|
+
items: d
|
|
2193
|
+
}, {
|
|
2194
|
+
"item-template": k(({ item: w }) => [
|
|
2195
|
+
w.value === "powershell" ? (f(), E(g(kt), { key: 0 })) : (f(), E(g(bt), { key: 1 })),
|
|
2196
|
+
P(" " + S(w.label), 1)
|
|
2197
|
+
]),
|
|
2198
|
+
"selected-item-template": k(({ item: w }) => [
|
|
2199
|
+
w.value === "powershell" ? (f(), E(g(kt), { key: 0 })) : (f(), E(g(bt), { key: 1 })),
|
|
2200
|
+
P(" " + S(w.label), 1)
|
|
2201
|
+
]),
|
|
2202
|
+
_: 1
|
|
2203
|
+
}, 8, ["modelValue"]),
|
|
2204
|
+
F("div", ba, S(g(a)("deckCodeBlock.steps.step_1")), 1),
|
|
2205
|
+
e.isCustomizing ? B("", !0) : (f(), E(g(r), {
|
|
2206
|
+
key: 0,
|
|
2207
|
+
"data-testid": `deck-hint-${e.app}`,
|
|
2208
|
+
keypath: `deckCodeBlock.hint.${e.app}`,
|
|
2209
|
+
tag: "p"
|
|
2210
|
+
}, we({
|
|
2211
|
+
link: k(() => [
|
|
2212
|
+
K(g(ni), {
|
|
2213
|
+
href: e.app === "konnect" ? "https://developer.konghq.com/deck/get-started/" : "https://developer.konghq.com/deck/gateway/configuration/"
|
|
2214
|
+
}, {
|
|
2215
|
+
default: k(() => [
|
|
2216
|
+
P(S(g(i).t("deckCodeBlock.documentation")), 1)
|
|
2217
|
+
]),
|
|
2218
|
+
_: 1
|
|
2219
|
+
}, 8, ["href"])
|
|
2220
|
+
]),
|
|
2221
|
+
_: 2
|
|
2222
|
+
}, [
|
|
2223
|
+
e.app === "konnect" ? {
|
|
2224
|
+
name: "token",
|
|
2225
|
+
fn: k(() => [
|
|
2226
|
+
K(C, null, {
|
|
2227
|
+
default: k(() => [...p[4] || (p[4] = [
|
|
2228
|
+
P("DECK_KONNECT_TOKEN", -1)
|
|
2229
|
+
])]),
|
|
2230
|
+
_: 1
|
|
2231
|
+
})
|
|
2232
|
+
]),
|
|
2233
|
+
key: "0"
|
|
2234
|
+
} : void 0
|
|
2235
|
+
]), 1032, ["data-testid", "keypath"])),
|
|
2236
|
+
e.app === "konnect" ? (f(), E(R, {
|
|
2237
|
+
key: 1,
|
|
2238
|
+
id: "deck-env-codeblock",
|
|
2239
|
+
class: ue({ customization: n.isCustomizing }),
|
|
2240
|
+
code: s.value,
|
|
2241
|
+
language: y.value,
|
|
2242
|
+
"single-line": "",
|
|
2243
|
+
theme: e.isCustomizing ? "light" : "dark",
|
|
2244
|
+
onCodeBlockRender: g(Ke)
|
|
2245
|
+
}, null, 8, ["class", "code", "language", "theme", "onCodeBlockRender"])) : B("", !0),
|
|
2246
|
+
o.value ? (f(), E(z, {
|
|
2247
|
+
key: 2,
|
|
2248
|
+
class: "copy-konnect-pat-alert"
|
|
2249
|
+
}, {
|
|
2250
|
+
default: k(() => [
|
|
2251
|
+
P(S(g(a)("deckCodeBlock.customization.copy_pat")), 1)
|
|
2252
|
+
]),
|
|
2253
|
+
_: 1
|
|
2254
|
+
})) : n.isCustomizing && n.generateKonnectPat ? (f(), A("div", Ca, [
|
|
2255
|
+
K(Y, {
|
|
2256
|
+
appearance: "secondary",
|
|
2257
|
+
onClick: p[1] || (p[1] = (w) => c.value = !0)
|
|
2258
|
+
}, {
|
|
2259
|
+
default: k(() => [
|
|
2260
|
+
P(S(g(a)("deckCodeBlock.customization.generate_pat")), 1)
|
|
2261
|
+
]),
|
|
2262
|
+
_: 1
|
|
2263
|
+
}),
|
|
2264
|
+
F("div", null, S(g(a)("deckCodeBlock.customization.reuse_pat")), 1)
|
|
2265
|
+
])) : B("", !0),
|
|
2266
|
+
F("div", xa, S(g(a)("deckCodeBlock.steps.step_2")), 1),
|
|
2267
|
+
n.entityRecord && !n.isCustomizing ? (f(), E(R, {
|
|
2268
|
+
key: 4,
|
|
2269
|
+
id: "deck-codeblock",
|
|
2270
|
+
class: ue({ customization: n.isCustomizing }),
|
|
2271
|
+
code: l.value,
|
|
2272
|
+
language: y.value,
|
|
2273
|
+
theme: e.isCustomizing ? "light" : "dark",
|
|
2274
|
+
onCodeBlockRender: g(Ke)
|
|
2275
|
+
}, null, 8, ["class", "code", "language", "theme", "onCodeBlockRender"])) : n.entityRecord && n.isCustomizing && g(t) ? (f(), E(je(g(t)), {
|
|
2276
|
+
key: 5,
|
|
2277
|
+
modelValue: l.value,
|
|
2278
|
+
"onUpdate:modelValue": p[2] || (p[2] = (w) => l.value = w),
|
|
2279
|
+
language: y.value
|
|
2280
|
+
}, null, 8, ["modelValue", "language"])) : B("", !0),
|
|
2281
|
+
n.isCustomizing ? (f(), E(z, {
|
|
2282
|
+
key: 6,
|
|
2283
|
+
class: "customization-footer-reminder"
|
|
2284
|
+
}, {
|
|
2285
|
+
icon: k(() => [
|
|
2286
|
+
K(g(mi))
|
|
2287
|
+
]),
|
|
2288
|
+
default: k(() => [
|
|
2289
|
+
P(" " + S(g(a)("deckCodeBlock.customization.footer_reminder")), 1)
|
|
2290
|
+
]),
|
|
2291
|
+
_: 1
|
|
2292
|
+
})) : B("", !0)
|
|
2293
|
+
], 16),
|
|
2294
|
+
n.isCustomizing && n.generateKonnectPat ? (f(), E(ka, {
|
|
2295
|
+
key: 0,
|
|
2296
|
+
"generate-konnect-pat": n.generateKonnectPat,
|
|
2297
|
+
visible: c.value,
|
|
2298
|
+
onDismiss: p[3] || (p[3] = (w) => c.value = !1),
|
|
2299
|
+
onGenerated: h
|
|
2300
|
+
}, null, 8, ["generate-konnect-pat", "visible"])) : B("", !0)
|
|
2301
|
+
], 64);
|
|
2302
|
+
};
|
|
2303
|
+
}
|
|
2304
|
+
}), Nt = /* @__PURE__ */ se(Aa, [["__scopeId", "data-v-54396b4c"]]), Mn = /* @__PURE__ */ ee({
|
|
2305
|
+
inheritAttrs: !1,
|
|
2306
|
+
__name: "DeckCodeBlock",
|
|
2307
|
+
props: {
|
|
2308
|
+
app: {},
|
|
2309
|
+
entityRecord: {},
|
|
2310
|
+
entityType: {},
|
|
2311
|
+
geoApiServerUrl: {},
|
|
2312
|
+
controlPlaneName: {},
|
|
2313
|
+
kongAdminApiUrl: {},
|
|
2314
|
+
workspace: {},
|
|
2315
|
+
customizationOptions: { type: [Boolean, Object] },
|
|
2316
|
+
isCustomizationModalVisible: { type: Boolean }
|
|
2317
|
+
},
|
|
2318
|
+
emits: ["customization-close"],
|
|
2319
|
+
setup(e) {
|
|
2320
|
+
const t = e, { i18n: { t: n } } = G.useI18n(), i = T(() => {
|
|
2321
|
+
if (t.app === "konnect" && t.customizationOptions && typeof t.customizationOptions != "boolean")
|
|
2322
|
+
return t.customizationOptions.generateKonnectPat;
|
|
2323
|
+
});
|
|
2324
|
+
return (r, a) => {
|
|
2325
|
+
const o = L("KModal");
|
|
2326
|
+
return f(), A(pe, null, [
|
|
2327
|
+
t.entityRecord ? (f(), E(Nt, qe({ key: 0 }, r.$attrs, {
|
|
2328
|
+
app: t.app,
|
|
2329
|
+
"control-plane-name": t.app === "konnect" ? t.controlPlaneName : void 0,
|
|
2330
|
+
"entity-record": t.entityRecord,
|
|
2331
|
+
"entity-type": t.entityType,
|
|
2332
|
+
"geo-api-server-url": t.app === "konnect" ? t.geoApiServerUrl : void 0,
|
|
2333
|
+
"kong-admin-api-url": t.app === "kongManager" ? t.kongAdminApiUrl : void 0,
|
|
2334
|
+
workspace: t.app === "kongManager" ? t.workspace : void 0
|
|
2335
|
+
}), null, 16, ["app", "control-plane-name", "entity-record", "entity-type", "geo-api-server-url", "kong-admin-api-url", "workspace"])) : B("", !0),
|
|
2336
|
+
t.entityRecord ? (f(), E(o, {
|
|
2337
|
+
key: 1,
|
|
2338
|
+
"action-button-appearance": "tertiary",
|
|
2339
|
+
"action-button-text": g(n)("baseConfigCard.actions.deck_customize_cancel"),
|
|
2340
|
+
"hide-cancel-button": "",
|
|
2341
|
+
"max-width": "640px",
|
|
2342
|
+
title: g(n)("deckCodeBlock.customization.title"),
|
|
2343
|
+
visible: t.isCustomizationModalVisible,
|
|
2344
|
+
onCancel: a[0] || (a[0] = (l) => r.$emit("customization-close")),
|
|
2345
|
+
onProceed: a[1] || (a[1] = (l) => r.$emit("customization-close"))
|
|
2346
|
+
}, {
|
|
2347
|
+
default: k(() => [
|
|
2348
|
+
K(Nt, {
|
|
2349
|
+
app: t.app,
|
|
2350
|
+
"control-plane-name": t.app === "konnect" ? t.controlPlaneName : void 0,
|
|
2351
|
+
"entity-record": t.entityRecord,
|
|
2352
|
+
"entity-type": t.entityType,
|
|
2353
|
+
"generate-konnect-pat": i.value,
|
|
2354
|
+
"geo-api-server-url": t.app === "konnect" ? t.geoApiServerUrl : void 0,
|
|
2355
|
+
"is-customizing": "",
|
|
2356
|
+
"kong-admin-api-url": t.app === "kongManager" ? t.kongAdminApiUrl : void 0,
|
|
2357
|
+
workspace: t.app === "kongManager" ? t.workspace : void 0
|
|
2358
|
+
}, null, 8, ["app", "control-plane-name", "entity-record", "entity-type", "generate-konnect-pat", "geo-api-server-url", "kong-admin-api-url", "workspace"])
|
|
2359
|
+
]),
|
|
2360
|
+
_: 1
|
|
2361
|
+
}, 8, ["action-button-text", "title", "visible"])) : B("", !0)
|
|
2362
|
+
], 64);
|
|
2363
|
+
};
|
|
2364
|
+
}
|
|
2365
|
+
}), Sa = {
|
|
2366
|
+
key: 0,
|
|
2367
|
+
class: "config-card-display-form"
|
|
2368
|
+
}, _a = ["data-testid"], Ta = {
|
|
2369
|
+
key: 0,
|
|
2370
|
+
class: "config-card-prop-section-title"
|
|
2371
|
+
}, wa = /* @__PURE__ */ ee({
|
|
2372
|
+
__name: "ConfigCardDisplay",
|
|
2373
|
+
props: {
|
|
2374
|
+
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
2375
|
+
config: {
|
|
2376
|
+
type: Object,
|
|
2377
|
+
required: !1,
|
|
2378
|
+
default: () => ({})
|
|
2379
|
+
},
|
|
2380
|
+
entityType: {
|
|
2381
|
+
type: String,
|
|
2382
|
+
required: !0,
|
|
2383
|
+
validator: (e) => Je.includes(e)
|
|
2384
|
+
},
|
|
2385
|
+
subEntityType: {
|
|
2386
|
+
// only for event gateway entities
|
|
2387
|
+
type: String,
|
|
2388
|
+
default: ""
|
|
2389
|
+
},
|
|
2390
|
+
propertyCollections: {
|
|
2391
|
+
type: Object,
|
|
2392
|
+
required: !1,
|
|
2393
|
+
default: () => null
|
|
2394
|
+
},
|
|
2395
|
+
format: {
|
|
2396
|
+
type: String,
|
|
2397
|
+
required: !1,
|
|
2398
|
+
default: "structured",
|
|
2399
|
+
validator: (e) => Xn.includes(e)
|
|
2400
|
+
},
|
|
2401
|
+
propListTypes: {
|
|
2402
|
+
type: Array,
|
|
2403
|
+
required: !1,
|
|
2404
|
+
default: () => []
|
|
2405
|
+
},
|
|
2406
|
+
/** A record to indicate the entity's configuration, used to populate the JSON/YAML code blocks */
|
|
2407
|
+
record: {
|
|
2408
|
+
type: Object,
|
|
2409
|
+
required: !1,
|
|
2410
|
+
default: () => ({})
|
|
2411
|
+
},
|
|
2412
|
+
/**
|
|
2413
|
+
* When set, JSON/YAML/TR/deck code blocks use this record instead of `record`
|
|
2414
|
+
*/
|
|
2415
|
+
codeBlockRecord: {
|
|
2416
|
+
type: Object,
|
|
2417
|
+
default: void 0
|
|
2418
|
+
},
|
|
2419
|
+
/**
|
|
2420
|
+
* When false/default, strip created_at/ updated_at per KHCP-9837
|
|
2421
|
+
* Set true to show full payloads
|
|
2422
|
+
*/
|
|
2423
|
+
preserveCodeBlockTimestamps: {
|
|
2424
|
+
type: Boolean,
|
|
2425
|
+
default: !1
|
|
2426
|
+
},
|
|
2427
|
+
/** Fetcher url for the entity with the filled-in controlPlaneId, workspace, and entity id. */
|
|
2428
|
+
fetcherUrl: {
|
|
2429
|
+
type: String,
|
|
2430
|
+
required: !1,
|
|
2431
|
+
default: ""
|
|
2432
|
+
},
|
|
2433
|
+
/**
|
|
2434
|
+
* A function to format the entity record before displaying it in the code block.
|
|
2435
|
+
*/
|
|
2436
|
+
codeBlockRecordFormatter: {
|
|
2437
|
+
type: Function,
|
|
2438
|
+
required: !1,
|
|
2439
|
+
default: (e) => e
|
|
2440
|
+
},
|
|
2441
|
+
isDeckCustomizationVisible: {
|
|
2442
|
+
type: Boolean,
|
|
2443
|
+
required: !1,
|
|
2444
|
+
default: !1
|
|
2445
|
+
}
|
|
2446
|
+
},
|
|
2447
|
+
emits: ["deck-customization:close", "request-deck-format"],
|
|
2448
|
+
setup(e) {
|
|
2449
|
+
const t = e, n = Ue(), { i18n: { t: i } } = G.useI18n(), r = (u) => !!(u.tooltip || n[`${u.key}-label-tooltip`]), a = T(
|
|
2450
|
+
() => t.codeBlockRecord !== void 0 ? t.codeBlockRecord : t.record
|
|
2451
|
+
), o = T(() => {
|
|
2452
|
+
let u = a.value;
|
|
2453
|
+
if (u == null)
|
|
2454
|
+
return;
|
|
2455
|
+
t.codeBlockRecordFormatter && (u = t.codeBlockRecordFormatter(u, t.format));
|
|
2456
|
+
const v = JSON.parse(JSON.stringify(u));
|
|
2457
|
+
return t.preserveCodeBlockTimestamps || (delete v.created_at, delete v.updated_at), v;
|
|
2458
|
+
}), l = T(() => t.fetcherUrl.replace(/(\?|&)__ui_data=true/, "")), {
|
|
2459
|
+
isDeckEnabled: c,
|
|
2460
|
+
deckCustomizationOptions: d,
|
|
2461
|
+
deckCalloutPreferenceKey: y
|
|
2462
|
+
} = G.useBaseEntityDeckOptions(
|
|
2463
|
+
() => t.config,
|
|
2464
|
+
() => t.entityType
|
|
2465
|
+
);
|
|
2466
|
+
return (u, v) => (f(), A(pe, null, [
|
|
2467
|
+
e.format === "structured" ? (f(), A("div", Sa, [
|
|
2468
|
+
(f(!0), A(pe, null, he(e.propListTypes, (s) => (f(), A("div", {
|
|
2469
|
+
key: `config-card-details-${s}-props`,
|
|
2470
|
+
class: ue(`config-card-details-${s}-props`),
|
|
2471
|
+
"data-testid": `config-card-details-${s}-props`
|
|
2472
|
+
}, [
|
|
2473
|
+
s !== "basic" ? (f(), A("div", Ta, S(s === "advanced" ? g(i)("baseConfigCard.sections.advanced") : s === "plugin" ? g(i)("baseConfigCard.sections.plugin") : g(i)("baseConfigCard.sections.policy")), 1)) : B("", !0),
|
|
2474
|
+
(f(!0), A(pe, null, he(e.propertyCollections[s], (h) => M(u.$slots, `config-card-item-${h.key}`, { row: h }, () => [
|
|
2475
|
+
(f(), E(Vt, {
|
|
2476
|
+
key: h.key,
|
|
2477
|
+
item: h
|
|
2478
|
+
}, we({
|
|
2479
|
+
label: k(() => [
|
|
2480
|
+
M(u.$slots, `${h.key}-label`, { row: h }, void 0, !0)
|
|
2481
|
+
]),
|
|
2482
|
+
[h.key]: k(({ rowValue: m }) => [
|
|
2483
|
+
M(u.$slots, h.key, {
|
|
2484
|
+
row: h,
|
|
2485
|
+
rowValue: m
|
|
2486
|
+
}, void 0, !0)
|
|
2487
|
+
]),
|
|
2488
|
+
_: 2
|
|
2489
|
+
}, [
|
|
2490
|
+
r(h) ? {
|
|
2491
|
+
name: "label-tooltip",
|
|
2492
|
+
fn: k(() => [
|
|
2493
|
+
M(u.$slots, `${h.key}-label-tooltip`, { row: h }, void 0, !0)
|
|
2494
|
+
]),
|
|
2495
|
+
key: "0"
|
|
2496
|
+
} : void 0
|
|
2497
|
+
]), 1032, ["item"]))
|
|
2498
|
+
], !0)), 256))
|
|
2499
|
+
], 10, _a))), 128))
|
|
2500
|
+
])) : B("", !0),
|
|
2501
|
+
e.format === "json" && o.value ? (f(), E(Yt, {
|
|
2502
|
+
key: 1,
|
|
2503
|
+
config: t.config,
|
|
2504
|
+
"entity-record": o.value,
|
|
2505
|
+
"fetcher-url": l.value,
|
|
2506
|
+
"request-method": "get"
|
|
2507
|
+
}, null, 8, ["config", "entity-record", "fetcher-url"])) : B("", !0),
|
|
2508
|
+
e.format === "yaml" && o.value ? (f(), E(Nn, {
|
|
2509
|
+
key: 2,
|
|
2510
|
+
"deck-callout-preference-key": g(c) ? g(y) : void 0,
|
|
2511
|
+
"entity-record": o.value,
|
|
2512
|
+
"onDeckCallout:clickCta": v[0] || (v[0] = (s) => u.$emit("request-deck-format"))
|
|
2513
|
+
}, null, 8, ["deck-callout-preference-key", "entity-record"])) : B("", !0),
|
|
2514
|
+
e.format === "terraform" && o.value ? (f(), E(Pn, {
|
|
2515
|
+
key: 3,
|
|
2516
|
+
"entity-record": o.value,
|
|
2517
|
+
"entity-type": t.entityType,
|
|
2518
|
+
"sub-entity-type": t.subEntityType
|
|
2519
|
+
}, null, 8, ["entity-record", "entity-type", "sub-entity-type"])) : B("", !0),
|
|
2520
|
+
e.format === "deck" && o.value ? (f(), E(Mn, {
|
|
2521
|
+
key: 4,
|
|
2522
|
+
app: e.config.app,
|
|
2523
|
+
"control-plane-name": e.config.app === "konnect" ? e.config.controlPlaneName : void 0,
|
|
2524
|
+
"customization-options": g(d),
|
|
2525
|
+
"entity-record": o.value,
|
|
2526
|
+
"entity-type": t.entityType,
|
|
2527
|
+
"geo-api-server-url": e.config.app === "konnect" ? e.config.geoApiServerUrl : void 0,
|
|
2528
|
+
"is-customization-modal-visible": e.isDeckCustomizationVisible,
|
|
2529
|
+
"kong-admin-api-url": e.config.app === "kongManager" ? e.config.apiBaseUrl : void 0,
|
|
2530
|
+
workspace: e.config.app === "kongManager" ? e.config.workspace : void 0,
|
|
2531
|
+
onCustomizationClose: v[1] || (v[1] = (s) => u.$emit("deck-customization:close"))
|
|
2532
|
+
}, null, 8, ["app", "control-plane-name", "customization-options", "entity-record", "entity-type", "geo-api-server-url", "is-customization-modal-visible", "kong-admin-api-url", "workspace"])) : B("", !0)
|
|
2533
|
+
], 64));
|
|
2534
|
+
}
|
|
2535
|
+
}), $a = /* @__PURE__ */ se(wa, [["__scopeId", "data-v-473655ad"]]), Ea = {
|
|
2536
|
+
class: "config-card-title",
|
|
2537
|
+
"data-testid": "config-card-title"
|
|
2538
|
+
}, Ia = { class: "config-card-actions" }, Fa = ["href"], Oa = { class: "config-card-details-section" }, Ba = {
|
|
2539
|
+
key: 0,
|
|
2540
|
+
class: "config-card-details-after"
|
|
2541
|
+
}, Ka = /* @__PURE__ */ ee({
|
|
2542
|
+
__name: "EntityBaseConfigCard",
|
|
2543
|
+
props: {
|
|
2544
|
+
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
2545
|
+
config: {
|
|
2546
|
+
type: Object,
|
|
2547
|
+
required: !0,
|
|
2548
|
+
validator: (e) => !(!e || !["konnect", "kongManager"].includes(e == null ? void 0 : e.app) || e.app === "konnect" && !e.controlPlaneId || e.app === "kongManager" && typeof e.workspace != "string" || !e.entityId)
|
|
2549
|
+
},
|
|
2550
|
+
/** Schema to configure display of fields */
|
|
2551
|
+
configSchema: {
|
|
2552
|
+
type: Object,
|
|
2553
|
+
required: !1,
|
|
2554
|
+
default: () => ({})
|
|
2555
|
+
},
|
|
2556
|
+
/**
|
|
2557
|
+
* Entity type, required to generate terraform code
|
|
2558
|
+
*/
|
|
2559
|
+
entityType: {
|
|
2560
|
+
type: String,
|
|
2561
|
+
required: !0,
|
|
2562
|
+
validator: (e) => Je.includes(e)
|
|
2563
|
+
},
|
|
2564
|
+
/**
|
|
2565
|
+
* Sub Entity type, required to generate terraform code for event gateway entities
|
|
2566
|
+
*/
|
|
2567
|
+
subEntityType: {
|
|
2568
|
+
type: String,
|
|
2569
|
+
default: ""
|
|
2570
|
+
},
|
|
2571
|
+
/** Record key that contains the plugin configuration */
|
|
2572
|
+
pluginConfigKey: {
|
|
2573
|
+
type: String,
|
|
2574
|
+
required: !1,
|
|
2575
|
+
default: ""
|
|
2576
|
+
},
|
|
2577
|
+
/** Configuration schema for the plugin configuration section */
|
|
2578
|
+
pluginConfigSchema: {
|
|
2579
|
+
type: Object,
|
|
2580
|
+
required: !1,
|
|
2581
|
+
default: () => ({})
|
|
2582
|
+
},
|
|
2583
|
+
/** Record key that contains the policy configuration */
|
|
2584
|
+
policyConfigKey: {
|
|
2585
|
+
type: String,
|
|
2586
|
+
required: !1,
|
|
2587
|
+
default: ""
|
|
2588
|
+
},
|
|
2589
|
+
/** Configuration schema for the policy configuration section */
|
|
2590
|
+
policyConfigSchema: {
|
|
2591
|
+
type: Object,
|
|
2592
|
+
required: !1,
|
|
2593
|
+
default: () => ({})
|
|
2594
|
+
},
|
|
2595
|
+
/**
|
|
2596
|
+
* Fetch url for the item to display configuration for.
|
|
2597
|
+
* We will handle the replacement of {controlPlaneId}, {workspace}, and {id}.
|
|
2598
|
+
* Value should NOT contain config.apiBaseUrl, as we auto include this. Typically this will just an entry from
|
|
2599
|
+
* the endpoints file.
|
|
2600
|
+
*
|
|
2601
|
+
* ex. `/v2/control-planes/{controlPlaneId}/core-entities/snis/{id}`
|
|
2602
|
+
*/
|
|
2603
|
+
fetchUrl: {
|
|
2604
|
+
type: String,
|
|
2605
|
+
required: !0
|
|
2606
|
+
},
|
|
2607
|
+
/**
|
|
2608
|
+
* Optional key to use to access the record from fetched response.data
|
|
2609
|
+
* If not provided, response.data will be used.
|
|
2610
|
+
*/
|
|
2611
|
+
dataKey: {
|
|
2612
|
+
type: String,
|
|
2613
|
+
required: !1,
|
|
2614
|
+
default: ""
|
|
2615
|
+
},
|
|
2616
|
+
/**
|
|
2617
|
+
* Function to resolve the record from the fetched response.
|
|
2618
|
+
* This prop only works if dataKey is not provided.
|
|
2619
|
+
*/
|
|
2620
|
+
recordResolver: {
|
|
2621
|
+
type: Function,
|
|
2622
|
+
required: !1,
|
|
2623
|
+
default: (e) => e
|
|
2624
|
+
},
|
|
2625
|
+
/**
|
|
2626
|
+
* A function to format the entity record before displaying it in the code block.
|
|
2627
|
+
*/
|
|
2628
|
+
codeBlockRecordFormatter: {
|
|
2629
|
+
type: Function,
|
|
2630
|
+
required: !1,
|
|
2631
|
+
default: (e) => e
|
|
2632
|
+
},
|
|
2633
|
+
/**
|
|
2634
|
+
* JSON tab show the same nested shape the GET returned
|
|
2635
|
+
*/
|
|
2636
|
+
codeBlockRecordResolver: {
|
|
2637
|
+
type: Function,
|
|
2638
|
+
required: !1,
|
|
2639
|
+
default: void 0
|
|
2640
|
+
},
|
|
2641
|
+
/**
|
|
2642
|
+
* When true, code blocks keep `created_at`/ `updated_at` (default strips them per KHCP-9837)
|
|
2643
|
+
*/
|
|
2644
|
+
preserveCodeBlockTimestamps: {
|
|
2645
|
+
type: Boolean,
|
|
2646
|
+
required: !1,
|
|
2647
|
+
default: !1
|
|
2648
|
+
},
|
|
2649
|
+
/**
|
|
2650
|
+
* Boolean to control card title visibility.
|
|
2651
|
+
*/
|
|
2652
|
+
hideTitle: {
|
|
2653
|
+
type: Boolean,
|
|
2654
|
+
default: !1
|
|
2655
|
+
},
|
|
2656
|
+
/**
|
|
2657
|
+
* The label text to show for the select Format element
|
|
2658
|
+
*/
|
|
2659
|
+
label: {
|
|
2660
|
+
type: String,
|
|
2661
|
+
default: "Format: ",
|
|
2662
|
+
required: !1
|
|
2663
|
+
},
|
|
2664
|
+
/**
|
|
2665
|
+
* External link for documentation
|
|
2666
|
+
*/
|
|
2667
|
+
configCardDoc: {
|
|
2668
|
+
type: String,
|
|
2669
|
+
default: "",
|
|
2670
|
+
required: !1
|
|
2671
|
+
},
|
|
2672
|
+
titleTag: {
|
|
2673
|
+
type: String,
|
|
2674
|
+
default: "h2"
|
|
2675
|
+
},
|
|
2676
|
+
/**
|
|
2677
|
+
* Hide entries from the Format dropdown (eg. ['yaml']). Structured view is always shown
|
|
2678
|
+
*/
|
|
2679
|
+
formatsToHide: {
|
|
2680
|
+
type: Array,
|
|
2681
|
+
required: !1,
|
|
2682
|
+
default: () => []
|
|
2683
|
+
}
|
|
2684
|
+
},
|
|
2685
|
+
emits: ["loading", "fetch:success", "fetch:error", "configFormatChange"],
|
|
2686
|
+
setup(e, { emit: t }) {
|
|
2687
|
+
var Se;
|
|
2688
|
+
const n = t, i = e, r = /* @__PURE__ */ new Set(["after-fields"]), { i18n: { t: a } } = G.useI18n(), { getMessageFromError: o } = G.useErrors(), { convertKeyToTitle: l } = G.useStringHelpers();
|
|
2689
|
+
G.useSubSchema(i.pluginConfigKey);
|
|
2690
|
+
const { axiosInstance: c } = G.useAxios((Se = i.config) == null ? void 0 : Se.axiosRequestConfig), d = Ue(), y = q(!1), u = T(
|
|
2691
|
+
() => Object.keys(d).filter((x) => !r.has(x))
|
|
2692
|
+
), v = T(() => !!d["after-fields"]), {
|
|
2693
|
+
isDeckEnabled: s,
|
|
2694
|
+
deckCustomizationOptions: h
|
|
2695
|
+
} = G.useBaseEntityDeckOptions(
|
|
2696
|
+
() => i.config,
|
|
2697
|
+
() => i.entityType
|
|
2698
|
+
), m = T(() => {
|
|
2699
|
+
const x = [
|
|
2700
|
+
{
|
|
2701
|
+
label: a("baseConfigCard.general.structuredFormat"),
|
|
2702
|
+
value: "structured",
|
|
2703
|
+
selected: !0
|
|
2704
|
+
},
|
|
2705
|
+
{
|
|
2706
|
+
label: a("baseForm.configuration.json"),
|
|
2707
|
+
value: "json"
|
|
2708
|
+
},
|
|
2709
|
+
{
|
|
2710
|
+
label: a("baseForm.configuration.yaml"),
|
|
2711
|
+
value: "yaml"
|
|
2712
|
+
}
|
|
2713
|
+
];
|
|
2714
|
+
i.config.app === "konnect" && x.splice(2, 0, {
|
|
2715
|
+
label: a("baseForm.configuration.terraform"),
|
|
2716
|
+
value: "terraform"
|
|
2717
|
+
}), s.value && x.push({
|
|
2718
|
+
label: a("baseForm.configuration.deck"),
|
|
2719
|
+
value: "deck"
|
|
2720
|
+
});
|
|
2721
|
+
const U = new Set(i.formatsToHide);
|
|
2722
|
+
return x.filter((Q) => Q.value === "structured" || !U.has(Q.value));
|
|
2723
|
+
}), p = q("structured"), b = (x) => {
|
|
2724
|
+
p.value = x == null ? void 0 : x.value, n("configFormatChange", p.value);
|
|
2725
|
+
}, C = (x, U) => {
|
|
2726
|
+
localStorage.setItem(x, U);
|
|
2727
|
+
};
|
|
2728
|
+
Ce(p, (x) => {
|
|
2729
|
+
i.config.formatPreferenceKey && C(i.config.formatPreferenceKey, x);
|
|
2730
|
+
}), ct(() => {
|
|
2731
|
+
var x;
|
|
2732
|
+
if (i.config.formatPreferenceKey) {
|
|
2733
|
+
const U = localStorage.getItem(i.config.formatPreferenceKey), Q = m.value;
|
|
2734
|
+
U && Q.some((X) => X.value === U) ? p.value = U : p.value = ((x = Q[0]) == null ? void 0 : x.value) ?? "structured", C(i.config.formatPreferenceKey, p.value);
|
|
2735
|
+
}
|
|
2736
|
+
});
|
|
2737
|
+
const R = {
|
|
2738
|
+
id: {
|
|
2739
|
+
type: Z.ID,
|
|
2740
|
+
label: a("baseConfigCard.commonFields.id_label"),
|
|
2741
|
+
order: 0,
|
|
2742
|
+
section: me.Basic
|
|
2743
|
+
},
|
|
2744
|
+
name: {
|
|
2745
|
+
order: 1,
|
|
2746
|
+
section: me.Basic
|
|
2747
|
+
},
|
|
2748
|
+
enabled: {
|
|
2749
|
+
type: Z.BadgeStatus,
|
|
2750
|
+
order: 2,
|
|
2751
|
+
section: me.Basic
|
|
2752
|
+
},
|
|
2753
|
+
updated_at: {
|
|
2754
|
+
type: Z.Date,
|
|
2755
|
+
label: a("baseConfigCard.commonFields.updated_at_label"),
|
|
2756
|
+
order: 3,
|
|
2757
|
+
section: me.Basic
|
|
2758
|
+
},
|
|
2759
|
+
created_at: {
|
|
2760
|
+
type: Z.Date,
|
|
2761
|
+
label: a("baseConfigCard.commonFields.created_at_label"),
|
|
2762
|
+
order: 4,
|
|
2763
|
+
section: me.Basic
|
|
2764
|
+
},
|
|
2765
|
+
tags: {
|
|
2766
|
+
type: Z.BadgeTag,
|
|
2767
|
+
order: -1,
|
|
2768
|
+
// the last property displayed
|
|
2769
|
+
section: me.Basic
|
|
2770
|
+
},
|
|
2771
|
+
partials: {
|
|
2772
|
+
type: Z.LinkInternal,
|
|
2773
|
+
label: a("baseConfigCard.commonFields.partial_label"),
|
|
2774
|
+
order: -1,
|
|
2775
|
+
// the last property displayed
|
|
2776
|
+
section: me.Basic
|
|
2777
|
+
}
|
|
2778
|
+
}, z = q(!1), Y = q(!1), w = q(""), $ = q({}), O = q(null), _ = T(() => {
|
|
2779
|
+
if (!(!i.codeBlockRecordResolver || O.value == null))
|
|
2780
|
+
return i.codeBlockRecordResolver(O.value);
|
|
2781
|
+
}), j = T(() => {
|
|
2782
|
+
var Q, X, ge;
|
|
2783
|
+
if (!$.value)
|
|
2784
|
+
return [];
|
|
2785
|
+
const x = [], U = Object.keys($.value).length;
|
|
2786
|
+
for (const V in $.value) {
|
|
2787
|
+
if (V === "__ui_data") continue;
|
|
2788
|
+
const N = (X = (Q = i.configSchema) == null ? void 0 : Q[V]) == null ? void 0 : X.order, ne = (ge = R[V]) == null ? void 0 : ge.order;
|
|
2789
|
+
let W = U;
|
|
2790
|
+
(ne || ne === 0) && (W = ne === -1 ? U + 1 : ne), N && (W = N === -1 ? U + 1 : N), x.push([V, W]);
|
|
2791
|
+
}
|
|
2792
|
+
return x.sort(function(V, N) {
|
|
2793
|
+
return V[1] - N[1];
|
|
2794
|
+
}), x.map((V) => {
|
|
2795
|
+
var gt, ht;
|
|
2796
|
+
const N = V[0], ne = (gt = $.value) == null ? void 0 : gt[N], W = ((ht = i.configSchema) == null ? void 0 : ht[N]) || {}, ie = R[N];
|
|
2797
|
+
return {
|
|
2798
|
+
key: N,
|
|
2799
|
+
value: ne,
|
|
2800
|
+
hidden: W.hidden || !1,
|
|
2801
|
+
type: W.type ?? ((ie == null ? void 0 : ie.type) || Z.Text),
|
|
2802
|
+
label: W.label ?? ((ie == null ? void 0 : ie.label) || l(N)),
|
|
2803
|
+
tooltip: W.tooltip ?? ((ie == null ? void 0 : ie.tooltip) || void 0),
|
|
2804
|
+
section: W.section ?? ((ie == null ? void 0 : ie.section) || me.Advanced)
|
|
2805
|
+
};
|
|
2806
|
+
}).filter((V) => !V.hidden && V.key !== i.pluginConfigKey);
|
|
2807
|
+
}), D = T(() => {
|
|
2808
|
+
var X, ge;
|
|
2809
|
+
if (!$.value || !i.pluginConfigKey)
|
|
2810
|
+
return [];
|
|
2811
|
+
const x = $.value[i.pluginConfigKey] || {}, U = Object.keys(x).length, Q = [];
|
|
2812
|
+
for (const V in x) {
|
|
2813
|
+
const N = (ge = (X = i.pluginConfigSchema) == null ? void 0 : X[V]) == null ? void 0 : ge.order, ne = x[V];
|
|
2814
|
+
let W = ne != null && ne !== "" ? U - 1 : U;
|
|
2815
|
+
N && (W = N === -1 ? U + 1 : N), Q.push([V, W]);
|
|
2816
|
+
}
|
|
2817
|
+
return Q.sort(function(V, N) {
|
|
2818
|
+
return V[1] - N[1];
|
|
2819
|
+
}), Q.map((V) => {
|
|
2820
|
+
var ie;
|
|
2821
|
+
const N = V[0], ne = x[N], W = ((ie = i.pluginConfigSchema) == null ? void 0 : ie[N]) || {};
|
|
2822
|
+
return {
|
|
2823
|
+
key: N,
|
|
2824
|
+
value: ne,
|
|
2825
|
+
hidden: W.hidden || !1,
|
|
2826
|
+
type: W.type ?? Z.Text,
|
|
2827
|
+
label: W.label ?? l(N),
|
|
2828
|
+
tooltip: W.tooltip ?? void 0,
|
|
2829
|
+
section: me.Plugin
|
|
2830
|
+
};
|
|
2831
|
+
}).filter((V) => !V.hidden);
|
|
2832
|
+
}), J = T(() => {
|
|
2833
|
+
var X, ge;
|
|
2834
|
+
if (!$.value || !i.policyConfigKey)
|
|
2835
|
+
return [];
|
|
2836
|
+
const x = $.value[i.policyConfigKey] || {}, U = Object.keys(x).length, Q = [];
|
|
2837
|
+
for (const V in x) {
|
|
2838
|
+
const N = (ge = (X = i.policyConfigSchema) == null ? void 0 : X[V]) == null ? void 0 : ge.order, ne = x[V];
|
|
2839
|
+
let W = ne != null && ne !== "" ? U - 1 : U;
|
|
2840
|
+
N && (W = N === -1 ? U + 1 : N), Q.push([V, W]);
|
|
2841
|
+
}
|
|
2842
|
+
return Q.sort(function(V, N) {
|
|
2843
|
+
return V[1] - N[1];
|
|
2844
|
+
}), Q.map((V) => {
|
|
2845
|
+
var ie;
|
|
2846
|
+
const N = V[0], ne = x[N], W = ((ie = i.policyConfigSchema) == null ? void 0 : ie[N]) || {};
|
|
2847
|
+
return {
|
|
2848
|
+
key: N,
|
|
2849
|
+
value: ne,
|
|
2850
|
+
hidden: W.hidden || !1,
|
|
2851
|
+
type: W.type ?? Z.Text,
|
|
2852
|
+
label: W.label ?? l(N),
|
|
2853
|
+
tooltip: W.tooltip ?? void 0,
|
|
2854
|
+
section: me.Policy
|
|
2855
|
+
};
|
|
2856
|
+
}).filter((V) => !V.hidden);
|
|
2857
|
+
}), H = T(() => {
|
|
2858
|
+
var x, U, Q, X, ge, V;
|
|
2859
|
+
return {
|
|
2860
|
+
basic: (x = j.value) == null ? void 0 : x.filter((N) => N.section === me.Basic),
|
|
2861
|
+
advanced: (U = j.value) == null ? void 0 : U.filter((N) => N.section === me.Advanced),
|
|
2862
|
+
plugin: (X = D.value) == null ? void 0 : X.concat((Q = j.value) == null ? void 0 : Q.filter((N) => N.section === me.Plugin)),
|
|
2863
|
+
policy: (V = J.value) == null ? void 0 : V.concat((ge = j.value) == null ? void 0 : ge.filter((N) => N.section === me.Policy))
|
|
2864
|
+
};
|
|
2865
|
+
}), te = T(() => {
|
|
2866
|
+
const x = [];
|
|
2867
|
+
return H.value.basic.length && x.push("basic"), H.value.advanced.length && x.push("advanced"), H.value.plugin.length && x.push("plugin"), H.value.policy.length && x.push("policy"), x;
|
|
2868
|
+
}), Ae = T(() => {
|
|
2869
|
+
var U, Q;
|
|
2870
|
+
let x = `${i.config.apiBaseUrl}${i.fetchUrl}`;
|
|
2871
|
+
return i.config.app === "konnect" && (x = x.replace(/{controlPlaneId}/gi, ((U = i.config) == null ? void 0 : U.controlPlaneId) || "")), x.replace(/\/{workspace}/gi, (Q = i.config) != null && Q.workspace ? `/${i.config.workspace}` : "").replace(/{id}/gi, i.config.entityId);
|
|
2872
|
+
});
|
|
2873
|
+
return Ce(z, (x) => {
|
|
2874
|
+
n("loading", x);
|
|
2875
|
+
}, { immediate: !0 }), st(async () => {
|
|
2876
|
+
Y.value = !1, z.value = !0;
|
|
2877
|
+
try {
|
|
2878
|
+
const { data: x } = await c.get(Ae.value);
|
|
2879
|
+
if (O.value = x, i.dataKey)
|
|
2880
|
+
if (typeof x[i.dataKey] < "u")
|
|
2881
|
+
$.value = { ...x[i.dataKey] };
|
|
2882
|
+
else
|
|
2883
|
+
throw new Error(a("errors.dataKeyUndefined", { dataKey: i.dataKey }));
|
|
2884
|
+
else i.recordResolver ? $.value = { ...i.recordResolver(x) } : $.value = { ...x };
|
|
2885
|
+
Object.keys(i.configSchema).filter((Q) => i.configSchema[Q].forceShow).forEach((Q) => {
|
|
2886
|
+
$.value && typeof $.value[Q] > "u" && ($.value[Q] = null);
|
|
2887
|
+
}), n("fetch:success", x);
|
|
2888
|
+
} catch (x) {
|
|
2889
|
+
O.value = null;
|
|
2890
|
+
const U = o(x);
|
|
2891
|
+
w.value = U.startsWith("code") ? a("baseConfigCard.errors.load") : U, Y.value = !0, n("fetch:error", x);
|
|
2892
|
+
} finally {
|
|
2893
|
+
z.value = !1;
|
|
2894
|
+
}
|
|
2895
|
+
}), (x, U) => {
|
|
2896
|
+
const Q = L("KButton"), X = L("KLabel"), ge = L("KSelect"), V = L("KSkeleton"), N = L("KEmptyState"), ne = L("KCard");
|
|
2897
|
+
return f(), E(ne, {
|
|
2898
|
+
class: "kong-ui-entity-base-config-card",
|
|
2899
|
+
"title-tag": e.titleTag
|
|
2900
|
+
}, we({
|
|
2901
|
+
actions: k(() => [
|
|
2902
|
+
F("div", Ia, [
|
|
2903
|
+
M(x.$slots, "actions", {}, void 0, !0),
|
|
2904
|
+
p.value === "deck" && g(h) ? (f(), E(Q, {
|
|
2905
|
+
key: 0,
|
|
2906
|
+
appearance: "secondary",
|
|
2907
|
+
class: "button-customize-deck",
|
|
2908
|
+
onClick: U[0] || (U[0] = (W) => y.value = !0)
|
|
2909
|
+
}, {
|
|
2910
|
+
default: k(() => [
|
|
2911
|
+
P(S(g(a)("baseConfigCard.actions.deck_customize")), 1)
|
|
2912
|
+
]),
|
|
2913
|
+
_: 1
|
|
2914
|
+
})) : B("", !0),
|
|
2915
|
+
K(X, {
|
|
2916
|
+
class: "config-format-select-label",
|
|
2917
|
+
"data-testid": "config-format-select-label"
|
|
2918
|
+
}, {
|
|
2919
|
+
default: k(() => [
|
|
2920
|
+
P(S(e.label), 1)
|
|
2921
|
+
]),
|
|
2922
|
+
_: 1
|
|
2923
|
+
}),
|
|
2924
|
+
K(ge, {
|
|
2925
|
+
modelValue: p.value,
|
|
2926
|
+
"onUpdate:modelValue": U[1] || (U[1] = (W) => p.value = W),
|
|
2927
|
+
"data-testid": "select-config-format",
|
|
2928
|
+
items: m.value,
|
|
2929
|
+
onChange: b
|
|
2930
|
+
}, null, 8, ["modelValue", "items"]),
|
|
2931
|
+
e.configCardDoc ? (f(), E(Q, {
|
|
2932
|
+
key: 1,
|
|
2933
|
+
appearance: "tertiary",
|
|
2934
|
+
class: "book-icon",
|
|
2935
|
+
"data-testid": "book-icon"
|
|
2936
|
+
}, {
|
|
2937
|
+
default: k(() => [
|
|
2938
|
+
F("a", {
|
|
2939
|
+
href: e.configCardDoc,
|
|
2940
|
+
rel: "noopener",
|
|
2941
|
+
target: "_blank"
|
|
2942
|
+
}, [
|
|
2943
|
+
K(g(qt), { size: g(Oi) }, null, 8, ["size"])
|
|
2944
|
+
], 8, Fa)
|
|
2945
|
+
]),
|
|
2946
|
+
_: 1
|
|
2947
|
+
})) : B("", !0)
|
|
2948
|
+
])
|
|
2949
|
+
]),
|
|
2950
|
+
default: k(() => [
|
|
2951
|
+
z.value ? (f(), E(V, {
|
|
2952
|
+
key: 0,
|
|
2953
|
+
"data-testid": "config-card-loader",
|
|
2954
|
+
"table-columns": 2,
|
|
2955
|
+
type: "table"
|
|
2956
|
+
})) : Y.value ? (f(), E(N, {
|
|
2957
|
+
key: 1,
|
|
2958
|
+
"data-testid": "config-card-fetch-error",
|
|
2959
|
+
"icon-variant": "error"
|
|
2960
|
+
}, {
|
|
2961
|
+
default: k(() => [
|
|
2962
|
+
F("h3", null, S(w.value), 1)
|
|
2963
|
+
]),
|
|
2964
|
+
_: 1
|
|
2965
|
+
})) : (f(), A(pe, { key: 2 }, [
|
|
2966
|
+
F("div", Oa, [
|
|
2967
|
+
K($a, {
|
|
2968
|
+
"code-block-record": _.value,
|
|
2969
|
+
"code-block-record-formatter": e.codeBlockRecordFormatter,
|
|
2970
|
+
config: e.config,
|
|
2971
|
+
"entity-type": e.entityType,
|
|
2972
|
+
"fetcher-url": Ae.value,
|
|
2973
|
+
format: p.value,
|
|
2974
|
+
"is-deck-customization-visible": y.value,
|
|
2975
|
+
"preserve-code-block-timestamps": e.preserveCodeBlockTimestamps,
|
|
2976
|
+
"prop-list-types": te.value,
|
|
2977
|
+
"property-collections": H.value,
|
|
2978
|
+
record: $.value,
|
|
2979
|
+
"sub-entity-type": e.subEntityType,
|
|
2980
|
+
"onDeckCustomization:close": U[2] || (U[2] = (W) => y.value = !1),
|
|
2981
|
+
onRequestDeckFormat: U[3] || (U[3] = (W) => p.value = "deck")
|
|
2982
|
+
}, we({ _: 2 }, [
|
|
2983
|
+
he(u.value, (W) => ({
|
|
2984
|
+
name: W,
|
|
2985
|
+
fn: k((ie) => [
|
|
2986
|
+
M(x.$slots, W, qe({ record: $.value }, ie), void 0, !0)
|
|
2987
|
+
])
|
|
2988
|
+
}))
|
|
2989
|
+
]), 1032, ["code-block-record", "code-block-record-formatter", "config", "entity-type", "fetcher-url", "format", "is-deck-customization-visible", "preserve-code-block-timestamps", "prop-list-types", "property-collections", "record", "sub-entity-type"])
|
|
2990
|
+
]),
|
|
2991
|
+
v.value ? (f(), A("div", Ba, [
|
|
2992
|
+
M(x.$slots, "after-fields", {}, void 0, !0)
|
|
2993
|
+
])) : B("", !0)
|
|
2994
|
+
], 64))
|
|
2995
|
+
]),
|
|
2996
|
+
_: 2
|
|
2997
|
+
}, [
|
|
2998
|
+
e.hideTitle ? void 0 : {
|
|
2999
|
+
name: "title",
|
|
3000
|
+
fn: k(() => [
|
|
3001
|
+
F("span", Ea, [
|
|
3002
|
+
M(x.$slots, "title", {}, () => [
|
|
3003
|
+
P(S(g(a)("baseConfigCard.title")), 1)
|
|
3004
|
+
], !0)
|
|
3005
|
+
])
|
|
3006
|
+
]),
|
|
3007
|
+
key: "0"
|
|
3008
|
+
}
|
|
3009
|
+
]), 1032, ["title-tag"]);
|
|
3010
|
+
};
|
|
3011
|
+
}
|
|
3012
|
+
}), cc = /* @__PURE__ */ se(Ka, [["__scopeId", "data-v-af6ced27"]]), Ra = ["novalidate"], La = {
|
|
3013
|
+
key: 0,
|
|
3014
|
+
class: "button-customize-deck-wrapper"
|
|
3015
|
+
}, Da = /* @__PURE__ */ ee({
|
|
3016
|
+
__name: "EntityBaseForm",
|
|
3017
|
+
props: {
|
|
3018
|
+
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
3019
|
+
config: {
|
|
3020
|
+
type: Object,
|
|
3021
|
+
required: !0,
|
|
3022
|
+
validator: (e) => !(!e || !["konnect", "kongManager"].includes(e == null ? void 0 : e.app) || e.app === "konnect" && !e.controlPlaneId || e.app === "kongManager" && typeof e.workspace != "string")
|
|
3023
|
+
},
|
|
3024
|
+
/** If a valid edit ID is provided, it will put the form in Edit mode instead of Create */
|
|
3025
|
+
editId: {
|
|
3026
|
+
type: String,
|
|
3027
|
+
required: !1,
|
|
3028
|
+
default: ""
|
|
3029
|
+
},
|
|
3030
|
+
/**
|
|
3031
|
+
* Entity type, required to generate terraform code
|
|
3032
|
+
*/
|
|
3033
|
+
entityType: {
|
|
3034
|
+
type: String,
|
|
3035
|
+
required: !0,
|
|
3036
|
+
validator: (e) => Je.includes(e)
|
|
3037
|
+
},
|
|
3038
|
+
/**
|
|
3039
|
+
* Sub entity type, required for event gateway entities to generate terraform code
|
|
3040
|
+
*/
|
|
3041
|
+
subEntityType: {
|
|
3042
|
+
type: String,
|
|
3043
|
+
required: !1,
|
|
3044
|
+
default: ""
|
|
3045
|
+
},
|
|
3046
|
+
/**
|
|
3047
|
+
* Fetch url for the item to edit. We will handle the replacement of {controlPlaneId}, {workspace}, and {id}.
|
|
3048
|
+
* Value should NOT contain config.apiBaseUrl, as we auto include this. Typically this will just an entry from
|
|
3049
|
+
* the endpoints file.
|
|
3050
|
+
* Required if `editId` is specified.
|
|
3051
|
+
*
|
|
3052
|
+
* ex. `/v2/control-planes/{controlPlaneId}/core-entities/snis/{id}`
|
|
3053
|
+
*/
|
|
3054
|
+
fetchUrl: {
|
|
3055
|
+
type: String,
|
|
3056
|
+
required: !1,
|
|
3057
|
+
default: ""
|
|
3058
|
+
},
|
|
3059
|
+
/** Set this prop to true during Save action. Disables save and cancel buttons */
|
|
3060
|
+
isReadonly: {
|
|
3061
|
+
type: Boolean,
|
|
3062
|
+
required: !1,
|
|
3063
|
+
default: !1
|
|
3064
|
+
},
|
|
3065
|
+
/** Used to track form validation, disables save button when false */
|
|
3066
|
+
canSubmit: {
|
|
3067
|
+
type: Boolean,
|
|
3068
|
+
required: !1,
|
|
3069
|
+
default: void 0
|
|
3070
|
+
},
|
|
3071
|
+
/** If form submission fails, this is the error message to display */
|
|
3072
|
+
errorMessage: {
|
|
3073
|
+
type: String,
|
|
3074
|
+
required: !1,
|
|
3075
|
+
default: ""
|
|
3076
|
+
},
|
|
3077
|
+
/** Used to populate the Configuration JSON/YAML code blocks */
|
|
3078
|
+
formFields: {
|
|
3079
|
+
type: Object,
|
|
3080
|
+
required: !0
|
|
3081
|
+
},
|
|
3082
|
+
/**
|
|
3083
|
+
* Set true to disable the form validation upon submission.
|
|
3084
|
+
*/
|
|
3085
|
+
noValidate: {
|
|
3086
|
+
type: Boolean,
|
|
3087
|
+
default: !1
|
|
3088
|
+
},
|
|
3089
|
+
/**
|
|
3090
|
+
* Wrapper component to use at component's root level.
|
|
3091
|
+
*/
|
|
3092
|
+
wrapperComponent: {
|
|
3093
|
+
type: String,
|
|
3094
|
+
default: "KCard"
|
|
3095
|
+
},
|
|
3096
|
+
/**
|
|
3097
|
+
* Teleport target for the actions
|
|
3098
|
+
*/
|
|
3099
|
+
actionTeleportTarget: {
|
|
3100
|
+
type: String,
|
|
3101
|
+
default: void 0
|
|
3102
|
+
},
|
|
3103
|
+
/**
|
|
3104
|
+
* Hide the actions
|
|
3105
|
+
*/
|
|
3106
|
+
hideActions: {
|
|
3107
|
+
type: Boolean,
|
|
3108
|
+
default: !1
|
|
3109
|
+
},
|
|
3110
|
+
/**
|
|
3111
|
+
* Top offset for the slideout
|
|
3112
|
+
*/
|
|
3113
|
+
slidoutTopOffset: {
|
|
3114
|
+
type: Number,
|
|
3115
|
+
default: 60
|
|
3116
|
+
},
|
|
3117
|
+
/**
|
|
3118
|
+
* Controls whether to align action buttons to left
|
|
3119
|
+
*/
|
|
3120
|
+
alignActionButtonToLeft: {
|
|
3121
|
+
type: Boolean,
|
|
3122
|
+
default: !1
|
|
3123
|
+
},
|
|
3124
|
+
/**
|
|
3125
|
+
* Save and Cancel button text override
|
|
3126
|
+
*/
|
|
3127
|
+
saveButtonText: {
|
|
3128
|
+
type: String,
|
|
3129
|
+
default: void 0
|
|
3130
|
+
},
|
|
3131
|
+
cancelButtonText: {
|
|
3132
|
+
type: String,
|
|
3133
|
+
default: void 0
|
|
3134
|
+
}
|
|
3135
|
+
},
|
|
3136
|
+
emits: ["loading", "fetch:success", "fetch:error", "submit", "cancel", "codeBlockTabChange"],
|
|
3137
|
+
setup(e, { expose: t, emit: n }) {
|
|
3138
|
+
var D;
|
|
3139
|
+
const i = jt(Zn, q(!1)), r = n, a = e, o = vi(), { i18n: { t: l } } = G.useI18n(), { getMessageFromError: c } = G.useErrors(), { axiosInstance: d } = G.useAxios((D = a.config) == null ? void 0 : D.axiosRequestConfig), y = q(!1), u = T(() => !!a.editId), v = q(!1), s = q(""), h = T(() => a.canSubmit === !1 || a.isReadonly), m = q(!1), p = T(() => {
|
|
3140
|
+
var H, te;
|
|
3141
|
+
let J = `${a.config.apiBaseUrl}${a.fetchUrl}`;
|
|
3142
|
+
return a.config.app === "konnect" && (J = J.replace(/{controlPlaneId}/gi, ((H = a.config) == null ? void 0 : H.controlPlaneId) || "")), J = J.replace(/\/{workspace}/gi, (te = a.config) != null && te.workspace ? `/${a.config.workspace}` : ""), a.editId ? (J = J.replace(/{id}/gi, a.editId), J) : (J = J.replace(/\/{id}/gi, ""), J);
|
|
3143
|
+
}), b = q(!1), {
|
|
3144
|
+
isDeckEnabled: C,
|
|
3145
|
+
deckCustomizationOptions: R,
|
|
3146
|
+
deckCalloutPreferenceKey: z
|
|
3147
|
+
} = G.useBaseFormDeckOptions(
|
|
3148
|
+
() => a.config,
|
|
3149
|
+
() => a.entityType
|
|
3150
|
+
), Y = () => {
|
|
3151
|
+
m.value = !m.value;
|
|
3152
|
+
}, w = () => {
|
|
3153
|
+
a.config.cancelRoute ? o.push(a.config.cancelRoute) : $();
|
|
3154
|
+
}, $ = () => {
|
|
3155
|
+
r("cancel");
|
|
3156
|
+
}, O = () => {
|
|
3157
|
+
h.value || r("submit");
|
|
3158
|
+
}, _ = q([
|
|
3159
|
+
{
|
|
3160
|
+
title: l("baseForm.configuration.json"),
|
|
3161
|
+
hash: "#json"
|
|
3162
|
+
},
|
|
3163
|
+
{
|
|
3164
|
+
title: l("baseForm.configuration.yaml"),
|
|
3165
|
+
hash: "#yaml"
|
|
3166
|
+
}
|
|
3167
|
+
]);
|
|
3168
|
+
a.config.app === "konnect" && a.entityType !== _e.Other && _.value.splice(1, 0, {
|
|
3169
|
+
title: l("baseForm.configuration.terraform"),
|
|
3170
|
+
hash: "#terraform"
|
|
3171
|
+
}), C.value && _.value.push({
|
|
3172
|
+
title: l("baseForm.configuration.deck"),
|
|
3173
|
+
hash: "#deck"
|
|
3174
|
+
});
|
|
3175
|
+
const j = q(_.value[0].hash);
|
|
3176
|
+
return Ce(() => y.value, (J) => {
|
|
3177
|
+
r("loading", J);
|
|
3178
|
+
}, { immediate: !0 }), st(async () => {
|
|
3179
|
+
if (a.editId)
|
|
3180
|
+
try {
|
|
3181
|
+
v.value = !1, y.value = !0;
|
|
3182
|
+
const { data: J } = await d.get(p.value);
|
|
3183
|
+
r("fetch:success", J);
|
|
3184
|
+
} catch (J) {
|
|
3185
|
+
const H = c(J);
|
|
3186
|
+
s.value = H.startsWith("code") ? l("baseForm.errors.edit") : H, v.value = !0, r("fetch:error", J);
|
|
3187
|
+
} finally {
|
|
3188
|
+
y.value = !1;
|
|
3189
|
+
}
|
|
3190
|
+
}), t({
|
|
3191
|
+
viewConfig: Y,
|
|
3192
|
+
formCancel: $,
|
|
3193
|
+
formSubmit: O
|
|
3194
|
+
}), (J, H) => {
|
|
3195
|
+
const te = L("KSkeleton"), Ae = L("KEmptyState"), Se = L("KAlert"), x = L("KButton"), U = L("KTabs"), Q = L("KSlideout");
|
|
3196
|
+
return f(), E(je(e.wrapperComponent), {
|
|
3197
|
+
class: ue(["kong-ui-entity-base-form", {
|
|
3198
|
+
"new-form-layout": g(i) && e.entityType === g(_e).Plugin
|
|
3199
|
+
}])
|
|
3200
|
+
}, {
|
|
3201
|
+
default: k(() => [
|
|
3202
|
+
y.value ? (f(), E(te, {
|
|
3203
|
+
key: 0,
|
|
3204
|
+
type: "form"
|
|
3205
|
+
})) : v.value ? (f(), E(Ae, {
|
|
3206
|
+
key: 1,
|
|
3207
|
+
"action-button-text": g(l)("baseForm.actions.back"),
|
|
3208
|
+
"data-testid": "form-fetch-error",
|
|
3209
|
+
"icon-variant": "error",
|
|
3210
|
+
onClickAction: w
|
|
3211
|
+
}, {
|
|
3212
|
+
default: k(() => [
|
|
3213
|
+
F("h3", null, S(s.value), 1)
|
|
3214
|
+
]),
|
|
3215
|
+
_: 1
|
|
3216
|
+
}, 8, ["action-button-text"])) : (f(), A("form", {
|
|
3217
|
+
key: 2,
|
|
3218
|
+
"data-testid": "form-content",
|
|
3219
|
+
novalidate: a.noValidate,
|
|
3220
|
+
onReset: He($, ["prevent"]),
|
|
3221
|
+
onSubmit: He(O, ["prevent"])
|
|
3222
|
+
}, [
|
|
3223
|
+
M(J.$slots, "default", {}, void 0, !0),
|
|
3224
|
+
e.errorMessage ? (f(), E(Se, {
|
|
3225
|
+
key: 0,
|
|
3226
|
+
appearance: "danger",
|
|
3227
|
+
class: "form-error",
|
|
3228
|
+
"data-testid": "form-error",
|
|
3229
|
+
message: e.errorMessage
|
|
3230
|
+
}, null, 8, ["message"])) : B("", !0),
|
|
3231
|
+
e.hideActions ? B("", !0) : (f(), E(Ut, {
|
|
3232
|
+
key: 1,
|
|
3233
|
+
disabled: !e.actionTeleportTarget,
|
|
3234
|
+
to: e.actionTeleportTarget
|
|
3235
|
+
}, [
|
|
3236
|
+
F("div", {
|
|
3237
|
+
class: ue(["form-actions", { "form-actions-reverted": e.alignActionButtonToLeft }]),
|
|
3238
|
+
"data-testid": "form-actions"
|
|
3239
|
+
}, [
|
|
3240
|
+
M(J.$slots, "form-actions", {}, () => [
|
|
3241
|
+
K(x, {
|
|
3242
|
+
appearance: "tertiary",
|
|
3243
|
+
"data-testid": `${e.entityType}-${u.value ? "edit" : "create"}-form-view-configuration`,
|
|
3244
|
+
onClick: H[0] || (H[0] = (X) => Y())
|
|
3245
|
+
}, {
|
|
3246
|
+
default: k(() => [
|
|
3247
|
+
P(S(m.value ? g(l)("baseForm.actions.hideConfiguration") : g(l)("baseForm.actions.viewConfiguration")), 1)
|
|
3248
|
+
]),
|
|
3249
|
+
_: 1
|
|
3250
|
+
}, 8, ["data-testid"]),
|
|
3251
|
+
K(x, {
|
|
3252
|
+
appearance: "secondary",
|
|
3253
|
+
"data-testid": `${e.entityType}-${u.value ? "edit" : "create"}-form-cancel`,
|
|
3254
|
+
disabled: e.isReadonly,
|
|
3255
|
+
type: "reset",
|
|
3256
|
+
onClick: H[1] || (H[1] = (X) => !!e.actionTeleportTarget && $())
|
|
3257
|
+
}, {
|
|
3258
|
+
default: k(() => [
|
|
3259
|
+
P(S(e.cancelButtonText ?? g(l)("baseForm.actions.cancel")), 1)
|
|
3260
|
+
]),
|
|
3261
|
+
_: 1
|
|
3262
|
+
}, 8, ["data-testid", "disabled"]),
|
|
3263
|
+
K(x, {
|
|
3264
|
+
appearance: "primary",
|
|
3265
|
+
"data-testid": `${e.entityType}-${u.value ? "edit" : "create"}-form-submit`,
|
|
3266
|
+
disabled: h.value,
|
|
3267
|
+
type: "submit",
|
|
3268
|
+
onClick: H[2] || (H[2] = (X) => !!e.actionTeleportTarget && O())
|
|
3269
|
+
}, {
|
|
3270
|
+
default: k(() => [
|
|
3271
|
+
P(S(e.saveButtonText ?? g(l)("baseForm.actions.save")), 1)
|
|
3272
|
+
]),
|
|
3273
|
+
_: 1
|
|
3274
|
+
}, 8, ["data-testid", "disabled"])
|
|
3275
|
+
], !0)
|
|
3276
|
+
], 2)
|
|
3277
|
+
], 8, ["disabled", "to"]))
|
|
3278
|
+
], 40, Ra)),
|
|
3279
|
+
K(Q, {
|
|
3280
|
+
"close-on-blur": !1,
|
|
3281
|
+
"data-testid": "form-view-configuration-slideout",
|
|
3282
|
+
"has-overlay": !1,
|
|
3283
|
+
"offset-top": e.slidoutTopOffset,
|
|
3284
|
+
title: g(l)("baseForm.configuration.title"),
|
|
3285
|
+
visible: m.value,
|
|
3286
|
+
onClose: H[8] || (H[8] = (X) => Y())
|
|
3287
|
+
}, {
|
|
3288
|
+
default: k(() => [
|
|
3289
|
+
F("div", null, [
|
|
3290
|
+
M(J.$slots, "configuration-slideout-message", {}, () => [
|
|
3291
|
+
P(S(g(l)("baseForm.configuration.message")), 1)
|
|
3292
|
+
], !0)
|
|
3293
|
+
]),
|
|
3294
|
+
K(U, {
|
|
3295
|
+
modelValue: j.value,
|
|
3296
|
+
"onUpdate:modelValue": H[6] || (H[6] = (X) => j.value = X),
|
|
3297
|
+
"data-testid": "form-view-configuration-slideout-tabs",
|
|
3298
|
+
tabs: _.value,
|
|
3299
|
+
onChange: H[7] || (H[7] = (X) => r("codeBlockTabChange", X.replace("#", "")))
|
|
3300
|
+
}, {
|
|
3301
|
+
json: k(() => [
|
|
3302
|
+
K(Yt, {
|
|
3303
|
+
config: e.config,
|
|
3304
|
+
"entity-record": a.formFields,
|
|
3305
|
+
"fetcher-url": p.value,
|
|
3306
|
+
"request-method": a.editId ? "put" : "post"
|
|
3307
|
+
}, null, 8, ["config", "entity-record", "fetcher-url", "request-method"])
|
|
3308
|
+
]),
|
|
3309
|
+
yaml: k(() => [
|
|
3310
|
+
K(Nn, {
|
|
3311
|
+
"deck-callout-preference-key": g(C) ? g(z) : void 0,
|
|
3312
|
+
"entity-record": a.formFields,
|
|
3313
|
+
"onDeckCallout:clickCta": H[3] || (H[3] = (X) => j.value = "#deck")
|
|
3314
|
+
}, null, 8, ["deck-callout-preference-key", "entity-record"])
|
|
3315
|
+
]),
|
|
3316
|
+
terraform: k(() => [
|
|
3317
|
+
K(Pn, {
|
|
3318
|
+
"entity-record": a.formFields,
|
|
3319
|
+
"entity-type": e.entityType,
|
|
3320
|
+
"sub-entity-type": e.subEntityType
|
|
3321
|
+
}, null, 8, ["entity-record", "entity-type", "sub-entity-type"])
|
|
3322
|
+
]),
|
|
3323
|
+
deck: k(() => [
|
|
3324
|
+
g(R) ? (f(), A("div", La, [
|
|
3325
|
+
K(x, {
|
|
3326
|
+
appearance: "secondary",
|
|
3327
|
+
class: "button-customize-deck",
|
|
3328
|
+
onClick: H[4] || (H[4] = (X) => b.value = !0)
|
|
3329
|
+
}, {
|
|
3330
|
+
default: k(() => [
|
|
3331
|
+
P(S(g(l)("baseConfigCard.actions.deck_customize")), 1)
|
|
3332
|
+
]),
|
|
3333
|
+
_: 1
|
|
3334
|
+
})
|
|
3335
|
+
])) : B("", !0),
|
|
3336
|
+
K(Mn, {
|
|
3337
|
+
app: e.config.app,
|
|
3338
|
+
"control-plane-name": e.config.app === "konnect" ? e.config.controlPlaneName : void 0,
|
|
3339
|
+
"customization-options": g(R),
|
|
3340
|
+
"entity-record": a.formFields,
|
|
3341
|
+
"entity-type": e.entityType,
|
|
3342
|
+
"geo-api-server-url": e.config.app === "konnect" ? e.config.geoApiServerUrl : void 0,
|
|
3343
|
+
"is-customization-modal-visible": b.value,
|
|
3344
|
+
"kong-admin-api-url": e.config.app === "kongManager" ? e.config.apiBaseUrl : void 0,
|
|
3345
|
+
workspace: e.config.app === "kongManager" ? e.config.workspace : void 0,
|
|
3346
|
+
onCustomizationClose: H[5] || (H[5] = (X) => b.value = !1)
|
|
3347
|
+
}, null, 8, ["app", "control-plane-name", "customization-options", "entity-record", "entity-type", "geo-api-server-url", "is-customization-modal-visible", "kong-admin-api-url", "workspace"])
|
|
3348
|
+
]),
|
|
3349
|
+
_: 1
|
|
3350
|
+
}, 8, ["modelValue", "tabs"])
|
|
3351
|
+
]),
|
|
3352
|
+
_: 3
|
|
3353
|
+
}, 8, ["offset-top", "title", "visible"])
|
|
3354
|
+
]),
|
|
3355
|
+
_: 3
|
|
3356
|
+
}, 8, ["class"]);
|
|
3357
|
+
};
|
|
3358
|
+
}
|
|
3359
|
+
}), sc = /* @__PURE__ */ se(Da, [["__scopeId", "data-v-e667411e"]]), Na = ["data-truncate"], Pa = /* @__PURE__ */ ee({
|
|
3360
|
+
__name: "EntityBaseTableCell",
|
|
3361
|
+
props: {
|
|
3362
|
+
keyName: {
|
|
3363
|
+
type: String,
|
|
3364
|
+
required: !0
|
|
3365
|
+
},
|
|
3366
|
+
rowEl: {
|
|
3367
|
+
type: [Object, null],
|
|
3368
|
+
required: !0
|
|
3369
|
+
},
|
|
3370
|
+
tooltip: {
|
|
3371
|
+
type: Boolean,
|
|
3372
|
+
default: !1
|
|
3373
|
+
}
|
|
3374
|
+
},
|
|
3375
|
+
setup(e) {
|
|
3376
|
+
const t = e, n = T(() => {
|
|
3377
|
+
var p;
|
|
3378
|
+
return ((p = t.rowEl) == null ? void 0 : p.querySelector(`[data-testid="${t.keyName}"]`)) || null;
|
|
3379
|
+
}), i = T(() => {
|
|
3380
|
+
var p;
|
|
3381
|
+
return ((p = n.value) == null ? void 0 : p.querySelector('[data-truncate="true"]')) || null;
|
|
3382
|
+
}), r = T(() => {
|
|
3383
|
+
var b, C;
|
|
3384
|
+
const p = (b = t.rowEl) == null ? void 0 : b.querySelectorAll("td");
|
|
3385
|
+
return p ? ((C = p[0]) == null ? void 0 : C.getAttribute("data-testid")) === t.keyName : !0;
|
|
3386
|
+
}), a = T(() => r.value || t.tooltip);
|
|
3387
|
+
let o;
|
|
3388
|
+
const l = () => {
|
|
3389
|
+
o && (o.disconnect(), o = void 0);
|
|
3390
|
+
}, c = () => {
|
|
3391
|
+
var b, C, R;
|
|
3392
|
+
let p = ((b = n.value) == null ? void 0 : b.clientWidth) || 0;
|
|
3393
|
+
if (n.value && "getComputedStyle" in window) {
|
|
3394
|
+
const z = window.getComputedStyle(n.value);
|
|
3395
|
+
p -= (parseFloat(z.paddingLeft) || 0) + (parseFloat(z.paddingRight) || 0);
|
|
3396
|
+
}
|
|
3397
|
+
y.value = ((C = i.value) == null ? void 0 : C.getBoundingClientRect().width) || 0, u.value = p, v.value = ((R = d.value) == null ? void 0 : R.innerText) || "";
|
|
3398
|
+
}, d = q({}), y = q(0), u = q(0), v = q(""), s = T(() => [i.value, n.value]), h = Ce(
|
|
3399
|
+
s,
|
|
3400
|
+
(p) => {
|
|
3401
|
+
if (a.value && (l(), "ResizeObserver" in window && window)) {
|
|
3402
|
+
o = new ResizeObserver((b) => {
|
|
3403
|
+
window.requestAnimationFrame(() => {
|
|
3404
|
+
!Array.isArray(b) || !b.length || c();
|
|
3405
|
+
});
|
|
3406
|
+
});
|
|
3407
|
+
for (const b of p)
|
|
3408
|
+
b && o.observe(b);
|
|
3409
|
+
}
|
|
3410
|
+
},
|
|
3411
|
+
{ immediate: !0, flush: "post", deep: !0 }
|
|
3412
|
+
), m = T(() => a.value ? y.value > u.value : !1);
|
|
3413
|
+
return ct(() => {
|
|
3414
|
+
c();
|
|
3415
|
+
}), zn(() => {
|
|
3416
|
+
h();
|
|
3417
|
+
}), (p, b) => {
|
|
3418
|
+
const C = L("KTooltip");
|
|
3419
|
+
return f(), A("span", {
|
|
3420
|
+
ref_key: "contentRef",
|
|
3421
|
+
ref: d,
|
|
3422
|
+
class: "content-wrapper"
|
|
3423
|
+
}, [
|
|
3424
|
+
a.value ? (f(), A("span", {
|
|
3425
|
+
key: 0,
|
|
3426
|
+
"data-truncate": a.value || void 0
|
|
3427
|
+
}, [
|
|
3428
|
+
K(C, {
|
|
3429
|
+
"max-width": "300",
|
|
3430
|
+
placement: "bottom-start",
|
|
3431
|
+
text: m.value ? v.value : ""
|
|
3432
|
+
}, {
|
|
3433
|
+
default: k(() => [
|
|
3434
|
+
M(p.$slots, "default", {}, void 0, !0)
|
|
3435
|
+
]),
|
|
3436
|
+
_: 3
|
|
3437
|
+
}, 8, ["text"])
|
|
3438
|
+
], 8, Na)) : M(p.$slots, "default", { key: 1 }, void 0, !0)
|
|
3439
|
+
], 512);
|
|
3440
|
+
};
|
|
3441
|
+
}
|
|
3442
|
+
}), Ma = /* @__PURE__ */ se(Pa, [["__scopeId", "data-v-a3a65cac"]]), ja = { class: "toolbar-container" }, Ua = {
|
|
3443
|
+
key: 0,
|
|
3444
|
+
class: "toolbar-button-container"
|
|
3445
|
+
}, qa = {
|
|
3446
|
+
key: 0,
|
|
3447
|
+
class: "hidden"
|
|
3448
|
+
}, Ha = /* @__PURE__ */ ee({
|
|
3449
|
+
__name: "EntityBaseTable",
|
|
3450
|
+
props: {
|
|
3451
|
+
// table header configuration
|
|
3452
|
+
tableHeaders: {
|
|
3453
|
+
type: Object,
|
|
3454
|
+
required: !0,
|
|
3455
|
+
default: () => ({})
|
|
3456
|
+
},
|
|
3457
|
+
// fetcher function
|
|
3458
|
+
fetcher: {
|
|
3459
|
+
type: Function,
|
|
3460
|
+
required: !0,
|
|
3461
|
+
default: async () => ({
|
|
3462
|
+
data: [],
|
|
3463
|
+
total: 0
|
|
3464
|
+
})
|
|
3465
|
+
},
|
|
3466
|
+
initialFetcherParams: {
|
|
3467
|
+
type: Object,
|
|
3468
|
+
default: null
|
|
3469
|
+
},
|
|
3470
|
+
rowKey: {
|
|
3471
|
+
type: [String, Function],
|
|
3472
|
+
default: "id"
|
|
3473
|
+
},
|
|
3474
|
+
// used to identify the cache entry
|
|
3475
|
+
cacheIdentifier: {
|
|
3476
|
+
type: String,
|
|
3477
|
+
default: ""
|
|
3478
|
+
},
|
|
3479
|
+
// cache key for the fetcher
|
|
3480
|
+
fetcherCacheKey: {
|
|
3481
|
+
type: Number,
|
|
3482
|
+
default: 1
|
|
3483
|
+
},
|
|
3484
|
+
// whether the table is loading
|
|
3485
|
+
isLoading: {
|
|
3486
|
+
type: Boolean,
|
|
3487
|
+
default: !1
|
|
3488
|
+
},
|
|
3489
|
+
// search query
|
|
3490
|
+
query: {
|
|
3491
|
+
type: String,
|
|
3492
|
+
default: ""
|
|
3493
|
+
},
|
|
3494
|
+
// Enable client-side sort (e.g. for Koko endpoints that do not support sort)
|
|
3495
|
+
enableClientSort: {
|
|
3496
|
+
type: Boolean,
|
|
3497
|
+
default: !1
|
|
3498
|
+
},
|
|
3499
|
+
sortHandlerFunction: {
|
|
3500
|
+
type: Function,
|
|
3501
|
+
default: null
|
|
3502
|
+
},
|
|
3503
|
+
// whether to show the actions column
|
|
3504
|
+
enableEntityActions: {
|
|
3505
|
+
type: Boolean,
|
|
3506
|
+
default: !0
|
|
3507
|
+
},
|
|
3508
|
+
// options for the empty state
|
|
3509
|
+
emptyStateOptions: {
|
|
3510
|
+
type: Object,
|
|
3511
|
+
default: () => ({})
|
|
3512
|
+
},
|
|
3513
|
+
// error message to show in the error state
|
|
3514
|
+
// this prop being set (or empty) determines if the KTable is in an error state
|
|
3515
|
+
// please use `TableErrorMessage` since `string` is only for backwards compatibility
|
|
3516
|
+
errorMessage: {
|
|
3517
|
+
type: [String, Object],
|
|
3518
|
+
default: null
|
|
3519
|
+
},
|
|
3520
|
+
paginationAttributes: {
|
|
3521
|
+
type: Object,
|
|
3522
|
+
default: () => ({})
|
|
3523
|
+
},
|
|
3524
|
+
hidePaginationWhenOptional: {
|
|
3525
|
+
type: Boolean,
|
|
3526
|
+
default: !0
|
|
3527
|
+
},
|
|
3528
|
+
disableSorting: {
|
|
3529
|
+
type: Boolean,
|
|
3530
|
+
default: void 0
|
|
3531
|
+
},
|
|
3532
|
+
// A function for applying attributes to cells
|
|
3533
|
+
cellAttributes: {
|
|
3534
|
+
type: Function,
|
|
3535
|
+
default: () => ({})
|
|
3536
|
+
},
|
|
3537
|
+
// A function for applying attributes to rows
|
|
3538
|
+
rowAttributes: {
|
|
3539
|
+
type: Function,
|
|
3540
|
+
default: () => ({})
|
|
3541
|
+
},
|
|
3542
|
+
/** tableKey to use for user table preferences. If empty, will fallback to default preferences */
|
|
3543
|
+
preferencesStorageKey: {
|
|
3544
|
+
type: String,
|
|
3545
|
+
default: ""
|
|
3546
|
+
},
|
|
3547
|
+
/** default table preferences to use if no user preferences are found */
|
|
3548
|
+
defaultTablePreferences: {
|
|
3549
|
+
type: Object,
|
|
3550
|
+
default: null,
|
|
3551
|
+
required: !1
|
|
3552
|
+
},
|
|
3553
|
+
title: {
|
|
3554
|
+
type: String,
|
|
3555
|
+
default: ""
|
|
3556
|
+
},
|
|
3557
|
+
titleTag: {
|
|
3558
|
+
type: String,
|
|
3559
|
+
default: "h2"
|
|
3560
|
+
},
|
|
3561
|
+
/** default to false, setting to true will suppress the row click event even if "@click:row" is attached */
|
|
3562
|
+
disableRowClick: {
|
|
3563
|
+
type: Boolean,
|
|
3564
|
+
default: !1
|
|
3565
|
+
},
|
|
3566
|
+
hidePagination: {
|
|
3567
|
+
type: Boolean,
|
|
3568
|
+
default: !1
|
|
3569
|
+
},
|
|
3570
|
+
hideToolbar: {
|
|
3571
|
+
type: Boolean,
|
|
3572
|
+
default: void 0
|
|
3573
|
+
},
|
|
3574
|
+
/**
|
|
3575
|
+
* @deprecated in favour of `paginationAttributes`
|
|
3576
|
+
*/
|
|
3577
|
+
disablePaginationPageJump: {
|
|
3578
|
+
type: Boolean,
|
|
3579
|
+
default: void 0,
|
|
3580
|
+
validator: (e) => (e && console.warn("EntityBaseTable: `disablePaginationPageJump` is deprecated in favour of `paginationAttributes`. Please update your code to use `paginationAttributes` instead."), typeof e == "boolean")
|
|
3581
|
+
},
|
|
3582
|
+
/**
|
|
3583
|
+
* @deprecated in favour of `paginationAttributes`
|
|
3584
|
+
*/
|
|
3585
|
+
paginationType: {
|
|
3586
|
+
type: String,
|
|
3587
|
+
default: void 0,
|
|
3588
|
+
validator: (e) => (e && console.warn("EntityBaseTable: `paginationType` is deprecated in favour of `paginationAttributes`. Please update your code to use `paginationAttributes` instead."), ["default", "offset"].includes(e))
|
|
3589
|
+
}
|
|
3590
|
+
},
|
|
3591
|
+
emits: ["click:row", "sort", "clear-search-input", "empty-state-cta-clicked", "state"],
|
|
3592
|
+
setup(e, { emit: t }) {
|
|
3593
|
+
const n = e, i = t, { i18n: { t: r } } = G.useI18n(), a = T(() => {
|
|
3594
|
+
var _, j;
|
|
3595
|
+
return typeof n.errorMessage == "string" ? {
|
|
3596
|
+
hasError: !!n.errorMessage,
|
|
3597
|
+
title: n.errorMessage,
|
|
3598
|
+
message: void 0
|
|
3599
|
+
} : {
|
|
3600
|
+
hasError: !!n.errorMessage,
|
|
3601
|
+
title: (_ = n.errorMessage) == null ? void 0 : _.title,
|
|
3602
|
+
message: (j = n.errorMessage) == null ? void 0 : j.message
|
|
3603
|
+
};
|
|
3604
|
+
}), o = T(() => n.cacheIdentifier || n.preferencesStorageKey), l = T(() => {
|
|
3605
|
+
const _ = [];
|
|
3606
|
+
return Object.keys(n.tableHeaders).forEach((D) => {
|
|
3607
|
+
const J = n.tableHeaders[D];
|
|
3608
|
+
_.push({
|
|
3609
|
+
label: J.label ?? D,
|
|
3610
|
+
key: D,
|
|
3611
|
+
sortable: J.sortable ?? !1,
|
|
3612
|
+
hidable: J.hidable ?? !0
|
|
3613
|
+
});
|
|
3614
|
+
}), n.enableEntityActions && _.push({
|
|
3615
|
+
key: "actions",
|
|
3616
|
+
hideLabel: !0
|
|
3617
|
+
}), _;
|
|
3618
|
+
}), c = (_) => ({
|
|
3619
|
+
"data-rowid": _.id,
|
|
3620
|
+
"data-testid": _.name,
|
|
3621
|
+
...n.rowAttributes(_)
|
|
3622
|
+
}), d = q({}), y = (_) => {
|
|
3623
|
+
var j;
|
|
3624
|
+
return (j = d.value) == null ? void 0 : j.$el.querySelector(`[data-rowid="${_.id}"]`);
|
|
3625
|
+
}, u = (_) => {
|
|
3626
|
+
const j = {
|
|
3627
|
+
"data-testid": _.headerKey,
|
|
3628
|
+
...n.cellAttributes(_)
|
|
3629
|
+
};
|
|
3630
|
+
return _.colIndex === 0 && (j.style = {
|
|
3631
|
+
maxWidth: "250px",
|
|
3632
|
+
overflowX: "hidden",
|
|
3633
|
+
textOverflow: "ellipsis"
|
|
3634
|
+
}), j;
|
|
3635
|
+
}, v = (_) => {
|
|
3636
|
+
C(_), i("state", _);
|
|
3637
|
+
}, s = () => {
|
|
3638
|
+
i("empty-state-cta-clicked"), h();
|
|
3639
|
+
}, h = () => {
|
|
3640
|
+
i("clear-search-input");
|
|
3641
|
+
}, m = T(() => n.disableRowClick ? void 0 : (_, j) => {
|
|
3642
|
+
i("click:row", j);
|
|
3643
|
+
}), p = (_) => {
|
|
3644
|
+
i("sort", _);
|
|
3645
|
+
}, { hideTableToolbar: b, handleStateChange: C } = G.useTableState(() => n.query), { setTablePreferences: R, getTablePreferences: z } = ei(), Y = q(z(o.value, n.defaultTablePreferences)), w = T(() => {
|
|
3646
|
+
const _ = z(o.value);
|
|
3647
|
+
return {
|
|
3648
|
+
...n.initialFetcherParams,
|
|
3649
|
+
..._
|
|
3650
|
+
};
|
|
3651
|
+
}), $ = (_) => {
|
|
3652
|
+
Y.value = _, l.value.forEach((j) => {
|
|
3653
|
+
!("hidable" in j) || !Y.value.columnVisibility || j.hidable === !1 && (Y.value.columnVisibility[j.key] = !0);
|
|
3654
|
+
}), o.value && R(o.value, _);
|
|
3655
|
+
}, O = T(() => ({
|
|
3656
|
+
disablePageJump: n.disablePaginationPageJump,
|
|
3657
|
+
offset: n.paginationType === "offset",
|
|
3658
|
+
...n.paginationAttributes
|
|
3659
|
+
}));
|
|
3660
|
+
return (_, j) => {
|
|
3661
|
+
const D = L("KTableData"), J = L("KCard");
|
|
3662
|
+
return f(), E(J, {
|
|
3663
|
+
class: "kong-ui-entity-base-table",
|
|
3664
|
+
title: e.title,
|
|
3665
|
+
"title-tag": e.titleTag
|
|
3666
|
+
}, {
|
|
3667
|
+
default: k(() => [
|
|
3668
|
+
K(D, {
|
|
3669
|
+
ref_key: "tableRefs",
|
|
3670
|
+
ref: d,
|
|
3671
|
+
"cache-identifier": o.value,
|
|
3672
|
+
"cell-attrs": u,
|
|
3673
|
+
"client-sort": e.enableClientSort,
|
|
3674
|
+
"empty-state-action-message": e.query ? g(r)("baseTable.emptyState.noSearchResultsCtaText") : e.emptyStateOptions.ctaText,
|
|
3675
|
+
"empty-state-action-route": e.query ? void 0 : e.emptyStateOptions.ctaPath,
|
|
3676
|
+
"empty-state-icon-variant": e.query ? "search" : "kong",
|
|
3677
|
+
"empty-state-message": e.query ? g(r)("baseTable.emptyState.noSearchResultsMessage") : e.emptyStateOptions.message,
|
|
3678
|
+
"empty-state-title": e.query ? g(r)("baseTable.emptyState.noSearchResultsTitle") : e.emptyStateOptions.title,
|
|
3679
|
+
error: a.value.hasError,
|
|
3680
|
+
"error-state-message": a.value.message,
|
|
3681
|
+
"error-state-title": a.value.title,
|
|
3682
|
+
fetcher: e.fetcher,
|
|
3683
|
+
"fetcher-cache-key": String(e.fetcherCacheKey),
|
|
3684
|
+
headers: l.value,
|
|
3685
|
+
"hide-pagination": e.hidePagination,
|
|
3686
|
+
"hide-pagination-when-optional": e.hidePaginationWhenOptional,
|
|
3687
|
+
"hide-toolbar": e.hideToolbar ?? g(b),
|
|
3688
|
+
"initial-fetcher-params": w.value,
|
|
3689
|
+
loading: e.isLoading,
|
|
3690
|
+
"pagination-attributes": O.value,
|
|
3691
|
+
"resize-columns": "",
|
|
3692
|
+
"row-attrs": c,
|
|
3693
|
+
"row-key": e.rowKey,
|
|
3694
|
+
"search-input": e.query,
|
|
3695
|
+
"sort-handler-function": e.enableClientSort ? e.sortHandlerFunction : void 0,
|
|
3696
|
+
sortable: !e.disableSorting,
|
|
3697
|
+
"table-preferences": Y.value,
|
|
3698
|
+
onEmptyStateActionClick: s,
|
|
3699
|
+
"onRow:click": m.value,
|
|
3700
|
+
onSort: j[0] || (j[0] = (H) => p(H)),
|
|
3701
|
+
onState: v,
|
|
3702
|
+
"onUpdate:tablePreferences": $
|
|
3703
|
+
}, we({
|
|
3704
|
+
toolbar: k(() => [
|
|
3705
|
+
F("div", ja, [
|
|
3706
|
+
M(_.$slots, "toolbar-filter", {}, void 0, !0),
|
|
3707
|
+
_.$slots["toolbar-button"] ? (f(), A("div", Ua, [
|
|
3708
|
+
M(_.$slots, "toolbar-button", {}, void 0, !0)
|
|
3709
|
+
])) : B("", !0)
|
|
3710
|
+
])
|
|
3711
|
+
]),
|
|
3712
|
+
"action-items": k(({ row: H }) => [
|
|
3713
|
+
M(_.$slots, "actions", { row: H }, void 0, !0)
|
|
3714
|
+
]),
|
|
3715
|
+
_: 2
|
|
3716
|
+
}, [
|
|
3717
|
+
_.$slots["empty-state"] ? {
|
|
3718
|
+
name: "empty-state",
|
|
3719
|
+
fn: k(() => [
|
|
3720
|
+
M(_.$slots, "empty-state", {}, void 0, !0)
|
|
3721
|
+
]),
|
|
3722
|
+
key: "0"
|
|
3723
|
+
} : void 0,
|
|
3724
|
+
he(e.tableHeaders, (H, te) => ({
|
|
3725
|
+
name: te,
|
|
3726
|
+
fn: k(({ row: Ae, rowValue: Se }) => [
|
|
3727
|
+
K(Ma, {
|
|
3728
|
+
"key-name": String(te),
|
|
3729
|
+
"row-el": y(Ae),
|
|
3730
|
+
tooltip: H.tooltip
|
|
3731
|
+
}, {
|
|
3732
|
+
default: k(() => [
|
|
3733
|
+
M(_.$slots, te, {
|
|
3734
|
+
row: Ae,
|
|
3735
|
+
rowKey: e.rowKey,
|
|
3736
|
+
rowValue: Se
|
|
3737
|
+
}, () => [
|
|
3738
|
+
P(S(Se), 1)
|
|
3739
|
+
], !0)
|
|
3740
|
+
]),
|
|
3741
|
+
_: 2
|
|
3742
|
+
}, 1032, ["key-name", "row-el", "tooltip"])
|
|
3743
|
+
])
|
|
3744
|
+
})),
|
|
3745
|
+
e.query ? void 0 : {
|
|
3746
|
+
name: "empty-state-action-icon",
|
|
3747
|
+
fn: k(() => [
|
|
3748
|
+
K(g(Ht))
|
|
3749
|
+
]),
|
|
3750
|
+
key: "1"
|
|
3751
|
+
}
|
|
3752
|
+
]), 1032, ["cache-identifier", "client-sort", "empty-state-action-message", "empty-state-action-route", "empty-state-icon-variant", "empty-state-message", "empty-state-title", "error", "error-state-message", "error-state-title", "fetcher", "fetcher-cache-key", "headers", "hide-pagination", "hide-pagination-when-optional", "hide-toolbar", "initial-fetcher-params", "loading", "pagination-attributes", "row-key", "search-input", "sort-handler-function", "sortable", "table-preferences", "onRow:click"]),
|
|
3753
|
+
_.$slots["outside-actions"] && g(b) ? (f(), A("div", qa, [
|
|
3754
|
+
M(_.$slots, "outside-actions", {}, void 0, !0)
|
|
3755
|
+
])) : B("", !0)
|
|
3756
|
+
]),
|
|
3757
|
+
_: 3
|
|
3758
|
+
}, 8, ["title", "title-tag"]);
|
|
3759
|
+
};
|
|
3760
|
+
}
|
|
3761
|
+
}), uc = /* @__PURE__ */ se(Ha, [["__scopeId", "data-v-09e101d4"]]), za = {
|
|
3762
|
+
key: 0,
|
|
3763
|
+
class: "kong-ui-entity-delete-error"
|
|
3764
|
+
}, Va = {
|
|
3765
|
+
key: 1,
|
|
3766
|
+
class: "description"
|
|
3767
|
+
}, Ya = /* @__PURE__ */ ee({
|
|
3768
|
+
__name: "EntityDeleteModal",
|
|
3769
|
+
props: {
|
|
3770
|
+
visible: {
|
|
3771
|
+
type: Boolean,
|
|
3772
|
+
required: !0
|
|
3773
|
+
},
|
|
3774
|
+
title: {
|
|
3775
|
+
type: String,
|
|
3776
|
+
default: "Delete"
|
|
3777
|
+
},
|
|
3778
|
+
entityType: {
|
|
3779
|
+
type: String,
|
|
3780
|
+
required: !0
|
|
3781
|
+
},
|
|
3782
|
+
entityName: {
|
|
3783
|
+
type: String,
|
|
3784
|
+
default: ""
|
|
3785
|
+
},
|
|
3786
|
+
entityTypeDisplay: {
|
|
3787
|
+
type: String,
|
|
3788
|
+
default: ""
|
|
3789
|
+
},
|
|
3790
|
+
needConfirm: {
|
|
3791
|
+
type: Boolean,
|
|
3792
|
+
default: !0
|
|
3793
|
+
},
|
|
3794
|
+
description: {
|
|
3795
|
+
type: String,
|
|
3796
|
+
default: ""
|
|
3797
|
+
},
|
|
3798
|
+
actionPending: {
|
|
3799
|
+
type: Boolean,
|
|
3800
|
+
default: !1
|
|
3801
|
+
},
|
|
3802
|
+
error: {
|
|
3803
|
+
type: String,
|
|
3804
|
+
default: ""
|
|
3805
|
+
},
|
|
3806
|
+
confirmationPrompt: {
|
|
3807
|
+
type: String,
|
|
3808
|
+
default: ""
|
|
3809
|
+
},
|
|
3810
|
+
// Konnect-managed Redis delete UI
|
|
3811
|
+
stackedCopy: {
|
|
3812
|
+
type: Boolean,
|
|
3813
|
+
default: !1
|
|
3814
|
+
}
|
|
3815
|
+
},
|
|
3816
|
+
emits: ["cancel", "proceed"],
|
|
3817
|
+
setup(e, { emit: t }) {
|
|
3818
|
+
const { i18nT: n } = G.useI18n(), i = e, r = t, a = T(
|
|
3819
|
+
() => i.entityTypeDisplay.trim() !== "" ? i.entityTypeDisplay : i.entityType
|
|
3820
|
+
), o = T(() => i.needConfirm ? i.entityName : ""), l = () => {
|
|
3821
|
+
r("cancel");
|
|
3822
|
+
}, c = () => {
|
|
3823
|
+
r("proceed");
|
|
3824
|
+
};
|
|
3825
|
+
return (d, y) => {
|
|
3826
|
+
const u = L("KAlert"), v = L("KPrompt");
|
|
3827
|
+
return f(), E(v, {
|
|
3828
|
+
"action-button-appearance": "danger",
|
|
3829
|
+
"action-button-disabled": e.actionPending,
|
|
3830
|
+
"action-button-text": "Yes, delete",
|
|
3831
|
+
class: ue(["kong-ui-entity-delete-modal", { "kong-ui-entity-delete-modal-stacked-copy": e.stackedCopy }]),
|
|
3832
|
+
"confirmation-prompt": e.confirmationPrompt || void 0,
|
|
3833
|
+
"confirmation-text": o.value,
|
|
3834
|
+
"data-testid": "entity-delete-modal",
|
|
3835
|
+
title: e.title,
|
|
3836
|
+
visible: e.visible,
|
|
3837
|
+
onCancel: l,
|
|
3838
|
+
onProceed: c
|
|
3839
|
+
}, {
|
|
3840
|
+
default: k(() => [
|
|
3841
|
+
F("div", {
|
|
3842
|
+
class: ue(["body", { "body-stacked-copy": e.stackedCopy }])
|
|
3843
|
+
}, [
|
|
3844
|
+
e.error ? (f(), A("div", za, [
|
|
3845
|
+
K(u, { appearance: "danger" }, {
|
|
3846
|
+
default: k(() => [
|
|
3847
|
+
P(S(e.error), 1)
|
|
3848
|
+
]),
|
|
3849
|
+
_: 1
|
|
3850
|
+
})
|
|
3851
|
+
])) : B("", !0),
|
|
3852
|
+
M(d.$slots, "message", {}, () => [
|
|
3853
|
+
K(g(n), {
|
|
3854
|
+
class: "message",
|
|
3855
|
+
keypath: i.entityName ? "deleteModal.messageWithName" : "deleteModal.message",
|
|
3856
|
+
tag: "p"
|
|
3857
|
+
}, we({
|
|
3858
|
+
entityType: k(() => [
|
|
3859
|
+
P(S(a.value), 1)
|
|
3860
|
+
]),
|
|
3861
|
+
_: 2
|
|
3862
|
+
}, [
|
|
3863
|
+
i.entityName ? {
|
|
3864
|
+
name: "entityName",
|
|
3865
|
+
fn: k(() => [
|
|
3866
|
+
F("strong", null, S(i.entityName), 1)
|
|
3867
|
+
]),
|
|
3868
|
+
key: "0"
|
|
3869
|
+
} : void 0
|
|
3870
|
+
]), 1032, ["keypath"])
|
|
3871
|
+
], !0),
|
|
3872
|
+
i.description || d.$slots.description ? (f(), A("div", Va, [
|
|
3873
|
+
M(d.$slots, "description", {}, () => [
|
|
3874
|
+
F("p", null, S(i.description), 1)
|
|
3875
|
+
], !0)
|
|
3876
|
+
])) : B("", !0)
|
|
3877
|
+
], 2)
|
|
3878
|
+
]),
|
|
3879
|
+
_: 3
|
|
3880
|
+
}, 8, ["action-button-disabled", "class", "confirmation-prompt", "confirmation-text", "title", "visible"]);
|
|
3881
|
+
};
|
|
3882
|
+
}
|
|
3883
|
+
}), dc = /* @__PURE__ */ se(Ya, [["__scopeId", "data-v-fc366e0c"]]), Wa = {
|
|
3884
|
+
fill: "none",
|
|
3885
|
+
height: "20",
|
|
3886
|
+
viewBox: "0 0 20 20",
|
|
3887
|
+
width: "20",
|
|
3888
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
3889
|
+
}, Ga = {
|
|
3890
|
+
id: "mask0_180_20349",
|
|
3891
|
+
height: "20",
|
|
3892
|
+
"mask-type": "alpha",
|
|
3893
|
+
maskUnits: "userSpaceOnUse",
|
|
3894
|
+
width: "20",
|
|
3895
|
+
x: "0",
|
|
3896
|
+
y: "0"
|
|
3897
|
+
}, Ja = ["fill"], Qa = { mask: "url(#mask0_180_20349)" }, Xa = ["fill"], Pt = /* @__PURE__ */ ee({
|
|
3898
|
+
__name: "IconFilter",
|
|
3899
|
+
props: {
|
|
3900
|
+
color: {
|
|
3901
|
+
type: String,
|
|
3902
|
+
default: `var(--kong-ui-entity-filter-color, ${Ti})`
|
|
3903
|
+
}
|
|
3904
|
+
},
|
|
3905
|
+
setup(e) {
|
|
3906
|
+
return (t, n) => (f(), A("svg", Wa, [
|
|
3907
|
+
F("mask", Ga, [
|
|
3908
|
+
F("rect", {
|
|
3909
|
+
fill: e.color,
|
|
3910
|
+
height: "20",
|
|
3911
|
+
width: "20"
|
|
3912
|
+
}, null, 8, Ja)
|
|
3913
|
+
]),
|
|
3914
|
+
F("g", Qa, [
|
|
3915
|
+
F("path", {
|
|
3916
|
+
d: "M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",
|
|
3917
|
+
fill: e.color
|
|
3918
|
+
}, null, 8, Xa)
|
|
3919
|
+
])
|
|
3920
|
+
]));
|
|
3921
|
+
}
|
|
3922
|
+
}), Za = {
|
|
3923
|
+
key: 1,
|
|
3924
|
+
class: "kong-ui-entity-filter"
|
|
3925
|
+
}, el = { class: "kong-ui-entity-filter-menu" }, tl = ["data-testid"], nl = ["onClick", "onKeydown"], il = { class: "menu-item-indicator" }, rl = { class: "menu-item-body" }, ol = ["for"], al = { class: "menu-item-buttons" }, ll = { class: "filter-clear-button-container" }, cl = /* @__PURE__ */ ee({
|
|
3926
|
+
__name: "EntityFilter",
|
|
3927
|
+
props: {
|
|
3928
|
+
// filter config, either exact match or fuzzy match
|
|
3929
|
+
config: {
|
|
3930
|
+
type: Object,
|
|
3931
|
+
required: !0,
|
|
3932
|
+
default: () => ({
|
|
3933
|
+
isExactMatch: !0,
|
|
3934
|
+
placeholder: ""
|
|
3935
|
+
})
|
|
3936
|
+
},
|
|
3937
|
+
// query string
|
|
3938
|
+
modelValue: {
|
|
3939
|
+
type: String,
|
|
3940
|
+
required: !0
|
|
3941
|
+
}
|
|
3942
|
+
},
|
|
3943
|
+
emits: ["update:modelValue"],
|
|
3944
|
+
setup(e, { emit: t }) {
|
|
3945
|
+
const { i18n: { t: n } } = G.useI18n(), i = e, r = t, a = q(!1), o = q({}), l = q(/* @__PURE__ */ new Set()), c = T(() => {
|
|
3946
|
+
const w = [];
|
|
3947
|
+
return new URLSearchParams(i.modelValue).forEach(($, O) => {
|
|
3948
|
+
$ !== "" && w.push(O);
|
|
3949
|
+
}), w;
|
|
3950
|
+
}), d = T(() => {
|
|
3951
|
+
const w = i.config.fields;
|
|
3952
|
+
return Object.keys(w).filter(($) => {
|
|
3953
|
+
var O;
|
|
3954
|
+
return (O = w == null ? void 0 : w[$]) == null ? void 0 : O.searchable;
|
|
3955
|
+
}).map(($) => ({
|
|
3956
|
+
label: w[$].label || $,
|
|
3957
|
+
value: $,
|
|
3958
|
+
expanded: !1
|
|
3959
|
+
}));
|
|
3960
|
+
});
|
|
3961
|
+
Ce(() => i.modelValue, (w) => {
|
|
3962
|
+
o.value = {}, new URLSearchParams(w).forEach(($, O) => {
|
|
3963
|
+
o.value[O] = $;
|
|
3964
|
+
});
|
|
3965
|
+
});
|
|
3966
|
+
const y = () => {
|
|
3967
|
+
a.value = !a.value;
|
|
3968
|
+
}, u = (w) => {
|
|
3969
|
+
l.value.has(w) ? l.value.delete(w) : l.value.add(w);
|
|
3970
|
+
}, v = (w) => {
|
|
3971
|
+
r("update:modelValue", w);
|
|
3972
|
+
}, s = () => {
|
|
3973
|
+
v("");
|
|
3974
|
+
}, h = (w) => `filter-${w}`, m = (w) => {
|
|
3975
|
+
var $, O;
|
|
3976
|
+
return (((O = ($ = i.config.schema) == null ? void 0 : $[w]) == null ? void 0 : O.values) ?? []).map((_) => typeof _ == "string" ? { value: _, label: _ } : _);
|
|
3977
|
+
}, p = (w) => {
|
|
3978
|
+
var $, O;
|
|
3979
|
+
return ((O = ($ = i.config.schema) == null ? void 0 : $[w]) == null ? void 0 : O.type) ?? "text";
|
|
3980
|
+
}, b = (w) => {
|
|
3981
|
+
o.value = {
|
|
3982
|
+
...o.value,
|
|
3983
|
+
[w]: ""
|
|
3984
|
+
}, R();
|
|
3985
|
+
}, C = () => {
|
|
3986
|
+
o.value = {}, R(!0);
|
|
3987
|
+
}, R = (w = !1) => {
|
|
3988
|
+
const $ = Object.keys(o.value).reduce((O, _) => (o.value[_] && (O[_] = `${o.value[_]}`), O), {});
|
|
3989
|
+
w && (a.value = !1), r("update:modelValue", new URLSearchParams($).toString());
|
|
3990
|
+
}, z = (w) => {
|
|
3991
|
+
var $, O;
|
|
3992
|
+
return !!((O = ($ = i.config.schema) == null ? void 0 : $[w]) != null && O.filterFunction);
|
|
3993
|
+
}, Y = (w, $) => {
|
|
3994
|
+
var _;
|
|
3995
|
+
const O = (_ = i.config.schema) == null ? void 0 : _[w];
|
|
3996
|
+
return (O == null ? void 0 : O.filterFunction) === void 0 ? !0 : O.filterFunction($);
|
|
3997
|
+
};
|
|
3998
|
+
return (w, $) => {
|
|
3999
|
+
const O = L("KInput"), _ = L("KButton"), j = L("KSelect");
|
|
4000
|
+
return e.config.isExactMatch ? (f(), E(O, {
|
|
4001
|
+
key: 0,
|
|
4002
|
+
autocomplete: "off",
|
|
4003
|
+
class: "kong-ui-entity-filter-input",
|
|
4004
|
+
"data-testid": "search-input",
|
|
4005
|
+
"model-value": e.modelValue,
|
|
4006
|
+
placeholder: e.config.placeholder,
|
|
4007
|
+
"onUpdate:modelValue": v
|
|
4008
|
+
}, {
|
|
4009
|
+
before: k(() => [
|
|
4010
|
+
K(Pt)
|
|
4011
|
+
]),
|
|
4012
|
+
after: k(() => [
|
|
4013
|
+
$e(K(g(yi), {
|
|
4014
|
+
class: "kong-ui-entity-filter-clear",
|
|
4015
|
+
role: "button",
|
|
4016
|
+
tabindex: "0",
|
|
4017
|
+
onClick: s
|
|
4018
|
+
}, null, 512), [
|
|
4019
|
+
[Ee, e.modelValue !== ""]
|
|
4020
|
+
])
|
|
4021
|
+
]),
|
|
4022
|
+
_: 1
|
|
4023
|
+
}, 8, ["model-value", "placeholder"])) : (f(), A("div", Za, [
|
|
4024
|
+
K(_, {
|
|
4025
|
+
appearance: "tertiary",
|
|
4026
|
+
"data-testid": "filter-button",
|
|
4027
|
+
onClick: y
|
|
4028
|
+
}, {
|
|
4029
|
+
default: k(() => [
|
|
4030
|
+
K(Pt),
|
|
4031
|
+
P(" " + S(g(n)("filter.filterButtonText")) + " " + S(c.value.length > 0 ? `(${c.value.length})` : ""), 1)
|
|
4032
|
+
]),
|
|
4033
|
+
_: 1
|
|
4034
|
+
}),
|
|
4035
|
+
$e(F("div", {
|
|
4036
|
+
class: "kong-ui-entity-filter-backdrop",
|
|
4037
|
+
onClick: y
|
|
4038
|
+
}, null, 512), [
|
|
4039
|
+
[Ee, a.value]
|
|
4040
|
+
]),
|
|
4041
|
+
$e(F("div", el, [
|
|
4042
|
+
(f(!0), A(pe, null, he(d.value, (D) => {
|
|
4043
|
+
var J, H;
|
|
4044
|
+
return f(), A("div", {
|
|
4045
|
+
key: D.value,
|
|
4046
|
+
class: "kong-ui-entity-filter-menu-item",
|
|
4047
|
+
"data-testid": D.value
|
|
4048
|
+
}, [
|
|
4049
|
+
F("span", {
|
|
4050
|
+
class: ue(["menu-item-title", { expanded: l.value.has(D.value) }]),
|
|
4051
|
+
role: "button",
|
|
4052
|
+
tabindex: "0",
|
|
4053
|
+
onClick: (te) => u(D.value),
|
|
4054
|
+
onKeydown: Vn((te) => u(D.value), ["enter"])
|
|
4055
|
+
}, [
|
|
4056
|
+
P(S(D.label) + " ", 1),
|
|
4057
|
+
$e(F("span", il, null, 512), [
|
|
4058
|
+
[Ee, c.value.includes(D.value)]
|
|
4059
|
+
]),
|
|
4060
|
+
K(g(gi), {
|
|
4061
|
+
class: ue(["menu-item-expand-icon", { expanded: l.value.has(D.value) }]),
|
|
4062
|
+
color: g($i)
|
|
4063
|
+
}, null, 8, ["class", "color"])
|
|
4064
|
+
], 42, nl),
|
|
4065
|
+
$e(F("div", rl, [
|
|
4066
|
+
F("label", {
|
|
4067
|
+
class: "menu-item-label",
|
|
4068
|
+
for: h(D.value)
|
|
4069
|
+
}, S(g(n)("filter.fieldLabel")), 9, ol),
|
|
4070
|
+
((H = (J = e.config.schema) == null ? void 0 : J[D.value]) == null ? void 0 : H.type) === "select" ? (f(), E(j, {
|
|
4071
|
+
key: 0,
|
|
4072
|
+
id: h(D.value),
|
|
4073
|
+
modelValue: o.value[D.value],
|
|
4074
|
+
"onUpdate:modelValue": (te) => o.value[D.value] = te,
|
|
4075
|
+
"enable-filtering": z(D.value),
|
|
4076
|
+
"filter-function": (te) => Y(D.value, te),
|
|
4077
|
+
items: m(D.value),
|
|
4078
|
+
placeholder: g(n)("filter.selectPlaceholder")
|
|
4079
|
+
}, null, 8, ["id", "modelValue", "onUpdate:modelValue", "enable-filtering", "filter-function", "items", "placeholder"])) : (f(), E(O, {
|
|
4080
|
+
key: 1,
|
|
4081
|
+
id: h(D.value),
|
|
4082
|
+
modelValue: o.value[D.value],
|
|
4083
|
+
"onUpdate:modelValue": (te) => o.value[D.value] = te,
|
|
4084
|
+
autocomplete: "off",
|
|
4085
|
+
placeholder: g(n)("filter.inputPlaceholder"),
|
|
4086
|
+
type: p(D.value)
|
|
4087
|
+
}, null, 8, ["id", "modelValue", "onUpdate:modelValue", "placeholder", "type"]))
|
|
4088
|
+
], 512), [
|
|
4089
|
+
[Ee, l.value.has(D.value)]
|
|
4090
|
+
]),
|
|
4091
|
+
$e(F("div", al, [
|
|
4092
|
+
K(_, {
|
|
4093
|
+
appearance: "tertiary",
|
|
4094
|
+
"data-testid": "apply-filter",
|
|
4095
|
+
size: "small",
|
|
4096
|
+
onClick: $[0] || ($[0] = (te) => R(!0))
|
|
4097
|
+
}, {
|
|
4098
|
+
default: k(() => [
|
|
4099
|
+
P(S(g(n)("filter.applyButtonText")), 1)
|
|
4100
|
+
]),
|
|
4101
|
+
_: 1
|
|
4102
|
+
}),
|
|
4103
|
+
K(_, {
|
|
4104
|
+
appearance: "tertiary",
|
|
4105
|
+
"data-testid": "clear-filter",
|
|
4106
|
+
size: "small",
|
|
4107
|
+
onClick: (te) => b(D.value)
|
|
4108
|
+
}, {
|
|
4109
|
+
default: k(() => [
|
|
4110
|
+
P(S(g(n)("filter.clearButtonText")), 1)
|
|
4111
|
+
]),
|
|
4112
|
+
_: 1
|
|
4113
|
+
}, 8, ["onClick"])
|
|
4114
|
+
], 512), [
|
|
4115
|
+
[Ee, l.value.has(D.value)]
|
|
4116
|
+
])
|
|
4117
|
+
], 8, tl);
|
|
4118
|
+
}), 128)),
|
|
4119
|
+
F("div", ll, [
|
|
4120
|
+
K(_, {
|
|
4121
|
+
appearance: "tertiary",
|
|
4122
|
+
size: "small",
|
|
4123
|
+
onClick: C
|
|
4124
|
+
}, {
|
|
4125
|
+
default: k(() => [
|
|
4126
|
+
P(S(g(n)("filter.clearAllButtonText")), 1)
|
|
4127
|
+
]),
|
|
4128
|
+
_: 1
|
|
4129
|
+
})
|
|
4130
|
+
])
|
|
4131
|
+
], 512), [
|
|
4132
|
+
[Ee, a.value]
|
|
4133
|
+
])
|
|
4134
|
+
]));
|
|
4135
|
+
};
|
|
4136
|
+
}
|
|
4137
|
+
}), fc = /* @__PURE__ */ se(cl, [["__scopeId", "data-v-d3d2bd8b"]]), pc = /* @__PURE__ */ ee({
|
|
4138
|
+
__name: "EntityToggleModal",
|
|
4139
|
+
props: {
|
|
4140
|
+
visible: {
|
|
4141
|
+
type: Boolean,
|
|
4142
|
+
required: !0
|
|
4143
|
+
},
|
|
4144
|
+
action: {
|
|
4145
|
+
type: String,
|
|
4146
|
+
// 'enable' | 'disable'
|
|
4147
|
+
required: !0
|
|
4148
|
+
},
|
|
4149
|
+
entityId: {
|
|
4150
|
+
type: String,
|
|
4151
|
+
required: !0
|
|
4152
|
+
},
|
|
4153
|
+
entityType: {
|
|
4154
|
+
type: String,
|
|
4155
|
+
required: !0
|
|
4156
|
+
},
|
|
4157
|
+
entityName: {
|
|
4158
|
+
type: String,
|
|
4159
|
+
required: !0
|
|
4160
|
+
},
|
|
4161
|
+
onConfirm: {
|
|
4162
|
+
type: Function,
|
|
4163
|
+
required: !1,
|
|
4164
|
+
default: null
|
|
4165
|
+
}
|
|
4166
|
+
},
|
|
4167
|
+
emits: ["cancel", "proceed"],
|
|
4168
|
+
setup(e, { emit: t }) {
|
|
4169
|
+
const { i18n: { t: n }, i18nT: i } = G.useI18n(), r = e, a = t, o = q(!1), l = T(
|
|
4170
|
+
() => r.action === "enable" ? n("toggleModal.enable.title", { entityType: r.entityType }) : n("toggleModal.disable.title", { entityType: r.entityType })
|
|
4171
|
+
), c = T(
|
|
4172
|
+
() => r.action === "enable" ? n("toggleModal.enable.confirmText") : n("toggleModal.disable.confirmText")
|
|
4173
|
+
), d = () => a("cancel"), y = async () => {
|
|
4174
|
+
if (r.onConfirm) {
|
|
4175
|
+
o.value = !0;
|
|
4176
|
+
try {
|
|
4177
|
+
await r.onConfirm(), a("proceed");
|
|
4178
|
+
} catch (u) {
|
|
4179
|
+
console.error(u);
|
|
4180
|
+
} finally {
|
|
4181
|
+
o.value = !1;
|
|
4182
|
+
}
|
|
4183
|
+
}
|
|
4184
|
+
};
|
|
4185
|
+
return (u, v) => {
|
|
4186
|
+
const s = L("KPrompt");
|
|
4187
|
+
return f(), E(Ut, { to: "body" }, [
|
|
4188
|
+
K(s, {
|
|
4189
|
+
"action-button-disabled": o.value,
|
|
4190
|
+
"action-button-text": c.value,
|
|
4191
|
+
"data-testid": `${e.entityType}-${e.entityId}-toggle-prompt`,
|
|
4192
|
+
title: l.value,
|
|
4193
|
+
visible: e.visible,
|
|
4194
|
+
onCancel: d,
|
|
4195
|
+
onProceed: y
|
|
4196
|
+
}, {
|
|
4197
|
+
default: k(() => [
|
|
4198
|
+
K(g(i), {
|
|
4199
|
+
keypath: `toggleModal.${r.action}.message`,
|
|
4200
|
+
scope: "global"
|
|
4201
|
+
}, {
|
|
4202
|
+
entityType: k(() => [
|
|
4203
|
+
P(S(e.entityType), 1)
|
|
4204
|
+
]),
|
|
4205
|
+
entityName: k(() => [
|
|
4206
|
+
F("strong", null, S(e.entityName), 1)
|
|
4207
|
+
]),
|
|
4208
|
+
_: 1
|
|
4209
|
+
}, 8, ["keypath"])
|
|
4210
|
+
]),
|
|
4211
|
+
_: 1
|
|
4212
|
+
}, 8, ["action-button-disabled", "action-button-text", "data-testid", "title", "visible"])
|
|
4213
|
+
]);
|
|
4214
|
+
};
|
|
4215
|
+
}
|
|
4216
|
+
}), mc = /* @__PURE__ */ ee({
|
|
4217
|
+
__name: "PermissionsWrapper",
|
|
4218
|
+
props: {
|
|
4219
|
+
/**
|
|
4220
|
+
* Provide an async function that returns a boolean to determine whether
|
|
4221
|
+
* the wrapper should hide or show the default slot content.
|
|
4222
|
+
*/
|
|
4223
|
+
authFunction: {
|
|
4224
|
+
type: Function,
|
|
4225
|
+
required: !0,
|
|
4226
|
+
default: async () => !0
|
|
4227
|
+
},
|
|
4228
|
+
/**
|
|
4229
|
+
* Should the default slot content be shown once the authFunction is evaluated no matter what?
|
|
4230
|
+
* e.g. if you want to display the item but disable it.
|
|
4231
|
+
*/
|
|
4232
|
+
forceShow: {
|
|
4233
|
+
type: Boolean,
|
|
4234
|
+
default: !1
|
|
4235
|
+
}
|
|
4236
|
+
},
|
|
4237
|
+
setup(e) {
|
|
4238
|
+
const t = e, n = q(void 0), i = T(() => n.value === !0 || n.value !== void 0 && t.forceShow === !0);
|
|
4239
|
+
return Ce(() => t.authFunction, async () => {
|
|
4240
|
+
n.value = await t.authFunction();
|
|
4241
|
+
}, { immediate: !0 }), (r, a) => i.value ? M(r.$slots, "default", {
|
|
4242
|
+
key: 0,
|
|
4243
|
+
isAllowed: n.value
|
|
4244
|
+
}) : B("", !0);
|
|
4245
|
+
}
|
|
4246
|
+
}), le = [];
|
|
4247
|
+
for (let e = 0; e < 256; ++e)
|
|
4248
|
+
le.push((e + 256).toString(16).slice(1));
|
|
4249
|
+
function sl(e, t = 0) {
|
|
4250
|
+
return (le[e[t + 0]] + le[e[t + 1]] + le[e[t + 2]] + le[e[t + 3]] + "-" + le[e[t + 4]] + le[e[t + 5]] + "-" + le[e[t + 6]] + le[e[t + 7]] + "-" + le[e[t + 8]] + le[e[t + 9]] + "-" + le[e[t + 10]] + le[e[t + 11]] + le[e[t + 12]] + le[e[t + 13]] + le[e[t + 14]] + le[e[t + 15]]).toLowerCase();
|
|
4251
|
+
}
|
|
4252
|
+
const ul = new Uint8Array(16);
|
|
4253
|
+
function dl() {
|
|
4254
|
+
return crypto.getRandomValues(ul);
|
|
4255
|
+
}
|
|
4256
|
+
function fl(e, t, n) {
|
|
4257
|
+
return crypto.randomUUID ? crypto.randomUUID() : pl(e);
|
|
4258
|
+
}
|
|
4259
|
+
function pl(e, t, n) {
|
|
4260
|
+
var r;
|
|
4261
|
+
e = e || {};
|
|
4262
|
+
const i = e.random ?? ((r = e.rng) == null ? void 0 : r.call(e)) ?? dl();
|
|
4263
|
+
if (i.length < 16)
|
|
4264
|
+
throw new Error("Random bytes length must be >= 16");
|
|
4265
|
+
return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, sl(i);
|
|
4266
|
+
}
|
|
4267
|
+
const ml = ["aria-labelledby"], yl = { class: "form-section-wrapper" }, gl = {
|
|
4268
|
+
key: 1,
|
|
4269
|
+
class: "form-section-description"
|
|
4270
|
+
}, hl = {
|
|
4271
|
+
key: 2,
|
|
4272
|
+
class: "form-section-footer"
|
|
4273
|
+
}, vl = { class: "form-section-content" }, kl = /* @__PURE__ */ ee({
|
|
4274
|
+
__name: "EntityFormSection",
|
|
4275
|
+
props: {
|
|
4276
|
+
title: {
|
|
4277
|
+
type: String,
|
|
4278
|
+
default: ""
|
|
4279
|
+
},
|
|
4280
|
+
description: {
|
|
4281
|
+
type: String,
|
|
4282
|
+
default: ""
|
|
4283
|
+
},
|
|
4284
|
+
hasDivider: {
|
|
4285
|
+
type: Boolean,
|
|
4286
|
+
default: !1
|
|
4287
|
+
},
|
|
4288
|
+
stickyInfoHeader: {
|
|
4289
|
+
type: Boolean,
|
|
4290
|
+
default: !0
|
|
4291
|
+
},
|
|
4292
|
+
hideInfoHeader: {
|
|
4293
|
+
type: Boolean,
|
|
4294
|
+
default: !1
|
|
4295
|
+
},
|
|
4296
|
+
titleTag: {
|
|
4297
|
+
type: String,
|
|
4298
|
+
default: "h2"
|
|
4299
|
+
}
|
|
4300
|
+
},
|
|
4301
|
+
setup(e) {
|
|
4302
|
+
const t = Ue(), n = fl();
|
|
4303
|
+
return (i, r) => (f(), A("div", {
|
|
4304
|
+
"aria-labelledby": e.title ? g(n) : void 0,
|
|
4305
|
+
class: ue(["kong-ui-entity-form-section", { "has-divider": e.hasDivider }]),
|
|
4306
|
+
role: "group"
|
|
4307
|
+
}, [
|
|
4308
|
+
F("div", yl, [
|
|
4309
|
+
e.hideInfoHeader ? B("", !0) : (f(), A("div", {
|
|
4310
|
+
key: 0,
|
|
4311
|
+
class: ue(["form-section-info", { sticky: e.stickyInfoHeader }])
|
|
4312
|
+
}, [
|
|
4313
|
+
e.title ? (f(), E(je(e.titleTag), {
|
|
4314
|
+
key: 0,
|
|
4315
|
+
id: g(n),
|
|
4316
|
+
class: "form-section-title"
|
|
4317
|
+
}, {
|
|
4318
|
+
default: k(() => [
|
|
4319
|
+
P(S(e.title), 1)
|
|
4320
|
+
]),
|
|
4321
|
+
_: 1
|
|
4322
|
+
}, 8, ["id"])) : B("", !0),
|
|
4323
|
+
e.description || g(t).description ? (f(), A("div", gl, [
|
|
4324
|
+
M(i.$slots, "description", {}, () => [
|
|
4325
|
+
F("p", null, S(e.description), 1)
|
|
4326
|
+
], !0)
|
|
4327
|
+
])) : B("", !0),
|
|
4328
|
+
g(t).footer ? (f(), A("div", hl, [
|
|
4329
|
+
M(i.$slots, "footer", {}, void 0, !0)
|
|
4330
|
+
])) : B("", !0)
|
|
4331
|
+
], 2)),
|
|
4332
|
+
F("div", vl, [
|
|
4333
|
+
M(i.$slots, "default", {}, void 0, !0)
|
|
4334
|
+
])
|
|
4335
|
+
])
|
|
4336
|
+
], 10, ml));
|
|
4337
|
+
}
|
|
4338
|
+
}), yc = /* @__PURE__ */ se(kl, [["__scopeId", "data-v-ccd29028"]]), bl = { class: "header" }, Cl = {
|
|
4339
|
+
key: 0,
|
|
4340
|
+
class: "step",
|
|
4341
|
+
"data-testid": "form-block-step"
|
|
4342
|
+
}, xl = { class: "header-content" }, Al = {
|
|
4343
|
+
class: "header-title",
|
|
4344
|
+
"data-testid": "header-title"
|
|
4345
|
+
}, Sl = {
|
|
4346
|
+
key: 0,
|
|
4347
|
+
class: "header-description",
|
|
4348
|
+
"data-testid": "header-description"
|
|
4349
|
+
}, _l = {
|
|
4350
|
+
key: 1,
|
|
4351
|
+
class: "header-extra",
|
|
4352
|
+
"data-testid": "header-extra"
|
|
4353
|
+
}, Tl = {
|
|
4354
|
+
class: "content",
|
|
4355
|
+
"data-testid": "form-block-content"
|
|
4356
|
+
}, wl = /* @__PURE__ */ ee({
|
|
4357
|
+
__name: "EntityFormBlock",
|
|
4358
|
+
props: {
|
|
4359
|
+
step: { default: () => {
|
|
4360
|
+
} },
|
|
4361
|
+
title: { default: "" },
|
|
4362
|
+
description: { default: "" }
|
|
4363
|
+
},
|
|
4364
|
+
setup(e) {
|
|
4365
|
+
const t = Ue();
|
|
4366
|
+
return (n, i) => (f(), A("div", {
|
|
4367
|
+
class: ue(["kong-ui-entity-form-block", {
|
|
4368
|
+
stepped: e.step !== void 0 || t.step
|
|
4369
|
+
}])
|
|
4370
|
+
}, [
|
|
4371
|
+
F("header", bl, [
|
|
4372
|
+
e.step !== void 0 || t.step ? (f(), A("div", Cl, [
|
|
4373
|
+
M(n.$slots, "step", {}, () => [
|
|
4374
|
+
P(S(e.step), 1)
|
|
4375
|
+
], !0)
|
|
4376
|
+
])) : B("", !0),
|
|
4377
|
+
F("div", xl, [
|
|
4378
|
+
F("h2", Al, [
|
|
4379
|
+
M(n.$slots, "title", {}, () => [
|
|
4380
|
+
P(S(e.title), 1)
|
|
4381
|
+
], !0)
|
|
4382
|
+
]),
|
|
4383
|
+
e.description || t.description ? (f(), A("div", Sl, [
|
|
4384
|
+
M(n.$slots, "description", {}, () => [
|
|
4385
|
+
P(S(e.description), 1)
|
|
4386
|
+
], !0)
|
|
4387
|
+
])) : B("", !0)
|
|
4388
|
+
]),
|
|
4389
|
+
t.extra ? (f(), A("div", _l, [
|
|
4390
|
+
M(n.$slots, "extra", {}, void 0, !0)
|
|
4391
|
+
])) : B("", !0)
|
|
4392
|
+
]),
|
|
4393
|
+
F("div", Tl, [
|
|
4394
|
+
M(n.$slots, "default", {}, void 0, !0)
|
|
4395
|
+
])
|
|
4396
|
+
], 2));
|
|
4397
|
+
}
|
|
4398
|
+
}), gc = /* @__PURE__ */ se(wl, [["__scopeId", "data-v-8e48a559"]]), $l = {
|
|
4399
|
+
class: "kong-ui-public-entity-link",
|
|
4400
|
+
"data-testid": "entity-link-parent"
|
|
4401
|
+
}, El = {
|
|
4402
|
+
key: 0,
|
|
4403
|
+
class: "deleted-entity"
|
|
4404
|
+
}, Il = { key: 1 }, Fl = ["onClick"], Ol = /* @__PURE__ */ ee({
|
|
4405
|
+
__name: "EntityLink",
|
|
4406
|
+
props: {
|
|
4407
|
+
entityLinkData: {
|
|
4408
|
+
type: Object,
|
|
4409
|
+
required: !0
|
|
4410
|
+
},
|
|
4411
|
+
externalLink: {
|
|
4412
|
+
type: String,
|
|
4413
|
+
required: !1,
|
|
4414
|
+
default: ""
|
|
4415
|
+
},
|
|
4416
|
+
newWindow: {
|
|
4417
|
+
type: Boolean,
|
|
4418
|
+
required: !1,
|
|
4419
|
+
default: !1
|
|
4420
|
+
},
|
|
4421
|
+
allowCopy: {
|
|
4422
|
+
type: Boolean,
|
|
4423
|
+
required: !1,
|
|
4424
|
+
default: !1
|
|
4425
|
+
}
|
|
4426
|
+
},
|
|
4427
|
+
setup(e) {
|
|
4428
|
+
const t = e, n = q(), { isTruncated: i } = G.useTruncationDetector(n), { i18n: { t: r } } = G.useI18n(), a = r("global.actions.copyId"), o = q(a), l = T(() => t.entityLinkData.deleted ?? !1), c = T(() => {
|
|
4429
|
+
var u;
|
|
4430
|
+
return (u = t.entityLinkData.id) != null && u.toString().includes(":") ? t.entityLinkData.id.toString().split(":")[1] : t.entityLinkData.id;
|
|
4431
|
+
}), d = T(() => {
|
|
4432
|
+
var u;
|
|
4433
|
+
return `${(u = c.value) == null ? void 0 : u.toString().slice(0, 5)} (deleted)`;
|
|
4434
|
+
}), y = async (u) => {
|
|
4435
|
+
await u(c.value || "") && (o.value = r("global.actions.copyToClipboard"), setTimeout(() => {
|
|
4436
|
+
o.value = a;
|
|
4437
|
+
}, 1800));
|
|
4438
|
+
};
|
|
4439
|
+
return (u, v) => {
|
|
4440
|
+
const s = L("KTooltip"), h = L("KExternalLink"), m = L("KClipboardProvider");
|
|
4441
|
+
return f(), A("div", $l, [
|
|
4442
|
+
l.value ? (f(), A("div", El, S(d.value), 1)) : c.value ? c.value ? (f(), E(h, {
|
|
4443
|
+
key: 2,
|
|
4444
|
+
class: "entity-link",
|
|
4445
|
+
"hide-icon": !e.newWindow,
|
|
4446
|
+
href: e.externalLink,
|
|
4447
|
+
target: e.newWindow ? "_blank" : "_self"
|
|
4448
|
+
}, {
|
|
4449
|
+
default: k(() => [
|
|
4450
|
+
K(s, {
|
|
4451
|
+
text: g(i) && e.entityLinkData.label || ""
|
|
4452
|
+
}, {
|
|
4453
|
+
default: k(() => [
|
|
4454
|
+
F("span", {
|
|
4455
|
+
ref_key: "textContent",
|
|
4456
|
+
ref: n,
|
|
4457
|
+
class: "entity-link-label"
|
|
4458
|
+
}, S(e.entityLinkData.label), 513)
|
|
4459
|
+
]),
|
|
4460
|
+
_: 1
|
|
4461
|
+
}, 8, ["text"])
|
|
4462
|
+
]),
|
|
4463
|
+
_: 1
|
|
4464
|
+
}, 8, ["hide-icon", "href", "target"])) : B("", !0) : (f(), A("div", Il, S(" – "))),
|
|
4465
|
+
c.value && e.allowCopy ? (f(), E(s, {
|
|
4466
|
+
key: o.value,
|
|
4467
|
+
class: "copy-uuid-tooltip",
|
|
4468
|
+
"max-width": "160",
|
|
4469
|
+
placement: "bottom-end",
|
|
4470
|
+
text: o.value
|
|
4471
|
+
}, {
|
|
4472
|
+
default: k(() => [
|
|
4473
|
+
K(m, null, {
|
|
4474
|
+
default: k(({ copyToClipboard: p }) => [
|
|
4475
|
+
F("span", {
|
|
4476
|
+
class: "entity-link-copy-id",
|
|
4477
|
+
onClick: He((b) => y(p), ["stop"])
|
|
4478
|
+
}, [
|
|
4479
|
+
K(g(hi), {
|
|
4480
|
+
class: "copy-icon",
|
|
4481
|
+
color: g(Ei),
|
|
4482
|
+
"data-testid": "copy-id",
|
|
4483
|
+
size: g(Fi)
|
|
4484
|
+
}, null, 8, ["color", "size"])
|
|
4485
|
+
], 8, Fl)
|
|
4486
|
+
]),
|
|
4487
|
+
_: 1
|
|
4488
|
+
})
|
|
4489
|
+
]),
|
|
4490
|
+
_: 1
|
|
4491
|
+
}, 8, ["text"])) : B("", !0)
|
|
4492
|
+
]);
|
|
4493
|
+
};
|
|
4494
|
+
}
|
|
4495
|
+
}), hc = /* @__PURE__ */ se(Ol, [["__scopeId", "data-v-a18d7efa"]]), Bl = { class: "kong-ui-public-entity-empty-state" }, Kl = { class: "entity-empty-state-content" }, Rl = {
|
|
4496
|
+
key: 0,
|
|
4497
|
+
class: "empty-state-image"
|
|
4498
|
+
}, Ll = {
|
|
4499
|
+
key: 1,
|
|
4500
|
+
class: "entity-empty-state-title"
|
|
4501
|
+
}, Dl = {
|
|
4502
|
+
key: 2,
|
|
4503
|
+
class: "entity-empty-state-description"
|
|
4504
|
+
}, Nl = {
|
|
4505
|
+
key: 3,
|
|
4506
|
+
class: "entity-empty-state-pricing"
|
|
4507
|
+
}, Pl = {
|
|
4508
|
+
key: 0,
|
|
4509
|
+
class: "entity-empty-state-message"
|
|
4510
|
+
}, Ml = {
|
|
4511
|
+
key: 1,
|
|
4512
|
+
class: "entity-empty-state-action"
|
|
4513
|
+
}, jl = {
|
|
4514
|
+
key: 2,
|
|
4515
|
+
class: "entity-empty-state-card-container"
|
|
4516
|
+
}, Ul = {
|
|
4517
|
+
key: 0,
|
|
4518
|
+
class: "feature-icon"
|
|
4519
|
+
}, ql = { class: "card-header" }, Hl = ["title"], zl = {
|
|
4520
|
+
key: 3,
|
|
4521
|
+
class: "entity-empty-state-bottom-container"
|
|
4522
|
+
}, Vl = /* @__PURE__ */ ee({
|
|
4523
|
+
__name: "EntityEmptyState",
|
|
4524
|
+
props: {
|
|
4525
|
+
appearance: {
|
|
4526
|
+
type: String,
|
|
4527
|
+
default: () => "primary",
|
|
4528
|
+
validator: (e) => Ct.includes(e)
|
|
4529
|
+
},
|
|
4530
|
+
title: {
|
|
4531
|
+
type: String,
|
|
4532
|
+
default: ""
|
|
4533
|
+
},
|
|
4534
|
+
description: {
|
|
4535
|
+
type: String,
|
|
4536
|
+
default: ""
|
|
4537
|
+
},
|
|
4538
|
+
pricing: {
|
|
4539
|
+
type: String,
|
|
4540
|
+
default: ""
|
|
4541
|
+
},
|
|
4542
|
+
/** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can create a new entity */
|
|
4543
|
+
canCreate: {
|
|
4544
|
+
type: Function,
|
|
4545
|
+
required: !1,
|
|
4546
|
+
default: async () => !0
|
|
4547
|
+
},
|
|
4548
|
+
actionButtonText: {
|
|
4549
|
+
type: String,
|
|
4550
|
+
default: ""
|
|
4551
|
+
},
|
|
4552
|
+
learnMore: {
|
|
4553
|
+
type: Boolean,
|
|
4554
|
+
default: !1
|
|
4555
|
+
},
|
|
4556
|
+
features: {
|
|
4557
|
+
type: Array,
|
|
4558
|
+
default: () => []
|
|
4559
|
+
}
|
|
4560
|
+
},
|
|
4561
|
+
emits: ["click:create", "click:learn-more"],
|
|
4562
|
+
setup(e) {
|
|
4563
|
+
const t = e, { i18n: { t: n } } = G.useI18n(), i = q(!1), r = T(() => i.value && !!t.actionButtonText), a = T(() => Ct.includes(t.appearance) ? t.appearance : ["primary", t.appearance]);
|
|
4564
|
+
return st(async () => {
|
|
4565
|
+
i.value = await t.canCreate();
|
|
4566
|
+
}), ct(() => Yn(`EntityEmptyState is deprecated and will be removed in future releases. Please use the KEmptyState component instead.
|
|
4567
|
+
Docs: https://kongponents.konghq.com/components/empty-state.html.`)), (o, l) => {
|
|
4568
|
+
const c = L("KCard");
|
|
4569
|
+
return f(), A("div", Bl, [
|
|
4570
|
+
F("div", Kl, [
|
|
4571
|
+
o.$slots.image ? (f(), A("div", Rl, [
|
|
4572
|
+
M(o.$slots, "image", {}, void 0, !0)
|
|
4573
|
+
])) : B("", !0),
|
|
4574
|
+
e.title || o.$slots.title ? (f(), A("div", Ll, [
|
|
4575
|
+
F("h1", {
|
|
4576
|
+
class: ue(a.value)
|
|
4577
|
+
}, [
|
|
4578
|
+
M(o.$slots, "title", {}, () => [
|
|
4579
|
+
P(S(e.title), 1)
|
|
4580
|
+
], !0)
|
|
4581
|
+
], 2)
|
|
4582
|
+
])) : B("", !0),
|
|
4583
|
+
e.description || o.$slots.default ? (f(), A("div", Dl, [
|
|
4584
|
+
M(o.$slots, "default", {}, () => [
|
|
4585
|
+
F("p", null, S(e.description), 1)
|
|
4586
|
+
], !0)
|
|
4587
|
+
])) : B("", !0),
|
|
4588
|
+
e.pricing || o.$slots.pricing ? (f(), A("div", Nl, [
|
|
4589
|
+
F("p", null, [
|
|
4590
|
+
F("b", null, S(g(n)("emptyState.pricingTitle")), 1),
|
|
4591
|
+
l[2] || (l[2] = P()),
|
|
4592
|
+
M(o.$slots, "pricing", {}, () => [
|
|
4593
|
+
P(S(e.pricing), 1)
|
|
4594
|
+
], !0)
|
|
4595
|
+
])
|
|
4596
|
+
])) : B("", !0)
|
|
4597
|
+
]),
|
|
4598
|
+
o.$slots.message ? (f(), A("div", Pl, [
|
|
4599
|
+
M(o.$slots, "message", {}, void 0, !0)
|
|
4600
|
+
])) : B("", !0),
|
|
4601
|
+
r.value || e.learnMore || o.$slots.actions ? (f(), A("div", Ml, [
|
|
4602
|
+
M(o.$slots, "actions", {}, () => [
|
|
4603
|
+
r.value ? (f(), E(g(vt), {
|
|
4604
|
+
key: 0,
|
|
4605
|
+
appearance: "primary",
|
|
4606
|
+
"data-testid": "entity-create-button",
|
|
4607
|
+
size: e.appearance === "secondary" ? "medium" : "large",
|
|
4608
|
+
onClick: l[0] || (l[0] = (d) => o.$emit("click:create"))
|
|
4609
|
+
}, {
|
|
4610
|
+
default: k(() => [
|
|
4611
|
+
K(g(Ht)),
|
|
4612
|
+
P(" " + S(e.actionButtonText), 1)
|
|
4613
|
+
]),
|
|
4614
|
+
_: 1
|
|
4615
|
+
}, 8, ["size"])) : B("", !0),
|
|
4616
|
+
e.learnMore ? (f(), E(g(vt), {
|
|
4617
|
+
key: 1,
|
|
4618
|
+
appearance: "secondary",
|
|
4619
|
+
"data-testid": "entity-learn-more-button",
|
|
4620
|
+
size: e.appearance === "secondary" ? "medium" : "large",
|
|
4621
|
+
onClick: l[1] || (l[1] = (d) => o.$emit("click:learn-more"))
|
|
4622
|
+
}, {
|
|
4623
|
+
default: k(() => [
|
|
4624
|
+
K(g(qt), { decorative: "" }),
|
|
4625
|
+
P(" " + S(g(n)("emptyState.learnMore")), 1)
|
|
4626
|
+
]),
|
|
4627
|
+
_: 1
|
|
4628
|
+
}, 8, ["size"])) : B("", !0)
|
|
4629
|
+
], !0)
|
|
4630
|
+
])) : B("", !0),
|
|
4631
|
+
e.features.length ? (f(), A("div", jl, [
|
|
4632
|
+
(f(!0), A(pe, null, he(e.features, (d, y) => (f(), E(c, {
|
|
4633
|
+
key: `feature-${y}-card`,
|
|
4634
|
+
class: "entity-empty-state-card"
|
|
4635
|
+
}, {
|
|
4636
|
+
title: k(() => [
|
|
4637
|
+
o.$slots[`feature-${y}-icon`] ? (f(), A("div", Ul, [
|
|
4638
|
+
M(o.$slots, `feature-${y}-icon`, {}, void 0, !0)
|
|
4639
|
+
])) : B("", !0),
|
|
4640
|
+
F("div", ql, S(d.title), 1)
|
|
4641
|
+
]),
|
|
4642
|
+
default: k(() => [
|
|
4643
|
+
F("div", {
|
|
4644
|
+
title: d.description
|
|
4645
|
+
}, S(d.description), 9, Hl)
|
|
4646
|
+
]),
|
|
4647
|
+
_: 2
|
|
4648
|
+
}, 1024))), 128))
|
|
4649
|
+
])) : B("", !0),
|
|
4650
|
+
o.$slots.bottom ? (f(), A("div", zl, [
|
|
4651
|
+
M(o.$slots, "bottom", {}, void 0, !0)
|
|
4652
|
+
])) : B("", !0)
|
|
4653
|
+
]);
|
|
4654
|
+
};
|
|
4655
|
+
}
|
|
4656
|
+
}), vc = /* @__PURE__ */ se(Vl, [["__scopeId", "data-v-0b2e9081"]]), Yl = { key: 1 }, kc = /* @__PURE__ */ ee({
|
|
4657
|
+
__name: "TableTags",
|
|
4658
|
+
props: {
|
|
4659
|
+
/** The tags to display in the table */
|
|
4660
|
+
tags: {
|
|
4661
|
+
type: [Array, String],
|
|
4662
|
+
default: () => []
|
|
4663
|
+
},
|
|
4664
|
+
tagMaxWidth: {
|
|
4665
|
+
type: String,
|
|
4666
|
+
default: void 0
|
|
4667
|
+
}
|
|
4668
|
+
},
|
|
4669
|
+
setup(e) {
|
|
4670
|
+
const t = e, n = T(() => {
|
|
4671
|
+
if (Array.isArray(t.tags))
|
|
4672
|
+
return t.tags;
|
|
4673
|
+
if (typeof t.tags == "string")
|
|
4674
|
+
try {
|
|
4675
|
+
const i = JSON.parse(t.tags);
|
|
4676
|
+
return Array.isArray(i) ? i : [];
|
|
4677
|
+
} catch {
|
|
4678
|
+
return [];
|
|
4679
|
+
}
|
|
4680
|
+
return [];
|
|
4681
|
+
});
|
|
4682
|
+
return (i, r) => {
|
|
4683
|
+
var a;
|
|
4684
|
+
return ((a = n.value) == null ? void 0 : a.length) > 0 ? (f(), E(g(ii), { key: 0 }, {
|
|
4685
|
+
default: k(() => [
|
|
4686
|
+
(f(!0), A(pe, null, he(n.value, (o) => (f(), E(g(ri), {
|
|
4687
|
+
key: o,
|
|
4688
|
+
"max-width": e.tagMaxWidth,
|
|
4689
|
+
onClick: r[0] || (r[0] = He(() => {
|
|
4690
|
+
}, ["stop"]))
|
|
4691
|
+
}, {
|
|
4692
|
+
default: k(() => [
|
|
4693
|
+
P(S(o), 1)
|
|
4694
|
+
]),
|
|
4695
|
+
_: 2
|
|
4696
|
+
}, 1032, ["max-width"]))), 128))
|
|
4697
|
+
]),
|
|
4698
|
+
_: 1
|
|
4699
|
+
})) : (f(), A("span", Yl, "-"));
|
|
4700
|
+
};
|
|
4701
|
+
}
|
|
4702
|
+
}), { useAxios: bc, useDeleteUrlBuilder: Cc, useBaseEntityDeckOptions: xc, useBaseFormDeckOptions: Ac, useErrors: Sc, useExternalLinkCreator: _c, useFetchUrlBuilder: Tc, useFetcher: wc, useFetcherCacheKey: $c, useDebouncedFilter: Ec, useStringHelpers: Ic, useHelpers: Fc, useGatewayFeatureSupported: Oc, useTruncationDetector: Bc, useValidators: Kc, useSchemaProvider: Rc, useTableState: Lc } = G;
|
|
2
4703
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
4704
|
+
Ct as Appearances,
|
|
4705
|
+
Xn as CONFIG_CARD_FORMATS,
|
|
4706
|
+
$a as ConfigCardDisplay,
|
|
4707
|
+
Vt as ConfigCardItem,
|
|
4708
|
+
me as ConfigurationSchemaSection,
|
|
4709
|
+
Z as ConfigurationSchemaType,
|
|
4710
|
+
Jn as DECK_COMMAND_EDITOR_KEY,
|
|
4711
|
+
Qn as DECK_COMMAND_EDITOR_MISSING_WARNING,
|
|
4712
|
+
Mn as DeckCodeBlock,
|
|
4713
|
+
cc as EntityBaseConfigCard,
|
|
4714
|
+
sc as EntityBaseForm,
|
|
4715
|
+
bi as EntityBaseFormType,
|
|
4716
|
+
uc as EntityBaseTable,
|
|
4717
|
+
dc as EntityDeleteModal,
|
|
4718
|
+
vc as EntityEmptyState,
|
|
4719
|
+
fc as EntityFilter,
|
|
4720
|
+
gc as EntityFormBlock,
|
|
4721
|
+
yc as EntityFormSection,
|
|
4722
|
+
hc as EntityLink,
|
|
4723
|
+
pc as EntityToggleModal,
|
|
4724
|
+
ki as EntityTypes,
|
|
4725
|
+
Wn as EventGatewayTypesArray,
|
|
4726
|
+
Pc as FetcherStatus,
|
|
4727
|
+
ka as GeneratePatModal,
|
|
4728
|
+
Gn as IdentityTypesArray,
|
|
4729
|
+
Si as InternalLinkItem,
|
|
4730
|
+
Yt as JsonCodeBlock,
|
|
4731
|
+
Zn as PLUGIN_FORM_LAYOUT_STATE,
|
|
4732
|
+
mc as PermissionsWrapper,
|
|
4733
|
+
Mc as SupportedEntityDeckArray,
|
|
4734
|
+
_e as SupportedEntityType,
|
|
4735
|
+
Je as SupportedEntityTypesArray,
|
|
4736
|
+
kc as TableTags,
|
|
4737
|
+
Pn as TerraformCodeBlock,
|
|
4738
|
+
Nn as YamlCodeBlock,
|
|
4739
|
+
Ke as highlightCodeBlock,
|
|
4740
|
+
jc as isSupportedDeckEntityType,
|
|
4741
|
+
bc as useAxios,
|
|
4742
|
+
xc as useBaseEntityDeckOptions,
|
|
4743
|
+
Ac as useBaseFormDeckOptions,
|
|
4744
|
+
Ec as useDebouncedFilter,
|
|
4745
|
+
Cc as useDeleteUrlBuilder,
|
|
4746
|
+
Sc as useErrors,
|
|
4747
|
+
_c as useExternalLinkCreator,
|
|
4748
|
+
Tc as useFetchUrlBuilder,
|
|
4749
|
+
wc as useFetcher,
|
|
4750
|
+
$c as useFetcherCacheKey,
|
|
4751
|
+
Oc as useGatewayFeatureSupported,
|
|
4752
|
+
Fc as useHelpers,
|
|
4753
|
+
Rc as useSchemaProvider,
|
|
4754
|
+
Ic as useStringHelpers,
|
|
4755
|
+
Lc as useTableState,
|
|
4756
|
+
Bc as useTruncationDetector,
|
|
4757
|
+
Kc as useValidators
|
|
55
4758
|
};
|