sinde-ui 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/LICENSE.md +171 -0
  2. package/NOTICE +21 -0
  3. package/README.md +296 -2
  4. package/THIRD_PARTY_LICENSES.md +131 -0
  5. package/dist/chunks/use-ui-config-Ckaon2pR.mjs +10 -0
  6. package/dist/components/SAppShell.vue.d.ts +21 -0
  7. package/dist/components/SAsideNav.vue.d.ts +27 -0
  8. package/dist/components/SAvatar.vue.d.ts +21 -0
  9. package/dist/components/SBtn.vue.d.ts +15 -0
  10. package/dist/components/SCheckbox.vue.d.ts +24 -0
  11. package/dist/components/SCopy.vue.d.ts +26 -0
  12. package/dist/components/SCropper.vue.d.ts +16 -0
  13. package/dist/components/SDataTable.vue.d.ts +57 -0
  14. package/dist/components/SDateTimePicker/Calendar.vue.d.ts +40 -0
  15. package/dist/components/SDateTimePicker/Popover.vue.d.ts +22 -0
  16. package/dist/components/SDateTimePicker/QuickActions.vue.d.ts +13 -0
  17. package/dist/components/SDateTimePicker/Time.vue.d.ts +29 -0
  18. package/dist/components/SDateTimePicker/TimeWheel.vue.d.ts +15 -0
  19. package/dist/components/SDateTimePicker/index.vue.d.ts +33 -0
  20. package/dist/components/SDatetime.vue.d.ts +20 -0
  21. package/dist/components/SDocMarkdown.vue.d.ts +6 -0
  22. package/dist/components/SField.vue.d.ts +14 -0
  23. package/dist/components/SFile.vue.d.ts +27 -0
  24. package/dist/components/SGradation.vue.d.ts +24 -0
  25. package/dist/components/SIcon.vue.d.ts +8 -0
  26. package/dist/components/SImage.vue.d.ts +60 -0
  27. package/dist/components/SInput.vue.d.ts +21 -0
  28. package/dist/components/SLink.vue.d.ts +16 -0
  29. package/dist/components/SList.vue.d.ts +19 -0
  30. package/dist/components/SLoad.vue.d.ts +7 -0
  31. package/dist/components/SNav.vue.d.ts +13 -0
  32. package/dist/components/SNotification.vue.d.ts +15 -0
  33. package/dist/components/SNotificationHost.vue.d.ts +3 -0
  34. package/dist/components/SRange.vue.d.ts +19 -0
  35. package/dist/components/SScrollableEdges.vue.d.ts +21 -0
  36. package/dist/components/SSelect.vue.d.ts +39 -0
  37. package/dist/components/SSpoiler.vue.d.ts +24 -0
  38. package/dist/components/STextSpans.vue.d.ts +35 -0
  39. package/dist/components/STextarea.vue.d.ts +16 -0
  40. package/dist/components/SToggle.vue.d.ts +26 -0
  41. package/dist/components/STooltip.vue.d.ts +16 -0
  42. package/dist/components/STree.vue.d.ts +11 -0
  43. package/dist/components/icons/book-open.vue.d.ts +3 -0
  44. package/dist/components/icons/braces.vue.d.ts +3 -0
  45. package/dist/components/icons/calendar.vue.d.ts +3 -0
  46. package/dist/components/icons/camera.vue.d.ts +3 -0
  47. package/dist/components/icons/check.vue.d.ts +3 -0
  48. package/dist/components/icons/chevron.vue.d.ts +3 -0
  49. package/dist/components/icons/clock.vue.d.ts +3 -0
  50. package/dist/components/icons/close.vue.d.ts +3 -0
  51. package/dist/components/icons/collapse.vue.d.ts +3 -0
  52. package/dist/components/icons/contact-round.vue.d.ts +3 -0
  53. package/dist/components/icons/crown.vue.d.ts +3 -0
  54. package/dist/components/icons/expand.vue.d.ts +3 -0
  55. package/dist/components/icons/file-pen-line.vue.d.ts +3 -0
  56. package/dist/components/icons/fit-screen.vue.d.ts +3 -0
  57. package/dist/components/icons/flip-x.vue.d.ts +3 -0
  58. package/dist/components/icons/flip-y.vue.d.ts +3 -0
  59. package/dist/components/icons/home.vue.d.ts +3 -0
  60. package/dist/components/icons/inbox.vue.d.ts +3 -0
  61. package/dist/components/icons/layout.vue.d.ts +3 -0
  62. package/dist/components/icons/package.vue.d.ts +3 -0
  63. package/dist/components/icons/receipt.vue.d.ts +3 -0
  64. package/dist/components/icons/refresh.vue.d.ts +3 -0
  65. package/dist/components/icons/rotate-left.vue.d.ts +3 -0
  66. package/dist/components/icons/rotate-right.vue.d.ts +3 -0
  67. package/dist/components/icons/send.vue.d.ts +3 -0
  68. package/dist/components/icons/shield-alert.vue.d.ts +3 -0
  69. package/dist/components/icons/trash-2.vue.d.ts +3 -0
  70. package/dist/components/icons/users.vue.d.ts +3 -0
  71. package/dist/components/icons/vertical-dots.vue.d.ts +3 -0
  72. package/dist/components/icons/zoom-in.vue.d.ts +3 -0
  73. package/dist/components/icons/zoom-out.vue.d.ts +3 -0
  74. package/dist/composables/use-clipboard.d.ts +10 -0
  75. package/dist/composables/use-link-component.d.ts +5 -0
  76. package/dist/composables/use-notifications.d.ts +24 -0
  77. package/dist/composables/use-open-select.d.ts +2 -0
  78. package/dist/composables/use-optional-router.d.ts +16 -0
  79. package/dist/composables/use-sinde-user.d.ts +16 -0
  80. package/dist/composables/use-ui-config.d.ts +19 -0
  81. package/dist/icons.d.ts +5 -0
  82. package/dist/index.d.ts +44 -0
  83. package/dist/index.mjs +3892 -0
  84. package/dist/nuxt.d.ts +18 -0
  85. package/dist/nuxt.mjs +44 -0
  86. package/dist/runtime/plugin.mjs +8 -0
  87. package/dist/style.css +2 -0
  88. package/dist/utils/count-form.d.ts +2 -0
  89. package/dist/utils/date.d.ts +5 -0
  90. package/dist/utils/media.d.ts +9 -0
  91. package/dist/utils/picker-dt.d.ts +30 -0
  92. package/package.json +100 -4
package/dist/index.mjs ADDED
@@ -0,0 +1,3892 @@
1
+ import { n as e, t } from "./chunks/use-ui-config-Ckaon2pR.mjs";
2
+ import { Fragment as n, Teleport as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createSlots as l, createTextVNode as u, createVNode as d, defineComponent as f, getCurrentInstance as p, inject as m, isRef as h, mergeModels as g, mergeProps as _, nextTick as v, normalizeClass as y, normalizeStyle as b, onBeforeUnmount as x, onMounted as ee, openBlock as S, provide as C, reactive as w, readonly as T, ref as E, renderList as D, renderSlot as O, resolveComponent as k, resolveDynamicComponent as A, toDisplayString as j, toValue as M, unref as N, useId as P, useModel as F, vModelCheckbox as I, vModelText as L, vShow as te, watch as R, withCtx as z, withDirectives as ne, withKeys as B, withModifiers as re } from "vue";
3
+ import { autoUpdate as V, flip as ie, offset as ae, shift as H, size as U, useFloating as W } from "@floating-ui/vue";
4
+ import oe from "cropperjs";
5
+ // \0rolldown/runtime.js
6
+ var G = Object.defineProperty, K = (e, t) => {
7
+ let n = {};
8
+ for (var r in e) G(n, r, {
9
+ get: e[r],
10
+ enumerable: !0
11
+ });
12
+ return t || G(n, Symbol.toStringTag, { value: "Module" }), n;
13
+ }, q = { class: "flex min-h-dvh w-full flex-col gap-2 p-2 sm:p-4" }, se = { class: "flex min-w-0 flex-1 gap-3 lg:flex-row lg:items-start" }, ce = { class: "flex min-w-0 flex-1 flex-col gap-3" }, le = /* @__PURE__ */ f({
14
+ __name: "SAppShell",
15
+ emits: ["ready", "dispose"],
16
+ setup(e, { emit: t }) {
17
+ let n = t;
18
+ return ee(() => n("ready")), x(() => n("dispose")), (e, t) => (S(), s("div", q, [c("div", se, [O(e.$slots, "nav"), c("div", ce, [O(e.$slots, "default")])])]));
19
+ }
20
+ }), J = (e, t) => {
21
+ let n = e.__vccOpts || e;
22
+ for (let [e, r] of t) n[e] = r;
23
+ return n;
24
+ }, ue = /* @__PURE__ */ K({ default: () => me }), de = {}, fe = {
25
+ xmlns: "http://www.w3.org/2000/svg",
26
+ viewBox: "0 0 24 24",
27
+ fill: "none",
28
+ stroke: "currentColor",
29
+ "stroke-width": "1.75",
30
+ "stroke-linecap": "round",
31
+ "stroke-linejoin": "round"
32
+ };
33
+ function pe(e, t) {
34
+ return S(), s("svg", fe, [...t[0] ||= [c("path", { d: "M3 4h6a3 3 0 0 1 3 3v13a2.5 2.5 0 0 0-2.5-2.5H3V4Z" }, null, -1), c("path", { d: "M21 4h-6a3 3 0 0 0-3 3v13a2.5 2.5 0 0 1 2.5-2.5H21V4Z" }, null, -1)]]);
35
+ }
36
+ var me = /*#__PURE__*/ J(de, [["render", pe]]), he = /* @__PURE__ */ K({ default: () => ve }), ge = {}, _e = {
37
+ xmlns: "http://www.w3.org/2000/svg",
38
+ viewBox: "0 0 24 24",
39
+ fill: "none",
40
+ stroke: "currentColor",
41
+ "stroke-width": "1.75",
42
+ "stroke-linecap": "round",
43
+ "stroke-linejoin": "round"
44
+ };
45
+ function Y(e, t) {
46
+ return S(), s("svg", _e, [...t[0] ||= [c("path", { d: "M8 3H7a2 2 0 0 0-2 2v4a2 2 0 0 1-2 2 2 2 0 0 1 2 2v4a2 2 0 0 0 2 2h1" }, null, -1), c("path", { d: "M16 3h1a2 2 0 0 1 2 2v4a2 2 0 0 0 2 2 2 2 0 0 0-2 2v4a2 2 0 0 1-2 2h-1" }, null, -1)]]);
47
+ }
48
+ var ve = /*#__PURE__*/ J(ge, [["render", Y]]), ye = /* @__PURE__ */ K({ default: () => Ce }), be = {}, xe = {
49
+ viewBox: "0 0 24 24",
50
+ fill: "currentColor"
51
+ };
52
+ function Se(e, t) {
53
+ return S(), s("svg", xe, [...t[0] ||= [c("path", { d: "M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z" }, null, -1)]]);
54
+ }
55
+ var Ce = /*#__PURE__*/ J(be, [["render", Se]]), we = /* @__PURE__ */ K({ default: () => Oe }), Te = {}, Ee = {
56
+ viewBox: "0 0 24 24",
57
+ fill: "currentColor"
58
+ };
59
+ function De(e, t) {
60
+ return S(), s("svg", Ee, [...t[0] ||= [c("path", { d: "M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z" }, null, -1)]]);
61
+ }
62
+ var Oe = /*#__PURE__*/ J(Te, [["render", De]]), ke = /* @__PURE__ */ K({ default: () => Ne }), Ae = {}, je = {
63
+ viewBox: "0 0 24 24",
64
+ fill: "currentColor"
65
+ };
66
+ function Me(e, t) {
67
+ return S(), s("svg", je, [...t[0] ||= [c("path", { d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }, null, -1)]]);
68
+ }
69
+ var Ne = /*#__PURE__*/ J(Ae, [["render", Me]]), Pe = /* @__PURE__ */ K({ default: () => Re }), Fe = {}, Ie = {
70
+ viewBox: "0 0 24 24",
71
+ fill: "currentColor"
72
+ };
73
+ function Le(e, t) {
74
+ return S(), s("svg", Ie, [...t[0] ||= [c("g", { transform: "translate(12 12) scale(1.25) translate(-12 -12)" }, [c("path", { d: "M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" })], -1)]]);
75
+ }
76
+ var Re = /*#__PURE__*/ J(Fe, [["render", Le]]), ze = /* @__PURE__ */ K({ default: () => Ue }), Be = {}, Ve = {
77
+ viewBox: "0 0 24 24",
78
+ fill: "currentColor"
79
+ };
80
+ function He(e, t) {
81
+ return S(), s("svg", Ve, [...t[0] ||= [c("path", { d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" }, null, -1), c("path", { d: "M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z" }, null, -1)]]);
82
+ }
83
+ var Ue = /*#__PURE__*/ J(Be, [["render", He]]), We = /* @__PURE__ */ K({ default: () => Je }), Ge = {}, Ke = {
84
+ viewBox: "0 0 24 24",
85
+ fill: "currentColor"
86
+ };
87
+ function qe(e, t) {
88
+ return S(), s("svg", Ke, [...t[0] ||= [c("path", { d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }, null, -1)]]);
89
+ }
90
+ var Je = /*#__PURE__*/ J(Ge, [["render", qe]]), Ye = /* @__PURE__ */ K({ default: () => $e }), Xe = {}, Ze = {
91
+ viewBox: "0 0 24 24",
92
+ fill: "currentColor"
93
+ };
94
+ function Qe(e, t) {
95
+ return S(), s("svg", Ze, [...t[0] ||= [c("g", { transform: "translate(12 12) scale(0.9) translate(-12 -12)" }, [c("path", { d: "M7.41 3.41 12 8l4.59-4.59L18 4.83l-6 6-6-6zM7.41 20.59 12 16l4.59 4.59L18 19.17l-6-6-6 6z" })], -1)]]);
96
+ }
97
+ var $e = /*#__PURE__*/ J(Xe, [["render", Qe]]), et = /* @__PURE__ */ K({ default: () => it }), tt = {}, nt = {
98
+ xmlns: "http://www.w3.org/2000/svg",
99
+ viewBox: "0 0 24 24",
100
+ fill: "none",
101
+ stroke: "currentColor",
102
+ "stroke-width": "1.75",
103
+ "stroke-linecap": "round",
104
+ "stroke-linejoin": "round"
105
+ };
106
+ function rt(e, t) {
107
+ return S(), s("svg", nt, [...t[0] ||= [
108
+ c("circle", {
109
+ cx: "12",
110
+ cy: "12",
111
+ r: "10"
112
+ }, null, -1),
113
+ c("circle", {
114
+ cx: "12",
115
+ cy: "9",
116
+ r: "3"
117
+ }, null, -1),
118
+ c("path", { d: "M6.5 19a6 6 0 0 1 11 0" }, null, -1)
119
+ ]]);
120
+ }
121
+ var it = /*#__PURE__*/ J(tt, [["render", rt]]), at = /* @__PURE__ */ K({ default: () => lt }), ot = {}, st = {
122
+ viewBox: "0 0 24 24",
123
+ fill: "currentColor"
124
+ };
125
+ function ct(e, t) {
126
+ return S(), s("svg", st, [...t[0] ||= [c("path", { d: "M5 16l-1-9 5 4 3-6 3 6 5-4-1 9H5zm1 2h12v2H6v-2z" }, null, -1)]]);
127
+ }
128
+ var lt = /*#__PURE__*/ J(ot, [["render", ct]]), ut = /* @__PURE__ */ K({ default: () => mt }), dt = {}, ft = {
129
+ viewBox: "0 0 24 24",
130
+ fill: "currentColor"
131
+ };
132
+ function pt(e, t) {
133
+ return S(), s("svg", ft, [...t[0] ||= [c("g", { transform: "translate(12 12) scale(0.9) translate(-12 -12)" }, [c("path", { d: "M12 5.83 16.59 10.41 18 9l-6-6-6 6 1.41 1.41zM12 18.17 7.41 13.59 6 15l6 6 6-6-1.41-1.41z" })], -1)]]);
134
+ }
135
+ var mt = /*#__PURE__*/ J(dt, [["render", pt]]), ht = /* @__PURE__ */ K({ default: () => yt }), gt = {}, _t = {
136
+ xmlns: "http://www.w3.org/2000/svg",
137
+ viewBox: "0 0 24 24",
138
+ fill: "none",
139
+ stroke: "currentColor",
140
+ "stroke-width": "1.75",
141
+ "stroke-linecap": "round",
142
+ "stroke-linejoin": "round"
143
+ };
144
+ function vt(e, t) {
145
+ return S(), s("svg", _t, [...t[0] ||= [
146
+ c("path", { d: "M12 20H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v3" }, null, -1),
147
+ c("path", { d: "M16 3v5h5" }, null, -1),
148
+ c("path", { d: "m18 14 3 3" }, null, -1),
149
+ c("path", { d: "m13 19 6.5-6.5a2.12 2.12 0 0 1 3 3L16 22l-4 1Z" }, null, -1)
150
+ ]]);
151
+ }
152
+ var yt = /*#__PURE__*/ J(gt, [["render", vt]]), bt = /* @__PURE__ */ K({ default: () => wt }), xt = {}, St = {
153
+ viewBox: "0 0 24 24",
154
+ fill: "currentColor"
155
+ };
156
+ function Ct(e, t) {
157
+ return S(), s("svg", St, [...t[0] ||= [c("path", { d: "M6 16h12V8H6v8zm2-6h8v4H8v-4zM4 4h4v2H6v2H4V4zm12 0h4v4h-2V6h-2V4zM4 20v-4h2v2h2v2H4zm12 0v-2h2v-2h2v4h-4z" }, null, -1)]]);
158
+ }
159
+ var wt = /*#__PURE__*/ J(xt, [["render", Ct]]), Tt = /* @__PURE__ */ K({ default: () => kt }), Et = {}, Dt = {
160
+ viewBox: "0 0 24 24",
161
+ fill: "currentColor"
162
+ };
163
+ function Ot(e, t) {
164
+ return S(), s("svg", Dt, [...t[0] ||= [c("path", { d: "M6.99 11 3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z" }, null, -1)]]);
165
+ }
166
+ var kt = /*#__PURE__*/ J(Et, [["render", Ot]]), At = /* @__PURE__ */ K({ default: () => Pt }), jt = {}, Mt = {
167
+ viewBox: "0 0 24 24",
168
+ fill: "currentColor"
169
+ };
170
+ function Nt(e, t) {
171
+ return S(), s("svg", Mt, [...t[0] ||= [c("path", { d: "M9 3 5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3z" }, null, -1)]]);
172
+ }
173
+ var Pt = /*#__PURE__*/ J(jt, [["render", Nt]]), Ft = /* @__PURE__ */ K({ default: () => zt }), It = {}, Lt = {
174
+ xmlns: "http://www.w3.org/2000/svg",
175
+ viewBox: "0 0 24 24",
176
+ fill: "none",
177
+ stroke: "currentColor",
178
+ "stroke-width": "1.75",
179
+ "stroke-linecap": "round",
180
+ "stroke-linejoin": "round"
181
+ };
182
+ function Rt(e, t) {
183
+ return S(), s("svg", Lt, [...t[0] ||= [c("path", { d: "M3 10.5 12 3l9 7.5" }, null, -1), c("path", { d: "M5 9.5V20a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1V9.5" }, null, -1)]]);
184
+ }
185
+ var zt = /*#__PURE__*/ J(It, [["render", Rt]]), Bt = /* @__PURE__ */ K({ default: () => Wt }), Vt = {}, Ht = {
186
+ xmlns: "http://www.w3.org/2000/svg",
187
+ viewBox: "0 0 24 24",
188
+ fill: "none",
189
+ stroke: "currentColor",
190
+ "stroke-width": "1.75",
191
+ "stroke-linecap": "round",
192
+ "stroke-linejoin": "round"
193
+ };
194
+ function Ut(e, t) {
195
+ return S(), s("svg", Ht, [...t[0] ||= [c("path", { d: "M4 4h16l2 11v4a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-4L4 4Z" }, null, -1), c("path", { d: "M2 15h6l2 3h4l2-3h6" }, null, -1)]]);
196
+ }
197
+ var Wt = /*#__PURE__*/ J(Vt, [["render", Ut]]), Gt = /* @__PURE__ */ K({ default: () => Yt }), Kt = {}, qt = {
198
+ xmlns: "http://www.w3.org/2000/svg",
199
+ viewBox: "0 0 24 24",
200
+ fill: "none",
201
+ stroke: "currentColor",
202
+ "stroke-width": "1.75",
203
+ "stroke-linecap": "round",
204
+ "stroke-linejoin": "round"
205
+ };
206
+ function Jt(e, t) {
207
+ return S(), s("svg", qt, [...t[0] ||= [
208
+ c("rect", {
209
+ x: "3",
210
+ y: "3",
211
+ width: "18",
212
+ height: "18",
213
+ rx: "2"
214
+ }, null, -1),
215
+ c("path", { d: "M3 9h18" }, null, -1),
216
+ c("path", { d: "M9 21V9" }, null, -1)
217
+ ]]);
218
+ }
219
+ var Yt = /*#__PURE__*/ J(Kt, [["render", Jt]]), Xt = /* @__PURE__ */ K({ default: () => en }), Zt = {}, Qt = {
220
+ xmlns: "http://www.w3.org/2000/svg",
221
+ viewBox: "0 0 24 24",
222
+ fill: "none",
223
+ stroke: "currentColor",
224
+ "stroke-width": "1.75",
225
+ "stroke-linecap": "round",
226
+ "stroke-linejoin": "round"
227
+ };
228
+ function $t(e, t) {
229
+ return S(), s("svg", Qt, [...t[0] ||= [
230
+ c("path", { d: "M21 8.5 12 3 3 8.5v7L12 21l9-5.5v-7Z" }, null, -1),
231
+ c("path", { d: "m3 8.5 9 5.5 9-5.5" }, null, -1),
232
+ c("path", { d: "M12 14v7" }, null, -1)
233
+ ]]);
234
+ }
235
+ var en = /*#__PURE__*/ J(Zt, [["render", $t]]), tn = /* @__PURE__ */ K({ default: () => on }), nn = {}, rn = {
236
+ xmlns: "http://www.w3.org/2000/svg",
237
+ viewBox: "0 0 24 24",
238
+ fill: "none",
239
+ stroke: "currentColor",
240
+ "stroke-width": "1.75",
241
+ "stroke-linecap": "round",
242
+ "stroke-linejoin": "round"
243
+ };
244
+ function an(e, t) {
245
+ return S(), s("svg", rn, [...t[0] ||= [
246
+ c("path", { d: "M5 3h14v18l-2.5-1.5L14 21l-2-1.5L10 21l-2.5-1.5L5 21V3Z" }, null, -1),
247
+ c("path", { d: "M9 8h6" }, null, -1),
248
+ c("path", { d: "M9 12h6" }, null, -1),
249
+ c("path", { d: "M9 16h4" }, null, -1)
250
+ ]]);
251
+ }
252
+ var on = /*#__PURE__*/ J(nn, [["render", an]]), sn = /* @__PURE__ */ K({ default: () => dn }), cn = {}, ln = {
253
+ viewBox: "0 0 24 24",
254
+ fill: "currentColor"
255
+ };
256
+ function un(e, t) {
257
+ return S(), s("svg", ln, [...t[0] ||= [c("path", { d: "M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-8 8s3.58 8 8 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z" }, null, -1)]]);
258
+ }
259
+ var dn = /*#__PURE__*/ J(cn, [["render", un]]), fn = /* @__PURE__ */ K({ default: () => gn }), pn = {}, mn = {
260
+ viewBox: "0 0 24 24",
261
+ fill: "currentColor"
262
+ };
263
+ function hn(e, t) {
264
+ return S(), s("svg", mn, [...t[0] ||= [c("path", { d: "M7.11 8.53 5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47zM6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47zm1.01 5.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32zM13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93z" }, null, -1)]]);
265
+ }
266
+ var gn = /*#__PURE__*/ J(pn, [["render", hn]]), _n = /* @__PURE__ */ K({ default: () => xn }), vn = {}, yn = {
267
+ viewBox: "0 0 24 24",
268
+ fill: "currentColor"
269
+ };
270
+ function bn(e, t) {
271
+ return S(), s("svg", yn, [...t[0] ||= [c("path", { d: "M15.55 5.55 11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11a7.906 7.906 0 0 0-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42 1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z" }, null, -1)]]);
272
+ }
273
+ var xn = /*#__PURE__*/ J(vn, [["render", bn]]), Sn = /* @__PURE__ */ K({ default: () => En }), Cn = {}, wn = {
274
+ xmlns: "http://www.w3.org/2000/svg",
275
+ viewBox: "0 0 24 24",
276
+ fill: "none",
277
+ stroke: "currentColor",
278
+ "stroke-width": "1.75",
279
+ "stroke-linecap": "round",
280
+ "stroke-linejoin": "round"
281
+ };
282
+ function Tn(e, t) {
283
+ return S(), s("svg", wn, [...t[0] ||= [c("path", { d: "m22 2-7 20-4-9-9-4Z" }, null, -1), c("path", { d: "M22 2 11 13" }, null, -1)]]);
284
+ }
285
+ var En = /*#__PURE__*/ J(Cn, [["render", Tn]]), Dn = /* @__PURE__ */ K({ default: () => jn }), On = {}, kn = {
286
+ xmlns: "http://www.w3.org/2000/svg",
287
+ viewBox: "0 0 24 24",
288
+ fill: "none",
289
+ stroke: "currentColor",
290
+ "stroke-width": "1.75",
291
+ "stroke-linecap": "round",
292
+ "stroke-linejoin": "round"
293
+ };
294
+ function An(e, t) {
295
+ return S(), s("svg", kn, [...t[0] ||= [
296
+ c("path", { d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" }, null, -1),
297
+ c("path", { d: "M12 8v4" }, null, -1),
298
+ c("path", { d: "M12 16h.01" }, null, -1)
299
+ ]]);
300
+ }
301
+ var jn = /*#__PURE__*/ J(On, [["render", An]]), Mn = /* @__PURE__ */ K({ default: () => In }), Nn = {}, Pn = {
302
+ xmlns: "http://www.w3.org/2000/svg",
303
+ viewBox: "0 0 24 24",
304
+ fill: "none",
305
+ stroke: "currentColor",
306
+ "stroke-width": "1.75",
307
+ "stroke-linecap": "round",
308
+ "stroke-linejoin": "round"
309
+ };
310
+ function Fn(e, t) {
311
+ return S(), s("svg", Pn, [...t[0] ||= [
312
+ c("path", { d: "M3 6h18" }, null, -1),
313
+ c("path", { d: "M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2" }, null, -1),
314
+ c("path", { d: "m19 6-1 14H6L5 6" }, null, -1),
315
+ c("path", { d: "M10 11v5M14 11v5" }, null, -1)
316
+ ]]);
317
+ }
318
+ var In = /*#__PURE__*/ J(Nn, [["render", Fn]]), Ln = /* @__PURE__ */ K({ default: () => Vn }), Rn = {}, zn = {
319
+ xmlns: "http://www.w3.org/2000/svg",
320
+ viewBox: "0 0 24 24",
321
+ fill: "none",
322
+ stroke: "currentColor",
323
+ "stroke-width": "1.75",
324
+ "stroke-linecap": "round",
325
+ "stroke-linejoin": "round"
326
+ };
327
+ function Bn(e, t) {
328
+ return S(), s("svg", zn, [...t[0] ||= [
329
+ c("circle", {
330
+ cx: "9",
331
+ cy: "8",
332
+ r: "3.5"
333
+ }, null, -1),
334
+ c("path", { d: "M2.5 20a6.5 6.5 0 0 1 13 0" }, null, -1),
335
+ c("path", { d: "M16 5.2a3.5 3.5 0 0 1 0 5.6" }, null, -1),
336
+ c("path", { d: "M17.5 14.2A6.5 6.5 0 0 1 21.5 20" }, null, -1)
337
+ ]]);
338
+ }
339
+ var Vn = /*#__PURE__*/ J(Rn, [["render", Bn]]), Hn = /* @__PURE__ */ K({ default: () => Kn }), Un = {}, Wn = {
340
+ xmlns: "http://www.w3.org/2000/svg",
341
+ viewBox: "0 0 24 24",
342
+ fill: "currentColor",
343
+ "aria-hidden": "true",
344
+ focusable: "false"
345
+ };
346
+ function Gn(e, t) {
347
+ return S(), s("svg", Wn, [...t[0] ||= [
348
+ c("circle", {
349
+ cx: "12",
350
+ cy: "5",
351
+ r: "1.8"
352
+ }, null, -1),
353
+ c("circle", {
354
+ cx: "12",
355
+ cy: "12",
356
+ r: "1.8"
357
+ }, null, -1),
358
+ c("circle", {
359
+ cx: "12",
360
+ cy: "19",
361
+ r: "1.8"
362
+ }, null, -1)
363
+ ]]);
364
+ }
365
+ var Kn = /*#__PURE__*/ J(Un, [["render", Gn]]), qn = /* @__PURE__ */ K({ default: () => Zn }), Jn = {}, Yn = {
366
+ viewBox: "0 0 24 24",
367
+ fill: "currentColor"
368
+ };
369
+ function Xn(e, t) {
370
+ return S(), s("svg", Yn, [...t[0] ||= [c("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zm-.5-7h1v2h2v1h-2v2H9v-2H7V9h2V7z" }, null, -1)]]);
371
+ }
372
+ var Zn = /*#__PURE__*/ J(Jn, [["render", Xn]]), Qn = /* @__PURE__ */ K({ default: () => nr }), $n = {}, er = {
373
+ viewBox: "0 0 24 24",
374
+ fill: "currentColor"
375
+ };
376
+ function tr(e, t) {
377
+ return S(), s("svg", er, [...t[0] ||= [c("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7V9z" }, null, -1)]]);
378
+ }
379
+ var nr = /*#__PURE__*/ J($n, [["render", tr]]), rr = Object.fromEntries(Object.entries(/* @__PURE__ */ Object.assign({
380
+ "./components/icons/book-open.vue": ue,
381
+ "./components/icons/braces.vue": he,
382
+ "./components/icons/calendar.vue": ye,
383
+ "./components/icons/camera.vue": we,
384
+ "./components/icons/check.vue": ke,
385
+ "./components/icons/chevron.vue": Pe,
386
+ "./components/icons/clock.vue": ze,
387
+ "./components/icons/close.vue": We,
388
+ "./components/icons/collapse.vue": Ye,
389
+ "./components/icons/contact-round.vue": et,
390
+ "./components/icons/crown.vue": at,
391
+ "./components/icons/expand.vue": ut,
392
+ "./components/icons/file-pen-line.vue": ht,
393
+ "./components/icons/fit-screen.vue": bt,
394
+ "./components/icons/flip-x.vue": Tt,
395
+ "./components/icons/flip-y.vue": At,
396
+ "./components/icons/home.vue": Ft,
397
+ "./components/icons/inbox.vue": Bt,
398
+ "./components/icons/layout.vue": Gt,
399
+ "./components/icons/package.vue": Xt,
400
+ "./components/icons/receipt.vue": tn,
401
+ "./components/icons/refresh.vue": sn,
402
+ "./components/icons/rotate-left.vue": fn,
403
+ "./components/icons/rotate-right.vue": _n,
404
+ "./components/icons/send.vue": Sn,
405
+ "./components/icons/shield-alert.vue": Dn,
406
+ "./components/icons/trash-2.vue": Mn,
407
+ "./components/icons/users.vue": Ln,
408
+ "./components/icons/vertical-dots.vue": Hn,
409
+ "./components/icons/zoom-in.vue": qn,
410
+ "./components/icons/zoom-out.vue": Qn
411
+ })).map(([e, t]) => [e.split("/").pop()?.replace(/\.vue$/, "").toLowerCase() ?? "", t.default])), ir = Object.keys(rr).sort(), ar = { icon: "inline-block shrink-0 align-middle" }, X = /* @__PURE__ */ f({
412
+ __name: "SIcon",
413
+ props: { name: {} },
414
+ setup(e) {
415
+ let t = i(() => rr[e.name]);
416
+ return (e, n) => (S(), a(A(N(t)), { class: y(ar.icon) }, null, 8, ["class"]));
417
+ }
418
+ }), or = () => (p()?.appContext.app)?.component("NuxtLink") ? k("NuxtLink") : "a", sr = () => p()?.appContext.config.globalProperties?.$router, cr = () => {
419
+ let e = sr();
420
+ return i(() => e?.currentRoute?.value?.path ?? "/");
421
+ }, lr = ["aria-label"], ur = { key: 1 }, dr = {
422
+ root: "flex min-w-0 flex-col gap-1",
423
+ heading: "px-3 text-[10px] font-medium tracking-wider uppercase opacity-40",
424
+ link: "flex items-center gap-2 rounded-lg text-left text-xs font-medium tracking-wider whitespace-nowrap uppercase transition-colors focus-visible:ring-2 focus-visible:ring-(--accent) focus-visible:outline-none",
425
+ active: "bg-current/10 text-(--text-default)",
426
+ idle: "opacity-50 hover:bg-current/5 hover:opacity-90",
427
+ expanded: "px-3 py-2",
428
+ compact: "justify-center px-2 py-2",
429
+ icon: "size-4 shrink-0",
430
+ initial: "text-[10px] leading-none"
431
+ }, fr = /* @__PURE__ */ f({
432
+ __name: "SAsideNav",
433
+ props: {
434
+ items: { default: () => [] },
435
+ collapsed: {
436
+ type: Boolean,
437
+ default: !1
438
+ },
439
+ heading: { default: "" },
440
+ ariaLabel: { default: "Боковая навигация" }
441
+ },
442
+ setup(e) {
443
+ let t = cr(), r = or(), i = (e) => t.value === e || t.value.startsWith(`${e}/`), c = (e) => e.exact ? t.value === e.to : i(e.to) || (e.activePrefixes ?? []).some(i);
444
+ return (t, i) => (S(), s("nav", {
445
+ "aria-label": e.ariaLabel,
446
+ class: y(dr.root)
447
+ }, [e.heading && !e.collapsed ? (S(), s("span", {
448
+ key: 0,
449
+ class: y(dr.heading)
450
+ }, j(e.heading), 3)) : o("", !0), (S(!0), s(n, null, D(e.items, (t) => (S(), a(A(N(r)), {
451
+ key: t.to,
452
+ to: t.to,
453
+ href: N(r) === "a" ? t.to : void 0,
454
+ class: y([
455
+ dr.link,
456
+ c(t) ? dr.active : dr.idle,
457
+ e.collapsed ? dr.compact : dr.expanded
458
+ ]),
459
+ "aria-current": c(t) ? "page" : void 0,
460
+ "aria-label": e.collapsed ? t.label : void 0,
461
+ title: e.collapsed ? t.label : void 0
462
+ }, {
463
+ default: z(() => [t.icon ? (S(), a(X, {
464
+ key: 0,
465
+ name: t.icon,
466
+ class: y(dr.icon)
467
+ }, null, 8, ["name", "class"])) : o("", !0), e.collapsed ? t.icon ? o("", !0) : (S(), s("span", {
468
+ key: 2,
469
+ class: y(dr.initial)
470
+ }, j(t.label.slice(0, 1)), 3)) : (S(), s("span", ur, j(t.label), 1))]),
471
+ _: 2
472
+ }, 1032, [
473
+ "to",
474
+ "href",
475
+ "class",
476
+ "aria-current",
477
+ "aria-label",
478
+ "title"
479
+ ]))), 128))], 10, lr));
480
+ }
481
+ }), pr = {
482
+ container: "inline-block w-fit",
483
+ tooltip: "pointer-events-none z-50 rounded-full bg-(--bg-default) px-3 py-1 text-xs text-white border border-white"
484
+ }, mr = /* @__PURE__ */ f({
485
+ __name: "STooltip",
486
+ props: { tooltip: {} },
487
+ setup(e, { slots: t }) {
488
+ let n = E(null), r = E(null), i = E(!1), { floatingStyles: a } = W(n, r, {
489
+ placement: "top",
490
+ middleware: [
491
+ ae(4),
492
+ ie(),
493
+ H()
494
+ ],
495
+ whileElementsMounted: V
496
+ });
497
+ return (c, l) => (S(), s("div", {
498
+ ref_key: "reference",
499
+ ref: n,
500
+ class: y(pr.container),
501
+ onMouseenter: l[0] ||= (e) => i.value = !0,
502
+ onMouseleave: l[1] ||= (e) => i.value = !1,
503
+ onFocus: l[2] ||= (e) => i.value = !0,
504
+ onBlur: l[3] ||= (e) => i.value = !1
505
+ }, [O(c.$slots, "default"), (e.tooltip || t.tooltip) && N(i) ? (S(), s("div", {
506
+ key: 0,
507
+ ref_key: "floating",
508
+ ref: r,
509
+ role: "tooltip",
510
+ style: b(N(a)),
511
+ class: y(pr.tooltip)
512
+ }, [O(c.$slots, "tooltip", {}, () => [u(j(e.tooltip), 1)])], 6)) : o("", !0)], 34));
513
+ }
514
+ }), hr = Symbol.for("sinde-ui:user"), gr = (e) => {
515
+ C(hr, i(() => e() ?? null));
516
+ }, _r = () => m(hr, i(() => null)), vr = ["src", "alt"], yr = {
517
+ link: "block size-8 shrink-0 cursor-pointer overflow-hidden rounded-full border border-current/10 bg-(--default) outline-none select-none focus-visible:ring-2 focus-visible:ring-(--accent)",
518
+ image: "size-full object-cover",
519
+ fallback: "flex size-full items-center justify-center text-[10px] leading-none font-semibold text-(--accent)"
520
+ }, br = /* @__PURE__ */ f({
521
+ __name: "SAvatar",
522
+ props: {
523
+ src: { default: "" },
524
+ name: { default: "" },
525
+ to: { default: "" },
526
+ label: { default: "" }
527
+ },
528
+ setup(e) {
529
+ let t = or(), n = _r(), r = i(() => e.name || n.value?.name || ""), o = i(() => e.src || n.value?.src || ""), c = i(() => e.to || n.value?.to || "/profile"), l = i(() => r.value || e.label || "Профиль"), u = i(() => (r.value || "?").slice(0, 2).toUpperCase());
530
+ return (e, n) => (S(), a(mr, { tooltip: N(l) }, {
531
+ default: z(() => [(S(), a(A(N(t)), {
532
+ to: N(c),
533
+ href: N(t) === "a" ? N(c) : void 0,
534
+ class: y(yr.link),
535
+ "aria-label": `Профиль: ${N(l)}`
536
+ }, {
537
+ default: z(() => [N(o) ? (S(), s("img", {
538
+ key: 0,
539
+ src: N(o),
540
+ alt: N(l),
541
+ class: y(yr.image)
542
+ }, null, 10, vr)) : (S(), s("span", {
543
+ key: 1,
544
+ class: y(yr.fallback)
545
+ }, j(N(u)), 3))]),
546
+ _: 1
547
+ }, 8, [
548
+ "to",
549
+ "href",
550
+ "class",
551
+ "aria-label"
552
+ ]))]),
553
+ _: 1
554
+ }, 8, ["tooltip"]));
555
+ }
556
+ }), xr = {
557
+ Idle: "idle",
558
+ Active: "active",
559
+ Load: "load",
560
+ Disabled: "disabled"
561
+ }, Sr = {
562
+ base: "inline-flex items-center justify-center whitespace-nowrap rounded-full px-2 py-1 text-xs font-medium transition-all select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-black m-1",
563
+ states: {
564
+ [xr.Idle]: "bg-(--text-default) text-(--bg-default) hover:bg-zinc-200 active:bg-zinc-300 focus-visible:ring-white",
565
+ [xr.Active]: "bg-(--accent) text-white hover:bg-(--accent)/90 active:bg-(--accent)/70 focus-visible:ring-(--accent)/50",
566
+ [xr.Load]: "cursor-wait! bg-zinc-800 text-zinc-400 focus-visible:ring-zinc-600",
567
+ [xr.Disabled]: "cursor-not-allowed! bg-(--elevated) text-zinc-600 focus-visible:ring-zinc-800"
568
+ }
569
+ }, Cr = /* @__PURE__ */ f({
570
+ __name: "SBtn",
571
+ props: {
572
+ to: {},
573
+ label: { default: "" },
574
+ state: { default: () => xr.Idle }
575
+ },
576
+ setup(e) {
577
+ let t = or(), n = i(() => e.state === xr.Disabled || e.state === xr.Load), r = i(() => n.value || !e.to ? "button" : t), o = i(() => e.to ? void 0 : "button"), s = i(() => r.value === "button" ? void 0 : e.to), l = i(() => r.value === "a" ? e.to : void 0), u = i(() => [Sr.base, Sr.states[e.state]]), d = i(() => ({ "animate-pulse tracking-wide": e.state === xr.Load }));
578
+ return (t, i) => (S(), a(A(N(r)), {
579
+ to: N(s),
580
+ href: N(l),
581
+ type: N(o),
582
+ disabled: N(n),
583
+ class: y(N(u))
584
+ }, {
585
+ default: z(() => [c("span", { class: y(N(d)) }, j(e.label), 3)]),
586
+ _: 1
587
+ }, 8, [
588
+ "to",
589
+ "href",
590
+ "type",
591
+ "disabled",
592
+ "class"
593
+ ]));
594
+ }
595
+ }), wr = ["for"], Tr = [
596
+ "id",
597
+ "checked",
598
+ "disabled",
599
+ "aria-checked"
600
+ ], Er = { key: 0 }, Dr = {
601
+ labelBase: "inline-flex w-fit items-center gap-2 select-none",
602
+ labelDisabled: "cursor-not-allowed opacity-50",
603
+ labelEnabled: "cursor-pointer",
604
+ box: "m-1 flex size-3 shrink-0 items-center justify-center bg-(--default) hover:bg-(--default-hover) ring-1 ring-(--border) peer-focus-visible:ring-2 peer-focus-visible:ring-(--accent)",
605
+ icon: "size-4 text-(--accent)",
606
+ partial: "size-1.5 bg-(--accent)"
607
+ }, Or = /* @__PURE__ */ f({
608
+ __name: "SCheckbox",
609
+ props: /*@__PURE__*/ g({
610
+ id: {},
611
+ label: {},
612
+ disabled: {
613
+ type: Boolean,
614
+ default: !1
615
+ },
616
+ partial: {
617
+ type: Boolean,
618
+ default: !1
619
+ }
620
+ }, {
621
+ modelValue: {
622
+ type: [Boolean, String],
623
+ default: !1
624
+ },
625
+ modelModifiers: {}
626
+ }),
627
+ emits: ["update:modelValue"],
628
+ setup(e, { slots: t }) {
629
+ let n = F(e, "modelValue"), r = m("field-id", void 0), l = i(() => e.id || r || `checkbox-${P()}`), d = i(() => n.value === !0), f = i(() => n.value === "partial"), p = E(null), h = i(() => [Dr.labelBase, e.disabled ? Dr.labelDisabled : Dr.labelEnabled]);
630
+ R(f, (e) => {
631
+ p.value && (p.value.indeterminate = e);
632
+ }, {
633
+ flush: "post",
634
+ immediate: !0
635
+ });
636
+ let g = () => n.value = e.partial ? n.value === !1 || n.value === !0 && "partial" : !d.value;
637
+ return (n, r) => (S(), s("label", {
638
+ for: N(l),
639
+ class: y(N(h))
640
+ }, [
641
+ c("input", {
642
+ id: N(l),
643
+ ref_key: "inputRef",
644
+ ref: p,
645
+ type: "checkbox",
646
+ checked: N(d),
647
+ disabled: e.disabled,
648
+ "aria-checked": N(f) ? "mixed" : N(d),
649
+ class: "peer sr-only",
650
+ onChange: g
651
+ }, null, 40, Tr),
652
+ c("span", {
653
+ class: y(Dr.box),
654
+ "aria-hidden": "true"
655
+ }, [N(d) ? (S(), a(X, {
656
+ key: 0,
657
+ name: "check",
658
+ class: y(Dr.icon)
659
+ }, null, 8, ["class"])) : N(f) ? (S(), s("span", {
660
+ key: 1,
661
+ class: y(Dr.partial)
662
+ }, null, 2)) : o("", !0)], 2),
663
+ e.label || t.default ? (S(), s("span", Er, [O(n.$slots, "default", {}, () => [u(j(e.label), 1)])])) : o("", !0)
664
+ ], 10, wr));
665
+ }
666
+ }), kr = (e = 1500) => {
667
+ let t = E(!1), n = E(!1), r = i(() => typeof window < "u" && !!navigator?.clipboard), a = i(() => r.value && !n.value), o, s = () => {
668
+ clearTimeout(o), t.value = !0, o = setTimeout(() => {
669
+ t.value = !1;
670
+ }, e);
671
+ };
672
+ return x(() => {
673
+ clearTimeout(o);
674
+ }), {
675
+ isSupported: r,
676
+ copied: T(t),
677
+ copying: T(n),
678
+ isIdle: a,
679
+ copyFrom: async (e) => {
680
+ let t = M(e);
681
+ if (!t || !a.value) return !1;
682
+ n.value = !0;
683
+ try {
684
+ return await navigator.clipboard.writeText(t), s(), !0;
685
+ } catch {
686
+ return !1;
687
+ } finally {
688
+ n.value = !1;
689
+ }
690
+ },
691
+ paste: async (e) => {
692
+ if (!r.value) return null;
693
+ try {
694
+ let t = (await navigator.clipboard.readText()).trim();
695
+ return e && (e.value = t), t;
696
+ } catch {
697
+ return null;
698
+ }
699
+ }
700
+ };
701
+ }, Ar = [
702
+ "data-state",
703
+ "aria-disabled",
704
+ "onKeydown"
705
+ ], jr = {
706
+ base: "text-nowrap",
707
+ tooltipContent: "flex items-center gap-1.5",
708
+ checkIcon: "size-4 text-emerald-500"
709
+ }, Mr = /* @__PURE__ */ f({
710
+ __name: "SCopy",
711
+ props: {
712
+ value: { default: "" },
713
+ hover: { default: "Копировать" },
714
+ done: { default: "Скопировано" },
715
+ disabled: {
716
+ type: Boolean,
717
+ default: !1
718
+ }
719
+ },
720
+ emits: ["copied"],
721
+ setup(e, { emit: t }) {
722
+ let n = t, { copied: r, copying: s, isSupported: d, copyFrom: f } = kr(1500), p = i(() => e.value ?? ""), m = i(() => e.disabled || !p.value), h = i(() => m.value ? "" : r.value ? e.done : e.hover), g = i(() => m.value || s.value ? "disabled" : "idle"), _ = async () => {
723
+ m.value || s.value || !d.value || await f(p.value) && n("copied", p.value);
724
+ };
725
+ return (e, t) => (S(), a(mr, {
726
+ class: "w-fit",
727
+ tooltip: N(h)
728
+ }, l({
729
+ default: z(() => [c("span", {
730
+ class: y(jr.base),
731
+ "data-state": N(g),
732
+ "aria-disabled": N(m) || void 0,
733
+ role: "button",
734
+ tabindex: "0",
735
+ onClick: _,
736
+ onKeydown: [B(re(_, ["prevent"]), ["enter"]), B(re(_, ["prevent"]), ["space"])]
737
+ }, [O(e.$slots, "default", {
738
+ copied: N(r),
739
+ copying: N(s),
740
+ state: N(g),
741
+ disabled: N(m),
742
+ copy: _
743
+ }, () => [u(j(N(p)), 1)])], 42, Ar)]),
744
+ _: 2
745
+ }, [N(h) ? {
746
+ name: "tooltip",
747
+ fn: z(() => [c("span", { class: y(jr.tooltipContent) }, [N(r) ? (S(), a(X, {
748
+ key: 0,
749
+ name: "check",
750
+ class: y(jr.checkIcon)
751
+ }, null, 8, ["class"])) : o("", !0), c("span", null, j(N(h)), 1)], 2)]),
752
+ key: "0"
753
+ } : void 0]), 1032, ["tooltip"]));
754
+ }
755
+ }), Nr = ["for"], Pr = [
756
+ "id",
757
+ "min",
758
+ "max",
759
+ "step",
760
+ "disabled"
761
+ ], Fr = {
762
+ wrapper: "flex w-full max-w-[300px] flex-col gap-1.5",
763
+ header: "flex items-center justify-between text-sm",
764
+ label: "font-medium text-(--text-default)",
765
+ value: "text-(--text-default) tabular-nums opacity-60",
766
+ slider: "h-2 w-full cursor-pointer appearance-none rounded-full transition focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-(--accent) disabled:cursor-not-allowed disabled:opacity-50 [&::-moz-range-thumb]:size-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-(--bg-default) [&::-moz-range-thumb]:bg-(--accent) [&::-moz-range-thumb]:shadow-sm [&::-moz-range-thumb]:transition [&::-webkit-slider-thumb]:size-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-(--bg-default) [&::-webkit-slider-thumb]:bg-(--accent) [&::-webkit-slider-thumb]:shadow-sm [&::-webkit-slider-thumb]:transition"
767
+ }, Ir = /* @__PURE__ */ f({
768
+ __name: "SRange",
769
+ props: /*@__PURE__*/ g({
770
+ label: { default: "" },
771
+ min: { default: 0 },
772
+ max: { default: 100 },
773
+ step: { default: 1 },
774
+ disabled: {
775
+ type: Boolean,
776
+ default: !1
777
+ },
778
+ showValue: {
779
+ type: Boolean,
780
+ default: !0
781
+ }
782
+ }, {
783
+ modelValue: { default: 0 },
784
+ modelModifiers: {}
785
+ }),
786
+ emits: ["update:modelValue"],
787
+ setup(e) {
788
+ let t = F(e, "modelValue"), n = P(), r = i(() => (Math.min(Math.max(t.value, e.min), e.max) - e.min) / (e.max - e.min) * 100);
789
+ return (i, a) => (S(), s("div", { class: y(Fr.wrapper) }, [e.label || e.showValue ? (S(), s("div", {
790
+ key: 0,
791
+ class: y(Fr.header)
792
+ }, [e.label ? (S(), s("label", {
793
+ key: 0,
794
+ for: N(n),
795
+ class: y(Fr.label)
796
+ }, j(e.label), 11, Nr)) : o("", !0), e.showValue ? (S(), s("span", {
797
+ key: 1,
798
+ class: y(Fr.value)
799
+ }, j(t.value), 3)) : o("", !0)], 2)) : o("", !0), ne(c("input", {
800
+ id: N(n),
801
+ "onUpdate:modelValue": a[0] ||= (e) => t.value = e,
802
+ type: "range",
803
+ min: e.min,
804
+ max: e.max,
805
+ step: e.step,
806
+ disabled: e.disabled,
807
+ class: y(Fr.slider),
808
+ style: b({ background: `linear-gradient(to right, var(--accent) ${N(r)}%, var(--default) ${N(r)}%)` })
809
+ }, null, 14, Pr), [[
810
+ L,
811
+ t.value,
812
+ void 0,
813
+ { number: !0 }
814
+ ]])], 2));
815
+ }
816
+ }), Lr = {
817
+ root: "relative min-w-0 overflow-hidden",
818
+ edge: "pointer-events-none absolute opacity-0 transition-opacity",
819
+ edgeActive: "opacity-100",
820
+ layerDefault: "z-20",
821
+ layerRaised: "z-30",
822
+ left: "inset-y-0 left-0 w-16 shadow-[inset_40px_0_40px_-40px_var(--scroll-edge-shadow)]",
823
+ right: "inset-y-0 right-0 w-16 shadow-[inset_-40px_0_40px_-40px_var(--scroll-edge-shadow)]",
824
+ top: "inset-x-0 top-0 h-16 shadow-[inset_0_40px_40px_-40px_var(--scroll-edge-shadow)]",
825
+ bottom: "inset-x-0 bottom-0 h-16 shadow-[inset_0_-40px_40px_-40px_var(--scroll-edge-shadow)]",
826
+ leftTrim: "top-0 bottom-2 left-0 w-16 shadow-[inset_40px_0_40px_-40px_var(--scroll-edge-shadow)]",
827
+ rightTrim: "top-0 right-0 bottom-2 w-16 shadow-[inset_-40px_0_40px_-40px_var(--scroll-edge-shadow)]"
828
+ }, Rr = /* @__PURE__ */ f({
829
+ __name: "SScrollableEdges",
830
+ props: {
831
+ edges: { default: () => ({}) },
832
+ active: { default: () => ({}) },
833
+ axis: { default: "both" },
834
+ area: { default: "full" },
835
+ layer: { default: "default" },
836
+ hideScrollbar: {
837
+ type: Boolean,
838
+ default: !0
839
+ }
840
+ },
841
+ setup(e, { attrs: t }) {
842
+ let r = e, i = [
843
+ "left",
844
+ "right",
845
+ "top",
846
+ "bottom"
847
+ ], a = E(null), o = (e) => r.axis === "both" ? !0 : r.axis === "x" ? e === "left" || e === "right" : e === "top" || e === "bottom", l = (e) => o(e) && !!(r.active?.[e] ?? r.edges?.[e]), u = (e) => e === "left" ? r.area === "trim-bottom" ? Lr.leftTrim : Lr.left : e === "right" ? r.area === "trim-bottom" ? Lr.rightTrim : Lr.right : e === "top" ? Lr.top : Lr.bottom, d = (e) => {
848
+ let t = getComputedStyle(e).overflowX;
849
+ return (t === "auto" || t === "scroll") && e.scrollWidth > e.clientWidth;
850
+ }, f = null, p = (e) => {
851
+ let t = a.value;
852
+ if (f && t?.contains(f) && d(f)) return f;
853
+ let n = e instanceof HTMLElement ? e : null;
854
+ for (; t && n && t.contains(n);) {
855
+ if (d(n)) return f = n, n;
856
+ if (n === t) break;
857
+ n = n.parentElement;
858
+ }
859
+ let r = t && Array.from(t.querySelectorAll("*")).find(d) || null;
860
+ return f = r, r;
861
+ }, m = (e) => {
862
+ if (r.axis !== "x" || !e.deltaY || Math.abs(e.deltaX) > Math.abs(e.deltaY)) return;
863
+ let t = p(e.target);
864
+ if (!t) return;
865
+ let n = t.scrollWidth - t.clientWidth, i = Math.min(Math.max(t.scrollLeft + e.deltaY, 0), n);
866
+ i !== t.scrollLeft && (e.preventDefault(), t.scrollLeft = i);
867
+ };
868
+ return (o, d) => (S(), s("div", _({
869
+ ref_key: "rootRef",
870
+ ref: a,
871
+ class: [Lr.root, e.hideScrollbar && "hide-scrollbar"]
872
+ }, t, { onWheel: m }), [O(o.$slots, "default"), (S(), s(n, null, D(i, (e) => c("span", {
873
+ key: e,
874
+ class: y([
875
+ Lr.edge,
876
+ u(e),
877
+ r.layer === "raised" ? Lr.layerRaised : Lr.layerDefault,
878
+ l(e) && Lr.edgeActive
879
+ ]),
880
+ "aria-hidden": "true"
881
+ }, null, 2)), 64))], 16));
882
+ }
883
+ }), zr = E(null), Br = () => zr, Vr = [
884
+ "id",
885
+ "tabindex",
886
+ "aria-expanded",
887
+ "aria-controls",
888
+ "aria-activedescendant"
889
+ ], Hr = ["placeholder"], Ur = ["name", "value"], Wr = ["id"], Gr = [
890
+ "id",
891
+ "aria-selected",
892
+ "aria-disabled",
893
+ "onMouseenter",
894
+ "onMousedown"
895
+ ], Kr = {
896
+ wrapper: "relative m-1",
897
+ trigger: "relative flex h-9 w-full items-center justify-between gap-2 px-3 text-sm text-(--text-default) bg-(--default) hover:bg-(--default-hover) outline-none select-none focus:ring-2 focus:ring-(--accent) focus-within:ring-2 focus-within:ring-(--accent)",
898
+ input: "w-full bg-transparent outline-none text-sm text-(--text-default)",
899
+ label: "flex-1 min-w-0 truncate text-sm pointer-events-none",
900
+ clearButton: "size-4 shrink-0 flex items-center justify-center opacity-60 hover:opacity-100 cursor-pointer outline-none",
901
+ arrow: "size-4 shrink-0 pointer-events-none transition-transform duration-200",
902
+ dropdown: "fixed z-90 overflow-auto bg-(--elevated) text-(--text-default) ring-1 ring-(--border) outline-none",
903
+ noResults: "px-3 py-2 text-sm opacity-60",
904
+ option: "w-full px-3 py-1.5 text-left text-sm truncate transition-colors",
905
+ optionDisabled: "cursor-not-allowed opacity-50",
906
+ optionEnabled: "cursor-pointer",
907
+ optionActive: "bg-(--default-hover)",
908
+ optionSelected: "text-(--accent)"
909
+ }, qr = /* @__PURE__ */ f({
910
+ __name: "SSelect",
911
+ props: /*@__PURE__*/ g({
912
+ options: { default: () => [] },
913
+ id: {},
914
+ name: {},
915
+ disabled: {
916
+ type: Boolean,
917
+ default: !1
918
+ },
919
+ invalid: {
920
+ type: Boolean,
921
+ default: !1
922
+ },
923
+ placeholder: { default: "Выберите значение" },
924
+ filter: {
925
+ type: Boolean,
926
+ default: !1
927
+ },
928
+ clearable: {
929
+ type: Boolean,
930
+ default: !1
931
+ },
932
+ allowCustom: {
933
+ type: Boolean,
934
+ default: !1
935
+ }
936
+ }, {
937
+ modelValue: {},
938
+ modelModifiers: {}
939
+ }),
940
+ emits: ["update:modelValue"],
941
+ setup(e) {
942
+ let t = F(e, "modelValue"), l = P(), u = i(() => e.id || m("field-id", void 0) || `select-${l}`), f = i(() => `${u.value}-listbox`), p = E(null), g = E(null), _ = E(null), C = Br(), w = i(() => C.value === l), T = E(-1), O = E(""), k = E("bottom-start"), { floatingStyles: A } = W(p, g, {
943
+ open: w,
944
+ whileElementsMounted: V,
945
+ placement: k,
946
+ middleware: [ae(4), U({ apply({ rects: e, availableHeight: t, elements: n }) {
947
+ Object.assign(n.floating.style, {
948
+ width: `${e.reference.width}px`,
949
+ maxHeight: `${Math.min(240, Math.max(48, t))}px`
950
+ });
951
+ } })]
952
+ }), M = () => {
953
+ let e = p.value;
954
+ if (!e) return;
955
+ let t = e.getBoundingClientRect(), n = g.value?.scrollHeight || I.value.length * 32 + 8, r = Math.min(n, 240), i = window.innerHeight - t.bottom - 4, a = t.top - 4, o;
956
+ o = i >= r ? "bottom-start" : a >= r || a > i ? "top-start" : "bottom-start", k.value !== o && (k.value = o);
957
+ }, I = i(() => {
958
+ if (!e.filter || !O.value.trim()) return e.options;
959
+ let t = O.value.toLowerCase().trim(), n = e.options.filter((e) => e.label.toLowerCase().includes(t) || String(e.value).toLowerCase().includes(t));
960
+ return e.allowCustom && t && !e.options.some((e) => String(e.value).toLowerCase() === t) ? [{
961
+ value: O.value.trim(),
962
+ label: `Использовать: ${O.value.trim()}`
963
+ }, ...n] : n;
964
+ }), te = i(() => e.options.find((e) => e.value === t.value)), z = i(() => te.value?.label || String(t.value ?? e.placeholder)), B = () => {
965
+ if (T.value < 0 || !g.value) return;
966
+ let e = document.getElementById(`${u.value}-opt-${T.value}`);
967
+ e && (e.offsetTop < g.value.scrollTop ? g.value.scrollTop = e.offsetTop : e.offsetTop + e.offsetHeight > g.value.scrollTop + g.value.clientHeight && (g.value.scrollTop = e.offsetTop + e.offsetHeight - g.value.clientHeight));
968
+ }, ie = (e, t) => {
969
+ let n = I.value.length;
970
+ if (!n) return -1;
971
+ let r = e;
972
+ for (let e = 0; e < n; e++) if (r = (r + t + n) % n, !I.value[r]?.disabled) return r;
973
+ return -1;
974
+ }, H = () => {
975
+ let e = I.value.findIndex((e) => e.value === t.value);
976
+ T.value = e >= 0 && !I.value[e]?.disabled ? e : I.value.findIndex((e) => !e.disabled);
977
+ }, oe = async () => {
978
+ e.disabled || (C.value = l, H(), M(), await v(), M(), e.filter && _.value && _.value.focus({ preventScroll: !0 }), B());
979
+ }, G = () => {
980
+ C.value === l && (C.value = null), O.value = "";
981
+ }, K = () => w.value ? G() : oe(), q = (n) => {
982
+ n.disabled || e.disabled || (t.value = n.value, G(), p.value?.focus({ preventScroll: !0 }));
983
+ }, se = (e) => {
984
+ e.stopPropagation(), t.value = null, G(), p.value?.focus({ preventScroll: !0 });
985
+ }, ce = (n) => {
986
+ if (n.key === "ArrowDown" || n.key === "ArrowUp") {
987
+ if (n.preventDefault(), !w.value) return oe();
988
+ let e = ie(T.value, n.key === "ArrowDown" ? 1 : -1);
989
+ e !== -1 && (T.value = e, B());
990
+ } else if (n.key === "Enter") {
991
+ n.preventDefault();
992
+ let e = I.value[T.value];
993
+ w.value && e ? q(e) : oe();
994
+ } else n.key === "Escape" ? w.value && (n.preventDefault(), n.stopPropagation(), G(), p.value?.focus({ preventScroll: !0 })) : n.key === "Tab" ? G() : n.key !== "Backspace" && n.key !== "Delete" || w.value || !e.clearable && !e.allowCustom || e.disabled || (t.value = null);
995
+ }, le = (e) => {
996
+ w.value && !p.value?.contains(e.target) && !g.value?.contains(e.target) && G();
997
+ };
998
+ R(I, () => {
999
+ w.value && H();
1000
+ }), R(() => e.disabled, (e) => {
1001
+ e && G();
1002
+ });
1003
+ let J = () => {
1004
+ w.value && M();
1005
+ };
1006
+ ee(() => {
1007
+ document.addEventListener("click", le), window.addEventListener("resize", J);
1008
+ }), x(() => {
1009
+ G(), document.removeEventListener("click", le), window.removeEventListener("resize", J);
1010
+ });
1011
+ let ue = i(() => [
1012
+ Kr.trigger,
1013
+ e.invalid ? "ring-2 ring-(--danger) focus:ring-(--danger) focus-within:ring-(--danger)" : "ring-1 ring-(--border)",
1014
+ e.disabled && "cursor-not-allowed opacity-50"
1015
+ ]), de = i(() => [Kr.label, !t.value && "opacity-60"]), fe = i(() => [Kr.arrow, w.value && "rotate-90"]), pe = (e, n) => [
1016
+ Kr.option,
1017
+ e.disabled ? Kr.optionDisabled : Kr.optionEnabled,
1018
+ n === T.value && !e.disabled && Kr.optionActive,
1019
+ e.value === t.value && Kr.optionSelected
1020
+ ];
1021
+ return (i, l) => (S(), s("div", { class: y(Kr.wrapper) }, [
1022
+ c("div", {
1023
+ ref_key: "controlRef",
1024
+ ref: p,
1025
+ id: N(u),
1026
+ class: y(N(ue)),
1027
+ tabindex: e.disabled ? -1 : 0,
1028
+ role: "combobox",
1029
+ "aria-expanded": N(w),
1030
+ "aria-controls": N(f),
1031
+ "aria-activedescendant": N(w) && N(T) >= 0 ? `${N(u)}-opt-${N(T)}` : void 0,
1032
+ onClick: K,
1033
+ onKeydown: ce
1034
+ }, [
1035
+ e.filter && N(w) ? ne((S(), s("input", {
1036
+ key: 0,
1037
+ ref_key: "inputRef",
1038
+ ref: _,
1039
+ "onUpdate:modelValue": l[0] ||= (e) => h(O) ? O.value = e : null,
1040
+ type: "text",
1041
+ class: y(Kr.input),
1042
+ placeholder: N(z),
1043
+ onClick: l[1] ||= re(() => {}, ["stop"])
1044
+ }, null, 10, Hr)), [[L, N(O)]]) : (S(), s("span", {
1045
+ key: 1,
1046
+ class: y(N(de))
1047
+ }, j(N(z)), 3)),
1048
+ (e.clearable || e.allowCustom) && t.value && !e.disabled ? (S(), s("button", {
1049
+ key: 2,
1050
+ type: "button",
1051
+ class: y(Kr.clearButton),
1052
+ tabindex: "-1",
1053
+ onClick: se
1054
+ }, [d(X, { name: "close" })], 2)) : o("", !0),
1055
+ d(X, {
1056
+ name: "chevron",
1057
+ class: y(N(fe))
1058
+ }, null, 8, ["class"])
1059
+ ], 42, Vr),
1060
+ e.name ? (S(), s("input", {
1061
+ key: 0,
1062
+ type: "hidden",
1063
+ name: e.name,
1064
+ value: String(t.value ?? "")
1065
+ }, null, 8, Ur)) : o("", !0),
1066
+ N(w) ? (S(), a(r, {
1067
+ key: 1,
1068
+ to: "body"
1069
+ }, [c("div", {
1070
+ id: N(f),
1071
+ ref_key: "listRef",
1072
+ ref: g,
1073
+ class: y(Kr.dropdown),
1074
+ style: b(N(A)),
1075
+ role: "listbox",
1076
+ "data-select-list": ""
1077
+ }, [N(I).length ? o("", !0) : (S(), s("div", {
1078
+ key: 0,
1079
+ class: y(Kr.noResults)
1080
+ }, "Ничего не найдено", 2)), (S(!0), s(n, null, D(N(I), (e, n) => (S(), s("div", {
1081
+ id: `${N(u)}-opt-${n}`,
1082
+ key: String(e.value ?? n),
1083
+ class: y(pe(e, n)),
1084
+ role: "option",
1085
+ "aria-selected": e.value === t.value,
1086
+ "aria-disabled": e.disabled,
1087
+ onMouseenter: (t) => !e.disabled && (T.value = n),
1088
+ onMousedown: re((t) => q(e), ["prevent"])
1089
+ }, j(e.label), 43, Gr))), 128))], 14, Wr)])) : o("", !0)
1090
+ ], 2));
1091
+ }
1092
+ }), Jr = ["aria-label"], Yr = { class: "min-w-0 truncate text-sm font-semibold" }, Xr = { class: "flex shrink-0 items-center gap-2" }, Zr = ["src"], Qr = { class: "w-36 shrink-0" }, Z = {
1093
+ overlay: "fixed inset-0 z-60 flex touch-none flex-col overscroll-contain bg-(--bg-default) text-(--text-default)",
1094
+ header: "flex shrink-0 items-center justify-between gap-3 px-3 py-1",
1095
+ meta: "text-xs whitespace-nowrap tabular-nums opacity-60",
1096
+ iconButton: "inline-flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-(--text-default) transition-colors select-none hover:bg-(--default-hover) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--accent)",
1097
+ closeButton: "inline-flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-full px-2 text-xs font-medium text-(--text-default) transition-colors select-none hover:bg-(--default-hover) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--accent)",
1098
+ viewport: "min-h-0 flex-1",
1099
+ canvas: "ui-image-grid h-full w-full overflow-hidden",
1100
+ image: "block h-full max-h-full w-full max-w-full object-contain",
1101
+ footer: "shrink-0 px-3 py-2",
1102
+ controls: "overflow-x-auto overflow-y-hidden",
1103
+ controlsRow: "flex min-w-max items-center gap-2",
1104
+ actions: "ml-2 flex shrink-0 items-center gap-2",
1105
+ zoomField: "w-40 shrink-0 sm:w-64",
1106
+ error: "mt-2 text-sm text-(--danger)"
1107
+ }, $r = /*#__PURE__*/ J(/* @__PURE__ */ f({
1108
+ __name: "SCropper",
1109
+ props: {
1110
+ file: {},
1111
+ title: { default: "" },
1112
+ loading: {
1113
+ type: Boolean,
1114
+ default: !1
1115
+ },
1116
+ aspectRatio: { default: "free" }
1117
+ },
1118
+ emits: ["cancel", "confirm"],
1119
+ setup(e, { emit: t }) {
1120
+ let n = [
1121
+ {
1122
+ value: "free",
1123
+ label: "Свободная форма"
1124
+ },
1125
+ {
1126
+ value: "1:1",
1127
+ label: "1:1"
1128
+ },
1129
+ {
1130
+ value: "4:3",
1131
+ label: "4:3"
1132
+ },
1133
+ {
1134
+ value: "3:4",
1135
+ label: "3:4"
1136
+ },
1137
+ {
1138
+ value: "16:9",
1139
+ label: "16:9"
1140
+ },
1141
+ {
1142
+ value: "9:16",
1143
+ label: "9:16"
1144
+ }
1145
+ ], l = (e) => {
1146
+ switch (e) {
1147
+ case "1:1": return 1;
1148
+ case "4:3": return 4 / 3;
1149
+ case "3:4": return 3 / 4;
1150
+ case "16:9": return 16 / 9;
1151
+ case "9:16": return 9 / 16;
1152
+ default: return NaN;
1153
+ }
1154
+ }, u = (e) => Number.isFinite(e) && [
1155
+ ["1:1", 1],
1156
+ ["4:3", 4 / 3],
1157
+ ["3:4", 3 / 4],
1158
+ ["16:9", 16 / 9],
1159
+ ["9:16", 9 / 16]
1160
+ ].find(([, t]) => Math.abs(t - e) < 1e-4)?.[0] || "free", f = (e) => e === "free" ? NaN : e, p = E(u(f(e.aspectRatio))), m = i(() => l(p.value)), g = t, _ = E(null), b = E(null), C = E(""), T = E(""), D = E(1), O = E(.1), k = E(3), A = (e) => Math.round(e * 100) / 100, M = (e, t = !1) => {
1161
+ e > 0 && Number.isFinite(e) && (O.value = A(t ? e : Math.min(O.value, e)), k.value = Math.max(3, A(O.value * 3)));
1162
+ }, P = E(0), F = E(1), I = E(1), L = E(""), te = E(null), ne = w({
1163
+ left: !1,
1164
+ right: !1,
1165
+ top: !1,
1166
+ bottom: !1
1167
+ }), B = () => {
1168
+ let e = te.value;
1169
+ e && (ne.left = e.scrollLeft > 2, ne.right = e.scrollLeft < Math.max(0, e.scrollWidth - e.clientWidth) - 2);
1170
+ }, re = i(() => e.title || "Кадрирование"), V = null, ie = null, ae = () => "image/webp", H = (e) => {
1171
+ let t = String(e || "").trim(), n = t.lastIndexOf(".");
1172
+ return n > 0 ? t.slice(0, n) : t || "image";
1173
+ }, U = () => {
1174
+ C.value &&= (URL.revokeObjectURL(C.value), "");
1175
+ }, W = () => {
1176
+ V?.destroy(), V = null;
1177
+ }, G = () => {
1178
+ let e = V?.getImageData(), t = Number(e?.naturalWidth || 0), n = Number(e?.width || 0);
1179
+ return t > 0 && n > 0 ? n / t : 1;
1180
+ }, K = (e) => {
1181
+ let t = e % 360;
1182
+ return t < 0 ? t + 360 : t;
1183
+ }, q = () => {
1184
+ if (!V) return;
1185
+ let e = V.getContainerData(), t = V.getImageData(), n = Number(e.width || 0), r = Number(e.height || 0), i = Number(t.naturalWidth || 0), a = Number(t.naturalHeight || 0);
1186
+ if (!(n > 0 && r > 0 && i > 0 && a > 0)) return;
1187
+ let o = K(P.value) * Math.PI / 180, s = Math.abs(i * Math.cos(o)) + Math.abs(a * Math.sin(o)), c = Math.abs(i * Math.sin(o)) + Math.abs(a * Math.cos(o)), l = Math.min(n * .96 / s, r * .96 / c);
1188
+ if (!(l > 0 && Number.isFinite(l))) return;
1189
+ V.zoomTo(l), D.value = l, M(l);
1190
+ let u = V.getImageData();
1191
+ V.moveTo((n - u.width) / 2, (r - u.height) / 2);
1192
+ }, se = () => {
1193
+ W(), e.file && _.value?.complete && _.value.naturalWidth && (V = new oe(_.value, {
1194
+ viewMode: 1,
1195
+ dragMode: "move",
1196
+ aspectRatio: m.value,
1197
+ autoCropArea: .92,
1198
+ background: !1,
1199
+ center: !0,
1200
+ guides: !0,
1201
+ highlight: !1,
1202
+ movable: !0,
1203
+ responsive: !0,
1204
+ rotatable: !0,
1205
+ scalable: !0,
1206
+ toggleDragModeOnDblclick: !1,
1207
+ zoomable: !0,
1208
+ zoom: (e) => {
1209
+ let t = Number(e.detail.ratio || 0);
1210
+ t > 0 && Number.isFinite(t) && (D.value = t);
1211
+ },
1212
+ ready: () => {
1213
+ V?.setAspectRatio(m.value), V?.scaleX(1), V?.scaleY(1), D.value = G(), M(D.value, !0), D.value = O.value;
1214
+ }
1215
+ }));
1216
+ }, ce = async () => {
1217
+ await v(), se();
1218
+ }, le = () => {
1219
+ V && (V.reset(), P.value = 0, F.value = 1, I.value = 1, V.setAspectRatio(m.value), D.value = G(), M(D.value));
1220
+ }, J = (e) => {
1221
+ V && (P.value = K(P.value + e), V.rotateTo(P.value), q());
1222
+ }, ue = () => {
1223
+ F.value = F.value === 1 ? -1 : 1, V?.scaleX(F.value);
1224
+ }, de = () => {
1225
+ I.value = I.value === 1 ? -1 : 1, V?.scaleY(I.value);
1226
+ }, fe = () => {
1227
+ V && V.zoomTo(Math.min(k.value, G() * 1.1));
1228
+ }, pe = () => {
1229
+ V && V.zoomTo(Math.max(O.value, G() / 1.1));
1230
+ }, me = (e) => {
1231
+ D.value = e, V && e > 0 && Number.isFinite(e) && V.zoomTo(e);
1232
+ }, he = async () => {
1233
+ if (!V || !e.file || e.loading) return;
1234
+ T.value = "";
1235
+ let t = V.getCroppedCanvas({
1236
+ imageSmoothingEnabled: !0,
1237
+ imageSmoothingQuality: "high"
1238
+ });
1239
+ if (!t) {
1240
+ T.value = "Не удалось получить область кадрирования.";
1241
+ return;
1242
+ }
1243
+ let n = ae(), r = await new Promise((e) => t.toBlob(e, n, .92));
1244
+ r ? g("confirm", new File([r], `${H(e.file.name)}-cropped.webp`, {
1245
+ type: n,
1246
+ lastModified: Date.now()
1247
+ })) : T.value = "Не удалось подготовить изображение к загрузке.";
1248
+ }, ge = () => {
1249
+ e.loading || g("cancel");
1250
+ }, _e = (e) => {
1251
+ e.key === "Escape" && ge();
1252
+ }, Y = () => {
1253
+ requestAnimationFrame(q), requestAnimationFrame(B);
1254
+ };
1255
+ return R(() => e.file, async (e) => {
1256
+ W(), U(), T.value = "", D.value = 1, P.value = 0, F.value = 1, I.value = 1, e && typeof window < "u" && (C.value = URL.createObjectURL(e));
1257
+ }, { immediate: !0 }), R(() => e.aspectRatio, (e) => {
1258
+ p.value = u(f(e)), V?.setAspectRatio(l(p.value));
1259
+ }), R(p, (e) => {
1260
+ V?.setAspectRatio(l(e));
1261
+ }), ee(() => {
1262
+ typeof window < "u" && (L.value = document.body.style.overflow, document.body.style.overflow = "hidden", window.addEventListener("keydown", _e), ie = new ResizeObserver(Y), b.value && ie.observe(b.value), _.value?.complete && ce(), v(B));
1263
+ }), x(() => {
1264
+ W(), U(), ie?.disconnect(), typeof window < "u" && (window.removeEventListener("keydown", _e), document.body.style.overflow = L.value);
1265
+ }), (t, i) => e.file ? (S(), a(r, {
1266
+ key: 0,
1267
+ to: "body"
1268
+ }, [c("div", {
1269
+ class: y(Z.overlay),
1270
+ role: "dialog",
1271
+ "aria-modal": "true",
1272
+ "aria-label": N(re)
1273
+ }, [
1274
+ c("header", { class: y(Z.header) }, [c("h2", Yr, j(N(re)), 1), c("div", Xr, [c("span", { class: y(Z.meta) }, j(Math.round(Math.max(0, N(D)) * 100)) + "%", 3), c("button", {
1275
+ type: "button",
1276
+ class: y(Z.closeButton),
1277
+ "aria-label": "Закрыть окно",
1278
+ onClick: ge
1279
+ }, [d(X, {
1280
+ name: "close",
1281
+ class: "size-4"
1282
+ }), i[4] ||= c("span", { class: "hidden sm:inline" }, "Закрыть", -1)], 2)])], 2),
1283
+ c("div", {
1284
+ ref_key: "viewportRef",
1285
+ ref: b,
1286
+ class: y(Z.viewport)
1287
+ }, [c("div", { class: y(Z.canvas) }, [c("img", {
1288
+ ref_key: "imageRef",
1289
+ ref: _,
1290
+ src: N(C),
1291
+ alt: "Изображение для кадрирования",
1292
+ class: y(Z.image),
1293
+ onLoad: ce
1294
+ }, null, 42, Zr)], 2)], 2),
1295
+ c("footer", { class: y(Z.footer) }, [d(Rr, {
1296
+ active: N(ne),
1297
+ axis: "x"
1298
+ }, {
1299
+ default: z(() => [c("div", {
1300
+ ref_key: "controlsRef",
1301
+ ref: te,
1302
+ class: y(Z.controls),
1303
+ onScrollPassive: B
1304
+ }, [c("div", { class: y(Z.controlsRow) }, [
1305
+ d(mr, { tooltip: "Повернуть против часовой стрелки на 90 градусов" }, {
1306
+ default: z(() => [c("button", {
1307
+ type: "button",
1308
+ class: y(Z.iconButton),
1309
+ "aria-label": "Повернуть против часовой стрелки на 90 градусов",
1310
+ onClick: i[0] ||= (e) => J(-90)
1311
+ }, [d(X, {
1312
+ name: "rotate-left",
1313
+ class: "size-5"
1314
+ })], 2)]),
1315
+ _: 1
1316
+ }),
1317
+ d(mr, { tooltip: "Повернуть по часовой стрелке на 90 градусов" }, {
1318
+ default: z(() => [c("button", {
1319
+ type: "button",
1320
+ class: y(Z.iconButton),
1321
+ "aria-label": "Повернуть по часовой стрелке на 90 градусов",
1322
+ onClick: i[1] ||= (e) => J(90)
1323
+ }, [d(X, {
1324
+ name: "rotate-right",
1325
+ class: "size-5"
1326
+ })], 2)]),
1327
+ _: 1
1328
+ }),
1329
+ d(mr, { tooltip: "Отразить по горизонтали" }, {
1330
+ default: z(() => [c("button", {
1331
+ type: "button",
1332
+ class: y(Z.iconButton),
1333
+ "aria-label": "Отразить по горизонтали",
1334
+ onClick: ue
1335
+ }, [d(X, {
1336
+ name: "flip-x",
1337
+ class: "size-5"
1338
+ })], 2)]),
1339
+ _: 1
1340
+ }),
1341
+ d(mr, { tooltip: "Отразить по вертикали" }, {
1342
+ default: z(() => [c("button", {
1343
+ type: "button",
1344
+ class: y(Z.iconButton),
1345
+ "aria-label": "Отразить по вертикали",
1346
+ onClick: de
1347
+ }, [d(X, {
1348
+ name: "flip-y",
1349
+ class: "size-5"
1350
+ })], 2)]),
1351
+ _: 1
1352
+ }),
1353
+ d(mr, { tooltip: "Уменьшить" }, {
1354
+ default: z(() => [c("button", {
1355
+ type: "button",
1356
+ class: y(Z.iconButton),
1357
+ "aria-label": "Уменьшить",
1358
+ onClick: pe
1359
+ }, [d(X, {
1360
+ name: "zoom-out",
1361
+ class: "size-5"
1362
+ })], 2)]),
1363
+ _: 1
1364
+ }),
1365
+ c("div", { class: y(Z.zoomField) }, [d(Ir, {
1366
+ modelValue: N(D),
1367
+ "onUpdate:modelValue": [i[2] ||= (e) => h(D) ? D.value = e : null, me],
1368
+ modelModifiers: { number: !0 },
1369
+ min: N(O),
1370
+ max: N(k),
1371
+ step: .01,
1372
+ "show-value": !1
1373
+ }, null, 8, [
1374
+ "modelValue",
1375
+ "min",
1376
+ "max"
1377
+ ])], 2),
1378
+ d(mr, { tooltip: "Увеличить" }, {
1379
+ default: z(() => [c("button", {
1380
+ type: "button",
1381
+ class: y(Z.iconButton),
1382
+ "aria-label": "Увеличить",
1383
+ onClick: fe
1384
+ }, [d(X, {
1385
+ name: "zoom-in",
1386
+ class: "size-5"
1387
+ })], 2)]),
1388
+ _: 1
1389
+ }),
1390
+ d(mr, { tooltip: "Вместить" }, {
1391
+ default: z(() => [c("button", {
1392
+ type: "button",
1393
+ class: y(Z.iconButton),
1394
+ "aria-label": "Вместить",
1395
+ onClick: q
1396
+ }, [d(X, {
1397
+ name: "fit-screen",
1398
+ class: "size-5"
1399
+ })], 2)]),
1400
+ _: 1
1401
+ }),
1402
+ d(mr, { tooltip: "Сбросить" }, {
1403
+ default: z(() => [c("button", {
1404
+ type: "button",
1405
+ class: y(Z.iconButton),
1406
+ "aria-label": "Сбросить",
1407
+ onClick: le
1408
+ }, [d(X, {
1409
+ name: "refresh",
1410
+ class: "size-5"
1411
+ })], 2)]),
1412
+ _: 1
1413
+ }),
1414
+ c("div", Qr, [d(qr, {
1415
+ modelValue: N(p),
1416
+ "onUpdate:modelValue": i[3] ||= (e) => h(p) ? p.value = e : null,
1417
+ options: n
1418
+ }, null, 8, ["modelValue"])]),
1419
+ c("div", { class: y(Z.actions) }, [d(Cr, {
1420
+ label: "Отмена",
1421
+ state: e.loading ? "disabled" : "idle",
1422
+ onClick: ge
1423
+ }, null, 8, ["state"]), d(Cr, {
1424
+ label: "Загрузить",
1425
+ state: e.loading ? "load" : "idle",
1426
+ onClick: he
1427
+ }, null, 8, ["state"])], 2)
1428
+ ], 2)], 34)]),
1429
+ _: 1
1430
+ }, 8, ["active"]), N(T) ? (S(), s("p", {
1431
+ key: 0,
1432
+ class: y(Z.error)
1433
+ }, j(N(T)), 3)) : o("", !0)], 2)
1434
+ ], 10, Jr)])) : o("", !0);
1435
+ }
1436
+ }), [["__scopeId", "data-v-ea37f216"]]), ei = {
1437
+ wrapper: "inline-flex items-center gap-1.5",
1438
+ spinner: "inline-block size-3 animate-spin rounded-full border-2 border-(--accent) border-t-transparent",
1439
+ label: "text-xs"
1440
+ }, ti = /* @__PURE__ */ f({
1441
+ __name: "SLoad",
1442
+ props: { label: {} },
1443
+ setup(e) {
1444
+ return (t, n) => (S(), s("span", { class: y(ei.wrapper) }, [c("span", {
1445
+ role: "status",
1446
+ "aria-label": "Загрузка",
1447
+ class: y(ei.spinner)
1448
+ }, null, 2), e.label ? (S(), s("span", {
1449
+ key: 0,
1450
+ class: y(ei.label)
1451
+ }, j(e.label), 3)) : o("", !0)], 2));
1452
+ }
1453
+ }), ni = { class: "contents" }, ri = ["aria-sort"], ii = ["onClick"], ai = { class: "contents" }, oi = {
1454
+ wrapper: "relative w-full max-w-full overflow-x-auto min-w-0",
1455
+ loading: "pointer-events-none absolute top-1 right-1 z-10 flex items-center gap-1 rounded-full bg-(--bg-default) px-2 py-1",
1456
+ leadHead: "w-7 py-2 pr-2 text-left align-top",
1457
+ leadCell: "n w-7 py-2 pr-2 align-top text-xs",
1458
+ emptyRow: "col-span-full py-3 pr-4 text-sm opacity-75",
1459
+ dividerRow: "col-span-full py-0.5 pr-4",
1460
+ dividerContent: "flex items-center gap-2",
1461
+ dividerText: "n text-[10px] leading-none",
1462
+ dividerLine: "h-px flex-1 bg-(--border)",
1463
+ headBase: "py-2 pr-4 text-left align-top text-xs font-medium opacity-70",
1464
+ cellBase: "py-2 pr-4 align-top"
1465
+ }, si = /* @__PURE__ */ f({
1466
+ __name: "SDataTable",
1467
+ props: {
1468
+ columns: { default: () => [] },
1469
+ rows: { default: () => [] },
1470
+ loading: {
1471
+ type: Boolean,
1472
+ default: !1
1473
+ },
1474
+ emptyText: { default: "" },
1475
+ rowKey: {
1476
+ type: [String, Function],
1477
+ default: "id"
1478
+ },
1479
+ nowrap: {
1480
+ type: Boolean,
1481
+ default: !1
1482
+ },
1483
+ rowNumbers: {
1484
+ type: Boolean,
1485
+ default: !1
1486
+ },
1487
+ divider: { type: Function },
1488
+ fixedLayout: {
1489
+ type: Boolean,
1490
+ default: !1
1491
+ }
1492
+ },
1493
+ setup(e) {
1494
+ let t = i(() => e.columns.length + +!!e.rowNumbers), r = i(() => e.emptyText || "Ничего не найдено."), a = (t, n) => {
1495
+ if (typeof e.rowKey == "function") return e.rowKey(t, n);
1496
+ let r = t[e.rowKey || "id"];
1497
+ return [
1498
+ "string",
1499
+ "number",
1500
+ "symbol"
1501
+ ].includes(typeof r) ? r : n;
1502
+ }, l = (e) => e == null || e === "" ? "—" : String(e), f = i(() => [
1503
+ "grid text-left text-sm",
1504
+ e.fixedLayout ? "w-full" : "w-max",
1505
+ e.nowrap && "whitespace-nowrap"
1506
+ ]), p = i(() => ({ gridTemplateColumns: e.fixedLayout ? `repeat(${t.value}, minmax(0, 1fr))` : `${e.rowNumbers ? "max-content " : ""}repeat(${e.columns.length}, max-content)` })), m = (t) => [
1507
+ oi.headBase,
1508
+ t.widthClass,
1509
+ t.headerClass,
1510
+ (e.nowrap || t.nowrap) && "whitespace-nowrap"
1511
+ ], h = (t) => [
1512
+ oi.cellBase,
1513
+ t.widthClass,
1514
+ t.cellClass,
1515
+ (e.nowrap || t.nowrap) && "whitespace-nowrap"
1516
+ ], g = E(""), _ = E("asc"), v = (e) => !!e.sortable && g.value === e.key, x = (e) => v(e) ? _.value === "asc" ? "ascending" : "descending" : "none", ee = (e) => {
1517
+ e.sortable && (g.value === e.key ? _.value === "asc" ? _.value = "desc" : (g.value = "", _.value = "asc") : (g.value = e.key, _.value = "asc"));
1518
+ }, C = (e) => e == null || e === "", w = (e, t) => {
1519
+ if (typeof e == "number" && typeof t == "number") return e - t;
1520
+ if (typeof e == "boolean" && typeof t == "boolean") return Number(e) - Number(t);
1521
+ let n = String(e), r = String(t), i = /^\d{4}-\d{2}-\d{2}/;
1522
+ return i.test(n) && i.test(r) ? Date.parse(n) - Date.parse(r) : n.localeCompare(r, "ru", {
1523
+ numeric: !0,
1524
+ sensitivity: "base"
1525
+ });
1526
+ }, T = i(() => {
1527
+ let t = g.value;
1528
+ if (!t) return e.rows;
1529
+ let n = _.value === "asc" ? 1 : -1;
1530
+ return [...e.rows].sort((e, r) => {
1531
+ let i = e[t], a = r[t], o = C(i), s = C(a);
1532
+ return o || s ? o === s ? 0 : o ? 1 : -1 : n * w(i, a);
1533
+ });
1534
+ });
1535
+ return (t, i) => (S(), s("div", { class: y(oi.wrapper) }, [e.loading ? (S(), s("div", {
1536
+ key: 0,
1537
+ class: y(oi.loading)
1538
+ }, [d(ti)], 2)) : o("", !0), c("div", {
1539
+ class: y(N(f)),
1540
+ style: b(N(p))
1541
+ }, [
1542
+ c("div", ni, [e.rowNumbers ? (S(), s("div", {
1543
+ key: 0,
1544
+ class: y(oi.leadHead)
1545
+ }, null, 2)) : o("", !0), (S(!0), s(n, null, D(e.columns, (e) => (S(), s("div", {
1546
+ key: e.key,
1547
+ role: "columnheader",
1548
+ "aria-sort": e.sortable ? x(e) : void 0,
1549
+ class: y(m(e))
1550
+ }, [e.sortable ? (S(), s("button", {
1551
+ key: 0,
1552
+ type: "button",
1553
+ class: "flex w-full items-center gap-1 text-left",
1554
+ onClick: (t) => ee(e)
1555
+ }, [O(t.$slots, `header-${e.key}`, {
1556
+ column: e,
1557
+ sortable: !0,
1558
+ sorted: v(e)
1559
+ }, () => [u(j(e.label), 1)]), d(X, {
1560
+ name: "chevron",
1561
+ class: y(["size-3 transition", v(e) ? N(_) === "asc" ? "-rotate-90 opacity-100" : "rotate-90 opacity-100" : "rotate-90 opacity-0"])
1562
+ }, null, 8, ["class"])], 8, ii)) : O(t.$slots, `header-${e.key}`, {
1563
+ column: e,
1564
+ sortable: !1,
1565
+ sorted: !1
1566
+ }, () => [u(j(e.label), 1)], void 0, 1)], 10, ri))), 128))]),
1567
+ e.rows.length ? o("", !0) : (S(), s("div", {
1568
+ key: 0,
1569
+ class: y(oi.emptyRow)
1570
+ }, [O(t.$slots, "empty", {}, () => [u(j(N(r)), 1)])], 2)),
1571
+ (S(!0), s(n, null, D(N(T), (r, i) => (S(), s(n, { key: a(r, i) }, [e.divider?.(r, i) ? (S(), s("div", {
1572
+ key: 0,
1573
+ class: y(oi.dividerRow)
1574
+ }, [c("div", {
1575
+ class: y(oi.dividerContent),
1576
+ role: "separator"
1577
+ }, [c("span", { class: y(oi.dividerText) }, j(e.divider(r, i)), 3), c("span", { class: y(oi.dividerLine) }, null, 2)], 2)], 2)) : o("", !0), c("div", ai, [e.rowNumbers ? (S(), s("div", {
1578
+ key: 0,
1579
+ class: y(oi.leadCell)
1580
+ }, j(i + 1), 3)) : o("", !0), (S(!0), s(n, null, D(e.columns, (e) => (S(), s("div", {
1581
+ key: `${String(a(r, i))}:${e.key}`,
1582
+ class: y(h(e))
1583
+ }, [O(t.$slots, `cell-${e.key}`, {
1584
+ row: r,
1585
+ column: e,
1586
+ value: r[e.key],
1587
+ index: i
1588
+ }, () => [O(t.$slots, "cell", {
1589
+ row: r,
1590
+ column: e,
1591
+ value: r[e.key],
1592
+ index: i
1593
+ }, () => [u(j(l(r[e.key])), 1)])])], 2))), 128))])], 64))), 128))
1594
+ ], 6)], 2));
1595
+ }
1596
+ }), ci = /* @__PURE__ */ new Map(), li = (e, t) => {
1597
+ let n = `${e}-${JSON.stringify(t)}`, r = ci.get(n);
1598
+ return r || (r = new Intl.DateTimeFormat(e, t), ci.set(n, r)), r;
1599
+ }, ui = {
1600
+ Short: "short",
1601
+ Full: "full"
1602
+ }, di = (e, t = {}, n) => {
1603
+ if (!e) return "";
1604
+ let r = new Date(e);
1605
+ if (Number.isNaN(r.getTime())) return "";
1606
+ let i = (e) => li("en-US", {
1607
+ timeZone: n,
1608
+ year: "numeric"
1609
+ }).format(e), a = t.fullYear || i(r) !== i(/* @__PURE__ */ new Date());
1610
+ return li("ru-RU", {
1611
+ timeZone: n,
1612
+ month: t.view === ui.Full ? "long" : "short",
1613
+ day: "numeric",
1614
+ year: a ? "numeric" : void 0,
1615
+ hour: "2-digit",
1616
+ minute: "2-digit",
1617
+ hour12: !1
1618
+ }).format(r);
1619
+ }, fi = /* @__PURE__ */ f({
1620
+ __name: "SDatetime",
1621
+ props: {
1622
+ value: {},
1623
+ timeZone: {},
1624
+ view: { default: () => ui.Short },
1625
+ fullYear: {
1626
+ type: Boolean,
1627
+ default: !1
1628
+ }
1629
+ },
1630
+ setup(t) {
1631
+ let n = e(), r = i(() => String(t.timeZone ?? n.timeZone ?? "").trim() || void 0), a = i(() => di(t.value, {
1632
+ view: t.view,
1633
+ fullYear: t.fullYear
1634
+ }, r.value));
1635
+ return (e, t) => (S(), s("span", null, j(N(a)), 1));
1636
+ }
1637
+ }), pi = ["id", "aria-label"], mi = /* @__PURE__ */ f({
1638
+ __name: "Popover",
1639
+ props: {
1640
+ open: { type: Boolean },
1641
+ trigger: {},
1642
+ panelId: {},
1643
+ ariaLabel: {}
1644
+ },
1645
+ emits: ["close", "confirm"],
1646
+ setup(e, { emit: t }) {
1647
+ let n = t, i = E(null), s = E({}), l = () => {
1648
+ let t = e.trigger?.getBoundingClientRect(), n = i.value;
1649
+ if (!t || !n) return;
1650
+ let r = Math.min(n.offsetWidth, window.innerWidth - 16), a = window.innerHeight - t.bottom - 4 - 8, o = t.top - 4 - 8, c = a >= n.offsetHeight || a >= o, l = Math.min(Math.max(8, t.left), window.innerWidth - r - 8);
1651
+ s.value = {
1652
+ left: `${l}px`,
1653
+ maxWidth: `${window.innerWidth - 16}px`,
1654
+ maxHeight: `${Math.max(160, c ? a : o)}px`,
1655
+ top: c ? `${t.bottom + 4}px` : "",
1656
+ bottom: c ? "" : `${window.innerHeight - t.top + 4}px`
1657
+ };
1658
+ }, u = (t) => {
1659
+ if (!e.open) return;
1660
+ let r = t.target;
1661
+ e.trigger?.contains(r) || i.value?.contains(r) || (r instanceof Element ? r : r.parentElement)?.closest("[data-select-list]") || n("close");
1662
+ }, d = (t) => {
1663
+ if (e.open) {
1664
+ if (t.key === "Escape") t.stopPropagation(), n("close"), e.trigger?.focus();
1665
+ else if (t.key === "Enter") {
1666
+ let e = t.target?.tagName;
1667
+ if (e === "INPUT" || e === "SELECT" || e === "TEXTAREA") return;
1668
+ t.preventDefault(), t.stopPropagation(), n("confirm");
1669
+ }
1670
+ }
1671
+ };
1672
+ return R(() => e.open, async (e) => {
1673
+ e && (await v(), l(), i.value?.focus());
1674
+ }), ee(() => {
1675
+ document.addEventListener("pointerdown", u), window.addEventListener("resize", l), window.addEventListener("scroll", l, !0), e.open && l();
1676
+ }), x(() => {
1677
+ document.removeEventListener("pointerdown", u), window.removeEventListener("resize", l), window.removeEventListener("scroll", l, !0);
1678
+ }), (t, n) => e.open ? (S(), a(r, {
1679
+ key: 0,
1680
+ to: "body"
1681
+ }, [c("div", {
1682
+ id: e.panelId,
1683
+ ref_key: "panelRef",
1684
+ ref: i,
1685
+ class: "fixed z-50 flex flex-col gap-2 overflow-auto bg-(--elevated) p-3 text-(--text-default) ring-1 ring-(--border) outline-none",
1686
+ style: b(N(s)),
1687
+ role: "dialog",
1688
+ "aria-label": e.ariaLabel,
1689
+ tabindex: "-1",
1690
+ onKeydown: d
1691
+ }, [O(t.$slots, "default")], 44, pi)])) : o("", !0);
1692
+ }
1693
+ }), hi = (e, t = 2) => String(e).padStart(t, "0"), gi = (e, t, n) => {
1694
+ let r = new Date(e, t - 1, n);
1695
+ return r.getFullYear() === e && r.getMonth() === t - 1 && r.getDate() === n;
1696
+ }, _i = (e) => {
1697
+ let t = String(e || "").trim();
1698
+ if (!t) return null;
1699
+ let n = t.match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?/);
1700
+ if (n) {
1701
+ let [, e, t, r, i, a, o] = n;
1702
+ return gi(Number(e), Number(t), Number(r)) ? {
1703
+ year: Number(e),
1704
+ month: Number(t),
1705
+ day: Number(r),
1706
+ hour: Math.min(Number(i || 0), 23),
1707
+ minute: Math.min(Number(a || 0), 59),
1708
+ second: Math.min(Number(o || 0), 59)
1709
+ } : null;
1710
+ }
1711
+ let r = t.match(/^(\d{2}):(\d{2})(?::(\d{2}))?$/);
1712
+ if (!r) return null;
1713
+ let i = /* @__PURE__ */ new Date();
1714
+ return {
1715
+ year: i.getFullYear(),
1716
+ month: i.getMonth() + 1,
1717
+ day: i.getDate(),
1718
+ hour: Math.min(Number(r[1]), 23),
1719
+ minute: Math.min(Number(r[2]), 59),
1720
+ second: Math.min(Number(r[3] || 0), 59)
1721
+ };
1722
+ }, vi = (e, t) => {
1723
+ let n = `${hi(e.year, 4)}-${hi(e.month)}-${hi(e.day)}`, r = `${hi(e.hour)}:${hi(e.minute)}${t.showSeconds ? `:${hi(e.second)}` : ""}`;
1724
+ return t.showDate ? t.showTime ? `${n}T${r}` : n : r;
1725
+ }, yi = (e) => ({
1726
+ year: e.getFullYear(),
1727
+ month: e.getMonth() + 1,
1728
+ day: e.getDate(),
1729
+ hour: e.getHours(),
1730
+ minute: e.getMinutes(),
1731
+ second: e.getSeconds()
1732
+ }), bi = (e) => new Date(e.year, e.month - 1, e.day, e.hour, e.minute, e.second), xi = (e, t) => bi(e).getTime() - bi(t).getTime(), Si = (e, t) => e.year === t.year ? e.month === t.month ? e.day - t.day : e.month - t.month : e.year - t.year, Ci = (e, t, n) => t && xi(e, t) < 0 ? { ...t } : n && xi(e, n) > 0 ? { ...n } : e, wi = (e, t, n) => li(t, {
1733
+ dateStyle: n.showDate ? "medium" : void 0,
1734
+ timeStyle: n.showTime ? n.showSeconds ? "medium" : "short" : void 0,
1735
+ hour12: !1
1736
+ }).format(bi(e)), Ti = /* @__PURE__ */ new Map(), Ei = (e) => {
1737
+ let t = li(e, {
1738
+ month: "long",
1739
+ timeZone: "UTC"
1740
+ });
1741
+ return Array.from({ length: 12 }, (e, n) => t.format(new Date(Date.UTC(2024, n, 15))));
1742
+ }, Di = (e, t) => {
1743
+ let n = li(e, {
1744
+ weekday: t,
1745
+ timeZone: "UTC"
1746
+ });
1747
+ return Array.from({ length: 7 }, (e, t) => n.format(new Date(Date.UTC(2024, 0, 1 + t))));
1748
+ }, Oi = (e) => {
1749
+ let t = Ti.get(e);
1750
+ if (t) return t;
1751
+ let n = {
1752
+ monthNames: Ei(e),
1753
+ weekdayNamesShort: Di(e, "short"),
1754
+ weekdayNamesLong: Di(e, "long")
1755
+ };
1756
+ return Ti.set(e, n), n;
1757
+ }, ki = (e) => {
1758
+ let t = String(e || "").trim();
1759
+ if (!t) return "UTC";
1760
+ try {
1761
+ return new Intl.DateTimeFormat("en-US", { timeZone: t }).format(/* @__PURE__ */ new Date(0)), t;
1762
+ } catch {
1763
+ return "UTC";
1764
+ }
1765
+ }, Ai = () => {
1766
+ try {
1767
+ return ki(Intl.DateTimeFormat().resolvedOptions().timeZone);
1768
+ } catch {
1769
+ return "UTC";
1770
+ }
1771
+ }, ji = () => {
1772
+ try {
1773
+ let e = Intl.supportedValuesOf("timeZone");
1774
+ if (e.length) return (e.includes("UTC") ? e : ["UTC", ...e]).map((e) => ({
1775
+ value: e,
1776
+ label: e.replace(/_/g, " ")
1777
+ }));
1778
+ } catch {}
1779
+ return (/* @__PURE__ */ "UTC.Europe/Kaliningrad.Europe/Moscow.Europe/Samara.Asia/Yekaterinburg.Asia/Omsk.Asia/Novosibirsk.Asia/Krasnoyarsk.Asia/Irkutsk.Asia/Yakutsk.Asia/Vladivostok.Asia/Magadan.Asia/Kamchatka.Europe/Berlin.Europe/Paris.Europe/London.Asia/Tbilisi.Asia/Yerevan.Asia/Almaty.Asia/Tashkent.Asia/Dubai.Asia/Shanghai.Asia/Tokyo.America/New_York.America/Chicago.America/Denver.America/Los_Angeles".split(".")).map((e) => ({
1780
+ value: e,
1781
+ label: e
1782
+ }));
1783
+ }, Mi = { class: "flex flex-col gap-2" }, Ni = { class: "flex items-center gap-1" }, Pi = ["aria-label", "disabled"], Fi = ["aria-label", "disabled"], Ii = ["aria-label"], Li = {
1784
+ role: "row",
1785
+ class: "flex"
1786
+ }, Ri = ["abbr"], zi = [
1787
+ "data-day",
1788
+ "tabindex",
1789
+ "aria-selected",
1790
+ "aria-current",
1791
+ "aria-disabled",
1792
+ "aria-label",
1793
+ "onClick",
1794
+ "onKeydown"
1795
+ ], Bi = /* @__PURE__ */ f({
1796
+ __name: "Calendar",
1797
+ props: {
1798
+ selected: {},
1799
+ min: {},
1800
+ max: {},
1801
+ localeInfo: {},
1802
+ labels: {}
1803
+ },
1804
+ emits: ["select", "commit"],
1805
+ setup(e, { emit: t }) {
1806
+ let r = t, a = /* @__PURE__ */ new Date(), o = e.selected || {
1807
+ year: a.getFullYear(),
1808
+ month: a.getMonth() + 1,
1809
+ day: 1
1810
+ }, l = E(o.year), u = E(o.month), f = E(""), p = E(null), m = i(() => e.min?.year ?? a.getFullYear() - 100), h = i(() => e.max?.year ?? a.getFullYear() + 100), g = i(() => !(l.value <= m.value && u.value === 1)), _ = i(() => !(l.value >= h.value && u.value === 12)), b = i(() => e.localeInfo.monthNames.map((e, t) => ({
1811
+ value: String(t + 1),
1812
+ label: e
1813
+ }))), x = i(() => Array.from({ length: h.value - m.value + 1 }, (e, t) => {
1814
+ let n = m.value + t;
1815
+ return {
1816
+ value: String(n),
1817
+ label: String(n)
1818
+ };
1819
+ })), ee = (e, t) => new Date(e, t, 0).getDate(), C = () => {
1820
+ if (!e.selected) return;
1821
+ let t = Math.min(e.selected.day, ee(l.value, u.value));
1822
+ r("commit", {
1823
+ year: l.value,
1824
+ month: u.value,
1825
+ day: t
1826
+ });
1827
+ }, w = (e) => {
1828
+ u.value = Number(e) || u.value, C();
1829
+ }, T = (e) => {
1830
+ l.value = Number(e) || l.value, C();
1831
+ }, O = (e) => {
1832
+ let t = u.value + e;
1833
+ if (t < 1) {
1834
+ if (l.value <= m.value) return;
1835
+ --l.value, u.value = 12;
1836
+ } else if (t > 12) {
1837
+ if (l.value >= h.value) return;
1838
+ l.value += 1, u.value = 1;
1839
+ } else u.value = t;
1840
+ };
1841
+ R(() => e.selected && `${e.selected.year}-${e.selected.month}`, () => {
1842
+ e.selected && (l.value = e.selected.year, u.value = e.selected.month);
1843
+ });
1844
+ let k = (e, t, n) => `${e}-${t}-${n}`, A = k(a.getFullYear(), a.getMonth() + 1, a.getDate()), M = i(() => e.selected ? k(e.selected.year, e.selected.month, e.selected.day) : ""), P = [
1845
+ 1,
1846
+ 2,
1847
+ 3,
1848
+ 4,
1849
+ 5,
1850
+ 6,
1851
+ 7
1852
+ ], F = i(() => {
1853
+ let e = new Date(l.value, u.value - 1, 1), t = (e.getDay() === 0 ? 7 : e.getDay()) - 1, n = new Date(l.value, u.value - 1, 1 - t);
1854
+ return Array.from({ length: 6 }, (e, t) => Array.from({ length: 7 }, (e, r) => {
1855
+ let i = new Date(n.getFullYear(), n.getMonth(), n.getDate() + t * 7 + r), a = {
1856
+ year: i.getFullYear(),
1857
+ month: i.getMonth() + 1,
1858
+ day: i.getDate()
1859
+ };
1860
+ return {
1861
+ ...a,
1862
+ inMonth: a.month === u.value && a.year === l.value,
1863
+ key: k(a.year, a.month, a.day)
1864
+ };
1865
+ }));
1866
+ }), I = (t) => {
1867
+ let n = {
1868
+ ...t,
1869
+ hour: 0,
1870
+ minute: 0,
1871
+ second: 0
1872
+ };
1873
+ return e.min && Si(n, e.min) < 0 ? !0 : !!(e.max && Si(n, e.max) > 0);
1874
+ }, L = i(() => {
1875
+ let e = F.value.flat();
1876
+ return e.some((e) => e.key === f.value) ? f.value : e.some((e) => e.key === M.value) ? M.value : e.some((e) => e.key === A && e.inMonth) ? A : e.find((e) => e.inMonth)?.key || "";
1877
+ }), te = (e) => {
1878
+ I(e) || (f.value = e.key, r("select", {
1879
+ year: e.year,
1880
+ month: e.month,
1881
+ day: e.day
1882
+ }));
1883
+ }, z = async (e) => {
1884
+ let t = e.getFullYear(), n = e.getMonth() + 1;
1885
+ f.value = k(t, n, e.getDate()), (t !== l.value || n !== u.value) && (l.value = t, u.value = n), await v(), p.value?.querySelector(`[data-day="${f.value}"]`)?.focus();
1886
+ }, ne = (e, t) => {
1887
+ let n = new Date(e.year, e.month - 1, e.day), r = (t) => z(new Date(e.year, e.month - 1, e.day + t));
1888
+ if (t.key === "ArrowLeft") r(-1);
1889
+ else if (t.key === "ArrowRight") r(1);
1890
+ else if (t.key === "ArrowUp") r(-7);
1891
+ else if (t.key === "ArrowDown") r(7);
1892
+ else if (t.key === "PageUp") z(new Date(e.year - +!!t.shiftKey, e.month - 1 - !t.shiftKey, e.day));
1893
+ else if (t.key === "PageDown") z(new Date(e.year + +!!t.shiftKey, e.month - 1 + +!t.shiftKey, e.day));
1894
+ else if (t.key === "Home") r(-(((n.getDay() === 0 ? 7 : n.getDay()) - 1 + 7) % 7));
1895
+ else if (t.key === "End") r(6 - ((n.getDay() === 0 ? 7 : n.getDay()) - 1 + 7) % 7);
1896
+ else if (t.key === "Enter" || t.key === " ") te(e);
1897
+ else return;
1898
+ t.preventDefault();
1899
+ };
1900
+ return (t, r) => (S(), s("div", Mi, [c("div", Ni, [
1901
+ c("button", {
1902
+ type: "button",
1903
+ class: "ui-focus inline-flex items-center justify-center rounded-full p-1 text-(--text-default) transition hover:bg-(--accent)/10 disabled:cursor-not-allowed disabled:opacity-30 disabled:hover:bg-transparent",
1904
+ "aria-label": e.labels.prevMonth,
1905
+ disabled: !N(g),
1906
+ onClick: r[0] ||= (e) => O(-1)
1907
+ }, [d(X, {
1908
+ name: "chevron",
1909
+ class: "size-5 rotate-180"
1910
+ })], 8, Pi),
1911
+ d(qr, {
1912
+ class: "min-w-32 flex-1",
1913
+ "model-value": String(N(u)),
1914
+ options: N(b),
1915
+ "aria-label": e.labels.month,
1916
+ "onUpdate:modelValue": r[1] ||= (e) => w(String(e ?? ""))
1917
+ }, null, 8, [
1918
+ "model-value",
1919
+ "options",
1920
+ "aria-label"
1921
+ ]),
1922
+ d(qr, {
1923
+ class: "min-w-20",
1924
+ "model-value": String(N(l)),
1925
+ options: N(x),
1926
+ "aria-label": e.labels.year,
1927
+ "onUpdate:modelValue": r[2] ||= (e) => T(String(e ?? ""))
1928
+ }, null, 8, [
1929
+ "model-value",
1930
+ "options",
1931
+ "aria-label"
1932
+ ]),
1933
+ c("button", {
1934
+ type: "button",
1935
+ class: "ui-focus inline-flex items-center justify-center rounded-full p-1 text-(--text-default) transition hover:bg-(--accent)/10 disabled:cursor-not-allowed disabled:opacity-30 disabled:hover:bg-transparent",
1936
+ "aria-label": e.labels.nextMonth,
1937
+ disabled: !N(_),
1938
+ onClick: r[3] ||= (e) => O(1)
1939
+ }, [d(X, {
1940
+ name: "chevron",
1941
+ class: "size-5"
1942
+ })], 8, Fi)
1943
+ ]), c("div", {
1944
+ ref_key: "gridRef",
1945
+ ref: p,
1946
+ role: "grid",
1947
+ "aria-label": e.labels.grid,
1948
+ class: "flex flex-col gap-0.5 select-none"
1949
+ }, [c("div", Li, [(S(), s(n, null, D(P, (t) => c("span", {
1950
+ key: t,
1951
+ role: "columnheader",
1952
+ class: "w-9 py-1 text-center text-xs opacity-60",
1953
+ abbr: e.localeInfo.weekdayNamesLong[t - 1]
1954
+ }, j(e.localeInfo.weekdayNamesShort[t - 1]), 9, Ri)), 64))]), (S(!0), s(n, null, D(N(F), (t, r) => (S(), s("div", {
1955
+ key: r,
1956
+ role: "row",
1957
+ class: "flex"
1958
+ }, [(S(!0), s(n, null, D(t, (t) => (S(), s("button", {
1959
+ key: t.key,
1960
+ type: "button",
1961
+ role: "gridcell",
1962
+ "data-day": t.key,
1963
+ class: y(["ui-focus flex size-9 items-center justify-center text-sm", [
1964
+ t.key === N(M) ? "bg-(--accent) text-(--bg-default)" : t.key === N(A) ? "ring-1 ring-(--accent) ring-inset" : "hover:bg-(--accent)/10",
1965
+ !t.inMonth && "opacity-40",
1966
+ I(t) && "cursor-not-allowed opacity-25 hover:bg-transparent"
1967
+ ]]),
1968
+ tabindex: t.key === N(L) ? 0 : -1,
1969
+ "aria-selected": t.key === N(M) ? "true" : "false",
1970
+ "aria-current": t.key === N(A) ? "date" : void 0,
1971
+ "aria-disabled": I(t) || void 0,
1972
+ "aria-label": `${t.day} ${e.localeInfo.monthNames[t.month - 1]} ${t.year}`,
1973
+ onClick: (e) => te(t),
1974
+ onKeydown: (e) => ne(t, e)
1975
+ }, j(t.day), 43, zi))), 128))]))), 128))], 8, Ii)]));
1976
+ }
1977
+ }), Vi = [
1978
+ "aria-label",
1979
+ "aria-valuemin",
1980
+ "aria-valuemax",
1981
+ "aria-valuenow",
1982
+ "aria-valuetext"
1983
+ ], Hi = ["onClick"], Ui = /* @__PURE__ */ f({
1984
+ __name: "TimeWheel",
1985
+ props: {
1986
+ modelValue: {},
1987
+ values: {},
1988
+ labels: {},
1989
+ ariaLabel: { default: "" },
1990
+ disabledValues: { default: () => [] },
1991
+ loop: {
1992
+ type: Boolean,
1993
+ default: !0
1994
+ }
1995
+ },
1996
+ emits: ["update:modelValue"],
1997
+ setup(e, { emit: t }) {
1998
+ let r = t, a = i(() => e.values.length), o = i(() => new Set(e.disabledValues)), l = i(() => Math.max(0, e.values.indexOf(e.modelValue))), u = E(l.value), d = E(!1), f = (e) => (e % a.value + a.value) % a.value, p = (t) => o.value.has(e.values[f(t)] ?? -1), m = (t, n) => {
1999
+ if (!a.value) return 0;
2000
+ for (let r = 0; r < a.value; r += 1) {
2001
+ let i = n ? [t + r * n] : [t + r, t - r];
2002
+ for (let t of i) if (!(!e.loop && (t < 0 || t >= a.value)) && !p(t)) return t;
2003
+ }
2004
+ return t;
2005
+ }, h = (t, n = 0) => {
2006
+ let i = e.loop ? t : Math.min(Math.max(t, 0), a.value - 1);
2007
+ u.value = m(i, n);
2008
+ let o = e.values[f(u.value)];
2009
+ o !== void 0 && o !== e.modelValue && r("update:modelValue", o);
2010
+ }, g = (e) => h(Math.round(u.value) + e, Math.sign(e)), _ = i(() => String(Math.max(...e.values, 0)).length), v = "", ee = null, C = () => {
2011
+ ee && clearTimeout(ee), ee = setTimeout(() => v = "", 900);
2012
+ }, w = (t) => {
2013
+ let n = Math.max(...e.values), r = Number(v + t);
2014
+ !Number.isFinite(r) || r > n ? (r = Number(t), v = t) : v += t;
2015
+ let i = e.values.indexOf(r);
2016
+ i !== -1 && h(i), v.length >= _.value && (v = ""), C();
2017
+ };
2018
+ x(() => {
2019
+ ee && clearTimeout(ee);
2020
+ }), R(l, (e) => {
2021
+ !d.value && f(Math.round(u.value)) !== e && (u.value = e);
2022
+ }), R(a, () => {
2023
+ u.value = l.value;
2024
+ });
2025
+ let T = i(() => {
2026
+ let t = Math.round(u.value);
2027
+ return Array.from({ length: 7 }, (n, r) => {
2028
+ let i = t - 2 - 1 + r, o = !e.loop && (i < 0 || i >= a.value), s = f(i);
2029
+ return {
2030
+ index: i,
2031
+ label: o ? "" : e.labels[s] || "",
2032
+ disabled: p(i),
2033
+ offset: (i - u.value) * 32
2034
+ };
2035
+ });
2036
+ }), O = 0, k = 0, A = 0, M = (e) => {
2037
+ e.preventDefault();
2038
+ let t = performance.now();
2039
+ if (t - A < 80) return;
2040
+ A = t;
2041
+ let n = Math.sign(e.deltaY);
2042
+ n !== 0 && g(n);
2043
+ }, P = (e) => {
2044
+ (e.button === 0 || e.pointerType !== "mouse") && (d.value = !0, O = e.clientY, k = u.value, e.currentTarget.setPointerCapture(e.pointerId));
2045
+ }, F = (t) => {
2046
+ if (!d.value) return;
2047
+ let n = k + (O - t.clientY) / 32;
2048
+ u.value = e.loop ? n : Math.min(Math.max(n, -.4), a.value - .6);
2049
+ }, I = () => {
2050
+ d.value && (d.value = !1, h(Math.round(u.value)));
2051
+ }, L = (e) => {
2052
+ if (e.key === "ArrowUp") g(-1);
2053
+ else if (e.key === "ArrowDown") g(1);
2054
+ else if (e.key === "PageUp") g(-5);
2055
+ else if (e.key === "PageDown") g(5);
2056
+ else if (e.key === "Home") h(0, 1);
2057
+ else if (e.key === "End") h(a.value - 1, -1);
2058
+ else if (/^[0-9]$/.test(e.key)) w(e.key);
2059
+ else if (e.key === "Backspace") v = "";
2060
+ else return;
2061
+ e.preventDefault();
2062
+ }, te = i(() => Math.min(...e.values)), z = i(() => Math.max(...e.values)), ne = i(() => e.labels[l.value] || "");
2063
+ return (t, r) => (S(), s("div", {
2064
+ class: "ui-focus relative touch-none overflow-hidden text-(--text-default) select-none",
2065
+ style: b({
2066
+ height: "160px",
2067
+ width: "3.5rem"
2068
+ }),
2069
+ role: "spinbutton",
2070
+ tabindex: "0",
2071
+ "aria-label": e.ariaLabel,
2072
+ "aria-valuemin": N(te),
2073
+ "aria-valuemax": N(z),
2074
+ "aria-valuenow": e.modelValue,
2075
+ "aria-valuetext": N(ne),
2076
+ onPointerdown: P,
2077
+ onPointermove: F,
2078
+ onPointerup: I,
2079
+ onPointercancel: I,
2080
+ onWheel: M,
2081
+ onKeydown: L
2082
+ }, [c("div", {
2083
+ class: "pointer-events-none absolute inset-x-0 border-y border-(--accent)/40 bg-(--accent)/10",
2084
+ style: b({
2085
+ top: `${32 * N(2)}px`,
2086
+ height: "32px"
2087
+ })
2088
+ }, null, 4), (S(!0), s(n, null, D(N(T), (e) => (S(), s("div", {
2089
+ key: e.index,
2090
+ class: y(["absolute inset-x-0 flex cursor-pointer items-center justify-center text-sm tabular-nums", [!N(d) && "transition-transform duration-100", e.disabled ? "cursor-not-allowed opacity-25" : Math.abs(e.offset) < 2 ? "" : "opacity-55"]]),
2091
+ style: b({
2092
+ height: "32px",
2093
+ transform: `translateY(${e.offset + 32 * N(2)}px)`
2094
+ }),
2095
+ "aria-hidden": "true",
2096
+ onClick: (t) => h(e.index)
2097
+ }, j(e.label), 15, Hi))), 128))], 44, Vi));
2098
+ }
2099
+ }), Wi = { class: "flex items-start justify-center gap-1 text-(--text-default)" }, Gi = {
2100
+ key: 0,
2101
+ class: "flex h-40 items-center text-sm opacity-60",
2102
+ "aria-hidden": "true"
2103
+ }, Ki = /* @__PURE__ */ f({
2104
+ __name: "Time",
2105
+ props: {
2106
+ hour: {},
2107
+ minute: {},
2108
+ second: {},
2109
+ showSeconds: {
2110
+ type: Boolean,
2111
+ default: !1
2112
+ },
2113
+ disabledHours: { default: () => [] },
2114
+ disabledMinutes: { default: () => [] },
2115
+ disabledSeconds: { default: () => [] },
2116
+ labels: {}
2117
+ },
2118
+ emits: ["change"],
2119
+ setup(e, { emit: t }) {
2120
+ let n = t, r = Array.from({ length: 60 }, (e, t) => t), i = r.map((e) => String(e).padStart(2, "0")), l = Array.from({ length: 24 }, (e, t) => t), u = i.slice(0, 24);
2121
+ return (t, f) => (S(), s("div", Wi, [
2122
+ d(Ui, {
2123
+ "model-value": e.hour,
2124
+ values: N(l),
2125
+ labels: N(u),
2126
+ "aria-label": e.labels.hours,
2127
+ "disabled-values": e.disabledHours,
2128
+ "onUpdate:modelValue": f[0] ||= (e) => n("change", { hour: e })
2129
+ }, null, 8, [
2130
+ "model-value",
2131
+ "values",
2132
+ "labels",
2133
+ "aria-label",
2134
+ "disabled-values"
2135
+ ]),
2136
+ f[3] ||= c("span", {
2137
+ class: "flex h-40 items-center text-sm opacity-60",
2138
+ "aria-hidden": "true"
2139
+ }, ":", -1),
2140
+ d(Ui, {
2141
+ "model-value": e.minute,
2142
+ values: N(r),
2143
+ labels: N(i),
2144
+ "aria-label": e.labels.minutes,
2145
+ "disabled-values": e.disabledMinutes,
2146
+ "onUpdate:modelValue": f[1] ||= (e) => n("change", { minute: e })
2147
+ }, null, 8, [
2148
+ "model-value",
2149
+ "values",
2150
+ "labels",
2151
+ "aria-label",
2152
+ "disabled-values"
2153
+ ]),
2154
+ e.showSeconds ? (S(), s("span", Gi, ":")) : o("", !0),
2155
+ e.showSeconds ? (S(), a(Ui, {
2156
+ key: 1,
2157
+ "model-value": e.second,
2158
+ values: N(r),
2159
+ labels: N(i),
2160
+ "aria-label": e.labels.seconds,
2161
+ "disabled-values": e.disabledSeconds,
2162
+ "onUpdate:modelValue": f[2] ||= (e) => n("change", { second: e })
2163
+ }, null, 8, [
2164
+ "model-value",
2165
+ "values",
2166
+ "labels",
2167
+ "aria-label",
2168
+ "disabled-values"
2169
+ ])) : o("", !0)
2170
+ ]));
2171
+ }
2172
+ }), qi = { class: "flex flex-wrap items-center gap-2" }, Ji = {
2173
+ key: 0,
2174
+ class: "flex flex-wrap gap-1"
2175
+ }, Yi = {
2176
+ key: 1,
2177
+ class: "h-4 w-px bg-(--border)",
2178
+ "aria-hidden": "true"
2179
+ }, Xi = {
2180
+ key: 2,
2181
+ class: "flex flex-wrap gap-1"
2182
+ }, Zi = /* @__PURE__ */ f({
2183
+ __name: "QuickActions",
2184
+ props: {
2185
+ showDate: { type: Boolean },
2186
+ showTime: { type: Boolean },
2187
+ labels: {}
2188
+ },
2189
+ emits: ["action"],
2190
+ setup(e, { emit: t }) {
2191
+ let r = t, c = i(() => e.showDate ? [
2192
+ "yesterday",
2193
+ "today",
2194
+ "tomorrow"
2195
+ ] : []), l = i(() => e.showTime ? [
2196
+ "startOfDay",
2197
+ "now",
2198
+ "endOfDay"
2199
+ ] : []);
2200
+ return (t, i) => (S(), s("div", qi, [
2201
+ N(c).length ? (S(), s("div", Ji, [(S(!0), s(n, null, D(N(c), (t) => (S(), a(Cr, {
2202
+ key: t,
2203
+ label: e.labels[t],
2204
+ onClick: (e) => r("action", t)
2205
+ }, null, 8, ["label", "onClick"]))), 128))])) : o("", !0),
2206
+ N(c).length && N(l).length ? (S(), s("span", Yi)) : o("", !0),
2207
+ N(l).length ? (S(), s("div", Xi, [(S(!0), s(n, null, D(N(l), (t) => (S(), a(Cr, {
2208
+ key: t,
2209
+ label: e.labels[t],
2210
+ onClick: (e) => r("action", t)
2211
+ }, null, 8, ["label", "onClick"]))), 128))])) : o("", !0)
2212
+ ]));
2213
+ }
2214
+ }), Qi = { class: "inline-block" }, $i = [
2215
+ "id",
2216
+ "tabindex",
2217
+ "aria-label",
2218
+ "aria-expanded",
2219
+ "aria-controls",
2220
+ "aria-invalid",
2221
+ "aria-disabled"
2222
+ ], ea = ["aria-hidden", "disabled"], ta = ["name", "value"], na = { class: "flex flex-wrap items-start gap-4" }, ra = /* @__PURE__ */ f({
2223
+ __name: "index",
2224
+ props: /*@__PURE__*/ g({
2225
+ disabled: {
2226
+ type: Boolean,
2227
+ default: !1
2228
+ },
2229
+ readonly: {
2230
+ type: Boolean,
2231
+ default: !1
2232
+ },
2233
+ invalid: {
2234
+ type: Boolean,
2235
+ default: !1
2236
+ },
2237
+ locale: { default: "ru-RU" },
2238
+ min: {},
2239
+ max: {},
2240
+ showDate: {
2241
+ type: Boolean,
2242
+ default: !0
2243
+ },
2244
+ showTime: {
2245
+ type: Boolean,
2246
+ default: !0
2247
+ },
2248
+ showSeconds: {
2249
+ type: Boolean,
2250
+ default: !1
2251
+ },
2252
+ closeOnSelect: { type: Boolean },
2253
+ showTimezone: {
2254
+ type: Boolean,
2255
+ default: !1
2256
+ },
2257
+ id: {},
2258
+ name: {},
2259
+ ariaLabel: {}
2260
+ }, {
2261
+ modelValue: { default: "" },
2262
+ modelModifiers: {},
2263
+ timezone: {},
2264
+ timezoneModifiers: {}
2265
+ }),
2266
+ emits: ["update:modelValue", "update:timezone"],
2267
+ setup(e, { expose: t }) {
2268
+ let n = F(e, "modelValue"), r = F(e, "timezone"), l = E(null);
2269
+ t({ focus: () => l.value?.focus() });
2270
+ let u = m("field-id", void 0), f = m("field-context", null), p = m("fieldset-disabled", E(!1)), g = P(), _ = i(() => e.id || f?.id.value || u || `datetime-${g}`), v = i(() => `${_.value}-panel`), b = i(() => !!(e.disabled || f?.disabled?.value || p.value)), x = i(() => e.locale || "ru-RU"), C = i(() => Oi(x.value)), w = i(() => ({
2271
+ showDate: e.showDate,
2272
+ showTime: e.showTime,
2273
+ showSeconds: e.showTime && e.showSeconds
2274
+ })), T = i(() => _i(n.value)), D = i(() => !!T.value && !b.value && !e.readonly), O = i(() => _i(e.min)), k = i(() => _i(e.max)), A = i(() => T.value ? wi(T.value, x.value, w.value) : ""), M = i(() => e.showDate ? e.showTime ? "Выберите дату и время" : "Выберите дату" : "Выберите время"), I = E(!1), L = i(() => e.closeOnSelect ?? !e.showTime), te = () => {
2275
+ b.value || e.readonly || (I.value = !I.value);
2276
+ }, R = () => I.value = !1, ne = () => {
2277
+ b.value || e.readonly || (n.value = "", l.value?.focus());
2278
+ }, B = (e) => {
2279
+ e.key === "Enter" || e.key === " " ? (e.preventDefault(), te()) : e.key === "Escape" && I.value && (e.preventDefault(), e.stopPropagation(), R(), l.value?.focus());
2280
+ }, V = () => {
2281
+ let e = l.value?.closest("fieldset");
2282
+ if (!l.value || !e) return !1;
2283
+ let t = Array.from(e.querySelectorAll("[data-datetime-trigger]")), n = t[t.indexOf(l.value) + 1];
2284
+ return n ? (n.focus(), !0) : !1;
2285
+ }, ie = () => {
2286
+ let t = /* @__PURE__ */ new Date();
2287
+ return e.showTime ? yi(t) : {
2288
+ ...yi(t),
2289
+ hour: 0,
2290
+ minute: 0,
2291
+ second: 0
2292
+ };
2293
+ }, ae = (t) => {
2294
+ let r = Ci(e.showSeconds ? t : {
2295
+ ...t,
2296
+ second: 0
2297
+ }, O.value, k.value);
2298
+ n.value = vi(r, w.value);
2299
+ }, H = (e) => {
2300
+ ae({
2301
+ ...T.value || ie(),
2302
+ ...e
2303
+ }), L.value && (R(), V() || l.value?.focus());
2304
+ }, U = (e) => ae({
2305
+ ...T.value || ie(),
2306
+ ...e
2307
+ }), W = () => {
2308
+ R(), V() || l.value?.focus();
2309
+ }, oe = (e) => ae({
2310
+ ...T.value || ie(),
2311
+ ...e
2312
+ }), G = (e, t) => !!(e && t && Si(e, t) === 0), K = i(() => {
2313
+ let e = [], t = T.value;
2314
+ if (G(t, O.value)) for (let t = 0; t < (O.value?.hour || 0); t += 1) e.push(t);
2315
+ if (G(t, k.value)) for (let t = (k.value?.hour ?? 23) + 1; t < 24; t += 1) e.push(t);
2316
+ return e;
2317
+ }), q = i(() => {
2318
+ let e = [], t = T.value;
2319
+ if (G(t, O.value) && t?.hour === O.value?.hour) for (let t = 0; t < (O.value?.minute || 0); t += 1) e.push(t);
2320
+ if (G(t, k.value) && t?.hour === k.value?.hour) for (let t = (k.value?.minute ?? 59) + 1; t < 60; t += 1) e.push(t);
2321
+ return e;
2322
+ }), se = E("");
2323
+ ee(() => {
2324
+ se.value = Ai();
2325
+ });
2326
+ let ce = i({
2327
+ get: () => r.value || se.value,
2328
+ set: (e) => {
2329
+ r.value = e;
2330
+ }
2331
+ }), le = i(() => e.showTimezone ? ji() : []), J = i(() => ({
2332
+ today: "Сегодня",
2333
+ now: "Сейчас",
2334
+ tomorrow: "Завтра",
2335
+ yesterday: "Вчера",
2336
+ startOfDay: "Начало дня",
2337
+ endOfDay: "Конец дня"
2338
+ })), ue = i(() => ({
2339
+ grid: "Календарь",
2340
+ prevMonth: "Предыдущий месяц",
2341
+ nextMonth: "Следующий месяц",
2342
+ month: "Месяц",
2343
+ year: "Год"
2344
+ })), de = i(() => ({
2345
+ hours: "Часы",
2346
+ minutes: "Минуты",
2347
+ seconds: "Секунды"
2348
+ })), fe = (t) => {
2349
+ let n = /* @__PURE__ */ new Date(), r = T.value || ie();
2350
+ if (t === "now") return ae(yi(n));
2351
+ if (t === "startOfDay") return ae({
2352
+ ...r,
2353
+ hour: 0,
2354
+ minute: 0,
2355
+ second: 0
2356
+ });
2357
+ if (t === "endOfDay") return ae({
2358
+ ...r,
2359
+ hour: 23,
2360
+ minute: 59,
2361
+ second: e.showSeconds ? 59 : 0
2362
+ });
2363
+ let i = t === "tomorrow" ? 1 : t === "yesterday" ? -1 : 0, a = new Date(n.getFullYear(), n.getMonth(), n.getDate() + i);
2364
+ ae({
2365
+ ...r,
2366
+ year: a.getFullYear(),
2367
+ month: a.getMonth() + 1,
2368
+ day: a.getDate()
2369
+ });
2370
+ }, pe = i(() => [
2371
+ "relative flex h-9 w-full min-w-44 items-center justify-between gap-2 px-3 text-sm text-(--text-default) bg-(--default) hover:bg-(--default-hover) outline-none select-none focus:ring-2 focus:ring-(--accent) focus-within:ring-2 focus-within:ring-(--accent)",
2372
+ e.invalid ? "ring-2 ring-(--danger) focus:ring-(--danger) focus-within:ring-(--danger)" : "ring-1 ring-(--border)",
2373
+ b.value && "cursor-not-allowed opacity-50"
2374
+ ]);
2375
+ return (t, r) => (S(), s("div", Qi, [
2376
+ c("div", {
2377
+ id: N(_),
2378
+ ref_key: "triggerRef",
2379
+ ref: l,
2380
+ role: "combobox",
2381
+ tabindex: N(b) ? -1 : 0,
2382
+ class: y(N(pe)),
2383
+ "data-datetime-trigger": "",
2384
+ "aria-label": e.ariaLabel || N(M),
2385
+ "aria-haspopup": "dialog",
2386
+ "aria-expanded": N(I) ? "true" : "false",
2387
+ "aria-controls": N(I) ? N(v) : void 0,
2388
+ "aria-invalid": e.invalid || void 0,
2389
+ "aria-disabled": N(b) || void 0,
2390
+ onClick: te,
2391
+ onKeydown: B
2392
+ }, [
2393
+ d(X, {
2394
+ name: e.showDate ? "calendar" : "clock",
2395
+ class: "size-4 shrink-0 opacity-60"
2396
+ }, null, 8, ["name"]),
2397
+ c("span", { class: y(["flex-1 truncate", !N(A) && "opacity-60"]) }, j(N(A) || N(M)), 3),
2398
+ c("button", {
2399
+ type: "button",
2400
+ tabindex: "-1",
2401
+ "aria-label": "Очистить",
2402
+ "aria-hidden": !N(D) || void 0,
2403
+ disabled: !N(D),
2404
+ class: "flex size-4 shrink-0 cursor-pointer items-center justify-center opacity-60 outline-none hover:opacity-100 disabled:pointer-events-none disabled:opacity-0",
2405
+ onClick: re(ne, ["stop"])
2406
+ }, [d(X, { name: "close" })], 8, ea)
2407
+ ], 42, $i),
2408
+ e.name ? (S(), s("input", {
2409
+ key: 0,
2410
+ type: "hidden",
2411
+ name: e.name,
2412
+ value: n.value || ""
2413
+ }, null, 8, ta)) : o("", !0),
2414
+ d(mi, {
2415
+ open: N(I),
2416
+ trigger: N(l),
2417
+ "panel-id": N(v),
2418
+ "aria-label": e.ariaLabel || N(M),
2419
+ onClose: R,
2420
+ onConfirm: W
2421
+ }, {
2422
+ default: z(() => [
2423
+ c("div", na, [e.showDate ? (S(), a(Bi, {
2424
+ key: 0,
2425
+ selected: N(T),
2426
+ min: N(O),
2427
+ max: N(k),
2428
+ "locale-info": N(C),
2429
+ labels: N(ue),
2430
+ onSelect: H,
2431
+ onCommit: U
2432
+ }, null, 8, [
2433
+ "selected",
2434
+ "min",
2435
+ "max",
2436
+ "locale-info",
2437
+ "labels"
2438
+ ])) : o("", !0), e.showTime ? (S(), a(Ki, {
2439
+ key: 1,
2440
+ hour: N(T)?.hour ?? 0,
2441
+ minute: N(T)?.minute ?? 0,
2442
+ second: N(T)?.second ?? 0,
2443
+ "show-seconds": e.showSeconds,
2444
+ "disabled-hours": N(K),
2445
+ "disabled-minutes": N(q),
2446
+ labels: N(de),
2447
+ onChange: oe
2448
+ }, null, 8, [
2449
+ "hour",
2450
+ "minute",
2451
+ "second",
2452
+ "show-seconds",
2453
+ "disabled-hours",
2454
+ "disabled-minutes",
2455
+ "labels"
2456
+ ])) : o("", !0)]),
2457
+ e.showTimezone ? (S(), a(qr, {
2458
+ key: 0,
2459
+ modelValue: N(ce),
2460
+ "onUpdate:modelValue": r[0] ||= (e) => h(ce) ? ce.value = e : null,
2461
+ class: "w-full",
2462
+ filter: "",
2463
+ options: N(le),
2464
+ "aria-label": "Часовой пояс"
2465
+ }, null, 8, ["modelValue", "options"])) : o("", !0),
2466
+ d(Zi, {
2467
+ "show-date": e.showDate,
2468
+ "show-time": e.showTime,
2469
+ labels: N(J),
2470
+ onAction: fe
2471
+ }, null, 8, [
2472
+ "show-date",
2473
+ "show-time",
2474
+ "labels"
2475
+ ])
2476
+ ]),
2477
+ _: 1
2478
+ }, 8, [
2479
+ "open",
2480
+ "trigger",
2481
+ "panel-id",
2482
+ "aria-label"
2483
+ ])
2484
+ ]));
2485
+ }
2486
+ }), ia = ["innerHTML"], aa = /*#__PURE__*/ J(/* @__PURE__ */ f({
2487
+ __name: "SDocMarkdown",
2488
+ props: { html: {} },
2489
+ setup(e) {
2490
+ let t = E(null), n = {
2491
+ javascript: "js",
2492
+ js: "js",
2493
+ typescript: "ts",
2494
+ ts: "ts",
2495
+ vue: "vue",
2496
+ html: "html",
2497
+ xml: "xml",
2498
+ css: "css",
2499
+ scss: "css",
2500
+ sass: "css",
2501
+ json: "json",
2502
+ go: "go",
2503
+ golang: "go",
2504
+ bash: "bash",
2505
+ sh: "bash",
2506
+ shell: "bash",
2507
+ zsh: "bash",
2508
+ sql: "sql",
2509
+ yaml: "yaml",
2510
+ yml: "yaml",
2511
+ md: "md",
2512
+ markdown: "md"
2513
+ }, r = null, i = () => r ??= import("@speed-highlight/core"), a = (e) => e.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;"), o = async (e) => {
2514
+ let { highlightHTML: t } = await i(), n = e.split(/(<script\b[^>]*>[\s\S]*?<\/script>|<style\b[^>]*>[\s\S]*?<\/style>)/gi), r = [];
2515
+ for (let e of n) {
2516
+ let n = /^<script\b([^>]*)>([\s\S]*?)<\/script>$/i.exec(e);
2517
+ if (n) {
2518
+ let i = /lang=["']?(ts|typescript)["']?/i.test(n[1] ?? "") ? "ts" : "js", o = e.slice(0, e.indexOf(">") + 1);
2519
+ r.push(a(o), await t(n[2] ?? "", i, { block: !1 }), a("<\/script>"));
2520
+ continue;
2521
+ }
2522
+ let i = /^<style\b([^>]*)>([\s\S]*?)<\/style>$/i.exec(e);
2523
+ if (i) {
2524
+ let n = e.slice(0, e.indexOf(">") + 1);
2525
+ r.push(a(n), await t(i[2] ?? "", "css", { block: !1 }), a("</style>"));
2526
+ } else r.push(await t(e, "html", { block: !1 }));
2527
+ }
2528
+ return r.join("");
2529
+ }, c = async (e) => {
2530
+ let t = e.className.match(/language-([\w-]+)/)?.[1]?.toLowerCase(), r = t ? n[t] : void 0;
2531
+ if (!r || e.dataset.highlighted) return;
2532
+ e.dataset.highlighted = "true";
2533
+ let a = e.textContent ?? "";
2534
+ try {
2535
+ e.innerHTML = r === "vue" ? await o(a) : await (await i()).highlightHTML(a, r, { block: !1 });
2536
+ } catch {
2537
+ delete e.dataset.highlighted;
2538
+ }
2539
+ }, l = () => {
2540
+ t.value?.querySelectorAll("pre code").forEach((e) => void c(e));
2541
+ }, u = async (e) => {
2542
+ let t = e.target?.closest("[data-copy-code]");
2543
+ if (!t) return;
2544
+ let n = t.closest(".doc-code")?.querySelector("code");
2545
+ if (n) {
2546
+ try {
2547
+ await navigator.clipboard.writeText(n.textContent ?? ""), t.textContent = "скопировано";
2548
+ } catch {
2549
+ t.textContent = "не удалось";
2550
+ }
2551
+ window.setTimeout(() => {
2552
+ t.textContent = "копировать";
2553
+ }, 1500);
2554
+ }
2555
+ }, d = null;
2556
+ return ee(() => {
2557
+ l();
2558
+ let e = (e) => void u(e);
2559
+ t.value?.addEventListener("click", e), d = () => t.value?.removeEventListener("click", e);
2560
+ }), x(() => d?.()), (n, r) => (S(), s("div", {
2561
+ ref_key: "root",
2562
+ ref: t,
2563
+ innerHTML: e.html
2564
+ }, null, 8, ia));
2565
+ }
2566
+ }), [["__scopeId", "data-v-71a37e31"]]), oa = {
2567
+ wrapper: "space-y-2",
2568
+ label: "text-xs text-(--accent)"
2569
+ }, sa = /* @__PURE__ */ f({
2570
+ __name: "SField",
2571
+ props: { label: {} },
2572
+ setup(e) {
2573
+ return (t, n) => (S(), s("div", { class: y(oa.wrapper) }, [e.label ? (S(), s("div", {
2574
+ key: 0,
2575
+ class: y(oa.label)
2576
+ }, j(e.label), 3)) : o("", !0), O(t.$slots, "default")], 2));
2577
+ }
2578
+ }), ca = (e, t) => {
2579
+ if (!Number.isFinite(e) || !Array.isArray(t) || t.length !== 3 || t.some((e) => typeof e != "string")) throw TypeError("Invalid arguments");
2580
+ let n = Math.abs(e), r = n % 10, i = n % 100;
2581
+ return n % 1 == 0 ? i >= 11 && i <= 19 ? t[2] : r === 1 ? t[0] : r >= 2 && r <= 4 ? t[1] : t[2] : t[1];
2582
+ }, la = [
2583
+ "id",
2584
+ "name",
2585
+ "accept",
2586
+ "multiple",
2587
+ "disabled"
2588
+ ], ua = {
2589
+ wrapper: "flex flex-col items-start gap-2",
2590
+ list: "flex max-h-32 flex-col gap-1 overflow-auto",
2591
+ item: "flex items-center justify-between gap-2 bg-(--elevated) px-2 py-1 text-sm text-(--text-default)",
2592
+ fileName: "min-w-0 wrap-break-word",
2593
+ removeBtn: "cursor-pointer hover:bg-(--danger)"
2594
+ }, da = /* @__PURE__ */ f({
2595
+ __name: "SFile",
2596
+ props: /*@__PURE__*/ g({
2597
+ id: {},
2598
+ name: {},
2599
+ accept: {},
2600
+ buttonLabel: { default: "" },
2601
+ count: {},
2602
+ disabled: {
2603
+ type: Boolean,
2604
+ default: !1
2605
+ },
2606
+ loading: {
2607
+ type: Boolean,
2608
+ default: !1
2609
+ },
2610
+ multiple: {
2611
+ type: Boolean,
2612
+ default: !1
2613
+ },
2614
+ showList: {
2615
+ type: Boolean,
2616
+ default: !0
2617
+ }
2618
+ }, {
2619
+ modelValue: { default: () => [] },
2620
+ modelModifiers: {}
2621
+ }),
2622
+ emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
2623
+ setup(e, { expose: t, emit: r }) {
2624
+ let a = F(e, "modelValue"), l = r, u = m("field-id", void 0), f = P(), p = i(() => e.id || u || `file-${f}`), h = E(null), g = i(() => e.buttonLabel || (e.multiple ? "Выбрать файлы" : "Выбрать файл")), _ = i(() => {
2625
+ let t = e.loading && a.value.length ? a.value.length : Number(e.count || 0) || a.value.length;
2626
+ return t ? e.multiple ? `${t} ${ca(t, [
2627
+ "файл",
2628
+ "файла",
2629
+ "файлов"
2630
+ ])}` : a.value[0]?.name || g.value : g.value;
2631
+ }), v = i(() => e.loading ? "load" : e.disabled ? "disabled" : "idle"), b = () => {
2632
+ !e.disabled && !e.loading && h.value?.click();
2633
+ }, x = (e) => {
2634
+ let t = e.target, n = Array.from(t.files ?? []);
2635
+ a.value = n, l("change", e, n), t.value = "";
2636
+ }, ee = (e) => {
2637
+ a.value = a.value.filter((t, n) => n !== e);
2638
+ }, C = () => {
2639
+ a.value = [], h.value && (h.value.value = "");
2640
+ };
2641
+ return t({
2642
+ reset: C,
2643
+ files: a
2644
+ }), R(() => e.loading, (t) => {
2645
+ !t && !e.showList && C();
2646
+ }), (t, r) => (S(), s("div", { class: y(ua.wrapper) }, [
2647
+ c("input", {
2648
+ id: N(p),
2649
+ ref_key: "inputRef",
2650
+ ref: h,
2651
+ name: e.name,
2652
+ accept: e.accept,
2653
+ multiple: e.multiple,
2654
+ disabled: e.disabled || e.loading,
2655
+ type: "file",
2656
+ class: "sr-only",
2657
+ tabindex: "-1",
2658
+ "aria-hidden": "true",
2659
+ onChange: x
2660
+ }, null, 40, la),
2661
+ d(Cr, {
2662
+ label: N(_),
2663
+ state: N(v),
2664
+ onClick: b
2665
+ }, null, 8, ["label", "state"]),
2666
+ e.showList && a.value.length && e.multiple ? (S(), s("div", {
2667
+ key: 0,
2668
+ class: y(ua.list)
2669
+ }, [(S(!0), s(n, null, D(a.value, (e, t) => (S(), s("div", {
2670
+ key: e.name + t,
2671
+ class: y(ua.item)
2672
+ }, [c("span", { class: y(ua.fileName) }, j(e.name), 3), d(Cr, {
2673
+ class: y(ua.removeBtn),
2674
+ state: N(v),
2675
+ label: "Удалить",
2676
+ onClick: (e) => ee(t)
2677
+ }, null, 8, [
2678
+ "class",
2679
+ "state",
2680
+ "onClick"
2681
+ ])], 2))), 128))], 2)) : o("", !0)
2682
+ ], 2));
2683
+ }
2684
+ }), fa = ["id", "aria-disabled"], pa = [
2685
+ "aria-checked",
2686
+ "aria-label",
2687
+ "disabled",
2688
+ "title",
2689
+ "onClick"
2690
+ ], ma = ["name", "value"], ha = {
2691
+ wrapper: "inline-flex flex-col gap-1 w-fit",
2692
+ wrapperDisabled: "opacity-50",
2693
+ grid: "grid gap-1",
2694
+ button: "ui-focus flex h-6 min-w-6 items-center justify-center",
2695
+ buttonDisabled: "cursor-not-allowed",
2696
+ buttonEnabled: "cursor-pointer",
2697
+ bar: "h-2 w-full",
2698
+ barActive: "bg-(--accent)",
2699
+ barInactive: "bg-(--elevated)",
2700
+ srOnly: "sr-only",
2701
+ optionLabel: "truncate text-center text-xs",
2702
+ optionLabelActive: "text-(--accent)",
2703
+ optionLabelInactive: "opacity-70"
2704
+ }, ga = /* @__PURE__ */ f({
2705
+ __name: "SGradation",
2706
+ props: /*@__PURE__*/ g({
2707
+ options: { default: () => [] },
2708
+ id: {},
2709
+ name: {},
2710
+ disabled: {
2711
+ type: Boolean,
2712
+ default: !1
2713
+ },
2714
+ clearValue: { default: "" }
2715
+ }, {
2716
+ modelValue: { default: "" },
2717
+ modelModifiers: {}
2718
+ }),
2719
+ emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
2720
+ setup(e, { emit: t }) {
2721
+ let r = F(e, "modelValue"), a = t, l = P(), u = i(() => e.id || `gradation-${l}`), d = i(() => String(r.value ?? "").trim()), f = i(() => e.options.map((e, t) => ({
2722
+ value: String(e.value).trim(),
2723
+ label: e.label?.trim() || `Уровень ${t + 1}`
2724
+ })).filter((e) => e.value)), p = i(() => f.value.findIndex((e) => e.value === d.value)), m = i(() => ({ gridTemplateColumns: `repeat(${f.value.length}, minmax(1.5rem, 1fr))` })), h = (t) => {
2725
+ if (e.disabled) return;
2726
+ let n = t === d.value ? e.clearValue : t;
2727
+ r.value = n, a("change", n);
2728
+ }, g = i(() => [ha.wrapper, e.disabled && ha.wrapperDisabled]), _ = i(() => [ha.button, e.disabled ? ha.buttonDisabled : ha.buttonEnabled]), v = (e) => [ha.bar, p.value >= 0 && e <= p.value ? ha.barActive : ha.barInactive], x = (e) => [ha.optionLabel, e.value === d.value ? ha.optionLabelActive : ha.optionLabelInactive];
2729
+ return (t, r) => (S(), s("div", { class: y(N(g)) }, [
2730
+ c("div", {
2731
+ id: N(u),
2732
+ "aria-disabled": e.disabled ? "true" : "false",
2733
+ "aria-label": "Градация",
2734
+ class: y(ha.grid),
2735
+ style: b(N(m)),
2736
+ role: "radiogroup"
2737
+ }, [(S(!0), s(n, null, D(N(f), (t, n) => (S(), s("button", {
2738
+ key: t.value,
2739
+ "aria-checked": t.value === N(d) ? "true" : "false",
2740
+ "aria-label": t.label,
2741
+ disabled: e.disabled,
2742
+ title: t.label,
2743
+ class: y(N(_)),
2744
+ role: "radio",
2745
+ type: "button",
2746
+ onClick: (e) => h(t.value)
2747
+ }, [c("span", { class: y(v(n)) }, null, 2), c("span", { class: y(ha.srOnly) }, j(t.label), 3)], 10, pa))), 128))], 14, fa),
2748
+ c("div", {
2749
+ class: y(ha.grid),
2750
+ style: b(N(m))
2751
+ }, [(S(!0), s(n, null, D(N(f), (e) => (S(), s("span", {
2752
+ key: `label-${e.value}`,
2753
+ class: y(x(e))
2754
+ }, j(e.label), 3))), 128))], 6),
2755
+ e.name ? (S(), s("input", {
2756
+ key: 0,
2757
+ type: "hidden",
2758
+ name: e.name,
2759
+ value: N(d)
2760
+ }, null, 8, ma)) : o("", !0)
2761
+ ], 2));
2762
+ }
2763
+ }), _a = ["aria-label"], va = ["src", "alt"], ya = { class: "truncate" }, ba = ["aria-label"], xa = { class: "relative min-h-0 flex-1" }, Sa = ["src", "alt"], Ca = [
2764
+ "data-thumb-index",
2765
+ "aria-label",
2766
+ "aria-current",
2767
+ "onClick"
2768
+ ], wa = ["src", "alt"], Q = {
2769
+ trigger: "group relative block w-full max-w-full cursor-pointer overflow-hidden bg-(--elevated) p-0 text-left outline-none focus-visible:ring-2 focus-visible:ring-(--accent)",
2770
+ triggerImage: "aspect-4/3 w-full object-cover transition-transform duration-200 group-hover:scale-105",
2771
+ badge: "pointer-events-none absolute top-0 right-0 z-1 flex size-7 items-center justify-center bg-zinc-950/70 text-white opacity-80 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",
2772
+ triggerLabel: "pointer-events-none absolute inset-x-0 bottom-0 flex items-center justify-center gap-1.5 bg-zinc-950/70 p-2 text-xs font-medium text-white opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",
2773
+ overlay: "fixed inset-0 z-60 flex flex-col bg-(--bg-default) text-(--text-default)",
2774
+ toolbar: "relative z-10 flex shrink-0 items-center gap-2 overflow-x-auto px-2 py-1",
2775
+ meta: "text-xs whitespace-nowrap tabular-nums opacity-60",
2776
+ iconButton: "inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-full text-(--text-default) transition-colors select-none hover:bg-(--default-hover) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--accent)",
2777
+ closeButton: "inline-flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-full px-2 text-xs font-medium text-(--text-default) transition-colors select-none hover:bg-(--default-hover) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--accent)",
2778
+ stage: "absolute inset-0 bg-(--bg-default)",
2779
+ fitWrapper: "flex h-full w-full items-center justify-center",
2780
+ originalWrapper: "flex h-max w-max min-h-full min-w-full items-center justify-center",
2781
+ nav: "absolute inset-y-0 z-20 hidden w-16 cursor-pointer items-center justify-center text-(--text-default) bg-(--default-hover)/30 opacity-80 transition-colors select-none hover:bg-(--default-hover)/60 hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--accent) focus-visible:ring-inset md:flex",
2782
+ bottom: "relative z-10 flex shrink-0 flex-col gap-2 bg-(--bg-default) p-2",
2783
+ tools: "flex items-center justify-center gap-1",
2784
+ thumbs: "min-w-0 overflow-x-auto",
2785
+ thumbsRow: "flex min-w-max gap-2",
2786
+ thumb: "relative size-16 shrink-0 cursor-pointer overflow-hidden bg-(--elevated) p-0 opacity-70 transition-opacity select-none hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--accent)",
2787
+ thumbImage: "size-full object-cover",
2788
+ spinner: "pointer-events-none absolute inset-0 flex items-center justify-center"
2789
+ }, Ta = /* @__PURE__ */ f({
2790
+ __name: "SImage",
2791
+ props: /*@__PURE__*/ g({
2792
+ src: { default: "" },
2793
+ title: { default: "" },
2794
+ alt: { default: "" },
2795
+ items: { default: () => [] },
2796
+ groups: { default: () => [] },
2797
+ initialIndex: { default: 0 },
2798
+ trigger: {
2799
+ type: Boolean,
2800
+ default: !0
2801
+ },
2802
+ triggerLabel: { default: "Открыть" },
2803
+ routeSync: {
2804
+ type: Boolean,
2805
+ default: !1
2806
+ },
2807
+ galleryName: { default: "" },
2808
+ wrap: {
2809
+ type: Boolean,
2810
+ default: !0
2811
+ },
2812
+ groupSwitching: {
2813
+ type: Boolean,
2814
+ default: !1
2815
+ }
2816
+ }, {
2817
+ modelValue: {
2818
+ type: Boolean,
2819
+ default: !1
2820
+ },
2821
+ modelModifiers: {}
2822
+ }),
2823
+ emits: /*@__PURE__*/ g([
2824
+ "change",
2825
+ "group-change",
2826
+ "group-previous",
2827
+ "group-next",
2828
+ "open",
2829
+ "close"
2830
+ ], ["update:modelValue"]),
2831
+ setup(e, { expose: t, emit: l }) {
2832
+ let u = F(e, "modelValue"), f = i(() => N(e.items) ?? []), p = i(() => N(e.groups) ?? []), m = cr(), h = sr(), g = E(!1), _ = l, C = E(Math.max(0, Math.trunc(e.initialIndex))), T = E(0), k = E("fit"), A = E(!1), M = E(0), P = w({
2833
+ x: 1,
2834
+ y: 1
2835
+ }), I = w({
2836
+ width: 0,
2837
+ height: 0
2838
+ }), L = w({}), B = w({
2839
+ width: 0,
2840
+ height: 0
2841
+ }), V = (e) => !Number.isFinite(e) || e <= 0 ? "" : e > 1022976 ? `${(e / 1024 / 1024).toFixed(1)}мб` : `${(e / 1024).toFixed(1)}кб`, ie = i(() => {
2842
+ let e = Y.value;
2843
+ if (!e) return null;
2844
+ let t = e.fileSize ?? e.size ?? L[e.src];
2845
+ return typeof t == "number" && t > 0 ? t : null;
2846
+ }), ae = async (e) => {
2847
+ if (typeof window > "u" || !e || L[e] && L[e] > 0) return;
2848
+ let t = (() => {
2849
+ try {
2850
+ return new URL(e, window.location.href).href;
2851
+ } catch {
2852
+ return e;
2853
+ }
2854
+ })();
2855
+ for (let n of [t, e]) {
2856
+ let t = performance.getEntriesByName(n, "resource").at(-1), r = t?.decodedBodySize || t?.encodedBodySize || 0;
2857
+ if (r > 0) {
2858
+ L[e] = r;
2859
+ return;
2860
+ }
2861
+ }
2862
+ try {
2863
+ let t = await fetch(e, { method: "HEAD" }), n = Number(t.headers.get("content-length"));
2864
+ if (Number.isFinite(n) && n > 0) {
2865
+ L[e] = n;
2866
+ return;
2867
+ }
2868
+ } catch {}
2869
+ try {
2870
+ let t = await fetch(e, { headers: { Range: "bytes=0-0" } }), n = t.headers.get("content-range")?.match(/\/(\d+)\s*$/), r = n ? Number(n[1]) : NaN;
2871
+ if (Number.isFinite(r) && r > 0) {
2872
+ L[e] = r;
2873
+ return;
2874
+ }
2875
+ let i = Number(t.headers.get("content-length"));
2876
+ if (Number.isFinite(i) && i > 0) {
2877
+ L[e] = i;
2878
+ return;
2879
+ }
2880
+ } catch {}
2881
+ L[e] = 0;
2882
+ }, H = w({
2883
+ startX: 0,
2884
+ startY: 0,
2885
+ left: 0,
2886
+ top: 0,
2887
+ tracking: !1
2888
+ }), U = w({
2889
+ startX: 0,
2890
+ startY: 0,
2891
+ deltaX: 0,
2892
+ deltaY: 0,
2893
+ tracking: !1
2894
+ }), W = w({
2895
+ active: !1,
2896
+ startDistance: 0,
2897
+ startScale: 1
2898
+ }), oe = E(1), G = E(!1), K = E(null), q = E(null), se = E(null), ce = E(null), le = w({
2899
+ left: !1,
2900
+ right: !1,
2901
+ top: !1,
2902
+ bottom: !1
2903
+ }), J = w({
2904
+ left: !1,
2905
+ right: !1,
2906
+ top: !1,
2907
+ bottom: !1
2908
+ }), ue = w({
2909
+ left: !1,
2910
+ right: !1,
2911
+ top: !1,
2912
+ bottom: !1
2913
+ }), de = E(""), fe = null, pe = null, me = (e) => {
2914
+ let t = [];
2915
+ return (e ?? []).forEach((e, n) => {
2916
+ let r = String(e?.src ?? "").trim();
2917
+ if (!r) return;
2918
+ let i = String(e?.title ?? "").trim(), a = String(e?.alt ?? "").trim(), o = String(e?.thumbnailSrc ?? "").trim();
2919
+ t.push({
2920
+ src: r,
2921
+ title: i || void 0,
2922
+ alt: a || i || `Изображение ${n + 1}`,
2923
+ thumbnailSrc: o || void 0
2924
+ });
2925
+ }), t;
2926
+ }, he = i(() => {
2927
+ let t = (p.value ?? []).map(me).filter((e) => e.length);
2928
+ if (t.length) return t;
2929
+ let n = me(f.value ?? []);
2930
+ if (n.length) return [n];
2931
+ let r = String(e.src ?? "").trim();
2932
+ return r ? [[{
2933
+ src: r,
2934
+ title: e.title || void 0,
2935
+ alt: String(e.alt ?? "").trim() || e.title || "Изображение"
2936
+ }]] : [];
2937
+ }), ge = i(() => he.value[T.value] ?? []), _e = i(() => he.value.length), Y = i(() => ge.value[C.value] || null), ve = (e) => {
2938
+ let t = (String(e.src ?? "").split("?")[0] || "").split("/").pop() || "", n = t;
2939
+ try {
2940
+ n = decodeURIComponent(t);
2941
+ } catch {}
2942
+ return n.replace(/\.[a-z0-9]+$/i, "");
2943
+ }, ye = i(() => {
2944
+ let e = m.value.match(/\/g\/([^/]+)\/([^/]+)$/);
2945
+ return !e?.[1] || !e[2] ? null : {
2946
+ name: decodeURIComponent(e[1]),
2947
+ image: decodeURIComponent(e[2])
2948
+ };
2949
+ }), be = i(() => {
2950
+ if (!e.routeSync || !ge.value.length || !ye.value || ye.value.name !== e.galleryName.trim()) return null;
2951
+ let t = ge.value.findIndex((e) => ve(e) === ye.value?.image);
2952
+ return t >= 0 ? t : null;
2953
+ }), xe = i(() => !(!u.value && be.value === null || !Y.value?.src)), Se = i(() => {
2954
+ let e = Y.value;
2955
+ return e ? k.value === "original" || B.width >= 532 && B.height >= 532 ? e.src : e.thumbnailSrc || e.src : "";
2956
+ }), Ce = async (t) => {
2957
+ if (!e.routeSync || typeof window > "u") return;
2958
+ let n = e.galleryName.trim();
2959
+ if (!n) return;
2960
+ let r = t === null ? null : ge.value[t], i = r ? ve(r) : null, a = m.value.replace(/\/g\/[^/]+\/[^/]+$/, ""), o = i ? `${a}/g/${encodeURIComponent(n)}/${encodeURIComponent(i)}` : a;
2961
+ if (h && m.value !== o) {
2962
+ g.value = !0;
2963
+ try {
2964
+ await h.replace(o + window.location.search + window.location.hash);
2965
+ } finally {
2966
+ g.value = !1;
2967
+ }
2968
+ }
2969
+ }, we = i(() => ge.value.length > 1), Te = i(() => Y.value?.title || e.title), Ee = i(() => I.width > 0 && I.height > 0), De = i(() => Math.abs(M.value) / 90 % 2 == 1), Oe = i(() => ({
2970
+ width: De.value ? I.height : I.width,
2971
+ height: De.value ? I.width : I.height
2972
+ })), ke = i(() => !Oe.value.width || !Oe.value.height || !B.width || !B.height ? 1 : Math.min(1, Math.max(0, B.width - 20) / Oe.value.width, Math.max(0, B.height - 20) / Oe.value.height)), Ae = i(() => k.value === "fit" ? ke.value : oe.value), je = i(() => !!(A.value && Oe.value.width && Oe.value.height && B.width && B.height && (Oe.value.width > B.width - 20 || Oe.value.height > B.height - 20))), Me = i(() => k.value === "original" && je.value), Ne = i(() => !Me.value), Pe = i(() => U.tracking && U.deltaX ? { transform: `translate3d(${U.deltaX}px, 0, 0)` } : void 0), Fe = i(() => A.value ? `${Math.round(Ae.value * 100)}%` : "…"), Ie = i(() => {
2973
+ if (!Ee.value) return "";
2974
+ let e = [`${I.width}x${I.height}`], t = ie.value;
2975
+ if (t) {
2976
+ let n = V(t);
2977
+ n && e.push(n);
2978
+ }
2979
+ return e.join(" ");
2980
+ }), Le = i(() => Ee.value ? {
2981
+ width: `${Math.max(1, Math.round(Oe.value.width * Ae.value))}px`,
2982
+ height: `${Math.max(1, Math.round(Oe.value.height * Ae.value))}px`,
2983
+ flex: "0 0 auto"
2984
+ } : {
2985
+ width: "100%",
2986
+ height: "100%"
2987
+ }), Re = i(() => Ee.value ? {
2988
+ position: "absolute",
2989
+ left: "50%",
2990
+ top: "50%",
2991
+ width: `${Math.max(1, Math.round(I.width * Ae.value))}px`,
2992
+ height: `${Math.max(1, Math.round(I.height * Ae.value))}px`,
2993
+ maxWidth: "none",
2994
+ maxHeight: "none",
2995
+ transform: `translate(-50%, -50%) rotate(${M.value}deg) scale(${P.x}, ${P.y})`,
2996
+ transformOrigin: "center center"
2997
+ } : {
2998
+ position: "absolute",
2999
+ inset: "0",
3000
+ width: "100%",
3001
+ height: "100%",
3002
+ objectFit: "contain"
3003
+ }), ze = (e) => {
3004
+ let t = e % 360;
3005
+ return t < 0 ? t + 360 : t;
3006
+ }, Be = () => {
3007
+ let e = q.value;
3008
+ e && (B.width = e.clientWidth, B.height = e.clientHeight);
3009
+ }, Ve = (e) => {
3010
+ e.left = !1, e.right = !1, e.top = !1, e.bottom = !1;
3011
+ }, He = (e, t, n) => {
3012
+ if (!e) return Ve(t);
3013
+ let r = n === "x" || n === "both", i = n === "y" || n === "both";
3014
+ t.left = r && e.scrollLeft > 2, t.right = r && e.scrollLeft < Math.max(0, e.scrollWidth - e.clientWidth) - 2, t.top = i && e.scrollTop > 2, t.bottom = i && e.scrollTop < Math.max(0, e.scrollHeight - e.clientHeight) - 2;
3015
+ }, Ue = () => {
3016
+ He(se.value, le, "x"), He(q.value, J, "both"), He(ce.value, ue, "x");
3017
+ }, We = () => {
3018
+ typeof window < "u" && (fe?.disconnect(), q.value && fe?.observe(q.value), Be());
3019
+ }, Ge = () => {
3020
+ let e = K.value;
3021
+ e?.complete && e.naturalWidth && (I.width = e.naturalWidth, I.height = e.naturalHeight, A.value = !0, Be());
3022
+ }, Ke = () => {
3023
+ let e = se.value;
3024
+ if (!e || !we.value) return;
3025
+ let t = e.querySelector(`[data-thumb-index="${C.value}"]`);
3026
+ t && e.scrollTo({
3027
+ left: Math.max(0, t.offsetLeft - Math.max(0, (e.clientWidth - t.offsetWidth) / 2)),
3028
+ behavior: "smooth"
3029
+ });
3030
+ }, qe = () => {
3031
+ let e = q.value;
3032
+ e && k.value === "original" && (e.scrollLeft = Math.max(0, Math.round((e.scrollWidth - e.clientWidth) / 2)), e.scrollTop = Math.max(0, Math.round((e.scrollHeight - e.clientHeight) / 2)));
3033
+ }, Je = (e) => {
3034
+ let t = ge.value.length;
3035
+ if (!t) return;
3036
+ let n = (Math.trunc(e) % t + t) % t;
3037
+ n !== C.value && (C.value = n, _("change", n), u.value && Ce(n));
3038
+ }, Ye = (e) => {
3039
+ let t = ge.value.length;
3040
+ if (!t) return;
3041
+ let n = (Math.trunc(e) % t + t) % t;
3042
+ C.value = n, _("change", n), u.value && Ce(n);
3043
+ }, Xe = (e) => {
3044
+ ge.value.length && (typeof e == "number" && Je(e), u.value = !0, Ce(C.value));
3045
+ }, Ze = () => {
3046
+ u.value = !1, Ce(null);
3047
+ }, Qe = () => {
3048
+ we.value && Je(C.value - 1);
3049
+ }, $e = () => {
3050
+ we.value && Je(C.value + 1);
3051
+ }, et = (e) => {
3052
+ let t = _e.value;
3053
+ t > 1 && (T.value = ((T.value + e) % t + t) % t, C.value = 0, tt(), _("change", 0), _("group-change", T.value)), _(e > 0 ? "group-next" : "group-previous");
3054
+ }, tt = () => {
3055
+ k.value = "fit", M.value = 0, P.x = 1, P.y = 1, oe.value = 1, W.active = !1;
3056
+ }, nt = () => {
3057
+ je.value && (k.value === "original" && (oe.value = 1), k.value = k.value === "fit" ? "original" : "fit", v(() => k.value === "original" ? qe() : q.value?.scrollTo({
3058
+ top: 0,
3059
+ left: 0
3060
+ })));
3061
+ }, rt = (e) => {
3062
+ M.value = ze(M.value + e), v(qe);
3063
+ }, it = (e) => {
3064
+ P[e] *= -1;
3065
+ }, at = (e) => {
3066
+ let t = e.target;
3067
+ t && (I.width = t.naturalWidth || 0, I.height = t.naturalHeight || 0, A.value = !0, k.value = "fit", Be(), Ke());
3068
+ }, ot = () => {
3069
+ typeof window < "u" && (window.removeEventListener("mousemove", st), window.removeEventListener("mouseup", ct)), H.tracking = !1;
3070
+ }, st = (e) => {
3071
+ let t = q.value;
3072
+ if (!H.tracking || !t || k.value !== "original" || !(e.buttons & 1)) return ot();
3073
+ let n = e.clientX - H.startX, r = e.clientY - H.startY;
3074
+ !G.value && Math.abs(n) + Math.abs(r) > 4 && (G.value = !0, e.preventDefault()), t.scrollLeft = H.left - n, t.scrollTop = H.top - r;
3075
+ }, ct = () => {
3076
+ let e = G.value;
3077
+ ot(), e && typeof window < "u" && (pe !== null && window.clearTimeout(pe), pe = window.setTimeout(() => {
3078
+ G.value = !1, pe = null;
3079
+ }, 0));
3080
+ }, lt = (e) => {
3081
+ let t = q.value;
3082
+ k.value === "original" && je.value && t && e.button === 0 && (H.startX = e.clientX, H.startY = e.clientY, H.left = t.scrollLeft, H.top = t.scrollTop, H.tracking = !0, typeof window < "u" && (window.addEventListener("mousemove", st), window.addEventListener("mouseup", ct)));
3083
+ }, ut = () => {
3084
+ G.value || nt();
3085
+ }, dt = (e) => {
3086
+ let t = e[0], n = e[1];
3087
+ return !t || !n ? 0 : Math.hypot(n.clientX - t.clientX, n.clientY - t.clientY);
3088
+ }, ft = () => {
3089
+ U.startX = 0, U.startY = 0, U.deltaX = 0, U.deltaY = 0, U.tracking = !1, W.active = !1;
3090
+ }, pt = (e) => {
3091
+ if (e.touches.length >= 2) {
3092
+ if (ft(), k.value !== "original" || !je.value) return;
3093
+ W.active = !0, W.startDistance = dt(e.touches), W.startScale = oe.value;
3094
+ return;
3095
+ }
3096
+ let t = e.touches[0];
3097
+ if (!t || !Ne.value) return ft();
3098
+ U.startX = t.clientX, U.startY = t.clientY, U.deltaX = 0, U.deltaY = 0, U.tracking = !0;
3099
+ }, mt = (e) => {
3100
+ if (W.active) {
3101
+ if (e.touches.length < 2 || !W.startDistance) return;
3102
+ let t = dt(e.touches);
3103
+ oe.value = Math.min(4, Math.max(1, W.startScale * t / W.startDistance)), e.cancelable && e.preventDefault();
3104
+ return;
3105
+ }
3106
+ if (Me.value) return;
3107
+ let t = e.touches[0];
3108
+ t && U.tracking && Ne.value && (U.deltaX = t.clientX - U.startX, U.deltaY = t.clientY - U.startY, Math.abs(U.deltaX) > Math.abs(U.deltaY) && Math.abs(U.deltaX) > 12 && e.cancelable && e.preventDefault());
3109
+ }, ht = () => {
3110
+ if (W.active) {
3111
+ W.active = !1, oe.value <= 1.02 && (oe.value = 1);
3112
+ return;
3113
+ }
3114
+ if (!U.tracking || !Ne.value) return ft();
3115
+ let e = Math.abs(U.deltaX) > Math.abs(U.deltaY), t = we.value && e && Math.abs(U.deltaX) >= 56, n = !e && Math.abs(U.deltaY) >= 56, r = U.deltaX < 0 ? 1 : -1, i = U.deltaY < 0 ? 1 : -1;
3116
+ ft(), n ? et(i) : t && (r > 0 ? $e() : Qe());
3117
+ }, gt = (e) => {
3118
+ if (G.value) return;
3119
+ let t = e.target;
3120
+ t && (t.closest("img, button, a, [data-no-close]") || Ze());
3121
+ }, _t = (e) => {
3122
+ if (u.value) {
3123
+ if (e.key === "Escape") return Ze();
3124
+ if (e.key === "ArrowLeft") return Qe();
3125
+ if (e.key === "ArrowRight") return $e();
3126
+ if (e.key === "ArrowUp") return et(-1);
3127
+ if (e.key === "ArrowDown") return et(1);
3128
+ }
3129
+ };
3130
+ R(u, async (e) => {
3131
+ typeof window < "u" && (e ? (de.value = document.body.style.overflow, document.body.style.overflow = "hidden", _("open"), await v(), We(), vt(), Ue(), Ge(), Ke(), Ce(C.value)) : (document.body.style.overflow = de.value, ot(), ft(), tt(), Ce(null), _("close")));
3132
+ }), R(be, (t) => {
3133
+ if (!g.value) {
3134
+ if (t === null) {
3135
+ if (e.groupSwitching) return;
3136
+ if (u.value && ge.value.length > 0) {
3137
+ Ce(C.value);
3138
+ return;
3139
+ }
3140
+ u.value &&= !1;
3141
+ } else C.value !== t && (C.value = t), u.value ||= !0, Ce(t);
3142
+ }
3143
+ }, { immediate: !0 }), R(() => Y.value?.src, (e) => {
3144
+ A.value = !1, tt(), e && ae(e), v(() => {
3145
+ Ge(), Ke(), Ue();
3146
+ });
3147
+ }), R(Se, (e) => {
3148
+ e && (A.value = !1, v(() => {
3149
+ Ge(), Ue();
3150
+ }));
3151
+ }), R(Ie, () => v(Ue)), R(() => ge.value, (e) => {
3152
+ e.length ? C.value >= e.length && (C.value = 0) : u.value && Ze();
3153
+ }), R(_e, (e) => {
3154
+ T.value > e - 1 && (T.value = Math.max(0, e - 1));
3155
+ }), R(() => e.initialIndex, (e) => {
3156
+ u.value || (C.value = Math.max(0, Math.trunc(e)));
3157
+ }), ee(() => {
3158
+ typeof window < "u" && (window.addEventListener("keydown", _t), fe = new ResizeObserver(() => {
3159
+ Be(), Ue();
3160
+ }), u.value && We(), Ue(), Ge(), Y.value?.src && ae(Y.value.src), v(() => {
3161
+ Ge(), Ke();
3162
+ }));
3163
+ });
3164
+ let vt = () => {
3165
+ typeof window < "u" && [
3166
+ se.value,
3167
+ q.value,
3168
+ ce.value
3169
+ ].forEach((e) => {
3170
+ e && e.addEventListener("scroll", Ue, { passive: !0 });
3171
+ });
3172
+ };
3173
+ return x(() => {
3174
+ typeof window < "u" && (window.removeEventListener("keydown", _t), fe?.disconnect(), ot(), ft(), pe !== null && window.clearTimeout(pe), u.value && (document.body.style.overflow = de.value));
3175
+ }), t({
3176
+ open: Xe,
3177
+ close: Ze,
3178
+ goTo: Ye
3179
+ }), (t, i) => (S(), s(n, null, [e.trigger && N(Y) ? (S(), s("button", {
3180
+ key: 0,
3181
+ type: "button",
3182
+ class: y(Q.trigger),
3183
+ "aria-label": `${e.triggerLabel}: ${N(Y).alt || ""}`,
3184
+ onClick: i[0] ||= (e) => Xe()
3185
+ }, [
3186
+ c("img", {
3187
+ src: N(Y).thumbnailSrc || N(Y).src,
3188
+ alt: N(Y).alt,
3189
+ class: y(Q.triggerImage),
3190
+ loading: "lazy",
3191
+ decoding: "async"
3192
+ }, null, 10, va),
3193
+ c("span", {
3194
+ class: y(Q.badge),
3195
+ "aria-hidden": "true"
3196
+ }, [d(X, {
3197
+ name: "expand",
3198
+ class: "size-4"
3199
+ })], 2),
3200
+ c("span", { class: y(Q.triggerLabel) }, [d(X, {
3201
+ name: "expand",
3202
+ class: "size-4"
3203
+ }), c("span", ya, j(e.triggerLabel), 1)], 2)
3204
+ ], 10, _a)) : o("", !0), N(xe) ? (S(), a(r, {
3205
+ key: 1,
3206
+ to: "body"
3207
+ }, [c("div", {
3208
+ class: y(Q.overlay),
3209
+ role: "dialog",
3210
+ "aria-modal": "true",
3211
+ "aria-label": N(Te) || N(Y)?.alt || "Изображение"
3212
+ }, [
3213
+ d(Rr, {
3214
+ active: N(ue),
3215
+ axis: "x",
3216
+ class: "shrink-0"
3217
+ }, {
3218
+ default: z(() => [c("div", {
3219
+ ref_key: "toolbarRef",
3220
+ ref: ce,
3221
+ class: y(Q.toolbar)
3222
+ }, [
3223
+ i[7] ||= c("div", { class: "flex-1" }, null, -1),
3224
+ N(Te) ? (S(), s("span", {
3225
+ key: 0,
3226
+ class: y([Q.meta, "hidden max-w-40 truncate sm:block"])
3227
+ }, j(N(Te)), 3)) : o("", !0),
3228
+ N(_e) > 1 ? (S(), s("span", {
3229
+ key: 1,
3230
+ class: y(Q.meta)
3231
+ }, j(N(T) + 1) + " / " + j(N(_e)), 3)) : o("", !0),
3232
+ N(Ie) ? (S(), s("span", {
3233
+ key: 2,
3234
+ class: y(Q.meta)
3235
+ }, j(N(Ie)), 3)) : o("", !0),
3236
+ c("span", { class: y(Q.meta) }, j(N(Fe)), 3),
3237
+ O(t.$slots, "toolbar-start", {
3238
+ index: N(C),
3239
+ item: N(Y)
3240
+ }),
3241
+ c("button", {
3242
+ type: "button",
3243
+ class: y(Q.closeButton),
3244
+ "aria-label": "Закрыть",
3245
+ onClick: Ze
3246
+ }, [d(X, {
3247
+ name: "close",
3248
+ class: "size-4"
3249
+ }), i[6] ||= c("span", { class: "hidden sm:inline" }, "Закрыть", -1)], 2)
3250
+ ], 2)]),
3251
+ _: 3
3252
+ }, 8, ["active"]),
3253
+ c("div", xa, [
3254
+ d(Rr, {
3255
+ active: N(J),
3256
+ axis: "both",
3257
+ class: "h-full"
3258
+ }, {
3259
+ default: z(() => [c("div", {
3260
+ ref_key: "stageRef",
3261
+ ref: q,
3262
+ class: y([
3263
+ Q.stage,
3264
+ "ui-image-grid",
3265
+ N(k) === "original" ? "touch-pan-x touch-pan-y overflow-auto select-none" : "touch-pan-y overflow-hidden"
3266
+ ]),
3267
+ onClick: gt,
3268
+ onMousedown: lt,
3269
+ onTouchstart: pt,
3270
+ onTouchmove: mt,
3271
+ onTouchend: ht,
3272
+ onTouchcancel: ft
3273
+ }, [c("div", {
3274
+ class: y([N(k) === "original" ? Q.originalWrapper : Q.fitWrapper, "relative z-1"]),
3275
+ style: b(N(Pe)),
3276
+ onClick: gt
3277
+ }, [c("div", {
3278
+ style: b(N(Le)),
3279
+ class: "relative shrink-0"
3280
+ }, [N(Y) ? ne((S(), s("img", {
3281
+ ref_key: "imageRef",
3282
+ ref: K,
3283
+ key: N(Y).src,
3284
+ src: N(Se),
3285
+ alt: N(Y).alt,
3286
+ style: b(N(Re)),
3287
+ class: y([
3288
+ "block select-none",
3289
+ N(k) === "original" ? N(Me) ? N(H).tracking ? "cursor-grabbing" : "cursor-grab" : "cursor-zoom-out" : N(je) ? "cursor-zoom-in" : "cursor-default",
3290
+ N(H).tracking ? "cursor-grabbing" : ""
3291
+ ]),
3292
+ decoding: "async",
3293
+ draggable: "false",
3294
+ onDragstart: i[1] ||= re(() => {}, ["prevent"]),
3295
+ onLoad: at,
3296
+ onClick: ut
3297
+ }, null, 46, Sa)), [[te, N(A)]]) : o("", !0)], 4), N(A) ? o("", !0) : (S(), s("div", {
3298
+ key: 0,
3299
+ class: y(Q.spinner)
3300
+ }, [d(ti)], 2))], 6)], 34)]),
3301
+ _: 1
3302
+ }, 8, ["active"]),
3303
+ N(we) ? (S(), s("button", {
3304
+ key: 0,
3305
+ type: "button",
3306
+ class: y([Q.nav, "left-0"]),
3307
+ "aria-label": "Предыдущее изображение",
3308
+ onClick: Qe
3309
+ }, [d(X, {
3310
+ name: "chevron",
3311
+ class: "size-6 rotate-180"
3312
+ })], 2)) : o("", !0),
3313
+ N(we) ? (S(), s("button", {
3314
+ key: 1,
3315
+ type: "button",
3316
+ class: y([Q.nav, "right-0"]),
3317
+ "aria-label": "Следующее изображение",
3318
+ onClick: $e
3319
+ }, [d(X, {
3320
+ name: "chevron",
3321
+ class: "size-6"
3322
+ })], 2)) : o("", !0)
3323
+ ]),
3324
+ c("div", { class: y(Q.bottom) }, [c("div", { class: y(Q.tools) }, [
3325
+ d(mr, { tooltip: "Отразить горизонтально" }, {
3326
+ default: z(() => [c("button", {
3327
+ type: "button",
3328
+ class: y(Q.iconButton),
3329
+ "aria-label": "Отразить горизонтально",
3330
+ onClick: i[2] ||= (e) => it("x")
3331
+ }, [d(X, {
3332
+ name: "flip-x",
3333
+ class: "size-4"
3334
+ })], 2)]),
3335
+ _: 1
3336
+ }),
3337
+ d(mr, { tooltip: "Отразить вертикально" }, {
3338
+ default: z(() => [c("button", {
3339
+ type: "button",
3340
+ class: y(Q.iconButton),
3341
+ "aria-label": "Отразить вертикально",
3342
+ onClick: i[3] ||= (e) => it("y")
3343
+ }, [d(X, {
3344
+ name: "flip-y",
3345
+ class: "size-4"
3346
+ })], 2)]),
3347
+ _: 1
3348
+ }),
3349
+ d(mr, { tooltip: "Повернуть влево" }, {
3350
+ default: z(() => [c("button", {
3351
+ type: "button",
3352
+ class: y(Q.iconButton),
3353
+ "aria-label": "Повернуть влево",
3354
+ onClick: i[4] ||= (e) => rt(-90)
3355
+ }, [d(X, {
3356
+ name: "rotate-left",
3357
+ class: "size-4"
3358
+ })], 2)]),
3359
+ _: 1
3360
+ }),
3361
+ d(mr, { tooltip: "Повернуть вправо" }, {
3362
+ default: z(() => [c("button", {
3363
+ type: "button",
3364
+ class: y(Q.iconButton),
3365
+ "aria-label": "Повернуть вправо",
3366
+ onClick: i[5] ||= (e) => rt(90)
3367
+ }, [d(X, {
3368
+ name: "rotate-right",
3369
+ class: "size-4"
3370
+ })], 2)]),
3371
+ _: 1
3372
+ })
3373
+ ], 2), N(we) ? (S(), a(Rr, {
3374
+ key: 0,
3375
+ active: N(le),
3376
+ axis: "x"
3377
+ }, {
3378
+ default: z(() => [c("div", {
3379
+ ref_key: "thumbsRef",
3380
+ ref: se,
3381
+ class: y(Q.thumbs)
3382
+ }, [c("div", { class: y(Q.thumbsRow) }, [(S(!0), s(n, null, D(N(ge), (e, t) => (S(), s("button", {
3383
+ key: `${e.src}:${t}`,
3384
+ type: "button",
3385
+ "data-thumb-index": t,
3386
+ "aria-label": `Открыть изображение ${t + 1}`,
3387
+ "aria-current": t === N(C) ? "true" : void 0,
3388
+ class: y([Q.thumb, t === N(C) ? "opacity-100" : ""]),
3389
+ onClick: (e) => Je(t)
3390
+ }, [c("span", {
3391
+ class: y(["absolute inset-x-0 top-0 z-1 h-1", t === N(C) ? "bg-(--accent)" : "bg-transparent"]),
3392
+ "aria-hidden": "true"
3393
+ }, null, 2), c("img", {
3394
+ src: e.thumbnailSrc || e.src,
3395
+ alt: e.alt,
3396
+ class: y(Q.thumbImage),
3397
+ loading: "lazy",
3398
+ decoding: "async"
3399
+ }, null, 10, wa)], 10, Ca))), 128))], 2)], 2)]),
3400
+ _: 1
3401
+ }, 8, ["active"])) : o("", !0)], 2)
3402
+ ], 10, ba)])) : o("", !0)], 64));
3403
+ }
3404
+ }), Ea = [
3405
+ "id",
3406
+ "disabled",
3407
+ "aria-invalid"
3408
+ ], Da = { base: "box-border h-9 py-1 px-2 m-1 text-sm text-(--text-default) bg-(--default) hover:bg-(--default-hover)" }, Oa = /* @__PURE__ */ f({
3409
+ __name: "SInput",
3410
+ props: /*@__PURE__*/ g({
3411
+ id: {},
3412
+ invalid: {
3413
+ type: Boolean,
3414
+ default: !1
3415
+ },
3416
+ disabled: {
3417
+ type: Boolean,
3418
+ default: !1
3419
+ }
3420
+ }, {
3421
+ modelValue: {},
3422
+ modelModifiers: {}
3423
+ }),
3424
+ emits: ["update:modelValue"],
3425
+ setup(e, { expose: t }) {
3426
+ let n = F(e, "modelValue"), r = m("field-context", null), a = m("fieldset-disabled", E(!1)), o = i(() => e.id || r?.id?.value || `input-${P()}`), c = i(() => !!(e.disabled || r?.disabled?.value || a.value)), l = i(() => [
3427
+ Da.base,
3428
+ e.invalid ? "ring-2 ring-(--danger) focus:ring-(--danger)" : "ring-1 ring-(--border) focus:ring-2 focus:ring-(--accent)",
3429
+ c.value && "cursor-not-allowed opacity-50"
3430
+ ]), u = E(null);
3431
+ return t({ focus: () => u.value?.focus() }), (t, r) => ne((S(), s("input", {
3432
+ id: N(o),
3433
+ ref_key: "inputRef",
3434
+ ref: u,
3435
+ "onUpdate:modelValue": r[0] ||= (e) => n.value = e,
3436
+ disabled: N(c),
3437
+ "aria-invalid": e.invalid || void 0,
3438
+ class: y(N(l))
3439
+ }, null, 10, Ea)), [[L, n.value]]);
3440
+ }
3441
+ }), ka = { link: "text-(--link) hover:text-(--link-hover)" }, Aa = /* @__PURE__ */ f({
3442
+ __name: "SLink",
3443
+ props: {
3444
+ to: {},
3445
+ label: { default: "" }
3446
+ },
3447
+ setup(e) {
3448
+ let t = or();
3449
+ return (n, r) => (S(), a(A(N(t)), {
3450
+ class: y(ka.link),
3451
+ to: e.to,
3452
+ href: N(t) === "a" ? e.to : void 0
3453
+ }, {
3454
+ default: z(() => [O(n.$slots, "default", {}, () => [u(j(e.label), 1)])]),
3455
+ _: 3
3456
+ }, 8, [
3457
+ "class",
3458
+ "to",
3459
+ "href"
3460
+ ]));
3461
+ }
3462
+ }), ja = {
3463
+ list: "flex flex-col gap-1 pl-4 text-sm text-(--text-default)",
3464
+ listOl: "list-decimal",
3465
+ listUl: "list-disc",
3466
+ item: "leading-snug"
3467
+ }, Ma = /* @__PURE__ */ f({
3468
+ __name: "SList",
3469
+ props: {
3470
+ items: {},
3471
+ tag: { default: "ul" }
3472
+ },
3473
+ setup(e) {
3474
+ let t = i(() => [ja.list, e.tag === "ol" ? ja.listOl : ja.listUl]);
3475
+ return (r, i) => (S(), a(A(e.tag), { class: y(N(t)) }, {
3476
+ default: z(() => [(S(!0), s(n, null, D(e.items, (e, t) => (S(), s("li", {
3477
+ key: t,
3478
+ class: y(ja.item)
3479
+ }, [O(r.$slots, "item", {
3480
+ item: e,
3481
+ index: t
3482
+ }, () => [u(j(e), 1)])], 2))), 128))]),
3483
+ _: 3
3484
+ }, 8, ["class"]));
3485
+ }
3486
+ }), Na = { class: "mx-auto flex w-full max-w-4xl [scrollbar-width:none] items-center gap-1 overflow-x-auto px-4 sm:flex-wrap sm:overflow-visible sm:px-6 [&::-webkit-scrollbar]:hidden" }, Pa = /* @__PURE__ */ f({
3487
+ __name: "SNav",
3488
+ props: { items: { default: () => [{
3489
+ to: "/",
3490
+ label: "начальная"
3491
+ }] } },
3492
+ setup(e) {
3493
+ let t = cr(), r = or(), i = (e) => t.value === e || t.value.startsWith(`${e}/`), o = (e) => e.to === "/" ? t.value === "/" : i(e.to) ? !0 : (e.activePrefixes ?? []).some(i);
3494
+ return (t, i) => (S(), s("nav", Na, [(S(!0), s(n, null, D(e.items, (e) => (S(), a(A(N(r)), {
3495
+ key: e.to,
3496
+ to: e.to,
3497
+ href: N(r) === "a" ? e.to : void 0,
3498
+ class: y(["shrink-0 rounded-full px-3 py-1 text-xs font-medium tracking-wider whitespace-nowrap uppercase transition-colors", o(e) ? "bg-current/5 text-(--text-default)" : "opacity-50 hover:bg-current/5 hover:opacity-90"])
3499
+ }, {
3500
+ default: z(() => [u(j(e.label), 1)]),
3501
+ _: 2
3502
+ }, 1032, [
3503
+ "to",
3504
+ "href",
3505
+ "class"
3506
+ ]))), 128))]));
3507
+ }
3508
+ }), Fa = { class: "flex items-start justify-between gap-3" }, Ia = { class: "min-w-0" }, La = {
3509
+ root: "fixed top-4 right-4 z-70 flex w-full max-w-sm flex-col gap-2",
3510
+ stack: "flex w-full flex-col gap-2",
3511
+ card: "rounded border border-(--border) bg-(--default) p-4 shadow-lg",
3512
+ title: "text-sm font-semibold",
3513
+ message: "text-sm opacity-80",
3514
+ success: "border-l-4 border-l-(--accent)",
3515
+ error: "border-l-4 border-l-(--danger)",
3516
+ info: "border-l-4 border-l-(--text-default)"
3517
+ }, Ra = /* @__PURE__ */ f({
3518
+ __name: "SNotification",
3519
+ props: {
3520
+ modelValue: {
3521
+ type: Boolean,
3522
+ default: !1
3523
+ },
3524
+ title: { default: "" },
3525
+ message: { default: "" },
3526
+ type: { default: "info" },
3527
+ duration: { default: 3e3 },
3528
+ floating: {
3529
+ type: Boolean,
3530
+ default: !0
3531
+ }
3532
+ },
3533
+ emits: ["update:modelValue"],
3534
+ setup(e, { emit: t }) {
3535
+ let n = e, l = t, u = i({
3536
+ get: () => n.modelValue,
3537
+ set: (e) => l("update:modelValue", e)
3538
+ }), d = null, f = () => {
3539
+ u.value = !1;
3540
+ }, p = () => {
3541
+ d !== null && window.clearTimeout(d), n.duration > 0 && (d = window.setTimeout(f, n.duration));
3542
+ };
3543
+ return R(() => n.modelValue, (e) => {
3544
+ e ? p() : d !== null && (window.clearTimeout(d), d = null);
3545
+ }, { immediate: !0 }), x(() => {
3546
+ d !== null && window.clearTimeout(d);
3547
+ }), (t, i) => N(u) ? (S(), a(r, {
3548
+ key: 0,
3549
+ to: "body",
3550
+ disabled: !n.floating
3551
+ }, [c("div", { class: y(n.floating ? La.root : La.stack) }, [c("div", { class: y([La.card, La[n.type]]) }, [c("div", Fa, [c("div", Ia, [e.title ? (S(), s("p", {
3552
+ key: 0,
3553
+ class: y(La.title)
3554
+ }, j(e.title), 3)) : o("", !0), e.message ? (S(), s("p", {
3555
+ key: 1,
3556
+ class: y(La.message)
3557
+ }, j(e.message), 3)) : o("", !0)]), c("button", {
3558
+ type: "button",
3559
+ class: "shrink-0 opacity-60 hover:opacity-100",
3560
+ "aria-label": "Закрыть",
3561
+ onClick: f
3562
+ }, " × ")])], 2)], 2)], 8, ["disabled"])) : o("", !0);
3563
+ }
3564
+ }), za = 4e3, Ba = 0, Va = E([]), Ha = () => {
3565
+ let e = (e) => {
3566
+ Va.value = Va.value.filter((t) => t.id !== e);
3567
+ }, t = (e) => {
3568
+ let t = ++Ba;
3569
+ return Va.value = [...Va.value, {
3570
+ duration: za,
3571
+ ...e,
3572
+ id: t
3573
+ }], t;
3574
+ };
3575
+ return {
3576
+ items: i(() => Va.value),
3577
+ push: t,
3578
+ dismiss: e,
3579
+ success: (e, n) => t({
3580
+ type: "success",
3581
+ title: e,
3582
+ message: n
3583
+ }),
3584
+ error: (e, n) => t({
3585
+ type: "error",
3586
+ title: e,
3587
+ message: n,
3588
+ duration: 6e3
3589
+ }),
3590
+ info: (e, n) => t({
3591
+ type: "info",
3592
+ title: e,
3593
+ message: n
3594
+ })
3595
+ };
3596
+ }, Ua = { class: "pointer-events-none fixed top-4 right-4 z-70 flex w-[calc(100%-2rem)] max-w-sm flex-col gap-2" }, Wa = /* @__PURE__ */ f({
3597
+ __name: "SNotificationHost",
3598
+ setup(e) {
3599
+ let { items: t, dismiss: i } = Ha();
3600
+ return (e, o) => (S(), a(r, { to: "body" }, [c("div", Ua, [(S(!0), s(n, null, D(N(t), (e) => (S(), s("div", {
3601
+ key: e.id,
3602
+ class: "pointer-events-auto"
3603
+ }, [d(Ra, {
3604
+ "model-value": !0,
3605
+ title: e.title,
3606
+ message: e.message,
3607
+ type: e.type,
3608
+ duration: e.duration,
3609
+ floating: !1,
3610
+ "onUpdate:modelValue": (t) => N(i)(e.id)
3611
+ }, null, 8, [
3612
+ "title",
3613
+ "message",
3614
+ "type",
3615
+ "duration",
3616
+ "onUpdate:modelValue"
3617
+ ])]))), 128))])]));
3618
+ }
3619
+ }), Ga = /* @__PURE__ */ f({
3620
+ __name: "SSpoiler",
3621
+ props: /*@__PURE__*/ g({ label: { default: "Подробнее" } }, {
3622
+ modelValue: {
3623
+ type: Boolean,
3624
+ default: !1
3625
+ },
3626
+ modelModifiers: {}
3627
+ }),
3628
+ emits: ["update:modelValue"],
3629
+ setup(e) {
3630
+ let t = F(e, "modelValue");
3631
+ return (n, r) => (S(), s("div", null, [c("button", {
3632
+ type: "button",
3633
+ class: "flex items-center gap-1 text-left text-(--link) hover:text-(--link-hover)",
3634
+ onClick: r[0] ||= (e) => t.value = !t.value
3635
+ }, [d(X, {
3636
+ name: "chevron",
3637
+ class: y(["size-4 transition-transform duration-100", t.value && "rotate-90"])
3638
+ }, null, 8, ["class"]), c("span", null, j(e.label), 1)]), ne(c("div", null, [O(n.$slots, "default")], 512), [[te, t.value]])]));
3639
+ }
3640
+ }), Ka = {
3641
+ Tightest: "tightest",
3642
+ Tight: "tight",
3643
+ Normal: "normal",
3644
+ Wide: "wide",
3645
+ Widest: "widest"
3646
+ }, qa = {
3647
+ Xs: "text-xs",
3648
+ Sm: "text-sm",
3649
+ Base: "text-base",
3650
+ Lg: "text-lg",
3651
+ Xl: "text-xl"
3652
+ }, Ja = {
3653
+ Inherit: "text-inherit",
3654
+ Default: "text-(--text-default)",
3655
+ Accent: "text-(--accent)",
3656
+ Muted: "opacity-60"
3657
+ }, Ya = { container: "text-shadow-xs/80 font-light font-mono uppercase flex w-full justify-center" }, Xa = /* @__PURE__ */ f({
3658
+ __name: "STextSpans",
3659
+ props: {
3660
+ text: {},
3661
+ gap: { default: () => Ka.Wide },
3662
+ textSize: { default: () => qa.Xs },
3663
+ textColor: { default: () => Ja.Inherit }
3664
+ },
3665
+ setup(e) {
3666
+ let t = i(() => e.text.trim()), r = {
3667
+ [Ka.Tightest]: "gap-1",
3668
+ [Ka.Tight]: "gap-2",
3669
+ [Ka.Normal]: "gap-3",
3670
+ [Ka.Wide]: "gap-6",
3671
+ [Ka.Widest]: "gap-8"
3672
+ }, a = i(() => [
3673
+ Ya.container,
3674
+ e.textSize,
3675
+ e.textColor,
3676
+ r[e.gap]
3677
+ ]);
3678
+ return (e, r) => (S(), s("div", { class: y(N(a)) }, [(S(!0), s(n, null, D(N(t), (e, t) => (S(), s("span", { key: t }, j(e), 1))), 128))], 2));
3679
+ }
3680
+ }), Za = [
3681
+ "id",
3682
+ "rows",
3683
+ "aria-invalid"
3684
+ ], Qa = { textarea: "max-w-full resize bg-(--default) m-1 p-2 px-3 text-sm text-(--text-default) disabled:cursor-not-allowed disabled:opacity-50" }, $a = /* @__PURE__ */ f({
3685
+ __name: "STextarea",
3686
+ props: /*@__PURE__*/ g({
3687
+ id: {},
3688
+ rows: { default: 3 },
3689
+ invalid: {
3690
+ type: Boolean,
3691
+ default: !1
3692
+ }
3693
+ }, {
3694
+ modelValue: { default: "" },
3695
+ modelModifiers: {}
3696
+ }),
3697
+ emits: ["update:modelValue"],
3698
+ setup(e) {
3699
+ let t = m("field-id", void 0), n = i(() => e.id || t || `textarea-${P()}`), r = F(e, "modelValue"), a = i(() => [Qa.textarea, e.invalid ? "ring-2 ring-(--danger) focus:ring-(--danger)" : "ring-1 ring-(--border) focus:ring-2 focus:ring-(--accent)"]);
3700
+ return (t, i) => ne((S(), s("textarea", {
3701
+ id: N(n),
3702
+ "onUpdate:modelValue": i[0] ||= (e) => r.value = e,
3703
+ rows: e.rows,
3704
+ "aria-invalid": e.invalid || void 0,
3705
+ class: y(N(a))
3706
+ }, null, 10, Za)), [[L, r.value]]);
3707
+ }
3708
+ }), eo = ["for"], to = [
3709
+ "id",
3710
+ "name",
3711
+ "disabled"
3712
+ ], no = {
3713
+ label: "relative inline-flex w-fit items-center gap-2 text-sm select-none",
3714
+ track: "ui-focus-peer relative h-4 w-7 shrink-0 rounded-full border-2 transition-colors duration-200",
3715
+ thumb: "absolute -top-0.5 -left-0.5 size-4 rounded-full border-2 transition-transform duration-200",
3716
+ text: "text-nowrap text-(--text-default)"
3717
+ }, ro = /* @__PURE__ */ f({
3718
+ __name: "SToggle",
3719
+ props: /*@__PURE__*/ g({
3720
+ id: {},
3721
+ name: {},
3722
+ label: {},
3723
+ disabled: {
3724
+ type: Boolean,
3725
+ default: !1
3726
+ }
3727
+ }, {
3728
+ modelValue: {
3729
+ type: Boolean,
3730
+ default: !1
3731
+ },
3732
+ modelModifiers: {}
3733
+ }),
3734
+ emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
3735
+ setup(e, { emit: t, slots: n }) {
3736
+ let r = F(e, "modelValue"), a = t, l = m("field-id", void 0), d = i(() => e.id || l || `toggle-${P()}`), f = (e) => {
3737
+ a("change", e);
3738
+ }, p = i(() => [no.label, e.disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"]), h = i(() => [no.track, r.value ? "border-(--accent) bg-(--accent)" : "border-white/40 bg-(--toggle-off-bg)"]), g = i(() => [no.thumb, r.value ? "translate-x-3 border-(--accent) bg-(--bg-default)" : "translate-x-0 border-transparent bg-white"]);
3739
+ return (t, i) => (S(), s("label", {
3740
+ for: N(d),
3741
+ class: y(N(p))
3742
+ }, [
3743
+ ne(c("input", {
3744
+ id: N(d),
3745
+ name: e.name,
3746
+ type: "checkbox",
3747
+ class: "peer sr-only",
3748
+ "onUpdate:modelValue": i[0] ||= (e) => r.value = e,
3749
+ disabled: e.disabled,
3750
+ onChange: f
3751
+ }, null, 40, to), [[I, r.value]]),
3752
+ c("span", {
3753
+ "aria-hidden": "true",
3754
+ class: y(N(h))
3755
+ }, [c("span", { class: y(N(g)) }, null, 2)], 2),
3756
+ e.label || n.default ? (S(), s("span", {
3757
+ key: 0,
3758
+ class: y(no.text)
3759
+ }, [O(t.$slots, "default", {}, () => [u(j(e.label), 1)])], 2)) : o("", !0)
3760
+ ], 10, eo));
3761
+ }
3762
+ }), io = ["aria-label"], ao = [
3763
+ "aria-label",
3764
+ "aria-expanded",
3765
+ "onClick"
3766
+ ], oo = {
3767
+ key: 1,
3768
+ class: "size-4 shrink-0"
3769
+ }, $ = {
3770
+ root: "flex min-w-0 flex-col items-start",
3771
+ header: "flex w-full min-w-0 items-center gap-2",
3772
+ title: "min-w-0 text-base font-semibold wrap-break-word",
3773
+ collapseBtn: "flex size-6 shrink-0 items-center justify-center rounded-full text-(--accent) hover:bg-(--elevated) outline-none focus-visible:ring-2 focus-visible:ring-(--accent) transition-colors cursor-pointer",
3774
+ collapseIcon: "size-4 pointer-events-none",
3775
+ list: "flex w-full min-w-0 flex-col gap-x-1",
3776
+ row: "group flex h-4 min-w-0 items-start gap-2",
3777
+ number: "h-4 shrink-0 text-right text-xs leading-4 text-(--text-default) tabular-nums",
3778
+ toggleBtn: "flex size-4 shrink-0 items-center justify-center rounded-full text-(--accent) hover:bg-(--elevated) outline-none focus-visible:ring-2 focus-visible:ring-(--accent) transition-colors cursor-pointer",
3779
+ toggleDisabled: "pointer-events-none opacity-0",
3780
+ toggleIcon: "size-4 pointer-events-none transition-transform duration-100",
3781
+ toggleIconActive: "rotate-90",
3782
+ itemBtn: "flex h-4 min-w-0 items-start text-base leading-4 outline-none focus-visible:ring-2 focus-visible:ring-(--accent) cursor-pointer group-hover:text-(--accent) transition-colors",
3783
+ itemLeaf: "flex h-4 min-w-0 items-start text-base leading-4",
3784
+ depth: "flex size-4 shrink-0 justify-start",
3785
+ depthLine: "h-4 w-px bg-(--text-default)",
3786
+ depthLineHover: "group-hover:bg-(--accent)",
3787
+ text: "text-sm h-4 self-start overflow-hidden leading-4 wrap-break-word"
3788
+ }, so = /* @__PURE__ */ f({
3789
+ __name: "STree",
3790
+ props: {
3791
+ items: { default: () => [] },
3792
+ h: { default: "" }
3793
+ },
3794
+ setup(e) {
3795
+ let t = E(/* @__PURE__ */ new Set()), r = (e) => typeof e == "string" ? e : e.text, l = (e) => typeof e == "string" ? [] : e.children || [], u = i(() => {
3796
+ let n = [], i = 0, a = (e, o = 0, s = "", c = !0) => {
3797
+ e.forEach((e, u) => {
3798
+ let d = s ? `${s}.${u}` : String(u), f = l(e);
3799
+ i += 1, c && n.push({
3800
+ id: d,
3801
+ number: i,
3802
+ text: r(e),
3803
+ depth: o,
3804
+ children: f
3805
+ }), a(f, o + 1, d, c && t.value.has(d));
3806
+ });
3807
+ };
3808
+ return a(e.items), n;
3809
+ }), f = i(() => {
3810
+ let t = [], n = (e, r = "") => {
3811
+ e.forEach((e, i) => {
3812
+ let a = r ? `${r}.${i}` : String(i), o = l(e);
3813
+ o.length && (t.push(a), n(o, a));
3814
+ });
3815
+ };
3816
+ return n(e.items), t;
3817
+ }), p = i(() => {
3818
+ let t = 0, n = (e) => {
3819
+ e.forEach((e) => {
3820
+ t += 1, n(l(e));
3821
+ });
3822
+ };
3823
+ return n(e.items), t;
3824
+ }), m = i(() => `${Math.max(2, String(p.value).length)}ch`), h = i(() => f.value.length > 0), g = i(() => h.value && f.value.every((e) => t.value.has(e))), _ = i(() => g.value ? "Свернуть всё" : "Развернуть всё"), v = (e) => t.value.has(e), x = (e) => {
3825
+ e.children.length && (t.value.has(e.id) ? t.value.delete(e.id) : t.value.add(e.id));
3826
+ }, ee = () => {
3827
+ t.value = g.value ? /* @__PURE__ */ new Set() : new Set(f.value);
3828
+ };
3829
+ return (r, i) => (S(), s("div", { class: y($.root) }, [e.h || N(h) ? (S(), s("div", {
3830
+ key: 0,
3831
+ class: y($.header)
3832
+ }, [e.h ? (S(), s("h2", {
3833
+ key: 0,
3834
+ class: y($.title)
3835
+ }, j(e.h), 3)) : o("", !0), N(h) ? (S(), a(mr, {
3836
+ key: 1,
3837
+ tooltip: N(_)
3838
+ }, {
3839
+ default: z(() => [c("button", {
3840
+ type: "button",
3841
+ "aria-label": N(_),
3842
+ class: y($.collapseBtn),
3843
+ onClick: ee
3844
+ }, [d(X, {
3845
+ name: N(g) ? "collapse" : "expand",
3846
+ class: y($.collapseIcon)
3847
+ }, null, 8, ["name", "class"])], 10, io)]),
3848
+ _: 1
3849
+ }, 8, ["tooltip"])) : o("", !0)], 2)) : o("", !0), c("div", { class: y($.list) }, [(S(!0), s(n, null, D(N(u), (e) => (S(), s("div", {
3850
+ key: e.id,
3851
+ class: y($.row)
3852
+ }, [
3853
+ c("span", {
3854
+ class: y($.number),
3855
+ style: b({ width: N(m) })
3856
+ }, j(e.number), 7),
3857
+ N(h) ? (S(), s(n, { key: 0 }, [e.children.length ? (S(), s("button", {
3858
+ key: 0,
3859
+ type: "button",
3860
+ tabindex: "-1",
3861
+ class: y($.toggleBtn),
3862
+ "aria-label": N(t).has(e.id) ? "Свернуть" : "Раскрыть",
3863
+ "aria-expanded": N(t).has(e.id),
3864
+ onClick: (t) => x(e)
3865
+ }, [d(X, {
3866
+ name: "chevron",
3867
+ class: y([$.toggleIcon, v(e.id) && $.toggleIconActive])
3868
+ }, null, 8, ["class"])], 10, ao)) : (S(), s("span", oo))], 64)) : o("", !0),
3869
+ (S(), a(A(e.children.length ? "button" : "div"), {
3870
+ type: e.children.length ? "button" : void 0,
3871
+ class: y(e.children.length ? $.itemBtn : $.itemLeaf),
3872
+ onClick: (t) => e.children.length && x(e)
3873
+ }, {
3874
+ default: z(() => [(S(!0), s(n, null, D(e.depth, (t) => (S(), s("span", {
3875
+ key: t,
3876
+ class: y($.depth)
3877
+ }, [c("span", { class: y([$.depthLine, t === e.depth && $.depthLineHover]) }, null, 2)], 2))), 128)), c("span", { class: y($.text) }, j(e.text), 3)]),
3878
+ _: 2
3879
+ }, 1032, [
3880
+ "type",
3881
+ "class",
3882
+ "onClick"
3883
+ ]))
3884
+ ], 2))), 128))], 2)], 2));
3885
+ }
3886
+ }), co = (e) => typeof e == "string" ? e.trim().replace(/^\/+/, "").replace(/\\/g, "/") : "", lo = (t) => {
3887
+ let n = co(t);
3888
+ if (!n) return "";
3889
+ let r = e().mediaBasePath || "/api/media/files", i = n.split("/").map((e) => encodeURIComponent(e)).join("/");
3890
+ return `${r.replace(/\/+$/, "")}/${i}`;
3891
+ }, uo = co;
3892
+ export { xr as BtnState, le as SAppShell, fr as SAsideNav, br as SAvatar, Cr as SBtn, Or as SCheckbox, Mr as SCopy, $r as SCropper, si as SDataTable, ra as SDateTimePicker, fi as SDatetime, ui as SDatetimeView, aa as SDocMarkdown, sa as SField, da as SFile, ga as SGradation, X as SIcon, Ta as SImage, Oa as SInput, Aa as SLink, Ma as SList, ti as SLoad, Pa as SNav, Ra as SNotification, Wa as SNotificationHost, Ir as SRange, Rr as SScrollableEdges, qr as SSelect, Ga as SSpoiler, Xa as STextSpans, $a as STextarea, ro as SToggle, mr as STooltip, so as STree, Ja as TextColor, Ka as TextGap, qa as TextSize, ji as allTimeZoneOptions, Ci as clampDateTimePickerParts, Si as compareDateOnly, ca as countForm, yi as dateToPickerParts, wi as formatDateTimePickerDisplay, li as getFormatter, ir as iconNames, rr as icons, Ai as localTimeZone, lo as mediaFileSrc, uo as normalizeMediaKey, _i as parseDateTimePickerModel, gr as provideSindeUser, Oi as resolveDateTimePickerLocale, vi as serializeDateTimePickerModel, t as setSindeUiConfig, kr as useClipboard, or as useLinkComponent, Ha as useNotifications, Br as useOpenSelect, cr as useOptionalRoutePath, sr as useOptionalRouter, e as useSindeUiConfig, _r as useSindeUser };