@vacano/ui 1.12.1 → 1.14.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 (44) hide show
  1. package/README.md +9 -8
  2. package/dist/CircleX-BzaN6v37.cjs +2 -0
  3. package/dist/CircleX-BzaN6v37.cjs.map +1 -0
  4. package/dist/CircleX-RQVijA2m.js +75 -0
  5. package/dist/CircleX-RQVijA2m.js.map +1 -0
  6. package/dist/ToggleGroup-C44x4Sx1.js +3948 -0
  7. package/dist/ToggleGroup-C44x4Sx1.js.map +1 -0
  8. package/dist/ToggleGroup-COFNoVg9.cjs +1294 -0
  9. package/dist/ToggleGroup-COFNoVg9.cjs.map +1 -0
  10. package/dist/{X-BIgkmQPR.cjs → X-CI1qRJDP.cjs} +4 -4
  11. package/dist/X-CI1qRJDP.cjs.map +1 -0
  12. package/dist/{X-Dyq6IJZW.js → X-DAuAfjix.js} +198 -222
  13. package/dist/X-DAuAfjix.js.map +1 -0
  14. package/dist/form.cjs +2 -0
  15. package/dist/form.cjs.map +1 -0
  16. package/dist/form.d.ts +540 -0
  17. package/dist/form.js +428 -0
  18. package/dist/form.js.map +1 -0
  19. package/dist/icons.cjs +1 -1
  20. package/dist/icons.cjs.map +1 -1
  21. package/dist/icons.js +4616 -4659
  22. package/dist/icons.js.map +1 -1
  23. package/dist/index-Abn5L42P.js +42 -0
  24. package/dist/index-Abn5L42P.js.map +1 -0
  25. package/dist/index-GSZAZ6Cz.cjs +2 -0
  26. package/dist/index-GSZAZ6Cz.cjs.map +1 -0
  27. package/dist/index.cjs +1148 -1252
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.ts +584 -37
  30. package/dist/index.js +3232 -4640
  31. package/dist/index.js.map +1 -1
  32. package/dist/{media-CWK1OED-.js → keyboard-D00e_brg.js} +63 -66
  33. package/dist/keyboard-D00e_brg.js.map +1 -0
  34. package/dist/{media-BuwIclXE.cjs → keyboard-D8zOi0jU.cjs} +3 -3
  35. package/dist/keyboard-D8zOi0jU.cjs.map +1 -0
  36. package/dist/lib.cjs +1 -1
  37. package/dist/lib.d.ts +38 -0
  38. package/dist/lib.js +15 -13
  39. package/dist/lib.js.map +1 -1
  40. package/package.json +25 -3
  41. package/dist/X-BIgkmQPR.cjs.map +0 -1
  42. package/dist/X-Dyq6IJZW.js.map +0 -1
  43. package/dist/media-BuwIclXE.cjs.map +0 -1
  44. package/dist/media-CWK1OED-.js.map +0 -1
@@ -0,0 +1,3948 @@
1
+ import { m as Ir, g as _r, s as Ar, r as Er, u as Lr, i as Mr, a as w, j as a, L as Fr, M as Yr, C as rr, X as or, b as ir, d as et, e as tt, F as Xe } from "./X-DAuAfjix.js";
2
+ import * as Ne from "react";
3
+ import { useState as B, useRef as K, useEffect as fe, useCallback as A, useMemo as oe, useImperativeHandle as Vr, useLayoutEffect as nr } from "react";
4
+ import { C as t, a as o, K as $t, g as Br, u as Hr } from "./keyboard-D00e_brg.js";
5
+ import { withEmotionCache as Wr, ThemeContext as jr, keyframes as Gr } from "@emotion/react";
6
+ import { n as L } from "./tooling-YDHxmiMT.js";
7
+ import { createPortal as Ze } from "react-dom";
8
+ function bt() {
9
+ return bt = Object.assign ? Object.assign.bind() : function(e) {
10
+ for (var r = 1; r < arguments.length; r++) {
11
+ var i = arguments[r];
12
+ for (var l in i) ({}).hasOwnProperty.call(i, l) && (e[l] = i[l]);
13
+ }
14
+ return e;
15
+ }, bt.apply(null, arguments);
16
+ }
17
+ var Ur = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/, Kr = /* @__PURE__ */ Ir(
18
+ function(e) {
19
+ return Ur.test(e) || e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && e.charCodeAt(2) < 91;
20
+ }
21
+ /* Z+1 */
22
+ ), Xr = Kr, qr = function(r) {
23
+ return r !== "theme";
24
+ }, St = function(r) {
25
+ return typeof r == "string" && // 96 is one less than the char code
26
+ // for "a" so this is checking that
27
+ // it's a lowercase character
28
+ r.charCodeAt(0) > 96 ? Xr : qr;
29
+ }, mt = function(r, i, l) {
30
+ var d;
31
+ if (i) {
32
+ var p = i.shouldForwardProp;
33
+ d = r.__emotion_forwardProp && p ? function(b) {
34
+ return r.__emotion_forwardProp(b) && p(b);
35
+ } : p;
36
+ }
37
+ return typeof d != "function" && l && (d = r.__emotion_forwardProp), d;
38
+ }, Zr = function(r) {
39
+ var i = r.cache, l = r.serialized, d = r.isStringTag;
40
+ return Er(i, l, d), Lr(function() {
41
+ return Mr(i, l, d);
42
+ }), null;
43
+ }, Jr = function e(r, i) {
44
+ var l = r.__emotion_real === r, d = l && r.__emotion_base || r, p, b;
45
+ i !== void 0 && (p = i.label, b = i.target);
46
+ var c = mt(r, i, l), h = c || St(d), u = !h("as");
47
+ return function() {
48
+ var $ = arguments, g = l && r.__emotion_styles !== void 0 ? r.__emotion_styles.slice(0) : [];
49
+ if (p !== void 0 && g.push("label:" + p + ";"), $[0] == null || $[0].raw === void 0)
50
+ g.push.apply(g, $);
51
+ else {
52
+ var z = $[0];
53
+ g.push(z[0]);
54
+ for (var S = $.length, C = 1; C < S; C++)
55
+ g.push($[C], z[C]);
56
+ }
57
+ var v = Wr(function(P, D, k) {
58
+ var y = u && P.as || d, s = "", _ = [], E = P;
59
+ if (P.theme == null) {
60
+ E = {};
61
+ for (var I in P)
62
+ E[I] = P[I];
63
+ E.theme = Ne.useContext(jr);
64
+ }
65
+ typeof P.className == "string" ? s = _r(D.registered, _, P.className) : P.className != null && (s = P.className + " ");
66
+ var W = Ar(g.concat(_), D.registered, E);
67
+ s += D.key + "-" + W.name, b !== void 0 && (s += " " + b);
68
+ var H = u && c === void 0 ? St(y) : h, Y = {};
69
+ for (var V in P)
70
+ u && V === "as" || H(V) && (Y[V] = P[V]);
71
+ return Y.className = s, k && (Y.ref = k), /* @__PURE__ */ Ne.createElement(Ne.Fragment, null, /* @__PURE__ */ Ne.createElement(Zr, {
72
+ cache: D,
73
+ serialized: W,
74
+ isStringTag: typeof y == "string"
75
+ }), /* @__PURE__ */ Ne.createElement(y, Y));
76
+ });
77
+ return v.displayName = p !== void 0 ? p : "Styled(" + (typeof d == "string" ? d : d.displayName || d.name || "Component") + ")", v.defaultProps = r.defaultProps, v.__emotion_real = v, v.__emotion_base = d, v.__emotion_styles = g, v.__emotion_forwardProp = c, Object.defineProperty(v, "toString", {
78
+ value: function() {
79
+ return "." + b;
80
+ }
81
+ }), v.withComponent = function(P, D) {
82
+ var k = e(P, bt({}, i, D, {
83
+ shouldForwardProp: mt(v, D, !0)
84
+ }));
85
+ return k.apply(void 0, g);
86
+ }, v;
87
+ };
88
+ }, Qr = [
89
+ "a",
90
+ "abbr",
91
+ "address",
92
+ "area",
93
+ "article",
94
+ "aside",
95
+ "audio",
96
+ "b",
97
+ "base",
98
+ "bdi",
99
+ "bdo",
100
+ "big",
101
+ "blockquote",
102
+ "body",
103
+ "br",
104
+ "button",
105
+ "canvas",
106
+ "caption",
107
+ "cite",
108
+ "code",
109
+ "col",
110
+ "colgroup",
111
+ "data",
112
+ "datalist",
113
+ "dd",
114
+ "del",
115
+ "details",
116
+ "dfn",
117
+ "dialog",
118
+ "div",
119
+ "dl",
120
+ "dt",
121
+ "em",
122
+ "embed",
123
+ "fieldset",
124
+ "figcaption",
125
+ "figure",
126
+ "footer",
127
+ "form",
128
+ "h1",
129
+ "h2",
130
+ "h3",
131
+ "h4",
132
+ "h5",
133
+ "h6",
134
+ "head",
135
+ "header",
136
+ "hgroup",
137
+ "hr",
138
+ "html",
139
+ "i",
140
+ "iframe",
141
+ "img",
142
+ "input",
143
+ "ins",
144
+ "kbd",
145
+ "keygen",
146
+ "label",
147
+ "legend",
148
+ "li",
149
+ "link",
150
+ "main",
151
+ "map",
152
+ "mark",
153
+ "marquee",
154
+ "menu",
155
+ "menuitem",
156
+ "meta",
157
+ "meter",
158
+ "nav",
159
+ "noscript",
160
+ "object",
161
+ "ol",
162
+ "optgroup",
163
+ "option",
164
+ "output",
165
+ "p",
166
+ "param",
167
+ "picture",
168
+ "pre",
169
+ "progress",
170
+ "q",
171
+ "rp",
172
+ "rt",
173
+ "ruby",
174
+ "s",
175
+ "samp",
176
+ "script",
177
+ "section",
178
+ "select",
179
+ "small",
180
+ "source",
181
+ "span",
182
+ "strong",
183
+ "style",
184
+ "sub",
185
+ "summary",
186
+ "sup",
187
+ "table",
188
+ "tbody",
189
+ "td",
190
+ "textarea",
191
+ "tfoot",
192
+ "th",
193
+ "thead",
194
+ "time",
195
+ "title",
196
+ "tr",
197
+ "track",
198
+ "u",
199
+ "ul",
200
+ "var",
201
+ "video",
202
+ "wbr",
203
+ // SVG
204
+ "circle",
205
+ "clipPath",
206
+ "defs",
207
+ "ellipse",
208
+ "foreignObject",
209
+ "g",
210
+ "image",
211
+ "line",
212
+ "linearGradient",
213
+ "mask",
214
+ "path",
215
+ "pattern",
216
+ "polygon",
217
+ "polyline",
218
+ "radialGradient",
219
+ "rect",
220
+ "stop",
221
+ "svg",
222
+ "text",
223
+ "tspan"
224
+ ], n = Jr.bind(null);
225
+ Qr.forEach(function(e) {
226
+ n[e] = n(e);
227
+ });
228
+ const eo = n.span`
229
+ font-size: 12px;
230
+ font-weight: 500;
231
+ color: ${(e) => e.$variant === "normal" ? t.black : t.red};
232
+ `, to = L("field-label"), le = ({
233
+ children: e,
234
+ className: r,
235
+ ref: i,
236
+ required: l,
237
+ variant: d = "normal",
238
+ ...p
239
+ }) => e ? /* @__PURE__ */ w(
240
+ eo,
241
+ {
242
+ ...p,
243
+ ref: i,
244
+ className: to("container", r),
245
+ $variant: d,
246
+ children: [
247
+ e,
248
+ " ",
249
+ l && "*"
250
+ ]
251
+ }
252
+ ) : null, ro = {
253
+ normal: t["iron-grey"],
254
+ error: t.red,
255
+ success: t.green,
256
+ warning: t.yellow
257
+ }, oo = n.span`
258
+ display: block;
259
+ font-size: 12px;
260
+ font-weight: 500;
261
+ line-height: 1.4;
262
+ color: ${(e) => ro[e.$variant]};
263
+ `, io = L("field-message"), ce = ({
264
+ children: e,
265
+ className: r,
266
+ ref: i,
267
+ variant: l = "normal",
268
+ ...d
269
+ }) => e ? /* @__PURE__ */ a(
270
+ oo,
271
+ {
272
+ ...d,
273
+ ref: i,
274
+ className: io("container", r),
275
+ $variant: l,
276
+ children: e
277
+ }
278
+ ) : null, rt = {
279
+ compact: {
280
+ height: "32px",
281
+ padding: "0 10px",
282
+ radius: "14px"
283
+ },
284
+ default: {
285
+ height: "40px",
286
+ padding: "0 14px",
287
+ radius: "16px"
288
+ }
289
+ }, ae = {
290
+ normal: {
291
+ background: {
292
+ static: o(t.black, 2),
293
+ disabled: o(t.black, 10)
294
+ },
295
+ border: {
296
+ static: o(t.black, 60),
297
+ disabled: o(t.black, 10)
298
+ },
299
+ color: {
300
+ static: t.black,
301
+ disabled: o(t.black, 65)
302
+ },
303
+ placeholder: {
304
+ static: o(t.black, 40),
305
+ disabled: o(t.black, 65)
306
+ },
307
+ focus: o(t["iron-grey"], 30)
308
+ },
309
+ error: {
310
+ background: {
311
+ static: o(t.red, 2),
312
+ disabled: o(t.red, 10)
313
+ },
314
+ border: {
315
+ static: o(t.red, 60),
316
+ disabled: o(t.red, 10)
317
+ },
318
+ color: {
319
+ static: t.red,
320
+ disabled: o(t.red, 65)
321
+ },
322
+ placeholder: {
323
+ static: o(t.red, 40),
324
+ disabled: o(t.red, 65)
325
+ },
326
+ focus: o(t.red, 30)
327
+ }
328
+ }, no = n.div`
329
+ position: relative;
330
+ display: grid;
331
+ gap: 2px;
332
+ width: ${(e) => e.$fullWidth ? "100%" : "fit-content"};
333
+ `, ao = n(le)`
334
+ margin-left: 6px;
335
+ `, lo = n(ce)`
336
+ margin-left: 6px;
337
+ `, co = n.div`
338
+ position: relative;
339
+ display: flex;
340
+ align-items: center;
341
+ `, so = n.input`
342
+ flex: 1;
343
+ min-width: 0;
344
+ width: 100%;
345
+ outline: none;
346
+ font-size: 14px;
347
+ font-weight: 500;
348
+ height: ${(e) => rt[e.$size].height};
349
+ padding: ${(e) => rt[e.$size].padding};
350
+ padding-right: 40px;
351
+ border-radius: ${(e) => rt[e.$size].radius};
352
+
353
+ color: ${(e) => ae[e.$variant].color.static};
354
+ border: 1px solid ${(e) => ae[e.$variant].border.static};
355
+ background-color: ${(e) => ae[e.$variant].background.static};
356
+
357
+ &::placeholder {
358
+ color: ${(e) => ae[e.$variant].placeholder.static};
359
+ }
360
+
361
+ &:disabled {
362
+ cursor: not-allowed;
363
+ color: ${(e) => ae[e.$variant].color.disabled};
364
+ background-color: ${(e) => ae[e.$variant].background.disabled};
365
+ border-color: ${(e) => ae[e.$variant].border.disabled};
366
+
367
+ &::placeholder {
368
+ color: ${(e) => ae[e.$variant].placeholder.disabled};
369
+ }
370
+ }
371
+ `, po = n.div`
372
+ position: absolute;
373
+ right: 12px;
374
+ top: 50%;
375
+ transform: translateY(-50%);
376
+ display: flex;
377
+ align-items: center;
378
+ justify-content: center;
379
+ `, uo = n.div`
380
+ position: absolute;
381
+ top: 100%;
382
+ left: 0;
383
+ right: 0;
384
+ z-index: 100;
385
+ margin-top: 4px;
386
+ max-height: 240px;
387
+ overflow-y: auto;
388
+ background-color: ${t.white};
389
+ border: 1px solid ${t.gray};
390
+ border-radius: 12px;
391
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
392
+ opacity: ${({ $open: e }) => e ? 1 : 0};
393
+ visibility: ${({ $open: e }) => e ? "visible" : "hidden"};
394
+ transform: ${({ $open: e }) => e ? "translateY(0)" : "translateY(-8px)"};
395
+ transition:
396
+ opacity 0.15s ease,
397
+ transform 0.15s ease,
398
+ visibility 0.15s;
399
+ `, bo = n.div`
400
+ display: flex;
401
+ align-items: center;
402
+ gap: 10px;
403
+ padding: 10px 14px;
404
+ cursor: pointer;
405
+ font-size: 14px;
406
+ font-weight: 500;
407
+ color: ${t.black};
408
+ transition: background-color 0.1s ease;
409
+
410
+ &:first-of-type {
411
+ border-radius: 12px 12px 0 0;
412
+ }
413
+
414
+ &:last-of-type {
415
+ border-radius: 0 0 12px 12px;
416
+ }
417
+
418
+ &:only-child {
419
+ border-radius: 12px;
420
+ }
421
+
422
+ &:hover {
423
+ background-color: ${o(t.black, 5)};
424
+ }
425
+ `, ho = n.img`
426
+ width: 24px;
427
+ height: 24px;
428
+ border-radius: 6px;
429
+ object-fit: cover;
430
+ `, go = n.span`
431
+ flex: 1;
432
+ overflow: hidden;
433
+ text-overflow: ellipsis;
434
+ white-space: nowrap;
435
+ `, fo = n.div`
436
+ padding: 12px 14px;
437
+ font-size: 14px;
438
+ color: ${o(t.black, 50)};
439
+ text-align: center;
440
+ `, Pt = {
441
+ xs: { size: "16px", borderWidth: "2px" },
442
+ sm: { size: "20px", borderWidth: "2px" },
443
+ md: { size: "32px", borderWidth: "3px" },
444
+ lg: { size: "48px", borderWidth: "4px" }
445
+ }, Ct = {
446
+ track: o(t.black, 15),
447
+ indicator: t.black
448
+ }, ot = (e) => Pt[e] ?? Pt.md, $o = Gr`
449
+ 0% {
450
+ transform: rotate(0deg);
451
+ }
452
+ 100% {
453
+ transform: rotate(360deg);
454
+ }
455
+ `, xo = n.div`
456
+ display: inline-block;
457
+ width: ${(e) => ot(e.$size).size};
458
+ height: ${(e) => ot(e.$size).size};
459
+ border: ${(e) => ot(e.$size).borderWidth} solid ${Ct.track};
460
+ border-top-color: ${Ct.indicator};
461
+ border-radius: 50%;
462
+ animation: ${$o} 0.8s linear infinite;
463
+ `, yo = L("spinner"), ko = ({
464
+ "aria-label": e = "Loading",
465
+ className: r,
466
+ ref: i,
467
+ size: l = "md",
468
+ ...d
469
+ }) => /* @__PURE__ */ a(
470
+ xo,
471
+ {
472
+ ...d,
473
+ ref: i,
474
+ className: yo("container", r),
475
+ role: "status",
476
+ "aria-label": e,
477
+ $size: l
478
+ }
479
+ ), ze = L("autocomplete"), Jn = ({
480
+ className: e,
481
+ classnames: r,
482
+ disabled: i,
483
+ fullWidth: l,
484
+ label: d,
485
+ ref: p,
486
+ message: b,
487
+ size: c = "default",
488
+ variant: h = "normal",
489
+ value: u,
490
+ onChange: $,
491
+ onSearch: g,
492
+ debounceMs: z = 300,
493
+ minChars: S = 1,
494
+ noResultsMessage: C = "No results found",
495
+ ...v
496
+ }) => {
497
+ const [P, D] = B((u == null ? void 0 : u.value) ?? ""), [k, y] = B([]), [s, _] = B(!1), [E, I] = B(!1), [W, H] = B(!1), Y = K(null), V = K(null);
498
+ fe(() => {
499
+ (u == null ? void 0 : u.value) !== void 0 && D(u.value);
500
+ }, [u == null ? void 0 : u.value]);
501
+ const j = A(
502
+ async (O) => {
503
+ if (O.length < S) {
504
+ y([]), H(!1);
505
+ return;
506
+ }
507
+ _(!0), H(!0);
508
+ try {
509
+ const G = await g(O);
510
+ y(G), I(!0);
511
+ } catch {
512
+ y([]);
513
+ } finally {
514
+ _(!1);
515
+ }
516
+ },
517
+ [g, S]
518
+ ), T = A(
519
+ (O) => {
520
+ const G = O.target.value;
521
+ D(G), $ == null || $({ value: G, image_url: null }), V.current && clearTimeout(V.current), V.current = setTimeout(() => {
522
+ j(G);
523
+ }, z);
524
+ },
525
+ [$, j, z]
526
+ ), f = A(
527
+ (O) => {
528
+ D(O.value), y([]), I(!1), H(!1), $ == null || $({ value: O.value, image_url: O.image_url });
529
+ },
530
+ [$]
531
+ ), M = A(() => {
532
+ setTimeout(() => {
533
+ I(!1);
534
+ }, 150);
535
+ }, []), N = A(() => {
536
+ k.length > 0 && I(!0);
537
+ }, [k.length]);
538
+ return fe(() => () => {
539
+ V.current && clearTimeout(V.current);
540
+ }, []), /* @__PURE__ */ w(
541
+ no,
542
+ {
543
+ ref: Y,
544
+ className: ze("container", e),
545
+ $fullWidth: !!l,
546
+ children: [
547
+ d && /* @__PURE__ */ a(ao, { variant: h, className: ze("label", r == null ? void 0 : r.label), children: d }),
548
+ /* @__PURE__ */ w(co, { children: [
549
+ /* @__PURE__ */ a(
550
+ so,
551
+ {
552
+ ...v,
553
+ ref: p,
554
+ type: "text",
555
+ value: P,
556
+ onChange: T,
557
+ onBlur: M,
558
+ onFocus: N,
559
+ disabled: i,
560
+ $size: c,
561
+ $variant: h,
562
+ className: ze("input", r == null ? void 0 : r.input)
563
+ }
564
+ ),
565
+ s && /* @__PURE__ */ a(po, { children: /* @__PURE__ */ a(ko, { size: "xs" }) })
566
+ ] }),
567
+ b && /* @__PURE__ */ a(lo, { variant: h, children: b }),
568
+ /* @__PURE__ */ a(
569
+ uo,
570
+ {
571
+ $open: E && W && !s,
572
+ className: ze("dropdown", r == null ? void 0 : r.dropdown),
573
+ children: k.length > 0 ? k.map((O) => /* @__PURE__ */ w(
574
+ bo,
575
+ {
576
+ onClick: () => f(O),
577
+ className: ze("item", r == null ? void 0 : r.item),
578
+ children: [
579
+ O.image_url && /* @__PURE__ */ a(ho, { src: O.image_url, alt: O.value }),
580
+ /* @__PURE__ */ a(go, { children: O.value })
581
+ ]
582
+ },
583
+ O.id
584
+ )) : !s && /* @__PURE__ */ a(fo, { children: C })
585
+ }
586
+ )
587
+ ]
588
+ }
589
+ );
590
+ }, Nt = {
591
+ compact: {
592
+ height: "32px",
593
+ padding: "0 8px",
594
+ radius: "12px",
595
+ iconSize: "16px"
596
+ },
597
+ default: {
598
+ height: "40px",
599
+ padding: "0 12px",
600
+ radius: "16px",
601
+ iconSize: "20px"
602
+ }
603
+ }, zt = {
604
+ normal: {
605
+ background: {
606
+ static: t["steel-blue"],
607
+ hover: o(t["steel-blue"], 90),
608
+ active: o(t["steel-blue"], 80),
609
+ disabled: o(t["steel-blue"], 50)
610
+ },
611
+ color: {
612
+ static: t.white,
613
+ hover: t.white,
614
+ active: t.white,
615
+ disabled: t.white
616
+ },
617
+ borderColor: {
618
+ static: "transparent",
619
+ hover: "transparent",
620
+ active: "transparent",
621
+ disabled: "transparent"
622
+ }
623
+ },
624
+ system: {
625
+ background: {
626
+ static: t.black,
627
+ hover: o(t.black, 90),
628
+ active: o(t.black, 80),
629
+ disabled: o(t.black, 50)
630
+ },
631
+ color: {
632
+ static: t.white,
633
+ hover: t.white,
634
+ active: t.white,
635
+ disabled: t.white
636
+ },
637
+ borderColor: {
638
+ static: "transparent",
639
+ hover: "transparent",
640
+ active: "transparent",
641
+ disabled: "transparent"
642
+ }
643
+ },
644
+ success: {
645
+ background: {
646
+ static: t.green,
647
+ hover: o(t.green, 90),
648
+ active: o(t.green, 80),
649
+ disabled: o(t.green, 50)
650
+ },
651
+ color: {
652
+ static: t.white,
653
+ hover: t.white,
654
+ active: t.white,
655
+ disabled: t.white
656
+ },
657
+ borderColor: {
658
+ static: "transparent",
659
+ hover: "transparent",
660
+ active: "transparent",
661
+ disabled: "transparent"
662
+ }
663
+ },
664
+ warning: {
665
+ background: {
666
+ static: t.yellow,
667
+ hover: o(t.yellow, 90),
668
+ active: o(t.yellow, 80),
669
+ disabled: o(t.yellow, 50)
670
+ },
671
+ color: {
672
+ static: t.black,
673
+ hover: t.black,
674
+ active: t.black,
675
+ disabled: t.black
676
+ },
677
+ borderColor: {
678
+ static: "transparent",
679
+ hover: "transparent",
680
+ active: "transparent",
681
+ disabled: "transparent"
682
+ }
683
+ },
684
+ danger: {
685
+ background: {
686
+ static: t.red,
687
+ hover: o(t.red, 90),
688
+ active: o(t.red, 80),
689
+ disabled: o(t.red, 50)
690
+ },
691
+ color: {
692
+ static: t.white,
693
+ hover: t.white,
694
+ active: t.white,
695
+ disabled: t.white
696
+ },
697
+ borderColor: {
698
+ static: "transparent",
699
+ hover: "transparent",
700
+ active: "transparent",
701
+ disabled: "transparent"
702
+ }
703
+ },
704
+ transparent: {
705
+ background: {
706
+ static: o(t["iron-grey"], 1),
707
+ hover: o(t["iron-grey"], 5),
708
+ active: o(t["iron-grey"], 10),
709
+ disabled: o(t["iron-grey"], 5)
710
+ },
711
+ color: {
712
+ static: t.black,
713
+ hover: t.black,
714
+ active: t.black,
715
+ disabled: o(t.black, 30)
716
+ },
717
+ borderColor: {
718
+ static: o(t["iron-grey"], 20),
719
+ hover: o(t["iron-grey"], 20),
720
+ active: o(t["iron-grey"], 20),
721
+ disabled: o(t["iron-grey"], 10)
722
+ }
723
+ }
724
+ }, J = (e) => {
725
+ const r = zt[e];
726
+ return r || zt.normal;
727
+ }, ie = (e) => {
728
+ const r = Nt[e];
729
+ return r || Nt.default;
730
+ }, vo = (e) => e ? "auto" : "fit-content", wo = n.button`
731
+ display: flex;
732
+ gap: 6px;
733
+ text-decoration: none;
734
+ align-items: center;
735
+ justify-content: center;
736
+ width: ${(e) => e.$iconOnly ? ie(e.$size).height : vo(!!e.$fullWidth)};
737
+ color: ${(e) => J(e.$variant).color.static};
738
+ background-color: ${(e) => J(e.$variant).background.static};
739
+ height: ${(e) => ie(e.$size).height};
740
+ padding: ${(e) => e.$iconOnly ? "0" : ie(e.$size).padding};
741
+ border-radius: ${(e) => ie(e.$size).radius};
742
+ border: 1px solid ${(e) => J(e.$variant).borderColor.static};
743
+
744
+ &:hover:not(:disabled) {
745
+ color: ${(e) => J(e.$variant).color.hover};
746
+ background-color: ${(e) => J(e.$variant).background.hover};
747
+ border-color: ${(e) => J(e.$variant).borderColor.hover};
748
+ }
749
+
750
+ &:active:not(:disabled) {
751
+ color: ${(e) => J(e.$variant).color.active};
752
+ background-color: ${(e) => J(e.$variant).background.active};
753
+ border-color: ${(e) => J(e.$variant).borderColor.active};
754
+ }
755
+
756
+ &:disabled {
757
+ cursor: not-allowed;
758
+ color: ${(e) => J(e.$variant).color.disabled};
759
+ background-color: ${(e) => J(e.$variant).background.disabled};
760
+ border-color: ${(e) => J(e.$variant).borderColor.disabled};
761
+ }
762
+ `, So = n.div`
763
+ display: grid;
764
+ place-items: center;
765
+ width: ${(e) => ie(e.$size).iconSize};
766
+ height: ${(e) => ie(e.$size).iconSize};
767
+
768
+ & svg {
769
+ width: ${(e) => ie(e.$size).iconSize};
770
+ height: ${(e) => ie(e.$size).iconSize};
771
+ }
772
+ `, mo = n.span`
773
+ font-weight: 600;
774
+ overflow: hidden;
775
+ white-space: nowrap;
776
+ text-overflow: ellipsis;
777
+ `, Po = n(Fr)`
778
+ width: ${(e) => ie(e.$size).iconSize};
779
+ height: ${(e) => ie(e.$size).iconSize};
780
+ animation: ${$t.rotate} 0.8s linear infinite;
781
+ `, Co = n.div`
782
+ display: flex;
783
+ gap: 3px;
784
+ `, No = n.span`
785
+ text-align: center;
786
+ display: flex;
787
+ justify-content: center;
788
+ align-items: center;
789
+ font-size: 12px;
790
+ height: 18px;
791
+ min-width: 18px;
792
+ line-height: 1.6;
793
+ padding: 2px 4px;
794
+ border-radius: 4px;
795
+ width: fit-content;
796
+ background-color: ${(e) => e.$variant === "light" ? o(t.white, 25) : o(t.black, 25)};
797
+ `, zo = L("key-symbol"), To = ({
798
+ className: e,
799
+ ref: r,
800
+ symbol: i,
801
+ variant: l = "light",
802
+ ...d
803
+ }) => i ? /* @__PURE__ */ a(No, { ...d, ref: r, className: zo("container", e), $variant: l, children: i }) : null, Tt = L("key-bindings"), Do = ({
804
+ className: e,
805
+ classnames: r,
806
+ keys: i,
807
+ ref: l,
808
+ variant: d,
809
+ ...p
810
+ }) => {
811
+ const b = oe(() => Br(i), [i]);
812
+ return b.length === 0 ? null : /* @__PURE__ */ a(Co, { ...p, ref: l, className: Tt("container", e), children: b.map((c) => /* @__PURE__ */ a(
813
+ To,
814
+ {
815
+ symbol: c,
816
+ className: Tt("item", r == null ? void 0 : r.item),
817
+ variant: d
818
+ },
819
+ c
820
+ )) });
821
+ }, Dt = L("button"), Oo = ({
822
+ children: e,
823
+ className: r,
824
+ classnames: i,
825
+ disabled: l,
826
+ fullWidth: d,
827
+ icon: p,
828
+ loading: b,
829
+ onClick: c,
830
+ ref: h = null,
831
+ keyBindings: u = [],
832
+ size: $ = "default",
833
+ type: g = "button",
834
+ variant: z = "normal",
835
+ ...S
836
+ }) => {
837
+ const C = K(null);
838
+ Vr(h, () => C.current, []), Hr(u, () => {
839
+ var P;
840
+ (P = C.current) == null || P.click();
841
+ });
842
+ const v = oe(() => {
843
+ switch (g) {
844
+ case "link":
845
+ return "button";
846
+ default:
847
+ return g;
848
+ }
849
+ }, [g]);
850
+ return /* @__PURE__ */ w(
851
+ wo,
852
+ {
853
+ ...S,
854
+ onClick: c,
855
+ ref: C,
856
+ type: v,
857
+ disabled: l,
858
+ className: Dt("container", r),
859
+ $variant: z,
860
+ $size: $,
861
+ $fullWidth: !!d,
862
+ $iconOnly: !!p && !(e || (u == null ? void 0 : u.length) > 0),
863
+ children: [
864
+ b && /* @__PURE__ */ a(Po, { $size: $ }),
865
+ p && !b && /* @__PURE__ */ a(So, { $size: $, children: p }),
866
+ e && /* @__PURE__ */ a(mo, { className: Dt("label", i == null ? void 0 : i.label), children: e }),
867
+ /* @__PURE__ */ a(Do, { keys: u, variant: z === "system" ? "light" : "dark" })
868
+ ]
869
+ }
870
+ );
871
+ }, Ot = {
872
+ normal: {
873
+ box: {
874
+ border: o(t["iron-grey"], 30),
875
+ borderChecked: t["iron-grey"],
876
+ background: t.white,
877
+ backgroundChecked: t.black,
878
+ focusShadow: o(t["iron-grey"], 30)
879
+ },
880
+ label: t.black,
881
+ icon: t.white
882
+ },
883
+ error: {
884
+ box: {
885
+ border: t.red,
886
+ borderChecked: t.red,
887
+ background: t.white,
888
+ backgroundChecked: t.red,
889
+ focusShadow: o(t.red, 30)
890
+ },
891
+ label: t.red,
892
+ icon: t.white
893
+ }
894
+ }, we = (e) => Ot[e] ?? Ot.normal, Ro = n.label`
895
+ display: inline-flex;
896
+ align-items: flex-start;
897
+ gap: 8px;
898
+ cursor: ${(e) => e.$disabled ? "not-allowed" : "pointer"};
899
+ opacity: ${(e) => e.$disabled ? 0.5 : 1};
900
+ `, Io = n.input`
901
+ position: absolute;
902
+ opacity: 0;
903
+ width: 0;
904
+ height: 0;
905
+ pointer-events: none;
906
+ `, _o = n.span`
907
+ display: inline-flex;
908
+ align-items: center;
909
+ justify-content: center;
910
+ flex-shrink: 0;
911
+ width: 18px;
912
+ height: 18px;
913
+ border-radius: 6px;
914
+ border: 1.5px solid
915
+ ${(e) => e.$checked || e.$indeterminate ? we(e.$variant).box.borderChecked : we(e.$variant).box.border};
916
+ background-color: ${(e) => e.$checked || e.$indeterminate ? we(e.$variant).box.backgroundChecked : we(e.$variant).box.background};
917
+ transition:
918
+ border-color 0.15s ease,
919
+ background-color 0.15s ease,
920
+ box-shadow 0.15s ease;
921
+ `, Ao = n.span`
922
+ display: inline-flex;
923
+ align-items: center;
924
+ justify-content: center;
925
+ color: ${(e) => we(e.$variant).icon};
926
+ opacity: ${(e) => e.$visible ? 1 : 0};
927
+ transform: ${(e) => e.$visible ? "scale(1)" : "scale(0.5)"};
928
+ transition:
929
+ opacity 0.15s ease,
930
+ transform 0.15s ease;
931
+
932
+ & svg {
933
+ width: 12px;
934
+ height: 12px;
935
+ }
936
+ `, Eo = n.span`
937
+ font-size: 14px;
938
+ font-weight: 500;
939
+ line-height: 1.3;
940
+ color: ${(e) => we(e.$variant).label};
941
+ user-select: none;
942
+
943
+ a {
944
+ color: inherit;
945
+ text-decoration: underline;
946
+ cursor: pointer;
947
+
948
+ &:hover {
949
+ text-decoration: none;
950
+ }
951
+ }
952
+ `, Te = L("checkbox"), xt = ({
953
+ checked: e,
954
+ className: r,
955
+ classnames: i,
956
+ disabled: l,
957
+ indeterminate: d = !1,
958
+ label: p,
959
+ onChange: b,
960
+ ref: c,
961
+ variant: h = "normal",
962
+ ...u
963
+ }) => /* @__PURE__ */ w(
964
+ Ro,
965
+ {
966
+ className: Te("container", r),
967
+ $disabled: !!l,
968
+ $variant: h,
969
+ children: [
970
+ /* @__PURE__ */ a(
971
+ Io,
972
+ {
973
+ ...u,
974
+ ref: c,
975
+ type: "checkbox",
976
+ className: Te("input", i == null ? void 0 : i.input),
977
+ checked: e,
978
+ disabled: l,
979
+ onChange: b
980
+ }
981
+ ),
982
+ /* @__PURE__ */ a(
983
+ _o,
984
+ {
985
+ className: Te("box", i == null ? void 0 : i.box),
986
+ $checked: e,
987
+ $indeterminate: d,
988
+ $variant: h,
989
+ children: /* @__PURE__ */ a(
990
+ Ao,
991
+ {
992
+ className: Te("icon", i == null ? void 0 : i.icon),
993
+ $visible: d || e,
994
+ $variant: h,
995
+ children: d ? /* @__PURE__ */ a(Yr, {}) : /* @__PURE__ */ a(rr, {})
996
+ }
997
+ )
998
+ }
999
+ ),
1000
+ p && /* @__PURE__ */ a(Eo, { className: Te("label", i == null ? void 0 : i.label), $variant: h, children: p })
1001
+ ]
1002
+ }
1003
+ ), Rt = {
1004
+ normal: {
1005
+ border: {
1006
+ static: o(t.black, 20),
1007
+ hover: o(t.black, 40),
1008
+ active: o(t.black, 40),
1009
+ disabled: o(t.black, 10)
1010
+ },
1011
+ borderChecked: t.black,
1012
+ background: {
1013
+ static: t.white,
1014
+ hover: t.white,
1015
+ active: t.white,
1016
+ disabled: o(t.black, 5)
1017
+ },
1018
+ backgroundChecked: o(t.black, 5),
1019
+ focusRing: o(t.black, 20),
1020
+ label: {
1021
+ static: t.black,
1022
+ hover: t.black,
1023
+ active: t.black,
1024
+ disabled: o(t.black, 40)
1025
+ },
1026
+ description: {
1027
+ static: o(t.black, 60),
1028
+ hover: o(t.black, 60),
1029
+ active: o(t.black, 60),
1030
+ disabled: o(t.black, 30)
1031
+ }
1032
+ },
1033
+ error: {
1034
+ border: {
1035
+ static: t.red,
1036
+ hover: t.red,
1037
+ active: t.red,
1038
+ disabled: o(t.red, 30)
1039
+ },
1040
+ borderChecked: t.red,
1041
+ background: {
1042
+ static: t.white,
1043
+ hover: t.white,
1044
+ active: t.white,
1045
+ disabled: o(t.red, 5)
1046
+ },
1047
+ backgroundChecked: o(t.red, 5),
1048
+ focusRing: o(t.red, 20),
1049
+ label: {
1050
+ static: t.red,
1051
+ hover: t.red,
1052
+ active: t.red,
1053
+ disabled: o(t.red, 40)
1054
+ },
1055
+ description: {
1056
+ static: o(t.red, 70),
1057
+ hover: o(t.red, 70),
1058
+ active: o(t.red, 70),
1059
+ disabled: o(t.red, 40)
1060
+ }
1061
+ }
1062
+ }, be = (e) => Rt[e] ?? Rt.normal, Lo = n.label`
1063
+ display: grid;
1064
+ grid-template-columns: auto 1fr;
1065
+ align-items: start;
1066
+ gap: 8px;
1067
+ padding: 12px;
1068
+ background-color: ${(e) => {
1069
+ const r = be(e.$variant);
1070
+ return e.$disabled ? r.background.disabled : e.$checked ? r.backgroundChecked : r.background.static;
1071
+ }};
1072
+ border: 1px solid
1073
+ ${(e) => {
1074
+ const r = be(e.$variant);
1075
+ return e.$disabled ? r.border.disabled : e.$checked ? r.borderChecked : r.border.static;
1076
+ }};
1077
+ border-radius: 12px;
1078
+ cursor: ${(e) => e.$disabled ? "not-allowed" : "pointer"};
1079
+ transition:
1080
+ border-color 0.15s ease,
1081
+ background-color 0.15s ease;
1082
+ width: ${(e) => e.$fullWidth ? "100%" : "fit-content"};
1083
+ min-width: 0;
1084
+
1085
+ &:hover:not([data-disabled='true']) {
1086
+ border-color: ${(e) => {
1087
+ const r = be(e.$variant);
1088
+ return e.$checked ? r.borderChecked : r.border.hover;
1089
+ }};
1090
+ }
1091
+
1092
+ .vacano_checkbox_container {
1093
+ pointer-events: none;
1094
+ }
1095
+ `, Mo = n.input`
1096
+ position: absolute;
1097
+ width: 1px;
1098
+ height: 1px;
1099
+ margin: -1px;
1100
+ padding: 0;
1101
+ overflow: hidden;
1102
+ clip: rect(0, 0, 0, 0);
1103
+ white-space: nowrap;
1104
+ border: 0;
1105
+ `, Fo = n.div`
1106
+ display: flex;
1107
+ flex-direction: column;
1108
+ gap: 2px;
1109
+ min-width: 0;
1110
+ `, Yo = n.span`
1111
+ font-size: 14px;
1112
+ font-weight: 500;
1113
+ line-height: 1.4;
1114
+ color: ${(e) => be(e.$variant).label.static};
1115
+
1116
+ label[data-disabled='true'] & {
1117
+ color: ${(e) => be(e.$variant).label.disabled};
1118
+ }
1119
+ `, Vo = n.span`
1120
+ font-size: 12px;
1121
+ font-weight: 400;
1122
+ line-height: 1.4;
1123
+ color: ${(e) => be(e.$variant).description.static};
1124
+
1125
+ label[data-disabled='true'] & {
1126
+ color: ${(e) => be(e.$variant).description.disabled};
1127
+ }
1128
+ `, Ve = L("checkbox-card"), Qn = ({
1129
+ checked: e,
1130
+ className: r,
1131
+ classnames: i,
1132
+ description: l,
1133
+ disabled: d,
1134
+ fullWidth: p = !1,
1135
+ label: b,
1136
+ onChange: c,
1137
+ ref: h,
1138
+ variant: u = "normal",
1139
+ ...$
1140
+ }) => /* @__PURE__ */ w(
1141
+ Lo,
1142
+ {
1143
+ className: Ve("container", r),
1144
+ $checked: e,
1145
+ $disabled: !!d,
1146
+ $fullWidth: p,
1147
+ $variant: u,
1148
+ "data-disabled": d,
1149
+ children: [
1150
+ /* @__PURE__ */ a(
1151
+ Mo,
1152
+ {
1153
+ ...$,
1154
+ ref: h,
1155
+ type: "checkbox",
1156
+ checked: e,
1157
+ disabled: d,
1158
+ onChange: c
1159
+ }
1160
+ ),
1161
+ /* @__PURE__ */ a(
1162
+ xt,
1163
+ {
1164
+ className: i == null ? void 0 : i.checkbox,
1165
+ checked: e,
1166
+ disabled: d,
1167
+ variant: u,
1168
+ onChange: () => {
1169
+ },
1170
+ tabIndex: -1,
1171
+ "aria-hidden": !0
1172
+ }
1173
+ ),
1174
+ /* @__PURE__ */ w(Fo, { className: Ve("content", i == null ? void 0 : i.content), children: [
1175
+ /* @__PURE__ */ a(Yo, { className: Ve("label", i == null ? void 0 : i.label), $variant: u, children: b }),
1176
+ l && /* @__PURE__ */ a(
1177
+ Vo,
1178
+ {
1179
+ className: Ve("description", i == null ? void 0 : i.description),
1180
+ $variant: u,
1181
+ children: l
1182
+ }
1183
+ )
1184
+ ] })
1185
+ ]
1186
+ }
1187
+ ), It = {
1188
+ label: {
1189
+ color: t.black,
1190
+ disabledColor: o(t.black, 40)
1191
+ }
1192
+ }, Bo = n.div`
1193
+ display: flex;
1194
+ flex-direction: column;
1195
+ gap: 8px;
1196
+ `, Ho = n.span`
1197
+ font-size: 13px;
1198
+ font-weight: 500;
1199
+ line-height: 1.5;
1200
+ color: ${(e) => e.$disabled ? It.label.disabledColor : It.label.color};
1201
+ margin-bottom: 4px;
1202
+ `, Wo = n.div`
1203
+ display: flex;
1204
+ flex-direction: column;
1205
+ gap: 12px;
1206
+ `, it = L("checkbox-group"), ea = ({
1207
+ className: e,
1208
+ classnames: r,
1209
+ disabled: i,
1210
+ label: l,
1211
+ onChange: d,
1212
+ options: p,
1213
+ ref: b,
1214
+ value: c,
1215
+ variant: h = "normal",
1216
+ ...u
1217
+ }) => {
1218
+ const $ = (g, z) => {
1219
+ d(z ? [...c, g] : c.filter((S) => S !== g));
1220
+ };
1221
+ return /* @__PURE__ */ w(Bo, { ...u, ref: b, className: it("container", e), children: [
1222
+ l && /* @__PURE__ */ a(Ho, { className: it("label", r == null ? void 0 : r.label), $disabled: i, children: l }),
1223
+ /* @__PURE__ */ a(Wo, { className: it("options", r == null ? void 0 : r.options), children: p.map((g) => /* @__PURE__ */ a(
1224
+ xt,
1225
+ {
1226
+ className: r == null ? void 0 : r.checkbox,
1227
+ checked: c.includes(g.value),
1228
+ label: g.label,
1229
+ disabled: i,
1230
+ variant: h,
1231
+ onChange: (z) => $(g.value, z.target.checked)
1232
+ },
1233
+ g.value
1234
+ )) })
1235
+ ] });
1236
+ }, _t = {
1237
+ gray: {
1238
+ background: o(t["iron-grey"], 10),
1239
+ color: t["iron-grey"],
1240
+ deleteHover: o(t["iron-grey"], 20)
1241
+ },
1242
+ red: {
1243
+ background: o(t.red, 10),
1244
+ color: t.red,
1245
+ deleteHover: o(t.red, 20)
1246
+ },
1247
+ blue: {
1248
+ background: o(t["steel-blue"], 10),
1249
+ color: t["steel-blue"],
1250
+ deleteHover: o(t["steel-blue"], 20)
1251
+ },
1252
+ black: {
1253
+ background: t.black,
1254
+ color: t.white,
1255
+ deleteHover: o(t.white, 20)
1256
+ }
1257
+ }, ht = (e) => _t[e] ?? _t.gray, jo = n.span`
1258
+ display: inline-flex;
1259
+ align-items: center;
1260
+ gap: 6px;
1261
+ padding: 0 ${(e) => e.$deletable ? "7px" : "10px"} 0 10px;
1262
+ border-radius: 12px;
1263
+ height: 24px;
1264
+ font-size: 12px;
1265
+ font-weight: 500;
1266
+ line-height: 1.5;
1267
+ background-color: ${(e) => ht(e.$variant).background};
1268
+ color: ${(e) => ht(e.$variant).color};
1269
+ `, Go = n.button`
1270
+ display: inline-flex;
1271
+ align-items: center;
1272
+ justify-content: center;
1273
+ padding: 0;
1274
+ margin: 0;
1275
+ margin-left: 2px;
1276
+ border: none;
1277
+ background: transparent;
1278
+ color: inherit;
1279
+ cursor: pointer;
1280
+ border-radius: 4px;
1281
+ transition: background-color 0.15s ease;
1282
+
1283
+ &:hover {
1284
+ background-color: ${(e) => ht(e.$variant).deleteHover};
1285
+ }
1286
+
1287
+ & svg {
1288
+ width: 14px;
1289
+ height: 14px;
1290
+ }
1291
+ `, Uo = n.span`
1292
+ display: inline-flex;
1293
+ align-items: center;
1294
+ justify-content: center;
1295
+ flex-shrink: 0;
1296
+
1297
+ & svg {
1298
+ width: 14px;
1299
+ height: 14px;
1300
+ }
1301
+ `, Ko = n.span`
1302
+ flex: 1 0 auto;
1303
+ text-align: center;
1304
+ line-height: 1.4;
1305
+ `, Be = L("chip"), gt = ({
1306
+ children: e,
1307
+ className: r,
1308
+ classnames: i,
1309
+ deletable: l,
1310
+ icon: d,
1311
+ onDelete: p,
1312
+ ref: b,
1313
+ variant: c = "gray",
1314
+ ...h
1315
+ }) => /* @__PURE__ */ w(
1316
+ jo,
1317
+ {
1318
+ ...h,
1319
+ ref: b,
1320
+ className: Be("container", r),
1321
+ $variant: c,
1322
+ $deletable: !!l,
1323
+ children: [
1324
+ d && /* @__PURE__ */ a(Uo, { className: Be("icon", i == null ? void 0 : i.icon), children: d }),
1325
+ /* @__PURE__ */ a(Ko, { className: Be("label", i == null ? void 0 : i.label), children: e }),
1326
+ l && /* @__PURE__ */ a(
1327
+ Go,
1328
+ {
1329
+ type: "button",
1330
+ className: Be("delete", i == null ? void 0 : i.delete),
1331
+ $variant: c,
1332
+ onClick: p,
1333
+ children: /* @__PURE__ */ a(or, {})
1334
+ }
1335
+ )
1336
+ ]
1337
+ }
1338
+ ), qe = {
1339
+ compact: {
1340
+ height: "32px",
1341
+ padding: "0 10px",
1342
+ radius: "14px",
1343
+ iconSize: 16
1344
+ },
1345
+ default: {
1346
+ height: "40px",
1347
+ padding: "0 14px",
1348
+ radius: "16px",
1349
+ iconSize: 20
1350
+ }
1351
+ }, De = {
1352
+ normal: {
1353
+ background: {
1354
+ static: o(t.black, 2),
1355
+ disabled: o(t.black, 10)
1356
+ },
1357
+ border: {
1358
+ static: o(t.black, 60),
1359
+ disabled: o(t.black, 10)
1360
+ },
1361
+ color: {
1362
+ static: t.black,
1363
+ disabled: o(t.black, 65)
1364
+ },
1365
+ placeholder: {
1366
+ static: o(t.black, 40),
1367
+ disabled: o(t.black, 65)
1368
+ },
1369
+ focus: o(t["iron-grey"], 30)
1370
+ },
1371
+ error: {
1372
+ background: {
1373
+ static: o(t.red, 2),
1374
+ disabled: o(t.red, 10)
1375
+ },
1376
+ border: {
1377
+ static: o(t.red, 60),
1378
+ disabled: o(t.red, 10)
1379
+ },
1380
+ color: {
1381
+ static: t.red,
1382
+ disabled: o(t.red, 65)
1383
+ },
1384
+ placeholder: {
1385
+ static: o(t.red, 40),
1386
+ disabled: o(t.red, 65)
1387
+ },
1388
+ focus: o(t.red, 30)
1389
+ }
1390
+ }, ne = 36, Je = 2, Xo = 12, qo = (e, r, i = "en") => {
1391
+ const l = e.getFullYear(), d = e.getMonth(), p = e.getDate(), b = e.getHours(), c = e.getMinutes(), h = e.getSeconds(), u = b % 12 || 12, $ = b >= 12, g = new Intl.DateTimeFormat(i, { month: "long" }).format(e), z = new Intl.DateTimeFormat(i, { month: "short" }).format(e), S = new Intl.DateTimeFormat(i, { weekday: "long" }).format(e), C = new Intl.DateTimeFormat(i, { weekday: "short" }).format(e), v = (s) => s.toString().padStart(2, "0"), P = (s) => s.toString().padStart(2, " "), D = (s) => `\0${s}\0`, k = [
1392
+ ["2006", "YEARFOUR", l.toString()],
1393
+ ["January", "MONTHLONG", g],
1394
+ ["Monday", "WEEKDAYLONG", S],
1395
+ ["Jan", "MONTHSHORT", z],
1396
+ ["Mon", "WEEKDAYSHORT", C],
1397
+ ["06", "YEARTWO", l.toString().slice(-2)],
1398
+ ["01", "MONTHPAD", v(d + 1)],
1399
+ ["_2", "DAYSPACE", P(p)],
1400
+ ["02", "DAYPAD", v(p)],
1401
+ ["15", "HOURTWENTYFOUR", v(b)],
1402
+ ["03", "HOURTWELVEPAD", v(u)],
1403
+ ["04", "MINUTE", v(c)],
1404
+ ["05", "SECOND", v(h)],
1405
+ ["PM", "AMPMUP", $ ? "PM" : "AM"],
1406
+ ["pm", "AMPMLOW", $ ? "pm" : "am"],
1407
+ // Single character tokens must come last
1408
+ ["1", "MONTH", (d + 1).toString()],
1409
+ ["2", "DAY", p.toString()],
1410
+ ["3", "HOURTWELVE", u.toString()]
1411
+ ];
1412
+ let y = r;
1413
+ for (const [s, _] of k)
1414
+ y = y.split(s).join(D(_));
1415
+ for (const [, s, _] of k)
1416
+ y = y.split(D(s)).join(_);
1417
+ return y;
1418
+ }, Zo = (e, r) => new Date(e, r + 1, 0).getDate(), Jo = (e, r) => new Date(e, r, 1).getDay(), Qo = (e, r, i = 1) => {
1419
+ const l = Zo(e, r);
1420
+ let p = Jo(e, r) - i;
1421
+ p < 0 && (p += 7);
1422
+ const b = [];
1423
+ for (let c = 0; c < p; c++)
1424
+ b.push(null);
1425
+ for (let c = 1; c <= l; c++)
1426
+ b.push(c);
1427
+ for (; b.length < 42; )
1428
+ b.push(null);
1429
+ return b;
1430
+ }, ei = (e, r = 1) => {
1431
+ const i = [];
1432
+ for (let l = 0; l < 7; l++) {
1433
+ const d = (r + l) % 7, p = new Date(2024, 0, 7 + d);
1434
+ i.push(new Intl.DateTimeFormat(e, { weekday: "short" }).format(p));
1435
+ }
1436
+ return i;
1437
+ }, ti = (e) => {
1438
+ const r = [];
1439
+ for (let i = 0; i < 12; i++) {
1440
+ const l = new Date(2024, i, 1);
1441
+ r.push(new Intl.DateTimeFormat(e, { month: "short" }).format(l));
1442
+ }
1443
+ return r;
1444
+ }, At = (e, r) => e.getFullYear() === r.getFullYear() && e.getMonth() === r.getMonth() && e.getDate() === r.getDate(), Et = (e, r) => e.getFullYear() === r.getFullYear() && e.getMonth() === r.getMonth(), ri = (e, r) => e.getFullYear() === r.getFullYear(), Lt = (e, r, i, l, d) => {
1445
+ const p = new Date(e, r, i);
1446
+ if (l) {
1447
+ const b = new Date(l.getFullYear(), l.getMonth(), l.getDate());
1448
+ if (p < b) return !0;
1449
+ }
1450
+ if (d) {
1451
+ const b = new Date(d.getFullYear(), d.getMonth(), d.getDate());
1452
+ if (p > b) return !0;
1453
+ }
1454
+ return !1;
1455
+ }, Mt = (e, r, i, l) => {
1456
+ if (i) {
1457
+ const d = i.getFullYear(), p = i.getMonth();
1458
+ if (e < d || e === d && r < p) return !0;
1459
+ }
1460
+ if (l) {
1461
+ const d = l.getFullYear(), p = l.getMonth();
1462
+ if (e > d || e === d && r > p) return !0;
1463
+ }
1464
+ return !1;
1465
+ }, Ft = (e, r, i) => !!(r && e < r.getFullYear() || i && e > i.getFullYear()), oi = (e, r = 12) => {
1466
+ const i = e - Math.floor(r / 2), l = [];
1467
+ for (let d = 0; d < r; d++)
1468
+ l.push(i + d);
1469
+ return l;
1470
+ }, ii = (e) => {
1471
+ switch (e) {
1472
+ case "date":
1473
+ return "02.01.2006";
1474
+ case "month":
1475
+ return "January 2006";
1476
+ case "year":
1477
+ return "2006";
1478
+ }
1479
+ }, ni = n.div`
1480
+ position: relative;
1481
+ display: inline-flex;
1482
+ flex-direction: column;
1483
+ gap: 2px;
1484
+ min-width: 180px;
1485
+ width: ${({ $fullWidth: e }) => e ? "100%" : "fit-content"};
1486
+ `, ai = n(le)`
1487
+ margin-left: 6px;
1488
+ `, di = n(ce)`
1489
+ margin-left: 6px;
1490
+ `, li = n.button`
1491
+ display: flex;
1492
+ align-items: center;
1493
+ justify-content: space-between;
1494
+ gap: 8px;
1495
+ width: 100%;
1496
+ cursor: ${({ $disabled: e }) => e ? "not-allowed" : "pointer"};
1497
+ outline: none;
1498
+ font-size: 14px;
1499
+ font-weight: 500;
1500
+ text-align: left;
1501
+ height: ${({ $size: e }) => qe[e].height};
1502
+ padding: ${({ $size: e }) => qe[e].padding};
1503
+ border-radius: ${({ $size: e }) => qe[e].radius};
1504
+ color: ${({ $variant: e, $disabled: r, $hasValue: i }) => i ? De[e].color[r ? "disabled" : "static"] : De[e].placeholder[r ? "disabled" : "static"]};
1505
+ border: 1px solid
1506
+ ${({ $variant: e, $disabled: r }) => De[e].border[r ? "disabled" : "static"]};
1507
+ background-color: ${({ $variant: e, $disabled: r }) => De[e].background[r ? "disabled" : "static"]};
1508
+
1509
+ ${({ $open: e, $variant: r }) => e && `
1510
+ outline: 2px solid ${De[r].focus};
1511
+ `}
1512
+ `, ci = n.span`
1513
+ flex: 1;
1514
+ overflow: hidden;
1515
+ text-overflow: ellipsis;
1516
+ white-space: nowrap;
1517
+ `, si = n.span`
1518
+ display: flex;
1519
+ align-items: center;
1520
+ justify-content: center;
1521
+ flex-shrink: 0;
1522
+ transition: transform 0.15s ease;
1523
+ transform: ${({ $open: e }) => e ? "rotate(180deg)" : "rotate(0deg)"};
1524
+ `, ar = `
1525
+ z-index: 100;
1526
+ background-color: ${t.white};
1527
+ border: 1px solid ${o(t.black, 15)};
1528
+ border-radius: 12px;
1529
+ box-shadow: 0 4px 16px ${o(t.black, 12)};
1530
+ padding: ${Xo}px;
1531
+ `, dr = (e, r) => e ? "translateY(0)" : r === "bottom" ? "translateY(-8px)" : "translateY(8px)", pi = n.div`
1532
+ position: absolute;
1533
+ ${({ $position: e }) => e === "bottom" ? "top: calc(100% + 4px);" : "bottom: calc(100% + 4px);"}
1534
+ left: 0;
1535
+ ${ar}
1536
+ opacity: ${({ $open: e }) => e ? 1 : 0};
1537
+ visibility: ${({ $open: e }) => e ? "visible" : "hidden"};
1538
+ transform: ${({ $open: e, $position: r }) => dr(e, r)};
1539
+ transition:
1540
+ opacity 0.15s ease,
1541
+ transform 0.15s ease,
1542
+ visibility 0.15s;
1543
+ `, ui = n.div`
1544
+ position: fixed;
1545
+ ${ar}
1546
+ opacity: ${({ $open: e }) => e ? 1 : 0};
1547
+ visibility: ${({ $open: e }) => e ? "visible" : "hidden"};
1548
+ transform: ${({ $open: e, $position: r }) => dr(e, r)};
1549
+ transition:
1550
+ opacity 0.15s ease,
1551
+ transform 0.15s ease,
1552
+ visibility 0.15s;
1553
+ `, nt = n.div`
1554
+ display: flex;
1555
+ align-items: center;
1556
+ justify-content: space-between;
1557
+ margin-bottom: 8px;
1558
+ `, at = n.button`
1559
+ display: flex;
1560
+ align-items: center;
1561
+ gap: 4px;
1562
+ padding: 4px 8px;
1563
+ border: none;
1564
+ background: transparent;
1565
+ border-radius: 6px;
1566
+ font-size: 14px;
1567
+ font-weight: 600;
1568
+ color: ${t.black};
1569
+ cursor: pointer;
1570
+
1571
+ &:hover {
1572
+ background-color: ${o(t.black, 5)};
1573
+ }
1574
+ `, ye = n.button`
1575
+ display: flex;
1576
+ align-items: center;
1577
+ justify-content: center;
1578
+ width: 28px;
1579
+ height: 28px;
1580
+ border: none;
1581
+ background: transparent;
1582
+ border-radius: 6px;
1583
+ color: ${t.black};
1584
+ cursor: pointer;
1585
+
1586
+ &:hover {
1587
+ background-color: ${o(t.black, 5)};
1588
+ }
1589
+
1590
+ &:disabled {
1591
+ opacity: 0.3;
1592
+ cursor: not-allowed;
1593
+
1594
+ &:hover {
1595
+ background: transparent;
1596
+ }
1597
+ }
1598
+ `, dt = n.div`
1599
+ display: flex;
1600
+ gap: 4px;
1601
+ `, bi = n.div`
1602
+ display: grid;
1603
+ grid-template-columns: repeat(7, ${ne}px);
1604
+ gap: ${Je}px;
1605
+ margin-bottom: 4px;
1606
+ `, hi = n.div`
1607
+ display: flex;
1608
+ align-items: center;
1609
+ justify-content: center;
1610
+ height: ${ne}px;
1611
+ font-size: 12px;
1612
+ font-weight: 500;
1613
+ color: ${o(t.black, 50)};
1614
+ text-transform: uppercase;
1615
+ `, gi = n.div`
1616
+ display: grid;
1617
+ grid-template-columns: repeat(7, ${ne}px);
1618
+ gap: ${Je}px;
1619
+ `, fi = n.button`
1620
+ display: flex;
1621
+ align-items: center;
1622
+ justify-content: center;
1623
+ width: ${ne}px;
1624
+ height: ${ne}px;
1625
+ border: none;
1626
+ border-radius: 8px;
1627
+ font-size: 13px;
1628
+ font-weight: ${({ $selected: e, $today: r }) => e || r ? 600 : 500};
1629
+ cursor: ${({ $disabled: e }) => e ? "not-allowed" : "pointer"};
1630
+ background-color: ${({ $selected: e }) => e ? t.black : "transparent"};
1631
+ color: ${({ $selected: e, $disabled: r }) => e ? t.white : r ? o(t.black, 30) : t.black};
1632
+
1633
+ ${({ $today: e, $selected: r }) => e && !r && `
1634
+ box-shadow: inset 0 0 0 1px ${t.black};
1635
+ `}
1636
+
1637
+ &:hover:not(:disabled) {
1638
+ background-color: ${({ $selected: e }) => e ? t.black : o(t.black, 8)};
1639
+ }
1640
+
1641
+ &:disabled {
1642
+ cursor: not-allowed;
1643
+ }
1644
+ `, $i = n.div`
1645
+ display: grid;
1646
+ grid-template-columns: repeat(3, 1fr);
1647
+ gap: 8px;
1648
+ width: ${7 * ne + 6 * Je}px;
1649
+ `, xi = n.button`
1650
+ display: flex;
1651
+ align-items: center;
1652
+ justify-content: center;
1653
+ padding: 12px 8px;
1654
+ border: none;
1655
+ border-radius: 8px;
1656
+ font-size: 14px;
1657
+ font-weight: ${({ $selected: e, $current: r }) => e || r ? 600 : 400};
1658
+ cursor: ${({ $disabled: e }) => e ? "not-allowed" : "pointer"};
1659
+ background-color: ${({ $selected: e }) => e ? t.black : "transparent"};
1660
+ color: ${({ $selected: e, $disabled: r }) => e ? t.white : r ? o(t.black, 30) : t.black};
1661
+
1662
+ ${({ $current: e, $selected: r }) => e && !r && `
1663
+ box-shadow: inset 0 0 0 1px ${t.black};
1664
+ `}
1665
+
1666
+ &:hover:not(:disabled) {
1667
+ background-color: ${({ $selected: e }) => e ? t.black : o(t.black, 8)};
1668
+ }
1669
+ `, yi = n.div`
1670
+ display: grid;
1671
+ grid-template-columns: repeat(3, 1fr);
1672
+ gap: 8px;
1673
+ width: ${7 * ne + 6 * Je}px;
1674
+ `, ki = n.button`
1675
+ display: flex;
1676
+ align-items: center;
1677
+ justify-content: center;
1678
+ padding: 12px 8px;
1679
+ border: none;
1680
+ border-radius: 8px;
1681
+ font-size: 14px;
1682
+ font-weight: ${({ $selected: e, $current: r }) => e || r ? 600 : 400};
1683
+ cursor: ${({ $disabled: e }) => e ? "not-allowed" : "pointer"};
1684
+ background-color: ${({ $selected: e }) => e ? t.black : "transparent"};
1685
+ color: ${({ $selected: e, $disabled: r }) => e ? t.white : r ? o(t.black, 30) : t.black};
1686
+
1687
+ ${({ $current: e, $selected: r }) => e && !r && `
1688
+ box-shadow: inset 0 0 0 1px ${t.black};
1689
+ `}
1690
+
1691
+ &:hover:not(:disabled) {
1692
+ background-color: ${({ $selected: e }) => e ? t.black : o(t.black, 8)};
1693
+ }
1694
+ `, vi = n.div`
1695
+ width: ${ne}px;
1696
+ height: ${ne}px;
1697
+ `, q = L("date-picker"), He = 4, wi = 300, ta = ({
1698
+ value: e,
1699
+ onChange: r,
1700
+ mode: i = "date",
1701
+ displayFormat: l,
1702
+ placeholder: d,
1703
+ locale: p = "en",
1704
+ weekStartsOn: b = 1,
1705
+ minDate: c,
1706
+ maxDate: h,
1707
+ size: u = "default",
1708
+ variant: $ = "normal",
1709
+ disabled: g = !1,
1710
+ fullWidth: z = !1,
1711
+ label: S,
1712
+ message: C,
1713
+ portalRenderNode: v,
1714
+ open: P,
1715
+ onOpen: D,
1716
+ onClose: k,
1717
+ className: y,
1718
+ classnames: s,
1719
+ ref: _,
1720
+ ...E
1721
+ }) => {
1722
+ const I = oe(() => /* @__PURE__ */ new Date(), []), [W, H] = B(!1), [Y, V] = B({ top: 0, left: 0 }), [j, T] = B("bottom"), [f, M] = B(() => i === "year" ? "years" : i === "month" ? "months" : "days"), [N, O] = B(() => e ?? I), [G, te] = B(() => ((e == null ? void 0 : e.getFullYear()) ?? I.getFullYear()) - 6), se = K(null), m = K(null), R = K(null), U = P !== void 0, X = U ? P : W, $e = l ?? ii(i), Le = oe(() => ei(p, b), [p, b]), Qe = oe(() => ti(p), [p]), gr = oe(
1723
+ () => Qo(N.getFullYear(), N.getMonth(), b),
1724
+ [N, b]
1725
+ ), Me = oe(() => oi(G + 6, 12), [G]), yt = oe(() => e ? qo(e, $e, p) : null, [e, $e, p]), fr = d ?? $e.replace(/2006|06|January|Jan|01|02/g, "__"), me = A(() => {
1726
+ var Ce;
1727
+ if (!m.current) return;
1728
+ const x = m.current.getBoundingClientRect(), F = ((Ce = R.current) == null ? void 0 : Ce.offsetHeight) ?? wi, Pe = window.innerHeight - x.bottom - He, Fe = x.top - He, xe = Pe < F && Fe > Pe ? "top" : "bottom";
1729
+ if (T(xe), v) {
1730
+ const Ye = xe === "bottom" ? x.bottom + He : x.top - F - He;
1731
+ V({
1732
+ top: Ye,
1733
+ left: x.left
1734
+ });
1735
+ }
1736
+ }, [v]), kt = A(() => {
1737
+ if (g) return;
1738
+ U || H(!0), D == null || D(), M(i === "year" ? "years" : i === "month" ? "months" : "days");
1739
+ const x = e ?? I;
1740
+ O(x), te(x.getFullYear() - 6);
1741
+ }, [g, U, D, i, e, I]), Z = A(() => {
1742
+ U || H(!1), k == null || k();
1743
+ }, [U, k]), $r = A(() => {
1744
+ X ? Z() : kt();
1745
+ }, [X, Z, kt]), xr = A(
1746
+ (x) => {
1747
+ const F = new Date(N.getFullYear(), N.getMonth(), x);
1748
+ r == null || r(F), Z();
1749
+ },
1750
+ [N, r, Z]
1751
+ ), yr = A(
1752
+ (x) => {
1753
+ if (i === "month") {
1754
+ const F = new Date(N.getFullYear(), x, 1);
1755
+ r == null || r(F), Z();
1756
+ } else
1757
+ O(new Date(N.getFullYear(), x, 1)), M("days");
1758
+ },
1759
+ [i, N, r, Z]
1760
+ ), kr = A(
1761
+ (x) => {
1762
+ if (i === "year") {
1763
+ const F = new Date(x, 0, 1);
1764
+ r == null || r(F), Z();
1765
+ } else i === "month" ? (O(new Date(x, N.getMonth(), 1)), M("months")) : (O(new Date(x, N.getMonth(), 1)), M("months"));
1766
+ },
1767
+ [i, N, r, Z]
1768
+ ), vr = A(() => {
1769
+ O((x) => new Date(x.getFullYear(), x.getMonth() - 1, 1));
1770
+ }, []), wr = A(() => {
1771
+ O((x) => new Date(x.getFullYear(), x.getMonth() + 1, 1));
1772
+ }, []), Sr = A(() => {
1773
+ O((x) => new Date(x.getFullYear() - 1, x.getMonth(), 1));
1774
+ }, []), mr = A(() => {
1775
+ O((x) => new Date(x.getFullYear() + 1, x.getMonth(), 1));
1776
+ }, []), Pr = A(() => {
1777
+ te((x) => x - 12);
1778
+ }, []), Cr = A(() => {
1779
+ te((x) => x + 12);
1780
+ }, []), vt = A(() => {
1781
+ f === "days" ? M("months") : f === "months" && M("years");
1782
+ }, [f]);
1783
+ nr(() => {
1784
+ X && me();
1785
+ }, [X, me]), fe(() => {
1786
+ const x = (xe) => {
1787
+ const Ce = xe.target, Ye = se.current && !se.current.contains(Ce), Rr = R.current && !R.current.contains(Ce);
1788
+ v ? Ye && Rr && Z() : Ye && Z();
1789
+ }, F = (xe) => {
1790
+ xe.key === "Escape" && Z();
1791
+ }, Pe = () => {
1792
+ X && v && me();
1793
+ }, Fe = () => {
1794
+ X && v && me();
1795
+ };
1796
+ return X && (document.addEventListener("mousedown", x), document.addEventListener("keydown", F), v && (window.addEventListener("scroll", Pe, !0), window.addEventListener("resize", Fe))), () => {
1797
+ document.removeEventListener("mousedown", x), document.removeEventListener("keydown", F), window.removeEventListener("scroll", Pe, !0), window.removeEventListener("resize", Fe);
1798
+ };
1799
+ }, [X, Z, v, me]);
1800
+ const Nr = qe[u].iconSize, zr = () => /* @__PURE__ */ w(Xe, { children: [
1801
+ /* @__PURE__ */ w(nt, { className: q("header", s == null ? void 0 : s.header), children: [
1802
+ /* @__PURE__ */ a(at, { onClick: vt, type: "button", children: new Intl.DateTimeFormat(p, { month: "long", year: "numeric" }).format(N) }),
1803
+ /* @__PURE__ */ w(dt, { children: [
1804
+ /* @__PURE__ */ a(ye, { onClick: vr, type: "button", "aria-label": "Previous month", children: /* @__PURE__ */ a(et, { size: 16 }) }),
1805
+ /* @__PURE__ */ a(ye, { onClick: wr, type: "button", "aria-label": "Next month", children: /* @__PURE__ */ a(tt, { size: 16 }) })
1806
+ ] })
1807
+ ] }),
1808
+ /* @__PURE__ */ a(bi, { children: Le.map((x, F) => /* @__PURE__ */ a(hi, { children: x }, F)) }),
1809
+ /* @__PURE__ */ a(gi, { className: q("grid", s == null ? void 0 : s.grid), children: gr.map(
1810
+ (x, F) => x === null ? /* @__PURE__ */ a(vi, {}, F) : /* @__PURE__ */ a(
1811
+ fi,
1812
+ {
1813
+ type: "button",
1814
+ className: q("cell", s == null ? void 0 : s.cell),
1815
+ $selected: e ? At(e, new Date(N.getFullYear(), N.getMonth(), x)) : !1,
1816
+ $today: At(I, new Date(N.getFullYear(), N.getMonth(), x)),
1817
+ $disabled: Lt(
1818
+ N.getFullYear(),
1819
+ N.getMonth(),
1820
+ x,
1821
+ c,
1822
+ h
1823
+ ),
1824
+ disabled: Lt(
1825
+ N.getFullYear(),
1826
+ N.getMonth(),
1827
+ x,
1828
+ c,
1829
+ h
1830
+ ),
1831
+ onClick: () => xr(x),
1832
+ children: x
1833
+ },
1834
+ F
1835
+ )
1836
+ ) })
1837
+ ] }), Tr = () => /* @__PURE__ */ w(Xe, { children: [
1838
+ /* @__PURE__ */ w(nt, { className: q("header", s == null ? void 0 : s.header), children: [
1839
+ /* @__PURE__ */ a(at, { onClick: vt, type: "button", children: N.getFullYear() }),
1840
+ /* @__PURE__ */ w(dt, { children: [
1841
+ /* @__PURE__ */ a(ye, { onClick: Sr, type: "button", "aria-label": "Previous year", children: /* @__PURE__ */ a(et, { size: 16 }) }),
1842
+ /* @__PURE__ */ a(ye, { onClick: mr, type: "button", "aria-label": "Next year", children: /* @__PURE__ */ a(tt, { size: 16 }) })
1843
+ ] })
1844
+ ] }),
1845
+ /* @__PURE__ */ a($i, { className: q("grid", s == null ? void 0 : s.grid), children: Qe.map((x, F) => /* @__PURE__ */ a(
1846
+ xi,
1847
+ {
1848
+ type: "button",
1849
+ className: q("cell", s == null ? void 0 : s.cell),
1850
+ $selected: e ? Et(e, new Date(N.getFullYear(), F, 1)) : !1,
1851
+ $current: Et(I, new Date(N.getFullYear(), F, 1)),
1852
+ $disabled: Mt(N.getFullYear(), F, c, h),
1853
+ disabled: Mt(N.getFullYear(), F, c, h),
1854
+ onClick: () => yr(F),
1855
+ children: x
1856
+ },
1857
+ F
1858
+ )) })
1859
+ ] }), Dr = () => /* @__PURE__ */ w(Xe, { children: [
1860
+ /* @__PURE__ */ w(nt, { className: q("header", s == null ? void 0 : s.header), children: [
1861
+ /* @__PURE__ */ w(at, { type: "button", style: { cursor: "default" }, children: [
1862
+ Me[0],
1863
+ " - ",
1864
+ Me[Me.length - 1]
1865
+ ] }),
1866
+ /* @__PURE__ */ w(dt, { children: [
1867
+ /* @__PURE__ */ a(ye, { onClick: Pr, type: "button", "aria-label": "Previous years", children: /* @__PURE__ */ a(et, { size: 16 }) }),
1868
+ /* @__PURE__ */ a(ye, { onClick: Cr, type: "button", "aria-label": "Next years", children: /* @__PURE__ */ a(tt, { size: 16 }) })
1869
+ ] })
1870
+ ] }),
1871
+ /* @__PURE__ */ a(yi, { className: q("grid", s == null ? void 0 : s.grid), children: Me.map((x) => /* @__PURE__ */ a(
1872
+ ki,
1873
+ {
1874
+ type: "button",
1875
+ className: q("cell", s == null ? void 0 : s.cell),
1876
+ $selected: e ? ri(e, new Date(x, 0, 1)) : !1,
1877
+ $current: I.getFullYear() === x,
1878
+ $disabled: Ft(x, c, h),
1879
+ disabled: Ft(x, c, h),
1880
+ onClick: () => kr(x),
1881
+ children: x
1882
+ },
1883
+ x
1884
+ )) })
1885
+ ] }), wt = () => {
1886
+ switch (f) {
1887
+ case "days":
1888
+ return zr();
1889
+ case "months":
1890
+ return Tr();
1891
+ case "years":
1892
+ return Dr();
1893
+ }
1894
+ }, Or = v ? Ze(
1895
+ /* @__PURE__ */ a(
1896
+ ui,
1897
+ {
1898
+ ref: R,
1899
+ $open: X,
1900
+ $position: j,
1901
+ className: q("calendar", s == null ? void 0 : s.calendar),
1902
+ style: { top: Y.top, left: Y.left },
1903
+ children: wt()
1904
+ }
1905
+ ),
1906
+ v
1907
+ ) : /* @__PURE__ */ a(
1908
+ pi,
1909
+ {
1910
+ ref: R,
1911
+ $open: X,
1912
+ $position: j,
1913
+ className: q("calendar", s == null ? void 0 : s.calendar),
1914
+ children: wt()
1915
+ }
1916
+ );
1917
+ return /* @__PURE__ */ w(
1918
+ ni,
1919
+ {
1920
+ ...E,
1921
+ ref: _ ?? se,
1922
+ $fullWidth: z,
1923
+ className: q("container", y),
1924
+ children: [
1925
+ S && /* @__PURE__ */ a(ai, { variant: $, children: S }),
1926
+ /* @__PURE__ */ w(
1927
+ li,
1928
+ {
1929
+ ref: m,
1930
+ type: "button",
1931
+ onClick: $r,
1932
+ disabled: g,
1933
+ $size: u,
1934
+ $variant: $,
1935
+ $disabled: g,
1936
+ $open: X,
1937
+ $hasValue: !!yt,
1938
+ className: q("trigger", s == null ? void 0 : s.trigger),
1939
+ children: [
1940
+ /* @__PURE__ */ a(ci, { children: yt ?? fr }),
1941
+ /* @__PURE__ */ a(si, { $open: X, children: /* @__PURE__ */ a(ir, { size: Nr }) })
1942
+ ]
1943
+ }
1944
+ ),
1945
+ Or,
1946
+ C && /* @__PURE__ */ a(di, { variant: $, children: C })
1947
+ ]
1948
+ }
1949
+ );
1950
+ }, Yt = {
1951
+ compact: {
1952
+ height: "32px",
1953
+ padding: "0 10px",
1954
+ radius: "14px",
1955
+ prefixSize: "16px"
1956
+ },
1957
+ default: {
1958
+ height: "40px",
1959
+ padding: "0 14px",
1960
+ radius: "16px",
1961
+ prefixSize: "20px"
1962
+ }
1963
+ }, Vt = {
1964
+ normal: {
1965
+ background: {
1966
+ static: o(t.black, 2),
1967
+ disabled: o(t.black, 10)
1968
+ },
1969
+ border: {
1970
+ static: o(t.black, 60),
1971
+ disabled: o(t.black, 10)
1972
+ },
1973
+ color: {
1974
+ static: t.black,
1975
+ disabled: o(t.black, 65)
1976
+ },
1977
+ placeholder: {
1978
+ static: o(t.black, 40),
1979
+ disabled: o(t.black, 65)
1980
+ },
1981
+ focus: o(t["iron-grey"], 30)
1982
+ },
1983
+ error: {
1984
+ background: {
1985
+ static: o(t.red, 2),
1986
+ disabled: o(t.red, 10)
1987
+ },
1988
+ border: {
1989
+ static: o(t.red, 60),
1990
+ disabled: o(t.red, 10)
1991
+ },
1992
+ color: {
1993
+ static: t.red,
1994
+ disabled: o(t.red, 65)
1995
+ },
1996
+ placeholder: {
1997
+ static: o(t.red, 40),
1998
+ disabled: o(t.red, 65)
1999
+ },
2000
+ focus: o(t.red, 30)
2001
+ }
2002
+ }, re = (e) => Vt[e] ?? Vt.normal, Ee = (e) => Yt[e] ?? Yt.default, Si = n.div`
2003
+ display: grid;
2004
+ flex-direction: column;
2005
+ gap: 2px;
2006
+ width: ${(e) => e.$fullWidth ? "100%" : "fit-content"};
2007
+ `, mi = n(le)`
2008
+ margin-left: 6px;
2009
+ `, Pi = n(ce)`
2010
+ margin-left: 6px;
2011
+ `, Ci = n.div`
2012
+ display: flex;
2013
+ align-items: stretch;
2014
+ border: 1px solid
2015
+ ${(e) => re(e.$variant).border[e.$disabled ? "disabled" : "static"]};
2016
+ border-radius: ${(e) => Ee(e.$size).radius};
2017
+ overflow: hidden;
2018
+ `, Ni = n.span`
2019
+ display: flex;
2020
+ align-items: center;
2021
+ flex-shrink: 0;
2022
+ padding: ${(e) => Ee(e.$size).padding};
2023
+ font-size: 14px;
2024
+ font-weight: 500;
2025
+ white-space: nowrap;
2026
+ user-select: none;
2027
+ cursor: ${(e) => e.$disabled ? "not-allowed" : "default"};
2028
+ color: ${(e) => re(e.$variant).color[e.$disabled ? "disabled" : "static"]};
2029
+ background-color: ${(e) => e.$variant === "error" ? o(t.red, 8) : o(t.black, 6)};
2030
+ border-right: 1px solid
2031
+ ${(e) => re(e.$variant).border[e.$disabled ? "disabled" : "static"]};
2032
+ `, zi = n.input`
2033
+ flex: 1;
2034
+ min-width: 0;
2035
+ outline: none;
2036
+ font-size: 14px;
2037
+ font-weight: 500;
2038
+ height: ${(e) => Ee(e.$size).height};
2039
+ padding: ${(e) => Ee(e.$size).padding};
2040
+ border-radius: ${(e) => e.$hasPrefix ? "0" : Ee(e.$size).radius};
2041
+
2042
+ color: ${(e) => re(e.$variant).color.static};
2043
+ border: ${(e) => e.$hasPrefix ? "none" : `1px solid ${re(e.$variant).border.static}`};
2044
+ background-color: ${(e) => re(e.$variant).background.static};
2045
+
2046
+ &::placeholder {
2047
+ color: ${(e) => re(e.$variant).placeholder.static};
2048
+ }
2049
+
2050
+ &:disabled {
2051
+ cursor: not-allowed;
2052
+ color: ${(e) => re(e.$variant).color.disabled};
2053
+ background-color: ${(e) => re(e.$variant).background.disabled};
2054
+ border-color: ${(e) => e.$hasPrefix ? "transparent" : re(e.$variant).border.disabled};
2055
+
2056
+ &::placeholder {
2057
+ color: ${(e) => re(e.$variant).placeholder.disabled};
2058
+ }
2059
+ }
2060
+ `, We = L("input"), Ti = ({
2061
+ className: e,
2062
+ classnames: r,
2063
+ disabled: i,
2064
+ fullWidth: l,
2065
+ label: d,
2066
+ ref: p,
2067
+ message: b,
2068
+ prefix: c,
2069
+ size: h = "default",
2070
+ variant: u = "normal",
2071
+ ...$
2072
+ }) => {
2073
+ const g = c != null, z = /* @__PURE__ */ a(
2074
+ zi,
2075
+ {
2076
+ ...$,
2077
+ ref: p,
2078
+ disabled: i,
2079
+ $size: h,
2080
+ $variant: u,
2081
+ $hasPrefix: g,
2082
+ className: We("input", r == null ? void 0 : r.input)
2083
+ }
2084
+ );
2085
+ return /* @__PURE__ */ w(Si, { className: We("container", e), $fullWidth: !!l, children: [
2086
+ /* @__PURE__ */ a(mi, { variant: u, className: We("label", r == null ? void 0 : r.label), children: d }),
2087
+ g ? /* @__PURE__ */ w(Ci, { $size: h, $variant: u, $disabled: !!i, children: [
2088
+ /* @__PURE__ */ a(
2089
+ Ni,
2090
+ {
2091
+ $size: h,
2092
+ $variant: u,
2093
+ $disabled: !!i,
2094
+ className: We("prefix"),
2095
+ children: c
2096
+ }
2097
+ ),
2098
+ z
2099
+ ] }) : z,
2100
+ b && /* @__PURE__ */ a(Pi, { variant: u, children: b })
2101
+ ] });
2102
+ }, Di = n.div`
2103
+ position: fixed;
2104
+ inset: 0;
2105
+ z-index: 1000;
2106
+ display: flex;
2107
+ align-items: center;
2108
+ justify-content: center;
2109
+ background-color: ${o(t.black, 50)};
2110
+ animation: ${$t.fadeIn} ${(e) => e.$animated ? "0.15s" : "0s"} ease-out forwards;
2111
+ `, Oi = n.div`
2112
+ position: relative;
2113
+ z-index: 1001;
2114
+ width: ${(e) => e.$width};
2115
+ max-width: calc(100vw - 32px);
2116
+ max-height: calc(100vh - 32px);
2117
+ overflow: auto;
2118
+ background-color: ${t.white};
2119
+ border-radius: 16px;
2120
+ box-shadow: 0 8px 32px ${o(t.black, 20)};
2121
+ animation: ${$t.scaleIn} ${(e) => e.$animated ? "0.15s" : "0s"} ease-out forwards;
2122
+ `, Bt = L("modal"), Ri = ({
2123
+ animated: e,
2124
+ children: r,
2125
+ className: i,
2126
+ classnames: l,
2127
+ open: d,
2128
+ ref: p,
2129
+ width: b = "500px",
2130
+ ...c
2131
+ }) => d ? Ze(
2132
+ /* @__PURE__ */ a(Di, { className: Bt("overlay", l == null ? void 0 : l.overlay), $animated: !!e, children: /* @__PURE__ */ a(
2133
+ Oi,
2134
+ {
2135
+ ...c,
2136
+ ref: p,
2137
+ className: Bt("content", i, l == null ? void 0 : l.content),
2138
+ $animated: !!e,
2139
+ $width: b,
2140
+ children: r
2141
+ }
2142
+ ) }),
2143
+ document.body
2144
+ ) : null, lr = {
2145
+ normal: {
2146
+ border: t["iron-grey"],
2147
+ placeholder: t["iron-grey"]
2148
+ },
2149
+ error: {
2150
+ border: t.red,
2151
+ placeholder: o(t.red, 40)
2152
+ }
2153
+ }, Ii = n.div`
2154
+ display: flex;
2155
+ flex-direction: column;
2156
+ gap: 4px;
2157
+ `, _i = n(le)`
2158
+ margin-left: 6px;
2159
+ `, Ai = n.div`
2160
+ display: flex;
2161
+ flex-wrap: wrap;
2162
+ align-items: center;
2163
+ gap: 6px;
2164
+ min-height: 44px;
2165
+ padding: 8px 12px;
2166
+ border: 1px dashed ${(e) => lr[e.$variant].border};
2167
+ border-radius: 8px;
2168
+ background: ${t.white};
2169
+ cursor: ${(e) => e.$disabled ? "not-allowed" : "pointer"};
2170
+ opacity: ${(e) => e.$disabled ? 0.5 : 1};
2171
+ transition: border-color 0.15s ease;
2172
+ text-align: left;
2173
+
2174
+ &:hover {
2175
+ border-color: ${(e) => e.$disabled ? void 0 : e.$variant === "error" ? t.red : t.black};
2176
+ }
2177
+ `, Ei = n.span`
2178
+ color: ${(e) => lr[e.$variant].placeholder};
2179
+ font-size: 14px;
2180
+ `, Li = n.div`
2181
+ display: flex;
2182
+ flex-direction: column;
2183
+ padding: 20px;
2184
+ gap: 16px;
2185
+ `, Mi = n.div`
2186
+ display: flex;
2187
+ align-items: center;
2188
+ justify-content: space-between;
2189
+ `, Fi = n.h3`
2190
+ margin: 0;
2191
+ font-size: 18px;
2192
+ font-weight: 600;
2193
+ color: ${t.black};
2194
+ `, Yi = n.div`
2195
+ display: flex;
2196
+ flex-direction: column;
2197
+ gap: 4px;
2198
+ min-height: 200px;
2199
+ max-height: 300px;
2200
+ overflow-y: auto;
2201
+ `, Vi = n.label`
2202
+ display: flex;
2203
+ align-items: center;
2204
+ gap: 10px;
2205
+ padding: 10px 12px;
2206
+ border-radius: 8px;
2207
+ cursor: ${(e) => e.$disabled ? "not-allowed" : "pointer"};
2208
+ opacity: ${(e) => e.$disabled ? 0.5 : 1};
2209
+ transition: background-color 0.15s ease;
2210
+
2211
+ &:hover {
2212
+ background-color: ${(e) => e.$disabled ? "transparent" : t.gray};
2213
+ }
2214
+ `, Bi = n.span`
2215
+ font-size: 14px;
2216
+ color: ${t.black};
2217
+ `, Hi = n.div`
2218
+ display: flex;
2219
+ align-items: center;
2220
+ justify-content: center;
2221
+ padding: 32px 16px;
2222
+ color: ${t["iron-grey"]};
2223
+ font-size: 14px;
2224
+ text-align: center;
2225
+ `, Wi = n(ce)`
2226
+ margin-left: 6px;
2227
+ `, Q = L("multi-select"), ra = ({
2228
+ className: e,
2229
+ classnames: r,
2230
+ disabled: i = !1,
2231
+ emptyMessage: l = "No options found",
2232
+ label: d,
2233
+ maxVisible: p = 1 / 0,
2234
+ message: b,
2235
+ modalTitle: c = "Select options",
2236
+ onChange: h,
2237
+ options: u,
2238
+ placeholder: $ = "Select...",
2239
+ ref: g,
2240
+ searchPlaceholder: z = "Search...",
2241
+ value: S,
2242
+ variant: C = "normal",
2243
+ ...v
2244
+ }) => {
2245
+ const [P, D] = B(!1), [k, y] = B(""), s = K(null), _ = oe(() => u.filter((T) => S.includes(T.value)), [u, S]), E = oe(() => {
2246
+ if (!k.trim()) return u;
2247
+ const T = k.toLowerCase().trim();
2248
+ return u.filter((f) => f.label.toLowerCase().includes(T));
2249
+ }, [u, k]), I = p === 1 / 0 ? _ : _.slice(0, p), W = _.length - I.length, H = () => {
2250
+ i || (D(!0), y(""));
2251
+ }, Y = A(() => {
2252
+ D(!1), y("");
2253
+ }, []), V = (T) => {
2254
+ S.includes(T) ? h(S.filter((f) => f !== T)) : h([...S, T]);
2255
+ }, j = (T) => {
2256
+ h(S.filter((f) => f !== T));
2257
+ };
2258
+ return fe(() => {
2259
+ if (!P) return;
2260
+ const T = (f) => {
2261
+ s.current && !s.current.contains(f.target) && Y();
2262
+ };
2263
+ return document.addEventListener("mousedown", T), () => {
2264
+ document.removeEventListener("mousedown", T);
2265
+ };
2266
+ }, [P, Y]), /* @__PURE__ */ w(Ii, { ...v, ref: g, className: Q("container", e), children: [
2267
+ d && /* @__PURE__ */ a(_i, { variant: C, className: Q("label", r == null ? void 0 : r.trigger), children: d }),
2268
+ /* @__PURE__ */ a(
2269
+ Ai,
2270
+ {
2271
+ $variant: C,
2272
+ $disabled: i,
2273
+ onClick: H,
2274
+ className: Q("trigger", r == null ? void 0 : r.trigger),
2275
+ children: _.length === 0 ? /* @__PURE__ */ a(
2276
+ Ei,
2277
+ {
2278
+ $variant: C,
2279
+ className: Q("placeholder", r == null ? void 0 : r.placeholder),
2280
+ children: $
2281
+ }
2282
+ ) : /* @__PURE__ */ w(Xe, { children: [
2283
+ I.map((T) => /* @__PURE__ */ a(
2284
+ gt,
2285
+ {
2286
+ variant: C === "error" ? "red" : "gray",
2287
+ deletable: !0,
2288
+ onDelete: () => j(T.value),
2289
+ onClick: (f) => f.stopPropagation(),
2290
+ className: Q("chip", r == null ? void 0 : r.chip),
2291
+ children: T.label
2292
+ },
2293
+ T.value
2294
+ )),
2295
+ W > 0 && /* @__PURE__ */ w(
2296
+ gt,
2297
+ {
2298
+ variant: C === "error" ? "red" : "gray",
2299
+ onClick: (T) => T.stopPropagation(),
2300
+ className: Q("chip", r == null ? void 0 : r.chip),
2301
+ children: [
2302
+ "+",
2303
+ W
2304
+ ]
2305
+ }
2306
+ )
2307
+ ] })
2308
+ }
2309
+ ),
2310
+ b && /* @__PURE__ */ a(Wi, { variant: C, className: Q("message"), children: b }),
2311
+ /* @__PURE__ */ a(Ri, { open: P, width: "400px", animated: !0, className: Q("modal", r == null ? void 0 : r.modal), children: /* @__PURE__ */ w(Li, { ref: s, children: [
2312
+ /* @__PURE__ */ w(Mi, { children: [
2313
+ /* @__PURE__ */ a(Fi, { children: c }),
2314
+ /* @__PURE__ */ a(
2315
+ Oo,
2316
+ {
2317
+ variant: "transparent",
2318
+ size: "compact",
2319
+ icon: /* @__PURE__ */ a(or, {}),
2320
+ keyBindings: ["Escape"],
2321
+ onClick: Y
2322
+ }
2323
+ )
2324
+ ] }),
2325
+ /* @__PURE__ */ a(
2326
+ Ti,
2327
+ {
2328
+ type: "text",
2329
+ value: k,
2330
+ onChange: (T) => y(T.target.value),
2331
+ placeholder: z,
2332
+ autoFocus: !0,
2333
+ fullWidth: !0,
2334
+ className: Q("search", r == null ? void 0 : r.search)
2335
+ }
2336
+ ),
2337
+ /* @__PURE__ */ a(Yi, { className: Q("options", r == null ? void 0 : r.options), children: E.length === 0 ? /* @__PURE__ */ a(Hi, { className: Q("empty", r == null ? void 0 : r.empty), children: l }) : E.map((T) => /* @__PURE__ */ w(
2338
+ Vi,
2339
+ {
2340
+ $disabled: !!T.disabled,
2341
+ className: Q("option", r == null ? void 0 : r.option),
2342
+ children: [
2343
+ /* @__PURE__ */ a(
2344
+ xt,
2345
+ {
2346
+ checked: S.includes(T.value),
2347
+ disabled: T.disabled,
2348
+ onChange: () => V(T.value)
2349
+ }
2350
+ ),
2351
+ /* @__PURE__ */ a(Bi, { children: T.label })
2352
+ ]
2353
+ },
2354
+ T.value
2355
+ )) })
2356
+ ] }) })
2357
+ ] });
2358
+ }, Ht = {
2359
+ compact: {
2360
+ width: "36px",
2361
+ height: "40px",
2362
+ fontSize: "16px",
2363
+ radius: "10px",
2364
+ gap: "8px"
2365
+ },
2366
+ default: {
2367
+ width: "44px",
2368
+ height: "52px",
2369
+ fontSize: "20px",
2370
+ radius: "12px",
2371
+ gap: "10px"
2372
+ }
2373
+ }, Wt = {
2374
+ normal: {
2375
+ background: {
2376
+ static: o(t.black, 2),
2377
+ disabled: o(t.black, 10)
2378
+ },
2379
+ border: {
2380
+ static: o(t.black, 60),
2381
+ disabled: o(t.black, 10)
2382
+ },
2383
+ color: {
2384
+ static: t.black,
2385
+ disabled: o(t.black, 65)
2386
+ },
2387
+ focus: o(t["iron-grey"], 30)
2388
+ },
2389
+ error: {
2390
+ background: {
2391
+ static: o(t.red, 2),
2392
+ disabled: o(t.red, 10)
2393
+ },
2394
+ border: {
2395
+ static: o(t.red, 60),
2396
+ disabled: o(t.red, 10)
2397
+ },
2398
+ color: {
2399
+ static: t.red,
2400
+ disabled: o(t.red, 65)
2401
+ },
2402
+ focus: o(t.red, 30)
2403
+ }
2404
+ }, Ae = (e) => Ht[e] ?? Ht.default, ke = (e) => Wt[e] ?? Wt.normal, ji = n.div`
2405
+ display: inline-flex;
2406
+ flex-direction: column;
2407
+ gap: 2px;
2408
+ `, Gi = n(le)`
2409
+ margin-left: 6px;
2410
+ `, Ui = n.div`
2411
+ display: flex;
2412
+ gap: ${(e) => Ae(e.$size).gap};
2413
+ `, Ki = n.input`
2414
+ width: ${(e) => Ae(e.$size).width};
2415
+ height: ${(e) => Ae(e.$size).height};
2416
+ border-radius: ${(e) => Ae(e.$size).radius};
2417
+ font-size: ${(e) => Ae(e.$size).fontSize};
2418
+ font-weight: 600;
2419
+ text-align: center;
2420
+ outline: none;
2421
+ border: 1px solid ${(e) => ke(e.$variant).border.static};
2422
+ background-color: ${(e) => ke(e.$variant).background.static};
2423
+ color: ${(e) => ke(e.$variant).color.static};
2424
+ transition:
2425
+ border-color 0.15s ease,
2426
+ box-shadow 0.15s ease;
2427
+
2428
+ &:disabled {
2429
+ cursor: not-allowed;
2430
+ color: ${(e) => ke(e.$variant).color.disabled};
2431
+ background-color: ${(e) => ke(e.$variant).background.disabled};
2432
+ border-color: ${(e) => ke(e.$variant).border.disabled};
2433
+ }
2434
+
2435
+ &::selection {
2436
+ background-color: transparent;
2437
+ }
2438
+ `, Xi = n(ce)`
2439
+ margin-left: 6px;
2440
+ `, je = L("otp-code"), oa = ({
2441
+ autoFocus: e,
2442
+ className: r,
2443
+ classnames: i,
2444
+ disabled: l,
2445
+ label: d,
2446
+ length: p = 6,
2447
+ message: b,
2448
+ onChange: c,
2449
+ ref: h,
2450
+ size: u = "default",
2451
+ value: $ = "",
2452
+ variant: g = "normal",
2453
+ ...z
2454
+ }) => {
2455
+ const S = K([]);
2456
+ fe(() => {
2457
+ e && S.current[0] && S.current[0].focus();
2458
+ }, [e]);
2459
+ const C = A((k) => {
2460
+ const y = S.current[k];
2461
+ y && (y.focus(), y.select());
2462
+ }, []), v = A(
2463
+ (k, y) => {
2464
+ const _ = y.target.value.replace(/\D/g, "").slice(-1);
2465
+ if (!_) return;
2466
+ const E = $.padEnd(p, " ").split(""), I = E.findIndex((V) => V === " " || V === ""), W = I !== -1 ? I : k;
2467
+ E[W] = _;
2468
+ const H = E.join("").replace(/ /g, "");
2469
+ c == null || c(H);
2470
+ const Y = W + 1;
2471
+ Y < p && C(Y);
2472
+ },
2473
+ [$, p, c, C]
2474
+ ), P = A(
2475
+ (k, y) => {
2476
+ if (y.key === "Backspace") {
2477
+ y.preventDefault();
2478
+ const s = $.split("");
2479
+ s[k] ? (s[k] = "", c == null || c(s.join(""))) : k > 0 && (s[k - 1] = "", c == null || c(s.join("")), C(k - 1));
2480
+ } else y.key === "ArrowLeft" && k > 0 ? (y.preventDefault(), C(k - 1)) : y.key === "ArrowRight" && k < p - 1 && (y.preventDefault(), C(k + 1));
2481
+ },
2482
+ [$, p, c, C]
2483
+ ), D = A(
2484
+ (k) => {
2485
+ k.preventDefault();
2486
+ const y = k.clipboardData.getData("text").replace(/\D/g, "").slice(0, p);
2487
+ if (y) {
2488
+ c == null || c(y);
2489
+ const s = Math.min(y.length, p - 1);
2490
+ C(s);
2491
+ }
2492
+ },
2493
+ [p, c, C]
2494
+ );
2495
+ return /* @__PURE__ */ w(ji, { ref: h, className: je("container", r), ...z, children: [
2496
+ d && /* @__PURE__ */ a(Gi, { variant: g, className: je("label", i == null ? void 0 : i.label), children: d }),
2497
+ /* @__PURE__ */ a(Ui, { $size: u, children: Array.from({ length: p }).map((k, y) => /* @__PURE__ */ a(
2498
+ Ki,
2499
+ {
2500
+ ref: (s) => {
2501
+ S.current[y] = s;
2502
+ },
2503
+ type: "text",
2504
+ inputMode: "numeric",
2505
+ autoComplete: "one-time-code",
2506
+ maxLength: 2,
2507
+ disabled: l,
2508
+ value: $[y] ?? "",
2509
+ onChange: (s) => v(y, s),
2510
+ onKeyDown: (s) => P(y, s),
2511
+ onPaste: D,
2512
+ onFocus: (s) => s.target.select(),
2513
+ $size: u,
2514
+ $variant: g,
2515
+ className: je("input", i == null ? void 0 : i.input)
2516
+ },
2517
+ y
2518
+ )) }),
2519
+ b && /* @__PURE__ */ a(Xi, { variant: g, className: je("message"), children: b })
2520
+ ] });
2521
+ }, jt = {
2522
+ normal: {
2523
+ box: {
2524
+ border: o(t["iron-grey"], 30),
2525
+ borderChecked: t["iron-grey"],
2526
+ background: t.white,
2527
+ backgroundChecked: t.white,
2528
+ focusShadow: o(t["iron-grey"], 30)
2529
+ },
2530
+ dot: t.black,
2531
+ label: t.black
2532
+ },
2533
+ error: {
2534
+ box: {
2535
+ border: t.red,
2536
+ borderChecked: t.red,
2537
+ background: t.white,
2538
+ backgroundChecked: t.white,
2539
+ focusShadow: o(t.red, 30)
2540
+ },
2541
+ dot: t.red,
2542
+ label: t.red
2543
+ }
2544
+ }, Se = (e) => jt[e] ?? jt.normal, qi = n.label`
2545
+ display: inline-flex;
2546
+ align-items: flex-start;
2547
+ gap: 8px;
2548
+ cursor: ${(e) => e.$disabled ? "not-allowed" : "pointer"};
2549
+ opacity: ${(e) => e.$disabled ? 0.5 : 1};
2550
+ `, Zi = n.input`
2551
+ position: absolute;
2552
+ opacity: 0;
2553
+ width: 0;
2554
+ height: 0;
2555
+ pointer-events: none;
2556
+ `, Ji = n.span`
2557
+ display: inline-flex;
2558
+ align-items: center;
2559
+ justify-content: center;
2560
+ flex-shrink: 0;
2561
+ width: 18px;
2562
+ height: 18px;
2563
+ border-radius: 50%;
2564
+ border: 1.5px solid
2565
+ ${(e) => e.$checked ? Se(e.$variant).box.borderChecked : Se(e.$variant).box.border};
2566
+ background-color: ${(e) => e.$checked ? Se(e.$variant).box.backgroundChecked : Se(e.$variant).box.background};
2567
+ transition:
2568
+ border-color 0.15s ease,
2569
+ background-color 0.15s ease,
2570
+ box-shadow 0.15s ease;
2571
+ `, Qi = n.span`
2572
+ width: 8px;
2573
+ height: 8px;
2574
+ border-radius: 50%;
2575
+ background-color: ${(e) => Se(e.$variant).dot};
2576
+ opacity: ${(e) => e.$visible ? 1 : 0};
2577
+ transform: ${(e) => e.$visible ? "scale(1)" : "scale(0.5)"};
2578
+ transition:
2579
+ opacity 0.15s ease,
2580
+ transform 0.15s ease;
2581
+ `, en = n.span`
2582
+ font-size: 14px;
2583
+ font-weight: 500;
2584
+ line-height: 1.5;
2585
+ color: ${(e) => Se(e.$variant).label};
2586
+ user-select: none;
2587
+
2588
+ a {
2589
+ color: inherit;
2590
+ text-decoration: underline;
2591
+ cursor: pointer;
2592
+
2593
+ &:hover {
2594
+ text-decoration: none;
2595
+ }
2596
+ }
2597
+ `, Oe = L("radio"), cr = ({
2598
+ checked: e,
2599
+ className: r,
2600
+ classnames: i,
2601
+ disabled: l,
2602
+ label: d,
2603
+ onChange: p,
2604
+ ref: b,
2605
+ variant: c = "normal",
2606
+ ...h
2607
+ }) => /* @__PURE__ */ w(
2608
+ qi,
2609
+ {
2610
+ className: Oe("container", r),
2611
+ $disabled: !!l,
2612
+ $variant: c,
2613
+ children: [
2614
+ /* @__PURE__ */ a(
2615
+ Zi,
2616
+ {
2617
+ ...h,
2618
+ ref: b,
2619
+ type: "radio",
2620
+ className: Oe("input", i == null ? void 0 : i.input),
2621
+ checked: e,
2622
+ disabled: l,
2623
+ onChange: p
2624
+ }
2625
+ ),
2626
+ /* @__PURE__ */ a(Ji, { className: Oe("box", i == null ? void 0 : i.box), $checked: e, $variant: c, children: /* @__PURE__ */ a(Qi, { className: Oe("dot", i == null ? void 0 : i.dot), $visible: e, $variant: c }) }),
2627
+ d && /* @__PURE__ */ a(en, { className: Oe("label", i == null ? void 0 : i.label), $variant: c, children: d })
2628
+ ]
2629
+ }
2630
+ ), Gt = {
2631
+ normal: {
2632
+ border: {
2633
+ static: o(t.black, 20),
2634
+ hover: o(t.black, 40),
2635
+ active: o(t.black, 40),
2636
+ disabled: o(t.black, 10)
2637
+ },
2638
+ borderChecked: t.black,
2639
+ background: {
2640
+ static: t.white,
2641
+ hover: t.white,
2642
+ active: t.white,
2643
+ disabled: o(t.black, 5)
2644
+ },
2645
+ backgroundChecked: o(t.black, 5),
2646
+ focusRing: o(t.black, 20),
2647
+ label: {
2648
+ static: t.black,
2649
+ hover: t.black,
2650
+ active: t.black,
2651
+ disabled: o(t.black, 40)
2652
+ },
2653
+ description: {
2654
+ static: o(t.black, 60),
2655
+ hover: o(t.black, 60),
2656
+ active: o(t.black, 60),
2657
+ disabled: o(t.black, 30)
2658
+ }
2659
+ },
2660
+ error: {
2661
+ border: {
2662
+ static: t.red,
2663
+ hover: t.red,
2664
+ active: t.red,
2665
+ disabled: o(t.red, 30)
2666
+ },
2667
+ borderChecked: t.red,
2668
+ background: {
2669
+ static: t.white,
2670
+ hover: t.white,
2671
+ active: t.white,
2672
+ disabled: o(t.red, 5)
2673
+ },
2674
+ backgroundChecked: o(t.red, 5),
2675
+ focusRing: o(t.red, 20),
2676
+ label: {
2677
+ static: t.red,
2678
+ hover: t.red,
2679
+ active: t.red,
2680
+ disabled: o(t.red, 40)
2681
+ },
2682
+ description: {
2683
+ static: o(t.red, 70),
2684
+ hover: o(t.red, 70),
2685
+ active: o(t.red, 70),
2686
+ disabled: o(t.red, 40)
2687
+ }
2688
+ }
2689
+ }, he = (e) => Gt[e] ?? Gt.normal, tn = n.label`
2690
+ display: grid;
2691
+ grid-template-columns: auto 1fr;
2692
+ align-items: start;
2693
+ gap: 8px;
2694
+ padding: 12px;
2695
+ background-color: ${(e) => {
2696
+ const r = he(e.$variant);
2697
+ return e.$disabled ? r.background.disabled : e.$checked ? r.backgroundChecked : r.background.static;
2698
+ }};
2699
+ border: 1px solid
2700
+ ${(e) => {
2701
+ const r = he(e.$variant);
2702
+ return e.$disabled ? r.border.disabled : e.$checked ? r.borderChecked : r.border.static;
2703
+ }};
2704
+ border-radius: 12px;
2705
+ cursor: ${(e) => e.$disabled ? "not-allowed" : "pointer"};
2706
+ transition:
2707
+ border-color 0.15s ease,
2708
+ background-color 0.15s ease;
2709
+ width: ${(e) => e.$fullWidth ? "100%" : "fit-content"};
2710
+ min-width: 0;
2711
+
2712
+ &:hover:not([data-disabled='true']) {
2713
+ border-color: ${(e) => {
2714
+ const r = he(e.$variant);
2715
+ return e.$checked ? r.borderChecked : r.border.hover;
2716
+ }};
2717
+ }
2718
+
2719
+ .vacano_radio_container {
2720
+ pointer-events: none;
2721
+ }
2722
+ `, rn = n.input`
2723
+ position: absolute;
2724
+ width: 1px;
2725
+ height: 1px;
2726
+ margin: -1px;
2727
+ padding: 0;
2728
+ overflow: hidden;
2729
+ clip: rect(0, 0, 0, 0);
2730
+ white-space: nowrap;
2731
+ border: 0;
2732
+ `, on = n.div`
2733
+ display: flex;
2734
+ flex-direction: column;
2735
+ gap: 2px;
2736
+ min-width: 0;
2737
+ `, nn = n.span`
2738
+ font-size: 14px;
2739
+ font-weight: 500;
2740
+ line-height: 1.4;
2741
+ color: ${(e) => he(e.$variant).label.static};
2742
+
2743
+ label[data-disabled='true'] & {
2744
+ color: ${(e) => he(e.$variant).label.disabled};
2745
+ }
2746
+ `, an = n.span`
2747
+ font-size: 12px;
2748
+ font-weight: 400;
2749
+ line-height: 1.4;
2750
+ color: ${(e) => he(e.$variant).description.static};
2751
+
2752
+ label[data-disabled='true'] & {
2753
+ color: ${(e) => he(e.$variant).description.disabled};
2754
+ }
2755
+ `, Ge = L("radio-card"), ia = ({
2756
+ checked: e,
2757
+ className: r,
2758
+ classnames: i,
2759
+ description: l,
2760
+ disabled: d,
2761
+ fullWidth: p = !1,
2762
+ label: b,
2763
+ onChange: c,
2764
+ ref: h,
2765
+ variant: u = "normal",
2766
+ ...$
2767
+ }) => /* @__PURE__ */ w(
2768
+ tn,
2769
+ {
2770
+ className: Ge("container", r),
2771
+ $checked: e,
2772
+ $disabled: !!d,
2773
+ $fullWidth: p,
2774
+ $variant: u,
2775
+ "data-disabled": d,
2776
+ children: [
2777
+ /* @__PURE__ */ a(
2778
+ rn,
2779
+ {
2780
+ ...$,
2781
+ ref: h,
2782
+ type: "radio",
2783
+ checked: e,
2784
+ disabled: d,
2785
+ onChange: c
2786
+ }
2787
+ ),
2788
+ /* @__PURE__ */ a(
2789
+ cr,
2790
+ {
2791
+ className: i == null ? void 0 : i.radio,
2792
+ checked: e,
2793
+ disabled: d,
2794
+ variant: u,
2795
+ onChange: () => {
2796
+ },
2797
+ tabIndex: -1,
2798
+ "aria-hidden": !0
2799
+ }
2800
+ ),
2801
+ /* @__PURE__ */ w(on, { className: Ge("content", i == null ? void 0 : i.content), children: [
2802
+ /* @__PURE__ */ a(nn, { className: Ge("label", i == null ? void 0 : i.label), $variant: u, children: b }),
2803
+ l && /* @__PURE__ */ a(
2804
+ an,
2805
+ {
2806
+ className: Ge("description", i == null ? void 0 : i.description),
2807
+ $variant: u,
2808
+ children: l
2809
+ }
2810
+ )
2811
+ ] })
2812
+ ]
2813
+ }
2814
+ ), Ut = {
2815
+ label: {
2816
+ color: t.black,
2817
+ disabledColor: o(t.black, 40)
2818
+ }
2819
+ }, dn = n.div`
2820
+ display: flex;
2821
+ flex-direction: column;
2822
+ gap: 8px;
2823
+ `, ln = n.span`
2824
+ font-size: 13px;
2825
+ font-weight: 500;
2826
+ line-height: 1.5;
2827
+ color: ${(e) => e.$disabled ? Ut.label.disabledColor : Ut.label.color};
2828
+ margin-bottom: 4px;
2829
+ `, cn = n.div`
2830
+ display: flex;
2831
+ flex-direction: column;
2832
+ gap: 12px;
2833
+ `, lt = L("radio-group"), na = ({
2834
+ className: e,
2835
+ classnames: r,
2836
+ disabled: i,
2837
+ label: l,
2838
+ name: d,
2839
+ onChange: p,
2840
+ options: b,
2841
+ ref: c,
2842
+ value: h,
2843
+ variant: u = "normal",
2844
+ ...$
2845
+ }) => /* @__PURE__ */ w(dn, { ...$, ref: c, className: lt("container", e), children: [
2846
+ l && /* @__PURE__ */ a(ln, { className: lt("label", r == null ? void 0 : r.label), $disabled: i, children: l }),
2847
+ /* @__PURE__ */ a(cn, { className: lt("options", r == null ? void 0 : r.options), children: b.map((g) => /* @__PURE__ */ a(
2848
+ cr,
2849
+ {
2850
+ className: r == null ? void 0 : r.radio,
2851
+ name: d,
2852
+ checked: h === g.value,
2853
+ label: g.label,
2854
+ disabled: i,
2855
+ variant: u,
2856
+ onChange: () => p(g.value)
2857
+ },
2858
+ g.value
2859
+ )) })
2860
+ ] }), ct = 40, st = 2, Re = 4, Kt = {
2861
+ compact: {
2862
+ height: "32px",
2863
+ padding: "0 10px",
2864
+ radius: "14px"
2865
+ },
2866
+ default: {
2867
+ height: "40px",
2868
+ padding: "0 14px",
2869
+ radius: "16px"
2870
+ }
2871
+ }, Xt = {
2872
+ normal: {
2873
+ background: {
2874
+ static: o(t.black, 2),
2875
+ disabled: o(t.black, 10)
2876
+ },
2877
+ border: {
2878
+ static: o(t.black, 60),
2879
+ disabled: o(t.black, 10)
2880
+ },
2881
+ color: {
2882
+ static: t.black,
2883
+ disabled: o(t.black, 65)
2884
+ },
2885
+ placeholder: o(t.black, 40),
2886
+ focus: o(t["iron-grey"], 30)
2887
+ },
2888
+ error: {
2889
+ background: {
2890
+ static: o(t.red, 2),
2891
+ disabled: o(t.red, 10)
2892
+ },
2893
+ border: {
2894
+ static: o(t.red, 60),
2895
+ disabled: o(t.red, 10)
2896
+ },
2897
+ color: {
2898
+ static: t.red,
2899
+ disabled: o(t.red, 65)
2900
+ },
2901
+ placeholder: o(t.red, 40),
2902
+ focus: o(t.red, 30)
2903
+ }
2904
+ }, pt = (e) => Kt[e] ?? Kt.default, pe = (e) => Xt[e] ?? Xt.normal, sn = n.div`
2905
+ position: relative;
2906
+ display: grid;
2907
+ gap: 2px;
2908
+ min-width: 180px;
2909
+ width: ${(e) => e.$fullWidth ? "100%" : "fit-content"};
2910
+ `, pn = n(le)`
2911
+ margin-left: 6px;
2912
+ `, un = n(ce)`
2913
+ margin-left: 6px;
2914
+ `, bn = n.button`
2915
+ display: flex;
2916
+ align-items: center;
2917
+ justify-content: space-between;
2918
+ gap: 8px;
2919
+ width: 100%;
2920
+ outline: none;
2921
+ font-size: 14px;
2922
+ font-weight: 500;
2923
+ text-align: left;
2924
+ cursor: ${(e) => e.$disabled ? "not-allowed" : "pointer"};
2925
+ height: ${(e) => pt(e.$size).height};
2926
+ padding: ${(e) => pt(e.$size).padding};
2927
+ border-radius: ${(e) => pt(e.$size).radius};
2928
+
2929
+ color: ${(e) => e.$hasValue ? e.$disabled ? pe(e.$variant).color.disabled : pe(e.$variant).color.static : pe(e.$variant).placeholder};
2930
+ border: 1px solid
2931
+ ${(e) => e.$disabled ? pe(e.$variant).border.disabled : pe(e.$variant).border.static};
2932
+ background-color: ${(e) => e.$disabled ? pe(e.$variant).background.disabled : pe(e.$variant).background.static};
2933
+ `, hn = n.span`
2934
+ flex: 1;
2935
+ min-width: 0;
2936
+ overflow: hidden;
2937
+ text-overflow: ellipsis;
2938
+ white-space: nowrap;
2939
+ `, gn = n.span`
2940
+ display: flex;
2941
+ align-items: center;
2942
+ justify-content: center;
2943
+ flex-shrink: 0;
2944
+ transition: transform 0.2s ease;
2945
+ transform: rotate(${(e) => e.$open ? "180deg" : "0deg"});
2946
+ `, sr = `
2947
+ display: grid;
2948
+ gap: 2px;
2949
+ padding: 4px;
2950
+ background: ${t.white};
2951
+ border: 1px solid ${o(t.black, 10)};
2952
+ border-radius: 16px;
2953
+ box-shadow: 0 4px 20px ${o(t.black, 15)};
2954
+ z-index: 1000;
2955
+ `, fn = n.div`
2956
+ position: absolute;
2957
+ left: -4px;
2958
+ width: calc(100% + 8px);
2959
+ overflow: hidden;
2960
+ ${sr}
2961
+ `, $n = n.div`
2962
+ position: fixed;
2963
+ overflow: hidden;
2964
+ ${sr}
2965
+ `, xn = n.button`
2966
+ display: flex;
2967
+ align-items: center;
2968
+ justify-content: space-between;
2969
+ gap: 8px;
2970
+ width: 100%;
2971
+ min-width: 0;
2972
+ height: 40px;
2973
+ padding: 0 14px;
2974
+ border: none;
2975
+ background: ${(e) => e.$selected ? o(t.black, 6) : "transparent"};
2976
+ border-radius: 12px;
2977
+ font-size: 14px;
2978
+ font-weight: 500;
2979
+ text-align: left;
2980
+ cursor: ${(e) => e.$disabled ? "not-allowed" : "pointer"};
2981
+ color: ${(e) => e.$disabled ? o(t.black, 40) : t.black};
2982
+ transition: background-color 0.15s ease;
2983
+
2984
+ &:hover:not(:disabled) {
2985
+ background: ${o(t.black, 8)};
2986
+ }
2987
+
2988
+ & > span {
2989
+ overflow: hidden;
2990
+ text-overflow: ellipsis;
2991
+ white-space: nowrap;
2992
+ min-width: 0;
2993
+ }
2994
+ `, yn = n.span`
2995
+ display: flex;
2996
+ align-items: center;
2997
+ justify-content: center;
2998
+ flex-shrink: 0;
2999
+ color: ${t.black};
3000
+ `, ve = L("select"), aa = ({
3001
+ className: e,
3002
+ classnames: r,
3003
+ disabled: i = !1,
3004
+ fullWidth: l = !1,
3005
+ label: d,
3006
+ message: p,
3007
+ onChange: b,
3008
+ options: c,
3009
+ placeholder: h = "Select...",
3010
+ portalRenderNode: u,
3011
+ ref: $,
3012
+ size: g = "default",
3013
+ value: z,
3014
+ variant: S = "normal",
3015
+ ...C
3016
+ }) => {
3017
+ const [v, P] = B(!1), [D, k] = B({
3018
+ top: 0,
3019
+ left: 0,
3020
+ width: 0
3021
+ }), y = K(null), s = K(null), _ = K(null), E = c.find((f) => f.value === z), I = Math.max(
3022
+ 0,
3023
+ c.findIndex((f) => f.value === z)
3024
+ ), W = -(I * (ct + st) + Re), H = () => {
3025
+ if (!s.current || !u) return;
3026
+ const f = s.current.getBoundingClientRect(), M = I * (ct + st) + Re;
3027
+ let N = f.top - M;
3028
+ const O = c.length * ct + (c.length - 1) * st + Re * 2, G = 8, te = window.innerHeight - O - 8;
3029
+ N < G && (N = G), N > te && (N = te), k({
3030
+ top: N,
3031
+ left: f.left - Re,
3032
+ width: f.width + Re * 2
3033
+ });
3034
+ }, Y = (f) => {
3035
+ var M;
3036
+ b == null || b(f), P(!1), (M = s.current) == null || M.focus();
3037
+ }, V = (f) => {
3038
+ i || c.length === 0 || (f.key === "Enter" || f.key === " " ? (f.preventDefault(), P((M) => !M)) : f.key === "Escape" && v ? (f.preventDefault(), P(!1)) : f.key === "ArrowDown" && !v && (f.preventDefault(), P(!0)));
3039
+ };
3040
+ nr(() => {
3041
+ v && u && H();
3042
+ }, [v, u, I, c.length]), fe(() => {
3043
+ if (!v) return;
3044
+ const f = (O) => {
3045
+ const G = O.target, te = y.current && !y.current.contains(G), se = _.current && !_.current.contains(G);
3046
+ u ? te && se && P(!1) : te && P(!1);
3047
+ }, M = () => {
3048
+ u && H();
3049
+ }, N = () => {
3050
+ u && H();
3051
+ };
3052
+ return document.addEventListener("mousedown", f), u && (window.addEventListener("scroll", M, !0), window.addEventListener("resize", N)), () => {
3053
+ document.removeEventListener("mousedown", f), window.removeEventListener("scroll", M, !0), window.removeEventListener("resize", N);
3054
+ };
3055
+ }, [v, u]);
3056
+ const j = () => c.map((f) => /* @__PURE__ */ w(
3057
+ xn,
3058
+ {
3059
+ type: "button",
3060
+ role: "option",
3061
+ $selected: f.value === z,
3062
+ $disabled: f.disabled ?? !1,
3063
+ disabled: f.disabled,
3064
+ "aria-selected": f.value === z,
3065
+ onClick: () => Y(f.value),
3066
+ className: ve("option", r == null ? void 0 : r.option),
3067
+ children: [
3068
+ /* @__PURE__ */ a("span", { children: f.label }),
3069
+ f.value === z && /* @__PURE__ */ a(yn, { children: /* @__PURE__ */ a(rr, { size: 16 }) })
3070
+ ]
3071
+ },
3072
+ f.value
3073
+ )), T = u ? Ze(
3074
+ /* @__PURE__ */ a(
3075
+ $n,
3076
+ {
3077
+ ref: _,
3078
+ role: "listbox",
3079
+ style: {
3080
+ top: D.top,
3081
+ left: D.left,
3082
+ width: D.width
3083
+ },
3084
+ className: ve("dropdown", r == null ? void 0 : r.dropdown),
3085
+ children: j()
3086
+ }
3087
+ ),
3088
+ u
3089
+ ) : /* @__PURE__ */ a(
3090
+ fn,
3091
+ {
3092
+ ref: _,
3093
+ role: "listbox",
3094
+ style: { top: W },
3095
+ className: ve("dropdown", r == null ? void 0 : r.dropdown),
3096
+ children: j()
3097
+ }
3098
+ );
3099
+ return /* @__PURE__ */ w(
3100
+ sn,
3101
+ {
3102
+ ...C,
3103
+ ref: (f) => {
3104
+ y.current = f, typeof $ == "function" ? $(f) : $ && ($.current = f);
3105
+ },
3106
+ $fullWidth: l,
3107
+ className: ve("container", e),
3108
+ children: [
3109
+ d && /* @__PURE__ */ a(
3110
+ pn,
3111
+ {
3112
+ variant: S === "error" ? "error" : "normal",
3113
+ className: ve("label", r == null ? void 0 : r.label),
3114
+ children: d
3115
+ }
3116
+ ),
3117
+ /* @__PURE__ */ w(
3118
+ bn,
3119
+ {
3120
+ ref: s,
3121
+ type: "button",
3122
+ $size: g,
3123
+ $variant: S,
3124
+ $disabled: i,
3125
+ $hasValue: !!E,
3126
+ disabled: i,
3127
+ onClick: () => !i && c.length > 0 && P((f) => !f),
3128
+ onKeyDown: V,
3129
+ "aria-haspopup": "listbox",
3130
+ "aria-expanded": v,
3131
+ className: ve("trigger", r == null ? void 0 : r.trigger),
3132
+ children: [
3133
+ /* @__PURE__ */ a(hn, { children: (E == null ? void 0 : E.label) ?? h }),
3134
+ /* @__PURE__ */ a(gn, { $open: v, children: /* @__PURE__ */ a(ir, { size: 16 }) })
3135
+ ]
3136
+ }
3137
+ ),
3138
+ v && T,
3139
+ p && /* @__PURE__ */ a(un, { variant: S, children: p })
3140
+ ]
3141
+ }
3142
+ );
3143
+ }, ft = {
3144
+ normal: {
3145
+ border: t["iron-grey"],
3146
+ placeholder: t["iron-grey"]
3147
+ },
3148
+ error: {
3149
+ border: t.red,
3150
+ placeholder: o(t.red, 40)
3151
+ }
3152
+ }, kn = n.div`
3153
+ position: relative;
3154
+ display: flex;
3155
+ flex-direction: column;
3156
+ gap: 4px;
3157
+ `, vn = n(le)`
3158
+ margin-left: 6px;
3159
+ `, wn = n.div`
3160
+ display: flex;
3161
+ flex-wrap: wrap;
3162
+ align-items: center;
3163
+ gap: 6px;
3164
+ min-height: 44px;
3165
+ padding: 8px 12px;
3166
+ border: 1px dashed ${(e) => ft[e.$variant].border};
3167
+ border-radius: 8px;
3168
+ background: ${t.white};
3169
+ cursor: ${(e) => e.$disabled ? "not-allowed" : "text"};
3170
+ opacity: ${(e) => e.$disabled ? 0.5 : 1};
3171
+ transition: border-color 0.15s ease;
3172
+
3173
+ &:hover {
3174
+ border-color: ${(e) => e.$disabled ? ft[e.$variant].border : e.$variant === "error" ? t.red : t.black};
3175
+ }
3176
+
3177
+ ${(e) => e.$focused && `
3178
+ outline: 2px solid ${e.$variant === "error" ? t.red : t["steel-blue"]};
3179
+ outline-offset: 2px;
3180
+ `}
3181
+ `, Sn = n.input`
3182
+ flex: 1;
3183
+ min-width: 80px;
3184
+ border: none;
3185
+ outline: none;
3186
+ background: transparent;
3187
+ font-size: 14px;
3188
+ color: ${t.black};
3189
+ cursor: ${(e) => e.$disabled ? "not-allowed" : "text"};
3190
+
3191
+ &::placeholder {
3192
+ color: ${(e) => ft[e.$variant].placeholder};
3193
+ }
3194
+
3195
+ &:disabled {
3196
+ cursor: not-allowed;
3197
+ }
3198
+ `, pr = `
3199
+ z-index: 100;
3200
+ background-color: ${t.white};
3201
+ border: 1px solid ${o(t.black, 15)};
3202
+ border-radius: 8px;
3203
+ box-shadow: 0 4px 16px ${o(t.black, 12)};
3204
+ max-height: 200px;
3205
+ overflow-y: auto;
3206
+ `, ur = (e, r) => e ? "translateY(0)" : r === "bottom" ? "translateY(-8px)" : "translateY(8px)", br = `
3207
+ opacity 0.15s ease,
3208
+ transform 0.15s ease,
3209
+ visibility 0.15s;
3210
+ `, mn = n.div`
3211
+ position: absolute;
3212
+ left: 0;
3213
+ right: 0;
3214
+ ${(e) => e.$position === "bottom" ? "top: calc(100% + 4px);" : "bottom: calc(100% + 4px);"}
3215
+ ${pr}
3216
+ opacity: ${(e) => e.$open ? 1 : 0};
3217
+ visibility: ${(e) => e.$open ? "visible" : "hidden"};
3218
+ transform: ${(e) => ur(e.$open, e.$position)};
3219
+ transition: ${br};
3220
+ `, Pn = n.div`
3221
+ position: fixed;
3222
+ ${pr}
3223
+ opacity: ${(e) => e.$open ? 1 : 0};
3224
+ visibility: ${(e) => e.$open ? "visible" : "hidden"};
3225
+ transform: ${(e) => ur(e.$open, e.$position)};
3226
+ transition: ${br};
3227
+ `, qt = n.button`
3228
+ display: flex;
3229
+ align-items: center;
3230
+ width: 100%;
3231
+ padding: 10px 12px;
3232
+ border: none;
3233
+ background: transparent;
3234
+ font-size: 14px;
3235
+ color: ${t.black};
3236
+ text-align: left;
3237
+ cursor: pointer;
3238
+ transition: background-color 0.15s ease;
3239
+
3240
+ &:hover {
3241
+ background-color: ${t.gray};
3242
+ }
3243
+
3244
+ &:first-of-type {
3245
+ border-radius: 7px 7px 0 0;
3246
+ }
3247
+
3248
+ &:last-of-type {
3249
+ border-radius: 0 0 7px 7px;
3250
+ }
3251
+
3252
+ &:only-child {
3253
+ border-radius: 7px;
3254
+ }
3255
+ `, Zt = n.div`
3256
+ display: flex;
3257
+ align-items: center;
3258
+ justify-content: center;
3259
+ padding: 16px;
3260
+ color: ${t["iron-grey"]};
3261
+ font-size: 14px;
3262
+ text-align: center;
3263
+ `, Cn = n(ce)`
3264
+ margin-left: 6px;
3265
+ `, ee = L("tags"), Ue = 4, da = ({
3266
+ className: e,
3267
+ classnames: r,
3268
+ createKey: i = "Tab",
3269
+ disabled: l = !1,
3270
+ emptyMessage: d = "No options",
3271
+ freeSolo: p = !0,
3272
+ label: b,
3273
+ message: c,
3274
+ onChange: h,
3275
+ options: u = [],
3276
+ placeholder: $ = "Add tag...",
3277
+ portalRenderNode: g,
3278
+ ref: z,
3279
+ value: S,
3280
+ variant: C = "normal",
3281
+ ...v
3282
+ }) => {
3283
+ const P = K(null), D = K(null), k = K(null), y = K(null), [s, _] = B(""), [E, I] = B(!1), [W, H] = B("bottom"), [Y, V] = B({
3284
+ top: 0,
3285
+ left: 0,
3286
+ width: 0
3287
+ }), j = oe(() => {
3288
+ const m = u.filter((U) => !S.includes(U.value));
3289
+ if (!s.trim()) return m;
3290
+ const R = s.toLowerCase().trim();
3291
+ return m.filter((U) => U.label.toLowerCase().includes(R));
3292
+ }, [u, S, s]), T = E && u.length > 0, f = A(() => {
3293
+ var Le;
3294
+ if (!D.current) return;
3295
+ const m = D.current.getBoundingClientRect(), R = ((Le = k.current) == null ? void 0 : Le.offsetHeight) ?? 200, U = window.innerHeight - m.bottom - Ue, X = m.top - Ue, $e = U < R && X > U ? "top" : "bottom";
3296
+ if (H($e), g) {
3297
+ const Qe = $e === "bottom" ? m.bottom + Ue : m.top - R - Ue;
3298
+ V({
3299
+ top: Qe,
3300
+ left: m.left,
3301
+ width: m.width
3302
+ });
3303
+ }
3304
+ }, [g]);
3305
+ fe(() => {
3306
+ if (E)
3307
+ return f(), window.addEventListener("scroll", f, !0), window.addEventListener("resize", f), () => {
3308
+ window.removeEventListener("scroll", f, !0), window.removeEventListener("resize", f);
3309
+ };
3310
+ }, [E, f]);
3311
+ const M = A(
3312
+ (m) => {
3313
+ const R = m.trim();
3314
+ return !R || S.includes(R) ? !1 : (h([...S, R]), _(""), !0);
3315
+ },
3316
+ [S, h]
3317
+ ), N = (m) => {
3318
+ if (m.key === i && s.trim())
3319
+ if (m.preventDefault(), p)
3320
+ M(s);
3321
+ else {
3322
+ const R = j.find(
3323
+ (U) => U.label.toLowerCase() === s.toLowerCase().trim()
3324
+ );
3325
+ R && M(R.value);
3326
+ }
3327
+ else m.key === "Backspace" && !s && S.length > 0 && h(S.slice(0, -1));
3328
+ }, O = (m) => {
3329
+ var R;
3330
+ M(m), (R = y.current) == null || R.focus();
3331
+ }, G = (m) => {
3332
+ h(S.filter((R) => R !== m));
3333
+ }, te = () => {
3334
+ var m;
3335
+ l || (m = y.current) == null || m.focus();
3336
+ }, se = (m) => {
3337
+ const R = u.find((U) => U.value === m);
3338
+ return (R == null ? void 0 : R.label) ?? m;
3339
+ };
3340
+ return /* @__PURE__ */ w(kn, { ...v, ref: z, className: ee("container", e), children: [
3341
+ b && /* @__PURE__ */ a(vn, { variant: C, className: ee("label"), children: b }),
3342
+ /* @__PURE__ */ w("div", { ref: P, style: { position: "relative" }, children: [
3343
+ /* @__PURE__ */ w(
3344
+ wn,
3345
+ {
3346
+ ref: D,
3347
+ $variant: C,
3348
+ $disabled: l,
3349
+ $focused: E,
3350
+ onClick: te,
3351
+ className: ee("trigger", r == null ? void 0 : r.trigger),
3352
+ children: [
3353
+ S.map((m) => /* @__PURE__ */ a(
3354
+ gt,
3355
+ {
3356
+ variant: C === "error" ? "red" : "gray",
3357
+ deletable: !l,
3358
+ onDelete: () => G(m),
3359
+ className: ee("chip", r == null ? void 0 : r.chip),
3360
+ children: se(m)
3361
+ },
3362
+ m
3363
+ )),
3364
+ /* @__PURE__ */ a(
3365
+ Sn,
3366
+ {
3367
+ ref: y,
3368
+ type: "text",
3369
+ value: s,
3370
+ onChange: (m) => _(m.target.value),
3371
+ onFocus: () => I(!0),
3372
+ onBlur: () => setTimeout(() => I(!1), 150),
3373
+ onKeyDown: N,
3374
+ placeholder: S.length === 0 ? $ : "",
3375
+ disabled: l,
3376
+ $disabled: l,
3377
+ $variant: C,
3378
+ className: ee("input", r == null ? void 0 : r.input)
3379
+ }
3380
+ )
3381
+ ]
3382
+ }
3383
+ ),
3384
+ u.length > 0 && (g ? Ze(
3385
+ /* @__PURE__ */ a(
3386
+ Pn,
3387
+ {
3388
+ ref: k,
3389
+ $open: T,
3390
+ $position: W,
3391
+ style: {
3392
+ top: Y.top,
3393
+ left: Y.left,
3394
+ width: Y.width
3395
+ },
3396
+ className: ee("dropdown", r == null ? void 0 : r.dropdown),
3397
+ children: j.length === 0 ? /* @__PURE__ */ a(Zt, { className: ee("empty", r == null ? void 0 : r.empty), children: d }) : j.map((m) => /* @__PURE__ */ a(
3398
+ qt,
3399
+ {
3400
+ type: "button",
3401
+ onMouseDown: (R) => R.preventDefault(),
3402
+ onClick: () => O(m.value),
3403
+ className: ee("option", r == null ? void 0 : r.option),
3404
+ children: m.label
3405
+ },
3406
+ m.value
3407
+ ))
3408
+ }
3409
+ ),
3410
+ g
3411
+ ) : /* @__PURE__ */ a(
3412
+ mn,
3413
+ {
3414
+ ref: k,
3415
+ $open: T,
3416
+ $position: W,
3417
+ className: ee("dropdown", r == null ? void 0 : r.dropdown),
3418
+ children: j.length === 0 ? /* @__PURE__ */ a(Zt, { className: ee("empty", r == null ? void 0 : r.empty), children: d }) : j.map((m) => /* @__PURE__ */ a(
3419
+ qt,
3420
+ {
3421
+ type: "button",
3422
+ onMouseDown: (R) => R.preventDefault(),
3423
+ onClick: () => O(m.value),
3424
+ className: ee("option", r == null ? void 0 : r.option),
3425
+ children: m.label
3426
+ },
3427
+ m.value
3428
+ ))
3429
+ }
3430
+ ))
3431
+ ] }),
3432
+ c && /* @__PURE__ */ a(Cn, { variant: C, className: ee("message"), children: c })
3433
+ ] });
3434
+ }, Jt = {
3435
+ normal: {
3436
+ background: {
3437
+ static: o(t.black, 2),
3438
+ disabled: o(t.black, 10)
3439
+ },
3440
+ border: {
3441
+ static: o(t.black, 60),
3442
+ disabled: o(t.black, 10)
3443
+ },
3444
+ color: {
3445
+ static: t.black,
3446
+ disabled: o(t.black, 65)
3447
+ },
3448
+ placeholder: {
3449
+ static: o(t.black, 40),
3450
+ disabled: o(t.black, 65)
3451
+ },
3452
+ focus: o(t["iron-grey"], 30)
3453
+ },
3454
+ error: {
3455
+ background: {
3456
+ static: o(t.red, 2),
3457
+ disabled: o(t.red, 10)
3458
+ },
3459
+ border: {
3460
+ static: o(t.red, 60),
3461
+ disabled: o(t.red, 10)
3462
+ },
3463
+ color: {
3464
+ static: t.red,
3465
+ disabled: o(t.red, 65)
3466
+ },
3467
+ placeholder: {
3468
+ static: o(t.red, 40),
3469
+ disabled: o(t.red, 65)
3470
+ },
3471
+ focus: o(t.red, 30)
3472
+ }
3473
+ }, de = (e) => Jt[e] ?? Jt.normal, Nn = n.div`
3474
+ display: grid;
3475
+ flex-direction: column;
3476
+ gap: 2px;
3477
+ width: ${(e) => e.$fullWidth ? "100%" : "fit-content"};
3478
+ `, zn = n(le)`
3479
+ margin-left: 6px;
3480
+ `, Tn = n.textarea`
3481
+ flex: 1;
3482
+ min-width: 0;
3483
+ outline: none;
3484
+ font-size: 14px;
3485
+ font-weight: 500;
3486
+ font-family: inherit;
3487
+ padding: 10px 14px;
3488
+ border-radius: 16px;
3489
+ resize: vertical;
3490
+
3491
+ color: ${(e) => de(e.$variant).color.static};
3492
+ border: 1px solid ${(e) => de(e.$variant).border.static};
3493
+ background-color: ${(e) => de(e.$variant).background.static};
3494
+
3495
+ &::placeholder {
3496
+ color: ${(e) => de(e.$variant).placeholder.static};
3497
+ }
3498
+
3499
+ &:disabled {
3500
+ cursor: not-allowed;
3501
+ resize: none;
3502
+ color: ${(e) => de(e.$variant).color.disabled};
3503
+ background-color: ${(e) => de(e.$variant).background.disabled};
3504
+ border-color: ${(e) => de(e.$variant).border.disabled};
3505
+
3506
+ &::placeholder {
3507
+ color: ${(e) => de(e.$variant).placeholder.disabled};
3508
+ }
3509
+ }
3510
+ `, Dn = n.div`
3511
+ display: flex;
3512
+ align-items: flex-start;
3513
+ gap: 8px;
3514
+ margin: 0 6px;
3515
+ `, On = n(ce)`
3516
+ flex: 1;
3517
+ min-width: 0;
3518
+ `, Rn = n.span`
3519
+ flex-shrink: 0;
3520
+ margin-left: auto;
3521
+ font-size: 12px;
3522
+ font-weight: 500;
3523
+ color: ${(e) => e.$variant === "error" ? t.red : t["iron-grey"]};
3524
+ `, Ie = L("textarea"), la = ({
3525
+ className: e,
3526
+ classnames: r,
3527
+ count: i,
3528
+ disabled: l,
3529
+ fullWidth: d,
3530
+ label: p,
3531
+ message: b,
3532
+ ref: c,
3533
+ value: h,
3534
+ variant: u = "normal",
3535
+ rows: $ = 4,
3536
+ ...g
3537
+ }) => {
3538
+ const z = typeof h == "string" ? h.length : 0, S = b || i !== void 0;
3539
+ return /* @__PURE__ */ w(Nn, { className: Ie("container", e), $fullWidth: !!d, children: [
3540
+ p && /* @__PURE__ */ a(zn, { variant: u, className: Ie("label", r == null ? void 0 : r.label), children: p }),
3541
+ /* @__PURE__ */ a(
3542
+ Tn,
3543
+ {
3544
+ ...g,
3545
+ ref: c,
3546
+ rows: $,
3547
+ value: h,
3548
+ disabled: l,
3549
+ $variant: u,
3550
+ className: Ie("textarea", r == null ? void 0 : r.textarea)
3551
+ }
3552
+ ),
3553
+ S && /* @__PURE__ */ w(Dn, { children: [
3554
+ b && /* @__PURE__ */ a(On, { variant: u, className: Ie("message"), children: b }),
3555
+ i !== void 0 && /* @__PURE__ */ w(Rn, { $variant: u, className: Ie("counter"), children: [
3556
+ z,
3557
+ "/",
3558
+ i
3559
+ ] })
3560
+ ] })
3561
+ ] });
3562
+ }, Qt = {
3563
+ normal: {
3564
+ track: {
3565
+ background: o(t["iron-grey"], 20),
3566
+ backgroundChecked: t.black,
3567
+ border: o(t["iron-grey"], 30),
3568
+ borderChecked: t.black
3569
+ },
3570
+ thumb: {
3571
+ background: t.white,
3572
+ backgroundChecked: t.white
3573
+ },
3574
+ label: t.black
3575
+ },
3576
+ error: {
3577
+ track: {
3578
+ background: o(t.red, 15),
3579
+ backgroundChecked: t.red,
3580
+ border: t.red,
3581
+ borderChecked: t.red
3582
+ },
3583
+ thumb: {
3584
+ background: t.white,
3585
+ backgroundChecked: t.white
3586
+ },
3587
+ label: t.red
3588
+ }
3589
+ }, ue = (e) => Qt[e] ?? Qt.normal, In = n.label`
3590
+ display: inline-flex;
3591
+ align-items: flex-start;
3592
+ gap: 8px;
3593
+ cursor: ${(e) => e.$disabled ? "not-allowed" : "pointer"};
3594
+ opacity: ${(e) => e.$disabled ? 0.5 : 1};
3595
+ `, _n = n.input`
3596
+ position: absolute;
3597
+ opacity: 0;
3598
+ width: 0;
3599
+ height: 0;
3600
+ pointer-events: none;
3601
+ `, An = n.span`
3602
+ position: relative;
3603
+ flex-shrink: 0;
3604
+ width: 36px;
3605
+ height: 20px;
3606
+ border-radius: 10px;
3607
+ border: 1px solid
3608
+ ${(e) => e.$checked ? ue(e.$variant).track.borderChecked : ue(e.$variant).track.border};
3609
+ background-color: ${(e) => e.$checked ? ue(e.$variant).track.backgroundChecked : ue(e.$variant).track.background};
3610
+ transition:
3611
+ border-color 0.2s ease,
3612
+ background-color 0.2s ease;
3613
+ `, En = n.span`
3614
+ position: absolute;
3615
+ top: 2px;
3616
+ left: ${(e) => e.$checked ? "18px" : "2px"};
3617
+ width: 14px;
3618
+ height: 14px;
3619
+ border-radius: 50%;
3620
+ background-color: ${(e) => e.$checked ? ue(e.$variant).thumb.backgroundChecked : ue(e.$variant).thumb.background};
3621
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
3622
+ transition: left 0.2s ease;
3623
+ `, Ln = n.span`
3624
+ font-size: 14px;
3625
+ font-weight: 500;
3626
+ line-height: 1.3;
3627
+ color: ${(e) => ue(e.$variant).label};
3628
+ user-select: none;
3629
+
3630
+ a {
3631
+ color: inherit;
3632
+ text-decoration: underline;
3633
+ cursor: pointer;
3634
+
3635
+ &:hover {
3636
+ text-decoration: none;
3637
+ }
3638
+ }
3639
+ `, _e = L("toggle"), hr = ({
3640
+ checked: e,
3641
+ className: r,
3642
+ classnames: i,
3643
+ disabled: l,
3644
+ label: d,
3645
+ onChange: p,
3646
+ ref: b,
3647
+ variant: c = "normal",
3648
+ ...h
3649
+ }) => /* @__PURE__ */ w(
3650
+ In,
3651
+ {
3652
+ className: _e("container", r),
3653
+ $disabled: !!l,
3654
+ $variant: c,
3655
+ children: [
3656
+ /* @__PURE__ */ a(
3657
+ _n,
3658
+ {
3659
+ ...h,
3660
+ ref: b,
3661
+ type: "checkbox",
3662
+ className: _e("input", i == null ? void 0 : i.input),
3663
+ checked: e,
3664
+ disabled: l,
3665
+ onChange: p
3666
+ }
3667
+ ),
3668
+ /* @__PURE__ */ a(
3669
+ An,
3670
+ {
3671
+ className: _e("track", i == null ? void 0 : i.track),
3672
+ $checked: e,
3673
+ $variant: c,
3674
+ children: /* @__PURE__ */ a(
3675
+ En,
3676
+ {
3677
+ className: _e("thumb", i == null ? void 0 : i.thumb),
3678
+ $checked: e,
3679
+ $variant: c
3680
+ }
3681
+ )
3682
+ }
3683
+ ),
3684
+ d && /* @__PURE__ */ a(Ln, { className: _e("label", i == null ? void 0 : i.label), $variant: c, children: d })
3685
+ ]
3686
+ }
3687
+ ), er = {
3688
+ normal: {
3689
+ border: {
3690
+ static: o(t.black, 20),
3691
+ hover: o(t.black, 40),
3692
+ active: o(t.black, 40),
3693
+ disabled: o(t.black, 10)
3694
+ },
3695
+ borderChecked: t.black,
3696
+ background: {
3697
+ static: t.white,
3698
+ hover: t.white,
3699
+ active: t.white,
3700
+ disabled: o(t.black, 5)
3701
+ },
3702
+ backgroundChecked: o(t.black, 5),
3703
+ label: {
3704
+ static: t.black,
3705
+ hover: t.black,
3706
+ active: t.black,
3707
+ disabled: o(t.black, 40)
3708
+ },
3709
+ description: {
3710
+ static: o(t.black, 60),
3711
+ hover: o(t.black, 60),
3712
+ active: o(t.black, 60),
3713
+ disabled: o(t.black, 30)
3714
+ }
3715
+ },
3716
+ error: {
3717
+ border: {
3718
+ static: t.red,
3719
+ hover: t.red,
3720
+ active: t.red,
3721
+ disabled: o(t.red, 30)
3722
+ },
3723
+ borderChecked: t.red,
3724
+ background: {
3725
+ static: t.white,
3726
+ hover: t.white,
3727
+ active: t.white,
3728
+ disabled: o(t.red, 5)
3729
+ },
3730
+ backgroundChecked: o(t.red, 5),
3731
+ label: {
3732
+ static: t.red,
3733
+ hover: t.red,
3734
+ active: t.red,
3735
+ disabled: o(t.red, 40)
3736
+ },
3737
+ description: {
3738
+ static: o(t.red, 70),
3739
+ hover: o(t.red, 70),
3740
+ active: o(t.red, 70),
3741
+ disabled: o(t.red, 40)
3742
+ }
3743
+ }
3744
+ }, ge = (e) => er[e] ?? er.normal, Mn = n.label`
3745
+ display: grid;
3746
+ grid-template-columns: 1fr auto;
3747
+ align-items: start;
3748
+ gap: 8px;
3749
+ padding: 12px;
3750
+ background-color: ${(e) => {
3751
+ const r = ge(e.$variant);
3752
+ return e.$disabled ? r.background.disabled : e.$checked ? r.backgroundChecked : r.background.static;
3753
+ }};
3754
+ border: 1px solid
3755
+ ${(e) => {
3756
+ const r = ge(e.$variant);
3757
+ return e.$disabled ? r.border.disabled : e.$checked ? r.borderChecked : r.border.static;
3758
+ }};
3759
+ border-radius: 12px;
3760
+ cursor: ${(e) => e.$disabled ? "not-allowed" : "pointer"};
3761
+ transition:
3762
+ border-color 0.15s ease,
3763
+ background-color 0.15s ease;
3764
+ width: ${(e) => e.$fullWidth ? "100%" : "fit-content"};
3765
+ min-width: 0;
3766
+
3767
+ &:hover:not([data-disabled='true']) {
3768
+ border-color: ${(e) => {
3769
+ const r = ge(e.$variant);
3770
+ return e.$checked ? r.borderChecked : r.border.hover;
3771
+ }};
3772
+ }
3773
+
3774
+ .vacano_toggle_container {
3775
+ pointer-events: none;
3776
+ }
3777
+ `, Fn = n.input`
3778
+ position: absolute;
3779
+ width: 1px;
3780
+ height: 1px;
3781
+ margin: -1px;
3782
+ padding: 0;
3783
+ overflow: hidden;
3784
+ clip: rect(0, 0, 0, 0);
3785
+ white-space: nowrap;
3786
+ border: 0;
3787
+ `, Yn = n.div`
3788
+ display: flex;
3789
+ flex-direction: column;
3790
+ gap: 2px;
3791
+ min-width: 0;
3792
+ `, Vn = n.span`
3793
+ font-size: 14px;
3794
+ font-weight: 500;
3795
+ line-height: 1.4;
3796
+ color: ${(e) => ge(e.$variant).label.static};
3797
+
3798
+ label[data-disabled='true'] & {
3799
+ color: ${(e) => ge(e.$variant).label.disabled};
3800
+ }
3801
+ `, Bn = n.span`
3802
+ font-size: 12px;
3803
+ font-weight: 400;
3804
+ line-height: 1.4;
3805
+ color: ${(e) => ge(e.$variant).description.static};
3806
+
3807
+ label[data-disabled='true'] & {
3808
+ color: ${(e) => ge(e.$variant).description.disabled};
3809
+ }
3810
+ `, Ke = L("toggle-card"), ca = ({
3811
+ checked: e,
3812
+ className: r,
3813
+ classnames: i,
3814
+ description: l,
3815
+ disabled: d,
3816
+ fullWidth: p = !1,
3817
+ label: b,
3818
+ onChange: c,
3819
+ ref: h,
3820
+ variant: u = "normal",
3821
+ ...$
3822
+ }) => /* @__PURE__ */ w(
3823
+ Mn,
3824
+ {
3825
+ className: Ke("container", r),
3826
+ $checked: e,
3827
+ $disabled: !!d,
3828
+ $fullWidth: p,
3829
+ $variant: u,
3830
+ "data-disabled": d,
3831
+ children: [
3832
+ /* @__PURE__ */ a(
3833
+ Fn,
3834
+ {
3835
+ ...$,
3836
+ ref: h,
3837
+ type: "checkbox",
3838
+ checked: e,
3839
+ disabled: d,
3840
+ onChange: c
3841
+ }
3842
+ ),
3843
+ /* @__PURE__ */ w(Yn, { className: Ke("content", i == null ? void 0 : i.content), children: [
3844
+ /* @__PURE__ */ a(Vn, { className: Ke("label", i == null ? void 0 : i.label), $variant: u, children: b }),
3845
+ l && /* @__PURE__ */ a(
3846
+ Bn,
3847
+ {
3848
+ className: Ke("description", i == null ? void 0 : i.description),
3849
+ $variant: u,
3850
+ children: l
3851
+ }
3852
+ )
3853
+ ] }),
3854
+ /* @__PURE__ */ a(
3855
+ hr,
3856
+ {
3857
+ className: i == null ? void 0 : i.toggle,
3858
+ checked: e,
3859
+ disabled: d,
3860
+ variant: u,
3861
+ onChange: () => {
3862
+ },
3863
+ tabIndex: -1,
3864
+ "aria-hidden": !0
3865
+ }
3866
+ )
3867
+ ]
3868
+ }
3869
+ ), tr = {
3870
+ label: {
3871
+ color: t.black,
3872
+ disabledColor: o(t.black, 40)
3873
+ }
3874
+ }, Hn = n.div`
3875
+ display: flex;
3876
+ flex-direction: column;
3877
+ gap: 8px;
3878
+ `, Wn = n.span`
3879
+ font-size: 13px;
3880
+ font-weight: 500;
3881
+ line-height: 1.5;
3882
+ color: ${(e) => e.$disabled ? tr.label.disabledColor : tr.label.color};
3883
+ margin-bottom: 4px;
3884
+ `, jn = n.div`
3885
+ display: flex;
3886
+ flex-direction: column;
3887
+ gap: 12px;
3888
+ `, ut = L("toggle-group"), sa = ({
3889
+ className: e,
3890
+ classnames: r,
3891
+ disabled: i,
3892
+ label: l,
3893
+ onChange: d,
3894
+ options: p,
3895
+ ref: b,
3896
+ value: c,
3897
+ variant: h = "normal",
3898
+ ...u
3899
+ }) => {
3900
+ const $ = (g, z) => {
3901
+ d(z ? [...c, g] : c.filter((S) => S !== g));
3902
+ };
3903
+ return /* @__PURE__ */ w(Hn, { ...u, ref: b, className: ut("container", e), children: [
3904
+ l && /* @__PURE__ */ a(Wn, { className: ut("label", r == null ? void 0 : r.label), $disabled: i, children: l }),
3905
+ /* @__PURE__ */ a(jn, { className: ut("options", r == null ? void 0 : r.options), children: p.map((g) => /* @__PURE__ */ a(
3906
+ hr,
3907
+ {
3908
+ className: r == null ? void 0 : r.toggle,
3909
+ checked: c.includes(g.value),
3910
+ label: g.label,
3911
+ disabled: i,
3912
+ variant: h,
3913
+ onChange: (z) => $(g.value, z.target.checked)
3914
+ },
3915
+ g.value
3916
+ )) })
3917
+ ] });
3918
+ };
3919
+ export {
3920
+ Jn as A,
3921
+ Oo as B,
3922
+ xt as C,
3923
+ ta as D,
3924
+ le as F,
3925
+ Ti as I,
3926
+ Do as K,
3927
+ ra as M,
3928
+ oa as O,
3929
+ cr as R,
3930
+ aa as S,
3931
+ da as T,
3932
+ Qn as a,
3933
+ ea as b,
3934
+ ia as c,
3935
+ na as d,
3936
+ la as e,
3937
+ hr as f,
3938
+ ca as g,
3939
+ sa as h,
3940
+ ko as i,
3941
+ gt as j,
3942
+ qo as k,
3943
+ ce as l,
3944
+ To as m,
3945
+ Ri as n,
3946
+ n as s
3947
+ };
3948
+ //# sourceMappingURL=ToggleGroup-C44x4Sx1.js.map