@opengis/cms 0.0.26 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +98 -98
- package/dist/index-W-qQIppj-DunG40EG.js +2452 -0
- package/dist/index.html +28 -28
- package/dist/index.js +12683 -6702
- package/dist/index.umd.cjs +87 -41
- package/dist/style.css +1 -0
- package/package.json +68 -68
- package/plugin.js +76 -76
- package/server/app.js +35 -35
- package/server/config.js +4 -4
- package/server/functions/getDraftKey.js +22 -22
- package/server/index.js +22 -22
- package/server/migrations/fixes.sql +123 -123
- package/server/migrations/site.sql +545 -545
- package/server/plugins/adminHook.js +78 -78
- package/server/plugins/hook.js +59 -59
- package/server/plugins/vite.js +84 -84
- package/server/routes/category/controllers/cms.category.delete.js +21 -21
- package/server/routes/category/controllers/cms.category.get.js +17 -17
- package/server/routes/category/controllers/cms.category.list.js +16 -16
- package/server/routes/category/controllers/cms.category.post.js +21 -21
- package/server/routes/category/controllers/cms.category.put.js +23 -23
- package/server/routes/category/index.mjs +22 -22
- package/server/routes/cms/controllers/cmsStat.js +55 -55
- package/server/routes/cms/controllers/cmsSuggest.js +57 -57
- package/server/routes/cms/controllers/deleteContent.js +114 -114
- package/server/routes/cms/controllers/deleteMedia.js +75 -75
- package/server/routes/cms/controllers/downloadMedia.js +48 -48
- package/server/routes/cms/controllers/getContent.js +110 -110
- package/server/routes/cms/controllers/getContentBySlug.js +95 -95
- package/server/routes/cms/controllers/getPermissions.js +15 -15
- package/server/routes/cms/controllers/insertContent.js +218 -218
- package/server/routes/cms/controllers/listMedia.js +93 -93
- package/server/routes/cms/controllers/metadataMedia.js +38 -38
- package/server/routes/cms/controllers/properties.get.js +53 -53
- package/server/routes/cms/controllers/properties.post.js +99 -99
- package/server/routes/cms/controllers/searchContent.js +205 -205
- package/server/routes/cms/controllers/setPermissions.js +49 -49
- package/server/routes/cms/controllers/translate.js +89 -89
- package/server/routes/cms/controllers/updateContent.js +238 -238
- package/server/routes/cms/controllers/uploadMedia.js +78 -78
- package/server/routes/cms/index.mjs +114 -114
- package/server/routes/cms/utils/additionalData.js +35 -35
- package/server/routes/cms/utils/getCollection.js +81 -81
- package/server/routes/cms/utils/getSingle.js +187 -187
- package/server/routes/cms/utils/insertContentLocalization.js +86 -86
- package/server/routes/cms/utils/requestTranslation.js +85 -85
- package/server/routes/cms/utils/updateLocalization.js +47 -47
- package/server/routes/cmsSpace/controllers/deleteSpace.js +25 -25
- package/server/routes/cmsSpace/controllers/getSpaces.js +27 -27
- package/server/routes/cmsSpace/controllers/insertSpace.js +21 -21
- package/server/routes/cmsSpace/controllers/updateSpace.js +23 -23
- package/server/routes/cmsSpace/index.mjs +20 -20
- package/server/routes/contentType/controllers/addContentType.js +162 -162
- package/server/routes/contentType/controllers/contentTypeList.js +54 -54
- package/server/routes/contentType/controllers/delContentType.js +75 -75
- package/server/routes/contentType/controllers/editContentType.js +61 -61
- package/server/routes/contentType/controllers/getContentType.js +37 -37
- package/server/routes/contentType/index.mjs +35 -35
- package/server/routes/contentType/utils/updateContents.js +28 -28
- package/server/routes/contentType/utils/updateCustomContentTable.js +55 -55
- package/server/routes/feedback/controllers/email.list.js +24 -24
- package/server/routes/feedback/controllers/feedback.js +48 -48
- package/server/routes/feedback/controllers/feedback.list.js +37 -37
- package/server/routes/feedback/controllers/news.subscriptions.js +44 -44
- package/server/routes/feedback/index.mjs +71 -71
- package/server/routes/logs/controllers/export.user.logs.js +77 -77
- package/server/routes/logs/controllers/user.logs.js +44 -44
- package/server/routes/logs/index.mjs +9 -9
- package/server/routes/menu/controllers/addMenu.js +37 -37
- package/server/routes/menu/controllers/delMenu.js +31 -31
- package/server/routes/menu/controllers/editMenu.js +41 -41
- package/server/routes/menu/controllers/getMenu.js +42 -42
- package/server/routes/menu/index.mjs +13 -13
- package/server/routes/migration/controllers/collectionToCustom.js +137 -137
- package/server/routes/migration/index.mjs +8 -8
- package/server/routes/root.mjs +8 -8
- package/server/routes/tags/controllers/add.tags.js +24 -24
- package/server/routes/tags/controllers/del.tags.js +19 -19
- package/server/routes/tags/controllers/edit.tags.js +25 -25
- package/server/routes/tags/controllers/get.tags.js +15 -15
- package/server/routes/tags/index.mjs +14 -14
- package/server/templates/cls/cms.category_type.json +9 -9
- package/server/templates/cls/cms.content_review_status.json +9 -9
- package/server/templates/cls/cms.content_status.json +9 -9
- package/server/templates/cls/cms.content_type.json +9 -9
- package/server/templates/cls/cms.lang.json +9 -9
- package/server/templates/page/login.html +126 -126
- package/server/templates/select/core.user_mentioned.sql +1 -1
- package/dist/index-W-qQIppj-DRzFSjU1.js +0 -2452
package/dist/index.umd.cjs
CHANGED
|
@@ -1,153 +1,199 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(rt,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],e):(rt=typeof globalThis<"u"?globalThis:rt||self,e(rt.cms={},rt.Vue,rt.vueRouter))})(this,function(rt,e,dt){"use strict";/**
|
|
2
2
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/var
|
|
6
|
+
*/var Jl={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"};/**
|
|
7
7
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const
|
|
11
|
+
*/const Qs=l=>l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ce=(l,t)=>({size:a,strokeWidth:r=2,absoluteStrokeWidth:n,color:o,class:s,...i},{attrs:c,slots:u})=>e.h("svg",{...Jl,width:a||Jl.width,height:a||Jl.height,stroke:o||Jl.stroke,"stroke-width":n?Number(r)*24/Number(a):r,...c,class:["lucide",`lucide-${Qs(l)}`],...i},[...t.map(d=>e.h(...d)),...u.default?[u.default()]:[]]);/**
|
|
12
12
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const
|
|
16
|
+
*/const Js=Ce("ActivityIcon",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/**
|
|
17
17
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const
|
|
21
|
+
*/const ei=Ce("ArrowLeftIcon",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
22
22
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const
|
|
26
|
+
*/const Ra=Ce("CalendarIcon",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
27
27
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
28
28
|
*
|
|
29
29
|
* This source code is licensed under the ISC license.
|
|
30
30
|
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const
|
|
31
|
+
*/const ln=Ce("CheckCircleIcon",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
32
32
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the ISC license.
|
|
35
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const
|
|
36
|
+
*/const an=Ce("ChevronDownIcon",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
37
37
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the ISC license.
|
|
40
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const
|
|
41
|
+
*/const ti=Ce("ChevronLeftIcon",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
42
42
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
43
43
|
*
|
|
44
44
|
* This source code is licensed under the ISC license.
|
|
45
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const
|
|
46
|
+
*/const ml=Ce("ChevronRightIcon",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
47
47
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
48
48
|
*
|
|
49
49
|
* This source code is licensed under the ISC license.
|
|
50
50
|
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const
|
|
51
|
+
*/const ja=Ce("DownloadIcon",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
52
52
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
53
53
|
*
|
|
54
54
|
* This source code is licensed under the ISC license.
|
|
55
55
|
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const
|
|
56
|
+
*/const li=Ce("ExternalLinkIcon",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
57
57
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
58
58
|
*
|
|
59
59
|
* This source code is licensed under the ISC license.
|
|
60
60
|
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/const
|
|
61
|
+
*/const Ua=Ce("EyeIcon",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
62
62
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
63
63
|
*
|
|
64
64
|
* This source code is licensed under the ISC license.
|
|
65
65
|
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const
|
|
66
|
+
*/const vl=Ce("FileTextIcon",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
67
67
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
68
68
|
*
|
|
69
69
|
* This source code is licensed under the ISC license.
|
|
70
70
|
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/const
|
|
71
|
+
*/const ea=Ce("FileIcon",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
|
|
72
72
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
73
73
|
*
|
|
74
74
|
* This source code is licensed under the ISC license.
|
|
75
75
|
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const
|
|
76
|
+
*/const rn=Ce("FolderIcon",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
77
77
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
78
78
|
*
|
|
79
79
|
* This source code is licensed under the ISC license.
|
|
80
80
|
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const
|
|
81
|
+
*/const ai=Ce("GlobeIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
82
82
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
83
83
|
*
|
|
84
84
|
* This source code is licensed under the ISC license.
|
|
85
85
|
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/const
|
|
86
|
+
*/const nn=Ce("GripVerticalIcon",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
87
87
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
88
88
|
*
|
|
89
89
|
* This source code is licensed under the ISC license.
|
|
90
90
|
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const
|
|
91
|
+
*/const fl=Ce("HelpCircleIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
92
92
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
93
93
|
*
|
|
94
94
|
* This source code is licensed under the ISC license.
|
|
95
95
|
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const
|
|
96
|
+
*/const za=Ce("ImageIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
|
|
97
97
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
98
98
|
*
|
|
99
99
|
* This source code is licensed under the ISC license.
|
|
100
100
|
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const
|
|
101
|
+
*/const hl=Ce("LayersIcon",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
|
|
102
102
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
103
103
|
*
|
|
104
104
|
* This source code is licensed under the ISC license.
|
|
105
105
|
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const
|
|
106
|
+
*/const ri=Ce("LayoutGridIcon",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
|
|
107
107
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
108
108
|
*
|
|
109
109
|
* This source code is licensed under the ISC license.
|
|
110
110
|
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const
|
|
111
|
+
*/const Ha=Ce("ListIcon",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]);/**
|
|
112
112
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
113
113
|
*
|
|
114
114
|
* This source code is licensed under the ISC license.
|
|
115
115
|
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const
|
|
116
|
+
*/const Ka=Ce("Loader2Icon",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
117
117
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
118
118
|
*
|
|
119
119
|
* This source code is licensed under the ISC license.
|
|
120
120
|
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const
|
|
121
|
+
*/const on=Ce("PencilIcon",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
122
122
|
* @license lucide-vue-next v0.344.0 - ISC
|
|
123
123
|
*
|
|
124
124
|
* This source code is licensed under the ISC license.
|
|
125
125
|
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/const
|
|
126
|
+
*/const gl=Ce("PlusIcon",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
127
|
+
* @license lucide-vue-next v0.344.0 - ISC
|
|
128
|
+
*
|
|
129
|
+
* This source code is licensed under the ISC license.
|
|
130
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
+
*/const ni=Ce("SaveIcon",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/**
|
|
132
|
+
* @license lucide-vue-next v0.344.0 - ISC
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the ISC license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/const qa=Ce("SearchIcon",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
137
|
+
* @license lucide-vue-next v0.344.0 - ISC
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the ISC license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/const Sl=Ce("SquarePenIcon",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4Z",key:"1lpok0"}]]);/**
|
|
142
|
+
* @license lucide-vue-next v0.344.0 - ISC
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the ISC license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/const qt=Ce("Trash2Icon",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
147
|
+
* @license lucide-vue-next v0.344.0 - ISC
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the ISC license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const oi=Ce("UserIcon",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
|
152
|
+
* @license lucide-vue-next v0.344.0 - ISC
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the ISC license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/const Ga=Ce("UsersIcon",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
157
|
+
* @license lucide-vue-next v0.344.0 - ISC
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the ISC license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/const sn=Ce("XCircleIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
162
|
+
* @license lucide-vue-next v0.344.0 - ISC
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the ISC license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/const si=Ce("ZapIcon",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]);/*!
|
|
127
167
|
* shared v11.1.5
|
|
128
168
|
* (c) 2025 kazuya kawaguchi
|
|
129
169
|
* Released under the MIT License.
|
|
130
|
-
*/const
|
|
131
|
-
`)}function
|
|
170
|
+
*/const Ft=typeof window<"u";let ut,nl;if(process.env.NODE_ENV!=="production"){const l=Ft&&window.performance;l&&l.mark&&l.measure&&l.clearMarks&&l.clearMeasures&&(ut=t=>{l.mark(t)},nl=(t,a,r)=>{l.measure(t,a,r),l.clearMarks(a),l.clearMarks(r)})}const ii=/\{([0-9a-zA-Z]+)\}/g;function ta(l,...t){return t.length===1&&Ee(t[0])&&(t=t[0]),(!t||!t.hasOwnProperty)&&(t={}),l.replace(ii,(a,r)=>t.hasOwnProperty(r)?t[r]:"")}const It=(l,t=!1)=>t?Symbol.for(l):Symbol(l),ci=(l,t,a)=>di({l,k:t,s:a}),di=l=>JSON.stringify(l).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),He=l=>typeof l=="number"&&isFinite(l),ui=l=>Wa(l)==="[object Date]",la=l=>Wa(l)==="[object RegExp]",aa=l=>_e(l)&&Object.keys(l).length===0,Ke=Object.assign,pi=Object.create,ve=(l=null)=>pi(l);let cn;const ol=()=>cn||(cn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:ve());function dn(l){return l.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const mi=Object.prototype.hasOwnProperty;function Et(l,t){return mi.call(l,t)}const Oe=Array.isArray,Me=l=>typeof l=="function",ae=l=>typeof l=="string",Pe=l=>typeof l=="boolean",Ee=l=>l!==null&&typeof l=="object",fi=l=>Ee(l)&&Me(l.then)&&Me(l.catch),un=Object.prototype.toString,Wa=l=>un.call(l),_e=l=>Wa(l)==="[object Object]",hi=l=>l==null?"":Oe(l)||_e(l)&&l.toString===un?JSON.stringify(l,null,2):String(l);function Ya(l,t=""){return l.reduce((a,r,n)=>n===0?a+r:a+t+r,"")}const pn=2;function gi(l,t=0,a=l.length){const r=l.split(/\r?\n/);let n=0;const o=[];for(let s=0;s<r.length;s++)if(n+=r[s].length+1,n>=t){for(let i=s-pn;i<=s+pn||a>n;i++){if(i<0||i>=r.length)continue;const c=i+1;o.push(`${c}${" ".repeat(3-String(c).length)}| ${r[i]}`);const u=r[i].length;if(i===s){const d=t-(n-u)+1,p=Math.max(1,a>n?u-d:a-t);o.push(" | "+" ".repeat(d)+"^".repeat(p))}else if(i>s){if(a>n){const d=Math.max(Math.min(a-n,u),1);o.push(" | "+"^".repeat(d))}n+=u+1}}break}return o.join(`
|
|
171
|
+
`)}function Gt(l,t){typeof console<"u"&&(console.warn("[intlify] "+l),t&&console.warn(t.stack))}const mn={};function yi(l){mn[l]||(mn[l]=!0,Gt(l))}function bi(){const l=new Map;return{events:l,on(a,r){const n=l.get(a);n&&n.push(r)||l.set(a,[r])},off(a,r){const n=l.get(a);n&&n.splice(n.indexOf(r)>>>0,1)},emit(a,r){(l.get(a)||[]).slice().map(n=>n(r)),(l.get("*")||[]).slice().map(n=>n(a,r))}}}const ra=l=>!Ee(l)||Oe(l);function na(l,t){if(ra(l)||ra(t))throw new Error("Invalid value");const a=[{src:l,des:t}];for(;a.length;){const{src:r,des:n}=a.pop();Object.keys(r).forEach(o=>{o!=="__proto__"&&(Ee(r[o])&&!Ee(n[o])&&(n[o]=Array.isArray(r[o])?[]:ve()),ra(n[o])||ra(r[o])?n[o]=r[o]:a.push({src:r[o],des:n[o]}))})}}/*!
|
|
132
172
|
* message-compiler v11.1.5
|
|
133
173
|
* (c) 2025 kazuya kawaguchi
|
|
134
174
|
* Released under the MIT License.
|
|
135
|
-
*/function
|
|
136
|
-
`,Kr="\u2028",Gr="\u2029";function Wr(l){const t=l;let a=0,n=1,r=1,o=0;const i=V=>t[V]===Hr&&t[V+1]===Te,s=V=>t[V]===Te,c=V=>t[V]===Gr,d=V=>t[V]===Kr,u=V=>i(V)||s(V)||c(V)||d(V),p=()=>a,k=()=>n,m=()=>r,w=()=>o,b=V=>i(V)||c(V)||d(V)?Te:t[V],h=()=>b(a),g=()=>b(a+o);function x(){return o=0,u(a)&&(n++,r=0),i(a)&&a++,a++,r++,t[a]}function y(){return i(a+o)&&o++,o++,t[a+o]}function f(){a=0,n=1,r=1,o=0}function E(V=0){o=V}function N(){const V=a+o;for(;V!==a;)x();o=0}return{index:p,line:k,column:m,peekOffset:w,charAt:b,currentChar:h,currentPeek:g,next:x,peek:y,reset:f,resetPeek:E,skipToPeek:N}}const mt=void 0,Yr=".",Va="'",qr="tokenizer";function Xr(l,t={}){const a=t.location!==!1,n=Wr(l),r=()=>n.index(),o=()=>vr(n.line(),n.column(),n.index()),i=o(),s=r(),c={currentType:13,offset:s,startLoc:i,endLoc:i,lastType:13,lastOffset:s,lastStartLoc:i,lastEndLoc:i,braceNest:0,inLinked:!1,text:""},d=()=>c,{onError:u}=t;function p(C,B,R,...Z){const he=d();if(B.column+=R,B.offset+=R,u){const ge=a?Dl(he.startLoc,B):null,oe=At(C,ge,{domain:qr,args:Z});u(oe)}}function k(C,B,R){C.endLoc=o(),C.currentType=B;const Z={type:B};return a&&(Z.loc=Dl(C.startLoc,C.endLoc)),R!=null&&(Z.value=R),Z}const m=C=>k(C,13);function w(C,B){return C.currentChar()===B?(C.next(),B):(p(te.EXPECTED_TOKEN,o(),0,B),"")}function b(C){let B="";for(;C.currentPeek()===st||C.currentPeek()===Te;)B+=C.currentPeek(),C.peek();return B}function h(C){const B=b(C);return C.skipToPeek(),B}function g(C){if(C===mt)return!1;const B=C.charCodeAt(0);return B>=97&&B<=122||B>=65&&B<=90||B===95}function x(C){if(C===mt)return!1;const B=C.charCodeAt(0);return B>=48&&B<=57}function y(C,B){const{currentType:R}=B;if(R!==2)return!1;b(C);const Z=g(C.currentPeek());return C.resetPeek(),Z}function f(C,B){const{currentType:R}=B;if(R!==2)return!1;b(C);const Z=C.currentPeek()==="-"?C.peek():C.currentPeek(),he=x(Z);return C.resetPeek(),he}function E(C,B){const{currentType:R}=B;if(R!==2)return!1;b(C);const Z=C.currentPeek()===Va;return C.resetPeek(),Z}function N(C,B){const{currentType:R}=B;if(R!==7)return!1;b(C);const Z=C.currentPeek()===".";return C.resetPeek(),Z}function V(C,B){const{currentType:R}=B;if(R!==8)return!1;b(C);const Z=g(C.currentPeek());return C.resetPeek(),Z}function $(C,B){const{currentType:R}=B;if(!(R===7||R===11))return!1;b(C);const Z=C.currentPeek()===":";return C.resetPeek(),Z}function K(C,B){const{currentType:R}=B;if(R!==9)return!1;const Z=()=>{const ge=C.currentPeek();return ge==="{"?g(C.peek()):ge==="@"||ge==="|"||ge===":"||ge==="."||ge===st||!ge?!1:ge===Te?(C.peek(),Z()):v(C,!1)},he=Z();return C.resetPeek(),he}function H(C){b(C);const B=C.currentPeek()==="|";return C.resetPeek(),B}function v(C,B=!0){const R=(he=!1,ge="")=>{const oe=C.currentPeek();return oe==="{"||oe==="@"||!oe?he:oe==="|"?!(ge===st||ge===Te):oe===st?(C.peek(),R(!0,st)):oe===Te?(C.peek(),R(!0,Te)):!0},Z=R();return B&&C.resetPeek(),Z}function W(C,B){const R=C.currentChar();return R===mt?mt:B(R)?(C.next(),R):null}function le(C){const B=C.charCodeAt(0);return B>=97&&B<=122||B>=65&&B<=90||B>=48&&B<=57||B===95||B===36}function P(C){return W(C,le)}function F(C){const B=C.charCodeAt(0);return B>=97&&B<=122||B>=65&&B<=90||B>=48&&B<=57||B===95||B===36||B===45}function I(C){return W(C,F)}function T(C){const B=C.charCodeAt(0);return B>=48&&B<=57}function Y(C){return W(C,T)}function J(C){const B=C.charCodeAt(0);return B>=48&&B<=57||B>=65&&B<=70||B>=97&&B<=102}function pe(C){return W(C,J)}function _e(C){let B="",R="";for(;B=Y(C);)R+=B;return R}function Fe(C){let B="";for(;;){const R=C.currentChar();if(R==="{"||R==="}"||R==="@"||R==="|"||!R)break;if(R===st||R===Te)if(v(C))B+=R,C.next();else{if(H(C))break;B+=R,C.next()}else B+=R,C.next()}return B}function Vt(C){h(C);let B="",R="";for(;B=I(C);)R+=B;return C.currentChar()===mt&&p(te.UNTERMINATED_CLOSING_BRACE,o(),0),R}function Ce(C){h(C);let B="";return C.currentChar()==="-"?(C.next(),B+=`-${_e(C)}`):B+=_e(C),C.currentChar()===mt&&p(te.UNTERMINATED_CLOSING_BRACE,o(),0),B}function Ie(C){return C!==Va&&C!==Te}function ct(C){h(C),w(C,"'");let B="",R="";for(;B=W(C,Ie);)B==="\\"?R+=dt(C):R+=B;const Z=C.currentChar();return Z===Te||Z===mt?(p(te.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,o(),0),Z===Te&&(C.next(),w(C,"'")),R):(w(C,"'"),R)}function dt(C){const B=C.currentChar();switch(B){case"\\":case"'":return C.next(),`\\${B}`;case"u":return ut(C,B,4);case"U":return ut(C,B,6);default:return p(te.UNKNOWN_ESCAPE_SEQUENCE,o(),0,B),""}}function ut(C,B,R){w(C,B);let Z="";for(let he=0;he<R;he++){const ge=pe(C);if(!ge){p(te.INVALID_UNICODE_ESCAPE_SEQUENCE,o(),0,`\\${B}${Z}${C.currentChar()}`);break}Z+=ge}return`\\${B}${Z}`}function Nt(C){return C!=="{"&&C!=="}"&&C!==st&&C!==Te}function ve(C){h(C);let B="",R="";for(;B=W(C,Nt);)R+=B;return R}function Ke(C){let B="",R="";for(;B=P(C);)R+=B;return R}function at(C){const B=R=>{const Z=C.currentChar();return Z==="{"||Z==="@"||Z==="|"||Z==="("||Z===")"||!Z||Z===st?R:(R+=Z,C.next(),B(R))};return B("")}function Ve(C){h(C);const B=w(C,"|");return h(C),B}function Ge(C,B){let R=null;switch(C.currentChar()){case"{":return B.braceNest>=1&&p(te.NOT_ALLOW_NEST_PLACEHOLDER,o(),0),C.next(),R=k(B,2,"{"),h(C),B.braceNest++,R;case"}":return B.braceNest>0&&B.currentType===2&&p(te.EMPTY_PLACEHOLDER,o(),0),C.next(),R=k(B,3,"}"),B.braceNest--,B.braceNest>0&&h(C),B.inLinked&&B.braceNest===0&&(B.inLinked=!1),R;case"@":return B.braceNest>0&&p(te.UNTERMINATED_CLOSING_BRACE,o(),0),R=Xe(C,B)||m(B),B.braceNest=0,R;default:{let he=!0,ge=!0,oe=!0;if(H(C))return B.braceNest>0&&p(te.UNTERMINATED_CLOSING_BRACE,o(),0),R=k(B,1,Ve(C)),B.braceNest=0,B.inLinked=!1,R;if(B.braceNest>0&&(B.currentType===4||B.currentType===5||B.currentType===6))return p(te.UNTERMINATED_CLOSING_BRACE,o(),0),B.braceNest=0,nt(C,B);if(he=y(C,B))return R=k(B,4,Vt(C)),h(C),R;if(ge=f(C,B))return R=k(B,5,Ce(C)),h(C),R;if(oe=E(C,B))return R=k(B,6,ct(C)),h(C),R;if(!he&&!ge&&!oe)return R=k(B,12,ve(C)),p(te.INVALID_TOKEN_IN_PLACEHOLDER,o(),0,R.value),h(C),R;break}}return R}function Xe(C,B){const{currentType:R}=B;let Z=null;const he=C.currentChar();switch((R===7||R===8||R===11||R===9)&&(he===Te||he===st)&&p(te.INVALID_LINKED_FORMAT,o(),0),he){case"@":return C.next(),Z=k(B,7,"@"),B.inLinked=!0,Z;case".":return h(C),C.next(),k(B,8,".");case":":return h(C),C.next(),k(B,9,":");default:return H(C)?(Z=k(B,1,Ve(C)),B.braceNest=0,B.inLinked=!1,Z):N(C,B)||$(C,B)?(h(C),Xe(C,B)):V(C,B)?(h(C),k(B,11,Ke(C))):K(C,B)?(h(C),he==="{"?Ge(C,B)||Z:k(B,10,at(C))):(R===7&&p(te.INVALID_LINKED_FORMAT,o(),0),B.braceNest=0,B.inLinked=!1,nt(C,B))}}function nt(C,B){let R={type:13};if(B.braceNest>0)return Ge(C,B)||m(B);if(B.inLinked)return Xe(C,B)||m(B);switch(C.currentChar()){case"{":return Ge(C,B)||m(B);case"}":return p(te.UNBALANCED_CLOSING_BRACE,o(),0),C.next(),k(B,3,"}");case"@":return Xe(C,B)||m(B);default:{if(H(C))return R=k(B,1,Ve(C)),B.braceNest=0,B.inLinked=!1,R;if(v(C))return k(B,0,Fe(C));break}}return R}function bt(){const{currentType:C,offset:B,startLoc:R,endLoc:Z}=c;return c.lastType=C,c.lastOffset=B,c.lastStartLoc=R,c.lastEndLoc=Z,c.offset=r(),c.startLoc=o(),n.currentChar()===mt?k(c,13):nt(n,c)}return{nextToken:bt,currentOffset:r,currentPosition:o,context:d}}const Zr="parser",Jr=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function Qr(l,t,a){switch(l){case"\\\\":return"\\";case"\\'":return"'";default:{const n=parseInt(t||a,16);return n<=55295||n>=57344?String.fromCodePoint(n):"�"}}}function eo(l={}){const t=l.location!==!1,{onError:a}=l;function n(g,x,y,f,...E){const N=g.currentPosition();if(N.offset+=f,N.column+=f,a){const V=t?Dl(y,N):null,$=At(x,V,{domain:Zr,args:E});a($)}}function r(g,x,y){const f={type:g};return t&&(f.start=x,f.end=x,f.loc={start:y,end:y}),f}function o(g,x,y,f){t&&(g.end=x,g.loc&&(g.loc.end=y))}function i(g,x){const y=g.context(),f=r(3,y.offset,y.startLoc);return f.value=x,o(f,g.currentOffset(),g.currentPosition()),f}function s(g,x){const y=g.context(),{lastOffset:f,lastStartLoc:E}=y,N=r(5,f,E);return N.index=parseInt(x,10),g.nextToken(),o(N,g.currentOffset(),g.currentPosition()),N}function c(g,x){const y=g.context(),{lastOffset:f,lastStartLoc:E}=y,N=r(4,f,E);return N.key=x,g.nextToken(),o(N,g.currentOffset(),g.currentPosition()),N}function d(g,x){const y=g.context(),{lastOffset:f,lastStartLoc:E}=y,N=r(9,f,E);return N.value=x.replace(Jr,Qr),g.nextToken(),o(N,g.currentOffset(),g.currentPosition()),N}function u(g){const x=g.nextToken(),y=g.context(),{lastOffset:f,lastStartLoc:E}=y,N=r(8,f,E);return x.type!==11?(n(g,te.UNEXPECTED_EMPTY_LINKED_MODIFIER,y.lastStartLoc,0),N.value="",o(N,f,E),{nextConsumeToken:x,node:N}):(x.value==null&&n(g,te.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Je(x)),N.value=x.value||"",o(N,g.currentOffset(),g.currentPosition()),{node:N})}function p(g,x){const y=g.context(),f=r(7,y.offset,y.startLoc);return f.value=x,o(f,g.currentOffset(),g.currentPosition()),f}function k(g){const x=g.context(),y=r(6,x.offset,x.startLoc);let f=g.nextToken();if(f.type===8){const E=u(g);y.modifier=E.node,f=E.nextConsumeToken||g.nextToken()}switch(f.type!==9&&n(g,te.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,Je(f)),f=g.nextToken(),f.type===2&&(f=g.nextToken()),f.type){case 10:f.value==null&&n(g,te.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,Je(f)),y.key=p(g,f.value||"");break;case 4:f.value==null&&n(g,te.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,Je(f)),y.key=c(g,f.value||"");break;case 5:f.value==null&&n(g,te.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,Je(f)),y.key=s(g,f.value||"");break;case 6:f.value==null&&n(g,te.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,Je(f)),y.key=d(g,f.value||"");break;default:{n(g,te.UNEXPECTED_EMPTY_LINKED_KEY,x.lastStartLoc,0);const E=g.context(),N=r(7,E.offset,E.startLoc);return N.value="",o(N,E.offset,E.startLoc),y.key=N,o(y,E.offset,E.startLoc),{nextConsumeToken:f,node:y}}}return o(y,g.currentOffset(),g.currentPosition()),{node:y}}function m(g){const x=g.context(),y=x.currentType===1?g.currentOffset():x.offset,f=x.currentType===1?x.endLoc:x.startLoc,E=r(2,y,f);E.items=[];let N=null;do{const K=N||g.nextToken();switch(N=null,K.type){case 0:K.value==null&&n(g,te.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,Je(K)),E.items.push(i(g,K.value||""));break;case 5:K.value==null&&n(g,te.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,Je(K)),E.items.push(s(g,K.value||""));break;case 4:K.value==null&&n(g,te.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,Je(K)),E.items.push(c(g,K.value||""));break;case 6:K.value==null&&n(g,te.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,Je(K)),E.items.push(d(g,K.value||""));break;case 7:{const H=k(g);E.items.push(H.node),N=H.nextConsumeToken||null;break}}}while(x.currentType!==13&&x.currentType!==1);const V=x.currentType===1?x.lastOffset:g.currentOffset(),$=x.currentType===1?x.lastEndLoc:g.currentPosition();return o(E,V,$),E}function w(g,x,y,f){const E=g.context();let N=f.items.length===0;const V=r(1,x,y);V.cases=[],V.cases.push(f);do{const $=m(g);N||(N=$.items.length===0),V.cases.push($)}while(E.currentType!==13);return N&&n(g,te.MUST_HAVE_MESSAGES_IN_PLURAL,y,0),o(V,g.currentOffset(),g.currentPosition()),V}function b(g){const x=g.context(),{offset:y,startLoc:f}=x,E=m(g);return x.currentType===13?E:w(g,y,f,E)}function h(g){const x=Xr(g,Be({},l)),y=x.context(),f=r(0,y.offset,y.startLoc);return t&&f.loc&&(f.loc.source=g),f.body=b(x),l.onCacheKey&&(f.cacheKey=l.onCacheKey(g)),y.currentType!==13&&n(x,te.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,g[y.offset]||""),o(f,x.currentOffset(),x.currentPosition()),f}return{parse:h}}function Je(l){if(l.type===13)return"EOF";const t=(l.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function to(l,t={}){const a={ast:l,helpers:new Set};return{context:()=>a,helper:o=>(a.helpers.add(o),o)}}function Na(l,t){for(let a=0;a<l.length;a++)Ll(l[a],t)}function Ll(l,t){switch(l.type){case 1:Na(l.cases,t),t.helper("plural");break;case 2:Na(l.items,t);break;case 6:{Ll(l.key,t),t.helper("linked"),t.helper("type");break}case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named");break}}function lo(l,t={}){const a=to(l);a.helper("normalize"),l.body&&Ll(l.body,a);const n=a.context();l.helpers=Array.from(n.helpers)}function ao(l){const t=l.body;return t.type===2?Ba(t):t.cases.forEach(a=>Ba(a)),l}function Ba(l){if(l.items.length===1){const t=l.items[0];(t.type===3||t.type===9)&&(l.static=t.value,delete t.value)}else{const t=[];for(let a=0;a<l.items.length;a++){const n=l.items[a];if(!(n.type===3||n.type===9)||n.value==null)break;t.push(n.value)}if(t.length===l.items.length){l.static=Al(t);for(let a=0;a<l.items.length;a++){const n=l.items[a];(n.type===3||n.type===9)&&delete n.value}}}}const no="minifier";function Dt(l){switch(l.t=l.type,l.type){case 0:{const t=l;Dt(t.body),t.b=t.body,delete t.body;break}case 1:{const t=l,a=t.cases;for(let n=0;n<a.length;n++)Dt(a[n]);t.c=a,delete t.cases;break}case 2:{const t=l,a=t.items;for(let n=0;n<a.length;n++)Dt(a[n]);t.i=a,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=l;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=l;Dt(t.key),t.k=t.key,delete t.key,t.modifier&&(Dt(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=l;t.i=t.index,delete t.index;break}case 4:{const t=l;t.k=t.key,delete t.key;break}default:if(process.env.NODE_ENV!=="production")throw At(te.UNHANDLED_MINIFIER_NODE_TYPE,null,{domain:no,args:[l.type]})}delete l.type}const ro="parser";function oo(l,t){const{sourceMap:a,filename:n,breakLineCode:r,needIndent:o}=t,i=t.location!==!1,s={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:o,indentLevel:0};i&&l.loc&&(s.source=l.loc.source);const c=()=>s;function d(h,g){s.code+=h}function u(h,g=!0){const x=g?r:"";d(o?x+" ".repeat(h):x)}function p(h=!0){const g=++s.indentLevel;h&&u(g)}function k(h=!0){const g=--s.indentLevel;h&&u(g)}function m(){u(s.indentLevel)}return{context:c,push:d,indent:p,deindent:k,newline:m,helper:h=>`_${h}`,needIndent:()=>s.needIndent}}function so(l,t){const{helper:a}=l;l.push(`${a("linked")}(`),Lt(l,t.key),t.modifier?(l.push(", "),Lt(l,t.modifier),l.push(", _type")):l.push(", undefined, _type"),l.push(")")}function io(l,t){const{helper:a,needIndent:n}=l;l.push(`${a("normalize")}([`),l.indent(n());const r=t.items.length;for(let o=0;o<r&&(Lt(l,t.items[o]),o!==r-1);o++)l.push(", ");l.deindent(n()),l.push("])")}function co(l,t){const{helper:a,needIndent:n}=l;if(t.cases.length>1){l.push(`${a("plural")}([`),l.indent(n());const r=t.cases.length;for(let o=0;o<r&&(Lt(l,t.cases[o]),o!==r-1);o++)l.push(", ");l.deindent(n()),l.push("])")}}function uo(l,t){t.body?Lt(l,t.body):l.push("null")}function Lt(l,t){const{helper:a}=l;switch(t.type){case 0:uo(l,t);break;case 1:co(l,t);break;case 2:io(l,t);break;case 6:so(l,t);break;case 8:l.push(JSON.stringify(t.value),t);break;case 7:l.push(JSON.stringify(t.value),t);break;case 5:l.push(`${a("interpolate")}(${a("list")}(${t.index}))`,t);break;case 4:l.push(`${a("interpolate")}(${a("named")}(${JSON.stringify(t.key)}))`,t);break;case 9:l.push(JSON.stringify(t.value),t);break;case 3:l.push(JSON.stringify(t.value),t);break;default:if(process.env.NODE_ENV!=="production")throw At(te.UNHANDLED_CODEGEN_NODE_TYPE,null,{domain:ro,args:[t.type]})}}const po=(l,t={})=>{const a=X(t.mode)?t.mode:"normal",n=X(t.filename)?t.filename:"message.intl",r=!!t.sourceMap,o=t.breakLineCode!=null?t.breakLineCode:a==="arrow"?";":`
|
|
137
|
-
`,
|
|
175
|
+
*/function ki(l,t,a){return{line:l,column:t,offset:a}}function Xa(l,t,a){return{start:l,end:t}}const ce={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},xi=17,wi={[ce.EXPECTED_TOKEN]:"Expected token: '{0}'",[ce.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[ce.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[ce.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[ce.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[ce.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[ce.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[ce.EMPTY_PLACEHOLDER]:"Empty placeholder",[ce.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[ce.INVALID_LINKED_FORMAT]:"Invalid linked format",[ce.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[ce.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[ce.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[ce.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[ce.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[ce.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function yl(l,t,a={}){const{domain:r,messages:n,args:o}=a,s=process.env.NODE_ENV!=="production"?ta((n||wi)[l]||"",...o||[]):l,i=new SyntaxError(String(s));return i.code=l,t&&(i.location=t),i.domain=r,i}function Ei(l){throw l}const _i=/<\/?[\w\s="/.':;#-\/]+>/,Vi=l=>_i.test(l),Ot=" ",Ci="\r",tt=`
|
|
176
|
+
`,Ni="\u2028",Bi="\u2029";function vi(l){const t=l;let a=0,r=1,n=1,o=0;const s=E=>t[E]===Ci&&t[E+1]===tt,i=E=>t[E]===tt,c=E=>t[E]===Bi,u=E=>t[E]===Ni,d=E=>s(E)||i(E)||c(E)||u(E),p=()=>a,m=()=>r,f=()=>n,g=()=>o,y=E=>s(E)||c(E)||u(E)?tt:t[E],w=()=>y(a),h=()=>y(a+o);function k(){return o=0,d(a)&&(r++,n=0),s(a)&&a++,a++,n++,t[a]}function x(){return s(a+o)&&o++,o++,t[a+o]}function b(){a=0,r=1,n=1,o=0}function _(E=0){o=E}function V(){const E=a+o;for(;E!==a;)k();o=0}return{index:p,line:m,column:f,peekOffset:g,charAt:y,currentChar:w,currentPeek:h,next:k,peek:x,reset:b,resetPeek:_,skipToPeek:V}}const Wt=void 0,Si=".",fn="'",Di="tokenizer";function Ai(l,t={}){const a=t.location!==!1,r=vi(l),n=()=>r.index(),o=()=>ki(r.line(),r.column(),r.index()),s=o(),i=n(),c={currentType:13,offset:i,startLoc:s,endLoc:s,lastType:13,lastOffset:i,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},u=()=>c,{onError:d}=t;function p(v,S,q,...re){const De=u();if(S.column+=q,S.offset+=q,d){const Ae=a?Xa(De.startLoc,S):null,ge=yl(v,Ae,{domain:Di,args:re});d(ge)}}function m(v,S,q){v.endLoc=o(),v.currentType=S;const re={type:S};return a&&(re.loc=Xa(v.startLoc,v.endLoc)),q!=null&&(re.value=q),re}const f=v=>m(v,13);function g(v,S){return v.currentChar()===S?(v.next(),S):(p(ce.EXPECTED_TOKEN,o(),0,S),"")}function y(v){let S="";for(;v.currentPeek()===Ot||v.currentPeek()===tt;)S+=v.currentPeek(),v.peek();return S}function w(v){const S=y(v);return v.skipToPeek(),S}function h(v){if(v===Wt)return!1;const S=v.charCodeAt(0);return S>=97&&S<=122||S>=65&&S<=90||S===95}function k(v){if(v===Wt)return!1;const S=v.charCodeAt(0);return S>=48&&S<=57}function x(v,S){const{currentType:q}=S;if(q!==2)return!1;y(v);const re=h(v.currentPeek());return v.resetPeek(),re}function b(v,S){const{currentType:q}=S;if(q!==2)return!1;y(v);const re=v.currentPeek()==="-"?v.peek():v.currentPeek(),De=k(re);return v.resetPeek(),De}function _(v,S){const{currentType:q}=S;if(q!==2)return!1;y(v);const re=v.currentPeek()===fn;return v.resetPeek(),re}function V(v,S){const{currentType:q}=S;if(q!==7)return!1;y(v);const re=v.currentPeek()===".";return v.resetPeek(),re}function E(v,S){const{currentType:q}=S;if(q!==8)return!1;y(v);const re=h(v.currentPeek());return v.resetPeek(),re}function D(v,S){const{currentType:q}=S;if(!(q===7||q===11))return!1;y(v);const re=v.currentPeek()===":";return v.resetPeek(),re}function $(v,S){const{currentType:q}=S;if(q!==9)return!1;const re=()=>{const Ae=v.currentPeek();return Ae==="{"?h(v.peek()):Ae==="@"||Ae==="|"||Ae===":"||Ae==="."||Ae===Ot||!Ae?!1:Ae===tt?(v.peek(),re()):B(v,!1)},De=re();return v.resetPeek(),De}function C(v){y(v);const S=v.currentPeek()==="|";return v.resetPeek(),S}function B(v,S=!0){const q=(De=!1,Ae="")=>{const ge=v.currentPeek();return ge==="{"||ge==="@"||!ge?De:ge==="|"?!(Ae===Ot||Ae===tt):ge===Ot?(v.peek(),q(!0,Ot)):ge===tt?(v.peek(),q(!0,tt)):!0},re=q();return S&&v.resetPeek(),re}function M(v,S){const q=v.currentChar();return q===Wt?Wt:S(q)?(v.next(),q):null}function U(v){const S=v.charCodeAt(0);return S>=97&&S<=122||S>=65&&S<=90||S>=48&&S<=57||S===95||S===36}function P(v){return M(v,U)}function I(v){const S=v.charCodeAt(0);return S>=97&&S<=122||S>=65&&S<=90||S>=48&&S<=57||S===95||S===36||S===45}function O(v){return M(v,I)}function F(v){const S=v.charCodeAt(0);return S>=48&&S<=57}function H(v){return M(v,F)}function Q(v){const S=v.charCodeAt(0);return S>=48&&S<=57||S>=65&&S<=70||S>=97&&S<=102}function pe(v){return M(v,Q)}function Ve(v){let S="",q="";for(;S=H(v);)q+=S;return q}function ze(v){let S="";for(;;){const q=v.currentChar();if(q==="{"||q==="}"||q==="@"||q==="|"||!q)break;if(q===Ot||q===tt)if(B(v))S+=q,v.next();else{if(C(v))break;S+=q,v.next()}else S+=q,v.next()}return S}function Kt(v){w(v);let S="",q="";for(;S=O(v);)q+=S;return v.currentChar()===Wt&&p(ce.UNTERMINATED_CLOSING_BRACE,o(),0),q}function Le(v){w(v);let S="";return v.currentChar()==="-"?(v.next(),S+=`-${Ve(v)}`):S+=Ve(v),v.currentChar()===Wt&&p(ce.UNTERMINATED_CLOSING_BRACE,o(),0),S}function qe(v){return v!==fn&&v!==tt}function Ct(v){w(v),g(v,"'");let S="",q="";for(;S=M(v,qe);)S==="\\"?q+=yt(v):q+=S;const re=v.currentChar();return re===tt||re===Wt?(p(ce.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,o(),0),re===tt&&(v.next(),g(v,"'")),q):(g(v,"'"),q)}function yt(v){const S=v.currentChar();switch(S){case"\\":case"'":return v.next(),`\\${S}`;case"u":return wt(v,S,4);case"U":return wt(v,S,6);default:return p(ce.UNKNOWN_ESCAPE_SEQUENCE,o(),0,S),""}}function wt(v,S,q){g(v,S);let re="";for(let De=0;De<q;De++){const Ae=pe(v);if(!Ae){p(ce.INVALID_UNICODE_ESCAPE_SEQUENCE,o(),0,`\\${S}${re}${v.currentChar()}`);break}re+=Ae}return`\\${S}${re}`}function Lt(v){return v!=="{"&&v!=="}"&&v!==Ot&&v!==tt}function et(v){w(v);let S="",q="";for(;S=M(v,Lt);)q+=S;return q}function at(v){let S="",q="";for(;S=P(v);)q+=S;return q}function z(v){const S=q=>{const re=v.currentChar();return re==="{"||re==="@"||re==="|"||re==="("||re===")"||!re||re===Ot?q:(q+=re,v.next(),S(q))};return S("")}function X(v){w(v);const S=g(v,"|");return w(v),S}function te(v,S){let q=null;switch(v.currentChar()){case"{":return S.braceNest>=1&&p(ce.NOT_ALLOW_NEST_PLACEHOLDER,o(),0),v.next(),q=m(S,2,"{"),w(v),S.braceNest++,q;case"}":return S.braceNest>0&&S.currentType===2&&p(ce.EMPTY_PLACEHOLDER,o(),0),v.next(),q=m(S,3,"}"),S.braceNest--,S.braceNest>0&&w(v),S.inLinked&&S.braceNest===0&&(S.inLinked=!1),q;case"@":return S.braceNest>0&&p(ce.UNTERMINATED_CLOSING_BRACE,o(),0),q=le(v,S)||f(S),S.braceNest=0,q;default:{let De=!0,Ae=!0,ge=!0;if(C(v))return S.braceNest>0&&p(ce.UNTERMINATED_CLOSING_BRACE,o(),0),q=m(S,1,X(v)),S.braceNest=0,S.inLinked=!1,q;if(S.braceNest>0&&(S.currentType===4||S.currentType===5||S.currentType===6))return p(ce.UNTERMINATED_CLOSING_BRACE,o(),0),S.braceNest=0,de(v,S);if(De=x(v,S))return q=m(S,4,Kt(v)),w(v),q;if(Ae=b(v,S))return q=m(S,5,Le(v)),w(v),q;if(ge=_(v,S))return q=m(S,6,Ct(v)),w(v),q;if(!De&&!Ae&&!ge)return q=m(S,12,et(v)),p(ce.INVALID_TOKEN_IN_PLACEHOLDER,o(),0,q.value),w(v),q;break}}return q}function le(v,S){const{currentType:q}=S;let re=null;const De=v.currentChar();switch((q===7||q===8||q===11||q===9)&&(De===tt||De===Ot)&&p(ce.INVALID_LINKED_FORMAT,o(),0),De){case"@":return v.next(),re=m(S,7,"@"),S.inLinked=!0,re;case".":return w(v),v.next(),m(S,8,".");case":":return w(v),v.next(),m(S,9,":");default:return C(v)?(re=m(S,1,X(v)),S.braceNest=0,S.inLinked=!1,re):V(v,S)||D(v,S)?(w(v),le(v,S)):E(v,S)?(w(v),m(S,11,at(v))):$(v,S)?(w(v),De==="{"?te(v,S)||re:m(S,10,z(v))):(q===7&&p(ce.INVALID_LINKED_FORMAT,o(),0),S.braceNest=0,S.inLinked=!1,de(v,S))}}function de(v,S){let q={type:13};if(S.braceNest>0)return te(v,S)||f(S);if(S.inLinked)return le(v,S)||f(S);switch(v.currentChar()){case"{":return te(v,S)||f(S);case"}":return p(ce.UNBALANCED_CLOSING_BRACE,o(),0),v.next(),m(S,3,"}");case"@":return le(v,S)||f(S);default:{if(C(v))return q=m(S,1,X(v)),S.braceNest=0,S.inLinked=!1,q;if(B(v))return m(S,0,ze(v));break}}return q}function Se(){const{currentType:v,offset:S,startLoc:q,endLoc:re}=c;return c.lastType=v,c.lastOffset=S,c.lastStartLoc=q,c.lastEndLoc=re,c.offset=n(),c.startLoc=o(),r.currentChar()===Wt?m(c,13):de(r,c)}return{nextToken:Se,currentOffset:n,currentPosition:o,context:u}}const Mi="parser",Ti=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function $i(l,t,a){switch(l){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(t||a,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function Li(l={}){const t=l.location!==!1,{onError:a}=l;function r(h,k,x,b,..._){const V=h.currentPosition();if(V.offset+=b,V.column+=b,a){const E=t?Xa(x,V):null,D=yl(k,E,{domain:Mi,args:_});a(D)}}function n(h,k,x){const b={type:h};return t&&(b.start=k,b.end=k,b.loc={start:x,end:x}),b}function o(h,k,x,b){t&&(h.end=k,h.loc&&(h.loc.end=x))}function s(h,k){const x=h.context(),b=n(3,x.offset,x.startLoc);return b.value=k,o(b,h.currentOffset(),h.currentPosition()),b}function i(h,k){const x=h.context(),{lastOffset:b,lastStartLoc:_}=x,V=n(5,b,_);return V.index=parseInt(k,10),h.nextToken(),o(V,h.currentOffset(),h.currentPosition()),V}function c(h,k){const x=h.context(),{lastOffset:b,lastStartLoc:_}=x,V=n(4,b,_);return V.key=k,h.nextToken(),o(V,h.currentOffset(),h.currentPosition()),V}function u(h,k){const x=h.context(),{lastOffset:b,lastStartLoc:_}=x,V=n(9,b,_);return V.value=k.replace(Ti,$i),h.nextToken(),o(V,h.currentOffset(),h.currentPosition()),V}function d(h){const k=h.nextToken(),x=h.context(),{lastOffset:b,lastStartLoc:_}=x,V=n(8,b,_);return k.type!==11?(r(h,ce.UNEXPECTED_EMPTY_LINKED_MODIFIER,x.lastStartLoc,0),V.value="",o(V,b,_),{nextConsumeToken:k,node:V}):(k.value==null&&r(h,ce.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,Bt(k)),V.value=k.value||"",o(V,h.currentOffset(),h.currentPosition()),{node:V})}function p(h,k){const x=h.context(),b=n(7,x.offset,x.startLoc);return b.value=k,o(b,h.currentOffset(),h.currentPosition()),b}function m(h){const k=h.context(),x=n(6,k.offset,k.startLoc);let b=h.nextToken();if(b.type===8){const _=d(h);x.modifier=_.node,b=_.nextConsumeToken||h.nextToken()}switch(b.type!==9&&r(h,ce.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,Bt(b)),b=h.nextToken(),b.type===2&&(b=h.nextToken()),b.type){case 10:b.value==null&&r(h,ce.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,Bt(b)),x.key=p(h,b.value||"");break;case 4:b.value==null&&r(h,ce.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,Bt(b)),x.key=c(h,b.value||"");break;case 5:b.value==null&&r(h,ce.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,Bt(b)),x.key=i(h,b.value||"");break;case 6:b.value==null&&r(h,ce.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,Bt(b)),x.key=u(h,b.value||"");break;default:{r(h,ce.UNEXPECTED_EMPTY_LINKED_KEY,k.lastStartLoc,0);const _=h.context(),V=n(7,_.offset,_.startLoc);return V.value="",o(V,_.offset,_.startLoc),x.key=V,o(x,_.offset,_.startLoc),{nextConsumeToken:b,node:x}}}return o(x,h.currentOffset(),h.currentPosition()),{node:x}}function f(h){const k=h.context(),x=k.currentType===1?h.currentOffset():k.offset,b=k.currentType===1?k.endLoc:k.startLoc,_=n(2,x,b);_.items=[];let V=null;do{const $=V||h.nextToken();switch(V=null,$.type){case 0:$.value==null&&r(h,ce.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,Bt($)),_.items.push(s(h,$.value||""));break;case 5:$.value==null&&r(h,ce.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,Bt($)),_.items.push(i(h,$.value||""));break;case 4:$.value==null&&r(h,ce.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,Bt($)),_.items.push(c(h,$.value||""));break;case 6:$.value==null&&r(h,ce.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,Bt($)),_.items.push(u(h,$.value||""));break;case 7:{const C=m(h);_.items.push(C.node),V=C.nextConsumeToken||null;break}}}while(k.currentType!==13&&k.currentType!==1);const E=k.currentType===1?k.lastOffset:h.currentOffset(),D=k.currentType===1?k.lastEndLoc:h.currentPosition();return o(_,E,D),_}function g(h,k,x,b){const _=h.context();let V=b.items.length===0;const E=n(1,k,x);E.cases=[],E.cases.push(b);do{const D=f(h);V||(V=D.items.length===0),E.cases.push(D)}while(_.currentType!==13);return V&&r(h,ce.MUST_HAVE_MESSAGES_IN_PLURAL,x,0),o(E,h.currentOffset(),h.currentPosition()),E}function y(h){const k=h.context(),{offset:x,startLoc:b}=k,_=f(h);return k.currentType===13?_:g(h,x,b,_)}function w(h){const k=Ai(h,Ke({},l)),x=k.context(),b=n(0,x.offset,x.startLoc);return t&&b.loc&&(b.loc.source=h),b.body=y(k),l.onCacheKey&&(b.cacheKey=l.onCacheKey(h)),x.currentType!==13&&r(k,ce.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,h[x.offset]||""),o(b,k.currentOffset(),k.currentPosition()),b}return{parse:w}}function Bt(l){if(l.type===13)return"EOF";const t=(l.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function Fi(l,t={}){const a={ast:l,helpers:new Set};return{context:()=>a,helper:o=>(a.helpers.add(o),o)}}function hn(l,t){for(let a=0;a<l.length;a++)Za(l[a],t)}function Za(l,t){switch(l.type){case 1:hn(l.cases,t),t.helper("plural");break;case 2:hn(l.items,t);break;case 6:{Za(l.key,t),t.helper("linked"),t.helper("type");break}case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named");break}}function Ii(l,t={}){const a=Fi(l);a.helper("normalize"),l.body&&Za(l.body,a);const r=a.context();l.helpers=Array.from(r.helpers)}function Oi(l){const t=l.body;return t.type===2?gn(t):t.cases.forEach(a=>gn(a)),l}function gn(l){if(l.items.length===1){const t=l.items[0];(t.type===3||t.type===9)&&(l.static=t.value,delete t.value)}else{const t=[];for(let a=0;a<l.items.length;a++){const r=l.items[a];if(!(r.type===3||r.type===9)||r.value==null)break;t.push(r.value)}if(t.length===l.items.length){l.static=Ya(t);for(let a=0;a<l.items.length;a++){const r=l.items[a];(r.type===3||r.type===9)&&delete r.value}}}}const Pi="minifier";function bl(l){switch(l.t=l.type,l.type){case 0:{const t=l;bl(t.body),t.b=t.body,delete t.body;break}case 1:{const t=l,a=t.cases;for(let r=0;r<a.length;r++)bl(a[r]);t.c=a,delete t.cases;break}case 2:{const t=l,a=t.items;for(let r=0;r<a.length;r++)bl(a[r]);t.i=a,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=l;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=l;bl(t.key),t.k=t.key,delete t.key,t.modifier&&(bl(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=l;t.i=t.index,delete t.index;break}case 4:{const t=l;t.k=t.key,delete t.key;break}default:if(process.env.NODE_ENV!=="production")throw yl(ce.UNHANDLED_MINIFIER_NODE_TYPE,null,{domain:Pi,args:[l.type]})}delete l.type}const Ri="parser";function ji(l,t){const{filename:a,breakLineCode:r,needIndent:n}=t,o=t.location!==!1,s={filename:a,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:n,indentLevel:0};o&&l.loc&&(s.source=l.loc.source);const i=()=>s;function c(y,w){s.code+=y}function u(y,w=!0){const h=w?r:"";c(n?h+" ".repeat(y):h)}function d(y=!0){const w=++s.indentLevel;y&&u(w)}function p(y=!0){const w=--s.indentLevel;y&&u(w)}function m(){u(s.indentLevel)}return{context:i,push:c,indent:d,deindent:p,newline:m,helper:y=>`_${y}`,needIndent:()=>s.needIndent}}function Ui(l,t){const{helper:a}=l;l.push(`${a("linked")}(`),kl(l,t.key),t.modifier?(l.push(", "),kl(l,t.modifier),l.push(", _type")):l.push(", undefined, _type"),l.push(")")}function zi(l,t){const{helper:a,needIndent:r}=l;l.push(`${a("normalize")}([`),l.indent(r());const n=t.items.length;for(let o=0;o<n&&(kl(l,t.items[o]),o!==n-1);o++)l.push(", ");l.deindent(r()),l.push("])")}function Hi(l,t){const{helper:a,needIndent:r}=l;if(t.cases.length>1){l.push(`${a("plural")}([`),l.indent(r());const n=t.cases.length;for(let o=0;o<n&&(kl(l,t.cases[o]),o!==n-1);o++)l.push(", ");l.deindent(r()),l.push("])")}}function Ki(l,t){t.body?kl(l,t.body):l.push("null")}function kl(l,t){const{helper:a}=l;switch(t.type){case 0:Ki(l,t);break;case 1:Hi(l,t);break;case 2:zi(l,t);break;case 6:Ui(l,t);break;case 8:l.push(JSON.stringify(t.value),t);break;case 7:l.push(JSON.stringify(t.value),t);break;case 5:l.push(`${a("interpolate")}(${a("list")}(${t.index}))`,t);break;case 4:l.push(`${a("interpolate")}(${a("named")}(${JSON.stringify(t.key)}))`,t);break;case 9:l.push(JSON.stringify(t.value),t);break;case 3:l.push(JSON.stringify(t.value),t);break;default:if(process.env.NODE_ENV!=="production")throw yl(ce.UNHANDLED_CODEGEN_NODE_TYPE,null,{domain:Ri,args:[t.type]})}}const qi=(l,t={})=>{const a=ae(t.mode)?t.mode:"normal",r=ae(t.filename)?t.filename:"message.intl";t.sourceMap;const n=t.breakLineCode!=null?t.breakLineCode:a==="arrow"?";":`
|
|
177
|
+
`,o=t.needIndent?t.needIndent:a!=="arrow",s=l.helpers||[],i=ji(l,{filename:r,breakLineCode:n,needIndent:o});i.push(a==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),i.indent(o),s.length>0&&(i.push(`const { ${Ya(s.map(d=>`${d}: _${d}`),", ")} } = ctx`),i.newline()),i.push("return "),kl(i,l),i.deindent(o),i.push("}"),delete l.helpers;const{code:c,map:u}=i.context();return{ast:l,code:c,map:u?u.toJSON():void 0}};function Gi(l,t={}){const a=Ke({},t),r=!!a.jit,n=!!a.minify,o=a.optimize==null?!0:a.optimize,i=Li(a).parse(l);return r?(o&&Oi(i),n&&bl(i),{ast:i,code:""}):(Ii(i,a),qi(i,a))}/*!
|
|
138
178
|
* core-base v11.1.5
|
|
139
179
|
* (c) 2025 kazuya kawaguchi
|
|
140
180
|
* Released under the MIT License.
|
|
141
|
-
*/function fo(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(wt().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(wt().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Ye(l){return de(l)&&Ml(l)===0&&(We(l,"b")||We(l,"body"))}const Sa=["b","body"];function ho(l){return ft(l,Sa)}const Aa=["c","cases"];function go(l){return ft(l,Aa,[])}const Da=["s","static"];function ko(l){return ft(l,Da)}const La=["i","items"];function yo(l){return ft(l,La,[])}const Ma=["t","type"];function Ml(l){return ft(l,Ma)}const Ta=["v","value"];function ol(l,t){const a=ft(l,Ta);if(a!=null)return a;throw vt(t)}const Fa=["m","modifier"];function bo(l){return ft(l,Fa)}const Ia=["k","key"];function xo(l){const t=ft(l,Ia);if(t)return t;throw vt(6)}function ft(l,t,a){for(let n=0;n<t.length;n++){const r=t[n];if(We(l,r)&&l[r]!=null)return l[r]}return a}const Oa=[...Sa,...Aa,...Da,...La,...Ia,...Fa,...Ta,...Ma];function vt(l){return new Error(`unhandled node type: ${l}`)}function Tl(l){return a=>wo(a,l)}function wo(l,t){const a=ho(t);if(a==null)throw vt(0);if(Ml(a)===1){const o=go(a);return l.plural(o.reduce((i,s)=>[...i,$a(l,s)],[]))}else return $a(l,a)}function $a(l,t){const a=ko(t);if(a!=null)return l.type==="text"?a:l.normalize([a]);{const n=yo(t).reduce((r,o)=>[...r,Fl(l,o)],[]);return l.normalize(n)}}function Fl(l,t){const a=Ml(t);switch(a){case 3:return ol(t,a);case 9:return ol(t,a);case 4:{const n=t;if(We(n,"k")&&n.k)return l.interpolate(l.named(n.k));if(We(n,"key")&&n.key)return l.interpolate(l.named(n.key));throw vt(a)}case 5:{const n=t;if(We(n,"i")&&Ne(n.i))return l.interpolate(l.list(n.i));if(We(n,"index")&&Ne(n.index))return l.interpolate(l.list(n.index));throw vt(a)}case 6:{const n=t,r=bo(n),o=xo(n);return l.linked(Fl(l,o),r?Fl(l,r):void 0,l.type)}case 7:return ol(t,a);case 8:return ol(t,a);default:throw new Error(`unhandled node on format message part: ${a}`)}}const Eo="Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.";function _o(l,t){t&&zr(l)&&pt(tl(Eo,{source:l}))}const Co=l=>l;let sl=fe();function Vo(l,t={}){let a=!1;const n=t.onError||Ur;return t.onError=r=>{a=!0,n(r)},{...mo(l,t),detectError:a}}function No(l,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&X(l)){const a=Ee(t.warnHtmlMessage)?t.warnHtmlMessage:!0;process.env.NODE_ENV!=="production"&&_o(l,a);const r=(t.onCacheKey||Co)(l),o=sl[r];if(o)return o;const{ast:i,detectError:s}=Vo(l,{...t,location:process.env.NODE_ENV!=="production",jit:!0}),c=Tl(i);return s?c:sl[r]=c}else{if(process.env.NODE_ENV!=="production"&&!Ye(l))return pt(`the message that is resolve with key '${t.key}' is not supported for jit compilation`),()=>l;const a=l.cacheKey;if(a){const n=sl[a];return n||(sl[a]=Tl(l))}else return Tl(l)}}let Rt=null;function Bo(l){Rt=l}function So(l,t,a){Rt&&Rt.emit("i18n:init",{timestamp:Date.now(),i18n:l,version:t,meta:a})}const Ao=Do("function:translate");function Do(l){return t=>Rt&&Rt.emit(l,t)}const Me={INVALID_ARGUMENT:Rr,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},Lo=24;function it(l){return At(l,null,process.env.NODE_ENV!=="production"?{messages:Mo}:void 0)}const Mo={[Me.INVALID_ARGUMENT]:"Invalid arguments",[Me.INVALID_DATE_ARGUMENT]:"The date provided is an invalid Date object.Make sure your Date represents a valid date.",[Me.INVALID_ISO_DATE_ARGUMENT]:"The argument provided is not a valid ISO date string",[Me.NOT_SUPPORT_NON_STRING_MESSAGE]:"Not support non-string message",[Me.NOT_SUPPORT_LOCALE_PROMISE_VALUE]:"cannot support promise value",[Me.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]:"cannot support async function",[Me.NOT_SUPPORT_LOCALE_TYPE]:"cannot support locale type"};function Il(l,t){return t.locale!=null?va(t.locale):va(l.locale)}let Ol;function va(l){if(X(l))return l;if(ye(l)){if(l.resolvedOnce&&Ol!=null)return Ol;if(l.constructor.name==="Function"){const t=l();if(Tr(t))throw it(Me.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Ol=t}else throw it(Me.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw it(Me.NOT_SUPPORT_LOCALE_TYPE)}function To(l,t,a){return[...new Set([a,...we(t)?t:de(t)?Object.keys(t):X(t)?[t]:[a]])]}function Ra(l,t,a){const n=X(a)?a:cl,r=l;r.__localeChainCache||(r.__localeChainCache=new Map);let o=r.__localeChainCache.get(n);if(!o){o=[];let i=[a];for(;we(i);)i=Pa(o,i,t);const s=we(t)||!ue(t)?t:t.default?t.default:null;i=X(s)?[s]:s,we(i)&&Pa(o,i,!1),r.__localeChainCache.set(n,o)}return o}function Pa(l,t,a){let n=!0;for(let r=0;r<t.length&&Ee(n);r++){const o=t[r];X(o)&&(n=Fo(l,t[r],a))}return n}function Fo(l,t,a){let n;const r=t.split("-");do{const o=r.join("-");n=Io(l,o,a),r.splice(-1,1)}while(r.length&&n===!0);return n}function Io(l,t,a){let n=!1;if(!l.includes(t)&&(n=!0,t)){n=t[t.length-1]!=="!";const r=t.replace(/!/g,"");l.push(r),(we(a)||ue(a))&&a[r]&&(n=a[r])}return n}const ht=[];ht[0]={w:[0],i:[3,0],"[":[4],o:[7]},ht[1]={w:[1],".":[2],"[":[4],o:[7]},ht[2]={w:[2],i:[3,0],0:[3,0]},ht[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},ht[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},ht[5]={"'":[4,0],o:8,l:[5,0]},ht[6]={'"':[4,0],o:8,l:[6,0]};const Oo=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function $o(l){return Oo.test(l)}function vo(l){const t=l.charCodeAt(0),a=l.charCodeAt(l.length-1);return t===a&&(t===34||t===39)?l.slice(1,-1):l}function Ro(l){if(l==null)return"o";switch(l.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return l;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function Po(l){const t=l.trim();return l.charAt(0)==="0"&&isNaN(parseInt(l))?!1:$o(t)?vo(t):"*"+t}function Uo(l){const t=[];let a=-1,n=0,r=0,o,i,s,c,d,u,p;const k=[];k[0]=()=>{i===void 0?i=s:i+=s},k[1]=()=>{i!==void 0&&(t.push(i),i=void 0)},k[2]=()=>{k[0](),r++},k[3]=()=>{if(r>0)r--,n=4,k[0]();else{if(r=0,i===void 0||(i=Po(i),i===!1))return!1;k[1]()}};function m(){const w=l[a+1];if(n===5&&w==="'"||n===6&&w==='"')return a++,s="\\"+w,k[0](),!0}for(;n!==null;)if(a++,o=l[a],!(o==="\\"&&m())){if(c=Ro(o),p=ht[n],d=p[c]||p.l||8,d===8||(n=d[0],d[1]!==void 0&&(u=k[d[1]],u&&(s=o,u()===!1))))return;if(n===7)return t}}const Ua=new Map;function jo(l,t){return de(l)?l[t]:null}function zo(l,t){if(!de(l))return null;let a=Ua.get(t);if(a||(a=Uo(t),a&&Ua.set(t,a)),!a)return null;const n=a.length;let r=l,o=0;for(;o<n;){const i=a[o];if(Oa.includes(i)&&Ye(r))return null;const s=r[i];if(s===void 0||ye(r))return null;r=s,o++}return r}const Oe={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7},Ho=8,Ko={[Oe.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[Oe.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[Oe.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[Oe.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[Oe.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[Oe.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[Oe.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function Et(l,...t){return tl(Ko[l],...t)}const Go="11.1.5",il=-1,cl="en-US",dl="",ja=l=>`${l.charAt(0).toLocaleUpperCase()}${l.substr(1)}`;function Wo(){return{upper:(l,t)=>t==="text"&&X(l)?l.toUpperCase():t==="vnode"&&de(l)&&"__v_isVNode"in l?l.children.toUpperCase():l,lower:(l,t)=>t==="text"&&X(l)?l.toLowerCase():t==="vnode"&&de(l)&&"__v_isVNode"in l?l.children.toLowerCase():l,capitalize:(l,t)=>t==="text"&&X(l)?ja(l):t==="vnode"&&de(l)&&"__v_isVNode"in l?ja(l.children):l}}let za;function Yo(l){za=l}let Ha;function qo(l){Ha=l}let Ka;function Xo(l){Ka=l}let Ga=null;const Zo=l=>{Ga=l},Jo=()=>Ga;let Wa=null;const Ya=l=>{Wa=l},Qo=()=>Wa;let qa=0;function es(l={}){const t=ye(l.onWarn)?l.onWarn:pt,a=X(l.version)?l.version:Go,n=X(l.locale)||ye(l.locale)?l.locale:cl,r=ye(n)?cl:n,o=we(l.fallbackLocale)||ue(l.fallbackLocale)||X(l.fallbackLocale)||l.fallbackLocale===!1?l.fallbackLocale:r,i=ue(l.messages)?l.messages:$l(r),s=ue(l.datetimeFormats)?l.datetimeFormats:$l(r),c=ue(l.numberFormats)?l.numberFormats:$l(r),d=Be(fe(),l.modifiers,Wo()),u=l.pluralRules||fe(),p=ye(l.missing)?l.missing:null,k=Ee(l.missingWarn)||ll(l.missingWarn)?l.missingWarn:!0,m=Ee(l.fallbackWarn)||ll(l.fallbackWarn)?l.fallbackWarn:!0,w=!!l.fallbackFormat,b=!!l.unresolving,h=ye(l.postTranslation)?l.postTranslation:null,g=ue(l.processor)?l.processor:null,x=Ee(l.warnHtmlMessage)?l.warnHtmlMessage:!0,y=!!l.escapeParameter,f=ye(l.messageCompiler)?l.messageCompiler:za;process.env.NODE_ENV!=="production"&&ye(l.messageCompiler)&&Or(Et(Oe.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));const E=ye(l.messageResolver)?l.messageResolver:Ha||jo,N=ye(l.localeFallbacker)?l.localeFallbacker:Ka||To,V=de(l.fallbackContext)?l.fallbackContext:void 0,$=l,K=de($.__datetimeFormatters)?$.__datetimeFormatters:new Map,H=de($.__numberFormatters)?$.__numberFormatters:new Map,v=de($.__meta)?$.__meta:{};qa++;const W={version:a,cid:qa,locale:n,fallbackLocale:o,messages:i,modifiers:d,pluralRules:u,missing:p,missingWarn:k,fallbackWarn:m,fallbackFormat:w,unresolving:b,postTranslation:h,processor:g,warnHtmlMessage:x,escapeParameter:y,messageCompiler:f,messageResolver:E,localeFallbacker:N,fallbackContext:V,onWarn:t,__meta:v};return W.datetimeFormats=s,W.numberFormats=c,W.__datetimeFormatters=K,W.__numberFormatters=H,process.env.NODE_ENV!=="production"&&(W.__v_emitter=$.__v_emitter!=null?$.__v_emitter:void 0),(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__)&&So(W,a,v),W}const $l=l=>({[l]:fe()});function ul(l,t){return l instanceof RegExp?l.test(t):l}function Xa(l,t){return l instanceof RegExp?l.test(t):l}function vl(l,t,a,n,r){const{missing:o,onWarn:i}=l;if(process.env.NODE_ENV!=="production"){const s=l.__v_emitter;s&&s.emit("missing",{locale:a,key:t,type:r,groupId:`${r}:${t}`})}if(o!==null){const s=o(l,a,t,r);return X(s)?s:t}else return process.env.NODE_ENV!=="production"&&Xa(n,t)&&i(Et(Oe.NOT_FOUND_KEY,{key:t,locale:a})),t}function Pt(l,t,a){const n=l;n.__localeChainCache=new Map,l.localeFallbacker(l,a,t)}function Za(l,t){return l===t?!1:l.split("-")[0]===t.split("-")[0]}function ts(l,t){const a=t.indexOf(l);if(a===-1)return!1;for(let n=a+1;n<t.length;n++)if(Za(l,t[n]))return!0;return!1}const Ja=typeof Intl<"u",Qa={dateTimeFormat:Ja&&typeof Intl.DateTimeFormat<"u",numberFormat:Ja&&typeof Intl.NumberFormat<"u"};function en(l,...t){const{datetimeFormats:a,unresolving:n,fallbackLocale:r,onWarn:o,localeFallbacker:i}=l,{__datetimeFormatters:s}=l;if(process.env.NODE_ENV!=="production"&&!Qa.dateTimeFormat)return o(Et(Oe.CANNOT_FORMAT_DATE)),dl;const[c,d,u,p]=Rl(...t),k=Ee(u.missingWarn)?u.missingWarn:l.missingWarn,m=Ee(u.fallbackWarn)?u.fallbackWarn:l.fallbackWarn,w=!!u.part,b=Il(l,u),h=i(l,r,b);if(!X(c)||c==="")return new Intl.DateTimeFormat(b,p).format(d);let g={},x,y=null,f=b,E=null;const N="datetime format";for(let K=0;K<h.length;K++){if(x=E=h[K],process.env.NODE_ENV!=="production"&&b!==x&&ul(m,c)&&o(Et(Oe.FALLBACK_TO_DATE_FORMAT,{key:c,target:x})),process.env.NODE_ENV!=="production"&&b!==x){const H=l.__v_emitter;H&&H.emit("fallback",{type:N,key:c,from:f,to:E,groupId:`${N}:${c}`})}if(g=a[x]||{},y=g[c],ue(y))break;vl(l,c,x,k,N),f=E}if(!ue(y)||!X(x))return n?il:c;let V=`${x}__${c}`;al(p)||(V=`${V}__${JSON.stringify(p)}`);let $=s.get(V);return $||($=new Intl.DateTimeFormat(x,Be({},y,p)),s.set(V,$)),w?$.formatToParts(d):$.format(d)}const tn=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Rl(...l){const[t,a,n,r]=l,o=fe();let i=fe(),s;if(X(t)){const c=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!c)throw it(Me.INVALID_ISO_DATE_ARGUMENT);const d=c[3]?c[3].trim().startsWith("T")?`${c[1].trim()}${c[3].trim()}`:`${c[1].trim()}T${c[3].trim()}`:c[1].trim();s=new Date(d);try{s.toISOString()}catch{throw it(Me.INVALID_ISO_DATE_ARGUMENT)}}else if(Dr(t)){if(isNaN(t.getTime()))throw it(Me.INVALID_DATE_ARGUMENT);s=t}else if(Ne(t))s=t;else throw it(Me.INVALID_ARGUMENT);return X(a)?o.key=a:ue(a)&&Object.keys(a).forEach(c=>{tn.includes(c)?i[c]=a[c]:o[c]=a[c]}),X(n)?o.locale=n:ue(n)&&(i=n),ue(r)&&(i=r),[o.key||"",s,o,i]}function ln(l,t,a){const n=l;for(const r in a){const o=`${t}__${r}`;n.__datetimeFormatters.has(o)&&n.__datetimeFormatters.delete(o)}}function an(l,...t){const{numberFormats:a,unresolving:n,fallbackLocale:r,onWarn:o,localeFallbacker:i}=l,{__numberFormatters:s}=l;if(process.env.NODE_ENV!=="production"&&!Qa.numberFormat)return o(Et(Oe.CANNOT_FORMAT_NUMBER)),dl;const[c,d,u,p]=Pl(...t),k=Ee(u.missingWarn)?u.missingWarn:l.missingWarn,m=Ee(u.fallbackWarn)?u.fallbackWarn:l.fallbackWarn,w=!!u.part,b=Il(l,u),h=i(l,r,b);if(!X(c)||c==="")return new Intl.NumberFormat(b,p).format(d);let g={},x,y=null,f=b,E=null;const N="number format";for(let K=0;K<h.length;K++){if(x=E=h[K],process.env.NODE_ENV!=="production"&&b!==x&&ul(m,c)&&o(Et(Oe.FALLBACK_TO_NUMBER_FORMAT,{key:c,target:x})),process.env.NODE_ENV!=="production"&&b!==x){const H=l.__v_emitter;H&&H.emit("fallback",{type:N,key:c,from:f,to:E,groupId:`${N}:${c}`})}if(g=a[x]||{},y=g[c],ue(y))break;vl(l,c,x,k,N),f=E}if(!ue(y)||!X(x))return n?il:c;let V=`${x}__${c}`;al(p)||(V=`${V}__${JSON.stringify(p)}`);let $=s.get(V);return $||($=new Intl.NumberFormat(x,Be({},y,p)),s.set(V,$)),w?$.formatToParts(d):$.format(d)}const nn=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Pl(...l){const[t,a,n,r]=l,o=fe();let i=fe();if(!Ne(t))throw it(Me.INVALID_ARGUMENT);const s=t;return X(a)?o.key=a:ue(a)&&Object.keys(a).forEach(c=>{nn.includes(c)?i[c]=a[c]:o[c]=a[c]}),X(n)?o.locale=n:ue(n)&&(i=n),ue(r)&&(i=r),[o.key||"",s,o,i]}function rn(l,t,a){const n=l;for(const r in a){const o=`${t}__${r}`;n.__numberFormatters.has(o)&&n.__numberFormatters.delete(o)}}const ls=l=>l,as=l=>"",ns="text",rs=l=>l.length===0?"":Al(l),os=Fr;function on(l,t){return l=Math.abs(l),t===2?l?l>1?1:0:1:l?Math.min(l,2):0}function ss(l){const t=Ne(l.pluralIndex)?l.pluralIndex:-1;return l.named&&(Ne(l.named.count)||Ne(l.named.n))?Ne(l.named.count)?l.named.count:Ne(l.named.n)?l.named.n:t:t}function is(l,t){t.count||(t.count=l),t.n||(t.n=l)}function cs(l={}){const t=l.locale,a=ss(l),n=de(l.pluralRules)&&X(t)&&ye(l.pluralRules[t])?l.pluralRules[t]:on,r=de(l.pluralRules)&&X(t)&&ye(l.pluralRules[t])?on:void 0,o=g=>g[n(a,g.length,r)],i=l.list||[],s=g=>i[g],c=l.named||fe();Ne(l.pluralIndex)&&is(a,c);const d=g=>c[g];function u(g,x){const y=ye(l.messages)?l.messages(g,!!x):de(l.messages)?l.messages[g]:!1;return y||(l.parent?l.parent.message(g):as)}const p=g=>l.modifiers?l.modifiers[g]:ls,k=ue(l.processor)&&ye(l.processor.normalize)?l.processor.normalize:rs,m=ue(l.processor)&&ye(l.processor.interpolate)?l.processor.interpolate:os,w=ue(l.processor)&&X(l.processor.type)?l.processor.type:ns,h={list:s,named:d,plural:o,linked:(g,...x)=>{const[y,f]=x;let E="text",N="";x.length===1?de(y)?(N=y.modifier||N,E=y.type||E):X(y)&&(N=y||N):x.length===2&&(X(y)&&(N=y||N),X(f)&&(E=f||E));const V=u(g,!0)(h),$=E==="vnode"&&we(V)&&N?V[0]:V;return N?p(N)($,E):$},message:u,type:w,interpolate:m,normalize:k,values:Be(fe(),i,c)};return h}const sn=()=>"",ze=l=>ye(l);function cn(l,...t){const{fallbackFormat:a,postTranslation:n,unresolving:r,messageCompiler:o,fallbackLocale:i,messages:s}=l,[c,d]=Ul(...t),u=Ee(d.missingWarn)?d.missingWarn:l.missingWarn,p=Ee(d.fallbackWarn)?d.fallbackWarn:l.fallbackWarn,k=Ee(d.escapeParameter)?d.escapeParameter:l.escapeParameter,m=!!d.resolvedMessage,w=X(d.default)||Ee(d.default)?Ee(d.default)?o?c:()=>c:d.default:a?o?c:()=>c:null,b=a||w!=null&&(X(w)||ye(w)),h=Il(l,d);k&&ds(d);let[g,x,y]=m?[c,h,s[h]||fe()]:dn(l,c,h,i,p,u),f=g,E=c;if(!m&&!(X(f)||Ye(f)||ze(f))&&b&&(f=w,E=f),!m&&(!(X(f)||Ye(f)||ze(f))||!X(x)))return r?il:c;if(process.env.NODE_ENV!=="production"&&X(f)&&l.messageCompiler==null)return pt(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${c}'.`),c;let N=!1;const V=()=>{N=!0},$=ze(f)?f:un(l,c,x,f,E,V);if(N)return f;const K=fs(l,x,y,d),H=cs(K),v=us(l,$,H),W=n?n(v,c):v;if(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const le={timestamp:Date.now(),key:X(c)?c:ze(f)?f.key:"",locale:x||(ze(f)?f.locale:""),format:X(f)?f:ze(f)?f.source:"",message:W};le.meta=Be({},l.__meta,Jo()||{}),Ao(le)}return W}function ds(l){we(l.list)?l.list=l.list.map(t=>X(t)?wa(t):t):de(l.named)&&Object.keys(l.named).forEach(t=>{X(l.named[t])&&(l.named[t]=wa(l.named[t]))})}function dn(l,t,a,n,r,o){const{messages:i,onWarn:s,messageResolver:c,localeFallbacker:d}=l,u=d(l,n,a);let p=fe(),k,m=null,w=a,b=null;const h="translate";for(let g=0;g<u.length;g++){if(k=b=u[g],process.env.NODE_ENV!=="production"&&a!==k&&!Za(a,k)&&ul(r,t)&&s(Et(Oe.FALLBACK_TO_TRANSLATE,{key:t,target:k})),process.env.NODE_ENV!=="production"&&a!==k){const E=l.__v_emitter;E&&E.emit("fallback",{type:h,key:t,from:w,to:b,groupId:`${h}:${t}`})}p=i[k]||fe();let x=null,y,f;if(process.env.NODE_ENV!=="production"&&rt&&(x=window.performance.now(),y="intlify-message-resolve-start",f="intlify-message-resolve-end",Pe&&Pe(y)),(m=c(p,t))===null&&(m=p[t]),process.env.NODE_ENV!=="production"&&rt){const E=window.performance.now(),N=l.__v_emitter;N&&x&&m&&N.emit("message-resolve",{type:"message-resolve",key:t,message:m,time:E-x,groupId:`${h}:${t}`}),y&&f&&Pe&&xt&&(Pe(f),xt("intlify message resolve",y,f))}if(X(m)||Ye(m)||ze(m))break;if(!ts(k,u)){const E=vl(l,t,k,o,h);E!==t&&(m=E)}w=b}return[m,k,p]}function un(l,t,a,n,r,o){const{messageCompiler:i,warnHtmlMessage:s}=l;if(ze(n)){const k=n;return k.locale=k.locale||a,k.key=k.key||t,k}if(i==null){const k=()=>n;return k.locale=a,k.key=t,k}let c=null,d,u;process.env.NODE_ENV!=="production"&&rt&&(c=window.performance.now(),d="intlify-message-compilation-start",u="intlify-message-compilation-end",Pe&&Pe(d));const p=i(n,ps(l,a,r,n,s,o));if(process.env.NODE_ENV!=="production"&&rt){const k=window.performance.now(),m=l.__v_emitter;m&&c&&m.emit("message-compilation",{type:"message-compilation",message:n,time:k-c,groupId:`translate:${t}`}),d&&u&&Pe&&xt&&(Pe(u),xt("intlify message compilation",d,u))}return p.locale=a,p.key=t,p.source=n,p}function us(l,t,a){let n=null,r,o;process.env.NODE_ENV!=="production"&&rt&&(n=window.performance.now(),r="intlify-message-evaluation-start",o="intlify-message-evaluation-end",Pe&&Pe(r));const i=t(a);if(process.env.NODE_ENV!=="production"&&rt){const s=window.performance.now(),c=l.__v_emitter;c&&n&&c.emit("message-evaluation",{type:"message-evaluation",value:i,time:s-n,groupId:`translate:${t.key}`}),r&&o&&Pe&&xt&&(Pe(o),xt("intlify message evaluation",r,o))}return i}function Ul(...l){const[t,a,n]=l,r=fe();if(!X(t)&&!Ne(t)&&!ze(t)&&!Ye(t))throw it(Me.INVALID_ARGUMENT);const o=Ne(t)?String(t):(ze(t),t);return Ne(a)?r.plural=a:X(a)?r.default=a:ue(a)&&!al(a)?r.named=a:we(a)&&(r.list=a),Ne(n)?r.plural=n:X(n)?r.default=n:ue(n)&&Be(r,n),[o,r]}function ps(l,t,a,n,r,o){return{locale:t,key:a,warnHtmlMessage:r,onError:i=>{if(o&&o(i),process.env.NODE_ENV!=="production"){const s=ms(n),c=`Message compilation error: ${i.message}`,d=i.location&&s&&Ir(s,i.location.start.offset,i.location.end.offset),u=l.__v_emitter;u&&s&&u.emit("compile-error",{message:s,error:i.message,start:i.location&&i.location.start.offset,end:i.location&&i.location.end.offset,groupId:`translate:${a}`}),console.error(d?`${c}
|
|
142
|
-
${
|
|
181
|
+
*/function Wi(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ol().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ol().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function _t(l){return Ee(l)&&Qa(l)===0&&(Et(l,"b")||Et(l,"body"))}const yn=["b","body"];function Yi(l){return Yt(l,yn)}const bn=["c","cases"];function Xi(l){return Yt(l,bn,[])}const kn=["s","static"];function Zi(l){return Yt(l,kn)}const xn=["i","items"];function Qi(l){return Yt(l,xn,[])}const wn=["t","type"];function Qa(l){return Yt(l,wn)}const En=["v","value"];function oa(l,t){const a=Yt(l,En);if(a!=null)return a;throw Dl(t)}const _n=["m","modifier"];function Ji(l){return Yt(l,_n)}const Vn=["k","key"];function ec(l){const t=Yt(l,Vn);if(t)return t;throw Dl(6)}function Yt(l,t,a){for(let r=0;r<t.length;r++){const n=t[r];if(Et(l,n)&&l[n]!=null)return l[n]}return a}const Cn=[...yn,...bn,...kn,...xn,...Vn,..._n,...En,...wn];function Dl(l){return new Error(`unhandled node type: ${l}`)}function Ja(l){return a=>tc(a,l)}function tc(l,t){const a=Yi(t);if(a==null)throw Dl(0);if(Qa(a)===1){const o=Xi(a);return l.plural(o.reduce((s,i)=>[...s,Nn(l,i)],[]))}else return Nn(l,a)}function Nn(l,t){const a=Zi(t);if(a!=null)return l.type==="text"?a:l.normalize([a]);{const r=Qi(t).reduce((n,o)=>[...n,er(l,o)],[]);return l.normalize(r)}}function er(l,t){const a=Qa(t);switch(a){case 3:return oa(t,a);case 9:return oa(t,a);case 4:{const r=t;if(Et(r,"k")&&r.k)return l.interpolate(l.named(r.k));if(Et(r,"key")&&r.key)return l.interpolate(l.named(r.key));throw Dl(a)}case 5:{const r=t;if(Et(r,"i")&&He(r.i))return l.interpolate(l.list(r.i));if(Et(r,"index")&&He(r.index))return l.interpolate(l.list(r.index));throw Dl(a)}case 6:{const r=t,n=Ji(r),o=ec(r);return l.linked(er(l,o),n?er(l,n):void 0,l.type)}case 7:return oa(t,a);case 8:return oa(t,a);default:throw new Error(`unhandled node on format message part: ${a}`)}}const lc="Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.";function ac(l,t){t&&Vi(l)&&Gt(ta(lc,{source:l}))}const rc=l=>l;let sa=ve();function nc(l,t={}){let a=!1;const r=t.onError||Ei;return t.onError=n=>{a=!0,r(n)},{...Gi(l,t),detectError:a}}function oc(l,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&ae(l)){const a=Pe(t.warnHtmlMessage)?t.warnHtmlMessage:!0;process.env.NODE_ENV!=="production"&&ac(l,a);const n=(t.onCacheKey||rc)(l),o=sa[n];if(o)return o;const{ast:s,detectError:i}=nc(l,{...t,location:process.env.NODE_ENV!=="production",jit:!0}),c=Ja(s);return i?c:sa[n]=c}else{if(process.env.NODE_ENV!=="production"&&!_t(l))return Gt(`the message that is resolve with key '${t.key}' is not supported for jit compilation`),()=>l;const a=l.cacheKey;if(a){const r=sa[a];return r||(sa[a]=Ja(l))}else return Ja(l)}}let Al=null;function sc(l){Al=l}function ic(l,t,a){Al&&Al.emit("i18n:init",{timestamp:Date.now(),i18n:l,version:t,meta:a})}const cc=dc("function:translate");function dc(l){return t=>Al&&Al.emit(l,t)}const Qe={INVALID_ARGUMENT:xi,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},uc=24;function Pt(l){return yl(l,null,process.env.NODE_ENV!=="production"?{messages:pc}:void 0)}const pc={[Qe.INVALID_ARGUMENT]:"Invalid arguments",[Qe.INVALID_DATE_ARGUMENT]:"The date provided is an invalid Date object.Make sure your Date represents a valid date.",[Qe.INVALID_ISO_DATE_ARGUMENT]:"The argument provided is not a valid ISO date string",[Qe.NOT_SUPPORT_NON_STRING_MESSAGE]:"Not support non-string message",[Qe.NOT_SUPPORT_LOCALE_PROMISE_VALUE]:"cannot support promise value",[Qe.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]:"cannot support async function",[Qe.NOT_SUPPORT_LOCALE_TYPE]:"cannot support locale type"};function tr(l,t){return t.locale!=null?Bn(t.locale):Bn(l.locale)}let lr;function Bn(l){if(ae(l))return l;if(Me(l)){if(l.resolvedOnce&&lr!=null)return lr;if(l.constructor.name==="Function"){const t=l();if(fi(t))throw Pt(Qe.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return lr=t}else throw Pt(Qe.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Pt(Qe.NOT_SUPPORT_LOCALE_TYPE)}function mc(l,t,a){return[...new Set([a,...Oe(t)?t:Ee(t)?Object.keys(t):ae(t)?[t]:[a]])]}function vn(l,t,a){const r=ae(a)?a:ca,n=l;n.__localeChainCache||(n.__localeChainCache=new Map);let o=n.__localeChainCache.get(r);if(!o){o=[];let s=[a];for(;Oe(s);)s=Sn(o,s,t);const i=Oe(t)||!_e(t)?t:t.default?t.default:null;s=ae(i)?[i]:i,Oe(s)&&Sn(o,s,!1),n.__localeChainCache.set(r,o)}return o}function Sn(l,t,a){let r=!0;for(let n=0;n<t.length&&Pe(r);n++){const o=t[n];ae(o)&&(r=fc(l,t[n],a))}return r}function fc(l,t,a){let r;const n=t.split("-");do{const o=n.join("-");r=hc(l,o,a),n.splice(-1,1)}while(n.length&&r===!0);return r}function hc(l,t,a){let r=!1;if(!l.includes(t)&&(r=!0,t)){r=t[t.length-1]!=="!";const n=t.replace(/!/g,"");l.push(n),(Oe(a)||_e(a))&&a[n]&&(r=a[n])}return r}const Xt=[];Xt[0]={w:[0],i:[3,0],"[":[4],o:[7]},Xt[1]={w:[1],".":[2],"[":[4],o:[7]},Xt[2]={w:[2],i:[3,0],0:[3,0]},Xt[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},Xt[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},Xt[5]={"'":[4,0],o:8,l:[5,0]},Xt[6]={'"':[4,0],o:8,l:[6,0]};const gc=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function yc(l){return gc.test(l)}function bc(l){const t=l.charCodeAt(0),a=l.charCodeAt(l.length-1);return t===a&&(t===34||t===39)?l.slice(1,-1):l}function kc(l){if(l==null)return"o";switch(l.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return l;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function xc(l){const t=l.trim();return l.charAt(0)==="0"&&isNaN(parseInt(l))?!1:yc(t)?bc(t):"*"+t}function wc(l){const t=[];let a=-1,r=0,n=0,o,s,i,c,u,d,p;const m=[];m[0]=()=>{s===void 0?s=i:s+=i},m[1]=()=>{s!==void 0&&(t.push(s),s=void 0)},m[2]=()=>{m[0](),n++},m[3]=()=>{if(n>0)n--,r=4,m[0]();else{if(n=0,s===void 0||(s=xc(s),s===!1))return!1;m[1]()}};function f(){const g=l[a+1];if(r===5&&g==="'"||r===6&&g==='"')return a++,i="\\"+g,m[0](),!0}for(;r!==null;)if(a++,o=l[a],!(o==="\\"&&f())){if(c=kc(o),p=Xt[r],u=p[c]||p.l||8,u===8||(r=u[0],u[1]!==void 0&&(d=m[u[1]],d&&(i=o,d()===!1))))return;if(r===7)return t}}const Dn=new Map;function Ec(l,t){return Ee(l)?l[t]:null}function _c(l,t){if(!Ee(l))return null;let a=Dn.get(t);if(a||(a=wc(t),a&&Dn.set(t,a)),!a)return null;const r=a.length;let n=l,o=0;for(;o<r;){const s=a[o];if(Cn.includes(s)&&_t(n))return null;const i=n[s];if(i===void 0||Me(n))return null;n=i,o++}return n}const nt={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7},Vc=8,Cc={[nt.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[nt.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[nt.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[nt.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[nt.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[nt.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[nt.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function sl(l,...t){return ta(Cc[l],...t)}const Nc="11.1.5",ia=-1,ca="en-US",da="",An=l=>`${l.charAt(0).toLocaleUpperCase()}${l.substr(1)}`;function Bc(){return{upper:(l,t)=>t==="text"&&ae(l)?l.toUpperCase():t==="vnode"&&Ee(l)&&"__v_isVNode"in l?l.children.toUpperCase():l,lower:(l,t)=>t==="text"&&ae(l)?l.toLowerCase():t==="vnode"&&Ee(l)&&"__v_isVNode"in l?l.children.toLowerCase():l,capitalize:(l,t)=>t==="text"&&ae(l)?An(l):t==="vnode"&&Ee(l)&&"__v_isVNode"in l?An(l.children):l}}let Mn;function vc(l){Mn=l}let Tn;function Sc(l){Tn=l}let $n;function Dc(l){$n=l}let Ln=null;const Ac=l=>{Ln=l},Mc=()=>Ln;let Fn=null;const In=l=>{Fn=l},Tc=()=>Fn;let On=0;function $c(l={}){const t=Me(l.onWarn)?l.onWarn:Gt,a=ae(l.version)?l.version:Nc,r=ae(l.locale)||Me(l.locale)?l.locale:ca,n=Me(r)?ca:r,o=Oe(l.fallbackLocale)||_e(l.fallbackLocale)||ae(l.fallbackLocale)||l.fallbackLocale===!1?l.fallbackLocale:n,s=_e(l.messages)?l.messages:ar(n),i=_e(l.datetimeFormats)?l.datetimeFormats:ar(n),c=_e(l.numberFormats)?l.numberFormats:ar(n),u=Ke(ve(),l.modifiers,Bc()),d=l.pluralRules||ve(),p=Me(l.missing)?l.missing:null,m=Pe(l.missingWarn)||la(l.missingWarn)?l.missingWarn:!0,f=Pe(l.fallbackWarn)||la(l.fallbackWarn)?l.fallbackWarn:!0,g=!!l.fallbackFormat,y=!!l.unresolving,w=Me(l.postTranslation)?l.postTranslation:null,h=_e(l.processor)?l.processor:null,k=Pe(l.warnHtmlMessage)?l.warnHtmlMessage:!0,x=!!l.escapeParameter,b=Me(l.messageCompiler)?l.messageCompiler:Mn;process.env.NODE_ENV!=="production"&&Me(l.messageCompiler)&&yi(sl(nt.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));const _=Me(l.messageResolver)?l.messageResolver:Tn||Ec,V=Me(l.localeFallbacker)?l.localeFallbacker:$n||mc,E=Ee(l.fallbackContext)?l.fallbackContext:void 0,D=l,$=Ee(D.__datetimeFormatters)?D.__datetimeFormatters:new Map,C=Ee(D.__numberFormatters)?D.__numberFormatters:new Map,B=Ee(D.__meta)?D.__meta:{};On++;const M={version:a,cid:On,locale:r,fallbackLocale:o,messages:s,modifiers:u,pluralRules:d,missing:p,missingWarn:m,fallbackWarn:f,fallbackFormat:g,unresolving:y,postTranslation:w,processor:h,warnHtmlMessage:k,escapeParameter:x,messageCompiler:b,messageResolver:_,localeFallbacker:V,fallbackContext:E,onWarn:t,__meta:B};return M.datetimeFormats=i,M.numberFormats=c,M.__datetimeFormatters=$,M.__numberFormatters=C,process.env.NODE_ENV!=="production"&&(M.__v_emitter=D.__v_emitter!=null?D.__v_emitter:void 0),(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__)&&ic(M,a,B),M}const ar=l=>({[l]:ve()});function ua(l,t){return l instanceof RegExp?l.test(t):l}function Pn(l,t){return l instanceof RegExp?l.test(t):l}function rr(l,t,a,r,n){const{missing:o,onWarn:s}=l;if(process.env.NODE_ENV!=="production"){const i=l.__v_emitter;i&&i.emit("missing",{locale:a,key:t,type:n,groupId:`${n}:${t}`})}if(o!==null){const i=o(l,a,t,n);return ae(i)?i:t}else return process.env.NODE_ENV!=="production"&&Pn(r,t)&&s(sl(nt.NOT_FOUND_KEY,{key:t,locale:a})),t}function Ml(l,t,a){const r=l;r.__localeChainCache=new Map,l.localeFallbacker(l,a,t)}function Rn(l,t){return l===t?!1:l.split("-")[0]===t.split("-")[0]}function Lc(l,t){const a=t.indexOf(l);if(a===-1)return!1;for(let r=a+1;r<t.length;r++)if(Rn(l,t[r]))return!0;return!1}const jn=typeof Intl<"u",Un={dateTimeFormat:jn&&typeof Intl.DateTimeFormat<"u",numberFormat:jn&&typeof Intl.NumberFormat<"u"};function zn(l,...t){const{datetimeFormats:a,unresolving:r,fallbackLocale:n,onWarn:o,localeFallbacker:s}=l,{__datetimeFormatters:i}=l;if(process.env.NODE_ENV!=="production"&&!Un.dateTimeFormat)return o(sl(nt.CANNOT_FORMAT_DATE)),da;const[c,u,d,p]=nr(...t),m=Pe(d.missingWarn)?d.missingWarn:l.missingWarn,f=Pe(d.fallbackWarn)?d.fallbackWarn:l.fallbackWarn,g=!!d.part,y=tr(l,d),w=s(l,n,y);if(!ae(c)||c==="")return new Intl.DateTimeFormat(y,p).format(u);let h={},k,x=null,b=y,_=null;const V="datetime format";for(let $=0;$<w.length;$++){if(k=_=w[$],process.env.NODE_ENV!=="production"&&y!==k&&ua(f,c)&&o(sl(nt.FALLBACK_TO_DATE_FORMAT,{key:c,target:k})),process.env.NODE_ENV!=="production"&&y!==k){const C=l.__v_emitter;C&&C.emit("fallback",{type:V,key:c,from:b,to:_,groupId:`${V}:${c}`})}if(h=a[k]||{},x=h[c],_e(x))break;rr(l,c,k,m,V),b=_}if(!_e(x)||!ae(k))return r?ia:c;let E=`${k}__${c}`;aa(p)||(E=`${E}__${JSON.stringify(p)}`);let D=i.get(E);return D||(D=new Intl.DateTimeFormat(k,Ke({},x,p)),i.set(E,D)),g?D.formatToParts(u):D.format(u)}const Hn=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function nr(...l){const[t,a,r,n]=l,o=ve();let s=ve(),i;if(ae(t)){const c=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!c)throw Pt(Qe.INVALID_ISO_DATE_ARGUMENT);const u=c[3]?c[3].trim().startsWith("T")?`${c[1].trim()}${c[3].trim()}`:`${c[1].trim()}T${c[3].trim()}`:c[1].trim();i=new Date(u);try{i.toISOString()}catch{throw Pt(Qe.INVALID_ISO_DATE_ARGUMENT)}}else if(ui(t)){if(isNaN(t.getTime()))throw Pt(Qe.INVALID_DATE_ARGUMENT);i=t}else if(He(t))i=t;else throw Pt(Qe.INVALID_ARGUMENT);return ae(a)?o.key=a:_e(a)&&Object.keys(a).forEach(c=>{Hn.includes(c)?s[c]=a[c]:o[c]=a[c]}),ae(r)?o.locale=r:_e(r)&&(s=r),_e(n)&&(s=n),[o.key||"",i,o,s]}function Kn(l,t,a){const r=l;for(const n in a){const o=`${t}__${n}`;r.__datetimeFormatters.has(o)&&r.__datetimeFormatters.delete(o)}}function qn(l,...t){const{numberFormats:a,unresolving:r,fallbackLocale:n,onWarn:o,localeFallbacker:s}=l,{__numberFormatters:i}=l;if(process.env.NODE_ENV!=="production"&&!Un.numberFormat)return o(sl(nt.CANNOT_FORMAT_NUMBER)),da;const[c,u,d,p]=or(...t),m=Pe(d.missingWarn)?d.missingWarn:l.missingWarn,f=Pe(d.fallbackWarn)?d.fallbackWarn:l.fallbackWarn,g=!!d.part,y=tr(l,d),w=s(l,n,y);if(!ae(c)||c==="")return new Intl.NumberFormat(y,p).format(u);let h={},k,x=null,b=y,_=null;const V="number format";for(let $=0;$<w.length;$++){if(k=_=w[$],process.env.NODE_ENV!=="production"&&y!==k&&ua(f,c)&&o(sl(nt.FALLBACK_TO_NUMBER_FORMAT,{key:c,target:k})),process.env.NODE_ENV!=="production"&&y!==k){const C=l.__v_emitter;C&&C.emit("fallback",{type:V,key:c,from:b,to:_,groupId:`${V}:${c}`})}if(h=a[k]||{},x=h[c],_e(x))break;rr(l,c,k,m,V),b=_}if(!_e(x)||!ae(k))return r?ia:c;let E=`${k}__${c}`;aa(p)||(E=`${E}__${JSON.stringify(p)}`);let D=i.get(E);return D||(D=new Intl.NumberFormat(k,Ke({},x,p)),i.set(E,D)),g?D.formatToParts(u):D.format(u)}const Gn=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function or(...l){const[t,a,r,n]=l,o=ve();let s=ve();if(!He(t))throw Pt(Qe.INVALID_ARGUMENT);const i=t;return ae(a)?o.key=a:_e(a)&&Object.keys(a).forEach(c=>{Gn.includes(c)?s[c]=a[c]:o[c]=a[c]}),ae(r)?o.locale=r:_e(r)&&(s=r),_e(n)&&(s=n),[o.key||"",i,o,s]}function Wn(l,t,a){const r=l;for(const n in a){const o=`${t}__${n}`;r.__numberFormatters.has(o)&&r.__numberFormatters.delete(o)}}const Fc=l=>l,Ic=l=>"",Oc="text",Pc=l=>l.length===0?"":Ya(l),Rc=hi;function Yn(l,t){return l=Math.abs(l),t===2?l?l>1?1:0:1:l?Math.min(l,2):0}function jc(l){const t=He(l.pluralIndex)?l.pluralIndex:-1;return l.named&&(He(l.named.count)||He(l.named.n))?He(l.named.count)?l.named.count:He(l.named.n)?l.named.n:t:t}function Uc(l,t){t.count||(t.count=l),t.n||(t.n=l)}function zc(l={}){const t=l.locale,a=jc(l),r=Ee(l.pluralRules)&&ae(t)&&Me(l.pluralRules[t])?l.pluralRules[t]:Yn,n=Ee(l.pluralRules)&&ae(t)&&Me(l.pluralRules[t])?Yn:void 0,o=h=>h[r(a,h.length,n)],s=l.list||[],i=h=>s[h],c=l.named||ve();He(l.pluralIndex)&&Uc(a,c);const u=h=>c[h];function d(h,k){const x=Me(l.messages)?l.messages(h,!!k):Ee(l.messages)?l.messages[h]:!1;return x||(l.parent?l.parent.message(h):Ic)}const p=h=>l.modifiers?l.modifiers[h]:Fc,m=_e(l.processor)&&Me(l.processor.normalize)?l.processor.normalize:Pc,f=_e(l.processor)&&Me(l.processor.interpolate)?l.processor.interpolate:Rc,g=_e(l.processor)&&ae(l.processor.type)?l.processor.type:Oc,w={list:i,named:u,plural:o,linked:(h,...k)=>{const[x,b]=k;let _="text",V="";k.length===1?Ee(x)?(V=x.modifier||V,_=x.type||_):ae(x)&&(V=x||V):k.length===2&&(ae(x)&&(V=x||V),ae(b)&&(_=b||_));const E=d(h,!0)(w),D=_==="vnode"&&Oe(E)&&V?E[0]:E;return V?p(V)(D,_):D},message:d,type:g,interpolate:f,normalize:m,values:Ke(ve(),s,c)};return w}const Xn=()=>"",bt=l=>Me(l);function Zn(l,...t){const{fallbackFormat:a,postTranslation:r,unresolving:n,messageCompiler:o,fallbackLocale:s,messages:i}=l,[c,u]=sr(...t),d=Pe(u.missingWarn)?u.missingWarn:l.missingWarn,p=Pe(u.fallbackWarn)?u.fallbackWarn:l.fallbackWarn,m=Pe(u.escapeParameter)?u.escapeParameter:l.escapeParameter,f=!!u.resolvedMessage,g=ae(u.default)||Pe(u.default)?Pe(u.default)?o?c:()=>c:u.default:a?o?c:()=>c:null,y=a||g!=null&&(ae(g)||Me(g)),w=tr(l,u);m&&Hc(u);let[h,k,x]=f?[c,w,i[w]||ve()]:Qn(l,c,w,s,p,d),b=h,_=c;if(!f&&!(ae(b)||_t(b)||bt(b))&&y&&(b=g,_=b),!f&&(!(ae(b)||_t(b)||bt(b))||!ae(k)))return n?ia:c;if(process.env.NODE_ENV!=="production"&&ae(b)&&l.messageCompiler==null)return Gt(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${c}'.`),c;let V=!1;const E=()=>{V=!0},D=bt(b)?b:Jn(l,c,k,b,_,E);if(V)return b;const $=Wc(l,k,x,u),C=zc($),B=Kc(l,D,C),M=r?r(B,c):B;if(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const U={timestamp:Date.now(),key:ae(c)?c:bt(b)?b.key:"",locale:k||(bt(b)?b.locale:""),format:ae(b)?b:bt(b)?b.source:"",message:M};U.meta=Ke({},l.__meta,Mc()||{}),cc(U)}return M}function Hc(l){Oe(l.list)?l.list=l.list.map(t=>ae(t)?dn(t):t):Ee(l.named)&&Object.keys(l.named).forEach(t=>{ae(l.named[t])&&(l.named[t]=dn(l.named[t]))})}function Qn(l,t,a,r,n,o){const{messages:s,onWarn:i,messageResolver:c,localeFallbacker:u}=l,d=u(l,r,a);let p=ve(),m,f=null,g=a,y=null;const w="translate";for(let h=0;h<d.length;h++){if(m=y=d[h],process.env.NODE_ENV!=="production"&&a!==m&&!Rn(a,m)&&ua(n,t)&&i(sl(nt.FALLBACK_TO_TRANSLATE,{key:t,target:m})),process.env.NODE_ENV!=="production"&&a!==m){const _=l.__v_emitter;_&&_.emit("fallback",{type:w,key:t,from:g,to:y,groupId:`${w}:${t}`})}p=s[m]||ve();let k=null,x,b;if(process.env.NODE_ENV!=="production"&&Ft&&(k=window.performance.now(),x="intlify-message-resolve-start",b="intlify-message-resolve-end",ut&&ut(x)),(f=c(p,t))===null&&(f=p[t]),process.env.NODE_ENV!=="production"&&Ft){const _=window.performance.now(),V=l.__v_emitter;V&&k&&f&&V.emit("message-resolve",{type:"message-resolve",key:t,message:f,time:_-k,groupId:`${w}:${t}`}),x&&b&&ut&&nl&&(ut(b),nl("intlify message resolve",x,b))}if(ae(f)||_t(f)||bt(f))break;if(!Lc(m,d)){const _=rr(l,t,m,o,w);_!==t&&(f=_)}g=y}return[f,m,p]}function Jn(l,t,a,r,n,o){const{messageCompiler:s,warnHtmlMessage:i}=l;if(bt(r)){const m=r;return m.locale=m.locale||a,m.key=m.key||t,m}if(s==null){const m=()=>r;return m.locale=a,m.key=t,m}let c=null,u,d;process.env.NODE_ENV!=="production"&&Ft&&(c=window.performance.now(),u="intlify-message-compilation-start",d="intlify-message-compilation-end",ut&&ut(u));const p=s(r,qc(l,a,n,r,i,o));if(process.env.NODE_ENV!=="production"&&Ft){const m=window.performance.now(),f=l.__v_emitter;f&&c&&f.emit("message-compilation",{type:"message-compilation",message:r,time:m-c,groupId:`translate:${t}`}),u&&d&&ut&&nl&&(ut(d),nl("intlify message compilation",u,d))}return p.locale=a,p.key=t,p.source=r,p}function Kc(l,t,a){let r=null,n,o;process.env.NODE_ENV!=="production"&&Ft&&(r=window.performance.now(),n="intlify-message-evaluation-start",o="intlify-message-evaluation-end",ut&&ut(n));const s=t(a);if(process.env.NODE_ENV!=="production"&&Ft){const i=window.performance.now(),c=l.__v_emitter;c&&r&&c.emit("message-evaluation",{type:"message-evaluation",value:s,time:i-r,groupId:`translate:${t.key}`}),n&&o&&ut&&nl&&(ut(o),nl("intlify message evaluation",n,o))}return s}function sr(...l){const[t,a,r]=l,n=ve();if(!ae(t)&&!He(t)&&!bt(t)&&!_t(t))throw Pt(Qe.INVALID_ARGUMENT);const o=He(t)?String(t):(bt(t),t);return He(a)?n.plural=a:ae(a)?n.default=a:_e(a)&&!aa(a)?n.named=a:Oe(a)&&(n.list=a),He(r)?n.plural=r:ae(r)?n.default=r:_e(r)&&Ke(n,r),[o,n]}function qc(l,t,a,r,n,o){return{locale:t,key:a,warnHtmlMessage:n,onError:s=>{if(o&&o(s),process.env.NODE_ENV!=="production"){const i=Gc(r),c=`Message compilation error: ${s.message}`,u=s.location&&i&&gi(i,s.location.start.offset,s.location.end.offset),d=l.__v_emitter;d&&i&&d.emit("compile-error",{message:i,error:s.message,start:s.location&&s.location.start.offset,end:s.location&&s.location.end.offset,groupId:`translate:${a}`}),console.error(u?`${c}
|
|
182
|
+
${u}`:c)}else throw s},onCacheKey:s=>ci(t,a,s)}}function Gc(l){if(ae(l))return l;if(l.loc&&l.loc.source)return l.loc.source}function Wc(l,t,a,r){const{modifiers:n,pluralRules:o,messageResolver:s,fallbackLocale:i,fallbackWarn:c,missingWarn:u,fallbackContext:d}=l,m={locale:t,modifiers:n,pluralRules:o,messages:(f,g)=>{let y=s(a,f);if(y==null&&(d||g)){const[,,w]=Qn(d||l,f,t,i,c,u);y=s(w,f)}if(ae(y)||_t(y)){let w=!1;const k=Jn(l,f,t,y,f,()=>{w=!0});return w?Xn:k}else return bt(y)?y:Xn}};return l.processor&&(m.processor=l.processor),r.list&&(m.list=r.list),r.named&&(m.named=r.named),He(r.plural)&&(m.pluralIndex=r.plural),m}Wi();/*!
|
|
143
183
|
* vue-i18n v11.1.5
|
|
144
184
|
* (c) 2025 kazuya kawaguchi
|
|
145
185
|
* Released under the MIT License.
|
|
146
|
-
*/const
|
|
147
|
-
About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guide/advanced/composition.html`,[gt.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE]:"'v-t' has been deprecated in v11. Use translate APIs ('t' or '$t') instead."};function Yl(l,...t){return tl(bs[l],...t)}function jt(l){if(!de(l)||Ye(l))return l;for(const t in l)if(We(l,t))if(!t.includes("."))de(l[t])&&jt(l[t]);else{const a=t.split("."),n=a.length-1;let r=l,o=!1;for(let i=0;i<n;i++){if(a[i]==="__proto__")throw new Error(`unsafe key: ${a[i]}`);if(a[i]in r||(r[a[i]]=fe()),!de(r[a[i]])){process.env.NODE_ENV!=="production"&&pt(Yl(gt.IGNORE_OBJ_FLATTEN,{key:a[i]})),o=!0;break}r=r[a[i]]}if(o||(Ye(r)?Oa.includes(a[n])||delete l[t]:(r[a[n]]=l[t],delete l[t])),!Ye(r)){const i=r[a[n]];de(i)&&jt(i)}}return l}function mn(l,t){const{messages:a,__i18n:n,messageResolver:r,flatJson:o}=t,i=ue(a)?a:we(n)?fe():{[l]:fe()};if(we(n)&&n.forEach(s=>{if("locale"in s&&"resource"in s){const{locale:c,resource:d}=s;c?(i[c]=i[c]||fe(),rl(d,i[c])):rl(d,i)}else X(s)&&rl(JSON.parse(s),i)}),r==null&&o)for(const s in i)We(i,s)&&jt(i[s]);return i}function fn(l){return l.type}function xs(l,t,a){let n=de(t.messages)?t.messages:fe();"__i18nGlobal"in a&&(n=mn(l.locale.value,{messages:n,__i18n:a.__i18nGlobal}));const r=Object.keys(n);r.length&&r.forEach(o=>{l.mergeLocaleMessage(o,n[o])});{if(de(t.datetimeFormats)){const o=Object.keys(t.datetimeFormats);o.length&&o.forEach(i=>{l.mergeDateTimeFormat(i,t.datetimeFormats[i])})}if(de(t.numberFormats)){const o=Object.keys(t.numberFormats);o.length&&o.forEach(i=>{l.mergeNumberFormat(i,t.numberFormats[i])})}}}function hn(l){return e.createVNode(e.Text,null,l,0)}const gn="__INTLIFY_META__",kn=()=>[],ws=()=>!1;let yn=0;function bn(l){return(t,a,n,r)=>l(a,n,e.getCurrentInstance()||void 0,r)}const Es=()=>{const l=e.getCurrentInstance();let t=null;return l&&(t=fn(l)[gn])?{[gn]:t}:null};function _s(l={}){const{__root:t,__injectWithOption:a}=l,n=t===void 0,r=l.flatJson,o=rt?e.ref:e.shallowRef;let i=Ee(l.inheritLocale)?l.inheritLocale:!0;const s=o(t&&i?t.locale.value:X(l.locale)?l.locale:cl),c=o(t&&i?t.fallbackLocale.value:X(l.fallbackLocale)||we(l.fallbackLocale)||ue(l.fallbackLocale)||l.fallbackLocale===!1?l.fallbackLocale:s.value),d=o(mn(s.value,l)),u=o(ue(l.datetimeFormats)?l.datetimeFormats:{[s.value]:{}}),p=o(ue(l.numberFormats)?l.numberFormats:{[s.value]:{}});let k=t?t.missingWarn:Ee(l.missingWarn)||ll(l.missingWarn)?l.missingWarn:!0,m=t?t.fallbackWarn:Ee(l.fallbackWarn)||ll(l.fallbackWarn)?l.fallbackWarn:!0,w=t?t.fallbackRoot:Ee(l.fallbackRoot)?l.fallbackRoot:!0,b=!!l.fallbackFormat,h=ye(l.missing)?l.missing:null,g=ye(l.missing)?bn(l.missing):null,x=ye(l.postTranslation)?l.postTranslation:null,y=t?t.warnHtmlMessage:Ee(l.warnHtmlMessage)?l.warnHtmlMessage:!0,f=!!l.escapeParameter;const E=t?t.modifiers:ue(l.modifiers)?l.modifiers:{};let N=l.pluralRules||t&&t.pluralRules,V;V=(()=>{n&&Ya(null);const M={version:hs,locale:s.value,fallbackLocale:c.value,messages:d.value,modifiers:E,pluralRules:N,missing:g===null?void 0:g,missingWarn:k,fallbackWarn:m,fallbackFormat:b,unresolving:!0,postTranslation:x===null?void 0:x,warnHtmlMessage:y,escapeParameter:f,messageResolver:l.messageResolver,messageCompiler:l.messageCompiler,__meta:{framework:"vue"}};M.datetimeFormats=u.value,M.numberFormats=p.value,M.__datetimeFormatters=ue(V)?V.__datetimeFormatters:void 0,M.__numberFormatters=ue(V)?V.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(M.__v_emitter=ue(V)?V.__v_emitter:void 0);const U=es(M);return n&&Ya(U),U})(),Pt(V,s.value,c.value);function K(){return[s.value,c.value,d.value,u.value,p.value]}const H=e.computed({get:()=>s.value,set:M=>{V.locale=M,s.value=M}}),v=e.computed({get:()=>c.value,set:M=>{V.fallbackLocale=M,c.value=M,Pt(V,s.value,M)}}),W=e.computed(()=>d.value),le=e.computed(()=>u.value),P=e.computed(()=>p.value);function F(){return ye(x)?x:null}function I(M){x=M,V.postTranslation=M}function T(){return h}function Y(M){M!==null&&(g=bn(M)),h=M,V.missing=g}function J(M,U){return M!=="translate"||!U.resolvedMessage}const pe=(M,U,se,me,_,A)=>{K();let O;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,n||(V.fallbackContext=t?Qo():void 0),O=M(V)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,n||(V.fallbackContext=void 0)}if(se!=="translate exists"&&Ne(O)&&O===il||se==="translate exists"&&!O){const[j,G]=U();if(process.env.NODE_ENV!=="production"&&t&&X(j)&&J(se,G)&&(w&&(ul(m,j)||Xa(k,j))&&pt(Yl(gt.FALLBACK_TO_ROOT,{key:j,type:se})),process.env.NODE_ENV!=="production")){const{__v_emitter:S}=V;S&&w&&S.emit("fallback",{type:se,key:j,to:"global",groupId:`${se}:${j}`})}return t&&w?me(t):_(j)}else{if(A(O))return O;throw Ut(Se.UNEXPECTED_RETURN_TYPE)}};function _e(...M){return pe(U=>Reflect.apply(cn,null,[U,...M]),()=>Ul(...M),"translate",U=>Reflect.apply(U.t,U,[...M]),U=>U,U=>X(U))}function Fe(...M){const[U,se,me]=M;if(me&&!de(me))throw Ut(Se.INVALID_ARGUMENT);return _e(U,se,Be({resolvedMessage:!0},me||{}))}function Vt(...M){return pe(U=>Reflect.apply(en,null,[U,...M]),()=>Rl(...M),"datetime format",U=>Reflect.apply(U.d,U,[...M]),()=>dl,U=>X(U)||we(U))}function Ce(...M){return pe(U=>Reflect.apply(an,null,[U,...M]),()=>Pl(...M),"number format",U=>Reflect.apply(U.n,U,[...M]),()=>dl,U=>X(U)||we(U))}function Ie(M){return M.map(U=>X(U)||Ne(U)||Ee(U)?hn(String(U)):U)}const dt={normalize:Ie,interpolate:M=>M,type:"vnode"};function ut(...M){return pe(U=>{let se;const me=U;try{me.processor=dt,se=Reflect.apply(cn,null,[me,...M])}finally{me.processor=null}return se},()=>Ul(...M),"translate",U=>U[jl](...M),U=>[hn(U)],U=>we(U))}function Nt(...M){return pe(U=>Reflect.apply(an,null,[U,...M]),()=>Pl(...M),"number format",U=>U[Hl](...M),kn,U=>X(U)||we(U))}function ve(...M){return pe(U=>Reflect.apply(en,null,[U,...M]),()=>Rl(...M),"datetime format",U=>U[zl](...M),kn,U=>X(U)||we(U))}function Ke(M){N=M,V.pluralRules=N}function at(M,U){return pe(()=>{if(!M)return!1;const se=X(U)?U:s.value,me=Xe(se),_=V.messageResolver(me,M);return Ye(_)||ze(_)||X(_)},()=>[M],"translate exists",se=>Reflect.apply(se.te,se,[M,U]),ws,se=>Ee(se))}function Ve(M){let U=null;const se=Ra(V,c.value,s.value);for(let me=0;me<se.length;me++){const _=d.value[se[me]]||{},A=V.messageResolver(_,M);if(A!=null){U=A;break}}return U}function Ge(M){const U=Ve(M);return U??(t?t.tm(M)||{}:{})}function Xe(M){return d.value[M]||{}}function nt(M,U){if(r){const se={[M]:U};for(const me in se)We(se,me)&&jt(se[me]);U=se[M]}d.value[M]=U,V.messages=d.value}function bt(M,U){d.value[M]=d.value[M]||{};const se={[M]:U};if(r)for(const me in se)We(se,me)&&jt(se[me]);U=se[M],rl(U,d.value[M]),V.messages=d.value}function C(M){return u.value[M]||{}}function B(M,U){u.value[M]=U,V.datetimeFormats=u.value,ln(V,M,U)}function R(M,U){u.value[M]=Be(u.value[M]||{},U),V.datetimeFormats=u.value,ln(V,M,U)}function Z(M){return p.value[M]||{}}function he(M,U){p.value[M]=U,V.numberFormats=p.value,rn(V,M,U)}function ge(M,U){p.value[M]=Be(p.value[M]||{},U),V.numberFormats=p.value,rn(V,M,U)}yn++,t&&rt&&(e.watch(t.locale,M=>{i&&(s.value=M,V.locale=M,Pt(V,s.value,c.value))}),e.watch(t.fallbackLocale,M=>{i&&(c.value=M,V.fallbackLocale=M,Pt(V,s.value,c.value))}));const oe={id:yn,locale:H,fallbackLocale:v,get inheritLocale(){return i},set inheritLocale(M){i=M,M&&t&&(s.value=t.locale.value,c.value=t.fallbackLocale.value,Pt(V,s.value,c.value))},get availableLocales(){return Object.keys(d.value).sort()},messages:W,get modifiers(){return E},get pluralRules(){return N||{}},get isGlobal(){return n},get missingWarn(){return k},set missingWarn(M){k=M,V.missingWarn=k},get fallbackWarn(){return m},set fallbackWarn(M){m=M,V.fallbackWarn=m},get fallbackRoot(){return w},set fallbackRoot(M){w=M},get fallbackFormat(){return b},set fallbackFormat(M){b=M,V.fallbackFormat=b},get warnHtmlMessage(){return y},set warnHtmlMessage(M){y=M,V.warnHtmlMessage=M},get escapeParameter(){return f},set escapeParameter(M){f=M,V.escapeParameter=M},t:_e,getLocaleMessage:Xe,setLocaleMessage:nt,mergeLocaleMessage:bt,getPostTranslationHandler:F,setPostTranslationHandler:I,getMissingHandler:T,setMissingHandler:Y,[ys]:Ke};return oe.datetimeFormats=le,oe.numberFormats=P,oe.rt=Fe,oe.te=at,oe.tm=Ge,oe.d=Vt,oe.n=Ce,oe.getDateTimeFormat=C,oe.setDateTimeFormat=B,oe.mergeDateTimeFormat=R,oe.getNumberFormat=Z,oe.setNumberFormat=he,oe.mergeNumberFormat=ge,oe[pn]=a,oe[jl]=ut,oe[zl]=ve,oe[Hl]=Nt,process.env.NODE_ENV!=="production"&&(oe[Kl]=M=>{V.__v_emitter=M},oe[Gl]=()=>{V.__v_emitter=void 0}),oe}function xn(l,t){}const ql={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:l=>l==="parent"||l==="global",default:"parent"},i18n:{type:Object}};function Cs({slots:l},t){return t.length===1&&t[0]==="default"?(l.default?l.default():[]).reduce((n,r)=>[...n,...r.type===e.Fragment?r.children:[r]],[]):t.reduce((a,n)=>{const r=l[n];return r&&(a[n]=r()),a},fe())}function wn(){return e.Fragment}Be({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:l=>Ne(l)||!isNaN(l)}},ql);function Vs(l){return we(l)&&!X(l[0])}function En(l,t,a,n){const{slots:r,attrs:o}=t;return()=>{const i={part:!0};let s=fe();l.locale&&(i.locale=l.locale),X(l.format)?i.key=l.format:de(l.format)&&(X(l.format.key)&&(i.key=l.format.key),s=Object.keys(l.format).reduce((k,m)=>a.includes(m)?Be(fe(),k,{[m]:l.format[m]}):k,fe()));const c=n(l.value,i,s);let d=[i.key];we(c)?d=c.map((k,m)=>{const w=r[k.type],b=w?w({[k.type]:k.value,index:m,parts:c}):[k.value];return Vs(b)&&(b[0].key=`${k.type}-${m}`),b}):X(c)&&(d=[c]);const u=Be(fe(),o),p=X(l.tag)||de(l.tag)?l.tag:wn();return e.h(p,u,d)}}Be({value:{type:Number,required:!0},format:{type:[String,Object]}},ql);const Ns=ot("global-vue-i18n");function qe(l={}){const t=e.getCurrentInstance();if(t==null)throw Ut(Se.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Ut(Se.NOT_INSTALLED);const a=Bs(t),n=As(a),r=fn(t),o=Ss(l,r);if(o==="global")return xs(n,l,r),n;if(o==="parent"){let c=Ds(a,t,l.__useComponent);return c==null&&(process.env.NODE_ENV!=="production"&&pt(Yl(gt.NOT_FOUND_PARENT_SCOPE)),c=n),c}const i=a;let s=i.__getInstance(t);if(s==null){const c=Be({},l);"__i18n"in r&&(c.__i18n=r.__i18n),n&&(c.__root=n),s=_s(c),i.__composerExtend&&(s[Wl]=i.__composerExtend(s)),Ms(i,t,s),i.__setInstance(t,s)}return s}function Bs(l){const t=e.inject(l.isCE?Ns:l.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Ut(l.isCE?Se.NOT_INSTALLED_WITH_PROVIDE:Se.UNEXPECTED_ERROR);return t}function Ss(l,t){return al(l)?"__i18n"in t?"local":"global":l.useScope?l.useScope:"local"}function As(l){return l.mode==="composition"?l.global:l.global.__composer}function Ds(l,t,a=!1){let n=null;const r=t.root;let o=Ls(t,a);for(;o!=null;){const i=l;if(l.mode==="composition")n=i.__getInstance(o);else if(__VUE_I18N_LEGACY_API__){const s=i.__getInstance(o);s!=null&&(n=s.__composer,a&&n&&!n[pn]&&(n=null))}if(n!=null||r===o)break;o=o.parent}return n}function Ls(l,t=!1){return l==null?null:t&&l.vnode.ctx||l.parent}function Ms(l,t,a){let n=null;e.onMounted(()=>{if(process.env.NODE_ENV!=="production"&&t.vnode.el){t.vnode.el.__VUE_I18N__=a,n=$r();const r=a;r[Kl]&&r[Kl](n),n.on("*",xn)}},t),e.onUnmounted(()=>{const r=a;process.env.NODE_ENV!=="production"&&t.vnode.el&&t.vnode.el.__VUE_I18N__&&(n&&n.off("*",xn),r[Gl]&&r[Gl](),delete t.vnode.el.__VUE_I18N__),l.__deleteInstance(t);const o=r[Wl];o&&(o(),delete r[Wl])},t)}if(Be({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},ql),gs(),Yo(No),qo(zo),Xo(Ra),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const l=wt();l.__INTLIFY__=!0,Bo(l.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const Ts={class:"flex items-center justify-between"},Fs={class:"flex items-center gap-2"},Is={class:"text-4xl font-bold text-slate-800 dark:text-slate-100 mb-2"},Os=["href","title"],$s={class:"text-lg text-slate-600 dark:text-slate-300"},vs=e.defineComponent({__name:"DashboardHeader",setup(l){const{locale:t}=qe();return(a,n)=>{const r=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",Ts,[e.createElementVNode("div",null,[e.createElementVNode("div",Fs,[e.createElementVNode("h1",Is,e.toDisplayString(a.$t("dashboard.title")),1),e.createElementVNode("a",{href:`https://cms.opengis.info/${e.unref(t)}/get-started/app-overview`,target:"_blank",title:a.$t("guide.appOverview")},[e.createVNode(e.unref($t),{class:"w-5 h-5"})],8,Os)]),e.createElementVNode("div",$s,e.toDisplayString(a.$t("dashboard.description")),1)]),e.createElementVNode("div",null,[e.createVNode(r,{to:"/settings/collections",class:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 shadow h-9 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white"},{default:e.withCtx(()=>[e.createVNode(e.unref(Nl),{class:"w-4 h-4 mr-2"}),e.createTextVNode(" "+e.toDisplayString(a.$t("dashboard.newCollection")),1)]),_:1})])])}}}),Rs={class:"rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm hover:shadow-xl transition-all duration-300 transform hover:scale-105"},Ps={class:"p-6"},Us={class:"flex items-start justify-between"},js={class:"flex-1"},zs={class:"flex items-center space-x-2 mb-2"},Hs={class:"text-sm font-medium text-slate-600 dark:text-slate-400"},Ks={class:"text-3xl font-bold text-slate-800 dark:text-slate-100 mb-1"},Gs={class:"text-xs text-slate-500 dark:text-slate-400 mb-3"},Ws=e.defineComponent({__name:"StatCard",props:{stat:{}},setup(l){const t=a=>({"file-text":Qt,users:Bl,image:ha,eye:Cl})[a]||Qt;return(a,n)=>(e.openBlock(),e.createElementBlock("div",Rs,[e.createElementVNode("div",Ps,[e.createElementVNode("div",Us,[e.createElementVNode("div",js,[e.createElementVNode("div",zs,[e.createElementVNode("div",{class:e.normalizeClass(`p-2 rounded-lg bg-${a.stat.color}-50 dark:bg-${a.stat.color}-900/20`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t(a.stat.icon)),{class:e.normalizeClass(`w-5 h-5 text-${a.stat.color}-600`)},null,8,["class"]))],2),e.createElementVNode("p",Hs,e.toDisplayString(a.stat.title),1)]),e.createElementVNode("p",Ks,e.toDisplayString(a.stat.value),1),e.createElementVNode("p",Gs,e.toDisplayString(a.stat.description),1)])])])]))}}),Ys={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6"},qs=e.defineComponent({__name:"StatsGrid",props:{stats:{}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",Ys,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.stats,n=>(e.openBlock(),e.createBlock(Ws,{key:n.id,stat:n},null,8,["stat"]))),128))]))}}),Xs={class:"p-4 hover:bg-slate-50 dark:hover:bg-slate-700/50 transition-colors"},Zs={class:"flex items-center justify-between"},Js={class:"flex-1"},Qs={class:"flex items-center space-x-3 mb-2"},ei={class:"inline-flex items-center rounded-md border px-2.5 py-0.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-xs bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-600 dark:text-slate-300"},ti={class:"font-semibold text-slate-800 dark:text-slate-100 mb-1"},li={class:"flex items-center space-x-4 text-sm text-slate-500 dark:text-slate-400"},ai={class:"flex items-center"},ni={class:"flex items-center"},ri={class:"flex items-center"},oi={class:"flex items-center space-x-2"},si=e.defineComponent({__name:"ContentItem",props:{item:{}},setup(l){const t=n=>{const r={published:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300",draft:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-yellow-100 dark:bg-yellow-900/30 text-yellow-800 dark:text-yellow-300",review:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-300"};return r[n]||r.draft},a=n=>{if(!n)return"--.--.--";const r=new Date(n);return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(r)};return(n,r)=>{const o=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",Xs,[e.createElementVNode("div",Zs,[e.createElementVNode("div",Js,[e.createElementVNode("div",Qs,[e.createElementVNode("div",ei,e.toDisplayString(n.item.type),1),e.createElementVNode("div",{class:e.normalizeClass(t(n.item.status))},e.toDisplayString(n.item.status||"--"),3)]),e.createElementVNode("h3",ti,e.toDisplayString(n.item.title||"--"),1),e.createElementVNode("div",li,[e.createElementVNode("span",ai,[e.createVNode(e.unref(Bl),{class:"w-4 h-4 mr-1"}),e.createTextVNode(" "+e.toDisplayString(n.item.author||"--"),1)]),e.createElementVNode("span",ni,[e.createVNode(e.unref(_l),{class:"w-4 h-4 mr-1"}),e.createTextVNode(" "+e.toDisplayString(a(n.item.updated_at)||"--.--.--"),1)]),e.createElementVNode("span",ri,[e.createVNode(e.unref(Cl),{class:"w-4 h-4 mr-1"}),e.createTextVNode(" "+e.toDisplayString(n.item.views||"--")+" "+e.toDisplayString(n.$t("dashboard.views")),1)])])]),e.createElementVNode("div",oi,[e.createVNode(o,{to:`/collections/${n.item.object_id}/${n.item.content_id}`,class:"inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors border shadow-sm rounded-md text-xs h-8 w-8 p-0 bg-white border-slate-300 hover:text-accent-foreground hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600"},{default:e.withCtx(()=>[e.createVNode(e.unref(el),{class:"w-4 h-4 dark:text-blue-50"})]),_:1},8,["to"])])])])}}});/*!
|
|
148
|
-
* vue-router v4.4.3
|
|
149
|
-
* (c) 2024 Eduardo San Martin Morote
|
|
150
|
-
* @license MIT
|
|
151
|
-
*/var _n;(function(l){l.pop="pop",l.push="push"})(_n||(_n={}));var Cn;(function(l){l.back="back",l.forward="forward",l.unknown=""})(Cn||(Cn={})),Symbol(process.env.NODE_ENV!=="production"?"navigation failure":"");var Vn;(function(l){l[l.aborted=4]="aborted",l[l.cancelled=8]="cancelled",l[l.duplicated=16]="duplicated"})(Vn||(Vn={})),Symbol(process.env.NODE_ENV!=="production"?"router view location matched":""),Symbol(process.env.NODE_ENV!=="production"?"router view depth":"");const ii=Symbol(process.env.NODE_ENV!=="production"?"router":""),ci=Symbol(process.env.NODE_ENV!=="production"?"route location":"");Symbol(process.env.NODE_ENV!=="production"?"router view location":"");function Mt(){return e.inject(ii)}function di(l){return e.inject(ci)}const ui={class:"lg:col-span-2"},pi={class:"rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm"},mi={class:"flex flex-col space-y-1.5 p-6 border-b border-slate-200 dark:border-slate-700 bg-gradient-to-r from-slate-50 dark:from-slate-800 to-white dark:to-slate-800"},fi={class:"flex items-center justify-between"},hi={class:"tracking-tight text-xl font-semibold text-slate-800 dark:text-slate-100 flex items-center"},gi={class:"p-0"},ki={class:"divide-y divide-slate-100 dark:divide-slate-700"},yi=e.defineComponent({__name:"RecentContent",props:{content:{}},setup(l){const t=Mt(),a=n=>{t.push(n)};return(n,r)=>(e.openBlock(),e.createElementBlock("div",ui,[e.createElementVNode("div",pi,[e.createElementVNode("div",mi,[e.createElementVNode("div",fi,[e.createElementVNode("h3",hi,[e.createVNode(e.unref(xr),{class:"w-5 h-5 mr-2"}),e.createTextVNode(" "+e.toDisplayString(n.$t("dashboard.recentContent")),1)]),e.createElementVNode("button",{onClick:r[0]||(r[0]=o=>a("/settings/collections")),class:"inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border shadow-sm hover:text-accent-foreground h-8 rounded-md px-3 text-xs 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"},e.toDisplayString(n.$t("dashboard.viewAll")),1)])]),e.createElementVNode("div",gi,[e.createElementVNode("div",ki,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.content,o=>(e.openBlock(),e.createBlock(si,{key:o.id,item:o},null,8,["item"]))),128))])])])]))}}),bi={class:"rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm"},xi={class:"flex flex-col space-y-1.5 p-6 border-b border-slate-200 dark:border-slate-700 bg-gradient-to-r from-slate-50 dark:from-slate-800 to-white dark:to-slate-800"},wi={class:"tracking-tight text-lg font-semibold text-slate-800 dark:text-slate-100 flex items-center"},Ei={class:"p-4"},_i={class:"grid grid-cols-2 gap-3"},Ci=["onClick"],Vi={class:"p-2 rounded-lg bg-blue-50 dark:bg-blue-900/20 mb-2 w-fit"},Ni={class:"font-medium text-slate-800 dark:text-slate-100 text-sm mb-1 group-hover:text-slate-900 dark:group-hover:text-slate-50"},Bi={class:"text-xs text-slate-500 dark:text-slate-400 group-hover:text-slate-600 dark:group-hover:text-slate-300"},Si=e.defineComponent({__name:"QuickActions",setup(l){const t=Mt(),{t:a}=qe(),n=[{id:"create-article",title:a("dashboard.createArticle"),description:a("dashboard.createArticleDescription"),icon:Qt,iconColor:"text-blue-500",link:"/collections/pages/create"},{id:"upload-media",title:a("dashboard.uploadMedia"),description:a("dashboard.uploadMediaDescription"),icon:ha,iconColor:"text-purple-500",link:"/media"},{id:"manage-users",title:a("dashboard.manageUsers"),description:a("dashboard.manageUsersDescription"),icon:Bl,iconColor:"text-green-500",link:"/settings/users"}],r=o=>{o&&t.push(o)};return(o,i)=>(e.openBlock(),e.createElementBlock("div",bi,[e.createElementVNode("div",xi,[e.createElementVNode("h3",wi,[e.createVNode(e.unref(Nr),{class:"w-5 h-5 mr-2"}),e.createTextVNode(" "+e.toDisplayString(o.$t("dashboard.quickActions")),1)])]),e.createElementVNode("div",Ei,[e.createElementVNode("div",_i,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(n,s=>e.createElementVNode("button",{key:s.id,class:"p-3 rounded-lg border border-slate-200 transition-all duration-200 text-left group hover:bg-slate-50 hover:shadow-md dark:border-slate-600 bg-white dark:bg-slate-700 dark:hover:bg-slate-600",onClick:c=>r(s==null?void 0:s.link)},[e.createElementVNode("div",Vi,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s==null?void 0:s.icon),{class:e.normalizeClass(`w-4 h-4 ${s==null?void 0:s.iconColor}`)},null,8,["class"]))]),e.createElementVNode("h3",Ni,e.toDisplayString(s==null?void 0:s.title),1),e.createElementVNode("p",Bi,e.toDisplayString(s==null?void 0:s.description),1)],8,Ci)),64))])])]))}}),Ai={class:"w-full max-w-7xl mx-auto space-y-8"},Di={class:"grid grid-cols-1 lg:grid-cols-3 gap-6"},Xl=e.defineComponent({__name:"Dashboard",setup(l){const{t}=qe(),a=e.ref([{id:"total-content",title:t("dashboard.totalContent"),value:"2,847",description:t("dashboard.articlesPostsPages"),change:{value:"+12.5%",isPositive:!0},icon:"file-text",color:"blue"},{id:"active-users",title:t("dashboard.activeUsers"),value:"1,234",description:t("dashboard.monthlyActiveUsers"),change:{value:"+8.2%",isPositive:!0},icon:"users",color:"emerald"},{id:"media-files",title:t("dashboard.mediaFiles"),value:"5,692",description:t("dashboard.imagesVideosDocs"),change:{value:"+23.1%",isPositive:!0},icon:"image",color:"purple"},{id:"new-media",title:t("dashboard.newMediaFiles"),value:"89.2K",description:t("dashboard.thisMonth"),change:{value:"-2.4%",isPositive:!1},icon:"eye",color:"orange"}]),n=e.ref([{id:1,type:"Article",status:"published",title:t("dashboard.gettingStartedWithNextJs14"),author:t("dashboard.sarahJohnson"),updated_at:"2024-01-15",views:1247},{id:2,type:"Post",status:"draft",title:t("dashboard.advancedReactPatterns"),author:t("dashboard.mikeChen"),updated_at:"2024-01-14",views:0},{id:3,type:"Article",status:"published",title:t("dashboard.uiUxDesignPrinciples"),author:t("dashboard.emmaWilson"),updated_at:"2024-01-13",views:892},{id:4,type:"Post",status:"review",title:t("dashboard.databaseOptimizationTips"),author:t("dashboard.alexRodriguez"),updated_at:"2024-01-12",views:0}]),r=i=>{a.value=a.value.map(s=>{var c,d,u,p;switch(s.id){case"total-content":return{...s,value:((c=i.totalContent)==null?void 0:c.toLocaleString())??s.value};case"active-users":return{...s,value:((d=i.totalUsers)==null?void 0:d.toLocaleString())??s.value};case"media-files":return{...s,value:((u=i.totalMediaFiles)==null?void 0:u.toLocaleString())??s.value};case"new-media":return{...s,value:((p=i.newMediaFiles)==null?void 0:p.toLocaleString())??s.value};default:return s}})},o=async()=>{const s=await(await fetch("api/cms-stat")).json();n.value=s.recentContent,r(s.stat)};return e.onMounted(()=>{o()}),(i,s)=>(e.openBlock(),e.createElementBlock("div",Ai,[e.createVNode(vs),e.createVNode(qs,{stats:a.value},null,8,["stats"]),e.createElementVNode("div",Di,[e.createVNode(yi,{content:n.value,class:"lg:col-span-2"},null,8,["content"]),e.createElementVNode("div",null,[e.createVNode(Si)])])]))}}),Li={class:"rounded-xl text-card-foreground shadow-lg bg-white dark:bg-slate-800 backdrop-blur-sm border-2 border-dashed border-slate-300 dark:border-slate-600"},Mi={class:"p-12 text-center"},Ti={class:"text-lg font-medium text-slate-600 dark:text-slate-300 mb-2"},Fi={class:"text-slate-500 dark:text-slate-400 mb-6"},Nn={__name:"EmptyData",props:{title:{type:String,default:()=>"emptyData.title"},description:{type:String,default:()=>"emptyData.description"},buttonText:{type:String,default:()=>"emptyData.buttonText"},showButton:{type:Boolean,default:!0}},emits:["action"],setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",Li,[e.createElementVNode("div",Mi,[a[2]||(a[2]=e.createElementVNode("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-layers w-12 h-12 mx-auto mb-4 text-slate-400 dark:text-slate-500"},[e.createElementVNode("path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z"}),e.createElementVNode("path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"}),e.createElementVNode("path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"})],-1)),e.createElementVNode("h3",Ti,e.toDisplayString(t.$t(l.title)),1),e.createElementVNode("p",Fi,e.toDisplayString(t.$t(l.description)),1),l.showButton?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:a[0]||(a[0]=n=>t.$emit("action")),class:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 shadow h-9 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white"},[a[1]||(a[1]=e.createElementVNode("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-plus w-4 h-4 mr-2"},[e.createElementVNode("path",{d:"M5 12h14"}),e.createElementVNode("path",{d:"M12 5v14"})],-1)),e.createTextVNode(" "+e.toDisplayString(t.$t(l.buttonText)),1)])):e.createCommentVNode("",!0)])]))}},Ii={class:"space-y-6 max-w-7xl mx-auto"},Oi={class:"flex items-center justify-between mb-8"},$i={class:"flex gap-4"},vi={class:"text-3xl font-bold text-slate-800 dark:text-slate-100 mb-2"},Ri={class:"text-slate-600 dark:text-slate-300"},Pi=["href","title"],Ui={class:"relative w-full max-w-sm"},ji={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},zi=["placeholder"],Hi={key:0},Ki={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-6"},Gi=["onClick"],Wi={class:"flex items-start justify-between"},Yi={class:"flex items-start gap-3"},qi={class:"text-sm font-semibold text-gray-800 mb-1"},Xi={class:"text-xs text-gray-600"},Zi={class:"flex items-center gap-2"},Ji={class:"text-xs text-gray-500 whitespace-nowrap"},Qi={key:1,class:"flex items-center justify-center min-h-[400px]"},ec=e.defineComponent({__name:"CollectionsPage",setup(l){const{t,locale:a}=qe(),n=Mt();e.inject("fetchContentTypes");const r=e.ref([]),o=e.ref(""),i=e.computed(()=>{const d=r.value.filter(m=>m.type!=="single"),u=o.value.trim().toLowerCase();return[...u?d.filter(m=>[m==null?void 0:m.title,m==null?void 0:m.name,m==null?void 0:m.id,m==null?void 0:m.description].filter(Boolean).join(" ").toLowerCase().includes(u)):d].sort((m,w)=>m.id==="pages"?-1:w.id==="pages"?1:0)});async function s(){try{const d=await fetch("/api/cms-type?type=collection");if(!d.ok)throw new Error("Failed to fetch collections");const u=await d.json();r.value=u.rows||[]}catch(d){console.error("Error fetching collections:",d)}}const c=d=>{n.push(`/collections/${d.id}`)};return e.onMounted(()=>{s()}),(d,u)=>(e.openBlock(),e.createElementBlock("div",Ii,[e.createElementVNode("div",Oi,[e.createElementVNode("div",$i,[e.createElementVNode("div",null,[e.createElementVNode("h1",vi,e.toDisplayString(d.$t("navigation.collections")),1),e.createElementVNode("p",Ri,e.toDisplayString(d.$t("collections.selectCollection")),1)]),e.createElementVNode("a",{href:`https://cms.opengis.info/${e.unref(a)}/guides/collections/`,target:"_blank",title:d.$t("guide.collections"),class:"mt-2"},[e.createVNode(e.unref($t),{class:"w-5 h-5"})],8,Pi)]),e.createElementVNode("div",Ui,[e.createElementVNode("div",ji,[e.createVNode(e.unref(ka),{class:"w-5 h-5 text-gray-400"})]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":u[0]||(u[0]=p=>o.value=p),type:"text",class:"block w-full py-2 pl-10 pr-3 leading-5 text-gray-900 placeholder-gray-500 transition-colors bg-white border border-gray-300 rounded-md dark:border-gray-600 dark:bg-gray-700 dark:placeholder-gray-400 focus:outline-none focus:ring-sky-500 focus:border-sky-500 dark:text-white sm:text-sm",placeholder:d.$t("collections.searchCollections")},null,8,zi),[[e.vModelText,o.value]])])]),r.value.length>0?(e.openBlock(),e.createElementBlock("div",Hi,[e.createElementVNode("div",Ki,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,p=>(e.openBlock(),e.createElementBlock("button",{key:p.id,onClick:k=>c(p),class:"w-full border border-gray-200 bg-white rounded-lg p-4 text-left hover:shadow-md transition-all hover:border-gray-300"},[e.createElementVNode("div",Wi,[e.createElementVNode("div",Yi,[p.id==="pages"?(e.openBlock(),e.createBlock(e.unref(Vl),{key:0,class:"shrink-0 lucide lucide-page w-5 h-5 text-blue-600"})):(e.openBlock(),e.createBlock(e.unref(St),{key:1,class:"shrink-0 lucide lucide-layers w-5 h-5 text-blue-600"})),e.createElementVNode("div",null,[e.createElementVNode("h4",qi,e.toDisplayString(p.title),1),e.createElementVNode("p",Xi,e.toDisplayString(p.description||"Опис відсутній"),1)])]),e.createElementVNode("div",Zi,[e.createElementVNode("span",Ji,e.toDisplayString(p.entries)+" записів",1),e.createVNode(e.unref(Jt),{class:"w-4 h-4 text-gray-400"})])])],8,Gi))),128))])])):(e.openBlock(),e.createElementBlock("div",Qi,[e.createVNode(Nn)]))]))}}),tc={class:"text-card-foreground border-0 bg-white/80 dark:bg-slate-800/80 backdrop-blur-sm"},lc={class:"p-0"},ac={class:"table-scroll overflow-x-auto"},nc={class:"relative w-full overflow-auto max-h-[calc(100vh-270px)]"},rc={class:"w-full caption-bottom text-sm"},oc={class:"border-b border-slate-200 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors"},sc={class:"flex items-center gap-2"},ic={class:"h-10 text-center px-4 font-semibold text-slate-700 dark:text-slate-300 max-w-32"},cc=["onClick"],dc={key:1,class:"whitespace-nowrap"},uc={key:2,class:"whitespace-nowrap"},pc={key:3,class:"flex items-center"},mc={key:4,class:"inline-flex whitespace-nowrap items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-300"},fc={key:5,class:"flex items-center"},hc={key:6,class:"flex items-center gap-3"},gc={key:8,class:"flex items-center gap-3"},kc={key:11,class:"flex items-center gap-3"},yc={class:"line-clamp-2"},bc={class:"flex justify-end py-2 px-4 align-middle max-w-40"},xc={class:"flex items-center justify-center gap-1"},wc=["onClick"],Ec=["onClick"],Bn=e.defineComponent({__name:"UniversalTable",props:{rows:{},query:{},filterFn:{type:Function},onEdit:{type:Function},onView:{type:Function},onDelete:{type:Function},columns:{},onMore:{type:Function},customRender:{}},emits:["edit","view","delete","more"],setup(l,{emit:t}){const{t:a}=qe();e.ref(null);const n=l,r=t,o=e.computed(()=>!n.query||!n.filterFn?n.rows:n.rows.filter(p=>n.filterFn(p,n.query))),i=p=>{if(!p)return"";const k=new Date(p);return isNaN(k.getTime())?"":p.includes("T")||p.includes(" ")||p.includes(":")?k.toLocaleString("uk-UA",{dateStyle:"medium",timeStyle:"medium"}):k.toLocaleDateString("uk-UA",{dateStyle:"medium"})},s=p=>{switch(p){case"published":return{icon:fa,text:a("common.status.published"),classes:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-200 border-green-200 dark:border-green-700"};case"draft":return{icon:el,text:a("common.status.draft"),classes:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-200 border-yellow-200 dark:border-yellow-700"};case"archived":return{icon:ba,text:a("common.status.archived"),classes:"bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-300 border-gray-200 dark:border-gray-700"};default:return null}},c=(p,k)=>{switch(p){case"edit":r("edit",k),n.onEdit&&n.onEdit(k);break;case"view":r("view",k),n.onView&&n.onView(k);break;case"delete":r("delete",k);break;case"more":r("more",k),n.onMore&&n.onMore(k);break}},d=p=>{c("edit",p)},u=p=>{const k=new Date,m=new Date(p),w=k-m,b=Math.floor(w/1e3),h=Math.floor(b/60),g=Math.floor(h/60),x=Number(Math.floor(g/24)),y=Number(Math.floor(x/7));return y>=2?a("table.time.weeksAgo",{count:y}):y===1?a("table.time.weekAgo"):x>=2?a("table.time.daysAgo",{count:x}):x===1?a("table.time.dayAgo"):g>=2?a("table.time.hoursAgo",{count:g}):g===1?a("table.time.hourAgo"):h>=2?a("table.time.minutesAgo",{count:h}):a(h===1?"table.time.minuteAgo":"table.time.justNow")};return(p,k)=>(e.openBlock(),e.createElementBlock("div",tc,[e.createElementVNode("div",lc,[e.createElementVNode("div",ac,[e.createElementVNode("div",nc,[e.createElementVNode("table",rc,[e.createElementVNode("thead",null,[e.createElementVNode("tr",oc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.columns,m=>(e.openBlock(),e.createElementBlock("th",{key:m.name,class:e.normalizeClass(["h-10 px-4 text-left align-middle font-semibold text-slate-700 dark:text-slate-300 max-w-80",{"min-w-[200px]":["title","name"].includes(m.name),"min-w-[150px]":m.name==="slug","min-w-[250px]":m.name==="description"}])},[e.createElementVNode("div",sc,[m.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m.icon),{key:0,class:"w-5 h-5"})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(m.label||m.title||m.ua||m.name),1)])],2))),128)),e.createElementVNode("th",ic,e.toDisplayString(p.$t("table.actions")),1)])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,m=>(e.openBlock(),e.createElementBlock("tr",{key:m.id||m._id||m.name,class:"transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.columns,(w,b)=>{var h,g,x,y,f;return e.openBlock(),e.createElementBlock("td",{key:w.name,class:e.normalizeClass(["py-2 px-4 align-middle max-w-80",{"font-medium text-slate-800 dark:text-white cursor-pointer":b===0,"text-slate-600 dark:text-slate-400 font-mono text-sm":b!==0}]),onClick:E=>b===0?d(m):void 0},[p.customRender&&p.customRender[w.name]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p.customRender[w.name](m[w.name],m)),{key:0})):e.createCommentVNode("",!0),["published_at","publish_at","created_at","date"].includes(w.name)&&m[w.name]?(e.openBlock(),e.createElementBlock("span",dc,e.toDisplayString(i(m[w.name])),1)):["updated_at","lastModified","last_edit"].includes(w.name)?(e.openBlock(),e.createElementBlock("span",uc,e.toDisplayString(u(m[w.name])||"--"),1)):w.name==="views"?(e.openBlock(),e.createElementBlock("div",pc,[e.createVNode(e.unref(Cl),{class:"w-4 h-4 mr-1"}),e.createTextVNode(" "+e.toDisplayString(((g=(h=m[w.name])==null?void 0:h.toLocaleString)==null?void 0:g.call(h))??m[w.name]),1)])):["entries","fields"].includes(w.name)?(e.openBlock(),e.createElementBlock("div",mc,e.toDisplayString(m[w.name]||"-"),1)):w.name==="type"?(e.openBlock(),e.createElementBlock("div",fc,[e.createElementVNode("div",{class:e.normalizeClass(["whitespace-nowrap inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors border-transparent hover:bg-secondary/80",m[w.name]==="pages"?"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300":"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300"])},e.toDisplayString(m[w.name]||"-"),3)])):w.name==="name"?(e.openBlock(),e.createElementBlock("div",hc,[m.type==="single"?(e.openBlock(),e.createBlock(e.unref(Vl),{key:0,class:"shrink-0 lucide lucide-page w-5 h-5 text-blue-600"})):(e.openBlock(),e.createBlock(e.unref(St),{key:1,class:"shrink-0 lucide lucide-layers w-5 h-5 text-blue-600"})),e.createTextVNode(" "+e.toDisplayString(m[w.name]),1)])):w.name==="status"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[s(m[w.name])?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["whitespace-nowrap rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors hover:bg-secondary/80 flex items-center w-fit bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-300 dark:border-green-700",(x=s(m[w.name]))==null?void 0:x.classes])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent((y=s(m[w.name]))==null?void 0:y.icon),{class:"w-3 h-3 mr-1"})),e.createTextVNode(" "+e.toDisplayString((f=s(m[w.name]))==null?void 0:f.text),1)],2)):e.createCommentVNode("",!0)],64)):w.name==="slug"?(e.openBlock(),e.createElementBlock("div",gc,e.toDisplayString(m[w.name]?"/"+m[w.name]:"-"),1)):w.name==="color"?(e.openBlock(),e.createElementBlock("span",{key:9,class:e.normalizeClass(["w-4 h-4 rounded-full block ml-2","bg-["+m[w.name]+"]"])},null,2)):w.name==="enabled"?(e.openBlock(),e.createElementBlock("span",{key:10,class:e.normalizeClass(["whitespace-nowrap rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors hover:bg-secondary/80 flex items-center w-fit",m[w.name]?"bg-green-100 text-green-800 border-green-200":"bg-red-100 text-red-800 border-red-200"])},e.toDisplayString(m[w.name]?"Доступ":"Заборонено"),3)):(e.openBlock(),e.createElementBlock("div",kc,[e.createElementVNode("p",yc,e.toDisplayString(m[w.name]||"-"),1)]))],10,cc)}),128)),e.createElementVNode("td",bc,[e.createElementVNode("div",xc,[e.createElementVNode("button",{onClick:e.withModifiers(w=>c("edit",m),["stop"]),class:"inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:text-slate-200 hover:border-blue-300 hover:bg-blue-50 hover:text-blue-600",title:"Edit"},[e.createVNode(e.unref(Cr),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-green-600 dark:group-hover:text-blue-50"})],8,wc),e.createElementVNode("button",{onClick:e.withModifiers(w=>c("delete",m),["stop"]),class:"inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:text-slate-200 hover:border-blue-300 hover:bg-blue-50 hover:text-blue-600",title:"Preview"},[e.createVNode(e.unref(ya),{class:"w-4 h-4 text-slate-800 dark:text-slate-200 group-hover:text-red-600 dark:group-hover:text-blue-50"})],8,Ec),e.renderSlot(p.$slots,"actions",{row:m})])])]))),128))])])])])])]))}}),_c={class:"flex items-center justify-between px-6 py-4 border-t border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-800"},Cc={class:"flex justify-between flex-1 sm:hidden"},Vc={class:"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"},Nc={class:"relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"},Bc={class:"hidden sm:flex-1 sm:flex sm:items-center sm:justify-between"},Sc={class:"text-sm text-slate-600 dark:text-slate-400"},Ac={class:"font-medium text-slate-800 dark:text-slate-100"},Dc={class:"font-medium text-slate-800 dark:text-slate-100"},Lc={class:"relative z-0 inline-flex space-x-2 rounded-md shadow-sm","aria-label":"Pagination"},Mc=["disabled"],Tc={class:"sr-only"},Fc={class:"space-x-1"},Ic={key:0,class:"px-2 py-2 text-gray-400"},Oc=["onClick"],$c=["disabled"],vc={class:"sr-only"},Sn=e.defineComponent({__name:"UniversalTablePagination",props:e.mergeModels({total:{},count:{},limit:{}},{page:{},pageModifiers:{}}),emits:["update:page"],setup(l){const t=e.useModel(l,"page"),a=e.computed(()=>Math.ceil(l.total/l.limit)),n=e.computed(()=>{const o=[];if(a.value<=4){for(let c=1;c<=a.value;c++)o.push(c);return o}const i=Math.max(2,t.value-2),s=Math.min(a.value-1,t.value+2);o.push(1),i>2&&o.push("ellipsis");for(let c=i;c<=s;c++)o.push(c);return s<a.value-1&&o.push("ellipsis"),o.push(a.value),o});return(r,o)=>(e.openBlock(),e.createElementBlock("div",_c,[e.createElementVNode("div",Cc,[e.createElementVNode("button",Vc,e.toDisplayString(r.$t("common.pagination.previous")),1),e.createElementVNode("button",Nc,e.toDisplayString(r.$t("common.pagination.next")),1)]),e.createElementVNode("div",Bc,[e.createElementVNode("div",null,[e.createElementVNode("p",Sc,[e.createTextVNode(e.toDisplayString(r.$t("common.pagination.showing"))+" ",1),e.createElementVNode("span",Ac,e.toDisplayString(r.count),1),e.createTextVNode(" "+e.toDisplayString(r.$t("common.pagination.of"))+" ",1),e.createElementVNode("span",Dc,e.toDisplayString(r.total),1),e.createTextVNode(" "+e.toDisplayString(r.$t("common.pagination.results")),1)])]),e.createElementVNode("div",null,[e.createElementVNode("nav",Lc,[e.createElementVNode("button",{onClick:o[0]||(o[0]=i=>t.value=t.value>1?t.value-1:1),disabled:t.value===1,class:"inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors border shadow-sm rounded-md text-xs h-8 w-8 p-0 bg-white border-slate-300 text-slate-600 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed 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"},[e.createElementVNode("span",Tc,e.toDisplayString(r.$t("common.pagination.previous")),1),e.createVNode(e.unref(Er),{class:"w-5 h-5"})],8,Mc),e.createElementVNode("div",Fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(i,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i+"-"+s},[i==="ellipsis"?(e.openBlock(),e.createElementBlock("span",Ic,"...")):(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c=>t.value=i,class:e.normalizeClass(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors h-8 w-8 p-0 text-sm rounded-md",{"border shadow-sm hover:text-accent-foreground bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-600 dark:text-slate-300 hover:border-blue-600 hover:bg-slate-50 dark:hover:bg-slate-600":i!==t.value,"shadow bg-blue-600 hover:bg-blue-700 text-white border-blue-600":i===t.value}])},e.toDisplayString(i),11,Oc))],64))),128))]),e.createElementVNode("button",{onClick:o[1]||(o[1]=i=>t.value=t.value<Math.ceil(r.total/r.limit)?t.value+1:Math.ceil(r.total/r.limit)),disabled:t.value===Math.ceil(r.total/r.limit),class:"inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors border shadow-sm rounded-md text-xs h-8 w-8 p-0 bg-white border-slate-300 text-slate-600 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed 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"},[e.createElementVNode("span",vc,e.toDisplayString(r.$t("common.pagination.next")),1),e.createVNode(e.unref(Jt),{class:"w-5 h-5"})],8,$c)])])])]))}}),Tt=(l,t)=>{const a=l.__vccOpts||l;for(const[n,r]of t)a[n]=r;return a},Rc={key:0,class:"fixed inset-0 z-[2000] flex items-center justify-center bg-gray-600 bg-opacity-75"},Pc={key:0,class:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg",role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title"},Uc={class:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},jc={class:"mt-3 text-center sm:mt-5"},zc={id:"dialog-title",class:"text-base font-semibold text-gray-900"},Hc={class:"mt-2"},Kc={class:"text-sm text-gray-500"},Gc={class:"bg-gray-50 px-4 py-3 sm:px-6 flex justify-center"},Wc={key:1,class:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg",role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title"},Yc={class:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},qc={class:"sm:flex sm:items-start"},Xc={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Zc={id:"dialog-title",class:"text-base font-semibold text-gray-900"},Jc={class:"mt-2"},Qc={class:"text-sm text-gray-500"},ed={key:0,class:"mt-2"},td=["placeholder"],ld=e.defineComponent({__name:"message-box",props:{type:{default:"error"},mode:{default:"confirm"},title:{default:""},message:{default:""},confirmButtonText:{default:"OK"},cancelButtonText:{default:"Cancel"},modelValue:{type:Boolean,default:!1},promptPlaceholder:{default:""},align:{type:Boolean,default:!0}},emits:["confirm","cancel","update:modelValue"],setup(l,{emit:t}){const a=e.ref(null);e.onMounted(()=>{var w;(w=a.value)==null||w.focus()});const n={success:()=>e.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",class:"size-6 text-green-600"},[e.h("path",{d:"m4.5 12.75 6 6 9-13.5","stroke-linecap":"round","stroke-linejoin":"round"})]),error:()=>e.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",class:"size-6 text-red-600"},[e.h("path",{d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z","stroke-linecap":"round","stroke-linejoin":"round"})]),info:()=>e.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"size-6 text-blue-600"},[e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 16h-1v-4h-1m1-4h.01M12 20a8 8 0 100-16 8 8 0 000 16z"})]),warning:()=>e.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"size-6 text-yellow-600"},[e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 17a1 1 0 0 0 .87 1.5h18.62a1 1 0 0 0 .87-1.5L13.71 3.86a1 1 0 0 0-1.42 0z"})])},r=l,o=t,i=e.ref(r.modelValue),s=e.ref("");e.watch(()=>r.modelValue,w=>{i.value=w,w===!0&&r.mode==="prompt"&&(s.value="")});function c(w){i.value=!1,o("update:modelValue",!1),w==="confirm"&&r.mode==="prompt"?o("confirm",s.value):o(w)}function d(){c("confirm")}const u=e.computed(()=>{switch(r.type){case"success":return"bg-green-100";case"error":return"bg-red-100";case"info":return"bg-blue-100";case"warning":return"bg-yellow-100";default:return"bg-gray-100"}}),p=e.computed(()=>r.type==="warning"?"bg-orange-600 hover:bg-orange-500":r.type==="success"?"bg-green-600 hover:bg-green-500":r.type==="error"?"bg-red-600 hover:bg-red-500":"bg-blue-600 hover:bg-blue-500"),k=e.computed(()=>n[r.type||"error"]||n.error),m=e.computed(()=>r.title&&r.title.trim()!==""?r.title:r.type?r.type.charAt(0).toUpperCase()+r.type.slice(1):"Notification");return(w,b)=>{const h=e.resolveDirective("focus");return e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[i.value?(e.openBlock(),e.createElementBlock("div",Rc,[w.mode==="alert"?(e.openBlock(),e.createElementBlock("div",Pc,[e.createElementVNode("div",Uc,[e.createElementVNode("div",null,[b[4]||(b[4]=e.createElementVNode("div",{class:"mx-auto flex size-12 shrink-0 items-center justify-center rounded-full bg-green-100"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",class:"size-6 text-green-600"},[e.createElementVNode("path",{d:"m4.5 12.75 6 6 9-13.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),e.createElementVNode("div",jc,[e.createElementVNode("h3",zc,e.toDisplayString(m.value),1),e.createElementVNode("div",Hc,[e.createElementVNode("p",Kc,e.toDisplayString(w.message),1)])])])]),e.createElementVNode("div",Gc,[e.createElementVNode("button",{type:"button",onClick:b[0]||(b[0]=g=>c("confirm")),class:"inline-flex min-w-[70px] w-full justify-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-xs hover:bg-indigo-500 sm:w-auto"},e.toDisplayString(w.confirmButtonText),1)])])):(e.openBlock(),e.createElementBlock("div",Wc,[e.createElementVNode("div",Yc,[e.createElementVNode("div",qc,[e.createElementVNode("div",{class:e.normalizeClass(["mx-auto flex size-12 shrink-0 items-center justify-center rounded-full sm:mx-0 sm:size-10",u.value])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(k.value)))],2),e.createElementVNode("div",Xc,[e.createElementVNode("h3",Zc,e.toDisplayString(m.value),1),e.createElementVNode("div",Jc,[e.createElementVNode("p",Qc,e.toDisplayString(w.message),1)]),w.mode==="prompt"?(e.openBlock(),e.createElementBlock("div",ed,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":b[1]||(b[1]=g=>s.value=g),placeholder:w.promptPlaceholder,class:"w-full rounded-md py-1.5 pl-2 text-gray-900 shadow-sm placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6",onKeyup:e.withKeys(d,["enter"]),type:"text"},null,40,td),[[e.vModelText,s.value],[h]])])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",{class:e.normalizeClass(["bg-gray-50 px-4 py-3",w.align?"sm:flex sm:flex-row-reverse sm:px-6 gap-x-2.5":"sm:flex sm:flex-row sm:px-6 gap-x-2.5"])},[e.createElementVNode("button",{type:"button",onClick:b[2]||(b[2]=g=>c("confirm")),class:e.normalizeClass(["inline-flex w-full justify-center rounded-md px-3 py-2 text-sm font-semibold text-white shadow-xs sm:w-auto",p.value])},e.toDisplayString(w.confirmButtonText),3),e.createElementVNode("button",{type:"button",onClick:b[3]||(b[3]=g=>c("cancel")),class:"mt-3 inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 hover:bg-gray-50 sm:mt-0 sm:w-auto"},e.toDisplayString(w.cancelButtonText),1)],2)]))])):e.createCommentVNode("",!0)])}}}),ad=Tt(ld,[["__scopeId","data-v-047caa71"]]);e.defineComponent({props:{modelValue:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},disabled:{type:Boolean,default:()=>!1}},data(){return{}},mounted(){this.modelValue||this.$emit("update:modelValue",!1)},computed:{modelState:{get(){return this.modelValue},set(l){this.$emit("update:modelValue",l)}},labelCursorClasses(){return[{"cursor-not-allowed":this.disabled},{"cursor-pointer":!this.disabled}]}},methods:{handleEnterDown(l){const{keyCode:t}=l;t===13&&(this.modelState=!this.modelState)},addKeyHandler(){window.addEventListener("keydown",this.handleEnterDown)},removeKeyHandler(){window.removeEventListener("keydown",this.handleEnterDown)}}});const nd={key:0,class:"vsTailwind ui-dialog__wrapper text-gray-800"},rd={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},od={class:"font-medium text-gray-800 dark:text-[#ffffff]"},sd={class:"ui-dialog__content p-4"},id={key:0,class:"flex justify-end gap-x-2"},cd={key:1,class:"flex justify-end items-center gap-x-2 py-3 px-4 border-t border-gray-200 dark:border-neutral-700"},dd=e.defineComponent({__name:"vs-modal",props:{title:{default:""},template:{},visible:{type:Boolean,default:!1},size:{default:"small"},closeClickBack:{type:Boolean,default:!1},content:{},buttonText:{},contentProps:{},teleport:{default:"body"}},emits:["update:visible","close","done"],setup(l,{emit:t}){const a=l,n=t,r=e.computed(()=>a.size==="small"?"md:w-5/12 w-9/12":a.size==="medium"?"md:w-6/12 w-9/12":"lg:w-7/12 w-11/12"),o=e.useAttrs();function i(){n("done")}function s(){n("update:visible",!1),n("close")}function c(u){u.key==="Escape"&&s()}function d(u,p){p&&u.target.classList.contains("vs-dialog-overlay")&&s()}return e.onMounted(()=>{window.addEventListener("keydown",c)}),e.onUnmounted(()=>{window.removeEventListener("keydown",c)}),(u,p)=>(e.openBlock(),e.createBlock(e.Teleport,{to:u.teleport},[u.visible?(e.openBlock(),e.createElementBlock("div",nd,[e.createElementVNode("div",{onMousedown:p[0]||(p[0]=k=>d(k,u.closeClickBack)),class:e.normalizeClass(["vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 bg-black bg-opacity-50",[e.unref(o).class]])},[e.createVNode(e.Transition,{name:"content",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl",r.value])},[e.createElementVNode("div",rd,[e.createElementVNode("h3",od,e.toDisplayString(u.title),1),e.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:s},[...p[1]||(p[1]=[e.createElementVNode("span",{class:"sr-only"},"Close",-1),e.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",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"},[e.createElementVNode("path",{d:"M18 6 6 18"}),e.createElementVNode("path",{d:"m6 6 12 12"})],-1)])])]),e.createElementVNode("div",sd,[e.renderSlot(u.$slots,"default",{},void 0,!0)]),u.$slots.footer?(e.openBlock(),e.createElementBlock("div",id,[e.renderSlot(u.$slots,"footer",{handleClose:s},void 0,!0)])):e.createCommentVNode("",!0),u.buttonText?(e.openBlock(),e.createElementBlock("div",cd,[e.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:s}," Close "),e.createElementVNode("button",{type:"button",onClick:i,class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 focus:outline-hidden focus:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none"},e.toDisplayString(u.buttonText),1)])):e.createCommentVNode("",!0)],2)]),_:3})],34)])):e.createCommentVNode("",!0)],8,["to"]))}}),pl=Tt(dd,[["__scopeId","data-v-a6807cab"]]),ud={},pd={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 text-green-600"};function md(l,t){return e.openBlock(),e.createElementBlock("svg",pd,[...t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])])}const fd=Tt(ud,[["render",md]]),hd={},gd={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"orange",class:"size-6 text-orange-600"};function kd(l,t){return e.openBlock(),e.createElementBlock("svg",gd,[...t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])])}const yd=Tt(hd,[["render",kd]]),bd={},xd={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 text-blue-600"};function wd(l,t){return e.openBlock(),e.createElementBlock("svg",xd,[...t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"},null,-1)])])}const Ed=Tt(bd,[["render",wd]]),_d={},Cd={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"red",class:"size-6 text-red-600"};function Vd(l,t){return e.openBlock(),e.createElementBlock("svg",Cd,[...t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)])])}const Nd=Tt(_d,[["render",Vd]]),Bd={class:"rounded-md border border-gray-300 bg-white p-4 shadow-sm"},Sd={class:"flex items-start gap-4 opacity-100 scale-5 transition-all duration-300"},Ad={class:"flex-1"},Dd={class:"font-medium text-gray-900"},Ld={class:"mt-0.5 text-sm text-gray-700"},Md=e.defineComponent({__name:"vs-notify",props:{type:{},title:{},message:{}},setup(l){const t={success:fd,warning:yd,error:Nd,info:Ed};return(a,n)=>(e.openBlock(),e.createElementBlock("div",Bd,[e.createElementVNode("div",Sd,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t[a.type]))),e.createElementVNode("div",Ad,[e.createElementVNode("strong",Dd,e.toDisplayString(a.title),1),e.createElementVNode("p",Ld,e.toDisplayString(a.message),1)]),n[0]||(n[0]=e.createElementVNode("button",{class:"m-3 rounded-full p-1.5 text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700",type:"button","aria-label":"Dismiss notify"},[e.createElementVNode("span",{class:"sr-only"},"Dismiss popup"),e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})])],-1))])]))}}),Td=l=>{const{message:t,title:a,mode:n="confirm",type:r="info",confirmButtonText:o,cancelButtonText:i,onConfirm:s,onCancel:c,cascade:d,confirmButtonStyle:u,cancelButtonStyle:p}=l,k=document.querySelector("body");if(!k){console.error('Modal root element with id "#modal" not found!');return}const m=document.createElement("div");k.appendChild(m);const w=()=>{m.remove()};e.createApp({render(){return e.h(ad,{title:a,message:t,mode:n,type:r,cascade:d,confirmButtonText:o,cancelButtonText:i,cancelButtonStyle:p,confirmButtonStyle:u,modelValue:!0,onConfirm:()=>{s==null||s(),w()},onCancel:()=>{c==null||c(),w()}})}}).mount(m)};e.reactive({visible:!0});const Fd=l=>{const{template:t="",title:a="",content:n,contentProps:r={},size:o="medium"}=l,i=document.querySelector("body");if(!i)return console.error('Modal root element with id "#modal" not found!'),{close:()=>{}};const s=document.createElement("div");i.appendChild(s);const c={title:a,template:t,visible:!0,size:o,closeClickBack:!0,onClose:u},d=e.createApp({render(){return e.h(pl,c,{default:()=>[n?e.h(n,r):e.h("p",t)]})}});function u(){d.unmount(),s.remove()}return d.mount(s),{close:u}},ml={top:"top-4 left-1/2 transform -translate-x-1/2","left-bottom":"bottom-4 left-4 transform","right-bottom":"bottom-4 right-4 transform",bottom:"bottom-4 left-1/2 transform -translate-x-1/2"},ke=l=>{var c;const{type:t="info",title:a,message:n,position:r="right-bottom"}=l||{};let o=document.querySelector("#notify-root");o||(o=document.createElement("div"),o.id="notify-root",o.className=`fixed z-[2000] flex flex-col gap-3 ${ml[r]} p-6 max-w-md mx-auto font-sans antialiased`,document.body.appendChild(o)),o.className.includes(ml[r])||(Object.values(ml).forEach(d=>{o.classList.remove(...d.split(" "))}),o.classList.add(...ml[r].split(" ")));const i=document.createElement("div");o.appendChild(i);const s=e.createApp({render(){return e.h(Md,{type:t,title:a,message:n,onClose:()=>{s.unmount(),i.remove()}})}});s.mount(i),(c=i.querySelector("button"))==null||c.addEventListener("click",()=>{i.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{s.unmount(),i.remove()},350)}),setTimeout(()=>{i.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{s.unmount(),i.remove()},350)},3500)},Id={class:"w-full relative"},Od={key:0,class:"text-[14px] font-medium text-gray-900 mb-2"},$d={class:"opacity-100"},vd={key:0,class:"text-red-500 text-[14px]"},Rd={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},Pd=e.defineComponent({__name:"vs-layout-default",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(l){const t=e.ref("uk"),a=n=>{n.detail.key==="locale"&&(t.value=n.detail.newValue)};return e.onMounted(()=>{t.value=localStorage.locale,window.addEventListener("storage",a)}),e.onUnmounted(()=>{window.removeEventListener("resize",a)}),(n,r)=>{var o,i;return e.openBlock(),e.createElementBlock("div",Id,[n.ua||n.label?(e.openBlock(),e.createElementBlock("div",Od,[e.createElementVNode("span",$d,e.toDisplayString(n.item[t.value]||n.ua||n.label),1),(i=(o=n.item)==null?void 0:o.rules)!=null&&i.includes("required")?(e.openBlock(),e.createElementBlock("span",vd,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"default",e.mergeProps(n.$attrs,{class:{"opacity-60":n.item.disabled}})),n.error?(e.openBlock(),e.createElementBlock("span",Rd,e.toDisplayString(n.error),1)):e.createCommentVNode("",!0)])}}}),Ud={class:"w-full relative flex flex-row items-center gap-2"},jd={key:0,class:"text-red-500 text-[14px]"},zd={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},Hd=e.defineComponent({__name:"vs-layout-horizontal",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{default:()=>({container:12,label:3})}},setup(l){const t=l,a=e.computed(()=>t.columns??{container:12,label:3}),n=e.computed(()=>{const{container:s,label:c}=a.value;return!s||s<=0?0:Math.min(Math.max(c??0,0),s)/s}),r=e.computed(()=>{var s;return((s=t.item)==null?void 0:s.type)==="html"||n.value<=0?!1:!!(t.ua||t.label)}),o=e.computed(()=>{if(!r.value)return{};const s=`${n.value*100}%`;return{flexBasis:s,maxWidth:s}}),i=e.computed(()=>{var p;const{container:s,label:c}=a.value;if(!s||s<=0)return{};if(((p=t.item)==null?void 0:p.type)==="html")return{flexBasis:"100%",maxWidth:"100%"};if(!r.value)return{flexBasis:"100%",maxWidth:"100%"};const d=Math.max(s-Math.max(c??0,0),0)/s;if(!d)return{};const u=`${d*100}%`;return{flexBasis:u,maxWidth:u}});return(s,c)=>{var d,u;return e.openBlock(),e.createElementBlock("div",Ud,[r.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"text-sm text-gray-900 font-medium flex shrink-0",style:e.normalizeStyle(o.value)},[e.createTextVNode(e.toDisplayString(s.ua||s.label)+" ",1),(u=(d=s.item)==null?void 0:d.rules)!=null&&u.includes("required")&&(s.ua||s.label)?(e.openBlock(),e.createElementBlock("span",jd,"*")):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"flex-1 min-w-0",style:e.normalizeStyle(i.value)},[e.renderSlot(s.$slots,"default",e.normalizeProps(e.guardReactiveProps(s.$attrs)))],4),s.error?(e.openBlock(),e.createElementBlock("span",zd,e.toDisplayString(s.error),1)):e.createCommentVNode("",!0)])}}}),Kd={class:"w-full relative"},Gd={key:0,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},Wd=e.defineComponent({__name:"vs-layout-inline",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",Kd,[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps(t.$attrs))),t.error?(e.openBlock(),e.createElementBlock("span",Gd,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),Yd={class:"flex-1 min-w-0"},qd={key:0,class:"text-sm font-medium text-slate-700 dark:text-slate-200 flex items-center gap-1"},Xd={class:"truncate"},Zd={key:0,class:"text-red-500 text-[14px]"},Jd={key:1,class:"text-xs text-slate-500 dark:text-slate-400"},Qd={key:0,class:"mt-1 text-xs text-red-500"},eu=e.defineComponent({__name:"vs-layout-settings",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(l){const t=l,a=e.ref("uk");e.computed(()=>{var s;return((s=t.item??{})==null?void 0:s[a.value])??t.ua??t.label??""});const n=e.computed(()=>{var s;return((s=t.item)==null?void 0:s.description)??""}),r=e.computed(()=>{var s;return Array.isArray((s=t.item)==null?void 0:s.rules)&&t.item.rules.includes("required")}),o=e.computed(()=>(typeof t.error=="string"?t.error:"")??""),i=s=>{s.key==="locale"&&(a.value=s.newValue??"uk")};return e.onMounted(()=>{try{typeof localStorage<"u"&&localStorage.locale&&(a.value=localStorage.locale)}catch{}window.addEventListener("storage",i)}),e.onUnmounted(()=>{window.removeEventListener("storage",i)}),(s,c)=>{var d;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full relative",{"opacity-60":(d=s.item)==null?void 0:d.disabled}])},[e.createElementVNode("div",{class:e.normalizeClass(["gap-2 md:flex-row md:items-center md:justify-between",[["switcher","native-select"].includes(s.item.type)?"flex flex-col":""]])},[e.createElementVNode("div",Yd,[s.ua||s.label?(e.openBlock(),e.createElementBlock("p",qd,[e.createElementVNode("span",Xd,e.toDisplayString(s.item[a.value]||s.ua||s.label),1),r.value?(e.openBlock(),e.createElementBlock("span",Zd,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),n.value?(e.openBlock(),e.createElementBlock("p",Jd,e.toDisplayString(n.value),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["w-full",["select","native-select"].includes(s.item.type)?"md:w-[30%]":"md:w-auto"])},[e.renderSlot(s.$slots,"default",e.normalizeProps(e.guardReactiveProps(s.$attrs)))],2)],2),o.value?(e.openBlock(),e.createElementBlock("p",Qd,e.toDisplayString(o.value),1)):e.createCommentVNode("",!0)],2)}}}),tu={default:Pd,horizontal:Hd,inline:Wd,settings:eu};function Ue(l){return{inputClass:e.computed(()=>{const t=`disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${(l==null?void 0:l.primaryColor)||"blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;return(l==null?void 0:l.size)==="sm"?`${t}h-[32px]`:`${t}h-[38px]`})}}const lu=["placeholder","disabled"],au=e.defineComponent({__name:"vs-input-password",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=Ue(t.style),n=e.useModel(l,"modelValue"),r=e.computed(()=>!!t.disabled),o=e.computed(()=>t.placeholder??"");return(i,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"password","onUpdate:modelValue":s[0]||(s[0]=c=>n.value=c),placeholder:o.value,disabled:r.value,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a),{"!border-red-600":i.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,lu)),[[e.vModelText,n.value]])}}),nu=["placeholder","disabled"],fl=e.defineComponent({__name:"vs-input-text",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=Ue(t.style),n=e.useModel(l,"modelValue"),r=e.computed(()=>!!t.disabled),o=e.computed(()=>t.placeholder??"");return(i,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"text","onUpdate:modelValue":s[0]||(s[0]=c=>n.value=c),placeholder:o.value,disabled:r.value,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a),{"!border-red-600":i.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,nu)),[[e.vModelText,n.value]])}}),ru=["placeholder","disabled","min","max"],ou=e.defineComponent({__name:"vs-input-number",props:e.mergeModels({min:{},max:{},style:{default:()=>({})},customClass:{},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=Ue(t.style),n=e.useModel(l,"modelValue"),r=e.computed(()=>!!t.disabled);return(o,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"number",step:"any","onUpdate:modelValue":i[0]||(i[0]=s=>n.value=s),placeholder:o.placeholder,disabled:r.value,class:e.normalizeClass(["py-1.5 px-3 block w-full bg-white",[e.unref(a)]]),style:{border:"1px solid #CFD9E0"},min:o.min,max:o.max},null,10,ru)),[[e.vModelText,n.value]])}}),ce=(l,t)=>{const a=l.__vccOpts||l;for(const[n,r]of t)a[n]=r;return a},su={},iu={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function cu(l,t){return e.openBlock(),e.createElementBlock("svg",iu,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const du=ce(su,[["render",cu]]),uu={class:"flex items-center gap-[4px]"},pu=["value","id","disabled"],mu=["for"],fu={class:"text-[14px] text-gray-700 flex items-center dark:text-neutral-400"},hu=e.defineComponent({__name:"vs-checkbox-default",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},id:{},modelValue:{default:""},info:{},error:{}},emits:["update:modelValue"],setup(l,{emit:t}){const a=t,n=l,r=e.computed({get:()=>n.modelValue,set:i=>a("update:modelValue",i)}),o=e.computed(()=>!!n.disabled);return(i,s)=>(e.openBlock(),e.createElementBlock("div",uu,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",value:i.value,"onUpdate:modelValue":s[0]||(s[0]=c=>r.value=c),class:e.normalizeClass(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer",{"!cursor-not-allowed":o.value}]),id:i.id,disabled:o.value},null,10,pu),[[e.vModelCheckbox,r.value]]),e.createElementVNode("label",{for:i.id,class:e.normalizeClass(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300",{"!cursor-not-allowed":o.value}])},[e.createElementVNode("div",{class:e.normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded",[r.value?"bg-blue-600 border-blue-600":"bg-white border-gray-600",i.error?"border-red-600":""]])},[e.createVNode(du,{height:"12",width:"12"})],2),e.createElementVNode("span",fu,[e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(i.label),1)])])],10,mu)]))}}),gu=["name","value","disabled"],ku={class:"flex items-center gap-[6px] text-[14px]"},yu={key:0,class:"text-[16px]"},bu=["src"],xu=e.defineComponent({__name:"vs-checkbox-buttons",props:{value:{type:[String,Number,Boolean],default:""},label:{default:""},modelValue:{default:""},disabled:{type:Boolean},id:{},icon:{},imgUrl:{},style:{}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l,n=t,r=e.computed({get:()=>a.modelValue,set:s=>{n("update:modelValue",s)}}),o=e.computed(()=>Array.isArray(r.value)?r.value.includes(a.value):r.value===!0||r.value===a.value),i=e.computed(()=>{var s,c;return((s=a.style)==null?void 0:s.size)==="xs"?"p-1.5 text-xs":((c=a.style)==null?void 0:c.size)==="lg"?"p-3.5 text-[20px]":"p-2.5 text-xs"});return(s,c)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg",[i.value,o.value?"ring-blue-500":"border border-gray-200 ring-transparent"]])},[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"hidden",name:s.id,value:s.value,"onUpdate:modelValue":c[0]||(c[0]=d=>r.value=d),disabled:s.disabled},null,8,gu),[[e.vModelCheckbox,r.value]]),e.createElementVNode("span",ku,[s.icon||s.imgUrl?(e.openBlock(),e.createElementBlock("span",yu,[s.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(s.icon)},null,2)):e.createCommentVNode("",!0),s.imgUrl?(e.openBlock(),e.createElementBlock("img",{key:1,src:s.imgUrl,width:"16",height:"16",alt:"icon"},null,8,bu)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(s.label),1)])])],2))}}),wu={class:"flex items-center"},Zl=e.defineComponent({__name:"vs-input-checkbox-item",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},view:{default:"default"},modelValue:{type:[Boolean,Array],default:!1},icon:{},imgUrl:{},slots:{},option:{},style:{},error:{default:""}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l,n=t,r=`radio-${Math.floor(Math.random()*1e4)}`,o=e.computed({get:()=>Array.isArray(a.modelValue)?Array.isArray(a.modelValue)&&a.modelValue.includes(a.value):a.modelValue,set:s=>{if(Array.isArray(a.modelValue)){let c=[...a.modelValue];s?c.includes(a.value)||c.push(a.value):c=c.filter(d=>d!==a.value),n("update:modelValue",c)}else n("update:modelValue",s)}}),i=e.ref(`vs-checkbox-${a.view||"default"}`);return(s,c)=>{var d;return e.openBlock(),e.createElementBlock("div",wu,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value==="vs-checkbox-buttons"?e.unref(xu):e.unref(hu)),{value:s.value,label:s.label,info:(d=s.option)==null?void 0:d.info,disabled:s.disabled,modelValue:o.value,"onUpdate:modelValue":c[0]||(c[0]=u=>o.value=u),id:r,icon:s.icon,imgUrl:s.imgUrl,style:e.normalizeStyle(s.style),error:s.error},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.label),1)]),_:1},8,["value","label","info","disabled","modelValue","icon","imgUrl","style","error"]))])}}}),Eu={},_u={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"};function Cu(l,t){return e.openBlock(),e.createElementBlock("svg",_u,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const Vu=ce(Eu,[["render",Cu]]),Nu={},Bu={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x"};function Su(l,t){return e.openBlock(),e.createElementBlock("svg",Bu,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),e.createElementVNode("path",{d:"M6 6l12 12"},null,-1)]))}const Au=ce(Nu,[["render",Su]]),Du={},Lu={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"};function Mu(l,t){return e.openBlock(),e.createElementBlock("svg",Lu,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M12 9h.01"},null,-1),e.createElementVNode("path",{d:"M11 12h1v4h1"},null,-1),e.createElementVNode("path",{d:"M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z"},null,-1)]))}const Tu=ce(Du,[["render",Mu]]),Fu={key:0,class:"flex items-start gap-x-1"},Iu={key:0,class:"text-red-500 text-[14px]"},Ou=["title"],$u=["disabled"],An=e.defineComponent({__name:"vs-input-switcher",props:e.mergeModels({rules:{default:()=>[]},view:{default:"checkbox"},label:{default:""},i:{default:""},text:{default:""},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue");return(n,r)=>{var o,i;return t.view==="checkbox"?(e.openBlock(),e.createElementBlock("div",Fu,[e.createVNode(Zl,{modelValue:a.value,"onUpdate:modelValue":r[0]||(r[0]=s=>a.value=s),label:n.text,error:n.error||""},null,8,["modelValue","label","error"]),(o=n.rules)!=null&&o.includes("required")?(e.openBlock(),e.createElementBlock("span",Iu,"*")):e.createCommentVNode("",!0),n.i?(e.openBlock(),e.createElementBlock("button",{key:1,class:"cursor-pointer",title:n.i,onClick:r[1]||(r[1]=e.withModifiers(()=>{},["prevent"]))},[e.createVNode(e.unref(Tu),{class:"text-gray-500 w-[14px] h-[14px]"})],8,Ou)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50",[a.value?`bg-${((i=n.style)==null?void 0:i.primaryColor)||"blue"}-500`:"bg-stone-200",n.customClass]]),disabled:n.disabled,onClick:r[2]||(r[2]=s=>a.value=!a.value)},[e.createElementVNode("span",{"data-state":"checked",class:e.normalizeClass(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform",[a.value?"translate-x-4":"translate-x-0"]])},null,2)],10,$u))}}}),vu=["id","innerHTML"],Dn=e.defineComponent({__name:"vs-input-static",props:{text:{default:""},html:{default:""},style:{},customClass:{default:""},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",{id:t.name,class:e.normalizeClass(["text-gray-900",t.customClass]),innerHTML:t.html?t.html:t.text},null,10,vu))}}),Ru=["placeholder","disabled","name"],Pu=e.defineComponent({__name:"vs-input-mask",props:e.mergeModels({name:{},mask:{default:""},unmask:{type:Boolean,default:!1},placeholder:{default:"_"},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=Ue(t.style),n=e.useModel(l,"modelValue"),r=e.ref(null);let o=null;return e.onMounted(async()=>{if(r.value){const{default:i}=await Promise.resolve().then(()=>ex);o=i(r.value,{mask:t.mask||"",definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},lazy:!1}),o.on("accept",()=>{n.value=t.unmask?o.unmaskedValue:o.value}),o.on("complete",()=>{n.value=t.unmask?o.unmaskedValue:o.value}),o.value=n.value??""}}),e.onBeforeUnmount(()=>{o==null||o.destroy()}),e.watch(()=>t.mask,i=>{o&&o.updateOptions({mask:i,definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/}})}),e.watch(n,i=>{o&&o.unmaskedValue!==i&&(o.value=i||"")}),(i,s)=>(e.openBlock(),e.createElementBlock("input",{type:"text",ref_key:"inputEl",ref:r,placeholder:i.placeholder,disabled:i.disabled,name:i.name,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a)]]),style:{border:"1px solid #CFD9E0"}},null,10,Ru))}}),Uu={class:"relative w-full bg-white rounded-lg"},ju=["placeholder","disabled"],zu=e.defineComponent({__name:"vs-input-email",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:null},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=Ue(t.style),n=e.useModel(l,"modelValue");return(r,o)=>(e.openBlock(),e.createElementBlock("div",Uu,[o[1]||(o[1]=e.createStaticVNode('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>',1)),e.withDirectives(e.createElementVNode("input",{type:"email","onUpdate:modelValue":o[0]||(o[0]=i=>n.value=i),placeholder:r.placeholder,disabled:r.disabled,class:e.normalizeClass(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a),{"!border-red-600":r.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,ju),[[e.vModelText,n.value]])]))}}),Hu=["value","disabled"],Ku={class:"text-[13px] text-gray-700"},Gu=e.defineComponent({__name:"vs-input-radio-default",props:e.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),n=e.computed(()=>!!t.disabled);return(r,o)=>{var i,s;return e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["flex items-center gap-0",[t.customClass,n.value?"cursor-not-allowed opacity-60":""]])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=c=>a.value=c),type:"radio",value:t.value,disabled:n.value,class:"hidden"},null,8,Hu),[[e.vModelRadio,a.value]]),e.createElementVNode("span",{class:e.normalizeClass(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]",[`border-${((i=t.style)==null?void 0:i.primaryColor)||"blue"}-500`,n.value?"opacity-50 cursor-not-allowed":""]])},[a.value==t.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["w-[12px] h-[12px] shrink-0 rounded-full",[`bg-${((s=t.style)==null?void 0:s.primaryColor)||"blue"}-500`]])},null,2)):e.createCommentVNode("",!0)],2),e.createElementVNode("span",Ku,e.toDisplayString(t.text),1)],2)}}}),Wu=["value","disabled"],Yu={class:"text-[13px] text-gray-700"},qu=e.defineComponent({__name:"vs-input-radio-buttons",props:e.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),n=e.computed(()=>!!t.disabled);return(r,o)=>{var i;return e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["flex items-center border rounded-lg px-2 py-1",[a.value==t.value?`ring-2 ring-ring ring-${((i=t.style)==null?void 0:i.primaryColor)||"blue"}-500`:"",t.customClass,n.value?"cursor-not-allowed opacity-60":""]])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=s=>a.value=s),type:"radio",value:t.value,disabled:n.value,class:"hidden"},null,8,Wu),[[e.vModelRadio,a.value]]),e.createElementVNode("span",Yu,e.toDisplayString(t.text),1)],2)}}}),Xu={"vs-input-radio-default":Gu,"vs-input-radio-buttons":qu},Ln=e.defineComponent({__name:"vs-input-radio",props:e.mergeModels({options:{},position:{default:"vertical"},view:{default:"default"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),n=e.computed(()=>Xu[`vs-input-radio-${t.view}`]);return(r,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([r.position==="horizontal"?"flex items-center flex-wrap gap-2":""])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.options,i=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value),e.mergeProps({key:i==null?void 0:i.id,text:i.text,value:i.id.toString(),checked:a.value===i.id,modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=s=>a.value=s)},{ref_for:!0},r.$attrs),null,16,["text","value","checked","modelValue"]))),128))],2))}}),Zu={key:1,class:"w-full flex flex-col gap-4"},Ju={key:0,class:"text-sm font-medium text-muted-foreground my-2"},Qu="Без категорії",ep=e.defineComponent({__name:"vs-input-checkbox",props:{options:{default:()=>[]},position:{default:"vertical"},slots:{default:null},colSpan:{default:0},data:{},view:{},group:{default:void 0},values:{default:()=>[]},style:{},customClass:{},disabled:{type:Boolean},modelValue:{default:!1},error:{},name:{},placeholder:{}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l,n=t,r=e.ref([]),o=e.reactive({}),i=m=>(m==null?void 0:m.value)||(m==null?void 0:m.id)||(m==null?void 0:m.text)||m,s=m=>m.text||String(m),c=m=>`lg:col-span-${m||12}`,d=e.computed(()=>[a.position==="vertical"?"flex flex-col":"",a.colSpan?"grid":"flex justify-start"]),u=m=>m==null||m===""?null:typeof m=="string"||typeof m=="number"?m:String(m),p=e.computed(()=>{var x;if(!a.group)return[];const m=new Map;r.value.forEach(y=>{var N;const f=y[a.group],E=u(f);m.has(E)||m.set(E,[]),(N=m.get(E))==null||N.push(y)});const w=[];(x=a.values)!=null&&x.length&&a.values.forEach(y=>{const f=u(y);w.push(f)});const b=new Set,h=y=>{const f=m.get(y)||[];if(!f.length)return null;const E=y===null?"group-null":`group-${String(y)}`,N=y===null?Qu:String(y);return b.add(y),{key:E,label:N,options:f}},g=[];return w.forEach(y=>{const f=h(y);f&&g.push(f)}),m.forEach((y,f)=>{if(b.has(f))return;const E=h(f);E&&g.push(E)}),g}),k=async()=>{try{const m=await fetch(`/api/suggest/${a.data}`).then(w=>w.json());r.value=(m==null?void 0:m.data)||m}catch(m){console.error(m)}};return e.watch(()=>a.modelValue,m=>{if(typeof m=="boolean"&&r.value.length===1){const w=i(r.value[0]);o[w]=m}else if(Array.isArray(m)){const w=new Set(m);r.value.forEach(b=>{if(!b.disabled){const h=i(b);o[h]=w.has(h)}})}},{immediate:!0}),e.watch(o,()=>{if(!r.value.length){n("update:modelValue",null);return}const m=Object.entries(o).filter(([,w])=>w).map(([w])=>w);n("update:modelValue",m.length===0?[]:m)},{deep:!0}),e.onMounted(()=>{if(a.data)k().then(()=>{if(typeof a.modelValue=="boolean"&&r.value.length===1){const m=i(r.value[0]);o[m]=a.modelValue}else if(Array.isArray(a.modelValue)){const m=new Set(a.modelValue);r.value.forEach(w=>{if(!w.disabled){const b=i(w);o[b]=m.has(b)}})}});else if(r.value=a.options,typeof a.modelValue=="boolean"&&r.value.length===1){const m=i(r.value[0]);o[m]=a.modelValue}else if(Array.isArray(a.modelValue)){const m=new Set(a.modelValue);r.value.forEach(w=>{if(!w.disabled){const b=i(w);o[b]=m.has(b)}})}}),(m,w)=>a.group?(e.openBlock(),e.createElementBlock("div",Zu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,b=>(e.openBlock(),e.createElementBlock("div",{key:b.key,class:"flex flex-col gap-2"},[b.label?(e.openBlock(),e.createElementBlock("span",Ju,e.toDisplayString(b.label),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["p-0 w-full gap-[12px]",d.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.options,h=>(e.openBlock(),e.createBlock(Zl,{modelValue:o[i(h)],"onUpdate:modelValue":g=>o[i(h)]=g,value:i(h),class:e.normalizeClass(c(m.colSpan)),disabled:a.disabled||h.disabled,label:s(h),key:`${b.key}-${i(h)}`,icon:h==null?void 0:h.icon,imgUrl:h==null?void 0:h.imgUrl,option:h,view:m.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2)]))),128))])):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["p-0 w-full gap-[10px]",d.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,b=>(e.openBlock(),e.createBlock(Zl,{modelValue:o[i(b)],"onUpdate:modelValue":h=>o[i(b)]=h,value:i(b),class:e.normalizeClass(c(m.colSpan)),disabled:a.disabled||b.disabled,label:s(b),key:i(b),icon:b==null?void 0:b.icon,imgUrl:b==null?void 0:b.imgUrl,option:b,view:m.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2))}}),Mn=ce(ep,[["__scopeId","data-v-8e66207e"]]),tp=["type","placeholder","disabled"],lp=e.defineComponent({__name:"vs-input-date1",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},mode:{default:"date"}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l;function n(u){return u?a.mode==="datetime"?(u.includes("T")?u:null)||u+(u.includes(" ")?"":"T00:00"):u==null?void 0:u.split(" ")[0]:null}const{inputClass:r}=Ue(a.style),o=t,i=e.computed({get:()=>n(a.modelValue),set:u=>o("update:modelValue",u)}),s=e.computed(()=>a.mode==="datetime"?"datetime-local":a.mode),c=e.computed(()=>!!a.disabled),d=e.computed(()=>a.placeholder??"");return(u,p)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:s.value,"onUpdate:modelValue":p[0]||(p[0]=k=>i.value=k),placeholder:d.value,disabled:c.value,ref:"date",class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[u.modelValue?"":"text-opacity-50",e.unref(r)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,tp)),[[e.vModelDynamic,i.value]])}}),Tn=async(l,t,a,n)=>{var r;try{const o=new FormData;return o.append("unique","true"),o.append("file",l),(r=await fetch(`/file/upload/uploads?id=${t||""}&form=${a||""}&table=${n||""}`,{method:"POST",body:o}).then(i=>i.json()))==null?void 0:r.result}catch(o){return ke({type:"error",title:"Помилка!",message:"Сталась помилка під час завантаження файлу",position:"right-bottom"}),console.error("Сталась помилка завантаження файлу",o),null}},ap=async l=>{try{return await fetch(`file/delete${l}`),!0}catch(t){return console.error(t),!1}},Fn=async l=>{try{const t=await fetch(`file/download/files/uploads${l}`),a=await t.arrayBuffer(),n=t.headers["content-type"],r=new TextDecoder("utf-8").decode(a),o=new Blob([r],{type:n}),i=document.createElement("a");i.setAttribute("download",l),i.href=window.URL.createObjectURL(o),i.click()}catch(t){console.error(t.message)}},np={},rp={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"};function op(l,t){return e.openBlock(),e.createElementBlock("svg",rp,t[0]||(t[0]=[e.createElementVNode("path",{d:"M5 12h14"},null,-1),e.createElementVNode("path",{d:"M12 5v14"},null,-1)]))}const zt=ce(np,[["render",op]]),sp={},ip={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-text",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function cp(l,t,a,n,r,o){return e.openBlock(),e.createElementBlock("svg",ip,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>',6)]))}const dp=ce(sp,[["render",cp]]),up={},pp={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-table",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function mp(l,t,a,n,r,o){return e.openBlock(),e.createElementBlock("svg",pp,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"},null,-1),e.createElementVNode("line",{x1:"4",y1:"10",x2:"20",y2:"10"},null,-1),e.createElementVNode("line",{x1:"10",y1:"4",x2:"10",y2:"20"},null,-1)]))}const fp=ce(up,[["render",mp]]),hp={},gp={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"};function kp(l,t){return e.openBlock(),e.createElementBlock("svg",gp,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M9 9l1 0"></path><path d="M9 13l6 0"></path><path d="M9 17l6 0"></path>',6)]))}const In=ce(hp,[["render",kp]]),yp={},bp={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-zip",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function xp(l,t,a,n,r,o){return e.openBlock(),e.createElementBlock("svg",bp,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>',9)]))}const wp=ce(yp,[["render",xp]]),Ep={},_p={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-code",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function Cp(l,t,a,n,r,o){return e.openBlock(),e.createElementBlock("svg",_p,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>',5)]))}const Vp=ce(Ep,[["render",Cp]]),Np=l=>{if(!l)return"";const t=l==null?void 0:l.split(".");return t[t.length-1]},Bp=l=>{const t=Np(l),a={imageFormat:["tiff","jpg","jpeg","png","svg","ico","webp"],sheetsFormat:["xls","csv","xlsx"],archivesFormat:["zip","rar"],textsFormat:["json","geojson","txt","yml","yaml","shp"],documentsFormat:["pdf"]};return a.imageFormat.includes(t)?"img":a.sheetsFormat.includes(t)?fp:a.textsFormat.includes(t)?Vp:a.documentsFormat.includes(t)?dp:a.archivesFormat.includes(t)?wp:In},Sp={},Ap={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:"icon icon-tabler icons-tabler-outline icon-tabler-trash"};function Dp(l,t){return e.openBlock(),e.createElementBlock("svg",Ap,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>',6)]))}const hl=ce(Sp,[["render",Dp]]),Lp={},Mp={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:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function Tp(l,t){return e.openBlock(),e.createElementBlock("svg",Mp,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const On=ce(Lp,[["render",Tp]]),Fp=["title"],Ip={class:"absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center"},Op=e.defineComponent({__name:"vs-input-file-list-item",props:e.mergeModels({format:{},multiple:{type:Boolean},max_size:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{value:{},valueModifiers:{},item:{},itemModifiers:{}}),emits:["update:value","update:item"],setup(l){const t=e.useModel(l,"value"),a=e.useModel(l,"item"),n=l;return(r,o)=>(e.openBlock(),e.createElementBlock("div",{title:a.value,class:"h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(Bp)(a.value)),{src:a.value,alt:"file",class:"w-full h-full object-cover cursor-pointer",onClick:o[0]||(o[0]=i=>e.unref(Fn)(a.value))},null,8,["src"])),e.createElementVNode("div",Ip,[e.createElementVNode("button",{type:"button",onClick:o[1]||(o[1]=i=>{var s;e.unref(ap)(a.value),t.value=n.multiple?(s=t.value)==null?void 0:s.filter(c=>c!==a.value):""}),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"},[e.createVNode(hl,{class:"w-4 h-4"})]),e.createElementVNode("button",{type:"button",onClick:o[2]||(o[2]=i=>e.unref(Fn)(a.value)),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"},[e.createVNode(On,{class:"w-4 h-4"})])])],8,Fp))}}),$n=ce(Op,[["__scopeId","data-v-286cdbc0"]]),$p={class:"flex items-center gap-x-2"},vp=["multiple","disabled"],Rp={key:1,class:"flex items-center flex-wrap gap-2"},Pp={key:1,class:"loader"},Up={key:1,class:"loader"},jp=e.defineComponent({__name:"vs-input-file",props:e.mergeModels({format:{},multiple:{type:Boolean},max_size:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["change"],["update:modelValue"]),setup(l,{emit:t}){const a=l,n=e.useModel(l,"modelValue"),r=t,o=e.ref(null),i=e.ref(!1),s=u=>Array.isArray(n.value)&&n.value[u]||"",c=u=>{if(a.max_size&&u.size>a.max_size*1024*1024){const p=(u.size/1048576).toFixed(2);return ke({type:"error",title:"Помилка!",message:`Файл "${u.name}" занадто великий. Максимальний розмір: ${a.max_size} МБ, розмір файлу: ${p} МБ`,position:"right-bottom"}),!1}return!0},d=async u=>{const{files:p}=u.target;if(!p||p.length===0)return;const k=Array.from(p);if(a.max_size&&k.filter(m=>!c(m)).length>0){o.value&&(o.value.value="");return}i.value=!0;try{if(a.multiple){const m=Array.from(p).map(async b=>a.format&&!b.name.endsWith(a.format)?null:await Tn(b,"1","form","table")),w=(await Promise.all(m)).filter(b=>b!==null).map(b=>b==null?void 0:b.file_path).filter(Boolean);n.value=[...n.value||[],...w],r("change",n.value)}else{const m=p[0];if(a.format&&!m.name.endsWith(a.format))return;const w=await Tn(m,"1","form","table");n.value=w==null?void 0:w.file_path,r("change",n.value||"")}}finally{i.value=!1,o.value&&(o.value.value="")}};return(u,p)=>(e.openBlock(),e.createElementBlock("div",$p,[e.createElementVNode("input",{class:"hidden",ref_key:"fileInput",ref:o,type:"file",multiple:u.multiple,onChange:d,disabled:i.value||u.disabled},null,40,vp),!u.multiple&&n.value?(e.openBlock(),e.createBlock($n,{key:0,item:n.value,"onUpdate:item":p[0]||(p[0]=k=>n.value=k),value:n.value,"onUpdate:value":p[1]||(p[1]=k=>n.value=k)},null,8,["item","value"])):u.multiple?(e.openBlock(),e.createElementBlock("div",Rp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(k,m)=>(e.openBlock(),e.createBlock($n,{multiple:u.multiple,key:m,value:n.value,"onUpdate:value":p[2]||(p[2]=w=>n.value=w),item:s(m)},null,8,["multiple","value","item"]))),128)),e.createElementVNode("div",{onClick:p[3]||(p[3]=k=>{var m;return!u.disabled&&!i.value&&((m=o.value)==null?void 0:m.click())}),class:e.normalizeClass(["relative h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",u.disabled||i.value?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500 hover:bg-blue-50"])},[i.value?(e.openBlock(),e.createElementBlock("div",Pp)):(e.openBlock(),e.createBlock(zt,{key:0,class:"w-6 h-6"}))],2)])):e.createCommentVNode("",!0),u.multiple?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:p[4]||(p[4]=k=>{var m;return(m=o.value)==null?void 0:m.click()}),class:e.normalizeClass([u.disabled||i.value?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500","relative h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])},[i.value?(e.openBlock(),e.createElementBlock("div",Up)):(e.openBlock(),e.createBlock(zt,{key:0,class:"w-6 h-6"}))],2))]))}}),zp=ce(jp,[["__scopeId","data-v-e613a523"]]),Hp={class:"max-w-[55vw]"},Kp={class:"text-sm font-semibold text-gray-800 truncate dark:text-neutral-200"},Gp={class:"flex items-center text-xs text-gray-500 truncate dark:text-neutral-500"},Wp={class:"px-[5px]"},Yp={class:""},gl=e.defineComponent({__name:"vs-widget-file-info",props:{item:{default:null}},setup(l){const t=l,a=e.computed(()=>{try{return new Date(t.item.cdate).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}});function n(r){if(r<1024)return`${r} B`;const o=r/1024;return o<1024?`${o.toFixed(2)} KB`:`${(o/1024).toFixed(2)} MB`}return(r,o)=>{var i,s,c,d;return e.openBlock(),e.createElementBlock(e.Fragment,null,[o[1]||(o[1]=e.createStaticVNode('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>',1)),e.createElementVNode("div",Hp,[e.createElementVNode("p",Kp,e.toDisplayString((i=r.item)==null?void 0:i.uploaded_name),1),e.createElementVNode("p",Gp,[e.createElementVNode("span",null,e.toDisplayString((s=r.item)==null?void 0:s.username),1),e.withDirectives(e.createElementVNode("span",Wp,"|",512),[[e.vShow,(c=r.item)==null?void 0:c.username]]),e.createElementVNode("span",null,e.toDisplayString(a.value),1),o[0]||(o[0]=e.createElementVNode("span",{class:"px-[5px]"},"|",-1)),e.createElementVNode("span",Yp,e.toDisplayString(n((d=r.item)==null?void 0:d.size)),1)])])],64)}}}),qp={class:"p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full"},Xp={key:0,class:"flex w-full gap-x-3 items-center"},Zp={key:1,class:"flex gap-x-3 w-full items-center"},Jp={key:2,class:"flex gap-x-3 w-full items-center"},Qp=["href"],em={key:3,class:"flex gap-x-3 w-full items-center"},tm={class:"lg:absolute lg:top-3 lg:end-1 opacity-100"},lm={class:"p-0.5 sm:p-1 inline-flex items-center gap-0.5 bg-white rounded-lg dark:bg-neutral-800 dark:border-neutral-700"},am={class:"inline-block"},nm={class:"inline-block"},rm=e.defineComponent({__name:"vs-widget-file-item",props:{item:{default:null},index:{default:0},prefix:{default:"/api"}},emits:["update","openModal","openLightbox"],setup(l,{emit:t}){const a=l,n=t;function r(u){return["pdf","json"].includes(u.ext)}function o(u){return["ppt","pptx","doc","docx","xls","xlsx"].includes(u.ext)}function i(u){const p=document.createElement("a");p.setAttribute("download",u==null?void 0:u.uploaded_name),p.href=u==null?void 0:u.file_path,p.click()}async function s(){try{await fetch(`${a.prefix}/widget/file/${a.item.entity_id}/${a.item.file_id}`),n("update")}catch(u){console.error(u)}}function c(){n("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:s,updateListOnConfirm:!0})}function d(u){(a.item.ext==="jpg"||a.item.ext==="png")&&n("openLightbox",{item:a.item,index:u})}return(u,p)=>(e.openBlock(),e.createElementBlock("div",qp,[u.item.ext==="jpg"||u.item.ext==="png"?(e.openBlock(),e.createElementBlock("div",Xp,[e.createElementVNode("div",{class:"max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",onClick:p[0]||(p[0]=k=>d(u.index))},[e.createVNode(gl,{item:u.item},null,8,["item"])])])):r(u.item)?(e.openBlock(),e.createElementBlock("div",Zp,[e.createVNode(gl,{item:u.item},null,8,["item"])])):o(u.item)?(e.openBlock(),e.createElementBlock("div",Jp,[e.createElementVNode("a",{href:`/api/file-preview?id=${u.item.file_id}`,target:"_blank",class:"flex gap-x-3 w-full items-center"},[e.createVNode(gl,{item:u.item},null,8,["item"])],8,Qp)])):(e.openBlock(),e.createElementBlock("div",em,[e.createVNode(gl,{item:u.item},null,8,["item"])])),e.createElementVNode("div",tm,[e.createElementVNode("div",lm,[e.createElementVNode("div",am,[e.createElementVNode("button",{class:"inline-flex p-[6px] justify-center items-center gap-x-2 rounded-lg border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:p[1]||(p[1]=k=>i(u.item))},[e.createVNode(On,{height:"14",width:"14"})])]),p[3]||(p[3]=e.createElementVNode("div",{class:"w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700"},null,-1)),e.createElementVNode("div",nm,[e.createElementVNode("button",{type:"button",class:"size-[30px] inline-flex justify-center items-center gap-x-2 rounded-lg border border-transparent text-red-600 hover:bg-red-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-red-100 dark:text-red-500 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",onClick:p[2]||(p[2]=k=>c())},[e.createVNode(hl,{height:"14",width:"14"})])])])])]))}}),om={},sm={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:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function im(l,t){return e.openBlock(),e.createElementBlock("svg",sm,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const cm=ce(om,[["render",im]]),dm={class:"flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full"},um={class:"flex w-full mb-[12px] items-center gap-x-2"},pm={class:"font-semibold text-gray-800 dark:text-neutral-200 text-[14px]"},mm={class1:"ml-auto"},fm={class:"py-1.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 cursor-pointer hover:bg-gray-200 text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},hm={key:0,class:"py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"},gm={class:"relative"},km={key:1,class:"space-y-3 max-h-[300px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},ym={key:0},bm=e.defineComponent({__name:"vs-input-file-list",props:{id:{default:""},prefix:{default:"/api"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},emits:["update"],setup(l,{emit:t}){const a=l,n=e.inject("form"),r=e.computed(()=>n.value.formId),o=e.ref(!1),i=e.ref(0),s=t,c=e.ref(!1),d=e.ref({}),u=e.ref([]),p=e.ref(""),k=e.computed(()=>Array.isArray(u.value)?u.value.filter(y=>y.ext==="jpg"||y.ext==="png").map(y=>y==null?void 0:y.file_path):[]),m=e.computed(()=>p.value===""?u.value:u.value.filter(y=>{var f;return(f=y==null?void 0:y.uploaded_name)==null?void 0:f.includes(p.value)})),w=y=>{const f=k.value.findIndex(E=>E===y.item.file_path);f!==-1&&(o.value=!0,i.value=f)},b=async()=>{try{const y=await fetch(`${a.prefix}/widget/file/${r.value}`).then(f=>f.json());u.value=y==null?void 0:y.rows}catch(y){console.error(y)}},h=async y=>{await Promise.all(Array.from(y.target.files).map(async f=>{const E=new FormData;E.append("file",f);try{const N=`${a.prefix}/widget/file/${r.value}`,V=await fetch(N,{method:"POST",body:E});return V.ok?(s("update","file-list"),f):(ke({type:V.status>=400&&V.status<500?"warning":"error",title:"Error",message:`Error code: ${V.status}`}),null)}catch(N){return ke({type:"error",title:"Error",message:N.message||"Unknown error"}),console.error(N),null}})),await b()},g=y=>{const f={...y};return y.cancel||(f.cancel=()=>{c.value=!1}),y.updateListOnConfirm&&(f.confirm=async()=>{await y.confirm(),c.value=!1,b()}),f},x=y=>{d.value=g(y),c.value=!0};return e.watch(r,y=>{y&&b()}),e.onMounted(()=>{r.value&&b()}),(y,f)=>{var V,$,K;const E=e.resolveComponent("Lightbox"),N=e.resolveComponent("MessageBox");return e.openBlock(),e.createElementBlock("div",dm,[e.createElementVNode("div",um,[e.createElementVNode("h2",pm," Файлів: "+e.toDisplayString((V=u.value)==null?void 0:V.length),1),e.createElementVNode("div",mm,[e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",class:"hidden",onChange:f[0]||(f[0]=H=>h(H))},null,32),e.createElementVNode("div",fm,[e.createVNode(cm,{height:"16",width:"16"})])])])]),(($=u.value)==null?void 0:$.length)>4?(e.openBlock(),e.createElementBlock("div",hm,[e.createElementVNode("div",null,[e.createElementVNode("div",gm,[f[8]||(f[8]=e.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5"},[e.createElementVNode("svg",{class:"flex-shrink-0 text-gray-500 size-4 dark:text-neutral-400",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"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("path",{d:"m21 21-4.3-4.3"})])],-1)),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":f[1]||(f[1]=H=>p.value=H),class:"py-2 px-3 ps-10 pe-16 block w-full bg-gray-200 xl:bg-gray-100 rounded-lg text-sm focus:border-blue-500 h-[40px] focus:border-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",placeholder:"Введіть назву файлу"},null,512),[[e.vModelText,p.value,void 0,{trim:!0}]])])])])):e.createCommentVNode("",!0),(K=u.value)!=null&&K.length?(e.openBlock(),e.createElementBlock("div",km,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(H,v)=>(e.openBlock(),e.createBlock(rm,{key:v,prefix:y.prefix,item:H,index:v,onUpdate:f[2]||(f[2]=W=>y.$emit("update","file-list")),onOpenModal:f[3]||(f[3]=W=>x(W)),onOpenLightbox:f[4]||(f[4]=W=>w(W))},null,8,["prefix","item","index"]))),128)),m.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ym,f[9]||(f[9]=[e.createElementVNode("p",{class:"text-sm text-gray-600 font-sm"}," Файлів з такою назвою не існує, введіть інше пошукове слово ",-1)])))])):e.createCommentVNode("",!0),e.createVNode(E,{modelValue:o.value,"onUpdate:modelValue":f[5]||(f[5]=H=>o.value=H),startIndex:i.value,"onUpdate:index":f[6]||(f[6]=H=>i.value=H),images:k.value},null,8,["modelValue","startIndex","images"]),e.createVNode(N,e.mergeProps({modelValue:c.value,"onUpdate:modelValue":f[7]||(f[7]=H=>c.value=H),onConfirm:d.value.confirm},d.value),null,16,["modelValue","onConfirm"])])}}}),xm={class:"flex items-center justify-between"},wm={class:"text-[16px] text-gray-900 font-medium"},Em={class:"grid gap-3"},_m=e.defineComponent({__name:"vs-container-switcher",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(l){const t=l,a=e.ref(t.isOpen);return e.watch(()=>t.isOpen,n=>{a.value=n}),(n,r)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",xm,[e.createElementVNode("p",wm,e.toDisplayString(l.title),1),e.createVNode(An,{modelValue:a.value,"onUpdate:modelValue":r[0]||(r[0]=o=>a.value=o),style:e.normalizeStyle(l.style)},null,8,["modelValue","style"])]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",Em,[e.renderSlot(n.$slots,"default",{},void 0,!0)],512),[[e.vShow,a.value]])]),_:3})]))}}),Cm=ce(_m,[["__scopeId","data-v-90320b87"]]),Vm={class:"text-[16px] text-gray-900 font-medium"},Nm={class:"grid gap-3"},Bm=e.defineComponent({__name:"vs-container-accordion",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(l){const t=l,a=e.ref(t.isOpen);return e.watch(()=>t.isOpen,n=>{a.value=n}),(n,r)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{type:"button",onClick:r[0]||(r[0]=o=>a.value=!a.value),class:"flex items-center gap-2"},[e.createVNode(e.unref(Vu),{class:e.normalizeClass(["h-4 w-4 duration-300",[a.value?"-rotate-180":""]])},null,8,["class"]),e.createElementVNode("span",Vm,e.toDisplayString(l.title),1)]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",Nm,[e.renderSlot(n.$slots,"default",{},void 0,!0)],512),[[e.vShow,a.value]])]),_:3})]))}}),Sm=ce(Bm,[["__scopeId","data-v-590eff11"]]),Am={class:"flex items-center justify-between"},Dm=e.defineComponent({__name:"vs-container-default",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",Am,[e.createElementVNode("p",null,e.toDisplayString(l.title),1)]),e.renderSlot(t.$slots,"default")]))}}),Lm={switcher:Cm,accordion:Sm,default:Dm},He={Equal:"==",Inequal:"!=",Higer:">",HigerOrEqual:">=",Lower:"<",LowerOrEqual:"<=",Between:"between",StartWith:"^",EndWith:"$",Contain:"*",In:"in",NotIn:"not_in"},Mm=(l,t)=>String(l)===String(t),Tm=(l,t)=>String(l)!==String(t),Fm=(l,t)=>l>t,Im=(l,t)=>l>=t,Om=(l,t)=>l<t,$m=(l,t)=>l<=t,vm=(l,t)=>Array.isArray(t)&&t.length===2?l>=t[0]&&l<=t[1]:!1,Rm=(l,t)=>String(l).startsWith(String(t)),Pm=(l,t)=>String(l).endsWith(String(t)),Um=(l,t)=>String(l).includes(String(t)),jm=(l,t)=>Array.isArray(t)?t.includes(l):!1,zm=(l,t)=>Array.isArray(t)?!t.includes(l):!0,vn=(l,t)=>{if(!t)return!0;switch(t==null?void 0:t[1]){case He.Equal:return Mm(l,t==null?void 0:t[2]);case He.Inequal:return Tm(l,t==null?void 0:t[2]);case He.Higer:return Fm(l,t==null?void 0:t[2]);case He.HigerOrEqual:return Im(l,t==null?void 0:t[2]);case He.Lower:return Om(l,t==null?void 0:t[2]);case He.LowerOrEqual:return $m(l,t==null?void 0:t[2]);case He.Between:return vm(l,t==null?void 0:t[2]);case He.StartWith:return Rm(l,t==null?void 0:t[2]);case He.EndWith:return Pm(l,t==null?void 0:t[2]);case He.Contain:return Um(l,t==null?void 0:t[2]);case He.In:return jm(l,t==null?void 0:t[2]);case He.NotIn:return zm(l,t==null?void 0:t[2]);default:return!0}},Hm=e.defineComponent({__name:"vs-input-container",props:{style:{type:Object,default:()=>({})},title:{type:String,default:""},view:{type:String,default:"default"},name:{type:String,default:""},schema:{type:Array,default:()=>[]}},setup(l){const t=l,a=e.inject("values",e.ref({})),n=e.inject("form"),r=e.computed(()=>{var s;return(s=t.schema)==null?void 0:s.filter(c=>{var k,m,w,b;const d=c==null?void 0:c.conditions;if(!d)return!0;const u=Array.isArray(d)?d[0]:d,p=t.name?((m=(k=a.value)==null?void 0:k[t.name])==null?void 0:m[u])??((w=a.value)==null?void 0:w[u]):(b=a.value)==null?void 0:b[u];return vn(p,d)})}),o=e.computed(()=>Lm[t.view]),i=e.computed(()=>{if(a.value||(a.value={}),!t.name)return a.value;const s=a.value[t.name];if(s)return s;const c={};return a.value={...a.value,[t.name]:c},c});return(s,c)=>{var d;return(d=l.schema)!=null&&d.length?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{key:0,title:l.title,style:e.normalizeStyle(l.style)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,u=>{var p,k;return e.openBlock(),e.createBlock(Un,e.mergeProps({key:u.name},{ref_for:!0},u,{item:u,modelValue:i.value[u.name],"onUpdate:modelValue":m=>i.value[u.name]=m,style:l.style,error:(k=(p=e.unref(n))==null?void 0:p.errors)==null?void 0:k[u.name]}),null,16,["item","modelValue","onUpdate:modelValue","style","error"])}),128))]),_:1},8,["title","style"])):e.createCommentVNode("",!0)}}}),Km=["aria-expanded","data-focus"],Gm={key:0,class:"flex flex-wrap items-center gap-1 overflow-y-auto min-w-0 flex-1"},Wm={class:"flex items-center min-w-0"},Ym=["title"],qm=["innerHTML"],Xm=["onClick"],Zm={class:"flex-1 min-w-[2px]"},Jm=["placeholder"],Qm=["title"],ef=["innerHTML"],tf={key:2,class:"flex-1 min-w-[2px]"},lf=["placeholder"],af={class:"flex items-center shrink-0"},nf=["disabled"],rf=["disabled","title"],of=["aria-disabled","onClick"],sf=["innerHTML"],cf={key:1,class:"px-3 py-2 text-center text-gray-500"},df=["disabled"],Rn=e.defineComponent({__name:"vs-input-select",props:{multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},mode:{},defaultValue:{},search:{type:Boolean,default:!0},placeholder:{default:"Оберіть значення"},prefix:{default:"api"},host:{default:""},data:{default:""},options:{default:()=>[]},api:{default:null},maxHeight:{default:400},parent:{},set:{},slot:{},add:{},teleport:{default:"body"},auto:{default:0},style:{default:()=>({})},customClass:{default:""},modelValue:{},error:{default:null},name:{}},emits:["change","update:modelValue"],setup(l,{emit:t}){const a=l,n=t,r=e.computed(()=>a.multiple),o=e.computed(()=>a.disabled);Ue(a.style);const i=e.computed({get:()=>a.modelValue,set:S=>n("update:modelValue",S)});!i.value&&a.defaultValue&&(i.value=a.defaultValue);const s=e.ref(null),c=e.ref(null),d=e.ref(null),u=e.ref(null),p=e.ref(!1),k=e.ref(!1),m=e.ref(null),w=e.ref([]),b=e.ref(-1),h=e.ref([]),g=e.ref(""),x=e.ref(null),y=e.ref("bottom"),f=e.ref({}),E=e.ref([]),N=e.computed(()=>{if(!E.value.length)return[];const S=w.value,D=new Map(S.map(z=>{var q;return[(q=z.id)==null?void 0:q.toString(),z]}));return E.value.map(z=>D.get(z==null?void 0:z.toString())).filter(z=>!!z)}),V=e.computed(()=>a.placeholder||"Select..."),$=e.computed(()=>T(m.value));e.computed(()=>r.value?!E.value.length&&g.value==="":!$.value&&g.value==="");const K=e.computed(()=>o.value?!1:r.value?E.value.length>0:!!i.value),H=S=>{var D;return r.value?E.value.some(z=>(z==null?void 0:z.toString())===(S==null?void 0:S.toString())):((D=i.value)==null?void 0:D.toString())===(S==null?void 0:S.toString())},v=e.computed(()=>{let S=w.value??[];if(!a.data&&g.value.trim()!==""){const D=g.value.toLowerCase();S=S.filter(z=>{var ie,be;const q=T(z).toLowerCase(),re=((be=(ie=z.text)==null?void 0:ie.toLowerCase)==null?void 0:be.call(ie))||"";return q.includes(D)||re.includes(D)})}if(r.value&&E.value.length){const D=new Set(E.value.map(z=>z==null?void 0:z.toString()));S=S.filter(z=>{var q;return!D.has((q=z.id)==null?void 0:q.toString())})}return S}),W=e.inject("values"),le=/\{\{\s*([^}]+?)\s*\}\}/g,P=S=>(S?String(S):"").replace(/<[^>]*>/g,"").trim(),F=e.computed(()=>a.slot??(a==null?void 0:a.optionTemplate)??""),I=S=>{if(!S)return"";const D=F.value;return D?D.replace(le,(z,q)=>{const re=q.trim(),ie=S[re];return ie!=null?String(ie):""}):S.text??""},T=S=>{if(!S)return"";if(!F.value)return S.text??"";const D=I(S);return P(D)||S.text||""},Y=S=>{a.set&&(W!=null&&W.value)&&Object.entries(a.set).forEach(([D,z])=>{if(!D)return;const q=S?S[z]:null;W.value[D]=q??null})},J=e.computed(()=>{var S,D;return a.parent?((D=(S=W==null?void 0:W.value)==null?void 0:S[a.parent])==null?void 0:D.toString())??null:null}),pe=async S=>{var D;if(!a.data){let z=a.options??[];if(S!=null&&S.trim()){const q=S.toLowerCase();z=z.filter(re=>{var ee,Re;const ie=T(re).toLowerCase(),be=((Re=(ee=re.text)==null?void 0:ee.toLowerCase)==null?void 0:Re.call(ee))||"";return ie.includes(q)||be.includes(q)})}return z}try{const z=a.host??"",q=a.prefix??"api",re=a.api??`/${q}/suggest/${a.data}`,ie=`${z}${re}`,be=new URLSearchParams;return be.set("json","1"),S&&be.set("key",S),J.value!==void 0&&J.value!==null&&J.value!==""&&be.set("parent",J.value),((D=await fetch(`${ie}?${be.toString()}`).then(ee=>ee.json()))==null?void 0:D.data)??[]}catch{return[]}},_e=async()=>{a.data?w.value=await pe(g.value):w.value=a.options?[...a.options]:[]},Fe=async S=>{var z,q,re;if(S==null)return null;const D=(z=w.value)==null?void 0:z.find(ie=>{var be;return((be=ie==null?void 0:ie.id)==null?void 0:be.toString())===String(S)});if(D)return D;if(a.data)try{const ie=a.host??"",be=a.prefix??"api",ee=a.api??`/${be}/suggest/${a.data}`,Re=`${ie}${ee}`,Ze=new URLSearchParams;return Ze.set("json","1"),Ze.set("val",String(S)),J.value!==void 0&&J.value!==null&&J.value!==""&&Ze.set("parent",J.value),((re=((q=await fetch(`${Re}?${Ze.toString()}`).then(Bt=>Bt.json()))==null?void 0:q.data)??[])==null?void 0:re[0])??null}catch{return null}return null},Vt=async S=>{const D=new Set(w.value.map(q=>{var re;return(re=q.id)==null?void 0:re.toString()})),z=S.filter(q=>!D.has(q==null?void 0:q.toString()));z.length&&await z.reduce(async(q,re)=>{await q;const ie=await Fe(re);ie&&w.value.push(ie)},Promise.resolve())},Ce=async()=>{o.value||(p.value=!0,await _e(),await e.nextTick(()=>{var S;Ge(),(S=x.value)==null||S.focus(),v.value.length?b.value=0:b.value=-1}))},Ie=()=>{p.value=!1,b.value=-1},ct=async S=>{o.value||(p.value?Ie():await Ce())},dt=async()=>{var S;p.value?(S=x.value)==null||S.focus():await Ce()},ut=()=>{r.value?(E.value=[],i.value=[],n("change",[])):(m.value=null,i.value=null,n("change",null)),Y(null),g.value="",e.nextTick(()=>{var S;return(S=x.value)==null?void 0:S.focus()})},Nt=S=>{r.value&&(E.value=E.value.filter(D=>(D==null?void 0:D.toString())!==(S==null?void 0:S.toString())),i.value=[...E.value],n("change",i.value),e.nextTick(()=>{var D;return(D=x.value)==null?void 0:D.focus()}))},ve=S=>{r.value?(H(S.id)||(E.value=[...E.value,S.id],i.value=[...E.value],n("change",i.value)),g.value="",e.nextTick(()=>{var D;(D=x.value)==null||D.focus(),b.value=Math.min(b.value,v.value.length-1)}),Y(null)):(m.value=S,i.value=S.id,n("change",i.value),g.value="",Ie(),Y(S))},Ke=S=>{H(S.id)||ve(S)},at=(S,D)=>{if(!S||!D)return;const z=S.offsetTop,q=z+S.offsetHeight,re=D.scrollTop,ie=re+D.clientHeight;let be=D.scrollTop;z<re?be=z-80:q>ie&&(be=q-D.clientHeight+4);const ee=D;ee.scrollTop=be},Ve=S=>{let D=S.parentElement;for(;D;){if(D.classList.contains("ui-dialog__content"))return D;const z=window.getComputedStyle(D),q=z.overflow+z.overflowY+z.overflowX;if(q.includes("auto")||q.includes("scroll")||D===document.body||D===document.documentElement)return D;D=D.parentElement}return document.body},Ge=()=>{if(!c.value)return;const S=c.value.getBoundingClientRect(),D=window.innerHeight||document.documentElement.clientHeight,z=window.innerWidth||document.documentElement.clientWidth,q=8,re=8,ie=a.maxHeight||300,be=D-S.bottom-re-q,ee=S.top-re-q,Re=be>=ee,Ze=Math.max(z-q*2,0);let{width:Bt}=S;Ze>0&&Bt>Ze&&(Bt=Ze);let{left:Xt}=S;Xt+Bt+q>z&&(Xt=z-Bt-q),Xt=Math.max(Xt,q);const tx=Math.min(ie,Math.max(Re?be:ee,50));y.value=Re?"bottom":"top",f.value={position:"fixed",left:`${Xt}px`,width:`${Bt}px`,minWidth:"300px",maxHeight:`${tx}px`,transform:Re?"none":"translateY(-100%)",top:Re?`${S.bottom+re}px`:`${S.top-re}px`}},Xe=async S=>{o.value||!p.value&&(S.key==="ArrowDown"||S.key==="ArrowUp")&&(S.preventDefault(),await Ce())},nt=S=>{var z;if(!p.value)return;const{key:D}=S;if(D==="ArrowDown")S.preventDefault(),b.value+1<v.value.length&&(b.value+=1,at(h.value[b.value],d.value));else if(D==="ArrowUp")S.preventDefault(),b.value>0&&(b.value-=1,at(h.value[b.value],d.value));else if(D==="Enter"){S.preventDefault();const q=v.value[b.value];q&&ve(q),(z=x.value)==null||z.blur()}else D==="Escape"?(S.preventDefault(),Ie()):D==="Backspace"?r.value&&g.value===""&&E.value.length&&(E.value=E.value.slice(0,-1),i.value=[...E.value],n("change",i.value)):D==="Home"?(b.value=0,at(h.value[0],d.value)):D==="End"?(b.value=v.value.length-1,at(h.value[b.value],d.value)):D==="Tab"&&Ie()},bt=()=>{o.value||(k.value=!0)},C=()=>{k.value=!1,g.value=""},B=S=>{S.key==="Escape"&&p.value&&Ie()},R=S=>{var z,q;const D=S.target;(z=s.value)!=null&&z.contains(D)||(q=u.value)!=null&&q.contains(D)||Ie()},Z=S=>{p.value&&d.value&&!d.value.contains(S.target)&&Ge()},he=()=>{p.value&&Ge()},ge=()=>{p.value&&Ge()};e.watch(()=>a.options,S=>{S!=null&&S.length&&(w.value=[...S],oe())},{immediate:!0});async function oe(){if(r.value)Array.isArray(i.value)?E.value=[...i.value]:(E.value=i.value==null?[]:[i.value],i.value=[...E.value]),a.data&&E.value.length&&(await Vt(E.value),await e.nextTick());else{if(Array.isArray(i.value)){const S=i.value[0]??null;i.value=S??null}i.value!=null&&(m.value=await Fe(i.value)),Y(m.value??null)}}e.watch(i,()=>{oe()}),e.onMounted(async()=>{var S;addEventListener("keydown",B),addEventListener("scroll",Z,!0),addEventListener("resize",he),document.addEventListener("click",R,!0),c.value&&Ve(c.value).addEventListener("scroll",ge,!0),(S=a.options)!=null&&S.length&&!a.data?w.value=[...a.options]:a.data&&(w.value=await pe("")),await oe(),G.value=!1}),e.onUnmounted(()=>{removeEventListener("keydown",B),removeEventListener("scroll",Z,!0),removeEventListener("resize",he),document.removeEventListener("click",R,!0),c.value&&Ve(c.value).removeEventListener("scroll",ge,!0)});const M=e.ref(!1),U=e.ref({}),se=e.ref([]),me=e.ref(null);async function _(){var z,q;if(!((z=a.add)!=null&&z.token)||me!=null&&me.value.validate())return;const S=a.add.api??`/api/table/${a.add.token}`,{id:D}=await fetch(S,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(U.value)}).then(re=>re.json());if(!((q=a.options)!=null&&q.length)&&a.data){const{data:re}=await fetch(`${a.api??`/api/suggest/${a.data}`}?val=${D}`).then(ie=>ie.json());m.value=re[0],w.value.push(re[0]),i.value=D}M.value=!1,ke({title:"Success!",message:"Object created."})}async function A(){if(!a.add)return null;const S=await fetch(`/api/template/form/${a.add.form}`).then(D=>D.json());return se.value=S.schema,M.value=!0,null}function O(S,D=200){let z;return(...q)=>{z&&clearTimeout(z),z=window.setTimeout(()=>S(...q),D)}}const j=O(async S=>{w.value=await pe(S)},200);e.watch(g,S=>{a.data&&j(S.trim())}),e.watch(()=>a.options,S=>{!a.data&&(S!=null&&S.length)&&(w.value=[...S],oe())},{immediate:!0}),e.watch(()=>a.parent??a.parentValue,()=>{a.data&&_e()});const G=e.ref(!0);return e.watch(J,async()=>{if(a.data&&(G.value||(r.value?(E.value=[],i.value=[],n("change",[])):(m.value=null,i.value=null,n("change",null))),await _e(),a.auto===1&&J.value&&w.value.length>0)){const S=w.value[0];S&&ve(S)}}),(S,D)=>{var z,q,re,ie,be;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(pl),{visible:M.value,"onUpdate:visible":D[1]||(D[1]=ee=>M.value=ee),title:"Додати",buttonText:"Додати",onDone:_,teleport:S.teleport},{default:e.withCtx(()=>[e.createVNode(Ft,{schema:se.value,modelValue:U.value,"onUpdate:modelValue":D[0]||(D[0]=ee=>U.value=ee),ref_key:"addForm",ref:me},null,8,["schema","modelValue"])]),_:1},8,["visible","teleport"]),e.createElementVNode("div",{class:"flex gap-1 w-full",ref_key:"selectRoot",ref:s,onClick:D[5]||(D[5]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["relative w-full font-sans",a.customClass])},[D[10]||(D[10]=e.createElementVNode("span",{id:"react-select-live-region",class:"sr-only"},null,-1)),D[11]||(D[11]=e.createElementVNode("span",{"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text",role:"log",class:"sr-only"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white","border-gray-300 hover:border-gray-400",p.value||k.value?"border-blue-500 ring-1 ring-blue-500":"",o.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),role:"combobox","aria-expanded":p.value,"aria-haspopup":"listbox",onKeydown:Xe,onClick:dt,"data-focus":p.value||k.value?"true":"false"},[e.createElementVNode("div",{class:"flex flex-1 items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden h-full",ref_key:"triggerRef",ref:c},[r.value?(e.openBlock(),e.createElementBlock("div",Gm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,ee=>(e.openBlock(),e.createElementBlock("div",{class:"flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border max-w-full",key:ee.id},[e.createElementVNode("div",Wm,[ee!=null&&ee.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[16px] h-[16px] rounded-md block ml-1.5 flex-shrink-0",style:e.normalizeStyle({backgroundColor:ee==null?void 0:ee.color})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"truncate text-gray-900 overflow-hidden max-w-[200px] px-0.5 py-[2px] pl-1.5",title:T(ee)},[F.value?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:I(ee)},null,8,qm)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(ee.text),1)],64))],8,Ym)]),e.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b] flex-shrink-0",onClick:e.withModifiers(Re=>Nt(ee.id),["stop"])},D[6]||(D[6]=[e.createElementVNode("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,Xm)]))),128)),e.createElementVNode("div",Zm,[!o.value&&S.search?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:x,class:"w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",placeholder:E.value.length?" ":V.value,"onUpdate:modelValue":D[2]||(D[2]=ee=>g.value=ee),onFocus:bt,onBlur:C,onKeydown:nt},null,40,Jm)),[[e.vModelText,g.value]]):e.createCommentVNode("",!0)])])):!r.value&&!k.value&&$.value&&g.value===""?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["truncate text-gray-900"]),title:$.value},[(z=m.value)!=null&&z.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[14px] h-[14px] rounded-md block mr-1 mt-1 absolute",style:e.normalizeStyle({backgroundColor:(q=m.value)==null?void 0:q.color})},null,4)):e.createCommentVNode("",!0),F.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass({"pl-5":(re=m.value)==null?void 0:re.color}),innerHTML:I(m.value)},null,10,ef)):(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass({"pl-5":(ie=m.value)==null?void 0:ie.color})},e.toDisplayString((be=m.value)==null?void 0:be.text),3))],8,Qm)):e.createCommentVNode("",!0),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",tf,[!o.value&&S.search?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:x,class:"w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",placeholder:$.value?" ":V.value,"onUpdate:modelValue":D[3]||(D[3]=ee=>g.value=ee),onFocus:bt,onBlur:C,onKeydown:nt},null,40,lf)),[[e.vModelText,g.value]]):e.createCommentVNode("",!0)]))],512),e.createElementVNode("div",af,[K.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:o.value,onClick:e.withModifiers(ut,["stop"])},D[7]||(D[7]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,nf)):e.createCommentVNode("",!0),D[9]||(D[9]=e.createElementVNode("div",{class:"self-stretch w-px bg-[#ccc] my-[1px]"},null,-1)),e.createElementVNode("button",{type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:o.value,onClick:D[4]||(D[4]=e.withModifiers(ee=>ct(),["stop"])),title:p.value?"Закрити список":"Відкрити список"},D[8]||(D[8]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"})],-1)]),8,rf)])],42,Km),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:u,class:e.normalizeClass(["fixed z-[3000] rounded bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.1),0_4px_11px_rgba(0,0,0,0.1)]"]),style:e.normalizeStyle(f.value),role:"listbox"},[e.createElementVNode("div",{class:"overflow-y-auto py-1",style:e.normalizeStyle({maxHeight:f.value.maxHeight||"300px"}),ref_key:"listRef",ref:d},[v.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(v.value,(ee,Re)=>(e.openBlock(),e.createElementBlock("div",{key:ee.id,ref_for:!0,ref:Ze=>h.value[Re]=Ze,class:e.normalizeClass(["flex px-3 py-2 cursor-default select-none text-gray-900 ",H(ee.id)?"bg-blue-500 text-white":"bg-white hover:bg-blue-100",b.value===Re&&!H(ee.id)?"bg-blue-100":""]),"aria-disabled":H(ee.id)?"true":"false",role:"option",tabindex:"-1",onClick:Ze=>Ke(ee)},[ee!=null&&ee.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",style:e.normalizeStyle({backgroundColor:ee==null?void 0:ee.color})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["leading-[19px]",b.value===ee.id?"text-white":"",(b.value,"")])},[F.value?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:I(ee)},null,8,sf)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(ee.text),1)],64))],2)],10,of))),128)):(e.openBlock(),e.createElementBlock("div",cf," No options "))],4)],4)):e.createCommentVNode("",!0)]))],2),a.add?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:A,class:"bg-white hover:bg-gray-100 text-sm text-gray-900 py-[10px] px-3 border border-stone-200 rounded-md h-[38px] flex items-center gap-2",disabled:o.value,type:"button"},[e.createVNode(zt,{width:"16",height:"16"}),D[12]||(D[12]=e.createElementVNode("span",null,"Додати",-1))],8,df)):e.createCommentVNode("",!0)],512)],64)}}}),uf=["placeholder","disabled"],pf=e.defineComponent({__name:"vs-input-textarea",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=Ue(t.style),n=e.useModel(l,"modelValue"),r=e.computed(()=>!!t.disabled),o=e.computed(()=>t.placeholder??"");return(i,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{"onUpdate:modelValue":s[0]||(s[0]=c=>n.value=c),placeholder:o.value,disabled:r.value,row:"2",class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto bg-white",[e.unref(a)]]),style:{border:"1px solid #CFD9E0"}},null,10,uf)),[[e.vModelText,n.value]])}}),mf={},ff={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"};function hf(l,t){return e.openBlock(),e.createElementBlock("svg",ff,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),e.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)]))}const gf=ce(mf,[["render",hf]]),kf={},yf={class:"flex-shrink-0 mt-0.5 size-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function bf(l,t){return e.openBlock(),e.createElementBlock("svg",yf,t[0]||(t[0]=[e.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),e.createElementVNode("path",{d:"M7 20V4"},null,-1),e.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),e.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const xf=ce(kf,[["render",bf]]),wf={},Ef={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _f(l,t){return e.openBlock(),e.createElementBlock("svg",Ef,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 9l5 -5l5 5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const Cf=ce(wf,[["render",_f]]),Vf={},Nf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Bf(l,t){return e.openBlock(),e.createElementBlock("svg",Nf,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const Sf=ce(Vf,[["render",Bf]]),Af={},Df={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Lf(l,t){return e.openBlock(),e.createElementBlock("svg",Df,t[0]||(t[0]=[e.createStaticVNode('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>',6)]))}const Pn=ce(Af,[["render",Lf]]),Mf={},Tf={viewBox:"0 0 178 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ff(l,t){return e.openBlock(),e.createElementBlock("svg",Tf,t[0]||(t[0]=[e.createStaticVNode('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>',12)]))}const If=ce(Mf,[["render",Ff]]),Of={},$f={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function vf(l,t){return e.openBlock(),e.createElementBlock("svg",$f,t[0]||(t[0]=[e.createElementVNode("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"},null,-1)]))}const Rf=ce(Of,[["render",vf]]),Pf={class:"vs-datatable border rounded-xl w-full flex-grow"},Uf={class:"flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]"},jf={class:"relative w-full"},zf={class:"table-wrapper flex gap-2"},Hf={class:"vs-popover inline-block text-slate-700"},Kf={class:"text-center"},Gf={class:""},Wf={class:"py-1 px-0 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},Yf={class:"flex flex-col p-[1px] gap-[2px] w-[140px]"},qf={class:"text-sm items-center text-gray-800 flex gap-1"},Xf={class:"w-full overflow-x-auto"},Zf={class:"w-full table-auto caption-bottom text-sm"},Jf={class:"[&_tr]:border-b"},Qf={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"},e0={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"},t0={key:0,colspan:"100%",class:"text-center"},l0={class:"w-full"},a0={class:"p-5 min-h-[200px] flex flex-col justify-center items-center text-center"},n0=["onDragstart","onDragover","onDrop"],r0={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center"},o0={class:"flex items-center justify-center"},s0={key:0,class:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},i0={key:0},c0=["src"],d0={key:1,class:"rounded-md max-w-[45px] w-[45px] max-h-[45px] h-[45px] bg-gray-200 flex items-center justify-center"},u0=["innerHTML"],p0={key:2,class:"line-clamp-2 rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},m0={key:3,class:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},f0={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},h0={class:"flex items-center justify-center gap-2"},g0=["onClick"],k0=["onClick"],y0={class:"vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},b0=e.defineComponent({__name:"vs-input-datatable",props:e.mergeModels({colModel:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),n=e.ref({}),r=e.ref(""),o=e.computed(()=>{if(!r.value)return a.value??[];const F=r.value.toLowerCase();return a.value.filter(I=>{var T;return(T=t.colModel)==null?void 0:T.some(Y=>{const J=I[Y.key];return J?Array.isArray(J)?J.join(", ").toLowerCase().includes(F):String(J).toLowerCase().includes(F):!1})})}),i=e.ref(null),s=e.ref(null),c=e.ref(!1),d=e.ref(null),u=e.ref({top:0,left:0}),p=F=>{i.value=F},k=F=>{s.value=F},m=F=>{if(i.value===null||i.value===F){i.value=null,s.value=null;return}const I=[...a.value],[T]=I.splice(i.value,1);I.splice(F,0,T),a.value=I,i.value=null,s.value=null},w=F=>{const I=F.currentTarget.getBoundingClientRect();u.value={top:I.bottom+window.scrollY,left:I.left+window.scrollX},c.value=!c.value},b=()=>{d.value&&d.value.click()},h=F=>{const I=[".jpg",".jpeg",".png",".gif",".bmp",".webp",".svg",".ico",".tiff",".tif"],T=F.toLowerCase();return I.some(Y=>T.endsWith(Y))},g=F=>{var Y;const I=(Y=F.target.files)==null?void 0:Y[0];if(!I)return;const T=new FileReader;T.onload=J=>{var pe;try{const _e=(pe=J.target)==null?void 0:pe.result;if(typeof _e=="string"){const Fe=JSON.parse(_e);Array.isArray(Fe)&&a.value.push(...Fe)}}catch(_e){console.error("Error parsing file:",_e)}},T.readAsText(I)},x=()=>{const F=JSON.stringify(a.value,null,2),I=new Blob([F],{type:"application/json"}),T=URL.createObjectURL(I),Y=document.createElement("a");Y.href=T,Y.download="data.json",Y.click(),URL.revokeObjectURL(T)};e.onMounted(async()=>{var I;const F=(I=t.colModel)==null?void 0:I.filter(T=>T.data);F!=null&&F.length&&Promise.all(F.map(async T=>{const Y=await(await fetch(`/api/suggest/${T.data}`)).json();n.value[T.key]=Y.data}))});const y=e.ref(""),f=e.ref(!1);let E="edit",N=0;const V=e.ref({}),$=e.ref({});async function K(){y.value="Додати",f.value=!0,E="add",V.value={}}function H(F,I){var Y;const T=I.key||I.name;return n.value[T]&&F[T]?((Y=n.value[T].find(J=>J.id.toString()===F[T].toString()))==null?void 0:Y.text)??F[T]:F[T]||"-"}async function v(F,I){y.value="Редагувати",f.value=!0,E="edit",N=I,V.value={...F}}function W(){const F=$.value.validate();if(F){ke({type:"warning",title:"Помилка валідації",message:Object.entries(F).map(([I,T])=>`${I}: ${T}`).join(`
|
|
152
|
-
`)});return}E==="add"?Array.isArray(a.value)?a.value=[...a.value,V.value]:a.value=[V.value]:a.value=a.value.map((I,T)=>T===N?V.value:I),f.value=!1}function le(F){a.value=a.value.filter((I,T)=>T!==F)}function P(){f.value=!1}return(F,I)=>(e.openBlock(),e.createElementBlock("div",Pf,[e.createElementVNode("div",Uf,[e.createElementVNode("div",jf,[e.createVNode(gf,{width:"14",height:"14",class:"absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"}),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":I[0]||(I[0]=T=>r.value=T),placeholder:"Пошук",class:"py-2 px-3 pl-10 w-full bg-gray-100 h-[36px] rounded-[8px] text-[15px] leading-[18px] focus:border-1 text-stone-800 placeholder:text-[#6B7280] focus:outline-blue-500 focus:outline-2"},null,512),[[e.vModelText,r.value]])]),e.createElementVNode("div",zf,[e.createElementVNode("input",{ref_key:"fileInput",ref:d,onChange:g,class:"hidden",accept:".json",type:"file"},null,544),e.createElementVNode("div",Hf,[e.createElementVNode("div",Kf,[e.createElementVNode("div",Gf,[e.createElementVNode("button",{onClick:w,class:"bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"},[e.createVNode(xf,{height:"16",width:"16"})])])])])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"text-slate-700 vsTailwind vs-popover__content bottom",style:e.normalizeStyle([{width:"fit-content","z-index":"10002",position:"fixed"},{position:"absolute",top:u.value.top+"px",left:u.value.left+"px"}])},[e.createElementVNode("div",Wf,[e.createElementVNode("div",Yf,[e.createElementVNode("button",{onClick:b,class:"text-slate-700 flex items-center gap-1 px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"},[e.createVNode(Cf,{class:"text-black",width:"14",height:"14"}),I[4]||(I[4]=e.createTextVNode(" Імпортувати ",-1))]),e.createElementVNode("button",{onClick:x,class:"text-slate-700 flex items-center px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"},[e.createElementVNode("span",qf,[e.createVNode(Sf,{class:"text-black",width:"14",height:"14"}),I[5]||(I[5]=e.createTextVNode(" Експортувати ",-1))])])])])],4)):e.createCommentVNode("",!0)])),e.createElementVNode("button",{onClick:K,class:"text-slate-700 bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"},[e.createVNode(zt),I[6]||(I[6]=e.createTextVNode(" Додати ",-1))])]),e.createElementVNode("div",Xf,[e.createElementVNode("table",Zf,[e.createElementVNode("thead",Jf,[e.createElementVNode("tr",Qf,[e.createElementVNode("th",e0,[e.createVNode(Pn,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.colModel,T=>(e.openBlock(),e.createElementBlock("th",{key:T.key,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]"},e.toDisplayString(T.ua||T.label),1))),128)),I[7]||(I[7]=e.createElementVNode("th",{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-center"}," Дії ",-1))])]),e.createElementVNode("tbody",{class:e.normalizeClass({"[&_tr:last-child]:border-0":!s.value})},[o.value.length===0?(e.openBlock(),e.createElementBlock("td",t0,[e.createElementVNode("div",l0,[e.createElementVNode("div",a0,[e.createVNode(If,{class:"w-48 mx-auto"}),I[8]||(I[8]=e.createElementVNode("div",{class:"max-w-sm mx-auto mt-6"},[e.createElementVNode("p",{class:"font-medium text-gray-800 dark:text-neutral-200"},"Нічого не знайдено"),e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"})],-1))])])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(T,Y)=>(e.openBlock(),e.createElementBlock("tr",{key:T.id,class:e.normalizeClass(["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":i.value===Y,"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20":s.value===Y}]),draggable:"true",onDragstart:J=>p(Y),onDragover:e.withModifiers(J=>k(Y),["prevent"]),onDrop:J=>m(Y)},[e.createElementVNode("td",r0,[e.createElementVNode("div",o0,[e.createVNode(Pn,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.colModel,J=>(e.openBlock(),e.createElementBlock("td",{key:J.key,class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},[J.type==="file"?(e.openBlock(),e.createElementBlock("div",s0,[h(H(T,J))?(e.openBlock(),e.createElementBlock("div",i0,[e.createElementVNode("img",{src:H(T,J),alt:"alt",width:"45",class:"rounded-md max-w-[45px] h-[45px] object-cover"},null,8,c0)])):(e.openBlock(),e.createElementBlock("div",d0,[e.createVNode(In,{class:"w-[25px] min-w-[25px] h-[25px]"})]))])):J.type==="tiptap-editor"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors line-clamp-3",innerHTML:H(T,J)},null,8,u0)):J.type==="reference"?(e.openBlock(),e.createElementBlock("div",p0,e.toDisplayString(H(T,J)),1)):(e.openBlock(),e.createElementBlock("div",m0,e.toDisplayString(H(T,J)),1))]))),128)),e.createElementVNode("td",f0,[e.createElementVNode("div",h0,[e.createElementVNode("button",{onClick:J=>v(T,Y),class:"text-slate-700 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-7 w-7 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"},[e.createVNode(Rf,{width:"24",height:"24",class:"w-3 h-3"})],8,g0),e.createElementVNode("button",{onClick:J=>le(Y),class:"text-slate-700 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-7 w-7 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"},[e.createVNode(hl,{width:"24",height:"24",class:"w-3 h-3"})],8,k0)])])],42,n0))),128))],2)])]),e.createVNode(e.unref(pl),{teleport:"#modal",visible:f.value,title:y.value,size:"lg",onClose:P},{default:e.withCtx(()=>[e.createVNode(Ft,{schema:t.colModel,values:V.value,"onUpdate:values":I[1]||(I[1]=T=>V.value=T),form:$.value,"onUpdate:form":I[2]||(I[2]=T=>$.value=T)},null,8,["schema","values","form"]),e.createElementVNode("div",y0,[e.createElementVNode("button",{type:"button",onClick:I[3]||(I[3]=T=>f.value=!1),class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),e.createElementVNode("button",{onClick:W,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])]),_:1},8,["visible","title"])]))}}),x0={draw:{toolbar:{actions:{title:"Скасувати малювання",text:"Скасувати"},finish:{title:"Завершити малювання",text:"Завершити"},undo:{title:"Видалити останню точку",text:"Видалити останню"},buttons:{polyline:"Намалювати лінію",polygon:"Намалювати полігон",rectangle:"Намалювати прямокутник",circle:"Намалювати коло",marker:"Додати точку",circlemarker:"Додати маркер-коло"}},handlers:{circle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати коло",end:"Відпустіть кнопку миші, щоб завершити"},radius:"Радіус"},circlemarker:{tooltip:{start:"Клацніть на карту, щоб додати маркер-коло"}},marker:{tooltip:{start:"Клацніть на карту, щоб додати точку"}},polygon:{tooltip:{start:"Клацніть, щоб почати малювати полігон",cont:"Клацайте, щоб продовжити малювати полігон",end:"Клацніть першу точку, щоб завершити полігон"}},polyline:{error:"<strong>Помилка:</strong> лінія не може перетинатися сама з собою",tooltip:{start:"Клацніть, щоб почати малювати лінію",cont:"Клацайте, щоб продовжити малювати лінію",end:"Клацніть останню точку, щоб завершити лінію"}},rectangle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати прямокутник",end:"Відпустіть кнопку миші, щоб завершити"}},simpleshape:{tooltip:{end:"Відпустіть кнопку миші, щоб завершити"}}}},edit:{toolbar:{actions:{save:{title:"Зберегти зміни",text:"Зберегти"},cancel:{title:"Скасувати редагування",text:"Скасувати"},clearAll:{title:"Очистити всі шари",text:"Очистити все"}},buttons:{edit:"Редагувати шари",editDisabled:"Немає шарів для редагування",remove:"Видалити шари",removeDisabled:"Немає шарів для видалення"}},handlers:{edit:{tooltip:{text:"Перетягніть маркери, щоб редагувати шари",subtext:"Натисніть 'Скасувати', щоб повернутися"}},remove:{tooltip:{text:"Клацніть на шари, щоб видалити їх"}}}}};function Ht(l){return l?l.type==="Polygon"?{type:"MultiPolygon",coordinates:[l.coordinates]}:l.type==="Feature"?{...l,geometry:Ht(l.geometry)}:l.type==="FeatureCollection"?{...l,features:(l.features||[]).map(t=>Ht(t)).filter(Boolean)}:l:null}function w0(l){return l?l.type==="FeatureCollection"||l.type==="Feature"?Ht(l):l.geom?{type:"Feature",geometry:Ht({type:l.geom.type,coordinates:l.geom.coordinates}),properties:{}}:l.type&&l.coordinates?{type:"Feature",geometry:Ht(l),properties:{}}:null:null}const E0={},_0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",fill:"none","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-map-pin"};function C0(l,t){return e.openBlock(),e.createElementBlock("svg",_0,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"},null,-1),e.createElementVNode("path",{d:"M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0z"},null,-1)]))}const V0=ce(E0,[["render",C0]]),N0={},B0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none","stroke-width":"2",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-line"};function S0(l,t){return e.openBlock(),e.createElementBlock("svg",B0,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),e.createElementVNode("path",{d:"M18 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),e.createElementVNode("path",{d:"M7.5 16.5l9 -9"},null,-1)]))}const A0=ce(N0,[["render",S0]]),D0={},L0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-polygon"};function M0(l,t){return e.openBlock(),e.createElementBlock("svg",L0,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M6.5 9.5l3.5 -3"></path><path d="M14 5.5l3 1.5"></path><path d="M18.5 10l-2.5 7"></path><path d="M13.5 17.5l-7 -5"></path>',9)]))}const T0=ce(D0,[["render",M0]]),F0={},I0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-topology-ring-3"};function O0(l,t){return e.openBlock(),e.createElementBlock("svg",I0,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M8 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M6 8v8"></path><path d="M18 16v-8"></path><path d="M8 6h8"></path><path d="M16 18h-8"></path>',9)]))}const $0=ce(F0,[["render",O0]]),v0={},R0={version:"1.1",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg","xmlns:sketch":"http://www.bohemiancoding.com/sketch/ns","xmlns:xlink":"http://www.w3.org/1999/xlink",class:"fullscreen-icon"};function P0(l,t){return e.openBlock(),e.createElementBlock("svg",R0,t[0]||(t[0]=[e.createElementVNode("title",null,null,-1),e.createElementVNode("desc",null,null,-1),e.createElementVNode("defs",null,null,-1),e.createElementVNode("g",{fill:"none","fill-rule":"evenodd",id:"Page-1",stroke:"none","stroke-width":"1"},[e.createElementVNode("g",{fill:"#000000",id:"Core",transform:"translate(-215.000000, -257.000000)"},[e.createElementVNode("g",{id:"fullscreen",transform:"translate(215.000000, 257.000000)"},[e.createElementVNode("path",{d:"M2,9 L0,9 L0,14 L5,14 L5,12 L2,12 L2,9 L2,9 Z M0,5 L2,5 L2,2 L5,2 L5,0 L0,0 L0,5 L0,5 Z M12,12 L9,12 L9,14 L14,14 L14,9 L12,9 L12,12 L12,12 Z M9,0 L9,2 L12,2 L12,5 L14,5 L14,0 L9,0 L9,0 Z",id:"Shape"})])])],-1)]))}const U0=ce(v0,[["render",P0]]),j0={class:"map-search-widget flex flex-col gap-2 rounded-xl widget min-w-[200px]"},z0={key:0,class:"vs-select__options absolute z-50 mt-1 w-full bg-white border border-gray-300 shadow-lg rounded-lg text-sm"},H0=["onClick"],K0={class:"relative flex-1 min-w-[140px]"},G0=["placeholder"],W0="https://data.softpro.ua/api-user/gis-url-proxy",Y0="https://geo.rv.ua/api-user/dzk.api",q0=e.defineComponent({__name:"map-search",props:{config:{}},emits:["goToCoordinates"],setup(l,{emit:t}){const a=l,n=t,r=["here","xy","parcel"],o=e.computed(()=>{var E,N;const f=(N=(E=a.config)==null?void 0:E.tools)==null?void 0:N.filter(V=>r.includes(V));return f&&f.length?f:r}),i=e.computed(()=>{var f,E;return((E=(f=a.config)==null?void 0:f.placeholder)==null?void 0:E.trim())||"Пошук…"}),s=e.ref(o.value[0]??r[0]);e.watch(o,f=>{f.includes(s.value)||(s.value=f[0])});const c=e.ref(""),d=e.ref(!1),u=e.ref(null);e.watch(s,()=>{c.value="",d.value=!1});function p(f){s.value=f}function k(f){if(!d.value)return;const E=u.value;E&&!E.contains(f.target)&&(d.value=!1)}e.onMounted(()=>{window.addEventListener("click",k,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("click",k,!0)});function m(f){return f==="xy"?"Координати":f==="parcel"?"Кадастр":"Адреси"}function w(f){const E=f.replace(/[,]+/g," ").trim();if(!E)return null;const N=E.split(/\s+/).filter(Boolean);if(N.length<2)return null;const V=N.slice(0,2).map(Number);if(!V.every(P=>Number.isFinite(P)))return null;let[$,K]=V,H=$,v=K;const W=P=>Math.abs(P)<=90,le=P=>Math.abs(P)<=180;if(!W(H)||!le(v))if(W(v)&&le(H))H=K,v=$;else return null;return{lat:H,lng:v}}function b(f){return((f==null?void 0:f.items)||[]).map((E,N)=>{var V,$,K;return{id:String((E==null?void 0:E.id)??N),title:(E==null?void 0:E.title)||((V=E==null?void 0:E.address)==null?void 0:V.label)||"Знайдений обʼєкт",lat:Number(($=E==null?void 0:E.position)==null?void 0:$.lat),lng:Number((K=E==null?void 0:E.position)==null?void 0:K.lng)}}).filter(E=>Number.isFinite(E.lat)&&Number.isFinite(E.lng))}function h(f){const E=(f==null?void 0:f.result)||(f==null?void 0:f.data)||f;if(!E)return[];const N=E.geom_centroid;if(!N||!Array.isArray(N.coordinates))return[];const[V,$]=N.coordinates;return!Number.isFinite($)||!Number.isFinite(V)?[]:[{id:"parcel",title:E.cadnum||E.cad_num||"Земельна ділянка",lat:$,lng:V}]}function g(f){const E=f.replace(/\s+/g,"").split(":");if(E.length!==4)return!1;const N=[10,2,3,4];return E.every((V,$)=>V.length===N[$]&&/^\d+$/.test(V))}function x(f){n("goToCoordinates",[f.lat,f.lng])}async function y(){const f=c.value.trim();if(f){if(s.value==="xy"){const E=w(f);if(!E){ke({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}x(E),c.value="";return}try{const E=new URL(s.value==="here"?W0:Y0);if(s.value==="here")E.searchParams.set("searchtext",f);else{if(!g(f)){ke({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}E.searchParams.set("cad_num",f)}const N=await fetch(E.toString());if(!N.ok)throw new Error(`HTTP ${N.status}`);const V=await N.json(),$=s.value==="here"?b(V):h(V);if(!$.length)ke({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const K=$[0];x(K),c.value=""}}catch(E){const N=(E==null?void 0:E.message)||"Помилка пошуку";ke({type:"error",title:"Пошук",message:N})}}}return(f,E)=>(e.openBlock(),e.createElementBlock("div",j0,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(y,["prevent"])},[o.value.length>1?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:u,class:"relative search-type w-[140px]"},[e.createElementVNode("button",{type:"button",class:"vstSelect-input transition-all text-left bg-white border border-gray-200 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-100 block w-full py-1.5 px-3 text-sm cursor-pointer flex items-center justify-between gap-2",onClick:E[0]||(E[0]=N=>d.value=!d.value)},[e.createElementVNode("span",null,e.toDisplayString(m(s.value)),1),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":d.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},E[2]||(E[2]=[e.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]),2))]),d.value?(e.openBlock(),e.createElementBlock("div",z0,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,N=>(e.openBlock(),e.createElementBlock("li",{key:N,class:"px-3 py-2 cursor-pointer hover:bg-gray-100",onClick:V=>p(N)},e.toDisplayString(m(N)),9,H0))),128))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",K0,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":E[1]||(E[1]=N=>c.value=N),placeholder:i.value,type:"text",class:"vs-input transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,8,G0),[[e.vModelText,c.value,void 0,{trim:!0}]]),E[3]||(E[3]=e.createElementVNode("button",{type:"submit",class:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600","aria-label":"Пошук"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-4.35-4.35m0 0A7.5 7.5 0 1 0 5 5a7.5 7.5 0 0 0 11.65 11.65Z"})])],-1))])],32)]))}}),X0=ce(q0,[["__scopeId","data-v-3048520a"]]),Z0={class:"bg-white/30 p-1 rounded-md shadow"},J0={class:"flex gap-2"},Q0=["onClick","title"],eh=["src"],th=e.defineComponent({__name:"map-layers",props:{basemaps:{}},emits:["onLayerChange"],setup(l,{emit:t}){const a=e.ref(Object.keys(l.basemaps)[0]),n=t;function r(o){n("onLayerChange",o),a.value=o}return(o,i)=>(e.openBlock(),e.createElementBlock("div",Z0,[e.createElementVNode("div",J0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.basemaps,(s,c)=>(e.openBlock(),e.createElementBlock("div",{key:c,class:e.normalizeClass(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm",{"ring-2 ring-blue-500 border-blue-300":a.value===c}]),onClick:d=>r(c),title:s.name||c,role:"button",tabindex:"0"},[e.createElementVNode("img",{src:s.preview,alt:"",class:"w-10 h-10 object-cover"},null,8,eh)],10,Q0))),128))])]))}}),lh={key:0,class:"absolute inset-0 z-[2000] flex items-center justify-center pointer-events-none bg-black/20"},ah={class:"bg-black/50 text-white px-6 py-2 rounded-lg text-center max-w-sm mx-4 backdrop-blur-sm"},nh={class:"text-sm font-medium"},rh={key:0,class:"absolute top-4 left-4 z-[1000] w-[calc(100%-20px)] sm:w-[350px]"},oh={key:1,class:"form-geom__panel flex gap-1 items-start mt-2"},sh={class:"flex items-center gap-1"},ih=["disabled"],ch=["disabled"],dh=["disabled"],uh={class:"absolute top-4 right-4 z-[1000]"},ph={class:"flex flex-col gap-[2px]"},mh=["disabled"],fh=["disabled"],hh=["disabled"],gh=["disabled"],kh={class:"flex flex-col gap-2"},yh={key:0,class:"bg-white/95 border border-gray-200 rounded-md shadow-sm px-3 py-2 text-xs text-gray-700 min-w-[200px]"},bh={class:"flex flex-col gap-1"},xh=["checked","disabled","onChange"],wh={class:"text-gray-700 text-xs font-medium"},Eh={class:"absolute bottom-0 left-0 right-0 z-[1000] bg-white/95 border-t border-gray-200 text-xs text-gray-700 flex items-center gap-4 pt-1"},_h={key:0,class:"form-geom__feature flex items-center text-xs transition-all gap-2 w-full"},Ch={class:"shrink-0"},Vh={class:"font-bold"},Nh={class:"flex items-center"},Bh={class:"text-xs mr-2"},Sh={key:0,class:"text-xs"},Ah={key:1,class:"text-xs"},Dh=["disabled"],Lh=["disabled"],Mh=e.defineComponent({__name:"vs-input-map",props:{tools:{},handleZoom:{type:Boolean,default:!0},geomType:{default:()=>[]},prefix:{default:""},layers:{default:()=>[]},api:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},emits:["update:modelValue"],setup(l,{emit:t}){var me;const a=e.getCurrentInstance(),n=l,r=t,o=e.computed(()=>{const _={search:!1,import:!1,export:!1,point:!1,line:!1,polygon:!1,rectangle:!1};if(!n.tools||!n.tools.length)return _;const A=new Set(n.tools.map(O=>O.toLowerCase()));return{search:A.has("search"),import:A.has("import"),export:A.has("export"),point:A.has("point"),line:A.has("line"),polygon:A.has("polygon"),rectangle:A.has("rectangle")}}),i=e.computed(()=>!!n.disabled),s=e.ref(!1),c=e.ref(null),d=e.ref(null),u=e.ref(!1),p=e.ref(""),k=e.reactive({}),m=e.ref([]),w=e.computed(()=>m.value.map(_=>k[_]).filter(_=>!!_)),b=e.computed(()=>Array.isArray(n.layers)&&n.layers.some(_=>`${(_==null?void 0:_.service)??""}`.toLowerCase()==="vtile"));let h,g,x;function y(){return navigator.platform.toUpperCase().indexOf("MAC")>=0,/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?"Використовуйте два пальці для зуму карти.":"Використовуйте Ctrl + прокрутка для зуму карти."}const f=e.ref(null),E=e.ref(null);let N=null;const V=e.ref(null),$=_=>{_.ctrlKey&&_.preventDefault()};function K(_,A){return _!=null&&_.id?String(_.id):_!=null&&_.url?`${_.url}-${A}`:`layer-${A}`}function H(_){if(!_)return"";if(/^https?:\/\//i.test(_))return _.replace(/\/+$/,"");const A=_.replace(/^\/+/,"").replace(/\/+$/,"");return A?`/${A}`:""}function v(_){var q;const A=(_==null?void 0:_.url)??"";if(!A||/^https?:\/\//i.test(A))return A;const O=typeof window<"u"&&((q=window.location)!=null&&q.origin)?window.location.origin:"";if(A.startsWith("/"))return O?`${O}${A}`:A;const j=H(_==null?void 0:_.prefix),G=H(n.prefix),S=j||G,D=A.replace(/^\/+/,""),z=S?`${S.replace(/\/$/,"")}/${D}`:`/${D}`;return O?`${O}${z}`:z}function W(_){const A=(_==null?void 0:_.style)??{};return O=>{const j=A.colorAttr,G=A.colorSet??{},S=typeof j=="string"?(G==null?void 0:G[O==null?void 0:O[j]])??A.color??"#3388ff":A.color??"#3388ff",D=A.stroke??S;return{weight:A.width??1,color:D,opacity:A.opacity??1,fill:A.type?A.type!=="polyline":!0,fillColor:S,fillOpacity:A.opacity??.5}}}function le(_){const A=(_==null?void 0:_.colorSet)||(_==null?void 0:_.colors);if(_!=null&&_.colorAttr&&A){const O=Object.entries(A).flat();return["match",["get",_.colorAttr],...O,_.color??"#94a3b8"]}return(_==null?void 0:_.color)??"#3388ff"}function P(_,A,O){if(!_)return[];const j=[],G=le(_);return _.icon&&j.push({id:`${A}-icon`,type:"symbol",source:A,"source-layer":O,minzoom:_.iconZoom||0,layout:{"icon-image":_.icon,"icon-size":1,"icon-allow-overlap":!0,"icon-ignore-placement":!0}}),_.pointZoom&&j.push({id:`${A}-point`,type:"circle",source:A,"source-layer":O,maxzoom:_.pointZoom,paint:{"circle-stroke-color":_.stroke||"#fff","circle-opacity":_.opacity??1,"circle-color":G,"circle-stroke-width":_.width??1,"circle-radius":_.radius??5}}),_.type==="polygon"?j.push({id:`${A}-fill`,type:"fill",source:A,"source-layer":O,minzoom:_.pointZoom||0,paint:{"fill-color":G,"fill-opacity":_.opacity??.5,"fill-outline-color":_.stroke||G}}):_.type==="line"?j.push({id:`${A}-line`,type:"line",source:A,"source-layer":O,paint:{"line-color":G,"line-opacity":_.opacity??1,"line-width":_.width??1.5}}):_.icon||j.push({id:`${A}-circle`,type:"circle",source:A,"source-layer":O,paint:{"circle-stroke-color":_.stroke||"#fff","circle-opacity":_.opacity??1,"circle-color":G,"circle-stroke-width":_.width??1,"circle-radius":_.radius??5}}),j}function F(_,A){var S;const O=_.id||`source-${Math.random().toString(36).slice(2,8)}`,j=_.sourceLayer||_.layer||_.service_layer||_.service_key||_.map_key||((S=_.dataset)==null?void 0:S.layer)||_.id||_.table_name||O,G=P(_.style||{},O,j||O);return G.length?{version:8,glyphs:"https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf",sources:{[O]:{type:"vector",tiles:[A],minzoom:_.minzoom??0,maxzoom:_.maxzoom??19}},layers:G}:null}function I(_){var G,S,D,z;const A=((_==null?void 0:_.service)??"").toLowerCase(),O=v(_),j=_.sourceLayer||_.layer||_.service_layer||_.service_key||_.map_key||((G=_.dataset)==null?void 0:G.layer)||_.id||_.table_name;if(console.info("[vs-input-map] create overlay layer",{id:_.id,service:A,url:O,sourceLayer:j,hasSourceLayer:!!j}),A==="vtile"){if((S=L==null?void 0:L.vectorGrid)!=null&&S.protobuf&&!(L!=null&&L.maplibreGL))return console.info("[vs-input-map] using Leaflet.vectorGrid"),L.vectorGrid.protobuf(O,{interactive:!0,vectorTileLayerStyles:{default:W(_)}});if(L!=null&&L.maplibreGL&&(window!=null&&window.maplibregl)){console.info("[vs-input-map] using maplibre-gl-leaflet");const q=F(_,O);return q?L.maplibreGL({style:q,interactive:!1,pane:"overlayPane"}):(console.warn("[vs-input-map] maplibre spec is empty",_.id),null)}return null}return A==="tile"||/^https?:\/\//i.test(O)||O.includes("{z}")?L.tileLayer(O,{opacity:((D=_==null?void 0:_.style)==null?void 0:D.opacity)??1}):L.tileLayer(O,{opacity:((z=_==null?void 0:_.style)==null?void 0:z.opacity)??1})}function T(){h&&m.value.forEach(_=>{const A=k[_];A&&(A.visible?(A.layer||(A.layer=I(A.config)),A.layer&&!h.hasLayer(A.layer)?(console.info("[vs-input-map] add overlay layer to map",A.id),A.layer.addTo(h)):A.layer||console.warn("[vs-input-map] overlay layer is null",A.id)):A.layer&&h.hasLayer(A.layer)&&(console.info("[vs-input-map] remove overlay layer from map",A.id),h.removeLayer(A.layer)))})}function Y(_){if(i.value)return;const A=k[_];A&&(A.visible=!A.visible,h&&(console.info("[vs-input-map] toggle overlay",{id:_,nextVisible:A.visible,hasLayerInstance:!!A.layer}),A.visible?(A.layer||(A.layer=I(A.config)),A.layer&&!h.hasLayer(A.layer)&&(console.info("[vs-input-map] add overlay layer to map",A.id),A.layer.addTo(h))):A.layer&&h.hasLayer(A.layer)&&h.removeLayer(A.layer)))}function J(){if(!n.handleZoom)return null;let _;const A=j=>{const G=j.ctrlKey||j.metaKey,S=j.shiftKey;if(!G&&!S){u.value=!0,p.value=y(),clearTimeout(_),_=window.setTimeout(()=>{u.value=!1},1e3);return}u.value=!1,h.scrollWheelZoom.enable(),setTimeout(()=>{h.scrollWheelZoom.disable()},100)},O=j=>{if(j.touches.length===1){u.value=!0,p.value=y(),clearTimeout(_),_=window.setTimeout(()=>{u.value=!1},3e3);return}u.value=!1};return E.value&&(E.value.addEventListener("wheel",A,{passive:!1}),E.value.addEventListener("touchstart",O,{passive:!0})),h&&h.on("wheel",j=>{const G=j.originalEvent.ctrlKey||j.originalEvent.metaKey,S=j.originalEvent.shiftKey;!G&&!S&&(j.originalEvent.preventDefault(),j.originalEvent.stopPropagation())}),()=>{E.value&&(E.value.removeEventListener("wheel",A),E.value.removeEventListener("touchstart",O)),h&&h.off("wheel"),clearTimeout(_)}}const pe=e.ref(null),_e=e.ref(6),Fe=e.ref(0),Vt=e.ref(((me=a==null?void 0:a.appContext.config.globalProperties.$settings)==null?void 0:me.center)||[50,30]),Ce=e.ref(null),Ie=U();let ct;const dt=e.ref("topo100");function ut(_){return _?_.type==="Polygon"?{type:"MultiPolygon",coordinates:[_.coordinates]}:(_.type,_):null}function Nt(){return new Promise((_,A)=>{window.L&&window.L.Draw&&_(0);const O=S=>{if(Array.from(document.styleSheets).some(z=>{var q;return(q=z==null?void 0:z.href)==null?void 0:q.includes(S)}))return;const D=document.createElement("link");D.rel="stylesheet",D.href=S,document.head.appendChild(D)},j=S=>new Promise((D,z)=>{const q=Array.from(document.scripts).find(ie=>ie.src===S);if(q){q.addEventListener("load",()=>D()),q.addEventListener("error",ie=>z(ie));return}const re=document.createElement("script");re.src=S,re.async=!0,re.onload=()=>D(),re.onerror=ie=>z(ie),document.body.appendChild(re)});O("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"),O("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"),b.value&&O("https://unpkg.com/maplibre-gl@4.5.0/dist/maplibre-gl.css");let G=j("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(()=>j("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js"));b.value?G=G.then(()=>j("https://unpkg.com/maplibre-gl@4.5.0/dist/maplibre-gl.js")).then(()=>(window.maplibregl&&!window.mapboxgl&&(window.mapboxgl=window.maplibregl),j("https://unpkg.com/@maplibre/maplibre-gl-leaflet@0.0.20/leaflet-maplibre-gl.js"))):G=G.then(()=>j("https://unpkg.com/leaflet.vectorgrid@1.3.0/dist/Leaflet.VectorGrid.bundled.js").catch(()=>Promise.resolve())),G.then(()=>_(0)).catch(A)})}function ve(){const _=g.toGeoJSON(),A=[];let O=null;const j=S=>{if(S)switch(S.type){case"Point":O=S;break;case"Polygon":A.push(S.coordinates);break;case"MultiPolygon":A.push(...S.coordinates);break;case"GeometryCollection":(S.geometries||[]).forEach(j);break}};((_==null?void 0:_.features)||[]).forEach(S=>j(S.geometry));const G=O||(A.length?{type:"MultiPolygon",coordinates:A}:null);r("update:modelValue",G?ut(G):null),Fe.value=g.getLayers().length}function Ke(_=30){const A=g.getLayers();if(!A.length)return;const O=L.featureGroup(A).getBounds();O&&O.isValid()&&h.fitBounds(O,{padding:[_,_]})}function at(){var _;i.value||((_=V.value)==null||_.click())}const Ve=e.ref("");e.watch(o,_=>{Ve.value&&!Object.entries(_).filter(([A,O])=>O).map(([A])=>A).includes(Ve.value)&&(x!=null&&x.disable&&x.disable(),Ve.value="")}),e.watch(()=>n.layers,_=>{const A=Array.isArray(_)?_:[],O=[],j=new Set;A.forEach((G,S)=>{if(!G)return;const D=K(G,S);O.push(D),j.add(D),console.info("[vs-input-map] overlay register",{id:D,service:G==null?void 0:G.service,url:G==null?void 0:G.url});const z=k[D];z?k[D]={...z,config:{...G,id:D}}:k[D]={id:D,config:{...G,id:D},visible:(G==null?void 0:G.overlay)!==!1,layer:null}}),Object.keys(k).forEach(G=>{if(j.has(G))return;const S=k[G];S!=null&&S.layer&&(h!=null&&h.hasLayer)&&h.hasLayer(S.layer)&&h.removeLayer(S.layer),delete k[G]}),m.value=O,T()},{immediate:!0,deep:!0}),e.watch(i,_=>{_&&x&&(x.disable(),Ve.value=""),g&&g.eachLayer(A=>{var O,j,G,S,D;_?(j=(O=A.dragging)==null?void 0:O.disable)==null||j.call(O):(G=A.dragging)!=null&&G.enable&&(A.dragging.enable(),(D=(S=A.dragging).enabled)==null||D.call(S))})});function Ge(_){return _ instanceof L.Circle?"Circle":_ instanceof L.Rectangle?"Rectangle":_ instanceof L.Polygon&&!(_ instanceof L.Rectangle)?"Polygon":_ instanceof L.Polyline&&!(_ instanceof L.Polygon)?"Polyline":_ instanceof L.Marker?"Point":"Feature"}function Xe(_){var A;if(_ instanceof L.Circle){const O=_.getRadius();return Math.PI*(O*O)/1e6}if(_ instanceof L.Polygon||_ instanceof L.Rectangle)try{const O=_.getLatLngs(),j=Array.isArray(O[0])?O[0]:O,G=(A=L.GeometryUtil)!=null&&A.geodesicArea?L.GeometryUtil.geodesicArea(j):0;return G?G/1e6:0}catch{return null}return null}function nt(_){return _ instanceof L.Circle?_.getLatLng():_.getBounds?_.getBounds().getCenter():_.getLatLng?_.getLatLng():h.getCenter()}async function bt(_,A){var G;if(f.value="",!((G=n.api)!=null&&G.length))return;const[O,j]=n.api;try{const S=new URL(O);S.searchParams.set("lat",String(_)),S.searchParams.set("lon",String(A));const D=await fetch(S.toString());if(!D.ok)throw new Error("Request failed");const z=await D.json();j&&z[j]!==void 0?f.value=String(z[j]):f.value=JSON.stringify(z)}catch(S){console.error("[vs-input-map] reverse geocode failed:",S),f.value=null}}function C(){const _=g.getLayers();if(!_.length){Ce.value=null,Fe.value=0;return}const A=_[_.length-1],O=Ge(A),j=nt(A),G=Xe(A);Ce.value={type:O,center:j,areaKm2:G,layer:A},Fe.value=_.length,bt(j.lat,j.lng)}function B(){var A;if(i.value)return;const _=(A=Ce.value)==null?void 0:A.layer;_&&(_ instanceof L.Circle&&_.getBounds?h.fitBounds(_.getBounds(),{padding:[30,30]}):_.getBounds?h.fitBounds(_.getBounds(),{padding:[30,30]}):_.getLatLng&&h.setView(_.getLatLng(),Math.max(_e.value,14)))}function R(){var A;if(i.value)return;const _=(A=Ce.value)==null?void 0:A.layer;_&&(g.removeLayer(_),ve(),C())}e.onMounted(async()=>{document.addEventListener("wheel",$,{passive:!1}),await Nt(),L.drawLocal=x0;const _=n.handleZoom;h=L.map(E.value,{zoomControl:!1,scrollWheelZoom:!_}).setView(Vt.value,10),setTimeout(()=>{N=J()},100),L.control.zoom({position:"bottomright"}).addTo(h),dt.value=Object.keys(Ie)[0],ct=L.tileLayer(Ie[dt.value].url,{maxZoom:19,minZoom:6}).addTo(h),g=new L.FeatureGroup().addTo(h),h.on(L.Draw.Event.CREATED,j=>{if(i.value)return;const{layer:G}=j;g.clearLayers(),g.addLayer(G),ve(),Ke(),Ve.value=""}),h.on(L.Draw.Event.EDITED,()=>{i.value||(ve(),C(),Ke())}),h.on(L.Draw.Event.DELETED,()=>{i.value||(ve(),C(),Ke())});let A=!1;h.on("mousemove",j=>{A||(h.invalidateSize(),A=!0),pe.value=j.latlng}),h.on("zoomend",()=>{_e.value=h.getZoom()});const O=w0(n.modelValue);if(O){const j=[];L.geoJSON(O).eachLayer(G=>j.push(G)),j.length&&g.addLayer(j[0]),ve(),C(),Ke()}T()}),e.onUnmounted(()=>{document.removeEventListener("wheel",$),N&&N(),Object.values(k).forEach(_=>{var A;_!=null&&_.layer&&((A=h==null?void 0:h.hasLayer)!=null&&A.call(h,_.layer)&&h.removeLayer(_.layer),typeof _.layer.remove=="function"&&_.layer.remove())})});function Z(_){if(!i.value&&h){switch(x&&x.disable(),_){case"marker":x=new L.Draw.Marker(h);break;case"polyline":x=new L.Draw.Polyline(h);break;case"polygon":x=new L.Draw.Polygon(h);break;case"rectangle":x=new L.Draw.Rectangle(h);break;default:x=new L.Draw.Rectangle(h);break}x&&(x.enable(),Ve.value=_)}}function he(){if(i.value)return;const _=g.toGeoJSON(),A=new Blob([JSON.stringify(_,null,2)],{type:"application/json"}),O=URL.createObjectURL(A),j=document.createElement("a");j.href=O,j.download="data.geojson",j.click(),URL.revokeObjectURL(O)}function ge(_){var G;if(i.value)return;const A=_.target,O=(G=A.files)==null?void 0:G[0];if(!O)return;const j=new FileReader;j.onload=()=>{if(typeof j.result=="string")try{const S=JSON.parse(j.result);g.clearLayers(),S&&L.geoJSON({type:"Feature",geometry:S}).eachLayer(D=>{g.addLayer(D)}),ve(),C(),Ke()}finally{A.value=""}},j.readAsText(O)}function oe(_){h&&(ct&&h.removeLayer(ct),ct=L.tileLayer(Ie[_].url,{maxZoom:19,minZoom:6}).addTo(h),dt.value=_)}function M(_){const A=L.latLng(_[0],_[1]);h.setView(A,13)}e.watch(()=>n.modelValue,_=>{const A=ut(_);if(_&&A!==_){r("update:modelValue",A);return}g.clearLayers(),A&&L.geoJSON({type:"Feature",geometry:A}).eachLayer(O=>{var j,G,S,D,z,q;if(g.addLayer(O),i.value){(G=(j=O.dragging)==null?void 0:j.disable)==null||G.call(j);return}(D=(S=O.dragging)==null?void 0:S.enable)==null||D.call(S),(q=(z=O.dragging)==null?void 0:z.enabled)==null||q.call(z),O.on("dragend",re=>{const ie=re.target.getLatLng();r("update:modelValue",{type:"Point",coordinates:[ie.lng,ie.lat]})})}),Fe.value=g.getLayers().length,C(),Ke()});function U(){var _,A;return(_=a==null?void 0:a.appContext.config.globalProperties.$settings)!=null&&_.basemaps?(A=a==null?void 0:a.appContext.config.globalProperties.$settings)==null?void 0:A.basemaps.map((O,j)=>Object.assign(O,{key:`b${j}`,preview:O.preview||O.url.replace("{z}/{x}/{y}.png","13/4790/2762.png")})).reduce((O,j)=>({...O,[j.key]:j}),{}):{topo100:{url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"},orto10:{url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4790/2762.png"},osmb:{url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png",preview:"https://tile.openstreetmap.org.ua/styles/osm-bright/13/4790/2762.png"}}}const se=e.ref(!1);return e.watch(se,()=>{setTimeout(()=>{h.invalidateSize()},50)}),e.watch(s,async _=>{if(!_||!d.value){c.value=null;return}await e.nextTick();const A=d.value.getBoundingClientRect();c.value={top:A.bottom+6,left:A.left}}),e.onUnmounted(()=>{s.value=!1,c.value=null}),(_,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["leaflet-map-wrapper relative w-full h-[400px]",{fullscreen:se.value}])},[e.createElementVNode("div",{ref_key:"mapContainer",ref:E,class:"w-full h-full"},null,512),e.createVNode(e.Transition,{name:"zoom-instructions","enter-active-class":"transition-all duration-200 ease-out","leave-active-class":"transition-all duration-500 ease-in","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[u.value&&n.handleZoom?(e.openBlock(),e.createElementBlock("div",lh,[e.createElementVNode("div",ah,[e.createElementVNode("p",nh,e.toDisplayString(p.value),1)])])):e.createCommentVNode("",!0)]),_:1}),o.value.search||o.value.import||o.value.export?(e.openBlock(),e.createElementBlock("div",rh,[o.value.search?(e.openBlock(),e.createBlock(X0,{key:0,onGoToCoordinates:M})):e.createCommentVNode("",!0),o.value.import||o.value.export?(e.openBlock(),e.createElementBlock("div",oh,[e.createElementVNode("div",sh,[o.value.import?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white transition",onClick:at,disabled:i.value}," Import ",8,ih)):e.createCommentVNode("",!0),o.value.export?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white transition",onClick:he,disabled:i.value||Fe.value===0}," Export ",8,ch)):e.createCommentVNode("",!0)]),e.createElementVNode("input",{ref_key:"importRef",ref:V,type:"file",onChange:ge,accept:".json,.geojson",class:"hidden",disabled:i.value},null,40,dh)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",uh,[e.createElementVNode("div",ph,[o.value.point?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["vs-btn",{"vs-active":Ve.value==="marker"}]),title:"Point",onClick:A[0]||(A[0]=O=>Z("marker")),disabled:i.value},[e.createVNode(V0)],10,mh)):e.createCommentVNode("",!0),o.value.line?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["vs-btn",{"vs-active":Ve.value==="polyline"}]),title:"Line",onClick:A[1]||(A[1]=O=>Z("polyline")),disabled:i.value},[e.createVNode(A0)],10,fh)):e.createCommentVNode("",!0),o.value.polygon?(e.openBlock(),e.createElementBlock("button",{key:2,class:e.normalizeClass(["vs-btn",{"vs-active":Ve.value==="polygon"}]),title:"Polygon",onClick:A[2]||(A[2]=O=>Z("polygon")),disabled:i.value},[e.createVNode(T0)],10,hh)):e.createCommentVNode("",!0),o.value.rectangle?(e.openBlock(),e.createElementBlock("button",{key:3,class:e.normalizeClass(["vs-btn",{"vs-active":Ve.value==="rectangle"}]),title:"Rectangle",onClick:A[3]||(A[3]=O=>Z("rectangle")),disabled:i.value},[e.createVNode($0)],10,gh)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"vs-btn mt-5",onClick:A[4]||(A[4]=O=>se.value=!se.value),title:"Full Screen"},[e.createVNode(U0,{style:{width:"12px",height:"12px"}})])])]),e.createElementVNode("div",{class:e.normalizeClass(["absolute left-4 z-[1000]",Ce.value?"bottom-8":"bottom-4"])},[e.createElementVNode("div",kh,[e.createVNode(th,{basemaps:e.unref(Ie),onOnLayerChange:oe},null,8,["basemaps"]),w.value.length?(e.openBlock(),e.createElementBlock("div",yh,[A[9]||(A[9]=e.createElementVNode("p",{class:"font-semibold text-[11px] uppercase tracking-wide text-gray-500 mb-2"},"Layers",-1)),e.createElementVNode("div",bh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,O=>(e.openBlock(),e.createElementBlock("label",{key:O.id,class:"flex items-center gap-2 cursor-pointer select-none"},[e.createElementVNode("input",{type:"checkbox",class:"rounded border-gray-300 text-blue-600 focus:ring-blue-500",checked:O.visible,disabled:i.value,onChange:j=>Y(O.id)},null,40,xh),e.createElementVNode("span",wh,e.toDisplayString(O.config.title||O.config.name||O.id),1)]))),128))])])):e.createCommentVNode("",!0)])],2),e.createElementVNode("div",Eh,[Ce.value?(e.openBlock(),e.createElementBlock("div",_h,[e.createElementVNode("div",{class:"mr-auto flex items-center gap-2 min-w-0 relative",onMouseenter:A[5]||(A[5]=O=>s.value=!0),onMouseleave:A[6]||(A[6]=O=>s.value=!1)},[e.createElementVNode("div",Ch,[A[10]||(A[10]=e.createTextVNode(" Type: ",-1)),e.createElementVNode("span",Vh,e.toDisplayString(Ce.value.type),1)]),f.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"addressEl",ref:d,class:"text-gray-500 text-xs truncate cursor-help",style:{"max-width":"260px"}}," Address: "+e.toDisplayString(f.value),513)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[s.value&&f.value&&c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed z-[99999] pointer-events-none bg-gray-800 text-white text-xs px-2 py-1 rounded shadow whitespace-nowrap",style:e.normalizeStyle({top:c.value.top+"px",left:c.value.left+"px"})},e.toDisplayString(f.value),5)):e.createCommentVNode("",!0)]))],32),e.createElementVNode("div",Nh,[e.createElementVNode("div",Bh,[A[11]||(A[11]=e.createTextVNode(" Center: ",-1)),e.createElementVNode("b",null,e.toDisplayString(Ce.value.center.lat.toFixed(5))+", "+e.toDisplayString(Ce.value.center.lng.toFixed(5)),1)]),Ce.value.areaKm2!==null?(e.openBlock(),e.createElementBlock("div",Sh,[A[12]||(A[12]=e.createTextVNode(" Area: ",-1)),e.createElementVNode("b",null,e.toDisplayString(Ce.value.areaKm2.toFixed(1))+" km²",1)])):(e.openBlock(),e.createElementBlock("div",Ah,A[13]||(A[13]=[e.createTextVNode("Area: ",-1),e.createElementVNode("b",null,"—",-1)]))),e.createElementVNode("button",{class:"tool bg-gray-100 py-1.5 px-2 rounded-lg text-md mr-1 cursor-pointer hover:bg-blue-500 hover:text-white transition-all",title:"Zoom to feature",onClick:A[7]||(A[7]=O=>B()),disabled:i.value},A[14]||(A[14]=[e.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-3 h-3" data-v-150e767b><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-150e767b></path><path d="M7 10l6 0" data-v-150e767b></path><path d="M10 7l0 6" data-v-150e767b></path><path d="M21 21l-6 -6" data-v-150e767b></path></svg>',1)]),8,Dh),e.createElementVNode("button",{class:"tool bg-gray-100 py-1.5 px-2 rounded-lg text-md cursor-pointer hover:bg-blue-500 hover:text-white transition-all",title:"Delete feature",onClick:A[8]||(A[8]=O=>R()),disabled:i.value},[e.createVNode(hl,{class:"w-3 h-3"})],8,Lh)])])):e.createCommentVNode("",!0)])],2))}}),Th=ce(Mh,[["__scopeId","data-v-150e767b"]]),Fh=["data-focus"],Ih={class:"flex items-center"},Oh={class:"overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border"},$h=["onClick","aria-label"],vh={key:0,class:"absolute text-gray-500 truncate pl-2"},Rh={class:"flex-1 min-w-[2px]"},Ph=["placeholder"],Uh={class:"flex items-center shrink-0"},jh=["disabled"],zh=e.defineComponent({__name:"vs-input-tag",props:e.mergeModels({unique:{type:Boolean,default:!0},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:"Введіть тег"}},{modelValue:{default:[]},modelModifiers:{}}),emits:e.mergeModels(["update:modelValue"],["update:modelValue"]),setup(l,{emit:t}){const a=l,n=t;Ue(a.style);const r=e.ref(null),o=e.ref(null),i=e.ref(null),s=e.ref(!1),c=e.ref(""),d=e.useModel(l,"modelValue"),u=e.computed(()=>a.placeholder||"Add tag…"),p=e.computed(()=>{var N;return((N=d.value)==null?void 0:N.length)===0&&c.value===""}),k=e.computed(()=>{var N;return!a.disabled&&((N=d.value)==null?void 0:N.length)>0}),m=e.computed(()=>a.disabled),w=async()=>{m.value||await e.nextTick(()=>{var N;return(N=i.value)==null?void 0:N.focus()})},b=N=>{const V=N.trim();V!==""&&(!d.value||!Array.isArray(d.value)?d.value=[V]:a.unique?d.value.includes(V)||(d.value=[...d.value,V]):d.value=[...d.value,V],c.value="")},h=()=>{const N=c.value;N.trim()!==""&&b(N),c.value=""},g=N=>{const V=d.value.slice();V.splice(N,1),n("update:modelValue",V)},x=()=>{n("update:modelValue",[])},y=()=>{m.value||(s.value=!0)},f=()=>{s.value=!1,!m.value&&h()},E=N=>{const{key:V}=N;V==="Enter"?(N.preventDefault(),h()):V==="Backspace"&&c.value===""&&d.value.length>0&&g(d.value.length-1)};return(N,V)=>(e.openBlock(),e.createElementBlock("div",{class:"flex gap-1 w-full",ref_key:"root",ref:r,onClick:V[1]||(V[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["relative w-full font-sans",a.customClass]),role:"group","aria-label":"Tag input"},[e.createElementVNode("div",{class:e.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white","border-gray-300 hover:border-gray-400",s.value?"border-blue-500 ring-1 ring-blue-500":"",m.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),"data-focus":s.value?"true":"false",onClick:w},[e.createElementVNode("div",{class:"flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",ref_key:"chipsRef",ref:o},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,($,K)=>(e.openBlock(),e.createElementBlock("div",{key:K,class:"flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"},[e.createElementVNode("div",Ih,[e.createElementVNode("div",Oh,e.toDisplayString($),1)]),e.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",onClick:e.withModifiers(H=>g(K),["stop"]),"aria-label":`Remove ${$}`},V[2]||(V[2]=[e.createElementVNode("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,$h)]))),128)),p.value?(e.openBlock(),e.createElementBlock("div",vh,e.toDisplayString(u.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Rh,[m.value?e.createCommentVNode("",!0):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:i,class:"pl-2 w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-label":"Add tag","onUpdate:modelValue":V[0]||(V[0]=$=>c.value=$),onFocus:y,onBlur:f,onKeydown:E,placeholder:d.value&&d.value.length?"":void 0},null,40,Ph)),[[e.vModelText,c.value]])])],512),e.createElementVNode("div",Uh,[k.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-label":"Clear all tags",disabled:m.value,onClick:e.withModifiers(x,["stop"])},V[3]||(V[3]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,jh)):e.createCommentVNode("",!0)])],10,Fh)],2)],512))}}),Hh={class:"relative flex gap-1 bg-white w-full"},Kh=["disabled","placeholder"],Gh=e.defineComponent({__name:"vs-input-slug",props:e.mergeModels({disabled:{type:Boolean},placeholder:{},parent:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=e.inject("values"),a=l,n=e.useModel(l,"modelValue");function r(i){const s={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"e",ж:"zh",з:"z",и:"i",й:"y",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"kh",ц:"ts",ч:"ch",ш:"sh",щ:"shch",ы:"y",э:"e",ю:"yu",я:"ya",ь:"",ъ:"",є:"ye",і:"i",ї:"yi",ґ:"g"};return i.toLowerCase().split("").map(c=>s[c]||c).join("").replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}const o=()=>{var c,d;const i=(d=(c=t==null?void 0:t.value)==null?void 0:c[a.parent||""])==null?void 0:d.toString(),s=r(i);n.value=s.toString()};return(i,s)=>(e.openBlock(),e.createElementBlock("div",Hh,[e.withDirectives(e.createElementVNode("input",{ref:"vsText",disabled:i.disabled,placeholder:i.placeholder,"onUpdate:modelValue":s[0]||(s[0]=c=>n.value=c),class:"block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,8,Kh),[[e.vModelText,n.value]]),e.createElementVNode("button",{class:"px-2 bg-gray-100 border rounded-lg hover:bg-gray-200",onClick:o}," Gen ")]))}}),Wh=ce(Gh,[["__scopeId","data-v-b0eba370"]]),Yh={class:"relative flex gap-1 bg-white w-full"},qh=["disabled","placeholder"],Xh=["disabled"],Zh={key:0},Jh={key:1},Qh=e.defineComponent({__name:"vs-input-codegen",props:e.mergeModels({table:{},code:{},init:{type:Boolean},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),n=e.ref(!1),r=e.computed(()=>t.init!==!1),o=e.computed(()=>!!t.table&&!!t.code),i=()=>{if(!o.value)return"";const d=encodeURIComponent(String(t.table)),u=encodeURIComponent(String(t.code));return`/api/code-gen/${d}/${u}`},s=async()=>{if(!o.value||n.value)return;const d=i();if(d){n.value=!0;try{const u=await(await fetch(d)).text();a.value=u}finally{n.value=!1}}},c=()=>{r.value&&(a.value||s())};return e.onMounted(()=>{c()}),e.watch(()=>[t.table,t.code,t.init],()=>{c()}),(d,u)=>(e.openBlock(),e.createElementBlock("div",Yh,[e.withDirectives(e.createElementVNode("input",{disabled:d.disabled,placeholder:d.placeholder,"onUpdate:modelValue":u[0]||(u[0]=p=>a.value=p),class:"block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,8,qh),[[e.vModelText,a.value]]),e.createElementVNode("button",{class:"px-2 bg-gray-100 border rounded-lg hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed",disabled:n.value||d.disabled||!o.value,onClick:s},[n.value?(e.openBlock(),e.createElementBlock("span",Jh,"...")):(e.openBlock(),e.createElementBlock("span",Zh,"Gen"))],8,Xh)]))}}),eg=ce(Qh,[["__scopeId","data-v-6ee5237d"]]),tg={class:"w-full"},lg={ref:"sortableContainer",class:"flex flex-col gap-1"},ag=["onDragstart","onDrop"],ng={class:"w-1/3"},rg={class:"w-2/3"},og=["onClick"],sg={key:0,class:"text-[14px] text-gray-700"},ig={class:"mt-2 w-full flex items-center"},cg=["disabled"],dg=e.defineComponent({__name:"vs-input-key-value",props:{parent:{},ignore:{},addButtonText:{},modelValue:{}},emits:["update:modelValue"],setup(l,{emit:t}){const a=b=>`${b}-${Math.random().toString(36).substring(2,15)}`,n=e.inject("values"),r=l,o=t,i=r.addButtonText??"Додати",s=r.ignore??[],c=e.ref([]),d=e.ref(null);(()=>{var h;const b=r.parent&&((h=n==null?void 0:n.value)==null?void 0:h[r.parent])||r.modelValue||{};c.value=Object.entries(b).filter(([g])=>!s.includes(g)).map(([g,x])=>({id:a("key-value-"),key:g,value:x}))})();function u(b){d.value=b}function p(b){if(d.value===null||d.value===b)return;const h=c.value.splice(d.value,1)[0];c.value.splice(b,0,h),d.value=null}const k=e.computed(()=>c.value.some(b=>b.key&&!b.value||!b.key&&b.value)),m=()=>{c.value.push({id:a("key-value-"),key:"",value:""})},w=b=>{c.value=c.value.filter(h=>h.id!==b)};return e.watch(c,b=>{const h={};b.forEach(x=>{x.key&&x.value!==void 0&&(h[x.key]=x.value)});const g={};s.length&&s.forEach(x=>{var y,f;g[x]=r.parent?(f=(y=n==null?void 0:n.value)==null?void 0:y[r.parent])==null?void 0:f[x]:void 0}),n!=null&&n.value&&r.parent&&(n.value[r.parent]={...g,...h}),o("update:modelValue",h)},{deep:!0}),(b,h)=>(e.openBlock(),e.createElementBlock("div",tg,[e.createElementVNode("div",lg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(g,x)=>(e.openBlock(),e.createElementBlock("div",{key:g.id,class:e.normalizeClass(["flex items-center gap-2 w-full",{"opacity-50":d.value===x}]),draggable:"true",onDragstart:y=>u(x),onDragover:h[0]||(h[0]=e.withModifiers(()=>{},["prevent"])),onDrop:y=>p(x)},[h[1]||(h[1]=e.createStaticVNode('<button class="cursor-move" data-v-a0f7fbfc><svg fill="#000000" width="20" height="20" viewBox="0 0 36 36" data-v-a0f7fbfc><circle cx="15" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="18" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="18" r="1.5" data-v-a0f7fbfc></circle></svg></button>',1)),e.createElementVNode("div",ng,[e.createVNode(fl,{modelValue:g.key,"onUpdate:modelValue":y=>g.key=y,placeholder:"Ключ"},null,8,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("div",rg,[e.createVNode(fl,{modelValue:g.value,"onUpdate:modelValue":y=>g.value=y,placeholder:"Значення"},null,8,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("button",{onClick:y=>w(g.id),class:"shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200"},[e.createVNode(e.unref(Au),{height:"16",width:"16"})],8,og)],42,ag))),128))],512),c.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",sg," Дані для відображення відсутні ")),e.createElementVNode("div",ig,[e.createElementVNode("button",{type:"button",onClick:m,disabled:k.value,class:"py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"},[e.createVNode(zt,{height:"14",width:"14"}),e.createTextVNode(" "+e.toDisplayString(e.unref(i)),1)],8,cg)])]))}}),ug=ce(dg,[["__scopeId","data-v-a0f7fbfc"]]),pg={class:"flex items-center gap-2 w-full"},mg=["disabled"],fg=["disabled"],hg=e.defineComponent({__name:"vs-input-color",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l,{inputClass:n}=Ue(a.style),r=t,o=e.computed({get:()=>a.modelValue||"#000000",set:s=>r("update:modelValue",s)}),i=e.computed(()=>!!a.disabled);return(s,c)=>(e.openBlock(),e.createElementBlock("div",pg,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":c[0]||(c[0]=d=>o.value=d),disabled:i.value,ref:"color",class:e.normalizeClass(["py-1.5 px-1 block w-full bg-white cursor-pointer max-w-[50px]",[s.modelValue?"":"text-opacity-50",e.unref(n)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,mg),[[e.vModelText,o.value]]),e.withDirectives(e.createElementVNode("input",{class:"text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2","onUpdate:modelValue":c[1]||(c[1]=d=>o.value=d),disabled:i.value},null,8,fg),[[e.vModelText,o.value]])]))}}),gg={class:"flex items-center gap-2 w-full"},kg=["min","max","step","disabled"],yg=["disabled"],bg=e.defineComponent({__name:"vs-input-range",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},min:{default:0},max:{default:100},step:{default:1}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l,{inputClass:n}=Ue(a.style),r=t,o=e.computed({get:()=>Number(a.modelValue??a.min),set:s=>r("update:modelValue",Number(s))}),i=e.computed(()=>!!a.disabled);return(s,c)=>(e.openBlock(),e.createElementBlock("div",gg,[e.withDirectives(e.createElementVNode("input",{type:"range","onUpdate:modelValue":c[0]||(c[0]=d=>o.value=d),min:s.min,max:s.max,step:s.step,disabled:i.value,ref:"range",class:e.normalizeClass(["w-full cursor-pointer accent-blue-500",[s.modelValue?"":"text-opacity-50",e.unref(n)].join(" ")])},null,10,kg),[[e.vModelText,o.value]]),e.withDirectives(e.createElementVNode("input",{class:"text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2 max-w-[100px]",type:"number","onUpdate:modelValue":c[1]||(c[1]=d=>o.value=d),disabled:i.value},null,8,yg),[[e.vModelText,o.value]])]))}}),xg=["type","value","onInput","placeholder","disabled"],wg=e.defineComponent({__name:"vs-input-array",props:e.mergeModels({count:{default:1},limit:{default:l=>l.count??1},inputType:{default:"text"},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=Ue(t.style),n=e.useModel(l,"modelValue"),r=e.computed(()=>!!t.disabled),o=e.computed(()=>t.placeholder??"");e.watchEffect(()=>{var c;const s=((c=n.value)==null?void 0:c.length)??0;s<t.count&&(n.value=[...n.value??[],...Array(t.count-s)])});function i(s,c){if(r.value)return;const d=s.target.value,u=[...n.value];u[c]=t.inputType==="text"?d:Number(d),n.value=u}return(s,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["grid gap-2",`grid-cols-${s.limit}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.count,d=>{var u;return e.openBlock(),e.createElementBlock("input",{type:s.inputType,value:((u=n.value)==null?void 0:u[d-1])??"",onInput:p=>i(p,d-1),placeholder:o.value,disabled:r.value,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a),{"!border-red-600":s.error}]]),style:{border:"1px solid #CFD9E0"}},null,42,xg)}),256))],2))}}),Eg={class:"flex items-center gap-2 w-full"},_g={class:"relative flex-1"},Cg=["placeholder","disabled","onKeydown"],Vg=["disabled"],Ng={key:0,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Bg={key:1,class:"animate-spin h-5 w-5 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},Sg={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/50"},Ag={class:"bg-white text-gray-900 rounded-lg shadow-lg w-[480px] max-h-[80vh] overflow-y-auto"},Dg={class:"p-3 border-b font-semibold text-gray-900 flex justify-between items-center"},Lg=["onClick"],Mg={key:0,class:"p-4 text-sm text-gray-500"},Tg=e.defineComponent({__name:"vs-input-address",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{},api:{default:""},geom:{default:""},includes:{default:()=>[]}},{modelValue:{default:""},modelModifiers:{}}),emits:e.mergeModels(["update:modelValue","update:geom"],["update:modelValue"]),setup(l,{emit:t}){const a=l,n=t,{inputClass:r}=Ue(a.style),o=e.useModel(l,"modelValue"),i=e.computed({get:()=>o.value,set:g=>{o.value=g}}),s=e.ref(!1),c=e.ref([]),d=e.ref(!1),u=e.computed(()=>a.placeholder??""),p=e.computed(()=>!!a.disabled),k=e.inject("values");function m(){!p.value&&i.value.trim()&&w()}async function w(){var f;const g=(i.value||"").trim();if(!g)return;let x=g;if((f=a.includes)!=null&&f.length&&(k!=null&&k.value)){const E=a.includes.map(N=>{var V;return(V=k.value)==null?void 0:V[N]}).filter(Boolean);E.length&&(x=`${E.join(", ")}, ${g}`)}const y=a.api.replace("{{value}}",encodeURIComponent(x));s.value=!0;try{const E=await(await fetch(y)).json();c.value=Array.isArray(E)?E:[],d.value=!0}catch(E){console.error("Address search error:",E)}finally{s.value=!1}}function b(){d.value=!d.value}function h(g){if(!g)return;d.value=!1;const x=parseFloat(g.lat),y={type:"Point",coordinates:[parseFloat(g.lon),x]};a.geom&&(k!=null&&k.value)&&(k.value[a.geom]=y),n("update:geom",y)}return(g,x)=>{var y;return e.openBlock(),e.createElementBlock("div",Eg,[e.createElementVNode("div",_g,[e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":x[0]||(x[0]=f=>i.value=f),placeholder:u.value,disabled:p.value,class:e.normalizeClass(["py-1.5 px-3 block w-full bg-white border rounded-md placeholder:text-gray-400 focus:ring-2 focus:ring-blue-500",[e.unref(r),{"!border-red-600":a.error}]]),style:{border:"1px solid #CFD9E0"},onKeydown:e.withKeys(e.withModifiers(m,["prevent"]),["enter"])},null,42,Cg),[[e.vModelText,i.value]]),c.value.length?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-blue-600",onClick:b,title:"Show search results"},x[2]||(x[2]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),e.createElementVNode("path",{d:"M12 16v-4"}),e.createElementVNode("path",{d:"M12 8h.01"})],-1)]))):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",onClick:w,class:"flex items-center justify-center px-2 py-2 border rounded-md bg-white hover:bg-gray-50 text-gray-600 hover:text-blue-600 disabled:opacity-50 h-[38px]",disabled:s.value||!((y=i.value)!=null&&y.trim())},[s.value?(e.openBlock(),e.createElementBlock("svg",Bg,x[4]||(x[4]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)]))):(e.openBlock(),e.createElementBlock("svg",Ng,x[3]||(x[3]=[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"},null,-1),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"},null,-1)])))],8,Vg),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[d.value?(e.openBlock(),e.createElementBlock("div",Sg,[e.createElementVNode("div",Ag,[e.createElementVNode("div",Dg,[x[6]||(x[6]=e.createElementVNode("span",null,"Search results",-1)),e.createElementVNode("button",{class:"text-gray-500 hover:text-blue-600",onClick:x[1]||(x[1]=f=>d.value=!1),title:"Close"},x[5]||(x[5]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)]))]),e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(f,E)=>(e.openBlock(),e.createElementBlock("li",{key:E,onClick:N=>h(f),class:"px-3 py-2 cursor-pointer hover:bg-gray-100 border-b text-sm"},e.toDisplayString(f.display_name),9,Lg))),128))]),c.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Mg," No results found "))])])):e.createCommentVNode("",!0)]))])}}}),Jl={VsInputText:fl,VsInputRadio:Ln,"vs-input-text":fl,"vs-input-password":au,"vs-input-textarea":pf,"vs-input-mask":Pu,"vs-input-number":ou,"vs-input-radio":Ln,"vs-input-select":Rn,"vs-input-switcher":An,"vs-input-static":Dn,"vs-input-container":Hm,"vs-input-date":lp,"vs-input-checkbox":Mn,"vs-input-file":zp,"vs-input-html":Dn,"vs-input-email":zu,"vs-input-datatable":b0,"vs-input-map":Th,"vs-input-file-list":bm,"vs-input-tags":zh,"vs-input-slug":Wh,"vs-input-codegen":eg,"vs-input-key-value":ug,"vs-input-range":bg,"vs-input-color":hg,"vs-input-native-select":Rn,"vs-input-array":wg,"vs-input-address":Tg},Fg=e.defineComponent({__name:"behavior",props:{api:{},set:{},button:{},error:{},value:{}},setup(l){const t=l,a=e.inject("values");async function n(){try{if(!t.api)return;const r=t.api.replace("{{value}}",t.value),o=await fetch(r);if(!o.ok){ke({type:"warning",title:"Validation",message:"При спробі завантажити дані виникла помилка."});return}const i=await o.json();if(!t.set||!a)return;for(const[s,c]of Object.entries(t.set))a.value[s]=i.result[c]}catch(r){console.error(t.error,r)}}return(r,o)=>(e.openBlock(),e.createElementBlock("button",{onClick:n,class:"vs-button relative inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-blue-500 hover:border-blue-500 hover:bg-blue-500 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 ml-0 md:ml-2 mt-2 md:mt-0 py-[8px] md:w-2/4 whitespace-nowrap w-full"},e.toDisplayString(r.button),1))}}),Ig={class:"flex flex-col gap-1 w-full"},Og={key:0,class:"text-sm text-gray-500"},Un=e.defineComponent({__name:"vs-compact-form-layout",props:e.mergeModels({item:{default:{}},layout:{default:"default"},style:{default:{}},type:{default:""},error:{type:[String,Boolean]},columns:{default:()=>({container:12,label:3})}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),n=e.computed(()=>tu[`${t.layout}`]),r=e.computed(()=>Jl==null?void 0:Jl[`vs-input-${t.item.type}`]),o=e.computed(()=>{var u;const s=e.unref(r);if(!s)return new Set;const c=s.props??((u=s.__vccOpts)==null?void 0:u.props);if(!c)return new Set;const d=Array.isArray(c)?c:Object.keys(c);return new Set(d)}),i=e.computed(()=>{const s=t.item??{},c=o.value;return c.size?Object.fromEntries(Object.entries(s).filter(([d])=>c.has(d))):{}});return(s,c)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value),{ua:t.item.ua,error:t.error||"",item:s.item,columns:t.columns,label:t.item.label},{default:e.withCtx(()=>{var d,u;return[e.createElementVNode("div",{class:e.normalizeClass(["flex w-full",`${t.item.type}-component`])},[e.createElementVNode("div",Ig,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),e.mergeProps(i.value,{modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=p=>a.value=p)}),null,16,["modelValue"])),s.item.description&&t.layout!=="settings"?(e.openBlock(),e.createElementBlock("p",Og,e.toDisplayString(s.item.description),1)):e.createCommentVNode("",!0)]),(d=s.item.behavior)!=null&&d.api&&((u=s.item.behavior)!=null&&u.button)?(e.openBlock(),e.createBlock(Fg,e.mergeProps({key:0},s.item.behavior,{value:a.value}),null,16,["value"])):e.createCommentVNode("",!0)],2)]}),_:1},8,["ua","error","item","columns","label"]))}}),$g={class:"text-sm text-gray-800 mb-[4px] font-medium dark:text-neutral-300"},vg={class:"vs-compact-form-navigation__rail mt-[6px]"},Rg=["onClick"],Pg=e.defineComponent({__name:"vs-compact-form-navigation",props:{target:{},scrollContainer:{},title:{default:"Навігація"},enabled:{type:Boolean,default:!0},width:{default:400}},setup(l,{expose:t}){const a=l,n=e.ref([]),r=e.ref(""),o=e.ref(""),i=e.computed(()=>!!a.enabled),s=e.computed(()=>["vs-compact-form-navigation flex flex-col pl-[6px] pt-[8px] pr-[8px]","sticky top-0 self-start shrink-0","max-h-full min-h-0 overflow-y-auto"]),c=e.computed(()=>{const v=a.width;if(v==null)return{};const W=typeof v=="number"?`${v}px`:`${v}`;return{width:W,minWidth:W}});let d=null,u=0,p=0,k=null,m=null,w=null;const b=()=>K(),h=()=>x();e.watch(()=>a.target,async v=>{if(N(),!v){k=null,n.value=[],r.value="";return}k=v,i.value&&(await e.nextTick(),E(v),x())},{immediate:!0}),e.watch(()=>a.scrollContainer,v=>{if(!i.value){m=v??null;return}g(v??null),e.nextTick(()=>x())},{immediate:!0}),e.onMounted(()=>{a.scrollContainer||g(null),x()}),e.onBeforeUnmount(()=>{N(),g(null,!0),k=null,typeof window<"u"&&(u&&window.cancelAnimationFrame(u),p&&window.cancelAnimationFrame(p))});function g(v,W=!1){if(w&&(w(),w=null),W){m=null;return}if(m=v??null,typeof window>"u")return;const le=v??window,P=window;le.addEventListener("scroll",b,{passive:!0}),P.addEventListener("resize",h),w=()=>{le.removeEventListener("scroll",b),P.removeEventListener("resize",h)}}function x(){if(!i.value||!k)return;u&&typeof window<"u"&&window.cancelAnimationFrame(u);const v=()=>{y(),u=0};typeof window>"u"?v():u=window.requestAnimationFrame(v)}function y(){if(!i.value||!k)return;const v=Array.from(k.querySelectorAll("h1, h2")),W=new Set,le=[];v.forEach((P,F)=>{var pe;const I=((pe=P.textContent)==null?void 0:pe.trim())??"";if(!I)return;let T=(P.getAttribute("id")??"").trim();T||(T=f(I)||`heading-${F+1}`);let Y=T,J=1;for(;W.has(Y);)Y=`${T}-${J+=1}`;P.id!==Y&&Object.assign(P,{id:Y}),W.add(Y),le.push({id:Y,text:I,level:P.tagName.toLowerCase()==="h1"?1:2})}),n.value=le,le.length||(r.value=""),$()}function f(v){return v.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function E(v){!v||!i.value||typeof MutationObserver>"u"||(N(),d=new MutationObserver(()=>x()),d.observe(v,{childList:!0,subtree:!0}))}function N(){d&&(d.disconnect(),d=null)}function V(v){const W=m;if(!W)return typeof window>"u"?v.offsetTop:v.getBoundingClientRect().top+window.scrollY;const le=v.getBoundingClientRect(),P=W.getBoundingClientRect();return le.top-P.top+W.scrollTop}function $(){if(!i.value||!n.value.length)return;const v=m,W=(v?v.scrollTop:null)||(typeof window<"u"?window.scrollY:0),le=(v?v.clientHeight:null)||(typeof window<"u"?window.innerHeight:0),P=W+le;let F=null;for(let T=0;T<n.value.length;T+=1){const Y=n.value[T],J=document.getElementById(Y.id);if(J){const pe=V(J);pe+J.offsetHeight>W&&pe<P&&(F=Y.id)}}!F&&o.value&&(F=o.value),F&&(o.value=F);const I=v?v.scrollHeight-v.clientHeight:document.documentElement.scrollHeight-window.innerHeight;W+5>=I&&(F=n.value[n.value.length-1].id),F&&(r.value=F)}function K(){i.value&&(p&&window.cancelAnimationFrame(p),p=window.requestAnimationFrame(()=>{$(),p=0}))}function H(v){if(!i.value)return;const W=document.getElementById(v);if(!W)return;const le=m,P=Math.max(0,V(W));le?le.scrollTo({top:P,behavior:"smooth"}):typeof window<"u"&&window.scrollTo({top:P,behavior:"smooth"})}return t({refresh:x}),(v,W)=>i.value&&n.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(s.value),style:e.normalizeStyle(c.value)},[e.createElementVNode("h2",$g,e.toDisplayString(v.title),1),e.createElementVNode("div",vg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,le=>(e.openBlock(),e.createElementBlock("div",{key:le.id,class:e.normalizeClass(["vs-compact-form-navigation__item relative",le.level===2?"vs-compact-form-navigation__item--nested":"",le.id===r.value?"vs-compact-form-navigation__item--active":""])},[e.createElementVNode("button",{type:"button",onClick:P=>H(le.id),class:e.normalizeClass(["vs-compact-form-navigation__button flex gap-x-3 py-[6px] pr-3 text-sm duration-200 hover:text-gray-800",le.level===2?"pl-[15px]":"pl-[18px]",le.id===r.value?"text-gray-800":"text-gray-500"])},[e.createElementVNode("span",null,e.toDisplayString(le.text),1)],10,Rg)],2))),128))])],6)):e.createCommentVNode("",!0)}}),Ug=ce(Pg,[["__scopeId","data-v-1584a562"]]),jn={required:"Це поле є обов’язковим",email:"Неправильний email"},jg=l=>l?!1:jn.required,zg=l=>l?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l)?!1:jn.email:!1,Hg=(l,t)=>{const a=t.pattern??t.regexp;return!(typeof a=="string"?new RegExp(a):a).test(l)&&l?t.message:!1},Kg=(l,t)=>!1,Gg=(l,t)=>{switch(typeof t=="string"?t:t.type){case"required":return jg(l);case"email":return zg(l);case"regexp":return Hg(l,t);case"custom":return Kg();default:return!1}},Wg={autocomplete:"select",combobox:"select",datepicker:"date",markedtext:"mask",html:"static",geom:"map",filelist:"file-list",datalist:"datatable",file:"file",dropzone:"file"};function zn(l){const t=l.toLowerCase();return Wg[t]||t}function Ql(l,t=!1){if(Array.isArray(l)){const n=[];return l.forEach(r=>{const o={...r};o.name=(r.name||r.id||r.key||"").toString(),o.type=zn(r.type),o.label=r.label||r.ua,o.rules=r.rules||r.validators,o.type==="email"&&!o.rules&&(o.rules=["email"]),r.data&&(o.api=`/api/suggest/${r.data}`),o.disabled=t||o.disabled,Array.isArray(o.schema)&&(o.schema=Ql(o.schema,o.disabled)),n.push(o)}),n}const a=[];return Object.entries(l).forEach(n=>{const r={name:n[0],...n[1],type:zn(n[1].type),label:n[1].label||n[1].ua,rules:n[1].rules||n[1].validators,disabled:t};r.type==="email"&&!r.rules&&(r.rules=["email"]),n[1].type.includes("list")&&(r.multiple=!0),!r.api&&n[1].data&&(r.api=`/api/suggest/${n[1].data}`),Array.isArray(r.schema)&&(r.schema=Ql(r.schema,r.disabled)),a.push(r)}),a}function Yg(l,t,a=!1){const n=e.computed(()=>Ql(t,typeof a=="boolean"?a:a.value)),r=e.ref({});function o(c){var k;const d=c==null?void 0:c.conditions;if(!d)return!0;const u=Array.isArray(d)?d[0]:d,p=(k=l==null?void 0:l.value)==null?void 0:k[u];return vn(p,d)}const i=(c=n.value,d=!0)=>(c.forEach(u=>{if(u.rules){if(!o(u)){delete r.value[u.name];return}let p=!1,k=null;u.rules.forEach(m=>{const w=Gg(l.value[u.name],m);w&&(p=!0,!k&&typeof w=="string"&&(k=w))}),p&&k?r.value[u.name]=k:delete r.value[u.name]}u.schema&&i(u.schema,!1)}),d&&Object.values(r.value).some(Boolean)?r.value:null),s=e.computed(()=>{var c;return(c=n.value)==null?void 0:c.filter(d=>d.hidden!==!0&&o(d))});return{errors:r,validate:i,reset:()=>{l.value={},r.value={}},visibleSchema:s}}const qg={class:"flex w-full h-full min-h-0 gap-6"},Xg={key:0,"data-orientation":"horizontal",role:"none",class:"mt-1 shrink-0 h-[1px] w-full bg-slate-100 dark:bg-slate-600"},Ft=e.defineComponent({__name:"vs-compact-form",props:e.mergeModels({schema:{default:()=>[]},style:{default:()=>({})},modelValue:{},layout:{default:()=>"default"},formId:{default:()=>""},disabled:{type:Boolean,default:!1},navigation:{type:Boolean,default:!1},navWidth:{default:400},columns:{}},{form:{default:()=>({})},formModifiers:{},values:{default:()=>({})},valuesModifiers:{}}),emits:e.mergeModels(["handle-submit","update:modelValue"],["update:form","update:values"]),setup(l,{expose:t,emit:a}){const n=a,r=l,o=e.useModel(l,"form"),i=e.useModel(l,"values"),{errors:s,validate:c,reset:d,visibleSchema:u}=Yg(i,r.schema,e.toRef(r,"disabled")),p=e.ref(null),k=e.ref(null),m=e.computed(()=>r.navigation),w=e.computed(()=>r.navWidth),b=e.computed(()=>{var $;return($=r.style)==null?void 0:$.columns}),h=Object.freeze({container:12,label:3}),g=e.computed(()=>r.columns??b.value??h),x=e.computed(()=>r.columns!=null||b.value!=null),y=e.computed(()=>x.value?"horizontal":r.layout),f=$=>$!=null&&$.columns?"horizontal":y.value,E=$=>($==null?void 0:$.columns)??g.value,N=()=>{n("update:modelValue",i.value),c(),n("handle-submit",i.value)};t({validate:c,reset:d,errors:s}),e.onMounted(()=>{r.modelValue&&(i.value=r.modelValue),o.value={value:i.value,errors:s.value,reset:d,validate:c,formId:r.formId}});function V($,K){if($===K)return!0;if(typeof $!="object"||typeof K!="object"||!$||!K)return!1;const H=Object.keys($),v=Object.keys(K);return H.length!==v.length?!1:H.every(W=>$[W]===K[W])}return e.provide("form",o),e.provide("values",i),($,K)=>(e.openBlock(),e.createElementBlock("div",qg,[e.createElementVNode("div",{class:"flex-1 min-h-0 overflow-y-auto overflow-x-visible",ref_key:"formScrollContainer",ref:k},[e.createElementVNode("form",{ref_key:"formRef",ref:p,onSubmit:e.withModifiers(N,["prevent"]),class:e.normalizeClass(["grid grid-cols-12 p-1",y.value==="default"?"gap-6":"gap-4"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),(H,v)=>(e.openBlock(),e.createElementBlock("div",{key:H.name,class:e.normalizeClass(f(H)==="horizontal"?"col-span-12":`col-span-${H.col||12}`)},[e.createVNode(Un,{style:e.normalizeStyle($.style),item:H,layout:f(H),columns:E(H),"model-value":i.value[H.name],"onUpdate:modelValue":W=>{const le=i.value[H.name];V(le,W)||(i.value[H.name]=W)},error:e.unref(s)[H.name]},null,8,["style","item","layout","columns","model-value","onUpdate:modelValue","error"]),f(H)==="settings"&&v+1!==e.unref(u).length?(e.openBlock(),e.createElementBlock("div",Xg)):e.createCommentVNode("",!0)],2))),128))],34)],512),e.createVNode(Ug,{target:p.value,"scroll-container":k.value,enabled:m.value,width:w.value},null,8,["target","scroll-container","enabled","width"])]))}}),Zg={class:"relative"},Jg={class:"w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50"},Qg={class:"m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12"},ek={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},tk={class:"font-medium text-gray-800 dark:text-[#ffffff]"},lk={class:"p-4 mim-h-0 h-full overflow-auto"},ak=e.defineComponent({__name:"modal-edit",props:{schema:{},defaultValue:{},mode:{},token:{},form:{}},emits:["close","save","edit"],setup(l,{emit:t}){const a=l,n=t,r=e.ref(a.schema),o=e.ref(a.defaultValue?JSON.parse(JSON.stringify(a.defaultValue)):{}),i=e.ref({}),s=e.ref(),c=e.ref(a.mode);async function d(){const p=i.value.validate();if(p){ke({type:"warning",title:"Помилка валідації",message:Object.entries(p).map(([k,m])=>`${k}: ${m}`).join(`
|
|
153
|
-
`)});return}if(s.value)try{const k=await fetch(`/api/table/${s.value}`,{method:c.value==="add"?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(o.value)});if(k.ok)await k.json(),ke({type:"success",title:"Успішно",message:`Дані успішно ${c.value==="add"?"збережено":"оновлено"}`}),n("save",o.value);else if(k.status===400){const m=await k.json().catch(()=>({}));ke({type:"warning",title:"Помилка валідації",message:m.message||"Некоректні дані (400)"})}else k.status===500?ke({type:"error",title:"Серверна помилка",message:"Виникла помилка на сервері (500)"}):ke({type:"error",title:"Помилка",message:`Статус: ${k.status}`})}catch(k){ke({type:"error",title:"Помилка з’єднання",message:k.message||"Не вдалося виконати запит"})}}function u(){n("close")}return e.onMounted(async()=>{try{if(a.form){const p=await fetch(`/api/template/form/${a.form}`);if(!p.ok){ke({type:p.status>=400&&p.status<500?"warning":"error",title:"Error",message:`Error code: ${p.status}`});return}const k=await p.json();r.value=k.schema,s.value=k.token}else if(a.token){s.value=a.token;const p=await fetch(`/api/form/${s.value}`);if(!p.ok){ke({type:p.status>=400&&p.status<500?"warning":"error",title:"Error",message:`Error code: ${p.status}`});return}const k=await p.json();r.value=k.schema,k.data?o.value=k.data:c.value="add"}}catch(p){ke({type:"error",title:"Error",message:p.message||"Unexpected error"}),console.error(p)}}),(p,k)=>(e.openBlock(),e.createElementBlock("div",Zg,[e.createElementVNode("div",Jg,[e.createElementVNode("div",Qg,[e.createElementVNode("div",ek,[e.createElementVNode("h3",tk,e.toDisplayString(c.value==="add"?"Додати":"Змінити"),1),e.createElementVNode("button",{onClick:u,type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"},k[2]||(k[2]=[e.createElementVNode("span",{class:"sr-only"},"Close",-1),e.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",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"},[e.createElementVNode("path",{d:"M18 6 6 18"}),e.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),e.createElementVNode("div",lk,[r.value?(e.openBlock(),e.createBlock(Ft,{key:0,schema:r.value,values:o.value,"onUpdate:values":k[0]||(k[0]=m=>o.value=m),form:i.value,"onUpdate:form":k[1]||(k[1]=m=>i.value=m)},null,8,["schema","values","form"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"vs-form__head mr-5 mb-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},[e.createElementVNode("button",{type:"button",onClick:u,class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),e.createElementVNode("button",{onClick:d,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])])])]))}}),Hn=(l={mode:"edit",schema:null})=>new Promise(t=>{const{close:a}=Fd({title:l.mode==="add"?"Додати":"Редагувати",template:"",visible:!0,size:"medium",closeClickBack:!0,content:ak,contentProps:{...l,onClose:()=>{t(null),a()},onSave:n=>{t(n),a()}}})});Ft.install=function(l){l.component("VForm",Ft),Object.assign(l.config.globalProperties,{$form:Hn}),l.provide("form",Hn),window.v3plugin||(window.v3plugin={})};const Qe=(l,t)=>{const a=l.__vccOpts||l;for(const[n,r]of t)a[n]=r;return a},nk={},rk={xmlns:"http://www.w3.org/2000/svg",width:"15px",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-reload absolute inline mr-1 text-gray-800 transition-all cursor-pointer active:rotate-90 right-1 top-1 hover:text-blue-500"};function ok(l,t){return e.openBlock(),e.createElementBlock("svg",rk,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M19.933 13.041a8 8 0 1 1 -9.925 -8.788c3.899 -1 7.935 1.007 9.425 4.747"},null,-1),e.createElementVNode("path",{d:"M20 4v5h-5"},null,-1)])])}const sk=Qe(nk,[["render",ok]]),ik={class:"flex items-center justify-between w-full text-sm"},ck={class:"flex items-center cursor-pointer w-full"},dk={key:0,width:"16",height:"auto",src:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTYgMTYnIGZpbGw9J3doaXRlJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMi4yMDcgNC43OTNhMSAxIDAgMDEwIDEuNDE0bC01IDVhMSAxIDAgMDEtMS40MTQgMGwtMi0yYTEgMSAwIDAxMS40MTQtMS40MTRMNi41IDkuMDg2bDQuMjkzLTQuMjkzYTEgMSAwIDAxMS40MTQgMHonLz48L3N2Zz4="},uk=["value"],pk={class:"w-[calc(100%-18px)] flex flex-row items-center justify-between pl-[10px]"},mk={class:"flex flex-row items-center font-normal text-gray-800 gap-x-1"},fk={key:0,class:"text-xs text-gray-500 dark:text-neutral-500 pr-1"},ea=e.defineComponent({__name:"list-item",props:{layout:{},count:{},type:{},label:{},value:{},isSelected:{type:Boolean},color:{},highlighted:{type:Boolean}},emits:["itemClick"],setup(l,{expose:t,emit:a}){const n=l,r=a;function o(){r("itemClick",n.value)}const i=e.ref(null);return t({el:i}),(s,c)=>(e.openBlock(),e.createElementBlock("div",{class:"flex items-center w-full rounded-lg group hover:bg-gray-100",ref_key:"el",ref:i},[e.createElementVNode("div",ik,[e.createElementVNode("div",ck,[e.createElementVNode("label",{for:"radio-9740",class:e.normalizeClass([["inline","popover"].includes(l.layout)?"text-sm text-gray-500 px-2 w-full py-2 cursor-pointer !flex flex-row items-center":"flex flex-row items-center w-full px-2 py-2 text-sm text-gray-500 cursor-pointer",{"bg-blue-100":l.highlighted}]),onClick:e.withModifiers(o,["stop","prevent"])},[e.createElementVNode("div",{class:e.normalizeClass(["w-[18px] h-[18px] border flex items-center justify-center",[l.type=="checkbox"?"rounded-[4px]":"rounded-full",l.color?`bg-[${l.color}] border-[#ffffff]`:l.isSelected?"bg-[#2563eb] border-[#ffffff]":"bg-[#ffffff] border-[#d9d9d9]"]])},[l.isSelected?(e.openBlock(),e.createElementBlock("img",dk)):e.createCommentVNode("",!0)],2),e.createElementVNode("input",{type:"checkbox",class:"hidden",id:"radio-9740",value:l.value},null,8,uk),e.createElementVNode("div",pk,[e.createElementVNode("span",mk,e.toDisplayString(l.label??"Відсутні данні"),1),l.count?(e.openBlock(),e.createElementBlock("div",fk," ("+e.toDisplayString(l.count)+") ",1)):e.createCommentVNode("",!0)])],2)])])],512))}});function Kn(l,t){const{options:a=[],limit:n=20}=l;function r(y){return Array.isArray(y)?y[0]:y}const o=e.ref(r(l.modelValue)),i=e.ref(""),s=e.ref(!1),c=e.ref([]),d=e.ref("id"),u=e.ref("text"),p=e.ref(!1),k=e.ref(l.layout!=="popover"&&a.length>n);function m(y){const f=y.find(Boolean)??{},E=["id","value","code","key"].find(V=>V in f)??"id",N=["text","label","name","title"].find(V=>V in f)??"text";return{autoValueKey:E,autoLabelKey:N}}if(a.length>0){const y=m(a);d.value=y.autoValueKey,u.value=y.autoLabelKey}const w=e.computed(()=>{const y=c.value;return l.layout==="popover"||p.value?y:y.slice(0,n)});e.watch(()=>l.modelValue,y=>{o.value=r(y)},{immediate:!0}),c.value=[...a].sort((y,f)=>l.sort==="count"?f.count&&y.count?f.count-y.count:0:l.sort==="name"?String(y[u.value]??"").localeCompare(String(f[u.value]??"")):0);function b(y){return o.value===y[d.value]}function h(y){o.value=y[d.value],t("update:modelValue",o.value),t("change",{name:l.name,value:o.value})}function g(){o.value=void 0,t("update:modelValue",o.value),t("clear",l.name)}function x(){p.value=!p.value}return{innerValue:o,searchTerm:i,filteredOptions:w,isSelected:b,selectItem:h,clear:g,toggleShowAll:x,isReqProc:s,showAll:p,isEnableShowAll:k,labelKey:u,valueKey:d,allOptions:c}}const hk={},gk={class:"w-48 mx-auto",viewBox:"0 0 178 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function kk(l,t){return e.openBlock(),e.createElementBlock("svg",gk,[...t[0]||(t[0]=[e.createStaticVNode('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>',12)])])}const ta=Qe(hk,[["render",kk]]),yk={},bk={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:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate"};function xk(l,t){return e.openBlock(),e.createElementBlock("svg",bk,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)])])}const kl=Qe(yk,[["render",xk]]),wk={},Ek={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:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate-[180deg]"};function _k(l,t){return e.openBlock(),e.createElementBlock("svg",Ek,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)])])}const la=Qe(wk,[["render",_k]]),Ck={key:0,class:"w-full"},Vk={class:"flex flex-col items-center justify-center p-5 text-center"},Nk={key:0,class:"flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"},Bk={key:1,class:"flex justify-between items-center text-xs text-gray-500 p-1 border-t"},Sk=e.defineComponent({__name:"radio",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{default:10},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const n=l,r=e.ref(null),o=a,{innerValue:i,filteredOptions:s,isSelected:c,selectItem:d,clear:u,toggleShowAll:p,isReqProc:k,showAll:m,isEnableShowAll:w,labelKey:b,valueKey:h,allOptions:g}=Kn({...n,modelValue:n.modelValue??n.default??""},o);return t({clear:u,inputTextRef:r}),e.watch(()=>n.modelValue,x=>{x===void 0&&(i.value=void 0)}),(x,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([l.layout==="popover"?"flex flex-col h-full":"flex flex-col vs-filter-checkbox"])},[e.createElementVNode("div",{class:e.normalizeClass([l.layout==="popover"?"flex-1 overflow-y-auto max-h-64 p-2":"",l.layout==="inline"?"flex-1 overflow-y-auto max-h-80":""])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),f=>(e.openBlock(),e.createBlock(ea,{layout:l.layout,key:f[e.unref(h)],count:f.count,label:f[e.unref(b)],color:f.color,type:"radio",value:f[e.unref(h)],"is-selected":e.unref(c)(f),onItemClick:E=>e.unref(d)(f)},null,8,["layout","count","label","color","value","is-selected","onItemClick"]))),128))],2),l.type==="select"&&e.unref(s).length===0&&!e.unref(k)?(e.openBlock(),e.createElementBlock("div",Ck,[e.createElementVNode("div",Vk,[e.createVNode(ta),y[4]||(y[4]=e.createElementVNode("div",{class:"max-w-sm mx-auto mt-6"},[e.createElementVNode("p",{class:"font-medium text-gray-800 dark:text-neutral-200"},"За вашим запитом нічого не знайдено"),e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"})],-1))])])):e.createCommentVNode("",!0),l.layout!=="popover"&&l.type!=="select"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[!e.unref(m)&&e.unref(w)?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:y[0]||(y[0]=(...f)=>e.unref(p)&&e.unref(p)(...f)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[y[5]||(y[5]=e.createTextVNode(" Показати більше ",-1)),e.createVNode(kl)])):e.createCommentVNode("",!0),e.unref(m)?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:y[1]||(y[1]=(...f)=>e.unref(p)&&e.unref(p)(...f)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[y[6]||(y[6]=e.createTextVNode(" Показати менше ",-1)),e.createVNode(la)])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),l.cleanable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[l.layout==="inline"?(e.openBlock(),e.createElementBlock("div",Nk,[e.createTextVNode(e.toDisplayString(e.unref(i)||e.unref(i)===null?1:0)+" з "+e.toDisplayString(e.unref(g).length)+" обрано ",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:y[2]||(y[2]=(...f)=>e.unref(u)&&e.unref(u)(...f))}," Очистити ",512),[[e.vShow,e.unref(i)!==""&&e.unref(i)!==void 0]])])):e.createCommentVNode("",!0),l.layout==="popover"?(e.openBlock(),e.createElementBlock("div",Bk,[e.createElementVNode("span",null,e.toDisplayString(e.unref(i)||e.unref(i)===null?1:0)+" з "+e.toDisplayString(e.unref(g).length)+" обрано",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:y[3]||(y[3]=(...f)=>e.unref(u)&&e.unref(u)(...f))}," Очистити ",512),[[e.vShow,e.unref(i)!==""&&e.unref(i)!==void 0]])])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],2))}});function Gn(l,t){const{options:a=[],limit:n=20}=l;function r(y){return Array.isArray(y)?y:y?[y]:[]}const o=e.ref(r(l.modelValue)),i=e.ref(""),s=e.ref(!1),c=e.ref([]),d=e.ref("id"),u=e.ref("text"),p=e.ref(!1),k=e.ref(l.layout!=="popover"&&a.length>n);function m(y){const f=y.find(Boolean)??{},E=["id","value","code","key"].find(V=>V in f)??"id",N=["text","label","name","title"].find(V=>V in f)??"text";return{autoValueKey:E,autoLabelKey:N}}if(a.length>0){const y=m(a);d.value=y.autoValueKey,u.value=y.autoLabelKey}const w=e.computed(()=>{const y=c.value;return l.layout==="popover"||p.value?y:y.slice(0,n)});e.watch(()=>l.modelValue,y=>{o.value=r(y)},{immediate:!0}),c.value=[...a].sort((y,f)=>l.sort==="count"?f.count&&y.count?f.count-y.count:0:l.sort==="name"?String(y[u.value]).localeCompare(String(f[u.value])):0);function b(y){return o.value&&o.value.includes(y[d.value])}function h(y){const f=o.value.includes(y[d.value]);o.value=f?o.value.filter(E=>E!==y[d.value]):[...o.value,y[d.value]],t("update:modelValue",o.value),t("change",{name:l.name,value:o.value})}function g(){o.value=[],t("update:modelValue",o.value),t("clear",l.name)}function x(){p.value=!p.value}return{innerValue:o,searchTerm:i,filteredOptions:w,isSelected:b,selectItem:h,clear:g,toggleShowAll:x,isReqProc:s,showAll:p,isEnableShowAll:k,labelKey:u,valueKey:d,allOptions:c}}const Wn={en:{search:"Search",more:"Show more",less:"Show less",selected:"selected",clear:"Clear",notfound:"Nothing found",period:"Period",today:"Today",week:"Week",month:"Month",quarter:"Quarter",year:"Year",alltime:"All Time",prev:"Prev",next:"Next"},uk:{search:"Пошук",more:"Показати більше",less:"Показати меньше",selected:"обрано",clear:"Очистити",notfound:"Нічого не знайдено",period:"Період",today:"Сьогодні",week:"Тиждень",month:"Місяць",quarter:"Квартал",year:"Рік",alltime:"Весь час",prev:"Попередній період",next:"Настпуний період"}};function Ak(l){const t=l.split(".")[1];return(Wn[localStorage.locale||navigator.language]||Wn.uk)[t]}function It(){const l=e.getCurrentInstance();return l.appContext.config.globalProperties.$i18n?l.appContext.config.globalProperties.$t:Ak}const Dk={key:0,class:"w-full"},Lk={class:"flex flex-col items-center justify-center p-5 text-center"},Mk={class:"max-w-sm mx-auto mt-6"},Tk={class:"font-medium text-gray-800 dark:text-neutral-200"},Fk={key:0,class:"flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"},Ik={key:1,class:"flex justify-between items-center text-xs text-gray-500 p-1 border-t"},Yn=e.defineComponent({__name:"checkbox",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{default:10},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const n=It(),r=l,o=a,{innerValue:i,filteredOptions:s,isSelected:c,selectItem:d,clear:u,toggleShowAll:p,isReqProc:k,showAll:m,isEnableShowAll:w,labelKey:b,valueKey:h,allOptions:g}=Gn({...r,modelValue:r.modelValue},o);return e.watch(()=>r.modelValue,x=>{x===void 0&&(i.value=[])}),t({clear:u}),(x,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([l.layout==="popover"?"flex flex-col h-full":"flex flex-col vs-filter-checkbox space-y-0.5"])},[e.createElementVNode("div",{class:e.normalizeClass([l.layout==="popover"?"flex-1 overflow-y-auto max-h-64 p-2":"",l.layout==="inline"?"flex-1 overflow-y-auto max-h-80":""])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),f=>(e.openBlock(),e.createBlock(ea,{layout:l.layout,count:f.count,label:f[e.unref(b)],color:f.color,type:"checkbox",value:f[e.unref(h)],"is-selected":e.unref(c)(f),onItemClick:E=>e.unref(d)(f)},null,8,["layout","count","label","color","value","is-selected","onItemClick"]))),256))],2),l.type==="select"&&e.unref(s).length===0&&!e.unref(k)?(e.openBlock(),e.createElementBlock("div",Dk,[e.createElementVNode("div",Lk,[e.createVNode(ta),e.createElementVNode("div",Mk,[e.createElementVNode("p",Tk,e.toDisplayString(e.unref(n)("filter.notfound")),1),y[4]||(y[4]=e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"},null,-1))])])])):e.createCommentVNode("",!0),l.layout!=="popover"&&l.type!=="select"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[!e.unref(m)&&e.unref(w)?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:y[0]||(y[0]=(...f)=>e.unref(p)&&e.unref(p)(...f)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[e.createTextVNode(e.toDisplayString(e.unref(n)("filter.more"))+" ",1),e.createVNode(kl)])):e.createCommentVNode("",!0),e.unref(m)?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:y[1]||(y[1]=(...f)=>e.unref(p)&&e.unref(p)(...f)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[e.createTextVNode(e.toDisplayString(e.unref(n)("filter.less"))+" ",1),e.createVNode(la)])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),l.cleanable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[l.layout==="inline"?(e.openBlock(),e.createElementBlock("div",Fk,[e.createTextVNode(e.toDisplayString(e.unref(i).length)+" / "+e.toDisplayString(e.unref(g).length)+" "+e.toDisplayString(e.unref(n)("filter.selected"))+" ",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:y[2]||(y[2]=(...f)=>e.unref(u)&&e.unref(u)(...f))},e.toDisplayString(e.unref(n)("filter.clear")),513),[[e.vShow,e.unref(i).length!==0]])])):e.createCommentVNode("",!0),l.layout==="popover"?(e.openBlock(),e.createElementBlock("div",Ik,[e.createElementVNode("span",null,e.toDisplayString(e.unref(i).length)+" / "+e.toDisplayString(e.unref(g).length)+" "+e.toDisplayString(e.unref(n)("filter.selected")),1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:y[3]||(y[3]=(...f)=>e.unref(u)&&e.unref(u)(...f))},e.toDisplayString(e.unref(n)("filter.clear")),513),[[e.vShow,e.unref(i).length!==0]])])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],2))}}),Ok={},$k={xmlns:"http://www.w3.org/2000/svg",width:"15px",height:"15px",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"};function vk(l,t){return e.openBlock(),e.createElementBlock("svg",$k,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),e.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)])])}const qn=Qe(Ok,[["render",vk]]),Rk={},Pk={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x stroke-gray-500 hover:stroke-red-500 transition-all",width:"15px",height:"15px"};function Uk(l,t){return e.openBlock(),e.createElementBlock("svg",Pk,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),e.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])])}const Xn=Qe(Rk,[["render",Uk]]);class aa{static getWidthClass(t){return typeof t=="number"?`max-w-[${t}px]`:typeof t=="string"?t.endsWith("%")||t.endsWith("px")?`max-w-[${t}]`:`max-w-${t}`:"w-full"}}const jk={class:"absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3"},zk=["placeholder"],Hk=e.defineComponent({__name:"text-input",props:{id:{},name:{},title:{},type:{},label:{},width:{default:220},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{emit:t}){var d;const a=l,n=e.ref((a.placeholder||a.label||a.title||a.name||"search").toString()),r=t,o=e.ref(((d=a.modelValue)==null?void 0:d.toString())??"");e.watch(()=>a.modelValue,u=>{u!==o.value&&(o.value=(u==null?void 0:u.toString())??"")});let i=null;function s(){if(o.value=o.value.trimStart(),o.value.length===0){c();return}i&&clearTimeout(i),i=setTimeout(()=>{r("update:modelValue",o.value),r("change",{name:a.name,value:o.value})},300)}function c(){o.value="",r("update:modelValue",""),r("clear",a.name)}return(u,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vs-form-text relative bg-white rounded-lg [&>input]:py-[7px] [&>input]:max-h-[38px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600",l.layout==="inline"?e.unref(aa).getWidthClass(l.width):"mb-2"+(l.layout==="popover"?" m-2":"")])},[e.createElementVNode("div",jk,[e.createVNode(qn)]),o.value!==""?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:c,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer"},[e.createVNode(Xn)])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":p[0]||(p[0]=k=>o.value=k),onInput:s,placeholder:n.value,class:"!pr-7 !pl-8 bg-white h-[38px] min-w-[100px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:border-2 focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,40,zk),[[e.vModelText,o.value]])],2))}});function Zn(l={color:"blue"}){return e.computed(()=>{const t=`w-full px-3 py-2 border-solid border border-gray-300 text-sm rounded focus:outline-none focus:ring-2 focus:ring-${l.color}-500 focus:border-transparent`;return(l==null?void 0:l.size)==="sm"?`${t}h-[32px]`:`${t}h-[38px]`})}function Kk(){return"rounded-md font-medium border-gray-200 border-solid disabled:pointer-events-none disabled:opacity-50 px-4 py-2 w-full bg-transparent border text-black text-sm h-[38px]"}function Gk(){return"font-medium border-gray-200 border-solid disabled:pointer-events-none disabled:opacity-50 border h-7 rounded-md text-xs px-2 py-1 hover:bg-gray-100"}function Jn(l){return l==="ghost"?"inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent text-gray-600 hover:bg-blue-100 hover:text-gray-800 focus:outline-hidden focus:bg-gray-100 focus:text-gray-800 disabled:opacity-50 disabled:pointer-events-none dark:text-gray-500 dark:hover:bg-blue-800/30 dark:hover:text-blue-400 dark:focus:bg-blue-800/30 dark:focus:text-blue-400":l==="soft"?"inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 hover:bg-gray-200 focus:outline-hidden focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:text-blue-400 dark:hover:bg-blue-900 dark:focus:bg-blue-900":"relative border-solid border-gray-200 focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border-input hover:bg-gray-100 border px-4 py-2 gap-2 bg-transparent h-[38px]"}const Wk={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},Yk=["placeholder","disabled"],qk={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},Xk={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},Zk=["placeholder","disabled"],Jk=["disabled"],Qk=e.defineComponent({__name:"range-input",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const n=Zn(),r=Kk(),o=It(),i=l,s=e.ref(i.modelValue??i.default??[]),c=a,d=e.computed({get:()=>i.modelValue??s.value,set:k=>{i.modelValue!==void 0?c("update:modelValue",k):s.value=k}});function u(){c("change",{name:i.name,value:d.value||s.value})}function p(){s.value=[],d.value=s.value,c("clear",i.name)}return e.watch(()=>i.modelValue,k=>{k!==void 0&&i.layout!=="popover"?(s.value=k,c("update:modelValue",k)):s.value=[]}),t({clear:p,currentValue:d}),(k,m)=>{var w,b;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",null,[e.createElementVNode("div",{class:e.normalizeClass(l.layout==="vertical"?"inline-flex items-center gap-2":"space-y-3 p-2")},[e.createElementVNode("div",null,[l.layout!=="vertical"?(e.openBlock(),e.createElementBlock("label",Wk,e.toDisplayString(e.unref(o)("filter.from")),1)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"number",class:e.normalizeClass(e.unref(n)),placeholder:((w=l.placeholder)==null?void 0:w[0])??"min",step:"1",style:{outline:"none"},"onUpdate:modelValue":m[0]||(m[0]=h=>d.value[0]=h),disabled:l.disabled},null,10,Yk),[[e.vModelText,d.value[0]]])]),l.layout==="vertical"?(e.openBlock(),e.createElementBlock("label",qk," - ")):e.createCommentVNode("",!0),e.createElementVNode("div",null,[l.layout!=="vertical"?(e.openBlock(),e.createElementBlock("label",Xk,e.toDisplayString(e.unref(o)("filter.to")),1)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"number",class:e.normalizeClass(e.unref(n)),placeholder:((b=l.placeholder)==null?void 0:b[1])??"max",min:"0",max:"1000000000000000",step:"1",style:{outline:"none"},"onUpdate:modelValue":m[1]||(m[1]=h=>d.value[1]=h),disabled:l.disabled},null,10,Zk),[[e.vModelText,d.value[1]]])]),["popover","inline","vertical"].includes(l.layout)?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:u,class:e.normalizeClass(e.unref(r)+(l.layout==="vertical"?" w-[50px]":" bg-blue-100 hover:bg-blue-200"))},e.toDisplayString(l.layout==="vertical"?"Ok":e.unref(o)("filter.apply")),3)):e.createCommentVNode("",!0),["popover","inline"].includes(l.layout)?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:!(d.value[0]||d.value[1]),onClick:p,class:e.normalizeClass(e.unref(r)+" hover:bg-gray-100")},e.toDisplayString(e.unref(o)("filter.clear")),11,Jk)):e.createCommentVNode("",!0)],2)]),(l.cleanable&&s.value.length,e.createCommentVNode("",!0))],64)}}});function ey(l){return String(l).charAt(0).toUpperCase()+String(l).slice(1)}let Ae=class{static format(t){const a=t.getFullYear(),n=(t.getMonth()+1).toString().padStart(2,"0"),r=t.getDate().toString().padStart(2,"0");return`${a}-${n}-${r}`}static getShiftedDay(t,a=0){const n=t?new Date(t):new Date;return n.setDate(n.getDate()+a),this.format(n)}static getLastWeekRange(t,a,n=0){if(t&&a){const d=new Date(t),u=new Date(a);return d.setDate(d.getDate()+n*7),u.setDate(u.getDate()+n*7),[this.format(d),this.format(u)]}const r=new Date,o=r.getDay(),i=o===0?13:o-1+7,s=new Date(r);s.setDate(r.getDate()-i+n*7);const c=new Date(s);return c.setDate(s.getDate()+6),[this.format(s),this.format(c)]}static getMonthRange(t,a,n=0){let r;t?r=new Date(t):r=new Date,r=new Date(r.getFullYear(),r.getMonth()+n,1);const o=r,i=new Date(r.getFullYear(),r.getMonth()+1,0);return[this.format(o),this.format(i)]}static getQuarterRange(t,a,n=0){const r=t||a,o=r?new Date(r):new Date;let i=Math.floor(o.getMonth()/3);i+=n;const s=(i%4+4)%4*3,c=o.getFullYear()+Math.floor(i/4),d=new Date(c,s,1),u=new Date(c,s+3,0);return[this.format(d),this.format(u)]}static getYear(t,a=0){let n;return t&&/^\d{4}$/.test(t)?n=parseInt(t,10):t?n=new Date(t).getFullYear():n=new Date().getFullYear(),String(n+a)}static getYearRange(t,a=0){let n;return t&&/^\d{4}$/.test(t)?n=parseInt(t,10):t?n=new Date(t).getFullYear():n=new Date().getFullYear(),[this.format(new Date(n+a,0,1)),this.format(new Date(n+a+1,0,0))]}static getRangeFromDaysBefore(t){const a=new Date,n=new Date(a.getTime());return n.setDate(a.getDate()-t),[this.format(n),this.format(a)]}};function Qn(l,t){const{popoverRef:a}=l,n=It(),r=e.ref(""),o=e.ref(l.modelValue??l.default??[]),i=e.ref(0);function s(){const g=Ae.getRangeFromDaysBefore(i.value);return o.value=[...g],t("change",{name:l.name,value:o.value}),t("update:modelValue",o.value),g}function c(g){var y;r.value=g,(y=a.value)==null||y.close();const x=[];switch(r.value){case"today":x.push(Ae.getShiftedDay()),x.push(Ae.getShiftedDay());break;case"week":x.push(...Ae.getLastWeekRange());break;case"month":x.push(...Ae.getMonthRange());break;case"quarter":x.push(...Ae.getQuarterRange());break;case"year":x.push(...Ae.getYearRange());break;case"last_7_days":i.value=7,s();break;case"range":i.value=7,x.push(...s());break}o.value=[...x],t("change",{name:l.name,value:o.value}),t("update:modelValue",o.value)}function d(){const g=[];switch(r.value){case"today":g.push(Ae.getShiftedDay(o.value[0],1));break;case"week":g.push(...Ae.getLastWeekRange(o.value[0],o.value[1],1));break;case"month":g.push(...Ae.getMonthRange(o.value[0],o.value[1],1));break;case"quarter":g.push(...Ae.getQuarterRange(o.value[0],o.value[1],1));break;case"year":g.push(...Ae.getYearRange(o.value[0],1));break}o.value=[...g],t("change",{name:l.name,value:o.value}),t("update:modelValue",o.value)}function u(){const g=[];switch(r.value){case"today":g.push(Ae.getShiftedDay(o.value[0],-1));break;case"week":g.push(...Ae.getLastWeekRange(o.value[0],o.value[1],-1));break;case"month":g.push(...Ae.getMonthRange(o.value[0],o.value[1],-1));break;case"quarter":g.push(...Ae.getQuarterRange(o.value[0],o.value[1],-1));break;case"year":g.push(...Ae.getYearRange(o.value[0],-1));break}o.value=[...g],t("change",{name:l.name,value:o.value}),t("update:modelValue",o.value)}const p=["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень"];function k(g){const[x,y,f]=g.split("-");return`${f}.${y}.${x}`}function m(g,x="long"){const y=new Date(Date.UTC(2e3,g-1,1));return new Intl.DateTimeFormat(localStorage.locale,{month:x,timeZone:"UTC"}).format(y)}function w(g){const{value:x}=o;switch(g){case"today":return k(x[0]);case"range":return"Період";case"week":return x[0]&&x[1]?`${k(x[0])} – ${k(x[1])}`:"";case"quarter":if(x[0]){const y=new Date(x[0]),f=y.getFullYear(),E=y.getMonth();return`${Math.floor(E/3)+1} ${n("filter.quarter")} ${f}`}return"";case"month":if(x[0]){const[y,f]=x[0].split("-");return`${m(parseInt(f,10))} ${y}`}return"";case"year":return x[0]||"";case"last_7_days":return"За останні дні";default:return l.label??""}}const b=e.computed(()=>r.value?w(r.value):l.label??"");function h(){r.value="",o.value=[],t("update:modelValue",[]),t("clear",l.name)}return{activeMode:r,innerValue:o,daysBefore:i,onDaysBeforeChange:s,onSelectChange:c,nextClick:d,prevClick:u,ukMonths:p,formatDisplayDate:k,getModeLabel:w,currentLabel:b,clear:h}}const ty={key:0,class:"relative flex w-full h-auto gap-2 filter-date m-2 flex-wrap"},ly={key:0,class:"flex gap-1 !w-[75%] rounded-lg"},ay=["max","disabled"],ny=["min","disabled"],ry={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},oy=["max","disabled"],sy={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},iy={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},cy=["min","disabled"],dy={class:"flex gap-1 pt-2"},uy=["onClick"],py=e.defineComponent({__name:"date-input",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const n=l,r=Zn(),o=Gk(),i=a,s=e.ref(null),{activeMode:c,innerValue:d,onSelectChange:u,nextClick:p,prevClick:k,clear:m}=Qn({...n,popoverRef:s},i);return e.watch(()=>n.modelValue,w=>{w!==void 0?(d.value=w,i("update:modelValue",w)):(c.value="",d.value=[])}),t({clear:m,popoverRef:s}),(w,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[l.layout==="inline"?(e.openBlock(),e.createElementBlock("div",ty,[e.unref(c)!==""&&e.unref(c)==="range"?(e.openBlock(),e.createElementBlock("div",ly,[e.withDirectives(e.createElementVNode("input",{type:"date",max:e.unref(d)[1],locale:"uk-UA","onUpdate:modelValue":b[0]||(b[0]=h=>e.unref(d)[0]=h),class:"px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",disabled:l.disabled},null,8,ay),[[e.vModelText,e.unref(d)[0]]]),e.withDirectives(e.createElementVNode("input",{type:"date",min:e.unref(d)[0],locale:"uk-UA","onUpdate:modelValue":b[1]||(b[1]=h=>e.unref(d)[1]=h),class:"px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600 appearance-auto",disabled:l.disabled},null,8,ny),[[e.vModelText,e.unref(d)[1]]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(l.layout==="popover"?"space-y-3 p-2":"flex items-center gap-2")},[e.createElementVNode("div",{class:e.normalizeClass(l.layout!=="popover"?"w-[48%]":"")},[l.layout==="popover"?(e.openBlock(),e.createElementBlock("label",ry,"Від")):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"date",max:e.unref(d)[1],locale:"uk-UA","onUpdate:modelValue":b[2]||(b[2]=h=>e.unref(d)[0]=h),class:e.normalizeClass(e.unref(r)),disabled:l.disabled},null,10,oy),[[e.vModelText,e.unref(d)[0]]])],2),l.layout!=="popover"?(e.openBlock(),e.createElementBlock("label",sy," - ")):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(l.layout!=="popover"?"w-[48%]":"")},[l.layout==="popover"?(e.openBlock(),e.createElementBlock("label",iy,"До")):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"date",min:e.unref(d)[0],locale:"uk-UA","onUpdate:modelValue":b[3]||(b[3]=h=>e.unref(d)[1]=h),class:e.normalizeClass(e.unref(r)),disabled:l.disabled},null,10,cy),[[e.vModelText,e.unref(d)[1]]])],2)],2),e.createElementVNode("div",dy,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["today","week","month","quarter","year"],h=>e.createElementVNode("button",{key:h,class:e.normalizeClass(e.unref(o)+(e.unref(c)===h?" bg-blue-100":"")),onClick:g=>e.unref(u)(h)},e.toDisplayString(e.unref(ey)(h)),11,uy)),64)),e.createElementVNode("button",{class:e.normalizeClass(e.unref(o)),onClick:b[4]||(b[4]=(...h)=>e.unref(k)&&e.unref(k)(...h))}," <",2),e.createElementVNode("button",{class:e.normalizeClass(e.unref(o)),onClick:b[5]||(b[5]=(...h)=>e.unref(p)&&e.unref(p)(...h))}," >",2)]),(l.cleanable,e.createCommentVNode("",!0))],64))}});function my(l,t){const{api:a,options:n=[],limit:r=20,dataKey:o="data"}=l,i=l.multi;function s(P){return i?Array.isArray(P)?P:P?[P]:[]:Array.isArray(P)?P[0]:P}const c=e.ref(s(l.modelValue)),d=e.ref(""),u=e.ref(!1),p=e.ref(n),k=e.ref("id"),m=e.ref("text"),w=e.ref(!1),b=e.ref(l.layout!=="popover"&&n.length>r),h=e.ref([]),g=e.ref(0);function x(P){const F=P.find(Boolean)??{},I=["id","value","code","key"].find(Y=>Y in F)??"id",T=["text","label","name","title"].find(Y=>Y in F)??"text";return{autoValueKey:I,autoLabelKey:T}}if(n.length>0){const P=x(n);k.value=P.autoValueKey,m.value=P.autoLabelKey}const y=e.computed(()=>{if(a)return p.value;const P=p.value;if(l.layout==="popover")return P;if(!d.value)return w.value?P:P.slice(0,r);const F=d.value.toLowerCase();return P.filter(I=>I[m.value].toLowerCase().includes(F))});let f=null;async function E(P){if(a){u.value=!0;try{const F=new URL(a,window.location.origin);F.searchParams.set("json","1"),F.searchParams.set("key",P),F.searchParams.set("limit",r.toString());const I=await fetch(F.toString());if(!I.ok){ke({type:"error",title:"Error",message:"Failed to fetch remote options"}),p.value=[];return}const T=await I.json();if(!T[o]){ke({type:"error",title:"Error",message:T}),p.value=[];return}if(p.value=T[o],p.value.length>0){const Y=x(p.value);k.value=Y.autoValueKey,m.value=Y.autoLabelKey}g.value=T.total}catch(F){console.error("Failed to fetch remote options:",F)}finally{u.value=!1}}}e.watch(d,P=>{a&&(f&&clearTimeout(f),f=setTimeout(()=>{E(P)},200))}),e.watch(()=>l.modelValue,P=>{c.value=s(P)},{immediate:!0});function N(P){return i&&Array.isArray(c.value)?c.value.includes(P[k.value]):c.value&&c.value===P[k.value]}function V(P){if(i&&!Array.isArray(c.value)&&(c.value=[]),i&&Array.isArray(c.value)){const F=c.value.includes(P[k.value]);c.value=F?c.value.filter(I=>I!==P[k.value]):[...c.value,P[k.value]],h.value=F?h.value.filter(I=>I!==P[m.value]):[...h.value,P[m.value]]}else c.value=P[k.value],h.value=P[m.value];t("update:modelValue",c.value),t("change",{name:l.name,value:c.value})}function $(){i?(c.value=[],h.value=[]):(c.value=void 0,h.value=[]),t("update:modelValue",c.value),t("clear",l.name)}function K(){f&&clearTimeout(f),d.value="",w.value=!1}function H(){w.value=!w.value}e.onBeforeUnmount(()=>{f&&clearTimeout(f)});const v=e.ref(-1);e.watch(y,()=>{v.value=y.value.length>0?0:-1});function W(P){const F=y.value.length;if(P.key==="ArrowDown")P.preventDefault(),v.value=(v.value+1)%F;else if(P.key==="ArrowUp")P.preventDefault(),v.value=(v.value-1+F)%F;else if(P.key==="Enter"&&(P.preventDefault(),v.value>=0&&v.value<y.value.length)){const I=y.value[v.value];V(I)}}function le(){a&&p.value.length===0&&d.value.length===0&&E(d.value)}return{innerValue:c,searchTerm:d,filteredOptions:y,isSelected:N,selectItem:V,clear:$,resetSearch:K,toggleShowAll:H,isReqProc:u,showAll:w,isEnableShowAll:b,labelKey:m,valueKey:k,allOptions:p,highlightedIndex:v,onKeyDown:W,selectedLabels:h,totalCount:g,loadData:le}}const fy={class:"h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relative justify-center"},hy=["placeholder"],gy={key:0,class:"w-full"},ky={class:"flex flex-col items-center justify-center p-5 text-center"},yy={class:"max-w-sm mx-auto mt-6"},by={class:"font-medium text-gray-800 dark:text-neutral-200"},xy={key:0,class:"flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"},wy={key:1,class:"flex justify-between items-center text-xs text-gray-500 p-1 border-t"},Ey=e.defineComponent({__name:"select",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{default:10},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const n=It(),r=l,o=a,i=e.ref(null),{innerValue:s,filteredOptions:c,isSelected:d,selectItem:u,clear:p,resetSearch:k,toggleShowAll:m,isReqProc:w,showAll:b,isEnableShowAll:h,searchTerm:g,labelKey:x,valueKey:y,highlightedIndex:f,onKeyDown:E,selectedLabels:N,totalCount:V,loadData:$}=my({...r,modelValue:r.modelValue},o);e.onMounted(()=>{k(),r.layout!=="inline"&&($(),i.value&&r.layout==="popover"&&i.value.focus())}),e.watch(()=>r.modelValue,H=>{H===void 0&&(r.multi?s.value=[]:s.value=void 0)});const K=e.ref([]);return e.watch(f,H=>{var v;H>=0&&K.value[H]&&((v=K.value[H])==null||v.scrollIntoView({block:"nearest",behavior:"smooth"}))}),e.watch(c,()=>{K.value=[]}),t({clear:p,inputTextRef:i,selectedLabels:N,loadData:$}),(H,v)=>{var W,le;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([l.layout==="popover"?"flex flex-col h-full":"flex flex-col vs-filter-checkbox space-y-0.5"])},[e.createElementVNode("div",fy,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":v[0]||(v[0]=P=>e.isRef(g)?g.value=P:null),onKeydown:v[1]||(v[1]=(...P)=>e.unref(E)&&e.unref(E)(...P)),class:"w-full h-full text-[13px] px-4 border rounded-sm pl-9 focus:outline-none focus:ring-ring focus:ring-1 focus:ring-blue-500 text-gray-700",placeholder:e.unref(n)("filter.search"),type:"text",ref_key:"inputTextRef",ref:i},null,40,hy),[[e.vModelText,e.unref(g)]]),e.createVNode(qn,{class:"absolute text-gray-400 -translate-y-1/2 left-4 top-1/2"}),e.unref(g)!=""?(e.openBlock(),e.createBlock(Xn,{key:0,onClick:v[2]||(v[2]=P=>g.value=""),class:"absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"})):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass([l.layout==="popover"?"flex-1 overflow-y-auto max-h-64 p-2":"",l.layout==="inline"?"flex-1 overflow-y-auto max-h-80":""])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(P,F)=>(e.openBlock(),e.createBlock(ea,{layout:l.layout,count:P.count,label:P[e.unref(x)],color:P.color,type:l.multi?"checkbox":"radio",value:P[e.unref(y)],"is-selected":e.unref(d)(P),highlighted:F===e.unref(f),onItemClick:I=>e.unref(u)(P),ref_for:!0,ref:I=>K.value[F]=I==null?void 0:I.el},null,8,["layout","count","label","color","type","value","is-selected","highlighted","onItemClick"]))),256))],2),l.type==="select"&&e.unref(c).length===0&&!e.unref(w)?(e.openBlock(),e.createElementBlock("div",gy,[e.createElementVNode("div",ky,[e.createVNode(ta),e.createElementVNode("div",yy,[e.createElementVNode("p",by,e.toDisplayString(e.unref(n)("filter.notfound")),1),v[7]||(v[7]=e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"},null,-1))])])])):e.createCommentVNode("",!0),l.layout!=="popover"&&l.type!=="select"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[!e.unref(b)&&e.unref(h)?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:v[3]||(v[3]=(...P)=>e.unref(m)&&e.unref(m)(...P)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[e.createTextVNode(e.toDisplayString(e.unref(n)("filter.more"))+" ",1),e.createVNode(kl)])):e.createCommentVNode("",!0),e.unref(b)?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:v[4]||(v[4]=(...P)=>e.unref(m)&&e.unref(m)(...P)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[e.createTextVNode(e.toDisplayString(e.unref(n)("filter.less"))+" ",1),e.createVNode(la)])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),l.cleanable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[l.layout==="inline"?(e.openBlock(),e.createElementBlock("div",xy,[e.createTextVNode(e.toDisplayString(l.multi&&Array.isArray(e.unref(s))?(W=e.unref(s))==null?void 0:W.length:e.unref(s)!==void 0&&(e.unref(s)||e.unref(s)===null)?1:0)+" / "+e.toDisplayString(e.unref(V))+" "+e.toDisplayString(e.unref(n)("filter.selected"))+" ",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:v[5]||(v[5]=(...P)=>e.unref(p)&&e.unref(p)(...P))},e.toDisplayString(e.unref(n)("filter.clear")),513),[[e.vShow,e.unref(s)!==""&&e.unref(s)!==void 0||e.unref(s)]])])):e.createCommentVNode("",!0),l.layout==="popover"?(e.openBlock(),e.createElementBlock("div",wy,[e.createElementVNode("span",null,e.toDisplayString(l.multi&&Array.isArray(e.unref(s))?(le=e.unref(s))==null?void 0:le.length:e.unref(s)!==void 0&&(e.unref(s)||e.unref(s)===null)?1:0)+" / "+e.toDisplayString(e.unref(V))+" "+e.toDisplayString(e.unref(n)("filter.selected")),1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:v[6]||(v[6]=(...P)=>e.unref(p)&&e.unref(p)(...P))},e.toDisplayString(e.unref(n)("filter.clear")),513),[[e.vShow,e.unref(s)!==""&&e.unref(s)!==void 0||e.unref(s)]])])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],2)}}}),_y=["for","onClick"],Cy=["id","name","value"],Vy={class:"block"},Ny={key:0,class:"flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"},By={key:1,class:"flex justify-between items-center text-xs text-gray-500 p-1 border-t"},Sy=e.defineComponent({__name:"tag-field",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const n=l,r=a,{innerValue:o,isSelected:i,selectItem:s,clear:c,labelKey:d,valueKey:u,allOptions:p}=n.multi?Gn({...n,modelValue:n.modelValue??n.default??[]},r):Kn({...n,modelValue:n.modelValue!==void 0?n.modelValue:n.default??""},r);return t({clear:c}),e.watch(()=>n.modelValue,k=>{k===void 0&&(n.multi?o.value=[]:o.value=void 0)}),(k,m)=>{var w,b;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["grid grid-cols-3 gap-2 mx-[1px]",l.layout==="popover"?"m-1":"mb-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(p),h=>(e.openBlock(),e.createElementBlock("label",{key:`item-${h[e.unref(u)]}`,for:`item-${h[e.unref(u)]}`,onClick:e.withModifiers(g=>e.unref(s)(h),["stop","prevent"]),class:e.normalizeClass([e.unref(i)(h)?"ring-2 ring-indigo-600":"","p-2.5 group relative flex justify-center items-center gap-x-12 text-center text-xs bg-white text-gray-800 border border-gray-200 cursor-pointer rounded-lg dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-200 peer-checked:text-indigo-600 dark:has-checked:text-indigo-500 peer-checked:border-indigo-600 dark:has-checked:border-indigo-500 peer-checked:ring peer-checked:shadow focus:ring dark:has-checked:ring-indigo-500 has-disabled:pointer-events-none has-disabled:text-gray-200 dark:has-disabled:text-neutral-700 has-disabled:after:absolute has-disabled:after:inset-0 has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-gray-200)_calc(50%-1px),var(--color-gray-200)_50%,transparent_50%)] dark:has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-neutral-700)_calc(50%-1px),var(--color-neutral-700)_50%,transparent_50%)]"])},[e.createElementVNode("input",{type:"checkbox",id:`item-${h[e.unref(u)]}`,class:"hidden w4poy border-gray-200 g41z1 g22e3 axcnw dark:text-indigo-500 dark:border-neutral-700 dark:focus:ring-neutral-900",name:`item-${h[e.unref(u)]}`,value:h[e.unref(u)]},null,8,Cy),e.createElementVNode("span",Vy,e.toDisplayString(h[e.unref(d)]),1)],10,_y))),128))],2),l.cleanable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l.layout==="inline"?(e.openBlock(),e.createElementBlock("div",Ny,[e.createTextVNode(e.toDisplayString(l.multi&&Array.isArray(e.unref(o))?(w=e.unref(o))==null?void 0:w.length:e.unref(o)!==void 0&&(e.unref(o)||e.unref(o)===null)?1:0)+" з "+e.toDisplayString(e.unref(p).length)+" обрано ",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:m[0]||(m[0]=(...h)=>e.unref(c)&&e.unref(c)(...h))}," Очистити ",512),[[e.vShow,e.unref(o)!==""&&e.unref(o)!==void 0||e.unref(o)]])])):e.createCommentVNode("",!0),l.layout==="popover"?(e.openBlock(),e.createElementBlock("div",By,[e.createElementVNode("span",null,e.toDisplayString(l.multi&&Array.isArray(e.unref(o))?(b=e.unref(o))==null?void 0:b.length:e.unref(o)!==void 0&&(e.unref(o)||e.unref(o)===null)?1:0)+" з "+e.toDisplayString(e.unref(p).length)+" обрано",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:m[1]||(m[1]=(...h)=>e.unref(c)&&e.unref(c)(...h))}," Очистити ",512),[[e.vShow,e.unref(o)!==void 0&&e.unref(o)!==""||e.unref(o)]])])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)}}}),Ay=["disabled","title"],Dy={key:0,class:"absolute top-0 end-0 inline-flex min-h-[10px] min-w-[10px] z-10 items-center py-0.5 rounded-full text-xs font-medium transform -translate-y-1/2 translate-x-1/2 bg-blue-600 text-white px-1"},Ly={class:"w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},My={class:"w-[360px] max-h-[500px] overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 before:w-full p-2"},na=e.defineComponent({__name:"popover-field",props:{disabled:{type:Boolean,default:!1},label:{},en:{},ua:{},uk:{},fr:{},de:{},es:{},currentValue:{},fieldRef:{},width:{},mode:{},layout:{}},setup(l,{expose:t}){const a=l,n=e.computed(()=>Jn(a.mode)),r=e.ref(!1),o=e.ref({top:0,left:0}),i=e.ref(null),s=e.ref(null),c=e.ref(null);function d(){const x=s.value,y=c.value;if(!x||!y)return;const f=x.getBoundingClientRect(),E=y.offsetWidth,N=window.innerWidth,V=f.bottom+8;let{left:$}=f;$+E>N&&($=Math.max(N-E-10,10)),o.value={top:V,left:$}}function u(){console.log("~~~~~~~~~~"),console.log(r.value),r.value=!r.value,console.log(r.value),r.value&&e.nextTick(()=>{var x,y,f,E,N,V,$;d(),(x=a.fieldRef)!=null&&x.inputTextRef&&((E=(f=(y=a.fieldRef)==null?void 0:y.inputTextRef)==null?void 0:f.focus)==null||E.call(f)),(N=a.fieldRef)!=null&&N.loadData&&(($=(V=a.fieldRef)==null?void 0:V.loadData)==null||$.call(V))})}function p(x){var y,f,E;!((y=i.value)!=null&&y.contains(x.target))&&!((f=c.value)!=null&&f.contains(x.target))&&!((E=s.value)!=null&&E.contains(x.target))&&(r.value=!1)}function k(x){x.key==="Escape"&&(r.value=!1)}const m=e.ref(!1),w=e.ref("ua"),b=x=>{x.detail.key==="locale"&&(w.value=x.detail.newValue)};e.onMounted(()=>{m.value=!0,w.value=localStorage.locale,window.addEventListener("storage",b),document.addEventListener("click",p,!0),document.addEventListener("keydown",k),window.addEventListener("scroll",d,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",b),document.removeEventListener("click",p,!0),document.removeEventListener("keydown",k),window.removeEventListener("scroll",d,!0)});function h(){r.value=!1}t({close:h});const g=e.computed(()=>{var y;const x=(y=a.fieldRef)==null?void 0:y.selectedLabels;return!x||["inline"].includes(a.layout||"")?a[w.value]||(a.label??""):Array.isArray(x)?x.length>0?x.join(", "):a.label??"":String(x)});return(x,y)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{onClick:u,disabled:l.disabled,ref_key:"triggerRef",ref:s,title:l.label,class:e.normalizeClass(n.value+" "+(l.width?e.unref(aa).getWidthClass(l.width):"w-full"))},[e.createElementVNode("span",{class:e.normalizeClass(["truncate text-ellipsis block",l.width?e.unref(aa).getWidthClass(l.width-50):"w-full"])},e.toDisplayString(g.value),3),e.createVNode(kl,{class:"h-4 w-4"}),(Array.isArray(l.currentValue)?l.currentValue===null||l.currentValue.length>0:l.currentValue===null||l.currentValue)&&l.layout==="inline"?(e.openBlock(),e.createElementBlock("span",Dy)):e.createCommentVNode("",!0)],10,Ay),m.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{ref_key:"popperRef",ref:c,class:"vsTailwind vs-popover__content bottom-right w-fit fixed z-[1000]",style:e.normalizeStyle({top:`${o.value.top}px`,left:`${o.value.left}px`}),"data-inside-popover":""},[e.createElementVNode("div",Ly,[e.createElementVNode("div",My,[e.renderSlot(x.$slots,"default")])])],4),[[e.vShow,r.value]])])):e.createCommentVNode("",!0)]))}}),Ty={},Fy={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:"text-blue-600 w-[16px] h-[16px]"};function Iy(l,t){return e.openBlock(),e.createElementBlock("svg",Fy,[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M20 6 9 17l-5-5"},null,-1)])])}const _t=Qe(Ty,[["render",Iy]]),Oy={},$y={xmlns:"http://www.w3.org/2000/svg",width:"15px",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[90deg]"};function vy(l,t){return e.openBlock(),e.createElementBlock("svg",$y,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)])])}const Ry=Qe(Oy,[["render",vy]]),Py={},Uy={xmlns:"http://www.w3.org/2000/svg",width:"15px",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[270deg]"};function jy(l,t){return e.openBlock(),e.createElementBlock("svg",Uy,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)])])}const zy=Qe(Py,[["render",jy]]),Hy={class:"flex"},Ky={class:"mb-1"},Gy={class:"mb-1"},Wy={class:"inline-flex rounded-lg shrink-0 pl-1"},Yy=["title"],qy={class:"inline-flex rounded-lg shrink-0 pl-1"},Xy=["title"],Zy={key:1,class:"flex gap-1 !w-[75%] rounded-lg"},Jy=["max","disabled"],Qy=["min","disabled"],eb=e.defineComponent({__name:"date-input-inline",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const n=It(),r=l,o=a,i=e.ref(null),{activeMode:s,innerValue:c,onSelectChange:d,nextClick:u,prevClick:p,currentLabel:k,clear:m}=Qn({...r,popoverRef:i},o);return e.watch(()=>r.modelValue,w=>{w!==void 0?(c.value=w,o("update:modelValue",w)):(s.value="",c.value=[])}),t({clear:m,popoverRef:i}),(w,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Hy,[e.createVNode(na,{ref_key:"popoverRef",ref:i,label:e.unref(k),"current-value":e.unref(c),mode:l.mode,onClear:e.unref(m),layout:l.layout},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",onClick:b[0]||(b[0]=h=>e.unref(d)("range")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(n)("filter.period"))+" ",1),e.unref(s)==="range"?(e.openBlock(),e.createBlock(_t,{key:0})):e.createCommentVNode("",!0)])]),b[12]||(b[12]=e.createElementVNode("div",null,[e.createElementVNode("div",{class:"pt-1 mt-1 border-t"})],-1)),e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",onClick:b[1]||(b[1]=h=>e.unref(d)("today")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(n)("filter.today"))+" ",1),e.unref(s)==="today"?(e.openBlock(),e.createBlock(_t,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",onClick:b[2]||(b[2]=h=>e.unref(d)("week")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(n)("filter.week"))+" ",1),e.unref(s)==="week"?(e.openBlock(),e.createBlock(_t,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",onClick:b[3]||(b[3]=h=>e.unref(d)("month")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(n)("filter.month"))+" ",1),e.unref(s)==="month"?(e.openBlock(),e.createBlock(_t,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",onClick:b[4]||(b[4]=h=>e.unref(d)("quarter")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(n)("filter.quarter"))+" ",1),e.unref(s)==="quarter"?(e.openBlock(),e.createBlock(_t,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Ky,[e.createElementVNode("button",{type:"button",onClick:b[5]||(b[5]=h=>e.unref(d)("year")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(n)("filter.year"))+" ",1),e.unref(s)==="year"?(e.openBlock(),e.createBlock(_t,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Gy,[e.createElementVNode("button",{type:"button",onClick:b[6]||(b[6]=h=>e.unref(m)()),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(n)("filter.alltime"))+" ",1),e.unref(c)[0]?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(_t,{key:0}))])])]),_:1},8,["label","current-value","mode","onClear","layout"]),e.unref(s)!==""&&e.unref(s)!=="range"&&e.unref(s)!=="last_7_days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",Wy,[e.createElementVNode("button",{type:"button",title:e.unref(n)("filter.prev"),class:"inline-flex h-[38px] items-center px-2 text-sm text-gray-800 bg-gray-100 gap-x-2 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",onClick:b[7]||(b[7]=(...h)=>e.unref(p)&&e.unref(p)(...h))},[e.createVNode(Ry)],8,Yy)]),e.createElementVNode("div",qy,[e.createElementVNode("button",{type:"button",title:e.unref(n)("filter.next"),class:"inline-flex h-[38px] items-center px-2 text-sm text-gray-800 gap-x-2 bg-gray-100 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",onClick:b[8]||(b[8]=(...h)=>e.unref(u)&&e.unref(u)(...h))},[e.createVNode(zy)],8,Xy)])],64)):e.createCommentVNode("",!0),e.unref(s)!==""&&e.unref(s)==="range"?(e.openBlock(),e.createElementBlock("div",Zy,[e.withDirectives(e.createElementVNode("input",{type:"date",max:e.unref(c)[1],locale:"uk-UA","onUpdate:modelValue":b[9]||(b[9]=h=>e.unref(c)[0]=h),class:"px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",disabled:l.disabled},null,8,Jy),[[e.vModelText,e.unref(c)[0]]]),e.withDirectives(e.createElementVNode("input",{type:"date",min:e.unref(c)[0],locale:"uk-UA","onUpdate:modelValue":b[10]||(b[10]=h=>e.unref(c)[1]=h),class:"px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600 appearance-auto",disabled:l.disabled},null,8,Qy),[[e.vModelText,e.unref(c)[1]]])])):e.createCommentVNode("",!0)]),(l.cleanable,e.createCommentVNode("",!0))],64))}}),er={radio:Sk,checkbox:Yn,check:Yn,text:Hk,range:Qk,date:py,select:Ey,tag:Sy,"date:inline":eb};function ra(l,t){let a;switch(l.toLowerCase()){case"autocomplete":a="select";break;case"check":a="checkbox";break;default:a=l==null?void 0:l.toString().toLowerCase()}return a==="date"&&t&&t==="inline"&&(a="date:inline"),{component:er[a]||er.text,type:a}}const tb={style:{display:"inline-flex",margin:"0px",width:"100%"}},lb={class:"relative w-full mb-2 p-4 bg-white rounded-lg shadow-sm"},ab={class:"block mb-3 text-sm font-medium text-gray-800 dark:text-neutral-200"},nb={class:"flex items-center"},rb={class:"text-sm font-medium max-w-[80%] text-gray-800 flex items-center gap-x-1"},ob={class:"filter-layout__body"},sb=e.defineComponent({__name:"vertical-layout",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const n=l,r=a,o=e.ref(),i=ra(n.type,n.layout),s=e.computed({get:()=>n.modelValue,set:p=>r("update:modelValue",p)});function c(p){r("clear",p)}function d(p,k){r("change",{name:p,value:k}),n.modelValue!==void 0&&r("update:modelValue",k)}function u(){o.value&&o.value.clear(),r("clear",n.name)}return e.watch(()=>n.default,p=>{s.value=p}),e.watch(()=>n.modelValue,p=>{s.value=p}),t({filterRef:o}),(p,k)=>{var m,w,b;return e.openBlock(),e.createElementBlock("div",tb,[e.createElementVNode("div",lb,[e.createElementVNode("div",ab,[e.createElementVNode("div",nb,[e.createElementVNode("span",rb,e.toDisplayString(l.label),1)]),typeof s.value=="string"&&s.value.trim()!==""||Array.isArray(s.value)&&s.value.length>0&&s.value.some(h=>h!==void 0)||s.value===null?(e.openBlock(),e.createBlock(sk,{key:0,onClick:u})):e.createCommentVNode("",!0)]),e.createElementVNode("div",ob,[((m=e.unref(i))==null?void 0:m.type)!=="select"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent((w=e.unref(i))==null?void 0:w.component),e.mergeProps({key:0},n,{type:(b=e.unref(i))==null?void 0:b.type,onChange:k[0]||(k[0]=h=>d(h.name,h.value)),onClear:k[1]||(k[1]=h=>c(h)),ref_key:"filterRef",ref:o}),null,16,["type"])):(e.openBlock(),e.createBlock(na,{key:1,"current-value":s.value,label:l.label,mode:l.mode,onClear:u,fieldRef:o.value,width:void 0,disabled:l.disabled,layout:"vertical"},{default:e.withCtx(()=>{var h,g;return[(e.openBlock(),e.createBlock(e.resolveDynamicComponent((h=e.unref(i))==null?void 0:h.component),e.mergeProps({ref_key:"filterRef",ref:o},n,{type:(g=e.unref(i))==null?void 0:g.type,onChange:k[2]||(k[2]=x=>d(x.name,x.value)),onClear:k[3]||(k[3]=x=>c(x))}),null,16,["type"]))]}),_:1},8,["current-value","label","mode","fieldRef","disabled"]))])])])}}}),tr=e.defineComponent({__name:"inline-layout",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const n=l,r=a,o=e.ref(),i=ra(n.type,n.layout),s=e.computed({get:()=>n.modelValue,set:u=>r("update:modelValue",u)});function c(u=n.name){r("clear",u)}function d(u,p){r("change",{name:u,value:p}),n.modelValue!==void 0&&r("update:modelValue",p)}return e.watch(()=>n.default,u=>{s.value=u}),e.watch(()=>n.modelValue,u=>{s.value=u}),t({filterRef:o}),(u,p)=>{var k,m;return["text","date"].includes(l.type.toLocaleLowerCase())?(e.openBlock(),e.createBlock(e.resolveDynamicComponent((k=e.unref(i))==null?void 0:k.component),e.mergeProps({key:0},n,{type:(m=e.unref(i))==null?void 0:m.type,onChange:p[0]||(p[0]=w=>d(w.name,w.value)),onClear:p[1]||(p[1]=w=>c(w)),disabled:l.disabled,modelValue:s.value,"onUpdate:modelValue":p[2]||(p[2]=w=>s.value=w)}),null,16,["type","disabled","modelValue"])):(e.openBlock(),e.createBlock(na,{key:1,"current-value":s.value,label:l.label,mode:l.mode,onClear:c,fieldRef:o.value,width:n.width,disabled:l.disabled,layout:"inline"},{default:e.withCtx(()=>{var w,b;return[(e.openBlock(),e.createBlock(e.resolveDynamicComponent((w=e.unref(i))==null?void 0:w.component),e.mergeProps({ref_key:"filterRef",ref:o},n,{modelValue:s.value,"onUpdate:modelValue":p[3]||(p[3]=h=>s.value=h),type:(b=e.unref(i))==null?void 0:b.type,onChange:p[4]||(p[4]=h=>d(h.name,h.value)),onClear:p[5]||(p[5]=h=>c(h))}),null,16,["modelValue","type"]))]}),_:1},8,["current-value","label","mode","fieldRef","width","disabled"]))}}}),ib=e.defineComponent({__name:"popover-layout",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const n=l,r=a,o=e.ref(),i=e.ref(ra(n.type,n.layout)),s=e.computed({get:()=>n.modelValue,set:u=>r("update:modelValue",u)});function c(u){r("clear",u)}function d(u,p){r("change",{name:u,value:p}),n.modelValue!==void 0&&r("update:modelValue",p)}return e.watch(()=>n.default,u=>{s.value=u}),e.watch(()=>n.modelValue,u=>{s.value=u}),e.watch(()=>n,u=>{s.value=u}),t({filterRef:o}),(u,p)=>{var k,m;return e.openBlock(),e.createBlock(e.resolveDynamicComponent((k=i.value)==null?void 0:k.component),e.mergeProps(n,{type:(m=i.value)==null?void 0:m.type,modelValue:s.value,"onUpdate:modelValue":p[0]||(p[0]=w=>s.value=w),onChange:p[1]||(p[1]=w=>d(w.name,w.value)),onClear:p[2]||(p[2]=w=>c(w)),ref_key:"filterRef",ref:o}),null,16,["type","modelValue"])}}}),Ct=e.defineComponent({__name:"filter-field",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{default:10},multi:{type:Boolean,default:!0},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{default:"name"},ua:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const n=l,r=a,o=e.ref(),i=e.computed({get:()=>n.modelValue,set:u=>r("update:modelValue",u)});function s(u){r("clear",u)}function c(u,p){r("change",{name:u,value:p}),n.modelValue!==void 0&&r("update:modelValue",p)}e.watch(()=>n.default,u=>{i.value=u}),e.watch(()=>n.modelValue,u=>{i.value=u}),t({filterRef:o});function d(){switch(n.layout){case"inline":return tr;case"vertical":return sb;case"popover":return ib;default:return tr}}return(u,p)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d()),e.mergeProps(n,{onChange:p[0]||(p[0]=k=>c(k.name,k.value)),onClear:p[1]||(p[1]=k=>s(k)),modelValue:i.value,"onUpdate:modelValue":p[2]||(p[2]=k=>i.value=k)}),null,16,["modelValue"]))}});function oa(l,t){const{slots:a}=l,n=e.ref(l.value??{}),r=e.computed(()=>{var h;return(e.toRaw((h=a==null?void 0:a.default)==null?void 0:h.call(a))??[]).flatMap(g=>Array.isArray(g.children)?g.children:[g])});function o(h){delete n.value[h],t("clear",{data:e.toRaw(n.value),name:h})}function i(h,g){g===void 0?o(h):n.value={...n.value,[h]:g},t("change",{data:e.toRaw(n.value),name:h,value:g})}const s=e.computed(()=>r.value.map(h=>{var x;const g=(x=h.props)==null?void 0:x.name;return e.cloneVNode(h,{...h.props,layout:l.view,showClean:!0,modelValue:n.value[g],"onUpdate:modelValue":y=>{i(g,y)},onClear:()=>o(g)})})),c=e.computed(()=>new Map(s.value.map(h=>{var x;const g=(x=h.props)==null?void 0:x.name;return g?[g,h]:null}).filter(h=>h!==null)));function d(h=!1){n.value={},h||t("clearAll",{data:e.toRaw(n.value),name:"ALL"})}const u=e.ref(""),p=e.computed(()=>{var h;return(h=l.schema)!=null&&h.value?Object.entries(n.value).filter(([g,x])=>l.schema&&!(g in l.schema.value)?!1:Array.isArray(x)?x.some(y=>y!==""&&y!==void 0):x!==""&&x!==void 0).length:0}),k=e.ref();e.watch(u,async()=>{var h,g;await e.nextTick(),(g=(h=k==null?void 0:k.value)==null?void 0:h.filterRef)!=null&&g.inputTextRef&&k.value.filterRef.inputTextRef.focus()});const m=e.computed(()=>{var h,g;return(h=l.schema)!=null&&h.value?Object.fromEntries(Object.entries((g=l.schema)==null?void 0:g.value).slice(0,l.limit)):{}}),w=e.computed(()=>{var g;if(s.value.length===0)return[];let h=0;if((g=l.schema)!=null&&g.value){const x=Object.entries(l.schema.value).length;l.limit&&x<l.limit?h=l.limit-x:h=0}return s.value.slice(0,h)}),b=e.computed(()=>s.value.length===0?[]:l.view!=="inline"?s.value:s.value.slice(w.value.length));return{activeFilter:n,activeFilterCount:p,onFilterChange:i,clearFilter:o,clearAllFilters:d,limitedSchema:m,filtersSlot:s,limitedFiltersSlot:w,popoverFiltersSlot:b,vnodeMap:c,selectedFilter:u,filterRef:k}}const cb=e.defineComponent({__name:"popover",emits:["open","close"],setup(l,{emit:t}){const a=e.ref(!1),n=e.ref(null),r=e.ref(null),o=e.ref(null),i=e.ref({top:"0px",left:"0px",position:"absolute"});function s(){a.value=!a.value}function c(){const m=o.value,w=n.value;if(!m||!w)return;const b=m.getBoundingClientRect(),h=w.offsetWidth,g=window.innerWidth-b.left;let x=b.left+window.scrollX;h>g&&(x=window.innerWidth-h-8,x<8&&(x=8)),i.value={position:"absolute",top:`${b.bottom+window.scrollY+8}px`,left:`${x}px`}}const d=e.computed(()=>Object.entries(i.value).map(m=>m.join(":")).join(";"));function u(m){var b,h;const w=m.target;!((b=o.value)!=null&&b.contains(m.target))&&!((h=n.value)!=null&&h.contains(m.target))&&!w.closest("[data-inside-popover]")&&(a.value=!1)}const p=e.ref(!1);e.onMounted(()=>{p.value=!0}),e.onMounted(()=>{var m,w;o.value=((m=r.value)==null?void 0:m.querySelector("[data-popover-trigger]"))||null,(w=o.value)==null||w.addEventListener("click",s),document.addEventListener("click",u),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0)}),e.onBeforeUnmount(()=>{var m;(m=o.value)==null||m.removeEventListener("click",s),document.removeEventListener("click",u),window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0)});const k=t;return e.watch(a,async m=>{m?(k("open"),await e.nextTick(),c()):k("close")}),(m,w)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:r},[e.renderSlot(m.$slots,"trigger"),p.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{ref_key:"popoverRef",ref:n,class:"absolute z-[50] w-[600px] rounded-md border bg-white shadow-md",style:e.normalizeStyle(d.value)},[e.renderSlot(m.$slots,"default")],4),[[e.vShow,a.value]])])):e.createCommentVNode("",!0)],512))}}),db={},ub={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-filter h-4 w-4"};function pb(l,t){return e.openBlock(),e.createElementBlock("svg",ub,[...t[0]||(t[0]=[e.createElementVNode("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"},null,-1)])])}const mb=Qe(db,[["render",pb]]),fb={key:0,class:"inline-flex rounded-sm items-center border font-semibold border-transparent hover:bg-secondary/80 bg-blue-500 text-white text-xs px-1.5"},hb={class:"flex"},gb={class:"w-64 border-r border-gray-200"},kb={class:"p-2"},yb=["onClick"],bb={class:"flex items-center gap-2"},xb={class:"text-sm font-medium"},wb={key:0,class:"inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 text-blue-700 text-xs p-2"},Eb=["onClick"],_b={class:"flex items-center gap-2"},Cb={class:"text-sm font-medium"},Vb={key:0,class:"inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 text-blue-700 text-xs p-2"},Nb={key:0,class:"p-2 border-t"},Bb={class:"flex-1 min-h-[300px] overflow-y-auto"},Sb={key:0,class:"flex items-center justify-center h-full text-gray-500"},lr=e.defineComponent({__name:"popover-filter-layout",props:{schema:{},view:{},value:{},history:{type:Boolean},mode:{},limit:{default:3}},emits:["change","clear","clearAll"],setup(l,{expose:t,emit:a}){const n=l,r=Jn(n.mode),o=e.useSlots(),i=a,s=e.ref({}),c=e.computed(()=>s!=null&&s.value?n.view!=="inline"?s==null?void 0:s.value:Object.fromEntries(Object.entries(s==null?void 0:s.value).slice(n.limit)):{}),{activeFilter:d,activeFilterCount:u,onFilterChange:p,clearFilter:k,clearAllFilters:m,popoverFiltersSlot:w,selectedFilter:b,filterRef:h}=oa({...n,schema:s.value,slots:o},i);function g(){if(c.value){const[x]=Object.keys(c.value);b.value=x}else w.value.length>0?b.value=w.value[0].props.name:b.value=""}return e.watch(()=>n.schema,x=>{s.value=x},{deep:!0,immediate:!0}),t({clearFilter:k,clearAllFilters:m}),(x,y)=>(e.openBlock(),e.createBlock(cb,{onOpen:g,onClose:y[5]||(y[5]=f=>b.value="")},{trigger:e.withCtx(()=>[e.createElementVNode("button",{"data-popover-trigger":"","aria-haspopup":"dialog","aria-expanded":"false",class:e.normalizeClass(e.unref(r)+(e.unref(u)>0?"bg-blue-50 border-blue-200 text-blue-700 hover:bg-blue-100":"text-gray-800 hover:bg-gray-200 focus:bg-gray-200")),type:"button"},[e.createVNode(mb),y[6]||(y[6]=e.createTextVNode(" Фільтр ",-1)),e.unref(u)>0?(e.openBlock(),e.createElementBlock("div",fb,e.toDisplayString(e.unref(u)),1)):e.createCommentVNode("",!0)],2)]),default:e.withCtx(()=>[e.createElementVNode("div",hb,[e.createElementVNode("div",gb,[y[7]||(y[7]=e.createElementVNode("div",{class:"p-4 border-b"},[e.createElementVNode("p",{class:"text-sm text-gray-600"},"Select a field to start creating a filter.")],-1)),e.createElementVNode("div",kb,[l.schema?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Object.entries(c.value),([f,E])=>{var N;return e.openBlock(),e.createElementBlock("button",{key:f,onClick:()=>{b.value=f},class:e.normalizeClass(["w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",e.unref(b)===f?"bg-blue-50 text-blue-700 border-l-2 border-blue-500":"text-gray-700"])},[e.createElementVNode("div",bb,[e.createElementVNode("span",xb,e.toDisplayString(E.label),1)]),(Array.isArray(e.unref(d)[f])?((N=e.unref(d)[f])==null?void 0:N.length)>0:e.unref(d)[f]||e.unref(d)[f]===null)?(e.openBlock(),e.createElementBlock("div",wb)):e.createCommentVNode("",!0)],10,yb)}),128)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(w),(f,E)=>{var N;return e.openBlock(),e.createElementBlock("button",{key:"slot-"+E,onClick:V=>b.value=f.props.name,class:e.normalizeClass(["w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",e.unref(b)===f.props.name?"bg-blue-50 text-blue-700 border-l-2 border-blue-500":""])},[e.createElementVNode("div",_b,[e.createElementVNode("span",Cb,e.toDisplayString(f.props.label),1)]),((N=e.unref(d)[f.props.name])==null?void 0:N.length)>0?(e.openBlock(),e.createElementBlock("div",Vb)):e.createCommentVNode("",!0)],10,Eb)}),128))]),e.unref(u)>0?(e.openBlock(),e.createElementBlock("div",Nb,[e.createElementVNode("button",{class:"w-full px-3 py-2 text-left text-sm text-gray-600 hover:bg-gray-50 transition-colors",onClick:y[0]||(y[0]=f=>e.unref(m)()),"data-inside-popover":""}," Очистити всі ")])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Bb,[e.unref(b)===""?(e.openBlock(),e.createElementBlock("div",Sb,[...y[8]||(y[8]=[e.createElementVNode("p",{class:"text-sm"},"Select a field to start creating a filter.",-1)])])):e.createCommentVNode("",!0),e.unref(b)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[c.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Object.entries(c.value),([f,E])=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(b)===f?(e.openBlock(),e.createBlock(Ct,e.mergeProps({key:f,layout:"popover",ref_for:!0,ref_key:"filterRef",ref:h},{ref_for:!0},E,{onChange:y[1]||(y[1]=N=>e.unref(p)(N.name,N.value)),onClear:y[2]||(y[2]=N=>{e.unref(k)(N),e.unref(p)(N,void 0)}),modelValue:e.unref(d)[f],"onUpdate:modelValue":N=>e.unref(d)[f]=N,cleanable:!0}),null,16,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(w),(f,E)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"slot-"+E},[e.unref(b)===f.props.name?(e.openBlock(),e.createBlock(Ct,e.mergeProps({key:0,layout:"popover"},{ref_for:!0},f.props,{ref_for:!0,ref_key:"filterRef",ref:h,onChange:y[3]||(y[3]=N=>e.unref(p)(N.name,N.value)),onClear:y[4]||(y[4]=N=>{e.unref(k)(N),e.unref(p)(N,void 0)}),modelValue:e.unref(d)[f.props.name],"onUpdate:modelValue":N=>e.unref(d)[f.props.name]=N,cleanable:!0}),null,16,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],64))),128))],64)):e.createCommentVNode("",!0)])])]),_:1}))}}),Ab={class:"flex gap-1 items-center flex-wrap"},ar=e.defineComponent({__name:"inline-filter-layout",props:{schema:{},view:{},value:{},history:{type:Boolean},mode:{},limit:{default:3}},emits:["change","clear","clearAll"],setup(l,{expose:t,emit:a}){const n=It(),r=l,o=a,i=e.useSlots(),s=e.ref({}),c=e.computed(()=>Object.keys(r.schema).length>r.limit),{activeFilter:d,activeFilterCount:u,onFilterChange:p,clearFilter:k,clearAllFilters:m,limitedSchema:w,filtersSlot:b,limitedFiltersSlot:h}=oa({...r,schema:s,slots:i},o),g=e.ref();function x(){g.value&&g.value.clearAllFilters(!0),m()}return e.watch(()=>r.schema,y=>{s.value=y},{deep:!0,immediate:!0}),t({clearFilter:k,clearAllFilters:m}),(y,f)=>(e.openBlock(),e.createElementBlock("div",Ab,[l.schema?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Object.entries(e.unref(w)),([E,N])=>(e.openBlock(),e.createBlock(Ct,e.mergeProps({key:E,mode:l.mode},{ref_for:!0},N,{onChange:f[0]||(f[0]=V=>e.unref(p)(V.name,V.value)),onClear:e.unref(k),layout:"inline",cleanable:!0,modelValue:e.unref(d)[E],"onUpdate:modelValue":V=>e.unref(d)[E]=V}),null,16,["mode","onClear","modelValue","onUpdate:modelValue"]))),128)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),(E,N)=>(e.openBlock(),e.createBlock(Ct,e.mergeProps({key:"slot-"+N,layout:"inline"},{ref_for:!0},E.props,{onChange:f[1]||(f[1]=V=>e.unref(p)(V.name,V.value)),onClear:f[2]||(f[2]=V=>{e.unref(k)(V),e.unref(p)(V,void 0)}),cleanable:!0,modelValue:e.unref(d)[E.props.name],"onUpdate:modelValue":V=>e.unref(d)[E.props.name]=V}),null,16,["modelValue","onUpdate:modelValue"]))),128)),c.value?(e.openBlock(),e.createBlock(lr,e.mergeProps({key:1},r,{schema:l.schema,limit:l.limit,onChange:f[3]||(f[3]=E=>e.unref(p)(E.name,E.value)),onClearAll:f[4]||(f[4]=E=>e.unref(m)()),onClear:f[5]||(f[5]=E=>e.unref(k)(E.name)),mode:l.mode,ref_key:"popoverRef",ref:g,cleanable:!0}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(b),(E,N)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(E),e.mergeProps({key:"slot-"+N,layout:"popover"},{ref_for:!0},E.props,{cleanable:!0}),null,16))),128))]),_:1},16,["schema","limit","mode"])):e.createCommentVNode("",!0),e.unref(u)>0?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:x,class:"relative py-2 px-3 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 border border-transparent text-gray-800 hover:bg-gray-200 focus:bg-gray-200"},e.toDisplayString(e.unref(n)("filter.clear")),1)):e.createCommentVNode("",!0)]))}}),Db={key:0,class:"p-2 overflow-y-auto overflow-hidden [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-800 max-h-[calc(100%-142px)] h-full bg-gray-100"},Lb={class:"flex items-center vst-filters vsTailwind flex-col w-full"},Mb=e.defineComponent({__name:"vertical-filter-layout",props:{schema:{},view:{},value:{},history:{type:Boolean},mode:{},limit:{default:3}},emits:["change","clear","clearAll"],setup(l,{expose:t,emit:a}){const n=l,r=a,o=e.useSlots(),{activeFilter:i,activeFilterCount:s,onFilterChange:c,clearFilter:d,clearAllFilters:u,filtersSlot:p}=oa({...n,slots:o},r);return t({clearFilter:d,clearAllFilters:u}),(k,m)=>l.view==="vertical"?(e.openBlock(),e.createElementBlock("div",Db,[e.createElementVNode("div",Lb,[e.unref(s)>0?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:m[0]||(m[0]=w=>e.unref(u)()),"data-popover-trigger":"","aria-haspopup":"dialog","aria-expanded":"false",class:"w-full ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:text-accent-foreground border h-10 px-4 py-2 gap-2 m-2 bg-white text-gray-800 hover:bg-gray-200 focus:bg-gray-200",type:"button"}," Очистити ")):e.createCommentVNode("",!0),l.schema?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Object.entries(l.schema),([w,b])=>(e.openBlock(),e.createBlock(Ct,e.mergeProps({layout:"vertical"},{ref_for:!0},b,{onChange:m[1]||(m[1]=h=>e.unref(c)(h.name,h.value)),onClear:m[2]||(m[2]=h=>{e.unref(d)(h),e.unref(c)(h,void 0)}),modelValue:e.unref(i)[w],"onUpdate:modelValue":h=>e.unref(i)[w]=h,showClean:!0}),null,16,["modelValue","onUpdate:modelValue"]))),256)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(p),(w,b)=>(e.openBlock(),e.createBlock(Ct,e.mergeProps({key:"slot-"+b,layout:"vertical"},{ref_for:!0},w.props,{onChange:m[3]||(m[3]=h=>e.unref(c)(h.name,h.value)),onClear:m[4]||(m[4]=h=>{e.unref(d)(h),e.unref(c)(h,void 0)}),modelValue:e.unref(i)[w.props.name],"onUpdate:modelValue":h=>e.unref(i)[w.props.name]=h,showClean:!0}),null,16,["modelValue","onUpdate:modelValue"]))),128))])])):e.createCommentVNode("",!0)}}),sa=e.defineComponent({__name:"filter",props:{schema:{},view:{default:"inline"},value:{},history:{type:Boolean},mode:{},limit:{default:3}},emits:["change","clear","clearAll"],setup(l,{expose:t,emit:a}){const n=l,r=e.ref(n.value??{}),o=a,i=e.ref();function s(b){if(Array.isArray(b))return b.map(h=>s(h));if(b!==null&&typeof b=="object"){const h=e.toRaw(b),g={};for(const x in h)g[x]=s(h[x]);return g}return b}function c(b,h){h!==void 0?r.value={...r.value,[b]:h}:delete r.value[b],o("change",{data:s(r.value),name:b,value:s(h)})}function d(b){delete r.value[b],o("clear",{data:s(r.value),name:b}),o("change",{data:s(r.value),name:b,value:null})}function u(){r.value={},o("clear",{data:s(r.value),name:"ALL"}),o("change",{data:s(r.value),name:"ALL",value:null})}const p=e.ref({});function k(){switch(n.view){case"inline":return ar;case"vertical":return Mb;case"popover":return lr;default:return ar}}e.watch(()=>n.schema,b=>{if(!b){p.value={};return}if(Array.isArray(b)&&!b.length){p.value={};return}Array.isArray(b)?p.value=b.filter(h=>h.type).reduce((h,g)=>(Object.assign(g,{name:g.id||g.name,type:{datepicker:"date"}[g.type.toLowerCase()]||g.type.toLowerCase(),label:g.label||g.ua}),h[g.name]=g,g.data&&!g.api&&!g.options&&Object.assign(g,{api:`/api/suggest/${g.data}`}),h),{}):(Object.entries(b).forEach(([h,g])=>{Object.assign(g,{name:h||g.name||g.id,type:g.type.toLowerCase()})}),p.value={...b})},{immediate:!0,deep:!0});function m(b){i.value.clearFilter(b),d(b)}function w(){i.value.clearAllFilters(),u()}return e.watch(()=>r.value,b=>{if(n.history){const h=new URL(window.location.href),g=new URLSearchParams(window.location.search);Object.keys(b).length>0?g.set("filter",Object.entries(b).filter(([,x])=>x).map(([x,y])=>`${x}=${y}`).join("|")):g.delete("filter"),h.search=decodeURI(g.toString()),window.history.pushState({},"",h)}}),t({clearAllFilters:w,clearFilter:m}),(b,h)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(k()),e.mergeProps(n,{schema:p.value,onChange:h[0]||(h[0]=g=>c(g.name,g.value)),onClear:h[1]||(h[1]=g=>d(g.name)),onClearAll:u,ref_key:"filterRef",ref:i}),{default:e.withCtx(()=>[e.renderSlot(b.$slots,"default")]),_:3},16,["schema"]))}});sa.install=function(l){l.component("Filter",sa),l.component("FilterField",Ct)};const Tb={class:"flex items-center space-x-1 mb-4"},Fb=["onClick"],Ib={key:1,class:"flex gap-x-1 items-center px-2 py-1 rounded text-sm font-medium text-slate-700 dark:text-slate-300"},Ob=e.defineComponent({__name:"CollectionsBreadcrumb",props:{items:{}},emits:["navigate"],setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",Tb,[e.createElementVNode("button",{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 hover:bg-blue-100 dark:hover:bg-blue-900/30",onClick:a[0]||(a[0]=n=>t.$emit("navigate","collections"))},[e.createVNode(e.unref(St),{class:"w-3 h-3"}),e.createTextVNode(" "+e.toDisplayString(t.$t("navigation.collections")),1)]),t.items.length>0?(e.openBlock(),e.createBlock(e.unref(Jt),{key:0,class:"w-3 h-3 text-slate-400 dark:text-slate-500"})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[r<t.items.length-1?(e.openBlock(),e.createElementBlock("button",{key:0,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 hover:bg-blue-100 dark:hover:bg-blue-900/30",onClick:o=>t.$emit("navigate",n.route)},e.toDisplayString(n.label),9,Fb)):(e.openBlock(),e.createElementBlock("span",Ib,e.toDisplayString(n.label),1)),r<t.items.length-1?(e.openBlock(),e.createBlock(e.unref(Jt),{key:2,class:"w-3 h-3 text-slate-400 dark:text-slate-500"})):e.createCommentVNode("",!0)],64))),128))]))}}),$b={class:"space-y-6 max-w-7xl mx-auto"},vb={class:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between"},Rb={class:"flex items-center gap-2"},Pb={class:"text-3xl font-bold text-slate-800 dark:text-white mb-2"},Ub=["href","title"],jb={key:0,class:"text-card-foreground shadow-lg border-0 bg-white/80 dark:bg-slate-800/80 backdrop-blur-sm"},zb={key:0,class:"p-2 border-b border-gray-200 sm:px-4 sm:py-2 dark:border-gray-700"},Hb={class:"flex flex-col gap-4 sm:flex-row"},Kb={class:"relative flex items-center gap-2 ml-auto"},Gb={key:1,class:"absolute top-full right-1/2 translate-x-1/2 min-w-full p-4 z-10 bg-white border border-gray-300 rounded-md mt-2 dark:bg-slate-800 dark:border-slate-700"},Wb={class:"max-h-60 overflow-y-auto overflow-x-hidden"},Yb={key:1},qb=e.defineComponent({__name:"ArticlesPage",setup(l){const t=di(),a=Mt(),n=e.ref(null),r=e.ref(""),{t:o,locale:i}=qe(),s=e.ref([]),c=e.inject("menu")||[],d=e.ref(""),u=e.ref(1),p=e.ref(!1),k=e.ref(["title","slug","author","publish_at","published_at","status"]),m=e.ref([]),w=e.ref([]),b=e.ref([]),h=e.ref({}),g=e.ref(0),x=e.ref(!1),y=()=>{var I;let F=(I=n.value)==null?void 0:I.columns.filter(T=>{var Y;return(Y=k==null?void 0:k.value)==null?void 0:Y.includes(T.name)});m.value=F.map(T=>{switch(T.name){case"title":return{...T,title:T.name?T.name.charAt(0).toUpperCase()+T.name.slice(1):"--",icon:Qt};case"slug":return{...T,title:T.name?T.name.charAt(0).toUpperCase()+T.name.slice(1):"-",icon:_r};case"author":return{...T,title:T.name?T.name.charAt(0).toUpperCase()+T.name.slice(1):"-",icon:Vr};case"publish_at":return{...T,title:T.name?T.name.charAt(0).toUpperCase()+T.name.slice(1):"-",icon:_l};case"published_at":return{...T,title:T.name?T.name.charAt(0).toUpperCase()+T.name.slice(1):"-",icon:_l};default:return{...T,title:T.name?T.name.charAt(0).toUpperCase()+T.name.slice(1):"-"}}}),p.value=!1},f=e.computed(()=>{var F;return(F=c.value.find(I=>I.id===t.params.id))==null?void 0:F.title}),E=e.computed(()=>[{label:f.value||t.params.id,route:`collections/${t.params.id}`}]),N=F=>{F==="collections"?a.push("/collections"):a.push(`/${F}`)},V=()=>{a.push(`/collections/${t.params.id}/create`)},$=async F=>{console.log("handleRemoveArticle"),Td({title:o("builder.deleteTitle"),message:o("builder.deleteObject"),type:"error",onConfirm:async()=>{await fetch(`/api/cms/${t.params.id}/${F.id}`,{method:"DELETE"}),H()}})},K=F=>{a.push(`/collections/${t.params.id}/${F.id}`)},H=async()=>{if(!x.value){x.value=!0;try{const I=await(await fetch(`/api/cms/${t.params.id}?page=${u.value}&filter=${d.value}`)).json();s.value=I.rows||[],n.value=I;const T=(I.filters||[]).map(Y=>{const{extra:J,title:pe,..._e}=Y;return _e});b.value=T,t.params.id==="pages"&&k.value.push("type"),v(),y()}finally{x.value=!1}}},v=()=>{var I;if(!((I=n.value)!=null&&I.columns))return;const F=n.value.columns.map((T,Y)=>({text:T.label,id:T.name}));w.value=[...k.value.map(T=>F.find(Y=>Y.id===T)).filter(Boolean),...F.filter(T=>!k.value.includes(T.id))]},W=(F,I)=>{if(!I)return!0;const T=I.toLowerCase();return m.value.some(Y=>{const J=F[Y.name];return J&&J.toString().toLowerCase().includes(T)})},le=F=>{const I=Object.entries(F==null?void 0:F.data).filter(([,Y])=>Y!=null).map(([Y,J])=>`${Y}=${J}`).join("|");d.value=I;const T={...t.query};I?T.filter=I:delete T.filter,a.replace({query:T})},P=()=>{if(t.query.filter){d.value=t.query.filter;const F=t.query.filter.split("|"),I={};F.forEach(T=>{const[Y,J]=T.split("=");Y&&J&&(I[Y]=J)}),h.value=I}else d.value="",h.value={},g.value++};return e.onMounted(()=>{P(),H()}),e.watch(()=>t.params.id,()=>{h.value={},d.value="",b.value=[];const F={...t.query};delete F.filter,a.replace({query:F}),g.value++,P(),H()}),e.watch(()=>t.query,async()=>{P(),await e.nextTick(),H()},{deep:!0}),e.watch(u,async()=>{t.query.filter||(d.value="",h.value={},g.value++),await e.nextTick(),H()}),(F,I)=>{var T,Y,J;return e.openBlock(),e.createElementBlock("div",$b,[e.createVNode(Ob,{items:E.value,onNavigate:N},null,8,["items"]),e.createElementVNode("div",vb,[e.createElementVNode("div",Rb,[e.createElementVNode("h1",Pb,e.toDisplayString(f.value),1),e.createElementVNode("a",{href:`https://cms.opengis.info/${e.unref(i)}/guides/content/`,target:"_blank",title:F.$t("guide.content")},[e.createVNode(e.unref($t),{class:"w-5 h-5"})],8,Ub)]),s.value.length?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:V,class:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium h-9 px-4 py-2 bg-blue-600 text-white shadow-md transition-all duration-200 transform hover:bg-blue-700 hover:shadow-lg hover:scale-105 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"},[e.createVNode(e.unref(Nl),{class:"w-4 h-4 mr-2"}),e.createTextVNode(" "+e.toDisplayString(F.$t("articles.createArticle")),1)])):e.createCommentVNode("",!0)]),s.value.length||d.value.length?(e.openBlock(),e.createElementBlock("div",jb,[(e.openBlock(),e.createElementBlock("div",zb,[e.createElementVNode("div",Hb,[(e.openBlock(),e.createBlock(e.unref(sa),{key:g.value,schema:b.value,history:!0,value:h.value,view:"inline",onChange:le},null,8,["schema","value"])),e.createElementVNode("div",Kb,[w.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"flex items-center gap-2 cursor-pointer text-sm border border-gray-300 rounded-md p-2 dark:text-white",onClick:I[0]||(I[0]=pe=>p.value=!p.value)},[e.createElementVNode("p",null,e.toDisplayString(F.$t("articles.showColumns")),1),e.createVNode(e.unref(wr),{class:"w-4 h-4"})])):e.createCommentVNode("",!0),w.value.length>0&&p.value?(e.openBlock(),e.createElementBlock("div",Gb,[e.createElementVNode("div",Wb,[w.value.length>0&&p.value?(e.openBlock(),e.createBlock(e.unref(Mn),{key:0,options:w.value,modelValue:k.value,"onUpdate:modelValue":I[1]||(I[1]=pe=>k.value=pe)},null,8,["options","modelValue"])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{class:"text-sm bg-blue-600 text-white rounded-md p-2 mt-4 w-full",onClick:y},e.toDisplayString(F.$t("articles.update")),1)])):e.createCommentVNode("",!0)])])])),m.value.length>0?(e.openBlock(),e.createBlock(Bn,{key:1,class:"max-h-[calc(100vh-270px)] overflow-y-auto",rows:s.value,columns:m.value,query:r.value,filterFn:W,onDelete:$,onEdit:K},null,8,["rows","columns","query"])):e.createCommentVNode("",!0),((T=n.value)==null?void 0:T.total)>20?(e.openBlock(),e.createBlock(Sn,{key:2,total:(Y=n.value)==null?void 0:Y.filtered,count:(J=n.value)==null?void 0:J.count,page:u.value,"onUpdate:page":I[2]||(I[2]=pe=>u.value=pe),limit:20},null,8,["total","count","page"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Yb,[e.createVNode(Nn,{onAction:V})]))])}}}),Xb={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},Zb={__name:"CreateForm",setup(l){const t=e.inject("fetchContentTypes"),{t:a}=qe(),n=Mt(),r=e.ref({}),o=e.ref(!1),i=e.ref({type:"collection"}),s={name:{type:"text",label:a("builder.scheme.name.label"),required:!0,placeholder:a("builder.scheme.name.placeholder"),validators:["required"]},title:{type:"text",label:a("builder.scheme.title.label"),required:!0,placeholder:a("builder.scheme.title.placeholder"),validators:["required"]},type:{type:"combobox",mode:"combo",label:a("builder.scheme.type.label"),required:!0,placeholder:a("builder.scheme.type.placeholder"),validators:["required"],options:[{text:a("builder.scheme.type.options.collection"),id:"collection"},{text:a("builder.scheme.type.options.single"),id:"single"}]},customTable:{type:"switcher",label:a("builder.scheme.customTable.label")}},c=async()=>{if(await r.value.validate()){ke({type:"warning",title:a("common.actions.warning"),message:a("collections.collectionCreationFailed")});return}try{const p=await(await fetch("/api/cms-type",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i.value)})).json();n.push(`/settings/collections/edit/${p.id}`),t(),ke({type:"success",title:a("common.actions.success"),message:a("collections.collectionCreated")})}catch(u){ke({type:"error",title:a("common.actions.error"),message:a("collections.collectionCreationFailed")}),console.error(u)}};return(d,u)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{onClick:u[0]||(u[0]=p=>o.value=!0),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 h-9 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white shadow-md hover:shadow-lg transition-all duration-200 transform hover:scale-105"},[e.createVNode(e.unref(Nl),{class:"w-4 h-4 mr-2"}),e.createTextVNode(" "+e.toDisplayString(d.$t("collections.createCollection")),1)]),e.createVNode(e.unref(pl),{teleport:"#modal",visible:o.value,title:d.$t("collections.createCollection"),onClose:u[4]||(u[4]=p=>o.value=!1)},{footer:e.withCtx(()=>[e.createElementVNode("div",Xb,[e.createElementVNode("button",{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",onClick:u[3]||(u[3]=p=>o.value=!1)},e.toDisplayString(d.$t("common.actions.cancel")),1),e.createElementVNode("button",{onClick:c,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"},e.toDisplayString(d.$t("common.actions.save")),1)])]),default:e.withCtx(()=>[e.createVNode(e.unref(Ft),{form:r.value,"onUpdate:form":u[1]||(u[1]=p=>r.value=p),modelValue:i.value,"onUpdate:modelValue":u[2]||(u[2]=p=>i.value=p),schema:s},null,8,["form","modelValue"])]),_:1},8,["visible","title"])]))}};let Jb;function Qb(){return Jb}e.version[0];function e1(l){return typeof l=="function"?l():e.unref(l)}function ia(l){if(l instanceof Promise||l instanceof Date||l instanceof RegExp)return l;const t=e1(l);if(!l||!t)return t;if(Array.isArray(t))return t.map(a=>ia(a));if(typeof t=="object"){const a={};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(n==="titleTemplate"||n[0]==="o"&&n[1]==="n"){a[n]=e.unref(t[n]);continue}a[n]=ia(t[n])}return a}return t}const t1="usehead",nr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},rr="__unhead_injection_handler__";function l1(){if(rr in nr)return nr[rr]();const l=e.inject(t1);return!l&&process.env.NODE_ENV!=="production"&&console.warn("Unhead is missing Vue context, falling back to shared context. This may have unexpected results."),l||Qb()}function a1(l,t={}){const a=t.head||l1();if(a)return a.ssr?a.push(l,t):n1(a,l,t)}function n1(l,t,a={}){const n=e.ref(!1),r=e.ref({});e.watchEffect(()=>{r.value=n.value?{}:ia(t)});const o=l.push(r.value,a);return e.watch(r,s=>{o.patch(s)}),e.getCurrentInstance()&&(e.onBeforeUnmount(()=>{o.dispose()}),e.onDeactivated(()=>{n.value=!0}),e.onActivated(()=>{n.value=!1})),o}function r1(l,t=300){const a=e.ref(l.value);let n;return e.watch(l,r=>{clearTimeout(n),n=setTimeout(()=>{a.value=r},t)},{immediate:!0}),a}const or=(l,t)=>{const a=l.__vccOpts||l;for(const[n,r]of t)a[n]=r;return a},o1={},s1={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"};function i1(l,t){return e.openBlock(),e.createElementBlock("svg",s1,[...t[0]||(t[0]=[e.createStaticVNode('<line x1="8" x2="21" y1="6" y2="6"></line><line x1="8" x2="21" y1="12" y2="12"></line><line x1="8" x2="21" y1="18" y2="18"></line><line x1="3" x2="3.01" y1="6" y2="6"></line><line x1="3" x2="3.01" y1="12" y2="12"></line><line x1="3" x2="3.01" y1="18" y2="18"></line>',6)])])}const c1=or(o1,[["render",i1]]),d1={},u1={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function p1(l,t){return e.openBlock(),e.createElementBlock("svg",u1,[...t[0]||(t[0]=[e.createStaticVNode('<rect width="18" height="18" x="3" y="3" rx="2"></rect><path d="M3 9h18"></path><path d="M3 15h18"></path><path d="M9 3v18"></path><path d="M15 3v18"></path>',5)])])}const m1=or(d1,[["render",p1]]),f1={class:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6 pb-6"},h1={class:"flex items-center gap-2 space-y-1.5 p-6 border-b border-slate-200 dark:border-slate-700 bg-gradient-to-r from-slate-50 dark:from-slate-800 to-white dark:to-slate-800"},g1={class:"line-clamp-1 tracking-tight text-lg font-semibold text-slate-800 dark:text-slate-100 vertical-center"},k1={class:"w-full flex flex-col gap-2 p-6"},y1=["title"],b1={class:"flex items-center justify-between gap-2"},x1={class:"text-sm text-slate-600 dark:text-slate-400"},w1={class:"font-semibold text-slate-800 dark:text-slate-100"},E1={class:"flex items-center justify-between gap-2"},_1={class:"text-sm text-slate-500 dark:text-slate-400"},C1={class:"font-semibold text-slate-800 dark:text-slate-100"},V1={class:"flex items-center justify-between gap-2"},N1={class:"text-sm text-slate-500 dark:text-slate-400"},B1={class:"text-sm text-slate-600 dark:text-slate-300"},S1={class:"flex items-center justify-between gap-2 mt-6"},A1=["onClick"],D1={class:"text-slate-800 dark:text-slate-200 group-hover:text-green-600 dark:group-hover:text-blue-50"},L1=["onClick"],M1=["onClick"],T1=e.defineComponent({__name:"CollectionsGrid",props:{collections:{},onEdit:{type:Function},onView:{type:Function},onDelete:{type:Function}},emits:["edit","view","delete"],setup(l,{emit:t}){e.ref(!1),e.ref(null);const a=l,n=t,r=(s,c)=>{switch(s){case"edit":n("edit",c),a.onEdit&&a.onEdit(c);break;case"view":n("view",c),a.onView&&a.onView(c);break;case"delete":n("delete",c),a.onDelete&&a.onDelete(c);break}},o=s=>{const c=new Date,d=new Date(s),u=c.getTime()-d.getTime(),p=Math.floor(u/1e3),k=Math.floor(p/60),m=Math.floor(k/60),w=Math.floor(m/24),b=Math.floor(w/7);return b>=2?`${b} weeks ago`:b===1?"1 week ago":w>=2?`${w} days ago`:w===1?"1 day ago":m>=2?`${m} hours ago`:m===1?"1 hour ago":k>=2?`${k} minutes ago`:k===1?"1 minute ago":"just now"},i=s=>{switch(s){case"published":return{icon:fa,text:"Published",classes:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-200 border-green-200 dark:border-green-700"};case"draft":return{icon:el,text:"Draft",classes:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-200 border-yellow-200 dark:border-yellow-700"};case"archived":return{icon:ba,text:"Archived",classes:"bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-300 border-gray-200 dark:border-gray-700"};default:return{icon:$t,text:"--",classes:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-200 border-yellow-200 dark:border-yellow-700"}}};return(s,c)=>(e.openBlock(),e.createElementBlock("div",f1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.collections,d=>{var u,p,k;return e.openBlock(),e.createElementBlock("div",{key:d.id,class:"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:bg-slate-50"},[e.createElementVNode("div",h1,[d.type==="single"?(e.openBlock(),e.createBlock(e.unref(Vl),{key:0,class:"shrink-0 lucide lucide-page w-5 h-5 text-blue-600"})):(e.openBlock(),e.createBlock(e.unref(St),{key:1,class:"shrink-0 lucide lucide-layers w-5 h-5 text-blue-600"})),e.createElementVNode("p",g1,e.toDisplayString(d.title),1),i(d.status)?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["whitespace-nowrap rounded-md border ml-auto px-2.5 py-0.5 text-xs font-semibold transition-colors hover:bg-secondary/80 flex items-center w-fit bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-300 dark:border-green-700",(u=i(d.status))==null?void 0:u.classes])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent((p=i(d.status))==null?void 0:p.icon),{class:"w-3 h-3 mr-1"})),e.createTextVNode(" "+e.toDisplayString((k=i(d.status))==null?void 0:k.text),1)],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",k1,[e.createElementVNode("p",{class:"text-slate-600 dark:text-slate-300 mb-4 line-clamp-2",title:d.description},e.toDisplayString(d.description!==null?d.description:"No description"),9,y1),e.createElementVNode("div",b1,[e.createElementVNode("p",x1,e.toDisplayString(s.$t("collections.entries"))+":",1),e.createElementVNode("p",w1,e.toDisplayString(d.entries),1)]),e.createElementVNode("div",E1,[e.createElementVNode("p",_1,e.toDisplayString(s.$t("collections.fields"))+":",1),e.createElementVNode("p",C1,e.toDisplayString(d.fields),1)]),e.createElementVNode("div",V1,[e.createElementVNode("p",N1,e.toDisplayString(s.$t("collections.lastModified"))+":",1),e.createElementVNode("p",B1,e.toDisplayString(o(d.last_edit)),1)]),e.createElementVNode("div",S1,[e.renderSlot(s.$slots,"actions",{collection:d,handleAction:r},()=>[e.createElementVNode("button",{class:"inline-flex gap-1 items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-4/5 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-green-50 hover:border-green-300",onClick:e.withModifiers(m=>r("edit",d),["stop"])},[e.createVNode(e.unref(el),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-green-600 dark:group-hover:text-blue-50"}),e.createElementVNode("span",D1,e.toDisplayString(s.$t("common.actions.edit")),1)],8,A1),e.createElementVNode("button",{class:e.normalizeClass([d.id==="pages"?"disabled":"","inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-red-50 hover:border-red-300"]),onClick:e.withModifiers(m=>d.id==="pages"?null:r("delete",d),["stop"])},[e.createVNode(e.unref(ya),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-red-600 dark:group-hover:text-blue-50"})],10,L1),e.createElementVNode("button",{class:e.normalizeClass([d.type==="single"?"disabled cursor-not-allowed":"","inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-blue-50 hover:border-blue-300"]),onClick:e.withModifiers(m=>d.type==="single"?null:r("view",d),["stop"])},[e.createVNode(e.unref(ga),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-blue-600 dark:group-hover:text-blue-50"})],10,M1)])])])])}),128))]))}}),ca=localStorage.getItem("collectionView"),yl=e.ref(ca==="list"||ca==="grid"?ca:"list");e.watch(yl,l=>{localStorage.setItem("collectionView",l)});function F1(){yl.value=yl.value==="grid"?"list":"grid"}function I1(){return{collectionView:yl,toggleCollectionView:F1}}const O1={class:"space-y-6 max-w-7xl mx-auto"},$1={class:"flex items-center justify-between mb-8"},v1={class:"flex gap-4"},R1={class:"text-3xl font-bold text-slate-800 dark:text-slate-100 mb-2"},P1={class:"text-slate-600 dark:text-slate-300"},U1=["href","title"],j1={class:"flex items-center gap-3"},z1={class:"relative"},H1={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},K1=["placeholder"],G1={class:"flex items-center bg-white dark:bg-slate-700 border border-slate-200 dark:border-slate-600 rounded-lg p-1 max-w-[fit-content]"},W1=["onClick"],Y1=e.defineComponent({__name:"BuilderPage",setup(l){const{t,locale:a}=qe(),n=Mt(),r=[{name:"name",title:t("builder.collectionName"),type:"text",icon:St},{name:"title",title:t("builder.title"),type:"text",icon:St},{name:"description",title:t("common.description"),type:"text"},{name:"entries",title:t("builder.entries"),type:"number"},{name:"fields",title:t("builder.fields"),type:"number"},{name:"status",title:t("builder.status"),type:"text"},{name:"last_edit",title:t("builder.lastModified"),type:"date"}],o=e.ref(""),i=r1(o,300);a1({title:()=>t("collections.title")+" | CMS"});const s=e.ref([]),c=e.inject("fetchContentTypes"),d=e.ref(1),u=e.ref(16),p=e.ref(null),{collectionView:k,toggleCollectionView:m}=I1();async function w(){try{const y=i.value?`&search=${encodeURIComponent(String(i.value))}`:"",f=`/api/cms-type?page=${d.value}&limit=${u.value}${y}`;console.log("Fetching collections with URL:",f);const E=await fetch(f);if(!E.ok)throw new Error("Failed to fetch collections");const N=await E.json();console.log("Collections fetched:",N),s.value=N.rows,p.value=N}catch(y){console.error("Error fetching collections:",y)}}e.onMounted(()=>{w()});const b=e.computed(()=>[...s.value].sort((f,E)=>f.id==="pages"?-1:E.id==="pages"?1:0)),h=async y=>{try{await fetch(`/api/cms-type/${y.id}`,{method:"DELETE"}),w(),c()}catch(f){console.error("Error deleting collection:",f)}},g=y=>{n.push(`/settings/collections/edit/${y.id||y.name}`)},x=y=>{y.type==="single"?n.push(`/collections/single/${y.name}`):n.push(`/collections/${y.name}`)};return e.watch(d,()=>{w()}),e.watch(i,y=>{console.log("Search query changed:",y),d.value=1,w()}),(y,f)=>{var E,N,V,$;return e.openBlock(),e.createElementBlock("div",O1,[e.createElementVNode("div",$1,[e.createElementVNode("div",v1,[e.createElementVNode("div",null,[e.createElementVNode("h1",R1,e.toDisplayString(y.$t("builder.collections")),1),e.createElementVNode("p",P1,e.toDisplayString(y.$t("builder.manageContentCollections")),1)]),e.createElementVNode("a",{href:`https://cms.opengis.info/${e.unref(a)}/guides/collections/`,target:"_blank",title:y.$t("guide.collections"),class:"mt-2"},[e.createVNode(e.unref($t),{class:"w-5 h-5"})],8,U1)]),e.createElementVNode("div",j1,[e.createElementVNode("div",z1,[e.createElementVNode("div",H1,[e.createVNode(e.unref(ka),{class:"w-5 h-5 text-gray-400"})]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"block w-full py-2 pl-10 pr-3 leading-5 text-gray-900 placeholder-gray-500 transition-colors bg-white border border-gray-300 rounded-md dark:border-gray-600 dark:bg-gray-700 dark:placeholder-gray-400 focus:outline-none focus:ring-sky-500 focus:border-sky-500 dark:text-white sm:text-sm",placeholder:y.$t("builder.searchCollections"),"onUpdate:modelValue":f[0]||(f[0]=K=>o.value=K)},null,8,K1),[[e.vModelText,o.value]])]),e.createElementVNode("div",G1,[e.createElementVNode("button",{class:e.normalizeClass(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors rounded-md text-xs h-8 w-8 p-0 hover:bg-blue-700 hover:text-white cursor-pointer",{"bg-blue-600 text-white":e.unref(k)==="list"}]),onClick:f[1]||(f[1]=K=>k.value="list")},[e.createVNode(c1,{class:"dark:text-blue-50 w-4 h-4"})],2),e.createElementVNode("button",{class:e.normalizeClass(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors rounded-md text-xs h-8 w-8 p-0 hover:bg-blue-700 hover:text-white cursor-pointer",{"bg-blue-600 text-white":e.unref(k)==="grid"}]),onClick:f[2]||(f[2]=K=>k.value="grid")},[e.createVNode(m1,{class:"dark:text-blue-50 w-4 h-4"})],2)]),e.createVNode(Zb)])]),e.createElementVNode("div",null,[e.unref(k)==="list"?(e.openBlock(),e.createBlock(Bn,{key:0,class:"max-h-[calc(100vh-270px)] overflow-y-auto overflow-x-hidden",columns:r,rows:b.value,onDelete:h,onEdit:g,onView:x},{actions:e.withCtx(({row:K})=>[e.createElementVNode("button",{class:"inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-blue-50 hover:border-blue-300 hover:text-blue-600",onClick:H=>x(K)},[e.createVNode(e.unref(ga),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-blue-600 dark:group-hover:text-blue-50"})],8,W1)]),_:1},8,["rows"])):e.createCommentVNode("",!0),e.unref(k)==="grid"?(e.openBlock(),e.createBlock(T1,{key:1,collections:b.value,onEdit:g,onView:x,onDelete:h,class:"max-h-[calc(100vh-270px)] overflow-y-auto overflow-x-hidden"},null,8,["collections"])):e.createCommentVNode("",!0),((E=p.value)==null?void 0:E.total)>16?(e.openBlock(),e.createBlock(Sn,{key:2,total:(N=p.value)==null?void 0:N.filtered,count:((V=p.value)==null?void 0:V.count)||(($=p.value)==null?void 0:$.total),page:d.value,"onUpdate:page":f[3]||(f[3]=K=>d.value=K),limit:u.value},null,8,["total","count","page","limit"])):e.createCommentVNode("",!0)])])}}});function q1(l){l.component("Dashboard",Xl)}function kt(l){return typeof l=="string"||l instanceof String}function sr(l){var t;return typeof l=="object"&&l!=null&&(l==null||(t=l.constructor)==null?void 0:t.name)==="Object"}function ir(l,t){return Array.isArray(t)?ir(l,(a,n)=>t.includes(n)):Object.entries(l).reduce((a,n)=>{let[r,o]=n;return t(o,r)&&(a[r]=o),a},{})}const Q={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function cr(l){switch(l){case Q.LEFT:return Q.FORCE_LEFT;case Q.RIGHT:return Q.FORCE_RIGHT;default:return l}}function da(l){return l.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function bl(l,t){if(t===l)return!0;const a=Array.isArray(t),n=Array.isArray(l);let r;if(a&&n){if(t.length!=l.length)return!1;for(r=0;r<t.length;r++)if(!bl(t[r],l[r]))return!1;return!0}if(a!=n)return!1;if(t&&l&&typeof t=="object"&&typeof l=="object"){const o=t instanceof Date,i=l instanceof Date;if(o&&i)return t.getTime()==l.getTime();if(o!=i)return!1;const s=t instanceof RegExp,c=l instanceof RegExp;if(s&&c)return t.toString()==l.toString();if(s!=c)return!1;const d=Object.keys(t);for(r=0;r<d.length;r++)if(!Object.prototype.hasOwnProperty.call(l,d[r]))return!1;for(r=0;r<d.length;r++)if(!bl(l[d[r]],t[d[r]]))return!1;return!0}else if(t&&l&&typeof t=="function"&&typeof l=="function")return t.toString()===l.toString();return!1}class X1{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?Q.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?Q.RIGHT:Q.LEFT}}function ae(l,t){return new ae.InputMask(l,t)}function dr(l){if(l==null)throw new Error("mask property should be defined");return l instanceof RegExp?ae.MaskedRegExp:kt(l)?ae.MaskedPattern:l===Date?ae.MaskedDate:l===Number?ae.MaskedNumber:Array.isArray(l)||l===Array?ae.MaskedDynamic:ae.Masked&&l.prototype instanceof ae.Masked?l:ae.Masked&&l instanceof ae.Masked?l.constructor:l instanceof Function?ae.MaskedFunction:(console.warn("Mask not found for mask",l),ae.Masked)}function Ot(l){if(!l)throw new Error("Options in not defined");if(ae.Masked){if(l.prototype instanceof ae.Masked)return{mask:l};const{mask:t=void 0,...a}=l instanceof ae.Masked?{mask:l}:sr(l)&&l.mask instanceof ae.Masked?l:{};if(t){const n=t.mask;return{...ir(t,(r,o)=>!o.startsWith("_")),mask:t.constructor,_mask:n,...a}}}return sr(l)?{...l}:{mask:l}}function et(l){if(ae.Masked&&l instanceof ae.Masked)return l;const t=Ot(l),a=dr(t.mask);if(!a)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===a&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new a(t)}ae.createMask=et;class xl{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return t??this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return t??this.value.length}select(t,a){if(!(t==null||a==null||t===this.selectionStart&&a===this.selectionEnd))try{this._unsafeSelect(t,a)}catch{}}get isActive(){return!1}}ae.MaskElement=xl;const ur=90,Z1=89;class Kt extends xl{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,a,n;return(t=(a=(n=this.input).getRootNode)==null?void 0:a.call(n))!=null?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){if(this._handlers.redo&&(t.keyCode===ur&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===Z1&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===ur&&(t.metaKey||t.ctrlKey))return t.preventDefault(),this._handlers.undo(t);t.isComposing||this._handlers.selectionChange(t)}_onBeforeinput(t){if(t.inputType==="historyUndo"&&this._handlers.undo)return t.preventDefault(),this._handlers.undo(t);if(t.inputType==="historyRedo"&&this._handlers.redo)return t.preventDefault(),this._handlers.redo(t)}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}ae.HTMLMaskElement=Kt;class pr extends Kt{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,a){this.input.setSelectionRange(t,a)}get value(){return this.input.value}set value(t){this.input.value=t}}ae.HTMLMaskElement=Kt;class ua extends Kt{get _unsafeSelectionStart(){const t=this.rootElement,a=t.getSelection&&t.getSelection(),n=a&&a.anchorOffset,r=a&&a.focusOffset;return r==null||n==null||n<r?n:r}get _unsafeSelectionEnd(){const t=this.rootElement,a=t.getSelection&&t.getSelection(),n=a&&a.anchorOffset,r=a&&a.focusOffset;return r==null||n==null||n>r?n:r}_unsafeSelect(t,a){if(!this.rootElement.createRange)return;const n=this.rootElement.createRange();n.setStart(this.input.firstChild||this.input,t),n.setEnd(this.input.lastChild||this.input,a);const r=this.rootElement,o=r.getSelection&&r.getSelection();o&&(o.removeAllRanges(),o.addRange(n))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}ae.HTMLContenteditableMaskElement=ua;class wl{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>wl.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}wl.MAX_LENGTH=100;class mr{constructor(t,a){this.el=t instanceof xl?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new ua(t):new pr(t),this.masked=et(a),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new wl,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var a;return t==null||((a=this.masked)==null?void 0:a.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof ae.Masked)&&this.masked.constructor===dr(t)){this.masked.updateOptions({mask:t});return}const a=t instanceof ae.Masked?t:et({mask:t});a.unmaskedValue=this.masked.unmaskedValue,this.masked=a}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,a){const n=this._listeners[t];n&&n.forEach(r=>r(a))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){!this.el||!this.el.isActive||(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const a=this.masked.unmaskedValue,n=this.masked.value,r=this.masked.rawInputValue,o=this.displayValue,i=this.unmaskedValue!==a||this.value!==n||this._rawInputValue!==r;this._unmaskedValue=a,this._value=n,this._rawInputValue=r,this.el.value!==o&&(this.el.value=o),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),i&&this._fireChangeEvents(),!this._historyChanging&&(i||this.history.isEmpty)&&this.history.push({unmaskedValue:a,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:a,...n}=t,r=!this.maskEquals(a),o=this.masked.optionsIsChanged(n);r&&(this.mask=a),o&&this.masked.updateOptions(n),(r||o)&&this.updateControl()}updateCursor(t){t!=null&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,Q.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,a){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(a),this}off(t,a){if(!this._listeners[t])return this;if(!a)return delete this._listeners[t],this;const n=this._listeners[t].indexOf(a);return n>=0&&this._listeners[t].splice(n,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const a=new X1({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),n=this.masked.rawInputValue,r=this.masked.splice(a.startChangePos,a.removed.length,a.inserted,a.removeDirection,{input:!0,raw:!0}).offset,o=n===this.masked.rawInputValue?a.removeDirection:Q.NONE;let i=this.masked.nearestInputPos(a.startChangePos+r,o);o!==Q.NONE&&(i=this.masked.nearestInputPos(i,Q.NONE)),this.updateControl(i),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}ae.InputMask=mr;class ne{static normalize(t){return Array.isArray(t)?t:[t,new ne]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}ae.ChangeDetails=ne;class tt{constructor(t,a,n){t===void 0&&(t=""),a===void 0&&(a=0),this.value=t,this.from=a,this.stop=n}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||t!=null&&this.from>=t)return"";const a=this.value[0];return this.value=this.value.slice(1),a}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class De{constructor(t){this._value="",this._update({...De.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,a){a===void 0&&(a={input:!0}),this.reset(),this.append(t,a,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,a){return t}totalInputPositions(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),Math.min(this.displayValue.length,a-t)}extractInput(t,a,n){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),this.displayValue.slice(t,a)}extractTail(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),new tt(this.extractInput(t,a),t)}appendTail(t){return kt(t)&&(t=new tt(String(t))),t.appendTo(this)}_appendCharRaw(t,a){return t?(this._value+=t,new ne({inserted:t,rawInserted:t})):new ne}_appendChar(t,a,n){a===void 0&&(a={});const r=this.state;let o;if([t,o]=this.doPrepareChar(t,a),t&&(o=o.aggregate(this._appendCharRaw(t,a)),!o.rawInserted&&this.autofix==="pad")){const i=this.state;this.state=r;let s=this.pad(a);const c=this._appendCharRaw(t,a);s=s.aggregate(c),c.rawInserted||s.equals(o)?o=s:this.state=i}if(o.inserted){let i,s=this.doValidate(a)!==!1;if(s&&n!=null){const c=this.state;if(this.overwrite===!0){i=n.state;for(let u=0;u<o.rawInserted.length;++u)n.unshift(this.displayValue.length-o.tailShift)}let d=this.appendTail(n);if(s=d.rawInserted.length===n.toString().length,!(s&&d.inserted)&&this.overwrite==="shift"){this.state=c,i=n.state;for(let u=0;u<o.rawInserted.length;++u)n.shift();d=this.appendTail(n),s=d.rawInserted.length===n.toString().length}s&&d.inserted&&(this.state=c)}s||(o=new ne,this.state=r,n&&i&&(n.state=i))}return o}_appendPlaceholder(){return new ne}_appendEager(){return new ne}append(t,a,n){if(!kt(t))throw new Error("value should be string");const r=kt(n)?new tt(String(n)):n;a!=null&&a.tail&&(a._beforeTailState=this.state);let o;[t,o]=this.doPrepare(t,a);for(let i=0;i<t.length;++i){const s=this._appendChar(t[i],a,r);if(!s.rawInserted&&!this.doSkipInvalid(t[i],a,r))break;o.aggregate(s)}return(this.eager===!0||this.eager==="append")&&a!=null&&a.input&&t&&o.aggregate(this._appendEager()),r!=null&&(o.tailShift+=this.appendTail(r).tailShift),o}remove(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(a),new ne}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const a=this.rawInputValue,n=this.value,r=t();return this.rawInputValue=a,this.value&&this.value!==n&&n.indexOf(this.value)===0&&(this.append(n.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,r}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const a=this.state,n=t(this);return this.state=a,delete this._isolated,n}doSkipInvalid(t,a,n){return!!this.skipInvalid}doPrepare(t,a){return a===void 0&&(a={}),ne.normalize(this.prepare?this.prepare(t,this,a):t)}doPrepareChar(t,a){return a===void 0&&(a={}),ne.normalize(this.prepareChar?this.prepareChar(t,this,a):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,a,n,r,o){n===void 0&&(n=""),r===void 0&&(r=Q.NONE),o===void 0&&(o={input:!0});const i=t+a,s=this.extractTail(i),c=this.eager===!0||this.eager==="remove";let d;c&&(r=cr(r),d=this.extractInput(0,i,{raw:!0}));let u=t;const p=new ne;if(r!==Q.NONE&&(u=this.nearestInputPos(t,a>1&&t!==0&&!c?Q.NONE:r),p.tailShift=u-t),p.aggregate(this.remove(u)),c&&r!==Q.NONE&&d===this.rawInputValue)if(r===Q.FORCE_LEFT){let k;for(;d===this.rawInputValue&&(k=this.displayValue.length);)p.aggregate(new ne({tailShift:-1})).aggregate(this.remove(k-1))}else r===Q.FORCE_RIGHT&&s.unshift();return p.aggregate(this.append(n,o,s))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!bl(this,t)}typedValueEquals(t){const a=this.typedValue;return t===a||De.EMPTY_VALUES.includes(t)&&De.EMPTY_VALUES.includes(a)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new ne}}De.DEFAULTS={skipInvalid:!0},De.EMPTY_VALUES=[void 0,null,""],ae.Masked=De;class yt{constructor(t,a){t===void 0&&(t=[]),a===void 0&&(a=0),this.chunks=t,this.from=a}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=kt(t)?new tt(String(t)):t;const a=this.chunks[this.chunks.length-1],n=a&&(a.stop===t.stop||t.stop==null)&&t.from===a.from+a.toString().length;if(t instanceof tt)n?a.extend(t.toString()):this.chunks.push(t);else if(t instanceof yt){if(t.stop==null){let r;for(;t.chunks.length&&t.chunks[0].stop==null;)r=t.chunks.shift(),r.from+=t.from,this.extend(r)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof ae.MaskedPattern))return new tt(this.toString()).appendTo(t);const a=new ne;for(let n=0;n<this.chunks.length;++n){const r=this.chunks[n],o=t._mapPosToBlock(t.displayValue.length),i=r.stop;let s;if(i!=null&&(!o||o.index<=i)&&((r instanceof yt||t._stops.indexOf(i)>=0)&&a.aggregate(t._appendPlaceholder(i)),s=r instanceof yt&&t._blocks[i]),s){const c=s.appendTail(r);a.aggregate(c);const d=r.toString().slice(c.rawInserted.length);d&&a.aggregate(t.append(d,{tail:!0}))}else a.aggregate(t.append(r.toString(),{tail:!0}))}return a}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:a,...n}=t;Object.assign(this,n),this.chunks=a.map(r=>{const o="chunks"in r?new yt:new tt;return o.state=r,o})}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";const a=t!=null?t-this.from:t;let n=0;for(;n<this.chunks.length;){const r=this.chunks[n],o=r.unshift(a);if(r.toString()){if(!o)break;++n}else this.chunks.splice(n,1);if(o)return o}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const a=this.chunks[t],n=a.shift();if(a.toString()){if(!n)break;--t}else this.chunks.splice(t,1);if(n)return n}return""}}class J1{constructor(t,a){this.masked=t,this._log=[];const{offset:n,index:r}=t._mapPosToBlock(a)||(a<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=n,this.index=r,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((a=this.block)==null?void 0:a.displayValue.length)||0){var a;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Q.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Q.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Q.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Q.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Q.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Q.NONE),!0})}}class pa{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,a){return t===void 0&&(t=0),a===void 0&&(a=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(a),this._value||(this._isRawInput=!1),new ne}nearestInputPos(t,a){a===void 0&&(a=Q.NONE);const n=0,r=this._value.length;switch(a){case Q.LEFT:case Q.FORCE_LEFT:return n;case Q.NONE:case Q.RIGHT:case Q.FORCE_RIGHT:default:return r}}totalInputPositions(t,a){return t===void 0&&(t=0),a===void 0&&(a=this._value.length),this._isRawInput?a-t:0}extractInput(t,a,n){return t===void 0&&(t=0),a===void 0&&(a=this._value.length),n===void 0&&(n={}),n.raw&&this._isRawInput&&this._value.slice(t,a)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(t,a){if(a===void 0&&(a={}),this.isFilled)return new ne;const n=this.eager===!0||this.eager==="append",r=this.char===t&&(this.isUnmasking||a.input||a.raw)&&(!a.raw||!n)&&!a.tail,o=new ne({inserted:this.char,rawInserted:r?this.char:""});return this._value=this.char,this._isRawInput=r&&(a.raw||a.input),o}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new ne;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new tt("")}appendTail(t){return kt(t)&&(t=new tt(String(t))),t.appendTo(this)}append(t,a,n){const r=this._appendChar(t[0],a);return n!=null&&(r.tailShift+=this.appendTail(n).tailShift),r}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=!!t._rawInputValue}pad(t){return this._appendPlaceholder()}}class Gt{constructor(t){const{parent:a,isOptional:n,placeholderChar:r,displayChar:o,lazy:i,eager:s,...c}=t;this.masked=et(c),Object.assign(this,{parent:a,isOptional:n,placeholderChar:r,displayChar:o,lazy:i,eager:s})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.value.length),t===0&&a>=1?(this.isFilled=!1,this.masked.remove(t,a)):new ne}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(t,a){if(a===void 0&&(a={}),this.isFilled)return new ne;const n=this.masked.state;let r=this.masked._appendChar(t,this.currentMaskFlags(a));return r.inserted&&this.doValidate(a)===!1&&(r=new ne,this.masked.state=n),!r.inserted&&!this.isOptional&&!this.lazy&&!a.input&&(r.inserted=this.placeholderChar),r.skip=!r.inserted&&!this.isOptional,this.isFilled=!!r.inserted,r}append(t,a,n){return this.masked.append(t,this.currentMaskFlags(a),n)}_appendPlaceholder(){return this.isFilled||this.isOptional?new ne:(this.isFilled=!0,new ne({inserted:this.placeholderChar}))}_appendEager(){return new ne}extractTail(t,a){return this.masked.extractTail(t,a)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,a,n){return t===void 0&&(t=0),a===void 0&&(a=this.value.length),this.masked.extractInput(t,a,n)}nearestInputPos(t,a){a===void 0&&(a=Q.NONE);const n=0,r=this.value.length,o=Math.min(Math.max(t,n),r);switch(a){case Q.LEFT:case Q.FORCE_LEFT:return this.isComplete?o:n;case Q.RIGHT:case Q.FORCE_RIGHT:return this.isComplete?o:r;case Q.NONE:default:return o}}totalInputPositions(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.value.length),this.value.slice(t,a).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var a;return{...t,_beforeTailState:(t==null||(a=t._beforeTailState)==null?void 0:a.masked)||(t==null?void 0:t._beforeTailState)}}pad(t){return new ne}}Gt.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class fr extends De{updateOptions(t){super.updateOptions(t)}_update(t){const a=t.mask;a&&(t.validate=n=>n.search(a)>=0),super._update(t)}}ae.MaskedRegExp=fr;class Le extends De{constructor(t){super({...Le.DEFAULTS,...t,definitions:Object.assign({},Gt.DEFAULT_DEFINITIONS,t==null?void 0:t.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const a=this.mask;if(!a||!t)return;let n=!1,r=!1;for(let o=0;o<a.length;++o){if(this.blocks){const d=a.slice(o),u=Object.keys(this.blocks).filter(k=>d.indexOf(k)===0);u.sort((k,m)=>m.length-k.length);const p=u[0];if(p){const{expose:k,repeat:m,...w}=Ot(this.blocks[p]),b={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...w,repeat:m,parent:this},h=m!=null?new ae.RepeatBlock(b):et(b);h&&(this._blocks.push(h),k&&(this.exposeBlock=h),this._maskedBlocks[p]||(this._maskedBlocks[p]=[]),this._maskedBlocks[p].push(this._blocks.length-1)),o+=p.length-1;continue}}let i=a[o],s=i in t;if(i===Le.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(i==="{"||i==="}"){n=!n;continue}if(i==="["||i==="]"){r=!r;continue}if(i===Le.ESCAPE_CHAR){if(++o,i=a[o],!i)break;s=!1}const c=s?new Gt({isOptional:r,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...Ot(t[i]),parent:this}):new pa({char:i,eager:this.eager,isUnmasking:n});this._blocks.push(c)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t){this.reset();return}const{_blocks:a,...n}=t;this._blocks.forEach((r,o)=>r.state=a[o]),super.state=n}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,a)=>t+=a.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const a=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(a),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,a)=>t+=a.value,"")}set value(t){if(this.exposeBlock){const a=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(a),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const a=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(a),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,a)=>t+=a.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const a=new ne;let n=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(n==null)return a;this._blocks[n].isFilled&&++n;for(let r=n;r<this._blocks.length;++r){const o=this._blocks[r]._appendEager();if(!o.inserted)break;a.aggregate(o)}return a}_appendCharRaw(t,a){a===void 0&&(a={});const n=this._mapPosToBlock(this.displayValue.length),r=new ne;if(!n)return r;for(let i=n.index,s;s=this._blocks[i];++i){var o;const c=s._appendChar(t,{...a,_beforeTailState:(o=a._beforeTailState)==null||(o=o._blocks)==null?void 0:o[i]});if(r.aggregate(c),c.consumed)break}return r}extractTail(t,a){t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length);const n=new yt;return t===a||this._forEachBlocksInRange(t,a,(r,o,i,s)=>{const c=r.extractTail(i,s);c.stop=this._findStopBefore(o),c.from=this._blockStartPos(o),c instanceof yt&&(c.blockIndex=o),n.extend(c)}),n}extractInput(t,a,n){if(t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),n===void 0&&(n={}),t===a)return"";let r="";return this._forEachBlocksInRange(t,a,(o,i,s,c)=>{r+=o.extractInput(s,c,n)}),r}_findStopBefore(t){let a;for(let n=0;n<this._stops.length;++n){const r=this._stops[n];if(r<=t)a=r;else break}return a}_appendPlaceholder(t){const a=new ne;if(this.lazy&&t==null)return a;const n=this._mapPosToBlock(this.displayValue.length);if(!n)return a;const r=n.index,o=t??this._blocks.length;return this._blocks.slice(r,o).forEach(i=>{if(!i.lazy||t!=null){var s;a.aggregate(i._appendPlaceholder((s=i._blocks)==null?void 0:s.length))}}),a}_mapPosToBlock(t){let a="";for(let n=0;n<this._blocks.length;++n){const r=this._blocks[n],o=a.length;if(a+=r.displayValue,t<=a.length)return{index:n,offset:t-o}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((a,n)=>a+=n.displayValue.length,0)}_forEachBlocksInRange(t,a,n){a===void 0&&(a=this.displayValue.length);const r=this._mapPosToBlock(t);if(r){const o=this._mapPosToBlock(a),i=o&&r.index===o.index,s=r.offset,c=o&&i?o.offset:this._blocks[r.index].displayValue.length;if(n(this._blocks[r.index],r.index,s,c),o&&!i){for(let d=r.index+1;d<o.index;++d)n(this._blocks[d],d,0,this._blocks[d].displayValue.length);n(this._blocks[o.index],o.index,0,o.offset)}}}remove(t,a){t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length);const n=super.remove(t,a);return this._forEachBlocksInRange(t,a,(r,o,i,s)=>{n.aggregate(r.remove(i,s))}),n}nearestInputPos(t,a){if(a===void 0&&(a=Q.NONE),!this._blocks.length)return 0;const n=new J1(this,t);if(a===Q.NONE)return n.pushRightBeforeInput()||(n.popState(),n.pushLeftBeforeInput())?n.pos:this.displayValue.length;if(a===Q.LEFT||a===Q.FORCE_LEFT){if(a===Q.LEFT){if(n.pushRightBeforeFilled(),n.ok&&n.pos===t)return t;n.popState()}if(n.pushLeftBeforeInput(),n.pushLeftBeforeRequired(),n.pushLeftBeforeFilled(),a===Q.LEFT){if(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.ok&&n.pos<=t||(n.popState(),n.ok&&n.pos<=t))return n.pos;n.popState()}return n.ok?n.pos:a===Q.FORCE_LEFT?0:(n.popState(),n.ok||(n.popState(),n.ok)?n.pos:0)}return a===Q.RIGHT||a===Q.FORCE_RIGHT?(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.pushRightBeforeFilled()?n.pos:a===Q.FORCE_RIGHT?this.displayValue.length:(n.popState(),n.ok||(n.popState(),n.ok)?n.pos:this.nearestInputPos(t,Q.LEFT))):t}totalInputPositions(t,a){t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length);let n=0;return this._forEachBlocksInRange(t,a,(r,o,i,s)=>{n+=r.totalInputPositions(i,s)}),n}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const a=this._maskedBlocks[t];return a?a.map(n=>this._blocks[n]):[]}pad(t){const a=new ne;return this._forEachBlocksInRange(0,this.displayValue.length,n=>a.aggregate(n.pad(t))),a}}Le.DEFAULTS={...De.DEFAULTS,lazy:!0,placeholderChar:"_"},Le.STOP_CHAR="`",Le.ESCAPE_CHAR="\\",Le.InputDefinition=Gt,Le.FixedDefinition=pa,ae.MaskedPattern=Le;class Wt extends Le{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:a=this.to||0,from:n=this.from||0,maxLength:r=this.maxLength||0,autofix:o=this.autofix,...i}=t;this.to=a,this.from=n,this.maxLength=Math.max(String(a).length,r),this.autofix=o;const s=String(this.from).padStart(this.maxLength,"0"),c=String(this.to).padStart(this.maxLength,"0");let d=0;for(;d<c.length&&c[d]===s[d];)++d;i.mask=c.slice(0,d).replace(/0/g,"\\0")+"0".repeat(this.maxLength-d),super._update(i)}get isComplete(){return super.isComplete&&!!this.value}boundaries(t){let a="",n="";const[,r,o]=t.match(/^(\D*)(\d*)(\D*)/)||[];return o&&(a="0".repeat(r.length)+o,n="9".repeat(r.length)+o),a=a.padEnd(this.maxLength,"0"),n=n.padEnd(this.maxLength,"9"),[a,n]}doPrepareChar(t,a){a===void 0&&(a={});let n;return[t,n]=super.doPrepareChar(t.replace(/\D/g,""),a),t||(n.skip=!this.isComplete),[t,n]}_appendCharRaw(t,a){if(a===void 0&&(a={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,a);const n=String(this.from).padStart(this.maxLength,"0"),r=String(this.to).padStart(this.maxLength,"0"),[o,i]=this.boundaries(this.value+t);return Number(i)<this.from?super._appendCharRaw(n[this.value.length],a):Number(o)>this.to?!a.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(n[this.value.length],a).aggregate(this._appendCharRaw(t,a)):super._appendCharRaw(r[this.value.length],a):super._appendCharRaw(t,a)}doValidate(t){const a=this.value;if(a.search(/[^0]/)===-1&&a.length<=this._matchFrom)return!0;const[n,r]=this.boundaries(a);return this.from<=Number(r)&&Number(n)<=this.to&&super.doValidate(t)}pad(t){const a=new ne;if(this.value.length===this.maxLength)return a;const n=this.value,r=this.maxLength-this.value.length;if(r){this.reset();for(let o=0;o<r;++o)a.aggregate(super._appendCharRaw("0",t));n.split("").forEach(o=>this._appendCharRaw(o))}return a}}ae.MaskedRange=Wt;const Q1="d{.}`m{.}`Y";class lt extends Le{static extractPatternOptions(t){const{mask:a,pattern:n,...r}=t;return{...r,mask:kt(a)?a:n}}constructor(t){super(lt.extractPatternOptions({...lt.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:a,pattern:n,blocks:r,...o}={...lt.DEFAULTS,...t},i=Object.assign({},lt.GET_DEFAULT_BLOCKS());t.min&&(i.Y.from=t.min.getFullYear()),t.max&&(i.Y.to=t.max.getFullYear()),t.min&&t.max&&i.Y.from===i.Y.to&&(i.m.from=t.min.getMonth()+1,i.m.to=t.max.getMonth()+1,i.m.from===i.m.to&&(i.d.from=t.min.getDate(),i.d.to=t.max.getDate())),Object.assign(i,this.blocks,r),super._update({...o,mask:kt(a)?a:n,blocks:i})}doValidate(t){const a=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&a!=null&&(this.min==null||this.min<=a)&&(this.max==null||a<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(lt.extractPatternOptions(t))}}lt.GET_DEFAULT_BLOCKS=()=>({d:{mask:Wt,from:1,to:31,maxLength:2},m:{mask:Wt,from:1,to:12,maxLength:2},Y:{mask:Wt,from:1900,to:9999}}),lt.DEFAULTS={...Le.DEFAULTS,mask:Date,pattern:Q1,format:(l,t)=>{if(!l)return"";const a=String(l.getDate()).padStart(2,"0"),n=String(l.getMonth()+1).padStart(2,"0"),r=l.getFullYear();return[a,n,r].join(".")},parse:(l,t)=>{const[a,n,r]=l.split(".").map(Number);return new Date(r,n-1,a)}},ae.MaskedDate=lt;class Yt extends De{constructor(t){super({...Yt.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(a=>{const{expose:n,...r}=Ot(a),o=et({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...r});return n&&(this.exposeMask=o),o}):[])}_appendCharRaw(t,a){a===void 0&&(a={});const n=this._applyDispatch(t,a);return this.currentMask&&n.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(a))),n}_applyDispatch(t,a,n){t===void 0&&(t=""),a===void 0&&(a={}),n===void 0&&(n="");const r=a.tail&&a._beforeTailState!=null?a._beforeTailState._value:this.value,o=this.rawInputValue,i=a.tail&&a._beforeTailState!=null?a._beforeTailState._rawInputValue:o,s=o.slice(i.length),c=this.currentMask,d=new ne,u=c==null?void 0:c.state;return this.currentMask=this.doDispatch(t,{...a},n),this.currentMask&&(this.currentMask!==c?(this.currentMask.reset(),i&&(this.currentMask.append(i,{raw:!0}),d.tailShift=this.currentMask.value.length-r.length),s&&(d.tailShift+=this.currentMask.append(s,{raw:!0,tail:!0}).tailShift)):u&&(this.currentMask.state=u)),d}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const a=new ne;return t&&a.aggregate(this._applyDispatch("",{},t)),a.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var a,n;return{...t,_beforeTailState:((a=t._beforeTailState)==null?void 0:a.currentMaskRef)===this.currentMask&&((n=t._beforeTailState)==null?void 0:n.currentMask)||t._beforeTailState}}doDispatch(t,a,n){return a===void 0&&(a={}),n===void 0&&(n=""),this.dispatch(t,this,a,n)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,a){a===void 0&&(a={});let[n,r]=super.doPrepare(t,a);if(this.currentMask){let o;[n,o]=super.doPrepare(n,this.currentMaskFlags(a)),r=r.aggregate(o)}return[n,r]}doPrepareChar(t,a){a===void 0&&(a={});let[n,r]=super.doPrepareChar(t,a);if(this.currentMask){let o;[n,o]=super.doPrepareChar(n,this.currentMaskFlags(a)),r=r.aggregate(o)}return[n,r]}reset(){var t;(t=this.currentMask)==null||t.reset(),this.compiledMasks.forEach(a=>a.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask){this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,this._applyDispatch();return}let a=String(t);this.currentMask&&(this.currentMask.typedValue=t,a=this.currentMask.unmaskedValue),this.unmaskedValue=a}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return!!((t=this.currentMask)!=null&&t.isComplete)}get isFilled(){var t;return!!((t=this.currentMask)!=null&&t.isFilled)}remove(t,a){const n=new ne;return this.currentMask&&n.aggregate(this.currentMask.remove(t,a)).aggregate(this._applyDispatch()),n}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(a=>a.state),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state}}set state(t){const{compiledMasks:a,currentMaskRef:n,currentMask:r,...o}=t;a&&this.compiledMasks.forEach((i,s)=>i.state=a[s]),n!=null&&(this.currentMask=n,this.currentMask.state=r),super.state=o}extractInput(t,a,n){return this.currentMask?this.currentMask.extractInput(t,a,n):""}extractTail(t,a){return this.currentMask?this.currentMask.extractTail(t,a):super.extractTail(t,a)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,a){return this.currentMask?this.currentMask.nearestInputPos(t,a):super.nearestInputPos(t,a)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((a,n)=>{if(!t[n])return;const{mask:r,...o}=t[n];return bl(a,o)&&a.maskEquals(r)}):super.maskEquals(t)}typedValueEquals(t){var a;return!!((a=this.currentMask)!=null&&a.typedValueEquals(t))}}Yt.DEFAULTS={...De.DEFAULTS,dispatch:(l,t,a,n)=>{if(!t.compiledMasks.length)return;const r=t.rawInputValue,o=t.compiledMasks.map((i,s)=>{const c=t.currentMask===i,d=c?i.displayValue.length:i.nearestInputPos(i.displayValue.length,Q.FORCE_LEFT);return i.rawInputValue!==r?(i.reset(),i.append(r,{raw:!0})):c||i.remove(d),i.append(l,t.currentMaskFlags(a)),i.appendTail(n),{index:s,weight:i.rawInputValue.length,totalInputPositions:i.totalInputPositions(0,Math.max(d,i.nearestInputPos(i.displayValue.length,Q.FORCE_LEFT)))}});return o.sort((i,s)=>s.weight-i.weight||s.totalInputPositions-i.totalInputPositions),t.compiledMasks[o[0].index]}},ae.MaskedDynamic=Yt;class qt extends Le{constructor(t){super({...qt.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:a,...n}=t;if(a){const r=a.map(s=>s.length),o=Math.min(...r),i=Math.max(...r)-o;n.mask="*".repeat(o),i&&(n.mask+="["+"*".repeat(i)+"]"),this.enum=a}super._update(n)}_appendCharRaw(t,a){a===void 0&&(a={});const n=Math.min(this.nearestInputPos(0,Q.FORCE_RIGHT),this.value.length),r=this.enum.filter(o=>this.matchValue(o,this.unmaskedValue+t,n));if(r.length){r.length===1&&this._forEachBlocksInRange(0,this.value.length,(i,s)=>{const c=r[0][s];s>=this.value.length||c===i.value||(i.reset(),i._appendChar(c,a))});const o=super._appendCharRaw(r[0][this.value.length],a);return r.length===1&&r[0].slice(this.unmaskedValue.length).split("").forEach(i=>o.aggregate(super._appendCharRaw(i))),o}return new ne({skip:!this.isComplete})}extractTail(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),new tt("",t)}remove(t,a){if(t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),t===a)return new ne;const n=Math.min(super.nearestInputPos(0,Q.FORCE_RIGHT),this.value.length);let r;for(r=t;r>=0&&!(this.enum.filter(i=>this.matchValue(i,this.value.slice(n,r),n)).length>1);--r);const o=super.remove(r,a);return o.tailShift+=r-t,o}get isComplete(){return this.enum.indexOf(this.value)>=0}}qt.DEFAULTS={...Le.DEFAULTS,matchValue:(l,t,a)=>l.indexOf(t,a)===a},ae.MaskedEnum=qt;class hr extends De{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}}ae.MaskedFunction=hr;var gr;class $e extends De{constructor(t){super({...$e.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),a="\\d*",n=(this.scale?"("+da(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+a+n),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(da).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(da(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const a=t.split(this.radix);return a[0]=a[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),a.join(this.radix)}doPrepareChar(t,a){a===void 0&&(a={});const[n,r]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(a.input&&a.raw||!a.input&&!a.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),a);return t&&!n&&(r.skip=!0),n&&!this.allowPositive&&!this.value&&n!=="-"&&r.aggregate(this._appendChar("-")),[n,r]}_separatorsCount(t,a){a===void 0&&(a=!1);let n=0;for(let r=0;r<t;++r)this._value.indexOf(this.thousandsSeparator,r)===r&&(++n,a&&(t+=this.thousandsSeparator.length));return n}_separatorsCountFromSlice(t){return t===void 0&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,a,n){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),[t,a]=this._adjustRangeWithSeparators(t,a),this._removeThousandsSeparators(super.extractInput(t,a,n))}_appendCharRaw(t,a){a===void 0&&(a={});const n=a.tail&&a._beforeTailState?a._beforeTailState._value:this._value,r=this._separatorsCountFromSlice(n);this._value=this._removeThousandsSeparators(this.value);const o=this._value;this._value+=t;const i=this.number;let s=!isNaN(i),c=!1;if(s){let k;this.min!=null&&this.min<0&&this.number<this.min&&(k=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(k=this.max),k!=null&&(this.autofix?(this._value=this.format(k,this).replace($e.UNMASKED_RADIX,this.radix),c||(c=o===this._value&&!a.tail)):s=!1),s&&(s=!!this._value.match(this._numberRegExp))}let d;s?d=new ne({inserted:this._value.slice(o.length),rawInserted:c?"":t,skip:c}):(this._value=o,d=new ne),this._value=this._insertThousandsSeparators(this._value);const u=a.tail&&a._beforeTailState?a._beforeTailState._value:this._value,p=this._separatorsCountFromSlice(u);return d.tailShift+=(p-r)*this.thousandsSeparator.length,d}_findSeparatorAround(t){if(this.thousandsSeparator){const a=t-this.thousandsSeparator.length+1,n=this.value.indexOf(this.thousandsSeparator,a);if(n<=t)return n}return-1}_adjustRangeWithSeparators(t,a){const n=this._findSeparatorAround(t);n>=0&&(t=n);const r=this._findSeparatorAround(a);return r>=0&&(a=r+this.thousandsSeparator.length),[t,a]}remove(t,a){t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),[t,a]=this._adjustRangeWithSeparators(t,a);const n=this.value.slice(0,t),r=this.value.slice(a),o=this._separatorsCount(n.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(n+r));const i=this._separatorsCountFromSlice(n);return new ne({tailShift:(i-o)*this.thousandsSeparator.length})}nearestInputPos(t,a){if(!this.thousandsSeparator)return t;switch(a){case Q.NONE:case Q.LEFT:case Q.FORCE_LEFT:{const n=this._findSeparatorAround(t-1);if(n>=0){const r=n+this.thousandsSeparator.length;if(t<r||this.value.length<=r||a===Q.FORCE_LEFT)return n}break}case Q.RIGHT:case Q.FORCE_RIGHT:{const n=this._findSeparatorAround(t);if(n>=0)return n+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let a=t;this.min!=null&&(a=Math.max(a,this.min)),this.max!=null&&(a=Math.min(a,this.max)),a!==t&&(this.unmaskedValue=this.format(a,this));let n=this.value;this.normalizeZeros&&(n=this._normalizeZeros(n)),this.padFractionalZeros&&this.scale>0&&(n=this._padFractionalZeros(n)),this._value=n}super.doCommit()}_normalizeZeros(t){const a=this._removeThousandsSeparators(t).split(this.radix);return a[0]=a[0].replace(/^(\D*)(0*)(\d*)/,(n,r,o,i)=>r+i),t.length&&!/\d$/.test(a[0])&&(a[0]=a[0]+"0"),a.length>1&&(a[1]=a[1].replace(/0*$/,""),a[1].length||(a.length=1)),this._insertThousandsSeparators(a.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const a=t.split(this.radix);return a.length<2&&a.push(""),a[1]=a[1].padEnd(this.scale,"0"),a.join(this.radix)}doSkipInvalid(t,a,n){a===void 0&&(a={});const r=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===$e.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,a,n)&&!r}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,$e.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace($e.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||$e.EMPTY_VALUES.includes(t)&&$e.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}}gr=$e,$e.UNMASKED_RADIX=".",$e.EMPTY_VALUES=[...De.EMPTY_VALUES,0],$e.DEFAULTS={...De.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[gr.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:l=>l.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},ae.MaskedNumber=$e;const El={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function ma(l,t,a){t===void 0&&(t=El.MASKED),a===void 0&&(a=El.MASKED);const n=et(l);return r=>n.runIsolated(o=>(o[t]=r,o[a]))}function kr(l,t,a,n){return ma(t,a,n)(l)}ae.PIPE_TYPE=El,ae.createPipe=ma,ae.pipe=kr;class yr extends Le{get repeatFrom(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?t:0}get repeatTo(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var a,n,r;const{repeat:o,...i}=Ot(t);this._blockOpts=Object.assign({},this._blockOpts,i);const s=et(this._blockOpts);this.repeat=(a=(n=o??s.repeat)!=null?n:this.repeat)!=null?a:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((r=this._blocks)==null?void 0:r.length)||0,this.repeatFrom)),blocks:{m:s},eager:s.eager,overwrite:s.overwrite,skipInvalid:s.skipInvalid,lazy:s.lazy,placeholderChar:s.placeholderChar,displayChar:s.displayChar})}_allocateBlock(t){if(t<this._blocks.length)return this._blocks[t];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(et(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,a){a===void 0&&(a={});const n=new ne;for(let c=(r=(o=this._mapPosToBlock(this.displayValue.length))==null?void 0:o.index)!=null?r:Math.max(this._blocks.length-1,0),d,u;d=(i=this._blocks[c])!=null?i:u=!u&&this._allocateBlock(c);++c){var r,o,i,s;const p=d._appendChar(t,{...a,_beforeTailState:(s=a._beforeTailState)==null||(s=s._blocks)==null?void 0:s[c]});if(p.skip&&u){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(n.aggregate(p),p.consumed)break}return n}_trimEmptyTail(t,a){var n,r;t===void 0&&(t=0);const o=Math.max(((n=this._mapPosToBlock(t))==null?void 0:n.index)||0,this.repeatFrom,0);let i;a!=null&&(i=(r=this._mapPosToBlock(a))==null?void 0:r.index),i==null&&(i=this._blocks.length-1);let s=0;for(let c=i;o<=c&&!this._blocks[c].unmaskedValue;--c,++s);s&&(this._blocks.splice(i-s+1,s),this.mask=this.mask.slice(s))}reset(){super.reset(),this._trimEmptyTail()}remove(t,a){t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length);const n=super.remove(t,a);return this._trimEmptyTail(t,a),n}totalInputPositions(t,a){return t===void 0&&(t=0),a==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,a)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}}ae.RepeatBlock=yr;try{globalThis.IMask=ae}catch{}const ex=Object.freeze(Object.defineProperty({__proto__:null,ChangeDetails:ne,ChunksTailDetails:yt,DIRECTION:Q,HTMLContenteditableMaskElement:ua,HTMLInputMaskElement:pr,HTMLMaskElement:Kt,InputMask:mr,MaskElement:xl,Masked:De,MaskedDate:lt,MaskedDynamic:Yt,MaskedEnum:qt,MaskedFunction:hr,MaskedNumber:$e,MaskedPattern:Le,MaskedRange:Wt,MaskedRegExp:fr,PIPE_TYPE:El,PatternFixedDefinition:pa,PatternInputDefinition:Gt,RepeatBlock:yr,createMask:et,createPipe:ma,default:ae,forceDirection:cr,normalizeOpts:Ot,pipe:kr},Symbol.toStringTag,{value:"Module"}));je.ArticlesPage=qb,je.BuilderPage=Y1,je.CollectionsPage=ec,je.Dashboard=Xl,je.default=Xl,je.install=q1,Object.defineProperties(je,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
186
|
+
*/const Yc="11.1.5";function Xc(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(ol().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(ol().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ol().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ol().__INTLIFY_PROD_DEVTOOLS__=!1)}const Ge={UNEXPECTED_RETURN_TYPE:uc,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:30,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_COMPATIBLE_LEGACY_VUE_I18N:33,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function Tl(l,...t){return yl(l,null,process.env.NODE_ENV!=="production"?{messages:Zc,args:t}:void 0)}const Zc={[Ge.UNEXPECTED_RETURN_TYPE]:"Unexpected return type in composer",[Ge.INVALID_ARGUMENT]:"Invalid argument",[Ge.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[Ge.NOT_INSTALLED]:"Need to install with `app.use` function",[Ge.UNEXPECTED_ERROR]:"Unexpected error",[Ge.REQUIRED_VALUE]:"Required in value: {0}",[Ge.INVALID_VALUE]:"Invalid value",[Ge.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:"Cannot setup vue-devtools plugin",[Ge.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[Ge.NOT_COMPATIBLE_LEGACY_VUE_I18N]:"Not compatible legacy VueI18n.",[Ge.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:"Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"},ir=It("__translateVNode"),cr=It("__datetimeParts"),dr=It("__numberParts"),ur=It("__enableEmitter"),pr=It("__disableEmitter"),Qc=It("__setPluralRules"),eo=It("__injectWithOption"),mr=It("__dispose"),Zt={FALLBACK_TO_ROOT:Vc,NOT_FOUND_PARENT_SCOPE:9,IGNORE_OBJ_FLATTEN:10,DEPRECATE_LEGACY_MODE:11,DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE:12},Jc={[Zt.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[Zt.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[Zt.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[Zt.DEPRECATE_LEGACY_MODE]:`Legacy API mode has been deprecated in v11. Use Composition API mode instead.
|
|
187
|
+
About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guide/advanced/composition.html`,[Zt.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE]:"'v-t' has been deprecated in v11. Use translate APIs ('t' or '$t') instead."};function fr(l,...t){return ta(Jc[l],...t)}function $l(l){if(!Ee(l)||_t(l))return l;for(const t in l)if(Et(l,t))if(!t.includes("."))Ee(l[t])&&$l(l[t]);else{const a=t.split("."),r=a.length-1;let n=l,o=!1;for(let s=0;s<r;s++){if(a[s]==="__proto__")throw new Error(`unsafe key: ${a[s]}`);if(a[s]in n||(n[a[s]]=ve()),!Ee(n[a[s]])){process.env.NODE_ENV!=="production"&&Gt(fr(Zt.IGNORE_OBJ_FLATTEN,{key:a[s]})),o=!0;break}n=n[a[s]]}if(o||(_t(n)?Cn.includes(a[r])||delete l[t]:(n[a[r]]=l[t],delete l[t])),!_t(n)){const s=n[a[r]];Ee(s)&&$l(s)}}return l}function to(l,t){const{messages:a,__i18n:r,messageResolver:n,flatJson:o}=t,s=_e(a)?a:Oe(r)?ve():{[l]:ve()};if(Oe(r)&&r.forEach(i=>{if("locale"in i&&"resource"in i){const{locale:c,resource:u}=i;c?(s[c]=s[c]||ve(),na(u,s[c])):na(u,s)}else ae(i)&&na(JSON.parse(i),s)}),n==null&&o)for(const i in s)Et(s,i)&&$l(s[i]);return s}function lo(l){return l.type}function ed(l,t,a){let r=Ee(t.messages)?t.messages:ve();"__i18nGlobal"in a&&(r=to(l.locale.value,{messages:r,__i18n:a.__i18nGlobal}));const n=Object.keys(r);n.length&&n.forEach(o=>{l.mergeLocaleMessage(o,r[o])});{if(Ee(t.datetimeFormats)){const o=Object.keys(t.datetimeFormats);o.length&&o.forEach(s=>{l.mergeDateTimeFormat(s,t.datetimeFormats[s])})}if(Ee(t.numberFormats)){const o=Object.keys(t.numberFormats);o.length&&o.forEach(s=>{l.mergeNumberFormat(s,t.numberFormats[s])})}}}function ao(l){return e.createVNode(e.Text,null,l,0)}const ro="__INTLIFY_META__",no=()=>[],td=()=>!1;let oo=0;function so(l){return(t,a,r,n)=>l(a,r,e.getCurrentInstance()||void 0,n)}const ld=()=>{const l=e.getCurrentInstance();let t=null;return l&&(t=lo(l)[ro])?{[ro]:t}:null};function ad(l={}){const{__root:t,__injectWithOption:a}=l,r=t===void 0,n=l.flatJson,o=Ft?e.ref:e.shallowRef;let s=Pe(l.inheritLocale)?l.inheritLocale:!0;const i=o(t&&s?t.locale.value:ae(l.locale)?l.locale:ca),c=o(t&&s?t.fallbackLocale.value:ae(l.fallbackLocale)||Oe(l.fallbackLocale)||_e(l.fallbackLocale)||l.fallbackLocale===!1?l.fallbackLocale:i.value),u=o(to(i.value,l)),d=o(_e(l.datetimeFormats)?l.datetimeFormats:{[i.value]:{}}),p=o(_e(l.numberFormats)?l.numberFormats:{[i.value]:{}});let m=t?t.missingWarn:Pe(l.missingWarn)||la(l.missingWarn)?l.missingWarn:!0,f=t?t.fallbackWarn:Pe(l.fallbackWarn)||la(l.fallbackWarn)?l.fallbackWarn:!0,g=t?t.fallbackRoot:Pe(l.fallbackRoot)?l.fallbackRoot:!0,y=!!l.fallbackFormat,w=Me(l.missing)?l.missing:null,h=Me(l.missing)?so(l.missing):null,k=Me(l.postTranslation)?l.postTranslation:null,x=t?t.warnHtmlMessage:Pe(l.warnHtmlMessage)?l.warnHtmlMessage:!0,b=!!l.escapeParameter;const _=t?t.modifiers:_e(l.modifiers)?l.modifiers:{};let V=l.pluralRules||t&&t.pluralRules,E;E=(()=>{r&&In(null);const j={version:Yc,locale:i.value,fallbackLocale:c.value,messages:u.value,modifiers:_,pluralRules:V,missing:h===null?void 0:h,missingWarn:m,fallbackWarn:f,fallbackFormat:y,unresolving:!0,postTranslation:k===null?void 0:k,warnHtmlMessage:x,escapeParameter:b,messageResolver:l.messageResolver,messageCompiler:l.messageCompiler,__meta:{framework:"vue"}};j.datetimeFormats=d.value,j.numberFormats=p.value,j.__datetimeFormatters=_e(E)?E.__datetimeFormatters:void 0,j.__numberFormatters=_e(E)?E.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(j.__v_emitter=_e(E)?E.__v_emitter:void 0);const G=$c(j);return r&&In(G),G})(),Ml(E,i.value,c.value);function $(){return[i.value,c.value,u.value,d.value,p.value]}const C=e.computed({get:()=>i.value,set:j=>{E.locale=j,i.value=j}}),B=e.computed({get:()=>c.value,set:j=>{E.fallbackLocale=j,c.value=j,Ml(E,i.value,j)}}),M=e.computed(()=>u.value),U=e.computed(()=>d.value),P=e.computed(()=>p.value);function I(){return Me(k)?k:null}function O(j){k=j,E.postTranslation=j}function F(){return w}function H(j){j!==null&&(h=so(j)),w=j,E.missing=h}function Q(j,G){return j!=="translate"||!G.resolvedMessage}const pe=(j,G,ye,Be,N,T)=>{$();let K;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,r||(E.fallbackContext=t?Tc():void 0),K=j(E)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,r||(E.fallbackContext=void 0)}if(ye!=="translate exists"&&He(K)&&K===ia||ye==="translate exists"&&!K){const[W,J]=G();if(process.env.NODE_ENV!=="production"&&t&&ae(W)&&Q(ye,J)&&(g&&(ua(f,W)||Pn(m,W))&&Gt(fr(Zt.FALLBACK_TO_ROOT,{key:W,type:ye})),process.env.NODE_ENV!=="production")){const{__v_emitter:A}=E;A&&g&&A.emit("fallback",{type:ye,key:W,to:"global",groupId:`${ye}:${W}`})}return t&&g?Be(t):N(W)}else{if(T(K))return K;throw Tl(Ge.UNEXPECTED_RETURN_TYPE)}};function Ve(...j){return pe(G=>Reflect.apply(Zn,null,[G,...j]),()=>sr(...j),"translate",G=>Reflect.apply(G.t,G,[...j]),G=>G,G=>ae(G))}function ze(...j){const[G,ye,Be]=j;if(Be&&!Ee(Be))throw Tl(Ge.INVALID_ARGUMENT);return Ve(G,ye,Ke({resolvedMessage:!0},Be||{}))}function Kt(...j){return pe(G=>Reflect.apply(zn,null,[G,...j]),()=>nr(...j),"datetime format",G=>Reflect.apply(G.d,G,[...j]),()=>da,G=>ae(G)||Oe(G))}function Le(...j){return pe(G=>Reflect.apply(qn,null,[G,...j]),()=>or(...j),"number format",G=>Reflect.apply(G.n,G,[...j]),()=>da,G=>ae(G)||Oe(G))}function qe(j){return j.map(G=>ae(G)||He(G)||Pe(G)?ao(String(G)):G)}const yt={normalize:qe,interpolate:j=>j,type:"vnode"};function wt(...j){return pe(G=>{let ye;const Be=G;try{Be.processor=yt,ye=Reflect.apply(Zn,null,[Be,...j])}finally{Be.processor=null}return ye},()=>sr(...j),"translate",G=>G[ir](...j),G=>[ao(G)],G=>Oe(G))}function Lt(...j){return pe(G=>Reflect.apply(qn,null,[G,...j]),()=>or(...j),"number format",G=>G[dr](...j),no,G=>ae(G)||Oe(G))}function et(...j){return pe(G=>Reflect.apply(zn,null,[G,...j]),()=>nr(...j),"datetime format",G=>G[cr](...j),no,G=>ae(G)||Oe(G))}function at(j){V=j,E.pluralRules=V}function z(j,G){return pe(()=>{if(!j)return!1;const ye=ae(G)?G:i.value,Be=le(ye),N=E.messageResolver(Be,j);return _t(N)||bt(N)||ae(N)},()=>[j],"translate exists",ye=>Reflect.apply(ye.te,ye,[j,G]),td,ye=>Pe(ye))}function X(j){let G=null;const ye=vn(E,c.value,i.value);for(let Be=0;Be<ye.length;Be++){const N=u.value[ye[Be]]||{},T=E.messageResolver(N,j);if(T!=null){G=T;break}}return G}function te(j){const G=X(j);return G??(t?t.tm(j)||{}:{})}function le(j){return u.value[j]||{}}function de(j,G){if(n){const ye={[j]:G};for(const Be in ye)Et(ye,Be)&&$l(ye[Be]);G=ye[j]}u.value[j]=G,E.messages=u.value}function Se(j,G){u.value[j]=u.value[j]||{};const ye={[j]:G};if(n)for(const Be in ye)Et(ye,Be)&&$l(ye[Be]);G=ye[j],na(G,u.value[j]),E.messages=u.value}function v(j){return d.value[j]||{}}function S(j,G){d.value[j]=G,E.datetimeFormats=d.value,Kn(E,j,G)}function q(j,G){d.value[j]=Ke(d.value[j]||{},G),E.datetimeFormats=d.value,Kn(E,j,G)}function re(j){return p.value[j]||{}}function De(j,G){p.value[j]=G,E.numberFormats=p.value,Wn(E,j,G)}function Ae(j,G){p.value[j]=Ke(p.value[j]||{},G),E.numberFormats=p.value,Wn(E,j,G)}oo++,t&&Ft&&(e.watch(t.locale,j=>{s&&(i.value=j,E.locale=j,Ml(E,i.value,c.value))}),e.watch(t.fallbackLocale,j=>{s&&(c.value=j,E.fallbackLocale=j,Ml(E,i.value,c.value))}));const ge={id:oo,locale:C,fallbackLocale:B,get inheritLocale(){return s},set inheritLocale(j){s=j,j&&t&&(i.value=t.locale.value,c.value=t.fallbackLocale.value,Ml(E,i.value,c.value))},get availableLocales(){return Object.keys(u.value).sort()},messages:M,get modifiers(){return _},get pluralRules(){return V||{}},get isGlobal(){return r},get missingWarn(){return m},set missingWarn(j){m=j,E.missingWarn=m},get fallbackWarn(){return f},set fallbackWarn(j){f=j,E.fallbackWarn=f},get fallbackRoot(){return g},set fallbackRoot(j){g=j},get fallbackFormat(){return y},set fallbackFormat(j){y=j,E.fallbackFormat=y},get warnHtmlMessage(){return x},set warnHtmlMessage(j){x=j,E.warnHtmlMessage=j},get escapeParameter(){return b},set escapeParameter(j){b=j,E.escapeParameter=j},t:Ve,getLocaleMessage:le,setLocaleMessage:de,mergeLocaleMessage:Se,getPostTranslationHandler:I,setPostTranslationHandler:O,getMissingHandler:F,setMissingHandler:H,[Qc]:at};return ge.datetimeFormats=U,ge.numberFormats=P,ge.rt=ze,ge.te=z,ge.tm=te,ge.d=Kt,ge.n=Le,ge.getDateTimeFormat=v,ge.setDateTimeFormat=S,ge.mergeDateTimeFormat=q,ge.getNumberFormat=re,ge.setNumberFormat=De,ge.mergeNumberFormat=Ae,ge[eo]=a,ge[ir]=wt,ge[cr]=et,ge[dr]=Lt,process.env.NODE_ENV!=="production"&&(ge[ur]=j=>{E.__v_emitter=j},ge[pr]=()=>{E.__v_emitter=void 0}),ge}function io(l,t){}const hr={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:l=>l==="parent"||l==="global",default:"parent"},i18n:{type:Object}};function rd({slots:l},t){return t.length===1&&t[0]==="default"?(l.default?l.default():[]).reduce((r,n)=>[...r,...n.type===e.Fragment?n.children:[n]],[]):t.reduce((a,r)=>{const n=l[r];return n&&(a[r]=n()),a},ve())}function co(){return e.Fragment}Ke({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:l=>He(l)||!isNaN(l)}},hr);function nd(l){return Oe(l)&&!ae(l[0])}function uo(l,t,a,r){const{slots:n,attrs:o}=t;return()=>{const s={part:!0};let i=ve();l.locale&&(s.locale=l.locale),ae(l.format)?s.key=l.format:Ee(l.format)&&(ae(l.format.key)&&(s.key=l.format.key),i=Object.keys(l.format).reduce((m,f)=>a.includes(f)?Ke(ve(),m,{[f]:l.format[f]}):m,ve()));const c=r(l.value,s,i);let u=[s.key];Oe(c)?u=c.map((m,f)=>{const g=n[m.type],y=g?g({[m.type]:m.value,index:f,parts:c}):[m.value];return nd(y)&&(y[0].key=`${m.type}-${f}`),y}):ae(c)&&(u=[c]);const d=Ke(ve(),o),p=ae(l.tag)||Ee(l.tag)?l.tag:co();return e.h(p,d,u)}}Ke({value:{type:Number,required:!0},format:{type:[String,Object]}},hr);const od=It("global-vue-i18n");function Re(l={}){const t=e.getCurrentInstance();if(t==null)throw Tl(Ge.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Tl(Ge.NOT_INSTALLED);const a=sd(t),r=cd(a),n=lo(t),o=id(l,n);if(o==="global")return ed(r,l,n),r;if(o==="parent"){let c=dd(a,t,l.__useComponent);return c==null&&(process.env.NODE_ENV!=="production"&&Gt(fr(Zt.NOT_FOUND_PARENT_SCOPE)),c=r),c}const s=a;let i=s.__getInstance(t);if(i==null){const c=Ke({},l);"__i18n"in n&&(c.__i18n=n.__i18n),r&&(c.__root=r),i=ad(c),s.__composerExtend&&(i[mr]=s.__composerExtend(i)),pd(s,t,i),s.__setInstance(t,i)}return i}function sd(l){const t=e.inject(l.isCE?od:l.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Tl(l.isCE?Ge.NOT_INSTALLED_WITH_PROVIDE:Ge.UNEXPECTED_ERROR);return t}function id(l,t){return aa(l)?"__i18n"in t?"local":"global":l.useScope?l.useScope:"local"}function cd(l){return l.mode==="composition"?l.global:l.global.__composer}function dd(l,t,a=!1){let r=null;const n=t.root;let o=ud(t,a);for(;o!=null;){const s=l;if(l.mode==="composition")r=s.__getInstance(o);else if(__VUE_I18N_LEGACY_API__){const i=s.__getInstance(o);i!=null&&(r=i.__composer,a&&r&&!r[eo]&&(r=null))}if(r!=null||n===o)break;o=o.parent}return r}function ud(l,t=!1){return l==null?null:t&&l.vnode.ctx||l.parent}function pd(l,t,a){let r=null;e.onMounted(()=>{if(process.env.NODE_ENV!=="production"&&t.vnode.el){t.vnode.el.__VUE_I18N__=a,r=bi();const n=a;n[ur]&&n[ur](r),r.on("*",io)}},t),e.onUnmounted(()=>{const n=a;process.env.NODE_ENV!=="production"&&t.vnode.el&&t.vnode.el.__VUE_I18N__&&(r&&r.off("*",io),n[pr]&&n[pr](),delete t.vnode.el.__VUE_I18N__),l.__deleteInstance(t);const o=n[mr];o&&(o(),delete n[mr])},t)}if(Ke({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},hr),Xc(),vc(oc),Sc(_c),Dc(vn),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const l=ol();l.__INTLIFY__=!0,sc(l.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const md={class:"flex items-center justify-between"},fd={class:"flex items-center gap-2"},hd={class:"text-4xl font-bold text-slate-800 dark:text-slate-100 mb-2"},gd=["href","title"],yd={class:"text-lg text-slate-600 dark:text-slate-300"},bd=e.defineComponent({__name:"DashboardHeader",setup(l){const{locale:t}=Re();return(a,r)=>{const n=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",md,[e.createElementVNode("div",null,[e.createElementVNode("div",fd,[e.createElementVNode("h1",hd,e.toDisplayString(a.$t("dashboard.title")),1),e.createElementVNode("a",{href:`https://cms.opengis.info/${e.unref(t)}/get-started/app-overview`,target:"_blank",title:a.$t("guide.appOverview")},[e.createVNode(e.unref(fl),{class:"w-5 h-5"})],8,gd)]),e.createElementVNode("div",yd,e.toDisplayString(a.$t("dashboard.description")),1)]),e.createElementVNode("div",null,[e.createVNode(n,{to:"/settings/collections",class:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 shadow h-9 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white"},{default:e.withCtx(()=>[e.createVNode(e.unref(gl),{class:"w-4 h-4 mr-2"}),e.createTextVNode(" "+e.toDisplayString(a.$t("dashboard.newCollection")),1)]),_:1})])])}}}),kd={class:"rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm hover:shadow-xl transition-all duration-300 transform hover:scale-105"},xd={class:"p-6"},wd={class:"flex items-start justify-between"},Ed={class:"flex-1"},_d={class:"flex items-center space-x-2 mb-2"},Vd={class:"text-sm font-medium text-slate-600 dark:text-slate-400"},Cd={class:"text-3xl font-bold text-slate-800 dark:text-slate-100 mb-1"},Nd={class:"text-xs text-slate-500 dark:text-slate-400 mb-3"},Bd=e.defineComponent({__name:"StatCard",props:{stat:{}},setup(l){const t=a=>({"file-text":vl,users:Ga,image:za,eye:Ua})[a]||vl;return(a,r)=>(e.openBlock(),e.createElementBlock("div",kd,[e.createElementVNode("div",xd,[e.createElementVNode("div",wd,[e.createElementVNode("div",Ed,[e.createElementVNode("div",_d,[e.createElementVNode("div",{class:e.normalizeClass(`p-2 rounded-lg bg-${l.stat.color}-50 dark:bg-${l.stat.color}-900/20`)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t(l.stat.icon)),{class:e.normalizeClass(`w-5 h-5 text-${l.stat.color}-600`)},null,8,["class"]))],2),e.createElementVNode("p",Vd,e.toDisplayString(l.stat.title),1)]),e.createElementVNode("p",Cd,e.toDisplayString(l.stat.value),1),e.createElementVNode("p",Nd,e.toDisplayString(l.stat.description),1)])])])]))}}),vd={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6"},Sd=e.defineComponent({__name:"StatsGrid",props:{stats:{}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",vd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.stats,r=>(e.openBlock(),e.createBlock(Bd,{key:r.id,stat:r},null,8,["stat"]))),128))]))}}),Dd={class:"p-4 hover:bg-slate-50 dark:hover:bg-slate-700/50 transition-colors"},Ad={class:"flex items-center justify-between"},Md={class:"flex-1"},Td={class:"flex items-center space-x-3 mb-2"},$d={class:"inline-flex items-center rounded-md border px-2.5 py-0.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-xs bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-600 dark:text-slate-300"},Ld={class:"font-semibold text-slate-800 dark:text-slate-100 mb-1"},Fd={class:"flex items-center space-x-4 text-sm text-slate-500 dark:text-slate-400"},Id={class:"flex items-center"},Od={class:"flex items-center"},Pd={class:"flex items-center"},Rd={class:"flex items-center space-x-2"},jd=e.defineComponent({__name:"ContentItem",props:{item:{}},setup(l){const t=r=>{const n={published:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300",draft:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-yellow-100 dark:bg-yellow-900/30 text-yellow-800 dark:text-yellow-300",review:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-300"};return n[r]||n.draft},a=r=>{if(!r)return"--.--.--";const n=new Date(r);return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(n)};return(r,n)=>{const o=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",Dd,[e.createElementVNode("div",Ad,[e.createElementVNode("div",Md,[e.createElementVNode("div",Td,[e.createElementVNode("div",$d,e.toDisplayString(l.item.type),1),e.createElementVNode("div",{class:e.normalizeClass(t(l.item.status))},e.toDisplayString(l.item.status||"--"),3)]),e.createElementVNode("h3",Ld,e.toDisplayString(l.item.title||"--"),1),e.createElementVNode("div",Fd,[e.createElementVNode("span",Id,[e.createVNode(e.unref(Ga),{class:"w-4 h-4 mr-1"}),e.createTextVNode(" "+e.toDisplayString(l.item.author||"--"),1)]),e.createElementVNode("span",Od,[e.createVNode(e.unref(Ra),{class:"w-4 h-4 mr-1"}),e.createTextVNode(" "+e.toDisplayString(a(l.item.updated_at)||"--.--.--"),1)]),e.createElementVNode("span",Pd,[e.createVNode(e.unref(Ua),{class:"w-4 h-4 mr-1"}),e.createTextVNode(" "+e.toDisplayString(l.item.views||"--")+" "+e.toDisplayString(r.$t("dashboard.views")),1)])])]),e.createElementVNode("div",Rd,[e.createVNode(o,{to:`/collections/${l.item.object_id}/${l.item.content_id}`,class:"inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors border shadow-sm rounded-md text-xs h-8 w-8 p-0 bg-white border-slate-300 hover:text-accent-foreground hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600"},{default:e.withCtx(()=>[e.createVNode(e.unref(Sl),{class:"w-4 h-4 dark:text-blue-50"})]),_:1},8,["to"])])])])}}}),Ud={class:"lg:col-span-2"},zd={class:"rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm"},Hd={class:"flex flex-col space-y-1.5 p-6 border-b border-slate-200 dark:border-slate-700 bg-gradient-to-r from-slate-50 dark:from-slate-800 to-white dark:to-slate-800"},Kd={class:"flex items-center justify-between"},qd={class:"tracking-tight text-xl font-semibold text-slate-800 dark:text-slate-100 flex items-center"},Gd={class:"p-0"},Wd={class:"divide-y divide-slate-100 dark:divide-slate-700"},Yd=e.defineComponent({__name:"RecentContent",props:{content:{}},setup(l){const t=dt.useRouter(),a=r=>{t.push(r)};return(r,n)=>(e.openBlock(),e.createElementBlock("div",Ud,[e.createElementVNode("div",zd,[e.createElementVNode("div",Hd,[e.createElementVNode("div",Kd,[e.createElementVNode("h3",qd,[e.createVNode(e.unref(Js),{class:"w-5 h-5 mr-2"}),e.createTextVNode(" "+e.toDisplayString(r.$t("dashboard.recentContent")),1)]),e.createElementVNode("button",{onClick:n[0]||(n[0]=o=>a("/settings/collections")),class:"inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border shadow-sm hover:text-accent-foreground h-8 rounded-md px-3 text-xs 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"},e.toDisplayString(r.$t("dashboard.viewAll")),1)])]),e.createElementVNode("div",Gd,[e.createElementVNode("div",Wd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.content,o=>(e.openBlock(),e.createBlock(jd,{key:o.id,item:o},null,8,["item"]))),128))])])])]))}}),Xd={class:"rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm"},Zd={class:"flex flex-col space-y-1.5 p-6 border-b border-slate-200 dark:border-slate-700 bg-gradient-to-r from-slate-50 dark:from-slate-800 to-white dark:to-slate-800"},Qd={class:"tracking-tight text-lg font-semibold text-slate-800 dark:text-slate-100 flex items-center"},Jd={class:"p-4"},eu={class:"grid grid-cols-2 gap-3"},tu=["onClick"],lu={class:"p-2 rounded-lg bg-blue-50 dark:bg-blue-900/20 mb-2 w-fit"},au={class:"font-medium text-slate-800 dark:text-slate-100 text-sm mb-1 group-hover:text-slate-900 dark:group-hover:text-slate-50"},ru={class:"text-xs text-slate-500 dark:text-slate-400 group-hover:text-slate-600 dark:group-hover:text-slate-300"},nu=e.defineComponent({__name:"QuickActions",setup(l){const t=dt.useRouter(),{t:a}=Re(),r=[{id:"create-article",title:a("dashboard.createArticle"),description:a("dashboard.createArticleDescription"),icon:vl,iconColor:"text-blue-500",link:"/collections/pages/create"},{id:"upload-media",title:a("dashboard.uploadMedia"),description:a("dashboard.uploadMediaDescription"),icon:za,iconColor:"text-purple-500",link:"/media"},{id:"manage-users",title:a("dashboard.manageUsers"),description:a("dashboard.manageUsersDescription"),icon:Ga,iconColor:"text-green-500",link:"/settings/users"}],n=o=>{o&&t.push(o)};return(o,s)=>(e.openBlock(),e.createElementBlock("div",Xd,[e.createElementVNode("div",Zd,[e.createElementVNode("h3",Qd,[e.createVNode(e.unref(si),{class:"w-5 h-5 mr-2"}),e.createTextVNode(" "+e.toDisplayString(o.$t("dashboard.quickActions")),1)])]),e.createElementVNode("div",Jd,[e.createElementVNode("div",eu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,i=>e.createElementVNode("button",{key:i.id,class:"p-3 rounded-lg border border-slate-200 transition-all duration-200 text-left group hover:bg-slate-50 hover:shadow-md dark:border-slate-600 bg-white dark:bg-slate-700 dark:hover:bg-slate-600",onClick:c=>n(i==null?void 0:i.link)},[e.createElementVNode("div",lu,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i==null?void 0:i.icon),{class:e.normalizeClass(`w-4 h-4 ${i==null?void 0:i.iconColor}`)},null,8,["class"]))]),e.createElementVNode("h3",au,e.toDisplayString(i==null?void 0:i.title),1),e.createElementVNode("p",ru,e.toDisplayString(i==null?void 0:i.description),1)],8,tu)),64))])])]))}}),ou={class:"w-full max-w-7xl mx-auto space-y-8"},su={class:"grid grid-cols-1 lg:grid-cols-3 gap-6"},gr=e.defineComponent({__name:"Dashboard",setup(l){const{t}=Re(),a=e.ref([{id:"total-content",title:t("dashboard.totalContent"),value:"2,847",description:t("dashboard.articlesPostsPages"),change:{value:"+12.5%",isPositive:!0},icon:"file-text",color:"blue"},{id:"active-users",title:t("dashboard.activeUsers"),value:"1,234",description:t("dashboard.monthlyActiveUsers"),change:{value:"+8.2%",isPositive:!0},icon:"users",color:"emerald"},{id:"media-files",title:t("dashboard.mediaFiles"),value:"5,692",description:t("dashboard.imagesVideosDocs"),change:{value:"+23.1%",isPositive:!0},icon:"image",color:"purple"},{id:"new-media",title:t("dashboard.newMediaFiles"),value:"89.2K",description:t("dashboard.thisMonth"),change:{value:"-2.4%",isPositive:!1},icon:"eye",color:"orange"}]),r=e.ref([{id:1,type:"Article",status:"published",title:t("dashboard.gettingStartedWithNextJs14"),author:t("dashboard.sarahJohnson"),updated_at:"2024-01-15",views:1247},{id:2,type:"Post",status:"draft",title:t("dashboard.advancedReactPatterns"),author:t("dashboard.mikeChen"),updated_at:"2024-01-14",views:0},{id:3,type:"Article",status:"published",title:t("dashboard.uiUxDesignPrinciples"),author:t("dashboard.emmaWilson"),updated_at:"2024-01-13",views:892},{id:4,type:"Post",status:"review",title:t("dashboard.databaseOptimizationTips"),author:t("dashboard.alexRodriguez"),updated_at:"2024-01-12",views:0}]),n=s=>{a.value=a.value.map(i=>{var c,u,d,p;switch(i.id){case"total-content":return{...i,value:((c=s.totalContent)==null?void 0:c.toLocaleString())??i.value};case"active-users":return{...i,value:((u=s.totalUsers)==null?void 0:u.toLocaleString())??i.value};case"media-files":return{...i,value:((d=s.totalMediaFiles)==null?void 0:d.toLocaleString())??i.value};case"new-media":return{...i,value:((p=s.newMediaFiles)==null?void 0:p.toLocaleString())??i.value};default:return i}})},o=async()=>{const i=await(await fetch("api/cms-stat")).json();r.value=i.recentContent,n(i.stat)};return e.onMounted(()=>{o()}),(s,i)=>(e.openBlock(),e.createElementBlock("div",ou,[e.createVNode(bd),e.createVNode(Sd,{stats:a.value},null,8,["stats"]),e.createElementVNode("div",su,[e.createVNode(Yd,{content:r.value,class:"lg:col-span-2"},null,8,["content"]),e.createElementVNode("div",null,[e.createVNode(nu)])])]))}}),iu={class:"rounded-xl text-card-foreground shadow-lg bg-white dark:bg-slate-800 backdrop-blur-sm border-2 border-dashed border-slate-300 dark:border-slate-600"},cu={class:"p-12 text-center"},du={class:"text-lg font-medium text-slate-600 dark:text-slate-300 mb-2"},uu={class:"text-slate-500 dark:text-slate-400 mb-6"},po={__name:"EmptyData",props:{title:{type:String,default:()=>"emptyData.title"},description:{type:String,default:()=>"emptyData.description"},buttonText:{type:String,default:()=>"emptyData.buttonText"},showButton:{type:Boolean,default:!0}},emits:["action"],setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",iu,[e.createElementVNode("div",cu,[a[2]||(a[2]=e.createElementVNode("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-layers w-12 h-12 mx-auto mb-4 text-slate-400 dark:text-slate-500"},[e.createElementVNode("path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z"}),e.createElementVNode("path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"}),e.createElementVNode("path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"})],-1)),e.createElementVNode("h3",du,e.toDisplayString(t.$t(l.title)),1),e.createElementVNode("p",uu,e.toDisplayString(t.$t(l.description)),1),l.showButton?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:a[0]||(a[0]=r=>t.$emit("action")),class:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 shadow h-9 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white"},[a[1]||(a[1]=e.createElementVNode("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-plus w-4 h-4 mr-2"},[e.createElementVNode("path",{d:"M5 12h14"}),e.createElementVNode("path",{d:"M12 5v14"})],-1)),e.createTextVNode(" "+e.toDisplayString(t.$t(l.buttonText)),1)])):e.createCommentVNode("",!0)])]))}},pu={class:"space-y-6 max-w-7xl mx-auto"},mu={class:"flex items-center justify-between mb-8"},fu={class:"flex gap-4"},hu={class:"text-3xl font-bold text-slate-800 dark:text-slate-100 mb-2"},gu={class:"text-slate-600 dark:text-slate-300"},yu=["href","title"],bu={class:"relative w-full max-w-sm"},ku={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},xu=["placeholder"],wu={key:0},Eu={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-6"},_u=["onClick"],Vu={class:"flex items-start justify-between"},Cu={class:"flex items-start gap-3"},Nu={class:"text-sm font-semibold text-gray-800 mb-1"},Bu={class:"text-xs text-gray-600"},vu={class:"flex items-center gap-2"},Su={class:"text-xs text-gray-500 whitespace-nowrap"},Du={key:1,class:"flex items-center justify-center min-h-[400px]"},yr=e.defineComponent({__name:"CollectionsPage",setup(l){const{t,locale:a}=Re(),r=dt.useRouter();e.inject("fetchContentTypes");const n=e.ref([]),o=e.ref(""),s=e.computed(()=>{const u=n.value.filter(f=>f.type!=="single"),d=o.value.trim().toLowerCase();return[...d?u.filter(f=>[f==null?void 0:f.title,f==null?void 0:f.name,f==null?void 0:f.id,f==null?void 0:f.description].filter(Boolean).join(" ").toLowerCase().includes(d)):u].sort((f,g)=>f.id==="pages"?-1:g.id==="pages"?1:0)});async function i(){try{const u=await fetch("/api/cms-type?type=collection");if(!u.ok)throw new Error("Failed to fetch collections");const d=await u.json();n.value=d.rows||[]}catch(u){console.error("Error fetching collections:",u)}}const c=u=>{r.push(`/collections/${u.id}`)};return e.onMounted(()=>{i()}),(u,d)=>(e.openBlock(),e.createElementBlock("div",pu,[e.createElementVNode("div",mu,[e.createElementVNode("div",fu,[e.createElementVNode("div",null,[e.createElementVNode("h1",hu,e.toDisplayString(u.$t("navigation.collections")),1),e.createElementVNode("p",gu,e.toDisplayString(u.$t("collections.selectCollection")),1)]),e.createElementVNode("a",{href:`https://cms.opengis.info/${e.unref(a)}/guides/collections/`,target:"_blank",title:u.$t("guide.collections"),class:"mt-2"},[e.createVNode(e.unref(fl),{class:"w-5 h-5"})],8,yu)]),e.createElementVNode("div",bu,[e.createElementVNode("div",ku,[e.createVNode(e.unref(qa),{class:"w-5 h-5 text-gray-400"})]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":d[0]||(d[0]=p=>o.value=p),type:"text",class:"block w-full py-2 pl-10 pr-3 leading-5 text-gray-900 placeholder-gray-500 transition-colors bg-white border border-gray-300 rounded-md dark:border-gray-600 dark:bg-gray-700 dark:placeholder-gray-400 focus:outline-none focus:ring-sky-500 focus:border-sky-500 dark:text-white sm:text-sm",placeholder:u.$t("collections.searchCollections")},null,8,xu),[[e.vModelText,o.value]])])]),n.value.length>0?(e.openBlock(),e.createElementBlock("div",wu,[e.createElementVNode("div",Eu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,p=>(e.openBlock(),e.createElementBlock("button",{key:p.id,onClick:m=>c(p),class:"w-full border border-gray-200 bg-white rounded-lg p-4 text-left hover:shadow-md transition-all hover:border-gray-300"},[e.createElementVNode("div",Vu,[e.createElementVNode("div",Cu,[p.id==="pages"?(e.openBlock(),e.createBlock(e.unref(ea),{key:0,class:"shrink-0 lucide lucide-page w-5 h-5 text-blue-600"})):(e.openBlock(),e.createBlock(e.unref(hl),{key:1,class:"shrink-0 lucide lucide-layers w-5 h-5 text-blue-600"})),e.createElementVNode("div",null,[e.createElementVNode("h4",Nu,e.toDisplayString(p.title),1),e.createElementVNode("p",Bu,e.toDisplayString(p.description||"Опис відсутній"),1)])]),e.createElementVNode("div",vu,[e.createElementVNode("span",Su,e.toDisplayString(p.entries)+" записів",1),e.createVNode(e.unref(ml),{class:"w-4 h-4 text-gray-400"})])])],8,_u))),128))])])):(e.openBlock(),e.createElementBlock("div",Du,[e.createVNode(po)]))]))}}),Au={class:"text-card-foreground border-0 bg-white/80 dark:bg-slate-800/80 backdrop-blur-sm"},Mu={class:"p-0"},Tu={class:"table-scroll overflow-x-auto"},$u={class:"relative w-full overflow-auto max-h-[calc(100vh-270px)]"},Lu={class:"w-full caption-bottom text-sm"},Fu={class:"border-b border-slate-200 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors"},Iu={class:"flex items-center gap-2"},Ou={class:"h-10 text-center px-4 font-semibold text-slate-700 dark:text-slate-300 max-w-32"},Pu=["onClick"],Ru={key:1,class:"whitespace-nowrap"},ju={key:2,class:"whitespace-nowrap"},Uu={key:3,class:"flex items-center"},zu={key:4,class:"inline-flex whitespace-nowrap items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-300"},Hu={key:5,class:"flex items-center"},Ku={key:6,class:"flex items-center gap-3"},qu={key:8,class:"flex items-center gap-3"},Gu={key:11,class:"flex items-center gap-3"},Wu={class:"line-clamp-2"},Yu={class:"flex justify-end py-2 px-4 align-middle max-w-40"},Xu={class:"flex items-center justify-center gap-1"},Zu=["onClick"],Qu=["onClick"],mo=e.defineComponent({__name:"UniversalTable",props:{rows:{},query:{},filterFn:{type:Function},onEdit:{type:Function},onView:{type:Function},onDelete:{type:Function},columns:{},onMore:{type:Function},customRender:{}},emits:["edit","view","delete","more"],setup(l,{emit:t}){const{t:a}=Re();e.ref(null);const r=l,n=t,o=e.computed(()=>!r.query||!r.filterFn?r.rows:r.rows.filter(p=>r.filterFn(p,r.query))),s=p=>{if(!p)return"";const m=new Date(p);return isNaN(m.getTime())?"":p.includes("T")||p.includes(" ")||p.includes(":")?m.toLocaleString("uk-UA",{dateStyle:"medium",timeStyle:"medium"}):m.toLocaleDateString("uk-UA",{dateStyle:"medium"})},i=p=>{switch(p){case"published":return{icon:ln,text:a("common.status.published"),classes:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-200 border-green-200 dark:border-green-700"};case"draft":return{icon:Sl,text:a("common.status.draft"),classes:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-200 border-yellow-200 dark:border-yellow-700"};case"archived":return{icon:sn,text:a("common.status.archived"),classes:"bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-300 border-gray-200 dark:border-gray-700"};default:return null}},c=(p,m)=>{switch(p){case"edit":n("edit",m),r.onEdit&&r.onEdit(m);break;case"view":n("view",m),r.onView&&r.onView(m);break;case"delete":n("delete",m);break;case"more":n("more",m),r.onMore&&r.onMore(m);break}},u=p=>{c("edit",p)},d=p=>{const m=new Date,f=new Date(p),g=m-f,y=Math.floor(g/1e3),w=Math.floor(y/60),h=Math.floor(w/60),k=Number(Math.floor(h/24)),x=Number(Math.floor(k/7));return x>=2?a("table.time.weeksAgo",{count:x}):x===1?a("table.time.weekAgo"):k>=2?a("table.time.daysAgo",{count:k}):k===1?a("table.time.dayAgo"):h>=2?a("table.time.hoursAgo",{count:h}):h===1?a("table.time.hourAgo"):w>=2?a("table.time.minutesAgo",{count:w}):a(w===1?"table.time.minuteAgo":"table.time.justNow")};return(p,m)=>(e.openBlock(),e.createElementBlock("div",Au,[e.createElementVNode("div",Mu,[e.createElementVNode("div",Tu,[e.createElementVNode("div",$u,[e.createElementVNode("table",Lu,[e.createElementVNode("thead",null,[e.createElementVNode("tr",Fu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.columns,f=>(e.openBlock(),e.createElementBlock("th",{key:f.name,class:e.normalizeClass(["h-10 px-4 text-left align-middle font-semibold text-slate-700 dark:text-slate-300 max-w-80",{"min-w-[200px]":["title","name"].includes(f.name),"min-w-[150px]":f.name==="slug","min-w-[250px]":f.name==="description"}])},[e.createElementVNode("div",Iu,[f.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f.icon),{key:0,class:"w-5 h-5"})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(f.label||f.title||f.ua||f.name),1)])],2))),128)),e.createElementVNode("th",Ou,e.toDisplayString(p.$t("table.actions")),1)])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,f=>(e.openBlock(),e.createElementBlock("tr",{key:f.id||f._id||f.name,class:"transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.columns,(g,y)=>{var w,h,k,x,b;return e.openBlock(),e.createElementBlock("td",{key:g.name,class:e.normalizeClass(["py-2 px-4 align-middle max-w-80",{"font-medium text-slate-800 dark:text-white cursor-pointer":y===0,"text-slate-600 dark:text-slate-400 font-mono text-sm":y!==0}]),onClick:_=>y===0?u(f):void 0},[l.customRender&&l.customRender[g.name]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.customRender[g.name](f[g.name],f)),{key:0})):e.createCommentVNode("",!0),["published_at","publish_at","created_at","date"].includes(g.name)&&f[g.name]?(e.openBlock(),e.createElementBlock("span",Ru,e.toDisplayString(s(f[g.name])),1)):["updated_at","lastModified","last_edit"].includes(g.name)?(e.openBlock(),e.createElementBlock("span",ju,e.toDisplayString(d(f[g.name])||"--"),1)):g.name==="views"?(e.openBlock(),e.createElementBlock("div",Uu,[e.createVNode(e.unref(Ua),{class:"w-4 h-4 mr-1"}),e.createTextVNode(" "+e.toDisplayString(((h=(w=f[g.name])==null?void 0:w.toLocaleString)==null?void 0:h.call(w))??f[g.name]),1)])):["entries","fields"].includes(g.name)?(e.openBlock(),e.createElementBlock("div",zu,e.toDisplayString(f[g.name]||"-"),1)):g.name==="type"?(e.openBlock(),e.createElementBlock("div",Hu,[e.createElementVNode("div",{class:e.normalizeClass(["whitespace-nowrap inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors border-transparent hover:bg-secondary/80",f[g.name]==="pages"?"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300":"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300"])},e.toDisplayString(f[g.name]||"-"),3)])):g.name==="name"?(e.openBlock(),e.createElementBlock("div",Ku,[f.type==="single"?(e.openBlock(),e.createBlock(e.unref(ea),{key:0,class:"shrink-0 lucide lucide-page w-5 h-5 text-blue-600"})):(e.openBlock(),e.createBlock(e.unref(hl),{key:1,class:"shrink-0 lucide lucide-layers w-5 h-5 text-blue-600"})),e.createTextVNode(" "+e.toDisplayString(f[g.name]),1)])):g.name==="status"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[i(f[g.name])?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["whitespace-nowrap rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors hover:bg-secondary/80 flex items-center w-fit bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-300 dark:border-green-700",(k=i(f[g.name]))==null?void 0:k.classes])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent((x=i(f[g.name]))==null?void 0:x.icon),{class:"w-3 h-3 mr-1"})),e.createTextVNode(" "+e.toDisplayString((b=i(f[g.name]))==null?void 0:b.text),1)],2)):e.createCommentVNode("",!0)],64)):g.name==="slug"?(e.openBlock(),e.createElementBlock("div",qu,e.toDisplayString(f[g.name]?"/"+f[g.name]:"-"),1)):g.name==="color"?(e.openBlock(),e.createElementBlock("span",{key:9,class:e.normalizeClass(["w-4 h-4 rounded-full block ml-2","bg-["+f[g.name]+"]"])},null,2)):g.name==="enabled"?(e.openBlock(),e.createElementBlock("span",{key:10,class:e.normalizeClass(["whitespace-nowrap rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors hover:bg-secondary/80 flex items-center w-fit",f[g.name]?"bg-green-100 text-green-800 border-green-200":"bg-red-100 text-red-800 border-red-200"])},e.toDisplayString(f[g.name]?"Доступ":"Заборонено"),3)):(e.openBlock(),e.createElementBlock("div",Gu,[e.createElementVNode("p",Wu,e.toDisplayString(f[g.name]||"-"),1)]))],10,Pu)}),128)),e.createElementVNode("td",Yu,[e.createElementVNode("div",Xu,[e.createElementVNode("button",{onClick:e.withModifiers(g=>c("edit",f),["stop"]),class:"inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:text-slate-200 hover:border-blue-300 hover:bg-blue-50 hover:text-blue-600",title:"Edit"},[e.createVNode(e.unref(on),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-green-600 dark:group-hover:text-blue-50"})],8,Zu),e.createElementVNode("button",{onClick:e.withModifiers(g=>c("delete",f),["stop"]),class:"inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:text-slate-200 hover:border-blue-300 hover:bg-blue-50 hover:text-blue-600",title:"Preview"},[e.createVNode(e.unref(qt),{class:"w-4 h-4 text-slate-800 dark:text-slate-200 group-hover:text-red-600 dark:group-hover:text-blue-50"})],8,Qu),e.renderSlot(p.$slots,"actions",{row:f})])])]))),128))])])])])])]))}}),Ju={class:"flex items-center justify-between px-6 py-4 border-t border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-800"},ep={class:"flex justify-between flex-1 sm:hidden"},tp={class:"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"},lp={class:"relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"},ap={class:"hidden sm:flex-1 sm:flex sm:items-center sm:justify-between"},rp={class:"text-sm text-slate-600 dark:text-slate-400"},np={class:"font-medium text-slate-800 dark:text-slate-100"},op={class:"font-medium text-slate-800 dark:text-slate-100"},sp={class:"relative z-0 inline-flex space-x-2 rounded-md shadow-sm","aria-label":"Pagination"},ip=["disabled"],cp={class:"sr-only"},dp={class:"space-x-1"},up={key:0,class:"px-2 py-2 text-gray-400"},pp=["onClick"],mp=["disabled"],fp={class:"sr-only"},fo=e.defineComponent({__name:"UniversalTablePagination",props:e.mergeModels({total:{},count:{},limit:{}},{page:{},pageModifiers:{}}),emits:["update:page"],setup(l){const t=e.useModel(l,"page"),a=e.computed(()=>Math.ceil(l.total/l.limit)),r=e.computed(()=>{const o=[];if(a.value<=4){for(let c=1;c<=a.value;c++)o.push(c);return o}const s=Math.max(2,t.value-2),i=Math.min(a.value-1,t.value+2);o.push(1),s>2&&o.push("ellipsis");for(let c=s;c<=i;c++)o.push(c);return i<a.value-1&&o.push("ellipsis"),o.push(a.value),o});return(n,o)=>(e.openBlock(),e.createElementBlock("div",Ju,[e.createElementVNode("div",ep,[e.createElementVNode("button",tp,e.toDisplayString(n.$t("common.pagination.previous")),1),e.createElementVNode("button",lp,e.toDisplayString(n.$t("common.pagination.next")),1)]),e.createElementVNode("div",ap,[e.createElementVNode("div",null,[e.createElementVNode("p",rp,[e.createTextVNode(e.toDisplayString(n.$t("common.pagination.showing"))+" ",1),e.createElementVNode("span",np,e.toDisplayString(l.count),1),e.createTextVNode(" "+e.toDisplayString(n.$t("common.pagination.of"))+" ",1),e.createElementVNode("span",op,e.toDisplayString(l.total),1),e.createTextVNode(" "+e.toDisplayString(n.$t("common.pagination.results")),1)])]),e.createElementVNode("div",null,[e.createElementVNode("nav",sp,[e.createElementVNode("button",{onClick:o[0]||(o[0]=s=>t.value=t.value>1?t.value-1:1),disabled:t.value===1,class:"inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors border shadow-sm rounded-md text-xs h-8 w-8 p-0 bg-white border-slate-300 text-slate-600 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed 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"},[e.createElementVNode("span",cp,e.toDisplayString(n.$t("common.pagination.previous")),1),e.createVNode(e.unref(ti),{class:"w-5 h-5"})],8,ip),e.createElementVNode("div",dp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s+"-"+i},[s==="ellipsis"?(e.openBlock(),e.createElementBlock("span",up,"...")):(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c=>t.value=s,class:e.normalizeClass(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors h-8 w-8 p-0 text-sm rounded-md",{"border shadow-sm hover:text-accent-foreground bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-600 dark:text-slate-300 hover:border-blue-600 hover:bg-slate-50 dark:hover:bg-slate-600":s!==t.value,"shadow bg-blue-600 hover:bg-blue-700 text-white border-blue-600":s===t.value}])},e.toDisplayString(s),11,pp))],64))),128))]),e.createElementVNode("button",{onClick:o[1]||(o[1]=s=>t.value=t.value<Math.ceil(l.total/l.limit)?t.value+1:Math.ceil(l.total/l.limit)),disabled:t.value===Math.ceil(l.total/l.limit),class:"inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors border shadow-sm rounded-md text-xs h-8 w-8 p-0 bg-white border-slate-300 text-slate-600 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed 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"},[e.createElementVNode("span",fp,e.toDisplayString(n.$t("common.pagination.next")),1),e.createVNode(e.unref(ml),{class:"w-5 h-5"})],8,mp)])])])]))}}),il=(l,t)=>{const a=l.__vccOpts||l;for(const[r,n]of t)a[r]=n;return a},hp={key:0,class:"fixed inset-0 z-[2000] flex items-center justify-center bg-gray-600 bg-opacity-75"},gp={key:0,class:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg",role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title"},yp={class:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},bp={class:"mt-3 text-center sm:mt-5"},kp={id:"dialog-title",class:"text-base font-semibold text-gray-900"},xp={class:"mt-2"},wp={class:"text-sm text-gray-500"},Ep={class:"bg-gray-50 px-4 py-3 sm:px-6 flex justify-center"},_p={key:1,class:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg",role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title"},Vp={class:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Cp={class:"sm:flex sm:items-start"},Np={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Bp={id:"dialog-title",class:"text-base font-semibold text-gray-900"},vp={class:"mt-2"},Sp={class:"text-sm text-gray-500"},Dp={key:0,class:"mt-2"},Ap=["placeholder"],Mp=e.defineComponent({__name:"message-box",props:{type:{default:"error"},mode:{default:"confirm"},title:{default:""},message:{default:""},confirmButtonText:{default:"OK"},cancelButtonText:{default:"Cancel"},modelValue:{type:Boolean,default:!1},promptPlaceholder:{default:""},align:{type:Boolean,default:!0}},emits:["confirm","cancel","update:modelValue"],setup(l,{emit:t}){const a=e.ref(null);e.onMounted(()=>{var g;(g=a.value)==null||g.focus()});const r={success:()=>e.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",class:"size-6 text-green-600"},[e.h("path",{d:"m4.5 12.75 6 6 9-13.5","stroke-linecap":"round","stroke-linejoin":"round"})]),error:()=>e.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",class:"size-6 text-red-600"},[e.h("path",{d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z","stroke-linecap":"round","stroke-linejoin":"round"})]),info:()=>e.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"size-6 text-blue-600"},[e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 16h-1v-4h-1m1-4h.01M12 20a8 8 0 100-16 8 8 0 000 16z"})]),warning:()=>e.h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"size-6 text-yellow-600"},[e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 17a1 1 0 0 0 .87 1.5h18.62a1 1 0 0 0 .87-1.5L13.71 3.86a1 1 0 0 0-1.42 0z"})])},n=l,o=t,s=e.ref(n.modelValue),i=e.ref("");e.watch(()=>n.modelValue,g=>{s.value=g,g===!0&&n.mode==="prompt"&&(i.value="")});function c(g){s.value=!1,o("update:modelValue",!1),g==="confirm"&&n.mode==="prompt"?o("confirm",i.value):o(g)}function u(){c("confirm")}const d=e.computed(()=>{switch(n.type){case"success":return"bg-green-100";case"error":return"bg-red-100";case"info":return"bg-blue-100";case"warning":return"bg-yellow-100";default:return"bg-gray-100"}}),p=e.computed(()=>n.type==="warning"?"bg-orange-600 hover:bg-orange-500":n.type==="success"?"bg-green-600 hover:bg-green-500":n.type==="error"?"bg-red-600 hover:bg-red-500":"bg-blue-600 hover:bg-blue-500"),m=e.computed(()=>r[n.type||"error"]||r.error),f=e.computed(()=>n.title&&n.title.trim()!==""?n.title:n.type?n.type.charAt(0).toUpperCase()+n.type.slice(1):"Notification");return(g,y)=>{const w=e.resolveDirective("focus");return e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[s.value?(e.openBlock(),e.createElementBlock("div",hp,[g.mode==="alert"?(e.openBlock(),e.createElementBlock("div",gp,[e.createElementVNode("div",yp,[e.createElementVNode("div",null,[y[4]||(y[4]=e.createElementVNode("div",{class:"mx-auto flex size-12 shrink-0 items-center justify-center rounded-full bg-green-100"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",class:"size-6 text-green-600"},[e.createElementVNode("path",{d:"m4.5 12.75 6 6 9-13.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),e.createElementVNode("div",bp,[e.createElementVNode("h3",kp,e.toDisplayString(f.value),1),e.createElementVNode("div",xp,[e.createElementVNode("p",wp,e.toDisplayString(g.message),1)])])])]),e.createElementVNode("div",Ep,[e.createElementVNode("button",{type:"button",onClick:y[0]||(y[0]=h=>c("confirm")),class:"inline-flex min-w-[70px] w-full justify-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-xs hover:bg-indigo-500 sm:w-auto"},e.toDisplayString(g.confirmButtonText),1)])])):(e.openBlock(),e.createElementBlock("div",_p,[e.createElementVNode("div",Vp,[e.createElementVNode("div",Cp,[e.createElementVNode("div",{class:e.normalizeClass(["mx-auto flex size-12 shrink-0 items-center justify-center rounded-full sm:mx-0 sm:size-10",d.value])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m.value)))],2),e.createElementVNode("div",Np,[e.createElementVNode("h3",Bp,e.toDisplayString(f.value),1),e.createElementVNode("div",vp,[e.createElementVNode("p",Sp,e.toDisplayString(g.message),1)]),g.mode==="prompt"?(e.openBlock(),e.createElementBlock("div",Dp,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[1]||(y[1]=h=>i.value=h),placeholder:g.promptPlaceholder,class:"w-full rounded-md py-1.5 pl-2 text-gray-900 shadow-sm placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6",onKeyup:e.withKeys(u,["enter"]),type:"text"},null,40,Ap),[[e.vModelText,i.value],[w]])])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",{class:e.normalizeClass(["bg-gray-50 px-4 py-3",g.align?"sm:flex sm:flex-row-reverse sm:px-6 gap-x-2.5":"sm:flex sm:flex-row sm:px-6 gap-x-2.5"])},[e.createElementVNode("button",{type:"button",onClick:y[2]||(y[2]=h=>c("confirm")),class:e.normalizeClass(["inline-flex w-full justify-center rounded-md px-3 py-2 text-sm font-semibold text-white shadow-xs sm:w-auto",p.value])},e.toDisplayString(g.confirmButtonText),3),e.createElementVNode("button",{type:"button",onClick:y[3]||(y[3]=h=>c("cancel")),class:"mt-3 inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 hover:bg-gray-50 sm:mt-0 sm:w-auto"},e.toDisplayString(g.cancelButtonText),1)],2)]))])):e.createCommentVNode("",!0)])}}}),Tp=il(Mp,[["__scopeId","data-v-047caa71"]]);e.defineComponent({props:{modelValue:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},disabled:{type:Boolean,default:()=>!1}},data(){return{}},mounted(){this.modelValue||this.$emit("update:modelValue",!1)},computed:{modelState:{get(){return this.modelValue},set(l){this.$emit("update:modelValue",l)}},labelCursorClasses(){return[{"cursor-not-allowed":this.disabled},{"cursor-pointer":!this.disabled}]}},methods:{handleEnterDown(l){const{keyCode:t}=l;t===13&&(this.modelState=!this.modelState)},addKeyHandler(){window.addEventListener("keydown",this.handleEnterDown)},removeKeyHandler(){window.removeEventListener("keydown",this.handleEnterDown)}}});const $p={key:0,class:"vsTailwind ui-dialog__wrapper text-gray-800"},Lp={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},Fp={class:"font-medium text-gray-800 dark:text-[#ffffff]"},Ip={class:"ui-dialog__content p-4"},Op={key:0,class:"flex justify-end gap-x-2"},Pp={key:1,class:"flex justify-end items-center gap-x-2 py-3 px-4 border-t border-gray-200 dark:border-neutral-700"},Rp=e.defineComponent({__name:"vs-modal",props:{title:{default:""},template:{},visible:{type:Boolean,default:!1},size:{default:"small"},closeClickBack:{type:Boolean,default:!1},content:{},buttonText:{},contentProps:{},teleport:{default:"body"}},emits:["update:visible","close","done"],setup(l,{emit:t}){const a=l,r=t,n=e.computed(()=>a.size==="small"?"md:w-5/12 w-9/12":a.size==="medium"?"md:w-6/12 w-9/12":"lg:w-7/12 w-11/12"),o=e.useAttrs();function s(){r("done")}function i(){r("update:visible",!1),r("close")}function c(d){d.key==="Escape"&&i()}function u(d,p){p&&d.target.classList.contains("vs-dialog-overlay")&&i()}return e.onMounted(()=>{window.addEventListener("keydown",c)}),e.onUnmounted(()=>{window.removeEventListener("keydown",c)}),(d,p)=>(e.openBlock(),e.createBlock(e.Teleport,{to:d.teleport},[d.visible?(e.openBlock(),e.createElementBlock("div",$p,[e.createElementVNode("div",{onMousedown:p[0]||(p[0]=m=>u(m,d.closeClickBack)),class:e.normalizeClass(["vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 bg-black bg-opacity-50",[e.unref(o).class]])},[e.createVNode(e.Transition,{name:"content",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl",n.value])},[e.createElementVNode("div",Lp,[e.createElementVNode("h3",Fp,e.toDisplayString(d.title),1),e.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:i},[...p[1]||(p[1]=[e.createElementVNode("span",{class:"sr-only"},"Close",-1),e.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",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"},[e.createElementVNode("path",{d:"M18 6 6 18"}),e.createElementVNode("path",{d:"m6 6 12 12"})],-1)])])]),e.createElementVNode("div",Ip,[e.renderSlot(d.$slots,"default",{},void 0,!0)]),d.$slots.footer?(e.openBlock(),e.createElementBlock("div",Op,[e.renderSlot(d.$slots,"footer",{handleClose:i},void 0,!0)])):e.createCommentVNode("",!0),d.buttonText?(e.openBlock(),e.createElementBlock("div",Pp,[e.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:i}," Close "),e.createElementVNode("button",{type:"button",onClick:s,class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 focus:outline-hidden focus:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none"},e.toDisplayString(d.buttonText),1)])):e.createCommentVNode("",!0)],2)]),_:3})],34)])):e.createCommentVNode("",!0)],8,["to"]))}}),xl=il(Rp,[["__scopeId","data-v-a6807cab"]]),jp={key:0,class:"vsTailwind ui-drawer__wrapper"},Up={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},zp={class:"font-medium text-gray-800 dark:text-[#ffffff]"},Hp={class:"flex gap-2"},Kp={class:"sr-only"},qp={key:0,class:"flex-shrink-0 w-4 h-4",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"},Gp={key:1,class:"flex-shrink-0 w-4 h-4",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"},Wp={class:"ui-drawer__content p-4 flex-1 overflow-auto"},Yp={key:0,class:"flex justify-end gap-x-2 p-4 border-0 border-t border-solid border-gray-200 dark:border-t-[#454545]"},Xp=e.defineComponent({__name:"vs-drawer",props:{title:{default:""},visible:{type:Boolean,default:!1},position:{default:"right"},size:{default:"500px"},closeClickBack:{type:Boolean,default:!1}},emits:["update:visible","close"],setup(l,{emit:t}){const a=l,r=t,n=e.ref(!1),o=e.computed(()=>n.value?"fixed top-0 left-0 w-full h-full":a.position==="left"?"fixed top-0 left-0 h-full":a.position==="right"?"fixed top-0 right-0 h-full":a.position==="top"?"fixed top-0 left-0 w-full":"fixed bottom-0 left-0 w-full");function s(){r("update:visible",!1),r("close")}function i(){n.value=!n.value}function c(d){d.key==="Escape"&&s()}function u(d,p){p&&d.target.classList.contains("vs-drawer-overlay")&&s()}return e.onMounted(()=>{window.addEventListener("keydown",c)}),e.onUnmounted(()=>{window.removeEventListener("keydown",c)}),(d,p)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"#modal"},[d.visible?(e.openBlock(),e.createElementBlock("div",jp,[e.createElementVNode("div",{onMousedown:p[0]||(p[0]=m=>u(m,d.closeClickBack)),class:"vs-drawer-overlay vs-drawer w-full h-full fixed top-0 start-0 bg-black bg-opacity-50"},[e.createVNode(e.Transition,{name:"drawer",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["ui-drawer__drawer opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)]",[o.value,n.value?"w-full":`w-[${a.size}]`,`drawer-${a.position}`]])},[e.createElementVNode("div",Up,[e.createElementVNode("h3",zp,e.toDisplayString(d.title),1),e.createElementVNode("div",Hp,[e.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:i},[e.createElementVNode("span",Kp,e.toDisplayString(n.value?"Exit fullscreen":"Enter fullscreen"),1),n.value?(e.openBlock(),e.createElementBlock("svg",Gp,[...p[2]||(p[2]=[e.createElementVNode("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",qp,[...p[1]||(p[1]=[e.createElementVNode("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"},null,-1)])]))]),e.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:s},[...p[3]||(p[3]=[e.createElementVNode("span",{class:"sr-only"},"Close",-1),e.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",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"},[e.createElementVNode("path",{d:"M18 6 6 18"}),e.createElementVNode("path",{d:"m6 6 12 12"})],-1)])])])]),e.createElementVNode("div",Wp,[e.renderSlot(d.$slots,"default",{},void 0,!0)]),d.$slots.footer?(e.openBlock(),e.createElementBlock("div",Yp,[e.renderSlot(d.$slots,"footer",{handleClose:s},void 0,!0)])):e.createCommentVNode("",!0)],2)]),_:3})],32)])):e.createCommentVNode("",!0)]))}}),ho=il(Xp,[["__scopeId","data-v-c808fe88"]]),Zp={},Qp={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 text-green-600"};function Jp(l,t){return e.openBlock(),e.createElementBlock("svg",Qp,[...t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])])}const em=il(Zp,[["render",Jp]]),tm={},lm={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"orange",class:"size-6 text-orange-600"};function am(l,t){return e.openBlock(),e.createElementBlock("svg",lm,[...t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])])}const rm=il(tm,[["render",am]]),nm={},om={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 text-blue-600"};function sm(l,t){return e.openBlock(),e.createElementBlock("svg",om,[...t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"},null,-1)])])}const im=il(nm,[["render",sm]]),cm={},dm={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"red",class:"size-6 text-red-600"};function um(l,t){return e.openBlock(),e.createElementBlock("svg",dm,[...t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)])])}const pm=il(cm,[["render",um]]),mm={class:"rounded-md border border-gray-300 bg-white p-4 shadow-sm"},fm={class:"flex items-start gap-4 opacity-100 scale-5 transition-all duration-300"},hm={class:"flex-1"},gm={class:"font-medium text-gray-900"},ym={class:"mt-0.5 text-sm text-gray-700"},bm=e.defineComponent({__name:"vs-notify",props:{type:{},title:{},message:{}},setup(l){const t={success:em,warning:rm,error:pm,info:im};return(a,r)=>(e.openBlock(),e.createElementBlock("div",mm,[e.createElementVNode("div",fm,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t[a.type]))),e.createElementVNode("div",hm,[e.createElementVNode("strong",gm,e.toDisplayString(a.title),1),e.createElementVNode("p",ym,e.toDisplayString(a.message),1)]),r[0]||(r[0]=e.createElementVNode("button",{class:"m-3 rounded-full p-1.5 text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700",type:"button","aria-label":"Dismiss notify"},[e.createElementVNode("span",{class:"sr-only"},"Dismiss popup"),e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})])],-1))])]))}}),br=l=>{const{message:t,title:a,mode:r="confirm",type:n="info",confirmButtonText:o,cancelButtonText:s,onConfirm:i,onCancel:c,cascade:u,confirmButtonStyle:d,cancelButtonStyle:p}=l||{},m=document.querySelector("body");if(!m){console.error('Modal root element with id "#modal" not found!');return}const f=document.createElement("div");m.appendChild(f);const g=()=>{f.remove()};e.createApp({render(){return e.h(Tp,{title:a,message:t,mode:r,type:n,cascade:u,confirmButtonText:o,cancelButtonText:s,cancelButtonStyle:p,confirmButtonStyle:d,modelValue:!0,onConfirm:()=>{i==null||i(),g()},onCancel:()=>{c==null||c(),g()}})}}).mount(f)};e.reactive({visible:!0});const km=l=>{const{template:t="",title:a="",content:r,contentProps:n={},size:o="medium"}=l||{},s=document.querySelector("body");if(!s)return console.error('Modal root element with id "#modal" not found!'),{close:()=>{}};const i=document.createElement("div");s.appendChild(i);const c={title:a,template:t,visible:!0,size:o,closeClickBack:!0,onClose:d},u=e.createApp({render(){return e.h(xl,c,{default:()=>[r?e.h(r,n):e.h("p",t)]})}});function d(){u.unmount(),i.remove()}return u.mount(i),{close:d}},pa={top:"top-4 left-1/2 transform -translate-x-1/2","left-bottom":"bottom-4 left-4 transform","right-bottom":"bottom-4 right-4 transform",bottom:"bottom-4 left-1/2 transform -translate-x-1/2"},xe=l=>{var c;const{type:t="info",title:a,message:r,position:n="right-bottom"}=l||{};let o=document.querySelector("#notify-root");o||(o=document.createElement("div"),o.id="notify-root",o.className=`fixed z-[2000] flex flex-col gap-3 ${pa[n]} p-6 max-w-md mx-auto font-sans antialiased`,document.body.appendChild(o)),o.className.includes(pa[n])||(Object.values(pa).forEach(u=>{o.classList.remove(...u.split(" "))}),o.classList.add(...pa[n].split(" ")));const s=document.createElement("div");o.appendChild(s);const i=e.createApp({render(){return e.h(bm,{type:t,title:a,message:r,onClose:()=>{i.unmount(),s.remove()}})}});i.mount(s),(c=s.querySelector("button"))==null||c.addEventListener("click",()=>{s.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{i.unmount(),s.remove()},350)}),setTimeout(()=>{s.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{i.unmount(),s.remove()},350)},3500)},xm={class:"w-full relative"},wm={key:0,class:"text-[14px] font-medium text-gray-900 mb-2"},Em={class:"opacity-100"},_m={key:0,class:"text-red-500 text-[14px]"},Vm={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},Cm=e.defineComponent({__name:"vs-layout-default",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(l){const t=e.ref("uk"),a=r=>{r.detail.key==="locale"&&(t.value=r.detail.newValue)};return e.onMounted(()=>{t.value=localStorage.locale,window.addEventListener("storage",a)}),e.onUnmounted(()=>{window.removeEventListener("resize",a)}),(r,n)=>{var o,s;return e.openBlock(),e.createElementBlock("div",xm,[r.ua||r.label?(e.openBlock(),e.createElementBlock("div",wm,[e.createElementVNode("span",Em,e.toDisplayString(r.item[t.value]||r.ua||r.label),1),(s=(o=r.item)==null?void 0:o.rules)!=null&&s.includes("required")?(e.openBlock(),e.createElementBlock("span",_m,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"default",e.mergeProps(r.$attrs,{class:{"opacity-60":r.item.disabled}})),r.error?(e.openBlock(),e.createElementBlock("span",Vm,e.toDisplayString(r.error),1)):e.createCommentVNode("",!0)])}}}),Nm={class:"w-full relative flex flex-row items-center gap-2"},Bm={key:0,class:"text-red-500 text-[14px]"},vm={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},Sm=e.defineComponent({__name:"vs-layout-horizontal",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{default:()=>({container:12,label:3})}},setup(l){const t=l,a=e.computed(()=>t.columns??{container:12,label:3}),r=e.computed(()=>{const{container:i,label:c}=a.value;return!i||i<=0?0:Math.min(Math.max(c??0,0),i)/i}),n=e.computed(()=>{var i;return((i=t.item)==null?void 0:i.type)==="html"||r.value<=0?!1:!!(t.ua||t.label)}),o=e.computed(()=>{if(!n.value)return{};const i=`${r.value*100}%`;return{flexBasis:i,maxWidth:i}}),s=e.computed(()=>{var p;const{container:i,label:c}=a.value;if(!i||i<=0)return{};if(((p=t.item)==null?void 0:p.type)==="html")return{flexBasis:"100%",maxWidth:"100%"};if(!n.value)return{flexBasis:"100%",maxWidth:"100%"};const u=Math.max(i-Math.max(c??0,0),0)/i;if(!u)return{};const d=`${u*100}%`;return{flexBasis:d,maxWidth:d}});return(i,c)=>{var u,d;return e.openBlock(),e.createElementBlock("div",Nm,[n.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"text-sm text-gray-900 font-medium flex shrink-0",style:e.normalizeStyle(o.value)},[e.createTextVNode(e.toDisplayString(i.ua||i.label)+" ",1),(d=(u=i.item)==null?void 0:u.rules)!=null&&d.includes("required")&&(i.ua||i.label)?(e.openBlock(),e.createElementBlock("span",Bm,"*")):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"flex-1 min-w-0",style:e.normalizeStyle(s.value)},[e.renderSlot(i.$slots,"default",e.normalizeProps(e.guardReactiveProps(i.$attrs)))],4),i.error?(e.openBlock(),e.createElementBlock("span",vm,e.toDisplayString(i.error),1)):e.createCommentVNode("",!0)])}}}),Dm={class:"w-full relative"},Am={key:0,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},Mm=e.defineComponent({__name:"vs-layout-inline",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",Dm,[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps(t.$attrs))),t.error?(e.openBlock(),e.createElementBlock("span",Am,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),Tm={class:"flex-1 min-w-0"},$m={key:0,class:"text-sm font-medium text-slate-700 dark:text-slate-200 flex items-center gap-1"},Lm={class:"truncate"},Fm={key:0,class:"text-red-500 text-[14px]"},Im={key:1,class:"text-xs text-slate-500 dark:text-slate-400"},Om={key:0,class:"mt-1 text-xs text-red-500"},Pm=e.defineComponent({__name:"vs-layout-settings",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(l){const t=l,a=e.ref("uk");e.computed(()=>{var i;return((i=t.item??{})==null?void 0:i[a.value])??t.ua??t.label??""});const r=e.computed(()=>{var i;return((i=t.item)==null?void 0:i.description)??""}),n=e.computed(()=>{var i;return Array.isArray((i=t.item)==null?void 0:i.rules)&&t.item.rules.includes("required")}),o=e.computed(()=>(typeof t.error=="string"?t.error:"")??""),s=i=>{i.key==="locale"&&(a.value=i.newValue??"uk")};return e.onMounted(()=>{try{typeof localStorage<"u"&&localStorage.locale&&(a.value=localStorage.locale)}catch{}window.addEventListener("storage",s)}),e.onUnmounted(()=>{window.removeEventListener("storage",s)}),(i,c)=>{var u;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full relative",{"opacity-60":(u=i.item)==null?void 0:u.disabled}])},[e.createElementVNode("div",{class:e.normalizeClass(["gap-2 md:flex-row md:items-center md:justify-between",[["switcher","native-select"].includes(i.item.type)?"flex flex-col":""]])},[e.createElementVNode("div",Tm,[i.ua||i.label?(e.openBlock(),e.createElementBlock("p",$m,[e.createElementVNode("span",Lm,e.toDisplayString(i.item[a.value]||i.ua||i.label),1),n.value?(e.openBlock(),e.createElementBlock("span",Fm,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("p",Im,e.toDisplayString(r.value),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["w-full",["select","native-select"].includes(i.item.type)?"md:w-[30%]":"md:w-auto"])},[e.renderSlot(i.$slots,"default",e.normalizeProps(e.guardReactiveProps(i.$attrs)))],2)],2),o.value?(e.openBlock(),e.createElementBlock("p",Om,e.toDisplayString(o.value),1)):e.createCommentVNode("",!0)],2)}}}),Rm={default:Cm,horizontal:Sm,inline:Mm,settings:Pm};function pt(l){return{inputClass:e.computed(()=>{const t=`disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${(l==null?void 0:l.primaryColor)||"blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;return(l==null?void 0:l.size)==="sm"?`${t}h-[32px]`:`${t}h-[38px]`})}}const jm=["placeholder","disabled"],Um=e.defineComponent({__name:"vs-input-password",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=pt(t.style),r=e.useModel(l,"modelValue"),n=e.computed(()=>!!t.disabled),o=e.computed(()=>t.placeholder??"");return(s,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"password","onUpdate:modelValue":i[0]||(i[0]=c=>r.value=c),placeholder:o.value,disabled:n.value,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a),{"!border-red-600":s.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,jm)),[[e.vModelText,r.value]])}}),zm=["placeholder","disabled"],ma=e.defineComponent({__name:"vs-input-text",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=pt(t.style),r=e.useModel(l,"modelValue"),n=e.computed(()=>!!t.disabled),o=e.computed(()=>t.placeholder??"");return(s,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"text","onUpdate:modelValue":i[0]||(i[0]=c=>r.value=c),placeholder:o.value,disabled:n.value,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a),{"!border-red-600":s.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,zm)),[[e.vModelText,r.value]])}}),Hm=["placeholder","disabled","min","max"],Km=e.defineComponent({__name:"vs-input-number",props:e.mergeModels({min:{},max:{},style:{default:()=>({})},customClass:{},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=pt(t.style),r=e.useModel(l,"modelValue"),n=e.computed(()=>!!t.disabled);return(o,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"number",step:"any","onUpdate:modelValue":s[0]||(s[0]=i=>r.value=i),placeholder:o.placeholder,disabled:n.value,class:e.normalizeClass(["py-1.5 px-3 block w-full bg-white",[e.unref(a)]]),style:{border:"1px solid #CFD9E0"},min:o.min,max:o.max},null,10,Hm)),[[e.vModelText,r.value]])}}),ke=(l,t)=>{const a=l.__vccOpts||l;for(const[r,n]of t)a[r]=n;return a},qm={},Gm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function Wm(l,t){return e.openBlock(),e.createElementBlock("svg",Gm,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const Ym=ke(qm,[["render",Wm]]),Xm={class:"flex items-center gap-[4px]"},Zm=["value","id","disabled"],Qm=["for"],Jm={class:"text-[14px] text-gray-700 flex items-center dark:text-neutral-400"},e0=e.defineComponent({__name:"vs-checkbox-default",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},id:{},modelValue:{default:""},info:{},error:{}},emits:["update:modelValue"],setup(l,{emit:t}){const a=t,r=l,n=e.computed({get:()=>r.modelValue,set:s=>a("update:modelValue",s)}),o=e.computed(()=>!!r.disabled);return(s,i)=>(e.openBlock(),e.createElementBlock("div",Xm,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",value:s.value,"onUpdate:modelValue":i[0]||(i[0]=c=>n.value=c),class:e.normalizeClass(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer",{"!cursor-not-allowed":o.value}]),id:s.id,disabled:o.value},null,10,Zm),[[e.vModelCheckbox,n.value]]),e.createElementVNode("label",{for:s.id,class:e.normalizeClass(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300",{"!cursor-not-allowed":o.value}])},[e.createElementVNode("div",{class:e.normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded",[n.value?"bg-blue-600 border-blue-600":"bg-white border-gray-600",s.error?"border-red-600":""]])},[e.createVNode(Ym,{height:"12",width:"12"})],2),e.createElementVNode("span",Jm,[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(s.label),1)])])],10,Qm)]))}}),t0=["name","value","disabled"],l0={class:"flex items-center gap-[6px] text-[14px]"},a0={key:0,class:"text-[16px]"},r0=["src"],n0=e.defineComponent({__name:"vs-checkbox-buttons",props:{value:{type:[String,Number,Boolean],default:""},label:{default:""},modelValue:{default:""},disabled:{type:Boolean},id:{},icon:{},imgUrl:{},style:{}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l,r=t,n=e.computed({get:()=>a.modelValue,set:i=>{r("update:modelValue",i)}}),o=e.computed(()=>Array.isArray(n.value)?n.value.includes(a.value):n.value===!0||n.value===a.value),s=e.computed(()=>{var i,c;return((i=a.style)==null?void 0:i.size)==="xs"?"p-1.5 text-xs":((c=a.style)==null?void 0:c.size)==="lg"?"p-3.5 text-[20px]":"p-2.5 text-xs"});return(i,c)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg",[s.value,o.value?"ring-blue-500":"border border-gray-200 ring-transparent"]])},[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"hidden",name:i.id,value:i.value,"onUpdate:modelValue":c[0]||(c[0]=u=>n.value=u),disabled:i.disabled},null,8,t0),[[e.vModelCheckbox,n.value]]),e.createElementVNode("span",l0,[i.icon||i.imgUrl?(e.openBlock(),e.createElementBlock("span",a0,[i.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(i.icon)},null,2)):e.createCommentVNode("",!0),i.imgUrl?(e.openBlock(),e.createElementBlock("img",{key:1,src:i.imgUrl,width:"16",height:"16",alt:"icon"},null,8,r0)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(i.label),1)])])],2))}}),o0={class:"flex items-center"},kr=e.defineComponent({__name:"vs-input-checkbox-item",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},view:{default:"default"},modelValue:{type:[Boolean,Array],default:!1},icon:{},imgUrl:{},slots:{},option:{},style:{},error:{default:""}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l,r=t,n=`radio-${Math.floor(Math.random()*1e4)}`,o=e.computed({get:()=>Array.isArray(a.modelValue)?Array.isArray(a.modelValue)&&a.modelValue.includes(a.value):a.modelValue,set:i=>{if(Array.isArray(a.modelValue)){let c=[...a.modelValue];i?c.includes(a.value)||c.push(a.value):c=c.filter(u=>u!==a.value),r("update:modelValue",c)}else r("update:modelValue",i)}}),s=e.ref(`vs-checkbox-${a.view||"default"}`);return(i,c)=>{var u;return e.openBlock(),e.createElementBlock("div",o0,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value==="vs-checkbox-buttons"?e.unref(n0):e.unref(e0)),{value:i.value,label:i.label,info:(u=i.option)==null?void 0:u.info,disabled:i.disabled,modelValue:o.value,"onUpdate:modelValue":c[0]||(c[0]=d=>o.value=d),id:n,icon:i.icon,imgUrl:i.imgUrl,style:e.normalizeStyle(i.style),error:i.error},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.label),1)]),_:1},8,["value","label","info","disabled","modelValue","icon","imgUrl","style","error"]))])}}}),s0={},i0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"};function c0(l,t){return e.openBlock(),e.createElementBlock("svg",i0,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const d0=ke(s0,[["render",c0]]),u0={},p0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x"};function m0(l,t){return e.openBlock(),e.createElementBlock("svg",p0,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),e.createElementVNode("path",{d:"M6 6l12 12"},null,-1)]))}const f0=ke(u0,[["render",m0]]),h0={},g0={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"};function y0(l,t){return e.openBlock(),e.createElementBlock("svg",g0,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M12 9h.01"},null,-1),e.createElementVNode("path",{d:"M11 12h1v4h1"},null,-1),e.createElementVNode("path",{d:"M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z"},null,-1)]))}const b0=ke(h0,[["render",y0]]),k0={key:0,class:"flex items-start gap-x-1"},x0={key:0,class:"text-red-500 text-[14px]"},w0=["title"],E0=["disabled"],go=e.defineComponent({__name:"vs-input-switcher",props:e.mergeModels({rules:{default:()=>[]},view:{default:"checkbox"},label:{default:""},i:{default:""},text:{default:""},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue");return(r,n)=>{var o,s;return t.view==="checkbox"?(e.openBlock(),e.createElementBlock("div",k0,[e.createVNode(kr,{modelValue:a.value,"onUpdate:modelValue":n[0]||(n[0]=i=>a.value=i),label:r.text,error:r.error||""},null,8,["modelValue","label","error"]),(o=r.rules)!=null&&o.includes("required")?(e.openBlock(),e.createElementBlock("span",x0,"*")):e.createCommentVNode("",!0),r.i?(e.openBlock(),e.createElementBlock("button",{key:1,class:"cursor-pointer",title:r.i,onClick:n[1]||(n[1]=e.withModifiers(()=>{},["prevent"]))},[e.createVNode(e.unref(b0),{class:"text-gray-500 w-[14px] h-[14px]"})],8,w0)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50",[a.value?`bg-${((s=r.style)==null?void 0:s.primaryColor)||"blue"}-500`:"bg-stone-200",r.customClass]]),disabled:r.disabled,onClick:n[2]||(n[2]=i=>a.value=!a.value)},[e.createElementVNode("span",{"data-state":"checked",class:e.normalizeClass(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform",[a.value?"translate-x-4":"translate-x-0"]])},null,2)],10,E0))}}}),_0=["id","innerHTML"],yo=e.defineComponent({__name:"vs-input-static",props:{text:{default:""},html:{default:""},style:{},customClass:{default:""},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",{id:t.name,class:e.normalizeClass(["text-gray-900",t.customClass]),innerHTML:t.html?t.html:t.text},null,10,_0))}}),V0=["placeholder","disabled","name"],C0=e.defineComponent({__name:"vs-input-mask",props:e.mergeModels({name:{},mask:{default:""},unmask:{type:Boolean,default:!1},placeholder:{default:"_"},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=pt(t.style),r=e.useModel(l,"modelValue"),n=e.ref(null);let o=null;return e.onMounted(async()=>{if(n.value){const{default:s}=await Promise.resolve().then(()=>kB);o=s(n.value,{mask:t.mask||"",definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},lazy:!1}),o.on("accept",()=>{r.value=t.unmask?o.unmaskedValue:o.value}),o.on("complete",()=>{r.value=t.unmask?o.unmaskedValue:o.value}),o.value=r.value??""}}),e.onBeforeUnmount(()=>{o==null||o.destroy()}),e.watch(()=>t.mask,s=>{o&&o.updateOptions({mask:s,definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/}})}),e.watch(r,s=>{o&&o.unmaskedValue!==s&&(o.value=s||"")}),(s,i)=>(e.openBlock(),e.createElementBlock("input",{type:"text",ref_key:"inputEl",ref:n,placeholder:s.placeholder,disabled:s.disabled,name:s.name,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a)]]),style:{border:"1px solid #CFD9E0"}},null,10,V0))}}),N0={class:"relative w-full bg-white rounded-lg"},B0=["placeholder","disabled"],v0=e.defineComponent({__name:"vs-input-email",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:null},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=pt(t.style),r=e.useModel(l,"modelValue");return(n,o)=>(e.openBlock(),e.createElementBlock("div",N0,[o[1]||(o[1]=e.createStaticVNode('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>',1)),e.withDirectives(e.createElementVNode("input",{type:"email","onUpdate:modelValue":o[0]||(o[0]=s=>r.value=s),placeholder:n.placeholder,disabled:n.disabled,class:e.normalizeClass(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a),{"!border-red-600":n.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,B0),[[e.vModelText,r.value]])]))}}),S0=["value","disabled"],D0={class:"text-[13px] text-gray-700"},A0=e.defineComponent({__name:"vs-input-radio-default",props:e.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),r=e.computed(()=>!!t.disabled);return(n,o)=>{var s,i;return e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["flex items-center gap-0",[t.customClass,r.value?"cursor-not-allowed opacity-60":""]])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=c=>a.value=c),type:"radio",value:t.value,disabled:r.value,class:"hidden"},null,8,S0),[[e.vModelRadio,a.value]]),e.createElementVNode("span",{class:e.normalizeClass(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]",[`border-${((s=t.style)==null?void 0:s.primaryColor)||"blue"}-500`,r.value?"opacity-50 cursor-not-allowed":""]])},[a.value==t.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["w-[12px] h-[12px] shrink-0 rounded-full",[`bg-${((i=t.style)==null?void 0:i.primaryColor)||"blue"}-500`]])},null,2)):e.createCommentVNode("",!0)],2),e.createElementVNode("span",D0,e.toDisplayString(t.text),1)],2)}}}),M0=["value","disabled"],T0={class:"text-[13px] text-gray-700"},$0=e.defineComponent({__name:"vs-input-radio-buttons",props:e.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),r=e.computed(()=>!!t.disabled);return(n,o)=>{var s;return e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["flex items-center border rounded-lg px-2 py-1",[a.value==t.value?`ring-2 ring-ring ring-${((s=t.style)==null?void 0:s.primaryColor)||"blue"}-500`:"",t.customClass,r.value?"cursor-not-allowed opacity-60":""]])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=i=>a.value=i),type:"radio",value:t.value,disabled:r.value,class:"hidden"},null,8,M0),[[e.vModelRadio,a.value]]),e.createElementVNode("span",T0,e.toDisplayString(t.text),1)],2)}}}),L0={"vs-input-radio-default":A0,"vs-input-radio-buttons":$0},bo=e.defineComponent({__name:"vs-input-radio",props:e.mergeModels({options:{},position:{default:"vertical"},view:{default:"default"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),r=e.computed(()=>L0[`vs-input-radio-${t.view}`]);return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([n.position==="horizontal"?"flex items-center flex-wrap gap-2":""])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.options,s=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),e.mergeProps({key:s==null?void 0:s.id,text:s.text,value:s.id.toString(),checked:a.value===s.id,modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=i=>a.value=i)},{ref_for:!0},n.$attrs),null,16,["text","value","checked","modelValue"]))),128))],2))}}),F0={key:1,class:"w-full flex flex-col gap-4"},I0={key:0,class:"text-sm font-medium text-muted-foreground my-2"},O0="Без категорії",P0=e.defineComponent({__name:"vs-input-checkbox",props:{options:{default:()=>[]},position:{default:"vertical"},slots:{default:null},colSpan:{default:0},data:{},view:{},group:{default:void 0},values:{default:()=>[]},style:{},customClass:{},disabled:{type:Boolean},modelValue:{default:!1},error:{},name:{},placeholder:{}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l,r=t,n=e.ref([]),o=e.reactive({}),s=f=>(f==null?void 0:f.value)||(f==null?void 0:f.id)||(f==null?void 0:f.text)||f,i=f=>f.text||String(f),c=f=>`lg:col-span-${f||12}`,u=e.computed(()=>[a.position==="vertical"?"flex flex-col":"",a.colSpan?"grid":"flex justify-start"]),d=f=>f==null||f===""?null:typeof f=="string"||typeof f=="number"?f:String(f),p=e.computed(()=>{var k;if(!a.group)return[];const f=new Map;n.value.forEach(x=>{var V;const b=x[a.group],_=d(b);f.has(_)||f.set(_,[]),(V=f.get(_))==null||V.push(x)});const g=[];(k=a.values)!=null&&k.length&&a.values.forEach(x=>{const b=d(x);g.push(b)});const y=new Set,w=x=>{const b=f.get(x)||[];if(!b.length)return null;const _=x===null?"group-null":`group-${String(x)}`,V=x===null?O0:String(x);return y.add(x),{key:_,label:V,options:b}},h=[];return g.forEach(x=>{const b=w(x);b&&h.push(b)}),f.forEach((x,b)=>{if(y.has(b))return;const _=w(b);_&&h.push(_)}),h}),m=async()=>{try{const f=await fetch(`/api/suggest/${a.data}`).then(g=>g.json());n.value=(f==null?void 0:f.data)||f}catch(f){console.error(f)}};return e.watch(()=>a.modelValue,f=>{if(typeof f=="boolean"&&n.value.length===1){const g=s(n.value[0]);o[g]=f}else if(Array.isArray(f)){const g=new Set(f);n.value.forEach(y=>{if(!y.disabled){const w=s(y);o[w]=g.has(w)}})}},{immediate:!0}),e.watch(o,()=>{if(!n.value.length){r("update:modelValue",null);return}const f=Object.entries(o).filter(([,g])=>g).map(([g])=>g);r("update:modelValue",f.length===0?[]:f)},{deep:!0}),e.onMounted(()=>{if(a.data)m().then(()=>{if(typeof a.modelValue=="boolean"&&n.value.length===1){const f=s(n.value[0]);o[f]=a.modelValue}else if(Array.isArray(a.modelValue)){const f=new Set(a.modelValue);n.value.forEach(g=>{if(!g.disabled){const y=s(g);o[y]=f.has(y)}})}});else if(n.value=a.options,typeof a.modelValue=="boolean"&&n.value.length===1){const f=s(n.value[0]);o[f]=a.modelValue}else if(Array.isArray(a.modelValue)){const f=new Set(a.modelValue);n.value.forEach(g=>{if(!g.disabled){const y=s(g);o[y]=f.has(y)}})}}),(f,g)=>a.group?(e.openBlock(),e.createElementBlock("div",F0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,y=>(e.openBlock(),e.createElementBlock("div",{key:y.key,class:"flex flex-col gap-2"},[y.label?(e.openBlock(),e.createElementBlock("span",I0,e.toDisplayString(y.label),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["p-0 w-full gap-[12px]",u.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.options,w=>(e.openBlock(),e.createBlock(kr,{modelValue:o[s(w)],"onUpdate:modelValue":h=>o[s(w)]=h,value:s(w),class:e.normalizeClass(c(f.colSpan)),disabled:a.disabled||w.disabled,label:i(w),key:`${y.key}-${s(w)}`,icon:w==null?void 0:w.icon,imgUrl:w==null?void 0:w.imgUrl,option:w,view:f.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2)]))),128))])):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["p-0 w-full gap-[10px]",u.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,y=>(e.openBlock(),e.createBlock(kr,{modelValue:o[s(y)],"onUpdate:modelValue":w=>o[s(y)]=w,value:s(y),class:e.normalizeClass(c(f.colSpan)),disabled:a.disabled||y.disabled,label:i(y),key:s(y),icon:y==null?void 0:y.icon,imgUrl:y==null?void 0:y.imgUrl,option:y,view:f.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2))}}),ko=ke(P0,[["__scopeId","data-v-8e66207e"]]),R0=["type","placeholder","disabled"],j0=e.defineComponent({__name:"vs-input-date1",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},mode:{default:"date"}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l;function r(d){return d?a.mode==="datetime"?(d.includes("T")?d:null)||d+(d.includes(" ")?"":"T00:00"):d==null?void 0:d.split(" ")[0]:null}const{inputClass:n}=pt(a.style),o=t,s=e.computed({get:()=>r(a.modelValue),set:d=>o("update:modelValue",d)}),i=e.computed(()=>a.mode==="datetime"?"datetime-local":a.mode),c=e.computed(()=>!!a.disabled),u=e.computed(()=>a.placeholder??"");return(d,p)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:i.value,"onUpdate:modelValue":p[0]||(p[0]=m=>s.value=m),placeholder:u.value,disabled:c.value,ref:"date",class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[d.modelValue?"":"text-opacity-50",e.unref(n)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,R0)),[[e.vModelDynamic,s.value]])}}),xo=async(l,t,a,r)=>{var n;try{const o=new FormData;return o.append("unique","true"),o.append("file",l),(n=await fetch(`/file/upload/uploads?id=${t||""}&form=${a||""}&table=${r||""}`,{method:"POST",body:o}).then(s=>s.json()))==null?void 0:n.result}catch(o){return xe({type:"error",title:"Помилка!",message:"Сталась помилка під час завантаження файлу",position:"right-bottom"}),console.error("Сталась помилка завантаження файлу",o),null}},U0=async l=>{try{return await fetch(`file/delete${l}`),!0}catch(t){return console.error(t),!1}},wo=async l=>{try{const t=await fetch(`file/download/files/uploads${l}`),a=await t.arrayBuffer(),r=t.headers["content-type"],n=new TextDecoder("utf-8").decode(a),o=new Blob([n],{type:r}),s=document.createElement("a");s.setAttribute("download",l),s.href=window.URL.createObjectURL(o),s.click()}catch(t){console.error(t.message)}},z0={},H0={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"};function K0(l,t){return e.openBlock(),e.createElementBlock("svg",H0,t[0]||(t[0]=[e.createElementVNode("path",{d:"M5 12h14"},null,-1),e.createElementVNode("path",{d:"M12 5v14"},null,-1)]))}const Ll=ke(z0,[["render",K0]]),q0={},G0={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-text",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function W0(l,t,a,r,n,o){return e.openBlock(),e.createElementBlock("svg",G0,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>',6)]))}const Y0=ke(q0,[["render",W0]]),X0={},Z0={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-table",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function Q0(l,t,a,r,n,o){return e.openBlock(),e.createElementBlock("svg",Z0,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"},null,-1),e.createElementVNode("line",{x1:"4",y1:"10",x2:"20",y2:"10"},null,-1),e.createElementVNode("line",{x1:"10",y1:"4",x2:"10",y2:"20"},null,-1)]))}const J0=ke(X0,[["render",Q0]]),ef={},tf={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"};function lf(l,t){return e.openBlock(),e.createElementBlock("svg",tf,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M9 9l1 0"></path><path d="M9 13l6 0"></path><path d="M9 17l6 0"></path>',6)]))}const Eo=ke(ef,[["render",lf]]),af={},rf={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-zip",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function nf(l,t,a,r,n,o){return e.openBlock(),e.createElementBlock("svg",rf,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>',9)]))}const of=ke(af,[["render",nf]]),sf={},cf={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-code",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function df(l,t,a,r,n,o){return e.openBlock(),e.createElementBlock("svg",cf,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>',5)]))}const uf=ke(sf,[["render",df]]),pf=l=>{if(!l)return"";const t=l==null?void 0:l.split(".");return t[t.length-1]},mf=l=>{const t=pf(l),a={imageFormat:["tiff","jpg","jpeg","png","svg","ico","webp"],sheetsFormat:["xls","csv","xlsx"],archivesFormat:["zip","rar"],textsFormat:["json","geojson","txt","yml","yaml","shp"],documentsFormat:["pdf"]};return a.imageFormat.includes(t)?"img":a.sheetsFormat.includes(t)?J0:a.textsFormat.includes(t)?uf:a.documentsFormat.includes(t)?Y0:a.archivesFormat.includes(t)?of:Eo},ff={},hf={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:"icon icon-tabler icons-tabler-outline icon-tabler-trash"};function gf(l,t){return e.openBlock(),e.createElementBlock("svg",hf,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>',6)]))}const fa=ke(ff,[["render",gf]]),yf={},bf={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:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function kf(l,t){return e.openBlock(),e.createElementBlock("svg",bf,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const _o=ke(yf,[["render",kf]]),xf=["title"],wf={class:"absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center"},Ef=e.defineComponent({__name:"vs-input-file-list-item",props:e.mergeModels({format:{},multiple:{type:Boolean},max_size:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{value:{},valueModifiers:{},item:{},itemModifiers:{}}),emits:["update:value","update:item"],setup(l){const t=e.useModel(l,"value"),a=e.useModel(l,"item"),r=l;return(n,o)=>(e.openBlock(),e.createElementBlock("div",{title:a.value,class:"h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(mf)(a.value)),{src:a.value,alt:"file",class:"w-full h-full object-cover cursor-pointer",onClick:o[0]||(o[0]=s=>e.unref(wo)(a.value))},null,8,["src"])),e.createElementVNode("div",wf,[e.createElementVNode("button",{type:"button",onClick:o[1]||(o[1]=s=>{var i;e.unref(U0)(a.value),t.value=r.multiple?(i=t.value)==null?void 0:i.filter(c=>c!==a.value):""}),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"},[e.createVNode(fa,{class:"w-4 h-4"})]),e.createElementVNode("button",{type:"button",onClick:o[2]||(o[2]=s=>e.unref(wo)(a.value)),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"},[e.createVNode(_o,{class:"w-4 h-4"})])])],8,xf))}}),Vo=ke(Ef,[["__scopeId","data-v-286cdbc0"]]),_f={class:"flex items-center gap-x-2"},Vf=["multiple","disabled"],Cf={key:1,class:"flex items-center flex-wrap gap-2"},Nf={key:1,class:"loader"},Bf={key:1,class:"loader"},vf=e.defineComponent({__name:"vs-input-file",props:e.mergeModels({format:{},multiple:{type:Boolean},max_size:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["change"],["update:modelValue"]),setup(l,{emit:t}){const a=l,r=e.useModel(l,"modelValue"),n=t,o=e.ref(null),s=e.ref(!1),i=d=>Array.isArray(r.value)&&r.value[d]||"",c=d=>{if(a.max_size&&d.size>a.max_size*1024*1024){const p=(d.size/1048576).toFixed(2);return xe({type:"error",title:"Помилка!",message:`Файл "${d.name}" занадто великий. Максимальний розмір: ${a.max_size} МБ, розмір файлу: ${p} МБ`,position:"right-bottom"}),!1}return!0},u=async d=>{const{files:p}=d.target;if(!p||p.length===0)return;const m=Array.from(p);if(a.max_size&&m.filter(f=>!c(f)).length>0){o.value&&(o.value.value="");return}s.value=!0;try{if(a.multiple){const f=Array.from(p).map(async y=>a.format&&!y.name.endsWith(a.format)?null:await xo(y,"1","form","table")),g=(await Promise.all(f)).filter(y=>y!==null).map(y=>y==null?void 0:y.file_path).filter(Boolean);r.value=[...r.value||[],...g],n("change",r.value)}else{const f=p[0];if(a.format&&!f.name.endsWith(a.format))return;const g=await xo(f,"1","form","table");r.value=g==null?void 0:g.file_path,n("change",r.value||"")}}finally{s.value=!1,o.value&&(o.value.value="")}};return(d,p)=>(e.openBlock(),e.createElementBlock("div",_f,[e.createElementVNode("input",{class:"hidden",ref_key:"fileInput",ref:o,type:"file",multiple:d.multiple,onChange:u,disabled:s.value||d.disabled},null,40,Vf),!d.multiple&&r.value?(e.openBlock(),e.createBlock(Vo,{key:0,item:r.value,"onUpdate:item":p[0]||(p[0]=m=>r.value=m),value:r.value,"onUpdate:value":p[1]||(p[1]=m=>r.value=m)},null,8,["item","value"])):d.multiple?(e.openBlock(),e.createElementBlock("div",Cf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(m,f)=>(e.openBlock(),e.createBlock(Vo,{multiple:d.multiple,key:f,value:r.value,"onUpdate:value":p[2]||(p[2]=g=>r.value=g),item:i(f)},null,8,["multiple","value","item"]))),128)),e.createElementVNode("div",{onClick:p[3]||(p[3]=m=>{var f;return!d.disabled&&!s.value&&((f=o.value)==null?void 0:f.click())}),class:e.normalizeClass(["relative h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",d.disabled||s.value?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500 hover:bg-blue-50"])},[s.value?(e.openBlock(),e.createElementBlock("div",Nf)):(e.openBlock(),e.createBlock(Ll,{key:0,class:"w-6 h-6"}))],2)])):e.createCommentVNode("",!0),d.multiple?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:p[4]||(p[4]=m=>{var f;return(f=o.value)==null?void 0:f.click()}),class:e.normalizeClass([d.disabled||s.value?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500","relative h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])},[s.value?(e.openBlock(),e.createElementBlock("div",Bf)):(e.openBlock(),e.createBlock(Ll,{key:0,class:"w-6 h-6"}))],2))]))}}),Sf=ke(vf,[["__scopeId","data-v-e613a523"]]),Df={class:"max-w-[55vw]"},Af={class:"text-sm font-semibold text-gray-800 truncate dark:text-neutral-200"},Mf={class:"flex items-center text-xs text-gray-500 truncate dark:text-neutral-500"},Tf={class:"px-[5px]"},$f={class:""},ha=e.defineComponent({__name:"vs-widget-file-info",props:{item:{default:null}},setup(l){const t=l,a=e.computed(()=>{try{return new Date(t.item.cdate).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}});function r(n){if(n<1024)return`${n} B`;const o=n/1024;return o<1024?`${o.toFixed(2)} KB`:`${(o/1024).toFixed(2)} MB`}return(n,o)=>{var s,i,c,u;return e.openBlock(),e.createElementBlock(e.Fragment,null,[o[1]||(o[1]=e.createStaticVNode('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>',1)),e.createElementVNode("div",Df,[e.createElementVNode("p",Af,e.toDisplayString((s=n.item)==null?void 0:s.uploaded_name),1),e.createElementVNode("p",Mf,[e.createElementVNode("span",null,e.toDisplayString((i=n.item)==null?void 0:i.username),1),e.withDirectives(e.createElementVNode("span",Tf,"|",512),[[e.vShow,(c=n.item)==null?void 0:c.username]]),e.createElementVNode("span",null,e.toDisplayString(a.value),1),o[0]||(o[0]=e.createElementVNode("span",{class:"px-[5px]"},"|",-1)),e.createElementVNode("span",$f,e.toDisplayString(r((u=n.item)==null?void 0:u.size)),1)])])],64)}}}),Lf={class:"p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full"},Ff={key:0,class:"flex w-full gap-x-3 items-center"},If={key:1,class:"flex gap-x-3 w-full items-center"},Of={key:2,class:"flex gap-x-3 w-full items-center"},Pf=["href"],Rf={key:3,class:"flex gap-x-3 w-full items-center"},jf={class:"lg:absolute lg:top-3 lg:end-1 opacity-100"},Uf={class:"p-0.5 sm:p-1 inline-flex items-center gap-0.5 bg-white rounded-lg dark:bg-neutral-800 dark:border-neutral-700"},zf={class:"inline-block"},Hf={class:"inline-block"},Kf=e.defineComponent({__name:"vs-widget-file-item",props:{item:{default:null},index:{default:0},prefix:{default:"/api"}},emits:["update","openModal","openLightbox"],setup(l,{emit:t}){const a=l,r=t;function n(d){return["pdf","json"].includes(d.ext)}function o(d){return["ppt","pptx","doc","docx","xls","xlsx"].includes(d.ext)}function s(d){const p=document.createElement("a");p.setAttribute("download",d==null?void 0:d.uploaded_name),p.href=d==null?void 0:d.file_path,p.click()}async function i(){try{await fetch(`${a.prefix}/widget/file/${a.item.entity_id}/${a.item.file_id}`),r("update")}catch(d){console.error(d)}}function c(){r("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:i,updateListOnConfirm:!0})}function u(d){(a.item.ext==="jpg"||a.item.ext==="png")&&r("openLightbox",{item:a.item,index:d})}return(d,p)=>(e.openBlock(),e.createElementBlock("div",Lf,[d.item.ext==="jpg"||d.item.ext==="png"?(e.openBlock(),e.createElementBlock("div",Ff,[e.createElementVNode("div",{class:"max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",onClick:p[0]||(p[0]=m=>u(d.index))},[e.createVNode(ha,{item:d.item},null,8,["item"])])])):n(d.item)?(e.openBlock(),e.createElementBlock("div",If,[e.createVNode(ha,{item:d.item},null,8,["item"])])):o(d.item)?(e.openBlock(),e.createElementBlock("div",Of,[e.createElementVNode("a",{href:`/api/file-preview?id=${d.item.file_id}`,target:"_blank",class:"flex gap-x-3 w-full items-center"},[e.createVNode(ha,{item:d.item},null,8,["item"])],8,Pf)])):(e.openBlock(),e.createElementBlock("div",Rf,[e.createVNode(ha,{item:d.item},null,8,["item"])])),e.createElementVNode("div",jf,[e.createElementVNode("div",Uf,[e.createElementVNode("div",zf,[e.createElementVNode("button",{class:"inline-flex p-[6px] justify-center items-center gap-x-2 rounded-lg border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:p[1]||(p[1]=m=>s(d.item))},[e.createVNode(_o,{height:"14",width:"14"})])]),p[3]||(p[3]=e.createElementVNode("div",{class:"w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700"},null,-1)),e.createElementVNode("div",Hf,[e.createElementVNode("button",{type:"button",class:"size-[30px] inline-flex justify-center items-center gap-x-2 rounded-lg border border-transparent text-red-600 hover:bg-red-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-red-100 dark:text-red-500 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",onClick:p[2]||(p[2]=m=>c())},[e.createVNode(fa,{height:"14",width:"14"})])])])])]))}}),qf={},Gf={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:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function Wf(l,t){return e.openBlock(),e.createElementBlock("svg",Gf,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const Yf=ke(qf,[["render",Wf]]),Xf={class:"flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full"},Zf={class:"flex w-full mb-[12px] items-center gap-x-2"},Qf={class:"font-semibold text-gray-800 dark:text-neutral-200 text-[14px]"},Jf={class1:"ml-auto"},eh={class:"py-1.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 cursor-pointer hover:bg-gray-200 text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},th={key:0,class:"py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"},lh={class:"relative"},ah={key:1,class:"space-y-3 max-h-[300px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},rh={key:0},nh=e.defineComponent({__name:"vs-input-file-list",props:{id:{default:""},prefix:{default:"/api"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},emits:["update"],setup(l,{emit:t}){const a=l,r=e.inject("form"),n=e.computed(()=>r.value.formId),o=e.ref(!1),s=e.ref(0),i=t,c=e.ref(!1),u=e.ref({}),d=e.ref([]),p=e.ref(""),m=e.computed(()=>Array.isArray(d.value)?d.value.filter(x=>x.ext==="jpg"||x.ext==="png").map(x=>x==null?void 0:x.file_path):[]),f=e.computed(()=>p.value===""?d.value:d.value.filter(x=>{var b;return(b=x==null?void 0:x.uploaded_name)==null?void 0:b.includes(p.value)})),g=x=>{const b=m.value.findIndex(_=>_===x.item.file_path);b!==-1&&(o.value=!0,s.value=b)},y=async()=>{try{const x=await fetch(`${a.prefix}/widget/file/${n.value}`).then(b=>b.json());d.value=x==null?void 0:x.rows}catch(x){console.error(x)}},w=async x=>{await Promise.all(Array.from(x.target.files).map(async b=>{const _=new FormData;_.append("file",b);try{const V=`${a.prefix}/widget/file/${n.value}`,E=await fetch(V,{method:"POST",body:_});return E.ok?(i("update","file-list"),b):(xe({type:E.status>=400&&E.status<500?"warning":"error",title:"Error",message:`Error code: ${E.status}`}),null)}catch(V){return xe({type:"error",title:"Error",message:V.message||"Unknown error"}),console.error(V),null}})),await y()},h=x=>{const b={...x};return x.cancel||(b.cancel=()=>{c.value=!1}),x.updateListOnConfirm&&(b.confirm=async()=>{await x.confirm(),c.value=!1,y()}),b},k=x=>{u.value=h(x),c.value=!0};return e.watch(n,x=>{x&&y()}),e.onMounted(()=>{n.value&&y()}),(x,b)=>{var E,D,$;const _=e.resolveComponent("Lightbox"),V=e.resolveComponent("MessageBox");return e.openBlock(),e.createElementBlock("div",Xf,[e.createElementVNode("div",Zf,[e.createElementVNode("h2",Qf," Файлів: "+e.toDisplayString((E=d.value)==null?void 0:E.length),1),e.createElementVNode("div",Jf,[e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",class:"hidden",onChange:b[0]||(b[0]=C=>w(C))},null,32),e.createElementVNode("div",eh,[e.createVNode(Yf,{height:"16",width:"16"})])])])]),((D=d.value)==null?void 0:D.length)>4?(e.openBlock(),e.createElementBlock("div",th,[e.createElementVNode("div",null,[e.createElementVNode("div",lh,[b[8]||(b[8]=e.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5"},[e.createElementVNode("svg",{class:"flex-shrink-0 text-gray-500 size-4 dark:text-neutral-400",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"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("path",{d:"m21 21-4.3-4.3"})])],-1)),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":b[1]||(b[1]=C=>p.value=C),class:"py-2 px-3 ps-10 pe-16 block w-full bg-gray-200 xl:bg-gray-100 rounded-lg text-sm focus:border-blue-500 h-[40px] focus:border-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",placeholder:"Введіть назву файлу"},null,512),[[e.vModelText,p.value,void 0,{trim:!0}]])])])])):e.createCommentVNode("",!0),($=d.value)!=null&&$.length?(e.openBlock(),e.createElementBlock("div",ah,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(C,B)=>(e.openBlock(),e.createBlock(Kf,{key:B,prefix:x.prefix,item:C,index:B,onUpdate:b[2]||(b[2]=M=>x.$emit("update","file-list")),onOpenModal:b[3]||(b[3]=M=>k(M)),onOpenLightbox:b[4]||(b[4]=M=>g(M))},null,8,["prefix","item","index"]))),128)),f.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",rh,b[9]||(b[9]=[e.createElementVNode("p",{class:"text-sm text-gray-600 font-sm"}," Файлів з такою назвою не існує, введіть інше пошукове слово ",-1)])))])):e.createCommentVNode("",!0),e.createVNode(_,{modelValue:o.value,"onUpdate:modelValue":b[5]||(b[5]=C=>o.value=C),startIndex:s.value,"onUpdate:index":b[6]||(b[6]=C=>s.value=C),images:m.value},null,8,["modelValue","startIndex","images"]),e.createVNode(V,e.mergeProps({modelValue:c.value,"onUpdate:modelValue":b[7]||(b[7]=C=>c.value=C),onConfirm:u.value.confirm},u.value),null,16,["modelValue","onConfirm"])])}}}),oh={class:"flex items-center justify-between"},sh={class:"text-[16px] text-gray-900 font-medium"},ih={class:"grid gap-3"},ch=e.defineComponent({__name:"vs-container-switcher",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(l){const t=l,a=e.ref(t.isOpen);return e.watch(()=>t.isOpen,r=>{a.value=r}),(r,n)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",oh,[e.createElementVNode("p",sh,e.toDisplayString(l.title),1),e.createVNode(go,{modelValue:a.value,"onUpdate:modelValue":n[0]||(n[0]=o=>a.value=o),style:e.normalizeStyle(l.style)},null,8,["modelValue","style"])]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",ih,[e.renderSlot(r.$slots,"default",{},void 0,!0)],512),[[e.vShow,a.value]])]),_:3})]))}}),dh=ke(ch,[["__scopeId","data-v-90320b87"]]),uh={class:"text-[16px] text-gray-900 font-medium"},ph={class:"grid gap-3"},mh=e.defineComponent({__name:"vs-container-accordion",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(l){const t=l,a=e.ref(t.isOpen);return e.watch(()=>t.isOpen,r=>{a.value=r}),(r,n)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{type:"button",onClick:n[0]||(n[0]=o=>a.value=!a.value),class:"flex items-center gap-2"},[e.createVNode(e.unref(d0),{class:e.normalizeClass(["h-4 w-4 duration-300",[a.value?"-rotate-180":""]])},null,8,["class"]),e.createElementVNode("span",uh,e.toDisplayString(l.title),1)]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",ph,[e.renderSlot(r.$slots,"default",{},void 0,!0)],512),[[e.vShow,a.value]])]),_:3})]))}}),fh=ke(mh,[["__scopeId","data-v-590eff11"]]),hh={class:"flex items-center justify-between"},gh=e.defineComponent({__name:"vs-container-default",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",hh,[e.createElementVNode("p",null,e.toDisplayString(l.title),1)]),e.renderSlot(t.$slots,"default")]))}}),yh={switcher:dh,accordion:fh,default:gh},kt={Equal:"==",Inequal:"!=",Higer:">",HigerOrEqual:">=",Lower:"<",LowerOrEqual:"<=",Between:"between",StartWith:"^",EndWith:"$",Contain:"*",In:"in",NotIn:"not_in"},bh=(l,t)=>String(l)===String(t),kh=(l,t)=>String(l)!==String(t),xh=(l,t)=>l>t,wh=(l,t)=>l>=t,Eh=(l,t)=>l<t,_h=(l,t)=>l<=t,Vh=(l,t)=>Array.isArray(t)&&t.length===2?l>=t[0]&&l<=t[1]:!1,Ch=(l,t)=>String(l).startsWith(String(t)),Nh=(l,t)=>String(l).endsWith(String(t)),Bh=(l,t)=>String(l).includes(String(t)),vh=(l,t)=>Array.isArray(t)?t.includes(l):!1,Sh=(l,t)=>Array.isArray(t)?!t.includes(l):!0,Co=(l,t)=>{if(!t)return!0;switch(t==null?void 0:t[1]){case kt.Equal:return bh(l,t==null?void 0:t[2]);case kt.Inequal:return kh(l,t==null?void 0:t[2]);case kt.Higer:return xh(l,t==null?void 0:t[2]);case kt.HigerOrEqual:return wh(l,t==null?void 0:t[2]);case kt.Lower:return Eh(l,t==null?void 0:t[2]);case kt.LowerOrEqual:return _h(l,t==null?void 0:t[2]);case kt.Between:return Vh(l,t==null?void 0:t[2]);case kt.StartWith:return Ch(l,t==null?void 0:t[2]);case kt.EndWith:return Nh(l,t==null?void 0:t[2]);case kt.Contain:return Bh(l,t==null?void 0:t[2]);case kt.In:return vh(l,t==null?void 0:t[2]);case kt.NotIn:return Sh(l,t==null?void 0:t[2]);default:return!0}},Dh=e.defineComponent({__name:"vs-input-container",props:{style:{type:Object,default:()=>({})},title:{type:String,default:""},view:{type:String,default:"default"},name:{type:String,default:""},schema:{type:Array,default:()=>[]}},setup(l){const t=l,a=e.inject("values",e.ref({})),r=e.inject("form"),n=e.computed(()=>{var i;return(i=t.schema)==null?void 0:i.filter(c=>{var m,f,g,y;const u=c==null?void 0:c.conditions;if(!u)return!0;const d=Array.isArray(u)?u[0]:u,p=t.name?((f=(m=a.value)==null?void 0:m[t.name])==null?void 0:f[d])??((g=a.value)==null?void 0:g[d]):(y=a.value)==null?void 0:y[d];return Co(p,u)})}),o=e.computed(()=>yh[t.view]),s=e.computed(()=>{if(a.value||(a.value={}),!t.name)return a.value;const i=a.value[t.name];if(i)return i;const c={};return a.value={...a.value,[t.name]:c},c});return(i,c)=>{var u;return(u=l.schema)!=null&&u.length?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{key:0,title:l.title,style:e.normalizeStyle(l.style)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,d=>{var p,m;return e.openBlock(),e.createBlock(Bo,e.mergeProps({key:d.name},{ref_for:!0},d,{item:d,modelValue:s.value[d.name],"onUpdate:modelValue":f=>s.value[d.name]=f,style:l.style,error:(m=(p=e.unref(r))==null?void 0:p.errors)==null?void 0:m[d.name]}),null,16,["item","modelValue","onUpdate:modelValue","style","error"])}),128))]),_:1},8,["title","style"])):e.createCommentVNode("",!0)}}}),Ah=["aria-expanded","data-focus"],Mh={key:0,class:"flex flex-wrap items-center gap-1 overflow-y-auto min-w-0 flex-1"},Th={class:"flex items-center min-w-0"},$h=["title"],Lh=["innerHTML"],Fh=["onClick"],Ih={class:"flex-1 min-w-[2px]"},Oh=["placeholder"],Ph=["title"],Rh=["innerHTML"],jh={key:2,class:"flex-1 min-w-[2px]"},Uh=["placeholder"],zh={class:"flex items-center shrink-0"},Hh=["disabled"],Kh=["disabled","title"],qh=["aria-disabled","onClick"],Gh=["innerHTML"],Wh={key:1,class:"px-3 py-2 text-center text-gray-500"},Yh=["disabled"],xr=e.defineComponent({__name:"vs-input-select",props:{multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},mode:{},defaultValue:{},search:{type:Boolean,default:!0},placeholder:{default:"Оберіть значення"},prefix:{default:"api"},host:{default:""},data:{default:""},options:{default:()=>[]},api:{default:null},maxHeight:{default:400},parent:{},set:{},slot:{},add:{},teleport:{default:"body"},auto:{default:0},style:{default:()=>({})},customClass:{default:""},modelValue:{},error:{default:null},name:{}},emits:["change","update:modelValue"],setup(l,{emit:t}){const a=l,r=t,n=e.computed(()=>a.multiple),o=e.computed(()=>a.disabled);pt(a.style);const s=e.computed({get:()=>a.modelValue,set:A=>r("update:modelValue",A)});!s.value&&a.defaultValue&&(s.value=a.defaultValue);const i=e.ref(null),c=e.ref(null),u=e.ref(null),d=e.ref(null),p=e.ref(!1),m=e.ref(!1),f=e.ref(null),g=e.ref([]),y=e.ref(-1),w=e.ref([]),h=e.ref(""),k=e.ref(null),x=e.ref("bottom"),b=e.ref({}),_=e.ref([]),V=e.computed(()=>{if(!_.value.length)return[];const A=g.value,R=new Map(A.map(Y=>{var ee;return[(ee=Y.id)==null?void 0:ee.toString(),Y]}));return _.value.map(Y=>R.get(Y==null?void 0:Y.toString())).filter(Y=>!!Y)}),E=e.computed(()=>a.placeholder||"Select..."),D=e.computed(()=>F(f.value));e.computed(()=>n.value?!_.value.length&&h.value==="":!D.value&&h.value==="");const $=e.computed(()=>o.value?!1:n.value?_.value.length>0:!!s.value),C=A=>{var R;return n.value?_.value.some(Y=>(Y==null?void 0:Y.toString())===(A==null?void 0:A.toString())):((R=s.value)==null?void 0:R.toString())===(A==null?void 0:A.toString())},B=e.computed(()=>{let A=g.value??[];if(!a.data&&h.value.trim()!==""){const R=h.value.toLowerCase();A=A.filter(Y=>{var be,$e;const ee=F(Y).toLowerCase(),he=(($e=(be=Y.text)==null?void 0:be.toLowerCase)==null?void 0:$e.call(be))||"";return ee.includes(R)||he.includes(R)})}if(n.value&&_.value.length){const R=new Set(_.value.map(Y=>Y==null?void 0:Y.toString()));A=A.filter(Y=>{var ee;return!R.has((ee=Y.id)==null?void 0:ee.toString())})}return A}),M=e.inject("values"),U=/\{\{\s*([^}]+?)\s*\}\}/g,P=A=>(A?String(A):"").replace(/<[^>]*>/g,"").trim(),I=e.computed(()=>a.slot??(a==null?void 0:a.optionTemplate)??""),O=A=>{if(!A)return"";const R=I.value;return R?R.replace(U,(Y,ee)=>{const he=ee.trim(),be=A[he];return be!=null?String(be):""}):A.text??""},F=A=>{if(!A)return"";if(!I.value)return A.text??"";const R=O(A);return P(R)||A.text||""},H=A=>{a.set&&(M!=null&&M.value)&&Object.entries(a.set).forEach(([R,Y])=>{if(!R)return;const ee=A?A[Y]:null;M.value[R]=ee??null})},Q=e.computed(()=>{var A,R;return a.parent?((R=(A=M==null?void 0:M.value)==null?void 0:A[a.parent])==null?void 0:R.toString())??null:null}),pe=async A=>{var R;if(!a.data){let Y=a.options??[];if(A!=null&&A.trim()){const ee=A.toLowerCase();Y=Y.filter(he=>{var oe,ct;const be=F(he).toLowerCase(),$e=((ct=(oe=he.text)==null?void 0:oe.toLowerCase)==null?void 0:ct.call(oe))||"";return be.includes(ee)||$e.includes(ee)})}return Y}try{const Y=a.host??"",ee=a.prefix??"api",he=a.api??`/${ee}/suggest/${a.data}`,be=`${Y}${he}`,$e=new URLSearchParams;return $e.set("json","1"),A&&$e.set("key",A),Q.value!==void 0&&Q.value!==null&&Q.value!==""&&$e.set("parent",Q.value),((R=await fetch(`${be}?${$e.toString()}`).then(oe=>oe.json()))==null?void 0:R.data)??[]}catch{return[]}},Ve=async()=>{a.data?g.value=await pe(h.value):g.value=a.options?[...a.options]:[]},ze=async A=>{var Y,ee,he;if(A==null)return null;const R=(Y=g.value)==null?void 0:Y.find(be=>{var $e;return(($e=be==null?void 0:be.id)==null?void 0:$e.toString())===String(A)});if(R)return R;if(a.data)try{const be=a.host??"",$e=a.prefix??"api",oe=a.api??`/${$e}/suggest/${a.data}`,ct=`${be}${oe}`,Nt=new URLSearchParams;return Nt.set("json","1"),Nt.set("val",String(A)),Q.value!==void 0&&Q.value!==null&&Q.value!==""&&Nt.set("parent",Q.value),((he=((ee=await fetch(`${ct}?${Nt.toString()}`).then(pl=>pl.json()))==null?void 0:ee.data)??[])==null?void 0:he[0])??null}catch{return null}return null},Kt=async A=>{const R=new Set(g.value.map(ee=>{var he;return(he=ee.id)==null?void 0:he.toString()})),Y=A.filter(ee=>!R.has(ee==null?void 0:ee.toString()));Y.length&&await Y.reduce(async(ee,he)=>{await ee;const be=await ze(he);be&&g.value.push(be)},Promise.resolve())},Le=async()=>{o.value||(p.value=!0,await Ve(),await e.nextTick(()=>{var A;te(),(A=k.value)==null||A.focus(),B.value.length?y.value=0:y.value=-1}))},qe=()=>{p.value=!1,y.value=-1},Ct=async A=>{o.value||(p.value?qe():await Le())},yt=async()=>{var A;p.value?(A=k.value)==null||A.focus():await Le()},wt=()=>{n.value?(_.value=[],s.value=[],r("change",[])):(f.value=null,s.value=null,r("change",null)),H(null),h.value="",e.nextTick(()=>{var A;return(A=k.value)==null?void 0:A.focus()})},Lt=A=>{n.value&&(_.value=_.value.filter(R=>(R==null?void 0:R.toString())!==(A==null?void 0:A.toString())),s.value=[..._.value],r("change",s.value),e.nextTick(()=>{var R;return(R=k.value)==null?void 0:R.focus()}))},et=A=>{n.value?(C(A.id)||(_.value=[..._.value,A.id],s.value=[..._.value],r("change",s.value)),h.value="",e.nextTick(()=>{var R;(R=k.value)==null||R.focus(),y.value=Math.min(y.value,B.value.length-1)}),H(null)):(f.value=A,s.value=A.id,r("change",s.value),h.value="",qe(),H(A))},at=A=>{C(A.id)||et(A)},z=(A,R)=>{if(!A||!R)return;const Y=A.offsetTop,ee=Y+A.offsetHeight,he=R.scrollTop,be=he+R.clientHeight;let $e=R.scrollTop;Y<he?$e=Y-80:ee>be&&($e=ee-R.clientHeight+4);const oe=R;oe.scrollTop=$e},X=A=>{let R=A.parentElement;for(;R;){if(R.classList.contains("ui-dialog__content"))return R;const Y=window.getComputedStyle(R),ee=Y.overflow+Y.overflowY+Y.overflowX;if(ee.includes("auto")||ee.includes("scroll")||R===document.body||R===document.documentElement)return R;R=R.parentElement}return document.body},te=()=>{if(!c.value)return;const A=c.value.getBoundingClientRect(),R=window.innerHeight||document.documentElement.clientHeight,Y=window.innerWidth||document.documentElement.clientWidth,ee=8,he=8,be=a.maxHeight||300,$e=R-A.bottom-he-ee,oe=A.top-he-ee,ct=$e>=oe,Nt=Math.max(Y-ee*2,0);let{width:pl}=A;Nt>0&&pl>Nt&&(pl=Nt);let{left:Ql}=A;Ql+pl+ee>Y&&(Ql=Y-pl-ee),Ql=Math.max(Ql,ee);const xB=Math.min(be,Math.max(ct?$e:oe,50));x.value=ct?"bottom":"top",b.value={position:"fixed",left:`${Ql}px`,width:`${pl}px`,minWidth:"300px",maxHeight:`${xB}px`,transform:ct?"none":"translateY(-100%)",top:ct?`${A.bottom+he}px`:`${A.top-he}px`}},le=async A=>{o.value||!p.value&&(A.key==="ArrowDown"||A.key==="ArrowUp")&&(A.preventDefault(),await Le())},de=A=>{var Y;if(!p.value)return;const{key:R}=A;if(R==="ArrowDown")A.preventDefault(),y.value+1<B.value.length&&(y.value+=1,z(w.value[y.value],u.value));else if(R==="ArrowUp")A.preventDefault(),y.value>0&&(y.value-=1,z(w.value[y.value],u.value));else if(R==="Enter"){A.preventDefault();const ee=B.value[y.value];ee&&et(ee),(Y=k.value)==null||Y.blur()}else R==="Escape"?(A.preventDefault(),qe()):R==="Backspace"?n.value&&h.value===""&&_.value.length&&(_.value=_.value.slice(0,-1),s.value=[..._.value],r("change",s.value)):R==="Home"?(y.value=0,z(w.value[0],u.value)):R==="End"?(y.value=B.value.length-1,z(w.value[y.value],u.value)):R==="Tab"&&qe()},Se=()=>{o.value||(m.value=!0)},v=()=>{m.value=!1,h.value=""},S=A=>{A.key==="Escape"&&p.value&&qe()},q=A=>{var Y,ee;const R=A.target;(Y=i.value)!=null&&Y.contains(R)||(ee=d.value)!=null&&ee.contains(R)||qe()},re=A=>{p.value&&u.value&&!u.value.contains(A.target)&&te()},De=()=>{p.value&&te()},Ae=()=>{p.value&&te()};e.watch(()=>a.options,A=>{A!=null&&A.length&&(g.value=[...A],ge())},{immediate:!0});async function ge(){if(n.value)Array.isArray(s.value)?_.value=[...s.value]:(_.value=s.value==null?[]:[s.value],s.value=[..._.value]),a.data&&_.value.length&&(await Kt(_.value),await e.nextTick());else{if(Array.isArray(s.value)){const A=s.value[0]??null;s.value=A??null}s.value!=null&&(f.value=await ze(s.value)),H(f.value??null)}}e.watch(s,()=>{ge()}),e.onMounted(async()=>{var A;addEventListener("keydown",S),addEventListener("scroll",re,!0),addEventListener("resize",De),document.addEventListener("click",q,!0),c.value&&X(c.value).addEventListener("scroll",Ae,!0),(A=a.options)!=null&&A.length&&!a.data?g.value=[...a.options]:a.data&&(g.value=await pe("")),await ge(),J.value=!1}),e.onUnmounted(()=>{removeEventListener("keydown",S),removeEventListener("scroll",re,!0),removeEventListener("resize",De),document.removeEventListener("click",q,!0),c.value&&X(c.value).removeEventListener("scroll",Ae,!0)});const j=e.ref(!1),G=e.ref({}),ye=e.ref([]),Be=e.ref(null);async function N(){var Y,ee;if(!((Y=a.add)!=null&&Y.token)||Be!=null&&Be.value.validate())return;const A=a.add.api??`/api/table/${a.add.token}`,{id:R}=await fetch(A,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(G.value)}).then(he=>he.json());if(!((ee=a.options)!=null&&ee.length)&&a.data){const{data:he}=await fetch(`${a.api??`/api/suggest/${a.data}`}?val=${R}`).then(be=>be.json());f.value=he[0],g.value.push(he[0]),s.value=R}j.value=!1,xe({title:"Success!",message:"Object created."})}async function T(){if(!a.add)return null;const A=await fetch(`/api/template/form/${a.add.form}`).then(R=>R.json());return ye.value=A.schema,j.value=!0,null}function K(A,R=200){let Y;return(...ee)=>{Y&&clearTimeout(Y),Y=window.setTimeout(()=>A(...ee),R)}}const W=K(async A=>{g.value=await pe(A)},200);e.watch(h,A=>{a.data&&W(A.trim())}),e.watch(()=>a.options,A=>{!a.data&&(A!=null&&A.length)&&(g.value=[...A],ge())},{immediate:!0}),e.watch(()=>a.parent??a.parentValue,()=>{a.data&&Ve()});const J=e.ref(!0);return e.watch(Q,async()=>{if(a.data&&(J.value||(n.value?(_.value=[],s.value=[],r("change",[])):(f.value=null,s.value=null,r("change",null))),await Ve(),a.auto===1&&Q.value&&g.value.length>0)){const A=g.value[0];A&&et(A)}}),(A,R)=>{var Y,ee,he,be,$e;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(xl),{visible:j.value,"onUpdate:visible":R[1]||(R[1]=oe=>j.value=oe),title:"Додати",buttonText:"Додати",onDone:N,teleport:A.teleport},{default:e.withCtx(()=>[e.createVNode(mt,{schema:ye.value,modelValue:G.value,"onUpdate:modelValue":R[0]||(R[0]=oe=>G.value=oe),ref_key:"addForm",ref:Be},null,8,["schema","modelValue"])]),_:1},8,["visible","teleport"]),e.createElementVNode("div",{class:"flex gap-1 w-full",ref_key:"selectRoot",ref:i,onClick:R[5]||(R[5]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["relative w-full font-sans",a.customClass])},[R[10]||(R[10]=e.createElementVNode("span",{id:"react-select-live-region",class:"sr-only"},null,-1)),R[11]||(R[11]=e.createElementVNode("span",{"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text",role:"log",class:"sr-only"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white","border-gray-300 hover:border-gray-400",p.value||m.value?"border-blue-500 ring-1 ring-blue-500":"",o.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),role:"combobox","aria-expanded":p.value,"aria-haspopup":"listbox",onKeydown:le,onClick:yt,"data-focus":p.value||m.value?"true":"false"},[e.createElementVNode("div",{class:"flex flex-1 items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden h-full",ref_key:"triggerRef",ref:c},[n.value?(e.openBlock(),e.createElementBlock("div",Mh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,oe=>(e.openBlock(),e.createElementBlock("div",{class:"flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border max-w-full",key:oe.id},[e.createElementVNode("div",Th,[oe!=null&&oe.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[16px] h-[16px] rounded-md block ml-1.5 flex-shrink-0",style:e.normalizeStyle({backgroundColor:oe==null?void 0:oe.color})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"truncate text-gray-900 overflow-hidden max-w-[200px] px-0.5 py-[2px] pl-1.5",title:F(oe)},[I.value?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:O(oe)},null,8,Lh)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(oe.text),1)],64))],8,$h)]),e.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b] flex-shrink-0",onClick:e.withModifiers(ct=>Lt(oe.id),["stop"])},R[6]||(R[6]=[e.createElementVNode("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,Fh)]))),128)),e.createElementVNode("div",Ih,[!o.value&&A.search?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:k,class:"w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",placeholder:_.value.length?" ":E.value,"onUpdate:modelValue":R[2]||(R[2]=oe=>h.value=oe),onFocus:Se,onBlur:v,onKeydown:de},null,40,Oh)),[[e.vModelText,h.value]]):e.createCommentVNode("",!0)])])):!n.value&&!m.value&&D.value&&h.value===""?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["truncate text-gray-900"]),title:D.value},[(Y=f.value)!=null&&Y.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[14px] h-[14px] rounded-md block mr-1 mt-1 absolute",style:e.normalizeStyle({backgroundColor:(ee=f.value)==null?void 0:ee.color})},null,4)):e.createCommentVNode("",!0),I.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass({"pl-5":(he=f.value)==null?void 0:he.color}),innerHTML:O(f.value)},null,10,Rh)):(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass({"pl-5":(be=f.value)==null?void 0:be.color})},e.toDisplayString(($e=f.value)==null?void 0:$e.text),3))],8,Ph)):e.createCommentVNode("",!0),n.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",jh,[!o.value&&A.search?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:k,class:"w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",placeholder:D.value?" ":E.value,"onUpdate:modelValue":R[3]||(R[3]=oe=>h.value=oe),onFocus:Se,onBlur:v,onKeydown:de},null,40,Uh)),[[e.vModelText,h.value]]):e.createCommentVNode("",!0)]))],512),e.createElementVNode("div",zh,[$.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:o.value,onClick:e.withModifiers(wt,["stop"])},R[7]||(R[7]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,Hh)):e.createCommentVNode("",!0),R[9]||(R[9]=e.createElementVNode("div",{class:"self-stretch w-px bg-[#ccc] my-[1px]"},null,-1)),e.createElementVNode("button",{type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:o.value,onClick:R[4]||(R[4]=e.withModifiers(oe=>Ct(),["stop"])),title:p.value?"Закрити список":"Відкрити список"},R[8]||(R[8]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"})],-1)]),8,Kh)])],42,Ah),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:d,class:e.normalizeClass(["fixed z-[3000] rounded bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.1),0_4px_11px_rgba(0,0,0,0.1)]"]),style:e.normalizeStyle(b.value),role:"listbox"},[e.createElementVNode("div",{class:"overflow-y-auto py-1",style:e.normalizeStyle({maxHeight:b.value.maxHeight||"300px"}),ref_key:"listRef",ref:u},[B.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(B.value,(oe,ct)=>(e.openBlock(),e.createElementBlock("div",{key:oe.id,ref_for:!0,ref:Nt=>w.value[ct]=Nt,class:e.normalizeClass(["flex px-3 py-2 cursor-default select-none text-gray-900 ",C(oe.id)?"bg-blue-500 text-white":"bg-white hover:bg-blue-100",y.value===ct&&!C(oe.id)?"bg-blue-100":""]),"aria-disabled":C(oe.id)?"true":"false",role:"option",tabindex:"-1",onClick:Nt=>at(oe)},[oe!=null&&oe.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",style:e.normalizeStyle({backgroundColor:oe==null?void 0:oe.color})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["leading-[19px]",y.value===oe.id?"text-white":"",(y.value,"")])},[I.value?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:O(oe)},null,8,Gh)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(oe.text),1)],64))],2)],10,qh))),128)):(e.openBlock(),e.createElementBlock("div",Wh," No options "))],4)],4)):e.createCommentVNode("",!0)]))],2),a.add?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:T,class:"bg-white hover:bg-gray-100 text-sm text-gray-900 py-[10px] px-3 border border-stone-200 rounded-md h-[38px] flex items-center gap-2",disabled:o.value,type:"button"},[e.createVNode(Ll,{width:"16",height:"16"}),R[12]||(R[12]=e.createElementVNode("span",null,"Додати",-1))],8,Yh)):e.createCommentVNode("",!0)],512)],64)}}}),Xh=["placeholder","disabled"],Zh=e.defineComponent({__name:"vs-input-textarea",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=pt(t.style),r=e.useModel(l,"modelValue"),n=e.computed(()=>!!t.disabled),o=e.computed(()=>t.placeholder??"");return(s,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{"onUpdate:modelValue":i[0]||(i[0]=c=>r.value=c),placeholder:o.value,disabled:n.value,row:"2",class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto bg-white",[e.unref(a)]]),style:{border:"1px solid #CFD9E0"}},null,10,Xh)),[[e.vModelText,r.value]])}}),Qh={},Jh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"};function eg(l,t){return e.openBlock(),e.createElementBlock("svg",Jh,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),e.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)]))}const tg=ke(Qh,[["render",eg]]),lg={},ag={class:"flex-shrink-0 mt-0.5 size-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function rg(l,t){return e.openBlock(),e.createElementBlock("svg",ag,t[0]||(t[0]=[e.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),e.createElementVNode("path",{d:"M7 20V4"},null,-1),e.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),e.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const ng=ke(lg,[["render",rg]]),og={},sg={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function ig(l,t){return e.openBlock(),e.createElementBlock("svg",sg,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 9l5 -5l5 5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const cg=ke(og,[["render",ig]]),dg={},ug={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function pg(l,t){return e.openBlock(),e.createElementBlock("svg",ug,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const mg=ke(dg,[["render",pg]]),fg={},hg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function gg(l,t){return e.openBlock(),e.createElementBlock("svg",hg,t[0]||(t[0]=[e.createStaticVNode('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>',6)]))}const No=ke(fg,[["render",gg]]),yg={},bg={viewBox:"0 0 178 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function kg(l,t){return e.openBlock(),e.createElementBlock("svg",bg,t[0]||(t[0]=[e.createStaticVNode('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>',12)]))}const xg=ke(yg,[["render",kg]]),wg={},Eg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _g(l,t){return e.openBlock(),e.createElementBlock("svg",Eg,t[0]||(t[0]=[e.createElementVNode("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"},null,-1)]))}const Vg=ke(wg,[["render",_g]]),Cg={class:"vs-datatable border rounded-xl w-full flex-grow"},Ng={class:"flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]"},Bg={class:"relative w-full"},vg={class:"table-wrapper flex gap-2"},Sg={class:"vs-popover inline-block text-slate-700"},Dg={class:"text-center"},Ag={class:""},Mg={class:"py-1 px-0 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},Tg={class:"flex flex-col p-[1px] gap-[2px] w-[140px]"},$g={class:"text-sm items-center text-gray-800 flex gap-1"},Lg={class:"w-full overflow-x-auto"},Fg={class:"w-full table-auto caption-bottom text-sm"},Ig={class:"[&_tr]:border-b"},Og={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"},Pg={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"},Rg={key:0,colspan:"100%",class:"text-center"},jg={class:"w-full"},Ug={class:"p-5 min-h-[200px] flex flex-col justify-center items-center text-center"},zg=["onDragstart","onDragover","onDrop"],Hg={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center"},Kg={class:"flex items-center justify-center"},qg={key:0,class:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},Gg={key:0},Wg=["src"],Yg={key:1,class:"rounded-md max-w-[45px] w-[45px] max-h-[45px] h-[45px] bg-gray-200 flex items-center justify-center"},Xg=["innerHTML"],Zg={key:2,class:"line-clamp-2 rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},Qg={key:3,class:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},Jg={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},ey={class:"flex items-center justify-center gap-2"},ty=["onClick"],ly=["onClick"],ay={class:"vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},ry=e.defineComponent({__name:"vs-input-datatable",props:e.mergeModels({colModel:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),r=e.ref({}),n=e.ref(""),o=e.computed(()=>{if(!n.value)return a.value??[];const I=n.value.toLowerCase();return a.value.filter(O=>{var F;return(F=t.colModel)==null?void 0:F.some(H=>{const Q=O[H.key];return Q?Array.isArray(Q)?Q.join(", ").toLowerCase().includes(I):String(Q).toLowerCase().includes(I):!1})})}),s=e.ref(null),i=e.ref(null),c=e.ref(!1),u=e.ref(null),d=e.ref({top:0,left:0}),p=I=>{s.value=I},m=I=>{i.value=I},f=I=>{if(s.value===null||s.value===I){s.value=null,i.value=null;return}const O=[...a.value],[F]=O.splice(s.value,1);O.splice(I,0,F),a.value=O,s.value=null,i.value=null},g=I=>{const O=I.currentTarget.getBoundingClientRect();d.value={top:O.bottom+window.scrollY,left:O.left+window.scrollX},c.value=!c.value},y=()=>{u.value&&u.value.click()},w=I=>{const O=[".jpg",".jpeg",".png",".gif",".bmp",".webp",".svg",".ico",".tiff",".tif"],F=I.toLowerCase();return O.some(H=>F.endsWith(H))},h=I=>{var H;const O=(H=I.target.files)==null?void 0:H[0];if(!O)return;const F=new FileReader;F.onload=Q=>{var pe;try{const Ve=(pe=Q.target)==null?void 0:pe.result;if(typeof Ve=="string"){const ze=JSON.parse(Ve);Array.isArray(ze)&&a.value.push(...ze)}}catch(Ve){console.error("Error parsing file:",Ve)}},F.readAsText(O)},k=()=>{const I=JSON.stringify(a.value,null,2),O=new Blob([I],{type:"application/json"}),F=URL.createObjectURL(O),H=document.createElement("a");H.href=F,H.download="data.json",H.click(),URL.revokeObjectURL(F)};e.onMounted(async()=>{var O;const I=(O=t.colModel)==null?void 0:O.filter(F=>F.data);I!=null&&I.length&&Promise.all(I.map(async F=>{const H=await(await fetch(`/api/suggest/${F.data}`)).json();r.value[F.key]=H.data}))});const x=e.ref(""),b=e.ref(!1);let _="edit",V=0;const E=e.ref({}),D=e.ref({});async function $(){x.value="Додати",b.value=!0,_="add",E.value={}}function C(I,O){var H;const F=O.key||O.name;return r.value[F]&&I[F]?((H=r.value[F].find(Q=>Q.id.toString()===I[F].toString()))==null?void 0:H.text)??I[F]:I[F]||"-"}async function B(I,O){x.value="Редагувати",b.value=!0,_="edit",V=O,E.value={...I}}function M(){const I=D.value.validate();if(I){xe({type:"warning",title:"Помилка валідації",message:Object.entries(I).map(([O,F])=>`${O}: ${F}`).join(`
|
|
188
|
+
`)});return}_==="add"?Array.isArray(a.value)?a.value=[...a.value,E.value]:a.value=[E.value]:a.value=a.value.map((O,F)=>F===V?E.value:O),b.value=!1}function U(I){a.value=a.value.filter((O,F)=>F!==I)}function P(){b.value=!1}return(I,O)=>(e.openBlock(),e.createElementBlock("div",Cg,[e.createElementVNode("div",Ng,[e.createElementVNode("div",Bg,[e.createVNode(tg,{width:"14",height:"14",class:"absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"}),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":O[0]||(O[0]=F=>n.value=F),placeholder:"Пошук",class:"py-2 px-3 pl-10 w-full bg-gray-100 h-[36px] rounded-[8px] text-[15px] leading-[18px] focus:border-1 text-stone-800 placeholder:text-[#6B7280] focus:outline-blue-500 focus:outline-2"},null,512),[[e.vModelText,n.value]])]),e.createElementVNode("div",vg,[e.createElementVNode("input",{ref_key:"fileInput",ref:u,onChange:h,class:"hidden",accept:".json",type:"file"},null,544),e.createElementVNode("div",Sg,[e.createElementVNode("div",Dg,[e.createElementVNode("div",Ag,[e.createElementVNode("button",{onClick:g,class:"bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"},[e.createVNode(ng,{height:"16",width:"16"})])])])])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"text-slate-700 vsTailwind vs-popover__content bottom",style:e.normalizeStyle([{width:"fit-content","z-index":"10002",position:"fixed"},{position:"absolute",top:d.value.top+"px",left:d.value.left+"px"}])},[e.createElementVNode("div",Mg,[e.createElementVNode("div",Tg,[e.createElementVNode("button",{onClick:y,class:"text-slate-700 flex items-center gap-1 px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"},[e.createVNode(cg,{class:"text-black",width:"14",height:"14"}),O[4]||(O[4]=e.createTextVNode(" Імпортувати ",-1))]),e.createElementVNode("button",{onClick:k,class:"text-slate-700 flex items-center px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"},[e.createElementVNode("span",$g,[e.createVNode(mg,{class:"text-black",width:"14",height:"14"}),O[5]||(O[5]=e.createTextVNode(" Експортувати ",-1))])])])])],4)):e.createCommentVNode("",!0)])),e.createElementVNode("button",{onClick:$,class:"text-slate-700 bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"},[e.createVNode(Ll),O[6]||(O[6]=e.createTextVNode(" Додати ",-1))])]),e.createElementVNode("div",Lg,[e.createElementVNode("table",Fg,[e.createElementVNode("thead",Ig,[e.createElementVNode("tr",Og,[e.createElementVNode("th",Pg,[e.createVNode(No,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.colModel,F=>(e.openBlock(),e.createElementBlock("th",{key:F.key,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]"},e.toDisplayString(F.ua||F.label),1))),128)),O[7]||(O[7]=e.createElementVNode("th",{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-center"}," Дії ",-1))])]),e.createElementVNode("tbody",{class:e.normalizeClass({"[&_tr:last-child]:border-0":!i.value})},[o.value.length===0?(e.openBlock(),e.createElementBlock("td",Rg,[e.createElementVNode("div",jg,[e.createElementVNode("div",Ug,[e.createVNode(xg,{class:"w-48 mx-auto"}),O[8]||(O[8]=e.createElementVNode("div",{class:"max-w-sm mx-auto mt-6"},[e.createElementVNode("p",{class:"font-medium text-gray-800 dark:text-neutral-200"},"Нічого не знайдено"),e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"})],-1))])])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(F,H)=>(e.openBlock(),e.createElementBlock("tr",{key:F.id,class:e.normalizeClass(["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===H,"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20":i.value===H}]),draggable:"true",onDragstart:Q=>p(H),onDragover:e.withModifiers(Q=>m(H),["prevent"]),onDrop:Q=>f(H)},[e.createElementVNode("td",Hg,[e.createElementVNode("div",Kg,[e.createVNode(No,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.colModel,Q=>(e.openBlock(),e.createElementBlock("td",{key:Q.key,class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},[Q.type==="file"?(e.openBlock(),e.createElementBlock("div",qg,[w(C(F,Q))?(e.openBlock(),e.createElementBlock("div",Gg,[e.createElementVNode("img",{src:C(F,Q),alt:"alt",width:"45",class:"rounded-md max-w-[45px] h-[45px] object-cover"},null,8,Wg)])):(e.openBlock(),e.createElementBlock("div",Yg,[e.createVNode(Eo,{class:"w-[25px] min-w-[25px] h-[25px]"})]))])):Q.type==="tiptap-editor"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors line-clamp-3",innerHTML:C(F,Q)},null,8,Xg)):Q.type==="reference"?(e.openBlock(),e.createElementBlock("div",Zg,e.toDisplayString(C(F,Q)),1)):(e.openBlock(),e.createElementBlock("div",Qg,e.toDisplayString(C(F,Q)),1))]))),128)),e.createElementVNode("td",Jg,[e.createElementVNode("div",ey,[e.createElementVNode("button",{onClick:Q=>B(F,H),class:"text-slate-700 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-7 w-7 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"},[e.createVNode(Vg,{width:"24",height:"24",class:"w-3 h-3"})],8,ty),e.createElementVNode("button",{onClick:Q=>U(H),class:"text-slate-700 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-7 w-7 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"},[e.createVNode(fa,{width:"24",height:"24",class:"w-3 h-3"})],8,ly)])])],42,zg))),128))],2)])]),e.createVNode(e.unref(xl),{teleport:"#modal",visible:b.value,title:x.value,size:"lg",onClose:P},{default:e.withCtx(()=>[e.createVNode(mt,{schema:t.colModel,values:E.value,"onUpdate:values":O[1]||(O[1]=F=>E.value=F),form:D.value,"onUpdate:form":O[2]||(O[2]=F=>D.value=F)},null,8,["schema","values","form"]),e.createElementVNode("div",ay,[e.createElementVNode("button",{type:"button",onClick:O[3]||(O[3]=F=>b.value=!1),class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),e.createElementVNode("button",{onClick:M,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])]),_:1},8,["visible","title"])]))}}),ny={draw:{toolbar:{actions:{title:"Скасувати малювання",text:"Скасувати"},finish:{title:"Завершити малювання",text:"Завершити"},undo:{title:"Видалити останню точку",text:"Видалити останню"},buttons:{polyline:"Намалювати лінію",polygon:"Намалювати полігон",rectangle:"Намалювати прямокутник",circle:"Намалювати коло",marker:"Додати точку",circlemarker:"Додати маркер-коло"}},handlers:{circle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати коло",end:"Відпустіть кнопку миші, щоб завершити"},radius:"Радіус"},circlemarker:{tooltip:{start:"Клацніть на карту, щоб додати маркер-коло"}},marker:{tooltip:{start:"Клацніть на карту, щоб додати точку"}},polygon:{tooltip:{start:"Клацніть, щоб почати малювати полігон",cont:"Клацайте, щоб продовжити малювати полігон",end:"Клацніть першу точку, щоб завершити полігон"}},polyline:{error:"<strong>Помилка:</strong> лінія не може перетинатися сама з собою",tooltip:{start:"Клацніть, щоб почати малювати лінію",cont:"Клацайте, щоб продовжити малювати лінію",end:"Клацніть останню точку, щоб завершити лінію"}},rectangle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати прямокутник",end:"Відпустіть кнопку миші, щоб завершити"}},simpleshape:{tooltip:{end:"Відпустіть кнопку миші, щоб завершити"}}}},edit:{toolbar:{actions:{save:{title:"Зберегти зміни",text:"Зберегти"},cancel:{title:"Скасувати редагування",text:"Скасувати"},clearAll:{title:"Очистити всі шари",text:"Очистити все"}},buttons:{edit:"Редагувати шари",editDisabled:"Немає шарів для редагування",remove:"Видалити шари",removeDisabled:"Немає шарів для видалення"}},handlers:{edit:{tooltip:{text:"Перетягніть маркери, щоб редагувати шари",subtext:"Натисніть 'Скасувати', щоб повернутися"}},remove:{tooltip:{text:"Клацніть на шари, щоб видалити їх"}}}}};function Fl(l){return l?l.type==="Polygon"?{type:"MultiPolygon",coordinates:[l.coordinates]}:l.type==="Feature"?{...l,geometry:Fl(l.geometry)}:l.type==="FeatureCollection"?{...l,features:(l.features||[]).map(t=>Fl(t)).filter(Boolean)}:l:null}function oy(l){return l?l.type==="FeatureCollection"||l.type==="Feature"?Fl(l):l.geom?{type:"Feature",geometry:Fl({type:l.geom.type,coordinates:l.geom.coordinates}),properties:{}}:l.type&&l.coordinates?{type:"Feature",geometry:Fl(l),properties:{}}:null:null}const sy={},iy={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",fill:"none","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-map-pin"};function cy(l,t){return e.openBlock(),e.createElementBlock("svg",iy,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"},null,-1),e.createElementVNode("path",{d:"M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0z"},null,-1)]))}const dy=ke(sy,[["render",cy]]),uy={},py={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none","stroke-width":"2",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-line"};function my(l,t){return e.openBlock(),e.createElementBlock("svg",py,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),e.createElementVNode("path",{d:"M18 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),e.createElementVNode("path",{d:"M7.5 16.5l9 -9"},null,-1)]))}const fy=ke(uy,[["render",my]]),hy={},gy={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-polygon"};function yy(l,t){return e.openBlock(),e.createElementBlock("svg",gy,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M6.5 9.5l3.5 -3"></path><path d="M14 5.5l3 1.5"></path><path d="M18.5 10l-2.5 7"></path><path d="M13.5 17.5l-7 -5"></path>',9)]))}const by=ke(hy,[["render",yy]]),ky={},xy={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-topology-ring-3"};function wy(l,t){return e.openBlock(),e.createElementBlock("svg",xy,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M8 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M6 8v8"></path><path d="M18 16v-8"></path><path d="M8 6h8"></path><path d="M16 18h-8"></path>',9)]))}const Ey=ke(ky,[["render",wy]]),_y={},Vy={version:"1.1",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg","xmlns:sketch":"http://www.bohemiancoding.com/sketch/ns","xmlns:xlink":"http://www.w3.org/1999/xlink",class:"fullscreen-icon"};function Cy(l,t){return e.openBlock(),e.createElementBlock("svg",Vy,t[0]||(t[0]=[e.createElementVNode("title",null,null,-1),e.createElementVNode("desc",null,null,-1),e.createElementVNode("defs",null,null,-1),e.createElementVNode("g",{fill:"none","fill-rule":"evenodd",id:"Page-1",stroke:"none","stroke-width":"1"},[e.createElementVNode("g",{fill:"#000000",id:"Core",transform:"translate(-215.000000, -257.000000)"},[e.createElementVNode("g",{id:"fullscreen",transform:"translate(215.000000, 257.000000)"},[e.createElementVNode("path",{d:"M2,9 L0,9 L0,14 L5,14 L5,12 L2,12 L2,9 L2,9 Z M0,5 L2,5 L2,2 L5,2 L5,0 L0,0 L0,5 L0,5 Z M12,12 L9,12 L9,14 L14,14 L14,9 L12,9 L12,12 L12,12 Z M9,0 L9,2 L12,2 L12,5 L14,5 L14,0 L9,0 L9,0 Z",id:"Shape"})])])],-1)]))}const Ny=ke(_y,[["render",Cy]]),By={class:"map-search-widget flex flex-col gap-2 rounded-xl widget min-w-[200px]"},vy={key:0,class:"vs-select__options absolute z-50 mt-1 w-full bg-white border border-gray-300 shadow-lg rounded-lg text-sm"},Sy=["onClick"],Dy={class:"relative flex-1 min-w-[140px]"},Ay=["placeholder"],My="https://data.softpro.ua/api-user/gis-url-proxy",Ty="https://geo.rv.ua/api-user/dzk.api",$y=e.defineComponent({__name:"map-search",props:{config:{}},emits:["goToCoordinates"],setup(l,{emit:t}){const a=l,r=t,n=["here","xy","parcel"],o=e.computed(()=>{var _,V;const b=(V=(_=a.config)==null?void 0:_.tools)==null?void 0:V.filter(E=>n.includes(E));return b&&b.length?b:n}),s=e.computed(()=>{var b,_;return((_=(b=a.config)==null?void 0:b.placeholder)==null?void 0:_.trim())||"Пошук…"}),i=e.ref(o.value[0]??n[0]);e.watch(o,b=>{b.includes(i.value)||(i.value=b[0])});const c=e.ref(""),u=e.ref(!1),d=e.ref(null);e.watch(i,()=>{c.value="",u.value=!1});function p(b){i.value=b}function m(b){if(!u.value)return;const _=d.value;_&&!_.contains(b.target)&&(u.value=!1)}e.onMounted(()=>{window.addEventListener("click",m,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("click",m,!0)});function f(b){return b==="xy"?"Координати":b==="parcel"?"Кадастр":"Адреси"}function g(b){const _=b.replace(/[,]+/g," ").trim();if(!_)return null;const V=_.split(/\s+/).filter(Boolean);if(V.length<2)return null;const E=V.slice(0,2).map(Number);if(!E.every(P=>Number.isFinite(P)))return null;let[D,$]=E,C=D,B=$;const M=P=>Math.abs(P)<=90,U=P=>Math.abs(P)<=180;if(!M(C)||!U(B))if(M(B)&&U(C))C=$,B=D;else return null;return{lat:C,lng:B}}function y(b){return((b==null?void 0:b.items)||[]).map((_,V)=>{var E,D,$;return{id:String((_==null?void 0:_.id)??V),title:(_==null?void 0:_.title)||((E=_==null?void 0:_.address)==null?void 0:E.label)||"Знайдений обʼєкт",lat:Number((D=_==null?void 0:_.position)==null?void 0:D.lat),lng:Number(($=_==null?void 0:_.position)==null?void 0:$.lng)}}).filter(_=>Number.isFinite(_.lat)&&Number.isFinite(_.lng))}function w(b){const _=(b==null?void 0:b.result)||(b==null?void 0:b.data)||b;if(!_)return[];const V=_.geom_centroid;if(!V||!Array.isArray(V.coordinates))return[];const[E,D]=V.coordinates;return!Number.isFinite(D)||!Number.isFinite(E)?[]:[{id:"parcel",title:_.cadnum||_.cad_num||"Земельна ділянка",lat:D,lng:E}]}function h(b){const _=b.replace(/\s+/g,"").split(":");if(_.length!==4)return!1;const V=[10,2,3,4];return _.every((E,D)=>E.length===V[D]&&/^\d+$/.test(E))}function k(b){r("goToCoordinates",[b.lat,b.lng])}async function x(){const b=c.value.trim();if(b){if(i.value==="xy"){const _=g(b);if(!_){xe({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}k(_),c.value="";return}try{const _=new URL(i.value==="here"?My:Ty);if(i.value==="here")_.searchParams.set("searchtext",b);else{if(!h(b)){xe({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}_.searchParams.set("cad_num",b)}const V=await fetch(_.toString());if(!V.ok)throw new Error(`HTTP ${V.status}`);const E=await V.json(),D=i.value==="here"?y(E):w(E);if(!D.length)xe({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const $=D[0];k($),c.value=""}}catch(_){const V=(_==null?void 0:_.message)||"Помилка пошуку";xe({type:"error",title:"Пошук",message:V})}}}return(b,_)=>(e.openBlock(),e.createElementBlock("div",By,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(x,["prevent"])},[o.value.length>1?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:d,class:"relative search-type w-[140px]"},[e.createElementVNode("button",{type:"button",class:"vstSelect-input transition-all text-left bg-white border border-gray-200 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-100 block w-full py-1.5 px-3 text-sm cursor-pointer flex items-center justify-between gap-2",onClick:_[0]||(_[0]=V=>u.value=!u.value)},[e.createElementVNode("span",null,e.toDisplayString(f(i.value)),1),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":u.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_[2]||(_[2]=[e.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]),2))]),u.value?(e.openBlock(),e.createElementBlock("div",vy,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V,class:"px-3 py-2 cursor-pointer hover:bg-gray-100",onClick:E=>p(V)},e.toDisplayString(f(V)),9,Sy))),128))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",Dy,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":_[1]||(_[1]=V=>c.value=V),placeholder:s.value,type:"text",class:"vs-input transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,8,Ay),[[e.vModelText,c.value,void 0,{trim:!0}]]),_[3]||(_[3]=e.createElementVNode("button",{type:"submit",class:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600","aria-label":"Пошук"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-4.35-4.35m0 0A7.5 7.5 0 1 0 5 5a7.5 7.5 0 0 0 11.65 11.65Z"})])],-1))])],32)]))}}),Ly=ke($y,[["__scopeId","data-v-3048520a"]]),Fy={class:"bg-white/30 p-1 rounded-md shadow"},Iy={class:"flex gap-2"},Oy=["onClick","title"],Py=["src"],Ry=e.defineComponent({__name:"map-layers",props:{basemaps:{}},emits:["onLayerChange"],setup(l,{emit:t}){const a=e.ref(Object.keys(l.basemaps)[0]),r=t;function n(o){r("onLayerChange",o),a.value=o}return(o,s)=>(e.openBlock(),e.createElementBlock("div",Fy,[e.createElementVNode("div",Iy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.basemaps,(i,c)=>(e.openBlock(),e.createElementBlock("div",{key:c,class:e.normalizeClass(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm",{"ring-2 ring-blue-500 border-blue-300":a.value===c}]),onClick:u=>n(c),title:i.name||c,role:"button",tabindex:"0"},[e.createElementVNode("img",{src:i.preview,alt:"",class:"w-10 h-10 object-cover"},null,8,Py)],10,Oy))),128))])]))}}),jy={key:0,class:"absolute inset-0 z-[2000] flex items-center justify-center pointer-events-none bg-black/20"},Uy={class:"bg-black/50 text-white px-6 py-2 rounded-lg text-center max-w-sm mx-4 backdrop-blur-sm"},zy={class:"text-sm font-medium"},Hy={key:0,class:"absolute top-4 left-4 z-[1000] w-[calc(100%-20px)] sm:w-[350px]"},Ky={key:1,class:"form-geom__panel flex gap-1 items-start mt-2"},qy={class:"flex items-center gap-1"},Gy=["disabled"],Wy=["disabled"],Yy=["disabled"],Xy={class:"absolute top-4 right-4 z-[1000]"},Zy={class:"flex flex-col gap-[2px]"},Qy=["disabled"],Jy=["disabled"],eb=["disabled"],tb=["disabled"],lb={class:"flex flex-col gap-2"},ab={key:0,class:"bg-white/95 border border-gray-200 rounded-md shadow-sm px-3 py-2 text-xs text-gray-700 min-w-[200px]"},rb={class:"flex flex-col gap-1"},nb=["checked","disabled","onChange"],ob={class:"text-gray-700 text-xs font-medium"},sb={class:"absolute bottom-0 left-0 right-0 z-[1000] bg-white/95 border-t border-gray-200 text-xs text-gray-700 flex items-center gap-4 pt-1"},ib={key:0,class:"form-geom__feature flex items-center text-xs transition-all gap-2 w-full"},cb={class:"shrink-0"},db={class:"font-bold"},ub={class:"flex items-center"},pb={class:"text-xs mr-2"},mb={key:0,class:"text-xs"},fb={key:1,class:"text-xs"},hb=["disabled"],gb=["disabled"],yb=e.defineComponent({__name:"vs-input-map",props:{tools:{},handleZoom:{type:Boolean,default:!0},geomType:{default:()=>[]},prefix:{default:""},layers:{default:()=>[]},api:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},emits:["update:modelValue"],setup(l,{emit:t}){var Be;const a=e.getCurrentInstance(),r=l,n=t,o=e.computed(()=>{const N={search:!1,import:!1,export:!1,point:!1,line:!1,polygon:!1,rectangle:!1};if(!r.tools||!r.tools.length)return N;const T=new Set(r.tools.map(K=>K.toLowerCase()));return{search:T.has("search"),import:T.has("import"),export:T.has("export"),point:T.has("point"),line:T.has("line"),polygon:T.has("polygon"),rectangle:T.has("rectangle")}}),s=e.computed(()=>!!r.disabled),i=e.ref(!1),c=e.ref(null),u=e.ref(null),d=e.ref(!1),p=e.ref(""),m=e.reactive({}),f=e.ref([]),g=e.computed(()=>f.value.map(N=>m[N]).filter(N=>!!N)),y=e.computed(()=>Array.isArray(r.layers)&&r.layers.some(N=>`${(N==null?void 0:N.service)??""}`.toLowerCase()==="vtile"));let w,h,k;function x(){return navigator.platform.toUpperCase().indexOf("MAC")>=0,/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?"Використовуйте два пальці для зуму карти.":"Використовуйте Ctrl + прокрутка для зуму карти."}const b=e.ref(null),_=e.ref(null);let V=null;const E=e.ref(null),D=N=>{N.ctrlKey&&N.preventDefault()};function $(N,T){return N!=null&&N.id?String(N.id):N!=null&&N.url?`${N.url}-${T}`:`layer-${T}`}function C(N){if(!N)return"";if(/^https?:\/\//i.test(N))return N.replace(/\/+$/,"");const T=N.replace(/^\/+/,"").replace(/\/+$/,"");return T?`/${T}`:""}function B(N){var ee;const T=(N==null?void 0:N.url)??"";if(!T||/^https?:\/\//i.test(T))return T;const K=typeof window<"u"&&((ee=window.location)!=null&&ee.origin)?window.location.origin:"";if(T.startsWith("/"))return K?`${K}${T}`:T;const W=C(N==null?void 0:N.prefix),J=C(r.prefix),A=W||J,R=T.replace(/^\/+/,""),Y=A?`${A.replace(/\/$/,"")}/${R}`:`/${R}`;return K?`${K}${Y}`:Y}function M(N){const T=(N==null?void 0:N.style)??{};return K=>{const W=T.colorAttr,J=T.colorSet??{},A=typeof W=="string"?(J==null?void 0:J[K==null?void 0:K[W]])??T.color??"#3388ff":T.color??"#3388ff",R=T.stroke??A;return{weight:T.width??1,color:R,opacity:T.opacity??1,fill:T.type?T.type!=="polyline":!0,fillColor:A,fillOpacity:T.opacity??.5}}}function U(N){const T=(N==null?void 0:N.colorSet)||(N==null?void 0:N.colors);if(N!=null&&N.colorAttr&&T){const K=Object.entries(T).flat();return["match",["get",N.colorAttr],...K,N.color??"#94a3b8"]}return(N==null?void 0:N.color)??"#3388ff"}function P(N,T,K){if(!N)return[];const W=[],J=U(N);return N.icon&&W.push({id:`${T}-icon`,type:"symbol",source:T,"source-layer":K,minzoom:N.iconZoom||0,layout:{"icon-image":N.icon,"icon-size":1,"icon-allow-overlap":!0,"icon-ignore-placement":!0}}),N.pointZoom&&W.push({id:`${T}-point`,type:"circle",source:T,"source-layer":K,maxzoom:N.pointZoom,paint:{"circle-stroke-color":N.stroke||"#fff","circle-opacity":N.opacity??1,"circle-color":J,"circle-stroke-width":N.width??1,"circle-radius":N.radius??5}}),N.type==="polygon"?W.push({id:`${T}-fill`,type:"fill",source:T,"source-layer":K,minzoom:N.pointZoom||0,paint:{"fill-color":J,"fill-opacity":N.opacity??.5,"fill-outline-color":N.stroke||J}}):N.type==="line"?W.push({id:`${T}-line`,type:"line",source:T,"source-layer":K,paint:{"line-color":J,"line-opacity":N.opacity??1,"line-width":N.width??1.5}}):N.icon||W.push({id:`${T}-circle`,type:"circle",source:T,"source-layer":K,paint:{"circle-stroke-color":N.stroke||"#fff","circle-opacity":N.opacity??1,"circle-color":J,"circle-stroke-width":N.width??1,"circle-radius":N.radius??5}}),W}function I(N,T){var A;const K=N.id||`source-${Math.random().toString(36).slice(2,8)}`,W=N.sourceLayer||N.layer||N.service_layer||N.service_key||N.map_key||((A=N.dataset)==null?void 0:A.layer)||N.id||N.table_name||K,J=P(N.style||{},K,W||K);return J.length?{version:8,glyphs:"https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf",sources:{[K]:{type:"vector",tiles:[T],minzoom:N.minzoom??0,maxzoom:N.maxzoom??19}},layers:J}:null}function O(N){var J,A,R,Y;const T=((N==null?void 0:N.service)??"").toLowerCase(),K=B(N),W=N.sourceLayer||N.layer||N.service_layer||N.service_key||N.map_key||((J=N.dataset)==null?void 0:J.layer)||N.id||N.table_name;if(console.info("[vs-input-map] create overlay layer",{id:N.id,service:T,url:K,sourceLayer:W,hasSourceLayer:!!W}),T==="vtile"){if((A=L==null?void 0:L.vectorGrid)!=null&&A.protobuf&&!(L!=null&&L.maplibreGL))return console.info("[vs-input-map] using Leaflet.vectorGrid"),L.vectorGrid.protobuf(K,{interactive:!0,vectorTileLayerStyles:{default:M(N)}});if(L!=null&&L.maplibreGL&&(window!=null&&window.maplibregl)){console.info("[vs-input-map] using maplibre-gl-leaflet");const ee=I(N,K);return ee?L.maplibreGL({style:ee,interactive:!1,pane:"overlayPane"}):(console.warn("[vs-input-map] maplibre spec is empty",N.id),null)}return null}return T==="tile"||/^https?:\/\//i.test(K)||K.includes("{z}")?L.tileLayer(K,{opacity:((R=N==null?void 0:N.style)==null?void 0:R.opacity)??1}):L.tileLayer(K,{opacity:((Y=N==null?void 0:N.style)==null?void 0:Y.opacity)??1})}function F(){w&&f.value.forEach(N=>{const T=m[N];T&&(T.visible?(T.layer||(T.layer=O(T.config)),T.layer&&!w.hasLayer(T.layer)?(console.info("[vs-input-map] add overlay layer to map",T.id),T.layer.addTo(w)):T.layer||console.warn("[vs-input-map] overlay layer is null",T.id)):T.layer&&w.hasLayer(T.layer)&&(console.info("[vs-input-map] remove overlay layer from map",T.id),w.removeLayer(T.layer)))})}function H(N){if(s.value)return;const T=m[N];T&&(T.visible=!T.visible,w&&(console.info("[vs-input-map] toggle overlay",{id:N,nextVisible:T.visible,hasLayerInstance:!!T.layer}),T.visible?(T.layer||(T.layer=O(T.config)),T.layer&&!w.hasLayer(T.layer)&&(console.info("[vs-input-map] add overlay layer to map",T.id),T.layer.addTo(w))):T.layer&&w.hasLayer(T.layer)&&w.removeLayer(T.layer)))}function Q(){if(!r.handleZoom)return null;let N;const T=W=>{const J=W.ctrlKey||W.metaKey,A=W.shiftKey;if(!J&&!A){d.value=!0,p.value=x(),clearTimeout(N),N=window.setTimeout(()=>{d.value=!1},1e3);return}d.value=!1,w.scrollWheelZoom.enable(),setTimeout(()=>{w.scrollWheelZoom.disable()},100)},K=W=>{if(W.touches.length===1){d.value=!0,p.value=x(),clearTimeout(N),N=window.setTimeout(()=>{d.value=!1},3e3);return}d.value=!1};return _.value&&(_.value.addEventListener("wheel",T,{passive:!1}),_.value.addEventListener("touchstart",K,{passive:!0})),w&&w.on("wheel",W=>{const J=W.originalEvent.ctrlKey||W.originalEvent.metaKey,A=W.originalEvent.shiftKey;!J&&!A&&(W.originalEvent.preventDefault(),W.originalEvent.stopPropagation())}),()=>{_.value&&(_.value.removeEventListener("wheel",T),_.value.removeEventListener("touchstart",K)),w&&w.off("wheel"),clearTimeout(N)}}const pe=e.ref(null),Ve=e.ref(6),ze=e.ref(0),Kt=e.ref(((Be=a==null?void 0:a.appContext.config.globalProperties.$settings)==null?void 0:Be.center)||[50,30]),Le=e.ref(null),qe=G();let Ct;const yt=e.ref("topo100");function wt(N){return N?N.type==="Polygon"?{type:"MultiPolygon",coordinates:[N.coordinates]}:(N.type,N):null}function Lt(){return new Promise((N,T)=>{window.L&&window.L.Draw&&N(0);const K=A=>{if(Array.from(document.styleSheets).some(Y=>{var ee;return(ee=Y==null?void 0:Y.href)==null?void 0:ee.includes(A)}))return;const R=document.createElement("link");R.rel="stylesheet",R.href=A,document.head.appendChild(R)},W=A=>new Promise((R,Y)=>{const ee=Array.from(document.scripts).find(be=>be.src===A);if(ee){ee.addEventListener("load",()=>R()),ee.addEventListener("error",be=>Y(be));return}const he=document.createElement("script");he.src=A,he.async=!0,he.onload=()=>R(),he.onerror=be=>Y(be),document.body.appendChild(he)});K("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"),K("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"),y.value&&K("https://unpkg.com/maplibre-gl@4.5.0/dist/maplibre-gl.css");let J=W("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(()=>W("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js"));y.value?J=J.then(()=>W("https://unpkg.com/maplibre-gl@4.5.0/dist/maplibre-gl.js")).then(()=>(window.maplibregl&&!window.mapboxgl&&(window.mapboxgl=window.maplibregl),W("https://unpkg.com/@maplibre/maplibre-gl-leaflet@0.0.20/leaflet-maplibre-gl.js"))):J=J.then(()=>W("https://unpkg.com/leaflet.vectorgrid@1.3.0/dist/Leaflet.VectorGrid.bundled.js").catch(()=>Promise.resolve())),J.then(()=>N(0)).catch(T)})}function et(){const N=h.toGeoJSON(),T=[];let K=null;const W=A=>{if(A)switch(A.type){case"Point":K=A;break;case"Polygon":T.push(A.coordinates);break;case"MultiPolygon":T.push(...A.coordinates);break;case"GeometryCollection":(A.geometries||[]).forEach(W);break}};((N==null?void 0:N.features)||[]).forEach(A=>W(A.geometry));const J=K||(T.length?{type:"MultiPolygon",coordinates:T}:null);n("update:modelValue",J?wt(J):null),ze.value=h.getLayers().length}function at(N=30){const T=h.getLayers();if(!T.length)return;const K=L.featureGroup(T).getBounds();K&&K.isValid()&&w.fitBounds(K,{padding:[N,N]})}function z(){var N;s.value||((N=E.value)==null||N.click())}const X=e.ref("");e.watch(o,N=>{X.value&&!Object.entries(N).filter(([T,K])=>K).map(([T])=>T).includes(X.value)&&(k!=null&&k.disable&&k.disable(),X.value="")}),e.watch(()=>r.layers,N=>{const T=Array.isArray(N)?N:[],K=[],W=new Set;T.forEach((J,A)=>{if(!J)return;const R=$(J,A);K.push(R),W.add(R),console.info("[vs-input-map] overlay register",{id:R,service:J==null?void 0:J.service,url:J==null?void 0:J.url});const Y=m[R];Y?m[R]={...Y,config:{...J,id:R}}:m[R]={id:R,config:{...J,id:R},visible:(J==null?void 0:J.overlay)!==!1,layer:null}}),Object.keys(m).forEach(J=>{if(W.has(J))return;const A=m[J];A!=null&&A.layer&&(w!=null&&w.hasLayer)&&w.hasLayer(A.layer)&&w.removeLayer(A.layer),delete m[J]}),f.value=K,F()},{immediate:!0,deep:!0}),e.watch(s,N=>{N&&k&&(k.disable(),X.value=""),h&&h.eachLayer(T=>{var K,W,J,A,R;N?(W=(K=T.dragging)==null?void 0:K.disable)==null||W.call(K):(J=T.dragging)!=null&&J.enable&&(T.dragging.enable(),(R=(A=T.dragging).enabled)==null||R.call(A))})});function te(N){return N instanceof L.Circle?"Circle":N instanceof L.Rectangle?"Rectangle":N instanceof L.Polygon&&!(N instanceof L.Rectangle)?"Polygon":N instanceof L.Polyline&&!(N instanceof L.Polygon)?"Polyline":N instanceof L.Marker?"Point":"Feature"}function le(N){var T;if(N instanceof L.Circle){const K=N.getRadius();return Math.PI*(K*K)/1e6}if(N instanceof L.Polygon||N instanceof L.Rectangle)try{const K=N.getLatLngs(),W=Array.isArray(K[0])?K[0]:K,J=(T=L.GeometryUtil)!=null&&T.geodesicArea?L.GeometryUtil.geodesicArea(W):0;return J?J/1e6:0}catch{return null}return null}function de(N){return N instanceof L.Circle?N.getLatLng():N.getBounds?N.getBounds().getCenter():N.getLatLng?N.getLatLng():w.getCenter()}async function Se(N,T){var J;if(b.value="",!((J=r.api)!=null&&J.length))return;const[K,W]=r.api;try{const A=new URL(K);A.searchParams.set("lat",String(N)),A.searchParams.set("lon",String(T));const R=await fetch(A.toString());if(!R.ok)throw new Error("Request failed");const Y=await R.json();W&&Y[W]!==void 0?b.value=String(Y[W]):b.value=JSON.stringify(Y)}catch(A){console.error("[vs-input-map] reverse geocode failed:",A),b.value=null}}function v(){const N=h.getLayers();if(!N.length){Le.value=null,ze.value=0;return}const T=N[N.length-1],K=te(T),W=de(T),J=le(T);Le.value={type:K,center:W,areaKm2:J,layer:T},ze.value=N.length,Se(W.lat,W.lng)}function S(){var T;if(s.value)return;const N=(T=Le.value)==null?void 0:T.layer;N&&(N instanceof L.Circle&&N.getBounds?w.fitBounds(N.getBounds(),{padding:[30,30]}):N.getBounds?w.fitBounds(N.getBounds(),{padding:[30,30]}):N.getLatLng&&w.setView(N.getLatLng(),Math.max(Ve.value,14)))}function q(){var T;if(s.value)return;const N=(T=Le.value)==null?void 0:T.layer;N&&(h.removeLayer(N),et(),v())}e.onMounted(async()=>{document.addEventListener("wheel",D,{passive:!1}),await Lt(),L.drawLocal=ny;const N=r.handleZoom;w=L.map(_.value,{zoomControl:!1,scrollWheelZoom:!N}).setView(Kt.value,10),setTimeout(()=>{V=Q()},100),L.control.zoom({position:"bottomright"}).addTo(w),yt.value=Object.keys(qe)[0],Ct=L.tileLayer(qe[yt.value].url,{maxZoom:19,minZoom:6}).addTo(w),h=new L.FeatureGroup().addTo(w),w.on(L.Draw.Event.CREATED,W=>{if(s.value)return;const{layer:J}=W;h.clearLayers(),h.addLayer(J),et(),at(),X.value=""}),w.on(L.Draw.Event.EDITED,()=>{s.value||(et(),v(),at())}),w.on(L.Draw.Event.DELETED,()=>{s.value||(et(),v(),at())});let T=!1;w.on("mousemove",W=>{T||(w.invalidateSize(),T=!0),pe.value=W.latlng}),w.on("zoomend",()=>{Ve.value=w.getZoom()});const K=oy(r.modelValue);if(K){const W=[];L.geoJSON(K).eachLayer(J=>W.push(J)),W.length&&h.addLayer(W[0]),et(),v(),at()}F()}),e.onUnmounted(()=>{document.removeEventListener("wheel",D),V&&V(),Object.values(m).forEach(N=>{var T;N!=null&&N.layer&&((T=w==null?void 0:w.hasLayer)!=null&&T.call(w,N.layer)&&w.removeLayer(N.layer),typeof N.layer.remove=="function"&&N.layer.remove())})});function re(N){if(!s.value&&w){switch(k&&k.disable(),N){case"marker":k=new L.Draw.Marker(w);break;case"polyline":k=new L.Draw.Polyline(w);break;case"polygon":k=new L.Draw.Polygon(w);break;case"rectangle":k=new L.Draw.Rectangle(w);break;default:k=new L.Draw.Rectangle(w);break}k&&(k.enable(),X.value=N)}}function De(){if(s.value)return;const N=h.toGeoJSON(),T=new Blob([JSON.stringify(N,null,2)],{type:"application/json"}),K=URL.createObjectURL(T),W=document.createElement("a");W.href=K,W.download="data.geojson",W.click(),URL.revokeObjectURL(K)}function Ae(N){var J;if(s.value)return;const T=N.target,K=(J=T.files)==null?void 0:J[0];if(!K)return;const W=new FileReader;W.onload=()=>{if(typeof W.result=="string")try{const A=JSON.parse(W.result);h.clearLayers(),A&&L.geoJSON({type:"Feature",geometry:A}).eachLayer(R=>{h.addLayer(R)}),et(),v(),at()}finally{T.value=""}},W.readAsText(K)}function ge(N){w&&(Ct&&w.removeLayer(Ct),Ct=L.tileLayer(qe[N].url,{maxZoom:19,minZoom:6}).addTo(w),yt.value=N)}function j(N){const T=L.latLng(N[0],N[1]);w.setView(T,13)}e.watch(()=>r.modelValue,N=>{const T=wt(N);if(N&&T!==N){n("update:modelValue",T);return}h.clearLayers(),T&&L.geoJSON({type:"Feature",geometry:T}).eachLayer(K=>{var W,J,A,R,Y,ee;if(h.addLayer(K),s.value){(J=(W=K.dragging)==null?void 0:W.disable)==null||J.call(W);return}(R=(A=K.dragging)==null?void 0:A.enable)==null||R.call(A),(ee=(Y=K.dragging)==null?void 0:Y.enabled)==null||ee.call(Y),K.on("dragend",he=>{const be=he.target.getLatLng();n("update:modelValue",{type:"Point",coordinates:[be.lng,be.lat]})})}),ze.value=h.getLayers().length,v(),at()});function G(){var N,T;return(N=a==null?void 0:a.appContext.config.globalProperties.$settings)!=null&&N.basemaps?(T=a==null?void 0:a.appContext.config.globalProperties.$settings)==null?void 0:T.basemaps.map((K,W)=>Object.assign(K,{key:`b${W}`,preview:K.preview||K.url.replace("{z}/{x}/{y}.png","13/4790/2762.png")})).reduce((K,W)=>({...K,[W.key]:W}),{}):{topo100:{url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"},orto10:{url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4790/2762.png"},osmb:{url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png",preview:"https://tile.openstreetmap.org.ua/styles/osm-bright/13/4790/2762.png"}}}const ye=e.ref(!1);return e.watch(ye,()=>{setTimeout(()=>{w.invalidateSize()},50)}),e.watch(i,async N=>{if(!N||!u.value){c.value=null;return}await e.nextTick();const T=u.value.getBoundingClientRect();c.value={top:T.bottom+6,left:T.left}}),e.onUnmounted(()=>{i.value=!1,c.value=null}),(N,T)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["leaflet-map-wrapper relative w-full h-[400px]",{fullscreen:ye.value}])},[e.createElementVNode("div",{ref_key:"mapContainer",ref:_,class:"w-full h-full"},null,512),e.createVNode(e.Transition,{name:"zoom-instructions","enter-active-class":"transition-all duration-200 ease-out","leave-active-class":"transition-all duration-500 ease-in","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[d.value&&r.handleZoom?(e.openBlock(),e.createElementBlock("div",jy,[e.createElementVNode("div",Uy,[e.createElementVNode("p",zy,e.toDisplayString(p.value),1)])])):e.createCommentVNode("",!0)]),_:1}),o.value.search||o.value.import||o.value.export?(e.openBlock(),e.createElementBlock("div",Hy,[o.value.search?(e.openBlock(),e.createBlock(Ly,{key:0,onGoToCoordinates:j})):e.createCommentVNode("",!0),o.value.import||o.value.export?(e.openBlock(),e.createElementBlock("div",Ky,[e.createElementVNode("div",qy,[o.value.import?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white transition",onClick:z,disabled:s.value}," Import ",8,Gy)):e.createCommentVNode("",!0),o.value.export?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white transition",onClick:De,disabled:s.value||ze.value===0}," Export ",8,Wy)):e.createCommentVNode("",!0)]),e.createElementVNode("input",{ref_key:"importRef",ref:E,type:"file",onChange:Ae,accept:".json,.geojson",class:"hidden",disabled:s.value},null,40,Yy)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Xy,[e.createElementVNode("div",Zy,[o.value.point?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["vs-btn",{"vs-active":X.value==="marker"}]),title:"Point",onClick:T[0]||(T[0]=K=>re("marker")),disabled:s.value},[e.createVNode(dy)],10,Qy)):e.createCommentVNode("",!0),o.value.line?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["vs-btn",{"vs-active":X.value==="polyline"}]),title:"Line",onClick:T[1]||(T[1]=K=>re("polyline")),disabled:s.value},[e.createVNode(fy)],10,Jy)):e.createCommentVNode("",!0),o.value.polygon?(e.openBlock(),e.createElementBlock("button",{key:2,class:e.normalizeClass(["vs-btn",{"vs-active":X.value==="polygon"}]),title:"Polygon",onClick:T[2]||(T[2]=K=>re("polygon")),disabled:s.value},[e.createVNode(by)],10,eb)):e.createCommentVNode("",!0),o.value.rectangle?(e.openBlock(),e.createElementBlock("button",{key:3,class:e.normalizeClass(["vs-btn",{"vs-active":X.value==="rectangle"}]),title:"Rectangle",onClick:T[3]||(T[3]=K=>re("rectangle")),disabled:s.value},[e.createVNode(Ey)],10,tb)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"vs-btn mt-5",onClick:T[4]||(T[4]=K=>ye.value=!ye.value),title:"Full Screen"},[e.createVNode(Ny,{style:{width:"12px",height:"12px"}})])])]),e.createElementVNode("div",{class:e.normalizeClass(["absolute left-4 z-[1000]",Le.value?"bottom-8":"bottom-4"])},[e.createElementVNode("div",lb,[e.createVNode(Ry,{basemaps:e.unref(qe),onOnLayerChange:ge},null,8,["basemaps"]),g.value.length?(e.openBlock(),e.createElementBlock("div",ab,[T[9]||(T[9]=e.createElementVNode("p",{class:"font-semibold text-[11px] uppercase tracking-wide text-gray-500 mb-2"},"Layers",-1)),e.createElementVNode("div",rb,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,K=>(e.openBlock(),e.createElementBlock("label",{key:K.id,class:"flex items-center gap-2 cursor-pointer select-none"},[e.createElementVNode("input",{type:"checkbox",class:"rounded border-gray-300 text-blue-600 focus:ring-blue-500",checked:K.visible,disabled:s.value,onChange:W=>H(K.id)},null,40,nb),e.createElementVNode("span",ob,e.toDisplayString(K.config.title||K.config.name||K.id),1)]))),128))])])):e.createCommentVNode("",!0)])],2),e.createElementVNode("div",sb,[Le.value?(e.openBlock(),e.createElementBlock("div",ib,[e.createElementVNode("div",{class:"mr-auto flex items-center gap-2 min-w-0 relative",onMouseenter:T[5]||(T[5]=K=>i.value=!0),onMouseleave:T[6]||(T[6]=K=>i.value=!1)},[e.createElementVNode("div",cb,[T[10]||(T[10]=e.createTextVNode(" Type: ",-1)),e.createElementVNode("span",db,e.toDisplayString(Le.value.type),1)]),b.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"addressEl",ref:u,class:"text-gray-500 text-xs truncate cursor-help",style:{"max-width":"260px"}}," Address: "+e.toDisplayString(b.value),513)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[i.value&&b.value&&c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed z-[99999] pointer-events-none bg-gray-800 text-white text-xs px-2 py-1 rounded shadow whitespace-nowrap",style:e.normalizeStyle({top:c.value.top+"px",left:c.value.left+"px"})},e.toDisplayString(b.value),5)):e.createCommentVNode("",!0)]))],32),e.createElementVNode("div",ub,[e.createElementVNode("div",pb,[T[11]||(T[11]=e.createTextVNode(" Center: ",-1)),e.createElementVNode("b",null,e.toDisplayString(Le.value.center.lat.toFixed(5))+", "+e.toDisplayString(Le.value.center.lng.toFixed(5)),1)]),Le.value.areaKm2!==null?(e.openBlock(),e.createElementBlock("div",mb,[T[12]||(T[12]=e.createTextVNode(" Area: ",-1)),e.createElementVNode("b",null,e.toDisplayString(Le.value.areaKm2.toFixed(1))+" km²",1)])):(e.openBlock(),e.createElementBlock("div",fb,T[13]||(T[13]=[e.createTextVNode("Area: ",-1),e.createElementVNode("b",null,"—",-1)]))),e.createElementVNode("button",{class:"tool bg-gray-100 py-1.5 px-2 rounded-lg text-md mr-1 cursor-pointer hover:bg-blue-500 hover:text-white transition-all",title:"Zoom to feature",onClick:T[7]||(T[7]=K=>S()),disabled:s.value},T[14]||(T[14]=[e.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-3 h-3" data-v-150e767b><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-150e767b></path><path d="M7 10l6 0" data-v-150e767b></path><path d="M10 7l0 6" data-v-150e767b></path><path d="M21 21l-6 -6" data-v-150e767b></path></svg>',1)]),8,hb),e.createElementVNode("button",{class:"tool bg-gray-100 py-1.5 px-2 rounded-lg text-md cursor-pointer hover:bg-blue-500 hover:text-white transition-all",title:"Delete feature",onClick:T[8]||(T[8]=K=>q()),disabled:s.value},[e.createVNode(fa,{class:"w-3 h-3"})],8,gb)])])):e.createCommentVNode("",!0)])],2))}}),bb=ke(yb,[["__scopeId","data-v-150e767b"]]),kb=["data-focus"],xb={class:"flex items-center"},wb={class:"overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border"},Eb=["onClick","aria-label"],_b={key:0,class:"absolute text-gray-500 truncate pl-2"},Vb={class:"flex-1 min-w-[2px]"},Cb=["placeholder"],Nb={class:"flex items-center shrink-0"},Bb=["disabled"],vb=e.defineComponent({__name:"vs-input-tag",props:e.mergeModels({unique:{type:Boolean,default:!0},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:"Введіть тег"}},{modelValue:{default:[]},modelModifiers:{}}),emits:e.mergeModels(["update:modelValue"],["update:modelValue"]),setup(l,{emit:t}){const a=l,r=t;pt(a.style);const n=e.ref(null),o=e.ref(null),s=e.ref(null),i=e.ref(!1),c=e.ref(""),u=e.useModel(l,"modelValue"),d=e.computed(()=>a.placeholder||"Add tag…"),p=e.computed(()=>{var V;return((V=u.value)==null?void 0:V.length)===0&&c.value===""}),m=e.computed(()=>{var V;return!a.disabled&&((V=u.value)==null?void 0:V.length)>0}),f=e.computed(()=>a.disabled),g=async()=>{f.value||await e.nextTick(()=>{var V;return(V=s.value)==null?void 0:V.focus()})},y=V=>{const E=V.trim();E!==""&&(!u.value||!Array.isArray(u.value)?u.value=[E]:a.unique?u.value.includes(E)||(u.value=[...u.value,E]):u.value=[...u.value,E],c.value="")},w=()=>{const V=c.value;V.trim()!==""&&y(V),c.value=""},h=V=>{const E=u.value.slice();E.splice(V,1),r("update:modelValue",E)},k=()=>{r("update:modelValue",[])},x=()=>{f.value||(i.value=!0)},b=()=>{i.value=!1,!f.value&&w()},_=V=>{const{key:E}=V;E==="Enter"?(V.preventDefault(),w()):E==="Backspace"&&c.value===""&&u.value.length>0&&h(u.value.length-1)};return(V,E)=>(e.openBlock(),e.createElementBlock("div",{class:"flex gap-1 w-full",ref_key:"root",ref:n,onClick:E[1]||(E[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["relative w-full font-sans",a.customClass]),role:"group","aria-label":"Tag input"},[e.createElementVNode("div",{class:e.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white","border-gray-300 hover:border-gray-400",i.value?"border-blue-500 ring-1 ring-blue-500":"",f.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),"data-focus":i.value?"true":"false",onClick:g},[e.createElementVNode("div",{class:"flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",ref_key:"chipsRef",ref:o},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(D,$)=>(e.openBlock(),e.createElementBlock("div",{key:$,class:"flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"},[e.createElementVNode("div",xb,[e.createElementVNode("div",wb,e.toDisplayString(D),1)]),e.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",onClick:e.withModifiers(C=>h($),["stop"]),"aria-label":`Remove ${D}`},E[2]||(E[2]=[e.createElementVNode("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,Eb)]))),128)),p.value?(e.openBlock(),e.createElementBlock("div",_b,e.toDisplayString(d.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Vb,[f.value?e.createCommentVNode("",!0):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:s,class:"pl-2 w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-label":"Add tag","onUpdate:modelValue":E[0]||(E[0]=D=>c.value=D),onFocus:x,onBlur:b,onKeydown:_,placeholder:u.value&&u.value.length?"":void 0},null,40,Cb)),[[e.vModelText,c.value]])])],512),e.createElementVNode("div",Nb,[m.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-label":"Clear all tags",disabled:f.value,onClick:e.withModifiers(k,["stop"])},E[3]||(E[3]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,Bb)):e.createCommentVNode("",!0)])],10,kb)],2)],512))}}),Sb={class:"relative flex gap-1 bg-white w-full"},Db=["disabled","placeholder"],Ab=e.defineComponent({__name:"vs-input-slug",props:e.mergeModels({disabled:{type:Boolean},placeholder:{},parent:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=e.inject("values"),a=l,r=e.useModel(l,"modelValue");function n(s){const i={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"e",ж:"zh",з:"z",и:"i",й:"y",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"kh",ц:"ts",ч:"ch",ш:"sh",щ:"shch",ы:"y",э:"e",ю:"yu",я:"ya",ь:"",ъ:"",є:"ye",і:"i",ї:"yi",ґ:"g"};return s.toLowerCase().split("").map(c=>i[c]||c).join("").replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}const o=()=>{var c,u;const s=(u=(c=t==null?void 0:t.value)==null?void 0:c[a.parent||""])==null?void 0:u.toString(),i=n(s);r.value=i.toString()};return(s,i)=>(e.openBlock(),e.createElementBlock("div",Sb,[e.withDirectives(e.createElementVNode("input",{ref:"vsText",disabled:s.disabled,placeholder:s.placeholder,"onUpdate:modelValue":i[0]||(i[0]=c=>r.value=c),class:"block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,8,Db),[[e.vModelText,r.value]]),e.createElementVNode("button",{class:"px-2 bg-gray-100 border rounded-lg hover:bg-gray-200",onClick:o}," Gen ")]))}}),Mb=ke(Ab,[["__scopeId","data-v-b0eba370"]]),Tb={class:"relative flex gap-1 bg-white w-full"},$b=["disabled","placeholder"],Lb=["disabled"],Fb={key:0},Ib={key:1},Ob=e.defineComponent({__name:"vs-input-codegen",props:e.mergeModels({table:{},code:{},init:{type:Boolean},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),r=e.ref(!1),n=e.computed(()=>t.init!==!1),o=e.computed(()=>!!t.table&&!!t.code),s=()=>{if(!o.value)return"";const u=encodeURIComponent(String(t.table)),d=encodeURIComponent(String(t.code));return`/api/code-gen/${u}/${d}`},i=async()=>{if(!o.value||r.value)return;const u=s();if(u){r.value=!0;try{const d=await(await fetch(u)).text();a.value=d}finally{r.value=!1}}},c=()=>{n.value&&(a.value||i())};return e.onMounted(()=>{c()}),e.watch(()=>[t.table,t.code,t.init],()=>{c()}),(u,d)=>(e.openBlock(),e.createElementBlock("div",Tb,[e.withDirectives(e.createElementVNode("input",{disabled:u.disabled,placeholder:u.placeholder,"onUpdate:modelValue":d[0]||(d[0]=p=>a.value=p),class:"block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,8,$b),[[e.vModelText,a.value]]),e.createElementVNode("button",{class:"px-2 bg-gray-100 border rounded-lg hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed",disabled:r.value||u.disabled||!o.value,onClick:i},[r.value?(e.openBlock(),e.createElementBlock("span",Ib,"...")):(e.openBlock(),e.createElementBlock("span",Fb,"Gen"))],8,Lb)]))}}),Pb=ke(Ob,[["__scopeId","data-v-6ee5237d"]]),Rb={class:"w-full"},jb={ref:"sortableContainer",class:"flex flex-col gap-1"},Ub=["onDragstart","onDrop"],zb={class:"w-1/3"},Hb={class:"w-2/3"},Kb=["onClick"],qb={key:0,class:"text-[14px] text-gray-700"},Gb={class:"mt-2 w-full flex items-center"},Wb=["disabled"],Yb=e.defineComponent({__name:"vs-input-key-value",props:{parent:{},ignore:{},addButtonText:{},modelValue:{}},emits:["update:modelValue"],setup(l,{emit:t}){const a=y=>`${y}-${Math.random().toString(36).substring(2,15)}`,r=e.inject("values"),n=l,o=t,s=n.addButtonText??"Додати",i=n.ignore??[],c=e.ref([]),u=e.ref(null);(()=>{var w;const y=n.parent&&((w=r==null?void 0:r.value)==null?void 0:w[n.parent])||n.modelValue||{};c.value=Object.entries(y).filter(([h])=>!i.includes(h)).map(([h,k])=>({id:a("key-value-"),key:h,value:k}))})();function d(y){u.value=y}function p(y){if(u.value===null||u.value===y)return;const w=c.value.splice(u.value,1)[0];c.value.splice(y,0,w),u.value=null}const m=e.computed(()=>c.value.some(y=>y.key&&!y.value||!y.key&&y.value)),f=()=>{c.value.push({id:a("key-value-"),key:"",value:""})},g=y=>{c.value=c.value.filter(w=>w.id!==y)};return e.watch(c,y=>{const w={};y.forEach(k=>{k.key&&k.value!==void 0&&(w[k.key]=k.value)});const h={};i.length&&i.forEach(k=>{var x,b;h[k]=n.parent?(b=(x=r==null?void 0:r.value)==null?void 0:x[n.parent])==null?void 0:b[k]:void 0}),r!=null&&r.value&&n.parent&&(r.value[n.parent]={...h,...w}),o("update:modelValue",w)},{deep:!0}),(y,w)=>(e.openBlock(),e.createElementBlock("div",Rb,[e.createElementVNode("div",jb,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(h,k)=>(e.openBlock(),e.createElementBlock("div",{key:h.id,class:e.normalizeClass(["flex items-center gap-2 w-full",{"opacity-50":u.value===k}]),draggable:"true",onDragstart:x=>d(k),onDragover:w[0]||(w[0]=e.withModifiers(()=>{},["prevent"])),onDrop:x=>p(k)},[w[1]||(w[1]=e.createStaticVNode('<button class="cursor-move" data-v-a0f7fbfc><svg fill="#000000" width="20" height="20" viewBox="0 0 36 36" data-v-a0f7fbfc><circle cx="15" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="18" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="18" r="1.5" data-v-a0f7fbfc></circle></svg></button>',1)),e.createElementVNode("div",zb,[e.createVNode(ma,{modelValue:h.key,"onUpdate:modelValue":x=>h.key=x,placeholder:"Ключ"},null,8,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("div",Hb,[e.createVNode(ma,{modelValue:h.value,"onUpdate:modelValue":x=>h.value=x,placeholder:"Значення"},null,8,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("button",{onClick:x=>g(h.id),class:"shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200"},[e.createVNode(e.unref(f0),{height:"16",width:"16"})],8,Kb)],42,Ub))),128))],512),c.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",qb," Дані для відображення відсутні ")),e.createElementVNode("div",Gb,[e.createElementVNode("button",{type:"button",onClick:f,disabled:m.value,class:"py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"},[e.createVNode(Ll,{height:"14",width:"14"}),e.createTextVNode(" "+e.toDisplayString(e.unref(s)),1)],8,Wb)])]))}}),Xb=ke(Yb,[["__scopeId","data-v-a0f7fbfc"]]),Zb={class:"flex items-center gap-2 w-full"},Qb=["disabled"],Jb=["disabled"],e1=e.defineComponent({__name:"vs-input-color",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l,{inputClass:r}=pt(a.style),n=t,o=e.computed({get:()=>a.modelValue||"#000000",set:i=>n("update:modelValue",i)}),s=e.computed(()=>!!a.disabled);return(i,c)=>(e.openBlock(),e.createElementBlock("div",Zb,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":c[0]||(c[0]=u=>o.value=u),disabled:s.value,ref:"color",class:e.normalizeClass(["py-1.5 px-1 block w-full bg-white cursor-pointer max-w-[50px]",[i.modelValue?"":"text-opacity-50",e.unref(r)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,Qb),[[e.vModelText,o.value]]),e.withDirectives(e.createElementVNode("input",{class:"text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2","onUpdate:modelValue":c[1]||(c[1]=u=>o.value=u),disabled:s.value},null,8,Jb),[[e.vModelText,o.value]])]))}}),t1={class:"flex items-center gap-2 w-full"},l1=["min","max","step","disabled"],a1=["disabled"],r1=e.defineComponent({__name:"vs-input-range",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},min:{default:0},max:{default:100},step:{default:1}},emits:["update:modelValue"],setup(l,{emit:t}){const a=l,{inputClass:r}=pt(a.style),n=t,o=e.computed({get:()=>Number(a.modelValue??a.min),set:i=>n("update:modelValue",Number(i))}),s=e.computed(()=>!!a.disabled);return(i,c)=>(e.openBlock(),e.createElementBlock("div",t1,[e.withDirectives(e.createElementVNode("input",{type:"range","onUpdate:modelValue":c[0]||(c[0]=u=>o.value=u),min:i.min,max:i.max,step:i.step,disabled:s.value,ref:"range",class:e.normalizeClass(["w-full cursor-pointer accent-blue-500",[i.modelValue?"":"text-opacity-50",e.unref(r)].join(" ")])},null,10,l1),[[e.vModelText,o.value]]),e.withDirectives(e.createElementVNode("input",{class:"text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2 max-w-[100px]",type:"number","onUpdate:modelValue":c[1]||(c[1]=u=>o.value=u),disabled:s.value},null,8,a1),[[e.vModelText,o.value]])]))}}),n1=["type","value","onInput","placeholder","disabled"],o1=e.defineComponent({__name:"vs-input-array",props:e.mergeModels({count:{default:1},limit:{default:l=>l.count??1},inputType:{default:"text"},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,{inputClass:a}=pt(t.style),r=e.useModel(l,"modelValue"),n=e.computed(()=>!!t.disabled),o=e.computed(()=>t.placeholder??"");e.watchEffect(()=>{var c;const i=((c=r.value)==null?void 0:c.length)??0;i<t.count&&(r.value=[...r.value??[],...Array(t.count-i)])});function s(i,c){if(n.value)return;const u=i.target.value,d=[...r.value];d[c]=t.inputType==="text"?u:Number(u),r.value=d}return(i,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["grid gap-2",`grid-cols-${i.limit}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.count,u=>{var d;return e.openBlock(),e.createElementBlock("input",{type:i.inputType,value:((d=r.value)==null?void 0:d[u-1])??"",onInput:p=>s(p,u-1),placeholder:o.value,disabled:n.value,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(a),{"!border-red-600":i.error}]]),style:{border:"1px solid #CFD9E0"}},null,42,n1)}),256))],2))}}),s1={class:"flex items-center gap-2 w-full"},i1={class:"relative flex-1"},c1=["placeholder","disabled","onKeydown"],d1=["disabled"],u1={key:0,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},p1={key:1,class:"animate-spin h-5 w-5 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},m1={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/50"},f1={class:"bg-white text-gray-900 rounded-lg shadow-lg w-[480px] max-h-[80vh] overflow-y-auto"},h1={class:"p-3 border-b font-semibold text-gray-900 flex justify-between items-center"},g1=["onClick"],y1={key:0,class:"p-4 text-sm text-gray-500"},b1=e.defineComponent({__name:"vs-input-address",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{},api:{default:""},geom:{default:""},includes:{default:()=>[]}},{modelValue:{default:""},modelModifiers:{}}),emits:e.mergeModels(["update:modelValue","update:geom"],["update:modelValue"]),setup(l,{emit:t}){const a=l,r=t,{inputClass:n}=pt(a.style),o=e.useModel(l,"modelValue"),s=e.computed({get:()=>o.value,set:h=>{o.value=h}}),i=e.ref(!1),c=e.ref([]),u=e.ref(!1),d=e.computed(()=>a.placeholder??""),p=e.computed(()=>!!a.disabled),m=e.inject("values");function f(){!p.value&&s.value.trim()&&g()}async function g(){var b;const h=(s.value||"").trim();if(!h)return;let k=h;if((b=a.includes)!=null&&b.length&&(m!=null&&m.value)){const _=a.includes.map(V=>{var E;return(E=m.value)==null?void 0:E[V]}).filter(Boolean);_.length&&(k=`${_.join(", ")}, ${h}`)}const x=a.api.replace("{{value}}",encodeURIComponent(k));i.value=!0;try{const _=await(await fetch(x)).json();c.value=Array.isArray(_)?_:[],u.value=!0}catch(_){console.error("Address search error:",_)}finally{i.value=!1}}function y(){u.value=!u.value}function w(h){if(!h)return;u.value=!1;const k=parseFloat(h.lat),x={type:"Point",coordinates:[parseFloat(h.lon),k]};a.geom&&(m!=null&&m.value)&&(m.value[a.geom]=x),r("update:geom",x)}return(h,k)=>{var x;return e.openBlock(),e.createElementBlock("div",s1,[e.createElementVNode("div",i1,[e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":k[0]||(k[0]=b=>s.value=b),placeholder:d.value,disabled:p.value,class:e.normalizeClass(["py-1.5 px-3 block w-full bg-white border rounded-md placeholder:text-gray-400 focus:ring-2 focus:ring-blue-500",[e.unref(n),{"!border-red-600":a.error}]]),style:{border:"1px solid #CFD9E0"},onKeydown:e.withKeys(e.withModifiers(f,["prevent"]),["enter"])},null,42,c1),[[e.vModelText,s.value]]),c.value.length?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-blue-600",onClick:y,title:"Show search results"},k[2]||(k[2]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),e.createElementVNode("path",{d:"M12 16v-4"}),e.createElementVNode("path",{d:"M12 8h.01"})],-1)]))):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",onClick:g,class:"flex items-center justify-center px-2 py-2 border rounded-md bg-white hover:bg-gray-50 text-gray-600 hover:text-blue-600 disabled:opacity-50 h-[38px]",disabled:i.value||!((x=s.value)!=null&&x.trim())},[i.value?(e.openBlock(),e.createElementBlock("svg",p1,k[4]||(k[4]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)]))):(e.openBlock(),e.createElementBlock("svg",u1,k[3]||(k[3]=[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"},null,-1),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"},null,-1)])))],8,d1),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[u.value?(e.openBlock(),e.createElementBlock("div",m1,[e.createElementVNode("div",f1,[e.createElementVNode("div",h1,[k[6]||(k[6]=e.createElementVNode("span",null,"Search results",-1)),e.createElementVNode("button",{class:"text-gray-500 hover:text-blue-600",onClick:k[1]||(k[1]=b=>u.value=!1),title:"Close"},k[5]||(k[5]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)]))]),e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(b,_)=>(e.openBlock(),e.createElementBlock("li",{key:_,onClick:V=>w(b),class:"px-3 py-2 cursor-pointer hover:bg-gray-100 border-b text-sm"},e.toDisplayString(b.display_name),9,g1))),128))]),c.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",y1," No results found "))])])):e.createCommentVNode("",!0)]))])}}}),ot={VsInputText:ma,VsInputRadio:bo,"vs-input-text":ma,"vs-input-password":Um,"vs-input-textarea":Zh,"vs-input-mask":C0,"vs-input-number":Km,"vs-input-radio":bo,"vs-input-select":xr,"vs-input-switcher":go,"vs-input-static":yo,"vs-input-container":Dh,"vs-input-date":j0,"vs-input-checkbox":ko,"vs-input-file":Sf,"vs-input-html":yo,"vs-input-email":v0,"vs-input-datatable":ry,"vs-input-map":bb,"vs-input-file-list":nh,"vs-input-tags":vb,"vs-input-slug":Mb,"vs-input-codegen":Pb,"vs-input-key-value":Xb,"vs-input-range":r1,"vs-input-color":e1,"vs-input-native-select":xr,"vs-input-array":o1,"vs-input-address":b1},k1=e.defineComponent({__name:"behavior",props:{api:{},set:{},button:{},error:{},value:{}},setup(l){const t=l,a=e.inject("values");async function r(){try{if(!t.api)return;const n=t.api.replace("{{value}}",t.value),o=await fetch(n);if(!o.ok){xe({type:"warning",title:"Validation",message:"При спробі завантажити дані виникла помилка."});return}const s=await o.json();if(!t.set||!a)return;for(const[i,c]of Object.entries(t.set))a.value[i]=s.result[c]}catch(n){console.error(t.error,n)}}return(n,o)=>(e.openBlock(),e.createElementBlock("button",{onClick:r,class:"vs-button relative inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-blue-500 hover:border-blue-500 hover:bg-blue-500 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 ml-0 md:ml-2 mt-2 md:mt-0 py-[8px] md:w-2/4 whitespace-nowrap w-full"},e.toDisplayString(n.button),1))}}),x1={class:"flex flex-col gap-1 w-full"},w1={key:0,class:"text-sm text-gray-500"},Bo=e.defineComponent({__name:"vs-compact-form-layout",props:e.mergeModels({item:{default:{}},layout:{default:"default"},style:{default:{}},type:{default:""},error:{type:[String,Boolean]},columns:{default:()=>({container:12,label:3})}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=e.useModel(l,"modelValue"),r=e.computed(()=>Rm[`${t.layout}`]),n=e.computed(()=>ot==null?void 0:ot[`vs-input-${t.item.type}`]),o=e.computed(()=>{var d;const i=e.unref(n);if(!i)return new Set;const c=i.props??((d=i.__vccOpts)==null?void 0:d.props);if(!c)return new Set;const u=Array.isArray(c)?c:Object.keys(c);return new Set(u)}),s=e.computed(()=>{const i=t.item??{},c=o.value;return c.size?Object.fromEntries(Object.entries(i).filter(([u])=>c.has(u))):{}});return(i,c)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{ua:t.item.ua,error:t.error||"",item:i.item,columns:t.columns,label:t.item.label},{default:e.withCtx(()=>{var u,d;return[e.createElementVNode("div",{class:e.normalizeClass(["flex w-full",`${t.item.type}-component`])},[e.createElementVNode("div",x1,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value),e.mergeProps(s.value,{modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=p=>a.value=p)}),null,16,["modelValue"])),i.item.description&&t.layout!=="settings"?(e.openBlock(),e.createElementBlock("p",w1,e.toDisplayString(i.item.description),1)):e.createCommentVNode("",!0)]),(u=i.item.behavior)!=null&&u.api&&((d=i.item.behavior)!=null&&d.button)?(e.openBlock(),e.createBlock(k1,e.mergeProps({key:0},i.item.behavior,{value:a.value}),null,16,["value"])):e.createCommentVNode("",!0)],2)]}),_:1},8,["ua","error","item","columns","label"]))}}),E1={class:"text-sm text-gray-800 mb-[4px] font-medium dark:text-neutral-300"},_1={class:"vs-compact-form-navigation__rail mt-[6px]"},V1=["onClick"],C1=e.defineComponent({__name:"vs-compact-form-navigation",props:{target:{},scrollContainer:{},title:{default:"Навігація"},enabled:{type:Boolean,default:!0},width:{default:400}},setup(l,{expose:t}){const a=l,r=e.ref([]),n=e.ref(""),o=e.ref(""),s=e.computed(()=>!!a.enabled),i=e.computed(()=>["vs-compact-form-navigation flex flex-col pl-[6px] pt-[8px] pr-[8px]","sticky top-0 self-start shrink-0","max-h-full min-h-0 overflow-y-auto"]),c=e.computed(()=>{const B=a.width;if(B==null)return{};const M=typeof B=="number"?`${B}px`:`${B}`;return{width:M,minWidth:M}});let u=null,d=0,p=0,m=null,f=null,g=null;const y=()=>$(),w=()=>k();e.watch(()=>a.target,async B=>{if(V(),!B){m=null,r.value=[],n.value="";return}m=B,s.value&&(await e.nextTick(),_(B),k())},{immediate:!0}),e.watch(()=>a.scrollContainer,B=>{if(!s.value){f=B??null;return}h(B??null),e.nextTick(()=>k())},{immediate:!0}),e.onMounted(()=>{a.scrollContainer||h(null),k()}),e.onBeforeUnmount(()=>{V(),h(null,!0),m=null,typeof window<"u"&&(d&&window.cancelAnimationFrame(d),p&&window.cancelAnimationFrame(p))});function h(B,M=!1){if(g&&(g(),g=null),M){f=null;return}if(f=B??null,typeof window>"u")return;const U=B??window,P=window;U.addEventListener("scroll",y,{passive:!0}),P.addEventListener("resize",w),g=()=>{U.removeEventListener("scroll",y),P.removeEventListener("resize",w)}}function k(){if(!s.value||!m)return;d&&typeof window<"u"&&window.cancelAnimationFrame(d);const B=()=>{x(),d=0};typeof window>"u"?B():d=window.requestAnimationFrame(B)}function x(){if(!s.value||!m)return;const B=Array.from(m.querySelectorAll("h1, h2")),M=new Set,U=[];B.forEach((P,I)=>{var pe;const O=((pe=P.textContent)==null?void 0:pe.trim())??"";if(!O)return;let F=(P.getAttribute("id")??"").trim();F||(F=b(O)||`heading-${I+1}`);let H=F,Q=1;for(;M.has(H);)H=`${F}-${Q+=1}`;P.id!==H&&Object.assign(P,{id:H}),M.add(H),U.push({id:H,text:O,level:P.tagName.toLowerCase()==="h1"?1:2})}),r.value=U,U.length||(n.value=""),D()}function b(B){return B.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function _(B){!B||!s.value||typeof MutationObserver>"u"||(V(),u=new MutationObserver(()=>k()),u.observe(B,{childList:!0,subtree:!0}))}function V(){u&&(u.disconnect(),u=null)}function E(B){const M=f;if(!M)return typeof window>"u"?B.offsetTop:B.getBoundingClientRect().top+window.scrollY;const U=B.getBoundingClientRect(),P=M.getBoundingClientRect();return U.top-P.top+M.scrollTop}function D(){if(!s.value||!r.value.length)return;const B=f,M=(B?B.scrollTop:null)||(typeof window<"u"?window.scrollY:0),U=(B?B.clientHeight:null)||(typeof window<"u"?window.innerHeight:0),P=M+U;let I=null;for(let F=0;F<r.value.length;F+=1){const H=r.value[F],Q=document.getElementById(H.id);if(Q){const pe=E(Q);pe+Q.offsetHeight>M&&pe<P&&(I=H.id)}}!I&&o.value&&(I=o.value),I&&(o.value=I);const O=B?B.scrollHeight-B.clientHeight:document.documentElement.scrollHeight-window.innerHeight;M+5>=O&&(I=r.value[r.value.length-1].id),I&&(n.value=I)}function $(){s.value&&(p&&window.cancelAnimationFrame(p),p=window.requestAnimationFrame(()=>{D(),p=0}))}function C(B){if(!s.value)return;const M=document.getElementById(B);if(!M)return;const U=f,P=Math.max(0,E(M));U?U.scrollTo({top:P,behavior:"smooth"}):typeof window<"u"&&window.scrollTo({top:P,behavior:"smooth"})}return t({refresh:k}),(B,M)=>s.value&&r.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(i.value),style:e.normalizeStyle(c.value)},[e.createElementVNode("h2",E1,e.toDisplayString(B.title),1),e.createElementVNode("div",_1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,U=>(e.openBlock(),e.createElementBlock("div",{key:U.id,class:e.normalizeClass(["vs-compact-form-navigation__item relative",U.level===2?"vs-compact-form-navigation__item--nested":"",U.id===n.value?"vs-compact-form-navigation__item--active":""])},[e.createElementVNode("button",{type:"button",onClick:P=>C(U.id),class:e.normalizeClass(["vs-compact-form-navigation__button flex gap-x-3 py-[6px] pr-3 text-sm duration-200 hover:text-gray-800",U.level===2?"pl-[15px]":"pl-[18px]",U.id===n.value?"text-gray-800":"text-gray-500"])},[e.createElementVNode("span",null,e.toDisplayString(U.text),1)],10,V1)],2))),128))])],6)):e.createCommentVNode("",!0)}}),N1=ke(C1,[["__scopeId","data-v-1584a562"]]),vo={required:"Це поле є обов’язковим",email:"Неправильний email"},B1=l=>l?!1:vo.required,v1=l=>l?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l)?!1:vo.email:!1,S1=(l,t)=>{const a=t.pattern??t.regexp;return!(typeof a=="string"?new RegExp(a):a).test(l)&&l?t.message:!1},D1=(l,t)=>!1,A1=(l,t)=>{switch(typeof t=="string"?t:t.type){case"required":return B1(l);case"email":return v1(l);case"regexp":return S1(l,t);case"custom":return D1();default:return!1}},M1={autocomplete:"select",combobox:"select",datepicker:"date",markedtext:"mask",html:"static",geom:"map",filelist:"file-list",datalist:"datatable",file:"file",dropzone:"file"};function So(l){const t=l.toLowerCase();return M1[t]||t}function wr(l,t=!1){if(Array.isArray(l)){const r=[];return l.forEach(n=>{const o={...n};o.name=(n.name||n.id||n.key||"").toString(),o.type=So(n.type),o.label=n.label||n.ua,o.rules=n.rules||n.validators,o.type==="email"&&!o.rules&&(o.rules=["email"]),n.data&&(o.api=`/api/suggest/${n.data}`),o.disabled=t||o.disabled,Array.isArray(o.schema)&&(o.schema=wr(o.schema,o.disabled)),r.push(o)}),r}const a=[];return Object.entries(l).forEach(r=>{const n={name:r[0],...r[1],type:So(r[1].type),label:r[1].label||r[1].ua,rules:r[1].rules||r[1].validators,disabled:t};n.type==="email"&&!n.rules&&(n.rules=["email"]),r[1].type.includes("list")&&(n.multiple=!0),!n.api&&r[1].data&&(n.api=`/api/suggest/${r[1].data}`),Array.isArray(n.schema)&&(n.schema=wr(n.schema,n.disabled)),a.push(n)}),a}function T1(l,t,a=!1){const r=e.computed(()=>wr(t,typeof a=="boolean"?a:a.value)),n=e.ref({});function o(c){var m;const u=c==null?void 0:c.conditions;if(!u)return!0;const d=Array.isArray(u)?u[0]:u,p=(m=l==null?void 0:l.value)==null?void 0:m[d];return Co(p,u)}const s=(c=r.value,u=!0)=>(c.forEach(d=>{if(d.rules){if(!o(d)){delete n.value[d.name];return}let p=!1,m=null;d.rules.forEach(f=>{const g=A1(l.value[d.name],f);g&&(p=!0,!m&&typeof g=="string"&&(m=g))}),p&&m?n.value[d.name]=m:delete n.value[d.name]}d.schema&&s(d.schema,!1)}),u&&Object.values(n.value).some(Boolean)?n.value:null),i=e.computed(()=>{var c;return(c=r.value)==null?void 0:c.filter(u=>u.hidden!==!0&&o(u))});return{errors:n,validate:s,reset:()=>{l.value={},n.value={}},visibleSchema:i}}const $1={class:"flex w-full h-full min-h-0 gap-6"},L1={key:0,"data-orientation":"horizontal",role:"none",class:"mt-1 shrink-0 h-[1px] w-full bg-slate-100 dark:bg-slate-600"},mt=e.defineComponent({__name:"vs-compact-form",props:e.mergeModels({schema:{default:()=>[]},style:{default:()=>({})},modelValue:{},layout:{default:()=>"default"},formId:{default:()=>""},disabled:{type:Boolean,default:!1},navigation:{type:Boolean,default:!1},navWidth:{default:400},columns:{}},{form:{default:()=>({})},formModifiers:{},values:{default:()=>({})},valuesModifiers:{}}),emits:e.mergeModels(["handle-submit","update:modelValue"],["update:form","update:values"]),setup(l,{expose:t,emit:a}){const r=a,n=l,o=e.useModel(l,"form"),s=e.useModel(l,"values"),{errors:i,validate:c,reset:u,visibleSchema:d}=T1(s,n.schema,e.toRef(n,"disabled")),p=e.ref(null),m=e.ref(null),f=e.computed(()=>n.navigation),g=e.computed(()=>n.navWidth),y=e.computed(()=>{var D;return(D=n.style)==null?void 0:D.columns}),w=Object.freeze({container:12,label:3}),h=e.computed(()=>n.columns??y.value??w),k=e.computed(()=>n.columns!=null||y.value!=null),x=e.computed(()=>k.value?"horizontal":n.layout),b=D=>D!=null&&D.columns?"horizontal":x.value,_=D=>(D==null?void 0:D.columns)??h.value,V=()=>{r("update:modelValue",s.value),c(),r("handle-submit",s.value)};t({validate:c,reset:u,errors:i}),e.onMounted(()=>{n.modelValue&&(s.value=n.modelValue),o.value={value:s.value,errors:i.value,reset:u,validate:c,formId:n.formId}});function E(D,$){if(D===$)return!0;if(typeof D!="object"||typeof $!="object"||!D||!$)return!1;const C=Object.keys(D),B=Object.keys($);return C.length!==B.length?!1:C.every(M=>D[M]===$[M])}return e.provide("form",o),e.provide("values",s),(D,$)=>(e.openBlock(),e.createElementBlock("div",$1,[e.createElementVNode("div",{class:"flex-1 min-h-0 overflow-y-auto overflow-x-visible",ref_key:"formScrollContainer",ref:m},[e.createElementVNode("form",{ref_key:"formRef",ref:p,onSubmit:e.withModifiers(V,["prevent"]),class:e.normalizeClass(["grid grid-cols-12 p-1",x.value==="default"?"gap-6":"gap-4"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),(C,B)=>(e.openBlock(),e.createElementBlock("div",{key:C.name,class:e.normalizeClass(b(C)==="horizontal"?"col-span-12":`col-span-${C.col||12}`)},[e.createVNode(Bo,{style:e.normalizeStyle(D.style),item:C,layout:b(C),columns:_(C),"model-value":s.value[C.name],"onUpdate:modelValue":M=>{const U=s.value[C.name];E(U,M)||(s.value[C.name]=M)},error:e.unref(i)[C.name]},null,8,["style","item","layout","columns","model-value","onUpdate:modelValue","error"]),b(C)==="settings"&&B+1!==e.unref(d).length?(e.openBlock(),e.createElementBlock("div",L1)):e.createCommentVNode("",!0)],2))),128))],34)],512),e.createVNode(N1,{target:p.value,"scroll-container":m.value,enabled:f.value,width:g.value},null,8,["target","scroll-container","enabled","width"])]))}}),F1={class:"relative"},I1={class:"w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50"},O1={class:"m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12"},P1={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},R1={class:"font-medium text-gray-800 dark:text-[#ffffff]"},j1={class:"p-4 mim-h-0 h-full overflow-auto"},U1=e.defineComponent({__name:"modal-edit",props:{schema:{},defaultValue:{},mode:{},token:{},form:{}},emits:["close","save","edit"],setup(l,{emit:t}){const a=l,r=t,n=e.ref(a.schema),o=e.ref(a.defaultValue?JSON.parse(JSON.stringify(a.defaultValue)):{}),s=e.ref({}),i=e.ref(),c=e.ref(a.mode);async function u(){const p=s.value.validate();if(p){xe({type:"warning",title:"Помилка валідації",message:Object.entries(p).map(([m,f])=>`${m}: ${f}`).join(`
|
|
189
|
+
`)});return}if(i.value)try{const m=await fetch(`/api/table/${i.value}`,{method:c.value==="add"?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(o.value)});if(m.ok)await m.json(),xe({type:"success",title:"Успішно",message:`Дані успішно ${c.value==="add"?"збережено":"оновлено"}`}),r("save",o.value);else if(m.status===400){const f=await m.json().catch(()=>({}));xe({type:"warning",title:"Помилка валідації",message:f.message||"Некоректні дані (400)"})}else m.status===500?xe({type:"error",title:"Серверна помилка",message:"Виникла помилка на сервері (500)"}):xe({type:"error",title:"Помилка",message:`Статус: ${m.status}`})}catch(m){xe({type:"error",title:"Помилка з’єднання",message:m.message||"Не вдалося виконати запит"})}}function d(){r("close")}return e.onMounted(async()=>{try{if(a.form){const p=await fetch(`/api/template/form/${a.form}`);if(!p.ok){xe({type:p.status>=400&&p.status<500?"warning":"error",title:"Error",message:`Error code: ${p.status}`});return}const m=await p.json();n.value=m.schema,i.value=m.token}else if(a.token){i.value=a.token;const p=await fetch(`/api/form/${i.value}`);if(!p.ok){xe({type:p.status>=400&&p.status<500?"warning":"error",title:"Error",message:`Error code: ${p.status}`});return}const m=await p.json();n.value=m.schema,m.data?o.value=m.data:c.value="add"}}catch(p){xe({type:"error",title:"Error",message:p.message||"Unexpected error"}),console.error(p)}}),(p,m)=>(e.openBlock(),e.createElementBlock("div",F1,[e.createElementVNode("div",I1,[e.createElementVNode("div",O1,[e.createElementVNode("div",P1,[e.createElementVNode("h3",R1,e.toDisplayString(c.value==="add"?"Додати":"Змінити"),1),e.createElementVNode("button",{onClick:d,type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"},m[2]||(m[2]=[e.createElementVNode("span",{class:"sr-only"},"Close",-1),e.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",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"},[e.createElementVNode("path",{d:"M18 6 6 18"}),e.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),e.createElementVNode("div",j1,[n.value?(e.openBlock(),e.createBlock(mt,{key:0,schema:n.value,values:o.value,"onUpdate:values":m[0]||(m[0]=f=>o.value=f),form:s.value,"onUpdate:form":m[1]||(m[1]=f=>s.value=f)},null,8,["schema","values","form"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"vs-form__head mr-5 mb-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},[e.createElementVNode("button",{type:"button",onClick:d,class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),e.createElementVNode("button",{onClick:u,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])])])]))}}),Do=(l={mode:"edit",schema:null})=>new Promise(t=>{const{close:a}=km({title:l.mode==="add"?"Додати":"Редагувати",template:"",size:"medium",content:U1,contentProps:{...l,onClose:()=>{t(null),a()},onSave:r=>{t(r),a()}}})});mt.install=function(l){l.component("VForm",mt),Object.assign(l.config.globalProperties,{$form:Do}),l.provide("form",Do),window.v3plugin||(window.v3plugin={})};const vt=(l,t)=>{const a=l.__vccOpts||l;for(const[r,n]of t)a[r]=n;return a},z1={},H1={xmlns:"http://www.w3.org/2000/svg",width:"15px",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-reload absolute inline mr-1 text-gray-800 transition-all cursor-pointer active:rotate-90 right-1 top-1 hover:text-blue-500"};function K1(l,t){return e.openBlock(),e.createElementBlock("svg",H1,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M19.933 13.041a8 8 0 1 1 -9.925 -8.788c3.899 -1 7.935 1.007 9.425 4.747"},null,-1),e.createElementVNode("path",{d:"M20 4v5h-5"},null,-1)])])}const q1=vt(z1,[["render",K1]]),G1={},W1={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:"text-blue-600 w-[16px] h-[16px]"};function Y1(l,t){return e.openBlock(),e.createElementBlock("svg",W1,[...t[0]||(t[0]=[e.createElementVNode("path",{d:"M20 6 9 17l-5-5"},null,-1)])])}const Qt=vt(G1,[["render",Y1]]),X1={class:"flex items-center cursor-pointer w-full"},Z1={key:0,width:"16",height:"auto",src:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTYgMTYnIGZpbGw9J3doaXRlJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMi4yMDcgNC43OTNhMSAxIDAgMDEwIDEuNDE0bC01IDVhMSAxIDAgMDEtMS40MTQgMGwtMi0yYTEgMSAwIDAxMS40MTQtMS40MTRMNi41IDkuMDg2bDQuMjkzLTQuMjkzYTEgMSAwIDAxMS40MTQgMHonLz48L3N2Zz4="},Q1=["value"],J1={class:"flex flex-row items-center font-normal text-gray-800 gap-x-1"},ek={key:0,class:"text-xs text-gray-500 dark:text-neutral-500 pr-1"},tk={key:1,class:"absolute right-2 flex size-3.5 items-center justify-center"},Er=e.defineComponent({__name:"list-item",props:{layout:{},count:{},type:{},label:{},value:{},isSelected:{type:Boolean},color:{},highlighted:{type:Boolean}},emits:["itemClick"],setup(l,{expose:t,emit:a}){const r=l,n=a;function o(){n("itemClick",r.value)}const s=e.ref(null),i=e.computed(()=>r.layout==="inline"&&r.type==="radio"),c=e.computed(()=>r.layout==="vertical"?"text-[13px]":"text-sm");return t({el:s}),(u,d)=>(e.openBlock(),e.createElementBlock("div",{class:"flex items-center w-full rounded-sm group hover:bg-gray-100",ref_key:"el",ref:s},[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center justify-between w-full",c.value])},[e.createElementVNode("div",X1,[e.createElementVNode("label",{for:"radio-9740",class:e.normalizeClass([["inline","popover"].includes(u.layout)?"text-gray-500 px-2 w-full py-2 cursor-pointer !flex flex-row items-center":"flex flex-row items-center w-full px-2 py-2 text-gray-500 cursor-pointer",{"bg-blue-100":u.highlighted,relative:i.value},c.value]),onClick:e.withModifiers(o,["stop","prevent"])},[i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["w-[18px] h-[18px] border flex items-center justify-center",[u.type==="checkbox"?"rounded-[4px]":"rounded-full",u.color?`bg-[${u.color}] border-[#ffffff]`:u.isSelected?"bg-[#2563eb] border-[#ffffff]":"bg-[#ffffff] border-[#d9d9d9]"]])},[u.isSelected?(e.openBlock(),e.createElementBlock("img",Z1)):e.createCommentVNode("",!0)],2)),e.createElementVNode("input",{type:"checkbox",class:"hidden",id:"radio-9740",value:u.value},null,8,Q1),e.createElementVNode("div",{class:e.normalizeClass(["flex flex-1 flex-row items-center justify-between",i.value?"pl-1 pr-6":"w-[calc(100%-18px)] pl-[10px]"])},[e.createElementVNode("span",J1,e.toDisplayString(u.label??"Відсутні дані"),1),u.count?(e.openBlock(),e.createElementBlock("div",ek," ("+e.toDisplayString(u.count)+") ",1)):e.createCommentVNode("",!0)],2),i.value&&u.isSelected?(e.openBlock(),e.createElementBlock("span",tk,[e.createVNode(Qt)])):e.createCommentVNode("",!0)],2)])],2)],512))}});function _r(l,t){const{options:a=[],limit:r=20}=l;function n(x){return Array.isArray(x)?x[0]:x}const o=e.ref(n(l.modelValue)),s=e.ref(""),i=e.ref(!1),c=e.ref([]),u=e.ref("id"),d=e.ref("text"),p=e.ref(!1),m=e.ref(l.layout!=="popover"&&a.length>r);function f(x){const b=x.find(Boolean)??{},_=["id","value","code","key"].find(E=>E in b)??"id",V=["text","label","name","title"].find(E=>E in b)??"text";return{autoValueKey:_,autoLabelKey:V}}if(a.length>0){const x=f(a);u.value=x.autoValueKey,d.value=x.autoLabelKey}const g=e.computed(()=>{const x=c.value;return l.layout==="popover"||p.value?x:x.slice(0,r)});e.watch(()=>l.modelValue,x=>{o.value=n(x)},{immediate:!0}),c.value=[...a].sort((x,b)=>l.sort==="count"?b.count&&x.count?b.count-x.count:0:l.sort==="name"?String(x[d.value]??"").localeCompare(String(b[d.value]??"")):0);function y(x){return o.value===x[u.value]}function w(x){o.value=x[u.value],t("update:modelValue",o.value),t("change",{name:l.name,value:o.value})}function h(){o.value=void 0,t("update:modelValue",o.value),t("clear",l.name)}function k(){p.value=!p.value}return{innerValue:o,searchTerm:s,filteredOptions:g,isSelected:y,selectItem:w,clear:h,toggleShowAll:k,isReqProc:i,showAll:p,isEnableShowAll:m,labelKey:d,valueKey:u,allOptions:c}}const lk={},ak={class:"w-48 mx-auto",viewBox:"0 0 178 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function rk(l,t){return e.openBlock(),e.createElementBlock("svg",ak,[...t[0]||(t[0]=[e.createStaticVNode('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>',12)])])}const Vr=vt(lk,[["render",rk]]),nk={},ok={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:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate"};function sk(l,t){return e.openBlock(),e.createElementBlock("svg",ok,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)])])}const ga=vt(nk,[["render",sk]]),ik={},ck={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:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate-[180deg]"};function dk(l,t){return e.openBlock(),e.createElementBlock("svg",ck,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)])])}const Cr=vt(ik,[["render",dk]]),uk={key:0,class:"w-full"},pk={class:"flex flex-col items-center justify-center p-5 text-center"},mk={key:0,class:"flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"},fk={key:1,class:"flex justify-between items-center text-xs text-gray-500 p-1 border-t"},hk=e.defineComponent({__name:"radio",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{default:10},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{},itemClass:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=e.ref(null),o=a,{innerValue:s,filteredOptions:i,isSelected:c,selectItem:u,clear:d,toggleShowAll:p,isReqProc:m,showAll:f,isEnableShowAll:g,labelKey:y,valueKey:w,allOptions:h}=_r({...r,modelValue:r.modelValue??r.default??""},o);return t({clear:d,inputTextRef:n}),e.watch(()=>r.modelValue,k=>{k===void 0&&(s.value=void 0)}),(k,x)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([k.layout==="popover"?"flex flex-col h-full":"flex flex-col vs-filter-checkbox"])},[e.createElementVNode("div",{class:e.normalizeClass([k.layout==="popover"?"flex-1 overflow-y-auto p-2":"",k.layout==="inline"?"flex-1 overflow-y-auto max-h-80":""])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),b=>(e.openBlock(),e.createBlock(Er,{layout:k.layout,key:b[e.unref(w)],count:b.count,label:b[e.unref(y)],color:b.color,type:"radio",value:b[e.unref(w)],"is-selected":e.unref(c)(b),onItemClick:_=>e.unref(u)(b)},null,8,["layout","count","label","color","value","is-selected","onItemClick"]))),128))],2),k.type==="select"&&e.unref(i).length===0&&!e.unref(m)?(e.openBlock(),e.createElementBlock("div",uk,[e.createElementVNode("div",pk,[e.createVNode(Vr),x[4]||(x[4]=e.createElementVNode("div",{class:"max-w-sm mx-auto mt-6"},[e.createElementVNode("p",{class:"font-medium text-gray-800 dark:text-neutral-200"},"За вашим запитом нічого не знайдено"),e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"})],-1))])])):e.createCommentVNode("",!0),k.layout!=="popover"&&k.type!=="select"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[!e.unref(f)&&e.unref(g)?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:x[0]||(x[0]=(...b)=>e.unref(p)&&e.unref(p)(...b)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[x[5]||(x[5]=e.createTextVNode(" Показати більше ",-1)),e.createVNode(ga)])):e.createCommentVNode("",!0),e.unref(f)?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:x[1]||(x[1]=(...b)=>e.unref(p)&&e.unref(p)(...b)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[x[6]||(x[6]=e.createTextVNode(" Показати менше ",-1)),e.createVNode(Cr)])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),k.cleanable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[k.layout==="inline"?(e.openBlock(),e.createElementBlock("div",mk,[e.createTextVNode(e.toDisplayString(e.unref(s)||e.unref(s)===null?1:0)+" з "+e.toDisplayString(e.unref(h).length)+" обрано ",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:x[2]||(x[2]=(...b)=>e.unref(d)&&e.unref(d)(...b))}," Очистити ",512),[[e.vShow,e.unref(s)!==""&&e.unref(s)!==void 0]])])):e.createCommentVNode("",!0),k.layout==="popover"?(e.openBlock(),e.createElementBlock("div",fk,[e.createElementVNode("span",null,e.toDisplayString(e.unref(s)||e.unref(s)===null?1:0)+" з "+e.toDisplayString(e.unref(h).length)+" обрано",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:x[3]||(x[3]=(...b)=>e.unref(d)&&e.unref(d)(...b))}," Очистити ",512),[[e.vShow,e.unref(s)!==""&&e.unref(s)!==void 0]])])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],2))}});function Ao(l,t){const{options:a=[],limit:r=20}=l;function n(x){return Array.isArray(x)?x:x?[x]:[]}const o=e.ref(n(l.modelValue)),s=e.ref(""),i=e.ref(!1),c=e.ref([]),u=e.ref("id"),d=e.ref("text"),p=e.ref(!1),m=e.ref(l.layout!=="popover"&&a.length>r);function f(x){const b=x.find(Boolean)??{},_=["id","value","code","key"].find(E=>E in b)??"id",V=["text","label","name","title"].find(E=>E in b)??"text";return{autoValueKey:_,autoLabelKey:V}}if(a.length>0){const x=f(a);u.value=x.autoValueKey,d.value=x.autoLabelKey}const g=e.computed(()=>{const x=c.value;return l.layout==="popover"||p.value?x:x.slice(0,r)});e.watch(()=>l.modelValue,x=>{o.value=n(x)},{immediate:!0}),c.value=[...a].sort((x,b)=>l.sort==="count"?b.count&&x.count?b.count-x.count:0:l.sort==="name"?String(x[d.value]).localeCompare(String(b[d.value])):0);function y(x){return o.value&&o.value.includes(x[u.value])}function w(x){const b=o.value.includes(x[u.value]);o.value=b?o.value.filter(_=>_!==x[u.value]):[...o.value,x[u.value]],t("update:modelValue",o.value),t("change",{name:l.name,value:o.value})}function h(){o.value=[],t("update:modelValue",o.value),t("clear",l.name)}function k(){p.value=!p.value}return{innerValue:o,searchTerm:s,filteredOptions:g,isSelected:y,selectItem:w,clear:h,toggleShowAll:k,isReqProc:i,showAll:p,isEnableShowAll:m,labelKey:d,valueKey:u,allOptions:c}}const Mo={en:{apply:"Apply",search:"Search",more:"Show more",less:"Show less",selected:"selected",clear:"Clear",notfound:"Nothing found",period:"Period",today:"Today",week:"Week",max:"max",min:"min",month:"Month",quarter:"Quarter",year:"Year",alltime:"All Time",prev:"Prev",next:"Next",selectFieldHelp:"Select a field to start creating a filter."},uk:{apply:"Застосувати",search:"Пошук",more:"Показати більше",less:"Показати меньше",selected:"обрано",clear:"Очистити",notfound:"Нічого не знайдено",period:"Період",today:"Сьогодні",week:"Тиждень",max:"макс",min:"мін",month:"Місяць",quarter:"Квартал",year:"Рік",alltime:"Весь час",prev:"Попередній період",next:"Настпуний період",selectFieldHelp:"Оберіть поле, щоб розпочати створення фільтра."}};function To(l){const t=l.split(".")[1],a=typeof window<"u"&&window.localStorage?localStorage.locale:null;return(Mo[a||navigator.language]||Mo.uk)[t]}function Rt(){const l=e.getCurrentInstance();if(!l.appContext.config.globalProperties.$i18n)return To;const t=l.appContext.config.globalProperties.$t;return a=>{const r=t(a);return r===a?To(a):r}}const gk={key:0,class:"w-full"},yk={class:"flex flex-col items-center justify-center p-5 text-center"},bk={class:"max-w-sm mx-auto mt-6"},kk={class:"font-medium text-gray-800 dark:text-neutral-200"},xk={key:0,class:"flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"},wk={key:1,class:"flex justify-between items-center text-xs text-gray-500 p-1 border-t"},$o=e.defineComponent({__name:"checkbox",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{default:10},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{},itemClass:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=Rt(),n=l,o=a,{innerValue:s,filteredOptions:i,isSelected:c,selectItem:u,clear:d,toggleShowAll:p,isReqProc:m,showAll:f,isEnableShowAll:g,labelKey:y,valueKey:w,allOptions:h}=Ao({...n,modelValue:n.modelValue},o);return e.watch(()=>n.modelValue,k=>{k===void 0&&(s.value=[])}),t({clear:d}),(k,x)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([k.layout==="popover"?"flex flex-col h-full":"flex flex-col vs-filter-checkbox space-y-0.5"])},[e.createElementVNode("div",{class:e.normalizeClass([k.layout==="popover"?"flex-1 overflow-y-auto p-2":"",k.layout==="inline"?"flex-1 overflow-y-auto max-h-80":""])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),b=>(e.openBlock(),e.createBlock(Er,{layout:k.layout,count:b.count,label:b[e.unref(y)],color:b.color,type:"checkbox",value:b[e.unref(w)],"is-selected":e.unref(c)(b),onItemClick:_=>e.unref(u)(b)},null,8,["layout","count","label","color","value","is-selected","onItemClick"]))),256))],2),k.type==="select"&&e.unref(i).length===0&&!e.unref(m)?(e.openBlock(),e.createElementBlock("div",gk,[e.createElementVNode("div",yk,[e.createVNode(Vr),e.createElementVNode("div",bk,[e.createElementVNode("p",kk,e.toDisplayString(e.unref(r)("filter.notfound")),1),x[4]||(x[4]=e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"},null,-1))])])])):e.createCommentVNode("",!0),k.layout!=="popover"&&k.type!=="select"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[!e.unref(f)&&e.unref(g)?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:x[0]||(x[0]=(...b)=>e.unref(p)&&e.unref(p)(...b)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.more"))+" ",1),e.createVNode(ga)])):e.createCommentVNode("",!0),e.unref(f)?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:x[1]||(x[1]=(...b)=>e.unref(p)&&e.unref(p)(...b)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.less"))+" ",1),e.createVNode(Cr)])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),k.cleanable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[k.layout==="inline"?(e.openBlock(),e.createElementBlock("div",xk,[e.createTextVNode(e.toDisplayString(e.unref(s).length)+" / "+e.toDisplayString(e.unref(h).length)+" "+e.toDisplayString(e.unref(r)("filter.selected"))+" ",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:x[2]||(x[2]=(...b)=>e.unref(d)&&e.unref(d)(...b))},e.toDisplayString(e.unref(r)("filter.clear")),513),[[e.vShow,e.unref(s).length!==0]])])):e.createCommentVNode("",!0),k.layout==="popover"?(e.openBlock(),e.createElementBlock("div",wk,[e.createElementVNode("span",null,e.toDisplayString(e.unref(s).length)+" / "+e.toDisplayString(e.unref(h).length)+" "+e.toDisplayString(e.unref(r)("filter.selected")),1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:x[3]||(x[3]=(...b)=>e.unref(d)&&e.unref(d)(...b))},e.toDisplayString(e.unref(r)("filter.clear")),513),[[e.vShow,e.unref(s).length!==0]])])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],2))}}),Ek={},_k={xmlns:"http://www.w3.org/2000/svg",width:"15px",height:"15px",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"};function Vk(l,t){return e.openBlock(),e.createElementBlock("svg",_k,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),e.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)])])}const Lo=vt(Ek,[["render",Vk]]),Ck={},Nk={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x stroke-gray-500 hover:stroke-red-500 transition-all",width:"15px",height:"15px"};function Bk(l,t){return e.openBlock(),e.createElementBlock("svg",Nk,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),e.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])])}const Nr=vt(Ck,[["render",Bk]]);class Fo{static getWidthClass(t){return typeof t=="number"?`max-w-[${t}px] min-w-[${t}px]`:typeof t=="string"?t.endsWith("%")||t.endsWith("px")?`max-w-[${t}]`:`max-w-${t}`:"w-full"}}const vk={class:"absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3"},Sk=["placeholder"],Dk=e.defineComponent({__name:"text-input",props:{id:{},name:{},title:{},type:{},label:{},width:{default:220},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{},itemClass:{}},emits:["update:modelValue","change","clear"],setup(l,{emit:t}){var u;const a=l,r=e.ref((a.placeholder||a.label||a.title||a.name||"search").toString()),n=t,o=e.ref(((u=a.modelValue)==null?void 0:u.toString())??"");e.watch(()=>a.modelValue,d=>{d!==o.value&&(o.value=(d==null?void 0:d.toString())??"")});let s=null;function i(){if(o.value=o.value.trimStart(),o.value.length===0){c();return}s&&clearTimeout(s),s=setTimeout(()=>{n("update:modelValue",o.value),n("change",{name:a.name,value:o.value})},300)}function c(){o.value="",n("update:modelValue",""),n("clear",a.name)}return(d,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vs-form-text relative bg-white [&>input]:py-[7px] [&>input]:max-h-[38px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600",d.layout==="vertical"?"rounded-md":"rounded-sm",d.layout==="vertical"?"[&>input]:rounded-md":"[&>input]:rounded-sm",d.layout==="inline"?e.unref(Fo).getWidthClass(d.width):"mb-2"+(d.layout==="popover"?" m-2":"")])},[e.createElementVNode("div",vk,[e.createVNode(Lo)]),o.value!==""?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:c,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer"},[e.createVNode(Nr)])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":p[0]||(p[0]=m=>o.value=m),onInput:i,placeholder:r.value,class:e.normalizeClass(["!pr-7 !pl-8 bg-white h-[38px] min-w-[100px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 text-sm text-stone-800 placeholder:text-stone-400 focus:border-2 focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500",d.layout==="vertical"?"rounded-md":"rounded-sm"])},null,42,Sk),[[e.vModelText,o.value]])],2))}});function Io(l={color:"blue"}){return e.computed(()=>{const t=`w-full px-3 py-2 border-solid border text-black border-gray-300 text-sm rounded focus:outline-none focus:ring-2 focus:ring-${l.color}-500 focus:border-transparent
|
|
190
|
+
text-gray-800 bg-white dark:text-neutral-300 dark:bg-neutral-800 dark:border-neutral-600`;return(l==null?void 0:l.size)==="sm"?`${t}h-[32px]`:`${t}h-[38px]`})}function Ak(){return"rounded-md font-medium border-gray-200 border-solid disabled:pointer-events-none disabled:opacity-50 px-4 py-2 w-full bg-transparent border text-black text-sm h-[38px]"}function Mk(){return"font-medium border border-gray-200 border-solid disabled:pointer-events-none disabled:opacity-50 h-7 rounded-md text-xs px-2 py-1 text-gray-800 bg-white hover:bg-gray-100 dark:text-neutral-300 dark:bg-neutral-800 dark:hover:bg-neutral-700 dark:border-neutral-600"}function Oo(l){return l==="ghost"?"inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-sm border text-gray-600 hover:bg-blue-100 hover:text-gray-800 focus:outline-hidden focus:bg-gray-100 focus:text-gray-800 disabled:opacity-50 disabled:pointer-events-none dark:text-gray-500 dark:hover:bg-blue-800/30 dark:hover:text-blue-400 dark:focus:bg-blue-800/30 dark:focus:text-blue-400":l==="soft"?"inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-sm border bg-white-100 text-gray-800 hover:bg-gray-200 hover:bg-gray-200 focus:outline-hidden focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:text-blue-400 dark:hover:bg-blue-900 dark:focus:bg-blue-900":"relative border-solid border-gray-200 focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border-input hover:bg-gray-100 border px-4 py-2 gap-1 bg-transparent h-[38px]"}const Tk={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},$k=["placeholder","disabled"],Lk={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},Fk={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},Ik=["placeholder","disabled"],Ok=["disabled"],Pk=e.defineComponent({__name:"range-input",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{},itemClass:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=Io(),n=Ak(),o=Rt(),s=l,i=e.ref(s.modelValue??s.default??[]),c=a,u=e.computed({get:()=>s.modelValue??i.value,set:m=>{s.modelValue!==void 0?c("update:modelValue",m):i.value=m}});function d(){c("change",{name:s.name,value:u.value||i.value})}function p(){i.value=[],u.value=i.value,c("clear",s.name)}return e.watch(()=>s.modelValue,m=>{m!==void 0&&s.layout!=="popover"?(i.value=m,c("update:modelValue",m)):i.value=[]}),t({clear:p,currentValue:u}),(m,f)=>{var g,y;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",null,[e.createElementVNode("div",{class:e.normalizeClass(m.layout==="vertical"?"inline-flex items-center gap-2":"space-y-3 p-2")},[e.createElementVNode("div",null,[m.layout!=="vertical"?(e.openBlock(),e.createElementBlock("label",Tk,e.toDisplayString(e.unref(o)("filter.from")),1)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"number",class:e.normalizeClass(e.unref(r)),placeholder:((g=m.placeholder)==null?void 0:g[0])??e.unref(o)("filter.min"),step:"1",style:{outline:"none"},"onUpdate:modelValue":f[0]||(f[0]=w=>u.value[0]=w),disabled:m.disabled},null,10,$k),[[e.vModelText,u.value[0]]])]),m.layout==="vertical"?(e.openBlock(),e.createElementBlock("label",Lk," - ")):e.createCommentVNode("",!0),e.createElementVNode("div",null,[m.layout!=="vertical"?(e.openBlock(),e.createElementBlock("label",Fk,e.toDisplayString(e.unref(o)("filter.to")),1)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"number",class:e.normalizeClass(e.unref(r)),placeholder:((y=m.placeholder)==null?void 0:y[1])??e.unref(o)("filter.max"),min:"0",max:"1000000000000000",step:"1",style:{outline:"none"},"onUpdate:modelValue":f[1]||(f[1]=w=>u.value[1]=w),disabled:m.disabled},null,10,Ik),[[e.vModelText,u.value[1]]])]),["popover","inline","vertical"].includes(m.layout)?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:d,class:e.normalizeClass(e.unref(n)+(m.layout==="vertical"?" w-[50px]":" bg-blue-100 hover:bg-blue-200"))},e.toDisplayString(m.layout==="vertical"?"Ok":e.unref(o)("filter.apply")),3)):e.createCommentVNode("",!0),["popover","inline"].includes(m.layout)?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:!(u.value[0]||u.value[1]),onClick:p,class:e.normalizeClass(e.unref(n)+" hover:bg-gray-100")},e.toDisplayString(e.unref(o)("filter.clear")),11,Ok)):e.createCommentVNode("",!0)],2)]),(m.cleanable&&i.value.length,e.createCommentVNode("",!0))],64)}}});let We=class{static format(t){const a=t.getFullYear(),r=(t.getMonth()+1).toString().padStart(2,"0"),n=t.getDate().toString().padStart(2,"0");return`${a}-${r}-${n}`}static getShiftedDay(t,a=0){const r=t?new Date(t):new Date;return r.setDate(r.getDate()+a),this.format(r)}static getLastWeekRange(t,a,r=0){if(t&&a){const u=new Date(t),d=new Date(a);return u.setDate(u.getDate()+r*7),d.setDate(d.getDate()+r*7),[this.format(u),this.format(d)]}const n=new Date,o=n.getDay(),s=o===0?13:o-1+7,i=new Date(n);i.setDate(n.getDate()-s+r*7);const c=new Date(i);return c.setDate(i.getDate()+6),[this.format(i),this.format(c)]}static getMonthRange(t,a,r=0){let n;t?n=new Date(t):n=new Date,n=new Date(n.getFullYear(),n.getMonth()+r,1);const o=n,s=new Date(n.getFullYear(),n.getMonth()+1,0);return[this.format(o),this.format(s)]}static getQuarterRange(t,a,r=0){const n=t||a,o=n?new Date(n):new Date;let s=Math.floor(o.getMonth()/3);s+=r;const i=(s%4+4)%4*3,c=o.getFullYear()+Math.floor(s/4),u=new Date(c,i,1),d=new Date(c,i+3,0);return[this.format(u),this.format(d)]}static getYear(t,a=0){let r;return t&&/^\d{4}$/.test(t)?r=parseInt(t,10):t?r=new Date(t).getFullYear():r=new Date().getFullYear(),String(r+a)}static getYearRange(t,a=0){let r;return t&&/^\d{4}$/.test(t)?r=parseInt(t,10):t?r=new Date(t).getFullYear():r=new Date().getFullYear(),[this.format(new Date(r+a,0,1)),this.format(new Date(r+a+1,0,0))]}static getRangeFromDaysBefore(t){const a=new Date,r=new Date(a.getTime());return r.setDate(a.getDate()-t),[this.format(r),this.format(a)]}};function Po(l,t){const{popoverRef:a}=l,r=Rt(),n=e.ref(""),o=e.ref(l.modelValue??l.default??[]),s=e.ref(0);function i(){const h=We.getRangeFromDaysBefore(s.value);return o.value=[...h],t("change",{name:l.name,value:o.value}),t("update:modelValue",o.value),h}function c(h){var x;n.value=h,(x=a.value)==null||x.close();const k=[];switch(n.value){case"today":k.push(We.getShiftedDay()),k.push(We.getShiftedDay());break;case"week":k.push(...We.getLastWeekRange());break;case"month":k.push(...We.getMonthRange());break;case"quarter":k.push(...We.getQuarterRange());break;case"year":k.push(...We.getYearRange());break;case"last_7_days":s.value=7,i();break;case"range":s.value=7,k.push(...i());break}o.value=[...k],t("change",{name:l.name,value:o.value}),t("update:modelValue",o.value)}function u(){const h=[];switch(n.value){case"today":h.push(We.getShiftedDay(o.value[0],1));break;case"week":h.push(...We.getLastWeekRange(o.value[0],o.value[1],1));break;case"month":h.push(...We.getMonthRange(o.value[0],o.value[1],1));break;case"quarter":h.push(...We.getQuarterRange(o.value[0],o.value[1],1));break;case"year":h.push(...We.getYearRange(o.value[0],1));break}o.value=[...h],t("change",{name:l.name,value:o.value}),t("update:modelValue",o.value)}function d(){const h=[];switch(n.value){case"today":h.push(We.getShiftedDay(o.value[0],-1));break;case"week":h.push(...We.getLastWeekRange(o.value[0],o.value[1],-1));break;case"month":h.push(...We.getMonthRange(o.value[0],o.value[1],-1));break;case"quarter":h.push(...We.getQuarterRange(o.value[0],o.value[1],-1));break;case"year":h.push(...We.getYearRange(o.value[0],-1));break}o.value=[...h],t("change",{name:l.name,value:o.value}),t("update:modelValue",o.value)}const p=["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень"];function m(h){const[k,x,b]=h.split("-");return`${b}.${x}.${k}`}function f(h,k="long"){const x=new Date(Date.UTC(2e3,h-1,1));return new Intl.DateTimeFormat(localStorage.locale,{month:k,timeZone:"UTC"}).format(x)}function g(h){const{value:k}=o;switch(h){case"today":return m(k[0]);case"range":return"Період";case"week":return k[0]&&k[1]?`${m(k[0])} – ${m(k[1])}`:"";case"quarter":if(k[0]){const x=new Date(k[0]),b=x.getFullYear(),_=x.getMonth();return`${Math.floor(_/3)+1} ${r("filter.quarter")} ${b}`}return"";case"month":if(k[0]){const[x,b]=k[0].split("-");return`${f(parseInt(b,10))} ${x}`}return"";case"year":return k[0]||"";case"last_7_days":return"За останні дні";default:return l.label??""}}const y=e.computed(()=>n.value?g(n.value):l.label??"");function w(){n.value="",o.value=[],t("update:modelValue",[]),t("clear",l.name)}return{activeMode:n,innerValue:o,daysBefore:s,onDaysBeforeChange:i,onSelectChange:c,nextClick:u,prevClick:d,ukMonths:p,formatDisplayDate:m,getModeLabel:g,currentLabel:y,clear:w}}const Rk={key:0,class:"relative flex w-full h-auto gap-2 filter-date m-2 flex-wrap"},jk={key:0,class:"flex gap-1 !w-[75%] rounded-sm"},Uk=["max","disabled"],zk=["min","disabled"],Hk={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},Kk=["max","disabled"],qk={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},Gk={key:0,class:"block text-xs font-medium text-gray-600 mb-1"},Wk=["min","disabled"],Yk={class:"flex gap-1 pt-2"},Xk=["title","onClick"],Zk=e.defineComponent({__name:"date-input",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{},itemClass:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=Io(),o=Mk(),s=Rt(),i=a,c=e.ref(null),{activeMode:u,innerValue:d,onSelectChange:p,nextClick:m,prevClick:f,clear:g}=Po({...r,popoverRef:c},i);e.watch(()=>r.modelValue,x=>{x!==void 0?(d.value=x,i("update:modelValue",x)):(u.value="",d.value=[])}),e.watch(d,x=>{i("update:modelValue",x),i("change",{name:r.name,value:x})},{deep:!0});const y=["today","week","month","quarter","year"],w={today:{label:"день",title:s("filter.today")},week:{label:"тиж.",title:s("filter.week")},month:{label:"міс.",title:s("filter.month")},quarter:{label:"кв.",title:s("filter.quarter")},year:{label:"рік",title:s("filter.year")}};function h(x){var b;return((b=w[x])==null?void 0:b.label)??s(`filter.${x}`)}function k(x){var b;return((b=w[x])==null?void 0:b.title)??s(`filter.${x}`)}return t({clear:g,popoverRef:c}),(x,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[x.layout==="inline"?(e.openBlock(),e.createElementBlock("div",Rk,[e.unref(u)!==""&&e.unref(u)==="range"?(e.openBlock(),e.createElementBlock("div",jk,[b[7]||(b[7]=e.createTextVNode(" 1111 ",-1)),e.withDirectives(e.createElementVNode("input",{type:"date",max:e.unref(d)[1],locale:"uk-UA","onUpdate:modelValue":b[0]||(b[0]=_=>e.unref(d)[0]=_),class:"px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-sm focus:outline-blue-600",disabled:x.disabled},null,8,Uk),[[e.vModelText,e.unref(d)[0]]]),e.withDirectives(e.createElementVNode("input",{type:"date",min:e.unref(d)[0],locale:"uk-UA","onUpdate:modelValue":b[1]||(b[1]=_=>e.unref(d)[1]=_),class:"px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-sm focus:outline-blue-600 appearance-auto",disabled:x.disabled},null,8,zk),[[e.vModelText,e.unref(d)[1]]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(x.layout==="popover"?"space-y-3 p-2":"flex items-center gap-2")},[e.createElementVNode("div",{class:e.normalizeClass(x.layout!=="popover"?"w-[48%]":"")},[x.layout==="popover"?(e.openBlock(),e.createElementBlock("label",Hk,e.toDisplayString(e.unref(s)("filter.from")),1)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"date",max:e.unref(d)[1],locale:"uk-UA","onUpdate:modelValue":b[2]||(b[2]=_=>e.unref(d)[0]=_),class:e.normalizeClass(e.unref(n)),disabled:x.disabled},null,10,Kk),[[e.vModelText,e.unref(d)[0]]])],2),x.layout!=="popover"?(e.openBlock(),e.createElementBlock("label",qk," - ")):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(x.layout!=="popover"?"w-[48%]":"")},[x.layout==="popover"?(e.openBlock(),e.createElementBlock("label",Gk,e.toDisplayString(e.unref(s)("filter.to")),1)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"date",min:e.unref(d)[0],locale:"uk-UA","onUpdate:modelValue":b[3]||(b[3]=_=>e.unref(d)[1]=_),class:e.normalizeClass(e.unref(n)),disabled:x.disabled},null,10,Wk),[[e.vModelText,e.unref(d)[1]]])],2)],2),e.createElementVNode("div",Yk,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(y,_=>e.createElementVNode("button",{key:_,class:e.normalizeClass(e.unref(o)+(e.unref(u)===_?" bg-blue-100":"")),title:k(_),onClick:V=>e.unref(p)(_)},e.toDisplayString(h(_)),11,Xk)),64)),e.createElementVNode("button",{class:e.normalizeClass(e.unref(o)),onClick:b[4]||(b[4]=(..._)=>e.unref(f)&&e.unref(f)(..._))},"<",2),e.createElementVNode("button",{class:e.normalizeClass(e.unref(o)),onClick:b[5]||(b[5]=(..._)=>e.unref(m)&&e.unref(m)(..._))},">",2)]),(x.cleanable,e.createCommentVNode("",!0))],64))}});function Qk(l,t){const{api:a,options:r=[],limit:n=20,dataKey:o="data"}=l,s=l.multi;function i(P){return s?Array.isArray(P)?P:P?[P]:[]:Array.isArray(P)?P[0]:P}const c=e.ref(i(l.modelValue)),u=e.ref(""),d=e.ref(!1),p=e.ref(r),m=e.ref("id"),f=e.ref("text"),g=e.ref(!1),y=e.ref(l.layout!=="popover"&&r.length>n),w=e.ref([]),h=e.ref(0);function k(P){const I=P.find(Boolean)??{},O=["id","value","code","key"].find(H=>H in I)??"id",F=["text","label","name","title"].find(H=>H in I)??"text";return{autoValueKey:O,autoLabelKey:F}}if(r.length>0){const P=k(r);m.value=P.autoValueKey,f.value=P.autoLabelKey}const x=e.computed(()=>{if(a)return p.value;const P=p.value;if(l.layout==="popover")return P;if(!u.value)return g.value?P:P.slice(0,n);const I=u.value.toLowerCase();return P.filter(O=>O[f.value].toLowerCase().includes(I))});let b=null;async function _(P){if(a){d.value=!0;try{const I=new URL(a,window.location.origin);I.searchParams.set("json","1"),I.searchParams.set("key",P),I.searchParams.set("limit",n.toString());const O=await fetch(I.toString());if(!O.ok){xe({type:"error",title:"Error",message:"Failed to fetch remote options"}),p.value=[];return}const F=await O.json();if(!F[o]){xe({type:"error",title:"Error",message:F}),p.value=[];return}if(p.value=F[o],p.value.length>0){const H=k(p.value);m.value=H.autoValueKey,f.value=H.autoLabelKey}h.value=F.total}catch(I){console.error("Failed to fetch remote options:",I)}finally{d.value=!1}}}e.watch(u,P=>{a&&(b&&clearTimeout(b),b=setTimeout(()=>{_(P)},200))}),e.watch(()=>l.modelValue,P=>{c.value=i(P)},{immediate:!0});function V(P){return s&&Array.isArray(c.value)?c.value.includes(P[m.value]):c.value&&c.value===P[m.value]}function E(P){if(s&&!Array.isArray(c.value)&&(c.value=[]),s&&Array.isArray(c.value)){const I=c.value.includes(P[m.value]);c.value=I?c.value.filter(O=>O!==P[m.value]):[...c.value,P[m.value]],w.value=I?w.value.filter(O=>O!==P[f.value]):[...w.value,P[f.value]]}else c.value=P[m.value],w.value=P[f.value];t("update:modelValue",c.value),t("change",{name:l.name,value:c.value})}function D(){s?(c.value=[],w.value=[]):(c.value=void 0,w.value=[]),t("update:modelValue",c.value),t("clear",l.name)}function $(){b&&clearTimeout(b),u.value="",g.value=!1}function C(){g.value=!g.value}e.onBeforeUnmount(()=>{b&&clearTimeout(b)});const B=e.ref(-1);e.watch(x,()=>{B.value=x.value.length>0?0:-1});function M(P){const I=x.value.length;if(P.key==="ArrowDown")P.preventDefault(),B.value=(B.value+1)%I;else if(P.key==="ArrowUp")P.preventDefault(),B.value=(B.value-1+I)%I;else if(P.key==="Enter"&&(P.preventDefault(),B.value>=0&&B.value<x.value.length)){const O=x.value[B.value];E(O)}}function U(){a&&p.value.length===0&&u.value.length===0&&_(u.value)}return{innerValue:c,searchTerm:u,filteredOptions:x,isSelected:V,selectItem:E,clear:D,resetSearch:$,toggleShowAll:C,isReqProc:d,showAll:g,isEnableShowAll:y,labelKey:f,valueKey:m,allOptions:p,highlightedIndex:B,onKeyDown:M,selectedLabels:w,totalCount:h,loadData:U}}const Jk={class:"h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relative justify-center"},ex=["placeholder"],tx={key:0,class:"w-full"},lx={class:"flex flex-col items-center justify-center p-5 text-center"},ax={class:"max-w-sm mx-auto mt-6"},rx={class:"font-medium text-gray-800 dark:text-neutral-200"},nx={key:0,class:"flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"},ox={key:1,class:"flex justify-between items-center text-xs text-gray-500 p-1 border-t"},sx=e.defineComponent({__name:"select",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{default:10},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{},itemClass:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=Rt(),n=l,o=a,s=e.ref(null),{innerValue:i,filteredOptions:c,isSelected:u,selectItem:d,clear:p,resetSearch:m,toggleShowAll:f,isReqProc:g,showAll:y,isEnableShowAll:w,searchTerm:h,labelKey:k,valueKey:x,highlightedIndex:b,onKeyDown:_,selectedLabels:V,totalCount:E,loadData:D}=Qk({...n,modelValue:n.modelValue},o);e.onMounted(()=>{m(),n.layout!=="inline"&&(D(),s.value&&n.layout==="popover"&&s.value.focus())}),e.watch(()=>n.modelValue,C=>{C===void 0&&(n.multi?i.value=[]:i.value=void 0)});const $=e.ref([]);return e.watch(b,C=>{var B;C>=0&&$.value[C]&&((B=$.value[C])==null||B.scrollIntoView({block:"nearest",behavior:"smooth"}))}),e.watch(c,()=>{$.value=[]}),t({clear:p,inputTextRef:s,selectedLabels:V,loadData:D}),(C,B)=>{var M,U;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([C.layout==="popover"?"flex flex-col h-full":"flex flex-col vs-filter-checkbox space-y-0.5"])},[e.createElementVNode("div",Jk,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[0]||(B[0]=P=>e.isRef(h)?h.value=P:null),onKeydown:B[1]||(B[1]=(...P)=>e.unref(_)&&e.unref(_)(...P)),class:"w-full h-full text-[13px] px-4 border rounded-sm pl-9 focus:outline-none focus:ring-ring focus:ring-1 focus:ring-blue-500 text-gray-700",placeholder:e.unref(r)("filter.search"),type:"text",ref_key:"inputTextRef",ref:s},null,40,ex),[[e.vModelText,e.unref(h)]]),e.createVNode(Lo,{class:"absolute text-gray-400 -translate-y-1/2 left-4 top-1/2"}),e.unref(h)!=""?(e.openBlock(),e.createBlock(Nr,{key:0,onClick:B[2]||(B[2]=P=>h.value=""),class:"absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"})):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass([C.layout==="popover"?"flex-1 overflow-y-auto p-2":"",C.layout==="inline"?"flex-1 overflow-y-auto max-h-80":""])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(P,I)=>(e.openBlock(),e.createBlock(Er,{layout:C.layout,count:P.count,label:P[e.unref(k)],color:P.color,type:C.multi?"checkbox":"radio",value:P[e.unref(x)],"is-selected":e.unref(u)(P),highlighted:I===e.unref(b),onItemClick:O=>e.unref(d)(P),ref_for:!0,ref:O=>$.value[I]=O==null?void 0:O.el},null,8,["layout","count","label","color","type","value","is-selected","highlighted","onItemClick"]))),256))],2),C.type==="select"&&e.unref(c).length===0&&!e.unref(g)?(e.openBlock(),e.createElementBlock("div",tx,[e.createElementVNode("div",lx,[e.createVNode(Vr),e.createElementVNode("div",ax,[e.createElementVNode("p",rx,e.toDisplayString(e.unref(r)("filter.notfound")),1),B[7]||(B[7]=e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"},null,-1))])])])):e.createCommentVNode("",!0),C.layout!=="popover"&&C.type!=="select"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[!e.unref(y)&&e.unref(w)?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:B[3]||(B[3]=(...P)=>e.unref(f)&&e.unref(f)(...P)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.more"))+" ",1),e.createVNode(ga)])):e.createCommentVNode("",!0),e.unref(y)?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:B[4]||(B[4]=(...P)=>e.unref(f)&&e.unref(f)(...P)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.less"))+" ",1),e.createVNode(Cr)])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),C.cleanable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[C.layout==="inline"?(e.openBlock(),e.createElementBlock("div",nx,[e.createTextVNode(e.toDisplayString(C.multi&&Array.isArray(e.unref(i))?(M=e.unref(i))==null?void 0:M.length:e.unref(i)!==void 0&&(e.unref(i)||e.unref(i)===null)?1:0)+" / "+e.toDisplayString(e.unref(E))+" "+e.toDisplayString(e.unref(r)("filter.selected"))+" ",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:B[5]||(B[5]=(...P)=>e.unref(p)&&e.unref(p)(...P))},e.toDisplayString(e.unref(r)("filter.clear")),513),[[e.vShow,e.unref(i)!==""&&e.unref(i)!==void 0||e.unref(i)]])])):e.createCommentVNode("",!0),C.layout==="popover"?(e.openBlock(),e.createElementBlock("div",ox,[e.createElementVNode("span",null,e.toDisplayString(C.multi&&Array.isArray(e.unref(i))?(U=e.unref(i))==null?void 0:U.length:e.unref(i)!==void 0&&(e.unref(i)||e.unref(i)===null)?1:0)+" / "+e.toDisplayString(e.unref(E))+" "+e.toDisplayString(e.unref(r)("filter.selected")),1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:B[6]||(B[6]=(...P)=>e.unref(p)&&e.unref(p)(...P))},e.toDisplayString(e.unref(r)("filter.clear")),513),[[e.vShow,e.unref(i)!==""&&e.unref(i)!==void 0||e.unref(i)]])])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],2)}}}),ix=["for","onClick"],cx=["id","name","value"],dx={class:"block"},ux={key:0,class:"flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"},px={key:1,class:"flex justify-between items-center text-xs text-gray-500 p-1 border-t"},mx=e.defineComponent({__name:"tag-field",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{},itemClass:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=a,{innerValue:o,isSelected:s,selectItem:i,clear:c,labelKey:u,valueKey:d,allOptions:p}=r.multi?Ao({...r,modelValue:r.modelValue??r.default??[]},n):_r({...r,modelValue:r.modelValue!==void 0?r.modelValue:r.default??""},n);return t({clear:c}),e.watch(()=>r.modelValue,m=>{m===void 0&&(r.multi?o.value=[]:o.value=void 0)}),(m,f)=>{var g,y;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["grid grid-cols-3 gap-2 mx-[1px]",m.layout==="popover"?"m-1":"mb-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(p),w=>(e.openBlock(),e.createElementBlock("label",{key:`item-${w[e.unref(d)]}`,for:`item-${w[e.unref(d)]}`,onClick:e.withModifiers(h=>e.unref(i)(w),["stop","prevent"]),class:e.normalizeClass([e.unref(s)(w)?"ring-2 ring-indigo-600":"","p-2.5 group relative flex justify-center items-center gap-x-12 text-center text-xs bg-white text-gray-800 border border-gray-200 cursor-pointer rounded-sm dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-200 peer-checked:text-indigo-600 dark:has-checked:text-indigo-500 peer-checked:border-indigo-600 dark:has-checked:border-indigo-500 peer-checked:ring peer-checked:shadow focus:ring dark:has-checked:ring-indigo-500 has-disabled:pointer-events-none has-disabled:text-gray-200 dark:has-disabled:text-neutral-700 has-disabled:after:absolute has-disabled:after:inset-0 has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-gray-200)_calc(50%-1px),var(--color-gray-200)_50%,transparent_50%)] dark:has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-neutral-700)_calc(50%-1px),var(--color-neutral-700)_50%,transparent_50%)]"])},[e.createElementVNode("input",{type:"checkbox",id:`item-${w[e.unref(d)]}`,class:"hidden w4poy border-gray-200 g41z1 g22e3 axcnw dark:text-indigo-500 dark:border-neutral-700 dark:focus:ring-neutral-900",name:`item-${w[e.unref(d)]}`,value:w[e.unref(d)]},null,8,cx),e.createElementVNode("span",dx,e.toDisplayString(w[e.unref(u)]),1)],10,ix))),128))],2),m.cleanable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[m.layout==="inline"?(e.openBlock(),e.createElementBlock("div",ux,[e.createTextVNode(e.toDisplayString(m.multi&&Array.isArray(e.unref(o))?(g=e.unref(o))==null?void 0:g.length:e.unref(o)!==void 0&&(e.unref(o)||e.unref(o)===null)?1:0)+" з "+e.toDisplayString(e.unref(p).length)+" обрано ",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:f[0]||(f[0]=(...w)=>e.unref(c)&&e.unref(c)(...w))}," Очистити ",512),[[e.vShow,e.unref(o)!==""&&e.unref(o)!==void 0||e.unref(o)]])])):e.createCommentVNode("",!0),m.layout==="popover"?(e.openBlock(),e.createElementBlock("div",px,[e.createElementVNode("span",null,e.toDisplayString(m.multi&&Array.isArray(e.unref(o))?(y=e.unref(o))==null?void 0:y.length:e.unref(o)!==void 0&&(e.unref(o)||e.unref(o)===null)?1:0)+" з "+e.toDisplayString(e.unref(p).length)+" обрано",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:f[1]||(f[1]=(...w)=>e.unref(c)&&e.unref(c)(...w))}," Очистити ",512),[[e.vShow,e.unref(o)!==void 0&&e.unref(o)!==""||e.unref(o)]])])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)}}}),fx=["disabled","title"],hx={class:"flex w-full items-center justify-between gap-1 overflow-hidden text-left"},gx={class:"truncate text-ellipsis text-sm"},yx={key:0,class:"inline-flex min-h-[18px] min-w-[18px] items-center justify-center rounded-sm bg-blue-100 px-2 text-[11px] font-semibold text-blue-600"},bx={class:"w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-sm focus:outline-none focus:bg-stone-100 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},kx={class:"w-[360px] max-h-[500px] overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 before:w-full p-2"},Br=e.defineComponent({__name:"popover-field",props:{disabled:{type:Boolean,default:!1},label:{},en:{},ua:{},uk:{},fr:{},de:{},es:{},currentValue:{},fieldRef:{},width:{},mode:{},layout:{}},setup(l,{expose:t}){const a=l,r=e.computed(()=>Oo(a.mode)),n=e.ref(!1),o=e.ref({top:0,left:0}),s=e.ref(null),i=e.ref(null),c=e.ref(null);let u=null;function d(){const V=i.value,E=c.value;if(!V||!E)return;const D=V.getBoundingClientRect(),$=E.offsetWidth,C=E.offsetHeight,B=window.innerWidth,M=window.innerHeight,U=8;let P=D.bottom+U,{left:I}=D;const O=Math.max(B-$-10,10);if(I=Math.min(I,O),I=Math.max(I,10),P+C>M-10){const F=D.top-C-U;P=F>=10?F:Math.max(M-C-10,10)}P<10&&(P=10),o.value={top:P,left:I}}function p(){e.nextTick(()=>{d(),typeof window<"u"&&typeof window.requestAnimationFrame=="function"&&window.requestAnimationFrame(()=>d())})}function m(){n.value=!n.value,n.value&&(p(),e.nextTick(()=>{var V,E,D,$,C,B,M;(V=a.fieldRef)!=null&&V.inputTextRef&&(($=(D=(E=a.fieldRef)==null?void 0:E.inputTextRef)==null?void 0:D.focus)==null||$.call(D)),(C=a.fieldRef)!=null&&C.loadData&&Promise.resolve((M=(B=a.fieldRef)==null?void 0:B.loadData)==null?void 0:M.call(B)).finally(()=>{n.value&&p()})}))}function f(V){var E,D,$;!((E=s.value)!=null&&E.contains(V.target))&&!((D=c.value)!=null&&D.contains(V.target))&&!(($=i.value)!=null&&$.contains(V.target))&&(n.value=!1)}function g(V){V.key==="Escape"&&(n.value=!1)}const y=e.ref(!1),w=e.ref("ua"),h=V=>{V.detail.key==="locale"&&(w.value=V.detail.newValue)};e.onMounted(()=>{y.value=!0,w.value=localStorage.locale,window.addEventListener("storage",h),document.addEventListener("click",f,!0),document.addEventListener("keydown",g),window.addEventListener("scroll",d,!0),window.addEventListener("resize",d,!0),typeof ResizeObserver<"u"&&(u=new ResizeObserver(()=>{n.value&&p()}))}),e.onBeforeUnmount(()=>{window.removeEventListener("storage",h),document.removeEventListener("click",f,!0),document.removeEventListener("keydown",g),window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d,!0),u==null||u.disconnect(),u=null});function k(){n.value=!1}t({close:k}),e.watch([y,n,c],([V,E,D])=>{V&&E&&D&&(p(),u==null||u.observe(D))});function x(V){return Array.isArray(V)?V.filter(E=>E!=null&&E!=="").length:V&&typeof V=="object"?Object.values(V).filter(E=>E!=null&&E!=="").length:typeof V=="string"?V.trim()===""?0:1:typeof V=="number"?Number.isNaN(V)?0:1:V===null||V!==void 0?1:0}const b=e.computed(()=>{var D;const V=(D=a.fieldRef)==null?void 0:D.selectedLabels,E=x(V);return E>0?E:x(a.currentValue)}),_=e.computed(()=>{var E;const V=(E=a.fieldRef)==null?void 0:E.selectedLabels;return!V||["inline"].includes(a.layout||"")?a[w.value]||(a.label??""):Array.isArray(V)?V.length>0?V.join(", "):a.label??"":String(V)});return(V,E)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:s},[e.createElementVNode("button",{onClick:m,disabled:V.disabled,ref_key:"triggerRef",ref:i,title:V.label,class:e.normalizeClass([r.value,V.width?e.unref(Fo).getWidthClass(V.width):"w-full",V.layout==="inline"&&b.value>0?"border border-blue-400 bg-blue-50 text-blue-600":""]),type:"button"},[e.createElementVNode("span",hx,[e.createElementVNode("span",gx,e.toDisplayString(_.value),1),V.layout==="inline"&&b.value>0?(e.openBlock(),e.createElementBlock("span",yx,e.toDisplayString(b.value),1)):e.createCommentVNode("",!0)]),e.createVNode(ga,{class:"h-4 w-4 text-neutral-500"})],10,fx),y.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{ref_key:"popperRef",ref:c,class:"vsTailwind vs-popover__content w-fit fixed z-[1000]",style:e.normalizeStyle({top:`${o.value.top}px`,left:`${o.value.left}px`}),"data-inside-popover":""},[e.createElementVNode("div",bx,[e.createElementVNode("div",kx,[e.renderSlot(V.$slots,"default")])])],4),[[e.vShow,n.value]])])):e.createCommentVNode("",!0)],512))}}),xx={},wx={xmlns:"http://www.w3.org/2000/svg",width:"15px",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[90deg]"};function Ex(l,t){return e.openBlock(),e.createElementBlock("svg",wx,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)])])}const _x=vt(xx,[["render",Ex]]),Vx={},Cx={xmlns:"http://www.w3.org/2000/svg",width:"15px",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[270deg]"};function Nx(l,t){return e.openBlock(),e.createElementBlock("svg",Cx,[...t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)])])}const Bx=vt(Vx,[["render",Nx]]),vx={class:"flex gap-1"},Sx={class:"mb-1"},Dx={class:"mb-1"},Ax={class:"inline-flex rounded-sm shrink-0 pl-1"},Mx=["title"],Tx={class:"inline-flex rounded-sm shrink-0 pl-1"},$x=["title"],Lx={key:1,class:"flex gap-1 !w-[75%] rounded-sm"},Fx=["max","value","disabled"],Ix=["min","value","disabled"],Ox=e.defineComponent({__name:"date-input-inline",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{},itemClass:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=Rt(),n=l,o=a,s=e.ref(null),{activeMode:i,innerValue:c,onSelectChange:u,nextClick:d,prevClick:p,currentLabel:m,clear:f}=Po({...n,popoverRef:s},o);e.watch(()=>n.modelValue,w=>{w!==void 0?(c.value=w,o("update:modelValue",w)):(i.value="",c.value=[])}),e.watch(c,w=>{o("update:modelValue",w),o("change",{name:n.name,value:w})},{deep:!0});function g(w){const h=Array.isArray(c.value)?[...c.value]:[];c.value=[w,h[1]||""]}function y(w){const h=Array.isArray(c.value)?[...c.value]:[];c.value=[h[0]||"",w]}return t({clear:f,popoverRef:s}),(w,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",vx,[e.createVNode(Br,{ref_key:"popoverRef",ref:s,label:e.unref(m),"current-value":e.unref(c),mode:w.mode,width:typeof w.width=="number"&&e.unref(c).length?w.width-70:w.width,onClear:e.unref(f),layout:w.layout,class:e.normalizeClass(w.itemClass)},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",onClick:h[0]||(h[0]=k=>e.unref(u)("range")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.period"))+" ",1),e.unref(i)==="range"?(e.openBlock(),e.createBlock(Qt,{key:0})):e.createCommentVNode("",!0)])]),h[12]||(h[12]=e.createElementVNode("div",null,[e.createElementVNode("div",{class:"pt-1 mt-1 border-t"})],-1)),e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",onClick:h[1]||(h[1]=k=>e.unref(u)("today")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.today"))+" ",1),e.unref(i)==="today"?(e.openBlock(),e.createBlock(Qt,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",onClick:h[2]||(h[2]=k=>e.unref(u)("week")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.week"))+" ",1),e.unref(i)==="week"?(e.openBlock(),e.createBlock(Qt,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",onClick:h[3]||(h[3]=k=>e.unref(u)("month")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.month"))+" ",1),e.unref(i)==="month"?(e.openBlock(),e.createBlock(Qt,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",onClick:h[4]||(h[4]=k=>e.unref(u)("quarter")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.quarter"))+" ",1),e.unref(i)==="quarter"?(e.openBlock(),e.createBlock(Qt,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Sx,[e.createElementVNode("button",{type:"button",onClick:h[5]||(h[5]=k=>e.unref(u)("year")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.year"))+" ",1),e.unref(i)==="year"?(e.openBlock(),e.createBlock(Qt,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Dx,[e.createElementVNode("button",{type:"button",onClick:h[6]||(h[6]=k=>e.unref(f)()),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.alltime"))+" ",1),e.unref(c)[0]?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Qt,{key:0}))])])]),_:1},8,["label","current-value","mode","width","onClear","layout","class"]),e.unref(i)!==""&&e.unref(i)!=="range"&&e.unref(i)!=="last_7_days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",Ax,[e.createElementVNode("button",{type:"button",title:e.unref(r)("filter.prev"),class:"inline-flex h-[38px] items-center px-2 text-sm text-gray-800 bg-gray-100 gap-x-2 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",onClick:h[7]||(h[7]=(...k)=>e.unref(p)&&e.unref(p)(...k))},[e.createVNode(_x)],8,Mx)]),e.createElementVNode("div",Tx,[e.createElementVNode("button",{type:"button",title:e.unref(r)("filter.next"),class:"inline-flex h-[38px] items-center px-2 text-sm text-gray-800 gap-x-2 bg-gray-100 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",onClick:h[8]||(h[8]=(...k)=>e.unref(d)&&e.unref(d)(...k))},[e.createVNode(Bx)],8,$x)])],64)):e.createCommentVNode("",!0),e.unref(i)!==""&&e.unref(i)==="range"?(e.openBlock(),e.createElementBlock("div",Lx,[e.createElementVNode("input",{type:"date",max:e.unref(c)[1],locale:"uk-UA",value:e.unref(c)[0],onInput:h[9]||(h[9]=k=>g(k.target.value)),class:"px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-sm focus:outline-blue-600",disabled:w.disabled},null,40,Fx),e.createElementVNode("input",{type:"date",min:e.unref(c)[0],locale:"uk-UA",value:e.unref(c)[1],onInput:h[10]||(h[10]=k=>y(k.target.value)),class:"px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-sm focus:outline-blue-600 appearance-auto",disabled:w.disabled},null,40,Ix)])):e.createCommentVNode("",!0)]),(w.cleanable,e.createCommentVNode("",!0))],64))}}),Px={class:"flex flex-wrap items-center gap-2"},Rx=["disabled","onClick"],jx={key:0,class:"flex justify-between items-center text-xs text-gray-500 p-1 border-t"},Ux=e.defineComponent({__name:"button-field",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{},itemClass:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=a,{innerValue:o,isSelected:s,selectItem:i,clear:c,labelKey:u,valueKey:d,allOptions:p}=_r({...r,modelValue:r.modelValue??r.default??""},n),m=e.computed(()=>o.value!==void 0&&!(typeof o.value=="string"&&o.value==="")),f=e.computed(()=>m.value?1:0);function g(w){return s(w)?["bg-blue-600 text-white"].filter(h=>typeof h=="string"&&h.trim().length>0).join(" "):["text-gray-700 hover:bg-gray-200 bg-gray-50 "].filter(h=>typeof h=="string"&&h.trim().length>0).join(" ")}function y(w){r.disabled||i(w)}return t({clear:c}),e.watch(()=>r.modelValue,w=>{w===void 0&&(o.value=void 0)}),(w,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Px,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(p),k=>(e.openBlock(),e.createElementBlock("button",{key:k[e.unref(d)],type:"button",class:e.normalizeClass(["px-3 py-2 text-sm font-medium rounded-md transition-colors",g(k)]),disabled:w.disabled,onClick:x=>y(k)},e.toDisplayString(k[e.unref(u)]),11,Rx))),128))]),w.cleanable&&w.layout==="popover"?(e.openBlock(),e.createElementBlock("div",jx,[e.createElementVNode("span",null,e.toDisplayString(f.value)+" з "+e.toDisplayString(e.unref(p).length)+" обрано",1),e.withDirectives(e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",onClick:h[0]||(h[0]=(...k)=>e.unref(c)&&e.unref(c)(...k))}," Очистити ",512),[[e.vShow,m.value]])])):e.createCommentVNode("",!0)],64))}}),Ro={radio:hk,checkbox:$o,check:$o,text:Dk,range:Pk,date:Zk,select:sx,tag:mx,button:Ux,"date:inline":Ox};function vr(l,t){let a;switch(l.toLowerCase()){case"autocomplete":a="select";break;case"check":a="checkbox";break;default:a=l==null?void 0:l.toString().toLowerCase()}return a==="date"&&t&&t==="inline"&&(a="date:inline"),{component:Ro[a]||Ro.text,type:a}}const zx={style:{display:"inline-flex",margin:"0px",width:"100%"}},Hx={class:"relative w-full mb-2 p-4 bg-white rounded-md shadow-sm"},Kx={class:"block mb-3 text-sm font-medium text-gray-800 dark:text-neutral-200"},qx={class:"flex items-center"},Gx={class:"text-sm font-medium max-w-[80%] text-gray-800 flex items-center gap-x-1"},Wx={class:"filter-layout__body"},Yx=e.defineComponent({__name:"vertical-layout",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{},itemClass:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=a,o=e.ref(),s=e.computed(()=>vr(r.type,r.layout)),i=e.computed({get:()=>r.modelValue,set:p=>n("update:modelValue",p)});function c(p){n("clear",p)}function u(p,m){n("change",{name:p,value:m}),r.modelValue!==void 0&&n("update:modelValue",m)}function d(){n("clear",r.name)}return e.watch(()=>r.default,p=>{i.value=p}),e.watch(()=>r.modelValue,p=>{i.value=p}),t({filterRef:o}),(p,m)=>{var f,g,y;return e.openBlock(),e.createElementBlock("div",zx,[e.createElementVNode("div",Hx,[e.createElementVNode("div",Kx,[e.createElementVNode("div",qx,[e.createElementVNode("span",Gx,e.toDisplayString(p.label),1)]),typeof i.value=="string"&&i.value.trim()!==""||Array.isArray(i.value)&&i.value.length>0&&i.value.some(w=>w!==void 0)||i.value===null?(e.openBlock(),e.createBlock(q1,{key:0,onClick:d})):e.createCommentVNode("",!0)]),e.createElementVNode("div",Wx,[((f=s.value)==null?void 0:f.type)!=="select"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent((g=s.value)==null?void 0:g.component),e.mergeProps({key:0},r,{type:(y=s.value)==null?void 0:y.type,class:r.itemClass,onChange:m[0]||(m[0]=w=>u(w.name,w.value)),onClear:m[1]||(m[1]=w=>c(w)),ref_key:"filterRef",ref:o}),null,16,["type","class"])):(e.openBlock(),e.createBlock(Br,{key:1,"current-value":i.value,label:p.label,mode:p.mode,onClear:d,fieldRef:o.value,width:void 0,disabled:p.disabled,layout:"vertical"},{default:e.withCtx(()=>{var w,h;return[(e.openBlock(),e.createBlock(e.resolveDynamicComponent((w=s.value)==null?void 0:w.component),e.mergeProps({ref_key:"filterRef",ref:o},r,{type:(h=s.value)==null?void 0:h.type,class:r.itemClass,onChange:m[2]||(m[2]=k=>u(k.name,k.value)),onClear:m[3]||(m[3]=k=>c(k))}),null,16,["type","class"]))]}),_:1},8,["current-value","label","mode","fieldRef","disabled"]))])])])}}}),jo=e.defineComponent({__name:"inline-layout",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{},itemClass:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=a,o=e.ref(),s=e.computed(()=>vr(r.type,r.layout)),i=e.computed({get:()=>r.modelValue,set:d=>n("update:modelValue",d)});function c(d=r.name){n("clear",d)}function u(d,p){n("change",{name:d,value:p}),r.modelValue!==void 0&&n("update:modelValue",p)}return e.watch(()=>r.default,d=>{i.value=d}),e.watch(()=>r.modelValue,d=>{i.value=d}),t({filterRef:o}),(d,p)=>{var m,f;return["text","date","button"].includes(d.type.toLocaleLowerCase())?(e.openBlock(),e.createBlock(e.resolveDynamicComponent((m=s.value)==null?void 0:m.component),e.mergeProps({key:0},r,{type:(f=s.value)==null?void 0:f.type,class:d.itemClass,onChange:p[0]||(p[0]=g=>u(g.name,g.value)),onClear:p[1]||(p[1]=g=>c(g)),disabled:d.disabled,modelValue:i.value,"onUpdate:modelValue":p[2]||(p[2]=g=>i.value=g)}),null,16,["type","class","disabled","modelValue"])):(e.openBlock(),e.createBlock(Br,{key:1,"current-value":i.value,label:d.label,mode:d.mode,onClear:c,fieldRef:o.value,width:r.width,disabled:d.disabled,layout:"inline"},{default:e.withCtx(()=>{var g,y;return[(e.openBlock(),e.createBlock(e.resolveDynamicComponent((g=s.value)==null?void 0:g.component),e.mergeProps({ref_key:"filterRef",ref:o},r,{modelValue:i.value,"onUpdate:modelValue":p[3]||(p[3]=w=>i.value=w),type:(y=s.value)==null?void 0:y.type,class:r.itemClass,onChange:p[4]||(p[4]=w=>u(w.name,w.value)),onClear:p[5]||(p[5]=w=>c(w))}),null,16,["modelValue","type","class"]))]}),_:1},8,["current-value","label","mode","fieldRef","width","disabled"]))}}}),Xx=e.defineComponent({__name:"popover-layout",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{},ua:{},itemClass:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=a,o=e.ref(),s=e.computed(()=>vr(r.type,r.layout)),i=e.computed({get:()=>r.modelValue,set:d=>n("update:modelValue",d)});function c(d){n("clear",d)}function u(d,p){n("change",{name:d,value:p}),r.modelValue!==void 0&&n("update:modelValue",p)}return e.watch(()=>r.default,d=>{i.value=d}),e.watch(()=>r.modelValue,d=>{i.value=d}),e.watch(()=>r,d=>{i.value=d}),t({filterRef:o}),(d,p)=>{var m,f;return e.openBlock(),e.createBlock(e.resolveDynamicComponent((m=s.value)==null?void 0:m.component),e.mergeProps(r,{type:(f=s.value)==null?void 0:f.type,class:r.itemClass,modelValue:i.value,"onUpdate:modelValue":p[0]||(p[0]=g=>i.value=g),onChange:p[1]||(p[1]=g=>u(g.name,g.value)),onClear:p[2]||(p[2]=g=>c(g)),ref_key:"filterRef",ref:o}),null,16,["type","class","modelValue"])}}}),jt=e.defineComponent({__name:"filter-field",props:{id:{},name:{},title:{},type:{},label:{},width:{},options:{default:()=>[]},placeholder:{},api:{},data:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{default:10},multi:{type:Boolean,default:!0},dataKey:{},valueKey:{},mode:{},labelKey:{},sort:{default:"name"},ua:{},itemClass:{}},emits:["update:modelValue","change","clear"],setup(l,{expose:t,emit:a}){const r=l,n=a,o=e.ref(),s=e.computed({get:()=>r.modelValue,set:d=>n("update:modelValue",d)});function i(d){n("clear",d)}function c(d,p){n("change",{name:d,value:p}),r.modelValue!==void 0&&n("update:modelValue",p)}e.watch(()=>r.default,d=>{s.value=d}),e.watch(()=>r.modelValue,d=>{s.value=d}),t({filterRef:o});function u(){switch(r.layout){case"inline":return jo;case"vertical":return Yx;case"popover":return Xx;default:return jo}}return(d,p)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u()),e.mergeProps(r,{onChange:p[0]||(p[0]=m=>c(m.name,m.value)),onClear:p[1]||(p[1]=m=>i(m)),modelValue:s.value,"onUpdate:modelValue":p[2]||(p[2]=m=>s.value=m)}),null,16,["modelValue"]))}});function ya(l,t){const{slots:a}=l,r=h=>h?JSON.parse(JSON.stringify(e.toRaw(h))):{},n=e.ref(r(l.value));e.watch(()=>l.value,h=>{n.value=r(h)},{deep:!0,immediate:!0});const o=e.computed(()=>{var h;return(e.toRaw((h=a==null?void 0:a.default)==null?void 0:h.call(a))??[]).flatMap(k=>Array.isArray(k.children)?k.children:[k])});function s(h){delete n.value[h],t("clear",{data:e.toRaw(n.value),name:h})}function i(h,k){k===void 0?s(h):n.value={...n.value,[h]:k},t("change",{data:e.toRaw(n.value),name:h,value:k})}const c=e.computed(()=>o.value.map(h=>{var x,b,_;const k=(x=h.props)==null?void 0:x.name;return e.cloneVNode(h,{...h.props,layout:l.view,showClean:!0,modelValue:n.value[k],"onUpdate:modelValue":V=>{i(k,V)},onClear:()=>s(k),class:[l.itemClass,(b=h.props)==null?void 0:b.class],itemClass:[l.itemClass,(_=h.props)==null?void 0:_.itemClass].filter(V=>typeof V=="string"&&V.trim().length>0).join(" ")||void 0})})),u=e.computed(()=>new Map(c.value.map(h=>{var x;const k=(x=h.props)==null?void 0:x.name;return k?[k,h]:null}).filter(h=>h!==null)));function d(h=!1){n.value={},h||t("clearAll",{data:e.toRaw(n.value),name:"ALL"})}const p=e.ref(""),m=e.computed(()=>{var h;return(h=l.schema)!=null&&h.value?Object.entries(n.value).filter(([k,x])=>l.schema&&!(k in l.schema.value)?!1:Array.isArray(x)?x.some(b=>b!==""&&b!==void 0):x!==""&&x!==void 0).length:0}),f=e.ref();e.watch(p,async()=>{var h,k;await e.nextTick(),(k=(h=f==null?void 0:f.value)==null?void 0:h.filterRef)!=null&&k.inputTextRef&&f.value.filterRef.inputTextRef.focus()});const g=e.computed(()=>{var h,k;return(h=l.schema)!=null&&h.value?Object.fromEntries(Object.entries((k=l.schema)==null?void 0:k.value).slice(0,l.limit)):{}}),y=e.computed(()=>{var k;if(c.value.length===0)return[];let h=0;if((k=l.schema)!=null&&k.value){const x=Object.entries(l.schema.value).length;l.limit&&x<l.limit?h=l.limit-x:h=0}return c.value.slice(0,h)}),w=e.computed(()=>c.value.length===0?[]:l.view!=="inline"?c.value:c.value.slice(y.value.length));return{activeFilter:n,activeFilterCount:m,onFilterChange:i,clearFilter:s,clearAllFilters:d,limitedSchema:g,filtersSlot:c,limitedFiltersSlot:y,popoverFiltersSlot:w,vnodeMap:u,selectedFilter:p,filterRef:f}}const Zx=e.defineComponent({__name:"popover",emits:["open","close"],setup(l,{emit:t}){const a=e.ref(!1),r=e.ref(null),n=e.ref(null),o=e.ref(null),s=e.ref({top:"0px",left:"0px",position:"absolute"}),i=e.ref(!1);function c(){a.value=!a.value}function u(){const g=o.value,y=r.value;if(!g||!y)return;const{left:w,bottom:h}=g.getBoundingClientRect();requestAnimationFrame(()=>{if(!y)return;const{width:k}=y.getBoundingClientRect(),x=y.offsetWidth||k,b=window.innerWidth||document.documentElement.clientWidth,_=b-w;let V=w;x>_&&(V=b-x-18),V<18&&(V=18);const E=b-x-18;V>E&&(V=Math.max(18,E)),s.value={position:"fixed",top:`${h+18}px`,left:`${V}px`},i.value=!0})}const d=e.computed(()=>Object.entries(s.value).map(g=>g.join(":")).join(";"));function p(g){var w,h;const y=g.target;!((w=o.value)!=null&&w.contains(g.target))&&!((h=r.value)!=null&&h.contains(g.target))&&!y.closest("[data-inside-popover]")&&(a.value=!1)}const m=e.ref(!1);e.onMounted(()=>{m.value=!0}),e.onMounted(()=>{var g,y;o.value=((g=n.value)==null?void 0:g.querySelector("[data-popover-trigger]"))||null,(y=o.value)==null||y.addEventListener("click",c),document.addEventListener("click",p),window.addEventListener("resize",u),window.addEventListener("scroll",u,!0)}),e.onBeforeUnmount(()=>{var g;(g=o.value)==null||g.removeEventListener("click",c),document.removeEventListener("click",p),window.removeEventListener("resize",u),window.removeEventListener("scroll",u,!0)});const f=t;return e.watch(a,async g=>{g?(i.value=!1,f("open"),await e.nextTick(),requestAnimationFrame(()=>{u()})):(f("close"),i.value=!1)}),(g,y)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:n},[e.renderSlot(g.$slots,"trigger"),m.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{ref_key:"popoverRef",ref:r,class:"fixed z-[50] w-[calc(100vw-32px)] md:w-[600px] rounded-md border bg-white shadow-md transition-opacity duration-0",style:e.normalizeStyle([d.value,{visibility:i.value?"visible":"hidden",opacity:i.value?1:0}])},[e.renderSlot(g.$slots,"default")],4),[[e.vShow,a.value]])])):e.createCommentVNode("",!0)],512))}}),Qx={},Jx={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-filter h-4 w-4"};function ew(l,t){return e.openBlock(),e.createElementBlock("svg",Jx,[...t[0]||(t[0]=[e.createElementVNode("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"},null,-1)])])}const Uo=vt(Qx,[["render",ew]]),tw={class:"flex items-center gap-2 overflow-hidden"},lw={key:0,class:"inline-flex min-h-[18px] min-w-[18px] items-center justify-center rounded-[4px] bg-blue-500 px-1 text-[11px] font-semibold text-white"},aw={class:"flex max-h-[400px] md:max-h-[400px]"},rw={class:"w-[150px] sm:w-[180px] md:w-64 border-r border-gray-200 overflow-y-auto"},nw={class:"p-2 md:p-4 border-b"},ow={class:"text-xs md:text-sm text-gray-600"},sw={class:"p-1 md:p-2"},iw=["onClick"],cw={class:"flex items-center gap-1.5 md:gap-2"},dw={class:"text-xs md:text-sm font-medium line-clamp-3"},uw={key:0,class:"inline-flex min-h-[16px] md:min-h-[18px] min-w-[16px] md:min-w-[18px] items-center justify-center rounded-[4px] bg-blue-100 px-0.5 md:px-1 text-[10px] md:text-[11px] font-semibold text-blue-600 flex-shrink-0"},pw=["onClick"],mw={class:"flex items-center gap-1.5 md:gap-2"},fw={class:"text-xs md:text-sm font-medium truncate"},hw={key:0,class:"inline-flex min-h-[16px] md:min-h-[18px] min-w-[16px] md:min-w-[18px] items-center justify-center rounded-[4px] bg-blue-100 px-0.5 md:px-1 text-[10px] md:text-[11px] font-semibold text-blue-600 flex-shrink-0"},gw={key:0,class:"p-1 md:p-2 border-t"},yw={class:"flex-1 min-h-[250px] md:min-h-[300px] overflow-y-auto"},bw={key:0,class:"flex items-center justify-center h-full text-gray-500"},kw={class:"text-xs md:text-sm"},zo=e.defineComponent({__name:"popover-filter-layout",props:{badgeCount:{},schema:{},view:{},value:{},history:{type:Boolean},mode:{},limit:{default:3},width:{},title:{},disabled:{type:Boolean},defaultPanelWidth:{},itemClass:{},teleportActive:{}},emits:["change","clear","clearAll"],setup(l,{expose:t,emit:a}){const r=Rt(),n=l,o=Oo(n.mode),s=e.useSlots(),i=a,c=e.ref({}),u=e.computed(()=>c!=null&&c.value?n.view!=="inline"?c==null?void 0:c.value:Object.fromEntries(Object.entries(c==null?void 0:c.value).slice(n.limit)):{}),{activeFilter:d,activeFilterCount:p,onFilterChange:m,clearFilter:f,clearAllFilters:g,popoverFiltersSlot:y,selectedFilter:w,filterRef:h}=ya({...n,schema:c,slots:s},i),k=e.computed(()=>n.badgeCount??p.value);function x(V){return Array.isArray(V)?V.filter(E=>E!=null&&E!=="").length:V&&typeof V=="object"?Object.values(V).filter(E=>E!=null&&E!=="").length:V===null||V!==void 0&&V!==""?1:0}function b(V){return d.value?x(d.value[V]):0}function _(){if(u.value){const[V]=Object.keys(u.value);w.value=V}else y.value.length>0?w.value=y.value[0].props.name:w.value=""}return e.watch(()=>n.schema,V=>{c.value=V??{}},{deep:!0,immediate:!0}),t({clearFilter:f,clearAllFilters:g}),(V,E)=>(e.openBlock(),e.createBlock(Zx,{onOpen:_,onClose:E[5]||(E[5]=D=>w.value="")},{trigger:e.withCtx(()=>[e.createElementVNode("button",{"data-popover-trigger":"","aria-haspopup":"dialog","aria-expanded":"false",class:e.normalizeClass([V.itemClass,e.unref(o),"flex items-center justify-between gap-2",k.value>0?"border border-blue-400 bg-blue-50 text-blue-600 hover:border-blue-500":"text-neutral-700 hover:border-neutral-400"]),type:"button"},[e.createElementVNode("span",tw,[e.createVNode(Uo,{class:"h-4 w-4"}),E[6]||(E[6]=e.createElementVNode("span",{class:"text-sm font-medium"},"Фільтр",-1))]),k.value>0?(e.openBlock(),e.createElementBlock("span",lw,e.toDisplayString(k.value),1)):e.createCommentVNode("",!0)],2)]),default:e.withCtx(()=>[e.createElementVNode("div",aw,[e.createElementVNode("div",rw,[e.createElementVNode("div",nw,[e.createElementVNode("p",ow,e.toDisplayString(e.unref(r)("filter.selectFieldHelp")),1)]),e.createElementVNode("div",sw,[V.schema?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Object.entries(u.value),([D,$])=>(e.openBlock(),e.createElementBlock("button",{key:D,onClick:()=>{w.value=D},class:e.normalizeClass(["flex w-full items-center justify-between px-2 md:px-3 py-1.5 md:py-2 text-left transition-colors hover:bg-gray-50",e.unref(w)===D?"bg-blue-50 text-blue-700 border-l-2 border-blue-500":"text-neutral-700"])},[e.createElementVNode("div",cw,[e.createElementVNode("span",dw,e.toDisplayString($.label),1)]),b(D)>0?(e.openBlock(),e.createElementBlock("div",uw,e.toDisplayString(b(D)),1)):e.createCommentVNode("",!0)],10,iw))),128)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(y),(D,$)=>(e.openBlock(),e.createElementBlock("button",{key:"slot-"+$,onClick:C=>w.value=D.props.name,class:e.normalizeClass(["flex items-center justify-between px-2 md:px-3 py-1.5 md:py-2 text-left transition-colors hover:bg-gray-50",e.unref(w)===D.props.name?"bg-blue-50 text-blue-700 border-l-2 border-blue-500":"text-neutral-700"])},[e.createElementVNode("div",mw,[e.createElementVNode("span",fw,e.toDisplayString(D.props.label),1)]),b(D.props.name)>0?(e.openBlock(),e.createElementBlock("div",hw,e.toDisplayString(b(D.props.name)),1)):e.createCommentVNode("",!0)],10,pw))),128))]),e.unref(p)>0?(e.openBlock(),e.createElementBlock("div",gw,[e.createElementVNode("button",{class:e.normalizeClass([V.itemClass,"w-full px-2 md:px-3 py-1.5 md:py-2 text-left text-xs md:text-sm text-gray-600 hover:bg-gray-50 transition-colors"]),onClick:E[0]||(E[0]=D=>e.unref(g)()),"data-inside-popover":""}," Очистити всі ",2)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",yw,[e.unref(w)===""?(e.openBlock(),e.createElementBlock("div",bw,[e.createElementVNode("p",kw,e.toDisplayString(e.unref(r)("filter.selectFieldHelp")),1)])):e.createCommentVNode("",!0),e.unref(w)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[u.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Object.entries(u.value),([D,$])=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(w)===D?(e.openBlock(),e.createBlock(jt,e.mergeProps({key:D,layout:"popover",ref_for:!0,ref_key:"filterRef",ref:h},{ref_for:!0},$,{class:[V.itemClass,$==null?void 0:$.class],"item-class":[V.itemClass,$==null?void 0:$.itemClass].filter(Boolean).join(" ")||void 0,onChange:E[1]||(E[1]=C=>e.unref(m)(C.name,C.value)),onClear:E[2]||(E[2]=C=>{e.unref(f)(C),e.unref(m)(C,void 0)}),modelValue:e.unref(d)[D],"onUpdate:modelValue":C=>e.unref(d)[D]=C,cleanable:!0}),null,16,["class","item-class","modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(y),(D,$)=>{var C,B;return e.openBlock(),e.createElementBlock(e.Fragment,{key:"slot-"+$},[e.unref(w)===D.props.name?(e.openBlock(),e.createBlock(jt,e.mergeProps({key:0,layout:"popover"},{ref_for:!0},D.props,{ref_for:!0,ref_key:"filterRef",ref:h,class:[V.itemClass,(C=D.props)==null?void 0:C.class],"item-class":[V.itemClass,(B=D.props)==null?void 0:B.itemClass].filter(Boolean).join(" ")||void 0,onChange:E[3]||(E[3]=M=>e.unref(m)(M.name,M.value)),onClear:E[4]||(E[4]=M=>{e.unref(f)(M),e.unref(m)(M,void 0)}),modelValue:e.unref(d)[D.props.name],"onUpdate:modelValue":M=>e.unref(d)[D.props.name]=M,cleanable:!0}),null,16,["class","item-class","modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],64)}),128))],64)):e.createCommentVNode("",!0)])])]),_:1}))}}),xw={class:"flex gap-1 items-center flex-wrap"},Ho=e.defineComponent({__name:"inline-filter-layout",props:{schema:{},view:{},value:{},history:{type:Boolean},mode:{},limit:{default:3},width:{},title:{},disabled:{type:Boolean},defaultPanelWidth:{},itemClass:{},teleportActive:{}},emits:["change","clear","clearAll"],setup(l,{expose:t,emit:a}){const r=Rt(),n=l,o=a,s=e.useSlots(),i=e.ref({}),c=e.computed(()=>Object.keys(n.schema).length>n.limit),{activeFilter:u,activeFilterCount:d,onFilterChange:p,clearFilter:m,clearAllFilters:f,limitedSchema:g,filtersSlot:y,limitedFiltersSlot:w}=ya({...n,schema:i,slots:s},o);function h(E){return Array.isArray(E)?E.some(D=>D!==""&&D!==void 0&&D!==null):E===null?!0:E&&typeof E=="object"?Object.values(E).some(D=>D!==""&&D!==void 0&&D!==null):E!==""&&E!==void 0}const k=e.computed(()=>{const E=Object.keys(g.value??{}),D=w.value.map($=>{var C;return(C=$.props)==null?void 0:C.name}).filter($=>typeof $=="string");return new Set([...E,...D])}),x=e.computed(()=>Object.entries(u.value??{}).filter(([E,D])=>k.value.has(E)&&h(D)).length),b=e.computed(()=>{const E=d.value??0,D=x.value??0;return Math.max(E-D,0)}),_=e.ref();function V(){_.value&&_.value.clearAllFilters(!0),f()}return e.watch(()=>n.schema,E=>{i.value=E},{deep:!0,immediate:!0}),t({clearFilter:m,clearAllFilters:f}),(E,D)=>(e.openBlock(),e.createElementBlock("div",xw,[E.schema?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Object.entries(e.unref(g)),([$,C])=>(e.openBlock(),e.createBlock(jt,e.mergeProps({key:$,mode:E.mode,width:E.width?E.width:C==null?void 0:C.width},{ref_for:!0},C,{class:[E.itemClass,C==null?void 0:C.class],"item-class":[E.itemClass,C==null?void 0:C.itemClass].filter(Boolean).join(" ")||void 0,onChange:D[0]||(D[0]=B=>e.unref(p)(B.name,B.value)),onClear:e.unref(m),layout:"inline",cleanable:!0,modelValue:e.unref(u)[$],"onUpdate:modelValue":B=>e.unref(u)[$]=B}),null,16,["mode","width","class","item-class","onClear","modelValue","onUpdate:modelValue"]))),128)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(w),($,C)=>{var B,M;return e.openBlock(),e.createBlock(jt,e.mergeProps({key:"slot-"+C,layout:"inline"},{ref_for:!0},$.props,{class:[E.itemClass,(B=$.props)==null?void 0:B.class],"item-class":[E.itemClass,(M=$.props)==null?void 0:M.itemClass].filter(Boolean).join(" ")||void 0,onChange:D[1]||(D[1]=U=>e.unref(p)(U.name,U.value)),onClear:D[2]||(D[2]=U=>{e.unref(m)(U),e.unref(p)(U,void 0)}),cleanable:!0,modelValue:e.unref(u)[$.props.name],"onUpdate:modelValue":U=>e.unref(u)[$.props.name]=U}),null,16,["class","item-class","modelValue","onUpdate:modelValue"])}),128)),c.value?(e.openBlock(),e.createBlock(zo,e.mergeProps({key:1},n,{schema:E.schema,limit:E.limit,onChange:D[3]||(D[3]=$=>e.unref(p)($.name,$.value)),onClearAll:D[4]||(D[4]=$=>e.unref(f)()),onClear:D[5]||(D[5]=$=>e.unref(m)($.name)),mode:E.mode,ref_key:"popoverRef",ref:_,cleanable:!0,"badge-count":b.value}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(y),($,C)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent($),e.mergeProps({key:"slot-"+C,layout:"popover"},{ref_for:!0},$.props,{cleanable:!0}),null,16))),128))]),_:1},16,["schema","limit","mode","badge-count"])):e.createCommentVNode("",!0),e.unref(d)>0?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:V,class:e.normalizeClass([E.itemClass,"relative py-2 px-3 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-md bg-gray-50 border text-gray-800 hover:bg-gray-200 focus:bg-gray-200"])},e.toDisplayString(e.unref(r)("filter.clear")),3)):e.createCommentVNode("",!0)]))}}),ww={key:0,class:"p-2 overflow-y-auto overflow-hidden [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-800 max-h-[calc(100%-142px)] h-full bg-gray-100"},Ew={class:"flex items-center vst-filters vsTailwind flex-col w-full"},_w=e.defineComponent({__name:"vertical-filter-layout",props:{schema:{},view:{},value:{},history:{type:Boolean},mode:{},limit:{default:3},width:{},title:{},disabled:{type:Boolean},defaultPanelWidth:{},itemClass:{},teleportActive:{}},emits:["change","clear","clearAll"],setup(l,{expose:t,emit:a}){const r=l,n=a,o=e.useSlots(),{activeFilter:s,activeFilterCount:i,onFilterChange:c,clearFilter:u,clearAllFilters:d,filtersSlot:p}=ya({...r,slots:o},n);return t({clearFilter:u,clearAllFilters:d}),(m,f)=>m.view==="vertical"?(e.openBlock(),e.createElementBlock("div",ww,[e.createElementVNode("div",Ew,[e.unref(i)>0?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:f[0]||(f[0]=g=>e.unref(d)()),"data-popover-trigger":"","aria-haspopup":"dialog","aria-expanded":"false",class:e.normalizeClass([m.itemClass,"w-full ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:text-accent-foreground border h-10 px-4 py-2 gap-2 m-2 bg-white text-gray-800 hover:bg-gray-200 focus:bg-gray-200"]),type:"button"}," Очистити ",2)):e.createCommentVNode("",!0),m.schema?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Object.entries(m.schema),([g,y])=>(e.openBlock(),e.createBlock(jt,e.mergeProps({layout:"vertical"},{ref_for:!0},y,{class:[m.itemClass,y==null?void 0:y.class],"item-class":[m.itemClass,y==null?void 0:y.itemClass].filter(Boolean).join(" ")||void 0,onChange:f[1]||(f[1]=w=>e.unref(c)(w.name,w.value)),onClear:f[2]||(f[2]=w=>{e.unref(u)(w),e.unref(c)(w,void 0)}),modelValue:e.unref(s)[g],"onUpdate:modelValue":w=>e.unref(s)[g]=w,showClean:!0}),null,16,["class","item-class","modelValue","onUpdate:modelValue"]))),256)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(p),(g,y)=>{var w,h;return e.openBlock(),e.createBlock(jt,e.mergeProps({key:"slot-"+y,layout:"vertical"},{ref_for:!0},g.props,{class:[m.itemClass,(w=g.props)==null?void 0:w.class],"item-class":[m.itemClass,(h=g.props)==null?void 0:h.itemClass].filter(Boolean).join(" ")||void 0,onChange:f[3]||(f[3]=k=>e.unref(c)(k.name,k.value)),onClear:f[4]||(f[4]=k=>{e.unref(u)(k),e.unref(c)(k,void 0)}),modelValue:e.unref(s)[g.props.name],"onUpdate:modelValue":k=>e.unref(s)[g.props.name]=k,showClean:!0}),null,16,["class","item-class","modelValue","onUpdate:modelValue"])}),128))])])):e.createCommentVNode("",!0)}}),Vw=["onKeydown"],Cw=["disabled"],Nw={key:0,class:"ml-2 inline-flex min-h-[18px] min-w-[18px] items-center justify-center rounded-full bg-blue-500 px-1.5 text-[11px] font-semibold text-white"},Bw={class:"rounded-2xl border border-slate-300/35 bg-white/95 p-4 shadow-2xl backdrop-blur-sm"},vw={class:"mb-3 flex items-center justify-between"},Sw={class:"text-[15px] font-semibold text-slate-800"},Dw={"aria-hidden":"true"},Aw={class:"flex max-h-80 flex-col gap-1 overflow-y-auto"},Mw={key:0,class:"mt-3 flex justify-end"},Tw=e.defineComponent({__name:"popover-inline-filter-layout",props:{schema:{},view:{},value:{},history:{type:Boolean},mode:{},limit:{default:10},width:{default:220},title:{},disabled:{type:Boolean},defaultPanelWidth:{},itemClass:{},teleportActive:{}},emits:["change","clear","clearAll"],setup(l,{emit:t}){const a=Rt(),r=l,n=t,o=e.ref({}),s=e.useSlots(),{activeFilter:i,activeFilterCount:c,onFilterChange:u,clearFilter:d,clearAllFilters:p,filtersSlot:m}=ya({...r,schema:o.value,slots:s},n),f=e.ref(null),g=e.ref(null),y=e.reactive({open:!1,top:0,left:0}),w=e.computed(()=>y.open),h=e.computed(()=>!!r.disabled),k=e.computed(()=>o.value||{}),x=e.computed(()=>r.title??"Фільтр"),b=e.computed(()=>!!s.trigger),_=e.computed(()=>["inline-flex h-9 items-center justify-center gap-2 rounded-lg border border-transparent bg-slate-200/70 px-3 text-sm font-medium text-slate-700 transition-colors hover:bg-blue-100 hover:text-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-200 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-slate-200/70 disabled:hover:text-slate-700",h.value?"cursor-not-allowed opacity-60":"cursor-pointer"]),V=e.computed(()=>y.open?{position:"absolute",top:`${y.top}px`,left:`${y.left}px`,transform:"translateX(-50%)",zIndex:1e3}:{display:"none"});function E(){y.open=!1}function D(){if(!f.value)return;const U=f.value.getBoundingClientRect();y.top=U.bottom+window.scrollY+8,y.left=U.left+U.width/2+window.scrollX}function $(){y.open=!y.open,y.open&&e.nextTick(D)}function C(){h.value||$()}function B(){y.open&&D()}function M(){p()}return e.onMounted(()=>{window.addEventListener("resize",B),window.addEventListener("scroll",B,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",B),window.removeEventListener("scroll",B,!0)}),e.watch(()=>r.schema,U=>{if(!U){o.value={};return}if(Array.isArray(U)){const P=U.filter(I=>I&&(I.name||I.id)).map(I=>{const O=I.name||I.id;return[O,{...I,name:O}]});o.value=Object.fromEntries(P);return}o.value=U},{deep:!0,immediate:!0}),e.watch(()=>r.disabled,U=>{U&&E()}),(U,P)=>(e.openBlock(),e.createElementBlock("div",{class:"relative inline-flex",ref_key:"anchor",ref:f},[b.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["inline-flex",h.value?"cursor-not-allowed opacity-60 pointer-events-none":"cursor-pointer"]),role:"button",tabindex:"0","data-popover-trigger":"",onClick:e.withModifiers(C,["prevent","stop"]),onKeydown:[e.withKeys(e.withModifiers(C,["prevent","stop"]),["enter"]),e.withKeys(e.withModifiers(C,["prevent","stop"]),["space"])]},[e.renderSlot(U.$slots,"trigger",{toggle:C,open:w.value,disabled:h.value,activeCount:e.unref(c)})],42,Vw)):(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(_.value),type:"button",disabled:h.value,onClick:e.withModifiers(C,["prevent","stop"]),"data-popover-trigger":""},[e.createVNode(Uo,{class:"h-4 w-4"}),e.unref(c)>0?(e.openBlock(),e.createElementBlock("div",Nw,e.toDisplayString(e.unref(c)),1)):e.createCommentVNode("",!0)],10,Cw)),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[w.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["absolute",typeof U.width=="number"?`min-w-[${U.width+32+(Object.keys(k.value).length>7?20:0)}px]`:"min-w-[268px] "]),style:e.normalizeStyle(V.value),ref_key:"panel",ref:g,onClick:P[4]||(P[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Bw,[e.createElementVNode("div",vw,[e.createElementVNode("h3",Sw,e.toDisplayString(x.value),1),e.createElementVNode("button",{type:"button",class:"inline-flex h-6 w-6 items-center justify-center rounded-full border-0 bg-slate-300/40 text-slate-600 transition-colors hover:bg-blue-200/60 hover:text-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-200",onClick:E},[e.createElementVNode("span",Dw,[e.createVNode(Nr,{class:"h-4 w-4"})]),P[5]||(P[5]=e.createElementVNode("span",{class:"sr-only"},"Закрити",-1))])]),e.createElementVNode("div",Aw,[Object.keys(k.value).length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Object.entries(k.value),([I,O])=>(e.openBlock(),e.createBlock(jt,e.mergeProps({key:I},{ref_for:!0},{...O,layout:"inline"},{width:U.width?U.width:O==null?void 0:O.width,class:[U.itemClass,O==null?void 0:O.class],"item-class":[U.itemClass,O==null?void 0:O.itemClass].filter(Boolean).join(" ")||void 0,cleanable:!0,modelValue:e.unref(i)[I],"onUpdate:modelValue":F=>e.unref(i)[I]=F,onChange:P[0]||(P[0]=F=>e.unref(u)(F.name,F.value)),onClear:P[1]||(P[1]=F=>{e.unref(d)(F),e.unref(u)(F,void 0)})}),null,16,["width","class","item-class","modelValue","onUpdate:modelValue"]))),128)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),(I,O)=>{var F,H;return e.openBlock(),e.createBlock(jt,e.mergeProps({key:"slot-"+O,ref_for:!0},{...I.props,layout:"inline"},{class:[U.itemClass,(F=I.props)==null?void 0:F.class],"item-class":[U.itemClass,(H=I.props)==null?void 0:H.itemClass].filter(Boolean).join(" ")||void 0,cleanable:!0,modelValue:e.unref(i)[I.props.name],"onUpdate:modelValue":Q=>e.unref(i)[I.props.name]=Q,onChange:P[2]||(P[2]=Q=>e.unref(u)(Q.name,Q.value)),onClear:P[3]||(P[3]=Q=>{e.unref(d)(Q),e.unref(u)(Q,void 0)})}),null,16,["class","item-class","modelValue","onUpdate:modelValue"])}),128))]),e.unref(c)>0?(e.openBlock(),e.createElementBlock("div",Mw,[e.createElementVNode("button",{type:"button",class:e.normalizeClass([U.itemClass,"text-sm font-semibold text-blue-600 transition-colors hover:text-blue-700 focus:outline-none"]),onClick:M},e.toDisplayString(e.unref(a)("filter.clear")),3)])):e.createCommentVNode("",!0)])],6)):e.createCommentVNode("",!0)]))],512))}}),$w={class:"mb-6 flex flex-wrap gap-2"},Lw=["onClick"],Fw={class:"mr-2 flex items-center gap-1"},Iw={class:"font-semibold"},Ow={class:"text-xs text-gray-500"},Sr=e.defineComponent({__name:"filter",props:{schema:{},view:{default:"inline"},value:{},history:{type:Boolean},mode:{},limit:{default:3},width:{},title:{},disabled:{type:Boolean},defaultPanelWidth:{},itemClass:{},teleportActive:{}},emits:["change","clear","clearAll"],setup(l,{expose:t,emit:a}){const r=l,n=e.useAttrs(),o=e.computed(()=>({...r,...n})),s=e.ref(d(r.value??{}));e.watch(()=>r.value,async C=>{var B,M;s.value=d(C??{}),(!C||Object.keys(C).length===0)&&(await e.nextTick(),(M=(B=c.value)==null?void 0:B.clearAllFilters)==null||M.call(B,!0))},{deep:!0,immediate:!0});const i=a,c=e.ref(),u=e.useSlots();function d(C){if(Array.isArray(C))return C.map(B=>d(B));if(C!==null&&typeof C=="object"){const B=e.toRaw(C),M={};for(const U in B)M[U]=d(B[U]);return M}return C}function p(C,B){B!==void 0?s.value={...s.value,[C]:B}:delete s.value[C],i("change",{data:d(s.value),name:C,value:d(B)})}function m(C){delete s.value[C],i("clear",{data:d(s.value),name:C}),i("change",{data:d(s.value),name:C,value:null})}function f(){s.value={},i("clear",{data:d(s.value),name:"ALL"}),i("change",{data:d(s.value),name:"ALL",value:null})}const g=e.ref({}),y=e.computed(()=>r.teleportActive);function w(){switch(r.view){case"inline":return Ho;case"vertical":return _w;case"popover":return zo;case"popover-inline":return Tw;default:return Ho}}e.watch(()=>r.schema,C=>{if(!C){g.value={};return}if(Array.isArray(C)&&!C.length){g.value={};return}Array.isArray(C)?g.value=C.filter(B=>B.type).reduce((B,M)=>(Object.assign(M,{name:M.id||M.name,type:{datepicker:"date"}[M.type.toLowerCase()]||M.type.toLowerCase(),label:M.label||M.ua}),B[M.name]=M,M.data&&!M.api&&!M.options&&Object.assign(M,{api:`/api/suggest/${M.data}`}),B),{}):(Object.entries(C).forEach(([B,M])=>{Object.assign(M,{name:B||M.name||M.id,type:M.type.toLowerCase()})}),g.value={...C})},{immediate:!0,deep:!0});function h(C){c.value.clearFilter(C),m(C)}function k(){c.value.clearAllFilters(),f()}const x=e.computed(()=>Object.entries(s.value).filter(([,C])=>C==null?!1:Array.isArray(C)?C.length>0:typeof C=="string"?C.trim().length>0:!0).map(([C,B])=>{const M=g.value[C],U=(M==null?void 0:M.label)||(M==null?void 0:M.title)||C,P=_(M,B);return{key:C,label:U,value:P}}));function b(C){h(C)}function _(C,B){if(!C||B===void 0||B===null)return"";const M=V(B);if(!M.length)return"";const U=E(C);return M.map(P=>U.get(P)??P).filter(Boolean).join(", ")}function V(C){return Array.isArray(C)?C.map(B=>{var M;return((M=B==null?void 0:B.toString)==null?void 0:M.call(B))??""}).filter(Boolean):typeof C=="string"?C.split(",").map(B=>B.trim()).filter(Boolean):[]}function E(C){const B=new Map,M=C.valueKey||"id",U=C.labelKey||"text";return(C.options??[]).forEach(P=>{const I=D(P,M),O=$(P,U);I&&B.set(I,O||I)}),B}function D(C,B){var M,U;return C?((U=(M=C[B]??C.id??C.value??C.key)==null?void 0:M.toString)==null?void 0:U.call(M))??"":""}function $(C,B){var M,U;return C?((U=(M=C[B]??C.text??C.label??C.value??C.id)==null?void 0:M.toString)==null?void 0:U.call(M))??"":""}return e.watch(()=>s.value,C=>{if(r.history){const B=new URL(window.location.href),M=new URLSearchParams(window.location.search);Object.keys(C).length>0?M.set("filter",Object.entries(C).filter(([,U])=>U).map(([U,P])=>`${U}=${P}`).join("|")):M.delete("filter"),B.search=decodeURI(M.toString()),window.history.pushState({},"",B)}}),t({clearAllFilters:k,clearFilter:h}),(C,B)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(w()),e.mergeProps(o.value,{schema:g.value,onChange:B[0]||(B[0]=M=>p(M.name,M.value)),onClear:B[1]||(B[1]=M=>m(M.name)),onClearAll:f,ref_key:"filterRef",ref:c}),e.createSlots({default:e.withCtx(()=>[e.renderSlot(C.$slots,"default")]),_:2},[e.unref(u).trigger?{name:"trigger",fn:e.withCtx(M=>[e.renderSlot(C.$slots,"trigger",e.normalizeProps(e.guardReactiveProps(M)))]),key:"0"}:void 0]),1040,["schema"])),y.value&&x.value.length?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:y.value},[e.createElementVNode("div",$w,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,M=>(e.openBlock(),e.createElementBlock("button",{key:M.key,type:"button",class:"ga1u8 zw1wr sr4j9 flex items-center zu875 kew0r w9dei w4xo0 kghwt wz1vo focus:outline-hidden gugmw dark:bg-emerald-500 dark:hover:bg-emerald-600 dark:focus:bg-emerald-600 bg-white border border-gray-200 px-3 py-1 rounded-full text-sm text-gray-700",onClick:U=>b(M.key)},[e.createElementVNode("span",Fw,[e.createElementVNode("span",Iw,e.toDisplayString(M.label),1),e.createElementVNode("span",Ow,"· "+e.toDisplayString(M.value),1)]),B[2]||(B[2]=e.createElementVNode("span",{class:"g424j flex flex-col jkwm1 items-center b9gop aqyoh ad7q2 kghwt t4363 q7nhl dark:text-emerald-500"},[e.createElementVNode("svg",{class:"e731n u28hb",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M18 6 6 18"}),e.createElementVNode("path",{d:"m6 6 12 12"})])],-1))],8,Lw))),128))])],8,["to"])):e.createCommentVNode("",!0)],64))}});Sr.install=function(l){l.component("Filter",Sr),l.component("FilterField",jt)};const Pw={class:"flex items-center space-x-1 mb-4"},Rw=["onClick"],jw={key:1,class:"flex gap-x-1 items-center px-2 py-1 rounded text-sm font-medium text-slate-700 dark:text-slate-300"},Ko=e.defineComponent({__name:"CollectionsBreadcrumb",props:{items:{}},emits:["navigate"],setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",Pw,[e.createElementVNode("button",{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 hover:bg-blue-100 dark:hover:bg-blue-900/30",onClick:a[0]||(a[0]=r=>t.$emit("navigate","collections"))},[e.createVNode(e.unref(hl),{class:"w-3 h-3"}),e.createTextVNode(" "+e.toDisplayString(t.$t("navigation.collections")),1)]),l.items.length>0?(e.openBlock(),e.createBlock(e.unref(ml),{key:0,class:"w-3 h-3 text-slate-400 dark:text-slate-500"})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.items,(r,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[n<l.items.length-1?(e.openBlock(),e.createElementBlock("button",{key:0,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 hover:bg-blue-100 dark:hover:bg-blue-900/30",onClick:o=>t.$emit("navigate",r.route)},e.toDisplayString(r.label),9,Rw)):(e.openBlock(),e.createElementBlock("span",jw,e.toDisplayString(r.label),1)),n<l.items.length-1?(e.openBlock(),e.createBlock(e.unref(ml),{key:2,class:"w-3 h-3 text-slate-400 dark:text-slate-500"})):e.createCommentVNode("",!0)],64))),128))]))}}),Uw={class:"space-y-6 max-w-7xl mx-auto"},zw={class:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between"},Hw={class:"flex items-center gap-2"},Kw={class:"text-3xl font-bold text-slate-800 dark:text-white mb-2"},qw=["href","title"],Gw={key:0,class:"text-card-foreground shadow-lg border-0 bg-white/80 dark:bg-slate-800/80 backdrop-blur-sm"},Ww={key:0,class:"p-2 border-b border-gray-200 sm:px-4 sm:py-2 dark:border-gray-700"},Yw={class:"flex flex-col gap-4 sm:flex-row"},Xw={class:"relative flex items-center gap-2 ml-auto"},Zw={key:1,class:"absolute top-full right-1/2 translate-x-1/2 min-w-full p-4 z-10 bg-white border border-gray-300 rounded-md mt-2 dark:bg-slate-800 dark:border-slate-700"},Qw={class:"max-h-60 overflow-y-auto overflow-x-hidden"},Jw={key:1},qo=e.defineComponent({__name:"ArticlesPage",setup(l){const t=dt.useRoute(),a=dt.useRouter(),r=e.ref(null),n=e.ref(""),{t:o,locale:s}=Re(),i=e.ref([]),c=e.inject("menu")||[],u=e.ref(""),d=e.ref(1),p=e.ref(!1),m=e.ref(["title","slug","author","publish_at","published_at","status"]),f=e.ref([]),g=e.ref([]),y=e.ref([]),w=e.ref({}),h=e.ref(0),k=e.ref(!1),x=()=>{var O;let I=(O=r.value)==null?void 0:O.columns.filter(F=>{var H;return(H=m==null?void 0:m.value)==null?void 0:H.includes(F.name)});f.value=I.map(F=>{switch(F.name){case"title":return{...F,title:F.name?F.name.charAt(0).toUpperCase()+F.name.slice(1):"--",icon:vl};case"slug":return{...F,title:F.name?F.name.charAt(0).toUpperCase()+F.name.slice(1):"-",icon:ai};case"author":return{...F,title:F.name?F.name.charAt(0).toUpperCase()+F.name.slice(1):"-",icon:oi};case"publish_at":return{...F,title:F.name?F.name.charAt(0).toUpperCase()+F.name.slice(1):"-",icon:Ra};case"published_at":return{...F,title:F.name?F.name.charAt(0).toUpperCase()+F.name.slice(1):"-",icon:Ra};default:return{...F,title:F.name?F.name.charAt(0).toUpperCase()+F.name.slice(1):"-"}}}),p.value=!1},b=e.computed(()=>{var I,O;return(O=(I=c.value)==null?void 0:I.find(F=>F.id===t.params.id))==null?void 0:O.title}),_=e.computed(()=>[{label:b.value||t.params.id,route:`collections/${t.params.id}`}]),V=I=>{I==="collections"?a.push("/collections"):a.push(`/${I}`)},E=()=>{a.push(`/collections/${t.params.id}/create`)},D=async I=>{console.log("handleRemoveArticle"),br({title:o("builder.deleteTitle"),message:o("builder.deleteObject"),type:"error",onConfirm:async()=>{await fetch(`/api/cms/${t.params.id}/${I.id}`,{method:"DELETE"}),C()}})},$=I=>{a.push(`/collections/${t.params.id}/${I.id}`)},C=async()=>{if(!k.value){k.value=!0;try{const O=await(await fetch(`/api/cms/${t.params.id}?page=${d.value}&filter=${u.value}`)).json();i.value=O.rows||[],r.value=O;const F=(O.filters||[]).map(H=>{const{extra:Q,title:pe,...Ve}=H;return Ve});y.value=F,t.params.id==="pages"&&m.value.push("type"),B(),x()}finally{k.value=!1}}},B=()=>{var O;if(!((O=r.value)!=null&&O.columns))return;const I=r.value.columns.map((F,H)=>({text:F.label,id:F.name}));g.value=[...m.value.map(F=>I.find(H=>H.id===F)).filter(Boolean),...I.filter(F=>!m.value.includes(F.id))]},M=(I,O)=>{if(!O)return!0;const F=O.toLowerCase();return f.value.some(H=>{const Q=I[H.name];return Q&&Q.toString().toLowerCase().includes(F)})},U=I=>{const O=Object.entries(I==null?void 0:I.data).filter(([,H])=>H!=null).map(([H,Q])=>`${H}=${Q}`).join("|");u.value=O;const F={...t.query};O?F.filter=O:delete F.filter,a.replace({query:F})},P=()=>{if(t.query.filter){u.value=t.query.filter;const I=t.query.filter.split("|"),O={};I.forEach(F=>{const[H,Q]=F.split("=");H&&Q&&(O[H]=Q)}),w.value=O}else u.value="",w.value={},h.value++};return e.onMounted(()=>{P(),C()}),e.watch(()=>t.params.id,()=>{w.value={},u.value="",y.value=[];const I={...t.query};delete I.filter,a.replace({query:I}),h.value++,P(),C()}),e.watch(()=>t.query,async()=>{P(),await e.nextTick(),C()},{deep:!0}),e.watch(d,async()=>{t.query.filter||(u.value="",w.value={},h.value++),await e.nextTick(),C()}),(I,O)=>{var F,H,Q;return e.openBlock(),e.createElementBlock("div",Uw,[e.createVNode(Ko,{items:_.value,onNavigate:V},null,8,["items"]),e.createElementVNode("div",zw,[e.createElementVNode("div",Hw,[e.createElementVNode("h1",Kw,e.toDisplayString(b.value),1),e.createElementVNode("a",{href:`https://cms.opengis.info/${e.unref(s)}/guides/content/`,target:"_blank",title:I.$t("guide.content")},[e.createVNode(e.unref(fl),{class:"w-5 h-5"})],8,qw)]),i.value.length?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:E,class:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium h-9 px-4 py-2 bg-blue-600 text-white shadow-md transition-all duration-200 transform hover:bg-blue-700 hover:shadow-lg hover:scale-105 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"},[e.createVNode(e.unref(gl),{class:"w-4 h-4 mr-2"}),e.createTextVNode(" "+e.toDisplayString(I.$t("articles.createArticle")),1)])):e.createCommentVNode("",!0)]),i.value.length||u.value.length?(e.openBlock(),e.createElementBlock("div",Gw,[(e.openBlock(),e.createElementBlock("div",Ww,[e.createElementVNode("div",Yw,[(e.openBlock(),e.createBlock(e.unref(Sr),{key:h.value,schema:y.value,history:!0,value:w.value,view:"inline",onChange:U},null,8,["schema","value"])),e.createElementVNode("div",Xw,[g.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"flex items-center gap-2 cursor-pointer text-sm border border-gray-300 rounded-md p-2 dark:text-white",onClick:O[0]||(O[0]=pe=>p.value=!p.value)},[e.createElementVNode("p",null,e.toDisplayString(I.$t("articles.showColumns")),1),e.createVNode(e.unref(an),{class:"w-4 h-4"})])):e.createCommentVNode("",!0),g.value.length>0&&p.value?(e.openBlock(),e.createElementBlock("div",Zw,[e.createElementVNode("div",Qw,[g.value.length>0&&p.value?(e.openBlock(),e.createBlock(e.unref(ko),{key:0,options:g.value,modelValue:m.value,"onUpdate:modelValue":O[1]||(O[1]=pe=>m.value=pe)},null,8,["options","modelValue"])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{class:"text-sm bg-blue-600 text-white rounded-md p-2 mt-4 w-full",onClick:x},e.toDisplayString(I.$t("articles.update")),1)])):e.createCommentVNode("",!0)])])])),f.value.length>0?(e.openBlock(),e.createBlock(mo,{key:1,class:"max-h-[calc(100vh-270px)] overflow-y-auto",rows:i.value,columns:f.value,query:n.value,filterFn:M,onDelete:D,onEdit:$},null,8,["rows","columns","query"])):e.createCommentVNode("",!0),((F=r.value)==null?void 0:F.total)>20?(e.openBlock(),e.createBlock(fo,{key:2,total:(H=r.value)==null?void 0:H.filtered,count:(Q=r.value)==null?void 0:Q.count,page:d.value,"onUpdate:page":O[2]||(O[2]=pe=>d.value=pe),limit:20},null,8,["total","count","page"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Jw,[e.createVNode(po,{onAction:E})]))])}}}),e2={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},t2={__name:"CreateForm",setup(l){const t=e.inject("fetchContentTypes"),{t:a}=Re(),r=dt.useRouter(),n=e.ref({}),o=e.ref(!1),s=e.ref({type:"collection"}),i={name:{type:"text",label:a("builder.scheme.name.label"),required:!0,placeholder:a("builder.scheme.name.placeholder"),validators:["required"]},title:{type:"text",label:a("builder.scheme.title.label"),required:!0,placeholder:a("builder.scheme.title.placeholder"),validators:["required"]},type:{type:"combobox",mode:"combo",label:a("builder.scheme.type.label"),required:!0,placeholder:a("builder.scheme.type.placeholder"),validators:["required"],options:[{text:a("builder.scheme.type.options.collection"),id:"collection"},{text:a("builder.scheme.type.options.single"),id:"single"}]},customTable:{type:"switcher",label:a("builder.scheme.customTable.label")}},c=async()=>{if(await n.value.validate()){xe({type:"warning",title:a("common.actions.warning"),message:a("collections.collectionCreationFailed")});return}try{const p=await(await fetch("/api/cms-type",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s.value)})).json();r.push(`/settings/collections/edit/${p.id}`),t(),xe({type:"success",title:a("common.actions.success"),message:a("collections.collectionCreated")})}catch(d){xe({type:"error",title:a("common.actions.error"),message:a("collections.collectionCreationFailed")}),console.error(d)}};return(u,d)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{onClick:d[0]||(d[0]=p=>o.value=!0),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 h-9 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white shadow-md hover:shadow-lg transition-all duration-200 transform hover:scale-105"},[e.createVNode(e.unref(gl),{class:"w-4 h-4 mr-2"}),e.createTextVNode(" "+e.toDisplayString(u.$t("collections.createCollection")),1)]),e.createVNode(e.unref(xl),{teleport:"#modal",visible:o.value,title:u.$t("collections.createCollection"),onClose:d[4]||(d[4]=p=>o.value=!1)},{footer:e.withCtx(()=>[e.createElementVNode("div",e2,[e.createElementVNode("button",{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",onClick:d[3]||(d[3]=p=>o.value=!1)},e.toDisplayString(u.$t("common.actions.cancel")),1),e.createElementVNode("button",{onClick:c,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"},e.toDisplayString(u.$t("common.actions.save")),1)])]),default:e.withCtx(()=>[e.createVNode(e.unref(mt),{form:n.value,"onUpdate:form":d[1]||(d[1]=p=>n.value=p),modelValue:s.value,"onUpdate:modelValue":d[2]||(d[2]=p=>s.value=p),schema:i},null,8,["form","modelValue"])]),_:1},8,["visible","title"])]))}};let l2;function a2(){return l2}e.version[0];function r2(l){return typeof l=="function"?l():e.unref(l)}function Dr(l){if(l instanceof Promise||l instanceof Date||l instanceof RegExp)return l;const t=r2(l);if(!l||!t)return t;if(Array.isArray(t))return t.map(a=>Dr(a));if(typeof t=="object"){const a={};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(r==="titleTemplate"||r[0]==="o"&&r[1]==="n"){a[r]=e.unref(t[r]);continue}a[r]=Dr(t[r])}return a}return t}const n2="usehead",Go=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Wo="__unhead_injection_handler__";function o2(){if(Wo in Go)return Go[Wo]();const l=e.inject(n2);return!l&&process.env.NODE_ENV!=="production"&&console.warn("Unhead is missing Vue context, falling back to shared context. This may have unexpected results."),l||a2()}function s2(l,t={}){const a=t.head||o2();if(a)return a.ssr?a.push(l,t):i2(a,l,t)}function i2(l,t,a={}){const r=e.ref(!1),n=e.ref({});e.watchEffect(()=>{n.value=r.value?{}:Dr(t)});const o=l.push(n.value,a);return e.watch(n,i=>{o.patch(i)}),e.getCurrentInstance()&&(e.onBeforeUnmount(()=>{o.dispose()}),e.onDeactivated(()=>{r.value=!0}),e.onActivated(()=>{r.value=!1})),o}function c2(l,t=300){const a=e.ref(l.value);let r;return e.watch(l,n=>{clearTimeout(r),r=setTimeout(()=>{a.value=n},t)},{immediate:!0}),a}const Jt=(l,t)=>{const a=l.__vccOpts||l;for(const[r,n]of t)a[r]=n;return a},d2={},u2={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"};function p2(l,t){return e.openBlock(),e.createElementBlock("svg",u2,[...t[0]||(t[0]=[e.createStaticVNode('<line x1="8" x2="21" y1="6" y2="6"></line><line x1="8" x2="21" y1="12" y2="12"></line><line x1="8" x2="21" y1="18" y2="18"></line><line x1="3" x2="3.01" y1="6" y2="6"></line><line x1="3" x2="3.01" y1="12" y2="12"></line><line x1="3" x2="3.01" y1="18" y2="18"></line>',6)])])}const m2=Jt(d2,[["render",p2]]),f2={},h2={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function g2(l,t){return e.openBlock(),e.createElementBlock("svg",h2,[...t[0]||(t[0]=[e.createStaticVNode('<rect width="18" height="18" x="3" y="3" rx="2"></rect><path d="M3 9h18"></path><path d="M3 15h18"></path><path d="M9 3v18"></path><path d="M15 3v18"></path>',5)])])}const y2=Jt(f2,[["render",g2]]),b2={class:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6 pb-6"},k2={class:"flex items-center gap-2 space-y-1.5 p-6 border-b border-slate-200 dark:border-slate-700 bg-gradient-to-r from-slate-50 dark:from-slate-800 to-white dark:to-slate-800"},x2={class:"line-clamp-1 tracking-tight text-lg font-semibold text-slate-800 dark:text-slate-100 vertical-center"},w2={class:"w-full flex flex-col gap-2 p-6"},E2=["title"],_2={class:"flex items-center justify-between gap-2"},V2={class:"text-sm text-slate-600 dark:text-slate-400"},C2={class:"font-semibold text-slate-800 dark:text-slate-100"},N2={class:"flex items-center justify-between gap-2"},B2={class:"text-sm text-slate-500 dark:text-slate-400"},v2={class:"font-semibold text-slate-800 dark:text-slate-100"},S2={class:"flex items-center justify-between gap-2"},D2={class:"text-sm text-slate-500 dark:text-slate-400"},A2={class:"text-sm text-slate-600 dark:text-slate-300"},M2={class:"flex items-center justify-between gap-2 mt-6"},T2=["onClick"],$2={class:"text-slate-800 dark:text-slate-200 group-hover:text-green-600 dark:group-hover:text-blue-50"},L2=["onClick"],F2=["onClick"],I2=e.defineComponent({__name:"CollectionsGrid",props:{collections:{},onEdit:{type:Function},onView:{type:Function},onDelete:{type:Function}},emits:["edit","view","delete"],setup(l,{emit:t}){e.ref(!1),e.ref(null);const a=l,r=t,n=(i,c)=>{switch(i){case"edit":r("edit",c),a.onEdit&&a.onEdit(c);break;case"view":r("view",c),a.onView&&a.onView(c);break;case"delete":r("delete",c),a.onDelete&&a.onDelete(c);break}},o=i=>{const c=new Date,u=new Date(i),d=c.getTime()-u.getTime(),p=Math.floor(d/1e3),m=Math.floor(p/60),f=Math.floor(m/60),g=Math.floor(f/24),y=Math.floor(g/7);return y>=2?`${y} weeks ago`:y===1?"1 week ago":g>=2?`${g} days ago`:g===1?"1 day ago":f>=2?`${f} hours ago`:f===1?"1 hour ago":m>=2?`${m} minutes ago`:m===1?"1 minute ago":"just now"},s=i=>{switch(i){case"published":return{icon:ln,text:"Published",classes:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-200 border-green-200 dark:border-green-700"};case"draft":return{icon:Sl,text:"Draft",classes:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-200 border-yellow-200 dark:border-yellow-700"};case"archived":return{icon:sn,text:"Archived",classes:"bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-300 border-gray-200 dark:border-gray-700"};default:return{icon:fl,text:"--",classes:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-200 border-yellow-200 dark:border-yellow-700"}}};return(i,c)=>(e.openBlock(),e.createElementBlock("div",b2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.collections,u=>{var d,p,m;return e.openBlock(),e.createElementBlock("div",{key:u.id,class:"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:bg-slate-50"},[e.createElementVNode("div",k2,[u.type==="single"?(e.openBlock(),e.createBlock(e.unref(ea),{key:0,class:"shrink-0 lucide lucide-page w-5 h-5 text-blue-600"})):(e.openBlock(),e.createBlock(e.unref(hl),{key:1,class:"shrink-0 lucide lucide-layers w-5 h-5 text-blue-600"})),e.createElementVNode("p",x2,e.toDisplayString(u.title),1),s(u.status)?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["whitespace-nowrap rounded-md border ml-auto px-2.5 py-0.5 text-xs font-semibold transition-colors hover:bg-secondary/80 flex items-center w-fit bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-300 dark:border-green-700",(d=s(u.status))==null?void 0:d.classes])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent((p=s(u.status))==null?void 0:p.icon),{class:"w-3 h-3 mr-1"})),e.createTextVNode(" "+e.toDisplayString((m=s(u.status))==null?void 0:m.text),1)],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",w2,[e.createElementVNode("p",{class:"text-slate-600 dark:text-slate-300 mb-4 line-clamp-2",title:u.description},e.toDisplayString(u.description!==null?u.description:"No description"),9,E2),e.createElementVNode("div",_2,[e.createElementVNode("p",V2,e.toDisplayString(i.$t("collections.entries"))+":",1),e.createElementVNode("p",C2,e.toDisplayString(u.entries),1)]),e.createElementVNode("div",N2,[e.createElementVNode("p",B2,e.toDisplayString(i.$t("collections.fields"))+":",1),e.createElementVNode("p",v2,e.toDisplayString(u.fields),1)]),e.createElementVNode("div",S2,[e.createElementVNode("p",D2,e.toDisplayString(i.$t("collections.lastModified"))+":",1),e.createElementVNode("p",A2,e.toDisplayString(o(u.last_edit)),1)]),e.createElementVNode("div",M2,[e.renderSlot(i.$slots,"actions",{collection:u,handleAction:n},()=>[e.createElementVNode("button",{class:"inline-flex gap-1 items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-4/5 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-green-50 hover:border-green-300",onClick:e.withModifiers(f=>n("edit",u),["stop"])},[e.createVNode(e.unref(Sl),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-green-600 dark:group-hover:text-blue-50"}),e.createElementVNode("span",$2,e.toDisplayString(i.$t("common.actions.edit")),1)],8,T2),e.createElementVNode("button",{class:e.normalizeClass([u.id==="pages"?"disabled":"","inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-red-50 hover:border-red-300"]),onClick:e.withModifiers(f=>u.id==="pages"?null:n("delete",u),["stop"])},[e.createVNode(e.unref(qt),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-red-600 dark:group-hover:text-blue-50"})],10,L2),e.createElementVNode("button",{class:e.normalizeClass([u.type==="single"?"disabled cursor-not-allowed":"","inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-blue-50 hover:border-blue-300"]),onClick:e.withModifiers(f=>u.type==="single"?null:n("view",u),["stop"])},[e.createVNode(e.unref(Ha),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-blue-600 dark:group-hover:text-blue-50"})],10,F2)])])])])}),128))]))}}),Ar=localStorage.getItem("collectionView"),ba=e.ref(Ar==="list"||Ar==="grid"?Ar:"list");e.watch(ba,l=>{localStorage.setItem("collectionView",l)});function O2(){ba.value=ba.value==="grid"?"list":"grid"}function P2(){return{collectionView:ba,toggleCollectionView:O2}}const R2={class:"space-y-6 max-w-7xl mx-auto"},j2={class:"flex items-center justify-between mb-8"},U2={class:"flex gap-4"},z2={class:"text-3xl font-bold text-slate-800 dark:text-slate-100 mb-2"},H2={class:"text-slate-600 dark:text-slate-300"},K2=["href","title"],q2={class:"flex items-center gap-3"},G2={class:"relative"},W2={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},Y2=["placeholder"],X2={class:"flex items-center bg-white dark:bg-slate-700 border border-slate-200 dark:border-slate-600 rounded-lg p-1 max-w-[fit-content]"},Z2=["onClick"],Q2=e.defineComponent({__name:"BuilderPage",setup(l){const{t,locale:a}=Re(),r=dt.useRouter(),n=[{name:"name",title:t("builder.collectionName"),type:"text",icon:hl},{name:"title",title:t("builder.title"),type:"text",icon:hl},{name:"description",title:t("common.description"),type:"text"},{name:"entries",title:t("builder.entries"),type:"number"},{name:"fields",title:t("builder.fields"),type:"number"},{name:"status",title:t("builder.status"),type:"text"},{name:"last_edit",title:t("builder.lastModified"),type:"date"}],o=e.ref(""),s=c2(o,300);s2({title:()=>t("collections.title")+" | CMS"});const i=e.ref([]),c=e.inject("fetchContentTypes"),u=e.ref(1),d=e.ref(16),p=e.ref(null),{collectionView:m}=P2();async function f(){try{const k=s.value?`&search=${encodeURIComponent(String(s.value))}`:"",x=`/api/cms-type?page=${u.value}&limit=${d.value}${k}`;console.log("Fetching collections with URL:",x);const b=await fetch(x);if(!b.ok)throw new Error("Failed to fetch collections");const _=await b.json();console.log("Collections fetched:",_),i.value=_.rows,p.value=_}catch(k){console.error("Error fetching collections:",k)}}e.onMounted(()=>{f()});const g=e.computed(()=>[...i.value].sort((x,b)=>x.id==="pages"?-1:b.id==="pages"?1:0)),y=async k=>{try{await fetch(`/api/cms-type/${k.id}`,{method:"DELETE"}),f(),c()}catch(x){console.error("Error deleting collection:",x)}},w=k=>{r.push(`/settings/collections/edit/${k.id||k.name}`)},h=k=>{k.type==="single"?r.push(`/collections/single/${k.name}`):r.push(`/collections/${k.name}`)};return e.watch(u,()=>{f()}),e.watch(s,k=>{console.log("Search query changed:",k),u.value=1,f()}),(k,x)=>{var b,_,V,E;return e.openBlock(),e.createElementBlock("div",R2,[e.createElementVNode("div",j2,[e.createElementVNode("div",U2,[e.createElementVNode("div",null,[e.createElementVNode("h1",z2,e.toDisplayString(k.$t("builder.collections")),1),e.createElementVNode("p",H2,e.toDisplayString(k.$t("builder.manageContentCollections")),1)]),e.createElementVNode("a",{href:`https://cms.opengis.info/${e.unref(a)}/guides/collections/`,target:"_blank",title:k.$t("guide.collections"),class:"mt-2"},[e.createVNode(e.unref(fl),{class:"w-5 h-5"})],8,K2)]),e.createElementVNode("div",q2,[e.createElementVNode("div",G2,[e.createElementVNode("div",W2,[e.createVNode(e.unref(qa),{class:"w-5 h-5 text-gray-400"})]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"block w-full py-2 pl-10 pr-3 leading-5 text-gray-900 placeholder-gray-500 transition-colors bg-white border border-gray-300 rounded-md dark:border-gray-600 dark:bg-gray-700 dark:placeholder-gray-400 focus:outline-none focus:ring-sky-500 focus:border-sky-500 dark:text-white sm:text-sm",placeholder:k.$t("builder.searchCollections"),"onUpdate:modelValue":x[0]||(x[0]=D=>o.value=D)},null,8,Y2),[[e.vModelText,o.value]])]),e.createElementVNode("div",X2,[e.createElementVNode("button",{class:e.normalizeClass(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors rounded-md text-xs h-8 w-8 p-0 hover:bg-blue-700 hover:text-white cursor-pointer",{"bg-blue-600 text-white":e.unref(m)==="list"}]),onClick:x[1]||(x[1]=D=>m.value="list")},[e.createVNode(m2,{class:"dark:text-blue-50 w-4 h-4"})],2),e.createElementVNode("button",{class:e.normalizeClass(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors rounded-md text-xs h-8 w-8 p-0 hover:bg-blue-700 hover:text-white cursor-pointer",{"bg-blue-600 text-white":e.unref(m)==="grid"}]),onClick:x[2]||(x[2]=D=>m.value="grid")},[e.createVNode(y2,{class:"dark:text-blue-50 w-4 h-4"})],2)]),e.createVNode(t2)])]),e.createElementVNode("div",null,[e.unref(m)==="list"?(e.openBlock(),e.createBlock(mo,{key:0,class:"max-h-[calc(100vh-270px)] overflow-y-auto overflow-x-hidden",columns:n,rows:g.value,onDelete:y,onEdit:w,onView:h},{actions:e.withCtx(({row:D})=>[e.createElementVNode("button",{class:"inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-blue-50 hover:border-blue-300 hover:text-blue-600",onClick:$=>h(D)},[e.createVNode(e.unref(Ha),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-blue-600 dark:group-hover:text-blue-50"})],8,Z2)]),_:1},8,["rows"])):e.createCommentVNode("",!0),e.unref(m)==="grid"?(e.openBlock(),e.createBlock(I2,{key:1,collections:g.value,onEdit:w,onView:h,onDelete:y,class:"max-h-[calc(100vh-270px)] overflow-y-auto overflow-x-hidden"},null,8,["collections"])):e.createCommentVNode("",!0),((b=p.value)==null?void 0:b.total)>16?(e.openBlock(),e.createBlock(fo,{key:2,total:(_=p.value)==null?void 0:_.filtered,count:((V=p.value)==null?void 0:V.count)||((E=p.value)==null?void 0:E.total),page:u.value,"onUpdate:page":x[3]||(x[3]=D=>u.value=D),limit:d.value},null,8,["total","count","page","limit"])):e.createCommentVNode("",!0)])])}}}),J2=[{key:"title",label:"common.title",localization:!0,type:"text"},{key:"description",label:"common.description",localization:!0,type:"text"},{key:"keywords",label:"common.keywords",localization:!0,type:"text"},{key:"meta",label:"common.meta",type:"key-value",ignore:["title","description","keywords"]}];/**!
|
|
191
|
+
* Sortable 1.14.0
|
|
192
|
+
* @author RubaXa <trash@rubaxa.org>
|
|
193
|
+
* @author owenm <owen23355@gmail.com>
|
|
194
|
+
* @license MIT
|
|
195
|
+
*/function Yo(l,t){var a=Object.keys(l);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(l);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(l,n).enumerable})),a.push.apply(a,r)}return a}function St(l){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?Yo(Object(a),!0).forEach(function(r){eE(l,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(a)):Yo(Object(a)).forEach(function(r){Object.defineProperty(l,r,Object.getOwnPropertyDescriptor(a,r))})}return l}function ka(l){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ka=function(t){return typeof t}:ka=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ka(l)}function eE(l,t,a){return t in l?Object.defineProperty(l,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):l[t]=a,l}function Ut(){return Ut=Object.assign||function(l){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(l[r]=a[r])}return l},Ut.apply(this,arguments)}function tE(l,t){if(l==null)return{};var a={},r=Object.keys(l),n,o;for(o=0;o<r.length;o++)n=r[o],!(t.indexOf(n)>=0)&&(a[n]=l[n]);return a}function lE(l,t){if(l==null)return{};var a=tE(l,t),r,n;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(l);for(n=0;n<o.length;n++)r=o[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(l,r)&&(a[r]=l[r])}return a}var aE="1.14.0";function zt(l){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(l)}var Ht=zt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Il=zt(/Edge/i),Xo=zt(/firefox/i),Ol=zt(/safari/i)&&!zt(/chrome/i)&&!zt(/android/i),Zo=zt(/iP(ad|od|hone)/i),rE=zt(/chrome/i)&&zt(/android/i),Qo={capture:!1,passive:!1};function Ne(l,t,a){l.addEventListener(t,a,!Ht&&Qo)}function we(l,t,a){l.removeEventListener(t,a,!Ht&&Qo)}function xa(l,t){if(t){if(t[0]===">"&&(t=t.substring(1)),l)try{if(l.matches)return l.matches(t);if(l.msMatchesSelector)return l.msMatchesSelector(t);if(l.webkitMatchesSelector)return l.webkitMatchesSelector(t)}catch{return!1}return!1}}function nE(l){return l.host&&l!==document&&l.host.nodeType?l.host:l.parentNode}function Dt(l,t,a,r){if(l){a=a||document;do{if(t!=null&&(t[0]===">"?l.parentNode===a&&xa(l,t):xa(l,t))||r&&l===a)return l;if(l===a)break}while(l=nE(l))}return null}var Jo=/\s+/g;function ft(l,t,a){if(l&&t)if(l.classList)l.classList[a?"add":"remove"](t);else{var r=(" "+l.className+" ").replace(Jo," ").replace(" "+t+" "," ");l.className=(r+(a?" "+t:"")).replace(Jo," ")}}function se(l,t,a){var r=l&&l.style;if(r){if(a===void 0)return document.defaultView&&document.defaultView.getComputedStyle?a=document.defaultView.getComputedStyle(l,""):l.currentStyle&&(a=l.currentStyle),t===void 0?a:a[t];!(t in r)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),r[t]=a+(typeof a=="string"?"":"px")}}function wl(l,t){var a="";if(typeof l=="string")a=l;else do{var r=se(l,"transform");r&&r!=="none"&&(a=r+" "+a)}while(!t&&(l=l.parentNode));var n=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return n&&new n(a)}function es(l,t,a){if(l){var r=l.getElementsByTagName(t),n=0,o=r.length;if(a)for(;n<o;n++)a(r[n],n);return r}return[]}function At(){var l=document.scrollingElement;return l||document.documentElement}function Ue(l,t,a,r,n){if(!(!l.getBoundingClientRect&&l!==window)){var o,s,i,c,u,d,p;if(l!==window&&l.parentNode&&l!==At()?(o=l.getBoundingClientRect(),s=o.top,i=o.left,c=o.bottom,u=o.right,d=o.height,p=o.width):(s=0,i=0,c=window.innerHeight,u=window.innerWidth,d=window.innerHeight,p=window.innerWidth),(t||a)&&l!==window&&(n=n||l.parentNode,!Ht))do if(n&&n.getBoundingClientRect&&(se(n,"transform")!=="none"||a&&se(n,"position")!=="static")){var m=n.getBoundingClientRect();s-=m.top+parseInt(se(n,"border-top-width")),i-=m.left+parseInt(se(n,"border-left-width")),c=s+o.height,u=i+o.width;break}while(n=n.parentNode);if(r&&l!==window){var f=wl(n||l),g=f&&f.a,y=f&&f.d;f&&(s/=y,i/=g,p/=g,d/=y,c=s+d,u=i+p)}return{top:s,left:i,bottom:c,right:u,width:p,height:d}}}function ts(l,t,a){for(var r=el(l,!0),n=Ue(l)[t];r;){var o=Ue(r)[a],s=void 0;if(s=n>=o,!s)return r;if(r===At())break;r=el(r,!1)}return!1}function El(l,t,a,r){for(var n=0,o=0,s=l.children;o<s.length;){if(s[o].style.display!=="none"&&s[o]!==ie.ghost&&(r||s[o]!==ie.dragged)&&Dt(s[o],a.draggable,l,!1)){if(n===t)return s[o];n++}o++}return null}function Mr(l,t){for(var a=l.lastElementChild;a&&(a===ie.ghost||se(a,"display")==="none"||t&&!xa(a,t));)a=a.previousElementSibling;return a||null}function xt(l,t){var a=0;if(!l||!l.parentNode)return-1;for(;l=l.previousElementSibling;)l.nodeName.toUpperCase()!=="TEMPLATE"&&l!==ie.clone&&(!t||xa(l,t))&&a++;return a}function ls(l){var t=0,a=0,r=At();if(l)do{var n=wl(l),o=n.a,s=n.d;t+=l.scrollLeft*o,a+=l.scrollTop*s}while(l!==r&&(l=l.parentNode));return[t,a]}function oE(l,t){for(var a in l)if(l.hasOwnProperty(a)){for(var r in t)if(t.hasOwnProperty(r)&&t[r]===l[a][r])return Number(a)}return-1}function el(l,t){if(!l||!l.getBoundingClientRect)return At();var a=l,r=!1;do if(a.clientWidth<a.scrollWidth||a.clientHeight<a.scrollHeight){var n=se(a);if(a.clientWidth<a.scrollWidth&&(n.overflowX=="auto"||n.overflowX=="scroll")||a.clientHeight<a.scrollHeight&&(n.overflowY=="auto"||n.overflowY=="scroll")){if(!a.getBoundingClientRect||a===document.body)return At();if(r||t)return a;r=!0}}while(a=a.parentNode);return At()}function sE(l,t){if(l&&t)for(var a in t)t.hasOwnProperty(a)&&(l[a]=t[a]);return l}function Tr(l,t){return Math.round(l.top)===Math.round(t.top)&&Math.round(l.left)===Math.round(t.left)&&Math.round(l.height)===Math.round(t.height)&&Math.round(l.width)===Math.round(t.width)}var Pl;function as(l,t){return function(){if(!Pl){var a=arguments,r=this;a.length===1?l.call(r,a[0]):l.apply(r,a),Pl=setTimeout(function(){Pl=void 0},t)}}}function iE(){clearTimeout(Pl),Pl=void 0}function rs(l,t,a){l.scrollLeft+=t,l.scrollTop+=a}function ns(l){var t=window.Polymer,a=window.jQuery||window.Zepto;return t&&t.dom?t.dom(l).cloneNode(!0):a?a(l).clone(!0)[0]:l.cloneNode(!0)}var ht="Sortable"+new Date().getTime();function cE(){var l=[],t;return{captureAnimationState:function(){if(l=[],!!this.options.animation){var r=[].slice.call(this.el.children);r.forEach(function(n){if(!(se(n,"display")==="none"||n===ie.ghost)){l.push({target:n,rect:Ue(n)});var o=St({},l[l.length-1].rect);if(n.thisAnimationDuration){var s=wl(n,!0);s&&(o.top-=s.f,o.left-=s.e)}n.fromRect=o}})}},addAnimationState:function(r){l.push(r)},removeAnimationState:function(r){l.splice(oE(l,{target:r}),1)},animateAll:function(r){var n=this;if(!this.options.animation){clearTimeout(t),typeof r=="function"&&r();return}var o=!1,s=0;l.forEach(function(i){var c=0,u=i.target,d=u.fromRect,p=Ue(u),m=u.prevFromRect,f=u.prevToRect,g=i.rect,y=wl(u,!0);y&&(p.top-=y.f,p.left-=y.e),u.toRect=p,u.thisAnimationDuration&&Tr(m,p)&&!Tr(d,p)&&(g.top-p.top)/(g.left-p.left)===(d.top-p.top)/(d.left-p.left)&&(c=uE(g,m,f,n.options)),Tr(p,d)||(u.prevFromRect=d,u.prevToRect=p,c||(c=n.options.animation),n.animate(u,g,p,c)),c&&(o=!0,s=Math.max(s,c),clearTimeout(u.animationResetTimer),u.animationResetTimer=setTimeout(function(){u.animationTime=0,u.prevFromRect=null,u.fromRect=null,u.prevToRect=null,u.thisAnimationDuration=null},c),u.thisAnimationDuration=c)}),clearTimeout(t),o?t=setTimeout(function(){typeof r=="function"&&r()},s):typeof r=="function"&&r(),l=[]},animate:function(r,n,o,s){if(s){se(r,"transition",""),se(r,"transform","");var i=wl(this.el),c=i&&i.a,u=i&&i.d,d=(n.left-o.left)/(c||1),p=(n.top-o.top)/(u||1);r.animatingX=!!d,r.animatingY=!!p,se(r,"transform","translate3d("+d+"px,"+p+"px,0)"),this.forRepaintDummy=dE(r),se(r,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),se(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){se(r,"transition",""),se(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},s)}}}}function dE(l){return l.offsetWidth}function uE(l,t,a,r){return Math.sqrt(Math.pow(t.top-l.top,2)+Math.pow(t.left-l.left,2))/Math.sqrt(Math.pow(t.top-a.top,2)+Math.pow(t.left-a.left,2))*r.animation}var _l=[],$r={initializeByDefault:!0},Rl={mount:function(t){for(var a in $r)$r.hasOwnProperty(a)&&!(a in t)&&(t[a]=$r[a]);_l.forEach(function(r){if(r.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),_l.push(t)},pluginEvent:function(t,a,r){var n=this;this.eventCanceled=!1,r.cancel=function(){n.eventCanceled=!0};var o=t+"Global";_l.forEach(function(s){a[s.pluginName]&&(a[s.pluginName][o]&&a[s.pluginName][o](St({sortable:a},r)),a.options[s.pluginName]&&a[s.pluginName][t]&&a[s.pluginName][t](St({sortable:a},r)))})},initializePlugins:function(t,a,r,n){_l.forEach(function(i){var c=i.pluginName;if(!(!t.options[c]&&!i.initializeByDefault)){var u=new i(t,a,t.options);u.sortable=t,u.options=t.options,t[c]=u,Ut(r,u.defaults)}});for(var o in t.options)if(t.options.hasOwnProperty(o)){var s=this.modifyOption(t,o,t.options[o]);typeof s<"u"&&(t.options[o]=s)}},getEventProperties:function(t,a){var r={};return _l.forEach(function(n){typeof n.eventProperties=="function"&&Ut(r,n.eventProperties.call(a[n.pluginName],t))}),r},modifyOption:function(t,a,r){var n;return _l.forEach(function(o){t[o.pluginName]&&o.optionListeners&&typeof o.optionListeners[a]=="function"&&(n=o.optionListeners[a].call(t[o.pluginName],r))}),n}};function pE(l){var t=l.sortable,a=l.rootEl,r=l.name,n=l.targetEl,o=l.cloneEl,s=l.toEl,i=l.fromEl,c=l.oldIndex,u=l.newIndex,d=l.oldDraggableIndex,p=l.newDraggableIndex,m=l.originalEvent,f=l.putSortable,g=l.extraEventProperties;if(t=t||a&&a[ht],!!t){var y,w=t.options,h="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!Ht&&!Il?y=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(y=document.createEvent("Event"),y.initEvent(r,!0,!0)),y.to=s||a,y.from=i||a,y.item=n||a,y.clone=o,y.oldIndex=c,y.newIndex=u,y.oldDraggableIndex=d,y.newDraggableIndex=p,y.originalEvent=m,y.pullMode=f?f.lastPutMode:void 0;var k=St(St({},g),Rl.getEventProperties(r,t));for(var x in k)y[x]=k[x];a&&a.dispatchEvent(y),w[h]&&w[h].call(t,y)}}var mE=["evt"],st=function(t,a){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=r.evt,o=lE(r,mE);Rl.pluginEvent.bind(ie)(t,a,St({dragEl:Z,parentEl:Fe,ghostEl:me,rootEl:Te,nextEl:cl,lastDownEl:wa,cloneEl:Ie,cloneHidden:tl,dragStarted:Ul,putSortable:Ye,activeSortable:ie.active,originalEvent:n,oldIndex:Vl,oldDraggableIndex:jl,newIndex:gt,newDraggableIndex:ll,hideGhostForTarget:ps,unhideGhostForTarget:ms,cloneNowHidden:function(){tl=!0},cloneNowShown:function(){tl=!1},dispatchSortableEvent:function(i){lt({sortable:a,name:i,originalEvent:n})}},o))};function lt(l){pE(St({putSortable:Ye,cloneEl:Ie,targetEl:Z,rootEl:Te,oldIndex:Vl,oldDraggableIndex:jl,newIndex:gt,newDraggableIndex:ll},l))}var Z,Fe,me,Te,cl,wa,Ie,tl,Vl,gt,jl,ll,Ea,Ye,Cl=!1,_a=!1,Va=[],dl,Vt,Lr,Fr,os,ss,Ul,Nl,zl,Hl=!1,Ca=!1,Na,Je,Ir=[],Or=!1,Ba=[],va=typeof document<"u",Sa=Zo,is=Il||Ht?"cssFloat":"float",fE=va&&!rE&&!Zo&&"draggable"in document.createElement("div"),cs=function(){if(va){if(Ht)return!1;var l=document.createElement("x");return l.style.cssText="pointer-events:auto",l.style.pointerEvents==="auto"}}(),ds=function(t,a){var r=se(t),n=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),o=El(t,0,a),s=El(t,1,a),i=o&&se(o),c=s&&se(s),u=i&&parseInt(i.marginLeft)+parseInt(i.marginRight)+Ue(o).width,d=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+Ue(s).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&i.float&&i.float!=="none"){var p=i.float==="left"?"left":"right";return s&&(c.clear==="both"||c.clear===p)?"vertical":"horizontal"}return o&&(i.display==="block"||i.display==="flex"||i.display==="table"||i.display==="grid"||u>=n&&r[is]==="none"||s&&r[is]==="none"&&u+d>n)?"vertical":"horizontal"},hE=function(t,a,r){var n=r?t.left:t.top,o=r?t.right:t.bottom,s=r?t.width:t.height,i=r?a.left:a.top,c=r?a.right:a.bottom,u=r?a.width:a.height;return n===i||o===c||n+s/2===i+u/2},gE=function(t,a){var r;return Va.some(function(n){var o=n[ht].options.emptyInsertThreshold;if(!(!o||Mr(n))){var s=Ue(n),i=t>=s.left-o&&t<=s.right+o,c=a>=s.top-o&&a<=s.bottom+o;if(i&&c)return r=n}}),r},us=function(t){function a(o,s){return function(i,c,u,d){var p=i.options.group.name&&c.options.group.name&&i.options.group.name===c.options.group.name;if(o==null&&(s||p))return!0;if(o==null||o===!1)return!1;if(s&&o==="clone")return o;if(typeof o=="function")return a(o(i,c,u,d),s)(i,c,u,d);var m=(s?i:c).options.group.name;return o===!0||typeof o=="string"&&o===m||o.join&&o.indexOf(m)>-1}}var r={},n=t.group;(!n||ka(n)!="object")&&(n={name:n}),r.name=n.name,r.checkPull=a(n.pull,!0),r.checkPut=a(n.put),r.revertClone=n.revertClone,t.group=r},ps=function(){!cs&&me&&se(me,"display","none")},ms=function(){!cs&&me&&se(me,"display","")};va&&document.addEventListener("click",function(l){if(_a)return l.preventDefault(),l.stopPropagation&&l.stopPropagation(),l.stopImmediatePropagation&&l.stopImmediatePropagation(),_a=!1,!1},!0);var ul=function(t){if(Z){t=t.touches?t.touches[0]:t;var a=gE(t.clientX,t.clientY);if(a){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);r.target=r.rootEl=a,r.preventDefault=void 0,r.stopPropagation=void 0,a[ht]._onDragOver(r)}}},yE=function(t){Z&&Z.parentNode[ht]._isOutsideThisEl(t.target)};function ie(l,t){if(!(l&&l.nodeType&&l.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(l));this.el=l,this.options=t=Ut({},t),l[ht]=this;var a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(l.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return ds(l,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,i){s.setData("Text",i.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:ie.supportPointer!==!1&&"PointerEvent"in window&&!Ol,emptyInsertThreshold:5};Rl.initializePlugins(this,l,a);for(var r in a)!(r in t)&&(t[r]=a[r]);us(t);for(var n in this)n.charAt(0)==="_"&&typeof this[n]=="function"&&(this[n]=this[n].bind(this));this.nativeDraggable=t.forceFallback?!1:fE,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?Ne(l,"pointerdown",this._onTapStart):(Ne(l,"mousedown",this._onTapStart),Ne(l,"touchstart",this._onTapStart)),this.nativeDraggable&&(Ne(l,"dragover",this),Ne(l,"dragenter",this)),Va.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Ut(this,cE())}ie.prototype={constructor:ie,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Nl=null)},_getDirection:function(t,a){return typeof this.options.direction=="function"?this.options.direction.call(this,t,a,Z):this.options.direction},_onTapStart:function(t){if(t.cancelable){var a=this,r=this.el,n=this.options,o=n.preventOnFilter,s=t.type,i=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,c=(i||t).target,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||c,d=n.filter;if(CE(r),!Z&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||n.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&Ol&&c&&c.tagName.toUpperCase()==="SELECT")&&(c=Dt(c,n.draggable,r,!1),!(c&&c.animated)&&wa!==c)){if(Vl=xt(c),jl=xt(c,n.draggable),typeof d=="function"){if(d.call(this,t,c,this)){lt({sortable:a,rootEl:u,name:"filter",targetEl:c,toEl:r,fromEl:r}),st("filter",a,{evt:t}),o&&t.cancelable&&t.preventDefault();return}}else if(d&&(d=d.split(",").some(function(p){if(p=Dt(u,p.trim(),r,!1),p)return lt({sortable:a,rootEl:p,name:"filter",targetEl:c,fromEl:r,toEl:r}),st("filter",a,{evt:t}),!0}),d)){o&&t.cancelable&&t.preventDefault();return}n.handle&&!Dt(u,n.handle,r,!1)||this._prepareDragStart(t,i,c)}}},_prepareDragStart:function(t,a,r){var n=this,o=n.el,s=n.options,i=o.ownerDocument,c;if(r&&!Z&&r.parentNode===o){var u=Ue(r);if(Te=o,Z=r,Fe=Z.parentNode,cl=Z.nextSibling,wa=r,Ea=s.group,ie.dragged=Z,dl={target:Z,clientX:(a||t).clientX,clientY:(a||t).clientY},os=dl.clientX-u.left,ss=dl.clientY-u.top,this._lastX=(a||t).clientX,this._lastY=(a||t).clientY,Z.style["will-change"]="all",c=function(){if(st("delayEnded",n,{evt:t}),ie.eventCanceled){n._onDrop();return}n._disableDelayedDragEvents(),!Xo&&n.nativeDraggable&&(Z.draggable=!0),n._triggerDragStart(t,a),lt({sortable:n,name:"choose",originalEvent:t}),ft(Z,s.chosenClass,!0)},s.ignore.split(",").forEach(function(d){es(Z,d.trim(),Pr)}),Ne(i,"dragover",ul),Ne(i,"mousemove",ul),Ne(i,"touchmove",ul),Ne(i,"mouseup",n._onDrop),Ne(i,"touchend",n._onDrop),Ne(i,"touchcancel",n._onDrop),Xo&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Z.draggable=!0),st("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||a)&&(!this.nativeDraggable||!(Il||Ht))){if(ie.eventCanceled){this._onDrop();return}Ne(i,"mouseup",n._disableDelayedDrag),Ne(i,"touchend",n._disableDelayedDrag),Ne(i,"touchcancel",n._disableDelayedDrag),Ne(i,"mousemove",n._delayedDragTouchMoveHandler),Ne(i,"touchmove",n._delayedDragTouchMoveHandler),s.supportPointer&&Ne(i,"pointermove",n._delayedDragTouchMoveHandler),n._dragStartTimer=setTimeout(c,s.delay)}else c()}},_delayedDragTouchMoveHandler:function(t){var a=t.touches?t.touches[0]:t;Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Z&&Pr(Z),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;we(t,"mouseup",this._disableDelayedDrag),we(t,"touchend",this._disableDelayedDrag),we(t,"touchcancel",this._disableDelayedDrag),we(t,"mousemove",this._delayedDragTouchMoveHandler),we(t,"touchmove",this._delayedDragTouchMoveHandler),we(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,a){a=a||t.pointerType=="touch"&&t,!this.nativeDraggable||a?this.options.supportPointer?Ne(document,"pointermove",this._onTouchMove):a?Ne(document,"touchmove",this._onTouchMove):Ne(document,"mousemove",this._onTouchMove):(Ne(Z,"dragend",this),Ne(Te,"dragstart",this._onDragStart));try{document.selection?Aa(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,a){if(Cl=!1,Te&&Z){st("dragStarted",this,{evt:a}),this.nativeDraggable&&Ne(document,"dragover",yE);var r=this.options;!t&&ft(Z,r.dragClass,!1),ft(Z,r.ghostClass,!0),ie.active=this,t&&this._appendGhost(),lt({sortable:this,name:"start",originalEvent:a})}else this._nulling()},_emulateDragOver:function(){if(Vt){this._lastX=Vt.clientX,this._lastY=Vt.clientY,ps();for(var t=document.elementFromPoint(Vt.clientX,Vt.clientY),a=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Vt.clientX,Vt.clientY),t!==a);)a=t;if(Z.parentNode[ht]._isOutsideThisEl(t),a)do{if(a[ht]){var r=void 0;if(r=a[ht]._onDragOver({clientX:Vt.clientX,clientY:Vt.clientY,target:t,rootEl:a}),r&&!this.options.dragoverBubble)break}t=a}while(a=a.parentNode);ms()}},_onTouchMove:function(t){if(dl){var a=this.options,r=a.fallbackTolerance,n=a.fallbackOffset,o=t.touches?t.touches[0]:t,s=me&&wl(me,!0),i=me&&s&&s.a,c=me&&s&&s.d,u=Sa&&Je&&ls(Je),d=(o.clientX-dl.clientX+n.x)/(i||1)+(u?u[0]-Ir[0]:0)/(i||1),p=(o.clientY-dl.clientY+n.y)/(c||1)+(u?u[1]-Ir[1]:0)/(c||1);if(!ie.active&&!Cl){if(r&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<r)return;this._onDragStart(t,!0)}if(me){s?(s.e+=d-(Lr||0),s.f+=p-(Fr||0)):s={a:1,b:0,c:0,d:1,e:d,f:p};var m="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");se(me,"webkitTransform",m),se(me,"mozTransform",m),se(me,"msTransform",m),se(me,"transform",m),Lr=d,Fr=p,Vt=o}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!me){var t=this.options.fallbackOnBody?document.body:Te,a=Ue(Z,!0,Sa,!0,t),r=this.options;if(Sa){for(Je=t;se(Je,"position")==="static"&&se(Je,"transform")==="none"&&Je!==document;)Je=Je.parentNode;Je!==document.body&&Je!==document.documentElement?(Je===document&&(Je=At()),a.top+=Je.scrollTop,a.left+=Je.scrollLeft):Je=At(),Ir=ls(Je)}me=Z.cloneNode(!0),ft(me,r.ghostClass,!1),ft(me,r.fallbackClass,!0),ft(me,r.dragClass,!0),se(me,"transition",""),se(me,"transform",""),se(me,"box-sizing","border-box"),se(me,"margin",0),se(me,"top",a.top),se(me,"left",a.left),se(me,"width",a.width),se(me,"height",a.height),se(me,"opacity","0.8"),se(me,"position",Sa?"absolute":"fixed"),se(me,"zIndex","100000"),se(me,"pointerEvents","none"),ie.ghost=me,t.appendChild(me),se(me,"transform-origin",os/parseInt(me.style.width)*100+"% "+ss/parseInt(me.style.height)*100+"%")}},_onDragStart:function(t,a){var r=this,n=t.dataTransfer,o=r.options;if(st("dragStart",this,{evt:t}),ie.eventCanceled){this._onDrop();return}st("setupClone",this),ie.eventCanceled||(Ie=ns(Z),Ie.draggable=!1,Ie.style["will-change"]="",this._hideClone(),ft(Ie,this.options.chosenClass,!1),ie.clone=Ie),r.cloneId=Aa(function(){st("clone",r),!ie.eventCanceled&&(r.options.removeCloneOnHide||Te.insertBefore(Ie,Z),r._hideClone(),lt({sortable:r,name:"clone"}))}),!a&&ft(Z,o.dragClass,!0),a?(_a=!0,r._loopId=setInterval(r._emulateDragOver,50)):(we(document,"mouseup",r._onDrop),we(document,"touchend",r._onDrop),we(document,"touchcancel",r._onDrop),n&&(n.effectAllowed="move",o.setData&&o.setData.call(r,n,Z)),Ne(document,"drop",r),se(Z,"transform","translateZ(0)")),Cl=!0,r._dragStartId=Aa(r._dragStarted.bind(r,a,t)),Ne(document,"selectstart",r),Ul=!0,Ol&&se(document.body,"user-select","none")},_onDragOver:function(t){var a=this.el,r=t.target,n,o,s,i=this.options,c=i.group,u=ie.active,d=Ea===c,p=i.sort,m=Ye||u,f,g=this,y=!1;if(Or)return;function w(H,Q){st(H,g,St({evt:t,isOwner:d,axis:f?"vertical":"horizontal",revert:s,dragRect:n,targetRect:o,canSort:p,fromSortable:m,target:r,completed:k,onMove:function(Ve,ze){return Da(Te,a,Z,n,Ve,Ue(Ve),t,ze)},changed:x},Q))}function h(){w("dragOverAnimationCapture"),g.captureAnimationState(),g!==m&&m.captureAnimationState()}function k(H){return w("dragOverCompleted",{insertion:H}),H&&(d?u._hideClone():u._showClone(g),g!==m&&(ft(Z,Ye?Ye.options.ghostClass:u.options.ghostClass,!1),ft(Z,i.ghostClass,!0)),Ye!==g&&g!==ie.active?Ye=g:g===ie.active&&Ye&&(Ye=null),m===g&&(g._ignoreWhileAnimating=r),g.animateAll(function(){w("dragOverAnimationComplete"),g._ignoreWhileAnimating=null}),g!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(r===Z&&!Z.animated||r===a&&!r.animated)&&(Nl=null),!i.dragoverBubble&&!t.rootEl&&r!==document&&(Z.parentNode[ht]._isOutsideThisEl(t.target),!H&&ul(t)),!i.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),y=!0}function x(){gt=xt(Z),ll=xt(Z,i.draggable),lt({sortable:g,name:"change",toEl:a,newIndex:gt,newDraggableIndex:ll,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),r=Dt(r,i.draggable,a,!0),w("dragOver"),ie.eventCanceled)return y;if(Z.contains(t.target)||r.animated&&r.animatingX&&r.animatingY||g._ignoreWhileAnimating===r)return k(!1);if(_a=!1,u&&!i.disabled&&(d?p||(s=Fe!==Te):Ye===this||(this.lastPutMode=Ea.checkPull(this,u,Z,t))&&c.checkPut(this,u,Z,t))){if(f=this._getDirection(t,r)==="vertical",n=Ue(Z),w("dragOverValid"),ie.eventCanceled)return y;if(s)return Fe=Te,h(),this._hideClone(),w("revert"),ie.eventCanceled||(cl?Te.insertBefore(Z,cl):Te.appendChild(Z)),k(!0);var b=Mr(a,i.draggable);if(!b||wE(t,f,this)&&!b.animated){if(b===Z)return k(!1);if(b&&a===t.target&&(r=b),r&&(o=Ue(r)),Da(Te,a,Z,n,r,o,t,!!r)!==!1)return h(),a.appendChild(Z),Fe=a,x(),k(!0)}else if(b&&xE(t,f,this)){var _=El(a,0,i,!0);if(_===Z)return k(!1);if(r=_,o=Ue(r),Da(Te,a,Z,n,r,o,t,!1)!==!1)return h(),a.insertBefore(Z,_),Fe=a,x(),k(!0)}else if(r.parentNode===a){o=Ue(r);var V=0,E,D=Z.parentNode!==a,$=!hE(Z.animated&&Z.toRect||n,r.animated&&r.toRect||o,f),C=f?"top":"left",B=ts(r,"top","top")||ts(Z,"top","top"),M=B?B.scrollTop:void 0;Nl!==r&&(E=o[C],Hl=!1,Ca=!$&&i.invertSwap||D),V=EE(t,r,o,f,$?1:i.swapThreshold,i.invertedSwapThreshold==null?i.swapThreshold:i.invertedSwapThreshold,Ca,Nl===r);var U;if(V!==0){var P=xt(Z);do P-=V,U=Fe.children[P];while(U&&(se(U,"display")==="none"||U===me))}if(V===0||U===r)return k(!1);Nl=r,zl=V;var I=r.nextElementSibling,O=!1;O=V===1;var F=Da(Te,a,Z,n,r,o,t,O);if(F!==!1)return(F===1||F===-1)&&(O=F===1),Or=!0,setTimeout(kE,30),h(),O&&!I?a.appendChild(Z):r.parentNode.insertBefore(Z,O?I:r),B&&rs(B,0,M-B.scrollTop),Fe=Z.parentNode,E!==void 0&&!Ca&&(Na=Math.abs(E-Ue(r)[C])),x(),k(!0)}if(a.contains(Z))return k(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){we(document,"mousemove",this._onTouchMove),we(document,"touchmove",this._onTouchMove),we(document,"pointermove",this._onTouchMove),we(document,"dragover",ul),we(document,"mousemove",ul),we(document,"touchmove",ul)},_offUpEvents:function(){var t=this.el.ownerDocument;we(t,"mouseup",this._onDrop),we(t,"touchend",this._onDrop),we(t,"pointerup",this._onDrop),we(t,"touchcancel",this._onDrop),we(document,"selectstart",this)},_onDrop:function(t){var a=this.el,r=this.options;if(gt=xt(Z),ll=xt(Z,r.draggable),st("drop",this,{evt:t}),Fe=Z&&Z.parentNode,gt=xt(Z),ll=xt(Z,r.draggable),ie.eventCanceled){this._nulling();return}Cl=!1,Ca=!1,Hl=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Rr(this.cloneId),Rr(this._dragStartId),this.nativeDraggable&&(we(document,"drop",this),we(a,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ol&&se(document.body,"user-select",""),se(Z,"transform",""),t&&(Ul&&(t.cancelable&&t.preventDefault(),!r.dropBubble&&t.stopPropagation()),me&&me.parentNode&&me.parentNode.removeChild(me),(Te===Fe||Ye&&Ye.lastPutMode!=="clone")&&Ie&&Ie.parentNode&&Ie.parentNode.removeChild(Ie),Z&&(this.nativeDraggable&&we(Z,"dragend",this),Pr(Z),Z.style["will-change"]="",Ul&&!Cl&&ft(Z,Ye?Ye.options.ghostClass:this.options.ghostClass,!1),ft(Z,this.options.chosenClass,!1),lt({sortable:this,name:"unchoose",toEl:Fe,newIndex:null,newDraggableIndex:null,originalEvent:t}),Te!==Fe?(gt>=0&&(lt({rootEl:Fe,name:"add",toEl:Fe,fromEl:Te,originalEvent:t}),lt({sortable:this,name:"remove",toEl:Fe,originalEvent:t}),lt({rootEl:Fe,name:"sort",toEl:Fe,fromEl:Te,originalEvent:t}),lt({sortable:this,name:"sort",toEl:Fe,originalEvent:t})),Ye&&Ye.save()):gt!==Vl&>>=0&&(lt({sortable:this,name:"update",toEl:Fe,originalEvent:t}),lt({sortable:this,name:"sort",toEl:Fe,originalEvent:t})),ie.active&&((gt==null||gt===-1)&&(gt=Vl,ll=jl),lt({sortable:this,name:"end",toEl:Fe,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){st("nulling",this),Te=Z=Fe=me=cl=Ie=wa=tl=dl=Vt=Ul=gt=ll=Vl=jl=Nl=zl=Ye=Ea=ie.dragged=ie.ghost=ie.clone=ie.active=null,Ba.forEach(function(t){t.checked=!0}),Ba.length=Lr=Fr=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":Z&&(this._onDragOver(t),bE(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],a,r=this.el.children,n=0,o=r.length,s=this.options;n<o;n++)a=r[n],Dt(a,s.draggable,this.el,!1)&&t.push(a.getAttribute(s.dataIdAttr)||VE(a));return t},sort:function(t,a){var r={},n=this.el;this.toArray().forEach(function(o,s){var i=n.children[s];Dt(i,this.options.draggable,n,!1)&&(r[o]=i)},this),a&&this.captureAnimationState(),t.forEach(function(o){r[o]&&(n.removeChild(r[o]),n.appendChild(r[o]))}),a&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,a){return Dt(t,a||this.options.draggable,this.el,!1)},option:function(t,a){var r=this.options;if(a===void 0)return r[t];var n=Rl.modifyOption(this,t,a);typeof n<"u"?r[t]=n:r[t]=a,t==="group"&&us(r)},destroy:function(){st("destroy",this);var t=this.el;t[ht]=null,we(t,"mousedown",this._onTapStart),we(t,"touchstart",this._onTapStart),we(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(we(t,"dragover",this),we(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(a){a.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Va.splice(Va.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!tl){if(st("hideClone",this),ie.eventCanceled)return;se(Ie,"display","none"),this.options.removeCloneOnHide&&Ie.parentNode&&Ie.parentNode.removeChild(Ie),tl=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(tl){if(st("showClone",this),ie.eventCanceled)return;Z.parentNode==Te&&!this.options.group.revertClone?Te.insertBefore(Ie,Z):cl?Te.insertBefore(Ie,cl):Te.appendChild(Ie),this.options.group.revertClone&&this.animate(Z,Ie),se(Ie,"display",""),tl=!1}}};function bE(l){l.dataTransfer&&(l.dataTransfer.dropEffect="move"),l.cancelable&&l.preventDefault()}function Da(l,t,a,r,n,o,s,i){var c,u=l[ht],d=u.options.onMove,p;return window.CustomEvent&&!Ht&&!Il?c=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(c=document.createEvent("Event"),c.initEvent("move",!0,!0)),c.to=t,c.from=l,c.dragged=a,c.draggedRect=r,c.related=n||t,c.relatedRect=o||Ue(t),c.willInsertAfter=i,c.originalEvent=s,l.dispatchEvent(c),d&&(p=d.call(u,c,s)),p}function Pr(l){l.draggable=!1}function kE(){Or=!1}function xE(l,t,a){var r=Ue(El(a.el,0,a.options,!0)),n=10;return t?l.clientX<r.left-n||l.clientY<r.top&&l.clientX<r.right:l.clientY<r.top-n||l.clientY<r.bottom&&l.clientX<r.left}function wE(l,t,a){var r=Ue(Mr(a.el,a.options.draggable)),n=10;return t?l.clientX>r.right+n||l.clientX<=r.right&&l.clientY>r.bottom&&l.clientX>=r.left:l.clientX>r.right&&l.clientY>r.top||l.clientX<=r.right&&l.clientY>r.bottom+n}function EE(l,t,a,r,n,o,s,i){var c=r?l.clientY:l.clientX,u=r?a.height:a.width,d=r?a.top:a.left,p=r?a.bottom:a.right,m=!1;if(!s){if(i&&Na<u*n){if(!Hl&&(zl===1?c>d+u*o/2:c<p-u*o/2)&&(Hl=!0),Hl)m=!0;else if(zl===1?c<d+Na:c>p-Na)return-zl}else if(c>d+u*(1-n)/2&&c<p-u*(1-n)/2)return _E(t)}return m=m||s,m&&(c<d+u*o/2||c>p-u*o/2)?c>d+u/2?1:-1:0}function _E(l){return xt(Z)<xt(l)?1:-1}function VE(l){for(var t=l.tagName+l.className+l.src+l.href+l.textContent,a=t.length,r=0;a--;)r+=t.charCodeAt(a);return r.toString(36)}function CE(l){Ba.length=0;for(var t=l.getElementsByTagName("input"),a=t.length;a--;){var r=t[a];r.checked&&Ba.push(r)}}function Aa(l){return setTimeout(l,0)}function Rr(l){return clearTimeout(l)}va&&Ne(document,"touchmove",function(l){(ie.active||Cl)&&l.cancelable&&l.preventDefault()}),ie.utils={on:Ne,off:we,css:se,find:es,is:function(t,a){return!!Dt(t,a,t,!1)},extend:sE,throttle:as,closest:Dt,toggleClass:ft,clone:ns,index:xt,nextTick:Aa,cancelNextTick:Rr,detectDirection:ds,getChild:El},ie.get=function(l){return l[ht]},ie.mount=function(){for(var l=arguments.length,t=new Array(l),a=0;a<l;a++)t[a]=arguments[a];t[0].constructor===Array&&(t=t[0]),t.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(ie.utils=St(St({},ie.utils),r.utils)),Rl.mount(r)})},ie.create=function(l,t){return new ie(l,t)},ie.version=aE;var je=[],Kl,jr,Ur=!1,zr,Hr,Ma,ql;function NE(){function l(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return l.prototype={dragStarted:function(a){var r=a.originalEvent;this.sortable.nativeDraggable?Ne(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Ne(document,"pointermove",this._handleFallbackAutoScroll):r.touches?Ne(document,"touchmove",this._handleFallbackAutoScroll):Ne(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(a){var r=a.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?we(document,"dragover",this._handleAutoScroll):(we(document,"pointermove",this._handleFallbackAutoScroll),we(document,"touchmove",this._handleFallbackAutoScroll),we(document,"mousemove",this._handleFallbackAutoScroll)),fs(),Ta(),iE()},nulling:function(){Ma=jr=Kl=Ur=ql=zr=Hr=null,je.length=0},_handleFallbackAutoScroll:function(a){this._handleAutoScroll(a,!0)},_handleAutoScroll:function(a,r){var n=this,o=(a.touches?a.touches[0]:a).clientX,s=(a.touches?a.touches[0]:a).clientY,i=document.elementFromPoint(o,s);if(Ma=a,r||this.options.forceAutoScrollFallback||Il||Ht||Ol){Kr(a,this.options,i,r);var c=el(i,!0);Ur&&(!ql||o!==zr||s!==Hr)&&(ql&&fs(),ql=setInterval(function(){var u=el(document.elementFromPoint(o,s),!0);u!==c&&(c=u,Ta()),Kr(a,n.options,u,r)},10),zr=o,Hr=s)}else{if(!this.options.bubbleScroll||el(i,!0)===At()){Ta();return}Kr(a,this.options,el(i,!1),!1)}}},Ut(l,{pluginName:"scroll",initializeByDefault:!0})}function Ta(){je.forEach(function(l){clearInterval(l.pid)}),je=[]}function fs(){clearInterval(ql)}var Kr=as(function(l,t,a,r){if(t.scroll){var n=(l.touches?l.touches[0]:l).clientX,o=(l.touches?l.touches[0]:l).clientY,s=t.scrollSensitivity,i=t.scrollSpeed,c=At(),u=!1,d;jr!==a&&(jr=a,Ta(),Kl=t.scroll,d=t.scrollFn,Kl===!0&&(Kl=el(a,!0)));var p=0,m=Kl;do{var f=m,g=Ue(f),y=g.top,w=g.bottom,h=g.left,k=g.right,x=g.width,b=g.height,_=void 0,V=void 0,E=f.scrollWidth,D=f.scrollHeight,$=se(f),C=f.scrollLeft,B=f.scrollTop;f===c?(_=x<E&&($.overflowX==="auto"||$.overflowX==="scroll"||$.overflowX==="visible"),V=b<D&&($.overflowY==="auto"||$.overflowY==="scroll"||$.overflowY==="visible")):(_=x<E&&($.overflowX==="auto"||$.overflowX==="scroll"),V=b<D&&($.overflowY==="auto"||$.overflowY==="scroll"));var M=_&&(Math.abs(k-n)<=s&&C+x<E)-(Math.abs(h-n)<=s&&!!C),U=V&&(Math.abs(w-o)<=s&&B+b<D)-(Math.abs(y-o)<=s&&!!B);if(!je[p])for(var P=0;P<=p;P++)je[P]||(je[P]={});(je[p].vx!=M||je[p].vy!=U||je[p].el!==f)&&(je[p].el=f,je[p].vx=M,je[p].vy=U,clearInterval(je[p].pid),(M!=0||U!=0)&&(u=!0,je[p].pid=setInterval((function(){r&&this.layer===0&&ie.active._onTouchMove(Ma);var I=je[this.layer].vy?je[this.layer].vy*i:0,O=je[this.layer].vx?je[this.layer].vx*i:0;typeof d=="function"&&d.call(ie.dragged.parentNode[ht],O,I,l,Ma,je[this.layer].el)!=="continue"||rs(je[this.layer].el,O,I)}).bind({layer:p}),24))),p++}while(t.bubbleScroll&&m!==c&&(m=el(m,!1)));Ur=u}},30),hs=function(t){var a=t.originalEvent,r=t.putSortable,n=t.dragEl,o=t.activeSortable,s=t.dispatchSortableEvent,i=t.hideGhostForTarget,c=t.unhideGhostForTarget;if(a){var u=r||o;i();var d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:a,p=document.elementFromPoint(d.clientX,d.clientY);c(),u&&!u.el.contains(p)&&(s("spill"),this.onSpill({dragEl:n,putSortable:r}))}};function qr(){}qr.prototype={startIndex:null,dragStart:function(t){var a=t.oldDraggableIndex;this.startIndex=a},onSpill:function(t){var a=t.dragEl,r=t.putSortable;this.sortable.captureAnimationState(),r&&r.captureAnimationState();var n=El(this.sortable.el,this.startIndex,this.options);n?this.sortable.el.insertBefore(a,n):this.sortable.el.appendChild(a),this.sortable.animateAll(),r&&r.animateAll()},drop:hs},Ut(qr,{pluginName:"revertOnSpill"});function Gr(){}Gr.prototype={onSpill:function(t){var a=t.dragEl,r=t.putSortable,n=r||this.sortable;n.captureAnimationState(),a.parentNode&&a.parentNode.removeChild(a),n.animateAll()},drop:hs},Ut(Gr,{pluginName:"removeOnSpill"}),ie.mount(new NE),ie.mount(Gr,qr);function Wr(l){l.parentElement!==null&&l.parentElement.removeChild(l)}function gs(l,t,a){const r=a===0?l.children[0]:l.children[a-1].nextSibling;l.insertBefore(t,r)}function BE(){return typeof window<"u"?window.console:global.console}const vE=BE();function SE(l){const t=Object.create(null);return function(r){return t[r]||(t[r]=l(r))}}const DE=/-(\w)/g,AE=SE(l=>l.replace(DE,(t,a)=>a.toUpperCase())),ys=["Start","Add","Remove","Update","End"],bs=["Choose","Unchoose","Sort","Filter","Clone"],ks=["Move"],ME=[ks,ys,bs].flatMap(l=>l).map(l=>`on${l}`),Yr={manage:ks,manageAndEmit:ys,emit:bs};function TE(l){return ME.indexOf(l)!==-1}const $E=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"];function LE(l){return $E.includes(l)}function FE(l){return["transition-group","TransitionGroup"].includes(l)}function xs(l){return["id","class","role","style"].includes(l)||l.startsWith("data-")||l.startsWith("aria-")||l.startsWith("on")}function ws(l){return l.reduce((t,[a,r])=>(t[a]=r,t),{})}function IE({$attrs:l,componentData:t={}}){return{...ws(Object.entries(l).filter(([r,n])=>xs(r))),...t}}function OE({$attrs:l,callBackBuilder:t}){const a=ws(Es(l));Object.entries(t).forEach(([n,o])=>{Yr[n].forEach(s=>{a[`on${s}`]=o(s)})});const r=`[data-draggable]${a.draggable||""}`;return{...a,draggable:r}}function Es(l){return Object.entries(l).filter(([t,a])=>!xs(t)).map(([t,a])=>[AE(t),a]).filter(([t,a])=>!TE(t))}const _s=({el:l})=>l,PE=(l,t)=>l.__draggable_context=t,Vs=l=>l.__draggable_context;class RE{constructor({nodes:{header:t,default:a,footer:r},root:n,realList:o}){this.defaultNodes=a,this.children=[...t,...a,...r],this.externalComponent=n.externalComponent,this.rootTransition=n.transition,this.tag=n.tag,this.realList=o}get _isRootComponent(){return this.externalComponent||this.rootTransition}render(t,a){const{tag:r,children:n,_isRootComponent:o}=this;return t(r,a,o?{default:()=>n}:n)}updated(){const{defaultNodes:t,realList:a}=this;t.forEach((r,n)=>{PE(_s(r),{element:a[n],index:n})})}getUnderlyingVm(t){return Vs(t)}getVmIndexFromDomIndex(t,a){const{defaultNodes:r}=this,{length:n}=r,o=a.children,s=o.item(t);if(s===null)return n;const i=Vs(s);if(i)return i.index;if(n===0)return 0;const c=_s(r[0]),u=[...o].findIndex(d=>d===c);return t<u?0:n}}function jE(l,t){const a=l[t];return a?a():[]}function UE({$slots:l,realList:t,getKey:a}){const r=t||[],[n,o]=["header","footer"].map(c=>jE(l,c)),{item:s}=l;if(!s)throw new Error("draggable element must have an item slot");const i=r.flatMap((c,u)=>s({element:c,index:u}).map(d=>(d.key=a(c),d.props={...d.props||{},"data-draggable":!0},d)));if(i.length!==r.length)throw new Error("Item slot must have only one child");return{header:n,footer:o,default:i}}function zE(l){const t=FE(l),a=!LE(l)&&!t;return{transition:t,externalComponent:a,tag:a?e.resolveComponent(l):t?e.TransitionGroup:l}}function HE({$slots:l,tag:t,realList:a,getKey:r}){const n=UE({$slots:l,realList:a,getKey:r}),o=zE(t);return new RE({nodes:n,root:o,realList:a})}function Cs(l,t){e.nextTick(()=>this.$emit(l.toLowerCase(),t))}function Ns(l){return(t,a)=>{if(this.realList!==null)return this[`onDrag${l}`](t,a)}}function KE(l){const t=Ns.call(this,l);return(a,r)=>{t.call(this,a,r),Cs.call(this,l,a)}}let Xr=null;const qE={list:{type:Array,required:!1,default:null},modelValue:{type:Array,required:!1,default:null},itemKey:{type:[String,Function],required:!0},clone:{type:Function,default:l=>l},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},GE=["update:modelValue","change",...[...Yr.manageAndEmit,...Yr.emit].map(l=>l.toLowerCase())],WE=e.defineComponent({name:"draggable",inheritAttrs:!1,props:qE,emits:GE,data(){return{error:!1}},render(){try{this.error=!1;const{$slots:l,$attrs:t,tag:a,componentData:r,realList:n,getKey:o}=this,s=HE({$slots:l,tag:a,realList:n,getKey:o});this.componentStructure=s;const i=IE({$attrs:t,componentData:r});return s.render(e.h,i)}catch(l){return this.error=!0,e.h("pre",{style:{color:"red"}},l.stack)}},created(){this.list!==null&&this.modelValue!==null&&vE.error("modelValue and list props are mutually exclusive! Please set one or another.")},mounted(){if(this.error)return;const{$attrs:l,$el:t,componentStructure:a}=this;a.updated();const r=OE({$attrs:l,callBackBuilder:{manageAndEmit:o=>KE.call(this,o),emit:o=>Cs.bind(this,o),manage:o=>Ns.call(this,o)}}),n=t.nodeType===1?t:t.parentElement;this._sortable=new ie(n,r),this.targetDomElement=n,n.__draggable_component__=this},updated(){this.componentStructure.updated()},beforeUnmount(){this._sortable!==void 0&&this._sortable.destroy()},computed:{realList(){const{list:l}=this;return l||this.modelValue},getKey(){const{itemKey:l}=this;return typeof l=="function"?l:t=>t[l]}},watch:{$attrs:{handler(l){const{_sortable:t}=this;t&&Es(l).forEach(([a,r])=>{t.option(a,r)})},deep:!0}},methods:{getUnderlyingVm(l){return this.componentStructure.getUnderlyingVm(l)||null},getUnderlyingPotencialDraggableComponent(l){return l.__draggable_component__},emitChanges(l){e.nextTick(()=>this.$emit("change",l))},alterList(l){if(this.list){l(this.list);return}const t=[...this.modelValue];l(t),this.$emit("update:modelValue",t)},spliceList(){const l=t=>t.splice(...arguments);this.alterList(l)},updatePosition(l,t){const a=r=>r.splice(t,0,r.splice(l,1)[0]);this.alterList(a)},getRelatedContextFromMoveEvent({to:l,related:t}){const a=this.getUnderlyingPotencialDraggableComponent(l);if(!a)return{component:a};const r=a.realList,n={list:r,component:a};return l!==t&&r?{...a.getUnderlyingVm(t)||{},...n}:n},getVmIndexFromDomIndex(l){return this.componentStructure.getVmIndexFromDomIndex(l,this.targetDomElement)},onDragStart(l){this.context=this.getUnderlyingVm(l.item),l.item._underlying_vm_=this.clone(this.context.element),Xr=l.item},onDragAdd(l){const t=l.item._underlying_vm_;if(t===void 0)return;Wr(l.item);const a=this.getVmIndexFromDomIndex(l.newIndex);this.spliceList(a,0,t);const r={element:t,newIndex:a};this.emitChanges({added:r})},onDragRemove(l){if(gs(this.$el,l.item,l.oldIndex),l.pullMode==="clone"){Wr(l.clone);return}const{index:t,element:a}=this.context;this.spliceList(t,1);const r={element:a,oldIndex:t};this.emitChanges({removed:r})},onDragUpdate(l){Wr(l.item),gs(l.from,l.item,l.oldIndex);const t=this.context.index,a=this.getVmIndexFromDomIndex(l.newIndex);this.updatePosition(t,a);const r={element:this.context.element,oldIndex:t,newIndex:a};this.emitChanges({moved:r})},computeFutureIndex(l,t){if(!l.element)return 0;const a=[...t.to.children].filter(s=>s.style.display!=="none"),r=a.indexOf(t.related),n=l.component.getVmIndexFromDomIndex(r);return a.indexOf(Xr)!==-1||!t.willInsertAfter?n:n+1},onDragMove(l,t){const{move:a,realList:r}=this;if(!a||!r)return!0;const n=this.getRelatedContextFromMoveEvent(l),o=this.computeFutureIndex(n,l),s={...this.context,futureIndex:o},i={...l,relatedContext:n,draggedContext:s};return a(i,t)},onDragEnd(){Xr=null}}}),Bs="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",vs={faq:{schema:{title:{type:"text",label:"Назва",placeholder:"Назва"},show_dots:{type:"switcher",label:"Показувати точки"},show_index:{type:"switcher",conditions:["show_dots","==","true"],label:"Показувати нумерацію"},index_type:{type:"combobox",conditions:["show_index","==","true"],label:"Тип нумерації",options:[{id:"decimal",text:"Десятковий"},{id:"upper-alpha",text:"Латинські великі букви"},{id:"lower-alpha",text:"Латинські маленькі букви"},{id:"upper-roman",text:"Римські великі цифри"},{id:"lower-roman",text:"Римські маленькі цифри"},{id:"upper-cyrillic",text:"Кириличні великі букви"},{id:"lower-cyrillic",text:"Кириличні маленькі букви"}]},openfirst:{type:"switcher",label:"Відкрити перший елемент?"},collapse_mode:{type:"switcher",label:"Не згортати попередній елемент?"},data:{type:"DataTable",colModel:[{key:"title",ua:"Назва",type:"text",required:!0,validators:["required"]},{key:"is_section",type:"Radio",label:"Заповнити секціями",options:[{id:"yes",text:"Так"},{id:"no",text:"Ні"}],required:!0,validators:["required"]},{key:"section",type:"reference",label:"Вкладений контент",placeholder:"Ваш контент",conditions:["is_section","==","yes"],required:!0,validators:["required"]},{key:"body",type:"tiptap-editor",label:"Тіло вкладки",placeholder:"Ваш контент",conditions:["is_section","==","no"],required:!0,validators:["required"]}]}}},banner:{schema:{title:{type:"text",label:"Назва",placeholder:"Назва"},image:{type:"file",label:"Зображення",placeholder:"Зображення"}}},photoGrid:{schema:{columns:{type:"number",label:"Кількість колонок",placeholder:"Кількість колонок",default:3},data:{type:"DataTable",colModel:[{key:"image",ua:"Зображення",type:"file"},{key:"caption",ua:"Заголовок",type:"text"}]}}},slider:{schema:{autoplay:{type:"switcher",label:"Автоматичне гортання?",default:!0},autoplaySpeed:{type:"number",label:"Швидкість автоматичного гортання(мс)",placeholder:"Швидкість автоматичного гортання(мс)",default:3e3},show_navigation:{type:"switcher",label:"Показувати кнопки навігації?"},data:{type:"DataTable",colModel:[{key:"title",ua:"Назва",type:"text"},{key:"link",ua:"Посилання",type:"text"},{key:"image",ua:"Зображення",type:"file"},{key:"image_width",ua:"Ширина зображення(px)",type:"number",placeholder:"Ширина зображення"},{key:"image_height",ua:"Висота зображення(px)",type:"number",placeholder:"Висота зображення"},{ua:"Розтягувати по ширині",key:"stretch",type:"switcher"},{key:"target_blank",ua:"Відкривати в новій вкладці?",type:"switcher"}]}}},video:{schema:{file:{type:"file",max_size:50,description:"Максимальний розмір файлу 50MB",label:"Завантажити відео",placeholder:"Завантажити відео"},hidden_gif:{type:"switcher",label:"Сховати GIF"},preview:{type:"file",label:"Прев'ю для відео"},link:{type:"text",label:"Посилання",placeholder:"Посилання"}}},about:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},text:{type:"tiptap-editor",label:"Текст",placeholder:"Текст"},url:{type:"file",label:"Зображення / відео",placeholder:"Посилання"}}},cards:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},data:{type:"DataTable",colModel:[{key:"title",ua:"Назва",type:"text"},{key:"img",ua:"Зображення",type:"file"},{key:"link",ua:"Посилання",type:"text"},{key:"description",ua:"Опис",type:"text"}]}}},usefulLinks:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},data:{type:"DataTable",colModel:[{key:"text",ua:"Назва",type:"text"},{key:"url",ua:"Посилання",type:"text"},{key:"target_blank",ua:"Відкривати в новій вкладці?",type:"switcher"}]}}},team:{schema:{data:{type:"DataTable",colModel:[{key:"avatar",ua:"Аватар",type:"file"},{key:"title",ua:"Ім'я/ПІБ",type:"text"},{key:"description",ua:"Опис",type:"textarea",optional:!0},{key:"position",ua:"Посада",type:"text",tooltip:!0},{key:"email",ua:"Email",type:"text",optional:!0},{key:"tel",ua:"Телефон",type:"text",optional:!0},{key:"schedule",ua:"Графік прийому",type:"text",optional:!0},{key:"isinfo",type:"switcher",label:"Відображати кнопку 'Детальніше'"},{key:"slug",ua:"Slug",type:"text",label:"Унікальний ідентифікатор"}]}}},body:{schema:{background_color:{type:"switcher",label:"Додати білий фон?"},content:{type:"tiptap-editor",label:"Текст",placeholder:"Текст"}}},news:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},buttonText:{type:"text",label:"Текст кнопки",placeholder:"Текст кнопки"},buttonLink:{type:"text",label:"Посилання кнопки",placeholder:"Посилання кнопки"},tag:{type:"select",label:"Тег",placeholder:"Тег",data:"tag_id"},news_list:{type:"select",label:"Список новин",multiple:!0,placeholder:"Список новин",parent:"tag",data:"news_tag_id"}}},form:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},formUrl:{type:"text",label:"Посилання для відправки форми",placeholder:"Посилання"},schema:{label:"Схема форми",type:"DataTable",colModel:[{key:"name",ua:"Name",type:"text",placeholder:"Name"},{key:"label",ua:"Title",type:"text",placeholder:"Title"},{key:"type",ua:"Type",type:"combobox",options:[{text:"Text",id:"text"},{text:"Textarea",id:"textarea"},{text:"switcher",id:"switcher"},{text:"Email",id:"email"},{text:"Mask",id:"mask"},{text:"Number",id:"number"},{text:"Date",id:"date"},{text:"Datetime",id:"datetime"}]},{key:"mask",ua:"Маска",type:"text",conditions:["type","==","mask"],placeholder:"Маска"},{key:"placeholder",ua:"Плейсхолдер",type:"text",placeholder:"Placeholder"},{key:"required",ua:"Required",type:"switcher"}]}}},tabs:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},description:{type:"textarea",label:"Опис",placeholder:"Опис"},history_mode:{type:"switcher",label:"Використовувати історію сторінки?"},data:{type:"DataTable",colModel:[{key:"slug",type:"slug",label:"Slug",parent:"title",placeholder:"Slug"},{key:"title",ua:"Назва",type:"text",required:!0,validators:["required"]},{key:"is_section",type:"Radio",label:"Заповнити секціями",options:[{id:"yes",text:"Так"},{id:"no",text:"Ні"}],required:!0,validators:["required"]},{key:"section",type:"reference",label:"Тіло вкладки",placeholder:"Ваш контент",conditions:["is_section","==","yes"],required:!0,validators:["required"]},{key:"body",type:"tiptap-editor",label:"Тіло вкладки",placeholder:"Ваш контент",conditions:["is_section","==","no"],required:!0,validators:["required"]}]}}},vertical_tabs:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},history_mode:{type:"switcher",label:"Використовувати історію сторінки?"},data:{type:"DataTable",colModel:[{key:"slug",type:"slug",label:"Slug",parent:"title",placeholder:"Slug"},{key:"title",ua:"Назва",type:"text",required:!0,validators:["required"]},{key:"is_section",type:"Radio",label:"Заповнити секціями",options:[{id:"yes",text:"Так"},{id:"no",text:"Ні"},{id:"slug",text:"Привязати сторінку"}],required:!0,validators:["required"]},{key:"slug",type:"text",label:"Slug",placeholder:"Slug",conditions:["is_section","==","slug"]},{key:"section",type:"reference",label:"Тіло вкладки",placeholder:"Ваш контент",conditions:["is_section","==","yes"],required:!0,validators:["required"]},{key:"body",type:"tiptap-editor",label:"Тіло вкладки",placeholder:"Ваш контент",conditions:["is_section","==","no"],required:!0,validators:["required"]}]}}},documents:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},icon:{type:"file",label:"Завантажити іконку",placeholder:"Завантажити іконку"},show_icon:{type:"switcher",label:"Показувати іконку?"},documents:{type:"DataTable",colModel:[{key:"title",ua:"Назва",type:"text"},{key:"file",info:"Прев'ю доступно тільки для документів у форматі pdf, html, txt. Інші формати одразу завантажуються.",ua:"Файл",type:"file"}]}}},infoLine:{schema:{divider:{type:"file",label:"Завантажити розподілювач"},speed:{type:"number",label:"Швидкість автоматичного гортання(с)",placeholder:"Швидкість автоматичного гортання(с)",default:20},data:{type:"DataTable",colModel:[{key:"title",ua:"Текст",type:"text"}]}}},interested:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},data:{type:"DataTable",colModel:[{key:"title",ua:"Заголовок",type:"text"},{key:"link",ua:"Посилання",type:"text"},{key:"target_blank",ua:"Відкривати в новій вкладці?",type:"switcher"},{key:"color",ua:"Колір фону",type:"color"}]}}},contact:{schema:{title:{type:"text",label:"Заголовок",placeholder:"Заголовок"},data:{type:"DataTable",colModel:[{key:"type",ua:"Тип",type:"combobox",options:[{id:"email",text:"Email"},{id:"tel",text:"Телефон"},{id:"address",text:"Адреса"}]},{key:"title",ua:"Пошта",type:"text",conditions:["type","==","email"]},{key:"title",ua:"Телефон",type:"text",conditions:["type","==","tel"]},{key:"title",ua:"Адреса",type:"text",conditions:["type","==","address"]},{key:"description",ua:"Опис",type:"text"}]}}},iframe:{schema:{link:{type:"text",label:"Посилання",placeholder:"Посилання"},file:{type:"file",label:"Завантажити файл",placeholder:"Завантажити файл"},height:{type:"text",label:"Висота iframe(px)",placeholder:"Висота iframe(px)"}}}},$a=[{text:"reference.faq",id:"faq"},{text:"reference.banner",id:"banner"},{text:"reference.slider",id:"slider"},{text:"reference.photoGrid",id:"photoGrid"},{text:"reference.video",id:"video"},{text:"reference.about",id:"about"},{text:"reference.cards",id:"cards"},{text:"reference.usefulLinks",id:"usefulLinks"},{text:"reference.team",id:"team"},{text:"reference.body",id:"body"},{text:"reference.news",id:"news"},{text:"reference.form",id:"form"},{text:"reference.tabs",id:"tabs"},{text:"reference.vertical_tabs",id:"vertical_tabs"},{text:"reference.documents",id:"documents"},{text:"reference.infoLine",id:"infoLine"},{text:"reference.interested",id:"interested"},{text:"reference.contact",id:"contact"},{text:"reference.iframe",id:"iframe"}],YE={class:"h-full w-full flex flex-col"},XE={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},ZE={class:"text-xs font-medium text-gray-600"},QE={key:0,class:"text-xs text-gray-500"},Ss={__name:"cards-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",YE,[a[0]||(a[0]=e.createStaticVNode('<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)),e.createElementVNode("div",XE,[e.createElementVNode("div",ZE,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",QE,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},JE={class:"h-full w-full flex flex-col"},e_={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},t_={class:"text-xs font-medium text-gray-600"},l_={key:0,class:"text-xs text-gray-500"},a_={__name:"faq-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",JE,[a[0]||(a[0]=e.createStaticVNode('<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)),e.createElementVNode("div",e_,[e.createElementVNode("div",t_,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",l_,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},r_={class:"h-full w-full flex flex-col"},n_={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},o_={class:"text-xs font-medium text-gray-600"},s_={key:0,class:"text-xs text-gray-500"},Ds={__name:"banner-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",r_,[a[0]||(a[0]=e.createStaticVNode('<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)),e.createElementVNode("div",n_,[e.createElementVNode("div",o_,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",s_,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},i_={class:"h-full w-full flex flex-col"},c_={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},d_={class:"text-xs font-medium text-gray-600"},u_={key:0,class:"text-xs text-gray-500"},p_={__name:"form-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",i_,[a[0]||(a[0]=e.createStaticVNode('<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)),e.createElementVNode("div",c_,[e.createElementVNode("div",d_,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",u_,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},m_={class:"h-full w-full flex flex-col"},f_={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},h_={class:"text-xs font-medium text-gray-600"},g_={key:0,class:"text-xs text-gray-500"},As={__name:"news-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",m_,[a[0]||(a[0]=e.createStaticVNode('<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)),e.createElementVNode("div",f_,[e.createElementVNode("div",h_,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",g_,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},y_={class:"h-full w-full flex flex-col"},b_={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},k_={class:"text-xs font-medium text-gray-600"},x_={key:0,class:"text-xs text-gray-500"},w_={__name:"team-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",y_,[a[0]||(a[0]=e.createStaticVNode('<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)),e.createElementVNode("div",b_,[e.createElementVNode("div",k_,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",x_,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},E_={class:"h-full w-full flex flex-col"},__={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},V_={class:"text-xs font-medium text-gray-600"},C_={key:0,class:"text-xs text-gray-500"},Ms={__name:"usefulLinks-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",E_,[a[0]||(a[0]=e.createStaticVNode('<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)),e.createElementVNode("div",__,[e.createElementVNode("div",V_,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",C_,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},N_={class:"h-full w-full flex flex-col"},B_={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},v_={class:"text-xs font-medium text-gray-600"},S_={key:0,class:"text-xs text-gray-500"},D_={__name:"video-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",N_,[a[0]||(a[0]=e.createStaticVNode('<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)),e.createElementVNode("div",B_,[e.createElementVNode("div",v_,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",S_,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},A_={class:"h-full w-full flex flex-col"},M_={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},T_={class:"text-xs font-medium text-gray-600"},$_={key:0,class:"text-xs text-gray-500"},L_={__name:"about-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",A_,[a[0]||(a[0]=e.createStaticVNode('<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)),e.createElementVNode("div",M_,[e.createElementVNode("div",T_,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",$_,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},F_={class:"h-full w-full flex flex-col"},I_={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},O_={class:"text-xs font-medium text-gray-600"},P_={key:0,class:"text-xs text-gray-500"},R_={__name:"slider-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",F_,[a[0]||(a[0]=e.createStaticVNode('<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)),e.createElementVNode("div",I_,[e.createElementVNode("div",O_,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",P_,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},j_={class:"h-full flex flex-col"},U_={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},z_={class:"text-xs font-medium text-gray-600"},H_={key:0,class:"text-xs text-gray-500"},K_={__name:"infoLine-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",j_,[a[0]||(a[0]=e.createStaticVNode('<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)),e.createElementVNode("div",U_,[e.createElementVNode("div",z_,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",H_,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},q_={class:"h-full flex flex-col"},G_={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},W_={class:"text-xs font-medium text-gray-600"},Y_={key:0,class:"text-xs text-gray-500"},X_={__name:"tabs-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",q_,[a[0]||(a[0]=e.createStaticVNode('<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)),e.createElementVNode("div",G_,[e.createElementVNode("div",W_,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",Y_,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},Z_={class:"h-full flex flex-col"},Q_={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},J_={class:"text-xs font-medium text-gray-600"},eV={key:0,class:"text-xs text-gray-500"},Ts={__name:"documents-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",Z_,[a[0]||(a[0]=e.createStaticVNode('<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)),e.createElementVNode("div",Q_,[e.createElementVNode("div",J_,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",eV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},tV={class:"h-full flex flex-col"},lV={class:"flex justify-between items-center mt-2 pt-2 border-t border-gray-300"},aV={class:"text-xs font-medium text-gray-600"},rV={key:0,class:"text-xs text-gray-500"},La={faq:a_,banner:Ds,slider:R_,video:D_,about:L_,cards:Ss,usefulLinks:Ms,team:w_,news:As,form:p_,tabs:X_,vertical_tabs:As,documents:Ts,infoLine:K_,body:{__name:"body-skeleton",props:{text:{type:String,required:!0},count:{type:Number,required:!0}},setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",tV,[a[0]||(a[0]=e.createStaticVNode('<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)),e.createElementVNode("div",lV,[e.createElementVNode("div",aV,e.toDisplayString(t.$t(l.text)),1),l.count&&l.count>0?(e.openBlock(),e.createElementBlock("div",rV,e.toDisplayString(l.count),1)):e.createCommentVNode("",!0)])]))}},photoGrid:Ss,interested:Ms,contact:Ts,iframe:Ds},nV={class:"grid grid-cols-1 md:grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3 gap-4"},oV=["onClick"],sV={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"},iV=["src"],cV={__name:"vs-form-reference-choce",props:{modelValue:{type:String,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(l){const t=e.useModel(l,"modelValue");return(a,r)=>(e.openBlock(),e.createElementBlock("div",nV,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref($a),n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,onClick:o=>t.value=n.id,class:"relative"},[e.createElementVNode("div",sV,[e.unref(La)[n.id]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(La)[n.id]),{key:0,text:n==null?void 0:n.text,count:(n==null?void 0:n.data)||0},null,8,["text","count"])):(e.openBlock(),e.createElementBlock("img",{key:1,src:e.unref(Bs),alt:"Team collaboration",class:"w-full h-full object-cover"},null,8,iV))])],8,oV))),128))]))}},dV={};function uV(l,t,a,r,n,o){const s=e.resolveComponent("vs-richtext");return e.openBlock(),e.createBlock(s,{class:"w-full"})}const $s=Jt(dV,[["render",uV]]),pV={class:"flex gap-4"},mV={class:"text-sm text-gray-500 dark:text-gray-400 border flex items-center h-10 px-4 rounded-lg w-full"},fV={class:"flex items-center justify-between w-full p-4 border-t border-gray-200 dark:border-gray-700"},hV={__name:"vs-form-reference-add",props:e.mergeModels({title:{type:String,required:!0}},{modelValue:{type:Array,default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const{t}=Re();ot["vs-input-reference"]=Ls,ot["vs-input-tiptap-editor"]=$s;const a=e.useModel(l,"modelValue"),r=e.ref(!1),n=e.ref({}),o=e.ref(null),s=e.ref({}),i=e.computed(()=>{var u;return((u=vs[o.value])==null?void 0:u.schema)||null}),c=async()=>{if(await n.value.validate()){xe({type:"warning",title:t("common.actions.warning"),message:t("builder.editFieldFailed")});return}try{Object.keys(s.value).length!==0&&(a.value=[...a.value||[],{...s.value,id:Math.random().toString(36).substring(2,15),reference_type:o.value}]),r.value=!1,o.value=null,s.value={}}catch(d){console.log(d)}};return e.watch(r,()=>{r.value||(o.value=null,s.value={})}),(u,d)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{type:"button",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",onClick:d[0]||(d[0]=p=>r.value=!r.value)},e.toDisplayString(u.$t("builder.create")),1),e.createVNode(e.unref(ho),{visible:r.value,"onUpdate:visible":d[6]||(d[6]=p=>r.value=p),position:"right",closeClickBackdrop:!1,onClose:d[7]||(d[7]=p=>r.value=!1),title:o.value?u.$t("builder."+o.value):u.$t("builder.selectType"),size:"50vw"},{footer:e.withCtx(()=>[e.createElementVNode("div",fV,[e.createElementVNode("button",{onClick:d[5]||(d[5]=p=>r.value=!1),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"},e.toDisplayString(u.$t("builder.cancel")),1),e.createElementVNode("button",{onClick:c,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"},e.toDisplayString(u.$t("builder.create")),1)])]),default:e.withCtx(()=>{var p;return[o.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",pV,[e.createElementVNode("div",mV,[e.createElementVNode("span",null,e.toDisplayString((p=e.unref($a).find(m=>m.id===o.value))==null?void 0:p.text),1)]),e.createElementVNode("button",{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",onClick:d[2]||(d[2]=m=>o.value=null)},e.toDisplayString(u.$t("builder.changeType")),1)]),i.value?(e.openBlock(),e.createBlock(e.unref(mt),{key:o.value,schema:i.value,modelValue:s.value,"onUpdate:modelValue":d[3]||(d[3]=m=>s.value=m),form:n.value,"onUpdate:form":d[4]||(d[4]=m=>n.value=m)},null,8,["schema","modelValue","form"])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createBlock(cV,{key:0,modelValue:o.value,"onUpdate:modelValue":d[1]||(d[1]=m=>o.value=m),options:e.unref($a)},null,8,["modelValue","options"]))]}),_:1},8,["visible","title"])]))}},gV={class:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity flex space-x-1 z-10"},yV={class:"flex items-center justify-between w-full p-4 border-t border-gray-200 dark:border-gray-700"},bV={__name:"vs-form-reference-controls",props:e.mergeModels({title:{type:String,required:!0}},{modelValue:{type:Object,default:()=>({})},modelModifiers:{},parent:{type:Array,default:()=>[]},parentModifiers:{}}),emits:["update:modelValue","update:parent"],setup(l){const{t}=Re(),a=e.useModel(l,"modelValue"),r=e.useModel(l,"parent"),n=e.ref(!1),o=e.ref({}),s=e.ref({}),i=e.computed(()=>{var u;return((u=vs[a.value.reference_type])==null?void 0:u.schema)||null});e.watch(n,u=>{u&&(o.value={...a.value})});const c=async()=>{try{if(await s.value.validate()){xe({type:"warning",title:t("common.actions.warning"),message:t("builder.editFieldFailed")});return}a.value={...o.value},n.value=!1}catch(u){console.log(u)}};return(u,d)=>(e.openBlock(),e.createElementBlock("div",gV,[e.createElementVNode("button",{onClick:d[0]||(d[0]=p=>n.value=!n.value),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"},[e.createVNode(e.unref(Sl),{class:"h-4 w-4 text-gray-400"})]),e.createElementVNode("button",{onClick:d[1]||(d[1]=p=>r.value=r.value.filter(m=>m.id!==a.value.id)),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"},[e.createVNode(e.unref(qt),{class:"h-4 w-4 text-red-500"})]),e.createVNode(e.unref(ho),{visible:n.value,"onUpdate:visible":d[5]||(d[5]=p=>n.value=p),onClose:d[6]||(d[6]=p=>n.value=!1),title:l.title,width:"50vw"},{footer:e.withCtx(()=>[e.createElementVNode("div",yV,[e.createElementVNode("button",{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",onClick:d[4]||(d[4]=p=>n.value=!1)},e.toDisplayString(u.$t("common.actions.cancel")),1),e.createElementVNode("button",{onClick:c,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"},e.toDisplayString(u.$t("common.actions.save")),1)])]),default:e.withCtx(()=>[i.value?(e.openBlock(),e.createBlock(e.unref(mt),{key:0,form:s.value,"onUpdate:form":d[2]||(d[2]=p=>s.value=p),schema:i.value,modelValue:o.value,"onUpdate:modelValue":d[3]||(d[3]=p=>o.value=p),class:"-mr-[10px] ml-[10px] mt-[10px]"},null,8,["form","schema","modelValue"])):e.createCommentVNode("",!0)]),_:1},8,["visible","title"])]))}},kV={class:"w-full"},xV={key:0,class:"relative"},wV={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"},EV=["src"],Ls={__name:"vs-form-reference-list",props:e.mergeModels({reference_type:{type:String,required:!0},title:{type:String,required:!0}},{modelValue:{default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=n=>{var o;return(o=$a.find(s=>s.id===n))==null?void 0:o.text},a=e.useModel(l,"modelValue"),r=e.computed({get(){const n=a.value;return n==null?[]:Array.isArray(n)?n:[]},set(n){a.value=Array.isArray(n)?n:[]}});return e.watch(a,n=>{n!=null&&!Array.isArray(n)&&(a.value=[])},{immediate:!0}),(n,o)=>{var s;return e.openBlock(),e.createElementBlock("div",kV,[((s=r.value)==null?void 0:s.length)>0?(e.openBlock(),e.createBlock(e.unref(WE),{key:0,modelValue:r.value,"onUpdate:modelValue":o[1]||(o[1]=i=>r.value=i),"item-key":"id",handle:".drag-handle",class:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4"},{item:e.withCtx(({element:i,index:c})=>[i!=null&&i.reference_type?(e.openBlock(),e.createElementBlock("div",xV,[e.createElementVNode("div",wV,[(e.openBlock(),e.createElementBlock("div",{key:i.id,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"},[e.createVNode(e.unref(nn),{class:"h-4 w-4 text-gray-400"})])),e.createVNode(bV,{title:n.$t("builder."+(i==null?void 0:i.reference_type)),modelValue:r.value[c],"onUpdate:modelValue":u=>r.value[c]=u,parent:r.value,"onUpdate:parent":o[0]||(o[0]=u=>r.value=u)},null,8,["title","modelValue","onUpdate:modelValue","parent"]),e.unref(La)[i==null?void 0:i.reference_type]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(La)[i==null?void 0:i.reference_type]),{key:0,index:c,text:t(i==null?void 0:i.reference_type),count:Array.isArray(i==null?void 0:i.data)?i.data.length:0},null,8,["index","text","count"])):(e.openBlock(),e.createElementBlock("img",{key:1,src:e.unref(Bs),alt:"Team collaboration",class:"w-full h-full object-cover"},null,8,EV))])])):e.createCommentVNode("",!0)]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),e.createVNode(hV,{class:"mt-4",title:l.title,modelValue:r.value,"onUpdate:modelValue":o[2]||(o[2]=i=>r.value=i)},null,8,["title","modelValue"])])}}};function Fs(l){if(l===0)return"0 Bytes";const t=1024,a=["Bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(l)/Math.log(t));return Number.parseFloat((l/Math.pow(t,r)).toFixed(2))+" "+a[r]}function _V(l){const t=new Date(l);return isNaN(t.getTime())?"":t.toISOString().slice(0,10)}const VV={__name:"TypeTag",props:{type:{type:String,required:!0}},setup(l){const t=new Map([["document","bg-blue-100 text-blue-800 border-blue-200 dark:bg-blue-900/30 dark:text-blue-300 dark:border-blue-700"],["image","bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-300 dark:border-green-700"],["video","bg-purple-100 text-purple-800 border-purple-200 dark:bg-purple-900/30 dark:text-purple-300 dark:border-purple-700"]]);return(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors shadow-lg backdrop-blur-sm",e.unref(t).get(l.type)])},e.toDisplayString(l.type),3))}},CV={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"},NV={key:0,class:"flex flex-col items-center justify-center h-64 text-muted-foreground col-span-full"},BV=["onClick"],vV=["onClick"],SV={class:"truncate font-medium text-slate-800 dark:text-slate-100 mb-2"},DV={class:"text-sm text-slate-500 dark:text-slate-400"},AV=["onClick"],MV={class:"p-0"},TV={class:"aspect-video bg-slate-100 dark:bg-slate-700 rounded-t-lg overflow-hidden relative"},$V={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"},LV={key:0,class:"relative w-full"},FV=["src","alt"],IV={class:"p-4"},OV={class:"flex items-center justify-between mb-2"},PV={class:"font-medium text-slate-800 dark:text-slate-100 truncate flex-1 mr-2"},RV={class:"space-y-1 text-sm text-slate-500 dark:text-slate-400"},jV={class:"flex justify-between"},UV={class:"flex justify-between"},zV={__name:"MediaGrid",props:{files:{type:Array,required:!0},selectedFile:{type:Object,default:null},selectedFiles:{type:Array,default:()=>[]},isDeleteButton:{type:Boolean,default:!1}},emits:["delete-file","file-click","delete-folder"],setup(l,{emit:t}){const{t:a}=Re(),r=l,n=e.ref([]),o=e.ref(null),s=c=>{if(!c)return"";const u=new Date(c);return isNaN(u.getTime())?"":u.toISOString().slice(0,10)},i=()=>{n.value=r.files.sort((c,u)=>c.type==="dir"&&u.type!=="dir"?-1:c.type!=="dir"&&u.type==="dir"?1:0)};return e.onMounted(()=>i()),e.onUpdated(()=>i()),(c,u)=>{var d;return e.openBlock(),e.createElementBlock("div",CV,[((d=l.files)==null?void 0:d.length)===0?(e.openBlock(),e.createElementBlock("div",NV,[e.createVNode(e.unref(ea),{class:"w-12 h-12 mb-2"}),e.createElementVNode("p",null,e.toDisplayString(c.$t("noFilesInFolder")),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,p=>{var m;return e.openBlock(),e.createElementBlock(e.Fragment,{key:p==null?void 0:p.url},[(p==null?void 0:p.type)==="dir"?(e.openBlock(),e.createElementBlock("div",{key:0,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",onClick:f=>c.$emit("file-click",p)},[l.isDeleteButton?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:e.withModifiers(f=>{o.value=p},["stop"]),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"},[e.createVNode(e.unref(qt),{class:"w-4 h-4 text-gray-500 group-hover:text-red-500"})],8,vV)):e.createCommentVNode("",!0),e.createVNode(e.unref(rn),{class:"w-16 h-16 mx-auto mb-4 text-blue-600"}),e.createElementVNode("h3",SV,e.toDisplayString(p==null?void 0:p.name),1),e.createElementVNode("p",DV,e.toDisplayString(p==null?void 0:p.count)+" "+e.toDisplayString(c.$t("media.files")),1)],8,BV)):(p==null?void 0:p.type)==="file"?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["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",{"bg-accent text-accent-foreground ring-2 ring-primary":((m=l.selectedFile)==null?void 0:m.url)===(p==null?void 0:p.url)||l.selectedFiles&&l.selectedFiles.some(f=>f.id===p.id)}]),onClick:f=>c.$emit("file-click",p)},[e.createElementVNode("div",MV,[e.createElementVNode("div",TV,[e.createElementVNode("div",$V,[(p==null?void 0:p.filetype)==="image"&&(p!=null&&p.filepath||p!=null&&p.url)?(e.openBlock(),e.createElementBlock("div",LV,[e.createElementVNode("img",{src:p==null?void 0:p.preview,alt:(p==null?void 0:p.alt)||(p==null?void 0:p.filename),class:"object-cover w-full h-full rounded text-xs"},null,8,FV)])):(e.openBlock(),e.createBlock(e.unref(vl),{key:1,class:"w-12 h-12 text-gray-500"}))])]),e.createElementVNode("div",IV,[e.createElementVNode("div",OV,[e.createElementVNode("h3",PV,e.toDisplayString(p.filename),1),e.createVNode(VV,{type:p==null?void 0:p.filetype},null,8,["type"])]),e.createElementVNode("div",RV,[e.createElementVNode("div",jV,[e.createElementVNode("span",null,e.toDisplayString(c.$t("media.size"))+":",1),e.createElementVNode("span",null,e.toDisplayString(e.unref(Fs)(p.filesize)),1)]),e.createElementVNode("div",UV,[e.createElementVNode("span",null,e.toDisplayString(c.$t("media.uploaded"))+":",1),e.createElementVNode("span",null,e.toDisplayString(s(p.created_at)),1)])])])])],10,AV)):e.createCommentVNode("",!0)],64)}),128))])}}},HV={},KV={"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 16 16",width:"16",height:"16",fill:"currentColor"};function qV(l,t){return e.openBlock(),e.createElementBlock("svg",KV,[...t[0]||(t[0]=[e.createElementVNode("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),e.createElementVNode("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)])])}const GV=Jt(HV,[["render",qV]]),WV={},YV={"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 16 16",width:"16",height:"16",fill:"currentColor"};function XV(l,t){return e.openBlock(),e.createElementBlock("svg",YV,[...t[0]||(t[0]=[e.createElementVNode("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),e.createElementVNode("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)])])}const ZV=Jt(WV,[["render",XV]]),QV={key:0,class:"flex flex-col items-center justify-center h-64 text-muted-foreground"},JV={key:1,class:"w-full text-sm caption-bottom"},eC={class:"[&_tr]:border-b"},tC={class:"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted"},lC={class:"h-12 px-4 text-left align-middle font-medium text-muted-foreground w-[300px]"},aC={class:"h-12 px-4 font-medium text-left align-middle text-muted-foreground"},rC={class:"h-12 px-4 font-medium text-left align-middle text-muted-foreground"},nC={class:"hidden h-12 px-4 font-medium text-left align-middle text-muted-foreground md:table-cell"},oC={class:"[&_tr:last-child]:border-0"},sC=["onClick"],iC={class:"p-4 font-medium align-middle"},cC={class:"flex items-center gap-2"},dC={key:1,class:"relative w-8 h-8"},uC=["src","alt"],pC={class:"truncate max-w-[200px]"},mC={class:"p-4 align-middle"},fC={class:"p-4 align-middle"},hC={class:"hidden p-4 align-middle md:table-cell"},gC={key:0},yC={__name:"MediaList",props:{files:{type:Array,required:!0},selectedFile:{type:Object,default:null},selectedFiles:{type:Array,default:()=>[]}},emits:["file-click","delete-folder"],setup(l,{emit:t}){const{t:a}=Re(),r=e.ref(null),n=t,o=()=>{br({title:a("builder.deleteTitle"),message:a("builder.deleteObject"),type:"error",onConfirm:()=>{s()}})},s=()=>{n("delete-folder",r.value)};return(i,c)=>{const u=e.resolveComponent("File");return e.openBlock(),e.createElementBlock("div",null,[l.files.length===0?(e.openBlock(),e.createElementBlock("div",QV,[e.createVNode(u,{class:"w-12 h-12 mb-2"}),e.createElementVNode("p",null,e.toDisplayString(i.$t("media.noFilesInFolder")),1)])):(e.openBlock(),e.createElementBlock("table",JV,[e.createElementVNode("thead",eC,[e.createElementVNode("tr",tC,[e.createElementVNode("th",lC,e.toDisplayString(i.$t("media.name")),1),e.createElementVNode("th",aC,e.toDisplayString(i.$t("media.type")),1),e.createElementVNode("th",rC,e.toDisplayString(i.$t("media.size")),1),e.createElementVNode("th",nC,e.toDisplayString(i.$t("media.updatedAt")),1),c[0]||(c[0]=e.createElementVNode("th",null,null,-1))])]),e.createElementVNode("tbody",oC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.files,d=>{var p,m,f,g,y;return e.openBlock(),e.createElementBlock("tr",{key:d.id,class:e.normalizeClass(["border-b transition-colors hover:bg-blue-200/50 data-[state=selected]:bg-muted cursor-pointer",{"bg-blue-200":((p=r.value)==null?void 0:p.id)===d.id&&((m=r.value)==null?void 0:m.type)===d.type||l.selectedFiles&&l.selectedFiles.some(w=>w.id===d.id&&w.type===d.type)}]),onClick:w=>i.$emit("file-click",d)},[e.createElementVNode("td",iC,[e.createElementVNode("div",cC,[d.type==="dir"?(e.openBlock(),e.createBlock(GV,{key:0,class:"w-5 h-5 text-blue-500"})):(d==null?void 0:d.filetype)==="image"&&(d!=null&&d.filepath)?(e.openBlock(),e.createElementBlock("div",dC,[e.createElementVNode("img",{src:d==null?void 0:d.preview,alt:(d==null?void 0:d.alt)||(d==null?void 0:d.filename),class:"object-cover w-full h-full rounded"},null,8,uC)])):(d==null?void 0:d.filetype)==="image"?(e.openBlock(),e.createBlock(ZV,{key:2,class:"w-5 h-5 text-green-500"})):(e.openBlock(),e.createBlock(u,{key:3,class:"w-5 h-5 text-gray-500"})),e.createElementVNode("span",pC,e.toDisplayString((d==null?void 0:d.filename)||(d==null?void 0:d.name)),1)])]),e.createElementVNode("td",mC,e.toDisplayString((d==null?void 0:d.type)==="dir"?i.$t("media.folder"):((g=(f=d==null?void 0:d.filetype)==null?void 0:f.charAt(0))==null?void 0:g.toUpperCase())+((y=d==null?void 0:d.filetype)==null?void 0:y.slice(1))),1),e.createElementVNode("td",fC,e.toDisplayString((d==null?void 0:d.type)==="dir"?"--":e.unref(Fs)(d==null?void 0:d.filesize)),1),e.createElementVNode("td",hC,e.toDisplayString(d!=null&&d.updated_at?e.unref(_V)(d==null?void 0:d.updated_at):"--"),1),d.type==="dir"?(e.openBlock(),e.createElementBlock("td",gC,[e.createVNode(e.unref(qt),{class:"w-4 h-4 text-red-500 cursor-pointer",onClick:e.withModifiers(o,["stop"])},null,8,["onClick"])])):e.createCommentVNode("",!0)],10,sC)}),128))])]))])}}},bC={},kC={xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function xC(l,t){return e.openBlock(),e.createElementBlock("svg",kC,[...t[0]||(t[0]=[e.createElementVNode("path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"},null,-1),e.createElementVNode("polyline",{points:"9 22 9 12 15 12 15 22"},null,-1)])])}const wC=Jt(bC,[["render",xC]]),EC={class:"flex items-center space-x-1"},_C=["onClick"],VC={__name:"MediaBreadcrumb",props:{currentPath:{type:Array,required:!0}},emits:["navigate"],setup(l){return(t,a)=>(e.openBlock(),e.createElementBlock("div",EC,[e.createElementVNode("button",{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",onClick:a[0]||(a[0]=r=>t.$emit("navigate",[]))},[e.createVNode(wC,{class:"w-3 h-3"}),e.createTextVNode(" "+e.toDisplayString(t.$t("media.mediaLibrary")),1)]),l.currentPath.length>0?(e.openBlock(),e.createBlock(e.unref(ml),{key:0,class:"w-3 h-3 text-slate-400 dark:text-slate-500"})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.currentPath,(r,n)=>(e.openBlock(),e.createElementBlock("button",{key:n,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",onClick:o=>t.$emit("navigate",l.currentPath.slice(0,n+1))},[e.createVNode(e.unref(rn),{class:"w-3 h-3"}),e.createTextVNode(" "+e.toDisplayString(r)+" ",1),n<l.currentPath.length-1?(e.openBlock(),e.createBlock(e.unref(ml),{key:0,class:"w-3 h-3 text-slate-400 dark:text-slate-500"})):e.createCommentVNode("",!0)],8,_C))),128))]))}},CC=["src"],NC={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"},BC=["onClick"],vC=["onClick"],SC=["title"],DC={key:1,class:"relative group"},AC=["src"],MC={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"},TC=["title"],$C={key:2,class:"absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center rounded-lg z-10"},LC={class:"flex flex-col items-center gap-2"},FC={class:"text-xs text-gray-600"},IC=["multiple","disabled"],OC={class:"whitespace-nowrap text-sm"},PC={class:"whitespace-nowrap text-sm"},RC={class:"flex items-center justify-between p-4 border-b"},jC={class:"text-lg font-semibold"},UC={class:"flex items-center justify-between gap-4 p-4 border-b"},zC={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"},HC={class:"flex items-center justify-between gap-4"},KC={class:"flex items-center gap-4 flex-1"},qC={class:"relative flex-1 max-w-md"},GC=["placeholder"],WC={class:"flex items-center gap-2 relative"},YC={class:"text-xs font-bold"},XC={class:"text-xs font-bold"},ZC={key:0,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"},QC={class:"flex items-center gap-2"},JC={class:"flex flex-col gap-4 overflow-y-auto p-4 flex-1"},eN={class:"p-4 border-t flex items-center justify-between"},tN={key:0,class:"text-sm text-gray-600 dark:text-gray-400"},lN={key:1},aN=["disabled"],Zr={__name:"vs-form-media-select",props:e.mergeModels({multiple:{type:Boolean,default:!1},multi:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["change"],["update:modelValue"]),setup(l,{emit:t}){const{t:a}=Re(),r=dt.useRoute(),n=dt.useRouter(),o=e.useModel(l,"modelValue"),s=t,i=l,c=e.computed(()=>i.multiple||i.multi),u=e.ref(null),d=e.computed(()=>o.value||u.value),p=e.computed(()=>{if(!c.value)return[];const z=d.value;return z?Array.isArray(z)?z:[z]:[]}),m=e.computed(()=>d.value?typeof d.value=="object"?d.value.filename||d.value.file_name||d.value.native_file_name||"File":typeof d.value=="string"?d.value.split("/").pop()||d.value:"File":""),f=e.ref(!1),g=e.ref(!1),y=e.ref("grid"),w=e.ref([]),h=e.ref([]),k=e.ref([]),x=e.ref(),b=e.ref([]),_=e.ref(null),V=e.ref(!1),E=e.ref(null),D=e.ref(null),$=e.ref({}),C=e.ref(""),B=e.ref(!1),M=e.ref("name"),U=new Map([["name",a("media.sortBy.name")],["filesize",a("media.sortBy.filesize")]]),P=z=>typeof z=="string"?z:(z==null?void 0:z.filepath)||(z==null?void 0:z.file_path)||z,I=z=>z?typeof z=="string"?z.split("/").pop()||z:z.filename||z.file_name||z.native_file_name||"File":"",O=z=>typeof z=="string"?z:(z==null?void 0:z.preview)||`/file/resize?filepath=${P(z)}&h=137&quality=75`,F=()=>{_.value&&_.value.click()},H=()=>{f.value=!f.value,f.value&&Q()},Q=()=>{if(E.value){const z=E.value.getBoundingClientRect();$.value={top:`${z.bottom+10}px`,left:`${z.left+z.width/2}px`,transform:"translateX(-50%)",width:"200px"}}},pe=z=>{var X;if(z.type==="dir")qe([...w.value,z.name]);else if(c.value){const te=b.value.findIndex(le=>le.id===z.id);te>=0?b.value.splice(te,1):b.value.push(z)}else x.value=z.id===((X=x.value)==null?void 0:X.id)?null:z},Ve=z=>{M.value=z,B.value=!1,h.value=h.value.sort((X,te)=>{var le;if((X==null?void 0:X.type)==="dir")return-1;if(z==="name")return(le=X==null?void 0:X.name)==null?void 0:le.localeCompare(te==null?void 0:te.name);if(z==="filesize")return(te==null?void 0:te.filesize)-(X==null?void 0:X.filesize)})},ze=async()=>{try{const z=w.value.join("/"),te=await(await fetch(`/api/cms-media?subdir=${z}${C.value?"&search="+C.value:""}`,{method:"GET"})).json();te.data?(h.value=te.data.map(le=>({...le,id:le.type==="dir"?`dir-${le.name}`:le.id,preview:`/file/resize?filepath=${le.filepath}&h=137&quality=75`})),Ve(M.value)):h.value=[]}catch(z){console.error("Search error:",z),h.value=[]}},Kt=()=>{if(c.value){if(b.value.length>0){const z=Array.isArray(o.value)?[...o.value]:o.value?[o.value]:[],X=Array.isArray(u.value)?[...u.value]:u.value?[u.value]:[];b.value.forEach(te=>{const le=te.filepath||te.file_path;z.some(de=>(typeof de=="string"?de:(de==null?void 0:de.filepath)||(de==null?void 0:de.file_path))===le)||(z.push(le),X.push(te))}),o&&(o.value=z),u.value=X,s("change",z),b.value=[]}}else if(x.value){const z=x.value.filepath||x.value.file_path;o&&(o.value=z),u.value=x.value,s("change",z),x.value=null}Le()},Le=()=>{g.value=!1},qe=z=>{w.value=z,k.value=[...k.value,z],x.value=null,c.value&&(b.value=[]),yt()},Ct=()=>{k.value.length>1&&(k.value.pop(),w.value=k.value[k.value.length-1],x.value=null,c.value&&(b.value=[]),yt())},yt=async()=>{try{const z=w.value.join("/"),te=await(await fetch(`/api/cms-media?subdir=${z}${C.value?"&search="+C.value:""}`,{method:"GET"})).json();te.data?(h.value=te.data.map(le=>({...le,id:le.type==="dir"?`dir-${le.name}`:le.id,preview:`/file/resize?filepath=${le.filepath}&h=137&quality=75`})),Ve(M.value)):h.value=[]}catch(z){console.error("Fetch error:",z),h.value=[]}},wt=async(z,X)=>{try{const te=typeof z=="string"?z:P(z);if(await fetch(`/file/delete${te}`),c.value){const le=Array.isArray(o.value)?[...o.value]:[],de=Array.isArray(u.value)?[...u.value]:[];if(X!==void 0&&X>=0)le.splice(X,1),de.splice(X,1);else{const Se=le.findIndex(v=>(typeof v=="string"?v:(v==null?void 0:v.filepath)||(v==null?void 0:v.file_path))===te);Se>=0&&(le.splice(Se,1),de.splice(Se,1))}o&&(o.value=le.length>0?le:null),u.value=de.length>0?de:null,s("change",le.length>0?le:null)}else o&&(o.value=null),u.value=null,s("change",null);return!0}catch(te){return console.error(te),!1}},Lt=async z=>{try{const X=await fetch(`/file/download/files/uploads${z}`),te=await X.arrayBuffer(),le=X.headers["content-type"],de=new TextDecoder("utf-8").decode(te),Se=new Blob([de],{type:le}),v=document.createElement("a");v.setAttribute("download",z),v.href=window.URL.createObjectURL(Se),v.click()}catch(X){console.error(X.message)}},et=async z=>{if(!z.target.files||z.target.files.length===0)return;const X=Array.from(z.target.files);console.log("Uploading files:",X),V.value=!0;try{const te=[];for(const le of X){const de=new FormData;de.append("file",le);const Se=await fetch("/file/upload/uploads?id=1&form=form&table=table",{method:"POST",body:de});if(!Se.ok)throw new Error(`Upload failed: ${Se.status}`);const v=await Se.json();console.log("Upload result:",v);const S=v.result,q={file_id:S.file_id,file_name:S.file_name,file_path:S.file_path,filepath:S.file_path,format:S.format,size:S.size,entity_id:S.entity_id,dir:S.dir,native_file_name:S.native_file_name,preview:`/file/resize?filepath=${S.file_path}&h=137&quality=75`};te.push(q)}if(c.value){const le=Array.isArray(o.value)?[...o.value]:o.value?[o.value]:[],de=Array.isArray(u.value)?[...u.value]:u.value?[u.value]:[];te.forEach(Se=>{le.push(Se.file_path),de.push(Se)}),o&&(o.value=le),u.value=de,s("change",le)}else{const le=te[0];o&&(o.value=le.file_path),u.value=le,s("change",le.file_path)}f.value=!1}catch(te){console.error("Upload error:",te),alert("Помилка завантаження файлу: "+te.message)}finally{V.value=!1}z.target.value=""};e.watch(g,z=>{z&&yt()}),e.watch(w,z=>{z.length>0?n.push({query:{path:z.join("/")}}):n.push({query:{path:void 0}})});let at;return e.watch(C,z=>{clearTimeout(at),at=setTimeout(()=>{ze()},500)}),e.watch(o,z=>{var X,te,le,de;if(z&&typeof z=="object"){const Se=((X=x.value)==null?void 0:X.filepath)||((te=x.value)==null?void 0:te.file_path);z.filepath!==Se&&z.file_path!==Se&&(x.value=null)}else if(z&&typeof z=="string"){const Se=((le=x.value)==null?void 0:le.filepath)||((de=x.value)==null?void 0:de.file_path);z!==Se&&(x.value=null)}}),e.onMounted(()=>{var X,te;w.value=((te=(X=r.query)==null?void 0:X.path)==null?void 0:te.split("/"))||[],k.value=[[]],o.value||(x.value=null);const z=le=>{var de;f.value&&!((de=E.value)!=null&&de.contains(le.target))&&(f.value=!1),B.value&&D.value&&!D.value.contains(le.target)&&(B.value=!1)};document.addEventListener("click",z)}),(z,X)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",e.mergeProps(z.$attrs,{class:"flex gap-4 flex-wrap"}),[c.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(p.value,(te,le)=>(e.openBlock(),e.createElementBlock("div",{key:le,class:"relative group"},[e.createElementVNode("img",{src:O(te),alt:"Selected File",class:"w-32 h-32 object-cover rounded-lg"},null,8,CC),e.createElementVNode("div",NC,[e.createElementVNode("button",{type:"button",onClick:de=>wt(te,le),class:"p-2 rounded-full bg-red-500 text-white hover:bg-red-600 transition-colors"},[e.createVNode(e.unref(qt),{class:"w-4 h-4"})],8,BC),e.createElementVNode("button",{type:"button",onClick:de=>Lt(P(te)),class:"p-2 rounded-full bg-blue-500 text-white hover:bg-blue-600 transition-colors"},[e.createVNode(e.unref(ja),{class:"w-4 h-4"})],8,vC)]),e.createElementVNode("div",{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",title:I(te)},[e.createTextVNode(e.toDisplayString(I(te))+" ",1),X[12]||(X[12]=e.createElementVNode("div",{class:"absolute top-full left-4 border-4 border-transparent border-t-gray-900"},null,-1))],8,SC)]))),128)):d.value?(e.openBlock(),e.createElementBlock("div",DC,[e.createElementVNode("img",{src:d.value.preview||d.value,alt:"Selected File",class:"w-32 h-32 object-cover rounded-lg"},null,8,AC),e.createElementVNode("div",MC,[e.createElementVNode("button",{type:"button",onClick:X[0]||(X[0]=te=>{var le,de;return wt(((le=d.value)==null?void 0:le.filepath)||((de=d.value)==null?void 0:de.file_path)||d.value)}),class:"p-2 rounded-full bg-red-500 text-white hover:bg-red-600 transition-colors"},[e.createVNode(e.unref(qt),{class:"w-4 h-4"})]),e.createElementVNode("button",{type:"button",onClick:X[1]||(X[1]=te=>{var le,de;return Lt(((le=d.value)==null?void 0:le.filepath)||((de=d.value)==null?void 0:de.file_path)||d.value)}),class:"p-2 rounded-full bg-blue-500 text-white hover:bg-blue-600 transition-colors"},[e.createVNode(e.unref(ja),{class:"w-4 h-4"})])]),e.createElementVNode("div",{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",title:m.value},[e.createTextVNode(e.toDisplayString(m.value)+" ",1),X[13]||(X[13]=e.createElementVNode("div",{class:"absolute top-full left-4 border-4 border-transparent border-t-gray-900"},null,-1))],8,TC)])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"triggerButton",ref:E,class:e.normalizeClass(["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":f.value,"opacity-50 cursor-not-allowed":V.value}]),onClick:H},[V.value?(e.openBlock(),e.createBlock(e.unref(Ka),{key:0,class:"w-4 h-4 animate-spin text-blue-500"})):(e.openBlock(),e.createBlock(e.unref(gl),{key:1,class:"w-4 h-4"})),V.value?(e.openBlock(),e.createElementBlock("div",$C,[e.createElementVNode("div",LC,[e.createVNode(e.unref(Ka),{class:"w-6 h-6 animate-spin text-blue-500"}),e.createElementVNode("span",FC,e.toDisplayString(z.$t("media.uploading")),1)])])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed bg-white z-50 border border-gray-200 rounded-lg shadow-lg flex flex-col items-center justify-center",style:e.normalizeStyle($.value)},[e.createElementVNode("div",{class:e.normalizeClass(["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":V.value}]),onClick:X[3]||(X[3]=te=>!V.value&&F())},[e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:_,class:"absolute justify-center bottom-0 left-0 w-full opacity-0",onChange:et,onClick:X[2]||(X[2]=e.withModifiers(()=>{},["stop"])),multiple:c.value,disabled:V.value},null,40,IC),V.value?(e.openBlock(),e.createBlock(e.unref(Ka),{key:0,class:"w-4 h-4 animate-spin"})):(e.openBlock(),e.createBlock(e.unref(ja),{key:1})),e.createElementVNode("span",OC,e.toDisplayString(V.value?z.$t("media.uploading"):z.$t("media.upload")),1)],2),e.createElementVNode("div",{onClick:X[4]||(X[4]=te=>g.value=!0),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"},[e.createVNode(e.unref(za)),e.createElementVNode("span",PC,e.toDisplayString(z.$t("media.selectFromMedia")),1)])],4)):e.createCommentVNode("",!0)]))],2)],16),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",onClick:Le},[e.createElementVNode("div",{class:"bg-white rounded-lg shadow-xl max-w-4xl w-full mx-4 max-h-[90vh] flex flex-col",onClick:X[11]||(X[11]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",RC,[e.createElementVNode("h3",jC,e.toDisplayString(z.$t("media.selectFiles")),1),e.createElementVNode("button",{onClick:Le,class:"text-gray-400 hover:text-gray-600"},[...X[14]||(X[14]=[e.createElementVNode("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),e.createElementVNode("div",UC,[e.createVNode(VC,{"current-path":w.value,onNavigate:qe,onNavigateBack:Ct},null,8,["current-path"])]),e.createElementVNode("div",zC,[e.createElementVNode("div",HC,[e.createElementVNode("div",KC,[e.createElementVNode("div",qC,[e.createVNode(e.unref(qa),{class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-slate-400 dark:text-slate-500"}),e.withDirectives(e.createElementVNode("input",{type:"text",placeholder:z.$t("media.search"),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","onUpdate:modelValue":X[5]||(X[5]=te=>C.value=te)},null,8,GC),[[e.vModelText,C.value]])]),e.createElementVNode("div",WC,[e.createElementVNode("span",YC,e.toDisplayString(z.$t("media.sortBy.title")+": "),1),e.createElementVNode("button",{ref_key:"sortByButton",ref:D,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",onClick:X[8]||(X[8]=te=>B.value=!B.value)},[e.createVNode(e.unref(an),{class:"w-4 h-4"}),e.createElementVNode("span",XC,e.toDisplayString(e.unref(U).get(M.value)),1),B.value?(e.openBlock(),e.createElementBlock("div",ZC,[e.createElementVNode("span",{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",onClick:X[6]||(X[6]=e.withModifiers(te=>Ve("name"),["stop"]))},e.toDisplayString(z.$t("media.sortBy.name")),1),e.createElementVNode("span",{class:"text-left text-xs font-bold w-full p-2 hover:bg-slate-100 dark:hover:bg-slate-600 cursor-pointer",onClick:X[7]||(X[7]=e.withModifiers(te=>Ve("filesize"),["stop"]))},e.toDisplayString(z.$t("media.sortBy.filesize")),1)])):e.createCommentVNode("",!0)],512)])]),e.createElementVNode("div",QC,[e.createElementVNode("button",{class:e.normalizeClass(["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",{"shadow bg-blue-600 hover:bg-blue-700 text-white":y.value==="grid","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":y.value==="list"}]),onClick:X[9]||(X[9]=te=>y.value="grid")},[e.createVNode(e.unref(ri),{class:"w-4 h-4"})],2),e.createElementVNode("button",{class:e.normalizeClass(["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",{"shadow bg-blue-600 hover:bg-blue-700 text-white":y.value==="list","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":y.value==="grid"}]),onClick:X[10]||(X[10]=te=>y.value="list")},[e.createVNode(e.unref(Ha),{class:"w-4 h-4"})],2)])])]),e.createElementVNode("div",JC,[y.value==="grid"?(e.openBlock(),e.createBlock(zV,{key:0,files:h.value,"selected-file":c.value?null:x.value,"selected-files":c.value?b.value:[],onFileClick:pe},null,8,["files","selected-file","selected-files"])):(e.openBlock(),e.createBlock(yC,{key:1,files:h.value,"selected-file":c.value?null:x.value,"selected-files":c.value?b.value:[],onFileClick:pe},null,8,["files","selected-file","selected-files"]))]),e.createElementVNode("div",eN,[c.value&&b.value.length>0?(e.openBlock(),e.createElementBlock("div",tN,e.toDisplayString(z.$t("media.selectedFiles",{count:b.value.length})),1)):(e.openBlock(),e.createElementBlock("div",lN)),e.createElementVNode("button",{onClick:Kt,disabled:c.value?b.value.length===0:!x.value,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"},[e.createVNode(e.unref(gl),{class:"w-4 h-4 mr-2"}),e.createTextVNode(" "+e.toDisplayString(z.$t("common.actions.add")),1)],8,aN)])])])):e.createCommentVNode("",!0)]))],64))}},rN={};function nN(l,t){const a=e.resolveComponent("vs-richtext-md",!0);return e.openBlock(),e.createBlock(a,{class:"w-full h-[300px]"})}const oN=Jt(rN,[["render",nN]]),sN={props:{min:{type:Number},step:{type:Number,default:()=>1},max:{type:Number,default:()=>1/0},modelValue:{type:Number,default:()=>null},label:{type:String,default:()=>""},placeholder:{type:String,default:()=>"0"},disabled:{type:Boolean,default:()=>!1}},data(){return{id:`input-number-${Math.floor(Math.random()*1e3)}`,inputValue:this.modelValue}},watch:{modelValue(l){this.inputValue=l},inputValue(l){this.$emit("update:modelValue",l)}},methods:{validateInput(l){(l.key==="+"||l.key===","||l.key==="."||l.key==="-"&&this.inputValue&&this.inputValue.toString().length>0)&&l.preventDefault()},handleBlur(){let l=parseFloat(this.inputValue);this.$emit("blur"),isNaN(l)?l=this.min:l>this.max?l=this.max:l<this.min&&(l=this.min),this.inputValue=l,this.$emit("update:modelValue",this.inputValue)}}},iN={class:"p-0"},cN=["step","min","max","id","placeholder","disabled"];function dN(l,t,a,r,n,o){return e.openBlock(),e.createElementBlock("div",iN,[e.renderSlot(l.$slots,"label",e.normalizeProps(e.guardReactiveProps({id:n.id}))),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=s=>n.inputValue=s),type:"number",onKeydown:t[1]||(t[1]=(...s)=>o.validateInput&&o.validateInput(...s)),onBlur:t[2]||(t[2]=(...s)=>o.handleBlur&&o.handleBlur(...s)),step:a.step,min:a.min,max:a.max,id:n.id,"aria-describedby":"helper-text-explanation",class:e.normalizeClass(["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":a.disabled}]),placeholder:a.placeholder,disabled:a.disabled},null,42,cN),[[e.vModelText,n.inputValue]])])}const uN=Jt(sN,[["render",dN]]),pN={class:"flex items-center justify-end gap-2"},mN={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},fN={__name:"vs-form-custom-datatable-controls",props:e.mergeModels({item:{type:Object,required:!0},colModel:{type:Array,required:!0}},{modelValue:{type:Array,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const{t}=Re(),a=l,r=e.useModel(l,"modelValue"),n=e.ref(!1),o=e.ref({}),s=e.ref({}),i=()=>{br({title:t("builder.deleteTitle"),message:t("builder.deleteField"),type:"error",onConfirm:()=>{c()}})},c=()=>{r.value=r.value.filter(d=>d.id!==a.item.id)},u=async()=>{if(await s.value.validate()){xe({type:"warning",title:t("common.actions.warning"),message:t("builder.editFieldFailed")});return}r.value=r.value.map(p=>p.id===a.item.id?o.value:p),n.value=!1};return e.watch(n,d=>{d&&(o.value=a.item)}),(d,p)=>(e.openBlock(),e.createElementBlock("div",pN,[e.createElementVNode("button",{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",onClick:p[0]||(p[0]=m=>n.value=!0)},[e.createVNode(e.unref(on),{class:"w-4 h-4"})]),e.createElementVNode("button",{onClick:i,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"},[e.createVNode(e.unref(qt),{class:"w-4 h-4"})]),e.createVNode(e.unref(xl),{teleport:"#modal",title:d.$t("builder.editField"),visible:n.value,onClose:p[4]||(p[4]=m=>n.value=!1)},{footer:e.withCtx(()=>[e.createElementVNode("div",mN,[e.createElementVNode("button",{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",onClick:p[3]||(p[3]=m=>n.value=!1)},e.toDisplayString(d.$t("common.actions.cancel")),1),e.createElementVNode("button",{onClick:u,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"},e.toDisplayString(d.$t("common.actions.save")),1)])]),default:e.withCtx(()=>[e.createVNode(e.unref(mt),{form:s.value,"onUpdate:form":p[1]||(p[1]=m=>s.value=m),schema:l.colModel,modelValue:o.value,"onUpdate:modelValue":p[2]||(p[2]=m=>o.value=m)},null,8,["form","schema","modelValue"])]),_:1},8,["title","visible"])]))}},hN={class:"p-6 border-t border-slate-200 dark:border-slate-700 bg-slate-50/30 dark:bg-slate-700/30"},gN={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},yN={__name:"vs-form-custom-datatable-add",props:e.mergeModels({colModel:{type:Array,required:!0}},{modelValue:{type:Array,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const{t}=Re(),a=e.useModel(l,"modelValue"),r=e.ref(!1),n=e.ref({}),o=e.ref({}),s=async()=>{try{if(await o.value.validate()){xe({type:"warning",title:t("common.actions.warning"),message:t("builder.editFieldFailed")});return}a.value=[...a.value||[],{...n.value,id:Math.random().toString(36).substring(2,15)}],r.value=!1,n.value={}}catch(i){console.log(i)}};return(i,c)=>(e.openBlock(),e.createElementBlock("div",hN,[e.createElementVNode("button",{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",onClick:c[0]||(c[0]=u=>r.value=!0)},[e.createVNode(e.unref(gl),{class:"w-4 h-4 mr-2"}),e.createTextVNode(" "+e.toDisplayString(i.$t("common.actions.add")),1)]),e.createVNode(e.unref(xl),{teleport:"#modal",title:i.$t("common.actions.add"),visible:r.value,onClose:c[4]||(c[4]=u=>r.value=!1)},{footer:e.withCtx(()=>[e.createElementVNode("div",gN,[e.createElementVNode("button",{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",onClick:c[3]||(c[3]=u=>r.value=!1)},e.toDisplayString(i.$t("common.actions.cancel")),1),e.createElementVNode("button",{onClick:s,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"},e.toDisplayString(i.$t("common.actions.save")),1)])]),default:e.withCtx(()=>[e.createVNode(e.unref(mt),{form:o.value,"onUpdate:form":c[1]||(c[1]=u=>o.value=u),schema:l.colModel,modelValue:n.value,"onUpdate:modelValue":c[2]||(c[2]=u=>n.value=u)},null,8,["form","schema","modelValue"])]),_:1},8,["title","visible"])]))}},bN={class:"p-0 shadow w-full"},kN={class:"overflow-x-auto"},xN={class:"relative w-full overflow-auto"},wN={class:"w-full caption-bottom text-sm"},EN={class:"[&_tr]:border-b"},_N={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"},VN={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"},CN={class:"[&_tr:last-child]:border-0"},NN=["onDragstart","onDragover","onDrop","onDragenter"],BN={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center"},vN={class:"flex items-center justify-center text-slate-400"},SN=["innerHTML"],DN={key:1,class:"flex items-center gap-2"},AN={key:0,class:"flex items-center gap-1"},MN=["src","alt"],TN={key:0,class:"text-xs text-gray-500 dark:text-gray-400 ml-1"},$N={key:1,class:"w-8 h-8 rounded bg-gray-100 dark:bg-gray-700 flex items-center justify-center"},LN={key:2},FN={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},IN={key:0,class:"h-2 bg-blue-200 dark:bg-blue-800 transition-all duration-200"},Is=3,ON={__name:"vs-form-custom-datatable",props:e.mergeModels({colModel:{type:Array,required:!0}},{modelValue:{type:Array,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=e.useModel(l,"modelValue"),a=e.ref(null),r=e.ref(-1),n=e.ref(!1),o=(f,g,y)=>{a.value=g,r.value=y,f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/html","")},s=(f,g)=>{f.preventDefault(),f.dataTransfer.dropEffect="move"},i=(f,g)=>{r.value!==g&&(n.value=!0)},c=f=>{f.currentTarget.contains(f.relatedTarget)||(n.value=!1)},u=(f,g)=>{if(f.preventDefault(),n.value=!1,r.value===-1||r.value===g)return;const y=[...t.value],[w]=y.splice(r.value,1);y.splice(g,0,w),t.value=y,a.value=null,r.value=-1},d=f=>Array.isArray(f)?f.slice(0,Is):[],p=f=>Array.isArray(f)?Math.max(0,f.length-Is):0,m=f=>{const g=f.target;g.style.display="none";const y=document.createElement("div");y.className="w-full h-full flex items-center justify-center bg-gray-200 dark:bg-gray-600",y.innerHTML=`
|
|
196
|
+
<svg class="w-4 h-4 text-gray-400" fill="currentColor" viewBox="0 0 20 20">
|
|
197
|
+
<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" />
|
|
198
|
+
</svg>
|
|
199
|
+
`,g.parentNode.appendChild(y)};return e.onMounted(()=>{var f,g;(g=(f=t.value)==null?void 0:f.filter(y=>typeof y=="object"))==null||g.forEach(y=>y.id?y.id:y.id=Math.random().toString(36).substring(2,15))}),(f,g)=>(e.openBlock(),e.createElementBlock("div",bN,[e.createElementVNode("div",kN,[e.createElementVNode("div",xN,[e.createElementVNode("table",wN,[e.createElementVNode("thead",EN,[e.createElementVNode("tr",_N,[g[4]||(g[4]=e.createElementVNode("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)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.colModel,y=>(e.openBlock(),e.createElementBlock("th",{key:y.name,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]"},e.toDisplayString(y.label||y.title||y.name),1))),128)),e.createElementVNode("th",VN,e.toDisplayString(f.$t("table.actions")),1)])]),e.createElementVNode("tbody",CN,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(y,w)=>(e.openBlock(),e.createElementBlock("tr",{key:y==null?void 0:y.id,class:e.normalizeClass(["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":a.value===y}]),draggable:"true",onDragstart:h=>o(h,y,w),onDragover:h=>s(h),onDrop:h=>u(h,w),onDragenter:h=>i(h,w),onDragleave:g[2]||(g[2]=h=>c(h))},[e.createElementVNode("td",BN,[e.createElementVNode("div",vN,[e.createVNode(e.unref(nn))])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.colModel,h=>(e.openBlock(),e.createElementBlock("td",{key:h.name,class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-slate-600 dark:text-slate-400 text-sm"},[h.type==="Texteditor"?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:y[h.key]||"-"},null,8,SN)):h.type==="File"?(e.openBlock(),e.createElementBlock("div",DN,[Array.isArray(y[h.key])&&y[h.key].length>0?(e.openBlock(),e.createElementBlock("div",AN,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d(y[h.key]),(k,x)=>(e.openBlock(),e.createElementBlock("div",{key:x,class:"relative w-8 h-8 rounded overflow-hidden bg-gray-100 dark:bg-gray-700 flex-shrink-0"},[e.createElementVNode("img",{src:k,alt:`Image ${x+1}`,class:"w-full h-full object-cover",onError:g[0]||(g[0]=b=>m(b))},null,40,MN)]))),128)),p(y[h.key])>0?(e.openBlock(),e.createElementBlock("span",TN," +"+e.toDisplayString(p(y[h.key])),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",$N,[...g[5]||(g[5]=[e.createElementVNode("svg",{class:"w-4 h-4 text-gray-400",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("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"})],-1)])]))])):(e.openBlock(),e.createElementBlock("span",LN,e.toDisplayString(y[h.key]||"-"),1))]))),128)),e.createElementVNode("td",FN,[e.createVNode(fN,{item:y,colModel:l.colModel,modelValue:t.value,"onUpdate:modelValue":g[1]||(g[1]=h=>t.value=h)},null,8,["item","colModel","modelValue"])])],42,NN))),128)),n.value?(e.openBlock(),e.createElementBlock("tr",IN)):e.createCommentVNode("",!0)])])])]),e.createVNode(yN,{colModel:l.colModel,modelValue:t.value,"onUpdate:modelValue":g[3]||(g[3]=y=>t.value=y)},null,8,["colModel","modelValue"])]))}},PN={__name:"vs-form-reletion-link",props:e.mergeModels({relation:{type:String,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=e.useModel(l,"modelValue"),a=l,r=e.ref([]),n=async()=>{const s=await(await fetch(`/api/cms-suggest/${a.relation}`)).json();r.value=s==null?void 0:s.data};return e.onMounted(n),(o,s)=>{var i;return(i=r.value)!=null&&i.length?(e.openBlock(),e.createBlock(e.unref(xr),{key:0,mode:"combo",modelValue:t.value,"onUpdate:modelValue":s[0]||(s[0]=c=>t.value=c),options:r.value},null,8,["modelValue","options"])):e.createCommentVNode("",!0)}}},Os=l=>{var r,n;const t=(r=l==null?void 0:l.type)==null?void 0:r.toLowerCase(),a=l!=null&&l.required?["required"]:null;return t==="array"?{key:l.name,label:l.label||l.title,type:"multi-text",help:l==null?void 0:l.help,colModel:{type:(l==null?void 0:l.subtype)||"text",placeholder:l==null?void 0:l.placeholder},validators:a}:t==="boolean"?{key:l.name,label:l.label||l.title,type:"Switcher",help:l==null?void 0:l.help,validators:a}:t==="tags"?{key:l.name,label:l.label||l.title,type:"tags",help:l==null?void 0:l.help,validators:a}:t==="radio"?{key:l.name,label:l.label||l.title,type:"radio",help:l==null?void 0:l.help,options:l.options||[],validators:a}:t==="date"?{key:l.name,label:l.label||l.title,type:"Date",time:!1,help:l==null?void 0:l.help,validators:a}:t==="datetime"?{key:l.name,label:l.label||l.title,type:"Date",help:l==null?void 0:l.help,mode:"datetime",time:!0,validators:a}:t==="number"?{key:l.name,label:l.label||l.title,help:l==null?void 0:l.help,type:"Number",validators:a}:t==="integer"?{key:l.name,label:l.label||l.title,type:"Integer",help:l==null?void 0:l.help,validators:a}:t==="text"?{key:l.name,label:l.label||l.title,type:"Text",help:l==null?void 0:l.help,validators:a}:t==="file"?{key:l.name,label:l.label||l.title,type:"File",multiple:l.multi||l.multiple,help:l==null?void 0:l.help,validators:a,api:"/api/cms-media/upload?subdir=",dir:"uploads/"+new Date().toLocaleDateString("en-US").replace(/\//g,"-")}:t==="filelist"?{key:l.name,label:l.label||l.title,type:"file",multiple:!0,help:l==null?void 0:l.help,validators:a}:t==="slug"?{key:l.name,label:l.label||l.title,type:"Slug",parent:l.parent||"",help:l==null?void 0:l.help,validators:a}:t==="image"?{key:l.name,label:l.label||l.title,type:"File",multi:l.multiple,help:l==null?void 0:l.help,validators:a,api:"/api/cms-media/upload?subdir=",dir:"uploads/"+new Date().toLocaleDateString("en-US").replace(/\//g,"-")}:t==="select"?l.options?{key:l.name,label:l.label||l.title,type:"select",options:l.options||[],help:l==null?void 0:l.help,validators:a}:{key:l.name,label:l.label||l.title,type:"select",data:l.data||[],help:l==null?void 0:l.help,validators:a}:t==="multiselect"?{key:l.name,label:l.label||l.title,type:"select",data:l.data||[],parent:l.parent||"",options:l.options||[],help:l==null?void 0:l.help,validators:a,multiple:!0}:t==="richtext"?{key:l.name,label:l.label||l.title,type:"Texteditor",help:l==null?void 0:l.help,validators:a}:t==="datalist"?{key:l.name,label:l.label||l.title,type:"Custom-Datatable",colModel:((n=l.colModel)==null?void 0:n.map(o=>Os(o)))||[],help:l==null?void 0:l.help,validators:a}:t==="reference"?{key:l.name,label:l.label||l.title,type:"reference",reference_type:l.reference_type,help:l==null?void 0:l.help,validators:a}:t==="reference-list"?{key:l.name,label:l.label||l.title,type:"reference",reference_type:l.reference_type,help:l==null?void 0:l.help,validators:a}:t==="relation"?(console.log(l),{key:l.name,label:l.label||l.title,type:"relation-link",help:l==null?void 0:l.help,relation:l.relation,validators:a}):t==="markdown"?{key:l.name,label:l.label||l.title,type:"richtext-md",help:l==null?void 0:l.help,validators:a}:t==="mediaselect"?{key:l.name,label:l.label||l.title,type:"mediaselect",help:l==null?void 0:l.help,validators:a}:{key:l.name,label:l.label||l.title,placeholder:l.placeholder,help:l==null?void 0:l.help,type:"Text",validators:a}},RN={__name:"VsFormTags",props:{modelValue:{default:()=>[]},modelModifiers:{}},emits:["update:modelValue"],setup(l,{expose:t}){const{t:a}=Re(),r=e.useModel(l,"modelValue"),n=e.ref({}),o=e.ref(!1);e.provide("metaParentValue",r);const s=p=>Array.isArray(p)?p.map(m=>typeof m=="object"&&m!==null&&m.id?m.id:m):[],i=async p=>{if(!Array.isArray(p)||p.length===0)return[];try{const f=await(await fetch("/api/tags")).json(),g=(f==null?void 0:f.rows)||[];return p.map(y=>{const w=g.find(h=>h.tag_id===y);return w?{id:w.tag_id,text:w.value,color:w.color}:{id:y,text:"",color:"#ababab"}})}catch(m){return console.error("Error fetching tags:",m),p.map(f=>({id:f,text:"",color:"#ababab"}))}};e.onMounted(async()=>{await e.nextTick(),await e.nextTick(),setTimeout(()=>{var p;if(Array.isArray((p=r.value)==null?void 0:p.tag_list)){const m=s(r.value.tag_list);JSON.stringify(m)!==JSON.stringify(r.value.tag_list)&&(r.value.tag_list=m)}},100)}),e.watch(()=>r.value.tag_list,p=>{if(Array.isArray(p)&&!o.value){const m=s(p);JSON.stringify(m)!==JSON.stringify(p)&&(r.value.tag_list=m)}},{deep:!0}),e.watch(()=>r.value,p=>{if(p&&Array.isArray(p.tag_list)&&!o.value){const m=s(p.tag_list);JSON.stringify(m)!==JSON.stringify(p.tag_list)&&(p.tag_list=m)}},{deep:!0,immediate:!0}),e.watch(()=>{var p;return(p=r.value)==null?void 0:p.tag_list},p=>{Array.isArray(p)&&n.value&&e.nextTick(()=>{n.value&&n.value.setValue&&n.value.setValue("tag_list",p)})},{deep:!0});const c=async p=>{if(p.tag_list&&(p.tag_list=s(p.tag_list),r.value.tag_list=p.tag_list),await n.value.validate()){xe({type:"warning",title:a("common.actions.warning"),message:a("builder.editFieldFailed")});return}};t({restoreTagsBeforeSubmit:async()=>{var p;if(o.value=!0,Array.isArray((p=r.value)==null?void 0:p.tag_list)){console.log("Before restore:",r.value.tag_list);const m=await i(r.value.tag_list);console.log("After restore:",m),r.value.tag_list=m}setTimeout(()=>{o.value=!1},2e3)}});const d=e.computed(()=>{var p;return[{key:"tag_list",type:"select",multiple:!0,searchable:!1,placeholder:a("builder.tags"),data:"tag_id",value:((p=r.value)==null?void 0:p.tag_list)||[]}]});return(p,m)=>r.value?(e.openBlock(),e.createBlock(e.unref(mt),{key:0,schema:d.value,modelValue:r.value,"onUpdate:modelValue":[m[0]||(m[0]=f=>r.value=f),c]},null,8,["schema","modelValue"])):e.createCommentVNode("",!0)}},jN={class:"flex justify-end mb-4"},UN=["href"],zN=["src"],HN=["src"],KN={key:2,class:"w-full h-[80vh] flex items-center justify-center text-gray-500"},qN={__name:"VsPreview",props:{preview_path:{type:String,default:""},slug:{type:String,default:""}},setup(l){const t=e.ref(""),a=e.ref(""),r=async()=>{var o,s;try{const c=await(await fetch("/api/settings")).json();t.value=((s=(o=c==null?void 0:c.settings)==null?void 0:o.site_info)==null?void 0:s.previewUrl)||"http://ip.local.softpro.ua"}catch(i){console.error("Failed to fetch settings:",i),t.value="http://ip.local.softpro.ua"}},n=async()=>{var o;try{const i=await(await fetch("/user")).json();a.value=(o=i==null?void 0:i.user)==null?void 0:o.draftKey}catch(s){console.error("Failed to fetch user:",s)}};return e.onMounted(()=>{r(),n()}),(o,s)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",jN,[e.createElementVNode("a",{href:`${t.value}/uk/${l.preview_path}${l.slug}${a.value?`?draftKey=${a.value}`:""}`,target:"_blank",class:"inline-flex items-center gap-2 px-3 py-1.5 text-black-600 bg-white border border-blue-200 rounded hover:border-blue-300 hover:bg-blue-50 transition-colors duration-200 font-normal cursor-pointer"},[s[0]||(s[0]=e.createTextVNode(" Переглянути на сайті ",-1)),e.createVNode(e.unref(li),{class:"w-4 h-4"})],8,UN)]),t.value&&l.preview_path?(e.openBlock(),e.createElementBlock("iframe",{key:0,src:`${t.value}/uk/${l.preview_path}${l.slug}?hideHeader=true&hideFooter=true`,class:"w-full h-[80vh]"},null,8,zN)):t.value?(e.openBlock(),e.createElementBlock("iframe",{key:1,src:`${t.value}/uk/${l.slug}?hideHeader=true&hideFooter=true`,class:"w-full h-[80vh]"},null,8,HN)):(e.openBlock(),e.createElementBlock("div",KN," Loading preview... "))]))}},GN={class:"space-y-6 max-w-6xl mx-auto relative bg-white"},WN={class:"p-4 sticky top-[-24px] z-10 bg-white dark:bg-slate-800"},YN={class:"flex items-center justify-between"},XN={class:"flex items-center gap-4"},ZN={class:"text-2xl font-semibold text-gray-900 dark:text-white"},QN=["href","title"],JN={class:"flex items-center space-x-3"},eB={class:"w-full mt-6 flex items-center justify-between"},tB={class:"flex items-center w-full h-10 max-w-md grid-cols-3 p-1 bg-white border border-gray-200 rounded-md text-muted-foreground"},lB=["onClick"],aB={class:"flex items-center gap-2"},rB={for:"is_pin",class:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer"},nB={class:"relative"},oB={key:0,class:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20"},sB={class:"container mx-auto bg-white rounded-md pb-4 px-5"},iB={class:"container mx-auto bg-white rounded-md pb-4 px-2"},cB={key:0,class:"container mx-auto bg-white rounded-md pb-4 px-2"},dB={class:"container mx-auto bg-white rounded-md pb-4 px-2"},Ps=e.defineComponent({__name:"contentForm",setup(l){ot["vs-input-custom-datatable"]=ON,ot["vs-input-reference"]=Ls,ot["vs-input-texteditor"]=$s,ot["vs-input-mediaselect"]=Zr,ot["vs-input-file"]=Zr,ot["vs-input-image"]=Zr,ot["vs-input-richtext-md"]=oN,ot["vs-input-integer"]=uN,ot["vs-input-relation-link"]=PN;const{t,locale:a}=Re(),r=dt.useRouter(),n=dt.useRoute(),o=e.inject("menu",e.ref([])),s=e.ref([]),i=e.ref({}),c=e.ref({}),u=e.ref({}),d=e.ref(""),p=$=>{const C=[];return $.forEach(B=>{if(C.push(B),B.localization){const M={...B,name:B.name+":en",label:B.label+" (en)"};C.push(M)}}),C},m=e.computed(()=>{var $;return($=s.value)==null?void 0:$.map(Os)}),f=e.computed(()=>(a.value,J2.flatMap($=>{const C={...$,label:t($.label)};if($.localization){const B={...$,key:`${$.key}:en`,label:t($.label)+" (en)"};return[C,B]}return[C]}))),g=e.ref({}),y=e.ref({title:"",status:"draft"}),w=e.computed(()=>{const $=[{id:"content",name:t("builder.content")},{id:"seo",name:t("builder.seo")},{id:"tags",name:t("builder.tags")}];return d.value&&$.push({id:"preview",name:t("builder.preview")}),$}),h=e.ref("content"),k=e.computed(()=>{var C,B,M,U;const $=((C=n.params)==null?void 0:C.collection)||((B=n.params)==null?void 0:B.id);return((U=(M=o.value)==null?void 0:M.find(P=>P.id===$))==null?void 0:U.title)||$}),x=e.computed(()=>{var $,C;return(($=y.value)==null?void 0:$.title)||((C=n.params)!=null&&C.id?t("builder.editCollection"):t("articles.createArticle"))}),b=e.computed(()=>{var M,U,P;const $=((M=n.params)==null?void 0:M.collection)||((U=n.params)==null?void 0:U.id),C=(P=n.params)==null?void 0:P.id,B=[{label:k.value,route:`collections/${$}`}];return C?B.push({label:x.value,route:`collections/${$}/${C}`}):B.push({label:t("articles.createArticle"),route:`collections/${$}/create`}),B}),_=$=>{$==="collections"?r.push("/collections"):r.push(`/${$}`)};e.onMounted(async()=>{var U,P,I;const $=(U=n.params)==null?void 0:U.collection,C=(P=n.params)==null?void 0:P.id,B=$||C,M=$&&C?C:void 0;if(!M){if(!B)return;const F=await(await fetch(`/api/cms/${B}/`)).json();s.value=p(F.columns)}try{if(!M||!B)return;const O=await fetch(`/api/cms/${B}/${M}`);if(!O.ok)throw new Error("Failed to fetch article");const F=await O.json();if(s.value=p(F==null?void 0:F.columns),F!=null&&F.preview_path&&(d.value=F==null?void 0:F.preview_path),F.rows){let H=F.rows;Array.isArray(H)||(H=[H]),y.value=H[0],await e.nextTick(),(I=H[0])!=null&&I.meta?g.value={...H[0].meta}:g.value={title:"",description:"",keywords:"",meta:{}},console.log("Initialized seoData from rows[0]:",g.value)}else y.value=F,await e.nextTick(),F!=null&&F.meta?(g.value={title:F.meta.title||"",description:F.meta.description||"",keywords:F.meta.keywords||"",meta:{...F.meta}},delete g.value.meta.title,delete g.value.meta.description,delete g.value.meta.keywords):g.value={title:"",description:"",keywords:"",meta:{}},console.log("Initialized seoData from data:",g.value)}catch(O){console.error("Error fetching article:",O)}});const V=e.computed({get:()=>{var $;return(($=y.value)==null?void 0:$.is_pin)||!1},set:$=>{y.value&&(y.value.is_pin=$)}}),E=()=>{y.value&&(y.value.is_pin=!y.value.is_pin)};e.watch(g,$=>{console.log("seoData changed:",$)},{deep:!0});const D=async $=>{var I,O,F,H;const C=(I=n.params)==null?void 0:I.collection,B=(O=n.params)==null?void 0:O.id,M=await i.value.validate();if(M){xe({title:t("validation"),message:JSON.stringify(M),type:"warning"});return}(F=u.value)!=null&&F.restoreTagsBeforeSubmit&&await u.value.restoreTagsBeforeSubmit();const U=g.value||{},P={...y.value,meta:{...U,...U.meta||{}}};console.log("Payload before submit:",P);try{const Q=await fetch(`/api/cms/${C}/${B||""}`,{method:B?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)});if(!Q.ok){let pe;try{const Ve=await Q.json();pe=JSON.stringify(Ve,null,2)}catch{pe=await Q.text()}throw new Error(`HTTP ${Q.status}: ${pe}`)}if(!B)try{const pe=await Q.json(),Ve=pe.id||((H=pe.data)==null?void 0:H.id);Ve&&n.name==="createArticle"&&await r.push(`/collections/${C}/${Ve}`)}catch(pe){console.warn("Could not parse response to get ID:",pe)}xe({title:t("common.success"),message:t("common.successMessage"),type:"success"})}catch(Q){console.error("Submit error:",Q),xe({title:t("common.error"),message:"Помилка збереження",type:"error"})}};return($,C)=>{var B,M,U,P,I,O,F;return e.openBlock(),e.createElementBlock("div",GN,[e.createElementVNode("div",WN,[e.createVNode(Ko,{items:b.value,onNavigate:_},null,8,["items"]),e.createElementVNode("div",YN,[e.createElementVNode("div",XN,[e.createElementVNode("button",{onClick:C[0]||(C[0]=H=>e.unref(r).back()),class:"p-2 text-gray-500 rounded-full hover:text-gray-900 dark:text-gray-400 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"},[e.createVNode(e.unref(ei),{class:"w-5 h-5"})]),e.createElementVNode("h1",ZN,[e.createTextVNode(e.toDisplayString($.$t("builder.editCollection"))+" ",1),e.createElementVNode("span",null,'"'+e.toDisplayString(((B=y.value)==null?void 0:B.type)==="single"?y.value.title:(U=(M=e.unref(o).value)==null?void 0:M.find(H=>H.id===(e.unref(n).params.collection||e.unref(n).params.id)))==null?void 0:U.title)+'"',1)]),e.createElementVNode("a",{href:`https://cms.opengis.info/${e.unref(a)}/guides/content/`,target:"_blank",title:$.$t("guide.content")},[e.createVNode(e.unref(fl),{class:"w-5 h-5"})],8,QN)]),e.createElementVNode("div",JN,[e.createElementVNode("button",{onClick:D,type:"submit",class:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium h-9 px-4 py-2 bg-blue-600 text-white shadow-md transition-all duration-200 transform hover:bg-blue-700 hover:shadow-lg hover:scale-105 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"},[e.createVNode(e.unref(ni),{class:"w-4 h-4 mr-2"}),e.createTextVNode(" "+e.toDisplayString($.$t("builder.save")),1)])])]),e.createElementVNode("div",eB,[e.createElementVNode("div",tB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,H=>(e.openBlock(),e.createElementBlock("button",{key:H.id,onClick:Q=>h.value=H.id,class:e.normalizeClass(["inline-flex flex-1 items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm data-[state=active]:bg-blue-50 data-[state=active]:text-blue-700 data-[state=active]:border-blue-200",H.id===h.value?"bg-blue-50 text-blue-700 border-blue-200":""])},e.toDisplayString(H.name),11,lB))),128))]),e.createElementVNode("div",aB,[e.createElementVNode("label",rB,e.toDisplayString($.$t("collections.pinPublication")),1),e.createElementVNode("div",nB,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",id:"is_pin","onUpdate:modelValue":C[1]||(C[1]=H=>V.value=H),class:"sr-only"},null,512),[[e.vModelCheckbox,V.value]]),e.createElementVNode("div",{class:e.normalizeClass(["w-5 h-5 border-2 rounded transition-all duration-200 cursor-pointer flex items-center justify-center",(P=y.value)!=null&&P.is_pin?"bg-sky-600 border-sky-600":"bg-white border-gray-300 hover:border-sky-400 dark:bg-gray-700 dark:border-gray-600 dark:hover:border-sky-400"]),onClick:E},[(I=y.value)!=null&&I.is_pin?(e.openBlock(),e.createElementBlock("svg",oB,[...C[7]||(C[7]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):e.createCommentVNode("",!0)],2)])])])]),e.withDirectives(e.createElementVNode("div",sB,[(O=s.value)!=null&&O.length?(e.openBlock(),e.createBlock(e.unref(mt),{key:0,modelValue:y.value,"onUpdate:modelValue":C[2]||(C[2]=H=>y.value=H),schema:m.value,form:i.value,"onUpdate:form":C[3]||(C[3]=H=>i.value=H)},null,8,["modelValue","schema","form"])):e.createCommentVNode("",!0)],512),[[e.vShow,h.value==="content"]]),e.withDirectives(e.createElementVNode("div",iB,[e.createVNode(e.unref(mt),{schema:f.value,values:g.value,"onUpdate:values":C[4]||(C[4]=H=>g.value=H),form:c.value,"onUpdate:form":C[5]||(C[5]=H=>c.value=H)},null,8,["schema","values","form"])],512),[[e.vShow,h.value==="seo"]]),h.value==="tags"?(e.openBlock(),e.createElementBlock("div",cB,[e.createVNode(RN,{ref_key:"tagsForm",ref:u,modelValue:y.value,"onUpdate:modelValue":C[6]||(C[6]=H=>y.value=H)},null,8,["modelValue"])])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",dB,[e.createVNode(qN,{slug:(F=y.value)==null?void 0:F.slug,preview_path:d.value},null,8,["slug","preview_path"])],512),[[e.vShow,h.value==="preview"]])])}}}),uB=(l,t)=>{const a=l==null?void 0:l.trim();return a?t?t==="create"?{type:"createArticle",collection:a}:{type:"editArticle",collection:a,id:t}:{type:"articles",collection:a}:{type:"collections"}},pB={key:1,class:"p-4 text-sm text-slate-600 dark:text-slate-300"},mB=e.defineComponent({__name:"CmsContentWrapper",setup(l){const t=dt.useRoute(),a=e.getCurrentInstance();if(!a)throw new Error("CmsContentWrapper must be used within a component instance");const r=e.computed(()=>{const g=a.appContext.config.globalProperties.$route;if(!g)throw new Error("Vue Router is not registered on the app instance");return g}),n=e.computed(()=>t??r.value),o=e.computed(()=>{var g;return((g=n.value)==null?void 0:g.params)??{}}),s=e.computed(()=>{var g,y;return((g=o.value)==null?void 0:g.collection)??((y=o.value)==null?void 0:y.type)}),i=e.computed(()=>{var g;return(g=o.value)==null?void 0:g.id}),c=e.computed(()=>uB(s.value,i.value)),u={collections:yr,articles:qo,createArticle:Ps,editArticle:Ps},d=e.computed(()=>u[c.value.type]??yr),p=e.computed(()=>`${c.value.type}-${c.value.collection??""}-${c.value.id??""}`),m=e.computed(()=>{const{type:g,collection:y,id:w}=c.value,h={...o.value};return s.value?h.collection=s.value:delete h.collection,g==="articles"?h.id=y:g==="createArticle"?delete h.id:g==="editArticle"&&w?h.id=w:delete h.id,h}),f=new Proxy({},{get(g,y,w){const h=n.value;if(!h)return;if(y==="params")return m.value;const k=Reflect.get(h,y,w);return typeof k=="function"?k.bind(h):k},has(g,y){if(y==="params")return!0;const w=n.value;return w?Reflect.has(w,y):!1},ownKeys(){const g=n.value;return g?Reflect.ownKeys(g):["params"]},getOwnPropertyDescriptor(g,y){if(y==="params")return{configurable:!0,enumerable:!0,value:m.value};const w=n.value;if(!w)return;const h=Reflect.getOwnPropertyDescriptor(w,y);if(h)return{...h,configurable:!0}}});return e.provide(dt.routeLocationKey,f),(g,y)=>d.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.value),{key:p.value})):(e.openBlock(),e.createElementBlock("div",pB,e.toDisplayString(g.$t("navigation.collections")),1))}});function fB(l){l.component("Dashboard",gr)}function al(l){return typeof l=="string"||l instanceof String}function Rs(l){var t;return typeof l=="object"&&l!=null&&(l==null||(t=l.constructor)==null?void 0:t.name)==="Object"}function js(l,t){return Array.isArray(t)?js(l,(a,r)=>t.includes(r)):Object.entries(l).reduce((a,r)=>{let[n,o]=r;return t(o,n)&&(a[n]=o),a},{})}const ne={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function Us(l){switch(l){case ne.LEFT:return ne.FORCE_LEFT;case ne.RIGHT:return ne.FORCE_RIGHT;default:return l}}function Qr(l){return l.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function Fa(l,t){if(t===l)return!0;const a=Array.isArray(t),r=Array.isArray(l);let n;if(a&&r){if(t.length!=l.length)return!1;for(n=0;n<t.length;n++)if(!Fa(t[n],l[n]))return!1;return!0}if(a!=r)return!1;if(t&&l&&typeof t=="object"&&typeof l=="object"){const o=t instanceof Date,s=l instanceof Date;if(o&&s)return t.getTime()==l.getTime();if(o!=s)return!1;const i=t instanceof RegExp,c=l instanceof RegExp;if(i&&c)return t.toString()==l.toString();if(i!=c)return!1;const u=Object.keys(t);for(n=0;n<u.length;n++)if(!Object.prototype.hasOwnProperty.call(l,u[n]))return!1;for(n=0;n<u.length;n++)if(!Fa(l[u[n]],t[u[n]]))return!1;return!0}else if(t&&l&&typeof t=="function"&&typeof l=="function")return t.toString()===l.toString();return!1}class hB{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?ne.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?ne.RIGHT:ne.LEFT}}function ue(l,t){return new ue.InputMask(l,t)}function zs(l){if(l==null)throw new Error("mask property should be defined");return l instanceof RegExp?ue.MaskedRegExp:al(l)?ue.MaskedPattern:l===Date?ue.MaskedDate:l===Number?ue.MaskedNumber:Array.isArray(l)||l===Array?ue.MaskedDynamic:ue.Masked&&l.prototype instanceof ue.Masked?l:ue.Masked&&l instanceof ue.Masked?l.constructor:l instanceof Function?ue.MaskedFunction:(console.warn("Mask not found for mask",l),ue.Masked)}function Bl(l){if(!l)throw new Error("Options in not defined");if(ue.Masked){if(l.prototype instanceof ue.Masked)return{mask:l};const{mask:t=void 0,...a}=l instanceof ue.Masked?{mask:l}:Rs(l)&&l.mask instanceof ue.Masked?l:{};if(t){const r=t.mask;return{...js(t,(n,o)=>!o.startsWith("_")),mask:t.constructor,_mask:r,...a}}}return Rs(l)?{...l}:{mask:l}}function Mt(l){if(ue.Masked&&l instanceof ue.Masked)return l;const t=Bl(l),a=zs(t.mask);if(!a)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===a&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new a(t)}ue.createMask=Mt;class Ia{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return t??this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return t??this.value.length}select(t,a){if(!(t==null||a==null||t===this.selectionStart&&a===this.selectionEnd))try{this._unsafeSelect(t,a)}catch{}}get isActive(){return!1}}ue.MaskElement=Ia;const Hs=90,gB=89;class Gl extends Ia{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,a,r;return(t=(a=(r=this.input).getRootNode)==null?void 0:a.call(r))!=null?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){if(this._handlers.redo&&(t.keyCode===Hs&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===gB&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===Hs&&(t.metaKey||t.ctrlKey))return t.preventDefault(),this._handlers.undo(t);t.isComposing||this._handlers.selectionChange(t)}_onBeforeinput(t){if(t.inputType==="historyUndo"&&this._handlers.undo)return t.preventDefault(),this._handlers.undo(t);if(t.inputType==="historyRedo"&&this._handlers.redo)return t.preventDefault(),this._handlers.redo(t)}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}ue.HTMLMaskElement=Gl;class Ks extends Gl{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,a){this.input.setSelectionRange(t,a)}get value(){return this.input.value}set value(t){this.input.value=t}}ue.HTMLMaskElement=Gl;class Jr extends Gl{get _unsafeSelectionStart(){const t=this.rootElement,a=t.getSelection&&t.getSelection(),r=a&&a.anchorOffset,n=a&&a.focusOffset;return n==null||r==null||r<n?r:n}get _unsafeSelectionEnd(){const t=this.rootElement,a=t.getSelection&&t.getSelection(),r=a&&a.anchorOffset,n=a&&a.focusOffset;return n==null||r==null||r>n?r:n}_unsafeSelect(t,a){if(!this.rootElement.createRange)return;const r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,t),r.setEnd(this.input.lastChild||this.input,a);const n=this.rootElement,o=n.getSelection&&n.getSelection();o&&(o.removeAllRanges(),o.addRange(r))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}ue.HTMLContenteditableMaskElement=Jr;class Oa{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>Oa.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}Oa.MAX_LENGTH=100;class qs{constructor(t,a){this.el=t instanceof Ia?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new Jr(t):new Ks(t),this.masked=Mt(a),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Oa,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var a;return t==null||((a=this.masked)==null?void 0:a.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof ue.Masked)&&this.masked.constructor===zs(t)){this.masked.updateOptions({mask:t});return}const a=t instanceof ue.Masked?t:Mt({mask:t});a.unmaskedValue=this.masked.unmaskedValue,this.masked=a}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,a){const r=this._listeners[t];r&&r.forEach(n=>n(a))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){!this.el||!this.el.isActive||(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const a=this.masked.unmaskedValue,r=this.masked.value,n=this.masked.rawInputValue,o=this.displayValue,s=this.unmaskedValue!==a||this.value!==r||this._rawInputValue!==n;this._unmaskedValue=a,this._value=r,this._rawInputValue=n,this.el.value!==o&&(this.el.value=o),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),s&&this._fireChangeEvents(),!this._historyChanging&&(s||this.history.isEmpty)&&this.history.push({unmaskedValue:a,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:a,...r}=t,n=!this.maskEquals(a),o=this.masked.optionsIsChanged(r);n&&(this.mask=a),o&&this.masked.updateOptions(r),(n||o)&&this.updateControl()}updateCursor(t){t!=null&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,ne.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,a){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(a),this}off(t,a){if(!this._listeners[t])return this;if(!a)return delete this._listeners[t],this;const r=this._listeners[t].indexOf(a);return r>=0&&this._listeners[t].splice(r,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const a=new hB({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),r=this.masked.rawInputValue,n=this.masked.splice(a.startChangePos,a.removed.length,a.inserted,a.removeDirection,{input:!0,raw:!0}).offset,o=r===this.masked.rawInputValue?a.removeDirection:ne.NONE;let s=this.masked.nearestInputPos(a.startChangePos+n,o);o!==ne.NONE&&(s=this.masked.nearestInputPos(s,ne.NONE)),this.updateControl(s),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}ue.InputMask=qs;class fe{static normalize(t){return Array.isArray(t)?t:[t,new fe]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}ue.ChangeDetails=fe;class Tt{constructor(t,a,r){t===void 0&&(t=""),a===void 0&&(a=0),this.value=t,this.from=a,this.stop=r}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||t!=null&&this.from>=t)return"";const a=this.value[0];return this.value=this.value.slice(1),a}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class Xe{constructor(t){this._value="",this._update({...Xe.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,a){a===void 0&&(a={input:!0}),this.reset(),this.append(t,a,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,a){return t}totalInputPositions(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),Math.min(this.displayValue.length,a-t)}extractInput(t,a,r){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),this.displayValue.slice(t,a)}extractTail(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),new Tt(this.extractInput(t,a),t)}appendTail(t){return al(t)&&(t=new Tt(String(t))),t.appendTo(this)}_appendCharRaw(t,a){return t?(this._value+=t,new fe({inserted:t,rawInserted:t})):new fe}_appendChar(t,a,r){a===void 0&&(a={});const n=this.state;let o;if([t,o]=this.doPrepareChar(t,a),t&&(o=o.aggregate(this._appendCharRaw(t,a)),!o.rawInserted&&this.autofix==="pad")){const s=this.state;this.state=n;let i=this.pad(a);const c=this._appendCharRaw(t,a);i=i.aggregate(c),c.rawInserted||i.equals(o)?o=i:this.state=s}if(o.inserted){let s,i=this.doValidate(a)!==!1;if(i&&r!=null){const c=this.state;if(this.overwrite===!0){s=r.state;for(let d=0;d<o.rawInserted.length;++d)r.unshift(this.displayValue.length-o.tailShift)}let u=this.appendTail(r);if(i=u.rawInserted.length===r.toString().length,!(i&&u.inserted)&&this.overwrite==="shift"){this.state=c,s=r.state;for(let d=0;d<o.rawInserted.length;++d)r.shift();u=this.appendTail(r),i=u.rawInserted.length===r.toString().length}i&&u.inserted&&(this.state=c)}i||(o=new fe,this.state=n,r&&s&&(r.state=s))}return o}_appendPlaceholder(){return new fe}_appendEager(){return new fe}append(t,a,r){if(!al(t))throw new Error("value should be string");const n=al(r)?new Tt(String(r)):r;a!=null&&a.tail&&(a._beforeTailState=this.state);let o;[t,o]=this.doPrepare(t,a);for(let s=0;s<t.length;++s){const i=this._appendChar(t[s],a,n);if(!i.rawInserted&&!this.doSkipInvalid(t[s],a,n))break;o.aggregate(i)}return(this.eager===!0||this.eager==="append")&&a!=null&&a.input&&t&&o.aggregate(this._appendEager()),n!=null&&(o.tailShift+=this.appendTail(n).tailShift),o}remove(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(a),new fe}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const a=this.rawInputValue,r=this.value,n=t();return this.rawInputValue=a,this.value&&this.value!==r&&r.indexOf(this.value)===0&&(this.append(r.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,n}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const a=this.state,r=t(this);return this.state=a,delete this._isolated,r}doSkipInvalid(t,a,r){return!!this.skipInvalid}doPrepare(t,a){return a===void 0&&(a={}),fe.normalize(this.prepare?this.prepare(t,this,a):t)}doPrepareChar(t,a){return a===void 0&&(a={}),fe.normalize(this.prepareChar?this.prepareChar(t,this,a):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,a,r,n,o){r===void 0&&(r=""),n===void 0&&(n=ne.NONE),o===void 0&&(o={input:!0});const s=t+a,i=this.extractTail(s),c=this.eager===!0||this.eager==="remove";let u;c&&(n=Us(n),u=this.extractInput(0,s,{raw:!0}));let d=t;const p=new fe;if(n!==ne.NONE&&(d=this.nearestInputPos(t,a>1&&t!==0&&!c?ne.NONE:n),p.tailShift=d-t),p.aggregate(this.remove(d)),c&&n!==ne.NONE&&u===this.rawInputValue)if(n===ne.FORCE_LEFT){let m;for(;u===this.rawInputValue&&(m=this.displayValue.length);)p.aggregate(new fe({tailShift:-1})).aggregate(this.remove(m-1))}else n===ne.FORCE_RIGHT&&i.unshift();return p.aggregate(this.append(r,o,i))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!Fa(this,t)}typedValueEquals(t){const a=this.typedValue;return t===a||Xe.EMPTY_VALUES.includes(t)&&Xe.EMPTY_VALUES.includes(a)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new fe}}Xe.DEFAULTS={skipInvalid:!0},Xe.EMPTY_VALUES=[void 0,null,""],ue.Masked=Xe;class rl{constructor(t,a){t===void 0&&(t=[]),a===void 0&&(a=0),this.chunks=t,this.from=a}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=al(t)?new Tt(String(t)):t;const a=this.chunks[this.chunks.length-1],r=a&&(a.stop===t.stop||t.stop==null)&&t.from===a.from+a.toString().length;if(t instanceof Tt)r?a.extend(t.toString()):this.chunks.push(t);else if(t instanceof rl){if(t.stop==null){let n;for(;t.chunks.length&&t.chunks[0].stop==null;)n=t.chunks.shift(),n.from+=t.from,this.extend(n)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof ue.MaskedPattern))return new Tt(this.toString()).appendTo(t);const a=new fe;for(let r=0;r<this.chunks.length;++r){const n=this.chunks[r],o=t._mapPosToBlock(t.displayValue.length),s=n.stop;let i;if(s!=null&&(!o||o.index<=s)&&((n instanceof rl||t._stops.indexOf(s)>=0)&&a.aggregate(t._appendPlaceholder(s)),i=n instanceof rl&&t._blocks[s]),i){const c=i.appendTail(n);a.aggregate(c);const u=n.toString().slice(c.rawInserted.length);u&&a.aggregate(t.append(u,{tail:!0}))}else a.aggregate(t.append(n.toString(),{tail:!0}))}return a}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:a,...r}=t;Object.assign(this,r),this.chunks=a.map(n=>{const o="chunks"in n?new rl:new Tt;return o.state=n,o})}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";const a=t!=null?t-this.from:t;let r=0;for(;r<this.chunks.length;){const n=this.chunks[r],o=n.unshift(a);if(n.toString()){if(!o)break;++r}else this.chunks.splice(r,1);if(o)return o}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const a=this.chunks[t],r=a.shift();if(a.toString()){if(!r)break;--t}else this.chunks.splice(t,1);if(r)return r}return""}}class yB{constructor(t,a){this.masked=t,this._log=[];const{offset:r,index:n}=t._mapPosToBlock(a)||(a<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=r,this.index=n,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((a=this.block)==null?void 0:a.displayValue.length)||0){var a;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,ne.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,ne.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,ne.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,ne.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,ne.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,ne.NONE),!0})}}class en{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,a){return t===void 0&&(t=0),a===void 0&&(a=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(a),this._value||(this._isRawInput=!1),new fe}nearestInputPos(t,a){a===void 0&&(a=ne.NONE);const r=0,n=this._value.length;switch(a){case ne.LEFT:case ne.FORCE_LEFT:return r;case ne.NONE:case ne.RIGHT:case ne.FORCE_RIGHT:default:return n}}totalInputPositions(t,a){return t===void 0&&(t=0),a===void 0&&(a=this._value.length),this._isRawInput?a-t:0}extractInput(t,a,r){return t===void 0&&(t=0),a===void 0&&(a=this._value.length),r===void 0&&(r={}),r.raw&&this._isRawInput&&this._value.slice(t,a)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(t,a){if(a===void 0&&(a={}),this.isFilled)return new fe;const r=this.eager===!0||this.eager==="append",n=this.char===t&&(this.isUnmasking||a.input||a.raw)&&(!a.raw||!r)&&!a.tail,o=new fe({inserted:this.char,rawInserted:n?this.char:""});return this._value=this.char,this._isRawInput=n&&(a.raw||a.input),o}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new fe;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new Tt("")}appendTail(t){return al(t)&&(t=new Tt(String(t))),t.appendTo(this)}append(t,a,r){const n=this._appendChar(t[0],a);return r!=null&&(n.tailShift+=this.appendTail(r).tailShift),n}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=!!t._rawInputValue}pad(t){return this._appendPlaceholder()}}class Wl{constructor(t){const{parent:a,isOptional:r,placeholderChar:n,displayChar:o,lazy:s,eager:i,...c}=t;this.masked=Mt(c),Object.assign(this,{parent:a,isOptional:r,placeholderChar:n,displayChar:o,lazy:s,eager:i})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.value.length),t===0&&a>=1?(this.isFilled=!1,this.masked.remove(t,a)):new fe}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(t,a){if(a===void 0&&(a={}),this.isFilled)return new fe;const r=this.masked.state;let n=this.masked._appendChar(t,this.currentMaskFlags(a));return n.inserted&&this.doValidate(a)===!1&&(n=new fe,this.masked.state=r),!n.inserted&&!this.isOptional&&!this.lazy&&!a.input&&(n.inserted=this.placeholderChar),n.skip=!n.inserted&&!this.isOptional,this.isFilled=!!n.inserted,n}append(t,a,r){return this.masked.append(t,this.currentMaskFlags(a),r)}_appendPlaceholder(){return this.isFilled||this.isOptional?new fe:(this.isFilled=!0,new fe({inserted:this.placeholderChar}))}_appendEager(){return new fe}extractTail(t,a){return this.masked.extractTail(t,a)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,a,r){return t===void 0&&(t=0),a===void 0&&(a=this.value.length),this.masked.extractInput(t,a,r)}nearestInputPos(t,a){a===void 0&&(a=ne.NONE);const r=0,n=this.value.length,o=Math.min(Math.max(t,r),n);switch(a){case ne.LEFT:case ne.FORCE_LEFT:return this.isComplete?o:r;case ne.RIGHT:case ne.FORCE_RIGHT:return this.isComplete?o:n;case ne.NONE:default:return o}}totalInputPositions(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.value.length),this.value.slice(t,a).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var a;return{...t,_beforeTailState:(t==null||(a=t._beforeTailState)==null?void 0:a.masked)||(t==null?void 0:t._beforeTailState)}}pad(t){return new fe}}Wl.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class Gs extends Xe{updateOptions(t){super.updateOptions(t)}_update(t){const a=t.mask;a&&(t.validate=r=>r.search(a)>=0),super._update(t)}}ue.MaskedRegExp=Gs;class Ze extends Xe{constructor(t){super({...Ze.DEFAULTS,...t,definitions:Object.assign({},Wl.DEFAULT_DEFINITIONS,t==null?void 0:t.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const a=this.mask;if(!a||!t)return;let r=!1,n=!1;for(let o=0;o<a.length;++o){if(this.blocks){const u=a.slice(o),d=Object.keys(this.blocks).filter(m=>u.indexOf(m)===0);d.sort((m,f)=>f.length-m.length);const p=d[0];if(p){const{expose:m,repeat:f,...g}=Bl(this.blocks[p]),y={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...g,repeat:f,parent:this},w=f!=null?new ue.RepeatBlock(y):Mt(y);w&&(this._blocks.push(w),m&&(this.exposeBlock=w),this._maskedBlocks[p]||(this._maskedBlocks[p]=[]),this._maskedBlocks[p].push(this._blocks.length-1)),o+=p.length-1;continue}}let s=a[o],i=s in t;if(s===Ze.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(s==="{"||s==="}"){r=!r;continue}if(s==="["||s==="]"){n=!n;continue}if(s===Ze.ESCAPE_CHAR){if(++o,s=a[o],!s)break;i=!1}const c=i?new Wl({isOptional:n,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...Bl(t[s]),parent:this}):new en({char:s,eager:this.eager,isUnmasking:r});this._blocks.push(c)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t){this.reset();return}const{_blocks:a,...r}=t;this._blocks.forEach((n,o)=>n.state=a[o]),super.state=r}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,a)=>t+=a.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const a=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(a),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,a)=>t+=a.value,"")}set value(t){if(this.exposeBlock){const a=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(a),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const a=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(a),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,a)=>t+=a.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const a=new fe;let r=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(r==null)return a;this._blocks[r].isFilled&&++r;for(let n=r;n<this._blocks.length;++n){const o=this._blocks[n]._appendEager();if(!o.inserted)break;a.aggregate(o)}return a}_appendCharRaw(t,a){a===void 0&&(a={});const r=this._mapPosToBlock(this.displayValue.length),n=new fe;if(!r)return n;for(let s=r.index,i;i=this._blocks[s];++s){var o;const c=i._appendChar(t,{...a,_beforeTailState:(o=a._beforeTailState)==null||(o=o._blocks)==null?void 0:o[s]});if(n.aggregate(c),c.consumed)break}return n}extractTail(t,a){t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length);const r=new rl;return t===a||this._forEachBlocksInRange(t,a,(n,o,s,i)=>{const c=n.extractTail(s,i);c.stop=this._findStopBefore(o),c.from=this._blockStartPos(o),c instanceof rl&&(c.blockIndex=o),r.extend(c)}),r}extractInput(t,a,r){if(t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),r===void 0&&(r={}),t===a)return"";let n="";return this._forEachBlocksInRange(t,a,(o,s,i,c)=>{n+=o.extractInput(i,c,r)}),n}_findStopBefore(t){let a;for(let r=0;r<this._stops.length;++r){const n=this._stops[r];if(n<=t)a=n;else break}return a}_appendPlaceholder(t){const a=new fe;if(this.lazy&&t==null)return a;const r=this._mapPosToBlock(this.displayValue.length);if(!r)return a;const n=r.index,o=t??this._blocks.length;return this._blocks.slice(n,o).forEach(s=>{if(!s.lazy||t!=null){var i;a.aggregate(s._appendPlaceholder((i=s._blocks)==null?void 0:i.length))}}),a}_mapPosToBlock(t){let a="";for(let r=0;r<this._blocks.length;++r){const n=this._blocks[r],o=a.length;if(a+=n.displayValue,t<=a.length)return{index:r,offset:t-o}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((a,r)=>a+=r.displayValue.length,0)}_forEachBlocksInRange(t,a,r){a===void 0&&(a=this.displayValue.length);const n=this._mapPosToBlock(t);if(n){const o=this._mapPosToBlock(a),s=o&&n.index===o.index,i=n.offset,c=o&&s?o.offset:this._blocks[n.index].displayValue.length;if(r(this._blocks[n.index],n.index,i,c),o&&!s){for(let u=n.index+1;u<o.index;++u)r(this._blocks[u],u,0,this._blocks[u].displayValue.length);r(this._blocks[o.index],o.index,0,o.offset)}}}remove(t,a){t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length);const r=super.remove(t,a);return this._forEachBlocksInRange(t,a,(n,o,s,i)=>{r.aggregate(n.remove(s,i))}),r}nearestInputPos(t,a){if(a===void 0&&(a=ne.NONE),!this._blocks.length)return 0;const r=new yB(this,t);if(a===ne.NONE)return r.pushRightBeforeInput()||(r.popState(),r.pushLeftBeforeInput())?r.pos:this.displayValue.length;if(a===ne.LEFT||a===ne.FORCE_LEFT){if(a===ne.LEFT){if(r.pushRightBeforeFilled(),r.ok&&r.pos===t)return t;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),a===ne.LEFT){if(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.ok&&r.pos<=t||(r.popState(),r.ok&&r.pos<=t))return r.pos;r.popState()}return r.ok?r.pos:a===ne.FORCE_LEFT?0:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:0)}return a===ne.RIGHT||a===ne.FORCE_RIGHT?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:a===ne.FORCE_RIGHT?this.displayValue.length:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:this.nearestInputPos(t,ne.LEFT))):t}totalInputPositions(t,a){t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length);let r=0;return this._forEachBlocksInRange(t,a,(n,o,s,i)=>{r+=n.totalInputPositions(s,i)}),r}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const a=this._maskedBlocks[t];return a?a.map(r=>this._blocks[r]):[]}pad(t){const a=new fe;return this._forEachBlocksInRange(0,this.displayValue.length,r=>a.aggregate(r.pad(t))),a}}Ze.DEFAULTS={...Xe.DEFAULTS,lazy:!0,placeholderChar:"_"},Ze.STOP_CHAR="`",Ze.ESCAPE_CHAR="\\",Ze.InputDefinition=Wl,Ze.FixedDefinition=en,ue.MaskedPattern=Ze;class Yl extends Ze{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:a=this.to||0,from:r=this.from||0,maxLength:n=this.maxLength||0,autofix:o=this.autofix,...s}=t;this.to=a,this.from=r,this.maxLength=Math.max(String(a).length,n),this.autofix=o;const i=String(this.from).padStart(this.maxLength,"0"),c=String(this.to).padStart(this.maxLength,"0");let u=0;for(;u<c.length&&c[u]===i[u];)++u;s.mask=c.slice(0,u).replace(/0/g,"\\0")+"0".repeat(this.maxLength-u),super._update(s)}get isComplete(){return super.isComplete&&!!this.value}boundaries(t){let a="",r="";const[,n,o]=t.match(/^(\D*)(\d*)(\D*)/)||[];return o&&(a="0".repeat(n.length)+o,r="9".repeat(n.length)+o),a=a.padEnd(this.maxLength,"0"),r=r.padEnd(this.maxLength,"9"),[a,r]}doPrepareChar(t,a){a===void 0&&(a={});let r;return[t,r]=super.doPrepareChar(t.replace(/\D/g,""),a),t||(r.skip=!this.isComplete),[t,r]}_appendCharRaw(t,a){if(a===void 0&&(a={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,a);const r=String(this.from).padStart(this.maxLength,"0"),n=String(this.to).padStart(this.maxLength,"0"),[o,s]=this.boundaries(this.value+t);return Number(s)<this.from?super._appendCharRaw(r[this.value.length],a):Number(o)>this.to?!a.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(r[this.value.length],a).aggregate(this._appendCharRaw(t,a)):super._appendCharRaw(n[this.value.length],a):super._appendCharRaw(t,a)}doValidate(t){const a=this.value;if(a.search(/[^0]/)===-1&&a.length<=this._matchFrom)return!0;const[r,n]=this.boundaries(a);return this.from<=Number(n)&&Number(r)<=this.to&&super.doValidate(t)}pad(t){const a=new fe;if(this.value.length===this.maxLength)return a;const r=this.value,n=this.maxLength-this.value.length;if(n){this.reset();for(let o=0;o<n;++o)a.aggregate(super._appendCharRaw("0",t));r.split("").forEach(o=>this._appendCharRaw(o))}return a}}ue.MaskedRange=Yl;const bB="d{.}`m{.}`Y";class $t extends Ze{static extractPatternOptions(t){const{mask:a,pattern:r,...n}=t;return{...n,mask:al(a)?a:r}}constructor(t){super($t.extractPatternOptions({...$t.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:a,pattern:r,blocks:n,...o}={...$t.DEFAULTS,...t},s=Object.assign({},$t.GET_DEFAULT_BLOCKS());t.min&&(s.Y.from=t.min.getFullYear()),t.max&&(s.Y.to=t.max.getFullYear()),t.min&&t.max&&s.Y.from===s.Y.to&&(s.m.from=t.min.getMonth()+1,s.m.to=t.max.getMonth()+1,s.m.from===s.m.to&&(s.d.from=t.min.getDate(),s.d.to=t.max.getDate())),Object.assign(s,this.blocks,n),super._update({...o,mask:al(a)?a:r,blocks:s})}doValidate(t){const a=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&a!=null&&(this.min==null||this.min<=a)&&(this.max==null||a<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged($t.extractPatternOptions(t))}}$t.GET_DEFAULT_BLOCKS=()=>({d:{mask:Yl,from:1,to:31,maxLength:2},m:{mask:Yl,from:1,to:12,maxLength:2},Y:{mask:Yl,from:1900,to:9999}}),$t.DEFAULTS={...Ze.DEFAULTS,mask:Date,pattern:bB,format:(l,t)=>{if(!l)return"";const a=String(l.getDate()).padStart(2,"0"),r=String(l.getMonth()+1).padStart(2,"0"),n=l.getFullYear();return[a,r,n].join(".")},parse:(l,t)=>{const[a,r,n]=l.split(".").map(Number);return new Date(n,r-1,a)}},ue.MaskedDate=$t;class Xl extends Xe{constructor(t){super({...Xl.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(a=>{const{expose:r,...n}=Bl(a),o=Mt({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...n});return r&&(this.exposeMask=o),o}):[])}_appendCharRaw(t,a){a===void 0&&(a={});const r=this._applyDispatch(t,a);return this.currentMask&&r.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(a))),r}_applyDispatch(t,a,r){t===void 0&&(t=""),a===void 0&&(a={}),r===void 0&&(r="");const n=a.tail&&a._beforeTailState!=null?a._beforeTailState._value:this.value,o=this.rawInputValue,s=a.tail&&a._beforeTailState!=null?a._beforeTailState._rawInputValue:o,i=o.slice(s.length),c=this.currentMask,u=new fe,d=c==null?void 0:c.state;return this.currentMask=this.doDispatch(t,{...a},r),this.currentMask&&(this.currentMask!==c?(this.currentMask.reset(),s&&(this.currentMask.append(s,{raw:!0}),u.tailShift=this.currentMask.value.length-n.length),i&&(u.tailShift+=this.currentMask.append(i,{raw:!0,tail:!0}).tailShift)):d&&(this.currentMask.state=d)),u}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const a=new fe;return t&&a.aggregate(this._applyDispatch("",{},t)),a.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var a,r;return{...t,_beforeTailState:((a=t._beforeTailState)==null?void 0:a.currentMaskRef)===this.currentMask&&((r=t._beforeTailState)==null?void 0:r.currentMask)||t._beforeTailState}}doDispatch(t,a,r){return a===void 0&&(a={}),r===void 0&&(r=""),this.dispatch(t,this,a,r)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,a){a===void 0&&(a={});let[r,n]=super.doPrepare(t,a);if(this.currentMask){let o;[r,o]=super.doPrepare(r,this.currentMaskFlags(a)),n=n.aggregate(o)}return[r,n]}doPrepareChar(t,a){a===void 0&&(a={});let[r,n]=super.doPrepareChar(t,a);if(this.currentMask){let o;[r,o]=super.doPrepareChar(r,this.currentMaskFlags(a)),n=n.aggregate(o)}return[r,n]}reset(){var t;(t=this.currentMask)==null||t.reset(),this.compiledMasks.forEach(a=>a.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask){this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,this._applyDispatch();return}let a=String(t);this.currentMask&&(this.currentMask.typedValue=t,a=this.currentMask.unmaskedValue),this.unmaskedValue=a}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return!!((t=this.currentMask)!=null&&t.isComplete)}get isFilled(){var t;return!!((t=this.currentMask)!=null&&t.isFilled)}remove(t,a){const r=new fe;return this.currentMask&&r.aggregate(this.currentMask.remove(t,a)).aggregate(this._applyDispatch()),r}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(a=>a.state),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state}}set state(t){const{compiledMasks:a,currentMaskRef:r,currentMask:n,...o}=t;a&&this.compiledMasks.forEach((s,i)=>s.state=a[i]),r!=null&&(this.currentMask=r,this.currentMask.state=n),super.state=o}extractInput(t,a,r){return this.currentMask?this.currentMask.extractInput(t,a,r):""}extractTail(t,a){return this.currentMask?this.currentMask.extractTail(t,a):super.extractTail(t,a)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,a){return this.currentMask?this.currentMask.nearestInputPos(t,a):super.nearestInputPos(t,a)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((a,r)=>{if(!t[r])return;const{mask:n,...o}=t[r];return Fa(a,o)&&a.maskEquals(n)}):super.maskEquals(t)}typedValueEquals(t){var a;return!!((a=this.currentMask)!=null&&a.typedValueEquals(t))}}Xl.DEFAULTS={...Xe.DEFAULTS,dispatch:(l,t,a,r)=>{if(!t.compiledMasks.length)return;const n=t.rawInputValue,o=t.compiledMasks.map((s,i)=>{const c=t.currentMask===s,u=c?s.displayValue.length:s.nearestInputPos(s.displayValue.length,ne.FORCE_LEFT);return s.rawInputValue!==n?(s.reset(),s.append(n,{raw:!0})):c||s.remove(u),s.append(l,t.currentMaskFlags(a)),s.appendTail(r),{index:i,weight:s.rawInputValue.length,totalInputPositions:s.totalInputPositions(0,Math.max(u,s.nearestInputPos(s.displayValue.length,ne.FORCE_LEFT)))}});return o.sort((s,i)=>i.weight-s.weight||i.totalInputPositions-s.totalInputPositions),t.compiledMasks[o[0].index]}},ue.MaskedDynamic=Xl;class Zl extends Ze{constructor(t){super({...Zl.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:a,...r}=t;if(a){const n=a.map(i=>i.length),o=Math.min(...n),s=Math.max(...n)-o;r.mask="*".repeat(o),s&&(r.mask+="["+"*".repeat(s)+"]"),this.enum=a}super._update(r)}_appendCharRaw(t,a){a===void 0&&(a={});const r=Math.min(this.nearestInputPos(0,ne.FORCE_RIGHT),this.value.length),n=this.enum.filter(o=>this.matchValue(o,this.unmaskedValue+t,r));if(n.length){n.length===1&&this._forEachBlocksInRange(0,this.value.length,(s,i)=>{const c=n[0][i];i>=this.value.length||c===s.value||(s.reset(),s._appendChar(c,a))});const o=super._appendCharRaw(n[0][this.value.length],a);return n.length===1&&n[0].slice(this.unmaskedValue.length).split("").forEach(s=>o.aggregate(super._appendCharRaw(s))),o}return new fe({skip:!this.isComplete})}extractTail(t,a){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),new Tt("",t)}remove(t,a){if(t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),t===a)return new fe;const r=Math.min(super.nearestInputPos(0,ne.FORCE_RIGHT),this.value.length);let n;for(n=t;n>=0&&!(this.enum.filter(s=>this.matchValue(s,this.value.slice(r,n),r)).length>1);--n);const o=super.remove(n,a);return o.tailShift+=n-t,o}get isComplete(){return this.enum.indexOf(this.value)>=0}}Zl.DEFAULTS={...Ze.DEFAULTS,matchValue:(l,t,a)=>l.indexOf(t,a)===a},ue.MaskedEnum=Zl;class Ws extends Xe{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}}ue.MaskedFunction=Ws;var Ys;class it extends Xe{constructor(t){super({...it.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),a="\\d*",r=(this.scale?"("+Qr(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+a+r),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(Qr).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(Qr(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const a=t.split(this.radix);return a[0]=a[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),a.join(this.radix)}doPrepareChar(t,a){a===void 0&&(a={});const[r,n]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(a.input&&a.raw||!a.input&&!a.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),a);return t&&!r&&(n.skip=!0),r&&!this.allowPositive&&!this.value&&r!=="-"&&n.aggregate(this._appendChar("-")),[r,n]}_separatorsCount(t,a){a===void 0&&(a=!1);let r=0;for(let n=0;n<t;++n)this._value.indexOf(this.thousandsSeparator,n)===n&&(++r,a&&(t+=this.thousandsSeparator.length));return r}_separatorsCountFromSlice(t){return t===void 0&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,a,r){return t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),[t,a]=this._adjustRangeWithSeparators(t,a),this._removeThousandsSeparators(super.extractInput(t,a,r))}_appendCharRaw(t,a){a===void 0&&(a={});const r=a.tail&&a._beforeTailState?a._beforeTailState._value:this._value,n=this._separatorsCountFromSlice(r);this._value=this._removeThousandsSeparators(this.value);const o=this._value;this._value+=t;const s=this.number;let i=!isNaN(s),c=!1;if(i){let m;this.min!=null&&this.min<0&&this.number<this.min&&(m=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(m=this.max),m!=null&&(this.autofix?(this._value=this.format(m,this).replace(it.UNMASKED_RADIX,this.radix),c||(c=o===this._value&&!a.tail)):i=!1),i&&(i=!!this._value.match(this._numberRegExp))}let u;i?u=new fe({inserted:this._value.slice(o.length),rawInserted:c?"":t,skip:c}):(this._value=o,u=new fe),this._value=this._insertThousandsSeparators(this._value);const d=a.tail&&a._beforeTailState?a._beforeTailState._value:this._value,p=this._separatorsCountFromSlice(d);return u.tailShift+=(p-n)*this.thousandsSeparator.length,u}_findSeparatorAround(t){if(this.thousandsSeparator){const a=t-this.thousandsSeparator.length+1,r=this.value.indexOf(this.thousandsSeparator,a);if(r<=t)return r}return-1}_adjustRangeWithSeparators(t,a){const r=this._findSeparatorAround(t);r>=0&&(t=r);const n=this._findSeparatorAround(a);return n>=0&&(a=n+this.thousandsSeparator.length),[t,a]}remove(t,a){t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length),[t,a]=this._adjustRangeWithSeparators(t,a);const r=this.value.slice(0,t),n=this.value.slice(a),o=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+n));const s=this._separatorsCountFromSlice(r);return new fe({tailShift:(s-o)*this.thousandsSeparator.length})}nearestInputPos(t,a){if(!this.thousandsSeparator)return t;switch(a){case ne.NONE:case ne.LEFT:case ne.FORCE_LEFT:{const r=this._findSeparatorAround(t-1);if(r>=0){const n=r+this.thousandsSeparator.length;if(t<n||this.value.length<=n||a===ne.FORCE_LEFT)return r}break}case ne.RIGHT:case ne.FORCE_RIGHT:{const r=this._findSeparatorAround(t);if(r>=0)return r+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let a=t;this.min!=null&&(a=Math.max(a,this.min)),this.max!=null&&(a=Math.min(a,this.max)),a!==t&&(this.unmaskedValue=this.format(a,this));let r=this.value;this.normalizeZeros&&(r=this._normalizeZeros(r)),this.padFractionalZeros&&this.scale>0&&(r=this._padFractionalZeros(r)),this._value=r}super.doCommit()}_normalizeZeros(t){const a=this._removeThousandsSeparators(t).split(this.radix);return a[0]=a[0].replace(/^(\D*)(0*)(\d*)/,(r,n,o,s)=>n+s),t.length&&!/\d$/.test(a[0])&&(a[0]=a[0]+"0"),a.length>1&&(a[1]=a[1].replace(/0*$/,""),a[1].length||(a.length=1)),this._insertThousandsSeparators(a.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const a=t.split(this.radix);return a.length<2&&a.push(""),a[1]=a[1].padEnd(this.scale,"0"),a.join(this.radix)}doSkipInvalid(t,a,r){a===void 0&&(a={});const n=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===it.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,a,r)&&!n}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,it.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(it.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||it.EMPTY_VALUES.includes(t)&&it.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}}Ys=it,it.UNMASKED_RADIX=".",it.EMPTY_VALUES=[...Xe.EMPTY_VALUES,0],it.DEFAULTS={...Xe.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[Ys.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:l=>l.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},ue.MaskedNumber=it;const Pa={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function tn(l,t,a){t===void 0&&(t=Pa.MASKED),a===void 0&&(a=Pa.MASKED);const r=Mt(l);return n=>r.runIsolated(o=>(o[t]=n,o[a]))}function Xs(l,t,a,r){return tn(t,a,r)(l)}ue.PIPE_TYPE=Pa,ue.createPipe=tn,ue.pipe=Xs;class Zs extends Ze{get repeatFrom(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?t:0}get repeatTo(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var a,r,n;const{repeat:o,...s}=Bl(t);this._blockOpts=Object.assign({},this._blockOpts,s);const i=Mt(this._blockOpts);this.repeat=(a=(r=o??i.repeat)!=null?r:this.repeat)!=null?a:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((n=this._blocks)==null?void 0:n.length)||0,this.repeatFrom)),blocks:{m:i},eager:i.eager,overwrite:i.overwrite,skipInvalid:i.skipInvalid,lazy:i.lazy,placeholderChar:i.placeholderChar,displayChar:i.displayChar})}_allocateBlock(t){if(t<this._blocks.length)return this._blocks[t];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(Mt(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,a){a===void 0&&(a={});const r=new fe;for(let c=(n=(o=this._mapPosToBlock(this.displayValue.length))==null?void 0:o.index)!=null?n:Math.max(this._blocks.length-1,0),u,d;u=(s=this._blocks[c])!=null?s:d=!d&&this._allocateBlock(c);++c){var n,o,s,i;const p=u._appendChar(t,{...a,_beforeTailState:(i=a._beforeTailState)==null||(i=i._blocks)==null?void 0:i[c]});if(p.skip&&d){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(r.aggregate(p),p.consumed)break}return r}_trimEmptyTail(t,a){var r,n;t===void 0&&(t=0);const o=Math.max(((r=this._mapPosToBlock(t))==null?void 0:r.index)||0,this.repeatFrom,0);let s;a!=null&&(s=(n=this._mapPosToBlock(a))==null?void 0:n.index),s==null&&(s=this._blocks.length-1);let i=0;for(let c=s;o<=c&&!this._blocks[c].unmaskedValue;--c,++i);i&&(this._blocks.splice(s-i+1,i),this.mask=this.mask.slice(i))}reset(){super.reset(),this._trimEmptyTail()}remove(t,a){t===void 0&&(t=0),a===void 0&&(a=this.displayValue.length);const r=super.remove(t,a);return this._trimEmptyTail(t,a),r}totalInputPositions(t,a){return t===void 0&&(t=0),a==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,a)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}}ue.RepeatBlock=Zs;try{globalThis.IMask=ue}catch{}const kB=Object.freeze(Object.defineProperty({__proto__:null,ChangeDetails:fe,ChunksTailDetails:rl,DIRECTION:ne,HTMLContenteditableMaskElement:Jr,HTMLInputMaskElement:Ks,HTMLMaskElement:Gl,InputMask:qs,MaskElement:Ia,Masked:Xe,MaskedDate:$t,MaskedDynamic:Xl,MaskedEnum:Zl,MaskedFunction:Ws,MaskedNumber:it,MaskedPattern:Ze,MaskedRange:Yl,MaskedRegExp:Gs,PIPE_TYPE:Pa,PatternFixedDefinition:en,PatternInputDefinition:Wl,RepeatBlock:Zs,createMask:Mt,createPipe:tn,default:ue,forceDirection:Us,normalizeOpts:Bl,pipe:Xs},Symbol.toStringTag,{value:"Module"}));rt.ArticlesPage=qo,rt.BuilderPage=Q2,rt.CmsContentWrapper=mB,rt.CollectionsPage=yr,rt.Dashboard=gr,rt.default=gr,rt.install=fB,Object.defineProperties(rt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|