@opengis/cms 0.0.57 → 0.0.59

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 (56) hide show
  1. package/README.md +1 -1
  2. package/dist/AddNewItemInTree-05PSSEFi.js +76 -0
  3. package/dist/ArticlesPage-BjYzvTWM.js +298 -0
  4. package/dist/CollectionsBreadcrumb-HePNJb-d.js +4 -0
  5. package/dist/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-BJh-tjam.js +53 -0
  6. package/dist/CollectionsPage-DHfPNql6.js +124 -0
  7. package/dist/{CreateForm-BMOBeP4G.js → CreateForm-5FvT45vH.js} +1 -1
  8. package/dist/Dashboard-CXkg_pk8.js +358 -0
  9. package/dist/EditCollectionPage-CqYHpEON.js +187 -0
  10. package/dist/{EmptyData-DaZt_nAm.js → EmptyData-DxPrSXhV.js} +1 -1
  11. package/dist/{MenuAddPage-Bf48Z-ah.js → MenuAddPage-QTnwCoGh.js} +40 -35
  12. package/dist/MenuBody-Bi0ONVZf.js +125 -0
  13. package/dist/MenuItemPage-B7Y9KFyb.js +1027 -0
  14. package/dist/MenuList-BLIpeqSd.js +172 -0
  15. package/dist/MenuPage-3W6jZ15H.js +107 -0
  16. package/dist/MenuWrapper-OrOv6sOb.js +12 -0
  17. package/dist/MonacoEditor-ByPT8pnv.js +4 -0
  18. package/dist/MonacoEditor.vue_vue_type_script_setup_true_lang-C8cip9Ci.js +84 -0
  19. package/dist/{UniversalTable.vue_vue_type_script_setup_true_lang-CJGTsd1V.js → UniversalTable-GBd_pStq.js} +81 -81
  20. package/dist/{UniversalTablePagination.vue_vue_type_script_setup_true_lang-GYZd_gkA.js → UniversalTablePagination-Dw2hc0nc.js} +47 -47
  21. package/dist/VsFormTags-CMjiu9sY.js +114 -0
  22. package/dist/VsPreview-DwETkOpb.js +63 -0
  23. package/dist/contentForm-Buku-lel.js +489 -0
  24. package/dist/getField-CpwVE28P.js +179 -0
  25. package/dist/index.d.ts +8 -0
  26. package/dist/index.js +72 -71
  27. package/dist/style.css +1 -1
  28. package/dist/vs-builder-edit-D-q1o8tF.js +604 -0
  29. package/dist/vs-builder-monaco-Cw-f19gc.js +33 -0
  30. package/dist/vs-builder-preview-BH4VAM3a.js +44 -0
  31. package/dist/vs-form-custom-datatable-BDZo48w3.js +317 -0
  32. package/dist/vs-form-integer-BZ855R3g.js +61 -0
  33. package/dist/vs-form-media-select-NY27EaG1.js +837 -0
  34. package/dist/vs-form-reference-list-Dtv8fJJU.js +1536 -0
  35. package/dist/vs-form-reletion-link-BhzNQszm.js +34 -0
  36. package/dist/vs-form-tiptap-DDFQjRjY.js +4 -0
  37. package/dist/vs-form-tiptap.vue_vue_type_script_setup_true_lang-DGgsqXwg.js +11 -0
  38. package/dist/vs-richtext-md-C098v_6Q.js +4 -0
  39. package/dist/vs-richtext-md.vue_vue_type_script_setup_true_lang-Ct8uTV-J.js +14 -0
  40. package/locales/en.json +1 -0
  41. package/locales/uk.json +1 -0
  42. package/package.json +69 -68
  43. package/server/functions/utils/mock.reply.js +7 -7
  44. package/server/routes/cms/controllers/getPermissions.js +15 -15
  45. package/server/routes/cms/controllers/setPermissions.js +49 -49
  46. package/server/templates/select/core.user_mentioned.sql +1 -1
  47. package/dist/ArticlesPage-BcR1hbds.js +0 -286
  48. package/dist/BuilderPage-CK_osM89.js +0 -386
  49. package/dist/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-CnOe9ORD.js +0 -45
  50. package/dist/CollectionsPage-JfmrHNR_.js +0 -110
  51. package/dist/EditCollectionPage-Cw3GQYRe.js +0 -809
  52. package/dist/MenuItemPage-CXn5HC8j.js +0 -1366
  53. package/dist/MenuPage-tJZtK46W.js +0 -106
  54. package/dist/MonacoEditor.vue_vue_type_script_setup_true_lang-B1DrxmQX.js +0 -84
  55. package/dist/contentForm-B6gHgGkz.js +0 -586
  56. package/dist/getField-Y5WXnRR0.js +0 -2948
@@ -0,0 +1,1027 @@
1
+ import { defineComponent as Se, defineAsyncComponent as Q, computed as Ne, ref as I, onMounted as ke, openBlock as R, createElementBlock as W, createElementVNode as y, unref as w, createVNode as U, toDisplayString as L, createTextVNode as Te, normalizeClass as Z, createBlock as X, createCommentVNode as Oe } from "vue";
2
+ import { useRouter as Ce, useRoute as be } from "vue-router";
3
+ import { ArrowLeft as Ie, HelpCircle as Re, Save as Le } from "lucide-vue-next";
4
+ import { useI18n as Ye } from "vue-i18n";
5
+ import { notify as B } from "@opengis/core";
6
+ import { inputs as z, VForm as Me } from "@opengis/form";
7
+ /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
8
+ function se(e) {
9
+ return typeof e > "u" || e === null;
10
+ }
11
+ function De(e) {
12
+ return typeof e == "object" && e !== null;
13
+ }
14
+ function Ue(e) {
15
+ return Array.isArray(e) ? e : se(e) ? [] : [e];
16
+ }
17
+ function Be(e, r) {
18
+ var n, t, i, a;
19
+ if (r)
20
+ for (a = Object.keys(r), n = 0, t = a.length; n < t; n += 1)
21
+ i = a[n], e[i] = r[i];
22
+ return e;
23
+ }
24
+ function Pe(e, r) {
25
+ var n = "", t;
26
+ for (t = 0; t < r; t += 1)
27
+ n += e;
28
+ return n;
29
+ }
30
+ function He(e) {
31
+ return e === 0 && Number.NEGATIVE_INFINITY === 1 / e;
32
+ }
33
+ var je = se, Ke = De, Ve = Ue, $e = Pe, qe = He, Ge = Be, _ = {
34
+ isNothing: je,
35
+ isObject: Ke,
36
+ toArray: Ve,
37
+ repeat: $e,
38
+ isNegativeZero: qe,
39
+ extend: Ge
40
+ };
41
+ function ce(e, r) {
42
+ var n = "", t = e.reason || "(unknown reason)";
43
+ return e.mark ? (e.mark.name && (n += 'in "' + e.mark.name + '" '), n += "(" + (e.mark.line + 1) + ":" + (e.mark.column + 1) + ")", !r && e.mark.snippet && (n += `
44
+
45
+ ` + e.mark.snippet), t + " " + n) : t;
46
+ }
47
+ function k(e, r) {
48
+ Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = r, this.message = ce(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || "";
49
+ }
50
+ k.prototype = Object.create(Error.prototype);
51
+ k.prototype.constructor = k;
52
+ k.prototype.toString = function(r) {
53
+ return this.name + ": " + ce(this, r);
54
+ };
55
+ var g = k, Qe = [
56
+ "kind",
57
+ "multi",
58
+ "resolve",
59
+ "construct",
60
+ "instanceOf",
61
+ "predicate",
62
+ "represent",
63
+ "representName",
64
+ "defaultStyle",
65
+ "styleAliases"
66
+ ], We = [
67
+ "scalar",
68
+ "sequence",
69
+ "mapping"
70
+ ];
71
+ function Ze(e) {
72
+ var r = {};
73
+ return e !== null && Object.keys(e).forEach(function(n) {
74
+ e[n].forEach(function(t) {
75
+ r[String(t)] = n;
76
+ });
77
+ }), r;
78
+ }
79
+ function Xe(e, r) {
80
+ if (r = r || {}, Object.keys(r).forEach(function(n) {
81
+ if (Qe.indexOf(n) === -1)
82
+ throw new g('Unknown option "' + n + '" is met in definition of "' + e + '" YAML type.');
83
+ }), this.options = r, this.tag = e, this.kind = r.kind || null, this.resolve = r.resolve || function() {
84
+ return !0;
85
+ }, this.construct = r.construct || function(n) {
86
+ return n;
87
+ }, this.instanceOf = r.instanceOf || null, this.predicate = r.predicate || null, this.represent = r.represent || null, this.representName = r.representName || null, this.defaultStyle = r.defaultStyle || null, this.multi = r.multi || !1, this.styleAliases = Ze(r.styleAliases || null), We.indexOf(this.kind) === -1)
88
+ throw new g('Unknown kind "' + this.kind + '" is specified for "' + e + '" YAML type.');
89
+ }
90
+ var h = Xe;
91
+ function J(e, r) {
92
+ var n = [];
93
+ return e[r].forEach(function(t) {
94
+ var i = n.length;
95
+ n.forEach(function(a, l) {
96
+ a.tag === t.tag && a.kind === t.kind && a.multi === t.multi && (i = l);
97
+ }), n[i] = t;
98
+ }), n;
99
+ }
100
+ function ze() {
101
+ var e = {
102
+ scalar: {},
103
+ sequence: {},
104
+ mapping: {},
105
+ fallback: {},
106
+ multi: {
107
+ scalar: [],
108
+ sequence: [],
109
+ mapping: [],
110
+ fallback: []
111
+ }
112
+ }, r, n;
113
+ function t(i) {
114
+ i.multi ? (e.multi[i.kind].push(i), e.multi.fallback.push(i)) : e[i.kind][i.tag] = e.fallback[i.tag] = i;
115
+ }
116
+ for (r = 0, n = arguments.length; r < n; r += 1)
117
+ arguments[r].forEach(t);
118
+ return e;
119
+ }
120
+ function P(e) {
121
+ return this.extend(e);
122
+ }
123
+ P.prototype.extend = function(r) {
124
+ var n = [], t = [];
125
+ if (r instanceof h)
126
+ t.push(r);
127
+ else if (Array.isArray(r))
128
+ t = t.concat(r);
129
+ else if (r && (Array.isArray(r.implicit) || Array.isArray(r.explicit)))
130
+ r.implicit && (n = n.concat(r.implicit)), r.explicit && (t = t.concat(r.explicit));
131
+ else
132
+ throw new g("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
133
+ n.forEach(function(a) {
134
+ if (!(a instanceof h))
135
+ throw new g("Specified list of YAML types (or a single Type object) contains a non-Type object.");
136
+ if (a.loadKind && a.loadKind !== "scalar")
137
+ throw new g("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
138
+ if (a.multi)
139
+ throw new g("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
140
+ }), t.forEach(function(a) {
141
+ if (!(a instanceof h))
142
+ throw new g("Specified list of YAML types (or a single Type object) contains a non-Type object.");
143
+ });
144
+ var i = Object.create(P.prototype);
145
+ return i.implicit = (this.implicit || []).concat(n), i.explicit = (this.explicit || []).concat(t), i.compiledImplicit = J(i, "implicit"), i.compiledExplicit = J(i, "explicit"), i.compiledTypeMap = ze(i.compiledImplicit, i.compiledExplicit), i;
146
+ };
147
+ var Je = P, er = new h("tag:yaml.org,2002:str", {
148
+ kind: "scalar",
149
+ construct: function(e) {
150
+ return e !== null ? e : "";
151
+ }
152
+ }), rr = new h("tag:yaml.org,2002:seq", {
153
+ kind: "sequence",
154
+ construct: function(e) {
155
+ return e !== null ? e : [];
156
+ }
157
+ }), nr = new h("tag:yaml.org,2002:map", {
158
+ kind: "mapping",
159
+ construct: function(e) {
160
+ return e !== null ? e : {};
161
+ }
162
+ }), tr = new Je({
163
+ explicit: [
164
+ er,
165
+ rr,
166
+ nr
167
+ ]
168
+ });
169
+ function ir(e) {
170
+ if (e === null)
171
+ return !0;
172
+ var r = e.length;
173
+ return r === 1 && e === "~" || r === 4 && (e === "null" || e === "Null" || e === "NULL");
174
+ }
175
+ function lr() {
176
+ return null;
177
+ }
178
+ function ar(e) {
179
+ return e === null;
180
+ }
181
+ var ur = new h("tag:yaml.org,2002:null", {
182
+ kind: "scalar",
183
+ resolve: ir,
184
+ construct: lr,
185
+ predicate: ar,
186
+ represent: {
187
+ canonical: function() {
188
+ return "~";
189
+ },
190
+ lowercase: function() {
191
+ return "null";
192
+ },
193
+ uppercase: function() {
194
+ return "NULL";
195
+ },
196
+ camelcase: function() {
197
+ return "Null";
198
+ },
199
+ empty: function() {
200
+ return "";
201
+ }
202
+ },
203
+ defaultStyle: "lowercase"
204
+ });
205
+ function or(e) {
206
+ if (e === null)
207
+ return !1;
208
+ var r = e.length;
209
+ return r === 4 && (e === "true" || e === "True" || e === "TRUE") || r === 5 && (e === "false" || e === "False" || e === "FALSE");
210
+ }
211
+ function sr(e) {
212
+ return e === "true" || e === "True" || e === "TRUE";
213
+ }
214
+ function cr(e) {
215
+ return Object.prototype.toString.call(e) === "[object Boolean]";
216
+ }
217
+ var fr = new h("tag:yaml.org,2002:bool", {
218
+ kind: "scalar",
219
+ resolve: or,
220
+ construct: sr,
221
+ predicate: cr,
222
+ represent: {
223
+ lowercase: function(e) {
224
+ return e ? "true" : "false";
225
+ },
226
+ uppercase: function(e) {
227
+ return e ? "TRUE" : "FALSE";
228
+ },
229
+ camelcase: function(e) {
230
+ return e ? "True" : "False";
231
+ }
232
+ },
233
+ defaultStyle: "lowercase"
234
+ });
235
+ function pr(e) {
236
+ return 48 <= e && e <= 57 || 65 <= e && e <= 70 || 97 <= e && e <= 102;
237
+ }
238
+ function mr(e) {
239
+ return 48 <= e && e <= 55;
240
+ }
241
+ function dr(e) {
242
+ return 48 <= e && e <= 57;
243
+ }
244
+ function hr(e) {
245
+ if (e === null)
246
+ return !1;
247
+ var r = e.length, n = 0, t = !1, i;
248
+ if (!r)
249
+ return !1;
250
+ if (i = e[n], (i === "-" || i === "+") && (i = e[++n]), i === "0") {
251
+ if (n + 1 === r)
252
+ return !0;
253
+ if (i = e[++n], i === "b") {
254
+ for (n++; n < r; n++)
255
+ if (i = e[n], i !== "_") {
256
+ if (i !== "0" && i !== "1")
257
+ return !1;
258
+ t = !0;
259
+ }
260
+ return t && i !== "_";
261
+ }
262
+ if (i === "x") {
263
+ for (n++; n < r; n++)
264
+ if (i = e[n], i !== "_") {
265
+ if (!pr(e.charCodeAt(n)))
266
+ return !1;
267
+ t = !0;
268
+ }
269
+ return t && i !== "_";
270
+ }
271
+ if (i === "o") {
272
+ for (n++; n < r; n++)
273
+ if (i = e[n], i !== "_") {
274
+ if (!mr(e.charCodeAt(n)))
275
+ return !1;
276
+ t = !0;
277
+ }
278
+ return t && i !== "_";
279
+ }
280
+ }
281
+ if (i === "_")
282
+ return !1;
283
+ for (; n < r; n++)
284
+ if (i = e[n], i !== "_") {
285
+ if (!dr(e.charCodeAt(n)))
286
+ return !1;
287
+ t = !0;
288
+ }
289
+ return !(!t || i === "_");
290
+ }
291
+ function xr(e) {
292
+ var r = e, n = 1, t;
293
+ if (r.indexOf("_") !== -1 && (r = r.replace(/_/g, "")), t = r[0], (t === "-" || t === "+") && (t === "-" && (n = -1), r = r.slice(1), t = r[0]), r === "0")
294
+ return 0;
295
+ if (t === "0") {
296
+ if (r[1] === "b")
297
+ return n * parseInt(r.slice(2), 2);
298
+ if (r[1] === "x")
299
+ return n * parseInt(r.slice(2), 16);
300
+ if (r[1] === "o")
301
+ return n * parseInt(r.slice(2), 8);
302
+ }
303
+ return n * parseInt(r, 10);
304
+ }
305
+ function vr(e) {
306
+ return Object.prototype.toString.call(e) === "[object Number]" && e % 1 === 0 && !_.isNegativeZero(e);
307
+ }
308
+ var gr = new h("tag:yaml.org,2002:int", {
309
+ kind: "scalar",
310
+ resolve: hr,
311
+ construct: xr,
312
+ predicate: vr,
313
+ represent: {
314
+ binary: function(e) {
315
+ return e >= 0 ? "0b" + e.toString(2) : "-0b" + e.toString(2).slice(1);
316
+ },
317
+ octal: function(e) {
318
+ return e >= 0 ? "0o" + e.toString(8) : "-0o" + e.toString(8).slice(1);
319
+ },
320
+ decimal: function(e) {
321
+ return e.toString(10);
322
+ },
323
+ /* eslint-disable max-len */
324
+ hexadecimal: function(e) {
325
+ return e >= 0 ? "0x" + e.toString(16).toUpperCase() : "-0x" + e.toString(16).toUpperCase().slice(1);
326
+ }
327
+ },
328
+ defaultStyle: "decimal",
329
+ styleAliases: {
330
+ binary: [2, "bin"],
331
+ octal: [8, "oct"],
332
+ decimal: [10, "dec"],
333
+ hexadecimal: [16, "hex"]
334
+ }
335
+ }), yr = new RegExp(
336
+ // 2.5e4, 2.5 and integers
337
+ "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
338
+ );
339
+ function Ar(e) {
340
+ return !(e === null || !yr.test(e) || // Quick hack to not allow integers end with `_`
341
+ // Probably should update regexp & check speed
342
+ e[e.length - 1] === "_");
343
+ }
344
+ function wr(e) {
345
+ var r, n;
346
+ return r = e.replace(/_/g, "").toLowerCase(), n = r[0] === "-" ? -1 : 1, "+-".indexOf(r[0]) >= 0 && (r = r.slice(1)), r === ".inf" ? n === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : r === ".nan" ? NaN : n * parseFloat(r, 10);
347
+ }
348
+ var _r = /^[-+]?[0-9]+e/;
349
+ function Er(e, r) {
350
+ var n;
351
+ if (isNaN(e))
352
+ switch (r) {
353
+ case "lowercase":
354
+ return ".nan";
355
+ case "uppercase":
356
+ return ".NAN";
357
+ case "camelcase":
358
+ return ".NaN";
359
+ }
360
+ else if (Number.POSITIVE_INFINITY === e)
361
+ switch (r) {
362
+ case "lowercase":
363
+ return ".inf";
364
+ case "uppercase":
365
+ return ".INF";
366
+ case "camelcase":
367
+ return ".Inf";
368
+ }
369
+ else if (Number.NEGATIVE_INFINITY === e)
370
+ switch (r) {
371
+ case "lowercase":
372
+ return "-.inf";
373
+ case "uppercase":
374
+ return "-.INF";
375
+ case "camelcase":
376
+ return "-.Inf";
377
+ }
378
+ else if (_.isNegativeZero(e))
379
+ return "-0.0";
380
+ return n = e.toString(10), _r.test(n) ? n.replace("e", ".e") : n;
381
+ }
382
+ function Fr(e) {
383
+ return Object.prototype.toString.call(e) === "[object Number]" && (e % 1 !== 0 || _.isNegativeZero(e));
384
+ }
385
+ var Sr = new h("tag:yaml.org,2002:float", {
386
+ kind: "scalar",
387
+ resolve: Ar,
388
+ construct: wr,
389
+ predicate: Fr,
390
+ represent: Er,
391
+ defaultStyle: "lowercase"
392
+ }), Nr = tr.extend({
393
+ implicit: [
394
+ ur,
395
+ fr,
396
+ gr,
397
+ Sr
398
+ ]
399
+ }), kr = Nr, fe = new RegExp(
400
+ "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
401
+ ), pe = new RegExp(
402
+ "^([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]))?))?$"
403
+ );
404
+ function Tr(e) {
405
+ return e === null ? !1 : fe.exec(e) !== null || pe.exec(e) !== null;
406
+ }
407
+ function Or(e) {
408
+ var r, n, t, i, a, l, u, o = 0, s = null, p, f, c;
409
+ if (r = fe.exec(e), r === null && (r = pe.exec(e)), r === null)
410
+ throw new Error("Date resolve error");
411
+ if (n = +r[1], t = +r[2] - 1, i = +r[3], !r[4])
412
+ return new Date(Date.UTC(n, t, i));
413
+ if (a = +r[4], l = +r[5], u = +r[6], r[7]) {
414
+ for (o = r[7].slice(0, 3); o.length < 3; )
415
+ o += "0";
416
+ o = +o;
417
+ }
418
+ return r[9] && (p = +r[10], f = +(r[11] || 0), s = (p * 60 + f) * 6e4, r[9] === "-" && (s = -s)), c = new Date(Date.UTC(n, t, i, a, l, u, o)), s && c.setTime(c.getTime() - s), c;
419
+ }
420
+ function Cr(e) {
421
+ return e.toISOString();
422
+ }
423
+ var br = new h("tag:yaml.org,2002:timestamp", {
424
+ kind: "scalar",
425
+ resolve: Tr,
426
+ construct: Or,
427
+ instanceOf: Date,
428
+ represent: Cr
429
+ });
430
+ function Ir(e) {
431
+ return e === "<<" || e === null;
432
+ }
433
+ var Rr = new h("tag:yaml.org,2002:merge", {
434
+ kind: "scalar",
435
+ resolve: Ir
436
+ }), $ = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
437
+ \r`;
438
+ function Lr(e) {
439
+ if (e === null)
440
+ return !1;
441
+ var r, n, t = 0, i = e.length, a = $;
442
+ for (n = 0; n < i; n++)
443
+ if (r = a.indexOf(e.charAt(n)), !(r > 64)) {
444
+ if (r < 0)
445
+ return !1;
446
+ t += 6;
447
+ }
448
+ return t % 8 === 0;
449
+ }
450
+ function Yr(e) {
451
+ var r, n, t = e.replace(/[\r\n=]/g, ""), i = t.length, a = $, l = 0, u = [];
452
+ for (r = 0; r < i; r++)
453
+ r % 4 === 0 && r && (u.push(l >> 16 & 255), u.push(l >> 8 & 255), u.push(l & 255)), l = l << 6 | a.indexOf(t.charAt(r));
454
+ return n = i % 4 * 6, n === 0 ? (u.push(l >> 16 & 255), u.push(l >> 8 & 255), u.push(l & 255)) : n === 18 ? (u.push(l >> 10 & 255), u.push(l >> 2 & 255)) : n === 12 && u.push(l >> 4 & 255), new Uint8Array(u);
455
+ }
456
+ function Mr(e) {
457
+ var r = "", n = 0, t, i, a = e.length, l = $;
458
+ for (t = 0; t < a; t++)
459
+ t % 3 === 0 && t && (r += l[n >> 18 & 63], r += l[n >> 12 & 63], r += l[n >> 6 & 63], r += l[n & 63]), n = (n << 8) + e[t];
460
+ return i = a % 3, i === 0 ? (r += l[n >> 18 & 63], r += l[n >> 12 & 63], r += l[n >> 6 & 63], r += l[n & 63]) : i === 2 ? (r += l[n >> 10 & 63], r += l[n >> 4 & 63], r += l[n << 2 & 63], r += l[64]) : i === 1 && (r += l[n >> 2 & 63], r += l[n << 4 & 63], r += l[64], r += l[64]), r;
461
+ }
462
+ function Dr(e) {
463
+ return Object.prototype.toString.call(e) === "[object Uint8Array]";
464
+ }
465
+ var Ur = new h("tag:yaml.org,2002:binary", {
466
+ kind: "scalar",
467
+ resolve: Lr,
468
+ construct: Yr,
469
+ predicate: Dr,
470
+ represent: Mr
471
+ }), Br = Object.prototype.hasOwnProperty, Pr = Object.prototype.toString;
472
+ function Hr(e) {
473
+ if (e === null)
474
+ return !0;
475
+ var r = [], n, t, i, a, l, u = e;
476
+ for (n = 0, t = u.length; n < t; n += 1) {
477
+ if (i = u[n], l = !1, Pr.call(i) !== "[object Object]")
478
+ return !1;
479
+ for (a in i)
480
+ if (Br.call(i, a))
481
+ if (!l)
482
+ l = !0;
483
+ else
484
+ return !1;
485
+ if (!l)
486
+ return !1;
487
+ if (r.indexOf(a) === -1)
488
+ r.push(a);
489
+ else
490
+ return !1;
491
+ }
492
+ return !0;
493
+ }
494
+ function jr(e) {
495
+ return e !== null ? e : [];
496
+ }
497
+ var Kr = new h("tag:yaml.org,2002:omap", {
498
+ kind: "sequence",
499
+ resolve: Hr,
500
+ construct: jr
501
+ }), Vr = Object.prototype.toString;
502
+ function $r(e) {
503
+ if (e === null)
504
+ return !0;
505
+ var r, n, t, i, a, l = e;
506
+ for (a = new Array(l.length), r = 0, n = l.length; r < n; r += 1) {
507
+ if (t = l[r], Vr.call(t) !== "[object Object]" || (i = Object.keys(t), i.length !== 1))
508
+ return !1;
509
+ a[r] = [i[0], t[i[0]]];
510
+ }
511
+ return !0;
512
+ }
513
+ function qr(e) {
514
+ if (e === null)
515
+ return [];
516
+ var r, n, t, i, a, l = e;
517
+ for (a = new Array(l.length), r = 0, n = l.length; r < n; r += 1)
518
+ t = l[r], i = Object.keys(t), a[r] = [i[0], t[i[0]]];
519
+ return a;
520
+ }
521
+ var Gr = new h("tag:yaml.org,2002:pairs", {
522
+ kind: "sequence",
523
+ resolve: $r,
524
+ construct: qr
525
+ }), Qr = Object.prototype.hasOwnProperty;
526
+ function Wr(e) {
527
+ if (e === null)
528
+ return !0;
529
+ var r, n = e;
530
+ for (r in n)
531
+ if (Qr.call(n, r) && n[r] !== null)
532
+ return !1;
533
+ return !0;
534
+ }
535
+ function Zr(e) {
536
+ return e !== null ? e : {};
537
+ }
538
+ var Xr = new h("tag:yaml.org,2002:set", {
539
+ kind: "mapping",
540
+ resolve: Wr,
541
+ construct: Zr
542
+ }), zr = kr.extend({
543
+ implicit: [
544
+ br,
545
+ Rr
546
+ ],
547
+ explicit: [
548
+ Ur,
549
+ Kr,
550
+ Gr,
551
+ Xr
552
+ ]
553
+ });
554
+ function ee(e) {
555
+ return e === 48 ? "\0" : e === 97 ? "\x07" : e === 98 ? "\b" : e === 116 || e === 9 ? " " : e === 110 ? `
556
+ ` : 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" : "";
557
+ }
558
+ var Jr = new Array(256), en = new Array(256);
559
+ for (var F = 0; F < 256; F++)
560
+ Jr[F] = ee(F) ? 1 : 0, en[F] = ee(F);
561
+ var me = Object.prototype.toString, de = Object.prototype.hasOwnProperty, q = 65279, rn = 9, T = 10, nn = 13, tn = 32, ln = 33, an = 34, H = 35, un = 37, on = 38, sn = 39, cn = 42, he = 44, fn = 45, Y = 58, pn = 61, mn = 62, dn = 63, hn = 64, xe = 91, ve = 93, xn = 96, ge = 123, vn = 124, ye = 125, x = {};
562
+ x[0] = "\\0";
563
+ x[7] = "\\a";
564
+ x[8] = "\\b";
565
+ x[9] = "\\t";
566
+ x[10] = "\\n";
567
+ x[11] = "\\v";
568
+ x[12] = "\\f";
569
+ x[13] = "\\r";
570
+ x[27] = "\\e";
571
+ x[34] = '\\"';
572
+ x[92] = "\\\\";
573
+ x[133] = "\\N";
574
+ x[160] = "\\_";
575
+ x[8232] = "\\L";
576
+ x[8233] = "\\P";
577
+ var gn = [
578
+ "y",
579
+ "Y",
580
+ "yes",
581
+ "Yes",
582
+ "YES",
583
+ "on",
584
+ "On",
585
+ "ON",
586
+ "n",
587
+ "N",
588
+ "no",
589
+ "No",
590
+ "NO",
591
+ "off",
592
+ "Off",
593
+ "OFF"
594
+ ], yn = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
595
+ function An(e, r) {
596
+ var n, t, i, a, l, u, o;
597
+ if (r === null)
598
+ return {};
599
+ for (n = {}, t = Object.keys(r), i = 0, a = t.length; i < a; i += 1)
600
+ l = t[i], u = String(r[l]), l.slice(0, 2) === "!!" && (l = "tag:yaml.org,2002:" + l.slice(2)), o = e.compiledTypeMap.fallback[l], o && de.call(o.styleAliases, u) && (u = o.styleAliases[u]), n[l] = u;
601
+ return n;
602
+ }
603
+ function wn(e) {
604
+ var r, n, t;
605
+ if (r = e.toString(16).toUpperCase(), e <= 255)
606
+ n = "x", t = 2;
607
+ else if (e <= 65535)
608
+ n = "u", t = 4;
609
+ else if (e <= 4294967295)
610
+ n = "U", t = 8;
611
+ else
612
+ throw new g("code point within a string may not be greater than 0xFFFFFFFF");
613
+ return "\\" + n + _.repeat("0", t - r.length) + r;
614
+ }
615
+ var _n = 1, O = 2;
616
+ function En(e) {
617
+ this.schema = e.schema || zr, this.indent = Math.max(1, e.indent || 2), this.noArrayIndent = e.noArrayIndent || !1, this.skipInvalid = e.skipInvalid || !1, this.flowLevel = _.isNothing(e.flowLevel) ? -1 : e.flowLevel, this.styleMap = An(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 === '"' ? O : _n, 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;
618
+ }
619
+ function re(e, r) {
620
+ for (var n = _.repeat(" ", r), t = 0, i = -1, a = "", l, u = e.length; t < u; )
621
+ i = e.indexOf(`
622
+ `, t), i === -1 ? (l = e.slice(t), t = u) : (l = e.slice(t, i + 1), t = i + 1), l.length && l !== `
623
+ ` && (a += n), a += l;
624
+ return a;
625
+ }
626
+ function j(e, r) {
627
+ return `
628
+ ` + _.repeat(" ", e.indent * r);
629
+ }
630
+ function Fn(e, r) {
631
+ var n, t, i;
632
+ for (n = 0, t = e.implicitTypes.length; n < t; n += 1)
633
+ if (i = e.implicitTypes[n], i.resolve(r))
634
+ return !0;
635
+ return !1;
636
+ }
637
+ function M(e) {
638
+ return e === tn || e === rn;
639
+ }
640
+ function C(e) {
641
+ return 32 <= e && e <= 126 || 161 <= e && e <= 55295 && e !== 8232 && e !== 8233 || 57344 <= e && e <= 65533 && e !== q || 65536 <= e && e <= 1114111;
642
+ }
643
+ function ne(e) {
644
+ return C(e) && e !== q && e !== nn && e !== T;
645
+ }
646
+ function te(e, r, n) {
647
+ var t = ne(e), i = t && !M(e);
648
+ return (
649
+ // ns-plain-safe
650
+ (n ? (
651
+ // c = flow-in
652
+ t
653
+ ) : t && e !== he && e !== xe && e !== ve && e !== ge && e !== ye) && e !== H && !(r === Y && !i) || ne(r) && !M(r) && e === H || r === Y && i
654
+ );
655
+ }
656
+ function Sn(e) {
657
+ return C(e) && e !== q && !M(e) && e !== fn && e !== dn && e !== Y && e !== he && e !== xe && e !== ve && e !== ge && e !== ye && e !== H && e !== on && e !== cn && e !== ln && e !== vn && e !== pn && e !== mn && e !== sn && e !== an && e !== un && e !== hn && e !== xn;
658
+ }
659
+ function Nn(e) {
660
+ return !M(e) && e !== Y;
661
+ }
662
+ function N(e, r) {
663
+ var n = e.charCodeAt(r), t;
664
+ return n >= 55296 && n <= 56319 && r + 1 < e.length && (t = e.charCodeAt(r + 1), t >= 56320 && t <= 57343) ? (n - 55296) * 1024 + t - 56320 + 65536 : n;
665
+ }
666
+ function Ae(e) {
667
+ var r = /^\n* /;
668
+ return r.test(e);
669
+ }
670
+ var we = 1, K = 2, _e = 3, Ee = 4, S = 5;
671
+ function kn(e, r, n, t, i, a, l, u) {
672
+ var o, s = 0, p = null, f = !1, c = !1, b = t !== -1, E = -1, m = Sn(N(e, 0)) && Nn(N(e, e.length - 1));
673
+ if (r || l)
674
+ for (o = 0; o < e.length; s >= 65536 ? o += 2 : o++) {
675
+ if (s = N(e, o), !C(s))
676
+ return S;
677
+ m = m && te(s, p, u), p = s;
678
+ }
679
+ else {
680
+ for (o = 0; o < e.length; s >= 65536 ? o += 2 : o++) {
681
+ if (s = N(e, o), s === T)
682
+ f = !0, b && (c = c || // Foldable line = too long, and not more-indented.
683
+ o - E - 1 > t && e[E + 1] !== " ", E = o);
684
+ else if (!C(s))
685
+ return S;
686
+ m = m && te(s, p, u), p = s;
687
+ }
688
+ c = c || b && o - E - 1 > t && e[E + 1] !== " ";
689
+ }
690
+ return !f && !c ? m && !l && !i(e) ? we : a === O ? S : K : n > 9 && Ae(e) ? S : l ? a === O ? S : K : c ? Ee : _e;
691
+ }
692
+ function Tn(e, r, n, t, i) {
693
+ e.dump = function() {
694
+ if (r.length === 0)
695
+ return e.quotingType === O ? '""' : "''";
696
+ if (!e.noCompatMode && (gn.indexOf(r) !== -1 || yn.test(r)))
697
+ return e.quotingType === O ? '"' + r + '"' : "'" + r + "'";
698
+ var a = e.indent * Math.max(1, n), l = e.lineWidth === -1 ? -1 : Math.max(Math.min(e.lineWidth, 40), e.lineWidth - a), u = t || e.flowLevel > -1 && n >= e.flowLevel;
699
+ function o(s) {
700
+ return Fn(e, s);
701
+ }
702
+ switch (kn(
703
+ r,
704
+ u,
705
+ e.indent,
706
+ l,
707
+ o,
708
+ e.quotingType,
709
+ e.forceQuotes && !t,
710
+ i
711
+ )) {
712
+ case we:
713
+ return r;
714
+ case K:
715
+ return "'" + r.replace(/'/g, "''") + "'";
716
+ case _e:
717
+ return "|" + ie(r, e.indent) + le(re(r, a));
718
+ case Ee:
719
+ return ">" + ie(r, e.indent) + le(re(On(r, l), a));
720
+ case S:
721
+ return '"' + Cn(r) + '"';
722
+ default:
723
+ throw new g("impossible error: invalid scalar style");
724
+ }
725
+ }();
726
+ }
727
+ function ie(e, r) {
728
+ var n = Ae(e) ? String(r) : "", t = e[e.length - 1] === `
729
+ `, i = t && (e[e.length - 2] === `
730
+ ` || e === `
731
+ `), a = i ? "+" : t ? "" : "-";
732
+ return n + a + `
733
+ `;
734
+ }
735
+ function le(e) {
736
+ return e[e.length - 1] === `
737
+ ` ? e.slice(0, -1) : e;
738
+ }
739
+ function On(e, r) {
740
+ for (var n = /(\n+)([^\n]*)/g, t = function() {
741
+ var s = e.indexOf(`
742
+ `);
743
+ return s = s !== -1 ? s : e.length, n.lastIndex = s, ae(e.slice(0, s), r);
744
+ }(), i = e[0] === `
745
+ ` || e[0] === " ", a, l; l = n.exec(e); ) {
746
+ var u = l[1], o = l[2];
747
+ a = o[0] === " ", t += u + (!i && !a && o !== "" ? `
748
+ ` : "") + ae(o, r), i = a;
749
+ }
750
+ return t;
751
+ }
752
+ function ae(e, r) {
753
+ if (e === "" || e[0] === " ")
754
+ return e;
755
+ for (var n = / [^ ]/g, t, i = 0, a, l = 0, u = 0, o = ""; t = n.exec(e); )
756
+ u = t.index, u - i > r && (a = l > i ? l : u, o += `
757
+ ` + e.slice(i, a), i = a + 1), l = u;
758
+ return o += `
759
+ `, e.length - i > r && l > i ? o += e.slice(i, l) + `
760
+ ` + e.slice(l + 1) : o += e.slice(i), o.slice(1);
761
+ }
762
+ function Cn(e) {
763
+ for (var r = "", n = 0, t, i = 0; i < e.length; n >= 65536 ? i += 2 : i++)
764
+ n = N(e, i), t = x[n], !t && C(n) ? (r += e[i], n >= 65536 && (r += e[i + 1])) : r += t || wn(n);
765
+ return r;
766
+ }
767
+ function bn(e, r, n) {
768
+ var t = "", i = e.tag, a, l, u;
769
+ for (a = 0, l = n.length; a < l; a += 1)
770
+ u = n[a], e.replacer && (u = e.replacer.call(n, String(a), u)), (A(e, r, u, !1, !1) || typeof u > "u" && A(e, r, null, !1, !1)) && (t !== "" && (t += "," + (e.condenseFlow ? "" : " ")), t += e.dump);
771
+ e.tag = i, e.dump = "[" + t + "]";
772
+ }
773
+ function ue(e, r, n, t) {
774
+ var i = "", a = e.tag, l, u, o;
775
+ for (l = 0, u = n.length; l < u; l += 1)
776
+ o = n[l], e.replacer && (o = e.replacer.call(n, String(l), o)), (A(e, r + 1, o, !0, !0, !1, !0) || typeof o > "u" && A(e, r + 1, null, !0, !0, !1, !0)) && ((!t || i !== "") && (i += j(e, r)), e.dump && T === e.dump.charCodeAt(0) ? i += "-" : i += "- ", i += e.dump);
777
+ e.tag = a, e.dump = i || "[]";
778
+ }
779
+ function In(e, r, n) {
780
+ var t = "", i = e.tag, a = Object.keys(n), l, u, o, s, p;
781
+ for (l = 0, u = a.length; l < u; l += 1)
782
+ p = "", t !== "" && (p += ", "), e.condenseFlow && (p += '"'), o = a[l], s = n[o], e.replacer && (s = e.replacer.call(n, o, s)), A(e, r, o, !1, !1) && (e.dump.length > 1024 && (p += "? "), p += e.dump + (e.condenseFlow ? '"' : "") + ":" + (e.condenseFlow ? "" : " "), A(e, r, s, !1, !1) && (p += e.dump, t += p));
783
+ e.tag = i, e.dump = "{" + t + "}";
784
+ }
785
+ function Rn(e, r, n, t) {
786
+ var i = "", a = e.tag, l = Object.keys(n), u, o, s, p, f, c;
787
+ if (e.sortKeys === !0)
788
+ l.sort();
789
+ else if (typeof e.sortKeys == "function")
790
+ l.sort(e.sortKeys);
791
+ else if (e.sortKeys)
792
+ throw new g("sortKeys must be a boolean or a function");
793
+ for (u = 0, o = l.length; u < o; u += 1)
794
+ c = "", (!t || i !== "") && (c += j(e, r)), s = l[u], p = n[s], e.replacer && (p = e.replacer.call(n, s, p)), A(e, r + 1, s, !0, !0, !0) && (f = e.tag !== null && e.tag !== "?" || e.dump && e.dump.length > 1024, f && (e.dump && T === e.dump.charCodeAt(0) ? c += "?" : c += "? "), c += e.dump, f && (c += j(e, r)), A(e, r + 1, p, !0, f) && (e.dump && T === e.dump.charCodeAt(0) ? c += ":" : c += ": ", c += e.dump, i += c));
795
+ e.tag = a, e.dump = i || "{}";
796
+ }
797
+ function oe(e, r, n) {
798
+ var t, i, a, l, u, o;
799
+ for (i = n ? e.explicitTypes : e.implicitTypes, a = 0, l = i.length; a < l; a += 1)
800
+ if (u = i[a], (u.instanceOf || u.predicate) && (!u.instanceOf || typeof r == "object" && r instanceof u.instanceOf) && (!u.predicate || u.predicate(r))) {
801
+ if (n ? u.multi && u.representName ? e.tag = u.representName(r) : e.tag = u.tag : e.tag = "?", u.represent) {
802
+ if (o = e.styleMap[u.tag] || u.defaultStyle, me.call(u.represent) === "[object Function]")
803
+ t = u.represent(r, o);
804
+ else if (de.call(u.represent, o))
805
+ t = u.represent[o](r, o);
806
+ else
807
+ throw new g("!<" + u.tag + '> tag resolver accepts not "' + o + '" style');
808
+ e.dump = t;
809
+ }
810
+ return !0;
811
+ }
812
+ return !1;
813
+ }
814
+ function A(e, r, n, t, i, a, l) {
815
+ e.tag = null, e.dump = n, oe(e, n, !1) || oe(e, n, !0);
816
+ var u = me.call(e.dump), o = t, s;
817
+ t && (t = e.flowLevel < 0 || e.flowLevel > r);
818
+ var p = u === "[object Object]" || u === "[object Array]", f, c;
819
+ if (p && (f = e.duplicates.indexOf(n), c = f !== -1), (e.tag !== null && e.tag !== "?" || c || e.indent !== 2 && r > 0) && (i = !1), c && e.usedDuplicates[f])
820
+ e.dump = "*ref_" + f;
821
+ else {
822
+ if (p && c && !e.usedDuplicates[f] && (e.usedDuplicates[f] = !0), u === "[object Object]")
823
+ t && Object.keys(e.dump).length !== 0 ? (Rn(e, r, e.dump, i), c && (e.dump = "&ref_" + f + e.dump)) : (In(e, r, e.dump), c && (e.dump = "&ref_" + f + " " + e.dump));
824
+ else if (u === "[object Array]")
825
+ t && e.dump.length !== 0 ? (e.noArrayIndent && !l && r > 0 ? ue(e, r - 1, e.dump, i) : ue(e, r, e.dump, i), c && (e.dump = "&ref_" + f + e.dump)) : (bn(e, r, e.dump), c && (e.dump = "&ref_" + f + " " + e.dump));
826
+ else if (u === "[object String]")
827
+ e.tag !== "?" && Tn(e, e.dump, r, a, o);
828
+ else {
829
+ if (u === "[object Undefined]")
830
+ return !1;
831
+ if (e.skipInvalid)
832
+ return !1;
833
+ throw new g("unacceptable kind of an object to dump " + u);
834
+ }
835
+ e.tag !== null && e.tag !== "?" && (s = encodeURI(
836
+ e.tag[0] === "!" ? e.tag.slice(1) : e.tag
837
+ ).replace(/!/g, "%21"), e.tag[0] === "!" ? s = "!" + s : s.slice(0, 18) === "tag:yaml.org,2002:" ? s = "!!" + s.slice(18) : s = "!<" + s + ">", e.dump = s + " " + e.dump);
838
+ }
839
+ return !0;
840
+ }
841
+ function Ln(e, r) {
842
+ var n = [], t = [], i, a;
843
+ for (V(e, n, t), i = 0, a = t.length; i < a; i += 1)
844
+ r.duplicates.push(n[t[i]]);
845
+ r.usedDuplicates = new Array(a);
846
+ }
847
+ function V(e, r, n) {
848
+ var t, i, a;
849
+ if (e !== null && typeof e == "object")
850
+ if (i = r.indexOf(e), i !== -1)
851
+ n.indexOf(i) === -1 && n.push(i);
852
+ else if (r.push(e), Array.isArray(e))
853
+ for (i = 0, a = e.length; i < a; i += 1)
854
+ V(e[i], r, n);
855
+ else
856
+ for (t = Object.keys(e), i = 0, a = t.length; i < a; i += 1)
857
+ V(e[t[i]], r, n);
858
+ }
859
+ function Yn(e, r) {
860
+ r = r || {};
861
+ var n = new En(r);
862
+ n.noRefs || Ln(e, n);
863
+ var t = e;
864
+ return n.replacer && (t = n.replacer.call({ "": t }, "", t)), A(n, 0, t, !0, !0) ? n.dump + `
865
+ ` : "";
866
+ }
867
+ var Mn = Yn, Dn = {
868
+ dump: Mn
869
+ }, Un = Dn.dump;
870
+ const Bn = { class: "space-y-6 max-w-7xl mx-auto" }, Pn = { class: "flex items-center justify-between" }, Hn = { class: "flex items-center gap-4" }, jn = { class: "flex items-center gap-2" }, Kn = { class: "text-2xl font-semibold text-gray-900 dark:text-white" }, Vn = ["href", "title"], $n = { class: "flex items-center space-x-3" }, qn = {
871
+ key: 0,
872
+ class: "max-w-[1000px] flex flex-col"
873
+ }, Gn = { class: "flex ml-2 mb-6 w-min border border-gray-200 dark:border-gray-700 rounded-full overflow-hidden" }, et = /* @__PURE__ */ Se({
874
+ __name: "MenuItemPage",
875
+ setup(e) {
876
+ const r = Q(
877
+ () => import("./MenuBody-Bi0ONVZf.js")
878
+ ), n = Q(
879
+ () => import("./MonacoEditor-ByPT8pnv.js")
880
+ );
881
+ z["vs-input-monaco-editor"] = n, console.log("[MenuItemPage] vs-input-monaco-editor registered:", !!z["vs-input-monaco-editor"]);
882
+ const { t, locale: i } = Ye(), a = Ce(), l = be(), u = Ne(() => [
883
+ {
884
+ key: "name",
885
+ title: t("cms.menu.form.name"),
886
+ type: "text",
887
+ placeholder: t("cms.menu.form.name"),
888
+ required: !0,
889
+ validators: ["required"]
890
+ },
891
+ {
892
+ key: "description",
893
+ title: t("cms.menu.form.description"),
894
+ type: "text",
895
+ placeholder: t("cms.menu.form.description"),
896
+ required: !0,
897
+ validators: ["required"]
898
+ },
899
+ {
900
+ key: "locale",
901
+ title: t("cms.menu.form.language"),
902
+ type: "select",
903
+ placeholder: t("cms.menu.form.language"),
904
+ options: [
905
+ { text: "Ukrainian", id: "uk" },
906
+ { text: "English", id: "en" }
907
+ ],
908
+ required: !0,
909
+ validators: ["required"]
910
+ },
911
+ {
912
+ key: "content",
913
+ title: t("cms.menu.form.content"),
914
+ type: "monaco-editor",
915
+ height: "500px",
916
+ language: "yaml",
917
+ theme: "vs-light"
918
+ }
919
+ ]), o = I(null), s = I({}), p = I(!1), f = I(!1), c = (m) => {
920
+ const d = {};
921
+ for (const v of m) {
922
+ const { title: G, value: Fe, children: D } = v;
923
+ D && D.length > 0 ? d[G] = c(D) : d[G] = Fe;
924
+ }
925
+ return d;
926
+ }, b = async () => {
927
+ o.value;
928
+ let m = { ...o.value || {} };
929
+ if (await s.value.validate()) {
930
+ B({
931
+ type: "warning",
932
+ title: t("cms.common.actions.warning"),
933
+ message: t("cms.menu.createMenuFailed")
934
+ });
935
+ return;
936
+ }
937
+ f.value && Array.isArray(m.items) && (m.items = c(m.items), m.content = Un(m.items));
938
+ try {
939
+ const v = await fetch(`/api/cms-menu/${l.params.id}`, {
940
+ method: "PUT",
941
+ headers: {
942
+ "Content-Type": "application/json"
943
+ },
944
+ body: JSON.stringify(m)
945
+ });
946
+ if (!v.ok)
947
+ throw new Error(`Failed to update menu: ${v.status}`);
948
+ B({
949
+ title: t("cms.menu.menuUpdated"),
950
+ type: "success",
951
+ message: t("cms.menu.menuUpdated")
952
+ }), a.push("/menu");
953
+ } catch {
954
+ B({
955
+ title: t("cms.menu.menuUpdateError"),
956
+ type: "error",
957
+ message: t("cms.menu.menuUpdateError")
958
+ });
959
+ }
960
+ };
961
+ return ke(async () => {
962
+ try {
963
+ const d = await (await fetch(`/api/cms-menu/${l.params.id}`)).json();
964
+ o.value = d, p.value = !0;
965
+ } catch {
966
+ p.value = !1;
967
+ }
968
+ }), (m, d) => (R(), W("div", Bn, [
969
+ y("div", Pn, [
970
+ y("div", Hn, [
971
+ y("button", {
972
+ onClick: d[0] || (d[0] = (v) => w(a).back()),
973
+ class: "p-2 text-gray-500 rounded-full hover:text-gray-900 dark:text-gray-400 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"
974
+ }, [
975
+ U(w(Ie), { class: "w-5 h-5" })
976
+ ]),
977
+ y("div", jn, [
978
+ y("h1", Kn, L(m.$t("cms.menu.editMenu")), 1),
979
+ y("a", {
980
+ href: `https://cms.opengis.info/${w(i)}/guides/menu/`,
981
+ target: "_blank",
982
+ title: m.$t("cms.guide.menu")
983
+ }, [
984
+ U(w(Re), { class: "w-5 h-5" })
985
+ ], 8, Vn)
986
+ ])
987
+ ]),
988
+ y("div", $n, [
989
+ y("button", {
990
+ onClick: b,
991
+ class: "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium h-9 px-4 py-2 bg-blue-600 text-white shadow-md transition-all duration-200 transform hover:bg-blue-700 hover:shadow-lg hover:scale-105 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"
992
+ }, [
993
+ U(w(Le), { class: "w-4 h-4 mr-2" }),
994
+ Te(" " + L(m.$t("cms.common.actions.save")), 1)
995
+ ])
996
+ ])
997
+ ]),
998
+ p.value ? (R(), W("div", qn, [
999
+ y("div", Gn, [
1000
+ y("button", {
1001
+ onClick: d[1] || (d[1] = (v) => f.value = !1),
1002
+ class: Z([{ "bg-gray-200 text-gray-900 dark:bg-gray-700 dark:text-white": !f.value }, "text-gray-500 hover:text-gray-900 dark:hover:text-white hover:bg-gray-200 dark:hover:bg-gray-700 whitespace-nowrap px-5 py-2 w-[200px] text-sm font-medium"])
1003
+ }, L(m.$t("cms.menu.textEditor")), 3),
1004
+ y("button", {
1005
+ onClick: d[2] || (d[2] = (v) => f.value = !0),
1006
+ class: Z([{ "bg-gray-200 text-gray-900 dark:bg-gray-700 dark:text-white": f.value }, "text-gray-500 hover:text-gray-900 dark:hover:text-white hover:bg-gray-200 dark:hover:bg-gray-700 whitespace-nowrap px-5 py-2 w-[200px] text-sm font-medium"])
1007
+ }, L(m.$t("cms.menu.listTree")), 3)
1008
+ ]),
1009
+ f.value ? (R(), X(w(r), {
1010
+ key: 0,
1011
+ modelValue: o.value,
1012
+ "onUpdate:modelValue": d[3] || (d[3] = (v) => o.value = v)
1013
+ }, null, 8, ["modelValue"])) : (R(), X(w(Me), {
1014
+ key: 1,
1015
+ schema: u.value,
1016
+ modelValue: o.value,
1017
+ "onUpdate:modelValue": d[4] || (d[4] = (v) => o.value = v),
1018
+ form: s.value,
1019
+ "onUpdate:form": d[5] || (d[5] = (v) => s.value = v)
1020
+ }, null, 8, ["schema", "modelValue", "form"]))
1021
+ ])) : Oe("", !0)
1022
+ ]));
1023
+ }
1024
+ });
1025
+ export {
1026
+ et as default
1027
+ };