@kong-ui-public/entities-shared 3.47.3-pr.3259.afc8c0143.0 → 3.47.3

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.
Files changed (132) hide show
  1. package/dist/_plugin-vue_export-helper-BpeW-zKx.js +754 -0
  2. package/dist/_plugin-vue_export-helper-CwM56vX0.cjs +1 -0
  3. package/dist/deck-editor.cjs.js +1 -0
  4. package/dist/deck-editor.es.js +86 -0
  5. package/dist/entities-shared.cjs.js +70 -0
  6. package/dist/entities-shared.es.js +4819 -0
  7. package/dist/style.css +1 -0
  8. package/dist/types/components/common/DeckCallout.vue.d.ts +10 -0
  9. package/dist/types/components/common/DeckCallout.vue.d.ts.map +1 -0
  10. package/dist/types/components/common/DeckCodeBlock.vue.d.ts +13 -0
  11. package/dist/types/components/common/DeckCodeBlock.vue.d.ts.map +1 -0
  12. package/dist/types/components/common/DeckCodeBlockInternal.vue.d.ts +13 -0
  13. package/dist/types/components/common/DeckCodeBlockInternal.vue.d.ts.map +1 -0
  14. package/dist/types/components/common/DeckCommandEditor.vue.d.ts +16 -0
  15. package/dist/types/components/common/DeckCommandEditor.vue.d.ts.map +1 -0
  16. package/dist/types/components/common/DeckCommandEditorLoading.vue.d.ts +4 -0
  17. package/dist/types/components/common/DeckCommandEditorLoading.vue.d.ts.map +1 -0
  18. package/dist/types/components/common/GeneratePatModal.vue.d.ts +14 -0
  19. package/dist/types/components/common/GeneratePatModal.vue.d.ts.map +1 -0
  20. package/dist/types/components/common/JsonCodeBlock.vue.d.ts +70 -0
  21. package/dist/types/components/common/JsonCodeBlock.vue.d.ts.map +1 -0
  22. package/dist/types/components/common/TableTags.vue.d.ts +27 -0
  23. package/dist/types/components/common/TableTags.vue.d.ts.map +1 -0
  24. package/dist/types/components/common/TerraformCodeBlock.vue.d.ts +58 -0
  25. package/dist/types/components/common/TerraformCodeBlock.vue.d.ts.map +1 -0
  26. package/dist/types/components/common/YamlCodeBlock.vue.d.ts +54 -0
  27. package/dist/types/components/common/YamlCodeBlock.vue.d.ts.map +1 -0
  28. package/dist/types/components/entity-base-config-card/ConfigCardDisplay.vue.d.ts +213 -0
  29. package/dist/types/components/entity-base-config-card/ConfigCardDisplay.vue.d.ts.map +1 -0
  30. package/dist/types/components/entity-base-config-card/ConfigCardItem.vue.d.ts +58 -0
  31. package/dist/types/components/entity-base-config-card/ConfigCardItem.vue.d.ts.map +1 -0
  32. package/dist/types/components/entity-base-config-card/EntityBaseConfigCard.vue.d.ts +337 -0
  33. package/dist/types/components/entity-base-config-card/EntityBaseConfigCard.vue.d.ts.map +1 -0
  34. package/dist/types/components/entity-base-config-card/InternalLinkItem.vue.d.ts +20 -0
  35. package/dist/types/components/entity-base-config-card/InternalLinkItem.vue.d.ts.map +1 -0
  36. package/dist/types/components/entity-base-config-card/JsonCardItem.vue.d.ts +35 -0
  37. package/dist/types/components/entity-base-config-card/JsonCardItem.vue.d.ts.map +1 -0
  38. package/dist/types/components/entity-base-config-card/StatusBadge.vue.d.ts +16 -0
  39. package/dist/types/components/entity-base-config-card/StatusBadge.vue.d.ts.map +1 -0
  40. package/dist/types/components/entity-base-form/EntityBaseForm.vue.d.ts +291 -0
  41. package/dist/types/components/entity-base-form/EntityBaseForm.vue.d.ts.map +1 -0
  42. package/dist/types/components/entity-base-table/EntityBaseTable.vue.d.ts +326 -0
  43. package/dist/types/components/entity-base-table/EntityBaseTable.vue.d.ts.map +1 -0
  44. package/dist/types/components/entity-base-table/EntityBaseTableCell.vue.d.ts +45 -0
  45. package/dist/types/components/entity-base-table/EntityBaseTableCell.vue.d.ts.map +1 -0
  46. package/dist/types/components/entity-delete-modal/EntityDeleteModal.vue.d.ts +124 -0
  47. package/dist/types/components/entity-delete-modal/EntityDeleteModal.vue.d.ts.map +1 -0
  48. package/dist/types/components/entity-empty-state/EntityEmptyState.vue.d.ts +117 -0
  49. package/dist/types/components/entity-empty-state/EntityEmptyState.vue.d.ts.map +1 -0
  50. package/dist/types/components/entity-filter/EntityFilter.vue.d.ts +38 -0
  51. package/dist/types/components/entity-filter/EntityFilter.vue.d.ts.map +1 -0
  52. package/dist/types/components/entity-form-block/EntityFormBlock.vue.d.ts +22 -0
  53. package/dist/types/components/entity-form-block/EntityFormBlock.vue.d.ts.map +1 -0
  54. package/dist/types/components/entity-form-section/EntityFormSection.vue.d.ts +77 -0
  55. package/dist/types/components/entity-form-section/EntityFormSection.vue.d.ts.map +1 -0
  56. package/dist/types/components/entity-link/EntityLink.vue.d.ts +50 -0
  57. package/dist/types/components/entity-link/EntityLink.vue.d.ts.map +1 -0
  58. package/dist/types/components/entity-toggle-modal/EntityToggleModal.vue.d.ts +65 -0
  59. package/dist/types/components/entity-toggle-modal/EntityToggleModal.vue.d.ts.map +1 -0
  60. package/dist/types/components/icons/IconFilter.vue.d.ts +16 -0
  61. package/dist/types/components/icons/IconFilter.vue.d.ts.map +1 -0
  62. package/dist/types/components/permissions-wrapper/PermissionsWrapper.vue.d.ts +56 -0
  63. package/dist/types/components/permissions-wrapper/PermissionsWrapper.vue.d.ts.map +1 -0
  64. package/dist/types/composables/index.d.ts +42 -0
  65. package/dist/types/composables/index.d.ts.map +1 -0
  66. package/dist/types/composables/useAxios.d.ts +5 -0
  67. package/dist/types/composables/useAxios.d.ts.map +1 -0
  68. package/dist/types/composables/useDebouncedFilter.d.ts +11 -0
  69. package/dist/types/composables/useDebouncedFilter.d.ts.map +1 -0
  70. package/dist/types/composables/useDeckOptions.d.ts +13 -0
  71. package/dist/types/composables/useDeckOptions.d.ts.map +1 -0
  72. package/dist/types/composables/useDeleteUrlBuilder.d.ts +3 -0
  73. package/dist/types/composables/useDeleteUrlBuilder.d.ts.map +1 -0
  74. package/dist/types/composables/useErrors.d.ts +11 -0
  75. package/dist/types/composables/useErrors.d.ts.map +1 -0
  76. package/dist/types/composables/useExternalLinkCreator.d.ts +2 -0
  77. package/dist/types/composables/useExternalLinkCreator.d.ts.map +1 -0
  78. package/dist/types/composables/useFetchUrlBuilder.d.ts +6 -0
  79. package/dist/types/composables/useFetchUrlBuilder.d.ts.map +1 -0
  80. package/dist/types/composables/useFetcher.d.ts +40 -0
  81. package/dist/types/composables/useFetcher.d.ts.map +1 -0
  82. package/dist/types/composables/useGatewayFeatureSupported.d.ts +11 -0
  83. package/dist/types/composables/useGatewayFeatureSupported.d.ts.map +1 -0
  84. package/dist/types/composables/useHelpers.d.ts +7 -0
  85. package/dist/types/composables/useHelpers.d.ts.map +1 -0
  86. package/dist/types/composables/useI18n.d.ts +9 -0
  87. package/dist/types/composables/useI18n.d.ts.map +1 -0
  88. package/dist/types/composables/useSchema.d.ts +11 -0
  89. package/dist/types/composables/useSchema.d.ts.map +1 -0
  90. package/dist/types/composables/useStringHelpers.d.ts +5 -0
  91. package/dist/types/composables/useStringHelpers.d.ts.map +1 -0
  92. package/dist/types/composables/useTableState.d.ts +15 -0
  93. package/dist/types/composables/useTableState.d.ts.map +1 -0
  94. package/dist/types/composables/useTruncationDetector.d.ts +12 -0
  95. package/dist/types/composables/useTruncationDetector.d.ts.map +1 -0
  96. package/dist/types/composables/useValidators.d.ts +8 -0
  97. package/dist/types/composables/useValidators.d.ts.map +1 -0
  98. package/dist/types/constants.d.ts +24 -0
  99. package/dist/types/constants.d.ts.map +1 -0
  100. package/dist/types/deck-editor.d.ts +18 -0
  101. package/dist/types/deck-editor.d.ts.map +1 -0
  102. package/dist/types/index.d.ts +29 -0
  103. package/dist/types/index.d.ts.map +1 -0
  104. package/dist/types/types/app-config.d.ts +43 -0
  105. package/dist/types/types/app-config.d.ts.map +1 -0
  106. package/dist/types/types/base.d.ts +12 -0
  107. package/dist/types/types/base.d.ts.map +1 -0
  108. package/dist/types/types/deck.d.ts +43 -0
  109. package/dist/types/types/deck.d.ts.map +1 -0
  110. package/dist/types/types/entity-base-config-card.d.ts +132 -0
  111. package/dist/types/types/entity-base-config-card.d.ts.map +1 -0
  112. package/dist/types/types/entity-base-form.d.ts +27 -0
  113. package/dist/types/types/entity-base-form.d.ts.map +1 -0
  114. package/dist/types/types/entity-base-table.d.ts +79 -0
  115. package/dist/types/types/entity-base-table.d.ts.map +1 -0
  116. package/dist/types/types/entity-delete-modal.d.ts +28 -0
  117. package/dist/types/types/entity-delete-modal.d.ts.map +1 -0
  118. package/dist/types/types/entity-empty-state.d.ts +7 -0
  119. package/dist/types/types/entity-empty-state.d.ts.map +1 -0
  120. package/dist/types/types/entity-filter.d.ts +48 -0
  121. package/dist/types/types/entity-filter.d.ts.map +1 -0
  122. package/dist/types/types/entity-link.d.ts +6 -0
  123. package/dist/types/types/entity-link.d.ts.map +1 -0
  124. package/dist/types/types/index.d.ts +12 -0
  125. package/dist/types/types/index.d.ts.map +1 -0
  126. package/dist/types/types/utils.d.ts +13 -0
  127. package/dist/types/types/utils.d.ts.map +1 -0
  128. package/dist/types/utils/code-block.d.ts +3 -0
  129. package/dist/types/utils/code-block.d.ts.map +1 -0
  130. package/dist/types/utils/shiki.d.ts +4 -0
  131. package/dist/types/utils/shiki.d.ts.map +1 -0
  132. package/package.json +6 -6
@@ -0,0 +1,754 @@
1
+ import N from "axios";
2
+ import { inject as P, ref as h, computed as _, unref as W, toValue as m, watch as se, toRef as ne, provide as J } from "vue";
3
+ import { createI18n as re, i18nTComponent as oe } from "@kong-ui-public/i18n";
4
+ var x = /* @__PURE__ */ ((e) => (e[e.InitialLoad = 0] = "InitialLoad", e[e.Loading = 1] = "Loading", e[e.Idle = 2] = "Idle", e[e.NoResults = 3] = "NoResults", e[e.NoRecords = 4] = "NoRecords", e[e.Error = 5] = "Error", e))(x || {}), Y = /* @__PURE__ */ ((e) => (e.CaCertificate = "ca_certificate", e.Certificate = "certificate", e.Consumer = "consumer", e.ConsumerGroup = "consumer_group", e.GatewayService = "service", e.Key = "key", e.KeySet = "set", e.Plugin = "plugin", e.Route = "route", e.SNI = "sni", e.Upstream = "upstream", e.Target = "target", e.Vault = "vault", e.Partial = "partial", e.CloudGatewayAddon = "cloud_gateway_addon", e.BackendCluster = "backend_cluster", e.VirtualCluster = "virtual_cluster", e.Listener = "listener", e.ProducePolicy = "produce_policy", e.ConsumePolicy = "consume_policy", e.ClusterPolicy = "cluster_policy", e.ListenerPolicy = "listener_policy", e.SchemaRegistry = "schema_registry", e.StaticKey = "static_key", e.TlsTrustBundle = "tls_trust_bundle", e.AuthServer = "auth_server", e.AuthServerScopes = "auth_server_scopes", e.AuthServerClaims = "auth_server_claims", e.AuthServerClients = "auth_server_clients", e.Other = "other", e))(Y || {});
5
+ const Qe = Object.values(Y), ie = [
6
+ "ca_certificate",
7
+ "certificate",
8
+ "consumer",
9
+ "consumer_group",
10
+ "service",
11
+ "key",
12
+ "set",
13
+ "plugin",
14
+ "route",
15
+ "upstream",
16
+ "target",
17
+ "vault",
18
+ "partial"
19
+ /* Partial */
20
+ ];
21
+ function H(e) {
22
+ return ie.includes(e);
23
+ }
24
+ const qe = ["backend_cluster", "virtual_cluster", "listener", "produce_policy", "consume_policy", "cluster_policy", "listener_policy", "schema_registry", "static_key", "tls_trust_bundle"], Ze = ["auth_server", "auth_server_scopes", "auth_server_claims", "auth_server_clients"];
25
+ var le = /* @__PURE__ */ ((e) => (e.ID = "id", e.IdArray = "id-array", e.Text = "plain-text", e.Date = "date", e.Redacted = "redacted", e.RedactedArray = "redacted-array", e.Json = "json", e.JsonArray = "json-array", e.BadgeTag = "badge-tag", e.CopyBadge = "copy-badge", e.BadgeStatus = "badge-status", e.BadgeMethod = "badge-method", e.LinkInternal = "link-internal", e.LinkExternal = "link-external", e))(le || {}), ce = /* @__PURE__ */ ((e) => (e.Basic = "basic", e.Advanced = "advanced", e.Plugin = "plugin", e.Policy = "policy", e))(ce || {});
26
+ const Xe = ["structured", "yaml", "json", "terraform", "deck"];
27
+ function ue() {
28
+ return {
29
+ getAxiosInstance: (e = {}) => {
30
+ try {
31
+ const s = P("get-axios-instance", void 0);
32
+ return typeof s == "function" ? s(e) : N.create({
33
+ withCredentials: !0,
34
+ timeout: 3e4,
35
+ ...e
36
+ });
37
+ } catch (s) {
38
+ return console.warn("getAxiosInstance:", s.message || s), N.create({
39
+ withCredentials: !0,
40
+ timeout: 3e4,
41
+ ...e
42
+ });
43
+ }
44
+ },
45
+ getTraceIdFromError: (e) => {
46
+ var s;
47
+ return ((s = e == null ? void 0 : e.response) == null ? void 0 : s.headers["x-datadog-trace-id"]) || "";
48
+ }
49
+ };
50
+ }
51
+ function de() {
52
+ return {
53
+ debounce: (e, s) => {
54
+ let r;
55
+ return (...t) => {
56
+ clearTimeout(r), r = window == null ? void 0 : window.setTimeout(() => {
57
+ e(...t);
58
+ }, s);
59
+ };
60
+ }
61
+ };
62
+ }
63
+ const E = "khcp-user-table-preferences", fe = {
64
+ pageSize: 30,
65
+ sortColumnKey: void 0,
66
+ sortColumnOrder: void 0,
67
+ columnVisibility: {}
68
+ };
69
+ function et() {
70
+ const e = (r) => {
71
+ if (typeof r == "string")
72
+ try {
73
+ return JSON.parse(r);
74
+ } catch (t) {
75
+ console.error("useTablePreferences(tryParseJson)", t);
76
+ return;
77
+ }
78
+ }, s = () => {
79
+ const r = e(localStorage.getItem(E));
80
+ return !r || !Object.keys(r).length ? /* @__PURE__ */ new Map() : new Map(Object.entries(r));
81
+ };
82
+ return {
83
+ setTablePreferences: (r, t) => {
84
+ try {
85
+ const o = s();
86
+ o.set(r, t), localStorage.setItem(E, JSON.stringify(Object.fromEntries(o.entries())));
87
+ } catch (o) {
88
+ console.error("useTablePreferences(setTablePreferences)", o);
89
+ }
90
+ },
91
+ getTablePreferences: (r, t) => {
92
+ const o = s();
93
+ return (o == null ? void 0 : o.get(r)) || void 0 || t || fe;
94
+ },
95
+ deleteAllTablePreferences: () => {
96
+ localStorage.removeItem(E);
97
+ }
98
+ };
99
+ }
100
+ function $(e = {}) {
101
+ const { getAxiosInstance: s } = ue();
102
+ return {
103
+ axiosInstance: s(e)
104
+ };
105
+ }
106
+ const pe = {
107
+ actions: {
108
+ copyId: "Copy ID",
109
+ copied_id: 'Copied "{id}" to the clipboard',
110
+ copyToClipboard: "Copied successfully!",
111
+ copyToClipboardFailed: "Failed to copy to the clipboard"
112
+ }
113
+ }, ge = {
114
+ message: "Are you sure you want to delete this {entityType}?",
115
+ messageWithName: "Are you sure you want to delete this {entityType} {entityName}?"
116
+ }, he = {
117
+ actions: {
118
+ viewConfiguration: "View configuration",
119
+ hideConfiguration: "Hide configuration",
120
+ save: "Save",
121
+ cancel: "Cancel",
122
+ back: "Back"
123
+ },
124
+ configuration: {
125
+ title: "Configuration",
126
+ message: "Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",
127
+ yaml: "YAML",
128
+ json: "JSON",
129
+ terraform: "Terraform",
130
+ deck: "decK"
131
+ },
132
+ errors: {
133
+ edit: "The entity could not be edited at this time."
134
+ }
135
+ }, me = {
136
+ emptyState: {
137
+ noSearchResultsTitle: "No results found",
138
+ noSearchResultsMessage: "Please adjust the criteria and try again.",
139
+ noSearchResultsCtaText: "Clear"
140
+ }
141
+ }, ve = {
142
+ title: "Configuration",
143
+ actions: {
144
+ copy: "Copy JSON",
145
+ deck_customize: "Customize before copying to CLI",
146
+ deck_customize_cancel: "Cancel",
147
+ sensitive_fields: "Show sensitive fields"
148
+ },
149
+ sections: {
150
+ advanced: "Advanced",
151
+ plugin: "Plugin specific configuration",
152
+ policy: "Policy specific configuration"
153
+ },
154
+ commonFields: {
155
+ id_label: "ID",
156
+ name_label: "Name",
157
+ enabled_label: "Enabled",
158
+ enabled_tooltip: "Enabled is FTW",
159
+ updated_at_label: "Last updated",
160
+ created_at_label: "Created",
161
+ tags_label: "Tags",
162
+ link: "Link",
163
+ partial_label: "Redis configuration"
164
+ },
165
+ statusBadge: {
166
+ enabledLabel: "Enabled",
167
+ disabledLabel: "Disabled"
168
+ },
169
+ copy: {
170
+ tooltip: "Copy {label}",
171
+ success: "Copied!"
172
+ },
173
+ errors: {
174
+ load: "The entity configuration data could not be loaded at this time.",
175
+ copy: "Failed to copy to clipboard"
176
+ },
177
+ general: {
178
+ entryTitle: "Entry {index}",
179
+ structuredFormat: "Structured"
180
+ }
181
+ }, be = {
182
+ learnMore: "Learn more",
183
+ pricingTitle: "Pricing: "
184
+ }, ye = {
185
+ filterButtonText: "Filter",
186
+ fieldLabel: "Filter by:",
187
+ inputPlaceholder: "Enter a value",
188
+ selectPlaceholder: "Select an item",
189
+ applyButtonText: "Apply",
190
+ clearButtonText: "Clear",
191
+ clearAllButtonText: "Clear all filters"
192
+ }, _e = {
193
+ errors: {
194
+ fetch: "Could not fetch available items",
195
+ invalid: "Please select a valid value"
196
+ }
197
+ }, we = {
198
+ unexpected: "An unexpected error has occurred",
199
+ dataKeyUndefined: 'The data key "{dataKey}" does not exist in the response.'
200
+ }, ke = {
201
+ utf8Name: "The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."
202
+ }, Ce = {
203
+ enable: {
204
+ title: "Enable {entityType}",
205
+ message: "Are you sure you want to enable the {entityType} {entityName}?",
206
+ confirmText: "Yes, enable"
207
+ },
208
+ disable: {
209
+ title: "Disable {entityType}",
210
+ message: "Are you sure you want to disable the {entityType} {entityName}?",
211
+ confirmText: "Yes, disable"
212
+ }
213
+ }, Ae = {
214
+ hint: {
215
+ konnect: "The {token} environment variable must be added first. See {link} for details.",
216
+ kongManager: "If your Admin API is secured, set up authentication following {link}."
217
+ },
218
+ documentation: "the documentation",
219
+ steps: {
220
+ step_1: "Step 1: Export token",
221
+ step_2: "Step 2: Apply configuration"
222
+ },
223
+ customization: {
224
+ title: "Customize before copying to CLI",
225
+ copy_pat: "Make sure to copy your personal access token now. You won't be able to see it again.",
226
+ reuse_pat: "Use an existing PAT if you've already generated one.",
227
+ generate_pat: "Generate PAT",
228
+ footer_reminder: "Changes you make here won't affect your configuration. After you apply changes with decK in the CLI, refresh the page to view them.",
229
+ secret_advise: "Command may contain sensitive values. Treat it as a secret."
230
+ },
231
+ copy_tooltip: "Copy"
232
+ }, xe = {
233
+ body: "Want a ready-to-use CLI command? {cta} to view this configuration as a decK sync snippet you can copy directly.",
234
+ cta: "Switch to decK format"
235
+ }, Ie = {
236
+ title: "Generate a Personal Access Token",
237
+ description: "Personal access tokens are used to authenticate decK commands and Konnect API requests.",
238
+ fields: {
239
+ name: {
240
+ label: "Name",
241
+ placeholder: "Enter token name"
242
+ },
243
+ expiresAt: {
244
+ label: "Expiration date",
245
+ placeholder: "Select an expiration date",
246
+ n_days: "{n} days"
247
+ }
248
+ },
249
+ actions: {
250
+ cancel: "Cancel",
251
+ generate: "Generate",
252
+ generating: "Generating…"
253
+ }
254
+ }, De = {
255
+ global: pe,
256
+ deleteModal: ge,
257
+ baseForm: he,
258
+ baseTable: me,
259
+ baseConfigCard: ve,
260
+ emptyState: be,
261
+ filter: ye,
262
+ debouncedFilter: _e,
263
+ errors: we,
264
+ validationErrors: ke,
265
+ toggleModal: Ce,
266
+ deckCodeBlock: Ae,
267
+ deckCallout: xe,
268
+ generatePatModal: Ie
269
+ };
270
+ function R() {
271
+ const e = re("en-us", De);
272
+ return {
273
+ i18n: e,
274
+ i18nT: oe(e)
275
+ // Translation component <i18n-t>
276
+ };
277
+ }
278
+ function Q() {
279
+ const e = (n, a) => (a == null ? void 0 : a[n]) ?? void 0, s = (n, a) => {
280
+ if (n.length !== a.length) return !1;
281
+ const c = /* @__PURE__ */ new Set([...n, ...a]);
282
+ for (const l of c) {
283
+ const i = n.filter((u) => u === l).length, f = a.filter((u) => u === l).length;
284
+ if (i !== f) return !1;
285
+ }
286
+ return !0;
287
+ };
288
+ return {
289
+ getPropValue: e,
290
+ objectsAreEqual: (n, a, c) => {
291
+ if (c) {
292
+ if (Object.keys(n).length === Object.keys(a).length)
293
+ for (const l in n)
294
+ if (Array.isArray(n[l]) && Array.isArray(a[l])) {
295
+ if (s(n[l], a[l]))
296
+ continue;
297
+ return !1;
298
+ } else {
299
+ if (n[l] === a[l])
300
+ continue;
301
+ return !1;
302
+ }
303
+ else
304
+ return !1;
305
+ return !0;
306
+ }
307
+ try {
308
+ return JSON.stringify(n) === JSON.stringify(a);
309
+ } catch {
310
+ return !1;
311
+ }
312
+ },
313
+ sortAlpha: (n) => (a, c) => {
314
+ let l = a[n] === void 0 || a[n] === null ? "" : a[n], i = c[n] === void 0 || c[n] === null ? "" : c[n];
315
+ return Array.isArray(a[n]) && (l = a[n][0]), Array.isArray(c[n]) && (i = c[n][0]), l.localeCompare(i);
316
+ },
317
+ isValidUuid: (n) => n ? /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(n) : !1
318
+ };
319
+ }
320
+ function Oe(e, s, r, t = {
321
+ fetchedItemsKey: "data",
322
+ searchKeys: ["id"]
323
+ }) {
324
+ r || (r = "1000");
325
+ const { axiosInstance: o } = $(e.axiosRequestConfig), { i18n: { t: n } } = R(), { debounce: a } = de(), c = a(async (d) => {
326
+ await D(d);
327
+ }, 200), l = h(!1), i = h(""), f = h(""), u = h([]), k = h([]), w = h(void 0), p = _(() => {
328
+ let d = `${e.apiBaseUrl}${W(s)}`;
329
+ return e.app === "konnect" && (d = d.replace(/{controlPlaneId}/gi, (e == null ? void 0 : e.controlPlaneId) || "")), d.replace(/\/{workspace}/gi, e != null && e.workspace ? `/${e.workspace}` : "");
330
+ }), { isValidUuid: C } = Q(), y = async () => {
331
+ try {
332
+ l.value = !0;
333
+ const { data: d } = await o.get(`${p.value}?size=${r}`);
334
+ d != null && d.next || (w.value = t.fetchedItemsKey in d ? d[t.fetchedItemsKey] : []), k.value = t.fetchedItemsKey in d ? d[t.fetchedItemsKey] : [], u.value = k.value;
335
+ } catch {
336
+ u.value = [], i.value = n("debouncedFilter.errors.fetch");
337
+ } finally {
338
+ l.value = !1;
339
+ }
340
+ }, I = h(""), D = async (d) => {
341
+ var M, T, U;
342
+ if (I.value !== d) {
343
+ if (I.value = d ?? "", !d) {
344
+ u.value = k.value;
345
+ return;
346
+ }
347
+ if (w.value === void 0)
348
+ try {
349
+ if (l.value = !0, i.value = "", f.value = "", e.app === "konnect") {
350
+ const b = `${p.value}/${d}`, { data: v } = await o.get(`${b}?size=${r}`);
351
+ t.fetchedItemsKey in v ? u.value = v[t.fetchedItemsKey] : v != null && v[t.exactMatchKey ?? "id"] ? u.value = [v] : u.value = [];
352
+ } else {
353
+ const b = [];
354
+ C(d) && t.searchKeys.includes("id") ? b.push((async () => {
355
+ const { data: g } = await o.get(`${p.value}/${d}`);
356
+ return [g[t.fetchedItemsKey] ?? g];
357
+ })()) : b.push(
358
+ ...t.searchKeys.filter((g) => g !== "id").map(async (g) => {
359
+ const { data: A } = await o.get(`${p.value}?${g}=${d}`);
360
+ return A[t.fetchedItemsKey];
361
+ })
362
+ );
363
+ const v = await Promise.all(b), O = /* @__PURE__ */ new Set();
364
+ u.value = [], (M = v == null ? void 0 : v.forEach) == null || M.call(v, (g) => {
365
+ var A;
366
+ (A = g == null ? void 0 : g.forEach) == null || A.call(g, (K) => {
367
+ O.has(K.id) || (O.add(K.id), u.value.push(K));
368
+ });
369
+ });
370
+ }
371
+ } catch (b) {
372
+ ((T = b == null ? void 0 : b.response) == null ? void 0 : T.status) === 404 ? f.value = n("debouncedFilter.errors.invalid") : (u.value = [], i.value = n("debouncedFilter.errors.fetch"));
373
+ } finally {
374
+ l.value = !1;
375
+ }
376
+ else
377
+ l.value = !0, f.value = "", u.value = (U = w.value) == null ? void 0 : U.filter((b) => {
378
+ var O;
379
+ let v = !1;
380
+ for (const g of t.searchKeys) {
381
+ const A = typeof b[g] == "string" ? (O = b[g]) == null ? void 0 : O.toLowerCase() : b[g];
382
+ A != null && A.includes(d.toLowerCase()) && (v = !0);
383
+ }
384
+ return v;
385
+ }), (!u.value || !u.value.length) && (f.value = n("debouncedFilter.errors.invalid")), l.value = !1;
386
+ }
387
+ };
388
+ return {
389
+ loading: l,
390
+ error: i,
391
+ validationError: f,
392
+ results: u,
393
+ allRecords: w,
394
+ loadItems: y,
395
+ debouncedQueryChange: c
396
+ };
397
+ }
398
+ const tt = Symbol("PLUGIN_FORM_LAYOUT_STATE"), q = Symbol("DECK_COMMAND_EDITOR"), Z = "[entities-shared] DeckCommandEditor was not provided. Provide it via the `DECK_COMMAND_EDITOR_KEY` injection key or the `provideDeckCommandEditor` helper (see @kong-ui-public/entities-shared/deck-editor).";
399
+ function Pe(e, s) {
400
+ const r = P(q, null), t = _(() => {
401
+ const a = m(e);
402
+ return (a.app === "kongManager" || !!(a.app === "konnect" && a.enableDeckConfig)) && H(m(s));
403
+ }), o = _(() => {
404
+ const a = m(e), c = a.app === "konnect" && a.enableDeckConfig && typeof a.enableDeckConfig != "boolean" ? a.enableDeckConfig.customization : void 0;
405
+ if (c && !r) {
406
+ console.warn(Z);
407
+ return;
408
+ }
409
+ return c;
410
+ }), n = _(() => {
411
+ const a = m(e);
412
+ return a.app === "konnect" && a.enableDeckConfig && typeof a.enableDeckConfig != "boolean" ? a.enableDeckConfig.calloutPreferenceKey : a.app === "kongManager" ? a.deckCalloutPreferenceKey : void 0;
413
+ });
414
+ return {
415
+ isDeckEnabled: t,
416
+ deckCustomizationOptions: o,
417
+ deckCalloutPreferenceKey: n
418
+ };
419
+ }
420
+ function Re(e, s) {
421
+ const r = P(q, null), t = _(() => {
422
+ const a = m(e);
423
+ return (a.app === "kongManager" || !!(a.app === "konnect" && a.enableDeckTab)) && H(m(s));
424
+ }), o = _(() => {
425
+ const a = m(e), c = a.app === "konnect" && a.enableDeckTab && typeof a.enableDeckTab != "boolean" ? a.enableDeckTab.customization : void 0;
426
+ if (c && !r) {
427
+ console.warn(Z);
428
+ return;
429
+ }
430
+ return c;
431
+ }), n = _(() => {
432
+ const a = m(e);
433
+ return a.app === "konnect" && a.enableDeckTab && typeof a.enableDeckTab != "boolean" ? a.enableDeckTab.calloutPreferenceKey : a.app === "kongManager" ? a.deckCalloutPreferenceKey : void 0;
434
+ });
435
+ return {
436
+ isDeckEnabled: t,
437
+ deckCustomizationOptions: o,
438
+ deckCalloutPreferenceKey: n
439
+ };
440
+ }
441
+ function Ke(e, s) {
442
+ const r = W(s), t = _(
443
+ () => e.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${r}`) : new URL(r)
444
+ );
445
+ return t.value.search = "", (o) => `${t.value.href}/${o}`;
446
+ }
447
+ function Ee() {
448
+ const { i18n: { t: e } } = R();
449
+ return {
450
+ getErrorFieldsFromError: (t) => {
451
+ var a, c, l;
452
+ if (!t)
453
+ return {
454
+ messages: [e("errors.unexpected")],
455
+ fields: []
456
+ };
457
+ if (((a = t == null ? void 0 : t.response) == null ? void 0 : a.status) === 401)
458
+ return {
459
+ messages: [],
460
+ fields: []
461
+ };
462
+ let o = [e("errors.unexpected")];
463
+ const n = [];
464
+ if ((c = t == null ? void 0 : t.response) != null && c.data) {
465
+ if ((l = t.response.data.details) != null && l.length)
466
+ return o = [], t.response.data.details.forEach((i) => {
467
+ let f = e("errors.unexpected");
468
+ i.messages && Array.isArray(i.messages) && i.messages.length && (f = i.messages.join(", ")), i.field && n.push({ field: i.field, message: f }), o.push(`${i.field ?? ""} ${f}`);
469
+ }), { messages: o, fields: n };
470
+ if (t.response.data.message && Array.isArray(t.response.data.message))
471
+ return o = [], t.response.data.message.forEach((i) => {
472
+ if (i != null && i.constraints) {
473
+ const f = Object.values(i.constraints).join(", ");
474
+ o.push(f), i.property && n.push({ field: i.property, message: f });
475
+ } else i != null && i.property && (i != null && i.message) ? (n.push({ field: i.property, message: i.message }), o.push(i.message)) : o.push(i);
476
+ }), { messages: o, fields: n };
477
+ if (typeof t.response.data.message == "string" || typeof t.response.data == "string")
478
+ return {
479
+ messages: [t.response.data.message],
480
+ fields: []
481
+ };
482
+ if (typeof t.response.data == "object")
483
+ return o = [], Object.keys(t.response.data).forEach((i) => {
484
+ n.push({ field: i, message: t.response.data[i] }), o.push(t.response.data[i]);
485
+ }), { messages: o, fields: n };
486
+ }
487
+ return {
488
+ messages: [t.message || e("errors.unexpected")],
489
+ fields: []
490
+ };
491
+ },
492
+ getMessageFromError: (t) => {
493
+ var o, n, a, c;
494
+ if (!t)
495
+ return e("errors.unexpected");
496
+ if (((o = t == null ? void 0 : t.response) == null ? void 0 : o.status) === 401)
497
+ return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."), "";
498
+ if ((n = t == null ? void 0 : t.response) != null && n.data) {
499
+ if (t.response.data.detail)
500
+ return t.response.data.detail;
501
+ if ((a = t.response.data.details) != null && a.length)
502
+ return t.response.data.details.map((l) => {
503
+ let i = e("errors.unexpected");
504
+ return l.messages && typeof l.messages == "object" && l.messages.length && (i = l.messages.join(", ")), l.field ? `${l.field} - ${i}` : i;
505
+ }).join("; ");
506
+ if (t.response.data.message) {
507
+ const { message: l } = t.response.data;
508
+ return Array.isArray(l) ? (c = l[0]) != null && c.constraints ? Object.values(l[0].constraints)[0] : l[0] : l;
509
+ }
510
+ if (typeof t.response.data == "string")
511
+ return t.response.data;
512
+ if (typeof t.response.data == "object")
513
+ return Object.keys(t.response.data).map((l) => `${l} ${t.response.data[l]}`).join(", ");
514
+ }
515
+ return t.message || e("errors.unexpected");
516
+ }
517
+ };
518
+ }
519
+ function Le(e) {
520
+ const s = window.location.origin, r = s.endsWith("/") ? s : `${s}/`;
521
+ try {
522
+ const t = e.join("/"), o = `${r}${t}`, n = e.some((c) => c.trim() === "");
523
+ if (/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(o) && !n && new URL(o))
524
+ return `${r}${t}`;
525
+ throw new Error("Invalid url");
526
+ } catch (t) {
527
+ return console.warn("Failed to build valid URL:", t), "";
528
+ }
529
+ }
530
+ function X(e, s) {
531
+ const r = _(() => {
532
+ const o = m(e);
533
+ return o.app === "konnect" || !!o.isExactMatch;
534
+ }), t = _(() => {
535
+ const o = m(s);
536
+ return o.startsWith("/") ? new URL(`${window.location.origin}${o}`) : new URL(o);
537
+ });
538
+ return (o) => {
539
+ const { page: n, pageSize: a, offset: c, sortColumnKey: l, sortColumnOrder: i, query: f } = o;
540
+ try {
541
+ let u = new URL(t.value.href);
542
+ if (r.value && f) {
543
+ const k = new URLSearchParams(t.value.search);
544
+ u.search = "", u = m(e).isExactMatch ? new URL(`${u.href}/${f}`) : new URL(`${u.href}?filter[name][contains]=${f}`), k.forEach((w, p) => u.searchParams.append(p, w));
545
+ } else
546
+ r.value || new URLSearchParams(f).forEach((k, w) => {
547
+ u.searchParams.append(w, k);
548
+ }), l && u.searchParams.append("sort_by", l), i === "desc" && u.searchParams.append("sort_desc", "1"), u.searchParams.append("size", String(a));
549
+ return c && n !== 1 && u.searchParams.append("offset", String(c)), u.href;
550
+ } catch (u) {
551
+ return console.error("RouteList(fetcher)", u), m(s);
552
+ }
553
+ };
554
+ }
555
+ const j = /* @__PURE__ */ new Map();
556
+ function $e(e, s, r) {
557
+ const t = h(!0), o = m(e), { axiosInstance: n } = $(o.axiosRequestConfig), a = X(e, s), c = h({
558
+ status: x.Idle
559
+ }), l = async (u) => {
560
+ var w;
561
+ const k = m(r) || "data";
562
+ try {
563
+ c.value = t.value ? { status: x.InitialLoad } : { status: x.Loading }, t.value = !1;
564
+ let p = a(u);
565
+ p.includes("filter[name]") && (p = `${p}&page[size]=${u.pageSize}&page[number]=${u.page}`);
566
+ const C = await n.get(p);
567
+ if (C.status >= 400)
568
+ throw C;
569
+ const y = C.data, I = k && k.replace(/[^\w-_]/gi, "");
570
+ let D;
571
+ y[I] ? D = Array.isArray(y[I]) ? y[I] : [y[I]] : Array.isArray(y) ? D = y : D = Object.keys(y).length ? [y] : [];
572
+ const d = {
573
+ data: D,
574
+ total: D.length,
575
+ ...y.offset ? {
576
+ pagination: {
577
+ offset: y.offset
578
+ }
579
+ } : null
580
+ };
581
+ return d.data.length === 0 && !u.query ? c.value = {
582
+ status: x.NoRecords,
583
+ response: d
584
+ } : c.value = {
585
+ status: x.Idle,
586
+ response: d
587
+ }, d;
588
+ } catch (p) {
589
+ const C = {
590
+ data: [],
591
+ total: 0
592
+ };
593
+ return u.query && (((w = p.response) == null ? void 0 : w.status) === 404 || p.status === 404) ? (c.value = {
594
+ status: x.NoResults,
595
+ response: C,
596
+ error: p.response ? p : { response: p }
597
+ }, C) : (c.value = {
598
+ status: x.Error,
599
+ response: C,
600
+ error: p.response ? p : { response: p }
601
+ }, C);
602
+ }
603
+ }, i = o.cacheIdentifier, f = ee(i);
604
+ return { fetcher: l, fetcherState: c, fetcherCacheKey: f };
605
+ }
606
+ function ee(e) {
607
+ if (e) {
608
+ let s = j.get(e);
609
+ return s || (s = h(1), j.set(e, s)), s;
610
+ }
611
+ return h(1);
612
+ }
613
+ function Me() {
614
+ const e = (t, o = "_") => t ? t.split(o).map((n) => n.toLowerCase() === "id" ? n.toUpperCase() : n.charAt(0).toUpperCase() + n.substring(1)).join(" ") : "", s = /(?:^|[\s-:'"])\w/g;
615
+ return {
616
+ capitalize: (t) => t ? t.replace(s, (o) => o.toUpperCase()) : "",
617
+ convertKeyToTitle: e
618
+ };
619
+ }
620
+ const te = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, F = (e) => {
621
+ if (typeof e != "string")
622
+ throw new TypeError("Invalid argument expected string");
623
+ const s = e.match(te);
624
+ if (!s)
625
+ throw new Error(`Invalid argument not valid semver ('${e}' received)`);
626
+ return s.shift(), s;
627
+ }, B = (e) => e === "*" || e === "x" || e === "X", z = (e) => {
628
+ const s = parseInt(e, 10);
629
+ return isNaN(s) ? e : s;
630
+ }, Te = (e, s) => typeof e != typeof s ? [String(e), String(s)] : [e, s], Ue = (e, s) => {
631
+ if (B(e) || B(s))
632
+ return 0;
633
+ const [r, t] = Te(z(e), z(s));
634
+ return r > t ? 1 : r < t ? -1 : 0;
635
+ }, V = (e, s) => {
636
+ for (let r = 0; r < Math.max(e.length, s.length); r++) {
637
+ const t = Ue(e[r] || "0", s[r] || "0");
638
+ if (t !== 0)
639
+ return t;
640
+ }
641
+ return 0;
642
+ }, Ne = (e, s) => {
643
+ const r = F(e), t = F(s), o = r.pop(), n = t.pop(), a = V(r, t);
644
+ return a !== 0 ? a : o && n ? V(o.split("."), n.split(".")) : o || n ? o ? -1 : 1 : 0;
645
+ }, G = (e, s, r) => {
646
+ je(r);
647
+ const t = Ne(e, s);
648
+ return ae[r].includes(t);
649
+ }, ae = {
650
+ ">": [1],
651
+ ">=": [0, 1],
652
+ "=": [0],
653
+ "<=": [-1, 0],
654
+ "<": [-1],
655
+ "!=": [-1, 1]
656
+ }, S = Object.keys(ae), je = (e) => {
657
+ if (typeof e != "string")
658
+ throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);
659
+ if (S.indexOf(e) === -1)
660
+ throw new Error(`Invalid operator, expected one of ${S.join("|")}`);
661
+ }, Fe = (e) => typeof e == "string" && /^[v\d]/.test(e) && te.test(e);
662
+ function Be(e) {
663
+ const { gatewayInfo: s, supportedRange: r } = e;
664
+ if (!s)
665
+ return !0;
666
+ const { edition: t, version: o } = s;
667
+ if (!Fe(o))
668
+ return console.error("Invalid version"), !1;
669
+ const n = r[t];
670
+ if (!n)
671
+ return !1;
672
+ const [a, c] = n;
673
+ return !(a && G(o, a, "<") || c && G(o, c, ">"));
674
+ }
675
+ function ze(e) {
676
+ const s = h(0), r = h(0), t = h(!1);
677
+ return se(e, (n) => {
678
+ n && !t.value && (s.value = n.offsetWidth, r.value = n.scrollWidth, t.value = !0);
679
+ }), {
680
+ isTruncated: _(() => s.value < r.value)
681
+ };
682
+ }
683
+ function Ve() {
684
+ const { i18n: { t: e } } = R();
685
+ return {
686
+ utf8Name: (r) => /^[\p{N}\p{L}.\-_~]*$/u.test(r) ? "" : e("validationErrors.utf8Name")
687
+ };
688
+ }
689
+ const L = Symbol("schema"), Ge = (e) => {
690
+ J(L, e);
691
+ }, Se = (e) => {
692
+ var o, n;
693
+ const s = P(L, void 0), r = (n = (o = s == null ? void 0 : s.value) == null ? void 0 : o.fields) == null ? void 0 : n.find((a) => Object.keys(a)[0] === e), t = ne(r == null ? void 0 : r[e]);
694
+ return J(L, t), t;
695
+ };
696
+ function We(e) {
697
+ let s = "";
698
+ const r = h(!1), t = h(null), o = _(() => {
699
+ let a;
700
+ return r.value ? a = !0 : t.value ? a = t.value.hasData || e && m(e) : a = !1, !a;
701
+ });
702
+ return {
703
+ tableState: t,
704
+ hasRecords: r,
705
+ hideTableToolbar: o,
706
+ handleStateChange: (a) => {
707
+ a.hasData ? r.value = !0 : a.state === "success" && !a.hasData && (!e || !s) && (r.value = !1), e && (s = m(e)), t.value = { ...a };
708
+ }
709
+ };
710
+ }
711
+ const at = {
712
+ useAxios: $,
713
+ useDebouncedFilter: Oe,
714
+ useDeleteUrlBuilder: Ke,
715
+ useBaseEntityDeckOptions: Pe,
716
+ useBaseFormDeckOptions: Re,
717
+ useErrors: Ee,
718
+ useExternalLinkCreator: Le,
719
+ useFetcher: $e,
720
+ useFetcherCacheKey: ee,
721
+ useFetchUrlBuilder: X,
722
+ useHelpers: Q,
723
+ useStringHelpers: Me,
724
+ useI18n: R,
725
+ useGatewayFeatureSupported: Be,
726
+ useTruncationDetector: ze,
727
+ useValidators: Ve,
728
+ useSchemaProvider: Ge,
729
+ useSubSchema: Se,
730
+ useTableState: We
731
+ }, st = (e, s) => {
732
+ const r = e.__vccOpts || e;
733
+ for (const [t, o] of s)
734
+ r[t] = o;
735
+ return r;
736
+ };
737
+ export {
738
+ le as C,
739
+ q as D,
740
+ qe as E,
741
+ x as F,
742
+ Ze as I,
743
+ tt as P,
744
+ Y as S,
745
+ st as _,
746
+ Qe as a,
747
+ Z as b,
748
+ at as c,
749
+ Xe as d,
750
+ ce as e,
751
+ et as f,
752
+ ie as g,
753
+ H as i
754
+ };