@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
@@ -1,2948 +0,0 @@
1
- import { openBlock as o, createElementBlock as n, createStaticVNode as z, createElementVNode as r, toDisplayString as i, createCommentVNode as j, useModel as Z, Fragment as L, renderList as P, unref as y, createBlock as F, resolveDynamicComponent as Ie, resolveComponent as me, mergeModels as W, ref as M, computed as R, watch as H, createVNode as k, withCtx as U, normalizeClass as Q, onMounted as de, onUpdated as at, withModifiers as J, createTextVNode as X, mergeProps as ot, Teleport as Me, normalizeStyle as nt, withDirectives as De, vModelText as Te, renderSlot as dt, normalizeProps as it, guardReactiveProps as ut, defineAsyncComponent as Le } from "vue";
2
- import { Edit as ct, Trash2 as ee, GripVertical as xe, File as vt, Folder as Ne, FileText as pt, ChevronRight as je, Download as ge, Loader2 as he, Plus as ye, Image as gt, Search as ht, ChevronDown as bt, LayoutGrid as yt, List as mt, Pencil as xt } from "lucide-vue-next";
3
- import { d as Ge } from "./vuedraggable-CoAPPFYd.js";
4
- import { VsDrawer as Qe, notify as ie, confirm as Ze, VsModal as Ue } from "@opengis/core";
5
- import { _ as te } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
- import { inputs as Ve, VForm as We, VsInputSelect as ft } from "@opengis/form";
7
- import { useI18n as Y } from "vue-i18n";
8
- import { useRoute as wt, useRouter as kt } from "vue-router";
9
- const Re = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASIAAACbCAIAAABJbgHoAAAGfklEQVR4Ae3d7W6baBSF0d7/7Q6IDxkzmrHEQU2DHZudWH1XflRHcXNqVnka4tL01+qNAIGwwK/wfusJEFjPyexyuUzTNAxD3/dd1/3z/1vXdX3fD8MwTdPlcoFNoFmBlzJblmWapr7vb10d/9j3/TRNy7I0a+3AmxV4MrPr9TqO43FXnz06juP1em1W3IE3KPBMZvM8b1eGn7V0/P6u6+Z5bpDbIbcp8OXMnv4k9jG8cRzbRHfUrQl8LbNhGD7W8sp7hmFoTdzxNijwhcxOb+zWp9IaPO1aO+RHMzvxWvHjZz9Xj62ddq0d70OZzfP8sY1z3+MVkdbOvKaO935m1+v1xdcVHwmy6zqv8jd15jV1sPczi14u7gt06djUmdfUwd7JbFmWfQnp2T0iTZ187RzsncymaUqntd8/TVM79I60HYE7mT14v+I+lVfmvu+P6W93UQ7eCLyxwMd7d48yu1wurzTz3Mce3Mu/LMs4jt3/b88t91EE0gK383Mcx/1XQEeZffMV4+34D64bb42lmewn8LpA13X7l/SOMgvd9nF8DAc3hXzzFezx8/QogWOB/VdAR5n9yGm9f3K/fZ32DX99dwznUQKPC3Rdt53AR5n9yGm9f3Lbs7wNjx+hn0ngHQS2E/gos596otuT+234qefj1yXwnMB2AsvsOUAfReC+wEOZuWi8D+lnEPhc4KHM3u0lkM8PxyME3lHgocze7QX9d4T0nAh8LvBQZu/219M/8tn1c0OPEDgS2P/V1NFLIO92s9U0TT/y5eKRpccI/Emg67r9/UxHma3r+s2fQPZ/AGyfcLfhlW8O+ScK7yOQEvjtm5Heyeybrxv3fwBsde2HZVnmeZ68EXhjgXme9/cNr+u976Hvn3XuIzcTeE7gzmezdV19k4LnZH0UgU3gfma+5c6GZSDwnMD9zNZ19Q3knsP1UQRuAg9llr503P8DOL8xBP4+gUczW9c1dFPIwb/j/Pu4HVGbAl/ILFGaxto87Vo76q9ldu7Vo2vF1s62Zo/3y5ndXhF58aYn/41gsydcmwf+TGbrur5y39Nv96G06e6omxJ4MrObkf/ivalzxcE+LfBSZtuverlcpmkahqHv++16suu6vu+HYZim6eCbnG5LDAT+VoFzMvtbdRwXgVMEZHYKoyUEjgRkdqTjMQKnCMjsFEZLCBwJyOxIx2METhGQ2SmMlhA4EpDZkY7HCJwiILNTGC0hcCTwX2a3/1/QjwQInCuwlSezc2FtI1ACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhASkFkI1loCJSCzsjARCAnILARrLYESkFlZmAiEBGQWgrWWQAnIrCxMBEICMgvBWkugBGRWFiYCIQGZhWCtJVACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhASkFkI1loCJSCzsjARCAnILARrLYESkFlZmAiEBGQWgrWWQAnIrCxMBEICMgvBWkugBGRWFiYCIQGZhWCtJVACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhASkFkI1loCJSCzsjARCAnILARrLYESkFlZmAiEBGQWgrWWQAnIrCxMBEICMgvBWkugBGRWFiYCIQGZhWCtJVACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhASkFkI1loCJSCzsjARCAnILARrLYESkFlZmAiEBGQWgrWWQAnIrCxMBEICMgvBWkugBGRWFiYCIQGZhWCtJVACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhASkFkI1loCJSCzsjARCAnILARrLYESkFlZmAiEBGQWgrWWQAnIrCxMBEICMgvBWkugBGRWFiYCIQGZhWCtJVACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhASkFkI1loCJSCzsjARCAnILARrLYESkFlZmAiEBGQWgrWWQAnIrCxMBEICMgvBWkugBGRWFiYCIQGZhWCtJVACMisLE4GQgMxCsNYSKAGZlYWJQEhAZiFYawmUgMzKwkQgJCCzEKy1BEpAZmVhIhAS2DL7F8r/OP7dtZNpAAAAAElFTkSuQmCC", Pe = {
10
- faq: {
11
- schema: {
12
- title: {
13
- type: "text",
14
- label: "Назва",
15
- placeholder: "Назва"
16
- },
17
- show_dots: {
18
- type: "switcher",
19
- label: "Показувати точки"
20
- },
21
- show_index: {
22
- type: "switcher",
23
- conditions: ["show_dots", "==", "true"],
24
- label: "Показувати нумерацію"
25
- },
26
- index_type: {
27
- type: "combobox",
28
- conditions: ["show_index", "==", "true"],
29
- label: "Тип нумерації",
30
- options: [
31
- { id: "decimal", text: "Десятковий" },
32
- { id: "upper-alpha", text: "Латинські великі букви" },
33
- { id: "lower-alpha", text: "Латинські маленькі букви" },
34
- { id: "upper-roman", text: "Римські великі цифри" },
35
- { id: "lower-roman", text: "Римські маленькі цифри" },
36
- { id: "upper-cyrillic", text: "Кириличні великі букви" },
37
- { id: "lower-cyrillic", text: "Кириличні маленькі букви" }
38
- ]
39
- },
40
- openfirst: {
41
- type: "switcher",
42
- label: "Відкрити перший елемент?"
43
- },
44
- collapse_mode: {
45
- type: "switcher",
46
- label: "Не згортати попередній елемент?"
47
- },
48
- data: {
49
- type: "DataTable",
50
- colModel: [
51
- {
52
- key: "title",
53
- ua: "Назва",
54
- type: "text",
55
- required: !0,
56
- validators: ["required"]
57
- },
58
- {
59
- key: "is_section",
60
- type: "Radio",
61
- label: "Заповнити секціями",
62
- options: [
63
- { id: "yes", text: "Так" },
64
- { id: "no", text: "Ні" }
65
- ],
66
- required: !0,
67
- validators: ["required"]
68
- },
69
- {
70
- key: "section",
71
- type: "reference",
72
- label: "Вкладений контент",
73
- placeholder: "Ваш контент",
74
- conditions: ["is_section", "==", "yes"],
75
- required: !0,
76
- validators: ["required"]
77
- },
78
- {
79
- key: "body",
80
- type: "tiptap-editor",
81
- label: "Тіло вкладки",
82
- placeholder: "Ваш контент",
83
- conditions: ["is_section", "==", "no"],
84
- required: !0,
85
- validators: ["required"]
86
- }
87
- ]
88
- }
89
- }
90
- },
91
- banner: {
92
- schema: {
93
- title: {
94
- type: "text",
95
- label: "Назва",
96
- placeholder: "Назва"
97
- },
98
- image: {
99
- type: "file",
100
- label: "Зображення",
101
- placeholder: "Зображення"
102
- }
103
- }
104
- },
105
- photoGrid: {
106
- schema: {
107
- columns: {
108
- type: "number",
109
- label: "Кількість колонок",
110
- placeholder: "Кількість колонок",
111
- default: 3
112
- },
113
- data: {
114
- type: "DataTable",
115
- colModel: [
116
- {
117
- key: "image",
118
- ua: "Зображення",
119
- type: "file"
120
- },
121
- {
122
- key: "caption",
123
- ua: "Заголовок",
124
- type: "text"
125
- }
126
- ]
127
- }
128
- }
129
- },
130
- slider: {
131
- schema: {
132
- autoplay: {
133
- type: "switcher",
134
- label: "Автоматичне гортання?",
135
- default: !0
136
- },
137
- autoplaySpeed: {
138
- type: "number",
139
- label: "Швидкість автоматичного гортання(мс)",
140
- placeholder: "Швидкість автоматичного гортання(мс)",
141
- default: 3e3
142
- },
143
- show_navigation: {
144
- type: "switcher",
145
- label: "Показувати кнопки навігації?"
146
- },
147
- data: {
148
- type: "DataTable",
149
- colModel: [
150
- {
151
- key: "title",
152
- ua: "Назва",
153
- type: "text"
154
- },
155
- {
156
- key: "link",
157
- ua: "Посилання",
158
- type: "text"
159
- },
160
- {
161
- key: "image",
162
- ua: "Зображення",
163
- type: "file"
164
- },
165
- {
166
- key: "image_width",
167
- ua: "Ширина зображення(px)",
168
- type: "number",
169
- placeholder: "Ширина зображення"
170
- },
171
- {
172
- key: "image_height",
173
- ua: "Висота зображення(px)",
174
- type: "number",
175
- placeholder: "Висота зображення"
176
- },
177
- {
178
- ua: "Розтягувати по ширині",
179
- key: "stretch",
180
- type: "switcher"
181
- },
182
- {
183
- key: "target_blank",
184
- ua: "Відкривати в новій вкладці?",
185
- type: "switcher"
186
- }
187
- ]
188
- }
189
- }
190
- },
191
- video: {
192
- schema: {
193
- file: {
194
- type: "file",
195
- max_size: 50,
196
- description: "Максимальний розмір файлу 50MB",
197
- label: "Завантажити відео",
198
- placeholder: "Завантажити відео"
199
- },
200
- hidden_gif: {
201
- type: "switcher",
202
- label: "Сховати GIF"
203
- },
204
- preview: {
205
- type: "file",
206
- label: "Прев'ю для відео"
207
- },
208
- link: {
209
- type: "text",
210
- label: "Посилання",
211
- placeholder: "Посилання"
212
- }
213
- }
214
- },
215
- about: {
216
- schema: {
217
- title: {
218
- type: "text",
219
- label: "Заголовок",
220
- placeholder: "Заголовок"
221
- },
222
- text: {
223
- type: "tiptap-editor",
224
- label: "Текст",
225
- placeholder: "Текст"
226
- },
227
- url: {
228
- type: "file",
229
- label: "Зображення / відео",
230
- placeholder: "Посилання"
231
- }
232
- }
233
- },
234
- cards: {
235
- schema: {
236
- title: {
237
- type: "text",
238
- label: "Заголовок",
239
- placeholder: "Заголовок"
240
- },
241
- data: {
242
- type: "DataTable",
243
- colModel: [
244
- {
245
- key: "title",
246
- ua: "Назва",
247
- type: "text"
248
- },
249
- {
250
- key: "img",
251
- ua: "Зображення",
252
- type: "file"
253
- },
254
- {
255
- key: "link",
256
- ua: "Посилання",
257
- type: "text"
258
- },
259
- {
260
- key: "description",
261
- ua: "Опис",
262
- type: "text"
263
- }
264
- ]
265
- }
266
- }
267
- },
268
- usefulLinks: {
269
- schema: {
270
- title: {
271
- type: "text",
272
- label: "Заголовок",
273
- placeholder: "Заголовок"
274
- },
275
- data: {
276
- type: "DataTable",
277
- colModel: [
278
- {
279
- key: "text",
280
- ua: "Назва",
281
- type: "text"
282
- },
283
- {
284
- key: "url",
285
- ua: "Посилання",
286
- type: "text"
287
- },
288
- {
289
- key: "target_blank",
290
- ua: "Відкривати в новій вкладці?",
291
- type: "switcher"
292
- }
293
- ]
294
- }
295
- }
296
- },
297
- team: {
298
- schema: {
299
- data: {
300
- type: "DataTable",
301
- colModel: [
302
- {
303
- key: "avatar",
304
- ua: "Аватар",
305
- type: "file"
306
- },
307
- {
308
- key: "title",
309
- ua: "Ім'я/ПІБ",
310
- type: "text"
311
- },
312
- {
313
- key: "description",
314
- ua: "Опис",
315
- type: "textarea",
316
- optional: !0
317
- },
318
- {
319
- key: "position",
320
- ua: "Посада",
321
- type: "text",
322
- tooltip: !0
323
- },
324
- {
325
- key: "email",
326
- ua: "Email",
327
- type: "text",
328
- optional: !0
329
- },
330
- {
331
- key: "tel",
332
- ua: "Телефон",
333
- type: "text",
334
- optional: !0
335
- },
336
- {
337
- key: "schedule",
338
- ua: "Графік прийому",
339
- type: "text",
340
- optional: !0
341
- },
342
- {
343
- key: "isinfo",
344
- type: "switcher",
345
- label: "Відображати кнопку 'Детальніше'"
346
- },
347
- {
348
- key: "slug",
349
- ua: "Slug",
350
- type: "text",
351
- label: "Унікальний ідентифікатор"
352
- }
353
- ]
354
- }
355
- }
356
- },
357
- body: {
358
- schema: {
359
- background_color: {
360
- type: "switcher",
361
- label: "Додати білий фон?"
362
- },
363
- content: {
364
- type: "tiptap-editor",
365
- label: "Текст",
366
- placeholder: "Текст"
367
- }
368
- }
369
- },
370
- news: {
371
- schema: {
372
- title: {
373
- type: "text",
374
- label: "Заголовок",
375
- placeholder: "Заголовок"
376
- },
377
- buttonText: {
378
- type: "text",
379
- label: "Текст кнопки",
380
- placeholder: "Текст кнопки"
381
- },
382
- buttonLink: {
383
- type: "text",
384
- label: "Посилання кнопки",
385
- placeholder: "Посилання кнопки"
386
- },
387
- tag: {
388
- type: "select",
389
- label: "Тег",
390
- placeholder: "Тег",
391
- data: "tag_id"
392
- },
393
- news_list: {
394
- type: "select",
395
- label: "Список новин",
396
- multiple: !0,
397
- placeholder: "Список новин",
398
- parent: "tag",
399
- data: "news_tag_id"
400
- }
401
- }
402
- },
403
- form: {
404
- schema: {
405
- title: {
406
- type: "text",
407
- label: "Заголовок",
408
- placeholder: "Заголовок"
409
- },
410
- formUrl: {
411
- type: "text",
412
- label: "Посилання для відправки форми",
413
- placeholder: "Посилання"
414
- },
415
- schema: {
416
- label: "Схема форми",
417
- type: "DataTable",
418
- colModel: [
419
- {
420
- key: "name",
421
- ua: "Name",
422
- type: "text",
423
- placeholder: "Name"
424
- },
425
- {
426
- key: "label",
427
- ua: "Title",
428
- type: "text",
429
- placeholder: "Title"
430
- },
431
- {
432
- key: "type",
433
- ua: "Type",
434
- type: "combobox",
435
- options: [
436
- {
437
- text: "Text",
438
- id: "text"
439
- },
440
- {
441
- text: "Textarea",
442
- id: "textarea"
443
- },
444
- {
445
- text: "switcher",
446
- id: "switcher"
447
- },
448
- {
449
- text: "Email",
450
- id: "email"
451
- },
452
- {
453
- text: "Mask",
454
- id: "mask"
455
- },
456
- {
457
- text: "Number",
458
- id: "number"
459
- },
460
- {
461
- text: "Date",
462
- id: "date"
463
- },
464
- {
465
- text: "Datetime",
466
- id: "datetime"
467
- }
468
- ]
469
- },
470
- {
471
- key: "mask",
472
- ua: "Маска",
473
- type: "text",
474
- conditions: ["type", "==", "mask"],
475
- placeholder: "Маска"
476
- },
477
- {
478
- key: "placeholder",
479
- ua: "Плейсхолдер",
480
- type: "text",
481
- placeholder: "Placeholder"
482
- },
483
- {
484
- key: "required",
485
- ua: "Required",
486
- type: "switcher"
487
- }
488
- ]
489
- }
490
- }
491
- },
492
- tabs: {
493
- schema: {
494
- title: {
495
- type: "text",
496
- label: "Заголовок",
497
- placeholder: "Заголовок"
498
- },
499
- description: {
500
- type: "textarea",
501
- label: "Опис",
502
- placeholder: "Опис"
503
- },
504
- history_mode: {
505
- type: "switcher",
506
- label: "Використовувати історію сторінки?"
507
- },
508
- data: {
509
- type: "DataTable",
510
- colModel: [
511
- {
512
- key: "slug",
513
- type: "slug",
514
- label: "Slug",
515
- parent: "title",
516
- placeholder: "Slug"
517
- },
518
- {
519
- key: "title",
520
- ua: "Назва",
521
- type: "text",
522
- required: !0,
523
- validators: ["required"]
524
- },
525
- {
526
- key: "is_section",
527
- type: "Radio",
528
- label: "Заповнити секціями",
529
- options: [
530
- { id: "yes", text: "Так" },
531
- { id: "no", text: "Ні" }
532
- ],
533
- required: !0,
534
- validators: ["required"]
535
- },
536
- {
537
- key: "section",
538
- type: "reference",
539
- label: "Тіло вкладки",
540
- placeholder: "Ваш контент",
541
- conditions: ["is_section", "==", "yes"],
542
- required: !0,
543
- validators: ["required"]
544
- },
545
- {
546
- key: "body",
547
- type: "tiptap-editor",
548
- label: "Тіло вкладки",
549
- placeholder: "Ваш контент",
550
- conditions: ["is_section", "==", "no"],
551
- required: !0,
552
- validators: ["required"]
553
- }
554
- ]
555
- }
556
- }
557
- },
558
- vertical_tabs: {
559
- schema: {
560
- title: {
561
- type: "text",
562
- label: "Заголовок",
563
- placeholder: "Заголовок"
564
- },
565
- history_mode: {
566
- type: "switcher",
567
- label: "Використовувати історію сторінки?"
568
- },
569
- data: {
570
- type: "DataTable",
571
- colModel: [
572
- {
573
- key: "slug",
574
- type: "slug",
575
- label: "Slug",
576
- parent: "title",
577
- placeholder: "Slug"
578
- },
579
- {
580
- key: "title",
581
- ua: "Назва",
582
- type: "text",
583
- required: !0,
584
- validators: ["required"]
585
- },
586
- {
587
- key: "is_section",
588
- type: "Radio",
589
- label: "Заповнити секціями",
590
- options: [
591
- { id: "yes", text: "Так" },
592
- { id: "no", text: "Ні" },
593
- { id: "slug", text: "Привязати сторінку" }
594
- ],
595
- required: !0,
596
- validators: ["required"]
597
- },
598
- {
599
- key: "slug",
600
- type: "text",
601
- label: "Slug",
602
- placeholder: "Slug",
603
- conditions: ["is_section", "==", "slug"]
604
- },
605
- {
606
- key: "section",
607
- type: "reference",
608
- label: "Тіло вкладки",
609
- placeholder: "Ваш контент",
610
- conditions: ["is_section", "==", "yes"],
611
- required: !0,
612
- validators: ["required"]
613
- },
614
- {
615
- key: "body",
616
- type: "tiptap-editor",
617
- label: "Тіло вкладки",
618
- placeholder: "Ваш контент",
619
- conditions: ["is_section", "==", "no"],
620
- required: !0,
621
- validators: ["required"]
622
- }
623
- ]
624
- }
625
- }
626
- },
627
- documents: {
628
- schema: {
629
- title: {
630
- type: "text",
631
- label: "Заголовок",
632
- placeholder: "Заголовок"
633
- },
634
- icon: {
635
- type: "file",
636
- label: "Завантажити іконку",
637
- placeholder: "Завантажити іконку"
638
- },
639
- show_icon: {
640
- type: "switcher",
641
- label: "Показувати іконку?"
642
- },
643
- documents: {
644
- type: "DataTable",
645
- colModel: [
646
- {
647
- key: "title",
648
- ua: "Назва",
649
- type: "text"
650
- },
651
- {
652
- key: "file",
653
- info: "Прев'ю доступно тільки для документів у форматі pdf, html, txt. Інші формати одразу завантажуються.",
654
- ua: "Файл",
655
- type: "file"
656
- }
657
- ]
658
- }
659
- }
660
- },
661
- infoLine: {
662
- schema: {
663
- divider: {
664
- type: "file",
665
- label: "Завантажити розподілювач"
666
- },
667
- speed: {
668
- type: "number",
669
- label: "Швидкість автоматичного гортання(с)",
670
- placeholder: "Швидкість автоматичного гортання(с)",
671
- default: 20
672
- },
673
- data: {
674
- type: "DataTable",
675
- colModel: [
676
- {
677
- key: "title",
678
- ua: "Текст",
679
- type: "text"
680
- }
681
- ]
682
- }
683
- }
684
- },
685
- interested: {
686
- schema: {
687
- title: {
688
- type: "text",
689
- label: "Заголовок",
690
- placeholder: "Заголовок"
691
- },
692
- data: {
693
- type: "DataTable",
694
- colModel: [
695
- {
696
- key: "title",
697
- ua: "Заголовок",
698
- type: "text"
699
- },
700
- {
701
- key: "link",
702
- ua: "Посилання",
703
- type: "text"
704
- },
705
- {
706
- key: "target_blank",
707
- ua: "Відкривати в новій вкладці?",
708
- type: "switcher"
709
- },
710
- {
711
- key: "color",
712
- ua: "Колір фону",
713
- type: "color"
714
- }
715
- ]
716
- }
717
- }
718
- },
719
- contact: {
720
- schema: {
721
- title: {
722
- type: "text",
723
- label: "Заголовок",
724
- placeholder: "Заголовок"
725
- },
726
- data: {
727
- type: "DataTable",
728
- colModel: [
729
- {
730
- key: "type",
731
- ua: "Тип",
732
- type: "combobox",
733
- options: [
734
- { id: "email", text: "Email" },
735
- { id: "tel", text: "Телефон" },
736
- { id: "address", text: "Адреса" }
737
- ]
738
- },
739
- {
740
- key: "title",
741
- ua: "Пошта",
742
- type: "text",
743
- conditions: ["type", "==", "email"]
744
- },
745
- {
746
- key: "title",
747
- ua: "Телефон",
748
- type: "text",
749
- conditions: ["type", "==", "tel"]
750
- },
751
- {
752
- key: "title",
753
- ua: "Адреса",
754
- type: "text",
755
- conditions: ["type", "==", "address"]
756
- },
757
- {
758
- key: "description",
759
- ua: "Опис",
760
- type: "text"
761
- }
762
- ]
763
- }
764
- }
765
- },
766
- iframe: {
767
- schema: {
768
- link: {
769
- type: "text",
770
- label: "Посилання",
771
- placeholder: "Посилання"
772
- },
773
- file: {
774
- type: "file",
775
- label: "Завантажити файл",
776
- placeholder: "Завантажити файл"
777
- },
778
- height: {
779
- type: "text",
780
- label: "Висота iframe(px)",
781
- placeholder: "Висота iframe(px)"
782
- }
783
- }
784
- }
785
- }, oe = [
786
- {
787
- text: "reference.faq",
788
- id: "faq"
789
- },
790
- {
791
- text: "reference.banner",
792
- id: "banner"
793
- },
794
- {
795
- text: "reference.slider",
796
- id: "slider"
797
- },
798
- {
799
- text: "reference.photoGrid",
800
- id: "photoGrid"
801
- },
802
- {
803
- text: "reference.video",
804
- id: "video"
805
- },
806
- {
807
- text: "reference.about",
808
- id: "about"
809
- },
810
- {
811
- text: "reference.cards",
812
- id: "cards"
813
- },
814
- {
815
- text: "reference.usefulLinks",
816
- id: "usefulLinks"
817
- },
818
- {
819
- text: "reference.team",
820
- id: "team"
821
- },
822
- {
823
- text: "reference.body",
824
- id: "body"
825
- },
826
- {
827
- text: "reference.news",
828
- id: "news"
829
- },
830
- {
831
- text: "reference.form",
832
- id: "form"
833
- },
834
- {
835
- text: "reference.tabs",
836
- id: "tabs"
837
- },
838
- {
839
- text: "reference.vertical_tabs",
840
- id: "vertical_tabs"
841
- },
842
- {
843
- text: "reference.documents",
844
- id: "documents"
845
- },
846
- {
847
- text: "reference.infoLine",
848
- id: "infoLine"
849
- },
850
- {
851
- text: "reference.interested",
852
- id: "interested"
853
- },
854
- {
855
- text: "reference.contact",
856
- id: "contact"
857
- },
858
- {
859
- text: "reference.iframe",
860
- id: "iframe"
861
- }
862
- ], _t = { class: "h-full w-full flex flex-col" }, $t = { class: "flex justify-between items-center mt-2 pt-2 border-t border-gray-300" }, Ct = { class: "text-xs font-medium text-gray-600" }, At = {
863
- key: 0,
864
- class: "text-xs text-gray-500"
865
- }, Fe = {
866
- __name: "cards-skeleton",
867
- props: {
868
- text: {
869
- type: String,
870
- required: !0
871
- },
872
- count: {
873
- type: Number,
874
- required: !0
875
- }
876
- },
877
- setup(e) {
878
- return (l, s) => (o(), n("div", _t, [
879
- s[0] || (s[0] = z('<div class="flex-1 grid grid-cols-3 gap-1.5"><div class="bg-gray-200 rounded p-1.5 flex flex-col"><div class="flex-1 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded"></div></div><div class="bg-gray-200 rounded p-1.5 flex flex-col"><div class="flex-1 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded"></div></div><div class="bg-gray-200 rounded p-1.5 flex flex-col"><div class="flex-1 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded"></div></div><div class="bg-gray-200 rounded p-1.5 flex flex-col"><div class="flex-1 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded"></div></div><div class="bg-gray-200 rounded p-1.5 flex flex-col"><div class="flex-1 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded"></div></div><div class="bg-gray-200 rounded p-1.5 flex flex-col"><div class="flex-1 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded"></div></div></div>', 1)),
880
- r("div", $t, [
881
- r("div", Ct, i(l.$t(e.text)), 1),
882
- e.count && e.count > 0 ? (o(), n("div", At, i(e.count), 1)) : j("", !0)
883
- ])
884
- ]));
885
- }
886
- }, Mt = { class: "h-full w-full flex flex-col" }, jt = { class: "flex justify-between items-center mt-2 pt-2 border-t border-gray-300" }, Vt = { class: "text-xs font-medium text-gray-600" }, Ft = {
887
- key: 0,
888
- class: "text-xs text-gray-500"
889
- }, Bt = {
890
- __name: "faq-skeleton",
891
- props: {
892
- text: {
893
- type: String,
894
- required: !0
895
- },
896
- count: {
897
- type: Number,
898
- required: !0
899
- }
900
- },
901
- setup(e) {
902
- return (l, s) => (o(), n("div", Mt, [
903
- s[0] || (s[0] = z('<div class="h-3 bg-gray-500 rounded mb-2"></div><div class="space-y-1.5 flex-1"><div class="border border-gray-300 rounded p-1"><div class="flex items-center justify-between"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-down w-2.5 h-2.5 text-gray-400"><path d="m6 9 6 6 6-6"></path></svg></div></div><div class="border border-gray-300 rounded p-1"><div class="flex items-center justify-between"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-down w-2.5 h-2.5 text-gray-400"><path d="m6 9 6 6 6-6"></path></svg></div><div class="mt-1 pt-1 border-t border-gray-200"><div class="space-y-0.5"><div class="h-1 bg-gray-200 rounded"></div><div class="h-1 bg-gray-200 rounded w-5/6"></div><div class="h-1 bg-gray-200 rounded w-4/5"></div></div></div></div><div class="border border-gray-300 rounded p-1"><div class="flex items-center justify-between"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-down w-2.5 h-2.5 text-gray-400"><path d="m6 9 6 6 6-6"></path></svg></div></div><div class="border border-gray-300 rounded p-1"><div class="flex items-center justify-between"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-down w-2.5 h-2.5 text-gray-400"><path d="m6 9 6 6 6-6"></path></svg></div></div></div>', 2)),
904
- r("div", jt, [
905
- r("div", Vt, i(l.$t(e.text)), 1),
906
- e.count && e.count > 0 ? (o(), n("div", Ft, i(e.count), 1)) : j("", !0)
907
- ])
908
- ]));
909
- }
910
- }, St = { class: "h-full w-full flex flex-col" }, qt = { class: "flex justify-between items-center mt-2 pt-2 border-t border-gray-300" }, zt = { class: "text-xs font-medium text-gray-600" }, Et = {
911
- key: 0,
912
- class: "text-xs text-gray-500"
913
- }, Be = {
914
- __name: "banner-skeleton",
915
- props: {
916
- text: {
917
- type: String,
918
- required: !0
919
- },
920
- count: {
921
- type: Number,
922
- required: !0
923
- }
924
- },
925
- setup(e) {
926
- return (l, s) => (o(), n("div", St, [
927
- s[0] || (s[0] = z('<div class="flex-1 bg-gray-200 rounded relative"><div class="absolute inset-0 flex items-center justify-center"><div class="w-16 h-10 bg-gray-300 rounded"></div></div><div class="absolute bottom-2 left-2"><div class="h-3 bg-gray-400 rounded w-16"></div></div></div>', 1)),
928
- r("div", qt, [
929
- r("div", zt, i(l.$t(e.text)), 1),
930
- e.count && e.count > 0 ? (o(), n("div", Et, i(e.count), 1)) : j("", !0)
931
- ])
932
- ]));
933
- }
934
- }, It = { class: "h-full w-full flex flex-col" }, Dt = { class: "flex justify-between items-center mt-2 pt-2 border-t border-gray-300" }, Tt = { class: "text-xs font-medium text-gray-600" }, Lt = {
935
- key: 0,
936
- class: "text-xs text-gray-500"
937
- }, Nt = {
938
- __name: "form-skeleton",
939
- props: {
940
- text: {
941
- type: String,
942
- required: !0
943
- },
944
- count: {
945
- type: Number,
946
- required: !0
947
- }
948
- },
949
- setup(e) {
950
- return (l, s) => (o(), n("div", It, [
951
- s[0] || (s[0] = z('<div class="h-3 bg-gray-500 rounded mb-2"></div><div class="space-y-1.5 flex-1"><div><div class="h-1.5 bg-gray-300 rounded mb-1 w-1/4"></div><div class="h-5 bg-gray-200 rounded border border-gray-300"></div></div><div><div class="h-1.5 bg-gray-300 rounded mb-1 w-1/3"></div><div class="h-5 bg-gray-200 rounded border border-gray-300"></div></div><div><div class="h-1.5 bg-gray-300 rounded mb-1 w-1/4"></div><div class="h-5 bg-gray-200 rounded border border-gray-300"></div></div><div><div class="h-1.5 bg-gray-300 rounded mb-1 w-1/3"></div><div class="h-8 bg-gray-200 rounded border border-gray-300"></div></div></div><div class="h-6 bg-gray-600 rounded mt-2"></div>', 3)),
952
- r("div", Dt, [
953
- r("div", Tt, i(l.$t(e.text)), 1),
954
- e.count && e.count > 0 ? (o(), n("div", Lt, i(e.count), 1)) : j("", !0)
955
- ])
956
- ]));
957
- }
958
- }, Gt = { class: "h-full w-full flex flex-col" }, Qt = { class: "flex justify-between items-center mt-2 pt-2 border-t border-gray-300" }, Zt = { class: "text-xs font-medium text-gray-600" }, Ut = {
959
- key: 0,
960
- class: "text-xs text-gray-500"
961
- }, Se = {
962
- __name: "news-skeleton",
963
- props: {
964
- text: {
965
- type: String,
966
- required: !0
967
- },
968
- count: {
969
- type: Number,
970
- required: !0
971
- }
972
- },
973
- setup(e) {
974
- return (l, s) => (o(), n("div", Gt, [
975
- s[0] || (s[0] = z('<div class="h-4 bg-gray-400 rounded mb-2"></div><div class="flex gap-2 flex-1"><div class="flex-1 space-y-2"><div class="bg-gray-200 rounded p-1.5"><div class="h-8 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded mb-1"></div><div class="h-1 bg-gray-300 rounded w-3/4"></div></div><div class="bg-gray-200 rounded p-1.5"><div class="h-8 bg-gray-300 rounded mb-1"></div><div class="h-1.5 bg-gray-400 rounded mb-1"></div><div class="h-1 bg-gray-300 rounded w-3/4"></div></div></div><div class="w-20 space-y-1"><div class="border-b border-gray-300 pb-1"><div class="h-1 bg-gray-300 rounded mb-1"></div><div class="h-1 bg-gray-300 rounded w-4/5"></div></div><div class="border-b border-gray-300 pb-1"><div class="h-1 bg-gray-300 rounded mb-1"></div><div class="h-1 bg-gray-300 rounded w-4/5"></div></div><div class="border-b border-gray-300 pb-1"><div class="h-1 bg-gray-300 rounded mb-1"></div><div class="h-1 bg-gray-300 rounded w-4/5"></div></div><div class="border-b border-gray-300 pb-1"><div class="h-1 bg-gray-300 rounded mb-1"></div><div class="h-1 bg-gray-300 rounded w-4/5"></div></div></div></div>', 2)),
976
- r("div", Qt, [
977
- r("div", Zt, i(l.$t(e.text)), 1),
978
- e.count && e.count > 0 ? (o(), n("div", Ut, i(e.count), 1)) : j("", !0)
979
- ])
980
- ]));
981
- }
982
- }, Wt = { class: "h-full w-full flex flex-col" }, Rt = { class: "flex justify-between items-center mt-2 pt-2 border-t border-gray-300" }, Pt = { class: "text-xs font-medium text-gray-600" }, Ht = {
983
- key: 0,
984
- class: "text-xs text-gray-500"
985
- }, Ot = {
986
- __name: "team-skeleton",
987
- props: {
988
- text: {
989
- type: String,
990
- required: !0
991
- },
992
- count: {
993
- type: Number,
994
- required: !0
995
- }
996
- },
997
- setup(e) {
998
- return (l, s) => (o(), n("div", Wt, [
999
- s[0] || (s[0] = z('<div class="space-y-2 flex-1"><div class="flex items-start gap-2"><div class="w-8 h-8 bg-gray-300 rounded flex-shrink-0"></div><div class="flex-1 min-w-0"><div class="h-2 bg-gray-400 rounded mb-1 w-2/3"></div><div class="h-1.5 bg-gray-300 rounded mb-1"></div><div class="flex gap-1"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-phone w-2.5 h-2.5 text-gray-400"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-mail w-2.5 h-2.5 text-gray-400"><rect width="20" height="16" x="2" y="4" rx="2"></rect><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-clock w-2.5 h-2.5 text-gray-400"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg></div></div></div><div class="flex items-start gap-2"><div class="w-8 h-8 bg-gray-300 rounded flex-shrink-0"></div><div class="flex-1 min-w-0"><div class="h-2 bg-gray-400 rounded mb-1 w-2/3"></div><div class="h-1.5 bg-gray-300 rounded mb-1"></div><div class="flex gap-1"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-phone w-2.5 h-2.5 text-gray-400"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-mail w-2.5 h-2.5 text-gray-400"><rect width="20" height="16" x="2" y="4" rx="2"></rect><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-clock w-2.5 h-2.5 text-gray-400"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg></div></div></div><div class="flex items-start gap-2"><div class="w-8 h-8 bg-gray-300 rounded flex-shrink-0"></div><div class="flex-1 min-w-0"><div class="h-2 bg-gray-400 rounded mb-1 w-2/3"></div><div class="h-1.5 bg-gray-300 rounded mb-1"></div><div class="flex gap-1"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-phone w-2.5 h-2.5 text-gray-400"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-mail w-2.5 h-2.5 text-gray-400"><rect width="20" height="16" x="2" y="4" rx="2"></rect><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-clock w-2.5 h-2.5 text-gray-400"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg></div></div></div><div class="flex items-start gap-2"><div class="w-8 h-8 bg-gray-300 rounded flex-shrink-0"></div><div class="flex-1 min-w-0"><div class="h-2 bg-gray-400 rounded mb-1 w-2/3"></div><div class="h-1.5 bg-gray-300 rounded mb-1"></div><div class="flex gap-1"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-phone w-2.5 h-2.5 text-gray-400"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-mail w-2.5 h-2.5 text-gray-400"><rect width="20" height="16" x="2" y="4" rx="2"></rect><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-clock w-2.5 h-2.5 text-gray-400"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg></div></div></div></div>', 1)),
1000
- r("div", Rt, [
1001
- r("div", Pt, i(l.$t(e.text)), 1),
1002
- e.count && e.count > 0 ? (o(), n("div", Ht, i(e.count), 1)) : j("", !0)
1003
- ])
1004
- ]));
1005
- }
1006
- }, Yt = { class: "h-full w-full flex flex-col" }, Kt = { class: "flex justify-between items-center mt-2 pt-2 border-t border-gray-300" }, Jt = { class: "text-xs font-medium text-gray-600" }, Xt = {
1007
- key: 0,
1008
- class: "text-xs text-gray-500"
1009
- }, qe = {
1010
- __name: "usefulLinks-skeleton",
1011
- props: {
1012
- text: {
1013
- type: String,
1014
- required: !0
1015
- },
1016
- count: {
1017
- type: Number,
1018
- required: !0
1019
- }
1020
- },
1021
- setup(e) {
1022
- return (l, s) => (o(), n("div", Yt, [
1023
- s[0] || (s[0] = z('<div class="h-4 bg-gray-400 rounded mb-3"></div><div class="grid grid-cols-2 gap-2 flex-1"><div class="space-y-2"><div class="flex items-center justify-between p-1.5 border border-gray-300 rounded"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><div class="w-2 h-2 bg-gray-400 rounded-full"></div></div><div class="flex items-center justify-between p-1.5 border border-gray-300 rounded"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><div class="w-2 h-2 bg-gray-400 rounded-full"></div></div><div class="flex items-center justify-between p-1.5 border border-gray-300 rounded"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><div class="w-2 h-2 bg-gray-400 rounded-full"></div></div></div><div class="space-y-2"><div class="flex items-center justify-between p-1.5 border border-gray-300 rounded"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><div class="w-2 h-2 bg-gray-400 rounded-full"></div></div><div class="flex items-center justify-between p-1.5 border border-gray-300 rounded"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><div class="w-2 h-2 bg-gray-400 rounded-full"></div></div><div class="flex items-center justify-between p-1.5 border border-gray-300 rounded"><div class="h-1.5 bg-gray-300 rounded flex-1 mr-2"></div><div class="w-2 h-2 bg-gray-400 rounded-full"></div></div></div></div>', 2)),
1024
- r("div", Kt, [
1025
- r("div", Jt, i(l.$t(e.text)), 1),
1026
- e.count && e.count > 0 ? (o(), n("div", Xt, i(e.count), 1)) : j("", !0)
1027
- ])
1028
- ]));
1029
- }
1030
- }, er = { class: "h-full w-full flex flex-col" }, tr = { class: "flex justify-between items-center mt-2 pt-2 border-t border-gray-300" }, rr = { class: "text-xs font-medium text-gray-600" }, lr = {
1031
- key: 0,
1032
- class: "text-xs text-gray-500"
1033
- }, sr = {
1034
- __name: "video-skeleton",
1035
- props: {
1036
- text: {
1037
- type: String,
1038
- required: !0
1039
- },
1040
- count: {
1041
- type: Number,
1042
- required: !0
1043
- }
1044
- },
1045
- setup(e) {
1046
- return (l, s) => (o(), n("div", er, [
1047
- s[0] || (s[0] = z('<div class="flex-1 bg-gray-200 rounded relative"><div class="absolute inset-0 flex items-center justify-center"><div class="w-10 h-10 bg-gray-400 rounded-full flex items-center justify-center"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-play w-5 h-5 text-white ml-0.5"><polygon points="6 3 20 12 6 21 6 3"></polygon></svg></div></div><div class="absolute bottom-1.5 left-1.5 right-1.5"><div class="h-2 bg-gray-400 rounded mb-1"></div><div class="h-2 bg-gray-400 rounded w-3/4"></div></div></div><div class="mt-2 flex items-center gap-2"><div class="w-5 h-5 bg-gray-300 rounded"></div><div class="h-2 bg-gray-300 rounded flex-1"></div></div>', 2)),
1048
- r("div", tr, [
1049
- r("div", rr, i(l.$t(e.text)), 1),
1050
- e.count && e.count > 0 ? (o(), n("div", lr, i(e.count), 1)) : j("", !0)
1051
- ])
1052
- ]));
1053
- }
1054
- }, ar = { class: "h-full w-full flex flex-col" }, or = { class: "flex justify-between items-center mt-2 pt-2 border-t border-gray-300" }, nr = { class: "text-xs font-medium text-gray-600" }, dr = {
1055
- key: 0,
1056
- class: "text-xs text-gray-500"
1057
- }, ir = {
1058
- __name: "about-skeleton",
1059
- props: {
1060
- text: {
1061
- type: String,
1062
- required: !0
1063
- },
1064
- count: {
1065
- type: Number,
1066
- required: !0
1067
- }
1068
- },
1069
- setup(e) {
1070
- return (l, s) => (o(), n("div", ar, [
1071
- s[0] || (s[0] = z('<div class="flex flex-1"><div class="flex-1 pr-2"><div class="h-4 bg-gray-400 rounded mb-2"></div><div class="space-y-1.5"><div class="h-2 bg-gray-300 rounded"></div><div class="h-2 bg-gray-300 rounded"></div><div class="h-2 bg-gray-300 rounded w-4/5"></div><div class="h-2 bg-gray-300 rounded"></div><div class="h-2 bg-gray-300 rounded w-3/4"></div><div class="h-2 bg-gray-300 rounded"></div></div></div><div class="w-16 h-20 bg-gray-200 rounded flex items-center justify-center"><div class="w-6 h-6 bg-gray-300 rounded-full"></div></div></div>', 1)),
1072
- r("div", or, [
1073
- r("div", nr, i(l.$t(e.text)), 1),
1074
- e.count && e.count > 0 ? (o(), n("div", dr, i(e.count), 1)) : j("", !0)
1075
- ])
1076
- ]));
1077
- }
1078
- }, ur = { class: "h-full w-full flex flex-col" }, cr = { class: "flex justify-between items-center mt-2 pt-2 border-t border-gray-300" }, vr = { class: "text-xs font-medium text-gray-600" }, pr = {
1079
- key: 0,
1080
- class: "text-xs text-gray-500"
1081
- }, gr = {
1082
- __name: "slider-skeleton",
1083
- props: {
1084
- text: {
1085
- type: String,
1086
- required: !0
1087
- },
1088
- count: {
1089
- type: Number,
1090
- required: !0
1091
- }
1092
- },
1093
- setup(e) {
1094
- return (l, s) => (o(), n("div", ur, [
1095
- s[0] || (s[0] = z('<div class="flex-1 bg-gray-200 rounded mb-2 relative"><div class="absolute inset-0 flex items-center justify-center"><div class="w-12 h-8 bg-gray-300 rounded"></div></div><div class="absolute left-1 top-1/2 transform -translate-y-1/2"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-left w-4 h-4 text-gray-400"><path d="m15 18-6-6 6-6"></path></svg></div><div class="absolute right-1 top-1/2 transform -translate-y-1/2"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right w-4 h-4 text-gray-400"><path d="m9 18 6-6-6-6"></path></svg></div></div><div class="h-3 bg-gray-300 rounded mb-2"></div><div class="h-6 w-20 bg-gray-400 rounded"></div><div class="flex justify-center gap-1 mt-2"><div class="w-1.5 h-1.5 bg-gray-300 rounded-full"></div><div class="w-1.5 h-1.5 bg-gray-300 rounded-full"></div><div class="w-1.5 h-1.5 bg-gray-300 rounded-full"></div><div class="w-1.5 h-1.5 bg-gray-300 rounded-full"></div><div class="w-1.5 h-1.5 bg-gray-300 rounded-full"></div></div>', 4)),
1096
- r("div", cr, [
1097
- r("div", vr, i(l.$t(e.text)), 1),
1098
- e.count && e.count > 0 ? (o(), n("div", pr, i(e.count), 1)) : j("", !0)
1099
- ])
1100
- ]));
1101
- }
1102
- }, hr = { class: "h-full flex flex-col" }, br = { class: "flex justify-between items-center mt-2 pt-2 border-t border-gray-300" }, yr = { class: "text-xs font-medium text-gray-600" }, mr = {
1103
- key: 0,
1104
- class: "text-xs text-gray-500"
1105
- }, xr = {
1106
- __name: "infoLine-skeleton",
1107
- props: {
1108
- text: {
1109
- type: String,
1110
- required: !0
1111
- },
1112
- count: {
1113
- type: Number,
1114
- required: !0
1115
- }
1116
- },
1117
- setup(e) {
1118
- return (l, s) => (o(), n("div", hr, [
1119
- s[0] || (s[0] = z('<div class="flex-1 bg-gray-200 rounded relative overflow-hidden"><div class="absolute inset-0 flex items-center"><div class="flex gap-8 whitespace-nowrap animate-pulse"><div class="h-3 bg-gray-400 rounded w-32"></div><div class="h-3 bg-gray-300 rounded w-24"></div><div class="h-3 bg-gray-400 rounded w-40"></div><div class="h-3 bg-gray-300 rounded w-28"></div><div class="h-3 bg-gray-400 rounded w-36"></div><div class="h-3 bg-gray-300 rounded w-20"></div></div></div><div class="absolute top-2 left-2 right-2 flex justify-between items-center"><div class="w-2 h-2 bg-gray-500 rounded-full"></div><div class="w-2 h-2 bg-gray-500 rounded-full"></div></div></div>', 1)),
1120
- r("div", br, [
1121
- r("div", yr, i(l.$t(e.text)), 1),
1122
- e.count && e.count > 0 ? (o(), n("div", mr, i(e.count), 1)) : j("", !0)
1123
- ])
1124
- ]));
1125
- }
1126
- }, fr = { class: "h-full flex flex-col" }, wr = { class: "flex justify-between items-center mt-2 pt-2 border-t border-gray-300" }, kr = { class: "text-xs font-medium text-gray-600" }, _r = {
1127
- key: 0,
1128
- class: "text-xs text-gray-500"
1129
- }, $r = {
1130
- __name: "tabs-skeleton",
1131
- props: {
1132
- text: {
1133
- type: String,
1134
- required: !0
1135
- },
1136
- count: {
1137
- type: Number,
1138
- required: !0
1139
- }
1140
- },
1141
- setup(e) {
1142
- return (l, s) => (o(), n("div", fr, [
1143
- s[0] || (s[0] = z('<div class="h-2 bg-gray-300 rounded mb-2"></div><div class="flex gap-1 mb-3"><div class="h-4 w-16 bg-gray-400 rounded"></div><div class="h-4 w-16 bg-gray-200 rounded"></div></div><div class="space-y-2 flex-1"><div class="h-2 bg-gray-300 rounded w-5/6"></div><div class="h-2 bg-gray-300 rounded"></div><div class="space-y-1 mt-3"><div class="flex items-center gap-2"><div class="w-2 h-2 bg-gray-400 rounded-full"></div><div class="h-1.5 bg-gray-300 rounded w-20"></div></div><div class="flex items-center gap-2"><div class="w-2 h-2 bg-gray-400 rounded-full"></div><div class="h-1.5 bg-gray-300 rounded w-16"></div></div></div></div>', 3)),
1144
- r("div", wr, [
1145
- r("div", kr, i(l.$t(e.text)), 1),
1146
- e.count && e.count > 0 ? (o(), n("div", _r, i(e.count), 1)) : j("", !0)
1147
- ])
1148
- ]));
1149
- }
1150
- }, Cr = { class: "h-full flex flex-col" }, Ar = { class: "flex justify-between items-center mt-2 pt-2 border-t border-gray-300" }, Mr = { class: "text-xs font-medium text-gray-600" }, jr = {
1151
- key: 0,
1152
- class: "text-xs text-gray-500"
1153
- }, ze = {
1154
- __name: "documents-skeleton",
1155
- props: {
1156
- text: {
1157
- type: String,
1158
- required: !0
1159
- },
1160
- count: {
1161
- type: Number,
1162
- required: !0
1163
- }
1164
- },
1165
- setup(e) {
1166
- return (l, s) => (o(), n("div", Cr, [
1167
- s[0] || (s[0] = z('<div class="h-4 bg-gray-400 rounded mb-2"></div><div class="space-y-1.5 flex-1"><div class="flex items-center justify-between p-1.5 border-b border-gray-200"><div class="flex items-center gap-2"><div class="w-3 h-3 bg-gray-400 rounded-full"></div><div class="h-2 bg-gray-300 rounded flex-1 w-28"></div></div><div class="flex gap-1.5"><div class="w-3 h-3 bg-gray-200 rounded"></div><div class="w-3 h-3 bg-gray-200 rounded"></div></div></div><div class="flex items-center justify-between p-1.5 border-b border-gray-200"><div class="flex items-center gap-2"><div class="w-3 h-3 bg-gray-400 rounded-full"></div><div class="h-2 bg-gray-300 rounded flex-1 w-28"></div></div><div class="flex gap-1.5"><div class="w-3 h-3 bg-gray-200 rounded"></div><div class="w-3 h-3 bg-gray-200 rounded"></div></div></div><div class="flex items-center justify-between p-1.5 border-b border-gray-200"><div class="flex items-center gap-2"><div class="w-3 h-3 bg-gray-400 rounded-full"></div><div class="h-2 bg-gray-300 rounded flex-1 w-28"></div></div><div class="flex gap-1.5"><div class="w-3 h-3 bg-gray-200 rounded"></div><div class="w-3 h-3 bg-gray-200 rounded"></div></div></div><div class="flex items-center justify-between p-1.5 border-b border-gray-200"><div class="flex items-center gap-2"><div class="w-3 h-3 bg-gray-400 rounded-full"></div><div class="h-2 bg-gray-300 rounded flex-1 w-28"></div></div><div class="flex gap-1.5"><div class="w-3 h-3 bg-gray-200 rounded"></div><div class="w-3 h-3 bg-gray-200 rounded"></div></div></div></div>', 2)),
1168
- r("div", Ar, [
1169
- r("div", Mr, i(l.$t(e.text)), 1),
1170
- e.count && e.count > 0 ? (o(), n("div", jr, i(e.count), 1)) : j("", !0)
1171
- ])
1172
- ]));
1173
- }
1174
- }, Vr = { class: "h-full flex flex-col" }, Fr = { class: "flex justify-between items-center mt-2 pt-2 border-t border-gray-300" }, Br = { class: "text-xs font-medium text-gray-600" }, Sr = {
1175
- key: 0,
1176
- class: "text-xs text-gray-500"
1177
- }, qr = {
1178
- __name: "body-skeleton",
1179
- props: {
1180
- text: {
1181
- type: String,
1182
- required: !0
1183
- },
1184
- count: {
1185
- type: Number,
1186
- required: !0
1187
- }
1188
- },
1189
- setup(e) {
1190
- return (l, s) => (o(), n("div", Vr, [
1191
- s[0] || (s[0] = z('<div class="grid grid-cols-3 gap-2 flex-1"><div class="flex flex-col"><div class="h-3 bg-gray-400 rounded mb-2"></div><div class="space-y-1.5"><div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5"><div class="h-1.5 bg-gray-300 rounded w-3/4"></div></div><div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5"><div class="h-1.5 bg-gray-300 rounded w-3/4"></div></div></div></div><div class="flex flex-col"><div class="h-3 bg-gray-400 rounded mb-2"></div><div class="space-y-1.5"><div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5"><div class="h-1.5 bg-gray-300 rounded w-3/4"></div></div><div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5"><div class="h-1.5 bg-gray-300 rounded w-3/4"></div></div></div></div><div class="flex flex-col"><div class="h-3 bg-gray-400 rounded mb-2"></div><div class="space-y-1.5"><div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5"><div class="h-1.5 bg-gray-300 rounded w-3/4"></div></div><div class="h-4 bg-gray-200 rounded border border-gray-300 p-1.5"><div class="h-1.5 bg-gray-300 rounded w-3/4"></div></div></div></div></div>', 1)),
1192
- r("div", Fr, [
1193
- r("div", Br, i(l.$t(e.text)), 1),
1194
- e.count && e.count > 0 ? (o(), n("div", Sr, i(e.count), 1)) : j("", !0)
1195
- ])
1196
- ]));
1197
- }
1198
- }, ne = {
1199
- faq: Bt,
1200
- banner: Be,
1201
- slider: gr,
1202
- video: sr,
1203
- about: ir,
1204
- cards: Fe,
1205
- usefulLinks: qe,
1206
- team: Ot,
1207
- news: Se,
1208
- form: Nt,
1209
- tabs: $r,
1210
- vertical_tabs: Se,
1211
- documents: ze,
1212
- infoLine: xr,
1213
- body: qr,
1214
- photoGrid: Fe,
1215
- interested: qe,
1216
- contact: ze,
1217
- iframe: Be
1218
- }, zr = { class: "grid grid-cols-1 md:grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3 gap-4" }, Er = ["onClick"], Ir = { class: "wireframe-block h-[240px] !p-4 border-2 border-dashed bg-white relative overflow-hidden transition-all rounded-lg shadow-sm border-gray-300 hover:border-gray-400 cursor-pointer" }, Dr = ["src"], Tr = {
1219
- __name: "vs-form-reference-choce",
1220
- props: {
1221
- modelValue: {
1222
- type: String,
1223
- required: !0
1224
- },
1225
- modelModifiers: {}
1226
- },
1227
- emits: ["update:modelValue"],
1228
- setup(e) {
1229
- const l = Z(e, "modelValue");
1230
- return (s, b) => (o(), n("div", zr, [
1231
- (o(!0), n(L, null, P(y(oe), (u) => (o(), n("div", {
1232
- key: u.id,
1233
- onClick: (d) => l.value = u.id,
1234
- class: "relative"
1235
- }, [
1236
- r("div", Ir, [
1237
- y(ne)[u.id] ? (o(), F(Ie(y(ne)[u.id]), {
1238
- key: 0,
1239
- text: u == null ? void 0 : u.text,
1240
- count: (u == null ? void 0 : u.data) || 0
1241
- }, null, 8, ["text", "count"])) : (o(), n("img", {
1242
- key: 1,
1243
- src: y(Re),
1244
- alt: "Team collaboration",
1245
- class: "w-full h-full object-cover"
1246
- }, null, 8, Dr))
1247
- ])
1248
- ], 8, Er))), 128))
1249
- ]));
1250
- }
1251
- }, Lr = {};
1252
- function Nr(e, l, s, b, u, d) {
1253
- const m = me("vs-richtext");
1254
- return o(), F(m, { class: "w-full" });
1255
- }
1256
- const Gr = /* @__PURE__ */ te(Lr, [["render", Nr]]), Qr = { class: "flex gap-4" }, Zr = { class: "text-sm text-gray-500 dark:text-gray-400 border flex items-center h-10 px-4 rounded-lg w-full" }, Ur = { class: "flex items-center justify-between w-full p-4 border-t border-gray-200 dark:border-gray-700" }, Wr = {
1257
- __name: "vs-form-reference-add",
1258
- props: /* @__PURE__ */ W({
1259
- title: {
1260
- type: String,
1261
- required: !0
1262
- }
1263
- }, {
1264
- modelValue: {
1265
- type: Array,
1266
- default: () => []
1267
- },
1268
- modelModifiers: {}
1269
- }),
1270
- emits: ["update:modelValue"],
1271
- setup(e) {
1272
- const { t: l } = Y();
1273
- Ve["vs-input-reference"] = Xr, Ve["vs-input-tiptap-editor"] = Gr;
1274
- const s = Z(e, "modelValue"), b = M(!1), u = M({}), d = M(null), m = M({}), g = R(() => {
1275
- var p;
1276
- return ((p = Pe[d.value]) == null ? void 0 : p.schema) || null;
1277
- }), x = async () => {
1278
- if (await u.value.validate()) {
1279
- ie({
1280
- type: "warning",
1281
- title: l("cms.common.actions.warning"),
1282
- message: l("cms.builder.editFieldFailed")
1283
- });
1284
- return;
1285
- }
1286
- try {
1287
- Object.keys(m.value).length !== 0 && (s.value = [
1288
- ...s.value || [],
1289
- {
1290
- ...m.value,
1291
- id: Math.random().toString(36).substring(2, 15),
1292
- reference_type: d.value
1293
- }
1294
- ]), b.value = !1, d.value = null, m.value = {};
1295
- } catch (t) {
1296
- console.log(t);
1297
- }
1298
- };
1299
- return H(b, () => {
1300
- b.value || (d.value = null, m.value = {});
1301
- }), (p, t) => (o(), n("div", null, [
1302
- r("button", {
1303
- type: "button",
1304
- class: "inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm text-sm font-medium text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-sky-500",
1305
- onClick: t[0] || (t[0] = (_) => b.value = !b.value)
1306
- }, i(p.$t("cms.builder.create")), 1),
1307
- k(y(Qe), {
1308
- visible: b.value,
1309
- "onUpdate:visible": t[6] || (t[6] = (_) => b.value = _),
1310
- position: "right",
1311
- closeClickBackdrop: !1,
1312
- onClose: t[7] || (t[7] = (_) => b.value = !1),
1313
- title: d.value ? p.$t("cms.builder." + d.value) : p.$t("cms.builder.selectType"),
1314
- size: "50vw"
1315
- }, {
1316
- footer: U(() => [
1317
- r("div", Ur, [
1318
- r("button", {
1319
- onClick: t[5] || (t[5] = (_) => b.value = !1),
1320
- class: "inline-flex items-center px-3 py-2 text-sm text-black duration-300 border border-gray-200 rounded-lg gap-x-2 whitespace-nowrap hover:bg-gray-100"
1321
- }, i(p.$t("cms.builder.cancel")), 1),
1322
- r("button", {
1323
- onClick: x,
1324
- class: "py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"
1325
- }, i(p.$t("cms.builder.create")), 1)
1326
- ])
1327
- ]),
1328
- default: U(() => {
1329
- var _;
1330
- return [
1331
- d.value ? (o(), n(L, { key: 1 }, [
1332
- r("div", Qr, [
1333
- r("div", Zr, [
1334
- r("span", null, i((_ = y(oe).find(($) => $.id === d.value)) == null ? void 0 : _.text), 1)
1335
- ]),
1336
- r("button", {
1337
- class: "py-2.5 px-3 mb-4 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300",
1338
- onClick: t[2] || (t[2] = ($) => d.value = null)
1339
- }, i(p.$t("cms.builder.changeType")), 1)
1340
- ]),
1341
- g.value ? (o(), F(y(We), {
1342
- key: d.value,
1343
- schema: g.value,
1344
- modelValue: m.value,
1345
- "onUpdate:modelValue": t[3] || (t[3] = ($) => m.value = $),
1346
- form: u.value,
1347
- "onUpdate:form": t[4] || (t[4] = ($) => u.value = $)
1348
- }, null, 8, ["schema", "modelValue", "form"])) : j("", !0)
1349
- ], 64)) : (o(), F(Tr, {
1350
- key: 0,
1351
- modelValue: d.value,
1352
- "onUpdate:modelValue": t[1] || (t[1] = ($) => d.value = $),
1353
- options: y(oe)
1354
- }, null, 8, ["modelValue", "options"]))
1355
- ];
1356
- }),
1357
- _: 1
1358
- }, 8, ["visible", "title"])
1359
- ]));
1360
- }
1361
- }, Rr = { class: "absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity flex space-x-1 z-10" }, Pr = { class: "flex items-center justify-between w-full p-4 border-t border-gray-200 dark:border-gray-700" }, Hr = {
1362
- __name: "vs-form-reference-controls",
1363
- props: /* @__PURE__ */ W({
1364
- title: {
1365
- type: String,
1366
- required: !0
1367
- }
1368
- }, {
1369
- modelValue: {
1370
- type: Object,
1371
- default: () => ({})
1372
- },
1373
- modelModifiers: {},
1374
- parent: {
1375
- type: Array,
1376
- default: () => []
1377
- },
1378
- parentModifiers: {}
1379
- }),
1380
- emits: ["update:modelValue", "update:parent"],
1381
- setup(e) {
1382
- const { t: l } = Y(), s = Z(e, "modelValue"), b = Z(e, "parent"), u = M(!1), d = M({}), m = M({}), g = R(() => {
1383
- var p;
1384
- return ((p = Pe[s.value.reference_type]) == null ? void 0 : p.schema) || null;
1385
- });
1386
- H(u, (p) => {
1387
- p && (d.value = { ...s.value });
1388
- });
1389
- const x = async () => {
1390
- try {
1391
- if (await m.value.validate()) {
1392
- ie({
1393
- type: "warning",
1394
- title: l("cms.common.actions.warning"),
1395
- message: l("cms.builder.editFieldFailed")
1396
- });
1397
- return;
1398
- }
1399
- s.value = { ...d.value }, u.value = !1;
1400
- } catch (p) {
1401
- console.log(p);
1402
- }
1403
- };
1404
- return (p, t) => (o(), n("div", Rr, [
1405
- r("button", {
1406
- onClick: t[0] || (t[0] = (_) => u.value = !u.value),
1407
- class: "p-1.5 bg-white dark:bg-gray-800 rounded shadow-sm hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors border border-gray-200 dark:border-gray-700"
1408
- }, [
1409
- k(y(ct), { class: "h-4 w-4 text-gray-400" })
1410
- ]),
1411
- r("button", {
1412
- onClick: t[1] || (t[1] = (_) => b.value = b.value.filter(($) => $.id !== s.value.id)),
1413
- class: "p-1.5 bg-white dark:bg-gray-800 rounded shadow-sm hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors border border-gray-200 dark:border-gray-700"
1414
- }, [
1415
- k(y(ee), { class: "h-4 w-4 text-red-500" })
1416
- ]),
1417
- k(y(Qe), {
1418
- visible: u.value,
1419
- "onUpdate:visible": t[5] || (t[5] = (_) => u.value = _),
1420
- onClose: t[6] || (t[6] = (_) => u.value = !1),
1421
- title: e.title,
1422
- width: "50vw"
1423
- }, {
1424
- footer: U(() => [
1425
- r("div", Pr, [
1426
- r("button", {
1427
- class: "inline-flex items-center px-3 py-2 text-sm text-black duration-300 border border-gray-200 rounded-lg gap-x-2 whitespace-nowrap hover:bg-gray-100",
1428
- onClick: t[4] || (t[4] = (_) => u.value = !1)
1429
- }, i(p.$t("cms.common.actions.cancel")), 1),
1430
- r("button", {
1431
- onClick: x,
1432
- class: "py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"
1433
- }, i(p.$t("cms.common.actions.save")), 1)
1434
- ])
1435
- ]),
1436
- default: U(() => [
1437
- g.value ? (o(), F(y(We), {
1438
- key: 0,
1439
- form: m.value,
1440
- "onUpdate:form": t[2] || (t[2] = (_) => m.value = _),
1441
- schema: g.value,
1442
- modelValue: d.value,
1443
- "onUpdate:modelValue": t[3] || (t[3] = (_) => d.value = _),
1444
- class: "-mr-[10px] ml-[10px] mt-[10px]"
1445
- }, null, 8, ["form", "schema", "modelValue"])) : j("", !0)
1446
- ]),
1447
- _: 1
1448
- }, 8, ["visible", "title"])
1449
- ]));
1450
- }
1451
- }, Or = { class: "w-full" }, Yr = {
1452
- key: 0,
1453
- class: "relative"
1454
- }, Kr = { class: "group wireframe-block h-[280px] !p-4 border-2 border-dashed bg-white relative overflow-hidden transition-all rounded-lg shadow-sm border-gray-00 hover:border-gray-400 cursor-grab" }, Jr = ["src"], Xr = {
1455
- __name: "vs-form-reference-list",
1456
- props: /* @__PURE__ */ W({
1457
- reference_type: {
1458
- type: String,
1459
- required: !0
1460
- },
1461
- title: {
1462
- type: String,
1463
- required: !0
1464
- }
1465
- }, {
1466
- modelValue: {
1467
- default: () => []
1468
- },
1469
- modelModifiers: {}
1470
- }),
1471
- emits: ["update:modelValue"],
1472
- setup(e) {
1473
- const l = (u) => {
1474
- var d;
1475
- return (d = oe.find((m) => m.id === u)) == null ? void 0 : d.text;
1476
- }, s = Z(e, "modelValue"), b = R({
1477
- get() {
1478
- const u = s.value;
1479
- return u == null ? [] : Array.isArray(u) ? u : [];
1480
- },
1481
- set(u) {
1482
- s.value = Array.isArray(u) ? u : [];
1483
- }
1484
- });
1485
- return H(s, (u) => {
1486
- u != null && !Array.isArray(u) && (s.value = []);
1487
- }, { immediate: !0 }), (u, d) => {
1488
- var m;
1489
- return o(), n("div", Or, [
1490
- ((m = b.value) == null ? void 0 : m.length) > 0 ? (o(), F(y(Ge), {
1491
- key: 0,
1492
- modelValue: b.value,
1493
- "onUpdate:modelValue": d[1] || (d[1] = (g) => b.value = g),
1494
- "item-key": "id",
1495
- handle: ".drag-handle",
1496
- class: "grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4"
1497
- }, {
1498
- item: U(({ element: g, index: x }) => [
1499
- g != null && g.reference_type ? (o(), n("div", Yr, [
1500
- r("div", Kr, [
1501
- (o(), n("div", {
1502
- key: g.id,
1503
- class: "absolute top-2 left-2 opacity-0 group-hover:opacity-100 border border-gray-200 dark:border-gray-700 transition-opacity cursor-move z-10 bg-white dark:bg-gray-800 rounded p-1 shadow-sm drag-handle"
1504
- }, [
1505
- k(y(xe), { class: "h-4 w-4 text-gray-400" })
1506
- ])),
1507
- k(Hr, {
1508
- title: u.$t("cms.builder." + (g == null ? void 0 : g.reference_type)),
1509
- modelValue: b.value[x],
1510
- "onUpdate:modelValue": (p) => b.value[x] = p,
1511
- parent: b.value,
1512
- "onUpdate:parent": d[0] || (d[0] = (p) => b.value = p)
1513
- }, null, 8, ["title", "modelValue", "onUpdate:modelValue", "parent"]),
1514
- y(ne)[g == null ? void 0 : g.reference_type] ? (o(), F(Ie(y(ne)[g == null ? void 0 : g.reference_type]), {
1515
- key: 0,
1516
- index: x,
1517
- text: l(g == null ? void 0 : g.reference_type),
1518
- count: Array.isArray(g == null ? void 0 : g.data) ? g.data.length : 0
1519
- }, null, 8, ["index", "text", "count"])) : (o(), n("img", {
1520
- key: 1,
1521
- src: y(Re),
1522
- alt: "Team collaboration",
1523
- class: "w-full h-full object-cover"
1524
- }, null, 8, Jr))
1525
- ])
1526
- ])) : j("", !0)
1527
- ]),
1528
- _: 1
1529
- }, 8, ["modelValue"])) : j("", !0),
1530
- k(Wr, {
1531
- class: "mt-4",
1532
- title: e.title,
1533
- modelValue: b.value,
1534
- "onUpdate:modelValue": d[2] || (d[2] = (g) => b.value = g)
1535
- }, null, 8, ["title", "modelValue"])
1536
- ]);
1537
- };
1538
- }
1539
- };
1540
- function He(e) {
1541
- if (e === 0)
1542
- return "0 Bytes";
1543
- const l = 1024, s = ["Bytes", "KB", "MB", "GB", "TB"], b = Math.floor(Math.log(e) / Math.log(l));
1544
- return Number.parseFloat((e / Math.pow(l, b)).toFixed(2)) + " " + s[b];
1545
- }
1546
- function el(e) {
1547
- const l = new Date(e);
1548
- return isNaN(l.getTime()) ? "" : l.toISOString().slice(0, 10);
1549
- }
1550
- const tl = {
1551
- __name: "TypeTag",
1552
- props: {
1553
- type: {
1554
- type: String,
1555
- required: !0
1556
- }
1557
- },
1558
- setup(e) {
1559
- const l = /* @__PURE__ */ new Map([
1560
- ["document", "bg-blue-100 text-blue-800 border-blue-200 dark:bg-blue-900/30 dark:text-blue-300 dark:border-blue-700"],
1561
- ["image", "bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-300 dark:border-green-700"],
1562
- ["video", "bg-purple-100 text-purple-800 border-purple-200 dark:bg-purple-900/30 dark:text-purple-300 dark:border-purple-700"]
1563
- ]);
1564
- return (s, b) => (o(), n("div", {
1565
- class: Q(["inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors shadow-lg backdrop-blur-sm", y(l).get(e.type)])
1566
- }, i(e.type), 3));
1567
- }
1568
- }, rl = { class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 max-h-[calc(100%-130px)] overflow-y-auto px-2 pt-2 pb-5" }, ll = {
1569
- key: 0,
1570
- class: "flex flex-col items-center justify-center h-64 text-muted-foreground col-span-full"
1571
- }, sl = ["onClick"], al = ["onClick"], ol = { class: "truncate font-medium text-slate-800 dark:text-slate-100 mb-2" }, nl = { class: "text-sm text-slate-500 dark:text-slate-400" }, dl = ["onClick"], il = { class: "p-0" }, ul = { class: "aspect-video bg-slate-100 dark:bg-slate-700 rounded-t-lg overflow-hidden relative" }, cl = { class: "w-full h-full flex items-center justify-center bg-gradient-to-br from-slate-100 to-slate-200 dark:from-slate-700 dark:to-slate-800" }, vl = {
1572
- key: 0,
1573
- class: "relative w-full"
1574
- }, pl = ["src", "alt"], gl = { class: "p-4" }, hl = { class: "flex items-center justify-between mb-2" }, bl = { class: "font-medium text-slate-800 dark:text-slate-100 truncate flex-1 mr-2" }, yl = { class: "space-y-1 text-sm text-slate-500 dark:text-slate-400" }, ml = { class: "flex justify-between" }, xl = { class: "flex justify-between" }, fl = {
1575
- __name: "MediaGrid",
1576
- props: {
1577
- files: {
1578
- type: Array,
1579
- required: !0
1580
- },
1581
- selectedFile: {
1582
- type: Object,
1583
- default: null
1584
- },
1585
- selectedFiles: {
1586
- type: Array,
1587
- default: () => []
1588
- },
1589
- isDeleteButton: {
1590
- type: Boolean,
1591
- default: !1
1592
- }
1593
- },
1594
- emits: ["delete-file", "file-click", "delete-folder"],
1595
- setup(e, { emit: l }) {
1596
- Y();
1597
- const s = e, b = M([]), u = M(null), d = (g) => {
1598
- if (!g)
1599
- return "";
1600
- const x = new Date(g);
1601
- return isNaN(x.getTime()) ? "" : x.toISOString().slice(0, 10);
1602
- }, m = () => {
1603
- b.value = s.files.sort((g, x) => g.type === "dir" && x.type !== "dir" ? -1 : g.type !== "dir" && x.type === "dir" ? 1 : 0);
1604
- };
1605
- return de(() => m()), at(() => m()), (g, x) => {
1606
- var p;
1607
- return o(), n("div", rl, [
1608
- ((p = e.files) == null ? void 0 : p.length) === 0 ? (o(), n("div", ll, [
1609
- k(y(vt), { class: "w-12 h-12 mb-2" }),
1610
- r("p", null, i(g.$t("cms.noFilesInFolder")), 1)
1611
- ])) : j("", !0),
1612
- (o(!0), n(L, null, P(b.value, (t) => {
1613
- var _;
1614
- return o(), n(L, {
1615
- key: t == null ? void 0 : t.url
1616
- }, [
1617
- (t == null ? void 0 : t.type) === "dir" ? (o(), n("div", {
1618
- key: 0,
1619
- class: "p-6 text-center rounded-xl h-[fit-content] relative text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm hover:shadow-xl transition-all duration-200 transform hover:scale-105 cursor-pointer",
1620
- onClick: ($) => g.$emit("file-click", t)
1621
- }, [
1622
- e.isDeleteButton ? (o(), n("div", {
1623
- key: 0,
1624
- onClick: J(($) => {
1625
- u.value = t;
1626
- }, ["stop"]),
1627
- class: "absolute top-4 right-4 p-1 border border-gray-300 dark:border-slate-700 rounded-lg cursor-pointer hover:bg-gray-200 dark:hover:bg-slate-700 group"
1628
- }, [
1629
- k(y(ee), { class: "w-4 h-4 text-gray-500 group-hover:text-red-500" })
1630
- ], 8, al)) : j("", !0),
1631
- k(y(Ne), { class: "w-16 h-16 mx-auto mb-4 text-blue-600" }),
1632
- r("h3", ol, i(t == null ? void 0 : t.name), 1),
1633
- r("p", nl, i(t == null ? void 0 : t.count) + " " + i(g.$t("cms.media.files")), 1)
1634
- ], 8, sl)) : (t == null ? void 0 : t.type) === "file" ? (o(), n("div", {
1635
- key: 1,
1636
- class: Q(["h-[fit-content] rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm hover:shadow-xl transition-all duration-200 transform hover:scale-105 group cursor-pointer", {
1637
- "bg-accent text-accent-foreground ring-2 ring-primary": ((_ = e.selectedFile) == null ? void 0 : _.url) === (t == null ? void 0 : t.url) || e.selectedFiles && e.selectedFiles.some(($) => $.id === t.id)
1638
- }]),
1639
- onClick: ($) => g.$emit("file-click", t)
1640
- }, [
1641
- r("div", il, [
1642
- r("div", ul, [
1643
- r("div", cl, [
1644
- (t == null ? void 0 : t.filetype) === "image" && (t != null && t.filepath || t != null && t.url) ? (o(), n("div", vl, [
1645
- r("img", {
1646
- src: t == null ? void 0 : t.preview,
1647
- alt: (t == null ? void 0 : t.alt) || (t == null ? void 0 : t.filename),
1648
- class: "object-cover w-full h-full rounded text-xs"
1649
- }, null, 8, pl)
1650
- ])) : (o(), F(y(pt), {
1651
- key: 1,
1652
- class: "w-12 h-12 text-gray-500"
1653
- }))
1654
- ])
1655
- ]),
1656
- r("div", gl, [
1657
- r("div", hl, [
1658
- r("h3", bl, i(t.filename), 1),
1659
- k(tl, {
1660
- type: t == null ? void 0 : t.filetype
1661
- }, null, 8, ["type"])
1662
- ]),
1663
- r("div", yl, [
1664
- r("div", ml, [
1665
- r("span", null, i(g.$t("cms.media.size")) + ":", 1),
1666
- r("span", null, i(y(He)(t.filesize)), 1)
1667
- ]),
1668
- r("div", xl, [
1669
- r("span", null, i(g.$t("cms.media.uploaded")) + ":", 1),
1670
- r("span", null, i(d(t.created_at)), 1)
1671
- ])
1672
- ])
1673
- ])
1674
- ])
1675
- ], 10, dl)) : j("", !0)
1676
- ], 64);
1677
- }), 128))
1678
- ]);
1679
- };
1680
- }
1681
- }, wl = {}, kl = {
1682
- "aria-hidden": "true",
1683
- focusable: "false",
1684
- role: "img",
1685
- viewBox: "0 0 16 16",
1686
- width: "16",
1687
- height: "16",
1688
- fill: "currentColor"
1689
- };
1690
- function _l(e, l) {
1691
- return o(), n("svg", kl, [...l[0] || (l[0] = [
1692
- r("path", { d: "M.513 1.513A1.75 1.75 0 0 1 1.75 1h3.5c.55 0 1.07.26 1.4.7l.9 1.2a.25.25 0 0 0 .2.1H 13a1 1 0 0 1 1 1v.5H2.75a.75.75 0 0 0 0 1.5h11.978a1 1 0 0 1 .994 1.117L15 13.25A1.75 1.75 0 0 1 13.25 15H1.75A1.75 1.75 0 0 1 0 13.25V2.75c0-.464.184-.91.513-1.237Z" }, null, -1),
1693
- r("path", { d: "M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z" }, null, -1)
1694
- ])]);
1695
- }
1696
- const $l = /* @__PURE__ */ te(wl, [["render", _l]]), Cl = {}, Al = {
1697
- "aria-hidden": "true",
1698
- focusable: "false",
1699
- role: "img",
1700
- viewBox: "0 0 16 16",
1701
- width: "16",
1702
- height: "16",
1703
- fill: "currentColor"
1704
- };
1705
- function Ml(e, l) {
1706
- return o(), n("svg", Al, [...l[0] || (l[0] = [
1707
- r("path", { d: "M.513 1.513A1.75 1.75 0 0 1 1.75 1h3.5c.55 0 1.07.26 1.4.7l.9 1.2a.25.25 0 0 0 .2.1H 13a1 1 0 0 1 1 1v.5H2.75a.75.75 0 0 0 0 1.5h11.978a1 1 0 0 1 .994 1.117L15 13.25A1.75 1.75 0 0 1 13.25 15H1.75A1.75 1.75 0 0 1 0 13.25V2.75c0-.464.184-.91.513-1.237Z" }, null, -1),
1708
- r("path", { d: "M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z" }, null, -1)
1709
- ])]);
1710
- }
1711
- const jl = /* @__PURE__ */ te(Cl, [["render", Ml]]), Vl = {
1712
- key: 0,
1713
- class: "flex flex-col items-center justify-center h-64 text-muted-foreground"
1714
- }, Fl = {
1715
- key: 1,
1716
- class: "w-full text-sm caption-bottom"
1717
- }, Bl = { class: "[&_tr]:border-b" }, Sl = { class: "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted" }, ql = { class: "h-12 px-4 text-left align-middle font-medium text-muted-foreground w-[300px]" }, zl = { class: "h-12 px-4 font-medium text-left align-middle text-muted-foreground" }, El = { class: "h-12 px-4 font-medium text-left align-middle text-muted-foreground" }, Il = { class: "hidden h-12 px-4 font-medium text-left align-middle text-muted-foreground md:table-cell" }, Dl = { class: "[&_tr:last-child]:border-0" }, Tl = ["onClick"], Ll = { class: "p-4 font-medium align-middle" }, Nl = { class: "flex items-center gap-2" }, Gl = {
1718
- key: 1,
1719
- class: "relative w-8 h-8"
1720
- }, Ql = ["src", "alt"], Zl = { class: "truncate max-w-[200px]" }, Ul = { class: "p-4 align-middle" }, Wl = { class: "p-4 align-middle" }, Rl = { class: "hidden p-4 align-middle md:table-cell" }, Pl = { key: 0 }, Hl = {
1721
- __name: "MediaList",
1722
- props: {
1723
- files: {
1724
- type: Array,
1725
- required: !0
1726
- },
1727
- selectedFile: {
1728
- type: Object,
1729
- default: null
1730
- },
1731
- selectedFiles: {
1732
- type: Array,
1733
- default: () => []
1734
- }
1735
- },
1736
- emits: ["file-click", "delete-folder"],
1737
- setup(e, { emit: l }) {
1738
- const { t: s } = Y(), b = M(null), u = l, d = () => {
1739
- Ze({
1740
- title: s("cms.builder.deleteTitle"),
1741
- message: s("cms.builder.deleteObject"),
1742
- type: "error",
1743
- onConfirm: () => {
1744
- m();
1745
- }
1746
- });
1747
- }, m = () => {
1748
- u("delete-folder", b.value);
1749
- };
1750
- return (g, x) => {
1751
- const p = me("File");
1752
- return o(), n("div", null, [
1753
- e.files.length === 0 ? (o(), n("div", Vl, [
1754
- k(p, { class: "w-12 h-12 mb-2" }),
1755
- r("p", null, i(g.$t("cms.media.noFilesInFolder")), 1)
1756
- ])) : (o(), n("table", Fl, [
1757
- r("thead", Bl, [
1758
- r("tr", Sl, [
1759
- r("th", ql, i(g.$t("cms.media.name")), 1),
1760
- r("th", zl, i(g.$t("cms.media.type")), 1),
1761
- r("th", El, i(g.$t("cms.media.size")), 1),
1762
- r("th", Il, i(g.$t("cms.media.updatedAt")), 1),
1763
- x[0] || (x[0] = r("th", null, null, -1))
1764
- ])
1765
- ]),
1766
- r("tbody", Dl, [
1767
- (o(!0), n(L, null, P(e.files, (t) => {
1768
- var _, $, C, w, f;
1769
- return o(), n("tr", {
1770
- key: t.id,
1771
- class: Q(["border-b transition-colors hover:bg-blue-200/50 data-[state=selected]:bg-muted cursor-pointer", {
1772
- "bg-blue-200": ((_ = b.value) == null ? void 0 : _.id) === t.id && (($ = b.value) == null ? void 0 : $.type) === t.type || e.selectedFiles && e.selectedFiles.some((q) => q.id === t.id && q.type === t.type)
1773
- }]),
1774
- onClick: (q) => g.$emit("file-click", t)
1775
- }, [
1776
- r("td", Ll, [
1777
- r("div", Nl, [
1778
- t.type === "dir" ? (o(), F($l, {
1779
- key: 0,
1780
- class: "w-5 h-5 text-blue-500"
1781
- })) : (t == null ? void 0 : t.filetype) === "image" && (t != null && t.filepath) ? (o(), n("div", Gl, [
1782
- r("img", {
1783
- src: t == null ? void 0 : t.preview,
1784
- alt: (t == null ? void 0 : t.alt) || (t == null ? void 0 : t.filename),
1785
- class: "object-cover w-full h-full rounded"
1786
- }, null, 8, Ql)
1787
- ])) : (t == null ? void 0 : t.filetype) === "image" ? (o(), F(jl, {
1788
- key: 2,
1789
- class: "w-5 h-5 text-green-500"
1790
- })) : (o(), F(p, {
1791
- key: 3,
1792
- class: "w-5 h-5 text-gray-500"
1793
- })),
1794
- r("span", Zl, i((t == null ? void 0 : t.filename) || (t == null ? void 0 : t.name)), 1)
1795
- ])
1796
- ]),
1797
- r("td", Ul, i((t == null ? void 0 : t.type) === "dir" ? g.$t("cms.media.folder") : ((w = (C = t == null ? void 0 : t.filetype) == null ? void 0 : C.charAt(0)) == null ? void 0 : w.toUpperCase()) + ((f = t == null ? void 0 : t.filetype) == null ? void 0 : f.slice(1))), 1),
1798
- r("td", Wl, i((t == null ? void 0 : t.type) === "dir" ? "--" : y(He)(t == null ? void 0 : t.filesize)), 1),
1799
- r("td", Rl, i(t != null && t.updated_at ? y(el)(t == null ? void 0 : t.updated_at) : "--"), 1),
1800
- t.type === "dir" ? (o(), n("td", Pl, [
1801
- k(y(ee), {
1802
- class: "w-4 h-4 text-red-500 cursor-pointer",
1803
- onClick: J(d, ["stop"])
1804
- }, null, 8, ["onClick"])
1805
- ])) : j("", !0)
1806
- ], 10, Tl);
1807
- }), 128))
1808
- ])
1809
- ]))
1810
- ]);
1811
- };
1812
- }
1813
- }, Ol = {}, Yl = {
1814
- xmlns: "http://www.w3.org/2000/svg",
1815
- width: "20",
1816
- height: "20",
1817
- viewBox: "0 0 24 24",
1818
- fill: "none",
1819
- stroke: "currentColor",
1820
- "stroke-width": "2",
1821
- "stroke-linecap": "round",
1822
- "stroke-linejoin": "round"
1823
- };
1824
- function Kl(e, l) {
1825
- return o(), n("svg", Yl, [...l[0] || (l[0] = [
1826
- r("path", { d: "m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }, null, -1),
1827
- r("polyline", { points: "9 22 9 12 15 12 15 22" }, null, -1)
1828
- ])]);
1829
- }
1830
- const Jl = /* @__PURE__ */ te(Ol, [["render", Kl]]), Xl = { class: "flex items-center space-x-1" }, es = ["onClick"], ts = {
1831
- __name: "MediaBreadcrumb",
1832
- props: {
1833
- currentPath: {
1834
- type: Array,
1835
- required: !0
1836
- }
1837
- },
1838
- emits: ["navigate"],
1839
- setup(e) {
1840
- return (l, s) => (o(), n("div", Xl, [
1841
- r("button", {
1842
- class: "flex gap-x-1 items-center px-2 py-1 rounded text-sm font-medium transition-all duration-200 text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20",
1843
- onClick: s[0] || (s[0] = (b) => l.$emit("navigate", []))
1844
- }, [
1845
- k(Jl, { class: "w-3 h-3" }),
1846
- X(" " + i(l.$t("cms.media.mediaLibrary")), 1)
1847
- ]),
1848
- e.currentPath.length > 0 ? (o(), F(y(je), {
1849
- key: 0,
1850
- class: "w-3 h-3 text-slate-400 dark:text-slate-500"
1851
- })) : j("", !0),
1852
- (o(!0), n(L, null, P(e.currentPath, (b, u) => (o(), n("button", {
1853
- key: u,
1854
- class: "flex gap-x-1 items-center px-2 py-1 rounded text-sm font-medium transition-all duration-200 text-blue-700 dark:text-blue-300 bg-blue-50 dark:bg-blue-900/20",
1855
- onClick: (d) => l.$emit("navigate", e.currentPath.slice(0, u + 1))
1856
- }, [
1857
- k(y(Ne), { class: "w-3 h-3" }),
1858
- X(" " + i(b) + " ", 1),
1859
- u < e.currentPath.length - 1 ? (o(), F(y(je), {
1860
- key: 0,
1861
- class: "w-3 h-3 text-slate-400 dark:text-slate-500"
1862
- })) : j("", !0)
1863
- ], 8, es))), 128))
1864
- ]));
1865
- }
1866
- }, rs = { class: "relative group" }, ls = {
1867
- class: "absolute top-1 left-1 z-20 p-1.5 rounded bg-white/90 dark:bg-slate-700/90 shadow cursor-grab active:cursor-grabbing opacity-0 group-hover:opacity-100 transition-opacity drag-handle",
1868
- title: "Перетягніть для зміни порядку"
1869
- }, ss = ["src"], as = { class: "absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity rounded-lg gap-2" }, os = ["onClick"], ns = ["onClick"], ds = ["title"], is = {
1870
- key: 1,
1871
- class: "relative group"
1872
- }, us = ["src"], cs = { class: "absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity rounded-lg gap-2" }, vs = ["title"], ps = {
1873
- key: 2,
1874
- class: "absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center rounded-lg z-10"
1875
- }, gs = { class: "flex flex-col items-center gap-2" }, hs = { class: "text-xs text-gray-600" }, bs = ["multiple", "disabled"], ys = { class: "whitespace-nowrap text-sm" }, ms = { class: "whitespace-nowrap text-sm" }, xs = { class: "flex items-center justify-between p-4 border-b" }, fs = { class: "text-lg font-semibold" }, ws = { class: "flex items-center justify-between gap-4 p-4 border-b" }, ks = { class: "relative z-[1] rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm mb-6 p-4 mx-4" }, _s = { class: "flex items-center justify-between gap-4" }, $s = { class: "flex items-center gap-4 flex-1" }, Cs = { class: "relative flex-1 max-w-md" }, As = ["placeholder"], Ms = { class: "flex items-center gap-2 relative" }, js = { class: "text-xs font-bold" }, Vs = { class: "text-xs font-bold" }, Fs = {
1876
- key: 0,
1877
- class: "w-full absolute top-full left-1/2 transform -translate-x-1/2 mt-2 z-50 bg-white dark:bg-slate-700 flex flex-col items-start border border-slate-200 dark:border-slate-600 rounded-md shadow-lg"
1878
- }, Bs = { class: "flex items-center gap-2" }, Ss = { class: "flex flex-col gap-4 overflow-y-auto p-4 flex-1" }, qs = { class: "p-4 border-t flex items-center justify-between" }, zs = {
1879
- key: 0,
1880
- class: "text-sm text-gray-600 dark:text-gray-400"
1881
- }, Es = { key: 1 }, Is = ["disabled"], Ds = 112, be = 10, Ca = {
1882
- __name: "vs-form-media-select",
1883
- props: /* @__PURE__ */ W({
1884
- multiple: {
1885
- type: Boolean,
1886
- default: !1
1887
- },
1888
- multi: {
1889
- type: Boolean,
1890
- default: !1
1891
- }
1892
- }, {
1893
- modelValue: {},
1894
- modelModifiers: {}
1895
- }),
1896
- emits: /* @__PURE__ */ W(["change"], ["update:modelValue"]),
1897
- setup(e, { emit: l }) {
1898
- const { t: s } = Y(), b = wt(), u = kt(), d = Z(e, "modelValue"), m = l, g = e, x = R(() => g.multiple || g.multi), p = M(null), t = R(() => d.value || p.value), _ = R(() => {
1899
- if (!x.value)
1900
- return [];
1901
- const a = t.value;
1902
- return a ? Array.isArray(a) ? a : [a] : [];
1903
- }), $ = R({
1904
- get: () => _.value,
1905
- set: (a) => {
1906
- if (!a || !Array.isArray(a) || a.length === 0) {
1907
- d && (d.value = null), p.value = null, m("cms.change", null);
1908
- return;
1909
- }
1910
- const c = a.map((v) => typeof v == "string" ? v : (v == null ? void 0 : v.filepath) || (v == null ? void 0 : v.file_path) || v), h = a.map(
1911
- (v) => typeof v == "object" ? v : p.value && Array.isArray(p.value) ? p.value.find((A) => re(A) === v) ?? v : v
1912
- );
1913
- d && (d.value = c), p.value = h, m("cms.change", c);
1914
- }
1915
- }), C = R(() => t.value ? typeof t.value == "object" ? t.value.filename || t.value.file_name || t.value.native_file_name || "File" : typeof t.value == "string" ? t.value.split("cms./").pop() || t.value : "File" : ""), w = M(!1), f = M(!1), q = M("grid"), V = M([]), D = M([]), N = M([]), B = M(), E = M([]), ue = M(null), G = M(!1), le = M(null), ce = M(null), fe = M({}), O = M(""), K = M(!1), se = M("name"), Oe = /* @__PURE__ */ new Map([
1916
- ["name", s("cms.media.sortBy.name")],
1917
- ["filesize", s("cms.media.sortBy.filesize")]
1918
- ]), re = (a) => typeof a == "string" ? a : (a == null ? void 0 : a.filepath) || (a == null ? void 0 : a.file_path) || a, we = (a) => a ? typeof a == "string" ? a.split("cms./").pop() || a : a.filename || a.file_name || a.native_file_name || "File" : "", Ye = (a) => typeof a == "string" ? a : (a == null ? void 0 : a.preview) || `/file/resize?filepath=${re(a)}&h=137&quality=75`, Ke = () => {
1919
- ue.value && ue.value.click();
1920
- }, Je = () => {
1921
- w.value = !w.value, w.value && Xe();
1922
- }, Xe = () => {
1923
- if (le.value) {
1924
- const a = le.value.getBoundingClientRect(), c = window.innerHeight - a.bottom, h = a.top, v = c >= Ds + be || c >= h;
1925
- fe.value = {
1926
- top: v ? `${a.bottom + be}px` : "auto",
1927
- bottom: v ? "auto" : `${window.innerHeight - a.top + be}px`,
1928
- left: `${a.left + a.width / 2}px`,
1929
- transform: "translateX(-50%)",
1930
- width: "200px"
1931
- };
1932
- }
1933
- }, ke = (a) => {
1934
- var c;
1935
- if (a.type === "dir")
1936
- _e([...V.value, a.name]);
1937
- else if (x.value) {
1938
- const h = E.value.findIndex((v) => v.id === a.id);
1939
- h >= 0 ? E.value.splice(h, 1) : E.value.push(a);
1940
- } else
1941
- B.value = a.id === ((c = B.value) == null ? void 0 : c.id) ? null : a;
1942
- }, ae = (a) => {
1943
- se.value = a, K.value = !1, D.value = D.value.sort((c, h) => {
1944
- var v;
1945
- if ((c == null ? void 0 : c.type) === "dir")
1946
- return -1;
1947
- if (a === "name")
1948
- return (v = c == null ? void 0 : c.name) == null ? void 0 : v.localeCompare(h == null ? void 0 : h.name);
1949
- if (a === "filesize")
1950
- return (h == null ? void 0 : h.filesize) - (c == null ? void 0 : c.filesize);
1951
- });
1952
- }, et = async () => {
1953
- try {
1954
- const a = V.value.join("/"), h = await (await fetch(`/api/cms-media?subdir=${a}${O.value ? "&search=" + O.value : ""}`, {
1955
- method: "GET"
1956
- })).json();
1957
- h.data ? (D.value = h.data.map((v) => ({
1958
- ...v,
1959
- id: v.type === "dir" ? `dir-${v.name}` : v.id,
1960
- preview: `/file/resize?filepath=${v.filepath}&h=137&quality=75`
1961
- })), ae(se.value)) : D.value = [];
1962
- } catch (a) {
1963
- console.error("Search error:", a), D.value = [];
1964
- }
1965
- }, tt = () => {
1966
- if (x.value) {
1967
- if (E.value.length > 0) {
1968
- const a = Array.isArray(d.value) ? [...d.value] : d.value ? [d.value] : [], c = Array.isArray(p.value) ? [...p.value] : p.value ? [p.value] : [];
1969
- E.value.forEach((h) => {
1970
- const v = h.filepath || h.file_path;
1971
- a.some((A) => (typeof A == "string" ? A : (A == null ? void 0 : A.filepath) || (A == null ? void 0 : A.file_path)) === v) || (a.push(v), c.push(h));
1972
- }), d && (d.value = a), p.value = c, m("cms.change", a), E.value = [];
1973
- }
1974
- } else if (B.value) {
1975
- const a = B.value.filepath || B.value.file_path;
1976
- d && (d.value = a), p.value = B.value, m("cms.change", a), B.value = null;
1977
- }
1978
- ve();
1979
- }, ve = () => {
1980
- f.value = !1;
1981
- }, _e = (a) => {
1982
- V.value = a, N.value = [...N.value, a], B.value = null, x.value && (E.value = []), pe();
1983
- }, rt = () => {
1984
- N.value.length > 1 && (N.value.pop(), V.value = N.value[N.value.length - 1], B.value = null, x.value && (E.value = []), pe());
1985
- }, pe = async () => {
1986
- try {
1987
- const a = V.value.join("/"), h = await (await fetch(`/api/cms-media?subdir=${a}${O.value ? "&search=" + O.value : ""}`, {
1988
- method: "GET"
1989
- })).json();
1990
- h.data ? (D.value = h.data.map((v) => ({
1991
- ...v,
1992
- id: v.type === "dir" ? `dir-${v.name}` : v.id,
1993
- preview: `/file/resize?filepath=${v.filepath}&h=137&quality=75`
1994
- })), ae(se.value)) : D.value = [];
1995
- } catch (a) {
1996
- console.error("Fetch error:", a), D.value = [];
1997
- }
1998
- }, $e = async (a, c) => {
1999
- try {
2000
- const h = typeof a == "string" ? a : re(a);
2001
- if (await fetch(`/file/delete${h}`), x.value) {
2002
- const v = Array.isArray(d.value) ? [...d.value] : [], A = Array.isArray(p.value) ? [...p.value] : [];
2003
- if (c !== void 0 && c >= 0)
2004
- v.splice(c, 1), A.splice(c, 1);
2005
- else {
2006
- const S = v.findIndex((I) => (typeof I == "string" ? I : (I == null ? void 0 : I.filepath) || (I == null ? void 0 : I.file_path)) === h);
2007
- S >= 0 && (v.splice(S, 1), A.splice(S, 1));
2008
- }
2009
- d && (d.value = v.length > 0 ? v : null), p.value = A.length > 0 ? A : null, m("cms.change", v.length > 0 ? v : null);
2010
- } else
2011
- d && (d.value = null), p.value = null, m("cms.change", null);
2012
- return !0;
2013
- } catch (h) {
2014
- return console.error(h), !1;
2015
- }
2016
- }, Ce = async (a) => {
2017
- try {
2018
- const c = await fetch(`/file/download/files/uploads${a}`), h = await c.arrayBuffer(), v = c.headers["content-type"], A = new TextDecoder("utf-8").decode(h), S = new Blob([A], { type: v }), I = document.createElement("cms.a");
2019
- I.setAttribute("download", a), I.href = window.URL.createObjectURL(S), I.click();
2020
- } catch (c) {
2021
- console.error(c.message);
2022
- }
2023
- }, lt = async (a) => {
2024
- if (!a.target.files || a.target.files.length === 0)
2025
- return;
2026
- const c = Array.from(a.target.files);
2027
- G.value = !0;
2028
- try {
2029
- const h = [];
2030
- for (const v of c) {
2031
- const A = new FormData();
2032
- A.append("file", v);
2033
- const S = await fetch("/file/upload/uploads?id=1&form=form&table=table", {
2034
- method: "POST",
2035
- body: A
2036
- });
2037
- if (!S.ok)
2038
- throw new Error(`Upload failed: ${S.status}`);
2039
- const T = (await S.json()).result, st = {
2040
- file_id: T.file_id,
2041
- file_name: T.file_name,
2042
- file_path: T.file_path,
2043
- filepath: T.file_path,
2044
- // Для сумісності
2045
- format: T.format,
2046
- size: T.size,
2047
- entity_id: T.entity_id,
2048
- dir: T.dir,
2049
- native_file_name: T.native_file_name,
2050
- preview: `/file/resize?filepath=${T.file_path}&h=137&quality=75`
2051
- };
2052
- h.push(st);
2053
- }
2054
- if (x.value) {
2055
- const v = Array.isArray(d.value) ? [...d.value] : d.value ? [d.value] : [], A = Array.isArray(p.value) ? [...p.value] : p.value ? [p.value] : [];
2056
- h.forEach((S) => {
2057
- v.push(S.file_path), A.push(S);
2058
- }), d && (d.value = v), p.value = A, m("cms.change", v);
2059
- } else {
2060
- const v = h[0];
2061
- d && (d.value = v.file_path), p.value = v, m("cms.change", v.file_path);
2062
- }
2063
- w.value = !1;
2064
- } catch (h) {
2065
- console.error("Upload error:", h), alert("cms.Помилка завантаження файлу: " + h.message);
2066
- } finally {
2067
- G.value = !1;
2068
- }
2069
- a.target.value = "";
2070
- };
2071
- H(f, (a) => {
2072
- a && pe();
2073
- }), H(V, (a) => {
2074
- a.length > 0 ? u.push({ query: { path: a.join("/") } }) : u.push({ query: { path: void 0 } });
2075
- });
2076
- let Ae;
2077
- return H(O, (a) => {
2078
- clearTimeout(Ae), Ae = setTimeout(() => {
2079
- et();
2080
- }, 500);
2081
- }), H(d, (a) => {
2082
- var c, h, v, A;
2083
- if (a && typeof a == "object") {
2084
- const S = ((c = B.value) == null ? void 0 : c.filepath) || ((h = B.value) == null ? void 0 : h.file_path);
2085
- a.filepath !== S && a.file_path !== S && (B.value = null);
2086
- } else if (a && typeof a == "string") {
2087
- const S = ((v = B.value) == null ? void 0 : v.filepath) || ((A = B.value) == null ? void 0 : A.file_path);
2088
- a !== S && (B.value = null);
2089
- }
2090
- }), de(() => {
2091
- var c, h;
2092
- V.value = ((h = (c = b.query) == null ? void 0 : c.path) == null ? void 0 : h.split("cms./")) || [], N.value = [[]], d.value || (B.value = null);
2093
- const a = (v) => {
2094
- var A;
2095
- w.value && !((A = le.value) != null && A.contains(v.target)) && (w.value = !1), K.value && ce.value && !ce.value.contains(v.target) && (K.value = !1);
2096
- };
2097
- document.addEventListener("click", a);
2098
- }), (a, c) => (o(), n(L, null, [
2099
- r("div", ot(a.$attrs, { class: "flex gap-4 flex-wrap" }), [
2100
- x.value ? (o(), F(y(Ge), {
2101
- key: 0,
2102
- modelValue: $.value,
2103
- "onUpdate:modelValue": c[0] || (c[0] = (h) => $.value = h),
2104
- "item-key": (h) => re(h),
2105
- handle: ".drag-handle",
2106
- class: Q(["flex gap-4 flex-wrap", a.$attrs.class])
2107
- }, {
2108
- item: U(({ element: h, index: v }) => [
2109
- r("div", rs, [
2110
- r("div", ls, [
2111
- k(y(xe), { class: "w-4 h-4 text-gray-500 dark:text-slate-400" })
2112
- ]),
2113
- r("img", {
2114
- src: Ye(h),
2115
- alt: "Selected File",
2116
- class: "w-32 h-32 object-cover rounded-lg"
2117
- }, null, 8, ss),
2118
- r("div", as, [
2119
- r("button", {
2120
- type: "button",
2121
- onClick: (A) => $e(h, v),
2122
- class: "p-2 rounded-full bg-red-500 text-white hover:bg-red-600 transition-colors"
2123
- }, [
2124
- k(y(ee), { class: "w-4 h-4" })
2125
- ], 8, os),
2126
- r("button", {
2127
- type: "button",
2128
- onClick: (A) => Ce(re(h)),
2129
- class: "p-2 rounded-full bg-blue-500 text-white hover:bg-blue-600 transition-colors"
2130
- }, [
2131
- k(y(ge), { class: "w-4 h-4" })
2132
- ], 8, ns)
2133
- ]),
2134
- r("div", {
2135
- class: "absolute bottom-full left-0 mb-2 px-3 py-1.5 bg-gray-900 text-white text-xs rounded-lg opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10 max-w-[200px] truncate",
2136
- title: we(h)
2137
- }, [
2138
- X(i(we(h)) + " ", 1),
2139
- c[13] || (c[13] = r("div", { class: "absolute top-full left-4 border-4 border-transparent border-t-gray-900" }, null, -1))
2140
- ], 8, ds)
2141
- ])
2142
- ]),
2143
- _: 1
2144
- }, 8, ["modelValue", "item-key", "class"])) : t.value ? (o(), n("div", is, [
2145
- r("img", {
2146
- src: t.value.preview || t.value,
2147
- alt: "Selected File",
2148
- class: "w-32 h-32 object-cover rounded-lg"
2149
- }, null, 8, us),
2150
- r("div", cs, [
2151
- r("button", {
2152
- type: "button",
2153
- onClick: c[1] || (c[1] = (h) => {
2154
- var v, A;
2155
- return $e(((v = t.value) == null ? void 0 : v.filepath) || ((A = t.value) == null ? void 0 : A.file_path) || t.value);
2156
- }),
2157
- class: "p-2 rounded-full bg-red-500 text-white hover:bg-red-600 transition-colors"
2158
- }, [
2159
- k(y(ee), { class: "w-4 h-4" })
2160
- ]),
2161
- r("button", {
2162
- type: "button",
2163
- onClick: c[2] || (c[2] = (h) => {
2164
- var v, A;
2165
- return Ce(((v = t.value) == null ? void 0 : v.filepath) || ((A = t.value) == null ? void 0 : A.file_path) || t.value);
2166
- }),
2167
- class: "p-2 rounded-full bg-blue-500 text-white hover:bg-blue-600 transition-colors"
2168
- }, [
2169
- k(y(ge), { class: "w-4 h-4" })
2170
- ])
2171
- ]),
2172
- r("div", {
2173
- class: "absolute bottom-full left-0 mb-2 px-3 py-1.5 bg-gray-900 text-white text-xs rounded-lg opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10 max-w-[200px] truncate",
2174
- title: C.value
2175
- }, [
2176
- X(i(C.value) + " ", 1),
2177
- c[14] || (c[14] = r("div", { class: "absolute top-full left-4 border-4 border-transparent border-t-gray-900" }, null, -1))
2178
- ], 8, vs)
2179
- ])) : j("", !0),
2180
- r("div", {
2181
- ref_key: "triggerButton",
2182
- ref: le,
2183
- class: Q(["relative w-32 h-32 flex items-center justify-center border border-dotted border-gray-300 rounded-lg hover:border-blue-500 hover:bg-blue-500/10 hover:cursor-pointer transition-all", { "border-blue-500 bg-blue-500/10": w.value, "opacity-50 cursor-not-allowed": G.value }]),
2184
- onClick: Je
2185
- }, [
2186
- G.value ? (o(), F(y(he), {
2187
- key: 0,
2188
- class: "w-4 h-4 animate-spin text-blue-500"
2189
- })) : (o(), F(y(ye), {
2190
- key: 1,
2191
- class: "w-4 h-4"
2192
- })),
2193
- G.value ? (o(), n("div", ps, [
2194
- r("div", gs, [
2195
- k(y(he), { class: "w-6 h-6 animate-spin text-blue-500" }),
2196
- r("span", hs, i(a.$t("cms.media.uploading")), 1)
2197
- ])
2198
- ])) : j("", !0),
2199
- (o(), F(Me, { to: "body" }, [
2200
- w.value ? (o(), n("div", {
2201
- key: 0,
2202
- class: "fixed bg-white z-50 border border-gray-200 rounded-lg shadow-lg flex flex-col items-center justify-center",
2203
- style: nt(fe.value)
2204
- }, [
2205
- r("div", {
2206
- class: Q(["relative overflow-hidden flex justify-start items-center w-full gap-2 p-4 hover:bg-blue-50 text-blue-700 border hover:border-blue-200 dark:bg-slate-700 dark:text-slate-100 hover:cursor-pointer", { "opacity-50 cursor-not-allowed": G.value }]),
2207
- onClick: c[4] || (c[4] = (h) => !G.value && Ke())
2208
- }, [
2209
- r("input", {
2210
- type: "file",
2211
- ref_key: "fileInput",
2212
- ref: ue,
2213
- class: "absolute justify-center bottom-0 left-0 w-full opacity-0",
2214
- onChange: lt,
2215
- onClick: c[3] || (c[3] = J(() => {
2216
- }, ["stop"])),
2217
- multiple: x.value,
2218
- disabled: G.value
2219
- }, null, 40, bs),
2220
- G.value ? (o(), F(y(he), {
2221
- key: 0,
2222
- class: "w-4 h-4 animate-spin"
2223
- })) : (o(), F(y(ge), { key: 1 })),
2224
- r("span", ys, i(G.value ? a.$t("cms.media.uploading") : a.$t("cms.media.upload")), 1)
2225
- ], 2),
2226
- r("div", {
2227
- onClick: c[5] || (c[5] = (h) => f.value = !0),
2228
- class: "flex justify-start items-center w-full gap-2 p-4 hover:bg-blue-50 text-blue-700 border hover:border-blue-200 dark:bg-slate-700 dark:text-slate-100 hover:cursor-pointer"
2229
- }, [
2230
- k(y(gt)),
2231
- r("span", ms, i(a.$t("cms.media.selectFromMedia")), 1)
2232
- ])
2233
- ], 4)) : j("", !0)
2234
- ]))
2235
- ], 2)
2236
- ], 16),
2237
- (o(), F(Me, { to: "body" }, [
2238
- f.value ? (o(), n("div", {
2239
- key: 0,
2240
- class: "fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",
2241
- onClick: ve
2242
- }, [
2243
- r("div", {
2244
- class: "bg-white rounded-lg shadow-xl max-w-4xl w-full mx-4 max-h-[90vh] flex flex-col",
2245
- onClick: c[12] || (c[12] = J(() => {
2246
- }, ["stop"]))
2247
- }, [
2248
- r("div", xs, [
2249
- r("h3", fs, i(a.$t("cms.media.selectFiles")), 1),
2250
- r("button", {
2251
- onClick: ve,
2252
- class: "text-gray-400 hover:text-gray-600"
2253
- }, [...c[15] || (c[15] = [
2254
- r("svg", {
2255
- class: "w-6 h-6",
2256
- fill: "none",
2257
- stroke: "currentColor",
2258
- viewBox: "0 0 24 24"
2259
- }, [
2260
- r("path", {
2261
- "stroke-linecap": "round",
2262
- "stroke-linejoin": "round",
2263
- "stroke-width": "2",
2264
- d: "M6 18L18 6M6 6l12 12"
2265
- })
2266
- ], -1)
2267
- ])])
2268
- ]),
2269
- r("div", ws, [
2270
- k(ts, {
2271
- "current-path": V.value,
2272
- onNavigate: _e,
2273
- onNavigateBack: rt
2274
- }, null, 8, ["current-path"])
2275
- ]),
2276
- r("div", ks, [
2277
- r("div", _s, [
2278
- r("div", $s, [
2279
- r("div", Cs, [
2280
- k(y(ht), { class: "absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-slate-400 dark:text-slate-500" }),
2281
- De(r("input", {
2282
- type: "text",
2283
- placeholder: a.$t("cms.media.search"),
2284
- class: "w-full pl-10 pr-4 py-2 text-sm border border-slate-200 dark:border-slate-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-slate-700 text-slate-700 dark:text-slate-200 placeholder-slate-400 dark:placeholder-slate-500",
2285
- "onUpdate:modelValue": c[6] || (c[6] = (h) => O.value = h)
2286
- }, null, 8, As), [
2287
- [Te, O.value]
2288
- ])
2289
- ]),
2290
- r("div", Ms, [
2291
- r("span", js, i(a.$t("cms.media.sortBy.title") + ": "), 1),
2292
- r("button", {
2293
- ref_key: "sortByButton",
2294
- ref: ce,
2295
- class: "relative z-[1000] inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border shadow-sm h-8 rounded-md px-3 text-xs bg-white border-slate-300 text-slate-700 disabled:pointer-events-none disabled:opacity-50 hover:text-accent-foreground hover:bg-slate-50 dark:bg-slate-700 dark:border-slate-600 dark:text-slate-300 dark:hover:bg-slate-600",
2296
- onClick: c[9] || (c[9] = (h) => K.value = !K.value)
2297
- }, [
2298
- k(y(bt), { class: "w-4 h-4" }),
2299
- r("span", Vs, i(y(Oe).get(se.value)), 1),
2300
- K.value ? (o(), n("div", Fs, [
2301
- r("span", {
2302
- class: "text-left text-xs font-bold w-full p-2 hover:bg-slate-100 dark:hover:bg-slate-600 border-b border-slate-200 dark:border-slate-600 cursor-pointer",
2303
- onClick: c[7] || (c[7] = J((h) => ae("name"), ["stop"]))
2304
- }, i(a.$t("cms.media.sortBy.name")), 1),
2305
- r("span", {
2306
- class: "text-left text-xs font-bold w-full p-2 hover:bg-slate-100 dark:hover:bg-slate-600 cursor-pointer",
2307
- onClick: c[8] || (c[8] = J((h) => ae("filesize"), ["stop"]))
2308
- }, i(a.$t("cms.media.sortBy.filesize")), 1)
2309
- ])) : j("", !0)
2310
- ], 512)
2311
- ])
2312
- ]),
2313
- r("div", Bs, [
2314
- r("button", {
2315
- class: Q(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 h-8 px-3 text-xs rounded-md", {
2316
- "shadow bg-blue-600 hover:bg-blue-700 text-white": q.value === "grid",
2317
- "border shadow-sm hover:text-accent-foreground bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-600": q.value === "list"
2318
- }]),
2319
- onClick: c[10] || (c[10] = (h) => q.value = "grid")
2320
- }, [
2321
- k(y(yt), { class: "w-4 h-4" })
2322
- ], 2),
2323
- r("button", {
2324
- class: Q(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 h-8 px-3 text-xs rounded-md", {
2325
- "shadow bg-blue-600 hover:bg-blue-700 text-white": q.value === "list",
2326
- "border shadow-sm hover:text-accent-foreground bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-600": q.value === "grid"
2327
- }]),
2328
- onClick: c[11] || (c[11] = (h) => q.value = "list")
2329
- }, [
2330
- k(y(mt), { class: "w-4 h-4" })
2331
- ], 2)
2332
- ])
2333
- ])
2334
- ]),
2335
- r("div", Ss, [
2336
- q.value === "grid" ? (o(), F(fl, {
2337
- key: 0,
2338
- files: D.value,
2339
- "selected-file": x.value ? null : B.value,
2340
- "selected-files": x.value ? E.value : [],
2341
- onFileClick: ke
2342
- }, null, 8, ["files", "selected-file", "selected-files"])) : (o(), F(Hl, {
2343
- key: 1,
2344
- files: D.value,
2345
- "selected-file": x.value ? null : B.value,
2346
- "selected-files": x.value ? E.value : [],
2347
- onFileClick: ke
2348
- }, null, 8, ["files", "selected-file", "selected-files"]))
2349
- ]),
2350
- r("div", qs, [
2351
- x.value && E.value.length > 0 ? (o(), n("div", zs, i(a.$t("cms.media.selectedFiles", { count: E.value.length })), 1)) : (o(), n("div", Es)),
2352
- r("button", {
2353
- onClick: tt,
2354
- disabled: x.value ? E.value.length === 0 : !B.value,
2355
- class: "flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium disabled:pointer-events-none disabled:opacity-50 h-9 px-4 py-2 ml-auto bg-blue-600 hover:bg-blue-700 text-white shadow-md hover:shadow-lg transition-all duration-200 transform hover:scale-105"
2356
- }, [
2357
- k(y(ye), { class: "w-4 h-4 mr-2" }),
2358
- X(" " + i(a.$t("cms.common.actions.add")), 1)
2359
- ], 8, Is)
2360
- ])
2361
- ])
2362
- ])) : j("", !0)
2363
- ]))
2364
- ], 64));
2365
- }
2366
- }, Ts = {};
2367
- function Ls(e, l) {
2368
- const s = me("vs-richtext-md", !0);
2369
- return o(), F(s, { class: "w-full h-[300px]" });
2370
- }
2371
- const Aa = /* @__PURE__ */ te(Ts, [["render", Ls]]), Ns = {
2372
- props: {
2373
- min: { type: Number },
2374
- step: { type: Number, default: () => 1 },
2375
- max: { type: Number, default: () => 1 / 0 },
2376
- modelValue: { type: Number, default: () => null },
2377
- label: { type: String, default: () => "" },
2378
- placeholder: { type: String, default: () => "0" },
2379
- disabled: { type: Boolean, default: () => !1 }
2380
- },
2381
- data() {
2382
- return {
2383
- id: `input-number-${Math.floor(Math.random() * 1e3)}`,
2384
- inputValue: this.modelValue
2385
- };
2386
- },
2387
- watch: {
2388
- modelValue(e) {
2389
- this.inputValue = e;
2390
- },
2391
- inputValue(e) {
2392
- this.$emit("update:modelValue", e);
2393
- }
2394
- },
2395
- methods: {
2396
- validateInput(e) {
2397
- (e.key === "+" || e.key === "," || e.key === "." || e.key === "-" && this.inputValue && this.inputValue.toString().length > 0) && e.preventDefault();
2398
- },
2399
- handleBlur() {
2400
- let e = parseFloat(this.inputValue);
2401
- this.$emit("blur"), isNaN(e) ? e = this.min : e > this.max ? e = this.max : e < this.min && (e = this.min), this.inputValue = e, this.$emit("update:modelValue", this.inputValue);
2402
- }
2403
- }
2404
- }, Gs = { class: "p-0" }, Qs = ["step", "min", "max", "id", "placeholder", "disabled"];
2405
- function Zs(e, l, s, b, u, d) {
2406
- return o(), n("div", Gs, [
2407
- dt(e.$slots, "label", it(ut({ id: u.id }))),
2408
- De(r("input", {
2409
- "onUpdate:modelValue": l[0] || (l[0] = (m) => u.inputValue = m),
2410
- type: "number",
2411
- onKeydown: l[1] || (l[1] = (...m) => d.validateInput && d.validateInput(...m)),
2412
- onBlur: l[2] || (l[2] = (...m) => d.handleBlur && d.handleBlur(...m)),
2413
- step: s.step,
2414
- min: s.min,
2415
- max: s.max,
2416
- id: u.id,
2417
- "aria-describedby": "helper-text-explanation",
2418
- class: Q(["vs-number__input py-2 px-3 block w-full h-[38px] border border-solid border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-500 focus:z-10 focus:border-1 focus:outline-none focus:border-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200 dark:placeholder:text-neutral-500 dark:focus:outline-none dark:focus:ring-1 dark:focus:ring-neutral-600", { "cursor-not-allowed": s.disabled }]),
2419
- placeholder: s.placeholder,
2420
- disabled: s.disabled
2421
- }, null, 42, Qs), [
2422
- [Te, u.inputValue]
2423
- ])
2424
- ]);
2425
- }
2426
- const Ma = /* @__PURE__ */ te(Ns, [["render", Zs]]), Us = { class: "flex items-center justify-end gap-2" }, Ws = { class: "flex justify-end p-[20px] gap-[10px] border-t w-full" }, Rs = {
2427
- __name: "vs-form-custom-datatable-controls",
2428
- props: /* @__PURE__ */ W({
2429
- item: {
2430
- type: Object,
2431
- required: !0
2432
- },
2433
- colModel: {
2434
- type: Array,
2435
- required: !0
2436
- }
2437
- }, {
2438
- modelValue: {
2439
- type: Array,
2440
- required: !0
2441
- },
2442
- modelModifiers: {}
2443
- }),
2444
- emits: ["update:modelValue"],
2445
- setup(e) {
2446
- const { t: l } = Y(), s = Le(() => import("@opengis/form")), b = e, u = Z(e, "modelValue"), d = M(!1), m = M({}), g = M({}), x = () => {
2447
- Ze({
2448
- title: l("cms.builder.deleteTitle"),
2449
- message: l("cms.builder.deleteField"),
2450
- type: "error",
2451
- onConfirm: () => {
2452
- p();
2453
- }
2454
- });
2455
- }, p = () => {
2456
- u.value = u.value.filter((_) => _.id !== b.item.id);
2457
- }, t = async () => {
2458
- if (await g.value.validate()) {
2459
- ie({
2460
- type: "warning",
2461
- title: l("cms.common.actions.warning"),
2462
- message: l("cms.builder.editFieldFailed")
2463
- });
2464
- return;
2465
- }
2466
- u.value = u.value.map(
2467
- ($) => $.id === b.item.id ? m.value : $
2468
- ), d.value = !1;
2469
- };
2470
- return H(d, (_) => {
2471
- _ && (m.value = b.item);
2472
- }), (_, $) => (o(), n("div", Us, [
2473
- r("button", {
2474
- class: "inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-8 w-8 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-blue-50 dark:hover:bg-slate-600 hover:border-blue-300 dark:hover:border-slate-500 hover:text-blue-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm",
2475
- onClick: $[0] || ($[0] = (C) => d.value = !0)
2476
- }, [
2477
- k(y(xt), { class: "w-4 h-4" })
2478
- ]),
2479
- r("button", {
2480
- onClick: x,
2481
- class: "inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-8 w-8 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-red-50 dark:hover:bg-slate-600 hover:border-red-300 dark:hover:border-slate-500 hover:text-red-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"
2482
- }, [
2483
- k(y(ee), { class: "w-4 h-4" })
2484
- ]),
2485
- k(y(Ue), {
2486
- teleport: "#modal",
2487
- title: _.$t("cms.builder.editField"),
2488
- visible: d.value,
2489
- onClose: $[4] || ($[4] = (C) => d.value = !1)
2490
- }, {
2491
- footer: U(() => [
2492
- r("div", Ws, [
2493
- r("button", {
2494
- class: "py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300",
2495
- onClick: $[3] || ($[3] = (C) => d.value = !1)
2496
- }, i(_.$t("cms.common.actions.cancel")), 1),
2497
- r("button", {
2498
- onClick: t,
2499
- class: "py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"
2500
- }, i(_.$t("cms.common.actions.save")), 1)
2501
- ])
2502
- ]),
2503
- default: U(() => [
2504
- k(y(s), {
2505
- form: g.value,
2506
- "onUpdate:form": $[1] || ($[1] = (C) => g.value = C),
2507
- schema: e.colModel,
2508
- modelValue: m.value,
2509
- "onUpdate:modelValue": $[2] || ($[2] = (C) => m.value = C)
2510
- }, null, 8, ["form", "schema", "modelValue"])
2511
- ]),
2512
- _: 1
2513
- }, 8, ["title", "visible"])
2514
- ]));
2515
- }
2516
- }, Ps = { class: "p-6 border-t border-slate-200 dark:border-slate-700 bg-slate-50/30 dark:bg-slate-700/30" }, Hs = { class: "flex justify-end p-[20px] gap-[10px] border-t w-full" }, Os = {
2517
- __name: "vs-form-custom-datatable-add",
2518
- props: /* @__PURE__ */ W({
2519
- colModel: {
2520
- type: Array,
2521
- required: !0
2522
- }
2523
- }, {
2524
- modelValue: {
2525
- type: Array,
2526
- required: !0
2527
- },
2528
- modelModifiers: {}
2529
- }),
2530
- emits: ["update:modelValue"],
2531
- setup(e) {
2532
- const { t: l } = Y(), s = Le(() => import("@opengis/form")), b = Z(e, "modelValue"), u = M(!1), d = M({}), m = M({}), g = async () => {
2533
- try {
2534
- if (await m.value.validate()) {
2535
- ie({
2536
- type: "warning",
2537
- title: l("cms.common.actions.warning"),
2538
- message: l("cms.builder.editFieldFailed")
2539
- });
2540
- return;
2541
- }
2542
- b.value = [
2543
- ...b.value || [],
2544
- { ...d.value, id: Math.random().toString(36).substring(2, 15) }
2545
- ], u.value = !1, d.value = {};
2546
- } catch (x) {
2547
- console.log(x);
2548
- }
2549
- };
2550
- return (x, p) => (o(), n("div", Ps, [
2551
- r("button", {
2552
- class: "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 shadow-sm h-9 px-4 w-full border-2 border-dashed border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-slate-50 dark:hover:bg-slate-600 hover:border-blue-400 dark:hover:border-blue-500 text-slate-600 dark:text-slate-300 hover:text-blue-600 dark:hover:text-blue-400 py-3 transition-all duration-200",
2553
- onClick: p[0] || (p[0] = (t) => u.value = !0)
2554
- }, [
2555
- k(y(ye), { class: "w-4 h-4 mr-2" }),
2556
- X(" " + i(x.$t("cms.common.actions.add")), 1)
2557
- ]),
2558
- k(y(Ue), {
2559
- teleport: "#modal",
2560
- title: x.$t("cms.common.actions.add"),
2561
- visible: u.value,
2562
- onClose: p[4] || (p[4] = (t) => u.value = !1)
2563
- }, {
2564
- footer: U(() => [
2565
- r("div", Hs, [
2566
- r("button", {
2567
- class: "inline-flex items-center px-3 py-2 text-sm text-black duration-300 border border-gray-200 rounded-lg gap-x-2 whitespace-nowrap hover:bg-gray-100",
2568
- onClick: p[3] || (p[3] = (t) => u.value = !1)
2569
- }, i(x.$t("cms.common.actions.cancel")), 1),
2570
- r("button", {
2571
- onClick: g,
2572
- class: "py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"
2573
- }, i(x.$t("cms.common.actions.save")), 1)
2574
- ])
2575
- ]),
2576
- default: U(() => [
2577
- k(y(s), {
2578
- form: m.value,
2579
- "onUpdate:form": p[1] || (p[1] = (t) => m.value = t),
2580
- schema: e.colModel,
2581
- modelValue: d.value,
2582
- "onUpdate:modelValue": p[2] || (p[2] = (t) => d.value = t)
2583
- }, null, 8, ["form", "schema", "modelValue"])
2584
- ]),
2585
- _: 1
2586
- }, 8, ["title", "visible"])
2587
- ]));
2588
- }
2589
- }, Ys = { class: "p-0 shadow w-full" }, Ks = { class: "overflow-x-auto" }, Js = { class: "relative w-full overflow-auto" }, Xs = { class: "w-full caption-bottom text-sm" }, ea = { class: "[&_tr]:border-b" }, ta = { class: "border-b data-[state=selected]:bg-muted bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors" }, ra = { class: "h-10 px-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 text-end" }, la = { class: "[&_tr:last-child]:border-0" }, sa = ["onDragstart", "onDragover", "onDrop", "onDragenter"], aa = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center" }, oa = { class: "flex items-center justify-center text-slate-400" }, na = ["innerHTML"], da = {
2590
- key: 1,
2591
- class: "flex items-center gap-2"
2592
- }, ia = {
2593
- key: 0,
2594
- class: "flex items-center gap-1"
2595
- }, ua = ["src", "alt"], ca = {
2596
- key: 0,
2597
- class: "text-xs text-gray-500 dark:text-gray-400 ml-1"
2598
- }, va = {
2599
- key: 1,
2600
- class: "w-8 h-8 rounded bg-gray-100 dark:bg-gray-700 flex items-center justify-center"
2601
- }, pa = { key: 2 }, ga = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]" }, ha = {
2602
- key: 0,
2603
- class: "h-2 bg-blue-200 dark:bg-blue-800 transition-all duration-200"
2604
- }, Ee = 3, ja = {
2605
- __name: "vs-form-custom-datatable",
2606
- props: /* @__PURE__ */ W({
2607
- colModel: {
2608
- type: Array,
2609
- required: !0
2610
- }
2611
- }, {
2612
- modelValue: {
2613
- type: Array,
2614
- required: !0
2615
- },
2616
- modelModifiers: {}
2617
- }),
2618
- emits: ["update:modelValue"],
2619
- setup(e) {
2620
- const l = Z(e, "modelValue"), s = M(null), b = M(-1), u = M(!1), d = (C, w, f) => {
2621
- s.value = w, b.value = f, C.dataTransfer.effectAllowed = "move", C.dataTransfer.setData("text/html", "");
2622
- }, m = (C, w) => {
2623
- C.preventDefault(), C.dataTransfer.dropEffect = "move";
2624
- }, g = (C, w) => {
2625
- b.value !== w && (u.value = !0);
2626
- }, x = (C) => {
2627
- C.currentTarget.contains(C.relatedTarget) || (u.value = !1);
2628
- }, p = (C, w) => {
2629
- if (C.preventDefault(), u.value = !1, b.value === -1 || b.value === w)
2630
- return;
2631
- const f = [...l.value], [q] = f.splice(b.value, 1);
2632
- f.splice(w, 0, q), l.value = f, s.value = null, b.value = -1;
2633
- }, t = (C) => Array.isArray(C) ? C.slice(0, Ee) : [], _ = (C) => Array.isArray(C) ? Math.max(0, C.length - Ee) : 0, $ = (C) => {
2634
- const w = C.target;
2635
- w.style.display = "none";
2636
- const f = document.createElement("cms.div");
2637
- f.className = "w-full h-full flex items-center justify-center bg-gray-200 dark:bg-gray-600", f.innerHTML = `
2638
- <svg class="w-4 h-4 text-gray-400" fill="currentColor" viewBox="0 0 20 20">
2639
- <path fill-rule="evenodd" d="M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm12 12H4l4-8 3 6 2-4 3 6z" clip-rule="evenodd" />
2640
- </svg>
2641
- `, w.parentNode.appendChild(f);
2642
- };
2643
- return de(() => {
2644
- var C, w;
2645
- (w = (C = l.value) == null ? void 0 : C.filter((f) => typeof f == "object")) == null || w.forEach(
2646
- (f) => f.id ? f.id : f.id = Math.random().toString(36).substring(2, 15)
2647
- );
2648
- }), (C, w) => (o(), n("div", Ys, [
2649
- r("div", Ks, [
2650
- r("div", Js, [
2651
- r("table", Xs, [
2652
- r("thead", ea, [
2653
- r("tr", ta, [
2654
- w[4] || (w[4] = r("th", { class: "h-10 px-2 align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] w-12 text-center" }, null, -1)),
2655
- (o(!0), n(L, null, P(e.colModel, (f) => (o(), n("th", {
2656
- key: f.name,
2657
- class: "h-10 px-2 text-left align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 min-w-[150px]"
2658
- }, i(f.label || f.title || f.name), 1))), 128)),
2659
- r("th", ra, i(C.$t("cms.table.actions")), 1)
2660
- ])
2661
- ]),
2662
- r("tbody", la, [
2663
- (o(!0), n(L, null, P(l.value, (f, q) => (o(), n("tr", {
2664
- key: f == null ? void 0 : f.id,
2665
- class: Q(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move", { "opacity-50": s.value === f }]),
2666
- draggable: "true",
2667
- onDragstart: (V) => d(V, f, q),
2668
- onDragover: (V) => m(V),
2669
- onDrop: (V) => p(V, q),
2670
- onDragenter: (V) => g(V, q),
2671
- onDragleave: w[2] || (w[2] = (V) => x(V))
2672
- }, [
2673
- r("td", aa, [
2674
- r("div", oa, [
2675
- k(y(xe))
2676
- ])
2677
- ]),
2678
- (o(!0), n(L, null, P(e.colModel, (V) => (o(), n("td", {
2679
- key: V.name,
2680
- class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-slate-600 dark:text-slate-400 text-sm"
2681
- }, [
2682
- V.type === "Texteditor" ? (o(), n("span", {
2683
- key: 0,
2684
- innerHTML: f[V.key] || "-"
2685
- }, null, 8, na)) : V.type === "File" ? (o(), n("div", da, [
2686
- Array.isArray(f[V.key]) && f[V.key].length > 0 ? (o(), n("div", ia, [
2687
- (o(!0), n(L, null, P(t(f[V.key]), (D, N) => (o(), n("div", {
2688
- key: N,
2689
- class: "relative w-8 h-8 rounded overflow-hidden bg-gray-100 dark:bg-gray-700 flex-shrink-0"
2690
- }, [
2691
- r("img", {
2692
- src: D,
2693
- alt: `Image ${N + 1}`,
2694
- class: "w-full h-full object-cover",
2695
- onError: w[0] || (w[0] = (B) => $(B))
2696
- }, null, 40, ua)
2697
- ]))), 128)),
2698
- _(f[V.key]) > 0 ? (o(), n("span", ca, " +" + i(_(f[V.key])), 1)) : j("", !0)
2699
- ])) : (o(), n("div", va, [...w[5] || (w[5] = [
2700
- r("svg", {
2701
- class: "w-4 h-4 text-gray-400",
2702
- fill: "currentColor",
2703
- viewBox: "0 0 20 20"
2704
- }, [
2705
- r("path", {
2706
- "fill-rule": "evenodd",
2707
- d: "M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm12 12H4l4-8 3 6 2-4 3 6z",
2708
- "clip-rule": "evenodd"
2709
- })
2710
- ], -1)
2711
- ])]))
2712
- ])) : (o(), n("span", pa, i(f[V.key] || "-"), 1))
2713
- ]))), 128)),
2714
- r("td", ga, [
2715
- k(Rs, {
2716
- item: f,
2717
- colModel: e.colModel,
2718
- modelValue: l.value,
2719
- "onUpdate:modelValue": w[1] || (w[1] = (V) => l.value = V)
2720
- }, null, 8, ["item", "colModel", "modelValue"])
2721
- ])
2722
- ], 42, sa))), 128)),
2723
- u.value ? (o(), n("tr", ha)) : j("", !0)
2724
- ])
2725
- ])
2726
- ])
2727
- ]),
2728
- k(Os, {
2729
- colModel: e.colModel,
2730
- modelValue: l.value,
2731
- "onUpdate:modelValue": w[3] || (w[3] = (f) => l.value = f)
2732
- }, null, 8, ["colModel", "modelValue"])
2733
- ]));
2734
- }
2735
- }, Va = {
2736
- __name: "vs-form-reletion-link",
2737
- props: /* @__PURE__ */ W({
2738
- relation: {
2739
- type: String,
2740
- required: !0
2741
- }
2742
- }, {
2743
- modelValue: {},
2744
- modelModifiers: {}
2745
- }),
2746
- emits: ["update:modelValue"],
2747
- setup(e) {
2748
- const l = Z(e, "modelValue"), s = e, b = M([]);
2749
- return de(async () => {
2750
- const m = await (await fetch(`/api/cms-suggest/${s.relation}`)).json();
2751
- b.value = m == null ? void 0 : m.data;
2752
- }), (d, m) => {
2753
- var g;
2754
- return (g = b.value) != null && g.length ? (o(), F(y(ft), {
2755
- key: 0,
2756
- mode: "combo",
2757
- modelValue: l.value,
2758
- "onUpdate:modelValue": m[0] || (m[0] = (x) => l.value = x),
2759
- options: b.value
2760
- }, null, 8, ["modelValue", "options"])) : j("", !0);
2761
- };
2762
- }
2763
- }, ba = (e) => {
2764
- var b, u;
2765
- const l = (b = e == null ? void 0 : e.type) == null ? void 0 : b.toLowerCase(), s = e != null && e.required ? ["required"] : null;
2766
- return l === "array" ? {
2767
- key: e.name,
2768
- label: e.label || e.title,
2769
- type: "multi-text",
2770
- help: e == null ? void 0 : e.help,
2771
- colModel: {
2772
- type: (e == null ? void 0 : e.subtype) || "text",
2773
- placeholder: e == null ? void 0 : e.placeholder
2774
- },
2775
- validators: s
2776
- } : l === "boolean" ? {
2777
- key: e.name,
2778
- label: e.label || e.title,
2779
- type: "Switcher",
2780
- help: e == null ? void 0 : e.help,
2781
- validators: s
2782
- } : l === "tags" ? {
2783
- key: e.name,
2784
- label: e.label || e.title,
2785
- type: "tags",
2786
- help: e == null ? void 0 : e.help,
2787
- validators: s
2788
- } : l === "radio" ? {
2789
- key: e.name,
2790
- label: e.label || e.title,
2791
- type: "radio",
2792
- help: e == null ? void 0 : e.help,
2793
- options: e.options || [],
2794
- validators: s
2795
- } : l === "date" ? {
2796
- key: e.name,
2797
- label: e.label || e.title,
2798
- type: "Date",
2799
- time: !1,
2800
- help: e == null ? void 0 : e.help,
2801
- validators: s
2802
- } : l === "datetime" ? {
2803
- key: e.name,
2804
- label: e.label || e.title,
2805
- type: "Date",
2806
- help: e == null ? void 0 : e.help,
2807
- mode: "datetime",
2808
- time: !0,
2809
- validators: s
2810
- } : l === "number" ? {
2811
- key: e.name,
2812
- label: e.label || e.title,
2813
- help: e == null ? void 0 : e.help,
2814
- type: "Number",
2815
- validators: s
2816
- } : l === "integer" ? {
2817
- key: e.name,
2818
- label: e.label || e.title,
2819
- type: "Integer",
2820
- help: e == null ? void 0 : e.help,
2821
- validators: s
2822
- } : l === "text" ? {
2823
- key: e.name,
2824
- label: e.label || e.title,
2825
- type: "Text",
2826
- help: e == null ? void 0 : e.help,
2827
- validators: s
2828
- } : l === "file" ? {
2829
- key: e.name,
2830
- label: e.label || e.title,
2831
- type: "File",
2832
- multiple: e.multi || e.multiple,
2833
- help: e == null ? void 0 : e.help,
2834
- validators: s,
2835
- api: "/api/cms-media/upload?subdir=",
2836
- dir: "uploads/" + (/* @__PURE__ */ new Date()).toLocaleDateString("en-US").replace(/\//g, "-")
2837
- } : l === "filelist" ? {
2838
- key: e.name,
2839
- label: e.label || e.title,
2840
- type: "file",
2841
- multiple: !0,
2842
- help: e == null ? void 0 : e.help,
2843
- validators: s
2844
- } : l === "slug" ? {
2845
- key: e.name,
2846
- label: e.label || e.title,
2847
- type: "Slug",
2848
- parent: e.parent || "",
2849
- help: e == null ? void 0 : e.help,
2850
- validators: s
2851
- } : l === "image" ? {
2852
- key: e.name,
2853
- label: e.label || e.title,
2854
- type: "File",
2855
- multi: e.multiple,
2856
- help: e == null ? void 0 : e.help,
2857
- validators: s,
2858
- api: "/api/cms-media/upload?subdir=",
2859
- dir: "uploads/" + (/* @__PURE__ */ new Date()).toLocaleDateString("en-US").replace(/\//g, "-")
2860
- } : l === "select" ? e.options ? {
2861
- key: e.name,
2862
- label: e.label || e.title,
2863
- type: "select",
2864
- options: e.options || [],
2865
- help: e == null ? void 0 : e.help,
2866
- validators: s
2867
- } : {
2868
- key: e.name,
2869
- label: e.label || e.title,
2870
- type: "select",
2871
- data: e.data || [],
2872
- help: e == null ? void 0 : e.help,
2873
- validators: s
2874
- } : l === "multiselect" ? {
2875
- key: e.name,
2876
- label: e.label || e.title,
2877
- type: "select",
2878
- data: e.data || [],
2879
- parent: e.parent || "",
2880
- options: e.options || [],
2881
- help: e == null ? void 0 : e.help,
2882
- validators: s,
2883
- multiple: !0
2884
- } : l === "richtext" ? {
2885
- key: e.name,
2886
- label: e.label || e.title,
2887
- type: "Texteditor",
2888
- help: e == null ? void 0 : e.help,
2889
- validators: s
2890
- } : l === "datalist" ? {
2891
- key: e.name,
2892
- label: e.label || e.title,
2893
- type: "Custom-Datatable",
2894
- colModel: ((u = e.colModel) == null ? void 0 : u.map((d) => ba(d))) || [],
2895
- help: e == null ? void 0 : e.help,
2896
- validators: s
2897
- } : l === "reference" ? {
2898
- key: e.name,
2899
- label: e.label || e.title,
2900
- type: "reference",
2901
- reference_type: e.reference_type,
2902
- help: e == null ? void 0 : e.help,
2903
- validators: s
2904
- } : l === "reference-list" ? {
2905
- key: e.name,
2906
- label: e.label || e.title,
2907
- type: "reference",
2908
- reference_type: e.reference_type,
2909
- help: e == null ? void 0 : e.help,
2910
- validators: s
2911
- } : l === "relation" ? {
2912
- key: e.name,
2913
- label: e.label || e.title,
2914
- type: "relation-link",
2915
- help: e == null ? void 0 : e.help,
2916
- relation: e.relation,
2917
- validators: s
2918
- } : l === "markdown" ? {
2919
- key: e.name,
2920
- label: e.label || e.title,
2921
- type: "richtext-md",
2922
- help: e == null ? void 0 : e.help,
2923
- validators: s
2924
- } : l === "mediaselect" ? {
2925
- key: e.name,
2926
- label: e.label || e.title,
2927
- type: "mediaselect",
2928
- help: e == null ? void 0 : e.help,
2929
- validators: s
2930
- } : {
2931
- key: e.name,
2932
- label: e.label || e.title,
2933
- placeholder: e.placeholder,
2934
- help: e == null ? void 0 : e.help,
2935
- type: "Text",
2936
- validators: s
2937
- };
2938
- };
2939
- export {
2940
- Gr as V,
2941
- ja as _,
2942
- Xr as a,
2943
- Ca as b,
2944
- Aa as c,
2945
- Ma as d,
2946
- Va as e,
2947
- ba as g
2948
- };