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