@krosoft/react 0.0.73 → 0.0.75

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.
@@ -0,0 +1,1237 @@
1
+ import { jsxs as D, jsx as u } from "react/jsx-runtime";
2
+ import { o as G, p as I, q as W, r as vt, I as gt, X as Ce, C as Pt, s as Z } from "./calendar-cHag6u-j.js";
3
+ import { a as Ne, u as x, d as yt, e as M, f as U, q as Ae, g as bt, h as wt, o as Et, s as Ct, l as Nt, i as At, j as Ot, k as Mt, m as xt, n as Rt, p as H, v as St, t as Tt, B as j } from "./index-BQOmHRsD.js";
4
+ import { c as Y } from "./index-gWiv5-6R.js";
5
+ import { h as _t, R as Dt, u as Ft } from "./select-Dv9bdUCB.js";
6
+ import { c as Oe } from "./createLucideIcon-CRdjzt2A.js";
7
+ import * as i from "react";
8
+ import * as Lt from "react-dom";
9
+ import kt from "react-dom";
10
+ /**
11
+ * @license lucide-react v1.16.0 - ISC
12
+ *
13
+ * This source code is licensed under the ISC license.
14
+ * See the LICENSE file in the root directory of this source tree.
15
+ */
16
+ const It = [
17
+ ["path", { d: "M8 2v4", key: "1cmpym" }],
18
+ ["path", { d: "M16 2v4", key: "4m81vk" }],
19
+ ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
20
+ ["path", { d: "M3 10h18", key: "8toen8" }]
21
+ ], Wt = Oe("calendar", It);
22
+ /**
23
+ * @license lucide-react v1.16.0 - ISC
24
+ *
25
+ * This source code is licensed under the ISC license.
26
+ * See the LICENSE file in the root directory of this source tree.
27
+ */
28
+ const jt = [
29
+ ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
30
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
31
+ ], Ut = Oe("search", jt), Ht = {
32
+ lessThanXSeconds: {
33
+ one: "moins d’une seconde",
34
+ other: "moins de {{count}} secondes"
35
+ },
36
+ xSeconds: {
37
+ one: "1 seconde",
38
+ other: "{{count}} secondes"
39
+ },
40
+ halfAMinute: "30 secondes",
41
+ lessThanXMinutes: {
42
+ one: "moins d’une minute",
43
+ other: "moins de {{count}} minutes"
44
+ },
45
+ xMinutes: {
46
+ one: "1 minute",
47
+ other: "{{count}} minutes"
48
+ },
49
+ aboutXHours: {
50
+ one: "environ 1 heure",
51
+ other: "environ {{count}} heures"
52
+ },
53
+ xHours: {
54
+ one: "1 heure",
55
+ other: "{{count}} heures"
56
+ },
57
+ xDays: {
58
+ one: "1 jour",
59
+ other: "{{count}} jours"
60
+ },
61
+ aboutXWeeks: {
62
+ one: "environ 1 semaine",
63
+ other: "environ {{count}} semaines"
64
+ },
65
+ xWeeks: {
66
+ one: "1 semaine",
67
+ other: "{{count}} semaines"
68
+ },
69
+ aboutXMonths: {
70
+ one: "environ 1 mois",
71
+ other: "environ {{count}} mois"
72
+ },
73
+ xMonths: {
74
+ one: "1 mois",
75
+ other: "{{count}} mois"
76
+ },
77
+ aboutXYears: {
78
+ one: "environ 1 an",
79
+ other: "environ {{count}} ans"
80
+ },
81
+ xYears: {
82
+ one: "1 an",
83
+ other: "{{count}} ans"
84
+ },
85
+ overXYears: {
86
+ one: "plus d’un an",
87
+ other: "plus de {{count}} ans"
88
+ },
89
+ almostXYears: {
90
+ one: "presqu’un an",
91
+ other: "presque {{count}} ans"
92
+ }
93
+ }, $t = (e, t, n) => {
94
+ let r;
95
+ const o = Ht[e];
96
+ return typeof o == "string" ? r = o : t === 1 ? r = o.one : r = o.other.replace("{{count}}", String(t)), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "dans " + r : "il y a " + r : r;
97
+ }, zt = {
98
+ full: "EEEE d MMMM y",
99
+ long: "d MMMM y",
100
+ medium: "d MMM y",
101
+ short: "dd/MM/y"
102
+ }, Jt = {
103
+ full: "HH:mm:ss zzzz",
104
+ long: "HH:mm:ss z",
105
+ medium: "HH:mm:ss",
106
+ short: "HH:mm"
107
+ }, Bt = {
108
+ full: "{{date}} 'à' {{time}}",
109
+ long: "{{date}} 'à' {{time}}",
110
+ medium: "{{date}}, {{time}}",
111
+ short: "{{date}}, {{time}}"
112
+ }, Xt = {
113
+ date: G({
114
+ formats: zt,
115
+ defaultWidth: "full"
116
+ }),
117
+ time: G({
118
+ formats: Jt,
119
+ defaultWidth: "full"
120
+ }),
121
+ dateTime: G({
122
+ formats: Bt,
123
+ defaultWidth: "full"
124
+ })
125
+ }, Kt = {
126
+ lastWeek: "eeee 'dernier à' p",
127
+ yesterday: "'hier à' p",
128
+ today: "'aujourd’hui à' p",
129
+ tomorrow: "'demain à' p'",
130
+ nextWeek: "eeee 'prochain à' p",
131
+ other: "P"
132
+ }, Vt = (e, t, n, r) => Kt[e], Yt = {
133
+ narrow: ["av. J.-C", "ap. J.-C"],
134
+ abbreviated: ["av. J.-C", "ap. J.-C"],
135
+ wide: ["avant Jésus-Christ", "après Jésus-Christ"]
136
+ }, qt = {
137
+ narrow: ["T1", "T2", "T3", "T4"],
138
+ abbreviated: ["1er trim.", "2ème trim.", "3ème trim.", "4ème trim."],
139
+ wide: ["1er trimestre", "2ème trimestre", "3ème trimestre", "4ème trimestre"]
140
+ }, Gt = {
141
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
142
+ abbreviated: [
143
+ "janv.",
144
+ "févr.",
145
+ "mars",
146
+ "avr.",
147
+ "mai",
148
+ "juin",
149
+ "juil.",
150
+ "août",
151
+ "sept.",
152
+ "oct.",
153
+ "nov.",
154
+ "déc."
155
+ ],
156
+ wide: [
157
+ "janvier",
158
+ "février",
159
+ "mars",
160
+ "avril",
161
+ "mai",
162
+ "juin",
163
+ "juillet",
164
+ "août",
165
+ "septembre",
166
+ "octobre",
167
+ "novembre",
168
+ "décembre"
169
+ ]
170
+ }, Zt = {
171
+ narrow: ["D", "L", "M", "M", "J", "V", "S"],
172
+ short: ["di", "lu", "ma", "me", "je", "ve", "sa"],
173
+ abbreviated: ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."],
174
+ wide: [
175
+ "dimanche",
176
+ "lundi",
177
+ "mardi",
178
+ "mercredi",
179
+ "jeudi",
180
+ "vendredi",
181
+ "samedi"
182
+ ]
183
+ }, Qt = {
184
+ narrow: {
185
+ am: "AM",
186
+ pm: "PM",
187
+ midnight: "minuit",
188
+ noon: "midi",
189
+ morning: "mat.",
190
+ afternoon: "ap.m.",
191
+ evening: "soir",
192
+ night: "mat."
193
+ },
194
+ abbreviated: {
195
+ am: "AM",
196
+ pm: "PM",
197
+ midnight: "minuit",
198
+ noon: "midi",
199
+ morning: "matin",
200
+ afternoon: "après-midi",
201
+ evening: "soir",
202
+ night: "matin"
203
+ },
204
+ wide: {
205
+ am: "AM",
206
+ pm: "PM",
207
+ midnight: "minuit",
208
+ noon: "midi",
209
+ morning: "du matin",
210
+ afternoon: "de l’après-midi",
211
+ evening: "du soir",
212
+ night: "du matin"
213
+ }
214
+ }, en = (e, t) => {
215
+ const n = Number(e), r = t == null ? void 0 : t.unit;
216
+ if (n === 0) return "0";
217
+ const o = ["year", "week", "hour", "minute", "second"];
218
+ let a;
219
+ return n === 1 ? a = r && o.includes(r) ? "ère" : "er" : a = "ème", n + a;
220
+ }, tn = ["MMM", "MMMM"], nn = {
221
+ preprocessor: (e, t) => e.getDate() === 1 || !t.some(
222
+ (r) => r.isToken && tn.includes(r.value)
223
+ ) ? t : t.map(
224
+ (r) => r.isToken && r.value === "do" ? { isToken: !0, value: "d" } : r
225
+ ),
226
+ ordinalNumber: en,
227
+ era: I({
228
+ values: Yt,
229
+ defaultWidth: "wide"
230
+ }),
231
+ quarter: I({
232
+ values: qt,
233
+ defaultWidth: "wide",
234
+ argumentCallback: (e) => e - 1
235
+ }),
236
+ month: I({
237
+ values: Gt,
238
+ defaultWidth: "wide"
239
+ }),
240
+ day: I({
241
+ values: Zt,
242
+ defaultWidth: "wide"
243
+ }),
244
+ dayPeriod: I({
245
+ values: Qt,
246
+ defaultWidth: "wide"
247
+ })
248
+ }, rn = /^(\d+)(ième|ère|ème|er|e)?/i, on = /\d+/i, an = {
249
+ narrow: /^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,
250
+ abbreviated: /^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,
251
+ wide: /^(avant Jésus-Christ|après Jésus-Christ)/i
252
+ }, sn = {
253
+ any: [/^av/i, /^ap/i]
254
+ }, cn = {
255
+ narrow: /^T?[1234]/i,
256
+ abbreviated: /^[1234](er|ème|e)? trim\.?/i,
257
+ wide: /^[1234](er|ème|e)? trimestre/i
258
+ }, dn = {
259
+ any: [/1/i, /2/i, /3/i, /4/i]
260
+ }, un = {
261
+ narrow: /^[jfmasond]/i,
262
+ abbreviated: /^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,
263
+ wide: /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i
264
+ }, ln = {
265
+ narrow: [
266
+ /^j/i,
267
+ /^f/i,
268
+ /^m/i,
269
+ /^a/i,
270
+ /^m/i,
271
+ /^j/i,
272
+ /^j/i,
273
+ /^a/i,
274
+ /^s/i,
275
+ /^o/i,
276
+ /^n/i,
277
+ /^d/i
278
+ ],
279
+ any: [
280
+ /^ja/i,
281
+ /^f/i,
282
+ /^mar/i,
283
+ /^av/i,
284
+ /^ma/i,
285
+ /^juin/i,
286
+ /^juil/i,
287
+ /^ao/i,
288
+ /^s/i,
289
+ /^o/i,
290
+ /^n/i,
291
+ /^d/i
292
+ ]
293
+ }, fn = {
294
+ narrow: /^[lmjvsd]/i,
295
+ short: /^(di|lu|ma|me|je|ve|sa)/i,
296
+ abbreviated: /^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,
297
+ wide: /^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i
298
+ }, mn = {
299
+ narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
300
+ any: [/^di/i, /^lu/i, /^ma/i, /^me/i, /^je/i, /^ve/i, /^sa/i]
301
+ }, pn = {
302
+ narrow: /^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,
303
+ any: /^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i
304
+ }, hn = {
305
+ any: {
306
+ am: /^a/i,
307
+ pm: /^p/i,
308
+ midnight: /^min/i,
309
+ noon: /^mid/i,
310
+ morning: /mat/i,
311
+ afternoon: /ap/i,
312
+ evening: /soir/i,
313
+ night: /nuit/i
314
+ }
315
+ }, vn = {
316
+ ordinalNumber: vt({
317
+ matchPattern: rn,
318
+ parsePattern: on,
319
+ valueCallback: (e) => parseInt(e)
320
+ }),
321
+ era: W({
322
+ matchPatterns: an,
323
+ defaultMatchWidth: "wide",
324
+ parsePatterns: sn,
325
+ defaultParseWidth: "any"
326
+ }),
327
+ quarter: W({
328
+ matchPatterns: cn,
329
+ defaultMatchWidth: "wide",
330
+ parsePatterns: dn,
331
+ defaultParseWidth: "any",
332
+ valueCallback: (e) => e + 1
333
+ }),
334
+ month: W({
335
+ matchPatterns: un,
336
+ defaultMatchWidth: "wide",
337
+ parsePatterns: ln,
338
+ defaultParseWidth: "any"
339
+ }),
340
+ day: W({
341
+ matchPatterns: fn,
342
+ defaultMatchWidth: "wide",
343
+ parsePatterns: mn,
344
+ defaultParseWidth: "any"
345
+ }),
346
+ dayPeriod: W({
347
+ matchPatterns: pn,
348
+ defaultMatchWidth: "any",
349
+ parsePatterns: hn,
350
+ defaultParseWidth: "any"
351
+ })
352
+ }, Q = {
353
+ code: "fr",
354
+ formatDistance: $t,
355
+ formatLong: Xt,
356
+ formatRelative: Vt,
357
+ localize: nn,
358
+ match: vn,
359
+ options: {
360
+ weekStartsOn: 1,
361
+ firstWeekContainsDate: 4
362
+ }
363
+ }, vr = ({
364
+ searchQuery: e,
365
+ search: t,
366
+ placeholder: n = "Rechercher...",
367
+ onSearch: r,
368
+ onSubmit: o,
369
+ onClear: a,
370
+ className: c
371
+ }) => {
372
+ const s = e || t || "", l = () => {
373
+ r(""), a && a();
374
+ };
375
+ return /* @__PURE__ */ D("div", { className: Y("relative h-fit w-full md:w-64", c), children: [
376
+ /* @__PURE__ */ u(Ut, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4" }),
377
+ /* @__PURE__ */ u(
378
+ gt,
379
+ {
380
+ placeholder: n,
381
+ value: s,
382
+ onChange: (d) => r(d.target.value),
383
+ className: "pl-8",
384
+ onKeyDown: (d) => {
385
+ d.key === "Enter" && o && (d.preventDefault(), o());
386
+ }
387
+ }
388
+ ),
389
+ s && /* @__PURE__ */ u("button", { onClick: l, className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700", type: "button", children: /* @__PURE__ */ u(Ce, { className: "size-4" }) })
390
+ ] });
391
+ };
392
+ var gn = [
393
+ "a",
394
+ "button",
395
+ "div",
396
+ "form",
397
+ "h2",
398
+ "h3",
399
+ "img",
400
+ "input",
401
+ "label",
402
+ "li",
403
+ "nav",
404
+ "ol",
405
+ "p",
406
+ "select",
407
+ "span",
408
+ "svg",
409
+ "ul"
410
+ ], A = gn.reduce((e, t) => {
411
+ const n = Ne(`Primitive.${t}`), r = i.forwardRef((o, a) => {
412
+ const { asChild: c, ...s } = o, l = c ? n : t;
413
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ u(l, { ...s, ref: a });
414
+ });
415
+ return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
416
+ }, {});
417
+ function Pn(e, t) {
418
+ e && Lt.flushSync(() => e.dispatchEvent(t));
419
+ }
420
+ var yn = "DismissableLayer", ne = "dismissableLayer.update", bn = "dismissableLayer.pointerDownOutside", wn = "dismissableLayer.focusOutside", ge, Me = i.createContext({
421
+ layers: /* @__PURE__ */ new Set(),
422
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
423
+ branches: /* @__PURE__ */ new Set()
424
+ }), xe = i.forwardRef(
425
+ (e, t) => {
426
+ const {
427
+ disableOutsidePointerEvents: n = !1,
428
+ onEscapeKeyDown: r,
429
+ onPointerDownOutside: o,
430
+ onFocusOutside: a,
431
+ onInteractOutside: c,
432
+ onDismiss: s,
433
+ ...l
434
+ } = e, d = i.useContext(Me), [m, v] = i.useState(null), h = (m == null ? void 0 : m.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, f] = i.useState({}), w = x(t, (P) => v(P)), p = Array.from(d.layers), [b] = [...d.layersWithOutsidePointerEventsDisabled].slice(-1), g = p.indexOf(b), E = m ? p.indexOf(m) : -1, C = d.layersWithOutsidePointerEventsDisabled.size > 0, y = E >= g, T = Nn((P) => {
435
+ const S = P.target, z = [...d.branches].some((L) => L.contains(S));
436
+ !y || z || (o == null || o(P), c == null || c(P), P.defaultPrevented || s == null || s());
437
+ }, h), N = An((P) => {
438
+ const S = P.target;
439
+ [...d.branches].some((L) => L.contains(S)) || (a == null || a(P), c == null || c(P), P.defaultPrevented || s == null || s());
440
+ }, h);
441
+ return yt((P) => {
442
+ E === d.layers.size - 1 && (r == null || r(P), !P.defaultPrevented && s && (P.preventDefault(), s()));
443
+ }, h), i.useEffect(() => {
444
+ if (m)
445
+ return n && (d.layersWithOutsidePointerEventsDisabled.size === 0 && (ge = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), d.layersWithOutsidePointerEventsDisabled.add(m)), d.layers.add(m), Pe(), () => {
446
+ n && d.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = ge);
447
+ };
448
+ }, [m, h, n, d]), i.useEffect(() => () => {
449
+ m && (d.layers.delete(m), d.layersWithOutsidePointerEventsDisabled.delete(m), Pe());
450
+ }, [m, d]), i.useEffect(() => {
451
+ const P = () => f({});
452
+ return document.addEventListener(ne, P), () => document.removeEventListener(ne, P);
453
+ }, []), /* @__PURE__ */ u(
454
+ A.div,
455
+ {
456
+ ...l,
457
+ ref: w,
458
+ style: {
459
+ pointerEvents: C ? y ? "auto" : "none" : void 0,
460
+ ...e.style
461
+ },
462
+ onFocusCapture: M(e.onFocusCapture, N.onFocusCapture),
463
+ onBlurCapture: M(e.onBlurCapture, N.onBlurCapture),
464
+ onPointerDownCapture: M(
465
+ e.onPointerDownCapture,
466
+ T.onPointerDownCapture
467
+ )
468
+ }
469
+ );
470
+ }
471
+ );
472
+ xe.displayName = yn;
473
+ var En = "DismissableLayerBranch", Cn = i.forwardRef((e, t) => {
474
+ const n = i.useContext(Me), r = i.useRef(null), o = x(t, r);
475
+ return i.useEffect(() => {
476
+ const a = r.current;
477
+ if (a)
478
+ return n.branches.add(a), () => {
479
+ n.branches.delete(a);
480
+ };
481
+ }, [n.branches]), /* @__PURE__ */ u(A.div, { ...e, ref: o });
482
+ });
483
+ Cn.displayName = En;
484
+ function Nn(e, t = globalThis == null ? void 0 : globalThis.document) {
485
+ const n = U(e), r = i.useRef(!1), o = i.useRef(() => {
486
+ });
487
+ return i.useEffect(() => {
488
+ const a = (s) => {
489
+ if (s.target && !r.current) {
490
+ let l = function() {
491
+ Re(
492
+ bn,
493
+ n,
494
+ d,
495
+ { discrete: !0 }
496
+ );
497
+ };
498
+ const d = { originalEvent: s };
499
+ s.pointerType === "touch" ? (t.removeEventListener("click", o.current), o.current = l, t.addEventListener("click", o.current, { once: !0 })) : l();
500
+ } else
501
+ t.removeEventListener("click", o.current);
502
+ r.current = !1;
503
+ }, c = window.setTimeout(() => {
504
+ t.addEventListener("pointerdown", a);
505
+ }, 0);
506
+ return () => {
507
+ window.clearTimeout(c), t.removeEventListener("pointerdown", a), t.removeEventListener("click", o.current);
508
+ };
509
+ }, [t, n]), {
510
+ // ensures we check React component tree (not just DOM tree)
511
+ onPointerDownCapture: () => r.current = !0
512
+ };
513
+ }
514
+ function An(e, t = globalThis == null ? void 0 : globalThis.document) {
515
+ const n = U(e), r = i.useRef(!1);
516
+ return i.useEffect(() => {
517
+ const o = (a) => {
518
+ a.target && !r.current && Re(wn, n, { originalEvent: a }, {
519
+ discrete: !1
520
+ });
521
+ };
522
+ return t.addEventListener("focusin", o), () => t.removeEventListener("focusin", o);
523
+ }, [t, n]), {
524
+ onFocusCapture: () => r.current = !0,
525
+ onBlurCapture: () => r.current = !1
526
+ };
527
+ }
528
+ function Pe() {
529
+ const e = new CustomEvent(ne);
530
+ document.dispatchEvent(e);
531
+ }
532
+ function Re(e, t, n, { discrete: r }) {
533
+ const o = n.originalEvent.target, a = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
534
+ t && o.addEventListener(e, t, { once: !0 }), r ? Pn(o, a) : o.dispatchEvent(a);
535
+ }
536
+ var ee = "focusScope.autoFocusOnMount", te = "focusScope.autoFocusOnUnmount", ye = { bubbles: !1, cancelable: !0 }, On = "FocusScope", Se = i.forwardRef((e, t) => {
537
+ const {
538
+ loop: n = !1,
539
+ trapped: r = !1,
540
+ onMountAutoFocus: o,
541
+ onUnmountAutoFocus: a,
542
+ ...c
543
+ } = e, [s, l] = i.useState(null), d = U(o), m = U(a), v = i.useRef(null), h = x(t, (p) => l(p)), f = i.useRef({
544
+ paused: !1,
545
+ pause() {
546
+ this.paused = !0;
547
+ },
548
+ resume() {
549
+ this.paused = !1;
550
+ }
551
+ }).current;
552
+ i.useEffect(() => {
553
+ if (r) {
554
+ let p = function(C) {
555
+ if (f.paused || !s) return;
556
+ const y = C.target;
557
+ s.contains(y) ? v.current = y : O(v.current, { select: !0 });
558
+ }, b = function(C) {
559
+ if (f.paused || !s) return;
560
+ const y = C.relatedTarget;
561
+ y !== null && (s.contains(y) || O(v.current, { select: !0 }));
562
+ }, g = function(C) {
563
+ if (document.activeElement === document.body)
564
+ for (const T of C)
565
+ T.removedNodes.length > 0 && O(s);
566
+ };
567
+ document.addEventListener("focusin", p), document.addEventListener("focusout", b);
568
+ const E = new MutationObserver(g);
569
+ return s && E.observe(s, { childList: !0, subtree: !0 }), () => {
570
+ document.removeEventListener("focusin", p), document.removeEventListener("focusout", b), E.disconnect();
571
+ };
572
+ }
573
+ }, [r, s, f.paused]), i.useEffect(() => {
574
+ if (s) {
575
+ we.add(f);
576
+ const p = document.activeElement;
577
+ if (!s.contains(p)) {
578
+ const g = new CustomEvent(ee, ye);
579
+ s.addEventListener(ee, d), s.dispatchEvent(g), g.defaultPrevented || (Mn(_n(Te(s)), { select: !0 }), document.activeElement === p && O(s));
580
+ }
581
+ return () => {
582
+ s.removeEventListener(ee, d), setTimeout(() => {
583
+ const g = new CustomEvent(te, ye);
584
+ s.addEventListener(te, m), s.dispatchEvent(g), g.defaultPrevented || O(p ?? document.body, { select: !0 }), s.removeEventListener(te, m), we.remove(f);
585
+ }, 0);
586
+ };
587
+ }
588
+ }, [s, d, m, f]);
589
+ const w = i.useCallback(
590
+ (p) => {
591
+ if (!n && !r || f.paused) return;
592
+ const b = p.key === "Tab" && !p.altKey && !p.ctrlKey && !p.metaKey, g = document.activeElement;
593
+ if (b && g) {
594
+ const E = p.currentTarget, [C, y] = xn(E);
595
+ C && y ? !p.shiftKey && g === y ? (p.preventDefault(), n && O(C, { select: !0 })) : p.shiftKey && g === C && (p.preventDefault(), n && O(y, { select: !0 })) : g === E && p.preventDefault();
596
+ }
597
+ },
598
+ [n, r, f.paused]
599
+ );
600
+ return /* @__PURE__ */ u(A.div, { tabIndex: -1, ...c, ref: h, onKeyDown: w });
601
+ });
602
+ Se.displayName = On;
603
+ function Mn(e, { select: t = !1 } = {}) {
604
+ const n = document.activeElement;
605
+ for (const r of e)
606
+ if (O(r, { select: t }), document.activeElement !== n) return;
607
+ }
608
+ function xn(e) {
609
+ const t = Te(e), n = be(t, e), r = be(t.reverse(), e);
610
+ return [n, r];
611
+ }
612
+ function Te(e) {
613
+ const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
614
+ acceptNode: (r) => {
615
+ const o = r.tagName === "INPUT" && r.type === "hidden";
616
+ return r.disabled || r.hidden || o ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
617
+ }
618
+ });
619
+ for (; n.nextNode(); ) t.push(n.currentNode);
620
+ return t;
621
+ }
622
+ function be(e, t) {
623
+ for (const n of e)
624
+ if (!Rn(n, { upTo: t })) return n;
625
+ }
626
+ function Rn(e, { upTo: t }) {
627
+ if (getComputedStyle(e).visibility === "hidden") return !0;
628
+ for (; e; ) {
629
+ if (t !== void 0 && e === t) return !1;
630
+ if (getComputedStyle(e).display === "none") return !0;
631
+ e = e.parentElement;
632
+ }
633
+ return !1;
634
+ }
635
+ function Sn(e) {
636
+ return e instanceof HTMLInputElement && "select" in e;
637
+ }
638
+ function O(e, { select: t = !1 } = {}) {
639
+ if (e && e.focus) {
640
+ const n = document.activeElement;
641
+ e.focus({ preventScroll: !0 }), e !== n && Sn(e) && t && e.select();
642
+ }
643
+ }
644
+ var we = Tn();
645
+ function Tn() {
646
+ let e = [];
647
+ return {
648
+ add(t) {
649
+ const n = e[0];
650
+ t !== n && (n == null || n.pause()), e = Ee(e, t), e.unshift(t);
651
+ },
652
+ remove(t) {
653
+ var n;
654
+ e = Ee(e, t), (n = e[0]) == null || n.resume();
655
+ }
656
+ };
657
+ }
658
+ function Ee(e, t) {
659
+ const n = [...e], r = n.indexOf(t);
660
+ return r !== -1 && n.splice(r, 1), n;
661
+ }
662
+ function _n(e) {
663
+ return e.filter((t) => t.tagName !== "A");
664
+ }
665
+ var Dn = "Arrow", _e = i.forwardRef((e, t) => {
666
+ const { children: n, width: r = 10, height: o = 5, ...a } = e;
667
+ return /* @__PURE__ */ u(
668
+ A.svg,
669
+ {
670
+ ...a,
671
+ ref: t,
672
+ width: r,
673
+ height: o,
674
+ viewBox: "0 0 30 10",
675
+ preserveAspectRatio: "none",
676
+ children: e.asChild ? n : /* @__PURE__ */ u("polygon", { points: "0,0 30,0 15,10" })
677
+ }
678
+ );
679
+ });
680
+ _e.displayName = Dn;
681
+ var Fn = _e, re = "Popper", [De, Fe] = Ae(re), [Ln, Le] = De(re), ke = (e) => {
682
+ const { __scopePopper: t, children: n } = e, [r, o] = i.useState(null);
683
+ return /* @__PURE__ */ u(Ln, { scope: t, anchor: r, onAnchorChange: o, children: n });
684
+ };
685
+ ke.displayName = re;
686
+ var Ie = "PopperAnchor", We = i.forwardRef(
687
+ (e, t) => {
688
+ const { __scopePopper: n, virtualRef: r, ...o } = e, a = Le(Ie, n), c = i.useRef(null), s = x(t, c), l = i.useRef(null);
689
+ return i.useEffect(() => {
690
+ const d = l.current;
691
+ l.current = (r == null ? void 0 : r.current) || c.current, d !== l.current && a.onAnchorChange(l.current);
692
+ }), r ? null : /* @__PURE__ */ u(A.div, { ...o, ref: s });
693
+ }
694
+ );
695
+ We.displayName = Ie;
696
+ var oe = "PopperContent", [kn, In] = De(oe), je = i.forwardRef(
697
+ (e, t) => {
698
+ var ue, le, fe, me, pe, he;
699
+ const {
700
+ __scopePopper: n,
701
+ side: r = "bottom",
702
+ sideOffset: o = 0,
703
+ align: a = "center",
704
+ alignOffset: c = 0,
705
+ arrowPadding: s = 0,
706
+ avoidCollisions: l = !0,
707
+ collisionBoundary: d = [],
708
+ collisionPadding: m = 0,
709
+ sticky: v = "partial",
710
+ hideWhenDetached: h = !1,
711
+ updatePositionStrategy: f = "optimized",
712
+ onPlaced: w,
713
+ ...p
714
+ } = e, b = Le(oe, n), [g, E] = i.useState(null), C = x(t, (k) => E(k)), [y, T] = i.useState(null), N = bt(y), P = (N == null ? void 0 : N.width) ?? 0, S = (N == null ? void 0 : N.height) ?? 0, z = r + (a !== "center" ? "-" + a : ""), L = typeof m == "number" ? m : { top: 0, right: 0, bottom: 0, left: 0, ...m }, ie = Array.isArray(d) ? d : [d], rt = ie.length > 0, J = {
715
+ padding: L,
716
+ boundary: ie.filter(jn),
717
+ // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
718
+ altBoundary: rt
719
+ }, { refs: ot, floatingStyles: ce, placement: at, isPositioned: B, middlewareData: _ } = wt({
720
+ // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
721
+ strategy: "fixed",
722
+ placement: z,
723
+ whileElementsMounted: (...k) => Rt(...k, {
724
+ animationFrame: f === "always"
725
+ }),
726
+ elements: {
727
+ reference: b.anchor
728
+ },
729
+ middleware: [
730
+ Et({ mainAxis: o + S, alignmentAxis: c }),
731
+ l && Ct({
732
+ mainAxis: !0,
733
+ crossAxis: !1,
734
+ limiter: v === "partial" ? Nt() : void 0,
735
+ ...J
736
+ }),
737
+ l && At({ ...J }),
738
+ Ot({
739
+ ...J,
740
+ apply: ({ elements: k, rects: ve, availableWidth: ft, availableHeight: mt }) => {
741
+ const { width: pt, height: ht } = ve.reference, K = k.floating.style;
742
+ K.setProperty("--radix-popper-available-width", `${ft}px`), K.setProperty("--radix-popper-available-height", `${mt}px`), K.setProperty("--radix-popper-anchor-width", `${pt}px`), K.setProperty("--radix-popper-anchor-height", `${ht}px`);
743
+ }
744
+ }),
745
+ y && Mt({ element: y, padding: s }),
746
+ Un({ arrowWidth: P, arrowHeight: S }),
747
+ h && xt({ strategy: "referenceHidden", ...J })
748
+ ]
749
+ }), [de, st] = $e(at), X = U(w);
750
+ H(() => {
751
+ B && (X == null || X());
752
+ }, [B, X]);
753
+ const it = (ue = _.arrow) == null ? void 0 : ue.x, ct = (le = _.arrow) == null ? void 0 : le.y, dt = ((fe = _.arrow) == null ? void 0 : fe.centerOffset) !== 0, [ut, lt] = i.useState();
754
+ return H(() => {
755
+ g && lt(window.getComputedStyle(g).zIndex);
756
+ }, [g]), /* @__PURE__ */ u(
757
+ "div",
758
+ {
759
+ ref: ot.setFloating,
760
+ "data-radix-popper-content-wrapper": "",
761
+ style: {
762
+ ...ce,
763
+ transform: B ? ce.transform : "translate(0, -200%)",
764
+ // keep off the page when measuring
765
+ minWidth: "max-content",
766
+ zIndex: ut,
767
+ "--radix-popper-transform-origin": [
768
+ (me = _.transformOrigin) == null ? void 0 : me.x,
769
+ (pe = _.transformOrigin) == null ? void 0 : pe.y
770
+ ].join(" "),
771
+ // hide the content if using the hide middleware and should be hidden
772
+ // set visibility to hidden and disable pointer events so the UI behaves
773
+ // as if the PopperContent isn't there at all
774
+ ...((he = _.hide) == null ? void 0 : he.referenceHidden) && {
775
+ visibility: "hidden",
776
+ pointerEvents: "none"
777
+ }
778
+ },
779
+ dir: e.dir,
780
+ children: /* @__PURE__ */ u(
781
+ kn,
782
+ {
783
+ scope: n,
784
+ placedSide: de,
785
+ onArrowChange: T,
786
+ arrowX: it,
787
+ arrowY: ct,
788
+ shouldHideArrow: dt,
789
+ children: /* @__PURE__ */ u(
790
+ A.div,
791
+ {
792
+ "data-side": de,
793
+ "data-align": st,
794
+ ...p,
795
+ ref: C,
796
+ style: {
797
+ ...p.style,
798
+ // if the PopperContent hasn't been placed yet (not all measurements done)
799
+ // we prevent animations so that users's animation don't kick in too early referring wrong sides
800
+ animation: B ? void 0 : "none"
801
+ }
802
+ }
803
+ )
804
+ }
805
+ )
806
+ }
807
+ );
808
+ }
809
+ );
810
+ je.displayName = oe;
811
+ var Ue = "PopperArrow", Wn = {
812
+ top: "bottom",
813
+ right: "left",
814
+ bottom: "top",
815
+ left: "right"
816
+ }, He = i.forwardRef(function(t, n) {
817
+ const { __scopePopper: r, ...o } = t, a = In(Ue, r), c = Wn[a.placedSide];
818
+ return (
819
+ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
820
+ // doesn't report size as we'd expect on SVG elements.
821
+ // it reports their bounding box which is effectively the largest path inside the SVG.
822
+ /* @__PURE__ */ u(
823
+ "span",
824
+ {
825
+ ref: a.onArrowChange,
826
+ style: {
827
+ position: "absolute",
828
+ left: a.arrowX,
829
+ top: a.arrowY,
830
+ [c]: 0,
831
+ transformOrigin: {
832
+ top: "",
833
+ right: "0 0",
834
+ bottom: "center 0",
835
+ left: "100% 0"
836
+ }[a.placedSide],
837
+ transform: {
838
+ top: "translateY(100%)",
839
+ right: "translateY(50%) rotate(90deg) translateX(-50%)",
840
+ bottom: "rotate(180deg)",
841
+ left: "translateY(50%) rotate(-90deg) translateX(50%)"
842
+ }[a.placedSide],
843
+ visibility: a.shouldHideArrow ? "hidden" : void 0
844
+ },
845
+ children: /* @__PURE__ */ u(
846
+ Fn,
847
+ {
848
+ ...o,
849
+ ref: n,
850
+ style: {
851
+ ...o.style,
852
+ // ensures the element can be measured correctly (mostly for if SVG)
853
+ display: "block"
854
+ }
855
+ }
856
+ )
857
+ }
858
+ )
859
+ );
860
+ });
861
+ He.displayName = Ue;
862
+ function jn(e) {
863
+ return e !== null;
864
+ }
865
+ var Un = (e) => ({
866
+ name: "transformOrigin",
867
+ options: e,
868
+ fn(t) {
869
+ var b, g, E;
870
+ const { placement: n, rects: r, middlewareData: o } = t, c = ((b = o.arrow) == null ? void 0 : b.centerOffset) !== 0, s = c ? 0 : e.arrowWidth, l = c ? 0 : e.arrowHeight, [d, m] = $e(n), v = { start: "0%", center: "50%", end: "100%" }[m], h = (((g = o.arrow) == null ? void 0 : g.x) ?? 0) + s / 2, f = (((E = o.arrow) == null ? void 0 : E.y) ?? 0) + l / 2;
871
+ let w = "", p = "";
872
+ return d === "bottom" ? (w = c ? v : `${h}px`, p = `${-l}px`) : d === "top" ? (w = c ? v : `${h}px`, p = `${r.floating.height + l}px`) : d === "right" ? (w = `${-l}px`, p = c ? v : `${f}px`) : d === "left" && (w = `${r.floating.width + l}px`, p = c ? v : `${f}px`), { data: { x: w, y: p } };
873
+ }
874
+ });
875
+ function $e(e) {
876
+ const [t, n = "center"] = e.split("-");
877
+ return [t, n];
878
+ }
879
+ var Hn = ke, ze = We, $n = je, zn = He, Jn = "Portal", Je = i.forwardRef((e, t) => {
880
+ var s;
881
+ const { container: n, ...r } = e, [o, a] = i.useState(!1);
882
+ H(() => a(!0), []);
883
+ const c = n || o && ((s = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : s.body);
884
+ return c ? kt.createPortal(/* @__PURE__ */ u(A.div, { ...r, ref: t }), c) : null;
885
+ });
886
+ Je.displayName = Jn;
887
+ function Bn(e, t) {
888
+ return i.useReducer((n, r) => t[n][r] ?? n, e);
889
+ }
890
+ var ae = (e) => {
891
+ const { present: t, children: n } = e, r = Xn(t), o = typeof n == "function" ? n({ present: r.isPresent }) : i.Children.only(n), a = x(r.ref, Kn(o));
892
+ return typeof n == "function" || r.isPresent ? i.cloneElement(o, { ref: a }) : null;
893
+ };
894
+ ae.displayName = "Presence";
895
+ function Xn(e) {
896
+ const [t, n] = i.useState(), r = i.useRef(null), o = i.useRef(e), a = i.useRef("none"), c = e ? "mounted" : "unmounted", [s, l] = Bn(c, {
897
+ mounted: {
898
+ UNMOUNT: "unmounted",
899
+ ANIMATION_OUT: "unmountSuspended"
900
+ },
901
+ unmountSuspended: {
902
+ MOUNT: "mounted",
903
+ ANIMATION_END: "unmounted"
904
+ },
905
+ unmounted: {
906
+ MOUNT: "mounted"
907
+ }
908
+ });
909
+ return i.useEffect(() => {
910
+ const d = V(r.current);
911
+ a.current = s === "mounted" ? d : "none";
912
+ }, [s]), H(() => {
913
+ const d = r.current, m = o.current;
914
+ if (m !== e) {
915
+ const h = a.current, f = V(d);
916
+ e ? l("MOUNT") : f === "none" || (d == null ? void 0 : d.display) === "none" ? l("UNMOUNT") : l(m && h !== f ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
917
+ }
918
+ }, [e, l]), H(() => {
919
+ if (t) {
920
+ let d;
921
+ const m = t.ownerDocument.defaultView ?? window, v = (f) => {
922
+ const p = V(r.current).includes(CSS.escape(f.animationName));
923
+ if (f.target === t && p && (l("ANIMATION_END"), !o.current)) {
924
+ const b = t.style.animationFillMode;
925
+ t.style.animationFillMode = "forwards", d = m.setTimeout(() => {
926
+ t.style.animationFillMode === "forwards" && (t.style.animationFillMode = b);
927
+ });
928
+ }
929
+ }, h = (f) => {
930
+ f.target === t && (a.current = V(r.current));
931
+ };
932
+ return t.addEventListener("animationstart", h), t.addEventListener("animationcancel", v), t.addEventListener("animationend", v), () => {
933
+ m.clearTimeout(d), t.removeEventListener("animationstart", h), t.removeEventListener("animationcancel", v), t.removeEventListener("animationend", v);
934
+ };
935
+ } else
936
+ l("ANIMATION_END");
937
+ }, [t, l]), {
938
+ isPresent: ["mounted", "unmountSuspended"].includes(s),
939
+ ref: i.useCallback((d) => {
940
+ r.current = d ? getComputedStyle(d) : null, n(d);
941
+ }, [])
942
+ };
943
+ }
944
+ function V(e) {
945
+ return (e == null ? void 0 : e.animationName) || "none";
946
+ }
947
+ function Kn(e) {
948
+ var r, o;
949
+ let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
950
+ return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
951
+ }
952
+ var q = "Popover", [Be] = Ae(q, [
953
+ Fe
954
+ ]), $ = Fe(), [Vn, R] = Be(q), Xe = (e) => {
955
+ const {
956
+ __scopePopover: t,
957
+ children: n,
958
+ open: r,
959
+ defaultOpen: o,
960
+ onOpenChange: a,
961
+ modal: c = !1
962
+ } = e, s = $(t), l = i.useRef(null), [d, m] = i.useState(!1), [v, h] = St({
963
+ prop: r,
964
+ defaultProp: o ?? !1,
965
+ onChange: a,
966
+ caller: q
967
+ });
968
+ return /* @__PURE__ */ u(Hn, { ...s, children: /* @__PURE__ */ u(
969
+ Vn,
970
+ {
971
+ scope: t,
972
+ contentId: Tt(),
973
+ triggerRef: l,
974
+ open: v,
975
+ onOpenChange: h,
976
+ onOpenToggle: i.useCallback(() => h((f) => !f), [h]),
977
+ hasCustomAnchor: d,
978
+ onCustomAnchorAdd: i.useCallback(() => m(!0), []),
979
+ onCustomAnchorRemove: i.useCallback(() => m(!1), []),
980
+ modal: c,
981
+ children: n
982
+ }
983
+ ) });
984
+ };
985
+ Xe.displayName = q;
986
+ var Ke = "PopoverAnchor", Yn = i.forwardRef(
987
+ (e, t) => {
988
+ const { __scopePopover: n, ...r } = e, o = R(Ke, n), a = $(n), { onCustomAnchorAdd: c, onCustomAnchorRemove: s } = o;
989
+ return i.useEffect(() => (c(), () => s()), [c, s]), /* @__PURE__ */ u(ze, { ...a, ...r, ref: t });
990
+ }
991
+ );
992
+ Yn.displayName = Ke;
993
+ var Ve = "PopoverTrigger", Ye = i.forwardRef(
994
+ (e, t) => {
995
+ const { __scopePopover: n, ...r } = e, o = R(Ve, n), a = $(n), c = x(t, o.triggerRef), s = /* @__PURE__ */ u(
996
+ A.button,
997
+ {
998
+ type: "button",
999
+ "aria-haspopup": "dialog",
1000
+ "aria-expanded": o.open,
1001
+ "aria-controls": o.contentId,
1002
+ "data-state": et(o.open),
1003
+ ...r,
1004
+ ref: c,
1005
+ onClick: M(e.onClick, o.onOpenToggle)
1006
+ }
1007
+ );
1008
+ return o.hasCustomAnchor ? s : /* @__PURE__ */ u(ze, { asChild: !0, ...a, children: s });
1009
+ }
1010
+ );
1011
+ Ye.displayName = Ve;
1012
+ var se = "PopoverPortal", [qn, Gn] = Be(se, {
1013
+ forceMount: void 0
1014
+ }), qe = (e) => {
1015
+ const { __scopePopover: t, forceMount: n, children: r, container: o } = e, a = R(se, t);
1016
+ return /* @__PURE__ */ u(qn, { scope: t, forceMount: n, children: /* @__PURE__ */ u(ae, { present: n || a.open, children: /* @__PURE__ */ u(Je, { asChild: !0, container: o, children: r }) }) });
1017
+ };
1018
+ qe.displayName = se;
1019
+ var F = "PopoverContent", Ge = i.forwardRef(
1020
+ (e, t) => {
1021
+ const n = Gn(F, e.__scopePopover), { forceMount: r = n.forceMount, ...o } = e, a = R(F, e.__scopePopover);
1022
+ return /* @__PURE__ */ u(ae, { present: r || a.open, children: a.modal ? /* @__PURE__ */ u(Qn, { ...o, ref: t }) : /* @__PURE__ */ u(er, { ...o, ref: t }) });
1023
+ }
1024
+ );
1025
+ Ge.displayName = F;
1026
+ var Zn = Ne("PopoverContent.RemoveScroll"), Qn = i.forwardRef(
1027
+ (e, t) => {
1028
+ const n = R(F, e.__scopePopover), r = i.useRef(null), o = x(t, r), a = i.useRef(!1);
1029
+ return i.useEffect(() => {
1030
+ const c = r.current;
1031
+ if (c) return _t(c);
1032
+ }, []), /* @__PURE__ */ u(Dt, { as: Zn, allowPinchZoom: !0, children: /* @__PURE__ */ u(
1033
+ Ze,
1034
+ {
1035
+ ...e,
1036
+ ref: o,
1037
+ trapFocus: n.open,
1038
+ disableOutsidePointerEvents: !0,
1039
+ onCloseAutoFocus: M(e.onCloseAutoFocus, (c) => {
1040
+ var s;
1041
+ c.preventDefault(), a.current || (s = n.triggerRef.current) == null || s.focus();
1042
+ }),
1043
+ onPointerDownOutside: M(
1044
+ e.onPointerDownOutside,
1045
+ (c) => {
1046
+ const s = c.detail.originalEvent, l = s.button === 0 && s.ctrlKey === !0, d = s.button === 2 || l;
1047
+ a.current = d;
1048
+ },
1049
+ { checkForDefaultPrevented: !1 }
1050
+ ),
1051
+ onFocusOutside: M(
1052
+ e.onFocusOutside,
1053
+ (c) => c.preventDefault(),
1054
+ { checkForDefaultPrevented: !1 }
1055
+ )
1056
+ }
1057
+ ) });
1058
+ }
1059
+ ), er = i.forwardRef(
1060
+ (e, t) => {
1061
+ const n = R(F, e.__scopePopover), r = i.useRef(!1), o = i.useRef(!1);
1062
+ return /* @__PURE__ */ u(
1063
+ Ze,
1064
+ {
1065
+ ...e,
1066
+ ref: t,
1067
+ trapFocus: !1,
1068
+ disableOutsidePointerEvents: !1,
1069
+ onCloseAutoFocus: (a) => {
1070
+ var c, s;
1071
+ (c = e.onCloseAutoFocus) == null || c.call(e, a), a.defaultPrevented || (r.current || (s = n.triggerRef.current) == null || s.focus(), a.preventDefault()), r.current = !1, o.current = !1;
1072
+ },
1073
+ onInteractOutside: (a) => {
1074
+ var l, d;
1075
+ (l = e.onInteractOutside) == null || l.call(e, a), a.defaultPrevented || (r.current = !0, a.detail.originalEvent.type === "pointerdown" && (o.current = !0));
1076
+ const c = a.target;
1077
+ ((d = n.triggerRef.current) == null ? void 0 : d.contains(c)) && a.preventDefault(), a.detail.originalEvent.type === "focusin" && o.current && a.preventDefault();
1078
+ }
1079
+ }
1080
+ );
1081
+ }
1082
+ ), Ze = i.forwardRef(
1083
+ (e, t) => {
1084
+ const {
1085
+ __scopePopover: n,
1086
+ trapFocus: r,
1087
+ onOpenAutoFocus: o,
1088
+ onCloseAutoFocus: a,
1089
+ disableOutsidePointerEvents: c,
1090
+ onEscapeKeyDown: s,
1091
+ onPointerDownOutside: l,
1092
+ onFocusOutside: d,
1093
+ onInteractOutside: m,
1094
+ ...v
1095
+ } = e, h = R(F, n), f = $(n);
1096
+ return Ft(), /* @__PURE__ */ u(
1097
+ Se,
1098
+ {
1099
+ asChild: !0,
1100
+ loop: !0,
1101
+ trapped: r,
1102
+ onMountAutoFocus: o,
1103
+ onUnmountAutoFocus: a,
1104
+ children: /* @__PURE__ */ u(
1105
+ xe,
1106
+ {
1107
+ asChild: !0,
1108
+ disableOutsidePointerEvents: c,
1109
+ onInteractOutside: m,
1110
+ onEscapeKeyDown: s,
1111
+ onPointerDownOutside: l,
1112
+ onFocusOutside: d,
1113
+ onDismiss: () => h.onOpenChange(!1),
1114
+ children: /* @__PURE__ */ u(
1115
+ $n,
1116
+ {
1117
+ "data-state": et(h.open),
1118
+ role: "dialog",
1119
+ id: h.contentId,
1120
+ ...f,
1121
+ ...v,
1122
+ ref: t,
1123
+ style: {
1124
+ ...v.style,
1125
+ "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
1126
+ "--radix-popover-content-available-width": "var(--radix-popper-available-width)",
1127
+ "--radix-popover-content-available-height": "var(--radix-popper-available-height)",
1128
+ "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
1129
+ "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
1130
+ }
1131
+ }
1132
+ )
1133
+ }
1134
+ )
1135
+ }
1136
+ );
1137
+ }
1138
+ ), Qe = "PopoverClose", tr = i.forwardRef(
1139
+ (e, t) => {
1140
+ const { __scopePopover: n, ...r } = e, o = R(Qe, n);
1141
+ return /* @__PURE__ */ u(
1142
+ A.button,
1143
+ {
1144
+ type: "button",
1145
+ ...r,
1146
+ ref: t,
1147
+ onClick: M(e.onClick, () => o.onOpenChange(!1))
1148
+ }
1149
+ );
1150
+ }
1151
+ );
1152
+ tr.displayName = Qe;
1153
+ var nr = "PopoverArrow", rr = i.forwardRef(
1154
+ (e, t) => {
1155
+ const { __scopePopover: n, ...r } = e, o = $(n);
1156
+ return /* @__PURE__ */ u(zn, { ...o, ...r, ref: t });
1157
+ }
1158
+ );
1159
+ rr.displayName = nr;
1160
+ function et(e) {
1161
+ return e ? "open" : "closed";
1162
+ }
1163
+ var or = Xe, ar = Ye, sr = qe, tt = Ge;
1164
+ const ir = or, cr = ar, nt = i.forwardRef(
1165
+ ({ className: e, align: t = "center", sideOffset: n = 4, ...r }, o) => /* @__PURE__ */ u(sr, { children: /* @__PURE__ */ u(
1166
+ tt,
1167
+ {
1168
+ ref: o,
1169
+ align: t,
1170
+ sideOffset: n,
1171
+ className: Y(
1172
+ "z-[100] w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1173
+ e
1174
+ ),
1175
+ ...r
1176
+ }
1177
+ ) })
1178
+ );
1179
+ nt.displayName = tt.displayName;
1180
+ const gr = ({ value: e, onChange: t, placeholder: n = "Selectionner une periode", className: r }) => {
1181
+ const [o, a] = i.useState(!1), [c, s] = i.useState(e);
1182
+ i.useEffect(() => {
1183
+ o && s(e);
1184
+ }, [o, e]);
1185
+ const l = (f) => {
1186
+ f.stopPropagation(), t(void 0), a(!1);
1187
+ }, d = () => {
1188
+ t(c), a(!1);
1189
+ }, m = () => {
1190
+ s(e), a(!1);
1191
+ }, v = () => {
1192
+ s(void 0);
1193
+ }, h = (f) => f != null && f.from ? !f.to || f.from.getTime() === f.to.getTime() ? Z(f.from, "dd MMM yyyy", { locale: Q }) : `${Z(f.from, "dd MMM yyyy", { locale: Q })} - ${Z(f.to, "dd MMM yyyy", { locale: Q })}` : n;
1194
+ return /* @__PURE__ */ u("div", { className: Y("grid gap-2", r), children: /* @__PURE__ */ D(ir, { open: o, onOpenChange: a, children: [
1195
+ /* @__PURE__ */ u(cr, { asChild: !0, children: /* @__PURE__ */ D(j, { id: "date", variant: "outline", className: Y("w-[300px] justify-start text-left font-normal", !(e != null && e.from) && "text-muted-foreground"), children: [
1196
+ /* @__PURE__ */ u(Wt, { className: "mr-2 h-4 w-4" }),
1197
+ h(e),
1198
+ (e == null ? void 0 : e.from) && /* @__PURE__ */ u(
1199
+ j,
1200
+ {
1201
+ type: "button",
1202
+ variant: "ghost",
1203
+ size: "icon",
1204
+ "aria-label": "Effacer la periode selectionnee",
1205
+ className: "ml-auto h-5 w-5 opacity-50 hover:opacity-100",
1206
+ onClick: l,
1207
+ children: /* @__PURE__ */ u(Ce, { className: "h-4 w-4" })
1208
+ }
1209
+ )
1210
+ ] }) }),
1211
+ /* @__PURE__ */ D(nt, { className: "w-auto p-0", align: "start", side: "bottom", sideOffset: 4, children: [
1212
+ /* @__PURE__ */ u(
1213
+ Pt,
1214
+ {
1215
+ mode: "range",
1216
+ defaultMonth: c == null ? void 0 : c.from,
1217
+ selected: c,
1218
+ onSelect: s,
1219
+ numberOfMonths: 2,
1220
+ weekStartsOn: 1,
1221
+ className: "pointer-events-auto p-3"
1222
+ }
1223
+ ),
1224
+ /* @__PURE__ */ D("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
1225
+ /* @__PURE__ */ u(j, { variant: "ghost", size: "sm", onClick: v, children: "Effacer" }),
1226
+ /* @__PURE__ */ D("div", { className: "flex gap-2", children: [
1227
+ /* @__PURE__ */ u(j, { variant: "ghost", size: "sm", onClick: m, children: "Annuler" }),
1228
+ /* @__PURE__ */ u(j, { size: "sm", onClick: d, children: "Appliquer" })
1229
+ ] })
1230
+ ] })
1231
+ ] })
1232
+ ] }) });
1233
+ };
1234
+ export {
1235
+ gr as D,
1236
+ vr as S
1237
+ };