@opengis/admin 0.1.87 → 0.1.88

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,642 +0,0 @@
1
- import { _ as C, I as Q, u as B, s as F, V as R, a as O } from "./import-file-_QpFvb1W.js";
2
- import { openBlock as n, createElementBlock as s, createElementVNode as t, createStaticVNode as q, resolveComponent as v, normalizeClass as E, createTextVNode as L, toDisplayString as V, createVNode as c, Transition as T, withCtx as M, withDirectives as G, Fragment as N, renderList as S, vShow as J, ref as D, createCommentVNode as H, getCurrentInstance as K, watch as W, onBeforeUnmount as X, createBlock as Y, withModifiers as ee } from "vue";
3
- import { I as te } from "./IconChevronDown-7fRR2Xlu.js";
4
- const oe = {}, ne = {
5
- xmlns: "http://www.w3.org/2000/svg",
6
- viewBox: "0 0 24 24",
7
- fill: "none",
8
- stroke: "currentColor",
9
- "stroke-width": "2",
10
- "stroke-linecap": "round",
11
- "stroke-linejoin": "round",
12
- class: "icon icon-tabler icons-tabler-outline icon-tabler-logout"
13
- };
14
- function se(o, e, r, a, l, i) {
15
- return n(), s("svg", ne, e[0] || (e[0] = [
16
- t("path", {
17
- stroke: "none",
18
- d: "M0 0h24v24H0z",
19
- fill: "none"
20
- }, null, -1),
21
- t("path", { d: "M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2" }, null, -1),
22
- t("path", { d: "M9 12h12l-3 -3" }, null, -1),
23
- t("path", { d: "M18 15l3 -3" }, null, -1)
24
- ]));
25
- }
26
- const re = /* @__PURE__ */ C(oe, [["render", se]]), le = {}, ae = {
27
- viewBox: "0 0 1823 249",
28
- fill: "none",
29
- xmlns: "http://www.w3.org/2000/svg"
30
- };
31
- function ie(o, e, r, a, l, i) {
32
- return n(), s("svg", ae, e[0] || (e[0] = [
33
- q('<path d="M218.88 96.05C223.55 99.19 228.69 101.56 234.09 103.07V145.42C212.05 151.54 195.83 171.79 195.83 195.75C195.83 200.22 196.41 204.65 197.53 208.94L160.92 230.08C156.82 226.06 152.08 222.73 146.91 220.24V171.62C164.83 163.13 176.59 145.06 176.59 124.48C176.59 123.17 176.54 121.86 176.44 120.56L218.88 96.05ZM220.32 79.09L160.97 113.36C162.04 116.88 162.61 120.61 162.61 124.48C162.61 142.66 149.93 157.87 132.93 161.76V230.05C143.4 232.46 152.23 239.16 157.46 248.21L215 214.99C211.7 209.34 209.81 202.77 209.81 195.75C209.81 174.62 226.94 157.49 248.07 157.49V91.02C237.14 91.02 227.29 86.43 220.32 79.09Z" fill="#CE3936"></path><path d="M161.39 19.13L197.44 39.94C196.39 44.11 195.84 48.42 195.84 52.75C195.84 54.21 195.9 55.65 196.02 57.1L153.9 81.42C145.27 75.5 134.95 72.24 124.36 72.24C113.83 72.24 103.57 75.47 94.96 81.32L52.71 56.93C52.82 55.55 52.88 54.16 52.88 52.76C52.88 48.43 52.34 44.12 51.28 39.95L87.3 19.16C96.98 28.89 110.26 34.58 124.34 34.58C138.42 34.57 151.7 28.87 161.39 19.13ZM157.77 0.919983C151.24 12.66 138.71 20.6 124.33 20.6C109.95 20.6 97.44 12.67 90.9 0.939983L33.9 33.85C37.08 39.43 38.91 45.88 38.91 52.76C38.91 56.71 38.31 60.52 37.2 64.11L96.46 98.32C103.44 90.87 113.36 86.22 124.37 86.22C135.44 86.22 145.41 90.93 152.39 98.44L211.59 64.27C210.45 60.64 209.83 56.78 209.83 52.77C209.83 45.89 211.65 39.44 214.84 33.86L157.77 0.919983Z" fill="#CE3936"></path><path d="M29.97 95.95L72.28 120.38C72.17 121.74 72.12 123.1 72.12 124.47C72.12 145.02 83.86 163.08 101.74 171.58V220.23C96.58 222.71 91.84 226.04 87.75 230.05L51.17 208.93C52.29 204.64 52.87 200.21 52.87 195.74C52.87 171.78 36.65 151.53 14.61 145.41V103.06C20.07 101.55 25.27 99.14 29.97 95.95ZM28.5 78.97C21.52 86.38 11.63 91.02 0.640015 91.02V157.49C21.77 157.49 38.9 174.62 38.9 195.75C38.9 202.77 37 209.33 33.71 214.99L91.2 248.18C96.43 239.14 105.25 232.45 115.71 230.04V161.73C98.74 157.81 86.09 142.62 86.09 124.46C86.09 120.54 86.68 116.75 87.78 113.18L28.5 78.97Z" fill="#CE3936"></path><path d="M498.39 177.5V144.88C498.39 128.55 485.11 115.27 468.78 115.27H343.22C342.69 115.27 342.18 115.32 341.67 115.4H337.19C332.35 115.4 328.42 111.46 328.42 106.63V74C328.42 69.16 332.36 65.23 337.19 65.23H486.33C492.08 65.23 496.75 60.57 496.75 54.81C496.75 49.06 492.08 44.39 486.33 44.39H337.19C320.86 44.39 307.58 57.67 307.58 74V106.62C307.58 122.95 320.86 136.23 337.19 136.23H462.75C463.28 136.23 463.79 136.18 464.3 136.1H468.78C473.62 136.1 477.55 140.04 477.55 144.87V177.49C477.55 182.33 473.61 186.26 468.78 186.26H319.64C313.89 186.26 309.22 190.92 309.22 196.68C309.22 202.43 313.89 207.1 319.64 207.1H468.78C485.11 207.11 498.39 193.83 498.39 177.5Z" fill="#CE3935"></path><path d="M710.7 177.32V75.24C710.7 58.91 697.42 45.63 681.09 45.63H550.05C533.72 45.63 520.44 58.91 520.44 75.24V177.32C520.44 193.65 533.72 206.93 550.05 206.93H681.1C697.42 206.93 710.7 193.65 710.7 177.32ZM541.27 75.24C541.27 70.4 545.21 66.47 550.04 66.47H681.09C685.93 66.47 689.86 70.41 689.86 75.24V177.32C689.86 182.16 685.92 186.09 681.09 186.09H550.05C545.21 186.09 541.28 182.15 541.28 177.32V75.24H541.27Z" fill="#CE3935"></path><path d="M1823 177.32V75.24C1823 58.91 1809.72 45.63 1793.39 45.63H1662.34C1646.01 45.63 1632.73 58.91 1632.73 75.24V177.32C1632.73 193.65 1646.01 206.93 1662.34 206.93H1793.39C1809.72 206.93 1823 193.65 1823 177.32ZM1653.57 75.24C1653.57 70.4 1657.51 66.47 1662.34 66.47H1793.39C1798.23 66.47 1802.16 70.41 1802.16 75.24V177.32C1802.16 182.16 1798.22 186.09 1793.39 186.09H1662.34C1657.5 186.09 1653.57 182.15 1653.57 177.32V75.24Z" fill="#CE3935"></path><path d="M756.76 196.51V152H849.42C855.17 152 859.84 147.34 859.84 141.58C859.84 135.83 855.17 131.16 849.42 131.16H756.76V75.23C756.76 70.39 760.7 66.46 765.53 66.46H893.29C899.04 66.46 903.71 61.8 903.71 56.04C903.71 50.29 899.04 45.62 893.29 45.62H765.53C749.2 45.62 735.92 58.9 735.92 75.23V196.5C735.92 202.25 740.59 206.92 746.34 206.92C752.09 206.93 756.76 202.27 756.76 196.51Z" fill="#CE3935"></path><path d="M933.86 66.47H1006.51V194.32C1006.51 200.07 1011.18 204.74 1016.93 204.74C1022.68 204.74 1027.35 200.07 1027.35 194.32V66.47H1100C1105.75 66.47 1110.42 61.81 1110.42 56.05C1110.42 50.3 1105.76 45.63 1100 45.63H933.86C928.11 45.63 923.44 50.29 923.44 56.05C923.45 61.81 928.11 66.47 933.86 66.47Z" fill="#CE3935"></path><path d="M1218.44 204.19C1224.19 204.19 1228.86 199.53 1228.86 193.77V152H1368.13C1384.46 152 1397.74 138.72 1397.74 122.39V75.24C1397.74 58.91 1384.46 45.63 1368.13 45.63H1237.63C1221.3 45.63 1208.02 58.91 1208.02 75.24V193.77C1208.02 199.53 1212.68 204.19 1218.44 204.19ZM1237.63 66.47H1368.13C1372.97 66.47 1376.9 70.41 1376.9 75.24V122.39C1376.9 127.23 1372.96 131.16 1368.13 131.16H1228.86V75.23C1228.86 70.41 1232.79 66.47 1237.63 66.47Z" fill="#CE3935"></path><path d="M1430.64 204.19C1436.39 204.19 1441.06 199.53 1441.06 193.77V152H1523.95C1524.57 153.18 1525.42 154.26 1526.51 155.17L1581.89 201.23C1583.83 202.85 1586.2 203.64 1588.55 203.64C1591.54 203.64 1594.5 202.36 1596.57 199.88C1600.25 195.46 1599.64 188.89 1595.22 185.21L1555.29 152H1580.33C1596.66 152 1609.94 138.72 1609.94 122.39V75.24C1609.94 58.91 1596.66 45.63 1580.33 45.63H1449.83C1433.5 45.63 1420.22 58.91 1420.22 75.24V193.77C1420.22 199.53 1424.88 204.19 1430.64 204.19ZM1449.83 66.47H1580.33C1585.17 66.47 1589.1 70.41 1589.1 75.24V122.39C1589.1 127.23 1585.17 131.16 1580.33 131.16H1441.06V75.23C1441.05 70.41 1444.99 66.47 1449.83 66.47Z" fill="#CE3935"></path>', 10)
34
- ]));
35
- }
36
- const ce = /* @__PURE__ */ C(le, [["render", ie]]), ue = {
37
- components: { IconChevronDown: te },
38
- props: { route: Object },
39
- mounted() {
40
- var o, e, r;
41
- (o = this.route) != null && o.menu && (r = (e = this.route) == null ? void 0 : e.menu) != null && r.some(
42
- (a) => {
43
- var l, i;
44
- return (a == null ? void 0 : a.path) === this.$route.path.replace("/", "") || ((i = (l = this.$route) == null ? void 0 : l.params) == null ? void 0 : i.table) === (a == null ? void 0 : a.table) && (a == null ? void 0 : a.table);
45
- }
46
- ) && (this.isOpen = !0);
47
- },
48
- watch: {
49
- route(o) {
50
- o != null && o.open && (this.isOpen = !0);
51
- }
52
- },
53
- data() {
54
- return {
55
- isOpen: !1
56
- };
57
- }
58
- }, de = {
59
- key: 0,
60
- class: ""
61
- }, pe = { class: "ml-[30px] py-[6px] before:block before:absolute relative w-[196px] flex flex-col gap-[6px] inline-block before:w-[2px] before:h-[100%] before:bg-gray-100 before:left-[-14px] cursor-pointer" }, fe = { key: 1 };
62
- function he(o, e, r, a, l, i) {
63
- var g, w, x, _, m, y, u, p, $, k, I, z, j;
64
- const b = v("IconChevronDown"), f = v("router-link");
65
- return (g = r.route) != null && g.menu ? (n(), s("div", de, [
66
- t("button", {
67
- onClick: e[0] || (e[0] = (h) => l.isOpen = !l.isOpen),
68
- class: E(["flex items-center justify-start w-full px-3 py-2 text-sm text-left text-gray-800 duration-300 border-none rounded-lg cursor-pointer gap-x-3 focus:outline-none hover:bg-gray-100", [
69
- ((x = (w = r.route) == null ? void 0 : w.menu) == null ? void 0 : x.some(
70
- (h) => {
71
- var d, Z;
72
- return (h == null ? void 0 : h.path) === o.$route.path.replace("/", "") || (h == null ? void 0 : h.table) === ((Z = (d = o.$route) == null ? void 0 : d.params) == null ? void 0 : Z.table) && (h == null ? void 0 : h.table);
73
- }
74
- )) && "bg-gray-100"
75
- ]])
76
- }, [
77
- L(V((_ = r.route) == null ? void 0 : _.ua) + " ", 1),
78
- c(b, {
79
- class: E([[l.isOpen && "-rotate-180"], "ml-auto duration-300"]),
80
- width: "14",
81
- height: "14"
82
- }, null, 8, ["class"])
83
- ], 2),
84
- c(T, { name: "fade" }, {
85
- default: M(() => {
86
- var h;
87
- return [
88
- G(t("ul", pe, [
89
- (n(!0), s(N, null, S((h = r.route) == null ? void 0 : h.menu, (d, Z) => {
90
- var U, A;
91
- return n(), s("li", {
92
- key: Z,
93
- class: "w-full"
94
- }, [
95
- c(f, {
96
- to: "/" + (d == null ? void 0 : d.path),
97
- class: E([[
98
- ((d == null ? void 0 : d.path) === o.$route.path.replace("/", "") || ((A = (U = o.$route) == null ? void 0 : U.params) == null ? void 0 : A.table) === (d == null ? void 0 : d.table) && (d == null ? void 0 : d.table)) && "bg-gray-100"
99
- ], "flex px-3 py-2 text-sm text-gray-800 rounded-lg gap-x-4 hover:bg-gray-100 focus:outline-none focus:bg-gray-100"])
100
- }, {
101
- default: M(() => [
102
- L(V(d == null ? void 0 : d.ua), 1)
103
- ]),
104
- _: 2
105
- }, 1032, ["to", "class"])
106
- ]);
107
- }), 128))
108
- ], 512), [
109
- [J, l.isOpen]
110
- ])
111
- ];
112
- }),
113
- _: 1
114
- })
115
- ])) : (n(), s("div", fe, [
116
- c(f, {
117
- to: ((y = (m = r.route) == null ? void 0 : m.path) == null ? void 0 : y[0]) === "/" ? (u = r.route) == null ? void 0 : u.path : "/" + ((p = r.route) == null ? void 0 : p.path),
118
- class: E([[
119
- ((($ = r.route) == null ? void 0 : $.path.replace("/", "")) === o.$route.path.replace("/", "") || ((I = (k = o.$route) == null ? void 0 : k.params) == null ? void 0 : I.table) === ((z = r.route) == null ? void 0 : z.table) && ((j = r.route) == null ? void 0 : j.table)) && "bg-gray-100"
120
- ], "flex gap-x-3 py-2 w-full font-[400] px-3 text-sm text-gray-800 rounded-lg items-center hover:bg-gray-100 duration-300 hover:text-gray-800"])
121
- }, {
122
- default: M(() => {
123
- var h;
124
- return [
125
- L(V((h = r.route) == null ? void 0 : h.ua), 1)
126
- ];
127
- }),
128
- _: 1
129
- }, 8, ["to", "class"])
130
- ]));
131
- }
132
- const ge = /* @__PURE__ */ C(ue, [["render", he]]), xe = {
133
- components: { IconLogout: re, NavbarItem: ge, IconLogo: ce, IconSearch: Q },
134
- data() {
135
- return {
136
- activeIndex: null,
137
- searchValue: ""
138
- };
139
- },
140
- computed: {
141
- data() {
142
- var o;
143
- return (o = this.searchValue) != null && o.trim() ? this.filterMenu(B.value, this.searchValue) : B.value;
144
- },
145
- logo() {
146
- var o;
147
- return ((o = F.value) == null ? void 0 : o.logo) || "/assets/logo.svg";
148
- }
149
- },
150
- methods: {
151
- filterMenu(o, e) {
152
- return o.map((r) => {
153
- var a, l;
154
- if (r.menu) {
155
- const i = this.filterMenu(r.menu, e);
156
- if (i.length > 0)
157
- return { ...r, menu: i, open: !0 };
158
- } else if ((l = (a = r.ua) == null ? void 0 : a.toLowerCase()) != null && l.includes(e.toLowerCase()))
159
- return r;
160
- return null;
161
- }).filter(Boolean);
162
- }
163
- }
164
- }, be = { class: "flex flex-col h-[100vh] border-r w-[260px] shrink-0" }, _e = ["src"], ve = { class: "relative" }, we = { class: "p-[16px] 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" }, Ce = { class: "flex flex-col flex-wrap w-full pb-3" }, me = {
165
- key: 0,
166
- class: "flex flex-col gap-[6px]"
167
- }, ye = {
168
- key: 1,
169
- class: "text-gray-800 text-lg mt-[20px]"
170
- };
171
- function ke(o, e, r, a, l, i) {
172
- var w;
173
- const b = v("IconSearch"), f = v("VsText"), g = v("NavbarItem");
174
- return n(), s("div", be, [
175
- t("img", {
176
- src: i.logo,
177
- height: "40",
178
- width: "200",
179
- class: "my-[20px] ml-[20px]"
180
- }, null, 8, _e),
181
- t("div", ve, [
182
- c(b, {
183
- height: "16",
184
- width: "16",
185
- class: "absolute top-[12px] left-[30px] text-gray-500 z-[1]"
186
- }),
187
- c(f, {
188
- type: "text",
189
- modelValue: l.searchValue,
190
- "onUpdate:modelValue": e[0] || (e[0] = (x) => l.searchValue = x),
191
- clearable: !0,
192
- placeholder: "Пошук по меню",
193
- class: "[&>input]:h-[40px] [&>input]:block [&>input]:rounded-none [&>input]:border-x-0 [&>input]:pl-[60px] [&>input:focus]:outline-none [&>input:focus]:focus:ring-0 [&>input:focus]:border-y-gray-200 [&>input:focus]:border-y-1 [&>input:focus]:border-x-0"
194
- }, null, 8, ["modelValue"])
195
- ]),
196
- t("div", we, [
197
- t("nav", Ce, [
198
- (w = i.data) != null && w.length ? (n(), s("ul", me, [
199
- (n(!0), s(N, null, S(i.data, (x, _) => (n(), s("li", {
200
- key: _,
201
- class: "flex flex-col gap-[6px]"
202
- }, [
203
- c(g, { route: x }, null, 8, ["route"])
204
- ]))), 128))
205
- ])) : (n(), s("div", ye, "Не знайдено"))
206
- ])
207
- ])
208
- ]);
209
- }
210
- const $e = /* @__PURE__ */ C(xe, [["render", ke]]), Ve = {}, Me = {
211
- class: "shrink-0",
212
- xmlns: "http://www.w3.org/2000/svg",
213
- width: "24",
214
- height: "24",
215
- viewBox: "0 0 24 24",
216
- fill: "none",
217
- stroke: "currentColor",
218
- "stroke-width": "2",
219
- "stroke-linecap": "round",
220
- "stroke-linejoin": "round"
221
- };
222
- function He(o, e) {
223
- return n(), s("svg", Me, e[0] || (e[0] = [
224
- t("path", { d: "M18 6 7 17l-5-5" }, null, -1),
225
- t("path", { d: "m22 10-7.5 7.5L13 16" }, null, -1)
226
- ]));
227
- }
228
- const Le = /* @__PURE__ */ C(Ve, [["render", He]]), Ie = {}, ze = {
229
- xmlns: "http://www.w3.org/2000/svg",
230
- width: "24",
231
- height: "24",
232
- viewBox: "0 0 24 24",
233
- fill: "currentColor",
234
- class: "icon icon-tabler icons-tabler-filled icon-tabler-user"
235
- };
236
- function je(o, e, r, a, l, i) {
237
- return n(), s("svg", ze, e[0] || (e[0] = [
238
- t("path", {
239
- stroke: "none",
240
- d: "M0 0h24v24H0z",
241
- fill: "none"
242
- }, null, -1),
243
- t("path", { d: "M12 2a5 5 0 1 1 -5 5l.005 -.217a5 5 0 0 1 4.995 -4.783z" }, null, -1),
244
- t("path", { d: "M14 14a5 5 0 0 1 5 5v1a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-1a5 5 0 0 1 5 -5h4z" }, null, -1)
245
- ]));
246
- }
247
- const P = /* @__PURE__ */ C(Ie, [["render", je]]), Ee = {}, De = {
248
- class: "shrink-0 size-4",
249
- xmlns: "http://www.w3.org/2000/svg",
250
- width: "24",
251
- height: "24",
252
- viewBox: "0 0 24 24",
253
- fill: "none",
254
- stroke: "currentColor",
255
- "stroke-width": "2",
256
- "stroke-linecap": "round",
257
- "stroke-linejoin": "round"
258
- };
259
- function Oe(o, e) {
260
- return n(), s("svg", De, e[0] || (e[0] = [
261
- t("polyline", { points: "9 11 12 14 22 4" }, null, -1),
262
- t("path", { d: "M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11" }, null, -1)
263
- ]));
264
- }
265
- const Ze = /* @__PURE__ */ C(Ee, [["render", Oe]]), Ne = { class: "relative shrink-0" }, Be = ["src"], Se = {
266
- key: 1,
267
- class: "h-[38px] w-[38px] bg-gray-200 rounded-full flex items-center justify-center"
268
- }, Ue = {
269
- key: 2,
270
- class: "absolute top-4 -start-3 size-2 bg-blue-600 rounded-full dark:bg-blue-500"
271
- }, Ae = { class: "grow" }, Te = { class: "text-xs text-gray-500 dark:text-neutral-500" }, Pe = { class: "block text-sm font-medium text-gray-800 dark:text-neutral-300" }, Qe = { class: "text-sm text-gray-500 dark:text-neutral-500" }, Fe = {
272
- key: 0,
273
- class: "sm:group-hover:opacity-100 sm:opacity-0 sm:absolute sm:top-5 sm:end-5 inline-block p-0.5 bg-white border border-gray-200 rounded-lg shadow-sm transition ease-out"
274
- }, Re = {
275
- __name: "admin-notification-item",
276
- props: { item: Object },
277
- emits: ["update-notification"],
278
- setup(o, { emit: e }) {
279
- const r = e, a = D(!1), l = () => a.value = !0, i = () => a.value = !1, b = async () => {
280
- var f;
281
- try {
282
- await O.get(`/api/notification-read/${(f = o.item) == null ? void 0 : f.id}`), await r("update-notification");
283
- } catch {
284
- }
285
- };
286
- return (f, g) => {
287
- var x, _, m, y, u, p;
288
- const w = v("VsPopover");
289
- return n(), s("li", {
290
- class: E(["relative group w-full flex gap-x-5 text-start p-5 border-b", [(x = o.item) != null && x.read ? "bg-gray-100" : "bg-white"]]),
291
- onMouseenter: l,
292
- onMouseleave: i
293
- }, [
294
- t("div", Ne, [
295
- (_ = o.item) != null && _.avatar ? (n(), s("img", {
296
- key: 0,
297
- class: "shrink-0 size-[38px] rounded-full",
298
- src: (m = o.item) == null ? void 0 : m.avatar,
299
- alt: "Avatar"
300
- }, null, 8, Be)) : (n(), s("div", Se, [
301
- c(P)
302
- ])),
303
- (y = o.item) != null && y.read ? (n(), s("span", Ue)) : H("", !0)
304
- ]),
305
- t("div", Ae, [
306
- t("p", Te, [
307
- c(R, {
308
- name: "cdate",
309
- data: o.item
310
- }, null, 8, ["data"])
311
- ]),
312
- t("span", Pe, V((u = o.item) == null ? void 0 : u.author), 1),
313
- t("p", Qe, V((p = o.item) == null ? void 0 : p.subject), 1)
314
- ]),
315
- a.value ? (n(), s("div", Fe, [
316
- c(w, {
317
- trigger: "hover",
318
- placement: "left"
319
- }, {
320
- reference: M(() => [
321
- t("button", {
322
- onClick: b,
323
- type: "button",
324
- class: "hs-tooltip-toggle hs-tooltip relative inline-block size-7 flex shrink-0 justify-center items-center text-gray-500 hover:bg-gray-100 hover:text-gray-800 rounded"
325
- }, [
326
- c(Ze)
327
- ])
328
- ]),
329
- default: M(() => [
330
- g[0] || (g[0] = L(" Прочитати "))
331
- ]),
332
- _: 1
333
- })
334
- ])) : H("", !0)
335
- ], 34);
336
- };
337
- }
338
- }, qe = {}, Ge = {
339
- class: "flex-shrink-0 size-4",
340
- xmlns: "http://www.w3.org/2000/svg",
341
- viewBox: "0 0 24 24",
342
- fill: "none",
343
- stroke: "currentColor",
344
- "stroke-width": "2",
345
- "stroke-linecap": "round",
346
- "stroke-linejoin": "round"
347
- };
348
- function Je(o, e, r, a, l, i) {
349
- return n(), s("svg", Ge, e[0] || (e[0] = [
350
- t("path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" }, null, -1),
351
- t("path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0" }, null, -1)
352
- ]));
353
- }
354
- const Ke = /* @__PURE__ */ C(qe, [["render", Je]]), We = {}, Xe = {
355
- class: "shrink-0 size-4",
356
- xmlns: "http://www.w3.org/2000/svg",
357
- width: "24",
358
- height: "24",
359
- viewBox: "0 0 24 24",
360
- fill: "none",
361
- stroke: "currentColor",
362
- "stroke-width": "2",
363
- "stroke-linecap": "round",
364
- "stroke-linejoin": "round"
365
- };
366
- function Ye(o, e) {
367
- return n(), s("svg", Xe, e[0] || (e[0] = [
368
- t("path", { d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" }, null, -1),
369
- t("circle", {
370
- cx: "12",
371
- cy: "12",
372
- r: "3"
373
- }, null, -1)
374
- ]));
375
- }
376
- const et = /* @__PURE__ */ C(We, [["render", Ye]]), tt = {
377
- key: 0,
378
- class: "flex absolute top-0 end-0 -mt-1.5 -me-1.5"
379
- }, ot = { class: "relative min-w-[18px] min-h-[18px] inline-flex justify-center items-center text-[10px] bg-red-500 text-white rounded-full px-1" }, nt = {
380
- key: 0,
381
- class: "w-96 h-[100px] z-[11] absolute top-[40px] right-0"
382
- }, st = { class: "h-[50px] px-[20px] border-b w-full flex items-center justify-between rounded-t-lg bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)]" }, rt = { class: "h-[30px] w-[30px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100" }, lt = { class: "max-h-[400px] bg-white overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300" }, at = { key: 0 }, it = {
383
- __name: "admin-notification",
384
- setup(o) {
385
- var w, x, _, m, y;
386
- const e = D(0), r = D([]), a = D(!1), l = D(null), i = (y = (m = (_ = (x = (w = K()) == null ? void 0 : w.appContext) == null ? void 0 : x.app) == null ? void 0 : _.config) == null ? void 0 : m.globalProperties) == null ? void 0 : y.$notify, b = (u) => {
387
- l.value && !l.value.contains(u.target) && (a.value = !1);
388
- };
389
- W(a, (u) => {
390
- u ? window.addEventListener("click", b) : window.removeEventListener("click", b);
391
- }), X(() => {
392
- window.removeEventListener("click", b);
393
- });
394
- const f = async () => {
395
- try {
396
- const { data: u } = await O.get("/api/notification");
397
- r.value = (u == null ? void 0 : u.rows) || [];
398
- } catch {
399
- i({
400
- type: "error",
401
- message: "При спробі завантаження нотифікацій виникла помилка",
402
- title: "Помилка!"
403
- });
404
- }
405
- };
406
- f();
407
- const g = async () => {
408
- try {
409
- await O.get("/api/notification-read"), await f();
410
- } catch {
411
- i({
412
- type: "error",
413
- message: "Виникла помилка",
414
- title: "Помилка!"
415
- });
416
- }
417
- };
418
- return (u, p) => (n(), s("div", {
419
- ref_key: "notificationRef",
420
- ref: l,
421
- class: "hs-tooltip [--placement:bottom] inline-block show relative"
422
- }, [
423
- t("button", {
424
- onClick: p[0] || (p[0] = ($) => a.value = !a.value),
425
- class: "hs-tooltip-toggle relative size-[38px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100"
426
- }, [
427
- c(Ke, {
428
- height: "24",
429
- width: "24"
430
- }),
431
- e.value ? (n(), s("span", tt, [
432
- p[1] || (p[1] = t("span", { class: "absolute inline-flex bg-red-400 rounded-full opacity-75 animate-ping size-full dark:bg-red-600" }, null, -1)),
433
- t("span", ot, V(e.value), 1)
434
- ])) : H("", !0)
435
- ]),
436
- c(T, null, {
437
- default: M(() => {
438
- var $;
439
- return [
440
- a.value ? (n(), s("div", nt, [
441
- t("div", st, [
442
- p[2] || (p[2] = t("nav", { class: "flex" }, [
443
- t("button", {
444
- type: "button",
445
- class: "px-2 py-1.5 relative inline-flex justify-center items-center gap-x-2 text-nowrap hover:bg-gray-100 text-gray-500 hover:text-gray-800 text-sm rounded-lg focus:outline-none focus:bg-gray-100 after:absolute after:bottom-[-9px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800"
446
- }, " Всі ")
447
- ], -1)),
448
- t("button", rt, [
449
- c(et)
450
- ])
451
- ]),
452
- t("div", lt, [
453
- ($ = r.value) != null && $.length ? (n(), s("ul", at, [
454
- (n(!0), s(N, null, S(r.value, (k) => (n(), Y(Re, {
455
- key: k == null ? void 0 : k.id,
456
- item: k,
457
- onUpdateNotification: f
458
- }, null, 8, ["item"]))), 128))
459
- ])) : H("", !0)
460
- ]),
461
- t("button", {
462
- onClick: g,
463
- class: "h-[50px] border-t w-full rounded-b-lg bg-white shadow p-4 flex justify-center items-center gap-x-2 text-sm text-gray-500 font-medium sm:rounded-b-lg hover:text-blue-600 focus:outline-none"
464
- }, [
465
- c(Le, {
466
- height: "16",
467
- width: "16"
468
- }),
469
- p[3] || (p[3] = L(" Прочитати усі "))
470
- ])
471
- ])) : H("", !0)
472
- ];
473
- }),
474
- _: 1
475
- })
476
- ], 512));
477
- }
478
- }, ct = {}, ut = {
479
- class: "flex-shrink-0 size-4",
480
- xmlns: "http://www.w3.org/2000/svg",
481
- viewBox: "0 0 24 24",
482
- fill: "none",
483
- stroke: "currentColor",
484
- "stroke-width": "2",
485
- "stroke-linecap": "round",
486
- "stroke-linejoin": "round"
487
- };
488
- function dt(o, e, r, a, l, i) {
489
- return n(), s("svg", ut, e[0] || (e[0] = [
490
- t("circle", {
491
- cx: "12",
492
- cy: "12",
493
- r: "10"
494
- }, null, -1),
495
- t("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }, null, -1),
496
- t("path", { d: "M12 17h.01" }, null, -1)
497
- ]));
498
- }
499
- const pt = /* @__PURE__ */ C(ct, [["render", dt]]), ft = {
500
- components: { IconQuestion: pt, IconUser: P, AdminNotification: it },
501
- mounted() {
502
- this.getUserData();
503
- },
504
- data() {
505
- return {
506
- userData: null,
507
- isVisible: !1
508
- };
509
- },
510
- watch: {
511
- isVisible(o) {
512
- o ? setTimeout(
513
- () => window.addEventListener("click", this.closeOnOutsideClick),
514
- 0
515
- ) : window.removeEventListener("click", this.closeOnOutsideClick);
516
- }
517
- },
518
- methods: {
519
- async getUserData() {
520
- try {
521
- const { data: o } = await O.get("/user");
522
- this.userData = o;
523
- } catch {
524
- }
525
- },
526
- async logout() {
527
- try {
528
- await O.get("/logout"), await window.history.pushState({}, "", "/login"), await location.reload(), localStorage.removeItem("user");
529
- } catch {
530
- }
531
- },
532
- closeOnOutsideClick() {
533
- this.isVisible = !1;
534
- }
535
- },
536
- beforeUnmount() {
537
- window.removeEventListener("click", this.closeOnOutsideClick);
538
- }
539
- }, ht = {
540
- class: "h-[60px] border-b flex justify-end px-[20px]",
541
- style: { width: "calc(100vw - 260px)" }
542
- }, gt = { class: "flex items-center gap-[6px]" }, xt = {
543
- href: "docs-softpro.com",
544
- class: "size-[38px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"
545
- }, bt = { class: "relative" }, _t = ["src"], vt = {
546
- key: 1,
547
- class: "size-[40px] rounded-full bg-gray-200 flex items-center justify-center"
548
- }, wt = { class: "p-[10px] gap-[6px] items-center border-b flex justify-between" }, Ct = ["src"], mt = {
549
- key: 1,
550
- class: "size-[40px] rounded-full bg-gray-200 flex items-center justify-center"
551
- }, yt = { class: "text-[14px] mr-[10px] text-gray-500" }, kt = { class: "flex flex-col p-[4px]" };
552
- function $t(o, e, r, a, l, i) {
553
- var x, _, m, y, u, p, $, k, I, z;
554
- const b = v("IconQuestion"), f = v("AdminNotification"), g = v("IconUser"), w = v("router-link");
555
- return n(), s("div", ht, [
556
- t("div", gt, [
557
- t("a", xt, [
558
- c(b, {
559
- height: "24",
560
- width: "24"
561
- })
562
- ]),
563
- c(f),
564
- e[4] || (e[4] = t("div", { class: "h-[30px] w-[1px] bg-gray-200 ml-[10px] mr-[10px]" }, null, -1)),
565
- t("div", bt, [
566
- t("div", {
567
- onClick: e[0] || (e[0] = (j) => l.isVisible = !0),
568
- class: "cursor-pointer"
569
- }, [
570
- (_ = (x = l.userData) == null ? void 0 : x.user) != null && _.avatar ? (n(), s("img", {
571
- key: 0,
572
- class: "flex-shrink-0 size-[30px] rounded-full",
573
- src: (y = (m = l.userData) == null ? void 0 : m.user) == null ? void 0 : y.avatar,
574
- alt: "Image Description"
575
- }, null, 8, _t)) : (n(), s("div", vt, [
576
- c(g)
577
- ]))
578
- ]),
579
- l.isVisible ? (n(), s("div", {
580
- key: 0,
581
- onClick: e[2] || (e[2] = ee(() => {
582
- }, ["stop"])),
583
- class: "fixed bg-white w-[180px] top-[55px] right-[20px] shadow-xl rounded-xl z-[1]"
584
- }, [
585
- t("div", wt, [
586
- (p = (u = l.userData) == null ? void 0 : u.user) != null && p.avatar ? (n(), s("img", {
587
- key: 0,
588
- class: "flex-shrink-0 size-[30px] rounded-full",
589
- src: (k = ($ = l.userData) == null ? void 0 : $.user) == null ? void 0 : k.avatar,
590
- alt: "Image Description"
591
- }, null, 8, Ct)) : (n(), s("div", mt, [
592
- c(g)
593
- ])),
594
- t("div", null, [
595
- t("p", yt, V((z = (I = l.userData) == null ? void 0 : I.user) == null ? void 0 : z.username), 1)
596
- ])
597
- ]),
598
- t("div", kt, [
599
- c(w, {
600
- to: "profile",
601
- disabled: !0,
602
- class: "p-[8px] block rounded-lg w-full mb-[4px] text-start hover:bg-gray-100 !duration-300"
603
- }, {
604
- default: M(() => e[3] || (e[3] = [
605
- L("Профіль")
606
- ])),
607
- _: 1
608
- }),
609
- t("button", {
610
- onClick: e[1] || (e[1] = (...j) => i.logout && i.logout(...j)),
611
- class: "p-[8px] block rounded-lg w-full text-start hover:bg-gray-100 !duration-300"
612
- }, " Вийти ")
613
- ])
614
- ])) : H("", !0)
615
- ])
616
- ])
617
- ]);
618
- }
619
- const Vt = /* @__PURE__ */ C(ft, [["render", $t]]), Mt = {
620
- components: { navbar: $e, AdminHeader: Vt },
621
- computed: {
622
- isMenu() {
623
- return B.value || null;
624
- }
625
- }
626
- }, Ht = { class: "admin-wrapper" }, Lt = { class: "flex flex-col" };
627
- function It(o, e, r, a, l, i) {
628
- const b = v("navbar"), f = v("admin-header"), g = v("router-view");
629
- return n(), s("div", Ht, [
630
- c(b),
631
- t("div", Lt, [
632
- i.isMenu ? (n(), s(N, { key: 0 }, [
633
- c(f),
634
- c(g)
635
- ], 64)) : H("", !0)
636
- ])
637
- ]);
638
- }
639
- const Dt = /* @__PURE__ */ C(Mt, [["render", It], ["__scopeId", "data-v-a53a7af5"]]);
640
- export {
641
- Dt as default
642
- };