@innosolutions/inno-calendar 1.0.60 → 1.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENT.md +31 -4
- package/dist/{agenda-widget-COpTIR70.js → agenda-widget-Couk7jMB.js} +1314 -1296
- package/dist/agenda-widget-Couk7jMB.js.map +1 -0
- package/dist/agenda-widget-DZkEXTh-.cjs +2 -0
- package/dist/agenda-widget-DZkEXTh-.cjs.map +1 -0
- package/dist/components/event/event-card.d.ts.map +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/components/primitives/scroll-navigator.d.ts +3 -1
- package/dist/components/primitives/scroll-navigator.d.ts.map +1 -1
- package/dist/components/views/timeline-view.d.ts +1 -1
- package/dist/components/views/timeline-view.d.ts.map +1 -1
- package/dist/core/context/slot-selection-context.d.ts +2 -0
- package/dist/core/context/slot-selection-context.d.ts.map +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +4 -4
- package/dist/presets/index.cjs +1 -1
- package/dist/presets/index.mjs +1 -1
- package/dist/slot-selection-context-CRstOosL.js +604 -0
- package/dist/{slot-selection-context-CKGT_45R.js.map → slot-selection-context-CRstOosL.js.map} +1 -1
- package/dist/slot-selection-context-DBCZI2Dn.cjs +2 -0
- package/dist/{slot-selection-context-CS1te8uo.cjs.map → slot-selection-context-DBCZI2Dn.cjs.map} +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/{tailwind-calendar-C3DidCJ5.js → tailwind-calendar-CNhXkxzW.js} +2 -2
- package/dist/{tailwind-calendar-C3DidCJ5.js.map → tailwind-calendar-CNhXkxzW.js.map} +1 -1
- package/dist/{tailwind-calendar-iFeIx0Ci.cjs → tailwind-calendar-VRvPJQwa.cjs} +2 -2
- package/dist/{tailwind-calendar-iFeIx0Ci.cjs.map → tailwind-calendar-VRvPJQwa.cjs.map} +1 -1
- package/dist/week-view-C1Vu2ErD.cjs +11 -0
- package/dist/week-view-C1Vu2ErD.cjs.map +1 -0
- package/dist/{week-view-CNbtlkE_.js → week-view-DY167Wok.js} +700 -670
- package/dist/week-view-DY167Wok.js.map +1 -0
- package/package.json +1 -1
- package/dist/agenda-widget-BtjS59HE.cjs +0 -2
- package/dist/agenda-widget-BtjS59HE.cjs.map +0 -1
- package/dist/agenda-widget-COpTIR70.js.map +0 -1
- package/dist/slot-selection-context-CKGT_45R.js +0 -598
- package/dist/slot-selection-context-CS1te8uo.cjs +0 -2
- package/dist/week-view-B9_48WmF.cjs +0 -11
- package/dist/week-view-B9_48WmF.cjs.map +0 -1
- package/dist/week-view-CNbtlkE_.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as e, jsxs as r, Fragment as
|
|
1
|
+
import { jsx as e, jsxs as r, Fragment as be } from "react/jsx-runtime";
|
|
2
2
|
import { g as it, u as pt, C as xt } from "./use-calendar-D8XaVe44.js";
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { c as
|
|
5
|
-
import { P as lt, p as ct, o as dt, z as
|
|
6
|
-
import { j as Lt, D as Tt, I as Ht, e as zt, S as It } from "./slot-selection-context-
|
|
3
|
+
import { useCallback as O, useState as ie, useEffect as de, forwardRef as Ae, useRef as ae, useMemo as te, useLayoutEffect as vt, useImperativeHandle as wt } from "react";
|
|
4
|
+
import { c as p } from "./index-DtaLkIY8.js";
|
|
5
|
+
import { P as lt, p as ct, o as dt, z as fe, I as bt, J as yt, B as Ce, K as kt, L as Ue, x as ge, F as pe, y as xe, k as Nt, C as Ct, M as Ve, A as Dt, W as Mt, c as St, N as Et } from "./week-view-DY167Wok.js";
|
|
6
|
+
import { j as Lt, D as Tt, I as Ht, e as zt, S as It } from "./slot-selection-context-CRstOosL.js";
|
|
7
7
|
import { az as ce, aQ as Pe, I as ut, an as jt, Z as At, a8 as Pt, n as ht, T as Wt } from "./position-utils-DMVQFywD.js";
|
|
8
8
|
function Ft({ view: t, className: n = "" }) {
|
|
9
9
|
return /* @__PURE__ */ e(
|
|
@@ -35,41 +35,41 @@ function Ye({ view: t, className: n }) {
|
|
|
35
35
|
function kr(t) {
|
|
36
36
|
const {
|
|
37
37
|
events: n,
|
|
38
|
-
resources:
|
|
39
|
-
scheduleTypes:
|
|
38
|
+
resources: s,
|
|
39
|
+
scheduleTypes: o,
|
|
40
40
|
initialView: i = "week",
|
|
41
|
-
initialDate:
|
|
42
|
-
initialFilters:
|
|
43
|
-
preferences:
|
|
44
|
-
locale:
|
|
41
|
+
initialDate: a,
|
|
42
|
+
initialFilters: f,
|
|
43
|
+
preferences: m,
|
|
44
|
+
locale: c,
|
|
45
45
|
slots: v,
|
|
46
|
-
renderEvent:
|
|
47
|
-
onViewChange:
|
|
46
|
+
renderEvent: y,
|
|
47
|
+
onViewChange: b,
|
|
48
48
|
onDateChange: A,
|
|
49
49
|
onEventClick: $,
|
|
50
50
|
onSlotSelect: P,
|
|
51
|
-
onFiltersChange:
|
|
51
|
+
onFiltersChange: F,
|
|
52
52
|
className: T,
|
|
53
|
-
children:
|
|
54
|
-
} = t,
|
|
55
|
-
if (
|
|
56
|
-
return /* @__PURE__ */ e("div", { className: T, style: { position: "relative" }, children:
|
|
57
|
-
const
|
|
53
|
+
children: C
|
|
54
|
+
} = t, j = it();
|
|
55
|
+
if (j)
|
|
56
|
+
return /* @__PURE__ */ e("div", { className: T, style: { position: "relative" }, children: C ?? /* @__PURE__ */ e(Ye, { view: j.view, className: T }) });
|
|
57
|
+
const W = pt({
|
|
58
58
|
events: n,
|
|
59
|
-
resources:
|
|
60
|
-
scheduleTypes:
|
|
59
|
+
resources: s,
|
|
60
|
+
scheduleTypes: o,
|
|
61
61
|
initialView: i,
|
|
62
|
-
initialDate:
|
|
63
|
-
initialFilters:
|
|
64
|
-
preferences:
|
|
65
|
-
locale:
|
|
66
|
-
onViewChange:
|
|
62
|
+
initialDate: a,
|
|
63
|
+
initialFilters: f,
|
|
64
|
+
preferences: m,
|
|
65
|
+
locale: c,
|
|
66
|
+
onViewChange: b,
|
|
67
67
|
onDateChange: A,
|
|
68
68
|
onEventClick: $,
|
|
69
69
|
onSlotSelect: P,
|
|
70
|
-
onFiltersChange:
|
|
70
|
+
onFiltersChange: F
|
|
71
71
|
});
|
|
72
|
-
return /* @__PURE__ */ e(xt, { value:
|
|
72
|
+
return /* @__PURE__ */ e(xt, { value: W, children: /* @__PURE__ */ e("div", { className: T, style: { position: "relative" }, children: C ?? /* @__PURE__ */ e(Ye, { view: W.view, className: T }) }) });
|
|
73
73
|
}
|
|
74
74
|
function $t({ className: t }) {
|
|
75
75
|
return /* @__PURE__ */ r(
|
|
@@ -295,7 +295,7 @@ function Me({ className: t }) {
|
|
|
295
295
|
strokeWidth: "2",
|
|
296
296
|
strokeLinecap: "round",
|
|
297
297
|
strokeLinejoin: "round",
|
|
298
|
-
className:
|
|
298
|
+
className: p("animate-spin", t),
|
|
299
299
|
children: /* @__PURE__ */ e("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
300
300
|
}
|
|
301
301
|
);
|
|
@@ -326,53 +326,53 @@ const Kt = {
|
|
|
326
326
|
deleteConfirmTitle: "Delete Event",
|
|
327
327
|
deleteConfirmDescription: "Are you sure you want to delete this event? This action cannot be undone."
|
|
328
328
|
}, He = Ae(
|
|
329
|
-
({ onClick: t, label: n, children:
|
|
330
|
-
/* @__PURE__ */ e(
|
|
329
|
+
({ onClick: t, label: n, children: s, className: o, variant: i = "ghost", ...a }, f) => /* @__PURE__ */ r(ge, { children: [
|
|
330
|
+
/* @__PURE__ */ e(pe, { asChild: !0, children: /* @__PURE__ */ e(
|
|
331
331
|
"button",
|
|
332
332
|
{
|
|
333
333
|
type: "button",
|
|
334
|
-
ref:
|
|
334
|
+
ref: f,
|
|
335
335
|
onClick: t,
|
|
336
|
-
className:
|
|
336
|
+
className: p(
|
|
337
337
|
"h-8 w-8 rounded-full flex items-center justify-center transition-colors",
|
|
338
338
|
i === "ghost" && "hover:bg-zinc-100 dark:hover:bg-zinc-800 text-zinc-600 dark:text-zinc-400",
|
|
339
339
|
i === "destructive" && "hover:bg-red-50 dark:hover:bg-red-950/30 text-zinc-600 dark:text-zinc-400 hover:text-red-600",
|
|
340
|
-
|
|
340
|
+
o
|
|
341
341
|
),
|
|
342
342
|
"aria-label": n,
|
|
343
|
-
...
|
|
344
|
-
children:
|
|
343
|
+
...a,
|
|
344
|
+
children: s
|
|
345
345
|
}
|
|
346
346
|
) }),
|
|
347
|
-
/* @__PURE__ */ e(
|
|
347
|
+
/* @__PURE__ */ e(xe, { side: "bottom", className: "text-xs", children: n })
|
|
348
348
|
] })
|
|
349
349
|
);
|
|
350
350
|
He.displayName = "IconButton";
|
|
351
|
-
function Gt({ src: t, alt: n, initials:
|
|
352
|
-
const [
|
|
351
|
+
function Gt({ src: t, alt: n, initials: s, className: o, isClient: i }) {
|
|
352
|
+
const [a, f] = ie(!1);
|
|
353
353
|
return /* @__PURE__ */ e(
|
|
354
354
|
"div",
|
|
355
355
|
{
|
|
356
|
-
className:
|
|
356
|
+
className: p(
|
|
357
357
|
"relative h-7 w-7 rounded-full overflow-hidden shrink-0",
|
|
358
|
-
|
|
358
|
+
o
|
|
359
359
|
),
|
|
360
|
-
children: t && !
|
|
360
|
+
children: t && !a ? /* @__PURE__ */ e(
|
|
361
361
|
"img",
|
|
362
362
|
{
|
|
363
363
|
src: t,
|
|
364
364
|
alt: n,
|
|
365
365
|
className: "h-full w-full object-cover",
|
|
366
|
-
onError: () =>
|
|
366
|
+
onError: () => f(!0)
|
|
367
367
|
}
|
|
368
368
|
) : /* @__PURE__ */ e(
|
|
369
369
|
"div",
|
|
370
370
|
{
|
|
371
|
-
className:
|
|
371
|
+
className: p(
|
|
372
372
|
"h-full w-full flex items-center justify-center text-[10px] font-medium",
|
|
373
373
|
i ? "bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300" : "bg-zinc-200 dark:bg-zinc-700 text-zinc-700 dark:text-zinc-300"
|
|
374
374
|
),
|
|
375
|
-
children:
|
|
375
|
+
children: s
|
|
376
376
|
}
|
|
377
377
|
)
|
|
378
378
|
}
|
|
@@ -381,43 +381,43 @@ function Gt({ src: t, alt: n, initials: o, className: a, isClient: i }) {
|
|
|
381
381
|
function Ke({
|
|
382
382
|
participant: t,
|
|
383
383
|
isEventCanceled: n = !1,
|
|
384
|
-
labels:
|
|
384
|
+
labels: s
|
|
385
385
|
}) {
|
|
386
|
-
const
|
|
386
|
+
const o = t.name || "Unknown", i = o.split(" ").map((A) => A[0]).join("").toUpperCase().slice(0, 2), a = t.isOrganizer ?? !1, f = t.isConfirmed, m = f === !0, c = f === !1, v = t.isClient ?? !1, y = t.profilePicture || t.avatar, b = n;
|
|
387
387
|
return /* @__PURE__ */ r(
|
|
388
388
|
"div",
|
|
389
389
|
{
|
|
390
|
-
className:
|
|
390
|
+
className: p(
|
|
391
391
|
"flex items-center gap-3 py-0",
|
|
392
|
-
|
|
392
|
+
b && "opacity-60"
|
|
393
393
|
),
|
|
394
394
|
children: [
|
|
395
395
|
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
396
396
|
/* @__PURE__ */ e(
|
|
397
397
|
Gt,
|
|
398
398
|
{
|
|
399
|
-
src:
|
|
400
|
-
alt:
|
|
399
|
+
src: y,
|
|
400
|
+
alt: o,
|
|
401
401
|
initials: i,
|
|
402
402
|
isClient: v,
|
|
403
|
-
className:
|
|
403
|
+
className: p(b && "grayscale")
|
|
404
404
|
}
|
|
405
405
|
),
|
|
406
|
-
|
|
406
|
+
b || c ? /* @__PURE__ */ e("div", { className: "absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "h-3 w-3 rounded-full bg-red-100 dark:bg-red-900/50 flex items-center justify-center", children: /* @__PURE__ */ e(je, { className: "h-2 w-2 text-red-600 dark:text-red-400 stroke-[3]" }) }) }) : m ? /* @__PURE__ */ e("div", { className: "absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "h-3 w-3 rounded-full bg-green-100 dark:bg-green-900/50 flex items-center justify-center", children: /* @__PURE__ */ e(Te, { className: "h-2 w-2 text-green-600 dark:text-green-400 stroke-[3]" }) }) }) : null
|
|
407
407
|
] }),
|
|
408
408
|
/* @__PURE__ */ r("div", { className: "!h-fit min-w-0 gap-0", children: [
|
|
409
409
|
/* @__PURE__ */ e("div", { className: "gap-0", children: /* @__PURE__ */ e(
|
|
410
410
|
"span",
|
|
411
411
|
{
|
|
412
|
-
className:
|
|
412
|
+
className: p(
|
|
413
413
|
"text-sm text-zinc-900 dark:text-zinc-100 truncate",
|
|
414
|
-
|
|
414
|
+
b && "line-through text-zinc-500 dark:text-zinc-500"
|
|
415
415
|
),
|
|
416
|
-
children:
|
|
416
|
+
children: o
|
|
417
417
|
}
|
|
418
418
|
) }),
|
|
419
|
-
v && /* @__PURE__ */ e("div", { className: "text-[10px] px-1.5 w-fit py-0.5 rounded bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300 font-medium", children:
|
|
420
|
-
|
|
419
|
+
v && /* @__PURE__ */ e("div", { className: "text-[10px] px-1.5 w-fit py-0.5 rounded bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300 font-medium", children: s.client }),
|
|
420
|
+
a && !b && /* @__PURE__ */ e("div", { className: "text-xs text-zinc-500", children: s.organizer })
|
|
421
421
|
] })
|
|
422
422
|
]
|
|
423
423
|
}
|
|
@@ -426,13 +426,13 @@ function Ke({
|
|
|
426
426
|
function Jt({
|
|
427
427
|
open: t,
|
|
428
428
|
onOpenChange: n,
|
|
429
|
-
title:
|
|
430
|
-
children:
|
|
429
|
+
title: s,
|
|
430
|
+
children: o
|
|
431
431
|
}) {
|
|
432
432
|
return de(() => {
|
|
433
433
|
if (!t) return;
|
|
434
|
-
const i = (
|
|
435
|
-
|
|
434
|
+
const i = (a) => {
|
|
435
|
+
a.key === "Escape" && n(!1);
|
|
436
436
|
};
|
|
437
437
|
return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
|
|
438
438
|
}, [t, n]), de(() => (t ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
@@ -449,20 +449,20 @@ function Jt({
|
|
|
449
449
|
}
|
|
450
450
|
),
|
|
451
451
|
/* @__PURE__ */ e("div", { className: "fixed inset-x-4 top-[50%] translate-y-[-50%] max-w-md mx-auto", children: /* @__PURE__ */ r("div", { className: "bg-white dark:bg-zinc-900 rounded-2xl shadow-xl overflow-hidden", children: [
|
|
452
|
-
|
|
453
|
-
|
|
452
|
+
s && /* @__PURE__ */ e("div", { className: "sr-only", children: s }),
|
|
453
|
+
o
|
|
454
454
|
] }) })
|
|
455
455
|
] }) : null;
|
|
456
456
|
}
|
|
457
457
|
function qt({
|
|
458
458
|
open: t,
|
|
459
459
|
onOpenChange: n,
|
|
460
|
-
title:
|
|
461
|
-
description:
|
|
460
|
+
title: s,
|
|
461
|
+
description: o,
|
|
462
462
|
cancelLabel: i,
|
|
463
|
-
confirmLabel:
|
|
464
|
-
onConfirm:
|
|
465
|
-
isLoading:
|
|
463
|
+
confirmLabel: a,
|
|
464
|
+
onConfirm: f,
|
|
465
|
+
isLoading: m
|
|
466
466
|
}) {
|
|
467
467
|
return t ? /* @__PURE__ */ r("div", { className: "fixed inset-0 z-[60]", children: [
|
|
468
468
|
/* @__PURE__ */ e(
|
|
@@ -470,14 +470,14 @@ function qt({
|
|
|
470
470
|
{
|
|
471
471
|
className: "fixed inset-0 bg-black/50 backdrop-blur-sm",
|
|
472
472
|
onClick: () => n(!1),
|
|
473
|
-
onKeyDown: (
|
|
474
|
-
(
|
|
473
|
+
onKeyDown: (c) => {
|
|
474
|
+
(c.key === "Enter" || c.key === " ") && n(!1);
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
477
|
),
|
|
478
478
|
/* @__PURE__ */ e("div", { className: "fixed inset-x-4 top-[50%] translate-y-[-50%] max-w-md mx-auto", children: /* @__PURE__ */ r("div", { className: "bg-white dark:bg-zinc-900 rounded-lg shadow-xl p-6", children: [
|
|
479
|
-
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-zinc-900 dark:text-zinc-100", children:
|
|
480
|
-
/* @__PURE__ */ e("p", { className: "mt-2 text-sm text-zinc-600 dark:text-zinc-400", children:
|
|
479
|
+
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-zinc-900 dark:text-zinc-100", children: s }),
|
|
480
|
+
/* @__PURE__ */ e("p", { className: "mt-2 text-sm text-zinc-600 dark:text-zinc-400", children: o }),
|
|
481
481
|
/* @__PURE__ */ r("div", { className: "mt-4 flex justify-end gap-3", children: [
|
|
482
482
|
/* @__PURE__ */ e(
|
|
483
483
|
Ce,
|
|
@@ -493,12 +493,12 @@ function qt({
|
|
|
493
493
|
{
|
|
494
494
|
variant: "destructive",
|
|
495
495
|
size: "sm",
|
|
496
|
-
onClick:
|
|
497
|
-
disabled:
|
|
496
|
+
onClick: f,
|
|
497
|
+
disabled: m,
|
|
498
498
|
children: [
|
|
499
|
-
|
|
499
|
+
m && /* @__PURE__ */ e(Me, { className: "h-4 w-4 mr-2" }),
|
|
500
500
|
/* @__PURE__ */ e(mt, { className: "h-4 w-4 mr-2" }),
|
|
501
|
-
|
|
501
|
+
a
|
|
502
502
|
]
|
|
503
503
|
}
|
|
504
504
|
)
|
|
@@ -514,12 +514,12 @@ function Xt(t, n) {
|
|
|
514
514
|
});
|
|
515
515
|
}
|
|
516
516
|
function Qt(t, n) {
|
|
517
|
-
const
|
|
517
|
+
const s = {
|
|
518
518
|
hour: "2-digit",
|
|
519
519
|
minute: "2-digit",
|
|
520
520
|
hour12: !1
|
|
521
521
|
};
|
|
522
|
-
return `${t.toLocaleTimeString(void 0,
|
|
522
|
+
return `${t.toLocaleTimeString(void 0, s)} – ${n.toLocaleTimeString(void 0, s)}`;
|
|
523
523
|
}
|
|
524
524
|
function Zt(t) {
|
|
525
525
|
return t.toLocaleDateString(void 0, {
|
|
@@ -531,72 +531,72 @@ function Zt(t) {
|
|
|
531
531
|
});
|
|
532
532
|
}
|
|
533
533
|
function en(t) {
|
|
534
|
-
const [n,
|
|
534
|
+
const [n, s] = ie(() => typeof window < "u" ? window.matchMedia(t).matches : !1);
|
|
535
535
|
return de(() => {
|
|
536
536
|
if (typeof window > "u") return;
|
|
537
|
-
const
|
|
538
|
-
return
|
|
537
|
+
const o = window.matchMedia(t), i = (a) => s(a.matches);
|
|
538
|
+
return o.addEventListener("change", i), () => o.removeEventListener("change", i);
|
|
539
539
|
}, [t]), n;
|
|
540
540
|
}
|
|
541
541
|
function Ge({
|
|
542
542
|
event: t,
|
|
543
543
|
labels: n,
|
|
544
|
-
isLoading:
|
|
545
|
-
onClose:
|
|
544
|
+
isLoading: s,
|
|
545
|
+
onClose: o,
|
|
546
546
|
onEdit: i,
|
|
547
|
-
onDelete:
|
|
548
|
-
onCancel:
|
|
549
|
-
onAccept:
|
|
550
|
-
onDecline:
|
|
547
|
+
onDelete: a,
|
|
548
|
+
onCancel: f,
|
|
549
|
+
onAccept: m,
|
|
550
|
+
onDecline: c,
|
|
551
551
|
onConfirmMeeting: v,
|
|
552
|
-
canEdit:
|
|
553
|
-
canDelete:
|
|
552
|
+
canEdit: y = !0,
|
|
553
|
+
canDelete: b = !1,
|
|
554
554
|
canCancel: A = !0,
|
|
555
555
|
isCurrentUserParticipant: $ = !1,
|
|
556
556
|
isCurrentUserClient: P = !1,
|
|
557
|
-
currentUserAcceptStatus:
|
|
557
|
+
currentUserAcceptStatus: F,
|
|
558
558
|
isAcceptLoading: T = !1,
|
|
559
|
-
isDeclineLoading:
|
|
560
|
-
isConfirmLoading:
|
|
561
|
-
isDeleteLoading:
|
|
559
|
+
isDeclineLoading: C = !1,
|
|
560
|
+
isConfirmLoading: j = !1,
|
|
561
|
+
isDeleteLoading: W = !1,
|
|
562
562
|
renderParticipant: _,
|
|
563
|
-
renderHeaderActions:
|
|
564
|
-
renderCancelReason:
|
|
565
|
-
renderDeleteConfirmation:
|
|
566
|
-
formatDate:
|
|
563
|
+
renderHeaderActions: M,
|
|
564
|
+
renderCancelReason: G,
|
|
565
|
+
renderDeleteConfirmation: H,
|
|
566
|
+
formatDate: L = Xt,
|
|
567
567
|
formatTimeRange: V = Qt
|
|
568
568
|
}) {
|
|
569
|
-
const [
|
|
570
|
-
|
|
571
|
-
},
|
|
572
|
-
|
|
573
|
-
},
|
|
574
|
-
|
|
575
|
-
},
|
|
576
|
-
|
|
569
|
+
const [X, Q] = ie(!1), B = !(t.isCanceled || t.meetingTookPlace), d = t.isRecurring ?? !1, N = t.participantDetails, h = t.participantsNames || [], D = N && N.length > 0, w = F === !0, R = F === !1, K = $ && !P && B, Z = D ? N.filter((E) => E.isConfirmed).length : t.isAccepted ? h.length : 0, Y = D ? N.length : h.length, J = t.scheduleTypeColor || t.hexColor || "#039BE5", ue = O(() => t.startDate ? L(t.startDate) : n.noDateProvided, [t.startDate, L, n.noDateProvided]), se = O(() => t.startDate && t.endDate ? V(t.startDate, t.endDate) : null, [t.startDate, t.endDate, V]), le = () => {
|
|
570
|
+
o(), i?.(t);
|
|
571
|
+
}, we = () => {
|
|
572
|
+
o(), f?.(t);
|
|
573
|
+
}, he = () => {
|
|
574
|
+
Q(!0);
|
|
575
|
+
}, g = () => {
|
|
576
|
+
a?.(t), Q(!1);
|
|
577
577
|
};
|
|
578
|
-
return
|
|
578
|
+
return s ? /* @__PURE__ */ e("div", { className: "flex h-48 items-center justify-center", children: /* @__PURE__ */ e(Me, { className: "h-6 w-6 text-zinc-400" }) }) : /* @__PURE__ */ r(fe, { delayDuration: 300, children: [
|
|
579
579
|
/* @__PURE__ */ r("div", { className: "flex flex-col gap-0.5 p-3", children: [
|
|
580
|
-
/* @__PURE__ */ e("div", { className: "flex items-start justify-end gap-0.5", children:
|
|
581
|
-
B &&
|
|
582
|
-
B && A &&
|
|
583
|
-
|
|
580
|
+
/* @__PURE__ */ e("div", { className: "flex items-start justify-end gap-0.5", children: M ? M({ onClose: o }) : /* @__PURE__ */ r(be, { children: [
|
|
581
|
+
B && y && i && /* @__PURE__ */ e(He, { onClick: le, label: n.edit, children: /* @__PURE__ */ e($t, { className: "h-[18px] w-[18px]" }) }),
|
|
582
|
+
B && A && f && /* @__PURE__ */ e(He, { onClick: we, label: n.cancel, children: /* @__PURE__ */ e(Ot, { className: "h-[18px] w-[18px]" }) }),
|
|
583
|
+
b && a && /* @__PURE__ */ e(
|
|
584
584
|
He,
|
|
585
585
|
{
|
|
586
|
-
onClick:
|
|
586
|
+
onClick: he,
|
|
587
587
|
label: n.delete,
|
|
588
588
|
variant: "destructive",
|
|
589
589
|
children: /* @__PURE__ */ e(mt, { className: "h-[18px] w-[18px]" })
|
|
590
590
|
}
|
|
591
591
|
),
|
|
592
|
-
/* @__PURE__ */ e(He, { onClick:
|
|
592
|
+
/* @__PURE__ */ e(He, { onClick: o, label: n.close, children: /* @__PURE__ */ e(je, { className: "h-[18px] w-[18px]" }) })
|
|
593
593
|
] }) }),
|
|
594
594
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ r("div", { className: "flex items-start gap-2", children: [
|
|
595
595
|
/* @__PURE__ */ e(
|
|
596
596
|
"div",
|
|
597
597
|
{
|
|
598
598
|
className: "w-4 h-4 rounded mt-1 shrink-0",
|
|
599
|
-
style: { backgroundColor:
|
|
599
|
+
style: { backgroundColor: J }
|
|
600
600
|
}
|
|
601
601
|
),
|
|
602
602
|
/* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
|
|
@@ -604,7 +604,7 @@ function Ge({
|
|
|
604
604
|
/* @__PURE__ */ e(
|
|
605
605
|
"h2",
|
|
606
606
|
{
|
|
607
|
-
className:
|
|
607
|
+
className: p(
|
|
608
608
|
"text-[22px] font-normal text-zinc-900 dark:text-zinc-100 leading-tight",
|
|
609
609
|
t.isCanceled && "line-through opacity-60"
|
|
610
610
|
),
|
|
@@ -621,16 +621,16 @@ function Ge({
|
|
|
621
621
|
] })
|
|
622
622
|
] }),
|
|
623
623
|
/* @__PURE__ */ r("div", { className: "mt-1 text-sm text-zinc-600 dark:text-zinc-400", children: [
|
|
624
|
-
/* @__PURE__ */ e("span", { children:
|
|
625
|
-
|
|
624
|
+
/* @__PURE__ */ e("span", { children: ue() }),
|
|
625
|
+
se() && /* @__PURE__ */ r(be, { children: [
|
|
626
626
|
/* @__PURE__ */ e("span", { className: "mx-1.5", children: "·" }),
|
|
627
|
-
/* @__PURE__ */ e("span", { children:
|
|
627
|
+
/* @__PURE__ */ e("span", { children: se() })
|
|
628
628
|
] })
|
|
629
629
|
] }),
|
|
630
|
-
|
|
630
|
+
d && t.recurrenceSummary && /* @__PURE__ */ e("div", { className: "text-sm text-zinc-500 dark:text-zinc-500", children: t.recurrenceSummary })
|
|
631
631
|
] })
|
|
632
632
|
] }) }),
|
|
633
|
-
t.isCanceled && /* @__PURE__ */ e("div", { className: "mx-4 p-3 rounded-lg bg-red-50 dark:bg-red-950/30", children:
|
|
633
|
+
t.isCanceled && /* @__PURE__ */ e("div", { className: "mx-4 p-3 rounded-lg bg-red-50 dark:bg-red-950/30", children: G ? G(t) : /* @__PURE__ */ e("div", { className: "flex items-start gap-0", children: /* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
|
|
634
634
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-red-700 dark:text-red-400", children: n.cancellationNote }),
|
|
635
635
|
t.cancelReason && /* @__PURE__ */ r("div", { className: "mt-1 text-sm text-red-600/80 dark:text-red-400/80 italic", children: [
|
|
636
636
|
'"',
|
|
@@ -648,38 +648,38 @@ function Ge({
|
|
|
648
648
|
/* @__PURE__ */ e(Ut, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
|
|
649
649
|
/* @__PURE__ */ e("span", { className: "text-sm text-zinc-700 dark:text-zinc-300", children: t.address })
|
|
650
650
|
] }),
|
|
651
|
-
(
|
|
651
|
+
(D || h.length > 0) && /* @__PURE__ */ r("div", { className: "flex items-start gap-2 py-0", children: [
|
|
652
652
|
/* @__PURE__ */ e(Rt, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
|
|
653
653
|
/* @__PURE__ */ r("div", { className: "flex-1", children: [
|
|
654
654
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-0", children: [
|
|
655
655
|
/* @__PURE__ */ r("span", { className: "text-sm text-zinc-900 dark:text-zinc-100 font-medium", children: [
|
|
656
|
-
|
|
656
|
+
Y,
|
|
657
657
|
" ",
|
|
658
|
-
|
|
658
|
+
Y !== 1 ? n.guests : n.guest
|
|
659
659
|
] }),
|
|
660
|
-
|
|
660
|
+
Y > 0 && /* @__PURE__ */ r("span", { className: "text-xs text-zinc-500", children: [
|
|
661
661
|
"(",
|
|
662
|
-
|
|
662
|
+
Z,
|
|
663
663
|
" ",
|
|
664
664
|
n.confirmed,
|
|
665
665
|
")"
|
|
666
666
|
] })
|
|
667
667
|
] }),
|
|
668
668
|
/* @__PURE__ */ r("div", { className: "mt-2 space-y-2", children: [
|
|
669
|
-
|
|
670
|
-
(
|
|
669
|
+
D ? N.slice(0, 6).map(
|
|
670
|
+
(E, U) => _ ? _(E, U) : /* @__PURE__ */ e(
|
|
671
671
|
Ke,
|
|
672
672
|
{
|
|
673
|
-
participant:
|
|
673
|
+
participant: E,
|
|
674
674
|
isEventCanceled: t.isCanceled,
|
|
675
675
|
labels: n
|
|
676
676
|
},
|
|
677
|
-
|
|
677
|
+
E.id
|
|
678
678
|
)
|
|
679
|
-
) :
|
|
679
|
+
) : h.slice(0, 6).map((E, U) => {
|
|
680
680
|
const re = {
|
|
681
681
|
id: String(U),
|
|
682
|
-
name:
|
|
682
|
+
name: E,
|
|
683
683
|
email: "",
|
|
684
684
|
isConfirmed: t.isAccepted,
|
|
685
685
|
isOrganizer: U === 0,
|
|
@@ -692,12 +692,12 @@ function Ge({
|
|
|
692
692
|
isEventCanceled: t.isCanceled,
|
|
693
693
|
labels: n
|
|
694
694
|
},
|
|
695
|
-
|
|
695
|
+
E
|
|
696
696
|
);
|
|
697
697
|
}),
|
|
698
|
-
|
|
698
|
+
Y > 6 && /* @__PURE__ */ r("div", { className: "text-xs text-zinc-500 py-1.5 pl-10", children: [
|
|
699
699
|
"+",
|
|
700
|
-
|
|
700
|
+
Y - 6,
|
|
701
701
|
" ",
|
|
702
702
|
n.more
|
|
703
703
|
] })
|
|
@@ -710,27 +710,27 @@ function Ge({
|
|
|
710
710
|
] }),
|
|
711
711
|
/* @__PURE__ */ r("div", { className: "flex items-start gap-2", children: [
|
|
712
712
|
/* @__PURE__ */ e(Vt, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
|
|
713
|
-
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-700 dark:text-zinc-300", children:
|
|
713
|
+
/* @__PURE__ */ e("div", { className: "text-sm text-zinc-700 dark:text-zinc-300", children: D && N.find((E) => E.isOrganizer)?.name || h[0] || "Calendar" })
|
|
714
714
|
] })
|
|
715
715
|
] }),
|
|
716
|
-
|
|
717
|
-
|
|
716
|
+
K && m && c && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 mt-3 py-3", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
717
|
+
d ? /* @__PURE__ */ r(bt, { children: [
|
|
718
718
|
/* @__PURE__ */ e(yt, { asChild: !0, children: /* @__PURE__ */ r("div", { className: "flex", children: [
|
|
719
719
|
/* @__PURE__ */ e(
|
|
720
720
|
Ce,
|
|
721
721
|
{
|
|
722
722
|
size: "sm",
|
|
723
723
|
variant: "outline",
|
|
724
|
-
className:
|
|
724
|
+
className: p(
|
|
725
725
|
"rounded-r-none gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
|
|
726
|
-
|
|
726
|
+
w && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
727
727
|
),
|
|
728
|
-
onClick: (
|
|
729
|
-
|
|
728
|
+
onClick: (E) => {
|
|
729
|
+
E.stopPropagation(), w || m(t);
|
|
730
730
|
},
|
|
731
731
|
disabled: T,
|
|
732
|
-
children: T ? /* @__PURE__ */ e(Me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(
|
|
733
|
-
|
|
732
|
+
children: T ? /* @__PURE__ */ e(Me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(be, { children: [
|
|
733
|
+
w && /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5" }),
|
|
734
734
|
n.going
|
|
735
735
|
] })
|
|
736
736
|
}
|
|
@@ -740,9 +740,9 @@ function Ge({
|
|
|
740
740
|
{
|
|
741
741
|
size: "sm",
|
|
742
742
|
variant: "outline",
|
|
743
|
-
className:
|
|
743
|
+
className: p(
|
|
744
744
|
"rounded-l-none px-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
|
|
745
|
-
|
|
745
|
+
w && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
746
746
|
),
|
|
747
747
|
children: /* @__PURE__ */ e(Bt, { className: "h-3.5 w-3.5" })
|
|
748
748
|
}
|
|
@@ -752,18 +752,18 @@ function Ge({
|
|
|
752
752
|
/* @__PURE__ */ r(
|
|
753
753
|
Ue,
|
|
754
754
|
{
|
|
755
|
-
className:
|
|
755
|
+
className: p(
|
|
756
756
|
"gap-1.5 h-8 !border-none !bg-green-50 text-green-800 hover:!bg-green-100",
|
|
757
|
-
|
|
757
|
+
w && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
758
758
|
),
|
|
759
|
-
onClick: () =>
|
|
759
|
+
onClick: () => m(t),
|
|
760
760
|
children: [
|
|
761
761
|
/* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5 mr-2 text-green-600" }),
|
|
762
762
|
n.acceptThisEvent
|
|
763
763
|
]
|
|
764
764
|
}
|
|
765
765
|
),
|
|
766
|
-
/* @__PURE__ */ r(Ue, { onClick: () =>
|
|
766
|
+
/* @__PURE__ */ r(Ue, { onClick: () => m(t), children: [
|
|
767
767
|
/* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5 mr-2 text-green-600" }),
|
|
768
768
|
n.acceptAllEvents
|
|
769
769
|
] })
|
|
@@ -773,16 +773,16 @@ function Ge({
|
|
|
773
773
|
{
|
|
774
774
|
size: "sm",
|
|
775
775
|
variant: "outline",
|
|
776
|
-
className:
|
|
776
|
+
className: p(
|
|
777
777
|
"gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
|
|
778
|
-
|
|
778
|
+
w && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
779
779
|
),
|
|
780
780
|
onClick: () => {
|
|
781
|
-
|
|
781
|
+
w || m(t);
|
|
782
782
|
},
|
|
783
783
|
disabled: T,
|
|
784
|
-
children: T ? /* @__PURE__ */ e(Me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(
|
|
785
|
-
|
|
784
|
+
children: T ? /* @__PURE__ */ e(Me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(be, { children: [
|
|
785
|
+
w && /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5" }),
|
|
786
786
|
n.going
|
|
787
787
|
] })
|
|
788
788
|
}
|
|
@@ -792,51 +792,51 @@ function Ge({
|
|
|
792
792
|
{
|
|
793
793
|
size: "sm",
|
|
794
794
|
variant: "outline",
|
|
795
|
-
className:
|
|
795
|
+
className: p(
|
|
796
796
|
"gap-1.5 h-8 !border-none !bg-rose-100 text-rose-800 hover:!bg-rose-200",
|
|
797
|
-
|
|
797
|
+
R && "!bg-rose-700 !text-white hover:!bg-rose-700"
|
|
798
798
|
),
|
|
799
799
|
onClick: () => {
|
|
800
|
-
|
|
800
|
+
R || c(t);
|
|
801
801
|
},
|
|
802
|
-
disabled:
|
|
803
|
-
children:
|
|
804
|
-
|
|
802
|
+
disabled: C,
|
|
803
|
+
children: C ? /* @__PURE__ */ e(Me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(be, { children: [
|
|
804
|
+
R && /* @__PURE__ */ e(je, { className: "h-3.5 w-3.5" }),
|
|
805
805
|
n.notGoing
|
|
806
806
|
] })
|
|
807
807
|
}
|
|
808
808
|
)
|
|
809
809
|
] }) }),
|
|
810
|
-
$ &&
|
|
810
|
+
$ && w && !t.meetingTookPlace && !t.isCanceled && v && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 py-3", children: /* @__PURE__ */ r(
|
|
811
811
|
Ce,
|
|
812
812
|
{
|
|
813
813
|
size: "sm",
|
|
814
814
|
variant: "outline",
|
|
815
815
|
className: "w-full h-9 hover:!bg-green-100 hover:text-green-700 text-green-700 !bg-green-100 !border-none dark:text-green-400 dark:hover:bg-green-950/30",
|
|
816
816
|
onClick: () => v(t),
|
|
817
|
-
disabled:
|
|
817
|
+
disabled: j,
|
|
818
818
|
children: [
|
|
819
|
-
|
|
819
|
+
j && /* @__PURE__ */ e(Me, { className: "h-4 w-4 mr-2" }),
|
|
820
820
|
n.confirmMeeting
|
|
821
821
|
]
|
|
822
822
|
}
|
|
823
823
|
) })
|
|
824
824
|
] }),
|
|
825
|
-
|
|
826
|
-
onConfirm:
|
|
827
|
-
onCancel: () =>
|
|
828
|
-
isLoading:
|
|
825
|
+
H ? X && H({
|
|
826
|
+
onConfirm: g,
|
|
827
|
+
onCancel: () => Q(!1),
|
|
828
|
+
isLoading: W
|
|
829
829
|
}) : /* @__PURE__ */ e(
|
|
830
830
|
qt,
|
|
831
831
|
{
|
|
832
|
-
open:
|
|
833
|
-
onOpenChange:
|
|
832
|
+
open: X,
|
|
833
|
+
onOpenChange: Q,
|
|
834
834
|
title: n.deleteConfirmTitle,
|
|
835
835
|
description: n.deleteConfirmDescription,
|
|
836
836
|
cancelLabel: n.cancel,
|
|
837
837
|
confirmLabel: n.delete,
|
|
838
|
-
onConfirm:
|
|
839
|
-
isLoading:
|
|
838
|
+
onConfirm: g,
|
|
839
|
+
isLoading: W
|
|
840
840
|
}
|
|
841
841
|
)
|
|
842
842
|
] });
|
|
@@ -844,92 +844,92 @@ function Ge({
|
|
|
844
844
|
function Nr({
|
|
845
845
|
event: t,
|
|
846
846
|
children: n,
|
|
847
|
-
open:
|
|
848
|
-
onOpenChange:
|
|
847
|
+
open: s,
|
|
848
|
+
onOpenChange: o,
|
|
849
849
|
isLoading: i,
|
|
850
|
-
labels:
|
|
851
|
-
onEdit:
|
|
852
|
-
onDelete:
|
|
853
|
-
onCancel:
|
|
850
|
+
labels: a,
|
|
851
|
+
onEdit: f,
|
|
852
|
+
onDelete: m,
|
|
853
|
+
onCancel: c,
|
|
854
854
|
onAccept: v,
|
|
855
|
-
onDecline:
|
|
856
|
-
onConfirmMeeting:
|
|
855
|
+
onDecline: y,
|
|
856
|
+
onConfirmMeeting: b,
|
|
857
857
|
canEdit: A = !0,
|
|
858
858
|
canDelete: $ = !1,
|
|
859
859
|
canCancel: P = !0,
|
|
860
|
-
isCurrentUserParticipant:
|
|
860
|
+
isCurrentUserParticipant: F,
|
|
861
861
|
isCurrentUserClient: T,
|
|
862
|
-
currentUserAcceptStatus:
|
|
863
|
-
isAcceptLoading:
|
|
864
|
-
isDeclineLoading:
|
|
862
|
+
currentUserAcceptStatus: C,
|
|
863
|
+
isAcceptLoading: j,
|
|
864
|
+
isDeclineLoading: W,
|
|
865
865
|
isConfirmLoading: _,
|
|
866
|
-
isDeleteLoading:
|
|
867
|
-
renderParticipant:
|
|
868
|
-
renderHeaderActions:
|
|
869
|
-
renderCancelReason:
|
|
866
|
+
isDeleteLoading: M,
|
|
867
|
+
renderParticipant: G,
|
|
868
|
+
renderHeaderActions: H,
|
|
869
|
+
renderCancelReason: L,
|
|
870
870
|
renderDeleteConfirmation: V,
|
|
871
|
-
formatDate:
|
|
872
|
-
formatTimeRange:
|
|
871
|
+
formatDate: X,
|
|
872
|
+
formatTimeRange: Q,
|
|
873
873
|
className: B,
|
|
874
|
-
width:
|
|
874
|
+
width: d = 360
|
|
875
875
|
}) {
|
|
876
|
-
const
|
|
877
|
-
|
|
878
|
-
}, [
|
|
876
|
+
const N = en("(min-width: 768px)"), h = { ...Kt, ...a }, D = O(() => {
|
|
877
|
+
o?.(!1);
|
|
878
|
+
}, [o]), w = {
|
|
879
879
|
event: t,
|
|
880
|
-
labels:
|
|
880
|
+
labels: h,
|
|
881
881
|
isLoading: i,
|
|
882
|
-
onClose:
|
|
883
|
-
onEdit:
|
|
884
|
-
onDelete:
|
|
885
|
-
onCancel:
|
|
882
|
+
onClose: D,
|
|
883
|
+
onEdit: f,
|
|
884
|
+
onDelete: m,
|
|
885
|
+
onCancel: c,
|
|
886
886
|
onAccept: v,
|
|
887
|
-
onDecline:
|
|
888
|
-
onConfirmMeeting:
|
|
887
|
+
onDecline: y,
|
|
888
|
+
onConfirmMeeting: b,
|
|
889
889
|
canEdit: A,
|
|
890
890
|
canDelete: $,
|
|
891
891
|
canCancel: P,
|
|
892
|
-
isCurrentUserParticipant:
|
|
892
|
+
isCurrentUserParticipant: F,
|
|
893
893
|
isCurrentUserClient: T,
|
|
894
|
-
currentUserAcceptStatus:
|
|
895
|
-
isAcceptLoading:
|
|
896
|
-
isDeclineLoading:
|
|
894
|
+
currentUserAcceptStatus: C,
|
|
895
|
+
isAcceptLoading: j,
|
|
896
|
+
isDeclineLoading: W,
|
|
897
897
|
isConfirmLoading: _,
|
|
898
|
-
isDeleteLoading:
|
|
899
|
-
renderParticipant:
|
|
900
|
-
renderHeaderActions:
|
|
901
|
-
renderCancelReason:
|
|
898
|
+
isDeleteLoading: M,
|
|
899
|
+
renderParticipant: G,
|
|
900
|
+
renderHeaderActions: H,
|
|
901
|
+
renderCancelReason: L,
|
|
902
902
|
renderDeleteConfirmation: V,
|
|
903
|
-
formatDate:
|
|
904
|
-
formatTimeRange:
|
|
903
|
+
formatDate: X,
|
|
904
|
+
formatTimeRange: Q
|
|
905
905
|
};
|
|
906
|
-
return
|
|
906
|
+
return N ? /* @__PURE__ */ r(lt, { open: s ?? !1, onOpenChange: o ?? (() => {
|
|
907
907
|
}), children: [
|
|
908
908
|
/* @__PURE__ */ e(ct, { asChild: !0, children: n }),
|
|
909
909
|
/* @__PURE__ */ e(
|
|
910
910
|
dt,
|
|
911
911
|
{
|
|
912
|
-
className:
|
|
912
|
+
className: p(
|
|
913
913
|
"p-0 shadow-lg !rounded-2xl bg-white dark:bg-zinc-900 overflow-hidden border z-50",
|
|
914
914
|
B
|
|
915
915
|
),
|
|
916
|
-
style: { width:
|
|
916
|
+
style: { width: d },
|
|
917
917
|
align: "center",
|
|
918
918
|
side: "bottom",
|
|
919
919
|
sideOffset: 4,
|
|
920
|
-
children: /* @__PURE__ */ e(Ge, { ...
|
|
920
|
+
children: /* @__PURE__ */ e(Ge, { ...w })
|
|
921
921
|
}
|
|
922
922
|
)
|
|
923
|
-
] }) : /* @__PURE__ */ r(
|
|
923
|
+
] }) : /* @__PURE__ */ r(be, { children: [
|
|
924
924
|
n,
|
|
925
925
|
/* @__PURE__ */ e(
|
|
926
926
|
Jt,
|
|
927
927
|
{
|
|
928
|
-
open:
|
|
929
|
-
onOpenChange:
|
|
928
|
+
open: s ?? !1,
|
|
929
|
+
onOpenChange: o ?? (() => {
|
|
930
930
|
}),
|
|
931
931
|
title: t.title,
|
|
932
|
-
children: /* @__PURE__ */ e(Ge, { ...
|
|
932
|
+
children: /* @__PURE__ */ e(Ge, { ...w })
|
|
933
933
|
}
|
|
934
934
|
)
|
|
935
935
|
] });
|
|
@@ -939,19 +939,19 @@ function on(t) {
|
|
|
939
939
|
return t.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2);
|
|
940
940
|
}
|
|
941
941
|
function sn(t, n) {
|
|
942
|
-
const
|
|
943
|
-
for (let
|
|
942
|
+
const s = [];
|
|
943
|
+
for (let o = 0; o < n; o++) {
|
|
944
944
|
const i = new Date(t);
|
|
945
|
-
i.setDate(i.getDate() +
|
|
945
|
+
i.setDate(i.getDate() + o), s.push(i);
|
|
946
946
|
}
|
|
947
|
-
return
|
|
947
|
+
return s;
|
|
948
948
|
}
|
|
949
|
-
function an(t, n,
|
|
950
|
-
const
|
|
951
|
-
return t.forEach((i,
|
|
952
|
-
for (let
|
|
953
|
-
|
|
954
|
-
}),
|
|
949
|
+
function an(t, n, s) {
|
|
950
|
+
const o = [];
|
|
951
|
+
return t.forEach((i, a) => {
|
|
952
|
+
for (let f = n; f < s; f++)
|
|
953
|
+
o.push({ hour: f, dayIndex: a, date: i });
|
|
954
|
+
}), o;
|
|
955
955
|
}
|
|
956
956
|
function Fe(t) {
|
|
957
957
|
return `${t.toString().padStart(2, "0")}:00`;
|
|
@@ -964,25 +964,25 @@ function ln(t) {
|
|
|
964
964
|
});
|
|
965
965
|
}
|
|
966
966
|
function Ze(t) {
|
|
967
|
-
const n = [...t].sort((i,
|
|
967
|
+
const n = [...t].sort((i, a) => i.startCol !== a.startCol ? i.startCol - a.startCol : a.spanCols - i.spanCols), s = [], o = [];
|
|
968
968
|
for (const i of n) {
|
|
969
|
-
let
|
|
970
|
-
for (; a
|
|
971
|
-
|
|
972
|
-
a
|
|
969
|
+
let a = 0;
|
|
970
|
+
for (; o[a] !== void 0 && o[a] > i.startCol; )
|
|
971
|
+
a++;
|
|
972
|
+
o[a] = i.startCol + i.spanCols, s.push({
|
|
973
973
|
...i,
|
|
974
|
-
stackIndex:
|
|
974
|
+
stackIndex: a
|
|
975
975
|
});
|
|
976
976
|
}
|
|
977
|
-
return
|
|
977
|
+
return s;
|
|
978
978
|
}
|
|
979
|
-
function cn({ src: t, alt: n, fallback:
|
|
979
|
+
function cn({ src: t, alt: n, fallback: s, className: o }) {
|
|
980
980
|
return /* @__PURE__ */ e(
|
|
981
981
|
"div",
|
|
982
982
|
{
|
|
983
|
-
className:
|
|
983
|
+
className: p(
|
|
984
984
|
"relative flex shrink-0 overflow-hidden rounded-sm border bg-muted",
|
|
985
|
-
|
|
985
|
+
o
|
|
986
986
|
),
|
|
987
987
|
children: t ? /* @__PURE__ */ e(
|
|
988
988
|
"img",
|
|
@@ -991,7 +991,7 @@ function cn({ src: t, alt: n, fallback: o, className: a }) {
|
|
|
991
991
|
alt: n,
|
|
992
992
|
className: "aspect-square h-full w-full object-cover"
|
|
993
993
|
}
|
|
994
|
-
) : /* @__PURE__ */ e("div", { className: "flex h-full w-full items-center justify-center bg-muted text-muted-foreground", children:
|
|
994
|
+
) : /* @__PURE__ */ e("div", { className: "flex h-full w-full items-center justify-center bg-muted text-muted-foreground", children: s })
|
|
995
995
|
}
|
|
996
996
|
);
|
|
997
997
|
}
|
|
@@ -999,44 +999,44 @@ const dn = 7;
|
|
|
999
999
|
function Le({
|
|
1000
1000
|
daysToShow: t = dn,
|
|
1001
1001
|
events: n,
|
|
1002
|
-
users:
|
|
1003
|
-
selectedDate:
|
|
1002
|
+
users: s = [],
|
|
1003
|
+
selectedDate: o,
|
|
1004
1004
|
onDateChange: i,
|
|
1005
|
-
onEventClick:
|
|
1006
|
-
onSlotClick:
|
|
1007
|
-
onSlotSelect:
|
|
1008
|
-
visibleHours:
|
|
1005
|
+
onEventClick: a,
|
|
1006
|
+
onSlotClick: f,
|
|
1007
|
+
onSlotSelect: m,
|
|
1008
|
+
visibleHours: c,
|
|
1009
1009
|
className: v,
|
|
1010
|
-
getEventUserId:
|
|
1011
|
-
renderPopover:
|
|
1010
|
+
getEventUserId: y,
|
|
1011
|
+
renderPopover: b,
|
|
1012
1012
|
slots: A,
|
|
1013
1013
|
classNames: $,
|
|
1014
1014
|
enableDrag: P = !0
|
|
1015
1015
|
}) {
|
|
1016
|
-
const
|
|
1017
|
-
const
|
|
1016
|
+
const F = ae(null), T = Lt(), [C, j] = ie(null), W = ae(!1), [_, M] = ie(null), G = o ?? /* @__PURE__ */ new Date(), H = !0, L = c?.from ?? nn, V = c?.to ?? rn, X = V - L, Q = te(() => {
|
|
1017
|
+
const l = new Date(G);
|
|
1018
1018
|
if (t === 1 || t === 3)
|
|
1019
|
-
return
|
|
1020
|
-
const u =
|
|
1021
|
-
return
|
|
1022
|
-
}, [
|
|
1023
|
-
() => sn(
|
|
1024
|
-
[
|
|
1025
|
-
),
|
|
1026
|
-
() => an(B,
|
|
1027
|
-
[
|
|
1028
|
-
),
|
|
1029
|
-
if (
|
|
1030
|
-
const u =
|
|
1019
|
+
return l.setHours(0, 0, 0, 0), l;
|
|
1020
|
+
const u = l.getDay(), x = u === 0 ? -6 : 1 - u;
|
|
1021
|
+
return l.setDate(l.getDate() + x), l.setHours(0, 0, 0, 0), l;
|
|
1022
|
+
}, [G, t]), B = te(
|
|
1023
|
+
() => sn(Q, t),
|
|
1024
|
+
[Q, t]
|
|
1025
|
+
), d = te(
|
|
1026
|
+
() => an(B, L, V),
|
|
1027
|
+
[H, B, L, V]
|
|
1028
|
+
), h = y ?? ((l) => {
|
|
1029
|
+
if (l.resourceId) return l.resourceId;
|
|
1030
|
+
const u = l.data;
|
|
1031
1031
|
if (u?.userId) return String(u.userId);
|
|
1032
1032
|
if (u?.user && typeof u.user == "object" && u.user.id)
|
|
1033
1033
|
return String(u.user.id);
|
|
1034
|
-
if (
|
|
1035
|
-
if (
|
|
1036
|
-
}),
|
|
1037
|
-
const
|
|
1038
|
-
for (const u of
|
|
1039
|
-
|
|
1034
|
+
if (l.user?.id) return l.user.id;
|
|
1035
|
+
if (l.participants?.[0]?.id) return l.participants[0].id;
|
|
1036
|
+
}), D = te(() => {
|
|
1037
|
+
const l = /* @__PURE__ */ new Map();
|
|
1038
|
+
for (const u of s)
|
|
1039
|
+
l.set(u.id, {
|
|
1040
1040
|
id: u.id,
|
|
1041
1041
|
name: u.name,
|
|
1042
1042
|
avatar: u.avatar ?? void 0,
|
|
@@ -1044,53 +1044,53 @@ function Le({
|
|
|
1044
1044
|
});
|
|
1045
1045
|
for (const u of n) {
|
|
1046
1046
|
const k = u.data?.user;
|
|
1047
|
-
k?.id && !
|
|
1047
|
+
k?.id && !l.has(k.id) && l.set(k.id, {
|
|
1048
1048
|
id: k.id,
|
|
1049
1049
|
name: k.name ?? "",
|
|
1050
1050
|
avatar: k.avatar ?? void 0,
|
|
1051
1051
|
email: k.email
|
|
1052
|
-
}), u.user?.id && !
|
|
1052
|
+
}), u.user?.id && !l.has(u.user.id) && l.set(u.user.id, {
|
|
1053
1053
|
id: u.user.id,
|
|
1054
1054
|
name: u.user.name,
|
|
1055
1055
|
avatar: u.user.avatar ?? void 0,
|
|
1056
1056
|
email: u.user.email
|
|
1057
1057
|
});
|
|
1058
|
-
for (const
|
|
1059
|
-
|
|
1060
|
-
id:
|
|
1061
|
-
name:
|
|
1062
|
-
avatar:
|
|
1063
|
-
email:
|
|
1058
|
+
for (const S of u.participants || [])
|
|
1059
|
+
S.id && !l.has(S.id) && l.set(S.id, {
|
|
1060
|
+
id: S.id,
|
|
1061
|
+
name: S.name,
|
|
1062
|
+
avatar: S.avatar ?? void 0,
|
|
1063
|
+
email: S.email
|
|
1064
1064
|
});
|
|
1065
1065
|
}
|
|
1066
|
-
return Array.from(
|
|
1067
|
-
}, [
|
|
1068
|
-
const
|
|
1069
|
-
for (const
|
|
1070
|
-
u.set(
|
|
1066
|
+
return Array.from(l.values());
|
|
1067
|
+
}, [s, n]), w = te(() => {
|
|
1068
|
+
const l = [], u = /* @__PURE__ */ new Map();
|
|
1069
|
+
for (const S of D)
|
|
1070
|
+
u.set(S.id, []);
|
|
1071
1071
|
u.set("unassigned", []);
|
|
1072
|
-
for (const
|
|
1073
|
-
const
|
|
1074
|
-
(u.get(
|
|
1072
|
+
for (const S of n) {
|
|
1073
|
+
const z = h(S) ?? "unassigned";
|
|
1074
|
+
(u.get(z) ?? u.get("unassigned")).push(S);
|
|
1075
1075
|
}
|
|
1076
|
-
const x = (
|
|
1077
|
-
const
|
|
1078
|
-
for (const
|
|
1079
|
-
const
|
|
1080
|
-
for (let
|
|
1081
|
-
const oe = B[
|
|
1082
|
-
if (
|
|
1083
|
-
let Ne =
|
|
1084
|
-
if (
|
|
1085
|
-
|
|
1076
|
+
const x = (S) => {
|
|
1077
|
+
const z = [];
|
|
1078
|
+
for (const I of S) {
|
|
1079
|
+
const ee = I.startDate.getHours() + I.startDate.getMinutes() / 60, ne = I.endDate.getHours() + I.endDate.getMinutes() / 60;
|
|
1080
|
+
for (let q = 0; q < B.length; q++) {
|
|
1081
|
+
const oe = B[q], ye = Pe(oe), ke = ut(oe);
|
|
1082
|
+
if (I.startDate <= ke && I.endDate >= ye) {
|
|
1083
|
+
let Ne = L, Se = V;
|
|
1084
|
+
if (I.startDate >= ye && (Ne = Math.max(L, ee)), I.endDate <= ke && (Se = Math.min(V, ne)), Ne = Math.max(
|
|
1085
|
+
L,
|
|
1086
1086
|
Math.min(V, Ne)
|
|
1087
1087
|
), Se = Math.max(
|
|
1088
|
-
|
|
1088
|
+
L,
|
|
1089
1089
|
Math.min(V, Se)
|
|
1090
1090
|
), Se > Ne) {
|
|
1091
|
-
const Re =
|
|
1092
|
-
|
|
1093
|
-
event:
|
|
1091
|
+
const Re = q * X + Math.floor(Ne - L), gt = q * X + Math.ceil(Se - L);
|
|
1092
|
+
z.push({
|
|
1093
|
+
event: I,
|
|
1094
1094
|
startCol: Re,
|
|
1095
1095
|
spanCols: Math.max(1, gt - Re)
|
|
1096
1096
|
});
|
|
@@ -1098,105 +1098,105 @@ function Le({
|
|
|
1098
1098
|
}
|
|
1099
1099
|
}
|
|
1100
1100
|
}
|
|
1101
|
-
return
|
|
1101
|
+
return z;
|
|
1102
1102
|
};
|
|
1103
|
-
for (const
|
|
1104
|
-
const
|
|
1105
|
-
(
|
|
1103
|
+
for (const S of D) {
|
|
1104
|
+
const z = u.get(S.id) ?? [], I = x(z), ee = Ze(I), ne = ee.reduce(
|
|
1105
|
+
(q, oe) => Math.max(q, oe.stackIndex + 1),
|
|
1106
1106
|
0
|
|
1107
1107
|
);
|
|
1108
|
-
|
|
1109
|
-
user:
|
|
1110
|
-
events:
|
|
1111
|
-
maxStack: Math.max(
|
|
1108
|
+
l.push({
|
|
1109
|
+
user: S,
|
|
1110
|
+
events: ee,
|
|
1111
|
+
maxStack: Math.max(ne, 1)
|
|
1112
1112
|
});
|
|
1113
1113
|
}
|
|
1114
1114
|
const k = u.get("unassigned") ?? [];
|
|
1115
1115
|
if (k.length > 0) {
|
|
1116
|
-
const
|
|
1117
|
-
(
|
|
1116
|
+
const S = x(k), z = Ze(S), I = z.reduce(
|
|
1117
|
+
(ee, ne) => Math.max(ee, ne.stackIndex + 1),
|
|
1118
1118
|
0
|
|
1119
1119
|
);
|
|
1120
|
-
|
|
1120
|
+
l.push({
|
|
1121
1121
|
user: {
|
|
1122
1122
|
id: "unassigned",
|
|
1123
1123
|
name: "Unassigned",
|
|
1124
1124
|
avatar: void 0,
|
|
1125
1125
|
email: void 0
|
|
1126
1126
|
},
|
|
1127
|
-
events:
|
|
1128
|
-
maxStack: Math.max(
|
|
1127
|
+
events: z,
|
|
1128
|
+
maxStack: Math.max(I, 1)
|
|
1129
1129
|
});
|
|
1130
1130
|
}
|
|
1131
|
-
return
|
|
1131
|
+
return l;
|
|
1132
1132
|
}, [
|
|
1133
|
-
|
|
1133
|
+
D,
|
|
1134
1134
|
n,
|
|
1135
1135
|
B,
|
|
1136
|
-
E,
|
|
1137
|
-
J,
|
|
1138
1136
|
H,
|
|
1137
|
+
X,
|
|
1138
|
+
L,
|
|
1139
1139
|
V,
|
|
1140
|
-
|
|
1141
|
-
]),
|
|
1142
|
-
const
|
|
1143
|
-
for (const u of
|
|
1140
|
+
h
|
|
1141
|
+
]), R = te(() => {
|
|
1142
|
+
const l = /* @__PURE__ */ new Map();
|
|
1143
|
+
for (const u of w)
|
|
1144
1144
|
for (const x of u.events)
|
|
1145
1145
|
if (x.spanCols === 1) {
|
|
1146
|
-
const k =
|
|
1147
|
-
|
|
1146
|
+
const k = l.get(x.startCol) ?? 0;
|
|
1147
|
+
l.set(x.startCol, k + 1);
|
|
1148
1148
|
}
|
|
1149
|
-
return
|
|
1150
|
-
}, [
|
|
1151
|
-
const
|
|
1152
|
-
for (let k = 0; k <
|
|
1153
|
-
const
|
|
1154
|
-
|
|
1155
|
-
Xe + (
|
|
1156
|
-
) :
|
|
1149
|
+
return l;
|
|
1150
|
+
}, [w]), K = te(() => {
|
|
1151
|
+
const l = d.length, u = ze, x = [];
|
|
1152
|
+
for (let k = 0; k < l; k++) {
|
|
1153
|
+
const S = R.get(k) ?? 0;
|
|
1154
|
+
S > Qe ? x.push(
|
|
1155
|
+
Xe + (S - Qe) * 20
|
|
1156
|
+
) : S > 0 ? x.push(Math.max(u, Xe)) : x.push(u);
|
|
1157
1157
|
}
|
|
1158
1158
|
return x;
|
|
1159
1159
|
}, [
|
|
1160
|
-
|
|
1161
|
-
|
|
1160
|
+
H,
|
|
1161
|
+
d.length,
|
|
1162
1162
|
B.length,
|
|
1163
|
-
|
|
1164
|
-
]),
|
|
1163
|
+
R
|
|
1164
|
+
]), Z = (l) => Math.max(
|
|
1165
1165
|
tn,
|
|
1166
|
-
|
|
1167
|
-
),
|
|
1168
|
-
const
|
|
1169
|
-
for (let u = 0; u <
|
|
1170
|
-
|
|
1171
|
-
return
|
|
1172
|
-
}, [
|
|
1166
|
+
l * (We + Je) + qe * 2
|
|
1167
|
+
), Y = Ee + K.reduce((l, u) => l + u, 0), J = te(() => {
|
|
1168
|
+
const l = [0];
|
|
1169
|
+
for (let u = 0; u < K.length; u++)
|
|
1170
|
+
l.push(l[u] + K[u]);
|
|
1171
|
+
return l;
|
|
1172
|
+
}, [K]);
|
|
1173
1173
|
vt(() => {
|
|
1174
|
-
const
|
|
1175
|
-
if (!
|
|
1174
|
+
const l = F.current;
|
|
1175
|
+
if (!l) return;
|
|
1176
1176
|
const u = () => {
|
|
1177
1177
|
let x = -1;
|
|
1178
|
-
const
|
|
1178
|
+
const S = (/* @__PURE__ */ new Date()).getHours();
|
|
1179
1179
|
{
|
|
1180
|
-
for (let
|
|
1181
|
-
const
|
|
1182
|
-
if (
|
|
1183
|
-
x =
|
|
1180
|
+
for (let z = 0; z < d.length; z++) {
|
|
1181
|
+
const I = d[z];
|
|
1182
|
+
if (I && ce(I.date) && I.hour <= S && I.hour + 1 > S) {
|
|
1183
|
+
x = z;
|
|
1184
1184
|
break;
|
|
1185
1185
|
}
|
|
1186
1186
|
}
|
|
1187
1187
|
if (x === -1)
|
|
1188
|
-
for (let
|
|
1189
|
-
const
|
|
1190
|
-
if (
|
|
1191
|
-
x =
|
|
1188
|
+
for (let z = 0; z < d.length; z++) {
|
|
1189
|
+
const I = d[z];
|
|
1190
|
+
if (I && ce(I.date)) {
|
|
1191
|
+
x = z;
|
|
1192
1192
|
break;
|
|
1193
1193
|
}
|
|
1194
1194
|
}
|
|
1195
1195
|
}
|
|
1196
1196
|
if (x !== -1) {
|
|
1197
|
-
const
|
|
1198
|
-
|
|
1199
|
-
left:
|
|
1197
|
+
const z = (J[x] ?? 0) + Ee, I = l.clientWidth, ee = Math.max(0, z - I / 3);
|
|
1198
|
+
l.scrollTo({
|
|
1199
|
+
left: ee,
|
|
1200
1200
|
behavior: "instant"
|
|
1201
1201
|
});
|
|
1202
1202
|
}
|
|
@@ -1204,104 +1204,104 @@ function Le({
|
|
|
1204
1204
|
requestAnimationFrame(() => {
|
|
1205
1205
|
requestAnimationFrame(u);
|
|
1206
1206
|
});
|
|
1207
|
-
}, [
|
|
1208
|
-
const
|
|
1209
|
-
(
|
|
1210
|
-
const x = u.getBoundingClientRect(), k =
|
|
1211
|
-
for (let
|
|
1212
|
-
const
|
|
1213
|
-
if (k >=
|
|
1214
|
-
const
|
|
1215
|
-
return { colIndex:
|
|
1207
|
+
}, [G, d, B, J, H]);
|
|
1208
|
+
const ue = O(
|
|
1209
|
+
(l, u) => {
|
|
1210
|
+
const x = u.getBoundingClientRect(), k = l - x.left + u.scrollLeft;
|
|
1211
|
+
for (let S = 0; S < J.length - 1; S++) {
|
|
1212
|
+
const z = J[S], I = J[S + 1];
|
|
1213
|
+
if (k >= z && k < I) {
|
|
1214
|
+
const ee = (k - z) / (I - z), ne = Math.floor(ee * 60), q = Math.round(ne / 15) * 15;
|
|
1215
|
+
return { colIndex: S, minute: Math.min(q, 45) };
|
|
1216
1216
|
}
|
|
1217
1217
|
}
|
|
1218
1218
|
return null;
|
|
1219
1219
|
},
|
|
1220
|
-
[
|
|
1221
|
-
),
|
|
1222
|
-
(
|
|
1223
|
-
if (
|
|
1224
|
-
const x =
|
|
1220
|
+
[J]
|
|
1221
|
+
), se = O(
|
|
1222
|
+
(l, u) => {
|
|
1223
|
+
if (d[l]) {
|
|
1224
|
+
const x = d[l], k = new Date(x.date);
|
|
1225
1225
|
return k.setHours(x.hour, u ?? 0, 0, 0), { date: k, hour: x.hour };
|
|
1226
1226
|
}
|
|
1227
1227
|
return { date: /* @__PURE__ */ new Date() };
|
|
1228
1228
|
},
|
|
1229
|
-
[
|
|
1230
|
-
), le =
|
|
1231
|
-
(
|
|
1232
|
-
if (
|
|
1233
|
-
const x =
|
|
1229
|
+
[H, d, B]
|
|
1230
|
+
), le = O(
|
|
1231
|
+
(l, u) => {
|
|
1232
|
+
if (l.preventDefault(), l.dataTransfer.dropEffect = "move", !T?.isDragging || !T.dragState) return;
|
|
1233
|
+
const x = l.currentTarget, k = ue(l.clientX, x);
|
|
1234
1234
|
if (!k) return;
|
|
1235
|
-
const { colIndex:
|
|
1236
|
-
T.updateDragPreview(
|
|
1237
|
-
const { originalStartDate:
|
|
1235
|
+
const { colIndex: S, minute: z } = k, { date: I, hour: ee } = se(S, z);
|
|
1236
|
+
T.updateDragPreview(I, ee, z, u);
|
|
1237
|
+
const { originalStartDate: ne, originalEndDate: q } = T.dragState, oe = q.getTime() - ne.getTime(), ye = d.length;
|
|
1238
1238
|
let ke;
|
|
1239
1239
|
{
|
|
1240
1240
|
const Ne = oe / 36e5;
|
|
1241
1241
|
ke = Math.max(1, Math.ceil(Ne));
|
|
1242
1242
|
}
|
|
1243
|
-
ke = Math.min(ke, ye -
|
|
1243
|
+
ke = Math.min(ke, ye - S), M({ resourceId: u, colIndex: S, spanCols: ke });
|
|
1244
1244
|
},
|
|
1245
|
-
[T,
|
|
1246
|
-
),
|
|
1247
|
-
(
|
|
1248
|
-
const u =
|
|
1249
|
-
|
|
1245
|
+
[T, ue, se, H, d.length, B.length]
|
|
1246
|
+
), we = O(
|
|
1247
|
+
(l) => {
|
|
1248
|
+
const u = l.relatedTarget;
|
|
1249
|
+
l.currentTarget.contains(u) || M(null);
|
|
1250
1250
|
},
|
|
1251
1251
|
[]
|
|
1252
|
-
),
|
|
1253
|
-
(
|
|
1254
|
-
|
|
1252
|
+
), he = O(
|
|
1253
|
+
(l, u) => {
|
|
1254
|
+
l.preventDefault(), M(null), T?.isDragging && T.endDrag();
|
|
1255
1255
|
},
|
|
1256
1256
|
[T]
|
|
1257
|
-
),
|
|
1258
|
-
(
|
|
1259
|
-
if (!
|
|
1260
|
-
const x = Math.min(
|
|
1257
|
+
), g = O(
|
|
1258
|
+
(l, u) => {
|
|
1259
|
+
if (!C || C.resourceId !== l) return !1;
|
|
1260
|
+
const x = Math.min(C.startCol, C.endCol), k = Math.max(C.startCol, C.endCol);
|
|
1261
1261
|
return u >= x && u <= k;
|
|
1262
1262
|
},
|
|
1263
|
-
[
|
|
1264
|
-
),
|
|
1265
|
-
(
|
|
1263
|
+
[C]
|
|
1264
|
+
), E = O(
|
|
1265
|
+
(l, u) => !_ || _.resourceId !== l ? !1 : u >= _.colIndex && u < _.colIndex + _.spanCols,
|
|
1266
1266
|
[_]
|
|
1267
|
-
), U =
|
|
1268
|
-
(
|
|
1269
|
-
x.button !== 0 && x.pointerType === "mouse" || (
|
|
1267
|
+
), U = O(
|
|
1268
|
+
(l, u, x) => {
|
|
1269
|
+
x.button !== 0 && x.pointerType === "mouse" || (m || f) && (x.preventDefault(), W.current = !0, j({ resourceId: l, startCol: u, endCol: u, isSelecting: !0 }));
|
|
1270
1270
|
},
|
|
1271
|
-
[
|
|
1272
|
-
), re =
|
|
1273
|
-
(
|
|
1274
|
-
if (
|
|
1271
|
+
[m, f]
|
|
1272
|
+
), re = O(
|
|
1273
|
+
(l, u, x) => {
|
|
1274
|
+
if (W.current && !(!C || C.resourceId !== l)) {
|
|
1275
1275
|
if (x.buttons === 0) {
|
|
1276
|
-
|
|
1276
|
+
W.current = !1;
|
|
1277
1277
|
return;
|
|
1278
1278
|
}
|
|
1279
|
-
|
|
1279
|
+
j((k) => k ? { ...k, endCol: u } : null);
|
|
1280
1280
|
}
|
|
1281
1281
|
},
|
|
1282
|
-
[
|
|
1283
|
-
), De =
|
|
1284
|
-
if (!
|
|
1285
|
-
|
|
1286
|
-
const
|
|
1287
|
-
k.hour !== void 0 &&
|
|
1288
|
-
const
|
|
1289
|
-
startDate:
|
|
1290
|
-
endDate:
|
|
1291
|
-
resourceId:
|
|
1282
|
+
[C]
|
|
1283
|
+
), De = O(() => {
|
|
1284
|
+
if (!W.current || !C) return;
|
|
1285
|
+
W.current = !1;
|
|
1286
|
+
const l = Math.min(C.startCol, C.endCol), u = Math.max(C.startCol, C.endCol), x = se(l), k = se(u), S = new Date(x.date), z = new Date(k.date);
|
|
1287
|
+
k.hour !== void 0 && z.setHours(k.hour + 1, 0, 0, 0);
|
|
1288
|
+
const I = {
|
|
1289
|
+
startDate: S,
|
|
1290
|
+
endDate: z,
|
|
1291
|
+
resourceId: C.resourceId
|
|
1292
1292
|
};
|
|
1293
|
-
|
|
1294
|
-
}, [
|
|
1293
|
+
l === u && f && f(x.date, x.hour, C.resourceId), m?.(I), j((ee) => ee ? { ...ee, isSelecting: !1 } : null), setTimeout(() => j(null), 150);
|
|
1294
|
+
}, [C, se, H, f, m]);
|
|
1295
1295
|
return de(() => {
|
|
1296
|
-
const
|
|
1297
|
-
|
|
1296
|
+
const l = () => {
|
|
1297
|
+
W.current && De();
|
|
1298
1298
|
};
|
|
1299
|
-
return window.addEventListener("pointerup",
|
|
1300
|
-
window.removeEventListener("pointerup",
|
|
1299
|
+
return window.addEventListener("pointerup", l), window.addEventListener("pointercancel", l), () => {
|
|
1300
|
+
window.removeEventListener("pointerup", l), window.removeEventListener("pointercancel", l);
|
|
1301
1301
|
};
|
|
1302
1302
|
}, [De]), de(() => {
|
|
1303
|
-
T?.isDragging ||
|
|
1304
|
-
}, [T?.isDragging]), /* @__PURE__ */ e("div", { className:
|
|
1303
|
+
T?.isDragging || M(null);
|
|
1304
|
+
}, [T?.isDragging]), /* @__PURE__ */ e("div", { className: p("flex h-full flex-col", v), children: /* @__PURE__ */ e("div", { className: "ic-timeline-scroll-container flex-1", ref: F, children: /* @__PURE__ */ r("div", { className: "relative", style: { minWidth: Y }, children: [
|
|
1305
1305
|
// Hour mode: Day headers + Hour sub-headers - sticky wrapper with flex child (sticky + flex breaks sticky)
|
|
1306
1306
|
/* @__PURE__ */ e("div", { className: "ic-timeline-header sticky top-0 z-20 border-b bg-background", children: t > 1 ? (
|
|
1307
1307
|
// Multi-day: Resources cell spans both day-header + hour-header rows
|
|
@@ -1315,35 +1315,35 @@ function Le({
|
|
|
1315
1315
|
}
|
|
1316
1316
|
),
|
|
1317
1317
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 flex-col", children: [
|
|
1318
|
-
/* @__PURE__ */ e("div", { className: "flex border-b", children: B.map((
|
|
1319
|
-
const x = ce(
|
|
1318
|
+
/* @__PURE__ */ e("div", { className: "flex border-b", children: B.map((l, u) => {
|
|
1319
|
+
const x = ce(l), k = u * X, S = K.slice(k, k + X).reduce((z, I) => z + I, 0);
|
|
1320
1320
|
return /* @__PURE__ */ e(
|
|
1321
1321
|
"div",
|
|
1322
1322
|
{
|
|
1323
|
-
className:
|
|
1323
|
+
className: p(
|
|
1324
1324
|
"flex shrink-0 items-center justify-center border-r py-1.5 font-medium",
|
|
1325
1325
|
x ? "bg-primary/10 text-primary" : "bg-muted/30"
|
|
1326
1326
|
),
|
|
1327
|
-
style: { width:
|
|
1328
|
-
children: /* @__PURE__ */ e("span", { className: "text-xs", children: ln(
|
|
1327
|
+
style: { width: S },
|
|
1328
|
+
children: /* @__PURE__ */ e("span", { className: "text-xs", children: ln(l) })
|
|
1329
1329
|
},
|
|
1330
|
-
`day-${
|
|
1330
|
+
`day-${l.toISOString()}`
|
|
1331
1331
|
);
|
|
1332
1332
|
}) }),
|
|
1333
|
-
/* @__PURE__ */ e("div", { className: "flex", children:
|
|
1334
|
-
const x =
|
|
1333
|
+
/* @__PURE__ */ e("div", { className: "flex", children: d.map((l, u) => {
|
|
1334
|
+
const x = l.hour === L, k = ce(l.date), S = K[u] ?? ze;
|
|
1335
1335
|
return /* @__PURE__ */ e(
|
|
1336
1336
|
"div",
|
|
1337
1337
|
{
|
|
1338
|
-
className:
|
|
1338
|
+
className: p(
|
|
1339
1339
|
"flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",
|
|
1340
1340
|
x && u > 0 ? "border-l-2 border-l-border" : "border-r border-r-border/50",
|
|
1341
1341
|
k && "bg-primary/5"
|
|
1342
1342
|
),
|
|
1343
|
-
style: { width:
|
|
1344
|
-
children: Fe(
|
|
1343
|
+
style: { width: S },
|
|
1344
|
+
children: Fe(l.hour)
|
|
1345
1345
|
},
|
|
1346
|
-
`hour-${
|
|
1346
|
+
`hour-${l.dayIndex}-${l.hour}`
|
|
1347
1347
|
);
|
|
1348
1348
|
}) })
|
|
1349
1349
|
] })
|
|
@@ -1359,30 +1359,30 @@ function Le({
|
|
|
1359
1359
|
children: /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase text-muted-foreground", children: "Resources" })
|
|
1360
1360
|
}
|
|
1361
1361
|
),
|
|
1362
|
-
|
|
1363
|
-
const x =
|
|
1362
|
+
d.map((l, u) => {
|
|
1363
|
+
const x = l.hour === L, k = ce(l.date), S = K[u] ?? ze;
|
|
1364
1364
|
return /* @__PURE__ */ e(
|
|
1365
1365
|
"div",
|
|
1366
1366
|
{
|
|
1367
|
-
className:
|
|
1367
|
+
className: p(
|
|
1368
1368
|
"flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",
|
|
1369
1369
|
x && u > 0 ? "border-l-2 border-l-border" : "border-r border-r-border/50",
|
|
1370
1370
|
k && "bg-primary/5"
|
|
1371
1371
|
),
|
|
1372
|
-
style: { width:
|
|
1373
|
-
children: Fe(
|
|
1372
|
+
style: { width: S },
|
|
1373
|
+
children: Fe(l.hour)
|
|
1374
1374
|
},
|
|
1375
|
-
`hour-${
|
|
1375
|
+
`hour-${l.dayIndex}-${l.hour}`
|
|
1376
1376
|
);
|
|
1377
1377
|
})
|
|
1378
1378
|
] })
|
|
1379
1379
|
) }),
|
|
1380
|
-
|
|
1381
|
-
const u =
|
|
1380
|
+
w.map((l) => {
|
|
1381
|
+
const u = Z(l.maxStack);
|
|
1382
1382
|
return /* @__PURE__ */ r(
|
|
1383
1383
|
"div",
|
|
1384
1384
|
{
|
|
1385
|
-
className:
|
|
1385
|
+
className: p(
|
|
1386
1386
|
"relative flex border-b",
|
|
1387
1387
|
$?.resourceRow
|
|
1388
1388
|
),
|
|
@@ -1396,7 +1396,7 @@ function Le({
|
|
|
1396
1396
|
children: /* @__PURE__ */ r(
|
|
1397
1397
|
"div",
|
|
1398
1398
|
{
|
|
1399
|
-
className:
|
|
1399
|
+
className: p(
|
|
1400
1400
|
"flex h-full items-center gap-2 sm:gap-3 border-r bg-background px-2 sm:px-4",
|
|
1401
1401
|
$?.resourceHeader
|
|
1402
1402
|
),
|
|
@@ -1405,12 +1405,12 @@ function Le({
|
|
|
1405
1405
|
cn,
|
|
1406
1406
|
{
|
|
1407
1407
|
className: "size-7",
|
|
1408
|
-
src:
|
|
1409
|
-
alt:
|
|
1410
|
-
fallback: on(
|
|
1408
|
+
src: l.user.avatar,
|
|
1409
|
+
alt: l.user.name,
|
|
1410
|
+
fallback: on(l.user.name)
|
|
1411
1411
|
}
|
|
1412
1412
|
),
|
|
1413
|
-
/* @__PURE__ */ e("span", { className: "truncate text-xs sm:text-sm font-medium", children:
|
|
1413
|
+
/* @__PURE__ */ e("span", { className: "truncate text-xs sm:text-sm font-medium", children: l.user.name })
|
|
1414
1414
|
]
|
|
1415
1415
|
}
|
|
1416
1416
|
)
|
|
@@ -1420,75 +1420,83 @@ function Le({
|
|
|
1420
1420
|
"div",
|
|
1421
1421
|
{
|
|
1422
1422
|
className: "ic-timeline-grid relative flex",
|
|
1423
|
-
onDragOver: (x) => le(x,
|
|
1424
|
-
onDragLeave:
|
|
1425
|
-
onDrop: (x) =>
|
|
1423
|
+
onDragOver: (x) => le(x, l.user.id),
|
|
1424
|
+
onDragLeave: we,
|
|
1425
|
+
onDrop: (x) => he(x, l.user.id),
|
|
1426
1426
|
children: [
|
|
1427
1427
|
// Hour mode cells — interactive buttons for slot selection
|
|
1428
|
-
|
|
1429
|
-
const
|
|
1428
|
+
d.map((x, k) => {
|
|
1429
|
+
const S = x.hour === L && k > 0, z = K[k] ?? ze, I = g(l.user.id, k), ee = E(l.user.id, k), ne = !!(m || f);
|
|
1430
1430
|
return /* @__PURE__ */ e(
|
|
1431
1431
|
"div",
|
|
1432
1432
|
{
|
|
1433
|
-
role:
|
|
1434
|
-
tabIndex:
|
|
1435
|
-
"aria-label":
|
|
1436
|
-
onPointerDown: (
|
|
1437
|
-
onPointerEnter: (
|
|
1433
|
+
role: ne ? "button" : void 0,
|
|
1434
|
+
tabIndex: ne ? 0 : void 0,
|
|
1435
|
+
"aria-label": ne ? `Select ${Fe(x.hour)} on ${x.date.toLocaleDateString()} for ${l.user.name}` : void 0,
|
|
1436
|
+
onPointerDown: (q) => U(l.user.id, k, q),
|
|
1437
|
+
onPointerEnter: (q) => re(l.user.id, k, q),
|
|
1438
1438
|
onPointerUp: De,
|
|
1439
|
-
onKeyDown: (
|
|
1440
|
-
if (
|
|
1441
|
-
|
|
1442
|
-
const oe =
|
|
1443
|
-
|
|
1439
|
+
onKeyDown: (q) => {
|
|
1440
|
+
if (ne && (q.key === "Enter" || q.key === " ")) {
|
|
1441
|
+
q.preventDefault();
|
|
1442
|
+
const oe = se(k);
|
|
1443
|
+
f?.(oe.date, oe.hour, l.user.id), m?.({
|
|
1444
1444
|
startDate: oe.date,
|
|
1445
1445
|
endDate: (() => {
|
|
1446
1446
|
const ye = new Date(oe.date);
|
|
1447
1447
|
return oe.hour !== void 0 && ye.setHours(oe.hour + 1, 0, 0, 0), ye;
|
|
1448
1448
|
})(),
|
|
1449
|
-
resourceId:
|
|
1449
|
+
resourceId: l.user.id
|
|
1450
1450
|
});
|
|
1451
1451
|
}
|
|
1452
1452
|
},
|
|
1453
|
-
className:
|
|
1453
|
+
className: p(
|
|
1454
1454
|
"shrink-0 select-none touch-none transition-colors",
|
|
1455
|
-
|
|
1456
|
-
|
|
1455
|
+
ne && "cursor-pointer",
|
|
1456
|
+
S ? "border-l-2 border-l-border" : "border-r border-r-border/50",
|
|
1457
1457
|
ce(x.date) && "bg-primary/5",
|
|
1458
1458
|
// Hover — subtle feedback (only when not selecting or dragging)
|
|
1459
|
-
|
|
1459
|
+
ne && !C?.isSelecting && !T?.isDragging && "hover:bg-blue-50/60",
|
|
1460
1460
|
// Slot selection highlight
|
|
1461
|
-
|
|
1461
|
+
I && "bg-blue-100/70",
|
|
1462
1462
|
// Drop target highlight
|
|
1463
|
-
|
|
1463
|
+
ee && "bg-primary/20 ring-2 ring-primary ring-inset"
|
|
1464
1464
|
),
|
|
1465
|
-
style: { width:
|
|
1465
|
+
style: { width: z }
|
|
1466
1466
|
},
|
|
1467
1467
|
`cell-${x.dayIndex}-${x.hour}`
|
|
1468
1468
|
);
|
|
1469
1469
|
}),
|
|
1470
|
-
|
|
1471
|
-
const k = (
|
|
1470
|
+
l.events.map((x) => {
|
|
1471
|
+
const k = (J[x.startCol] ?? 0) + 2, S = J[x.startCol + x.spanCols] ?? J[J.length - 1] ?? 0, z = J[x.startCol] ?? 0, I = S - z - 4, ee = qe + x.stackIndex * (We + Je), ne = t === 1 ? "timeline-day" : t === 3 ? "timeline-3day" : "timeline-week", q = A?.eventCard;
|
|
1472
1472
|
return /* @__PURE__ */ e(
|
|
1473
1473
|
"div",
|
|
1474
1474
|
{
|
|
1475
1475
|
className: "absolute",
|
|
1476
1476
|
style: {
|
|
1477
1477
|
left: k,
|
|
1478
|
-
width: Math.max(
|
|
1478
|
+
width: Math.max(I, 0),
|
|
1479
1479
|
// No forced minimum - columns are guaranteed wide enough
|
|
1480
|
-
top:
|
|
1480
|
+
top: ee,
|
|
1481
1481
|
height: We
|
|
1482
1482
|
},
|
|
1483
|
-
children: /* @__PURE__ */ e(
|
|
1483
|
+
children: q ? /* @__PURE__ */ e(
|
|
1484
|
+
q,
|
|
1485
|
+
{
|
|
1486
|
+
event: x.event,
|
|
1487
|
+
view: ne,
|
|
1488
|
+
isCompact: !0,
|
|
1489
|
+
onClick: () => a?.(x.event)
|
|
1490
|
+
}
|
|
1491
|
+
) : /* @__PURE__ */ e(
|
|
1484
1492
|
Nt,
|
|
1485
1493
|
{
|
|
1486
1494
|
event: x.event,
|
|
1487
1495
|
variant: "compact",
|
|
1488
1496
|
enableDrag: P,
|
|
1489
|
-
onClick:
|
|
1490
|
-
renderPopover:
|
|
1491
|
-
className:
|
|
1497
|
+
onClick: a,
|
|
1498
|
+
renderPopover: b,
|
|
1499
|
+
className: p(
|
|
1492
1500
|
"h-full w-full",
|
|
1493
1501
|
$?.eventCardCompact
|
|
1494
1502
|
)
|
|
@@ -1503,10 +1511,10 @@ function Le({
|
|
|
1503
1511
|
)
|
|
1504
1512
|
]
|
|
1505
1513
|
},
|
|
1506
|
-
|
|
1514
|
+
l.user.id
|
|
1507
1515
|
);
|
|
1508
1516
|
}),
|
|
1509
|
-
|
|
1517
|
+
w.length === 0 && /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-20 text-muted-foreground", children: "No users or events to display" })
|
|
1510
1518
|
] }) }) });
|
|
1511
1519
|
}
|
|
1512
1520
|
const un = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], hn = [
|
|
@@ -1527,49 +1535,49 @@ function et(t) {
|
|
|
1527
1535
|
const n = t.hexColor;
|
|
1528
1536
|
return n ? { backgroundColor: n } : {};
|
|
1529
1537
|
}
|
|
1530
|
-
function mn({ day: t, date: n, events:
|
|
1531
|
-
const
|
|
1538
|
+
function mn({ day: t, date: n, events: s, isCurrentMonth: o, onDayClick: i }) {
|
|
1539
|
+
const a = ce(n), f = 3, m = s.length;
|
|
1532
1540
|
return /* @__PURE__ */ r(
|
|
1533
1541
|
"button",
|
|
1534
1542
|
{
|
|
1535
1543
|
type: "button",
|
|
1536
1544
|
onClick: () => i?.(n),
|
|
1537
|
-
className:
|
|
1545
|
+
className: p(
|
|
1538
1546
|
"flex h-9 sm:h-11 flex-1 flex-col items-center justify-start gap-0.5 rounded-md pt-0.5 sm:pt-1",
|
|
1539
1547
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1540
1548
|
"transition-colors",
|
|
1541
|
-
!
|
|
1549
|
+
!o && "opacity-40"
|
|
1542
1550
|
),
|
|
1543
1551
|
children: [
|
|
1544
1552
|
/* @__PURE__ */ e(
|
|
1545
1553
|
"div",
|
|
1546
1554
|
{
|
|
1547
|
-
className:
|
|
1555
|
+
className: p(
|
|
1548
1556
|
"flex size-5 sm:size-6 items-center justify-center rounded-full text-[10px] sm:text-xs font-medium",
|
|
1549
|
-
|
|
1557
|
+
a && "bg-primary font-semibold text-primary-foreground"
|
|
1550
1558
|
),
|
|
1551
1559
|
children: t
|
|
1552
1560
|
}
|
|
1553
1561
|
),
|
|
1554
|
-
|
|
1562
|
+
m > 0 && /* @__PURE__ */ e("div", { className: "mt-0.5 flex items-center gap-0.5", children: m <= f ? s.map((c) => /* @__PURE__ */ e(
|
|
1555
1563
|
"div",
|
|
1556
1564
|
{
|
|
1557
1565
|
className: "size-1 sm:size-1.5 rounded-full bg-primary",
|
|
1558
|
-
style: et(
|
|
1566
|
+
style: et(c)
|
|
1559
1567
|
},
|
|
1560
|
-
|
|
1561
|
-
)) : /* @__PURE__ */ r(
|
|
1562
|
-
|
|
1568
|
+
c.id
|
|
1569
|
+
)) : /* @__PURE__ */ r(be, { children: [
|
|
1570
|
+
s.slice(0, f).map((c) => /* @__PURE__ */ e(
|
|
1563
1571
|
"div",
|
|
1564
1572
|
{
|
|
1565
1573
|
className: "size-1 sm:size-1.5 rounded-full bg-primary",
|
|
1566
|
-
style: et(
|
|
1574
|
+
style: et(c)
|
|
1567
1575
|
},
|
|
1568
|
-
|
|
1576
|
+
c.id
|
|
1569
1577
|
)),
|
|
1570
1578
|
/* @__PURE__ */ r("span", { className: "text-[6px] sm:text-[7px] font-medium text-muted-foreground", children: [
|
|
1571
1579
|
"+",
|
|
1572
|
-
|
|
1580
|
+
m - f
|
|
1573
1581
|
] })
|
|
1574
1582
|
] }) })
|
|
1575
1583
|
]
|
|
@@ -1579,17 +1587,17 @@ function mn({ day: t, date: n, events: o, isCurrentMonth: a, onDayClick: i }) {
|
|
|
1579
1587
|
function fn({
|
|
1580
1588
|
date: t,
|
|
1581
1589
|
events: n,
|
|
1582
|
-
onMonthClick:
|
|
1583
|
-
onDayClick:
|
|
1590
|
+
onMonthClick: s,
|
|
1591
|
+
onDayClick: o
|
|
1584
1592
|
}) {
|
|
1585
|
-
const i =
|
|
1593
|
+
const i = te(() => At(t, 0), [t]);
|
|
1586
1594
|
return /* @__PURE__ */ r("div", { className: "flex flex-col", children: [
|
|
1587
1595
|
/* @__PURE__ */ e(
|
|
1588
1596
|
"button",
|
|
1589
1597
|
{
|
|
1590
1598
|
type: "button",
|
|
1591
|
-
onClick: () =>
|
|
1592
|
-
className:
|
|
1599
|
+
onClick: () => s?.(t),
|
|
1600
|
+
className: p(
|
|
1593
1601
|
"w-full rounded-t-lg border px-2 sm:px-3 py-1.5 sm:py-2 text-xs sm:text-sm font-semibold",
|
|
1594
1602
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1595
1603
|
"transition-colors"
|
|
@@ -1598,22 +1606,22 @@ function fn({
|
|
|
1598
1606
|
}
|
|
1599
1607
|
),
|
|
1600
1608
|
/* @__PURE__ */ r("div", { className: "flex-1 space-y-1.5 sm:space-y-2 rounded-b-lg border border-t-0 p-2 sm:p-3", children: [
|
|
1601
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 text-center", children: un.map((
|
|
1602
|
-
/* @__PURE__ */ e("span", { className: "sm:hidden", children:
|
|
1603
|
-
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children:
|
|
1604
|
-
] },
|
|
1605
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 gap-y-1", children: i.map((
|
|
1606
|
-
const
|
|
1609
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 text-center", children: un.map((a, f) => /* @__PURE__ */ r("div", { className: "text-[9px] sm:text-xs font-medium text-muted-foreground", children: [
|
|
1610
|
+
/* @__PURE__ */ e("span", { className: "sm:hidden", children: a[0] }),
|
|
1611
|
+
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children: a })
|
|
1612
|
+
] }, f)) }),
|
|
1613
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 gap-y-1", children: i.map((a, f) => {
|
|
1614
|
+
const m = Pt(n, a.date);
|
|
1607
1615
|
return /* @__PURE__ */ e(
|
|
1608
1616
|
mn,
|
|
1609
1617
|
{
|
|
1610
|
-
day:
|
|
1611
|
-
date:
|
|
1612
|
-
events:
|
|
1613
|
-
isCurrentMonth:
|
|
1614
|
-
onDayClick:
|
|
1618
|
+
day: a.date.getDate(),
|
|
1619
|
+
date: a.date,
|
|
1620
|
+
events: m,
|
|
1621
|
+
isCurrentMonth: a.isCurrentMonth,
|
|
1622
|
+
onDayClick: o
|
|
1615
1623
|
},
|
|
1616
|
-
`${
|
|
1624
|
+
`${f + 1}-${a.date.toISOString()}`
|
|
1617
1625
|
);
|
|
1618
1626
|
}) })
|
|
1619
1627
|
] })
|
|
@@ -1622,24 +1630,24 @@ function fn({
|
|
|
1622
1630
|
function gn({
|
|
1623
1631
|
events: t,
|
|
1624
1632
|
year: n,
|
|
1625
|
-
onMonthClick:
|
|
1626
|
-
onDayClick:
|
|
1633
|
+
onMonthClick: s,
|
|
1634
|
+
onDayClick: o,
|
|
1627
1635
|
className: i,
|
|
1628
|
-
slots:
|
|
1629
|
-
classNames:
|
|
1636
|
+
slots: a,
|
|
1637
|
+
classNames: f
|
|
1630
1638
|
}) {
|
|
1631
|
-
const
|
|
1632
|
-
return /* @__PURE__ */ r("div", { className:
|
|
1639
|
+
const m = te(() => jt(n), [n]);
|
|
1640
|
+
return /* @__PURE__ */ r("div", { className: p("flex flex-col h-full", i), children: [
|
|
1633
1641
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-center border-b px-4 py-3", children: /* @__PURE__ */ e("h2", { className: "text-lg font-semibold", children: n }) }),
|
|
1634
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto p-4", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4", children:
|
|
1642
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto p-4", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4", children: m.map((c) => /* @__PURE__ */ e(
|
|
1635
1643
|
fn,
|
|
1636
1644
|
{
|
|
1637
|
-
date:
|
|
1645
|
+
date: c,
|
|
1638
1646
|
events: t,
|
|
1639
|
-
onMonthClick:
|
|
1640
|
-
onDayClick:
|
|
1647
|
+
onMonthClick: s,
|
|
1648
|
+
onDayClick: o
|
|
1641
1649
|
},
|
|
1642
|
-
|
|
1650
|
+
c.getMonth()
|
|
1643
1651
|
)) }) })
|
|
1644
1652
|
] });
|
|
1645
1653
|
}
|
|
@@ -1714,246 +1722,256 @@ function Nn() {
|
|
|
1714
1722
|
}
|
|
1715
1723
|
function Cn({
|
|
1716
1724
|
containerRef: t,
|
|
1717
|
-
|
|
1725
|
+
currentDate: n,
|
|
1726
|
+
className: s
|
|
1718
1727
|
}) {
|
|
1719
|
-
const [o,
|
|
1728
|
+
const [o, i] = ie({
|
|
1720
1729
|
canUp: !1,
|
|
1721
1730
|
canDown: !1,
|
|
1722
1731
|
canLeft: !1,
|
|
1723
1732
|
canRight: !1
|
|
1724
|
-
}), [
|
|
1725
|
-
const
|
|
1726
|
-
if (!
|
|
1727
|
-
const
|
|
1728
|
-
|
|
1729
|
-
canUp:
|
|
1730
|
-
canDown:
|
|
1731
|
-
canLeft:
|
|
1732
|
-
canRight:
|
|
1733
|
+
}), [a, f] = ie({ x: 0, y: 0 }), [m, c] = ie(!1), v = o.canUp || o.canDown || o.canLeft || o.canRight, y = ae(null), b = ae(null), A = ae(null), $ = ae(!1), P = ae({ x: 0, y: 0 }), F = ae({ x: 0, y: 0 }), T = ae(0), C = ae(null), j = O(() => {
|
|
1734
|
+
const h = t.current;
|
|
1735
|
+
if (!h) return;
|
|
1736
|
+
const D = 4;
|
|
1737
|
+
i({
|
|
1738
|
+
canUp: h.scrollTop > D,
|
|
1739
|
+
canDown: h.scrollTop + h.clientHeight < h.scrollHeight - D,
|
|
1740
|
+
canLeft: h.scrollLeft > D,
|
|
1741
|
+
canRight: h.scrollLeft + h.clientWidth < h.scrollWidth - D
|
|
1733
1742
|
});
|
|
1734
1743
|
}, [t]);
|
|
1735
1744
|
de(() => {
|
|
1736
|
-
const
|
|
1737
|
-
if (!
|
|
1738
|
-
|
|
1739
|
-
const
|
|
1740
|
-
|
|
1741
|
-
const
|
|
1742
|
-
return
|
|
1743
|
-
|
|
1745
|
+
const h = t.current;
|
|
1746
|
+
if (!h) return;
|
|
1747
|
+
j(), h.addEventListener("scroll", j, { passive: !0 });
|
|
1748
|
+
const D = new ResizeObserver(j);
|
|
1749
|
+
D.observe(h);
|
|
1750
|
+
const w = new MutationObserver(j);
|
|
1751
|
+
return w.observe(h, { childList: !0, subtree: !0 }), () => {
|
|
1752
|
+
h.removeEventListener("scroll", j), D.disconnect(), w.disconnect();
|
|
1744
1753
|
};
|
|
1745
|
-
}, [t,
|
|
1746
|
-
const
|
|
1747
|
-
(
|
|
1748
|
-
t.current?.scrollBy({ left:
|
|
1754
|
+
}, [t, j]);
|
|
1755
|
+
const W = O(
|
|
1756
|
+
(h, D) => {
|
|
1757
|
+
t.current?.scrollBy({ left: h, top: D, behavior: "smooth" });
|
|
1749
1758
|
},
|
|
1750
1759
|
[t]
|
|
1751
|
-
),
|
|
1752
|
-
|
|
1753
|
-
}, []),
|
|
1754
|
-
|
|
1755
|
-
b.current = setInterval(
|
|
1760
|
+
), _ = O(() => W(0, -Ie), [W]), M = O(() => W(0, Ie), [W]), G = O(() => W(-Ie, 0), [W]), H = O(() => W(Ie, 0), [W]), L = O(() => {
|
|
1761
|
+
y.current && (clearTimeout(y.current), y.current = null), b.current && (clearInterval(b.current), b.current = null);
|
|
1762
|
+
}, []), V = O((h) => {
|
|
1763
|
+
h(), y.current = setTimeout(() => {
|
|
1764
|
+
b.current = setInterval(h, pn);
|
|
1756
1765
|
}, xn);
|
|
1757
1766
|
}, []);
|
|
1758
|
-
de(() =>
|
|
1759
|
-
const
|
|
1760
|
-
if (!
|
|
1761
|
-
const
|
|
1762
|
-
if (
|
|
1763
|
-
const
|
|
1764
|
-
if (!(
|
|
1765
|
-
switch (
|
|
1767
|
+
de(() => L, [L]), de(() => {
|
|
1768
|
+
const h = t.current;
|
|
1769
|
+
if (!h) return;
|
|
1770
|
+
const D = (w) => {
|
|
1771
|
+
if (w.ctrlKey || w.metaKey || w.altKey) return;
|
|
1772
|
+
const R = w.target.tagName;
|
|
1773
|
+
if (!(R === "INPUT" || R === "TEXTAREA" || w.target.isContentEditable))
|
|
1774
|
+
switch (w.key) {
|
|
1766
1775
|
case "ArrowUp":
|
|
1767
|
-
|
|
1776
|
+
w.preventDefault(), _();
|
|
1768
1777
|
break;
|
|
1769
1778
|
case "ArrowDown":
|
|
1770
|
-
|
|
1779
|
+
w.preventDefault(), M();
|
|
1771
1780
|
break;
|
|
1772
1781
|
case "ArrowLeft":
|
|
1773
|
-
|
|
1782
|
+
w.preventDefault(), G();
|
|
1774
1783
|
break;
|
|
1775
1784
|
case "ArrowRight":
|
|
1776
|
-
|
|
1785
|
+
w.preventDefault(), H();
|
|
1777
1786
|
break;
|
|
1778
1787
|
}
|
|
1779
1788
|
};
|
|
1780
|
-
return
|
|
1781
|
-
}, [t,
|
|
1782
|
-
if (!
|
|
1783
|
-
const
|
|
1784
|
-
if (!
|
|
1785
|
-
let
|
|
1786
|
-
const
|
|
1787
|
-
const
|
|
1788
|
-
if (!
|
|
1789
|
-
const
|
|
1790
|
-
if (
|
|
1791
|
-
|
|
1789
|
+
return h.addEventListener("keydown", D), () => h.removeEventListener("keydown", D);
|
|
1790
|
+
}, [t, _, M, G, H]), de(() => {
|
|
1791
|
+
if (!v) return;
|
|
1792
|
+
const h = C.current;
|
|
1793
|
+
if (!h) return;
|
|
1794
|
+
let D = 0;
|
|
1795
|
+
const w = () => {
|
|
1796
|
+
const Y = h.offsetParent;
|
|
1797
|
+
if (!Y) return;
|
|
1798
|
+
const J = Y.getBoundingClientRect(), ue = window.innerHeight;
|
|
1799
|
+
if (J.height <= ue) {
|
|
1800
|
+
h.style.removeProperty("top"), h.style.removeProperty("bottom");
|
|
1792
1801
|
return;
|
|
1793
1802
|
}
|
|
1794
|
-
const
|
|
1795
|
-
|
|
1796
|
-
},
|
|
1797
|
-
cancelAnimationFrame(
|
|
1798
|
-
},
|
|
1799
|
-
let
|
|
1800
|
-
for (;
|
|
1801
|
-
const
|
|
1802
|
-
/(auto|scroll)/.test(
|
|
1803
|
+
const le = Math.min(J.bottom, ue) - J.top, we = h.offsetHeight, he = le - we - 12, g = 12, E = Y.clientHeight - we - 12, U = Math.max(g, Math.min(he, E));
|
|
1804
|
+
h.style.top = `${U}px`, h.style.bottom = "auto";
|
|
1805
|
+
}, R = () => {
|
|
1806
|
+
cancelAnimationFrame(D), D = requestAnimationFrame(w);
|
|
1807
|
+
}, K = [window];
|
|
1808
|
+
let Z = h.parentElement;
|
|
1809
|
+
for (; Z; ) {
|
|
1810
|
+
const Y = getComputedStyle(Z);
|
|
1811
|
+
/(auto|scroll)/.test(Y.overflow + Y.overflowY) && K.push(Z), Z = Z.parentElement;
|
|
1803
1812
|
}
|
|
1804
|
-
for (const
|
|
1805
|
-
|
|
1806
|
-
return window.addEventListener("resize",
|
|
1807
|
-
cancelAnimationFrame(
|
|
1808
|
-
for (const
|
|
1809
|
-
|
|
1810
|
-
window.removeEventListener("resize",
|
|
1813
|
+
for (const Y of K)
|
|
1814
|
+
Y.addEventListener("scroll", R, { passive: !0 });
|
|
1815
|
+
return window.addEventListener("resize", R, { passive: !0 }), w(), () => {
|
|
1816
|
+
cancelAnimationFrame(D);
|
|
1817
|
+
for (const Y of K)
|
|
1818
|
+
Y.removeEventListener("scroll", R);
|
|
1819
|
+
window.removeEventListener("resize", R);
|
|
1811
1820
|
};
|
|
1812
|
-
}, [
|
|
1813
|
-
const
|
|
1814
|
-
|
|
1815
|
-
}, []),
|
|
1816
|
-
(
|
|
1817
|
-
|
|
1818
|
-
const
|
|
1819
|
-
if (
|
|
1820
|
-
const
|
|
1821
|
-
if (
|
|
1822
|
-
const { x:
|
|
1823
|
-
if (
|
|
1824
|
-
const
|
|
1825
|
-
|
|
1821
|
+
}, [v]);
|
|
1822
|
+
const X = O(() => {
|
|
1823
|
+
$.current = !1, c(!1), f({ x: 0, y: 0 }), F.current = { x: 0, y: 0 }, T.current && cancelAnimationFrame(T.current);
|
|
1824
|
+
}, []), Q = O(
|
|
1825
|
+
(h) => {
|
|
1826
|
+
h.preventDefault(), $.current = !0, c(!0), P.current = { x: h.clientX, y: h.clientY }, F.current = { x: 0, y: 0 }, h.target.setPointerCapture(h.pointerId);
|
|
1827
|
+
const D = () => {
|
|
1828
|
+
if (!$.current) return;
|
|
1829
|
+
const w = t.current;
|
|
1830
|
+
if (w) {
|
|
1831
|
+
const { x: R, y: K } = F.current, Z = Math.sqrt(R * R + K * K);
|
|
1832
|
+
if (Z > tt) {
|
|
1833
|
+
const J = Math.min(Z / $e, 1) * wn;
|
|
1834
|
+
w.scrollLeft += R / Z * J, w.scrollTop += K / Z * J;
|
|
1826
1835
|
}
|
|
1827
1836
|
}
|
|
1828
|
-
|
|
1837
|
+
T.current = requestAnimationFrame(D);
|
|
1829
1838
|
};
|
|
1830
|
-
|
|
1839
|
+
T.current = requestAnimationFrame(D);
|
|
1831
1840
|
},
|
|
1832
1841
|
[t]
|
|
1833
|
-
),
|
|
1834
|
-
if (
|
|
1835
|
-
const
|
|
1836
|
-
|
|
1837
|
-
const
|
|
1838
|
-
if (
|
|
1839
|
-
|
|
1842
|
+
), B = O((h) => {
|
|
1843
|
+
if (!$.current) return;
|
|
1844
|
+
const D = h.clientX - P.current.x, w = h.clientY - P.current.y;
|
|
1845
|
+
F.current = { x: D, y: w };
|
|
1846
|
+
const R = Math.sqrt(D * D + w * w);
|
|
1847
|
+
if (R < tt)
|
|
1848
|
+
f({ x: 0, y: 0 });
|
|
1840
1849
|
else {
|
|
1841
|
-
const
|
|
1842
|
-
|
|
1843
|
-
x:
|
|
1844
|
-
y:
|
|
1850
|
+
const Z = Math.min(R, $e) / $e * vn;
|
|
1851
|
+
f({
|
|
1852
|
+
x: D / R * Z,
|
|
1853
|
+
y: w / R * Z
|
|
1845
1854
|
});
|
|
1846
1855
|
}
|
|
1847
|
-
}, []),
|
|
1848
|
-
(
|
|
1849
|
-
switch (
|
|
1856
|
+
}, []), d = O(
|
|
1857
|
+
(h) => {
|
|
1858
|
+
switch (h.key) {
|
|
1850
1859
|
case "ArrowUp":
|
|
1851
|
-
|
|
1860
|
+
h.preventDefault(), _();
|
|
1852
1861
|
break;
|
|
1853
1862
|
case "ArrowDown":
|
|
1854
|
-
|
|
1863
|
+
h.preventDefault(), M();
|
|
1855
1864
|
break;
|
|
1856
1865
|
case "ArrowLeft":
|
|
1857
|
-
|
|
1866
|
+
h.preventDefault(), G();
|
|
1858
1867
|
break;
|
|
1859
1868
|
case "ArrowRight":
|
|
1860
|
-
|
|
1869
|
+
h.preventDefault(), H();
|
|
1861
1870
|
break;
|
|
1862
1871
|
}
|
|
1863
1872
|
},
|
|
1864
|
-
[
|
|
1873
|
+
[_, M, G, H]
|
|
1865
1874
|
);
|
|
1866
|
-
|
|
1875
|
+
if (!v) return null;
|
|
1876
|
+
const N = n ? n.toLocaleDateString(void 0, {
|
|
1877
|
+
weekday: "short",
|
|
1878
|
+
month: "short",
|
|
1879
|
+
day: "numeric"
|
|
1880
|
+
}) : null;
|
|
1881
|
+
return /* @__PURE__ */ r(
|
|
1867
1882
|
"div",
|
|
1868
1883
|
{
|
|
1869
|
-
ref:
|
|
1870
|
-
className: `inno-scroll-nav ${
|
|
1884
|
+
ref: C,
|
|
1885
|
+
className: `inno-scroll-nav-wrapper ${s ?? ""}`,
|
|
1871
1886
|
role: "toolbar",
|
|
1872
1887
|
"aria-label": "Scroll navigation",
|
|
1873
|
-
onKeyDown:
|
|
1888
|
+
onKeyDown: d,
|
|
1874
1889
|
children: [
|
|
1875
|
-
/* @__PURE__ */ e(
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1890
|
+
N && /* @__PURE__ */ e("div", { className: "inno-scroll-nav-date", "aria-live": "polite", children: N }),
|
|
1891
|
+
/* @__PURE__ */ r("div", { className: "inno-scroll-nav", children: [
|
|
1892
|
+
/* @__PURE__ */ e(
|
|
1893
|
+
"button",
|
|
1894
|
+
{
|
|
1895
|
+
type: "button",
|
|
1896
|
+
className: `inno-scroll-nav-btn inno-scroll-nav-up ${o.canUp ? "" : "inno-scroll-nav-btn-disabled"}`,
|
|
1897
|
+
"aria-label": "Scroll up",
|
|
1898
|
+
disabled: !o.canUp,
|
|
1899
|
+
onPointerDown: () => V(_),
|
|
1900
|
+
onPointerUp: L,
|
|
1901
|
+
onPointerLeave: L,
|
|
1902
|
+
tabIndex: o.canUp ? 0 : -1,
|
|
1903
|
+
children: /* @__PURE__ */ e(bn, {})
|
|
1904
|
+
}
|
|
1905
|
+
),
|
|
1906
|
+
/* @__PURE__ */ e(
|
|
1907
|
+
"button",
|
|
1908
|
+
{
|
|
1909
|
+
type: "button",
|
|
1910
|
+
className: `inno-scroll-nav-btn inno-scroll-nav-left ${o.canLeft ? "" : "inno-scroll-nav-btn-disabled"}`,
|
|
1911
|
+
"aria-label": "Scroll left",
|
|
1912
|
+
disabled: !o.canLeft,
|
|
1913
|
+
onPointerDown: () => V(G),
|
|
1914
|
+
onPointerUp: L,
|
|
1915
|
+
onPointerLeave: L,
|
|
1916
|
+
tabIndex: o.canLeft ? 0 : -1,
|
|
1917
|
+
children: /* @__PURE__ */ e(kn, {})
|
|
1918
|
+
}
|
|
1919
|
+
),
|
|
1920
|
+
/* @__PURE__ */ e(
|
|
1921
|
+
"button",
|
|
1922
|
+
{
|
|
1923
|
+
ref: A,
|
|
1924
|
+
type: "button",
|
|
1925
|
+
className: `inno-scroll-nav-joystick ${m ? "inno-scroll-nav-joystick-active" : ""}`,
|
|
1926
|
+
"aria-label": "Drag to scroll freely",
|
|
1927
|
+
onPointerDown: Q,
|
|
1928
|
+
onPointerMove: B,
|
|
1929
|
+
onPointerUp: X,
|
|
1930
|
+
onPointerCancel: X,
|
|
1931
|
+
tabIndex: 0,
|
|
1932
|
+
children: /* @__PURE__ */ e(
|
|
1933
|
+
"span",
|
|
1934
|
+
{
|
|
1935
|
+
className: "inno-scroll-nav-joystick-dot",
|
|
1936
|
+
style: {
|
|
1937
|
+
transform: `translate(${a.x}px, ${a.y}px)`
|
|
1938
|
+
}
|
|
1921
1939
|
}
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
)
|
|
1940
|
+
)
|
|
1941
|
+
}
|
|
1942
|
+
),
|
|
1943
|
+
/* @__PURE__ */ e(
|
|
1944
|
+
"button",
|
|
1945
|
+
{
|
|
1946
|
+
type: "button",
|
|
1947
|
+
className: `inno-scroll-nav-btn inno-scroll-nav-right ${o.canRight ? "" : "inno-scroll-nav-btn-disabled"}`,
|
|
1948
|
+
"aria-label": "Scroll right",
|
|
1949
|
+
disabled: !o.canRight,
|
|
1950
|
+
onPointerDown: () => V(H),
|
|
1951
|
+
onPointerUp: L,
|
|
1952
|
+
onPointerLeave: L,
|
|
1953
|
+
tabIndex: o.canRight ? 0 : -1,
|
|
1954
|
+
children: /* @__PURE__ */ e(Nn, {})
|
|
1955
|
+
}
|
|
1956
|
+
),
|
|
1957
|
+
/* @__PURE__ */ e(
|
|
1958
|
+
"button",
|
|
1959
|
+
{
|
|
1960
|
+
type: "button",
|
|
1961
|
+
className: `inno-scroll-nav-btn inno-scroll-nav-down ${o.canDown ? "" : "inno-scroll-nav-btn-disabled"}`,
|
|
1962
|
+
"aria-label": "Scroll down",
|
|
1963
|
+
disabled: !o.canDown,
|
|
1964
|
+
onPointerDown: () => V(M),
|
|
1965
|
+
onPointerUp: L,
|
|
1966
|
+
onPointerLeave: L,
|
|
1967
|
+
tabIndex: o.canDown ? 0 : -1,
|
|
1968
|
+
children: /* @__PURE__ */ e(yn, {})
|
|
1969
|
+
}
|
|
1970
|
+
)
|
|
1971
|
+
] })
|
|
1954
1972
|
]
|
|
1955
1973
|
}
|
|
1956
|
-
)
|
|
1974
|
+
);
|
|
1957
1975
|
}
|
|
1958
1976
|
function Dn(t) {
|
|
1959
1977
|
switch (t) {
|
|
@@ -1967,67 +1985,67 @@ function Dn(t) {
|
|
|
1967
1985
|
function Mn({
|
|
1968
1986
|
onEventClick: t,
|
|
1969
1987
|
onSlotClick: n,
|
|
1970
|
-
onSlotSelect:
|
|
1971
|
-
onAddEvent:
|
|
1988
|
+
onSlotSelect: s,
|
|
1989
|
+
onAddEvent: o,
|
|
1972
1990
|
className: i,
|
|
1973
|
-
showHeader:
|
|
1974
|
-
minSelectionMinutes:
|
|
1975
|
-
showMoreMode:
|
|
1976
|
-
showMoreEventsInPopover:
|
|
1991
|
+
showHeader: a = !0,
|
|
1992
|
+
minSelectionMinutes: f = 30,
|
|
1993
|
+
showMoreMode: m,
|
|
1994
|
+
showMoreEventsInPopover: c = !1,
|
|
1977
1995
|
isLoading: v = !1,
|
|
1978
|
-
slots:
|
|
1979
|
-
classNames:
|
|
1996
|
+
slots: y,
|
|
1997
|
+
classNames: b,
|
|
1980
1998
|
settingsContent: A,
|
|
1981
1999
|
filterContent: $,
|
|
1982
2000
|
headerActions: P,
|
|
1983
|
-
renderPopover:
|
|
2001
|
+
renderPopover: F,
|
|
1984
2002
|
calendarRef: T,
|
|
1985
|
-
headerConfig:
|
|
1986
|
-
eventDetailMode:
|
|
1987
|
-
renderEventDetail:
|
|
2003
|
+
headerConfig: C,
|
|
2004
|
+
eventDetailMode: j,
|
|
2005
|
+
renderEventDetail: W
|
|
1988
2006
|
}) {
|
|
1989
|
-
const _ =
|
|
1990
|
-
view:
|
|
1991
|
-
setView:
|
|
1992
|
-
selectedDate:
|
|
1993
|
-
setSelectedDate:
|
|
2007
|
+
const _ = m ?? (c ? "popover" : "expand"), {
|
|
2008
|
+
view: M,
|
|
2009
|
+
setView: G,
|
|
2010
|
+
selectedDate: H,
|
|
2011
|
+
setSelectedDate: L,
|
|
1994
2012
|
slotDuration: V,
|
|
1995
|
-
filteredEvents:
|
|
1996
|
-
users:
|
|
2013
|
+
filteredEvents: X,
|
|
2014
|
+
users: Q,
|
|
1997
2015
|
visibleHours: B,
|
|
1998
|
-
workingHours:
|
|
1999
|
-
badgeVariant:
|
|
2000
|
-
showWorkingHoursOnly:
|
|
2001
|
-
clearFocusEventId:
|
|
2002
|
-
} = zt(),
|
|
2003
|
-
if (!
|
|
2016
|
+
workingHours: d,
|
|
2017
|
+
badgeVariant: N,
|
|
2018
|
+
showWorkingHoursOnly: h,
|
|
2019
|
+
clearFocusEventId: D
|
|
2020
|
+
} = zt(), w = te(() => {
|
|
2021
|
+
if (!h || !d)
|
|
2004
2022
|
return {
|
|
2005
2023
|
startHour: B.start,
|
|
2006
2024
|
endHour: B.end
|
|
2007
2025
|
};
|
|
2008
|
-
let
|
|
2009
|
-
for (const U of Object.keys(
|
|
2010
|
-
const re =
|
|
2011
|
-
!re || re.enabled === !1 || (re.from <
|
|
2026
|
+
let g = 24, E = 0;
|
|
2027
|
+
for (const U of Object.keys(d)) {
|
|
2028
|
+
const re = d[Number(U)];
|
|
2029
|
+
!re || re.enabled === !1 || (re.from < g && (g = re.from), re.to > E && (E = re.to));
|
|
2012
2030
|
}
|
|
2013
|
-
return
|
|
2031
|
+
return g >= E ? {
|
|
2014
2032
|
startHour: B.start,
|
|
2015
2033
|
endHour: B.end
|
|
2016
|
-
} : { startHour:
|
|
2017
|
-
}, [
|
|
2034
|
+
} : { startHour: g, endHour: E };
|
|
2035
|
+
}, [h, d, B]), R = w, K = ae(null);
|
|
2018
2036
|
wt(
|
|
2019
2037
|
T,
|
|
2020
2038
|
() => ({
|
|
2021
2039
|
scrollToToday: () => {
|
|
2022
|
-
const
|
|
2023
|
-
|
|
2040
|
+
const g = /* @__PURE__ */ new Date();
|
|
2041
|
+
L(g, M), requestAnimationFrame(() => {
|
|
2024
2042
|
requestAnimationFrame(() => {
|
|
2025
|
-
const
|
|
2043
|
+
const E = K.current?.querySelector(
|
|
2026
2044
|
".ic-timeline-scroll-container, [class*='overflow-auto']"
|
|
2027
2045
|
);
|
|
2028
|
-
if (!
|
|
2029
|
-
const De = (
|
|
2030
|
-
De > 0 &&
|
|
2046
|
+
if (!E) return;
|
|
2047
|
+
const De = (g.getHours() - w.startHour) * 96;
|
|
2048
|
+
De > 0 && E.scrollTo({
|
|
2031
2049
|
top: Math.max(0, De - 100),
|
|
2032
2050
|
// Offset to show some context
|
|
2033
2051
|
behavior: "smooth"
|
|
@@ -2036,149 +2054,149 @@ function Mn({
|
|
|
2036
2054
|
});
|
|
2037
2055
|
},
|
|
2038
2056
|
scrollToWorkingHours: () => {
|
|
2039
|
-
let
|
|
2040
|
-
if (
|
|
2041
|
-
for (const
|
|
2042
|
-
const U =
|
|
2043
|
-
U?.enabled && U.from <
|
|
2057
|
+
let g = 8;
|
|
2058
|
+
if (d)
|
|
2059
|
+
for (const E of Object.keys(d)) {
|
|
2060
|
+
const U = d[Number(E)];
|
|
2061
|
+
U?.enabled && U.from < g && (g = Math.max(U.from - 1, 0));
|
|
2044
2062
|
}
|
|
2045
2063
|
requestAnimationFrame(() => {
|
|
2046
2064
|
requestAnimationFrame(() => {
|
|
2047
|
-
const
|
|
2065
|
+
const E = K.current?.querySelector(
|
|
2048
2066
|
".ic-timeline-scroll-container, [class*='overflow-auto']"
|
|
2049
2067
|
);
|
|
2050
|
-
if (!
|
|
2051
|
-
const re = (
|
|
2052
|
-
|
|
2068
|
+
if (!E) return;
|
|
2069
|
+
const re = (g - w.startHour) * 96;
|
|
2070
|
+
E.scrollTo({
|
|
2053
2071
|
top: Math.max(0, re),
|
|
2054
2072
|
behavior: "smooth"
|
|
2055
2073
|
});
|
|
2056
2074
|
});
|
|
2057
2075
|
});
|
|
2058
2076
|
},
|
|
2059
|
-
getViewRect: () =>
|
|
2060
|
-
focusEvent: (
|
|
2061
|
-
|
|
2062
|
-
|
|
2077
|
+
getViewRect: () => K.current?.getBoundingClientRect() ?? null,
|
|
2078
|
+
focusEvent: (g) => {
|
|
2079
|
+
D(), requestAnimationFrame(() => {
|
|
2080
|
+
D();
|
|
2063
2081
|
});
|
|
2064
|
-
const
|
|
2065
|
-
`[data-event-id="${
|
|
2082
|
+
const E = K.current?.querySelector(
|
|
2083
|
+
`[data-event-id="${g}"]`
|
|
2066
2084
|
);
|
|
2067
|
-
|
|
2085
|
+
E && setTimeout(() => E.click(), 150);
|
|
2068
2086
|
}
|
|
2069
2087
|
}),
|
|
2070
2088
|
[
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2089
|
+
L,
|
|
2090
|
+
M,
|
|
2091
|
+
w,
|
|
2092
|
+
d,
|
|
2093
|
+
D
|
|
2076
2094
|
]
|
|
2077
2095
|
);
|
|
2078
|
-
const
|
|
2079
|
-
(
|
|
2080
|
-
if (
|
|
2081
|
-
|
|
2096
|
+
const Z = te(() => Dn(M), [M]), Y = O(
|
|
2097
|
+
(g) => {
|
|
2098
|
+
if (s) {
|
|
2099
|
+
s(g);
|
|
2082
2100
|
return;
|
|
2083
2101
|
}
|
|
2084
2102
|
if (n) {
|
|
2085
|
-
const
|
|
2086
|
-
n(
|
|
2103
|
+
const E = g.startDate.getHours();
|
|
2104
|
+
n(g.startDate, E);
|
|
2087
2105
|
}
|
|
2088
2106
|
},
|
|
2089
|
-
[
|
|
2090
|
-
),
|
|
2091
|
-
(
|
|
2092
|
-
|
|
2107
|
+
[s, n]
|
|
2108
|
+
), J = O(
|
|
2109
|
+
(g) => {
|
|
2110
|
+
G("day"), L(g, "day");
|
|
2093
2111
|
},
|
|
2094
|
-
[
|
|
2095
|
-
),
|
|
2096
|
-
(
|
|
2097
|
-
|
|
2112
|
+
[L, G]
|
|
2113
|
+
), ue = O(
|
|
2114
|
+
(g) => {
|
|
2115
|
+
G("month"), L(g, "month");
|
|
2098
2116
|
},
|
|
2099
|
-
[
|
|
2100
|
-
),
|
|
2101
|
-
(
|
|
2102
|
-
t?.(
|
|
2117
|
+
[L, G]
|
|
2118
|
+
), se = O(
|
|
2119
|
+
(g) => {
|
|
2120
|
+
t?.(g);
|
|
2103
2121
|
},
|
|
2104
2122
|
[t]
|
|
2105
|
-
), le =
|
|
2106
|
-
(
|
|
2107
|
-
n?.(
|
|
2123
|
+
), le = O(
|
|
2124
|
+
(g, E, U) => {
|
|
2125
|
+
n?.(g, E);
|
|
2108
2126
|
},
|
|
2109
2127
|
[n]
|
|
2110
|
-
),
|
|
2111
|
-
const
|
|
2112
|
-
switch (
|
|
2128
|
+
), we = () => {
|
|
2129
|
+
const g = X, E = se, U = F;
|
|
2130
|
+
switch (M) {
|
|
2113
2131
|
case "day":
|
|
2114
2132
|
return /* @__PURE__ */ e(
|
|
2115
2133
|
St,
|
|
2116
2134
|
{
|
|
2117
|
-
events:
|
|
2118
|
-
date:
|
|
2119
|
-
visibleHours:
|
|
2120
|
-
workingHours:
|
|
2135
|
+
events: g,
|
|
2136
|
+
date: H,
|
|
2137
|
+
visibleHours: R,
|
|
2138
|
+
workingHours: d,
|
|
2121
2139
|
slotDuration: V,
|
|
2122
|
-
badgeVariant:
|
|
2123
|
-
onEventClick:
|
|
2140
|
+
badgeVariant: N,
|
|
2141
|
+
onEventClick: E,
|
|
2124
2142
|
renderPopover: U,
|
|
2125
|
-
...
|
|
2126
|
-
...
|
|
2143
|
+
...y && { slots: y },
|
|
2144
|
+
...b && { classNames: b }
|
|
2127
2145
|
}
|
|
2128
2146
|
);
|
|
2129
2147
|
case "week":
|
|
2130
2148
|
return /* @__PURE__ */ e(
|
|
2131
2149
|
Mt,
|
|
2132
2150
|
{
|
|
2133
|
-
events:
|
|
2134
|
-
date:
|
|
2135
|
-
visibleHours:
|
|
2136
|
-
workingHours:
|
|
2151
|
+
events: g,
|
|
2152
|
+
date: H,
|
|
2153
|
+
visibleHours: R,
|
|
2154
|
+
workingHours: d,
|
|
2137
2155
|
slotDuration: V,
|
|
2138
|
-
badgeVariant:
|
|
2139
|
-
onEventClick:
|
|
2156
|
+
badgeVariant: N,
|
|
2157
|
+
onEventClick: E,
|
|
2140
2158
|
renderPopover: U,
|
|
2141
|
-
...
|
|
2142
|
-
...
|
|
2159
|
+
...y && { slots: y },
|
|
2160
|
+
...b && { classNames: b }
|
|
2143
2161
|
}
|
|
2144
2162
|
);
|
|
2145
2163
|
case "month":
|
|
2146
2164
|
return /* @__PURE__ */ e(
|
|
2147
2165
|
Ve,
|
|
2148
2166
|
{
|
|
2149
|
-
events:
|
|
2150
|
-
date:
|
|
2151
|
-
badgeVariant:
|
|
2152
|
-
onEventClick:
|
|
2153
|
-
onDayClick:
|
|
2167
|
+
events: g,
|
|
2168
|
+
date: H,
|
|
2169
|
+
badgeVariant: N,
|
|
2170
|
+
onEventClick: E,
|
|
2171
|
+
onDayClick: J,
|
|
2154
2172
|
renderPopover: U,
|
|
2155
2173
|
showMoreMode: _,
|
|
2156
|
-
...
|
|
2157
|
-
...
|
|
2174
|
+
...y && { slots: y },
|
|
2175
|
+
...b && { classNames: b }
|
|
2158
2176
|
}
|
|
2159
2177
|
);
|
|
2160
2178
|
case "year":
|
|
2161
2179
|
return /* @__PURE__ */ e(
|
|
2162
2180
|
gn,
|
|
2163
2181
|
{
|
|
2164
|
-
events:
|
|
2165
|
-
year:
|
|
2166
|
-
onMonthClick:
|
|
2167
|
-
onDayClick:
|
|
2168
|
-
...
|
|
2169
|
-
...
|
|
2182
|
+
events: g,
|
|
2183
|
+
year: H.getFullYear(),
|
|
2184
|
+
onMonthClick: ue,
|
|
2185
|
+
onDayClick: J,
|
|
2186
|
+
...y && { slots: y },
|
|
2187
|
+
...b && { classNames: b }
|
|
2170
2188
|
}
|
|
2171
2189
|
);
|
|
2172
2190
|
case "agenda":
|
|
2173
2191
|
return /* @__PURE__ */ e(
|
|
2174
2192
|
Dt,
|
|
2175
2193
|
{
|
|
2176
|
-
events:
|
|
2177
|
-
date:
|
|
2178
|
-
onEventClick:
|
|
2194
|
+
events: g,
|
|
2195
|
+
date: H,
|
|
2196
|
+
onEventClick: E,
|
|
2179
2197
|
renderPopover: U,
|
|
2180
|
-
...
|
|
2181
|
-
...
|
|
2198
|
+
...y && { slots: y },
|
|
2199
|
+
...b && { classNames: b }
|
|
2182
2200
|
}
|
|
2183
2201
|
);
|
|
2184
2202
|
// Resource views — delegate to TimelineView with matching day count
|
|
@@ -2187,19 +2205,19 @@ function Mn({
|
|
|
2187
2205
|
Le,
|
|
2188
2206
|
{
|
|
2189
2207
|
daysToShow: 1,
|
|
2190
|
-
events:
|
|
2191
|
-
users:
|
|
2192
|
-
selectedDate:
|
|
2208
|
+
events: g,
|
|
2209
|
+
users: Q,
|
|
2210
|
+
selectedDate: H,
|
|
2193
2211
|
visibleHours: {
|
|
2194
|
-
from:
|
|
2195
|
-
to:
|
|
2212
|
+
from: w.startHour,
|
|
2213
|
+
to: w.endHour
|
|
2196
2214
|
},
|
|
2197
|
-
onEventClick:
|
|
2198
|
-
onSlotSelect:
|
|
2215
|
+
onEventClick: E,
|
|
2216
|
+
onSlotSelect: Y,
|
|
2199
2217
|
onSlotClick: le,
|
|
2200
2218
|
renderPopover: U,
|
|
2201
|
-
...
|
|
2202
|
-
...
|
|
2219
|
+
...y && { slots: y },
|
|
2220
|
+
...b && { classNames: b }
|
|
2203
2221
|
}
|
|
2204
2222
|
);
|
|
2205
2223
|
case "resource-week":
|
|
@@ -2207,19 +2225,19 @@ function Mn({
|
|
|
2207
2225
|
Le,
|
|
2208
2226
|
{
|
|
2209
2227
|
daysToShow: 7,
|
|
2210
|
-
events:
|
|
2211
|
-
users:
|
|
2212
|
-
selectedDate:
|
|
2228
|
+
events: g,
|
|
2229
|
+
users: Q,
|
|
2230
|
+
selectedDate: H,
|
|
2213
2231
|
visibleHours: {
|
|
2214
|
-
from:
|
|
2215
|
-
to:
|
|
2232
|
+
from: w.startHour,
|
|
2233
|
+
to: w.endHour
|
|
2216
2234
|
},
|
|
2217
|
-
onEventClick:
|
|
2218
|
-
onSlotSelect:
|
|
2235
|
+
onEventClick: E,
|
|
2236
|
+
onSlotSelect: Y,
|
|
2219
2237
|
onSlotClick: le,
|
|
2220
2238
|
renderPopover: U,
|
|
2221
|
-
...
|
|
2222
|
-
...
|
|
2239
|
+
...y && { slots: y },
|
|
2240
|
+
...b && { classNames: b }
|
|
2223
2241
|
}
|
|
2224
2242
|
);
|
|
2225
2243
|
// Timeline views
|
|
@@ -2228,19 +2246,19 @@ function Mn({
|
|
|
2228
2246
|
Le,
|
|
2229
2247
|
{
|
|
2230
2248
|
daysToShow: 1,
|
|
2231
|
-
events:
|
|
2232
|
-
users:
|
|
2233
|
-
selectedDate:
|
|
2249
|
+
events: g,
|
|
2250
|
+
users: Q,
|
|
2251
|
+
selectedDate: H,
|
|
2234
2252
|
visibleHours: {
|
|
2235
|
-
from:
|
|
2236
|
-
to:
|
|
2253
|
+
from: w.startHour,
|
|
2254
|
+
to: w.endHour
|
|
2237
2255
|
},
|
|
2238
|
-
onEventClick:
|
|
2239
|
-
onSlotSelect:
|
|
2256
|
+
onEventClick: E,
|
|
2257
|
+
onSlotSelect: Y,
|
|
2240
2258
|
onSlotClick: le,
|
|
2241
2259
|
renderPopover: U,
|
|
2242
|
-
...
|
|
2243
|
-
...
|
|
2260
|
+
...y && { slots: y },
|
|
2261
|
+
...b && { classNames: b }
|
|
2244
2262
|
}
|
|
2245
2263
|
);
|
|
2246
2264
|
case "timeline-3day":
|
|
@@ -2248,19 +2266,19 @@ function Mn({
|
|
|
2248
2266
|
Le,
|
|
2249
2267
|
{
|
|
2250
2268
|
daysToShow: 3,
|
|
2251
|
-
events:
|
|
2252
|
-
users:
|
|
2253
|
-
selectedDate:
|
|
2269
|
+
events: g,
|
|
2270
|
+
users: Q,
|
|
2271
|
+
selectedDate: H,
|
|
2254
2272
|
visibleHours: {
|
|
2255
|
-
from:
|
|
2256
|
-
to:
|
|
2273
|
+
from: w.startHour,
|
|
2274
|
+
to: w.endHour
|
|
2257
2275
|
},
|
|
2258
|
-
onEventClick:
|
|
2259
|
-
onSlotSelect:
|
|
2276
|
+
onEventClick: E,
|
|
2277
|
+
onSlotSelect: Y,
|
|
2260
2278
|
onSlotClick: le,
|
|
2261
2279
|
renderPopover: U,
|
|
2262
|
-
...
|
|
2263
|
-
...
|
|
2280
|
+
...y && { slots: y },
|
|
2281
|
+
...b && { classNames: b }
|
|
2264
2282
|
}
|
|
2265
2283
|
);
|
|
2266
2284
|
case "timeline-week":
|
|
@@ -2268,70 +2286,70 @@ function Mn({
|
|
|
2268
2286
|
Le,
|
|
2269
2287
|
{
|
|
2270
2288
|
daysToShow: 7,
|
|
2271
|
-
events:
|
|
2272
|
-
users:
|
|
2273
|
-
selectedDate:
|
|
2289
|
+
events: g,
|
|
2290
|
+
users: Q,
|
|
2291
|
+
selectedDate: H,
|
|
2274
2292
|
visibleHours: {
|
|
2275
|
-
from:
|
|
2276
|
-
to:
|
|
2293
|
+
from: w.startHour,
|
|
2294
|
+
to: w.endHour
|
|
2277
2295
|
},
|
|
2278
|
-
onEventClick:
|
|
2279
|
-
onSlotSelect:
|
|
2296
|
+
onEventClick: E,
|
|
2297
|
+
onSlotSelect: Y,
|
|
2280
2298
|
onSlotClick: le,
|
|
2281
2299
|
renderPopover: U,
|
|
2282
|
-
...
|
|
2283
|
-
...
|
|
2300
|
+
...y && { slots: y },
|
|
2301
|
+
...b && { classNames: b }
|
|
2284
2302
|
}
|
|
2285
2303
|
);
|
|
2286
2304
|
default:
|
|
2287
2305
|
return /* @__PURE__ */ e(
|
|
2288
2306
|
Ve,
|
|
2289
2307
|
{
|
|
2290
|
-
events:
|
|
2291
|
-
date:
|
|
2292
|
-
badgeVariant:
|
|
2293
|
-
onEventClick:
|
|
2294
|
-
onDayClick:
|
|
2295
|
-
...
|
|
2296
|
-
...
|
|
2308
|
+
events: g,
|
|
2309
|
+
date: H,
|
|
2310
|
+
badgeVariant: N,
|
|
2311
|
+
onEventClick: E,
|
|
2312
|
+
onDayClick: J,
|
|
2313
|
+
...y && { slots: y },
|
|
2314
|
+
...b && { classNames: b }
|
|
2297
2315
|
}
|
|
2298
2316
|
);
|
|
2299
2317
|
}
|
|
2300
|
-
},
|
|
2318
|
+
}, he = ae(null);
|
|
2301
2319
|
return de(() => {
|
|
2302
|
-
|
|
2320
|
+
K.current = he.current;
|
|
2303
2321
|
}), /* @__PURE__ */ e(
|
|
2304
2322
|
It,
|
|
2305
2323
|
{
|
|
2306
|
-
mode:
|
|
2307
|
-
onSelect:
|
|
2308
|
-
minDurationMinutes:
|
|
2324
|
+
mode: Z,
|
|
2325
|
+
onSelect: Y,
|
|
2326
|
+
minDurationMinutes: f,
|
|
2309
2327
|
slotDurationMinutes: V,
|
|
2310
|
-
enabled: !!(
|
|
2328
|
+
enabled: !!(s || n),
|
|
2311
2329
|
children: /* @__PURE__ */ r(
|
|
2312
2330
|
"div",
|
|
2313
2331
|
{
|
|
2314
|
-
className:
|
|
2332
|
+
className: p(
|
|
2315
2333
|
"inno-calendar-root flex flex-col h-full p-4",
|
|
2316
|
-
|
|
2334
|
+
b?.root,
|
|
2317
2335
|
i
|
|
2318
2336
|
),
|
|
2319
2337
|
children: [
|
|
2320
|
-
|
|
2338
|
+
a && /* @__PURE__ */ e(
|
|
2321
2339
|
Ct,
|
|
2322
2340
|
{
|
|
2323
|
-
currentDate:
|
|
2324
|
-
view:
|
|
2325
|
-
events:
|
|
2326
|
-
onViewChange:
|
|
2327
|
-
onNavigateToday: () =>
|
|
2341
|
+
currentDate: H,
|
|
2342
|
+
view: M,
|
|
2343
|
+
events: X,
|
|
2344
|
+
onViewChange: G,
|
|
2345
|
+
onNavigateToday: () => L(/* @__PURE__ */ new Date(), M),
|
|
2328
2346
|
onNavigatePrev: () => {
|
|
2329
|
-
const
|
|
2330
|
-
|
|
2347
|
+
const g = new Date(H);
|
|
2348
|
+
M === "day" || M === "timeline-day" || M === "resource-day" ? g.setDate(g.getDate() - 1) : M === "timeline-3day" ? g.setDate(g.getDate() - 3) : M === "week" || M === "timeline-week" || M === "resource-week" ? g.setDate(g.getDate() - 7) : M === "month" ? g.setMonth(g.getMonth() - 1) : M === "year" ? g.setFullYear(g.getFullYear() - 1) : g.setDate(g.getDate() - 7), L(g, M);
|
|
2331
2349
|
},
|
|
2332
2350
|
onNavigateNext: () => {
|
|
2333
|
-
const
|
|
2334
|
-
|
|
2351
|
+
const g = new Date(H);
|
|
2352
|
+
M === "day" || M === "timeline-day" || M === "resource-day" ? g.setDate(g.getDate() + 1) : M === "timeline-3day" ? g.setDate(g.getDate() + 3) : M === "week" || M === "timeline-week" || M === "resource-week" ? g.setDate(g.getDate() + 7) : M === "month" ? g.setMonth(g.getMonth() + 1) : M === "year" ? g.setFullYear(g.getFullYear() + 1) : g.setDate(g.getDate() + 7), L(g, M);
|
|
2335
2353
|
},
|
|
2336
2354
|
availableViews: [
|
|
2337
2355
|
"day",
|
|
@@ -2342,27 +2360,27 @@ function Mn({
|
|
|
2342
2360
|
],
|
|
2343
2361
|
showTimelineViews: !0,
|
|
2344
2362
|
showSettings: !!A,
|
|
2345
|
-
...!P &&
|
|
2363
|
+
...!P && o && { onAddEvent: o },
|
|
2346
2364
|
actions: P,
|
|
2347
2365
|
settingsContent: A,
|
|
2348
2366
|
filterContent: $,
|
|
2349
|
-
...
|
|
2367
|
+
...C && { headerConfig: C }
|
|
2350
2368
|
}
|
|
2351
2369
|
),
|
|
2352
2370
|
/* @__PURE__ */ r("div", { className: "relative flex-1 min-h-0", children: [
|
|
2353
2371
|
/* @__PURE__ */ e(
|
|
2354
2372
|
"div",
|
|
2355
2373
|
{
|
|
2356
|
-
ref:
|
|
2357
|
-
className:
|
|
2374
|
+
ref: he,
|
|
2375
|
+
className: p(
|
|
2358
2376
|
"h-full border rounded-lg bg-white overflow-x-auto",
|
|
2359
|
-
|
|
2377
|
+
b?.viewContainer
|
|
2360
2378
|
),
|
|
2361
|
-
children:
|
|
2379
|
+
children: we()
|
|
2362
2380
|
}
|
|
2363
2381
|
),
|
|
2364
2382
|
v && /* @__PURE__ */ e("div", { className: "inno-calendar-loading-overlay", children: /* @__PURE__ */ e("div", { className: "inno-calendar-spinner" }) }),
|
|
2365
|
-
/* @__PURE__ */ e(Cn, { containerRef:
|
|
2383
|
+
/* @__PURE__ */ e(Cn, { containerRef: he, currentDate: H })
|
|
2366
2384
|
] })
|
|
2367
2385
|
]
|
|
2368
2386
|
}
|
|
@@ -2373,90 +2391,90 @@ function Mn({
|
|
|
2373
2391
|
function Sn({
|
|
2374
2392
|
events: t,
|
|
2375
2393
|
users: n = [],
|
|
2376
|
-
scheduleTypes:
|
|
2377
|
-
initialView:
|
|
2394
|
+
scheduleTypes: s = [],
|
|
2395
|
+
initialView: o = "week",
|
|
2378
2396
|
initialDate: i,
|
|
2379
|
-
initialSelectedUserId:
|
|
2380
|
-
initialScheduleTypeIds:
|
|
2381
|
-
initialParticipantIds:
|
|
2382
|
-
initialWorkingHoursView:
|
|
2397
|
+
initialSelectedUserId: a,
|
|
2398
|
+
initialScheduleTypeIds: f,
|
|
2399
|
+
initialParticipantIds: m,
|
|
2400
|
+
initialWorkingHoursView: c,
|
|
2383
2401
|
initialSearchQuery: v,
|
|
2384
|
-
preferencesConfig:
|
|
2385
|
-
onEventClick:
|
|
2402
|
+
preferencesConfig: y,
|
|
2403
|
+
onEventClick: b,
|
|
2386
2404
|
onSlotClick: A,
|
|
2387
2405
|
onSlotSelect: $,
|
|
2388
2406
|
onAddEvent: P,
|
|
2389
|
-
onEventDrop:
|
|
2407
|
+
onEventDrop: F,
|
|
2390
2408
|
onDateChange: T,
|
|
2391
|
-
onViewChange:
|
|
2392
|
-
className:
|
|
2393
|
-
showHeader:
|
|
2409
|
+
onViewChange: C,
|
|
2410
|
+
className: j,
|
|
2411
|
+
showHeader: W = !0,
|
|
2394
2412
|
minSelectionMinutes: _ = 30,
|
|
2395
|
-
showMoreMode:
|
|
2396
|
-
showMoreEventsInPopover:
|
|
2397
|
-
isLoading:
|
|
2398
|
-
renderPopover:
|
|
2413
|
+
showMoreMode: M,
|
|
2414
|
+
showMoreEventsInPopover: G = !1,
|
|
2415
|
+
isLoading: H = !1,
|
|
2416
|
+
renderPopover: L,
|
|
2399
2417
|
slots: V,
|
|
2400
|
-
classNames:
|
|
2401
|
-
settingsContent:
|
|
2418
|
+
classNames: X,
|
|
2419
|
+
settingsContent: Q,
|
|
2402
2420
|
filterContent: B,
|
|
2403
|
-
headerActions:
|
|
2404
|
-
focusEventId:
|
|
2405
|
-
headerConfig:
|
|
2406
|
-
eventDetailMode:
|
|
2407
|
-
renderEventDetail:
|
|
2408
|
-
},
|
|
2409
|
-
return /* @__PURE__ */ e(Tt, { ...
|
|
2421
|
+
headerActions: d,
|
|
2422
|
+
focusEventId: N,
|
|
2423
|
+
headerConfig: h,
|
|
2424
|
+
eventDetailMode: D,
|
|
2425
|
+
renderEventDetail: w
|
|
2426
|
+
}, R) {
|
|
2427
|
+
return /* @__PURE__ */ e(Tt, { ...F && { onEventDrop: F }, children: /* @__PURE__ */ e(
|
|
2410
2428
|
Ht,
|
|
2411
2429
|
{
|
|
2412
2430
|
initialEvents: t,
|
|
2413
2431
|
initialUsers: n,
|
|
2414
|
-
initialScheduleTypes:
|
|
2415
|
-
initialView:
|
|
2432
|
+
initialScheduleTypes: s,
|
|
2433
|
+
initialView: o,
|
|
2416
2434
|
...i && { initialDate: i },
|
|
2417
|
-
...
|
|
2418
|
-
...
|
|
2419
|
-
...
|
|
2420
|
-
...
|
|
2435
|
+
...a && { initialSelectedUserId: a },
|
|
2436
|
+
...f && { initialScheduleTypeIds: f },
|
|
2437
|
+
...m && { initialParticipantIds: m },
|
|
2438
|
+
...c && { initialWorkingHoursView: c },
|
|
2421
2439
|
...v && { initialSearchQuery: v },
|
|
2422
|
-
...
|
|
2440
|
+
...y && { preferencesConfig: y },
|
|
2423
2441
|
...T && { onDateChange: T },
|
|
2424
|
-
...
|
|
2425
|
-
...
|
|
2442
|
+
...C && { onViewChange: C },
|
|
2443
|
+
...N && { initialFocusEventId: N },
|
|
2426
2444
|
children: /* @__PURE__ */ e(
|
|
2427
2445
|
Mn,
|
|
2428
2446
|
{
|
|
2429
|
-
...
|
|
2447
|
+
...b && { onEventClick: b },
|
|
2430
2448
|
...A && { onSlotClick: A },
|
|
2431
2449
|
...$ && { onSlotSelect: $ },
|
|
2432
2450
|
...P && { onAddEvent: P },
|
|
2433
|
-
...
|
|
2434
|
-
className:
|
|
2435
|
-
showHeader:
|
|
2451
|
+
...L && { renderPopover: L },
|
|
2452
|
+
className: j,
|
|
2453
|
+
showHeader: W,
|
|
2436
2454
|
minSelectionMinutes: _,
|
|
2437
|
-
...
|
|
2438
|
-
showMoreEventsInPopover:
|
|
2439
|
-
isLoading:
|
|
2455
|
+
...M && { showMoreMode: M },
|
|
2456
|
+
showMoreEventsInPopover: G,
|
|
2457
|
+
isLoading: H,
|
|
2440
2458
|
...V && { slots: V },
|
|
2441
|
-
...
|
|
2442
|
-
settingsContent:
|
|
2459
|
+
...X && { classNames: X },
|
|
2460
|
+
settingsContent: Q,
|
|
2443
2461
|
filterContent: B,
|
|
2444
|
-
headerActions:
|
|
2445
|
-
calendarRef:
|
|
2446
|
-
...
|
|
2447
|
-
...
|
|
2448
|
-
...
|
|
2462
|
+
headerActions: d,
|
|
2463
|
+
calendarRef: R,
|
|
2464
|
+
...h && { headerConfig: h },
|
|
2465
|
+
...D && { eventDetailMode: D },
|
|
2466
|
+
...w && { renderEventDetail: w }
|
|
2449
2467
|
}
|
|
2450
2468
|
)
|
|
2451
2469
|
}
|
|
2452
2470
|
) });
|
|
2453
2471
|
}
|
|
2454
|
-
const Cr = Ae(Sn),
|
|
2455
|
-
({ className: t, children: n, ...
|
|
2472
|
+
const Cr = Ae(Sn), ve = Ae(
|
|
2473
|
+
({ className: t, children: n, ...s }, o) => /* @__PURE__ */ e(
|
|
2456
2474
|
"select",
|
|
2457
2475
|
{
|
|
2458
|
-
ref:
|
|
2459
|
-
className:
|
|
2476
|
+
ref: o,
|
|
2477
|
+
className: p(
|
|
2460
2478
|
"flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm",
|
|
2461
2479
|
"ring-offset-background",
|
|
2462
2480
|
"focus:outline-none focus:ring-1 focus:ring-ring",
|
|
@@ -2464,24 +2482,24 @@ const Cr = Ae(Sn), xe = Ae(
|
|
|
2464
2482
|
"[&>option]:bg-background",
|
|
2465
2483
|
t
|
|
2466
2484
|
),
|
|
2467
|
-
...
|
|
2485
|
+
...s,
|
|
2468
2486
|
children: n
|
|
2469
2487
|
}
|
|
2470
2488
|
)
|
|
2471
2489
|
);
|
|
2472
|
-
|
|
2473
|
-
const
|
|
2490
|
+
ve.displayName = "Select";
|
|
2491
|
+
const me = Ae(({ className: t, ...n }, s) => /* @__PURE__ */ e(
|
|
2474
2492
|
"label",
|
|
2475
2493
|
{
|
|
2476
|
-
ref:
|
|
2477
|
-
className:
|
|
2494
|
+
ref: s,
|
|
2495
|
+
className: p(
|
|
2478
2496
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
2479
2497
|
t
|
|
2480
2498
|
),
|
|
2481
2499
|
...n
|
|
2482
2500
|
}
|
|
2483
2501
|
));
|
|
2484
|
-
|
|
2502
|
+
me.displayName = "Label";
|
|
2485
2503
|
function En({ className: t }) {
|
|
2486
2504
|
return /* @__PURE__ */ r(
|
|
2487
2505
|
"svg",
|
|
@@ -2533,37 +2551,37 @@ const Tn = [
|
|
|
2533
2551
|
function Dr({
|
|
2534
2552
|
value: t,
|
|
2535
2553
|
onChange: n,
|
|
2536
|
-
isLocked:
|
|
2537
|
-
className:
|
|
2554
|
+
isLocked: s = !1,
|
|
2555
|
+
className: o,
|
|
2538
2556
|
labels: i = {}
|
|
2539
2557
|
}) {
|
|
2540
|
-
const
|
|
2558
|
+
const a = {
|
|
2541
2559
|
title: "Slot duration",
|
|
2542
2560
|
lockedMessage: "This setting is locked by the administrator",
|
|
2543
2561
|
infoMessage: "Set the time slot duration for day and week calendar views.",
|
|
2544
2562
|
...i
|
|
2545
|
-
},
|
|
2546
|
-
|
|
2563
|
+
}, f = (m) => {
|
|
2564
|
+
s || n(Number(m.target.value));
|
|
2547
2565
|
};
|
|
2548
|
-
return /* @__PURE__ */ r("div", { className:
|
|
2566
|
+
return /* @__PURE__ */ r("div", { className: p("flex flex-col gap-3", o), children: [
|
|
2549
2567
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2550
|
-
/* @__PURE__ */ e(
|
|
2551
|
-
|
|
2552
|
-
/* @__PURE__ */ e(
|
|
2553
|
-
/* @__PURE__ */ e(
|
|
2554
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2555
|
-
/* @__PURE__ */ e(
|
|
2556
|
-
/* @__PURE__ */ e(
|
|
2568
|
+
/* @__PURE__ */ e(me, { className: "text-sm font-semibold", children: a.title }),
|
|
2569
|
+
s ? /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
2570
|
+
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(Ln, { className: "size-3 text-muted-foreground" }) }),
|
|
2571
|
+
/* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e("p", { children: a.lockedMessage }) })
|
|
2572
|
+
] }) }) : /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
2573
|
+
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(En, { className: "size-3 text-muted-foreground" }) }),
|
|
2574
|
+
/* @__PURE__ */ e(xe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: a.infoMessage }) })
|
|
2557
2575
|
] }) })
|
|
2558
2576
|
] }),
|
|
2559
2577
|
/* @__PURE__ */ e(
|
|
2560
|
-
|
|
2578
|
+
ve,
|
|
2561
2579
|
{
|
|
2562
2580
|
value: t.toString(),
|
|
2563
|
-
onChange:
|
|
2564
|
-
disabled:
|
|
2581
|
+
onChange: f,
|
|
2582
|
+
disabled: s,
|
|
2565
2583
|
className: "h-9 w-[128px] text-sm",
|
|
2566
|
-
children: Tn.map((
|
|
2584
|
+
children: Tn.map((m) => /* @__PURE__ */ e("option", { value: m.value.toString(), children: m.label }, m.value))
|
|
2567
2585
|
}
|
|
2568
2586
|
)
|
|
2569
2587
|
] });
|
|
@@ -2619,11 +2637,11 @@ const In = [
|
|
|
2619
2637
|
function Mr({
|
|
2620
2638
|
value: t,
|
|
2621
2639
|
onChange: n,
|
|
2622
|
-
isLocked:
|
|
2623
|
-
className:
|
|
2640
|
+
isLocked: s = !1,
|
|
2641
|
+
className: o,
|
|
2624
2642
|
labels: i = {}
|
|
2625
2643
|
}) {
|
|
2626
|
-
const
|
|
2644
|
+
const a = {
|
|
2627
2645
|
title: "Event display",
|
|
2628
2646
|
lockedMessage: "This setting is locked by the administrator",
|
|
2629
2647
|
infoMessage: "Choose how events are displayed. Dot shows a small indicator, colored fills the entire event, mixed uses both.",
|
|
@@ -2633,28 +2651,28 @@ function Mr({
|
|
|
2633
2651
|
mixed: "Mixed"
|
|
2634
2652
|
},
|
|
2635
2653
|
...i
|
|
2636
|
-
},
|
|
2637
|
-
|
|
2654
|
+
}, f = (c) => a.options?.[c] ?? c, m = (c) => {
|
|
2655
|
+
s || n(c.target.value);
|
|
2638
2656
|
};
|
|
2639
|
-
return /* @__PURE__ */ r("div", { className:
|
|
2657
|
+
return /* @__PURE__ */ r("div", { className: p("flex flex-col gap-3", o), children: [
|
|
2640
2658
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2641
|
-
/* @__PURE__ */ e(
|
|
2642
|
-
|
|
2643
|
-
/* @__PURE__ */ e(
|
|
2644
|
-
/* @__PURE__ */ e(
|
|
2645
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2646
|
-
/* @__PURE__ */ e(
|
|
2647
|
-
/* @__PURE__ */ e(
|
|
2659
|
+
/* @__PURE__ */ e(me, { className: "text-sm font-semibold", children: a.title }),
|
|
2660
|
+
s ? /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
2661
|
+
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(zn, { className: "size-3 text-muted-foreground" }) }),
|
|
2662
|
+
/* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e("p", { children: a.lockedMessage }) })
|
|
2663
|
+
] }) }) : /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
2664
|
+
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(Hn, { className: "size-3 text-muted-foreground" }) }),
|
|
2665
|
+
/* @__PURE__ */ e(xe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: a.infoMessage }) })
|
|
2648
2666
|
] }) })
|
|
2649
2667
|
] }),
|
|
2650
2668
|
/* @__PURE__ */ e(
|
|
2651
|
-
|
|
2669
|
+
ve,
|
|
2652
2670
|
{
|
|
2653
2671
|
value: t,
|
|
2654
|
-
onChange:
|
|
2655
|
-
disabled:
|
|
2672
|
+
onChange: m,
|
|
2673
|
+
disabled: s,
|
|
2656
2674
|
className: "h-9 w-[128px] text-sm",
|
|
2657
|
-
children: In.map((
|
|
2675
|
+
children: In.map((c) => /* @__PURE__ */ e("option", { value: c.value, children: f(c.value) }, c.value))
|
|
2658
2676
|
}
|
|
2659
2677
|
)
|
|
2660
2678
|
] });
|
|
@@ -2711,48 +2729,48 @@ function Pn() {
|
|
|
2711
2729
|
function Sr({
|
|
2712
2730
|
value: t,
|
|
2713
2731
|
onChange: n,
|
|
2714
|
-
isLocked:
|
|
2715
|
-
className:
|
|
2732
|
+
isLocked: s = !1,
|
|
2733
|
+
className: o,
|
|
2716
2734
|
labels: i = {}
|
|
2717
2735
|
}) {
|
|
2718
|
-
const
|
|
2736
|
+
const a = {
|
|
2719
2737
|
title: "Visible hours",
|
|
2720
2738
|
from: "From",
|
|
2721
2739
|
to: "To",
|
|
2722
2740
|
lockedMessage: "This setting is locked by the administrator",
|
|
2723
2741
|
infoMessage: "Set the visible hour range for day and week views. Hours outside this range will be hidden.",
|
|
2724
2742
|
...i
|
|
2725
|
-
},
|
|
2726
|
-
if (
|
|
2727
|
-
const
|
|
2728
|
-
|
|
2729
|
-
},
|
|
2730
|
-
if (
|
|
2731
|
-
const
|
|
2732
|
-
|
|
2743
|
+
}, f = Pn(), m = (v) => {
|
|
2744
|
+
if (s) return;
|
|
2745
|
+
const y = Number(v.target.value);
|
|
2746
|
+
y < t.endHour && n({ ...t, startHour: y });
|
|
2747
|
+
}, c = (v) => {
|
|
2748
|
+
if (s) return;
|
|
2749
|
+
const y = Number(v.target.value);
|
|
2750
|
+
y > t.startHour && n({ ...t, endHour: y });
|
|
2733
2751
|
};
|
|
2734
|
-
return /* @__PURE__ */ r("div", { className:
|
|
2752
|
+
return /* @__PURE__ */ r("div", { className: p("flex flex-col gap-3", o), children: [
|
|
2735
2753
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2736
|
-
/* @__PURE__ */ e(
|
|
2737
|
-
|
|
2738
|
-
/* @__PURE__ */ e(
|
|
2739
|
-
/* @__PURE__ */ e(
|
|
2740
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2741
|
-
/* @__PURE__ */ e(
|
|
2742
|
-
/* @__PURE__ */ e(
|
|
2754
|
+
/* @__PURE__ */ e(me, { className: "text-sm font-semibold", children: a.title }),
|
|
2755
|
+
s ? /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
2756
|
+
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(An, { className: "size-3 text-muted-foreground" }) }),
|
|
2757
|
+
/* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e("p", { children: a.lockedMessage }) })
|
|
2758
|
+
] }) }) : /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
2759
|
+
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(jn, { className: "size-3 text-muted-foreground" }) }),
|
|
2760
|
+
/* @__PURE__ */ e(xe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: a.infoMessage }) })
|
|
2743
2761
|
] }) })
|
|
2744
2762
|
] }),
|
|
2745
2763
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2746
2764
|
/* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
|
|
2747
|
-
/* @__PURE__ */ e(
|
|
2765
|
+
/* @__PURE__ */ e(me, { className: "text-xs text-muted-foreground", children: a.from }),
|
|
2748
2766
|
/* @__PURE__ */ e(
|
|
2749
|
-
|
|
2767
|
+
ve,
|
|
2750
2768
|
{
|
|
2751
2769
|
value: t.startHour.toString(),
|
|
2752
|
-
onChange:
|
|
2753
|
-
disabled:
|
|
2770
|
+
onChange: m,
|
|
2771
|
+
disabled: s,
|
|
2754
2772
|
className: "h-9 w-[88px] text-sm",
|
|
2755
|
-
children:
|
|
2773
|
+
children: f.map((v) => /* @__PURE__ */ e(
|
|
2756
2774
|
"option",
|
|
2757
2775
|
{
|
|
2758
2776
|
value: v.value.toString(),
|
|
@@ -2766,15 +2784,15 @@ function Sr({
|
|
|
2766
2784
|
] }),
|
|
2767
2785
|
/* @__PURE__ */ e("span", { className: "mt-5 text-muted-foreground", children: "—" }),
|
|
2768
2786
|
/* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
|
|
2769
|
-
/* @__PURE__ */ e(
|
|
2787
|
+
/* @__PURE__ */ e(me, { className: "text-xs text-muted-foreground", children: a.to }),
|
|
2770
2788
|
/* @__PURE__ */ e(
|
|
2771
|
-
|
|
2789
|
+
ve,
|
|
2772
2790
|
{
|
|
2773
2791
|
value: t.endHour.toString(),
|
|
2774
|
-
onChange:
|
|
2775
|
-
disabled:
|
|
2792
|
+
onChange: c,
|
|
2793
|
+
disabled: s,
|
|
2776
2794
|
className: "h-9 w-[88px] text-sm",
|
|
2777
|
-
children:
|
|
2795
|
+
children: f.map((v) => /* @__PURE__ */ e(
|
|
2778
2796
|
"option",
|
|
2779
2797
|
{
|
|
2780
2798
|
value: v.value.toString(),
|
|
@@ -2874,17 +2892,17 @@ const nt = {
|
|
|
2874
2892
|
friday: "Fri",
|
|
2875
2893
|
saturday: "Sat"
|
|
2876
2894
|
};
|
|
2877
|
-
function Bn({ dayLabel: t, config: n, onChange:
|
|
2878
|
-
const
|
|
2879
|
-
|
|
2880
|
-
},
|
|
2881
|
-
if (
|
|
2882
|
-
const v = Number(
|
|
2883
|
-
v < n.to &&
|
|
2884
|
-
},
|
|
2885
|
-
if (
|
|
2886
|
-
const v = Number(
|
|
2887
|
-
v > n.from &&
|
|
2895
|
+
function Bn({ dayLabel: t, config: n, onChange: s, disabled: o, hourOptions: i }) {
|
|
2896
|
+
const a = () => {
|
|
2897
|
+
o || s({ ...n, enabled: !n.enabled });
|
|
2898
|
+
}, f = (c) => {
|
|
2899
|
+
if (o) return;
|
|
2900
|
+
const v = Number(c.target.value);
|
|
2901
|
+
v < n.to && s({ ...n, from: v });
|
|
2902
|
+
}, m = (c) => {
|
|
2903
|
+
if (o) return;
|
|
2904
|
+
const v = Number(c.target.value);
|
|
2905
|
+
v > n.from && s({ ...n, to: v });
|
|
2888
2906
|
};
|
|
2889
2907
|
return /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2890
2908
|
/* @__PURE__ */ e(
|
|
@@ -2894,36 +2912,36 @@ function Bn({ dayLabel: t, config: n, onChange: o, disabled: a, hourOptions: i }
|
|
|
2894
2912
|
role: "checkbox",
|
|
2895
2913
|
"aria-checked": n.enabled,
|
|
2896
2914
|
"aria-label": `Enable ${t}`,
|
|
2897
|
-
onClick:
|
|
2898
|
-
disabled:
|
|
2899
|
-
className:
|
|
2915
|
+
onClick: a,
|
|
2916
|
+
disabled: o,
|
|
2917
|
+
className: p(
|
|
2900
2918
|
"flex size-5 shrink-0 items-center justify-center rounded border transition-colors",
|
|
2901
2919
|
n.enabled ? "border-primary bg-primary text-primary-foreground" : "border-input bg-background",
|
|
2902
|
-
|
|
2920
|
+
o && "cursor-not-allowed opacity-50"
|
|
2903
2921
|
),
|
|
2904
2922
|
children: n.enabled && /* @__PURE__ */ e($n, { className: "size-3" })
|
|
2905
2923
|
}
|
|
2906
2924
|
),
|
|
2907
|
-
/* @__PURE__ */ e("span", { className:
|
|
2925
|
+
/* @__PURE__ */ e("span", { className: p("w-10 text-sm", !n.enabled && "text-muted-foreground"), children: t }),
|
|
2908
2926
|
/* @__PURE__ */ e(
|
|
2909
|
-
|
|
2927
|
+
ve,
|
|
2910
2928
|
{
|
|
2911
2929
|
value: n.from.toString(),
|
|
2912
|
-
onChange:
|
|
2913
|
-
disabled:
|
|
2930
|
+
onChange: f,
|
|
2931
|
+
disabled: o || !n.enabled,
|
|
2914
2932
|
className: "h-8 w-[76px] text-xs",
|
|
2915
|
-
children: i.map((
|
|
2933
|
+
children: i.map((c) => /* @__PURE__ */ e("option", { value: c.value.toString(), disabled: c.value >= n.to, children: c.label }, c.value))
|
|
2916
2934
|
}
|
|
2917
2935
|
),
|
|
2918
2936
|
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "—" }),
|
|
2919
2937
|
/* @__PURE__ */ e(
|
|
2920
|
-
|
|
2938
|
+
ve,
|
|
2921
2939
|
{
|
|
2922
2940
|
value: n.to.toString(),
|
|
2923
|
-
onChange:
|
|
2924
|
-
disabled:
|
|
2941
|
+
onChange: m,
|
|
2942
|
+
disabled: o || !n.enabled,
|
|
2925
2943
|
className: "h-8 w-[76px] text-xs",
|
|
2926
|
-
children: i.map((
|
|
2944
|
+
children: i.map((c) => /* @__PURE__ */ e("option", { value: c.value.toString(), disabled: c.value <= n.from, children: c.label }, c.value))
|
|
2927
2945
|
}
|
|
2928
2946
|
)
|
|
2929
2947
|
] });
|
|
@@ -2931,40 +2949,40 @@ function Bn({ dayLabel: t, config: n, onChange: o, disabled: a, hourOptions: i }
|
|
|
2931
2949
|
function Er({
|
|
2932
2950
|
value: t,
|
|
2933
2951
|
onChange: n,
|
|
2934
|
-
isLocked:
|
|
2935
|
-
className:
|
|
2952
|
+
isLocked: s = !1,
|
|
2953
|
+
className: o,
|
|
2936
2954
|
labels: i = {}
|
|
2937
2955
|
}) {
|
|
2938
|
-
const
|
|
2956
|
+
const a = {
|
|
2939
2957
|
title: "Working hours",
|
|
2940
2958
|
lockedMessage: "This setting is locked by the administrator",
|
|
2941
2959
|
infoMessage: "Configure working hours for each day of the week. Non-working hours will be grayed out in day and week views.",
|
|
2942
2960
|
days: nt,
|
|
2943
2961
|
...i
|
|
2944
|
-
},
|
|
2945
|
-
|
|
2962
|
+
}, f = _n(), m = (c, v) => {
|
|
2963
|
+
s || n({ ...t, [c]: v });
|
|
2946
2964
|
};
|
|
2947
|
-
return /* @__PURE__ */ r("div", { className:
|
|
2965
|
+
return /* @__PURE__ */ r("div", { className: p("flex flex-col gap-3", o), children: [
|
|
2948
2966
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2949
|
-
/* @__PURE__ */ e(
|
|
2950
|
-
|
|
2951
|
-
/* @__PURE__ */ e(
|
|
2952
|
-
/* @__PURE__ */ e(
|
|
2953
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2954
|
-
/* @__PURE__ */ e(
|
|
2955
|
-
/* @__PURE__ */ e(
|
|
2967
|
+
/* @__PURE__ */ e(me, { className: "text-sm font-semibold", children: a.title }),
|
|
2968
|
+
s ? /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
2969
|
+
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(Fn, { className: "size-3 text-muted-foreground" }) }),
|
|
2970
|
+
/* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e("p", { children: a.lockedMessage }) })
|
|
2971
|
+
] }) }) : /* @__PURE__ */ e(fe, { delayDuration: 100, children: /* @__PURE__ */ r(ge, { children: [
|
|
2972
|
+
/* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(Wn, { className: "size-3 text-muted-foreground" }) }),
|
|
2973
|
+
/* @__PURE__ */ e(xe, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: a.infoMessage }) })
|
|
2956
2974
|
] }) })
|
|
2957
2975
|
] }),
|
|
2958
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: On.map((
|
|
2976
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: On.map((c) => /* @__PURE__ */ e(
|
|
2959
2977
|
Bn,
|
|
2960
2978
|
{
|
|
2961
|
-
dayLabel:
|
|
2962
|
-
config: t[
|
|
2963
|
-
onChange: (v) =>
|
|
2964
|
-
disabled:
|
|
2965
|
-
hourOptions:
|
|
2979
|
+
dayLabel: a.days?.[c] ?? nt[c],
|
|
2980
|
+
config: t[c],
|
|
2981
|
+
onChange: (v) => m(c, v),
|
|
2982
|
+
disabled: s,
|
|
2983
|
+
hourOptions: f
|
|
2966
2984
|
},
|
|
2967
|
-
|
|
2985
|
+
c
|
|
2968
2986
|
)) })
|
|
2969
2987
|
] });
|
|
2970
2988
|
}
|
|
@@ -3031,7 +3049,7 @@ function Un({ className: t }) {
|
|
|
3031
3049
|
}
|
|
3032
3050
|
);
|
|
3033
3051
|
}
|
|
3034
|
-
function _e({ checked: t, onCheckedChange: n, className:
|
|
3052
|
+
function _e({ checked: t, onCheckedChange: n, className: s, children: o }) {
|
|
3035
3053
|
return /* @__PURE__ */ e(
|
|
3036
3054
|
"button",
|
|
3037
3055
|
{
|
|
@@ -3039,34 +3057,34 @@ function _e({ checked: t, onCheckedChange: n, className: o, children: a }) {
|
|
|
3039
3057
|
role: "checkbox",
|
|
3040
3058
|
"aria-checked": t,
|
|
3041
3059
|
onClick: () => n(!t),
|
|
3042
|
-
className:
|
|
3043
|
-
children:
|
|
3060
|
+
className: s,
|
|
3061
|
+
children: o
|
|
3044
3062
|
}
|
|
3045
3063
|
);
|
|
3046
3064
|
}
|
|
3047
|
-
function Vn({ src: t, alt: n, fallback:
|
|
3048
|
-
const [i,
|
|
3065
|
+
function Vn({ src: t, alt: n, fallback: s, className: o }) {
|
|
3066
|
+
const [i, a] = ie(!1);
|
|
3049
3067
|
return !t || i ? /* @__PURE__ */ e(
|
|
3050
3068
|
"div",
|
|
3051
3069
|
{
|
|
3052
|
-
className:
|
|
3070
|
+
className: p(
|
|
3053
3071
|
"flex items-center justify-center bg-zinc-200 text-zinc-600 font-medium text-sm",
|
|
3054
|
-
|
|
3072
|
+
o
|
|
3055
3073
|
),
|
|
3056
|
-
children:
|
|
3074
|
+
children: s || "?"
|
|
3057
3075
|
}
|
|
3058
3076
|
) : /* @__PURE__ */ e(
|
|
3059
3077
|
"img",
|
|
3060
3078
|
{
|
|
3061
3079
|
src: t,
|
|
3062
3080
|
alt: n || "",
|
|
3063
|
-
className:
|
|
3064
|
-
onError: () =>
|
|
3081
|
+
className: p("object-cover", o),
|
|
3082
|
+
onError: () => a(!0)
|
|
3065
3083
|
}
|
|
3066
3084
|
);
|
|
3067
3085
|
}
|
|
3068
|
-
function rt({ value: t, onChange: n, placeholder:
|
|
3069
|
-
return /* @__PURE__ */ r("div", { className:
|
|
3086
|
+
function rt({ value: t, onChange: n, placeholder: s, className: o }) {
|
|
3087
|
+
return /* @__PURE__ */ r("div", { className: p("relative", o), children: [
|
|
3070
3088
|
/* @__PURE__ */ e(Rn, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
3071
3089
|
/* @__PURE__ */ e(
|
|
3072
3090
|
"input",
|
|
@@ -3074,16 +3092,16 @@ function rt({ value: t, onChange: n, placeholder: o, className: a }) {
|
|
|
3074
3092
|
type: "text",
|
|
3075
3093
|
value: t,
|
|
3076
3094
|
onChange: (i) => n(i.target.value),
|
|
3077
|
-
placeholder:
|
|
3095
|
+
placeholder: s,
|
|
3078
3096
|
className: "h-9 w-full rounded-lg border border-border bg-white pl-9 pr-3 text-sm placeholder:text-muted-foreground focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary"
|
|
3079
3097
|
}
|
|
3080
3098
|
)
|
|
3081
3099
|
] });
|
|
3082
3100
|
}
|
|
3083
|
-
function ot(t, n,
|
|
3101
|
+
function ot(t, n, s, o = 0.3) {
|
|
3084
3102
|
if (!n.trim()) return t;
|
|
3085
3103
|
const i = n.toLowerCase();
|
|
3086
|
-
return t.filter((
|
|
3104
|
+
return t.filter((a) => s(a).some((m) => m ? m.toLowerCase().includes(i) : !1));
|
|
3087
3105
|
}
|
|
3088
3106
|
const Yn = {
|
|
3089
3107
|
title: "Filters",
|
|
@@ -3101,54 +3119,54 @@ const Yn = {
|
|
|
3101
3119
|
function Tr({
|
|
3102
3120
|
scheduleTypes: t,
|
|
3103
3121
|
users: n,
|
|
3104
|
-
selectedScheduleTypeIds:
|
|
3105
|
-
onScheduleTypeChange:
|
|
3122
|
+
selectedScheduleTypeIds: s,
|
|
3123
|
+
onScheduleTypeChange: o,
|
|
3106
3124
|
selectedUserIds: i,
|
|
3107
|
-
onUserChange:
|
|
3108
|
-
onClearAll:
|
|
3109
|
-
className:
|
|
3110
|
-
scheduleTypesLoading:
|
|
3125
|
+
onUserChange: a,
|
|
3126
|
+
onClearAll: f,
|
|
3127
|
+
className: m,
|
|
3128
|
+
scheduleTypesLoading: c = !1,
|
|
3111
3129
|
usersLoading: v = !1,
|
|
3112
|
-
labels:
|
|
3113
|
-
getScheduleTypeName:
|
|
3130
|
+
labels: y,
|
|
3131
|
+
getScheduleTypeName: b
|
|
3114
3132
|
}) {
|
|
3115
|
-
const A = { ...Yn, ...
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
]) : t, [t, $,
|
|
3119
|
-
const
|
|
3120
|
-
|
|
3121
|
-
},
|
|
3122
|
-
if (
|
|
3123
|
-
const
|
|
3124
|
-
|
|
3133
|
+
const A = { ...Yn, ...y }, [$, P] = ie(""), [F, T] = ie(""), C = te(() => $.trim() ? ot(t, $, (d) => [
|
|
3134
|
+
d.name,
|
|
3135
|
+
b?.(d) || d.name
|
|
3136
|
+
]) : t, [t, $, b]), j = te(() => F.trim() ? ot(n, F, (d) => [d.name, d.email || ""]) : n, [n, F]), W = C.length > 0 && C.every((d) => s.includes(d.id)), _ = j.length > 0 && j.every((d) => i.includes(d.id)), M = s.length + i.length, G = (d, N) => {
|
|
3137
|
+
const h = N ? [...s, d] : s.filter((D) => D !== d);
|
|
3138
|
+
o(h);
|
|
3139
|
+
}, H = () => {
|
|
3140
|
+
if (W) {
|
|
3141
|
+
const d = new Set(C.map((N) => N.id));
|
|
3142
|
+
o(s.filter((N) => !d.has(N)));
|
|
3125
3143
|
} else {
|
|
3126
|
-
const
|
|
3127
|
-
...
|
|
3128
|
-
...
|
|
3144
|
+
const d = /* @__PURE__ */ new Set([
|
|
3145
|
+
...s,
|
|
3146
|
+
...C.map((N) => N.id)
|
|
3129
3147
|
]);
|
|
3130
|
-
|
|
3148
|
+
o(Array.from(d));
|
|
3131
3149
|
}
|
|
3132
|
-
},
|
|
3133
|
-
const
|
|
3134
|
-
|
|
3150
|
+
}, L = (d, N) => {
|
|
3151
|
+
const h = N ? [...i, d] : i.filter((D) => D !== d);
|
|
3152
|
+
a(h);
|
|
3135
3153
|
}, V = () => {
|
|
3136
3154
|
if (_) {
|
|
3137
|
-
const
|
|
3138
|
-
|
|
3155
|
+
const d = new Set(j.map((N) => N.id));
|
|
3156
|
+
a(i.filter((N) => !d.has(N)));
|
|
3139
3157
|
} else {
|
|
3140
|
-
const
|
|
3141
|
-
|
|
3158
|
+
const d = /* @__PURE__ */ new Set([...i, ...j.map((N) => N.id)]);
|
|
3159
|
+
a(Array.from(d));
|
|
3142
3160
|
}
|
|
3143
|
-
},
|
|
3144
|
-
|
|
3145
|
-
},
|
|
3161
|
+
}, X = () => {
|
|
3162
|
+
o([]), a([]), f?.();
|
|
3163
|
+
}, Q = (d) => b ? b(d) : d.name, B = (d) => d.colorHex || d.color || "#069AD7";
|
|
3146
3164
|
return /* @__PURE__ */ r(
|
|
3147
3165
|
"div",
|
|
3148
3166
|
{
|
|
3149
|
-
className:
|
|
3167
|
+
className: p(
|
|
3150
3168
|
"flex min-w-72 max-w-72 flex-col rounded-lg border bg-white shadow-sm",
|
|
3151
|
-
|
|
3169
|
+
m
|
|
3152
3170
|
),
|
|
3153
3171
|
children: [
|
|
3154
3172
|
/* @__PURE__ */ r("header", { className: "flex items-start justify-between gap-2 px-4 pb-2 pt-4", children: [
|
|
@@ -3156,11 +3174,11 @@ function Tr({
|
|
|
3156
3174
|
/* @__PURE__ */ e("h3", { className: "text-base font-semibold text-foreground", children: A.title }),
|
|
3157
3175
|
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: A.subtitle })
|
|
3158
3176
|
] }),
|
|
3159
|
-
|
|
3177
|
+
M > 0 && /* @__PURE__ */ r(
|
|
3160
3178
|
"button",
|
|
3161
3179
|
{
|
|
3162
3180
|
type: "button",
|
|
3163
|
-
onClick:
|
|
3181
|
+
onClick: X,
|
|
3164
3182
|
className: "flex h-auto items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/10",
|
|
3165
3183
|
children: [
|
|
3166
3184
|
/* @__PURE__ */ e(Un, { className: "h-3.5 w-3.5" }),
|
|
@@ -3177,9 +3195,9 @@ function Tr({
|
|
|
3177
3195
|
"button",
|
|
3178
3196
|
{
|
|
3179
3197
|
type: "button",
|
|
3180
|
-
onClick:
|
|
3198
|
+
onClick: H,
|
|
3181
3199
|
className: "text-xs font-medium text-primary transition-colors hover:text-primary/80",
|
|
3182
|
-
children:
|
|
3200
|
+
children: W ? A.unselectAll : A.selectAll
|
|
3183
3201
|
}
|
|
3184
3202
|
)
|
|
3185
3203
|
] }),
|
|
@@ -3192,9 +3210,9 @@ function Tr({
|
|
|
3192
3210
|
}
|
|
3193
3211
|
) }),
|
|
3194
3212
|
/* @__PURE__ */ r("div", { className: "flex max-h-[220px] flex-col gap-2 overflow-y-auto px-4 pb-2 scrollbar-thin", children: [
|
|
3195
|
-
|
|
3213
|
+
c ? (
|
|
3196
3214
|
// Loading skeletons
|
|
3197
|
-
Array.from({ length: 4 }).map((
|
|
3215
|
+
Array.from({ length: 4 }).map((d, N) => /* @__PURE__ */ r(
|
|
3198
3216
|
"div",
|
|
3199
3217
|
{
|
|
3200
3218
|
className: "flex animate-pulse items-center gap-2 rounded-md border border-border/60 bg-muted/40 p-2",
|
|
@@ -3203,49 +3221,49 @@ function Tr({
|
|
|
3203
3221
|
/* @__PURE__ */ e("div", { className: "h-3 w-24 rounded bg-muted-foreground/20" })
|
|
3204
3222
|
]
|
|
3205
3223
|
},
|
|
3206
|
-
`skeleton-${
|
|
3224
|
+
`skeleton-${N}`
|
|
3207
3225
|
))
|
|
3208
|
-
) :
|
|
3209
|
-
const
|
|
3226
|
+
) : C.map((d) => {
|
|
3227
|
+
const N = s.includes(d.id), h = B(d);
|
|
3210
3228
|
return /* @__PURE__ */ r(
|
|
3211
3229
|
_e,
|
|
3212
3230
|
{
|
|
3213
|
-
checked:
|
|
3214
|
-
onCheckedChange: (
|
|
3215
|
-
className:
|
|
3231
|
+
checked: N,
|
|
3232
|
+
onCheckedChange: (D) => G(d.id, D),
|
|
3233
|
+
className: p(
|
|
3216
3234
|
"relative flex w-full cursor-pointer items-center justify-between gap-3 rounded-md border border-border bg-white px-3 py-2 transition-colors hover:border-primary/50",
|
|
3217
|
-
|
|
3235
|
+
N && "border-primary bg-primary/5"
|
|
3218
3236
|
),
|
|
3219
3237
|
children: [
|
|
3220
3238
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
3221
3239
|
/* @__PURE__ */ e(
|
|
3222
3240
|
"span",
|
|
3223
3241
|
{
|
|
3224
|
-
className:
|
|
3242
|
+
className: p(
|
|
3225
3243
|
"flex h-4 w-4 items-center justify-center rounded border border-border text-xs transition-colors",
|
|
3226
|
-
|
|
3244
|
+
N && "border-primary bg-primary text-primary-foreground"
|
|
3227
3245
|
),
|
|
3228
|
-
children:
|
|
3246
|
+
children: N && /* @__PURE__ */ e(Oe, { className: "h-3 w-3" })
|
|
3229
3247
|
}
|
|
3230
3248
|
),
|
|
3231
|
-
/* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children:
|
|
3249
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children: Q(d) })
|
|
3232
3250
|
] }),
|
|
3233
3251
|
/* @__PURE__ */ e(
|
|
3234
3252
|
"div",
|
|
3235
3253
|
{
|
|
3236
3254
|
className: "h-4 w-4 rounded-full border",
|
|
3237
3255
|
style: {
|
|
3238
|
-
backgroundColor:
|
|
3239
|
-
borderColor:
|
|
3256
|
+
backgroundColor: h,
|
|
3257
|
+
borderColor: h
|
|
3240
3258
|
}
|
|
3241
3259
|
}
|
|
3242
3260
|
)
|
|
3243
3261
|
]
|
|
3244
3262
|
},
|
|
3245
|
-
|
|
3263
|
+
d.id
|
|
3246
3264
|
);
|
|
3247
3265
|
}),
|
|
3248
|
-
!
|
|
3266
|
+
!c && C.length === 0 && /* @__PURE__ */ e("p", { className: "px-2 py-1 text-xs text-muted-foreground", children: A.noScheduleTypes })
|
|
3249
3267
|
] })
|
|
3250
3268
|
] }),
|
|
3251
3269
|
/* @__PURE__ */ e("div", { className: "h-px w-full bg-border/60" }),
|
|
@@ -3257,7 +3275,7 @@ function Tr({
|
|
|
3257
3275
|
{
|
|
3258
3276
|
checked: _,
|
|
3259
3277
|
onCheckedChange: () => V(),
|
|
3260
|
-
className:
|
|
3278
|
+
className: p(
|
|
3261
3279
|
"flex h-5 w-5 items-center justify-center rounded border border-border bg-white transition-colors hover:border-primary/50",
|
|
3262
3280
|
_ && "border-primary bg-primary text-primary-foreground"
|
|
3263
3281
|
),
|
|
@@ -3268,7 +3286,7 @@ function Tr({
|
|
|
3268
3286
|
/* @__PURE__ */ e("div", { className: "px-4 pb-3", children: /* @__PURE__ */ e(
|
|
3269
3287
|
rt,
|
|
3270
3288
|
{
|
|
3271
|
-
value:
|
|
3289
|
+
value: F,
|
|
3272
3290
|
onChange: T,
|
|
3273
3291
|
placeholder: A.searchParticipants
|
|
3274
3292
|
}
|
|
@@ -3276,7 +3294,7 @@ function Tr({
|
|
|
3276
3294
|
/* @__PURE__ */ r("div", { className: "flex max-h-[400px] flex-col gap-2 overflow-y-auto px-4 pb-4 scrollbar-thin", children: [
|
|
3277
3295
|
v ? (
|
|
3278
3296
|
// Loading skeletons
|
|
3279
|
-
Array.from({ length: 4 }).map((
|
|
3297
|
+
Array.from({ length: 4 }).map((d, N) => /* @__PURE__ */ r(
|
|
3280
3298
|
"div",
|
|
3281
3299
|
{
|
|
3282
3300
|
className: "flex animate-pulse items-center gap-3 rounded-md border border-border/60 bg-muted/40 p-3",
|
|
@@ -3289,58 +3307,58 @@ function Tr({
|
|
|
3289
3307
|
] })
|
|
3290
3308
|
]
|
|
3291
3309
|
},
|
|
3292
|
-
`p-skeleton-${
|
|
3310
|
+
`p-skeleton-${N}`
|
|
3293
3311
|
))
|
|
3294
|
-
) :
|
|
3295
|
-
const
|
|
3312
|
+
) : j.map((d) => {
|
|
3313
|
+
const N = i.includes(d.id);
|
|
3296
3314
|
return /* @__PURE__ */ r(
|
|
3297
3315
|
_e,
|
|
3298
3316
|
{
|
|
3299
|
-
checked:
|
|
3300
|
-
onCheckedChange: (
|
|
3301
|
-
className:
|
|
3317
|
+
checked: N,
|
|
3318
|
+
onCheckedChange: (h) => L(d.id, h),
|
|
3319
|
+
className: p(
|
|
3302
3320
|
"relative flex w-full cursor-pointer items-start gap-2 rounded-lg border border-border bg-white p-2 transition-colors hover:border-primary/50",
|
|
3303
|
-
|
|
3321
|
+
N && "border-primary bg-zinc-50"
|
|
3304
3322
|
),
|
|
3305
3323
|
children: [
|
|
3306
3324
|
/* @__PURE__ */ e(
|
|
3307
3325
|
"span",
|
|
3308
3326
|
{
|
|
3309
|
-
className:
|
|
3327
|
+
className: p(
|
|
3310
3328
|
"flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border border-border transition-colors",
|
|
3311
|
-
|
|
3329
|
+
N && "border-primary bg-primary text-primary-foreground"
|
|
3312
3330
|
),
|
|
3313
|
-
children:
|
|
3331
|
+
children: N && /* @__PURE__ */ e(Oe, { className: "h-2.5 w-2.5" })
|
|
3314
3332
|
}
|
|
3315
3333
|
),
|
|
3316
3334
|
/* @__PURE__ */ r("div", { className: "flex flex-1 items-start gap-2", children: [
|
|
3317
3335
|
/* @__PURE__ */ e(
|
|
3318
3336
|
Vn,
|
|
3319
3337
|
{
|
|
3320
|
-
src:
|
|
3321
|
-
alt:
|
|
3322
|
-
fallback:
|
|
3338
|
+
src: d.avatar ?? null,
|
|
3339
|
+
alt: d.name,
|
|
3340
|
+
fallback: d.name?.[0]?.toUpperCase() ?? "?",
|
|
3323
3341
|
className: "h-10 w-10 rounded-lg"
|
|
3324
3342
|
}
|
|
3325
3343
|
),
|
|
3326
3344
|
/* @__PURE__ */ r("div", { className: "flex max-w-[140px] flex-col gap-0.5 overflow-hidden", children: [
|
|
3327
|
-
/* @__PURE__ */ e("span", { className: "line-clamp-1 text-sm font-medium text-foreground", children:
|
|
3345
|
+
/* @__PURE__ */ e("span", { className: "line-clamp-1 text-sm font-medium text-foreground", children: d.name }),
|
|
3328
3346
|
/* @__PURE__ */ e(
|
|
3329
3347
|
"span",
|
|
3330
3348
|
{
|
|
3331
3349
|
className: "truncate text-[11px] text-muted-foreground",
|
|
3332
|
-
title:
|
|
3333
|
-
children:
|
|
3350
|
+
title: d.email,
|
|
3351
|
+
children: d.email
|
|
3334
3352
|
}
|
|
3335
3353
|
)
|
|
3336
3354
|
] })
|
|
3337
3355
|
] })
|
|
3338
3356
|
]
|
|
3339
3357
|
},
|
|
3340
|
-
|
|
3358
|
+
d.id
|
|
3341
3359
|
);
|
|
3342
3360
|
}),
|
|
3343
|
-
!v &&
|
|
3361
|
+
!v && j.length === 0 && /* @__PURE__ */ e("p", { className: "px-4 text-xs text-muted-foreground", children: A.noParticipants })
|
|
3344
3362
|
] })
|
|
3345
3363
|
] })
|
|
3346
3364
|
]
|
|
@@ -3371,33 +3389,33 @@ function Kn({ className: t }) {
|
|
|
3371
3389
|
function Hr({
|
|
3372
3390
|
scheduleTypes: t,
|
|
3373
3391
|
value: n,
|
|
3374
|
-
onChange:
|
|
3375
|
-
allLabel:
|
|
3392
|
+
onChange: s,
|
|
3393
|
+
allLabel: o = "All types",
|
|
3376
3394
|
className: i,
|
|
3377
|
-
label:
|
|
3395
|
+
label: a
|
|
3378
3396
|
}) {
|
|
3379
|
-
const
|
|
3380
|
-
|
|
3381
|
-
},
|
|
3382
|
-
return /* @__PURE__ */ r("div", { className:
|
|
3383
|
-
|
|
3397
|
+
const f = (c) => {
|
|
3398
|
+
s(c.target.value);
|
|
3399
|
+
}, m = t.find((c) => String(c.id) === n);
|
|
3400
|
+
return /* @__PURE__ */ r("div", { className: p("flex flex-col gap-1", i), children: [
|
|
3401
|
+
a && /* @__PURE__ */ e(me, { className: "text-xs text-muted-foreground", children: a }),
|
|
3384
3402
|
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
3385
|
-
|
|
3403
|
+
m ? /* @__PURE__ */ e(
|
|
3386
3404
|
"span",
|
|
3387
3405
|
{
|
|
3388
3406
|
className: "pointer-events-none absolute left-2.5 top-1/2 size-3 -translate-y-1/2 rounded-full",
|
|
3389
|
-
style: { backgroundColor:
|
|
3407
|
+
style: { backgroundColor: m.color }
|
|
3390
3408
|
}
|
|
3391
3409
|
) : /* @__PURE__ */ e(Kn, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
|
|
3392
3410
|
/* @__PURE__ */ r(
|
|
3393
|
-
|
|
3411
|
+
ve,
|
|
3394
3412
|
{
|
|
3395
3413
|
value: n,
|
|
3396
|
-
onChange:
|
|
3414
|
+
onChange: f,
|
|
3397
3415
|
className: "h-9 w-full min-w-[140px] pl-8 pr-8 text-sm",
|
|
3398
3416
|
children: [
|
|
3399
|
-
/* @__PURE__ */ e("option", { value: "all", children:
|
|
3400
|
-
t.map((
|
|
3417
|
+
/* @__PURE__ */ e("option", { value: "all", children: o }),
|
|
3418
|
+
t.map((c) => /* @__PURE__ */ e("option", { value: String(c.id), children: c.label }, c.id))
|
|
3401
3419
|
]
|
|
3402
3420
|
}
|
|
3403
3421
|
)
|
|
@@ -3430,27 +3448,27 @@ function Gn({ className: t }) {
|
|
|
3430
3448
|
function zr({
|
|
3431
3449
|
users: t,
|
|
3432
3450
|
value: n,
|
|
3433
|
-
onChange:
|
|
3434
|
-
allLabel:
|
|
3451
|
+
onChange: s,
|
|
3452
|
+
allLabel: o = "All users",
|
|
3435
3453
|
className: i,
|
|
3436
|
-
label:
|
|
3454
|
+
label: a
|
|
3437
3455
|
}) {
|
|
3438
|
-
const
|
|
3439
|
-
|
|
3456
|
+
const f = (m) => {
|
|
3457
|
+
s(m.target.value);
|
|
3440
3458
|
};
|
|
3441
|
-
return /* @__PURE__ */ r("div", { className:
|
|
3442
|
-
|
|
3459
|
+
return /* @__PURE__ */ r("div", { className: p("flex flex-col gap-1", i), children: [
|
|
3460
|
+
a && /* @__PURE__ */ e(me, { className: "text-xs text-muted-foreground", children: a }),
|
|
3443
3461
|
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
3444
3462
|
/* @__PURE__ */ e(Gn, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
|
|
3445
3463
|
/* @__PURE__ */ r(
|
|
3446
|
-
|
|
3464
|
+
ve,
|
|
3447
3465
|
{
|
|
3448
3466
|
value: n,
|
|
3449
|
-
onChange:
|
|
3467
|
+
onChange: f,
|
|
3450
3468
|
className: "h-9 w-full min-w-[120px] pl-8 pr-8 text-sm",
|
|
3451
3469
|
children: [
|
|
3452
|
-
/* @__PURE__ */ e("option", { value: "all", children:
|
|
3453
|
-
t.map((
|
|
3470
|
+
/* @__PURE__ */ e("option", { value: "all", children: o }),
|
|
3471
|
+
t.map((m) => /* @__PURE__ */ e("option", { value: m.id, children: m.name }, m.id))
|
|
3454
3472
|
]
|
|
3455
3473
|
}
|
|
3456
3474
|
)
|
|
@@ -3544,16 +3562,16 @@ function Qn({ className: t }) {
|
|
|
3544
3562
|
);
|
|
3545
3563
|
}
|
|
3546
3564
|
function Zn(t) {
|
|
3547
|
-
const n = t.getFullYear(),
|
|
3548
|
-
return `${n}-${
|
|
3565
|
+
const n = t.getFullYear(), s = String(t.getMonth() + 1).padStart(2, "0"), o = String(t.getDate()).padStart(2, "0");
|
|
3566
|
+
return `${n}-${s}-${o}`;
|
|
3549
3567
|
}
|
|
3550
3568
|
function st(t) {
|
|
3551
|
-
const n = t.getHours(),
|
|
3552
|
-
return `${i}:${
|
|
3569
|
+
const n = t.getHours(), s = t.getMinutes(), o = n >= 12 ? "PM" : "AM", i = n % 12 || 12, a = String(s).padStart(2, "0");
|
|
3570
|
+
return `${i}:${a} ${o}`;
|
|
3553
3571
|
}
|
|
3554
3572
|
function er(t) {
|
|
3555
|
-
const n = st(t.startDate),
|
|
3556
|
-
return `${n} - ${
|
|
3573
|
+
const n = st(t.startDate), s = st(t.endDate);
|
|
3574
|
+
return `${n} - ${s}`;
|
|
3557
3575
|
}
|
|
3558
3576
|
function tr(t) {
|
|
3559
3577
|
const n = ht(/* @__PURE__ */ new Date(), 1);
|
|
@@ -3562,7 +3580,7 @@ function tr(t) {
|
|
|
3562
3580
|
function nr(t) {
|
|
3563
3581
|
if (ce(t)) return "Today";
|
|
3564
3582
|
if (tr(t)) return "Tomorrow";
|
|
3565
|
-
const n = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
3583
|
+
const n = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], s = [
|
|
3566
3584
|
"Jan",
|
|
3567
3585
|
"Feb",
|
|
3568
3586
|
"Mar",
|
|
@@ -3575,33 +3593,33 @@ function nr(t) {
|
|
|
3575
3593
|
"Oct",
|
|
3576
3594
|
"Nov",
|
|
3577
3595
|
"Dec"
|
|
3578
|
-
],
|
|
3579
|
-
return `${
|
|
3596
|
+
], o = n[t.getDay()], i = s[t.getMonth()], a = t.getDate();
|
|
3597
|
+
return `${o}, ${i} ${a}`;
|
|
3580
3598
|
}
|
|
3581
3599
|
function rr(t, n) {
|
|
3582
|
-
const
|
|
3583
|
-
for (const
|
|
3584
|
-
const i = Zn(
|
|
3585
|
-
|
|
3600
|
+
const s = /* @__PURE__ */ new Map();
|
|
3601
|
+
for (const o of t) {
|
|
3602
|
+
const i = Zn(o.startDate), a = s.get(i) ?? [];
|
|
3603
|
+
a.push(o), s.set(i, a);
|
|
3586
3604
|
}
|
|
3587
|
-
return Array.from(
|
|
3588
|
-
const
|
|
3589
|
-
(
|
|
3590
|
-
),
|
|
3605
|
+
return Array.from(s.entries()).map(([o, i]) => {
|
|
3606
|
+
const a = [...i].sort(
|
|
3607
|
+
(m, c) => m.startDate.getTime() - c.startDate.getTime()
|
|
3608
|
+
), f = n > 0 ? a.slice(0, n) : a;
|
|
3591
3609
|
return {
|
|
3592
|
-
date: new Date(
|
|
3593
|
-
dateKey:
|
|
3594
|
-
events:
|
|
3595
|
-
hasMore: n > 0 &&
|
|
3610
|
+
date: new Date(o),
|
|
3611
|
+
dateKey: o,
|
|
3612
|
+
events: f,
|
|
3613
|
+
hasMore: n > 0 && a.length > n
|
|
3596
3614
|
};
|
|
3597
|
-
}).sort((
|
|
3615
|
+
}).sort((o, i) => o.date.getTime() - i.date.getTime());
|
|
3598
3616
|
}
|
|
3599
3617
|
function or(t) {
|
|
3600
|
-
const n = Pe(/* @__PURE__ */ new Date()),
|
|
3601
|
-
return t.filter((
|
|
3618
|
+
const n = Pe(/* @__PURE__ */ new Date()), s = ut(/* @__PURE__ */ new Date());
|
|
3619
|
+
return t.filter((o) => o.startDate >= n && o.startDate <= s).length;
|
|
3602
3620
|
}
|
|
3603
3621
|
function Be({ className: t }) {
|
|
3604
|
-
return /* @__PURE__ */ e("div", { className:
|
|
3622
|
+
return /* @__PURE__ */ e("div", { className: p("animate-pulse rounded-md bg-muted", t) });
|
|
3605
3623
|
}
|
|
3606
3624
|
function sr({ event: t, onClick: n }) {
|
|
3607
3625
|
return /* @__PURE__ */ r(
|
|
@@ -3609,7 +3627,7 @@ function sr({ event: t, onClick: n }) {
|
|
|
3609
3627
|
{
|
|
3610
3628
|
type: "button",
|
|
3611
3629
|
onClick: () => n?.(t),
|
|
3612
|
-
className:
|
|
3630
|
+
className: p(
|
|
3613
3631
|
"w-full text-left rounded-lg transition-colors",
|
|
3614
3632
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3615
3633
|
"flex items-start gap-3 p-2"
|
|
@@ -3634,52 +3652,52 @@ function sr({ event: t, onClick: n }) {
|
|
|
3634
3652
|
function ar({ group: t, onEventClick: n }) {
|
|
3635
3653
|
return /* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
3636
3654
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between px-2 py-1.5", children: [
|
|
3637
|
-
/* @__PURE__ */ e("h3", { className:
|
|
3655
|
+
/* @__PURE__ */ e("h3", { className: p("text-xs font-semibold", ce(t.date) && "text-primary"), children: nr(t.date) }),
|
|
3638
3656
|
t.hasMore && /* @__PURE__ */ r("span", { className: "text-[10px] text-muted-foreground", children: [
|
|
3639
3657
|
"+",
|
|
3640
3658
|
t.events.length,
|
|
3641
3659
|
" more"
|
|
3642
3660
|
] })
|
|
3643
3661
|
] }),
|
|
3644
|
-
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((
|
|
3662
|
+
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((s) => /* @__PURE__ */ e(sr, { event: s, onClick: n }, s.id)) })
|
|
3645
3663
|
] });
|
|
3646
3664
|
}
|
|
3647
3665
|
function Ir({
|
|
3648
3666
|
events: t,
|
|
3649
3667
|
isLoading: n = !1,
|
|
3650
|
-
className:
|
|
3651
|
-
daysAhead:
|
|
3668
|
+
className: s,
|
|
3669
|
+
daysAhead: o = 7,
|
|
3652
3670
|
maxEventsPerDay: i = 3,
|
|
3653
|
-
onEventClick:
|
|
3654
|
-
onNavigateToAgenda:
|
|
3671
|
+
onEventClick: a,
|
|
3672
|
+
onNavigateToAgenda: f
|
|
3655
3673
|
}) {
|
|
3656
|
-
const [
|
|
3657
|
-
const P = Pe(/* @__PURE__ */ new Date()),
|
|
3658
|
-
return t.filter((T) => T.endDate >= P && T.startDate <
|
|
3659
|
-
}, [t,
|
|
3674
|
+
const [m, c] = ie(!1), v = te(() => {
|
|
3675
|
+
const P = Pe(/* @__PURE__ */ new Date()), F = ht(P, o);
|
|
3676
|
+
return t.filter((T) => T.endDate >= P && T.startDate < F);
|
|
3677
|
+
}, [t, o]), y = te(
|
|
3660
3678
|
() => rr(v, i),
|
|
3661
3679
|
[v, i]
|
|
3662
|
-
),
|
|
3663
|
-
|
|
3680
|
+
), b = te(() => or(t), [t]), A = (P) => {
|
|
3681
|
+
c(!1), a?.(P);
|
|
3664
3682
|
}, $ = () => {
|
|
3665
|
-
|
|
3683
|
+
c(!1), f?.();
|
|
3666
3684
|
};
|
|
3667
|
-
return /* @__PURE__ */ r(lt, { open:
|
|
3685
|
+
return /* @__PURE__ */ r(lt, { open: m, onOpenChange: c, children: [
|
|
3668
3686
|
/* @__PURE__ */ r(
|
|
3669
3687
|
ct,
|
|
3670
3688
|
{
|
|
3671
|
-
className:
|
|
3689
|
+
className: p(
|
|
3672
3690
|
"relative rounded-xl hover:text-zinc-700 hover:!bg-zinc-300 !bg-zinc-200 text-zinc-600 shadow-none !px-2.5 p-2 max-h-10",
|
|
3673
|
-
|
|
3691
|
+
s
|
|
3674
3692
|
),
|
|
3675
3693
|
children: [
|
|
3676
3694
|
/* @__PURE__ */ e(Jn, { className: "h-4 w-4" }),
|
|
3677
|
-
|
|
3695
|
+
b > 0 && /* @__PURE__ */ e(
|
|
3678
3696
|
Et,
|
|
3679
3697
|
{
|
|
3680
3698
|
variant: "destructive",
|
|
3681
3699
|
className: "absolute -right-4 -top-4 m-3 flex h-5 w-5 items-center justify-center rounded-full bg-primary p-0 text-[10px] font-medium hover:bg-primary",
|
|
3682
|
-
children:
|
|
3700
|
+
children: b > 99 ? "99+" : b
|
|
3683
3701
|
}
|
|
3684
3702
|
)
|
|
3685
3703
|
]
|
|
@@ -3689,9 +3707,9 @@ function Ir({
|
|
|
3689
3707
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between border-b p-4", children: [
|
|
3690
3708
|
/* @__PURE__ */ r("div", { children: [
|
|
3691
3709
|
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: "Upcoming" }),
|
|
3692
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children:
|
|
3710
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: b > 0 ? `${b} event${b > 1 ? "s" : ""} today` : "No events today" })
|
|
3693
3711
|
] }),
|
|
3694
|
-
|
|
3712
|
+
f && /* @__PURE__ */ r(
|
|
3695
3713
|
"button",
|
|
3696
3714
|
{
|
|
3697
3715
|
type: "button",
|
|
@@ -3704,21 +3722,21 @@ function Ir({
|
|
|
3704
3722
|
}
|
|
3705
3723
|
)
|
|
3706
3724
|
] }),
|
|
3707
|
-
/* @__PURE__ */ e("div", { className: "max-h-80 overflow-y-auto p-2", children: n ? /* @__PURE__ */ e("div", { className: "space-y-2 p-2", children: Array.from({ length: 3 }).map((P,
|
|
3725
|
+
/* @__PURE__ */ e("div", { className: "max-h-80 overflow-y-auto p-2", children: n ? /* @__PURE__ */ e("div", { className: "space-y-2 p-2", children: Array.from({ length: 3 }).map((P, F) => /* @__PURE__ */ r("div", { className: "flex space-x-3", children: [
|
|
3708
3726
|
/* @__PURE__ */ e(Be, { className: "h-2 w-2 rounded-full mt-2" }),
|
|
3709
3727
|
/* @__PURE__ */ r("div", { className: "flex-1 space-y-2", children: [
|
|
3710
3728
|
/* @__PURE__ */ e(Be, { className: "h-4 w-full" }),
|
|
3711
3729
|
/* @__PURE__ */ e(Be, { className: "h-3 w-3/4" })
|
|
3712
3730
|
] })
|
|
3713
|
-
] },
|
|
3731
|
+
] }, F)) }) : y.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-8 text-center", children: [
|
|
3714
3732
|
/* @__PURE__ */ e(qn, { className: "mb-2 h-8 w-8 text-muted-foreground/50" }),
|
|
3715
3733
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "No upcoming events" }),
|
|
3716
3734
|
/* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground/70", children: [
|
|
3717
3735
|
"Your schedule is clear for the next ",
|
|
3718
|
-
|
|
3736
|
+
o,
|
|
3719
3737
|
" days"
|
|
3720
3738
|
] })
|
|
3721
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-3 divide-y", children:
|
|
3739
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-3 divide-y", children: y.map((P) => /* @__PURE__ */ e(
|
|
3722
3740
|
ar,
|
|
3723
3741
|
{
|
|
3724
3742
|
group: P,
|
|
@@ -3777,8 +3795,8 @@ function lr(t) {
|
|
|
3777
3795
|
return n.setDate(n.getDate() + 1), t.getFullYear() === n.getFullYear() && t.getMonth() === n.getMonth() && t.getDate() === n.getDate();
|
|
3778
3796
|
}
|
|
3779
3797
|
function at(t) {
|
|
3780
|
-
const n = t.getHours(),
|
|
3781
|
-
return `${n % 12 || 12}:${
|
|
3798
|
+
const n = t.getHours(), s = t.getMinutes(), o = n >= 12 ? "PM" : "AM";
|
|
3799
|
+
return `${n % 12 || 12}:${s.toString().padStart(2, "0")} ${o}`;
|
|
3782
3800
|
}
|
|
3783
3801
|
function cr(t) {
|
|
3784
3802
|
return new Intl.DateTimeFormat("en-US", {
|
|
@@ -3788,58 +3806,58 @@ function cr(t) {
|
|
|
3788
3806
|
}).format(t);
|
|
3789
3807
|
}
|
|
3790
3808
|
function dr(t) {
|
|
3791
|
-
const n = at(t.startDate),
|
|
3792
|
-
return `${n} - ${
|
|
3809
|
+
const n = at(t.startDate), s = at(t.endDate);
|
|
3810
|
+
return `${n} - ${s}`;
|
|
3793
3811
|
}
|
|
3794
3812
|
function ur(t) {
|
|
3795
3813
|
return ce(t) ? "Today" : lr(t) ? "Tomorrow" : cr(t);
|
|
3796
3814
|
}
|
|
3797
3815
|
function hr(t, n) {
|
|
3798
|
-
const
|
|
3799
|
-
for (const
|
|
3800
|
-
const i = Wt(
|
|
3801
|
-
|
|
3816
|
+
const s = /* @__PURE__ */ new Map();
|
|
3817
|
+
for (const o of t) {
|
|
3818
|
+
const i = Wt(o.startDate), a = s.get(i) ?? [];
|
|
3819
|
+
a.push(o), s.set(i, a);
|
|
3802
3820
|
}
|
|
3803
|
-
return Array.from(
|
|
3804
|
-
const
|
|
3805
|
-
(
|
|
3806
|
-
),
|
|
3821
|
+
return Array.from(s.entries()).map(([o, i]) => {
|
|
3822
|
+
const a = [...i].sort(
|
|
3823
|
+
(m, c) => m.startDate.getTime() - c.startDate.getTime()
|
|
3824
|
+
), f = n > 0 ? a.slice(0, n) : a;
|
|
3807
3825
|
return {
|
|
3808
|
-
date: new Date(
|
|
3809
|
-
dateKey:
|
|
3810
|
-
events:
|
|
3811
|
-
hasMore: n > 0 &&
|
|
3826
|
+
date: new Date(o),
|
|
3827
|
+
dateKey: o,
|
|
3828
|
+
events: f,
|
|
3829
|
+
hasMore: n > 0 && a.length > n
|
|
3812
3830
|
};
|
|
3813
|
-
}).sort((
|
|
3831
|
+
}).sort((o, i) => o.date.getTime() - i.date.getTime());
|
|
3814
3832
|
}
|
|
3815
|
-
function mr({ event: t, onClick: n, compact:
|
|
3833
|
+
function mr({ event: t, onClick: n, compact: s }) {
|
|
3816
3834
|
return /* @__PURE__ */ r(
|
|
3817
3835
|
"button",
|
|
3818
3836
|
{
|
|
3819
3837
|
type: "button",
|
|
3820
3838
|
onClick: () => n?.(t),
|
|
3821
|
-
className:
|
|
3839
|
+
className: p(
|
|
3822
3840
|
"w-full text-left rounded-lg transition-colors",
|
|
3823
3841
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3824
3842
|
"flex items-start gap-3",
|
|
3825
|
-
|
|
3843
|
+
s ? "p-2" : "p-3"
|
|
3826
3844
|
),
|
|
3827
3845
|
children: [
|
|
3828
3846
|
/* @__PURE__ */ e(
|
|
3829
3847
|
"div",
|
|
3830
3848
|
{
|
|
3831
|
-
className:
|
|
3849
|
+
className: p("shrink-0 rounded-full mt-1", s ? "size-2" : "size-2.5"),
|
|
3832
3850
|
style: { backgroundColor: t.color ?? "#3b82f6" }
|
|
3833
3851
|
}
|
|
3834
3852
|
),
|
|
3835
3853
|
/* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
|
|
3836
|
-
/* @__PURE__ */ e("p", { className:
|
|
3837
|
-
/* @__PURE__ */ e("p", { className:
|
|
3854
|
+
/* @__PURE__ */ e("p", { className: p("font-medium truncate", s ? "text-xs" : "text-sm"), children: t.title }),
|
|
3855
|
+
/* @__PURE__ */ e("p", { className: p("text-muted-foreground truncate", s ? "text-[10px]" : "text-xs"), children: dr(t) })
|
|
3838
3856
|
] }),
|
|
3839
3857
|
n && /* @__PURE__ */ e(
|
|
3840
3858
|
ft,
|
|
3841
3859
|
{
|
|
3842
|
-
className:
|
|
3860
|
+
className: p("shrink-0 text-muted-foreground/50", s ? "size-3" : "size-4")
|
|
3843
3861
|
}
|
|
3844
3862
|
)
|
|
3845
3863
|
]
|
|
@@ -3849,98 +3867,98 @@ function mr({ event: t, onClick: n, compact: o }) {
|
|
|
3849
3867
|
function fr({
|
|
3850
3868
|
group: t,
|
|
3851
3869
|
onEventClick: n,
|
|
3852
|
-
onViewMore:
|
|
3853
|
-
compact:
|
|
3870
|
+
onViewMore: s,
|
|
3871
|
+
compact: o
|
|
3854
3872
|
}) {
|
|
3855
3873
|
return /* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
3856
|
-
/* @__PURE__ */ r("div", { className:
|
|
3874
|
+
/* @__PURE__ */ r("div", { className: p("flex items-center justify-between px-2", o ? "py-1" : "py-1.5"), children: [
|
|
3857
3875
|
/* @__PURE__ */ e(
|
|
3858
3876
|
"h3",
|
|
3859
3877
|
{
|
|
3860
|
-
className:
|
|
3878
|
+
className: p(
|
|
3861
3879
|
"font-semibold",
|
|
3862
|
-
|
|
3880
|
+
o ? "text-xs" : "text-sm",
|
|
3863
3881
|
ce(t.date) && "text-primary"
|
|
3864
3882
|
),
|
|
3865
3883
|
children: ur(t.date)
|
|
3866
3884
|
}
|
|
3867
3885
|
),
|
|
3868
|
-
t.hasMore &&
|
|
3886
|
+
t.hasMore && s && /* @__PURE__ */ e(
|
|
3869
3887
|
"button",
|
|
3870
3888
|
{
|
|
3871
3889
|
type: "button",
|
|
3872
|
-
onClick: () =>
|
|
3873
|
-
className:
|
|
3890
|
+
onClick: () => s(t.date),
|
|
3891
|
+
className: p("text-primary hover:underline", o ? "text-[10px]" : "text-xs"),
|
|
3874
3892
|
children: "+more"
|
|
3875
3893
|
}
|
|
3876
3894
|
)
|
|
3877
3895
|
] }),
|
|
3878
|
-
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((i) => /* @__PURE__ */ e(mr, { event: i, onClick: n, compact:
|
|
3896
|
+
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((i) => /* @__PURE__ */ e(mr, { event: i, onClick: n, compact: o }, i.id)) })
|
|
3879
3897
|
] });
|
|
3880
3898
|
}
|
|
3881
3899
|
function jr({
|
|
3882
3900
|
events: t,
|
|
3883
3901
|
daysAhead: n = 7,
|
|
3884
|
-
maxEventsPerDay:
|
|
3885
|
-
onEventClick:
|
|
3902
|
+
maxEventsPerDay: s = 3,
|
|
3903
|
+
onEventClick: o,
|
|
3886
3904
|
onViewAll: i,
|
|
3887
|
-
className:
|
|
3888
|
-
emptyState:
|
|
3889
|
-
title:
|
|
3890
|
-
showHeader:
|
|
3905
|
+
className: a,
|
|
3906
|
+
emptyState: f,
|
|
3907
|
+
title: m = "Upcoming",
|
|
3908
|
+
showHeader: c = !0,
|
|
3891
3909
|
compact: v = !1
|
|
3892
3910
|
}) {
|
|
3893
|
-
const
|
|
3894
|
-
const
|
|
3895
|
-
return
|
|
3896
|
-
}, [$, n, A]),
|
|
3897
|
-
() => hr(P,
|
|
3898
|
-
[P,
|
|
3911
|
+
const y = it(), b = y?.filteredEvents, A = y?.currentDate ?? /* @__PURE__ */ new Date(), $ = t ?? b ?? [], P = te(() => {
|
|
3912
|
+
const C = Pe(A), j = new Date(C);
|
|
3913
|
+
return j.setDate(j.getDate() + n), $.filter((W) => W.endDate >= C && W.startDate < j);
|
|
3914
|
+
}, [$, n, A]), F = te(
|
|
3915
|
+
() => hr(P, s),
|
|
3916
|
+
[P, s]
|
|
3899
3917
|
), T = P.length;
|
|
3900
|
-
return
|
|
3901
|
-
|
|
3918
|
+
return F.length === 0 ? /* @__PURE__ */ r("div", { className: p("rounded-lg border bg-card", a), children: [
|
|
3919
|
+
c && /* @__PURE__ */ e(
|
|
3902
3920
|
"div",
|
|
3903
3921
|
{
|
|
3904
|
-
className:
|
|
3922
|
+
className: p(
|
|
3905
3923
|
"border-b px-4 flex items-center justify-between",
|
|
3906
3924
|
v ? "py-2" : "py-3"
|
|
3907
3925
|
),
|
|
3908
|
-
children: /* @__PURE__ */ e("h2", { className:
|
|
3926
|
+
children: /* @__PURE__ */ e("h2", { className: p("font-semibold", v ? "text-sm" : "text-base"), children: m })
|
|
3909
3927
|
}
|
|
3910
3928
|
),
|
|
3911
3929
|
/* @__PURE__ */ e(
|
|
3912
3930
|
"div",
|
|
3913
3931
|
{
|
|
3914
|
-
className:
|
|
3932
|
+
className: p(
|
|
3915
3933
|
"flex flex-col items-center justify-center text-center",
|
|
3916
3934
|
v ? "py-6 px-4" : "py-10 px-6"
|
|
3917
3935
|
),
|
|
3918
|
-
children:
|
|
3936
|
+
children: f ?? /* @__PURE__ */ r(be, { children: [
|
|
3919
3937
|
/* @__PURE__ */ e(
|
|
3920
3938
|
ir,
|
|
3921
3939
|
{
|
|
3922
|
-
className:
|
|
3940
|
+
className: p("text-muted-foreground/50 mb-2", v ? "size-8" : "size-10")
|
|
3923
3941
|
}
|
|
3924
3942
|
),
|
|
3925
|
-
/* @__PURE__ */ e("p", { className:
|
|
3943
|
+
/* @__PURE__ */ e("p", { className: p("text-muted-foreground", v ? "text-xs" : "text-sm"), children: "No upcoming events" })
|
|
3926
3944
|
] })
|
|
3927
3945
|
}
|
|
3928
3946
|
)
|
|
3929
|
-
] }) : /* @__PURE__ */ r("div", { className:
|
|
3930
|
-
|
|
3947
|
+
] }) : /* @__PURE__ */ r("div", { className: p("rounded-lg border bg-card overflow-hidden", a), children: [
|
|
3948
|
+
c && /* @__PURE__ */ r(
|
|
3931
3949
|
"div",
|
|
3932
3950
|
{
|
|
3933
|
-
className:
|
|
3951
|
+
className: p(
|
|
3934
3952
|
"border-b px-4 flex items-center justify-between",
|
|
3935
3953
|
v ? "py-2" : "py-3"
|
|
3936
3954
|
),
|
|
3937
3955
|
children: [
|
|
3938
3956
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
3939
|
-
/* @__PURE__ */ e("h2", { className:
|
|
3957
|
+
/* @__PURE__ */ e("h2", { className: p("font-semibold", v ? "text-sm" : "text-base"), children: m }),
|
|
3940
3958
|
/* @__PURE__ */ e(
|
|
3941
3959
|
"span",
|
|
3942
3960
|
{
|
|
3943
|
-
className:
|
|
3961
|
+
className: p(
|
|
3944
3962
|
"text-muted-foreground bg-muted rounded-full px-2",
|
|
3945
3963
|
v ? "text-[10px] py-0" : "text-xs py-0.5"
|
|
3946
3964
|
),
|
|
@@ -3953,7 +3971,7 @@ function jr({
|
|
|
3953
3971
|
{
|
|
3954
3972
|
type: "button",
|
|
3955
3973
|
onClick: () => i(),
|
|
3956
|
-
className:
|
|
3974
|
+
className: p(
|
|
3957
3975
|
"text-primary hover:underline flex items-center gap-0.5",
|
|
3958
3976
|
v ? "text-xs" : "text-sm"
|
|
3959
3977
|
),
|
|
@@ -3969,19 +3987,19 @@ function jr({
|
|
|
3969
3987
|
/* @__PURE__ */ e(
|
|
3970
3988
|
"div",
|
|
3971
3989
|
{
|
|
3972
|
-
className:
|
|
3990
|
+
className: p(
|
|
3973
3991
|
"divide-y overflow-auto",
|
|
3974
3992
|
v ? "p-2 max-h-[280px]" : "p-3 max-h-[400px]"
|
|
3975
3993
|
),
|
|
3976
|
-
children:
|
|
3994
|
+
children: F.map((C) => /* @__PURE__ */ e(
|
|
3977
3995
|
fr,
|
|
3978
3996
|
{
|
|
3979
|
-
group:
|
|
3980
|
-
onEventClick:
|
|
3981
|
-
onViewMore: i ? (
|
|
3997
|
+
group: C,
|
|
3998
|
+
onEventClick: o,
|
|
3999
|
+
onViewMore: i ? (j) => i(j) : void 0,
|
|
3982
4000
|
compact: v
|
|
3983
4001
|
},
|
|
3984
|
-
|
|
4002
|
+
C.dateKey
|
|
3985
4003
|
))
|
|
3986
4004
|
}
|
|
3987
4005
|
)
|
|
@@ -4004,4 +4022,4 @@ export {
|
|
|
4004
4022
|
Tr as b,
|
|
4005
4023
|
Dr as c
|
|
4006
4024
|
};
|
|
4007
|
-
//# sourceMappingURL=agenda-widget-
|
|
4025
|
+
//# sourceMappingURL=agenda-widget-Couk7jMB.js.map
|