@innosolutions/inno-calendar 1.0.49 → 1.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENT.md +1288 -359
- package/dist/agenda-widget-WpqvlAJP.cjs +2 -0
- package/dist/agenda-widget-WpqvlAJP.cjs.map +1 -0
- package/dist/{agenda-widget-DhCPt2vI.js → agenda-widget-ssrwyMvF.js} +1245 -1182
- package/dist/agenda-widget-ssrwyMvF.js.map +1 -0
- package/dist/components/event/event-card.d.ts +21 -2
- package/dist/components/event/event-card.d.ts.map +1 -1
- package/dist/components/header/calendar-header.d.ts +10 -2
- package/dist/components/header/calendar-header.d.ts.map +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.mjs +49 -35
- package/dist/components/inno-calendar.d.ts +45 -2
- package/dist/components/inno-calendar.d.ts.map +1 -1
- package/dist/components/ui/dialog.d.ts +35 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/index.d.ts +2 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/sheet.d.ts +35 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/views/timeline-view.d.ts +10 -1
- package/dist/components/views/timeline-view.d.ts.map +1 -1
- package/dist/core/context/drag-drop-context.d.ts +7 -1
- package/dist/core/context/drag-drop-context.d.ts.map +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/core/types.d.ts +81 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +206 -192
- package/dist/presets/index.cjs +1 -1
- package/dist/presets/index.mjs +1 -1
- package/dist/{slot-selection-context-D1495hEJ.js → slot-selection-context-BwghpxKA.js} +233 -231
- package/dist/slot-selection-context-BwghpxKA.js.map +1 -0
- package/dist/slot-selection-context-CHSaOPWP.cjs +2 -0
- package/dist/slot-selection-context-CHSaOPWP.cjs.map +1 -0
- package/dist/{tailwind-calendar-BmJa4HhQ.js → tailwind-calendar-Ctfffnbn.js} +2 -2
- package/dist/{tailwind-calendar-BmJa4HhQ.js.map → tailwind-calendar-Ctfffnbn.js.map} +1 -1
- package/dist/{tailwind-calendar-CJmOutn1.cjs → tailwind-calendar-Gy1Uc9ZK.cjs} +2 -2
- package/dist/{tailwind-calendar-CJmOutn1.cjs.map → tailwind-calendar-Gy1Uc9ZK.cjs.map} +1 -1
- package/dist/week-view-ITRsM6y1.cjs +11 -0
- package/dist/week-view-ITRsM6y1.cjs.map +1 -0
- package/dist/{week-view-aRPB2cjn.js → week-view-vnIcmoVr.js} +1564 -1405
- package/dist/week-view-vnIcmoVr.js.map +1 -0
- package/package.json +2 -1
- package/dist/agenda-widget-B-AVTnqM.cjs +0 -2
- package/dist/agenda-widget-B-AVTnqM.cjs.map +0 -1
- package/dist/agenda-widget-DhCPt2vI.js.map +0 -1
- package/dist/slot-selection-context-BCsC7WT7.cjs +0 -2
- package/dist/slot-selection-context-BCsC7WT7.cjs.map +0 -1
- package/dist/slot-selection-context-D1495hEJ.js.map +0 -1
- package/dist/week-view-D19YRBQC.cjs +0 -11
- package/dist/week-view-D19YRBQC.cjs.map +0 -1
- package/dist/week-view-aRPB2cjn.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as n, Fragment as
|
|
2
|
-
import { g as
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { c as
|
|
5
|
-
import { P as
|
|
6
|
-
import { D as
|
|
7
|
-
import { isToday as
|
|
8
|
-
function
|
|
1
|
+
import { jsx as e, jsxs as n, Fragment as ce } from "react/jsx-runtime";
|
|
2
|
+
import { g as Ue, u as Ze, C as et } from "./use-calendar-Clo9DFK4.js";
|
|
3
|
+
import { useCallback as X, useState as de, useEffect as pe, forwardRef as be, useRef as Ee, useMemo as U, useLayoutEffect as tt, useImperativeHandle as rt } from "react";
|
|
4
|
+
import { c as u } from "./index-DtaLkIY8.js";
|
|
5
|
+
import { P as Ye, p as Ge, o as Ke, z as oe, I as nt, J as ot, B as ue, K as st, L as ze, x as se, F as ae, y as ie, k as at, C as it, M as He, A as lt, W as ct, c as dt, N as ut } from "./week-view-vnIcmoVr.js";
|
|
6
|
+
import { j as ht, D as mt, I as ft, e as gt, S as xt } from "./slot-selection-context-BwghpxKA.js";
|
|
7
|
+
import { isToday as te, startOfDay as ye, endOfDay as qe, getYearMonths as pt, generateMonthGrid as vt, getEventsForDay as wt, addDays as Je, formatDateISO as bt } from "./utils.mjs";
|
|
8
|
+
function yt({ view: t, className: r = "" }) {
|
|
9
9
|
return /* @__PURE__ */ e(
|
|
10
10
|
"div",
|
|
11
11
|
{
|
|
@@ -29,49 +29,49 @@ function pt({ view: t, className: r = "" }) {
|
|
|
29
29
|
}
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return /* @__PURE__ */ e(
|
|
32
|
+
function Le({ view: t, className: r }) {
|
|
33
|
+
return /* @__PURE__ */ e(yt, { view: t, className: r });
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function Jr(t) {
|
|
36
36
|
const {
|
|
37
37
|
events: r,
|
|
38
38
|
resources: o,
|
|
39
39
|
scheduleTypes: s,
|
|
40
|
-
initialView:
|
|
41
|
-
initialDate:
|
|
40
|
+
initialView: a = "week",
|
|
41
|
+
initialDate: i,
|
|
42
42
|
initialFilters: g,
|
|
43
43
|
preferences: f,
|
|
44
|
-
locale:
|
|
44
|
+
locale: l,
|
|
45
45
|
slots: x,
|
|
46
|
-
renderEvent:
|
|
46
|
+
renderEvent: y,
|
|
47
47
|
onViewChange: p,
|
|
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: L,
|
|
49
|
+
onEventClick: A,
|
|
50
|
+
onSlotSelect: z,
|
|
51
|
+
onFiltersChange: j,
|
|
52
|
+
className: I,
|
|
53
|
+
children: C
|
|
54
|
+
} = t, T = Ue();
|
|
55
|
+
if (T)
|
|
56
|
+
return /* @__PURE__ */ e("div", { className: I, style: { position: "relative" }, children: C ?? /* @__PURE__ */ e(Le, { view: T.view, className: I }) });
|
|
57
|
+
const _ = Ze({
|
|
58
58
|
events: r,
|
|
59
59
|
resources: o,
|
|
60
60
|
scheduleTypes: s,
|
|
61
|
-
initialView:
|
|
62
|
-
initialDate:
|
|
61
|
+
initialView: a,
|
|
62
|
+
initialDate: i,
|
|
63
63
|
initialFilters: g,
|
|
64
64
|
preferences: f,
|
|
65
|
-
locale:
|
|
65
|
+
locale: l,
|
|
66
66
|
onViewChange: p,
|
|
67
|
-
onDateChange:
|
|
68
|
-
onEventClick:
|
|
69
|
-
onSlotSelect:
|
|
70
|
-
onFiltersChange:
|
|
67
|
+
onDateChange: L,
|
|
68
|
+
onEventClick: A,
|
|
69
|
+
onSlotSelect: z,
|
|
70
|
+
onFiltersChange: j
|
|
71
71
|
});
|
|
72
|
-
return /* @__PURE__ */ e(
|
|
72
|
+
return /* @__PURE__ */ e(et, { value: _, children: /* @__PURE__ */ e("div", { className: I, style: { position: "relative" }, children: C ?? /* @__PURE__ */ e(Le, { view: _.view, className: I }) }) });
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function kt({ className: t }) {
|
|
75
75
|
return /* @__PURE__ */ n(
|
|
76
76
|
"svg",
|
|
77
77
|
{
|
|
@@ -90,7 +90,7 @@ function vt({ className: t }) {
|
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function Xe({ className: t }) {
|
|
94
94
|
return /* @__PURE__ */ n(
|
|
95
95
|
"svg",
|
|
96
96
|
{
|
|
@@ -112,7 +112,7 @@ function Ye({ className: t }) {
|
|
|
112
112
|
}
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function we({ className: t }) {
|
|
116
116
|
return /* @__PURE__ */ n(
|
|
117
117
|
"svg",
|
|
118
118
|
{
|
|
@@ -131,7 +131,7 @@ function ge({ className: t }) {
|
|
|
131
131
|
}
|
|
132
132
|
);
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function Nt({ className: t }) {
|
|
135
135
|
return /* @__PURE__ */ n(
|
|
136
136
|
"svg",
|
|
137
137
|
{
|
|
@@ -150,7 +150,7 @@ function wt({ className: t }) {
|
|
|
150
150
|
}
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function ge({ className: t }) {
|
|
154
154
|
return /* @__PURE__ */ e(
|
|
155
155
|
"svg",
|
|
156
156
|
{
|
|
@@ -166,7 +166,7 @@ function he({ className: t }) {
|
|
|
166
166
|
}
|
|
167
167
|
);
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function Ct({ className: t }) {
|
|
170
170
|
return /* @__PURE__ */ n(
|
|
171
171
|
"svg",
|
|
172
172
|
{
|
|
@@ -185,7 +185,7 @@ function bt({ className: t }) {
|
|
|
185
185
|
}
|
|
186
186
|
);
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function Dt({ className: t }) {
|
|
189
189
|
return /* @__PURE__ */ e(
|
|
190
190
|
"svg",
|
|
191
191
|
{
|
|
@@ -201,7 +201,7 @@ function yt({ className: t }) {
|
|
|
201
201
|
}
|
|
202
202
|
);
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function Mt({ className: t }) {
|
|
205
205
|
return /* @__PURE__ */ n(
|
|
206
206
|
"svg",
|
|
207
207
|
{
|
|
@@ -222,7 +222,7 @@ function kt({ className: t }) {
|
|
|
222
222
|
}
|
|
223
223
|
);
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function St({ className: t }) {
|
|
226
226
|
return /* @__PURE__ */ n(
|
|
227
227
|
"svg",
|
|
228
228
|
{
|
|
@@ -241,7 +241,7 @@ function Nt({ className: t }) {
|
|
|
241
241
|
}
|
|
242
242
|
);
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function Et({ className: t }) {
|
|
245
245
|
return /* @__PURE__ */ n(
|
|
246
246
|
"svg",
|
|
247
247
|
{
|
|
@@ -262,7 +262,7 @@ function Ct({ className: t }) {
|
|
|
262
262
|
}
|
|
263
263
|
);
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function zt({ className: t }) {
|
|
266
266
|
return /* @__PURE__ */ n(
|
|
267
267
|
"svg",
|
|
268
268
|
{
|
|
@@ -284,7 +284,7 @@ function Dt({ className: t }) {
|
|
|
284
284
|
}
|
|
285
285
|
);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function he({ className: t }) {
|
|
288
288
|
return /* @__PURE__ */ e(
|
|
289
289
|
"svg",
|
|
290
290
|
{
|
|
@@ -295,12 +295,12 @@ function ce({ className: t }) {
|
|
|
295
295
|
strokeWidth: "2",
|
|
296
296
|
strokeLinecap: "round",
|
|
297
297
|
strokeLinejoin: "round",
|
|
298
|
-
className:
|
|
298
|
+
className: u("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 Ht = {
|
|
304
304
|
edit: "Edit",
|
|
305
305
|
delete: "Delete",
|
|
306
306
|
cancel: "Cancel Event",
|
|
@@ -325,39 +325,39 @@ const Mt = {
|
|
|
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: r, children: o, className: s, variant:
|
|
330
|
-
/* @__PURE__ */ e(
|
|
328
|
+
}, xe = be(
|
|
329
|
+
({ onClick: t, label: r, children: o, className: s, variant: a = "ghost", ...i }, g) => /* @__PURE__ */ n(se, { children: [
|
|
330
|
+
/* @__PURE__ */ e(ae, { asChild: !0, children: /* @__PURE__ */ e(
|
|
331
331
|
"button",
|
|
332
332
|
{
|
|
333
333
|
type: "button",
|
|
334
334
|
ref: g,
|
|
335
335
|
onClick: t,
|
|
336
|
-
className:
|
|
336
|
+
className: u(
|
|
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
|
s
|
|
341
341
|
),
|
|
342
342
|
"aria-label": r,
|
|
343
|
-
...
|
|
343
|
+
...i,
|
|
344
344
|
children: o
|
|
345
345
|
}
|
|
346
346
|
) }),
|
|
347
|
-
/* @__PURE__ */ e(
|
|
347
|
+
/* @__PURE__ */ e(ie, { side: "bottom", className: "text-xs", children: r })
|
|
348
348
|
] })
|
|
349
349
|
);
|
|
350
|
-
|
|
351
|
-
function
|
|
352
|
-
const [
|
|
350
|
+
xe.displayName = "IconButton";
|
|
351
|
+
function Lt({ src: t, alt: r, initials: o, className: s, isClient: a }) {
|
|
352
|
+
const [i, g] = de(!1);
|
|
353
353
|
return /* @__PURE__ */ e(
|
|
354
354
|
"div",
|
|
355
355
|
{
|
|
356
|
-
className:
|
|
356
|
+
className: u(
|
|
357
357
|
"relative h-7 w-7 rounded-full overflow-hidden shrink-0",
|
|
358
358
|
s
|
|
359
359
|
),
|
|
360
|
-
children: t && !
|
|
360
|
+
children: t && !i ? /* @__PURE__ */ e(
|
|
361
361
|
"img",
|
|
362
362
|
{
|
|
363
363
|
src: t,
|
|
@@ -368,9 +368,9 @@ function St({ src: t, alt: r, initials: o, className: s, isClient: i }) {
|
|
|
368
368
|
) : /* @__PURE__ */ e(
|
|
369
369
|
"div",
|
|
370
370
|
{
|
|
371
|
-
className:
|
|
371
|
+
className: u(
|
|
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: o
|
|
376
376
|
}
|
|
@@ -378,38 +378,38 @@ function St({ src: t, alt: r, initials: o, className: s, isClient: i }) {
|
|
|
378
378
|
}
|
|
379
379
|
);
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function Te({
|
|
382
382
|
participant: t,
|
|
383
383
|
isEventCanceled: r = !1,
|
|
384
384
|
labels: o
|
|
385
385
|
}) {
|
|
386
|
-
const s = t.name || "Unknown",
|
|
386
|
+
const s = t.name || "Unknown", a = s.split(" ").map((L) => L[0]).join("").toUpperCase().slice(0, 2), i = t.isOrganizer ?? !1, g = t.isConfirmed, f = g === !0, l = g === !1, x = t.isClient ?? !1, y = t.profilePicture || t.avatar, p = r;
|
|
387
387
|
return /* @__PURE__ */ n(
|
|
388
388
|
"div",
|
|
389
389
|
{
|
|
390
|
-
className:
|
|
390
|
+
className: u(
|
|
391
391
|
"flex items-center gap-3 py-0",
|
|
392
392
|
p && "opacity-60"
|
|
393
393
|
),
|
|
394
394
|
children: [
|
|
395
395
|
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
396
396
|
/* @__PURE__ */ e(
|
|
397
|
-
|
|
397
|
+
Lt,
|
|
398
398
|
{
|
|
399
|
-
src:
|
|
399
|
+
src: y,
|
|
400
400
|
alt: s,
|
|
401
|
-
initials:
|
|
401
|
+
initials: a,
|
|
402
402
|
isClient: x,
|
|
403
|
-
className:
|
|
403
|
+
className: u(p && "grayscale")
|
|
404
404
|
}
|
|
405
405
|
),
|
|
406
|
-
p ||
|
|
406
|
+
p || l ? /* @__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(we, { className: "h-2 w-2 text-red-600 dark:text-red-400 stroke-[3]" }) }) }) : f ? /* @__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(ge, { className: "h-2 w-2 text-green-600 dark:text-green-400 stroke-[3]" }) }) }) : null
|
|
407
407
|
] }),
|
|
408
408
|
/* @__PURE__ */ n("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: u(
|
|
413
413
|
"text-sm text-zinc-900 dark:text-zinc-100 truncate",
|
|
414
414
|
p && "line-through text-zinc-500 dark:text-zinc-500"
|
|
415
415
|
),
|
|
@@ -417,25 +417,25 @@ function Se({
|
|
|
417
417
|
}
|
|
418
418
|
) }),
|
|
419
419
|
x && /* @__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: o.client }),
|
|
420
|
-
|
|
420
|
+
i && !p && /* @__PURE__ */ e("div", { className: "text-xs text-zinc-500", children: o.organizer })
|
|
421
421
|
] })
|
|
422
422
|
]
|
|
423
423
|
}
|
|
424
424
|
);
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function Tt({
|
|
427
427
|
open: t,
|
|
428
428
|
onOpenChange: r,
|
|
429
429
|
title: o,
|
|
430
430
|
children: s
|
|
431
431
|
}) {
|
|
432
|
-
return
|
|
432
|
+
return pe(() => {
|
|
433
433
|
if (!t) return;
|
|
434
|
-
const
|
|
435
|
-
|
|
434
|
+
const a = (i) => {
|
|
435
|
+
i.key === "Escape" && r(!1);
|
|
436
436
|
};
|
|
437
|
-
return document.addEventListener("keydown",
|
|
438
|
-
}, [t, r]),
|
|
437
|
+
return document.addEventListener("keydown", a), () => document.removeEventListener("keydown", a);
|
|
438
|
+
}, [t, r]), pe(() => (t ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
439
439
|
document.body.style.overflow = "";
|
|
440
440
|
}), [t]), t ? /* @__PURE__ */ n("div", { className: "fixed inset-0 z-50", children: [
|
|
441
441
|
/* @__PURE__ */ e(
|
|
@@ -443,8 +443,8 @@ function Et({
|
|
|
443
443
|
{
|
|
444
444
|
className: "fixed inset-0 bg-black/50 backdrop-blur-sm",
|
|
445
445
|
onClick: () => r(!1),
|
|
446
|
-
onKeyDown: (
|
|
447
|
-
(
|
|
446
|
+
onKeyDown: (a) => {
|
|
447
|
+
(a.key === "Enter" || a.key === " ") && r(!1);
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
),
|
|
@@ -454,13 +454,13 @@ function Et({
|
|
|
454
454
|
] }) })
|
|
455
455
|
] }) : null;
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function It({
|
|
458
458
|
open: t,
|
|
459
459
|
onOpenChange: r,
|
|
460
460
|
title: o,
|
|
461
461
|
description: s,
|
|
462
|
-
cancelLabel:
|
|
463
|
-
confirmLabel:
|
|
462
|
+
cancelLabel: a,
|
|
463
|
+
confirmLabel: i,
|
|
464
464
|
onConfirm: g,
|
|
465
465
|
isLoading: f
|
|
466
466
|
}) {
|
|
@@ -470,8 +470,8 @@ function zt({
|
|
|
470
470
|
{
|
|
471
471
|
className: "fixed inset-0 bg-black/50 backdrop-blur-sm",
|
|
472
472
|
onClick: () => r(!1),
|
|
473
|
-
onKeyDown: (
|
|
474
|
-
(
|
|
473
|
+
onKeyDown: (l) => {
|
|
474
|
+
(l.key === "Enter" || l.key === " ") && r(!1);
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
477
|
),
|
|
@@ -480,25 +480,25 @@ function zt({
|
|
|
480
480
|
/* @__PURE__ */ e("p", { className: "mt-2 text-sm text-zinc-600 dark:text-zinc-400", children: s }),
|
|
481
481
|
/* @__PURE__ */ n("div", { className: "mt-4 flex justify-end gap-3", children: [
|
|
482
482
|
/* @__PURE__ */ e(
|
|
483
|
-
|
|
483
|
+
ue,
|
|
484
484
|
{
|
|
485
485
|
variant: "outline",
|
|
486
486
|
size: "sm",
|
|
487
487
|
onClick: () => r(!1),
|
|
488
|
-
children:
|
|
488
|
+
children: a
|
|
489
489
|
}
|
|
490
490
|
),
|
|
491
491
|
/* @__PURE__ */ n(
|
|
492
|
-
|
|
492
|
+
ue,
|
|
493
493
|
{
|
|
494
494
|
variant: "destructive",
|
|
495
495
|
size: "sm",
|
|
496
496
|
onClick: g,
|
|
497
497
|
disabled: f,
|
|
498
498
|
children: [
|
|
499
|
-
f && /* @__PURE__ */ e(
|
|
500
|
-
/* @__PURE__ */ e(
|
|
501
|
-
|
|
499
|
+
f && /* @__PURE__ */ e(he, { className: "h-4 w-4 mr-2" }),
|
|
500
|
+
/* @__PURE__ */ e(Xe, { className: "h-4 w-4 mr-2" }),
|
|
501
|
+
i
|
|
502
502
|
]
|
|
503
503
|
}
|
|
504
504
|
)
|
|
@@ -506,14 +506,14 @@ function zt({
|
|
|
506
506
|
] }) })
|
|
507
507
|
] }) : null;
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function jt(t, r) {
|
|
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 Wt(t, r) {
|
|
517
517
|
const o = {
|
|
518
518
|
hour: "2-digit",
|
|
519
519
|
minute: "2-digit",
|
|
@@ -521,7 +521,7 @@ function Lt(t, r) {
|
|
|
521
521
|
};
|
|
522
522
|
return `${t.toLocaleTimeString(void 0, o)} – ${r.toLocaleTimeString(void 0, o)}`;
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function At(t) {
|
|
525
525
|
return t.toLocaleDateString(void 0, {
|
|
526
526
|
day: "2-digit",
|
|
527
527
|
month: "short",
|
|
@@ -530,73 +530,73 @@ function Tt(t) {
|
|
|
530
530
|
minute: "2-digit"
|
|
531
531
|
});
|
|
532
532
|
}
|
|
533
|
-
function
|
|
534
|
-
const [r, o] =
|
|
535
|
-
return
|
|
533
|
+
function Ft(t) {
|
|
534
|
+
const [r, o] = de(() => typeof window < "u" ? window.matchMedia(t).matches : !1);
|
|
535
|
+
return pe(() => {
|
|
536
536
|
if (typeof window > "u") return;
|
|
537
|
-
const s = window.matchMedia(t),
|
|
538
|
-
return s.addEventListener("change",
|
|
537
|
+
const s = window.matchMedia(t), a = (i) => o(i.matches);
|
|
538
|
+
return s.addEventListener("change", a), () => s.removeEventListener("change", a);
|
|
539
539
|
}, [t]), r;
|
|
540
540
|
}
|
|
541
|
-
function
|
|
541
|
+
function Ie({
|
|
542
542
|
event: t,
|
|
543
543
|
labels: r,
|
|
544
544
|
isLoading: o,
|
|
545
545
|
onClose: s,
|
|
546
|
-
onEdit:
|
|
547
|
-
onDelete:
|
|
546
|
+
onEdit: a,
|
|
547
|
+
onDelete: i,
|
|
548
548
|
onCancel: g,
|
|
549
549
|
onAccept: f,
|
|
550
|
-
onDecline:
|
|
550
|
+
onDecline: l,
|
|
551
551
|
onConfirmMeeting: x,
|
|
552
|
-
canEdit:
|
|
552
|
+
canEdit: y = !0,
|
|
553
553
|
canDelete: p = !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: L = !0,
|
|
555
|
+
isCurrentUserParticipant: A = !1,
|
|
556
|
+
isCurrentUserClient: z = !1,
|
|
557
|
+
currentUserAcceptStatus: j,
|
|
558
|
+
isAcceptLoading: I = !1,
|
|
559
|
+
isDeclineLoading: C = !1,
|
|
560
|
+
isConfirmLoading: T = !1,
|
|
561
|
+
isDeleteLoading: _ = !1,
|
|
562
|
+
renderParticipant: Y,
|
|
563
|
+
renderHeaderActions: w,
|
|
564
|
+
renderCancelReason: W,
|
|
565
|
+
renderDeleteConfirmation: F,
|
|
566
|
+
formatDate: P = jt,
|
|
567
|
+
formatTimeRange: K = Wt
|
|
568
568
|
}) {
|
|
569
|
-
const [
|
|
570
|
-
s(),
|
|
571
|
-
},
|
|
569
|
+
const [q, V] = de(!1), B = !(t.isCanceled || t.meetingTookPlace), m = t.isRecurring ?? !1, b = t.participantDetails, E = t.participantsNames || [], $ = b && b.length > 0, H = j === !0, Q = j === !1, re = A && !z && B, c = $ ? b.filter((R) => R.isConfirmed).length : t.isAccepted ? E.length : 0, h = $ ? b.length : E.length, v = t.scheduleTypeColor || t.hexColor || "#039BE5", S = X(() => t.startDate ? P(t.startDate) : r.noDateProvided, [t.startDate, P, r.noDateProvided]), k = X(() => t.startDate && t.endDate ? K(t.startDate, t.endDate) : null, [t.startDate, t.endDate, K]), D = () => {
|
|
570
|
+
s(), a?.(t);
|
|
571
|
+
}, M = () => {
|
|
572
572
|
s(), g?.(t);
|
|
573
|
-
},
|
|
574
|
-
|
|
575
|
-
},
|
|
576
|
-
|
|
573
|
+
}, J = () => {
|
|
574
|
+
V(!0);
|
|
575
|
+
}, Z = () => {
|
|
576
|
+
i?.(t), V(!1);
|
|
577
577
|
};
|
|
578
|
-
return o ? /* @__PURE__ */ e("div", { className: "flex h-48 items-center justify-center", children: /* @__PURE__ */ e(
|
|
578
|
+
return o ? /* @__PURE__ */ e("div", { className: "flex h-48 items-center justify-center", children: /* @__PURE__ */ e(he, { className: "h-6 w-6 text-zinc-400" }) }) : /* @__PURE__ */ n(oe, { delayDuration: 300, children: [
|
|
579
579
|
/* @__PURE__ */ n("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
|
-
p &&
|
|
584
|
-
|
|
580
|
+
/* @__PURE__ */ e("div", { className: "flex items-start justify-end gap-0.5", children: w ? w({ onClose: s }) : /* @__PURE__ */ n(ce, { children: [
|
|
581
|
+
B && y && a && /* @__PURE__ */ e(xe, { onClick: D, label: r.edit, children: /* @__PURE__ */ e(kt, { className: "h-[18px] w-[18px]" }) }),
|
|
582
|
+
B && L && g && /* @__PURE__ */ e(xe, { onClick: M, label: r.cancel, children: /* @__PURE__ */ e(Nt, { className: "h-[18px] w-[18px]" }) }),
|
|
583
|
+
p && i && /* @__PURE__ */ e(
|
|
584
|
+
xe,
|
|
585
585
|
{
|
|
586
|
-
onClick:
|
|
586
|
+
onClick: J,
|
|
587
587
|
label: r.delete,
|
|
588
588
|
variant: "destructive",
|
|
589
|
-
children: /* @__PURE__ */ e(
|
|
589
|
+
children: /* @__PURE__ */ e(Xe, { className: "h-[18px] w-[18px]" })
|
|
590
590
|
}
|
|
591
591
|
),
|
|
592
|
-
/* @__PURE__ */ e(
|
|
592
|
+
/* @__PURE__ */ e(xe, { onClick: s, label: r.close, children: /* @__PURE__ */ e(we, { className: "h-[18px] w-[18px]" }) })
|
|
593
593
|
] }) }),
|
|
594
594
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ n("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: v }
|
|
600
600
|
}
|
|
601
601
|
),
|
|
602
602
|
/* @__PURE__ */ n("div", { className: "flex-1 min-w-0", children: [
|
|
@@ -604,7 +604,7 @@ function Ee({
|
|
|
604
604
|
/* @__PURE__ */ e(
|
|
605
605
|
"h2",
|
|
606
606
|
{
|
|
607
|
-
className:
|
|
607
|
+
className: u(
|
|
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 Ee({
|
|
|
612
612
|
}
|
|
613
613
|
),
|
|
614
614
|
t.meetingTookPlace && /* @__PURE__ */ n("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(Ct, { className: "h-3 w-3" }),
|
|
616
616
|
r.completed
|
|
617
617
|
] }),
|
|
618
618
|
t.isCanceled && /* @__PURE__ */ n("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(we, { className: "h-3 w-3" }),
|
|
620
620
|
r.canceled
|
|
621
621
|
] })
|
|
622
622
|
] }),
|
|
623
623
|
/* @__PURE__ */ n("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: S() }),
|
|
625
|
+
k() && /* @__PURE__ */ n(ce, { children: [
|
|
626
626
|
/* @__PURE__ */ e("span", { className: "mx-1.5", children: "·" }),
|
|
627
|
-
/* @__PURE__ */ e("span", { children:
|
|
627
|
+
/* @__PURE__ */ e("span", { children: k() })
|
|
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: W ? W(t) : /* @__PURE__ */ e("div", { className: "flex items-start gap-0", children: /* @__PURE__ */ n("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: r.cancellationNote }),
|
|
635
635
|
t.cancelReason && /* @__PURE__ */ n("div", { className: "mt-1 text-sm text-red-600/80 dark:text-red-400/80 italic", children: [
|
|
636
636
|
'"',
|
|
@@ -640,64 +640,64 @@ function Ee({
|
|
|
640
640
|
t.canceledDate && /* @__PURE__ */ n("div", { className: "mt-1.5 text-xs text-red-500/70 dark:text-red-400/60", children: [
|
|
641
641
|
r.canceledOn,
|
|
642
642
|
" ",
|
|
643
|
-
|
|
643
|
+
At(t.canceledDate)
|
|
644
644
|
] })
|
|
645
645
|
] }) }) }),
|
|
646
646
|
/* @__PURE__ */ n("div", { className: "space-y-0.5", children: [
|
|
647
647
|
t.address && /* @__PURE__ */ n("div", { className: "flex items-start gap-2", children: [
|
|
648
|
-
/* @__PURE__ */ e(
|
|
648
|
+
/* @__PURE__ */ e(St, { 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.length > 0) && /* @__PURE__ */ n("div", { className: "flex items-start gap-2 py-0", children: [
|
|
652
|
+
/* @__PURE__ */ e(Mt, { className: "h-5 w-5 text-zinc-400 mt-0.5 shrink-0" }),
|
|
653
653
|
/* @__PURE__ */ n("div", { className: "flex-1", children: [
|
|
654
654
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-0", children: [
|
|
655
655
|
/* @__PURE__ */ n("span", { className: "text-sm text-zinc-900 dark:text-zinc-100 font-medium", children: [
|
|
656
|
-
|
|
656
|
+
h,
|
|
657
657
|
" ",
|
|
658
|
-
|
|
658
|
+
h !== 1 ? r.guests : r.guest
|
|
659
659
|
] }),
|
|
660
|
-
|
|
660
|
+
h > 0 && /* @__PURE__ */ n("span", { className: "text-xs text-zinc-500", children: [
|
|
661
661
|
"(",
|
|
662
|
-
|
|
662
|
+
c,
|
|
663
663
|
" ",
|
|
664
664
|
r.confirmed,
|
|
665
665
|
")"
|
|
666
666
|
] })
|
|
667
667
|
] }),
|
|
668
668
|
/* @__PURE__ */ n("div", { className: "mt-2 space-y-2", children: [
|
|
669
|
-
|
|
670
|
-
(
|
|
671
|
-
|
|
669
|
+
$ ? b.slice(0, 6).map(
|
|
670
|
+
(R, d) => Y ? Y(R, d) : /* @__PURE__ */ e(
|
|
671
|
+
Te,
|
|
672
672
|
{
|
|
673
|
-
participant:
|
|
673
|
+
participant: R,
|
|
674
674
|
isEventCanceled: t.isCanceled,
|
|
675
675
|
labels: r
|
|
676
676
|
},
|
|
677
|
-
|
|
677
|
+
R.id
|
|
678
678
|
)
|
|
679
|
-
) :
|
|
680
|
-
const
|
|
681
|
-
id: String(
|
|
682
|
-
name:
|
|
679
|
+
) : E.slice(0, 6).map((R, d) => {
|
|
680
|
+
const N = {
|
|
681
|
+
id: String(d),
|
|
682
|
+
name: R,
|
|
683
683
|
email: "",
|
|
684
684
|
isConfirmed: t.isAccepted,
|
|
685
|
-
isOrganizer:
|
|
685
|
+
isOrganizer: d === 0,
|
|
686
686
|
isClient: !1
|
|
687
687
|
};
|
|
688
|
-
return
|
|
689
|
-
|
|
688
|
+
return Y ? Y(N, d) : /* @__PURE__ */ e(
|
|
689
|
+
Te,
|
|
690
690
|
{
|
|
691
|
-
participant:
|
|
691
|
+
participant: N,
|
|
692
692
|
isEventCanceled: t.isCanceled,
|
|
693
693
|
labels: r
|
|
694
694
|
},
|
|
695
|
-
|
|
695
|
+
R
|
|
696
696
|
);
|
|
697
697
|
}),
|
|
698
|
-
|
|
698
|
+
h > 6 && /* @__PURE__ */ n("div", { className: "text-xs text-zinc-500 py-1.5 pl-10", children: [
|
|
699
699
|
"+",
|
|
700
|
-
|
|
700
|
+
h - 6,
|
|
701
701
|
" ",
|
|
702
702
|
r.more
|
|
703
703
|
] })
|
|
@@ -705,282 +705,282 @@ function Ee({
|
|
|
705
705
|
] })
|
|
706
706
|
] }),
|
|
707
707
|
t.description && /* @__PURE__ */ n("div", { className: "flex items-start gap-2", children: [
|
|
708
|
-
/* @__PURE__ */ e(
|
|
708
|
+
/* @__PURE__ */ e(zt, { 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__ */ n("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(Et, { 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: $ && b.find((R) => R.isOrganizer)?.name || E[0] || "Calendar" })
|
|
714
714
|
] })
|
|
715
715
|
] }),
|
|
716
|
-
|
|
717
|
-
m ? /* @__PURE__ */ n(
|
|
718
|
-
/* @__PURE__ */ e(
|
|
716
|
+
re && f && l && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 mt-3 py-3", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
717
|
+
m ? /* @__PURE__ */ n(nt, { children: [
|
|
718
|
+
/* @__PURE__ */ e(ot, { asChild: !0, children: /* @__PURE__ */ n("div", { className: "flex", children: [
|
|
719
719
|
/* @__PURE__ */ e(
|
|
720
|
-
|
|
720
|
+
ue,
|
|
721
721
|
{
|
|
722
722
|
size: "sm",
|
|
723
723
|
variant: "outline",
|
|
724
|
-
className:
|
|
724
|
+
className: u(
|
|
725
725
|
"rounded-r-none gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
|
|
726
|
-
|
|
726
|
+
H && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
727
727
|
),
|
|
728
|
-
onClick: (
|
|
729
|
-
|
|
728
|
+
onClick: (R) => {
|
|
729
|
+
R.stopPropagation(), H || f(t);
|
|
730
730
|
},
|
|
731
|
-
disabled:
|
|
732
|
-
children:
|
|
733
|
-
|
|
731
|
+
disabled: I,
|
|
732
|
+
children: I ? /* @__PURE__ */ e(he, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ n(ce, { children: [
|
|
733
|
+
H && /* @__PURE__ */ e(ge, { className: "h-3.5 w-3.5" }),
|
|
734
734
|
r.going
|
|
735
735
|
] })
|
|
736
736
|
}
|
|
737
737
|
),
|
|
738
738
|
/* @__PURE__ */ e(
|
|
739
|
-
|
|
739
|
+
ue,
|
|
740
740
|
{
|
|
741
741
|
size: "sm",
|
|
742
742
|
variant: "outline",
|
|
743
|
-
className:
|
|
743
|
+
className: u(
|
|
744
744
|
"rounded-l-none px-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
|
|
745
|
-
|
|
745
|
+
H && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
746
746
|
),
|
|
747
|
-
children: /* @__PURE__ */ e(
|
|
747
|
+
children: /* @__PURE__ */ e(Dt, { className: "h-3.5 w-3.5" })
|
|
748
748
|
}
|
|
749
749
|
)
|
|
750
750
|
] }) }),
|
|
751
|
-
/* @__PURE__ */ n(
|
|
751
|
+
/* @__PURE__ */ n(st, { align: "start", children: [
|
|
752
752
|
/* @__PURE__ */ n(
|
|
753
|
-
|
|
753
|
+
ze,
|
|
754
754
|
{
|
|
755
|
-
className:
|
|
755
|
+
className: u(
|
|
756
756
|
"gap-1.5 h-8 !border-none !bg-green-50 text-green-800 hover:!bg-green-100",
|
|
757
|
-
|
|
757
|
+
H && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
758
758
|
),
|
|
759
759
|
onClick: () => f(t),
|
|
760
760
|
children: [
|
|
761
|
-
/* @__PURE__ */ e(
|
|
761
|
+
/* @__PURE__ */ e(ge, { className: "h-3.5 w-3.5 mr-2 text-green-600" }),
|
|
762
762
|
r.acceptThisEvent
|
|
763
763
|
]
|
|
764
764
|
}
|
|
765
765
|
),
|
|
766
|
-
/* @__PURE__ */ n(
|
|
767
|
-
/* @__PURE__ */ e(
|
|
766
|
+
/* @__PURE__ */ n(ze, { onClick: () => f(t), children: [
|
|
767
|
+
/* @__PURE__ */ e(ge, { className: "h-3.5 w-3.5 mr-2 text-green-600" }),
|
|
768
768
|
r.acceptAllEvents
|
|
769
769
|
] })
|
|
770
770
|
] })
|
|
771
771
|
] }) : /* @__PURE__ */ e(
|
|
772
|
-
|
|
772
|
+
ue,
|
|
773
773
|
{
|
|
774
774
|
size: "sm",
|
|
775
775
|
variant: "outline",
|
|
776
|
-
className:
|
|
776
|
+
className: u(
|
|
777
777
|
"gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",
|
|
778
|
-
|
|
778
|
+
H && "!bg-green-700 !text-white hover:!bg-green-700"
|
|
779
779
|
),
|
|
780
780
|
onClick: () => {
|
|
781
|
-
|
|
781
|
+
H || f(t);
|
|
782
782
|
},
|
|
783
|
-
disabled:
|
|
784
|
-
children:
|
|
785
|
-
|
|
783
|
+
disabled: I,
|
|
784
|
+
children: I ? /* @__PURE__ */ e(he, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ n(ce, { children: [
|
|
785
|
+
H && /* @__PURE__ */ e(ge, { className: "h-3.5 w-3.5" }),
|
|
786
786
|
r.going
|
|
787
787
|
] })
|
|
788
788
|
}
|
|
789
789
|
),
|
|
790
790
|
/* @__PURE__ */ e(
|
|
791
|
-
|
|
791
|
+
ue,
|
|
792
792
|
{
|
|
793
793
|
size: "sm",
|
|
794
794
|
variant: "outline",
|
|
795
|
-
className:
|
|
795
|
+
className: u(
|
|
796
796
|
"gap-1.5 h-8 !border-none !bg-rose-100 text-rose-800 hover:!bg-rose-200",
|
|
797
|
-
|
|
797
|
+
Q && "!bg-rose-700 !text-white hover:!bg-rose-700"
|
|
798
798
|
),
|
|
799
799
|
onClick: () => {
|
|
800
|
-
|
|
800
|
+
Q || l(t);
|
|
801
801
|
},
|
|
802
|
-
disabled:
|
|
803
|
-
children:
|
|
804
|
-
|
|
802
|
+
disabled: C,
|
|
803
|
+
children: C ? /* @__PURE__ */ e(he, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ n(ce, { children: [
|
|
804
|
+
Q && /* @__PURE__ */ e(we, { className: "h-3.5 w-3.5" }),
|
|
805
805
|
r.notGoing
|
|
806
806
|
] })
|
|
807
807
|
}
|
|
808
808
|
)
|
|
809
809
|
] }) }),
|
|
810
|
-
|
|
811
|
-
|
|
810
|
+
A && H && !t.meetingTookPlace && !t.isCanceled && x && /* @__PURE__ */ e("div", { className: "border-t border-zinc-100 dark:border-zinc-800 py-3", children: /* @__PURE__ */ n(
|
|
811
|
+
ue,
|
|
812
812
|
{
|
|
813
813
|
size: "sm",
|
|
814
814
|
variant: "outline",
|
|
815
815
|
className: "w-full h-9 hover:!bg-green-100 hover:text-green-700 text-green-700 !bg-green-100 !border-none dark:text-green-400 dark:hover:bg-green-950/30",
|
|
816
816
|
onClick: () => x(t),
|
|
817
|
-
disabled:
|
|
817
|
+
disabled: T,
|
|
818
818
|
children: [
|
|
819
|
-
|
|
819
|
+
T && /* @__PURE__ */ e(he, { className: "h-4 w-4 mr-2" }),
|
|
820
820
|
r.confirmMeeting
|
|
821
821
|
]
|
|
822
822
|
}
|
|
823
823
|
) })
|
|
824
824
|
] }),
|
|
825
|
-
|
|
826
|
-
onConfirm:
|
|
827
|
-
onCancel: () =>
|
|
828
|
-
isLoading:
|
|
825
|
+
F ? q && F({
|
|
826
|
+
onConfirm: Z,
|
|
827
|
+
onCancel: () => V(!1),
|
|
828
|
+
isLoading: _
|
|
829
829
|
}) : /* @__PURE__ */ e(
|
|
830
|
-
|
|
830
|
+
It,
|
|
831
831
|
{
|
|
832
|
-
open:
|
|
833
|
-
onOpenChange:
|
|
832
|
+
open: q,
|
|
833
|
+
onOpenChange: V,
|
|
834
834
|
title: r.deleteConfirmTitle,
|
|
835
835
|
description: r.deleteConfirmDescription,
|
|
836
836
|
cancelLabel: r.cancel,
|
|
837
837
|
confirmLabel: r.delete,
|
|
838
|
-
onConfirm:
|
|
839
|
-
isLoading:
|
|
838
|
+
onConfirm: Z,
|
|
839
|
+
isLoading: _
|
|
840
840
|
}
|
|
841
841
|
)
|
|
842
842
|
] });
|
|
843
843
|
}
|
|
844
|
-
function
|
|
844
|
+
function Xr({
|
|
845
845
|
event: t,
|
|
846
846
|
children: r,
|
|
847
847
|
open: o,
|
|
848
848
|
onOpenChange: s,
|
|
849
|
-
isLoading:
|
|
850
|
-
labels:
|
|
849
|
+
isLoading: a,
|
|
850
|
+
labels: i,
|
|
851
851
|
onEdit: g,
|
|
852
852
|
onDelete: f,
|
|
853
|
-
onCancel:
|
|
853
|
+
onCancel: l,
|
|
854
854
|
onAccept: x,
|
|
855
|
-
onDecline:
|
|
855
|
+
onDecline: y,
|
|
856
856
|
onConfirmMeeting: p,
|
|
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:
|
|
857
|
+
canEdit: L = !0,
|
|
858
|
+
canDelete: A = !1,
|
|
859
|
+
canCancel: z = !0,
|
|
860
|
+
isCurrentUserParticipant: j,
|
|
861
|
+
isCurrentUserClient: I,
|
|
862
|
+
currentUserAcceptStatus: C,
|
|
863
|
+
isAcceptLoading: T,
|
|
864
|
+
isDeclineLoading: _,
|
|
865
|
+
isConfirmLoading: Y,
|
|
866
|
+
isDeleteLoading: w,
|
|
867
|
+
renderParticipant: W,
|
|
868
|
+
renderHeaderActions: F,
|
|
869
|
+
renderCancelReason: P,
|
|
870
|
+
renderDeleteConfirmation: K,
|
|
871
|
+
formatDate: q,
|
|
872
|
+
formatTimeRange: V,
|
|
873
|
+
className: B,
|
|
874
874
|
width: m = 360
|
|
875
875
|
}) {
|
|
876
|
-
const
|
|
876
|
+
const b = Ft("(min-width: 768px)"), E = { ...Ht, ...i }, $ = X(() => {
|
|
877
877
|
s?.(!1);
|
|
878
|
-
}, [s]),
|
|
878
|
+
}, [s]), H = {
|
|
879
879
|
event: t,
|
|
880
|
-
labels:
|
|
881
|
-
isLoading:
|
|
882
|
-
onClose:
|
|
880
|
+
labels: E,
|
|
881
|
+
isLoading: a,
|
|
882
|
+
onClose: $,
|
|
883
883
|
onEdit: g,
|
|
884
884
|
onDelete: f,
|
|
885
|
-
onCancel:
|
|
885
|
+
onCancel: l,
|
|
886
886
|
onAccept: x,
|
|
887
|
-
onDecline:
|
|
887
|
+
onDecline: y,
|
|
888
888
|
onConfirmMeeting: p,
|
|
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: L,
|
|
890
|
+
canDelete: A,
|
|
891
|
+
canCancel: z,
|
|
892
|
+
isCurrentUserParticipant: j,
|
|
893
|
+
isCurrentUserClient: I,
|
|
894
|
+
currentUserAcceptStatus: C,
|
|
895
|
+
isAcceptLoading: T,
|
|
896
|
+
isDeclineLoading: _,
|
|
897
|
+
isConfirmLoading: Y,
|
|
898
|
+
isDeleteLoading: w,
|
|
899
|
+
renderParticipant: W,
|
|
900
|
+
renderHeaderActions: F,
|
|
901
|
+
renderCancelReason: P,
|
|
902
|
+
renderDeleteConfirmation: K,
|
|
903
|
+
formatDate: q,
|
|
904
|
+
formatTimeRange: V
|
|
905
905
|
};
|
|
906
|
-
return
|
|
906
|
+
return b ? /* @__PURE__ */ n(Ye, { open: o ?? !1, onOpenChange: s ?? (() => {
|
|
907
907
|
}), children: [
|
|
908
|
-
/* @__PURE__ */ e(
|
|
908
|
+
/* @__PURE__ */ e(Ge, { asChild: !0, children: r }),
|
|
909
909
|
/* @__PURE__ */ e(
|
|
910
|
-
|
|
910
|
+
Ke,
|
|
911
911
|
{
|
|
912
|
-
className:
|
|
912
|
+
className: u(
|
|
913
913
|
"p-0 shadow-lg !rounded-2xl bg-white dark:bg-zinc-900 overflow-hidden border z-50",
|
|
914
|
-
|
|
914
|
+
B
|
|
915
915
|
),
|
|
916
916
|
style: { width: m },
|
|
917
917
|
align: "center",
|
|
918
918
|
side: "bottom",
|
|
919
919
|
sideOffset: 4,
|
|
920
|
-
children: /* @__PURE__ */ e(
|
|
920
|
+
children: /* @__PURE__ */ e(Ie, { ...H })
|
|
921
921
|
}
|
|
922
922
|
)
|
|
923
|
-
] }) : /* @__PURE__ */ n(
|
|
923
|
+
] }) : /* @__PURE__ */ n(ce, { children: [
|
|
924
924
|
r,
|
|
925
925
|
/* @__PURE__ */ e(
|
|
926
|
-
|
|
926
|
+
Tt,
|
|
927
927
|
{
|
|
928
928
|
open: o ?? !1,
|
|
929
929
|
onOpenChange: s ?? (() => {
|
|
930
930
|
}),
|
|
931
931
|
title: t.title,
|
|
932
|
-
children: /* @__PURE__ */ e(
|
|
932
|
+
children: /* @__PURE__ */ e(Ie, { ...H })
|
|
933
933
|
}
|
|
934
934
|
)
|
|
935
935
|
] });
|
|
936
936
|
}
|
|
937
|
-
const
|
|
938
|
-
function
|
|
937
|
+
const Ne = 44, je = 4, Bt = 56, We = 8, Ce = 80, me = 140, Ae = 100, Fe = 2, $t = 8, Ot = 18;
|
|
938
|
+
function _t(t) {
|
|
939
939
|
return t.split(" ").map((r) => r[0]).join("").toUpperCase().slice(0, 2);
|
|
940
940
|
}
|
|
941
|
-
function
|
|
941
|
+
function Pt(t, r) {
|
|
942
942
|
const o = [];
|
|
943
943
|
for (let s = 0; s < r; s++) {
|
|
944
|
-
const
|
|
945
|
-
|
|
944
|
+
const a = new Date(t);
|
|
945
|
+
a.setDate(a.getDate() + s), o.push(a);
|
|
946
946
|
}
|
|
947
947
|
return o;
|
|
948
948
|
}
|
|
949
|
-
function
|
|
949
|
+
function Rt(t, r, o) {
|
|
950
950
|
const s = [];
|
|
951
|
-
return t.forEach((
|
|
951
|
+
return t.forEach((a, i) => {
|
|
952
952
|
for (let g = r; g < o; g++)
|
|
953
|
-
s.push({ hour: g, dayIndex:
|
|
953
|
+
s.push({ hour: g, dayIndex: i, date: a });
|
|
954
954
|
}), s;
|
|
955
955
|
}
|
|
956
|
-
function
|
|
956
|
+
function Vt(t) {
|
|
957
957
|
return `${t.toString().padStart(2, "0")}:00`;
|
|
958
958
|
}
|
|
959
|
-
function
|
|
959
|
+
function Ut(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 r = [...t].sort((
|
|
968
|
-
for (const
|
|
969
|
-
let
|
|
970
|
-
for (; s[
|
|
971
|
-
|
|
972
|
-
s[
|
|
973
|
-
...
|
|
974
|
-
stackIndex:
|
|
966
|
+
function Be(t) {
|
|
967
|
+
const r = [...t].sort((a, i) => a.startCol !== i.startCol ? a.startCol - i.startCol : i.spanCols - a.spanCols), o = [], s = [];
|
|
968
|
+
for (const a of r) {
|
|
969
|
+
let i = 0;
|
|
970
|
+
for (; s[i] !== void 0 && s[i] > a.startCol; )
|
|
971
|
+
i++;
|
|
972
|
+
s[i] = a.startCol + a.spanCols, o.push({
|
|
973
|
+
...a,
|
|
974
|
+
stackIndex: i
|
|
975
975
|
});
|
|
976
976
|
}
|
|
977
977
|
return o;
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function Yt({ src: t, alt: r, fallback: o, className: s }) {
|
|
980
980
|
return /* @__PURE__ */ e(
|
|
981
981
|
"div",
|
|
982
982
|
{
|
|
983
|
-
className:
|
|
983
|
+
className: u(
|
|
984
984
|
"relative flex shrink-0 overflow-hidden rounded-sm border bg-muted",
|
|
985
985
|
s
|
|
986
986
|
),
|
|
@@ -995,213 +995,251 @@ function _t({ src: t, alt: r, fallback: o, className: s }) {
|
|
|
995
995
|
}
|
|
996
996
|
);
|
|
997
997
|
}
|
|
998
|
-
const
|
|
999
|
-
function
|
|
1000
|
-
daysToShow: t =
|
|
998
|
+
const Gt = 7;
|
|
999
|
+
function fe({
|
|
1000
|
+
daysToShow: t = Gt,
|
|
1001
1001
|
events: r,
|
|
1002
1002
|
users: o = [],
|
|
1003
1003
|
selectedDate: s,
|
|
1004
|
-
onDateChange:
|
|
1005
|
-
onEventClick:
|
|
1004
|
+
onDateChange: a,
|
|
1005
|
+
onEventClick: i,
|
|
1006
1006
|
visibleHours: g,
|
|
1007
1007
|
className: f,
|
|
1008
|
-
getEventUserId:
|
|
1008
|
+
getEventUserId: l,
|
|
1009
1009
|
renderPopover: x,
|
|
1010
|
-
slots:
|
|
1011
|
-
classNames: p
|
|
1010
|
+
slots: y,
|
|
1011
|
+
classNames: p,
|
|
1012
|
+
enableDrag: L = !0
|
|
1012
1013
|
}) {
|
|
1013
|
-
const
|
|
1014
|
-
const
|
|
1014
|
+
const A = Ee(null), z = ht(), j = s ?? /* @__PURE__ */ new Date(), I = !0, C = g?.from ?? $t, T = g?.to ?? Ot, _ = T - C, Y = U(() => {
|
|
1015
|
+
const c = new Date(j);
|
|
1015
1016
|
if (t === 1 || t === 3)
|
|
1016
|
-
return
|
|
1017
|
-
const
|
|
1018
|
-
return
|
|
1019
|
-
}, [
|
|
1020
|
-
() =>
|
|
1021
|
-
[
|
|
1022
|
-
),
|
|
1023
|
-
() =>
|
|
1024
|
-
[
|
|
1025
|
-
),
|
|
1026
|
-
if (
|
|
1027
|
-
const
|
|
1028
|
-
if (
|
|
1029
|
-
if (
|
|
1030
|
-
return String(
|
|
1031
|
-
if (
|
|
1032
|
-
if (
|
|
1033
|
-
}),
|
|
1034
|
-
const
|
|
1035
|
-
for (const
|
|
1036
|
-
|
|
1037
|
-
id:
|
|
1038
|
-
name:
|
|
1039
|
-
avatar:
|
|
1040
|
-
email:
|
|
1017
|
+
return c.setHours(0, 0, 0, 0), c;
|
|
1018
|
+
const h = c.getDay(), v = h === 0 ? -6 : 1 - h;
|
|
1019
|
+
return c.setDate(c.getDate() + v), c.setHours(0, 0, 0, 0), c;
|
|
1020
|
+
}, [j, t]), w = U(
|
|
1021
|
+
() => Pt(Y, t),
|
|
1022
|
+
[Y, t]
|
|
1023
|
+
), W = U(
|
|
1024
|
+
() => Rt(w, C, T),
|
|
1025
|
+
[I, w, C, T]
|
|
1026
|
+
), P = l ?? ((c) => {
|
|
1027
|
+
if (c.resourceId) return c.resourceId;
|
|
1028
|
+
const h = c.data;
|
|
1029
|
+
if (h?.userId) return String(h.userId);
|
|
1030
|
+
if (h?.user && typeof h.user == "object" && h.user.id)
|
|
1031
|
+
return String(h.user.id);
|
|
1032
|
+
if (c.user?.id) return c.user.id;
|
|
1033
|
+
if (c.participants?.[0]?.id) return c.participants[0].id;
|
|
1034
|
+
}), K = U(() => {
|
|
1035
|
+
const c = /* @__PURE__ */ new Map();
|
|
1036
|
+
for (const h of o)
|
|
1037
|
+
c.set(h.id, {
|
|
1038
|
+
id: h.id,
|
|
1039
|
+
name: h.name,
|
|
1040
|
+
avatar: h.avatar ?? void 0,
|
|
1041
|
+
email: h.email
|
|
1041
1042
|
});
|
|
1042
|
-
for (const
|
|
1043
|
-
const
|
|
1044
|
-
|
|
1045
|
-
id:
|
|
1046
|
-
name:
|
|
1047
|
-
avatar:
|
|
1048
|
-
email:
|
|
1049
|
-
}),
|
|
1050
|
-
id:
|
|
1051
|
-
name:
|
|
1052
|
-
avatar:
|
|
1053
|
-
email:
|
|
1043
|
+
for (const h of r) {
|
|
1044
|
+
const S = h.data?.user;
|
|
1045
|
+
S?.id && !c.has(S.id) && c.set(S.id, {
|
|
1046
|
+
id: S.id,
|
|
1047
|
+
name: S.name ?? "",
|
|
1048
|
+
avatar: S.avatar ?? void 0,
|
|
1049
|
+
email: S.email
|
|
1050
|
+
}), h.user?.id && !c.has(h.user.id) && c.set(h.user.id, {
|
|
1051
|
+
id: h.user.id,
|
|
1052
|
+
name: h.user.name,
|
|
1053
|
+
avatar: h.user.avatar ?? void 0,
|
|
1054
|
+
email: h.user.email
|
|
1054
1055
|
});
|
|
1055
|
-
for (const
|
|
1056
|
-
|
|
1057
|
-
id:
|
|
1058
|
-
name:
|
|
1059
|
-
avatar:
|
|
1060
|
-
email:
|
|
1056
|
+
for (const k of h.participants || [])
|
|
1057
|
+
k.id && !c.has(k.id) && c.set(k.id, {
|
|
1058
|
+
id: k.id,
|
|
1059
|
+
name: k.name,
|
|
1060
|
+
avatar: k.avatar ?? void 0,
|
|
1061
|
+
email: k.email
|
|
1061
1062
|
});
|
|
1062
1063
|
}
|
|
1063
|
-
return Array.from(
|
|
1064
|
-
}, [o, r]),
|
|
1065
|
-
const
|
|
1066
|
-
for (const
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
for (const
|
|
1070
|
-
const
|
|
1071
|
-
(
|
|
1064
|
+
return Array.from(c.values());
|
|
1065
|
+
}, [o, r]), q = U(() => {
|
|
1066
|
+
const c = [], h = /* @__PURE__ */ new Map();
|
|
1067
|
+
for (const k of K)
|
|
1068
|
+
h.set(k.id, []);
|
|
1069
|
+
h.set("unassigned", []);
|
|
1070
|
+
for (const k of r) {
|
|
1071
|
+
const D = P(k) ?? "unassigned";
|
|
1072
|
+
(h.get(D) ?? h.get("unassigned")).push(k);
|
|
1072
1073
|
}
|
|
1073
|
-
const v = (
|
|
1074
|
-
const
|
|
1075
|
-
for (const
|
|
1076
|
-
const
|
|
1077
|
-
for (let
|
|
1078
|
-
const
|
|
1079
|
-
if (
|
|
1080
|
-
let
|
|
1081
|
-
if (
|
|
1082
|
-
|
|
1083
|
-
Math.min(
|
|
1084
|
-
),
|
|
1085
|
-
|
|
1086
|
-
Math.min(
|
|
1087
|
-
),
|
|
1088
|
-
const
|
|
1089
|
-
|
|
1090
|
-
event:
|
|
1091
|
-
startCol:
|
|
1092
|
-
spanCols: Math.max(1,
|
|
1074
|
+
const v = (k) => {
|
|
1075
|
+
const D = [];
|
|
1076
|
+
for (const M of k) {
|
|
1077
|
+
const J = M.startDate.getHours() + M.startDate.getMinutes() / 60, Z = M.endDate.getHours() + M.endDate.getMinutes() / 60;
|
|
1078
|
+
for (let R = 0; R < w.length; R++) {
|
|
1079
|
+
const d = w[R], N = ye(d), O = qe(d);
|
|
1080
|
+
if (M.startDate <= O && M.endDate >= N) {
|
|
1081
|
+
let G = C, ee = T;
|
|
1082
|
+
if (M.startDate >= N && (G = Math.max(C, J)), M.endDate <= O && (ee = Math.min(T, Z)), G = Math.max(
|
|
1083
|
+
C,
|
|
1084
|
+
Math.min(T, G)
|
|
1085
|
+
), ee = Math.max(
|
|
1086
|
+
C,
|
|
1087
|
+
Math.min(T, ee)
|
|
1088
|
+
), ee > G) {
|
|
1089
|
+
const ve = R * _ + Math.floor(G - C), ke = R * _ + Math.ceil(ee - C);
|
|
1090
|
+
D.push({
|
|
1091
|
+
event: M,
|
|
1092
|
+
startCol: ve,
|
|
1093
|
+
spanCols: Math.max(1, ke - ve)
|
|
1093
1094
|
});
|
|
1094
1095
|
}
|
|
1095
1096
|
}
|
|
1096
1097
|
}
|
|
1097
1098
|
}
|
|
1098
|
-
return
|
|
1099
|
+
return D;
|
|
1099
1100
|
};
|
|
1100
|
-
for (const
|
|
1101
|
-
const
|
|
1102
|
-
(
|
|
1101
|
+
for (const k of K) {
|
|
1102
|
+
const D = h.get(k.id) ?? [], M = v(D), J = Be(M), Z = J.reduce(
|
|
1103
|
+
(R, d) => Math.max(R, d.stackIndex + 1),
|
|
1103
1104
|
0
|
|
1104
1105
|
);
|
|
1105
|
-
|
|
1106
|
-
user:
|
|
1107
|
-
events:
|
|
1108
|
-
maxStack: Math.max(
|
|
1106
|
+
c.push({
|
|
1107
|
+
user: k,
|
|
1108
|
+
events: J,
|
|
1109
|
+
maxStack: Math.max(Z, 1)
|
|
1109
1110
|
});
|
|
1110
1111
|
}
|
|
1111
|
-
const
|
|
1112
|
-
if (
|
|
1113
|
-
const
|
|
1114
|
-
(
|
|
1112
|
+
const S = h.get("unassigned") ?? [];
|
|
1113
|
+
if (S.length > 0) {
|
|
1114
|
+
const k = v(S), D = Be(k), M = D.reduce(
|
|
1115
|
+
(J, Z) => Math.max(J, Z.stackIndex + 1),
|
|
1115
1116
|
0
|
|
1116
1117
|
);
|
|
1117
|
-
|
|
1118
|
+
c.push({
|
|
1118
1119
|
user: {
|
|
1119
1120
|
id: "unassigned",
|
|
1120
1121
|
name: "Unassigned",
|
|
1121
1122
|
avatar: void 0,
|
|
1122
1123
|
email: void 0
|
|
1123
1124
|
},
|
|
1124
|
-
events:
|
|
1125
|
-
maxStack: Math.max(
|
|
1125
|
+
events: D,
|
|
1126
|
+
maxStack: Math.max(M, 1)
|
|
1126
1127
|
});
|
|
1127
1128
|
}
|
|
1128
|
-
return
|
|
1129
|
+
return c.filter((k) => k.events.length > 0);
|
|
1129
1130
|
}, [
|
|
1130
|
-
|
|
1131
|
+
K,
|
|
1131
1132
|
r,
|
|
1133
|
+
w,
|
|
1132
1134
|
I,
|
|
1133
|
-
|
|
1135
|
+
_,
|
|
1136
|
+
C,
|
|
1134
1137
|
T,
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
for (const u of F)
|
|
1141
|
-
for (const v of u.events)
|
|
1138
|
+
P
|
|
1139
|
+
]), V = U(() => {
|
|
1140
|
+
const c = /* @__PURE__ */ new Map();
|
|
1141
|
+
for (const h of q)
|
|
1142
|
+
for (const v of h.events)
|
|
1142
1143
|
if (v.spanCols === 1) {
|
|
1143
|
-
const
|
|
1144
|
-
|
|
1144
|
+
const S = c.get(v.startCol) ?? 0;
|
|
1145
|
+
c.set(v.startCol, S + 1);
|
|
1145
1146
|
}
|
|
1146
|
-
return
|
|
1147
|
-
}, [
|
|
1148
|
-
const
|
|
1149
|
-
for (let
|
|
1150
|
-
const
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
) :
|
|
1147
|
+
return c;
|
|
1148
|
+
}, [q]), B = U(() => {
|
|
1149
|
+
const c = W.length, h = Ce, v = [];
|
|
1150
|
+
for (let S = 0; S < c; S++) {
|
|
1151
|
+
const k = V.get(S) ?? 0;
|
|
1152
|
+
k > Fe ? v.push(
|
|
1153
|
+
Ae + (k - Fe) * 20
|
|
1154
|
+
) : k > 0 ? v.push(Math.max(h, Ae)) : v.push(h);
|
|
1154
1155
|
}
|
|
1155
1156
|
return v;
|
|
1156
1157
|
}, [
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
]),
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
),
|
|
1165
|
-
const
|
|
1166
|
-
for (let
|
|
1167
|
-
|
|
1168
|
-
return
|
|
1169
|
-
}, [
|
|
1170
|
-
|
|
1171
|
-
const
|
|
1172
|
-
if (!
|
|
1173
|
-
const
|
|
1158
|
+
I,
|
|
1159
|
+
W.length,
|
|
1160
|
+
w.length,
|
|
1161
|
+
V
|
|
1162
|
+
]), m = (c) => Math.max(
|
|
1163
|
+
Bt,
|
|
1164
|
+
c * (Ne + je) + We * 2
|
|
1165
|
+
), b = me + B.reduce((c, h) => c + h, 0), E = U(() => {
|
|
1166
|
+
const c = [0];
|
|
1167
|
+
for (let h = 0; h < B.length; h++)
|
|
1168
|
+
c.push(c[h] + B[h]);
|
|
1169
|
+
return c;
|
|
1170
|
+
}, [B]);
|
|
1171
|
+
tt(() => {
|
|
1172
|
+
const c = A.current;
|
|
1173
|
+
if (!c) return;
|
|
1174
|
+
const h = () => {
|
|
1174
1175
|
let v = -1;
|
|
1175
|
-
const
|
|
1176
|
+
const k = (/* @__PURE__ */ new Date()).getHours();
|
|
1176
1177
|
{
|
|
1177
|
-
for (let
|
|
1178
|
-
const
|
|
1179
|
-
if (
|
|
1180
|
-
v =
|
|
1178
|
+
for (let D = 0; D < W.length; D++) {
|
|
1179
|
+
const M = W[D];
|
|
1180
|
+
if (M && te(M.date) && M.hour <= k && M.hour + 1 > k) {
|
|
1181
|
+
v = D;
|
|
1181
1182
|
break;
|
|
1182
1183
|
}
|
|
1183
1184
|
}
|
|
1184
1185
|
if (v === -1)
|
|
1185
|
-
for (let
|
|
1186
|
-
const
|
|
1187
|
-
if (
|
|
1188
|
-
v =
|
|
1186
|
+
for (let D = 0; D < W.length; D++) {
|
|
1187
|
+
const M = W[D];
|
|
1188
|
+
if (M && te(M.date)) {
|
|
1189
|
+
v = D;
|
|
1189
1190
|
break;
|
|
1190
1191
|
}
|
|
1191
1192
|
}
|
|
1192
1193
|
}
|
|
1193
1194
|
if (v !== -1) {
|
|
1194
|
-
const
|
|
1195
|
-
|
|
1196
|
-
left:
|
|
1195
|
+
const D = (E[v] ?? 0) + me, M = c.clientWidth, J = Math.max(0, D - M / 3);
|
|
1196
|
+
c.scrollTo({
|
|
1197
|
+
left: J,
|
|
1197
1198
|
behavior: "instant"
|
|
1198
1199
|
});
|
|
1199
1200
|
}
|
|
1200
1201
|
};
|
|
1201
1202
|
requestAnimationFrame(() => {
|
|
1202
|
-
requestAnimationFrame(
|
|
1203
|
+
requestAnimationFrame(h);
|
|
1203
1204
|
});
|
|
1204
|
-
}, [
|
|
1205
|
+
}, [j, W, w, E, I]);
|
|
1206
|
+
const $ = X(
|
|
1207
|
+
(c, h) => {
|
|
1208
|
+
const v = h.querySelector(".ic-timeline-grid");
|
|
1209
|
+
if (!v) return -1;
|
|
1210
|
+
const S = v.getBoundingClientRect(), k = c - S.left + v.scrollLeft;
|
|
1211
|
+
for (let D = 0; D < E.length - 1; D++) {
|
|
1212
|
+
const M = E[D], J = E[D + 1];
|
|
1213
|
+
if (k >= M && k < J) return D;
|
|
1214
|
+
}
|
|
1215
|
+
return -1;
|
|
1216
|
+
},
|
|
1217
|
+
[E]
|
|
1218
|
+
), H = X(
|
|
1219
|
+
(c) => {
|
|
1220
|
+
if (W[c]) {
|
|
1221
|
+
const h = W[c], v = new Date(h.date);
|
|
1222
|
+
return v.setHours(h.hour, 0, 0, 0), { date: v, hour: h.hour };
|
|
1223
|
+
}
|
|
1224
|
+
return { date: /* @__PURE__ */ new Date() };
|
|
1225
|
+
},
|
|
1226
|
+
[I, W, w]
|
|
1227
|
+
), Q = X(
|
|
1228
|
+
(c, h) => {
|
|
1229
|
+
if (c.preventDefault(), c.dataTransfer.dropEffect = "move", !z?.isDragging) return;
|
|
1230
|
+
const v = $(c.clientX, c.currentTarget);
|
|
1231
|
+
if (v < 0) return;
|
|
1232
|
+
const { date: S, hour: k } = H(v);
|
|
1233
|
+
z.updateDragPreview(S, k, void 0, h);
|
|
1234
|
+
},
|
|
1235
|
+
[z, $, H]
|
|
1236
|
+
), re = X(
|
|
1237
|
+
(c, h) => {
|
|
1238
|
+
c.preventDefault(), z?.isDragging && z.endDrag();
|
|
1239
|
+
},
|
|
1240
|
+
[z]
|
|
1241
|
+
);
|
|
1242
|
+
return /* @__PURE__ */ e("div", { className: u("flex h-full flex-col", f), children: /* @__PURE__ */ e("div", { className: "ic-timeline-scroll-container flex-1", ref: A, children: /* @__PURE__ */ n("div", { className: "relative", style: { minWidth: b }, children: [
|
|
1205
1243
|
// Hour mode: Day headers + Hour sub-headers - sticky wrapper with flex child (sticky + flex breaks sticky)
|
|
1206
1244
|
/* @__PURE__ */ e("div", { className: "ic-timeline-header sticky top-0 z-20 border-b bg-background", children: /* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
1207
1245
|
t > 1 && /* @__PURE__ */ n("div", { className: "flex border-b", children: [
|
|
@@ -1209,23 +1247,23 @@ function ue({
|
|
|
1209
1247
|
"div",
|
|
1210
1248
|
{
|
|
1211
1249
|
className: "flex shrink-0 items-center border-r bg-background px-2 py-1",
|
|
1212
|
-
style: { width:
|
|
1250
|
+
style: { width: me },
|
|
1213
1251
|
children: /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase text-muted-foreground", children: "Resources" })
|
|
1214
1252
|
}
|
|
1215
1253
|
),
|
|
1216
|
-
|
|
1217
|
-
const v =
|
|
1254
|
+
w.map((c, h) => {
|
|
1255
|
+
const v = te(c), S = h * _, k = B.slice(S, S + _).reduce((D, M) => D + M, 0);
|
|
1218
1256
|
return /* @__PURE__ */ e(
|
|
1219
1257
|
"div",
|
|
1220
1258
|
{
|
|
1221
|
-
className:
|
|
1259
|
+
className: u(
|
|
1222
1260
|
"flex shrink-0 items-center justify-center border-r py-1.5 font-medium",
|
|
1223
1261
|
v ? "bg-primary/10 text-primary" : "bg-muted/30"
|
|
1224
1262
|
),
|
|
1225
|
-
style: { width:
|
|
1226
|
-
children: /* @__PURE__ */ e("span", { className: "text-xs", children:
|
|
1263
|
+
style: { width: k },
|
|
1264
|
+
children: /* @__PURE__ */ e("span", { className: "text-xs", children: Ut(c) })
|
|
1227
1265
|
},
|
|
1228
|
-
`day-${
|
|
1266
|
+
`day-${c.toISOString()}`
|
|
1229
1267
|
);
|
|
1230
1268
|
})
|
|
1231
1269
|
] }),
|
|
@@ -1233,128 +1271,137 @@ function ue({
|
|
|
1233
1271
|
/* @__PURE__ */ e(
|
|
1234
1272
|
"div",
|
|
1235
1273
|
{
|
|
1236
|
-
className:
|
|
1274
|
+
className: u(
|
|
1237
1275
|
"flex shrink-0 items-center border-r bg-background px-2 py-2",
|
|
1238
1276
|
t > 1 && "sticky left-0 z-10"
|
|
1239
1277
|
),
|
|
1240
|
-
style: { width:
|
|
1278
|
+
style: { width: me },
|
|
1241
1279
|
children: t === 1 && /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase text-muted-foreground", children: "Resources" })
|
|
1242
1280
|
}
|
|
1243
1281
|
),
|
|
1244
|
-
|
|
1245
|
-
const v =
|
|
1282
|
+
W.map((c, h) => {
|
|
1283
|
+
const v = c.hour === C, S = te(c.date), k = B[h] ?? Ce;
|
|
1246
1284
|
return /* @__PURE__ */ e(
|
|
1247
1285
|
"div",
|
|
1248
1286
|
{
|
|
1249
|
-
className:
|
|
1287
|
+
className: u(
|
|
1250
1288
|
"flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",
|
|
1251
|
-
v &&
|
|
1252
|
-
|
|
1289
|
+
v && h > 0 ? "border-l-2 border-l-border" : "border-r border-r-border/50",
|
|
1290
|
+
S && "bg-primary/5"
|
|
1253
1291
|
),
|
|
1254
|
-
style: { width:
|
|
1255
|
-
children:
|
|
1292
|
+
style: { width: k },
|
|
1293
|
+
children: Vt(c.hour)
|
|
1256
1294
|
},
|
|
1257
|
-
`hour-${
|
|
1295
|
+
`hour-${c.dayIndex}-${c.hour}`
|
|
1258
1296
|
);
|
|
1259
1297
|
})
|
|
1260
1298
|
] })
|
|
1261
1299
|
] }) }),
|
|
1262
|
-
|
|
1263
|
-
const
|
|
1300
|
+
q.map((c) => {
|
|
1301
|
+
const h = m(c.maxStack);
|
|
1264
1302
|
return /* @__PURE__ */ n(
|
|
1265
1303
|
"div",
|
|
1266
1304
|
{
|
|
1267
|
-
className:
|
|
1305
|
+
className: u(
|
|
1268
1306
|
"relative flex border-b",
|
|
1269
1307
|
p?.resourceRow
|
|
1270
1308
|
),
|
|
1271
|
-
style: { height:
|
|
1309
|
+
style: { height: h },
|
|
1272
1310
|
children: [
|
|
1273
1311
|
/* @__PURE__ */ e(
|
|
1274
1312
|
"div",
|
|
1275
1313
|
{
|
|
1276
1314
|
className: "sticky left-0 z-10",
|
|
1277
|
-
style: { width:
|
|
1315
|
+
style: { width: me },
|
|
1278
1316
|
children: /* @__PURE__ */ n(
|
|
1279
1317
|
"div",
|
|
1280
1318
|
{
|
|
1281
|
-
className:
|
|
1319
|
+
className: u(
|
|
1282
1320
|
"flex h-full items-center gap-2 sm:gap-3 border-r bg-background px-2 sm:px-4",
|
|
1283
1321
|
p?.resourceHeader
|
|
1284
1322
|
),
|
|
1285
1323
|
children: [
|
|
1286
1324
|
/* @__PURE__ */ e(
|
|
1287
|
-
|
|
1325
|
+
Yt,
|
|
1288
1326
|
{
|
|
1289
1327
|
className: "size-7",
|
|
1290
|
-
src:
|
|
1291
|
-
alt:
|
|
1292
|
-
fallback:
|
|
1328
|
+
src: c.user.avatar,
|
|
1329
|
+
alt: c.user.name,
|
|
1330
|
+
fallback: _t(c.user.name)
|
|
1293
1331
|
}
|
|
1294
1332
|
),
|
|
1295
|
-
/* @__PURE__ */ e("span", { className: "truncate text-xs sm:text-sm font-medium", children:
|
|
1333
|
+
/* @__PURE__ */ e("span", { className: "truncate text-xs sm:text-sm font-medium", children: c.user.name })
|
|
1296
1334
|
]
|
|
1297
1335
|
}
|
|
1298
1336
|
)
|
|
1299
1337
|
}
|
|
1300
1338
|
),
|
|
1301
|
-
/* @__PURE__ */ n(
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
style: { width: E }
|
|
1314
|
-
},
|
|
1315
|
-
`cell-${v.dayIndex}-${v.hour}`
|
|
1316
|
-
);
|
|
1317
|
-
}),
|
|
1318
|
-
a.events.map((v) => {
|
|
1319
|
-
const k = (m[v.startCol] ?? 0) + 2, N = m[v.startCol + v.spanCols] ?? m[m.length - 1] ?? 0, E = m[v.startCol] ?? 0, H = N - E - 4, P = He + v.stackIndex * (ve + ze);
|
|
1320
|
-
return /* @__PURE__ */ e(
|
|
1321
|
-
"div",
|
|
1322
|
-
{
|
|
1323
|
-
className: "absolute",
|
|
1324
|
-
style: {
|
|
1325
|
-
left: k,
|
|
1326
|
-
width: Math.max(H, 0),
|
|
1327
|
-
// No forced minimum - columns are guaranteed wide enough
|
|
1328
|
-
top: P,
|
|
1329
|
-
height: ve
|
|
1330
|
-
},
|
|
1331
|
-
children: /* @__PURE__ */ e(
|
|
1332
|
-
nt,
|
|
1339
|
+
/* @__PURE__ */ n(
|
|
1340
|
+
"div",
|
|
1341
|
+
{
|
|
1342
|
+
className: "ic-timeline-grid relative flex",
|
|
1343
|
+
onDragOver: (v) => Q(v, c.user.id),
|
|
1344
|
+
onDrop: (v) => re(v, c.user.id),
|
|
1345
|
+
children: [
|
|
1346
|
+
// Hour mode cells
|
|
1347
|
+
W.map((v, S) => {
|
|
1348
|
+
const k = v.hour === C && S > 0, D = B[S] ?? Ce;
|
|
1349
|
+
return /* @__PURE__ */ e(
|
|
1350
|
+
"div",
|
|
1333
1351
|
{
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1352
|
+
className: u(
|
|
1353
|
+
"shrink-0",
|
|
1354
|
+
k ? "border-l-2 border-l-border" : "border-r border-r-border/50",
|
|
1355
|
+
te(v.date) && "bg-primary/5"
|
|
1356
|
+
),
|
|
1357
|
+
style: { width: D }
|
|
1358
|
+
},
|
|
1359
|
+
`cell-${v.dayIndex}-${v.hour}`
|
|
1360
|
+
);
|
|
1361
|
+
}),
|
|
1362
|
+
c.events.map((v) => {
|
|
1363
|
+
const S = (E[v.startCol] ?? 0) + 2, k = E[v.startCol + v.spanCols] ?? E[E.length - 1] ?? 0, D = E[v.startCol] ?? 0, M = k - D - 4, J = We + v.stackIndex * (Ne + je);
|
|
1364
|
+
return /* @__PURE__ */ e(
|
|
1365
|
+
"div",
|
|
1366
|
+
{
|
|
1367
|
+
className: "absolute",
|
|
1368
|
+
style: {
|
|
1369
|
+
left: S,
|
|
1370
|
+
width: Math.max(M, 0),
|
|
1371
|
+
// No forced minimum - columns are guaranteed wide enough
|
|
1372
|
+
top: J,
|
|
1373
|
+
height: Ne
|
|
1374
|
+
},
|
|
1375
|
+
children: /* @__PURE__ */ e(
|
|
1376
|
+
at,
|
|
1377
|
+
{
|
|
1378
|
+
event: v.event,
|
|
1379
|
+
variant: "compact",
|
|
1380
|
+
enableDrag: L,
|
|
1381
|
+
onClick: i,
|
|
1382
|
+
renderPopover: x,
|
|
1383
|
+
className: u(
|
|
1384
|
+
"h-full w-full",
|
|
1385
|
+
p?.eventCardCompact
|
|
1386
|
+
)
|
|
1387
|
+
}
|
|
1341
1388
|
)
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
}
|
|
1348
|
-
|
|
1389
|
+
},
|
|
1390
|
+
v.event.id
|
|
1391
|
+
);
|
|
1392
|
+
})
|
|
1393
|
+
]
|
|
1394
|
+
}
|
|
1395
|
+
)
|
|
1349
1396
|
]
|
|
1350
1397
|
},
|
|
1351
|
-
|
|
1398
|
+
c.user.id
|
|
1352
1399
|
);
|
|
1353
1400
|
}),
|
|
1354
|
-
|
|
1401
|
+
q.length === 0 && /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-20 text-muted-foreground", children: "No users or events to display" })
|
|
1355
1402
|
] }) }) });
|
|
1356
1403
|
}
|
|
1357
|
-
const
|
|
1404
|
+
const Kt = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], qt = [
|
|
1358
1405
|
"January",
|
|
1359
1406
|
"February",
|
|
1360
1407
|
"March",
|
|
@@ -1368,18 +1415,18 @@ const Vt = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], Ut = [
|
|
|
1368
1415
|
"November",
|
|
1369
1416
|
"December"
|
|
1370
1417
|
];
|
|
1371
|
-
function
|
|
1418
|
+
function $e(t) {
|
|
1372
1419
|
const r = t.hexColor;
|
|
1373
1420
|
return r ? { backgroundColor: r } : {};
|
|
1374
1421
|
}
|
|
1375
|
-
function
|
|
1376
|
-
const
|
|
1422
|
+
function Jt({ day: t, date: r, events: o, isCurrentMonth: s, onDayClick: a }) {
|
|
1423
|
+
const i = te(r), g = 3, f = o.length;
|
|
1377
1424
|
return /* @__PURE__ */ n(
|
|
1378
1425
|
"button",
|
|
1379
1426
|
{
|
|
1380
1427
|
type: "button",
|
|
1381
|
-
onClick: () =>
|
|
1382
|
-
className:
|
|
1428
|
+
onClick: () => a?.(r),
|
|
1429
|
+
className: u(
|
|
1383
1430
|
"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",
|
|
1384
1431
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1385
1432
|
"transition-colors",
|
|
@@ -1389,28 +1436,28 @@ function Yt({ day: t, date: r, events: o, isCurrentMonth: s, onDayClick: i }) {
|
|
|
1389
1436
|
/* @__PURE__ */ e(
|
|
1390
1437
|
"div",
|
|
1391
1438
|
{
|
|
1392
|
-
className:
|
|
1439
|
+
className: u(
|
|
1393
1440
|
"flex size-5 sm:size-6 items-center justify-center rounded-full text-[10px] sm:text-xs font-medium",
|
|
1394
|
-
|
|
1441
|
+
i && "bg-primary font-semibold text-primary-foreground"
|
|
1395
1442
|
),
|
|
1396
1443
|
children: t
|
|
1397
1444
|
}
|
|
1398
1445
|
),
|
|
1399
|
-
f > 0 && /* @__PURE__ */ e("div", { className: "mt-0.5 flex items-center gap-0.5", children: f <= g ? o.map((
|
|
1446
|
+
f > 0 && /* @__PURE__ */ e("div", { className: "mt-0.5 flex items-center gap-0.5", children: f <= g ? o.map((l) => /* @__PURE__ */ e(
|
|
1400
1447
|
"div",
|
|
1401
1448
|
{
|
|
1402
1449
|
className: "size-1 sm:size-1.5 rounded-full bg-primary",
|
|
1403
|
-
style:
|
|
1450
|
+
style: $e(l)
|
|
1404
1451
|
},
|
|
1405
|
-
|
|
1406
|
-
)) : /* @__PURE__ */ n(
|
|
1407
|
-
o.slice(0, g).map((
|
|
1452
|
+
l.id
|
|
1453
|
+
)) : /* @__PURE__ */ n(ce, { children: [
|
|
1454
|
+
o.slice(0, g).map((l) => /* @__PURE__ */ e(
|
|
1408
1455
|
"div",
|
|
1409
1456
|
{
|
|
1410
1457
|
className: "size-1 sm:size-1.5 rounded-full bg-primary",
|
|
1411
|
-
style:
|
|
1458
|
+
style: $e(l)
|
|
1412
1459
|
},
|
|
1413
|
-
|
|
1460
|
+
l.id
|
|
1414
1461
|
)),
|
|
1415
1462
|
/* @__PURE__ */ n("span", { className: "text-[6px] sm:text-[7px] font-medium text-muted-foreground", children: [
|
|
1416
1463
|
"+",
|
|
@@ -1421,74 +1468,74 @@ function Yt({ day: t, date: r, events: o, isCurrentMonth: s, onDayClick: i }) {
|
|
|
1421
1468
|
}
|
|
1422
1469
|
);
|
|
1423
1470
|
}
|
|
1424
|
-
function
|
|
1471
|
+
function Xt({
|
|
1425
1472
|
date: t,
|
|
1426
1473
|
events: r,
|
|
1427
1474
|
onMonthClick: o,
|
|
1428
1475
|
onDayClick: s
|
|
1429
1476
|
}) {
|
|
1430
|
-
const
|
|
1477
|
+
const a = U(() => vt(t, 0), [t]);
|
|
1431
1478
|
return /* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
1432
1479
|
/* @__PURE__ */ e(
|
|
1433
1480
|
"button",
|
|
1434
1481
|
{
|
|
1435
1482
|
type: "button",
|
|
1436
1483
|
onClick: () => o?.(t),
|
|
1437
|
-
className:
|
|
1484
|
+
className: u(
|
|
1438
1485
|
"w-full rounded-t-lg border px-2 sm:px-3 py-1.5 sm:py-2 text-xs sm:text-sm font-semibold",
|
|
1439
1486
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1440
1487
|
"transition-colors"
|
|
1441
1488
|
),
|
|
1442
|
-
children:
|
|
1489
|
+
children: qt[t.getMonth()]
|
|
1443
1490
|
}
|
|
1444
1491
|
),
|
|
1445
1492
|
/* @__PURE__ */ n("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: [
|
|
1446
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 text-center", children:
|
|
1447
|
-
/* @__PURE__ */ e("span", { className: "sm:hidden", children:
|
|
1448
|
-
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children:
|
|
1493
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 text-center", children: Kt.map((i, g) => /* @__PURE__ */ n("div", { className: "text-[9px] sm:text-xs font-medium text-muted-foreground", children: [
|
|
1494
|
+
/* @__PURE__ */ e("span", { className: "sm:hidden", children: i[0] }),
|
|
1495
|
+
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children: i })
|
|
1449
1496
|
] }, g)) }),
|
|
1450
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 gap-y-1", children:
|
|
1451
|
-
const f =
|
|
1497
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-x-0.5 gap-y-1", children: a.map((i, g) => {
|
|
1498
|
+
const f = wt(r, i.date);
|
|
1452
1499
|
return /* @__PURE__ */ e(
|
|
1453
|
-
|
|
1500
|
+
Jt,
|
|
1454
1501
|
{
|
|
1455
|
-
day:
|
|
1456
|
-
date:
|
|
1502
|
+
day: i.date.getDate(),
|
|
1503
|
+
date: i.date,
|
|
1457
1504
|
events: f,
|
|
1458
|
-
isCurrentMonth:
|
|
1505
|
+
isCurrentMonth: i.isCurrentMonth,
|
|
1459
1506
|
onDayClick: s
|
|
1460
1507
|
},
|
|
1461
|
-
`${g + 1}-${
|
|
1508
|
+
`${g + 1}-${i.date.toISOString()}`
|
|
1462
1509
|
);
|
|
1463
1510
|
}) })
|
|
1464
1511
|
] })
|
|
1465
1512
|
] });
|
|
1466
1513
|
}
|
|
1467
|
-
function
|
|
1514
|
+
function Qt({
|
|
1468
1515
|
events: t,
|
|
1469
1516
|
year: r,
|
|
1470
1517
|
onMonthClick: o,
|
|
1471
1518
|
onDayClick: s,
|
|
1472
|
-
className:
|
|
1473
|
-
slots:
|
|
1519
|
+
className: a,
|
|
1520
|
+
slots: i,
|
|
1474
1521
|
classNames: g
|
|
1475
1522
|
}) {
|
|
1476
|
-
const f =
|
|
1477
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1523
|
+
const f = U(() => pt(r), [r]);
|
|
1524
|
+
return /* @__PURE__ */ n("div", { className: u("flex flex-col h-full", a), children: [
|
|
1478
1525
|
/* @__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: r }) }),
|
|
1479
|
-
/* @__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: f.map((
|
|
1480
|
-
|
|
1526
|
+
/* @__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: f.map((l) => /* @__PURE__ */ e(
|
|
1527
|
+
Xt,
|
|
1481
1528
|
{
|
|
1482
|
-
date:
|
|
1529
|
+
date: l,
|
|
1483
1530
|
events: t,
|
|
1484
1531
|
onMonthClick: o,
|
|
1485
1532
|
onDayClick: s
|
|
1486
1533
|
},
|
|
1487
|
-
|
|
1534
|
+
l.getMonth()
|
|
1488
1535
|
)) }) })
|
|
1489
1536
|
] });
|
|
1490
1537
|
}
|
|
1491
|
-
function
|
|
1538
|
+
function Zt(t) {
|
|
1492
1539
|
switch (t) {
|
|
1493
1540
|
case "day":
|
|
1494
1541
|
case "week":
|
|
@@ -1497,68 +1544,71 @@ function qt(t) {
|
|
|
1497
1544
|
return "day";
|
|
1498
1545
|
}
|
|
1499
1546
|
}
|
|
1500
|
-
function
|
|
1547
|
+
function er({
|
|
1501
1548
|
onEventClick: t,
|
|
1502
1549
|
onSlotClick: r,
|
|
1503
1550
|
onSlotSelect: o,
|
|
1504
1551
|
onAddEvent: s,
|
|
1505
|
-
className:
|
|
1506
|
-
showHeader:
|
|
1552
|
+
className: a,
|
|
1553
|
+
showHeader: i = !0,
|
|
1507
1554
|
minSelectionMinutes: g = 30,
|
|
1508
1555
|
showMoreMode: f,
|
|
1509
|
-
showMoreEventsInPopover:
|
|
1556
|
+
showMoreEventsInPopover: l = !1,
|
|
1510
1557
|
isLoading: x = !1,
|
|
1511
|
-
slots:
|
|
1558
|
+
slots: y,
|
|
1512
1559
|
classNames: p,
|
|
1513
|
-
settingsContent:
|
|
1514
|
-
filterContent:
|
|
1515
|
-
headerActions:
|
|
1516
|
-
renderPopover:
|
|
1517
|
-
calendarRef:
|
|
1560
|
+
settingsContent: L,
|
|
1561
|
+
filterContent: A,
|
|
1562
|
+
headerActions: z,
|
|
1563
|
+
renderPopover: j,
|
|
1564
|
+
calendarRef: I,
|
|
1565
|
+
headerConfig: C,
|
|
1566
|
+
eventDetailMode: T,
|
|
1567
|
+
renderEventDetail: _
|
|
1518
1568
|
}) {
|
|
1519
|
-
const
|
|
1569
|
+
const Y = f ?? (l ? "popover" : "expand"), {
|
|
1520
1570
|
view: w,
|
|
1521
|
-
setView:
|
|
1522
|
-
selectedDate:
|
|
1523
|
-
setSelectedDate:
|
|
1524
|
-
slotDuration:
|
|
1525
|
-
filteredEvents:
|
|
1526
|
-
users:
|
|
1527
|
-
visibleHours:
|
|
1528
|
-
workingHours:
|
|
1529
|
-
badgeVariant:
|
|
1530
|
-
showWorkingHoursOnly:
|
|
1531
|
-
clearFocusEventId:
|
|
1532
|
-
} =
|
|
1533
|
-
if (!
|
|
1571
|
+
setView: W,
|
|
1572
|
+
selectedDate: F,
|
|
1573
|
+
setSelectedDate: P,
|
|
1574
|
+
slotDuration: K,
|
|
1575
|
+
filteredEvents: q,
|
|
1576
|
+
users: V,
|
|
1577
|
+
visibleHours: B,
|
|
1578
|
+
workingHours: m,
|
|
1579
|
+
badgeVariant: b,
|
|
1580
|
+
showWorkingHoursOnly: E,
|
|
1581
|
+
clearFocusEventId: $
|
|
1582
|
+
} = gt(), H = U(() => {
|
|
1583
|
+
if (!E || !m)
|
|
1534
1584
|
return {
|
|
1535
|
-
startHour:
|
|
1536
|
-
endHour:
|
|
1585
|
+
startHour: B.start,
|
|
1586
|
+
endHour: B.end
|
|
1537
1587
|
};
|
|
1538
|
-
let d = 24,
|
|
1539
|
-
for (const
|
|
1540
|
-
const
|
|
1541
|
-
|
|
1588
|
+
let d = 24, N = 0;
|
|
1589
|
+
for (const O of Object.keys(m)) {
|
|
1590
|
+
const G = m[Number(O)];
|
|
1591
|
+
!G || G.enabled === !1 || (G.from < d && (d = G.from), G.to > N && (N = G.to));
|
|
1542
1592
|
}
|
|
1543
|
-
return d >=
|
|
1544
|
-
startHour:
|
|
1545
|
-
endHour:
|
|
1546
|
-
} : { startHour: d, endHour:
|
|
1547
|
-
}, [
|
|
1548
|
-
|
|
1549
|
-
|
|
1593
|
+
return d >= N ? {
|
|
1594
|
+
startHour: B.start,
|
|
1595
|
+
endHour: B.end
|
|
1596
|
+
} : { startHour: d, endHour: N };
|
|
1597
|
+
}, [E, m, B]), Q = H, re = Ee(null);
|
|
1598
|
+
rt(
|
|
1599
|
+
I,
|
|
1550
1600
|
() => ({
|
|
1551
1601
|
scrollToToday: () => {
|
|
1552
1602
|
const d = /* @__PURE__ */ new Date();
|
|
1553
|
-
|
|
1603
|
+
P(d, w), requestAnimationFrame(() => {
|
|
1554
1604
|
requestAnimationFrame(() => {
|
|
1555
|
-
const
|
|
1605
|
+
const N = re.current?.querySelector(
|
|
1556
1606
|
".ic-timeline-scroll-container, [class*='overflow-auto']"
|
|
1557
1607
|
);
|
|
1558
|
-
if (!
|
|
1559
|
-
const
|
|
1560
|
-
|
|
1561
|
-
top: Math.max(0,
|
|
1608
|
+
if (!N) return;
|
|
1609
|
+
const ee = (d.getHours() - H.startHour) * 96;
|
|
1610
|
+
ee > 0 && N.scrollTo({
|
|
1611
|
+
top: Math.max(0, ee - 100),
|
|
1562
1612
|
// Offset to show some context
|
|
1563
1613
|
behavior: "smooth"
|
|
1564
1614
|
});
|
|
@@ -1567,298 +1617,304 @@ function Jt({
|
|
|
1567
1617
|
},
|
|
1568
1618
|
scrollToWorkingHours: () => {
|
|
1569
1619
|
let d = 8;
|
|
1570
|
-
if (
|
|
1571
|
-
for (const
|
|
1572
|
-
const
|
|
1573
|
-
|
|
1620
|
+
if (m)
|
|
1621
|
+
for (const N of Object.keys(m)) {
|
|
1622
|
+
const O = m[Number(N)];
|
|
1623
|
+
O?.enabled && O.from < d && (d = Math.max(O.from - 1, 0));
|
|
1574
1624
|
}
|
|
1575
1625
|
requestAnimationFrame(() => {
|
|
1576
1626
|
requestAnimationFrame(() => {
|
|
1577
|
-
const
|
|
1627
|
+
const N = re.current?.querySelector(
|
|
1578
1628
|
".ic-timeline-scroll-container, [class*='overflow-auto']"
|
|
1579
1629
|
);
|
|
1580
|
-
if (!
|
|
1581
|
-
const
|
|
1582
|
-
|
|
1583
|
-
top: Math.max(0,
|
|
1630
|
+
if (!N) return;
|
|
1631
|
+
const G = (d - H.startHour) * 96;
|
|
1632
|
+
N.scrollTo({
|
|
1633
|
+
top: Math.max(0, G),
|
|
1584
1634
|
behavior: "smooth"
|
|
1585
1635
|
});
|
|
1586
1636
|
});
|
|
1587
1637
|
});
|
|
1588
1638
|
},
|
|
1589
|
-
getViewRect: () =>
|
|
1639
|
+
getViewRect: () => re.current?.getBoundingClientRect() ?? null,
|
|
1590
1640
|
focusEvent: (d) => {
|
|
1591
|
-
|
|
1592
|
-
|
|
1641
|
+
$(), requestAnimationFrame(() => {
|
|
1642
|
+
$();
|
|
1593
1643
|
});
|
|
1594
|
-
const
|
|
1644
|
+
const N = re.current?.querySelector(
|
|
1595
1645
|
`[data-event-id="${d}"]`
|
|
1596
1646
|
);
|
|
1597
|
-
|
|
1647
|
+
N && setTimeout(() => N.click(), 150);
|
|
1598
1648
|
}
|
|
1599
1649
|
}),
|
|
1600
|
-
[
|
|
1650
|
+
[
|
|
1651
|
+
P,
|
|
1652
|
+
w,
|
|
1653
|
+
H,
|
|
1654
|
+
m,
|
|
1655
|
+
$
|
|
1656
|
+
]
|
|
1601
1657
|
);
|
|
1602
|
-
const
|
|
1658
|
+
const c = U(() => Zt(w), [w]), h = X(
|
|
1603
1659
|
(d) => {
|
|
1604
1660
|
if (o) {
|
|
1605
1661
|
o(d);
|
|
1606
1662
|
return;
|
|
1607
1663
|
}
|
|
1608
1664
|
if (r) {
|
|
1609
|
-
const
|
|
1610
|
-
r(d.startDate,
|
|
1665
|
+
const N = d.startDate.getHours();
|
|
1666
|
+
r(d.startDate, N);
|
|
1611
1667
|
}
|
|
1612
1668
|
},
|
|
1613
1669
|
[o, r]
|
|
1614
|
-
),
|
|
1670
|
+
), v = X(
|
|
1615
1671
|
(d) => {
|
|
1616
|
-
|
|
1672
|
+
W("day"), P(d, "day");
|
|
1617
1673
|
},
|
|
1618
|
-
[
|
|
1619
|
-
),
|
|
1674
|
+
[P, W]
|
|
1675
|
+
), S = X(
|
|
1620
1676
|
(d) => {
|
|
1621
|
-
|
|
1677
|
+
W("month"), P(d, "month");
|
|
1622
1678
|
},
|
|
1623
|
-
[
|
|
1624
|
-
),
|
|
1679
|
+
[P, W]
|
|
1680
|
+
), k = X(
|
|
1625
1681
|
(d) => {
|
|
1626
1682
|
t?.(d);
|
|
1627
1683
|
},
|
|
1628
1684
|
[t]
|
|
1629
|
-
),
|
|
1630
|
-
const d =
|
|
1685
|
+
), D = () => {
|
|
1686
|
+
const d = q, N = k, O = j;
|
|
1631
1687
|
switch (w) {
|
|
1632
1688
|
case "day":
|
|
1633
1689
|
return /* @__PURE__ */ e(
|
|
1634
|
-
|
|
1690
|
+
dt,
|
|
1635
1691
|
{
|
|
1636
1692
|
events: d,
|
|
1637
|
-
date:
|
|
1638
|
-
visibleHours:
|
|
1639
|
-
workingHours:
|
|
1640
|
-
slotDuration:
|
|
1641
|
-
badgeVariant:
|
|
1642
|
-
onEventClick:
|
|
1643
|
-
renderPopover:
|
|
1644
|
-
...
|
|
1693
|
+
date: F,
|
|
1694
|
+
visibleHours: Q,
|
|
1695
|
+
workingHours: m,
|
|
1696
|
+
slotDuration: K,
|
|
1697
|
+
badgeVariant: b,
|
|
1698
|
+
onEventClick: N,
|
|
1699
|
+
renderPopover: O,
|
|
1700
|
+
...y && { slots: y },
|
|
1645
1701
|
...p && { classNames: p }
|
|
1646
1702
|
}
|
|
1647
1703
|
);
|
|
1648
1704
|
case "week":
|
|
1649
1705
|
return /* @__PURE__ */ e(
|
|
1650
|
-
|
|
1706
|
+
ct,
|
|
1651
1707
|
{
|
|
1652
1708
|
events: d,
|
|
1653
|
-
date:
|
|
1654
|
-
visibleHours:
|
|
1655
|
-
workingHours:
|
|
1656
|
-
slotDuration:
|
|
1657
|
-
badgeVariant:
|
|
1658
|
-
onEventClick:
|
|
1659
|
-
renderPopover:
|
|
1660
|
-
...
|
|
1709
|
+
date: F,
|
|
1710
|
+
visibleHours: Q,
|
|
1711
|
+
workingHours: m,
|
|
1712
|
+
slotDuration: K,
|
|
1713
|
+
badgeVariant: b,
|
|
1714
|
+
onEventClick: N,
|
|
1715
|
+
renderPopover: O,
|
|
1716
|
+
...y && { slots: y },
|
|
1661
1717
|
...p && { classNames: p }
|
|
1662
1718
|
}
|
|
1663
1719
|
);
|
|
1664
1720
|
case "month":
|
|
1665
1721
|
return /* @__PURE__ */ e(
|
|
1666
|
-
|
|
1722
|
+
He,
|
|
1667
1723
|
{
|
|
1668
1724
|
events: d,
|
|
1669
|
-
date:
|
|
1670
|
-
badgeVariant:
|
|
1671
|
-
onEventClick:
|
|
1672
|
-
onDayClick:
|
|
1673
|
-
renderPopover:
|
|
1674
|
-
showMoreMode:
|
|
1675
|
-
...
|
|
1725
|
+
date: F,
|
|
1726
|
+
badgeVariant: b,
|
|
1727
|
+
onEventClick: N,
|
|
1728
|
+
onDayClick: v,
|
|
1729
|
+
renderPopover: O,
|
|
1730
|
+
showMoreMode: Y,
|
|
1731
|
+
...y && { slots: y },
|
|
1676
1732
|
...p && { classNames: p }
|
|
1677
1733
|
}
|
|
1678
1734
|
);
|
|
1679
1735
|
case "year":
|
|
1680
1736
|
return /* @__PURE__ */ e(
|
|
1681
|
-
|
|
1737
|
+
Qt,
|
|
1682
1738
|
{
|
|
1683
1739
|
events: d,
|
|
1684
|
-
year:
|
|
1685
|
-
onMonthClick:
|
|
1686
|
-
onDayClick:
|
|
1687
|
-
...
|
|
1740
|
+
year: F.getFullYear(),
|
|
1741
|
+
onMonthClick: S,
|
|
1742
|
+
onDayClick: v,
|
|
1743
|
+
...y && { slots: y },
|
|
1688
1744
|
...p && { classNames: p }
|
|
1689
1745
|
}
|
|
1690
1746
|
);
|
|
1691
1747
|
case "agenda":
|
|
1692
1748
|
return /* @__PURE__ */ e(
|
|
1693
|
-
|
|
1749
|
+
lt,
|
|
1694
1750
|
{
|
|
1695
1751
|
events: d,
|
|
1696
|
-
date:
|
|
1697
|
-
onEventClick:
|
|
1698
|
-
renderPopover:
|
|
1699
|
-
...
|
|
1752
|
+
date: F,
|
|
1753
|
+
onEventClick: N,
|
|
1754
|
+
renderPopover: O,
|
|
1755
|
+
...y && { slots: y },
|
|
1700
1756
|
...p && { classNames: p }
|
|
1701
1757
|
}
|
|
1702
1758
|
);
|
|
1703
1759
|
// Resource views — delegate to TimelineView with matching day count
|
|
1704
1760
|
case "resource-day":
|
|
1705
1761
|
return /* @__PURE__ */ e(
|
|
1706
|
-
|
|
1762
|
+
fe,
|
|
1707
1763
|
{
|
|
1708
1764
|
daysToShow: 1,
|
|
1709
1765
|
events: d,
|
|
1710
|
-
users:
|
|
1711
|
-
selectedDate:
|
|
1766
|
+
users: V,
|
|
1767
|
+
selectedDate: F,
|
|
1712
1768
|
visibleHours: {
|
|
1713
|
-
from:
|
|
1714
|
-
to:
|
|
1769
|
+
from: H.startHour,
|
|
1770
|
+
to: H.endHour
|
|
1715
1771
|
},
|
|
1716
|
-
onEventClick:
|
|
1717
|
-
renderPopover:
|
|
1718
|
-
...
|
|
1772
|
+
onEventClick: N,
|
|
1773
|
+
renderPopover: O,
|
|
1774
|
+
...y && { slots: y },
|
|
1719
1775
|
...p && { classNames: p }
|
|
1720
1776
|
}
|
|
1721
1777
|
);
|
|
1722
1778
|
case "resource-week":
|
|
1723
1779
|
return /* @__PURE__ */ e(
|
|
1724
|
-
|
|
1780
|
+
fe,
|
|
1725
1781
|
{
|
|
1726
1782
|
daysToShow: 7,
|
|
1727
1783
|
events: d,
|
|
1728
|
-
users:
|
|
1729
|
-
selectedDate:
|
|
1784
|
+
users: V,
|
|
1785
|
+
selectedDate: F,
|
|
1730
1786
|
visibleHours: {
|
|
1731
|
-
from:
|
|
1732
|
-
to:
|
|
1787
|
+
from: H.startHour,
|
|
1788
|
+
to: H.endHour
|
|
1733
1789
|
},
|
|
1734
|
-
onEventClick:
|
|
1735
|
-
renderPopover:
|
|
1736
|
-
...
|
|
1790
|
+
onEventClick: N,
|
|
1791
|
+
renderPopover: O,
|
|
1792
|
+
...y && { slots: y },
|
|
1737
1793
|
...p && { classNames: p }
|
|
1738
1794
|
}
|
|
1739
1795
|
);
|
|
1740
1796
|
// Timeline views
|
|
1741
1797
|
case "timeline-day":
|
|
1742
1798
|
return /* @__PURE__ */ e(
|
|
1743
|
-
|
|
1799
|
+
fe,
|
|
1744
1800
|
{
|
|
1745
1801
|
daysToShow: 1,
|
|
1746
1802
|
events: d,
|
|
1747
|
-
users:
|
|
1748
|
-
selectedDate:
|
|
1803
|
+
users: V,
|
|
1804
|
+
selectedDate: F,
|
|
1749
1805
|
visibleHours: {
|
|
1750
|
-
from:
|
|
1751
|
-
to:
|
|
1806
|
+
from: H.startHour,
|
|
1807
|
+
to: H.endHour
|
|
1752
1808
|
},
|
|
1753
|
-
onEventClick:
|
|
1754
|
-
renderPopover:
|
|
1755
|
-
...
|
|
1809
|
+
onEventClick: N,
|
|
1810
|
+
renderPopover: O,
|
|
1811
|
+
...y && { slots: y },
|
|
1756
1812
|
...p && { classNames: p }
|
|
1757
1813
|
}
|
|
1758
1814
|
);
|
|
1759
1815
|
case "timeline-3day":
|
|
1760
1816
|
return /* @__PURE__ */ e(
|
|
1761
|
-
|
|
1817
|
+
fe,
|
|
1762
1818
|
{
|
|
1763
1819
|
daysToShow: 3,
|
|
1764
1820
|
events: d,
|
|
1765
|
-
users:
|
|
1766
|
-
selectedDate:
|
|
1821
|
+
users: V,
|
|
1822
|
+
selectedDate: F,
|
|
1767
1823
|
visibleHours: {
|
|
1768
|
-
from:
|
|
1769
|
-
to:
|
|
1824
|
+
from: H.startHour,
|
|
1825
|
+
to: H.endHour
|
|
1770
1826
|
},
|
|
1771
|
-
onEventClick:
|
|
1772
|
-
renderPopover:
|
|
1773
|
-
...
|
|
1827
|
+
onEventClick: N,
|
|
1828
|
+
renderPopover: O,
|
|
1829
|
+
...y && { slots: y },
|
|
1774
1830
|
...p && { classNames: p }
|
|
1775
1831
|
}
|
|
1776
1832
|
);
|
|
1777
1833
|
case "timeline-week":
|
|
1778
1834
|
return /* @__PURE__ */ e(
|
|
1779
|
-
|
|
1835
|
+
fe,
|
|
1780
1836
|
{
|
|
1781
1837
|
daysToShow: 7,
|
|
1782
1838
|
events: d,
|
|
1783
|
-
users:
|
|
1784
|
-
selectedDate:
|
|
1839
|
+
users: V,
|
|
1840
|
+
selectedDate: F,
|
|
1785
1841
|
visibleHours: {
|
|
1786
|
-
from:
|
|
1787
|
-
to:
|
|
1842
|
+
from: H.startHour,
|
|
1843
|
+
to: H.endHour
|
|
1788
1844
|
},
|
|
1789
|
-
onEventClick:
|
|
1790
|
-
renderPopover:
|
|
1791
|
-
...
|
|
1845
|
+
onEventClick: N,
|
|
1846
|
+
renderPopover: O,
|
|
1847
|
+
...y && { slots: y },
|
|
1792
1848
|
...p && { classNames: p }
|
|
1793
1849
|
}
|
|
1794
1850
|
);
|
|
1795
1851
|
default:
|
|
1796
1852
|
return /* @__PURE__ */ e(
|
|
1797
|
-
|
|
1853
|
+
He,
|
|
1798
1854
|
{
|
|
1799
1855
|
events: d,
|
|
1800
|
-
date:
|
|
1801
|
-
badgeVariant:
|
|
1802
|
-
onEventClick:
|
|
1803
|
-
onDayClick:
|
|
1804
|
-
...
|
|
1856
|
+
date: F,
|
|
1857
|
+
badgeVariant: b,
|
|
1858
|
+
onEventClick: N,
|
|
1859
|
+
onDayClick: v,
|
|
1860
|
+
...y && { slots: y },
|
|
1805
1861
|
...p && { classNames: p }
|
|
1806
1862
|
}
|
|
1807
1863
|
);
|
|
1808
1864
|
}
|
|
1809
|
-
},
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
}),
|
|
1813
|
-
const d =
|
|
1865
|
+
}, M = Ee(null), [J, Z] = de(!1);
|
|
1866
|
+
pe(() => {
|
|
1867
|
+
re.current = M.current;
|
|
1868
|
+
}), pe(() => {
|
|
1869
|
+
const d = M.current;
|
|
1814
1870
|
if (!d) return;
|
|
1815
|
-
const
|
|
1816
|
-
const { scrollLeft:
|
|
1817
|
-
|
|
1871
|
+
const N = () => {
|
|
1872
|
+
const { scrollLeft: ee, scrollWidth: ve, clientWidth: ke } = d;
|
|
1873
|
+
Z(ee + ke < ve - 4);
|
|
1818
1874
|
};
|
|
1819
|
-
|
|
1820
|
-
const
|
|
1821
|
-
|
|
1822
|
-
const
|
|
1823
|
-
return
|
|
1824
|
-
d.removeEventListener("scroll",
|
|
1875
|
+
N(), d.addEventListener("scroll", N, { passive: !0 });
|
|
1876
|
+
const O = new ResizeObserver(N);
|
|
1877
|
+
O.observe(d);
|
|
1878
|
+
const G = new MutationObserver(N);
|
|
1879
|
+
return G.observe(d, { childList: !0, subtree: !0 }), () => {
|
|
1880
|
+
d.removeEventListener("scroll", N), O.disconnect(), G.disconnect();
|
|
1825
1881
|
};
|
|
1826
1882
|
}, [w]);
|
|
1827
|
-
const
|
|
1828
|
-
|
|
1883
|
+
const R = X(() => {
|
|
1884
|
+
M.current?.scrollBy({ left: 300, behavior: "smooth" });
|
|
1829
1885
|
}, []);
|
|
1830
1886
|
return /* @__PURE__ */ e(
|
|
1831
|
-
|
|
1887
|
+
xt,
|
|
1832
1888
|
{
|
|
1833
|
-
mode:
|
|
1834
|
-
onSelect:
|
|
1889
|
+
mode: c,
|
|
1890
|
+
onSelect: h,
|
|
1835
1891
|
minDurationMinutes: g,
|
|
1836
|
-
slotDurationMinutes:
|
|
1892
|
+
slotDurationMinutes: K,
|
|
1837
1893
|
enabled: !!(o || r),
|
|
1838
1894
|
children: /* @__PURE__ */ n(
|
|
1839
1895
|
"div",
|
|
1840
1896
|
{
|
|
1841
|
-
className:
|
|
1897
|
+
className: u(
|
|
1842
1898
|
"inno-calendar-root flex flex-col h-full p-4",
|
|
1843
1899
|
p?.root,
|
|
1844
|
-
|
|
1900
|
+
a
|
|
1845
1901
|
),
|
|
1846
1902
|
children: [
|
|
1847
|
-
|
|
1848
|
-
|
|
1903
|
+
i && /* @__PURE__ */ e(
|
|
1904
|
+
it,
|
|
1849
1905
|
{
|
|
1850
|
-
currentDate:
|
|
1906
|
+
currentDate: F,
|
|
1851
1907
|
view: w,
|
|
1852
|
-
events:
|
|
1853
|
-
onViewChange:
|
|
1854
|
-
onNavigateToday: () =>
|
|
1908
|
+
events: q,
|
|
1909
|
+
onViewChange: W,
|
|
1910
|
+
onNavigateToday: () => P(/* @__PURE__ */ new Date(), w),
|
|
1855
1911
|
onNavigatePrev: () => {
|
|
1856
|
-
const d = new Date(
|
|
1857
|
-
w === "day" || w === "timeline-day" || w === "resource-day" ? d.setDate(d.getDate() - 1) : w === "timeline-3day" ? d.setDate(d.getDate() - 3) : w === "week" || w === "timeline-week" || w === "resource-week" ? d.setDate(d.getDate() - 7) : w === "month" ? d.setMonth(d.getMonth() - 1) : w === "year" ? d.setFullYear(d.getFullYear() - 1) : d.setDate(d.getDate() - 7),
|
|
1912
|
+
const d = new Date(F);
|
|
1913
|
+
w === "day" || w === "timeline-day" || w === "resource-day" ? d.setDate(d.getDate() - 1) : w === "timeline-3day" ? d.setDate(d.getDate() - 3) : w === "week" || w === "timeline-week" || w === "resource-week" ? d.setDate(d.getDate() - 7) : w === "month" ? d.setMonth(d.getMonth() - 1) : w === "year" ? d.setFullYear(d.getFullYear() - 1) : d.setDate(d.getDate() - 7), P(d, w);
|
|
1858
1914
|
},
|
|
1859
1915
|
onNavigateNext: () => {
|
|
1860
|
-
const d = new Date(
|
|
1861
|
-
w === "day" || w === "timeline-day" || w === "resource-day" ? d.setDate(d.getDate() + 1) : w === "timeline-3day" ? d.setDate(d.getDate() + 3) : w === "week" || w === "timeline-week" || w === "resource-week" ? d.setDate(d.getDate() + 7) : w === "month" ? d.setMonth(d.getMonth() + 1) : w === "year" ? d.setFullYear(d.getFullYear() + 1) : d.setDate(d.getDate() + 7),
|
|
1916
|
+
const d = new Date(F);
|
|
1917
|
+
w === "day" || w === "timeline-day" || w === "resource-day" ? d.setDate(d.getDate() + 1) : w === "timeline-3day" ? d.setDate(d.getDate() + 3) : w === "week" || w === "timeline-week" || w === "resource-week" ? d.setDate(d.getDate() + 7) : w === "month" ? d.setMonth(d.getMonth() + 1) : w === "year" ? d.setFullYear(d.getFullYear() + 1) : d.setDate(d.getDate() + 7), P(d, w);
|
|
1862
1918
|
},
|
|
1863
1919
|
availableViews: [
|
|
1864
1920
|
"day",
|
|
@@ -1868,31 +1924,32 @@ function Jt({
|
|
|
1868
1924
|
"agenda"
|
|
1869
1925
|
],
|
|
1870
1926
|
showTimelineViews: !0,
|
|
1871
|
-
showSettings: !!
|
|
1872
|
-
...!
|
|
1873
|
-
actions:
|
|
1874
|
-
settingsContent:
|
|
1875
|
-
filterContent:
|
|
1927
|
+
showSettings: !!L,
|
|
1928
|
+
...!z && s && { onAddEvent: s },
|
|
1929
|
+
actions: z,
|
|
1930
|
+
settingsContent: L,
|
|
1931
|
+
filterContent: A,
|
|
1932
|
+
...C && { headerConfig: C }
|
|
1876
1933
|
}
|
|
1877
1934
|
),
|
|
1878
1935
|
/* @__PURE__ */ n("div", { className: "relative flex-1 min-h-0", children: [
|
|
1879
1936
|
/* @__PURE__ */ e(
|
|
1880
1937
|
"div",
|
|
1881
1938
|
{
|
|
1882
|
-
ref:
|
|
1883
|
-
className:
|
|
1939
|
+
ref: M,
|
|
1940
|
+
className: u(
|
|
1884
1941
|
"h-full border rounded-lg bg-white overflow-x-auto",
|
|
1885
1942
|
p?.viewContainer
|
|
1886
1943
|
),
|
|
1887
|
-
children:
|
|
1944
|
+
children: D()
|
|
1888
1945
|
}
|
|
1889
1946
|
),
|
|
1890
1947
|
x && /* @__PURE__ */ e("div", { className: "inno-calendar-loading-overlay", children: /* @__PURE__ */ e("div", { className: "inno-calendar-spinner" }) }),
|
|
1891
|
-
|
|
1948
|
+
J && /* @__PURE__ */ e(
|
|
1892
1949
|
"button",
|
|
1893
1950
|
{
|
|
1894
1951
|
type: "button",
|
|
1895
|
-
onClick:
|
|
1952
|
+
onClick: R,
|
|
1896
1953
|
className: "inno-scroll-right-btn",
|
|
1897
1954
|
"aria-label": "Scroll right",
|
|
1898
1955
|
children: /* @__PURE__ */ n(
|
|
@@ -1923,87 +1980,93 @@ function Jt({
|
|
|
1923
1980
|
}
|
|
1924
1981
|
);
|
|
1925
1982
|
}
|
|
1926
|
-
function
|
|
1983
|
+
function tr({
|
|
1927
1984
|
events: t,
|
|
1928
1985
|
users: r = [],
|
|
1929
1986
|
scheduleTypes: o = [],
|
|
1930
1987
|
initialView: s = "week",
|
|
1931
|
-
initialDate:
|
|
1932
|
-
initialSelectedUserId:
|
|
1988
|
+
initialDate: a,
|
|
1989
|
+
initialSelectedUserId: i,
|
|
1933
1990
|
initialScheduleTypeIds: g,
|
|
1934
1991
|
initialParticipantIds: f,
|
|
1935
|
-
initialWorkingHoursView:
|
|
1992
|
+
initialWorkingHoursView: l,
|
|
1936
1993
|
initialSearchQuery: x,
|
|
1937
|
-
preferencesConfig:
|
|
1994
|
+
preferencesConfig: y,
|
|
1938
1995
|
onEventClick: p,
|
|
1939
|
-
onSlotClick:
|
|
1940
|
-
onSlotSelect:
|
|
1941
|
-
onAddEvent:
|
|
1942
|
-
onEventDrop:
|
|
1943
|
-
onDateChange:
|
|
1944
|
-
onViewChange:
|
|
1945
|
-
className:
|
|
1946
|
-
showHeader:
|
|
1947
|
-
minSelectionMinutes:
|
|
1948
|
-
showMoreMode:
|
|
1949
|
-
showMoreEventsInPopover:
|
|
1950
|
-
isLoading:
|
|
1951
|
-
renderPopover:
|
|
1952
|
-
slots:
|
|
1953
|
-
classNames:
|
|
1954
|
-
settingsContent:
|
|
1955
|
-
filterContent:
|
|
1996
|
+
onSlotClick: L,
|
|
1997
|
+
onSlotSelect: A,
|
|
1998
|
+
onAddEvent: z,
|
|
1999
|
+
onEventDrop: j,
|
|
2000
|
+
onDateChange: I,
|
|
2001
|
+
onViewChange: C,
|
|
2002
|
+
className: T,
|
|
2003
|
+
showHeader: _ = !0,
|
|
2004
|
+
minSelectionMinutes: Y = 30,
|
|
2005
|
+
showMoreMode: w,
|
|
2006
|
+
showMoreEventsInPopover: W = !1,
|
|
2007
|
+
isLoading: F = !1,
|
|
2008
|
+
renderPopover: P,
|
|
2009
|
+
slots: K,
|
|
2010
|
+
classNames: q,
|
|
2011
|
+
settingsContent: V,
|
|
2012
|
+
filterContent: B,
|
|
1956
2013
|
headerActions: m,
|
|
1957
|
-
focusEventId:
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
2014
|
+
focusEventId: b,
|
|
2015
|
+
headerConfig: E,
|
|
2016
|
+
eventDetailMode: $,
|
|
2017
|
+
renderEventDetail: H
|
|
2018
|
+
}, Q) {
|
|
2019
|
+
return /* @__PURE__ */ e(mt, { ...j && { onEventDrop: j }, children: /* @__PURE__ */ e(
|
|
2020
|
+
ft,
|
|
1961
2021
|
{
|
|
1962
2022
|
initialEvents: t,
|
|
1963
2023
|
initialUsers: r,
|
|
1964
2024
|
initialScheduleTypes: o,
|
|
1965
2025
|
initialView: s,
|
|
1966
|
-
...
|
|
1967
|
-
...
|
|
2026
|
+
...a && { initialDate: a },
|
|
2027
|
+
...i && { initialSelectedUserId: i },
|
|
1968
2028
|
...g && { initialScheduleTypeIds: g },
|
|
1969
2029
|
...f && { initialParticipantIds: f },
|
|
1970
|
-
...
|
|
2030
|
+
...l && { initialWorkingHoursView: l },
|
|
1971
2031
|
...x && { initialSearchQuery: x },
|
|
1972
|
-
...
|
|
1973
|
-
...
|
|
1974
|
-
...
|
|
1975
|
-
...
|
|
2032
|
+
...y && { preferencesConfig: y },
|
|
2033
|
+
...I && { onDateChange: I },
|
|
2034
|
+
...C && { onViewChange: C },
|
|
2035
|
+
...b && { initialFocusEventId: b },
|
|
1976
2036
|
children: /* @__PURE__ */ e(
|
|
1977
|
-
|
|
2037
|
+
er,
|
|
1978
2038
|
{
|
|
1979
2039
|
...p && { onEventClick: p },
|
|
1980
|
-
...
|
|
1981
|
-
...
|
|
1982
|
-
...
|
|
1983
|
-
...
|
|
1984
|
-
className:
|
|
1985
|
-
showHeader:
|
|
1986
|
-
minSelectionMinutes:
|
|
1987
|
-
...
|
|
1988
|
-
showMoreEventsInPopover:
|
|
1989
|
-
isLoading:
|
|
1990
|
-
...
|
|
1991
|
-
...
|
|
1992
|
-
settingsContent:
|
|
1993
|
-
filterContent:
|
|
2040
|
+
...L && { onSlotClick: L },
|
|
2041
|
+
...A && { onSlotSelect: A },
|
|
2042
|
+
...z && { onAddEvent: z },
|
|
2043
|
+
...P && { renderPopover: P },
|
|
2044
|
+
className: T,
|
|
2045
|
+
showHeader: _,
|
|
2046
|
+
minSelectionMinutes: Y,
|
|
2047
|
+
...w && { showMoreMode: w },
|
|
2048
|
+
showMoreEventsInPopover: W,
|
|
2049
|
+
isLoading: F,
|
|
2050
|
+
...K && { slots: K },
|
|
2051
|
+
...q && { classNames: q },
|
|
2052
|
+
settingsContent: V,
|
|
2053
|
+
filterContent: B,
|
|
1994
2054
|
headerActions: m,
|
|
1995
|
-
calendarRef:
|
|
2055
|
+
calendarRef: Q,
|
|
2056
|
+
...E && { headerConfig: E },
|
|
2057
|
+
...$ && { eventDetailMode: $ },
|
|
2058
|
+
...H && { renderEventDetail: H }
|
|
1996
2059
|
}
|
|
1997
2060
|
)
|
|
1998
2061
|
}
|
|
1999
2062
|
) });
|
|
2000
2063
|
}
|
|
2001
|
-
const
|
|
2064
|
+
const Qr = be(tr), le = be(
|
|
2002
2065
|
({ className: t, children: r, ...o }, s) => /* @__PURE__ */ e(
|
|
2003
2066
|
"select",
|
|
2004
2067
|
{
|
|
2005
2068
|
ref: s,
|
|
2006
|
-
className:
|
|
2069
|
+
className: u(
|
|
2007
2070
|
"flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm",
|
|
2008
2071
|
"ring-offset-background",
|
|
2009
2072
|
"focus:outline-none focus:ring-1 focus:ring-ring",
|
|
@@ -2016,20 +2079,20 @@ const Kr = xe(Xt), te = xe(
|
|
|
2016
2079
|
}
|
|
2017
2080
|
)
|
|
2018
2081
|
);
|
|
2019
|
-
|
|
2020
|
-
const
|
|
2082
|
+
le.displayName = "Select";
|
|
2083
|
+
const ne = be(({ className: t, ...r }, o) => /* @__PURE__ */ e(
|
|
2021
2084
|
"label",
|
|
2022
2085
|
{
|
|
2023
2086
|
ref: o,
|
|
2024
|
-
className:
|
|
2087
|
+
className: u(
|
|
2025
2088
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
2026
2089
|
t
|
|
2027
2090
|
),
|
|
2028
2091
|
...r
|
|
2029
2092
|
}
|
|
2030
2093
|
));
|
|
2031
|
-
|
|
2032
|
-
function
|
|
2094
|
+
ne.displayName = "Label";
|
|
2095
|
+
function rr({ className: t }) {
|
|
2033
2096
|
return /* @__PURE__ */ n(
|
|
2034
2097
|
"svg",
|
|
2035
2098
|
{
|
|
@@ -2051,7 +2114,7 @@ function Qt({ className: t }) {
|
|
|
2051
2114
|
}
|
|
2052
2115
|
);
|
|
2053
2116
|
}
|
|
2054
|
-
function
|
|
2117
|
+
function nr({ className: t }) {
|
|
2055
2118
|
return /* @__PURE__ */ n(
|
|
2056
2119
|
"svg",
|
|
2057
2120
|
{
|
|
@@ -2072,50 +2135,50 @@ function Zt({ className: t }) {
|
|
|
2072
2135
|
}
|
|
2073
2136
|
);
|
|
2074
2137
|
}
|
|
2075
|
-
const
|
|
2138
|
+
const or = [
|
|
2076
2139
|
{ value: 15, label: "15 minutes" },
|
|
2077
2140
|
{ value: 30, label: "30 minutes" },
|
|
2078
2141
|
{ value: 60, label: "1 hour" }
|
|
2079
2142
|
];
|
|
2080
|
-
function
|
|
2143
|
+
function Zr({
|
|
2081
2144
|
value: t,
|
|
2082
2145
|
onChange: r,
|
|
2083
2146
|
isLocked: o = !1,
|
|
2084
2147
|
className: s,
|
|
2085
|
-
labels:
|
|
2148
|
+
labels: a = {}
|
|
2086
2149
|
}) {
|
|
2087
|
-
const
|
|
2150
|
+
const i = {
|
|
2088
2151
|
title: "Slot duration",
|
|
2089
2152
|
lockedMessage: "This setting is locked by the administrator",
|
|
2090
2153
|
infoMessage: "Set the time slot duration for day and week calendar views.",
|
|
2091
|
-
...
|
|
2154
|
+
...a
|
|
2092
2155
|
}, g = (f) => {
|
|
2093
2156
|
o || r(Number(f.target.value));
|
|
2094
2157
|
};
|
|
2095
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2158
|
+
return /* @__PURE__ */ n("div", { className: u("flex flex-col gap-3", s), children: [
|
|
2096
2159
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2097
|
-
/* @__PURE__ */ e(
|
|
2098
|
-
o ? /* @__PURE__ */ e(
|
|
2099
|
-
/* @__PURE__ */ e(
|
|
2100
|
-
/* @__PURE__ */ e(
|
|
2101
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2102
|
-
/* @__PURE__ */ e(
|
|
2103
|
-
/* @__PURE__ */ e(
|
|
2160
|
+
/* @__PURE__ */ e(ne, { className: "text-sm font-semibold", children: i.title }),
|
|
2161
|
+
o ? /* @__PURE__ */ e(oe, { delayDuration: 100, children: /* @__PURE__ */ n(se, { children: [
|
|
2162
|
+
/* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(nr, { className: "size-3 text-muted-foreground" }) }),
|
|
2163
|
+
/* @__PURE__ */ e(ie, { children: /* @__PURE__ */ e("p", { children: i.lockedMessage }) })
|
|
2164
|
+
] }) }) : /* @__PURE__ */ e(oe, { delayDuration: 100, children: /* @__PURE__ */ n(se, { children: [
|
|
2165
|
+
/* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(rr, { className: "size-3 text-muted-foreground" }) }),
|
|
2166
|
+
/* @__PURE__ */ e(ie, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: i.infoMessage }) })
|
|
2104
2167
|
] }) })
|
|
2105
2168
|
] }),
|
|
2106
2169
|
/* @__PURE__ */ e(
|
|
2107
|
-
|
|
2170
|
+
le,
|
|
2108
2171
|
{
|
|
2109
2172
|
value: t.toString(),
|
|
2110
2173
|
onChange: g,
|
|
2111
2174
|
disabled: o,
|
|
2112
2175
|
className: "h-9 w-[128px] text-sm",
|
|
2113
|
-
children:
|
|
2176
|
+
children: or.map((f) => /* @__PURE__ */ e("option", { value: f.value.toString(), children: f.label }, f.value))
|
|
2114
2177
|
}
|
|
2115
2178
|
)
|
|
2116
2179
|
] });
|
|
2117
2180
|
}
|
|
2118
|
-
function
|
|
2181
|
+
function sr({ className: t }) {
|
|
2119
2182
|
return /* @__PURE__ */ n(
|
|
2120
2183
|
"svg",
|
|
2121
2184
|
{
|
|
@@ -2137,7 +2200,7 @@ function tr({ className: t }) {
|
|
|
2137
2200
|
}
|
|
2138
2201
|
);
|
|
2139
2202
|
}
|
|
2140
|
-
function
|
|
2203
|
+
function ar({ className: t }) {
|
|
2141
2204
|
return /* @__PURE__ */ n(
|
|
2142
2205
|
"svg",
|
|
2143
2206
|
{
|
|
@@ -2158,19 +2221,19 @@ function rr({ className: t }) {
|
|
|
2158
2221
|
}
|
|
2159
2222
|
);
|
|
2160
2223
|
}
|
|
2161
|
-
const
|
|
2224
|
+
const ir = [
|
|
2162
2225
|
{ value: "dot", label: "Dot indicator" },
|
|
2163
2226
|
{ value: "colored", label: "Full color" },
|
|
2164
2227
|
{ value: "mixed", label: "Mixed" }
|
|
2165
2228
|
];
|
|
2166
|
-
function
|
|
2229
|
+
function en({
|
|
2167
2230
|
value: t,
|
|
2168
2231
|
onChange: r,
|
|
2169
2232
|
isLocked: o = !1,
|
|
2170
2233
|
className: s,
|
|
2171
|
-
labels:
|
|
2234
|
+
labels: a = {}
|
|
2172
2235
|
}) {
|
|
2173
|
-
const
|
|
2236
|
+
const i = {
|
|
2174
2237
|
title: "Event display",
|
|
2175
2238
|
lockedMessage: "This setting is locked by the administrator",
|
|
2176
2239
|
infoMessage: "Choose how events are displayed. Dot shows a small indicator, colored fills the entire event, mixed uses both.",
|
|
@@ -2179,34 +2242,34 @@ function Jr({
|
|
|
2179
2242
|
colored: "Full color",
|
|
2180
2243
|
mixed: "Mixed"
|
|
2181
2244
|
},
|
|
2182
|
-
...
|
|
2183
|
-
}, g = (
|
|
2184
|
-
o || r(
|
|
2245
|
+
...a
|
|
2246
|
+
}, g = (l) => i.options?.[l] ?? l, f = (l) => {
|
|
2247
|
+
o || r(l.target.value);
|
|
2185
2248
|
};
|
|
2186
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2249
|
+
return /* @__PURE__ */ n("div", { className: u("flex flex-col gap-3", s), children: [
|
|
2187
2250
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2188
|
-
/* @__PURE__ */ e(
|
|
2189
|
-
o ? /* @__PURE__ */ e(
|
|
2190
|
-
/* @__PURE__ */ e(
|
|
2191
|
-
/* @__PURE__ */ e(
|
|
2192
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2193
|
-
/* @__PURE__ */ e(
|
|
2194
|
-
/* @__PURE__ */ e(
|
|
2251
|
+
/* @__PURE__ */ e(ne, { className: "text-sm font-semibold", children: i.title }),
|
|
2252
|
+
o ? /* @__PURE__ */ e(oe, { delayDuration: 100, children: /* @__PURE__ */ n(se, { children: [
|
|
2253
|
+
/* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(ar, { className: "size-3 text-muted-foreground" }) }),
|
|
2254
|
+
/* @__PURE__ */ e(ie, { children: /* @__PURE__ */ e("p", { children: i.lockedMessage }) })
|
|
2255
|
+
] }) }) : /* @__PURE__ */ e(oe, { delayDuration: 100, children: /* @__PURE__ */ n(se, { children: [
|
|
2256
|
+
/* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(sr, { className: "size-3 text-muted-foreground" }) }),
|
|
2257
|
+
/* @__PURE__ */ e(ie, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: i.infoMessage }) })
|
|
2195
2258
|
] }) })
|
|
2196
2259
|
] }),
|
|
2197
2260
|
/* @__PURE__ */ e(
|
|
2198
|
-
|
|
2261
|
+
le,
|
|
2199
2262
|
{
|
|
2200
2263
|
value: t,
|
|
2201
2264
|
onChange: f,
|
|
2202
2265
|
disabled: o,
|
|
2203
2266
|
className: "h-9 w-[128px] text-sm",
|
|
2204
|
-
children:
|
|
2267
|
+
children: ir.map((l) => /* @__PURE__ */ e("option", { value: l.value, children: g(l.value) }, l.value))
|
|
2205
2268
|
}
|
|
2206
2269
|
)
|
|
2207
2270
|
] });
|
|
2208
2271
|
}
|
|
2209
|
-
function
|
|
2272
|
+
function lr({ className: t }) {
|
|
2210
2273
|
return /* @__PURE__ */ n(
|
|
2211
2274
|
"svg",
|
|
2212
2275
|
{
|
|
@@ -2228,7 +2291,7 @@ function or({ className: t }) {
|
|
|
2228
2291
|
}
|
|
2229
2292
|
);
|
|
2230
2293
|
}
|
|
2231
|
-
function
|
|
2294
|
+
function cr({ className: t }) {
|
|
2232
2295
|
return /* @__PURE__ */ n(
|
|
2233
2296
|
"svg",
|
|
2234
2297
|
{
|
|
@@ -2249,51 +2312,51 @@ function sr({ className: t }) {
|
|
|
2249
2312
|
}
|
|
2250
2313
|
);
|
|
2251
2314
|
}
|
|
2252
|
-
function
|
|
2315
|
+
function dr() {
|
|
2253
2316
|
return Array.from({ length: 25 }, (t, r) => ({
|
|
2254
2317
|
value: r,
|
|
2255
2318
|
label: `${String(r).padStart(2, "0")}:00`
|
|
2256
2319
|
}));
|
|
2257
2320
|
}
|
|
2258
|
-
function
|
|
2321
|
+
function tn({
|
|
2259
2322
|
value: t,
|
|
2260
2323
|
onChange: r,
|
|
2261
2324
|
isLocked: o = !1,
|
|
2262
2325
|
className: s,
|
|
2263
|
-
labels:
|
|
2326
|
+
labels: a = {}
|
|
2264
2327
|
}) {
|
|
2265
|
-
const
|
|
2328
|
+
const i = {
|
|
2266
2329
|
title: "Visible hours",
|
|
2267
2330
|
from: "From",
|
|
2268
2331
|
to: "To",
|
|
2269
2332
|
lockedMessage: "This setting is locked by the administrator",
|
|
2270
2333
|
infoMessage: "Set the visible hour range for day and week views. Hours outside this range will be hidden.",
|
|
2271
|
-
...
|
|
2272
|
-
}, g =
|
|
2334
|
+
...a
|
|
2335
|
+
}, g = dr(), f = (x) => {
|
|
2273
2336
|
if (o) return;
|
|
2274
|
-
const
|
|
2275
|
-
|
|
2276
|
-
},
|
|
2337
|
+
const y = Number(x.target.value);
|
|
2338
|
+
y < t.endHour && r({ ...t, startHour: y });
|
|
2339
|
+
}, l = (x) => {
|
|
2277
2340
|
if (o) return;
|
|
2278
|
-
const
|
|
2279
|
-
|
|
2341
|
+
const y = Number(x.target.value);
|
|
2342
|
+
y > t.startHour && r({ ...t, endHour: y });
|
|
2280
2343
|
};
|
|
2281
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2344
|
+
return /* @__PURE__ */ n("div", { className: u("flex flex-col gap-3", s), children: [
|
|
2282
2345
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2283
|
-
/* @__PURE__ */ e(
|
|
2284
|
-
o ? /* @__PURE__ */ e(
|
|
2285
|
-
/* @__PURE__ */ e(
|
|
2286
|
-
/* @__PURE__ */ e(
|
|
2287
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2288
|
-
/* @__PURE__ */ e(
|
|
2289
|
-
/* @__PURE__ */ e(
|
|
2346
|
+
/* @__PURE__ */ e(ne, { className: "text-sm font-semibold", children: i.title }),
|
|
2347
|
+
o ? /* @__PURE__ */ e(oe, { delayDuration: 100, children: /* @__PURE__ */ n(se, { children: [
|
|
2348
|
+
/* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(cr, { className: "size-3 text-muted-foreground" }) }),
|
|
2349
|
+
/* @__PURE__ */ e(ie, { children: /* @__PURE__ */ e("p", { children: i.lockedMessage }) })
|
|
2350
|
+
] }) }) : /* @__PURE__ */ e(oe, { delayDuration: 100, children: /* @__PURE__ */ n(se, { children: [
|
|
2351
|
+
/* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(lr, { className: "size-3 text-muted-foreground" }) }),
|
|
2352
|
+
/* @__PURE__ */ e(ie, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: i.infoMessage }) })
|
|
2290
2353
|
] }) })
|
|
2291
2354
|
] }),
|
|
2292
2355
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2293
2356
|
/* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
2294
|
-
/* @__PURE__ */ e(
|
|
2357
|
+
/* @__PURE__ */ e(ne, { className: "text-xs text-muted-foreground", children: i.from }),
|
|
2295
2358
|
/* @__PURE__ */ e(
|
|
2296
|
-
|
|
2359
|
+
le,
|
|
2297
2360
|
{
|
|
2298
2361
|
value: t.startHour.toString(),
|
|
2299
2362
|
onChange: f,
|
|
@@ -2313,12 +2376,12 @@ function Xr({
|
|
|
2313
2376
|
] }),
|
|
2314
2377
|
/* @__PURE__ */ e("span", { className: "mt-5 text-muted-foreground", children: "—" }),
|
|
2315
2378
|
/* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
2316
|
-
/* @__PURE__ */ e(
|
|
2379
|
+
/* @__PURE__ */ e(ne, { className: "text-xs text-muted-foreground", children: i.to }),
|
|
2317
2380
|
/* @__PURE__ */ e(
|
|
2318
|
-
|
|
2381
|
+
le,
|
|
2319
2382
|
{
|
|
2320
2383
|
value: t.endHour.toString(),
|
|
2321
|
-
onChange:
|
|
2384
|
+
onChange: l,
|
|
2322
2385
|
disabled: o,
|
|
2323
2386
|
className: "h-9 w-[88px] text-sm",
|
|
2324
2387
|
children: g.map((x) => /* @__PURE__ */ e(
|
|
@@ -2336,7 +2399,7 @@ function Xr({
|
|
|
2336
2399
|
] })
|
|
2337
2400
|
] });
|
|
2338
2401
|
}
|
|
2339
|
-
function
|
|
2402
|
+
function ur({ className: t }) {
|
|
2340
2403
|
return /* @__PURE__ */ n(
|
|
2341
2404
|
"svg",
|
|
2342
2405
|
{
|
|
@@ -2358,7 +2421,7 @@ function ir({ className: t }) {
|
|
|
2358
2421
|
}
|
|
2359
2422
|
);
|
|
2360
2423
|
}
|
|
2361
|
-
function
|
|
2424
|
+
function hr({ className: t }) {
|
|
2362
2425
|
return /* @__PURE__ */ n(
|
|
2363
2426
|
"svg",
|
|
2364
2427
|
{
|
|
@@ -2379,7 +2442,7 @@ function lr({ className: t }) {
|
|
|
2379
2442
|
}
|
|
2380
2443
|
);
|
|
2381
2444
|
}
|
|
2382
|
-
function
|
|
2445
|
+
function mr({ className: t }) {
|
|
2383
2446
|
return /* @__PURE__ */ e(
|
|
2384
2447
|
"svg",
|
|
2385
2448
|
{
|
|
@@ -2397,7 +2460,7 @@ function cr({ className: t }) {
|
|
|
2397
2460
|
}
|
|
2398
2461
|
);
|
|
2399
2462
|
}
|
|
2400
|
-
const
|
|
2463
|
+
const fr = [
|
|
2401
2464
|
"monday",
|
|
2402
2465
|
"tuesday",
|
|
2403
2466
|
"wednesday",
|
|
@@ -2406,13 +2469,13 @@ const dr = [
|
|
|
2406
2469
|
"saturday",
|
|
2407
2470
|
"sunday"
|
|
2408
2471
|
];
|
|
2409
|
-
function
|
|
2472
|
+
function gr() {
|
|
2410
2473
|
return Array.from({ length: 25 }, (t, r) => ({
|
|
2411
2474
|
value: r,
|
|
2412
2475
|
label: `${String(r).padStart(2, "0")}:00`
|
|
2413
2476
|
}));
|
|
2414
2477
|
}
|
|
2415
|
-
const
|
|
2478
|
+
const Oe = {
|
|
2416
2479
|
sunday: "Sun",
|
|
2417
2480
|
monday: "Mon",
|
|
2418
2481
|
tuesday: "Tue",
|
|
@@ -2421,16 +2484,16 @@ const We = {
|
|
|
2421
2484
|
friday: "Fri",
|
|
2422
2485
|
saturday: "Sat"
|
|
2423
2486
|
};
|
|
2424
|
-
function
|
|
2425
|
-
const
|
|
2487
|
+
function xr({ dayLabel: t, config: r, onChange: o, disabled: s, hourOptions: a }) {
|
|
2488
|
+
const i = () => {
|
|
2426
2489
|
s || o({ ...r, enabled: !r.enabled });
|
|
2427
|
-
}, g = (
|
|
2490
|
+
}, g = (l) => {
|
|
2428
2491
|
if (s) return;
|
|
2429
|
-
const x = Number(
|
|
2492
|
+
const x = Number(l.target.value);
|
|
2430
2493
|
x < r.to && o({ ...r, from: x });
|
|
2431
|
-
}, f = (
|
|
2494
|
+
}, f = (l) => {
|
|
2432
2495
|
if (s) return;
|
|
2433
|
-
const x = Number(
|
|
2496
|
+
const x = Number(l.target.value);
|
|
2434
2497
|
x > r.from && o({ ...r, to: x });
|
|
2435
2498
|
};
|
|
2436
2499
|
return /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
@@ -2441,81 +2504,81 @@ function hr({ dayLabel: t, config: r, onChange: o, disabled: s, hourOptions: i }
|
|
|
2441
2504
|
role: "checkbox",
|
|
2442
2505
|
"aria-checked": r.enabled,
|
|
2443
2506
|
"aria-label": `Enable ${t}`,
|
|
2444
|
-
onClick:
|
|
2507
|
+
onClick: i,
|
|
2445
2508
|
disabled: s,
|
|
2446
|
-
className:
|
|
2509
|
+
className: u(
|
|
2447
2510
|
"flex size-5 shrink-0 items-center justify-center rounded border transition-colors",
|
|
2448
2511
|
r.enabled ? "border-primary bg-primary text-primary-foreground" : "border-input bg-background",
|
|
2449
2512
|
s && "cursor-not-allowed opacity-50"
|
|
2450
2513
|
),
|
|
2451
|
-
children: r.enabled && /* @__PURE__ */ e(
|
|
2514
|
+
children: r.enabled && /* @__PURE__ */ e(mr, { className: "size-3" })
|
|
2452
2515
|
}
|
|
2453
2516
|
),
|
|
2454
|
-
/* @__PURE__ */ e("span", { className:
|
|
2517
|
+
/* @__PURE__ */ e("span", { className: u("w-10 text-sm", !r.enabled && "text-muted-foreground"), children: t }),
|
|
2455
2518
|
/* @__PURE__ */ e(
|
|
2456
|
-
|
|
2519
|
+
le,
|
|
2457
2520
|
{
|
|
2458
2521
|
value: r.from.toString(),
|
|
2459
2522
|
onChange: g,
|
|
2460
2523
|
disabled: s || !r.enabled,
|
|
2461
2524
|
className: "h-8 w-[76px] text-xs",
|
|
2462
|
-
children:
|
|
2525
|
+
children: a.map((l) => /* @__PURE__ */ e("option", { value: l.value.toString(), disabled: l.value >= r.to, children: l.label }, l.value))
|
|
2463
2526
|
}
|
|
2464
2527
|
),
|
|
2465
2528
|
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "—" }),
|
|
2466
2529
|
/* @__PURE__ */ e(
|
|
2467
|
-
|
|
2530
|
+
le,
|
|
2468
2531
|
{
|
|
2469
2532
|
value: r.to.toString(),
|
|
2470
2533
|
onChange: f,
|
|
2471
2534
|
disabled: s || !r.enabled,
|
|
2472
2535
|
className: "h-8 w-[76px] text-xs",
|
|
2473
|
-
children:
|
|
2536
|
+
children: a.map((l) => /* @__PURE__ */ e("option", { value: l.value.toString(), disabled: l.value <= r.from, children: l.label }, l.value))
|
|
2474
2537
|
}
|
|
2475
2538
|
)
|
|
2476
2539
|
] });
|
|
2477
2540
|
}
|
|
2478
|
-
function
|
|
2541
|
+
function rn({
|
|
2479
2542
|
value: t,
|
|
2480
2543
|
onChange: r,
|
|
2481
2544
|
isLocked: o = !1,
|
|
2482
2545
|
className: s,
|
|
2483
|
-
labels:
|
|
2546
|
+
labels: a = {}
|
|
2484
2547
|
}) {
|
|
2485
|
-
const
|
|
2548
|
+
const i = {
|
|
2486
2549
|
title: "Working hours",
|
|
2487
2550
|
lockedMessage: "This setting is locked by the administrator",
|
|
2488
2551
|
infoMessage: "Configure working hours for each day of the week. Non-working hours will be grayed out in day and week views.",
|
|
2489
|
-
days:
|
|
2490
|
-
...
|
|
2491
|
-
}, g =
|
|
2492
|
-
o || r({ ...t, [
|
|
2552
|
+
days: Oe,
|
|
2553
|
+
...a
|
|
2554
|
+
}, g = gr(), f = (l, x) => {
|
|
2555
|
+
o || r({ ...t, [l]: x });
|
|
2493
2556
|
};
|
|
2494
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2557
|
+
return /* @__PURE__ */ n("div", { className: u("flex flex-col gap-3", s), children: [
|
|
2495
2558
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2496
|
-
/* @__PURE__ */ e(
|
|
2497
|
-
o ? /* @__PURE__ */ e(
|
|
2498
|
-
/* @__PURE__ */ e(
|
|
2499
|
-
/* @__PURE__ */ e(
|
|
2500
|
-
] }) }) : /* @__PURE__ */ e(
|
|
2501
|
-
/* @__PURE__ */ e(
|
|
2502
|
-
/* @__PURE__ */ e(
|
|
2559
|
+
/* @__PURE__ */ e(ne, { className: "text-sm font-semibold", children: i.title }),
|
|
2560
|
+
o ? /* @__PURE__ */ e(oe, { delayDuration: 100, children: /* @__PURE__ */ n(se, { children: [
|
|
2561
|
+
/* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(hr, { className: "size-3 text-muted-foreground" }) }),
|
|
2562
|
+
/* @__PURE__ */ e(ie, { children: /* @__PURE__ */ e("p", { children: i.lockedMessage }) })
|
|
2563
|
+
] }) }) : /* @__PURE__ */ e(oe, { delayDuration: 100, children: /* @__PURE__ */ n(se, { children: [
|
|
2564
|
+
/* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(ur, { className: "size-3 text-muted-foreground" }) }),
|
|
2565
|
+
/* @__PURE__ */ e(ie, { className: "max-w-64 text-center", children: /* @__PURE__ */ e("p", { children: i.infoMessage }) })
|
|
2503
2566
|
] }) })
|
|
2504
2567
|
] }),
|
|
2505
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children:
|
|
2506
|
-
|
|
2568
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: fr.map((l) => /* @__PURE__ */ e(
|
|
2569
|
+
xr,
|
|
2507
2570
|
{
|
|
2508
|
-
dayLabel:
|
|
2509
|
-
config: t[
|
|
2510
|
-
onChange: (x) => f(
|
|
2571
|
+
dayLabel: i.days?.[l] ?? Oe[l],
|
|
2572
|
+
config: t[l],
|
|
2573
|
+
onChange: (x) => f(l, x),
|
|
2511
2574
|
disabled: o,
|
|
2512
2575
|
hourOptions: g
|
|
2513
2576
|
},
|
|
2514
|
-
|
|
2577
|
+
l
|
|
2515
2578
|
)) })
|
|
2516
2579
|
] });
|
|
2517
2580
|
}
|
|
2518
|
-
const
|
|
2581
|
+
const nn = {
|
|
2519
2582
|
sunday: { enabled: !1, from: 8, to: 18 },
|
|
2520
2583
|
monday: { enabled: !0, from: 8, to: 18 },
|
|
2521
2584
|
tuesday: { enabled: !0, from: 8, to: 18 },
|
|
@@ -2524,7 +2587,7 @@ const Zr = {
|
|
|
2524
2587
|
friday: { enabled: !0, from: 8, to: 18 },
|
|
2525
2588
|
saturday: { enabled: !1, from: 8, to: 18 }
|
|
2526
2589
|
};
|
|
2527
|
-
function
|
|
2590
|
+
function De({ className: t }) {
|
|
2528
2591
|
return /* @__PURE__ */ e(
|
|
2529
2592
|
"svg",
|
|
2530
2593
|
{
|
|
@@ -2540,7 +2603,7 @@ function be({ className: t }) {
|
|
|
2540
2603
|
}
|
|
2541
2604
|
);
|
|
2542
2605
|
}
|
|
2543
|
-
function
|
|
2606
|
+
function pr({ className: t }) {
|
|
2544
2607
|
return /* @__PURE__ */ n(
|
|
2545
2608
|
"svg",
|
|
2546
2609
|
{
|
|
@@ -2559,7 +2622,7 @@ function mr({ className: t }) {
|
|
|
2559
2622
|
}
|
|
2560
2623
|
);
|
|
2561
2624
|
}
|
|
2562
|
-
function
|
|
2625
|
+
function vr({ className: t }) {
|
|
2563
2626
|
return /* @__PURE__ */ n(
|
|
2564
2627
|
"svg",
|
|
2565
2628
|
{
|
|
@@ -2578,7 +2641,7 @@ function fr({ className: t }) {
|
|
|
2578
2641
|
}
|
|
2579
2642
|
);
|
|
2580
2643
|
}
|
|
2581
|
-
function
|
|
2644
|
+
function Me({ checked: t, onCheckedChange: r, className: o, children: s }) {
|
|
2582
2645
|
return /* @__PURE__ */ e(
|
|
2583
2646
|
"button",
|
|
2584
2647
|
{
|
|
@@ -2591,12 +2654,12 @@ function ye({ checked: t, onCheckedChange: r, className: o, children: s }) {
|
|
|
2591
2654
|
}
|
|
2592
2655
|
);
|
|
2593
2656
|
}
|
|
2594
|
-
function
|
|
2595
|
-
const [
|
|
2596
|
-
return !t ||
|
|
2657
|
+
function wr({ src: t, alt: r, fallback: o, className: s }) {
|
|
2658
|
+
const [a, i] = de(!1);
|
|
2659
|
+
return !t || a ? /* @__PURE__ */ e(
|
|
2597
2660
|
"div",
|
|
2598
2661
|
{
|
|
2599
|
-
className:
|
|
2662
|
+
className: u(
|
|
2600
2663
|
"flex items-center justify-center bg-zinc-200 text-zinc-600 font-medium text-sm",
|
|
2601
2664
|
s
|
|
2602
2665
|
),
|
|
@@ -2607,32 +2670,32 @@ function gr({ src: t, alt: r, fallback: o, className: s }) {
|
|
|
2607
2670
|
{
|
|
2608
2671
|
src: t,
|
|
2609
2672
|
alt: r || "",
|
|
2610
|
-
className:
|
|
2611
|
-
onError: () =>
|
|
2673
|
+
className: u("object-cover", s),
|
|
2674
|
+
onError: () => i(!0)
|
|
2612
2675
|
}
|
|
2613
2676
|
);
|
|
2614
2677
|
}
|
|
2615
|
-
function
|
|
2616
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2617
|
-
/* @__PURE__ */ e(
|
|
2678
|
+
function _e({ value: t, onChange: r, placeholder: o, className: s }) {
|
|
2679
|
+
return /* @__PURE__ */ n("div", { className: u("relative", s), children: [
|
|
2680
|
+
/* @__PURE__ */ e(pr, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
2618
2681
|
/* @__PURE__ */ e(
|
|
2619
2682
|
"input",
|
|
2620
2683
|
{
|
|
2621
2684
|
type: "text",
|
|
2622
2685
|
value: t,
|
|
2623
|
-
onChange: (
|
|
2686
|
+
onChange: (a) => r(a.target.value),
|
|
2624
2687
|
placeholder: o,
|
|
2625
2688
|
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"
|
|
2626
2689
|
}
|
|
2627
2690
|
)
|
|
2628
2691
|
] });
|
|
2629
2692
|
}
|
|
2630
|
-
function
|
|
2693
|
+
function Pe(t, r, o, s = 0.3) {
|
|
2631
2694
|
if (!r.trim()) return t;
|
|
2632
|
-
const
|
|
2633
|
-
return t.filter((
|
|
2695
|
+
const a = r.toLowerCase();
|
|
2696
|
+
return t.filter((i) => o(i).some((f) => f ? f.toLowerCase().includes(a) : !1));
|
|
2634
2697
|
}
|
|
2635
|
-
const
|
|
2698
|
+
const br = {
|
|
2636
2699
|
title: "Filters",
|
|
2637
2700
|
subtitle: "Filter calendar events",
|
|
2638
2701
|
scheduleTypes: "Event Types",
|
|
@@ -2645,73 +2708,73 @@ const xr = {
|
|
|
2645
2708
|
noScheduleTypes: "No event types found",
|
|
2646
2709
|
noParticipants: "No participants found"
|
|
2647
2710
|
};
|
|
2648
|
-
function
|
|
2711
|
+
function on({
|
|
2649
2712
|
scheduleTypes: t,
|
|
2650
2713
|
users: r,
|
|
2651
2714
|
selectedScheduleTypeIds: o,
|
|
2652
2715
|
onScheduleTypeChange: s,
|
|
2653
|
-
selectedUserIds:
|
|
2654
|
-
onUserChange:
|
|
2716
|
+
selectedUserIds: a,
|
|
2717
|
+
onUserChange: i,
|
|
2655
2718
|
onClearAll: g,
|
|
2656
2719
|
className: f,
|
|
2657
|
-
scheduleTypesLoading:
|
|
2720
|
+
scheduleTypesLoading: l = !1,
|
|
2658
2721
|
usersLoading: x = !1,
|
|
2659
|
-
labels:
|
|
2722
|
+
labels: y,
|
|
2660
2723
|
getScheduleTypeName: p
|
|
2661
2724
|
}) {
|
|
2662
|
-
const
|
|
2725
|
+
const L = { ...br, ...y }, [A, z] = de(""), [j, I] = de(""), C = U(() => A.trim() ? Pe(t, A, (m) => [
|
|
2663
2726
|
m.name,
|
|
2664
2727
|
p?.(m) || m.name
|
|
2665
|
-
]) : t, [t,
|
|
2666
|
-
const
|
|
2667
|
-
s(
|
|
2668
|
-
},
|
|
2669
|
-
if (
|
|
2670
|
-
const m = new Set(
|
|
2671
|
-
s(o.filter((
|
|
2728
|
+
]) : t, [t, A, p]), T = U(() => j.trim() ? Pe(r, j, (m) => [m.name, m.email || ""]) : r, [r, j]), _ = C.length > 0 && C.every((m) => o.includes(m.id)), Y = T.length > 0 && T.every((m) => a.includes(m.id)), w = o.length + a.length, W = (m, b) => {
|
|
2729
|
+
const E = b ? [...o, m] : o.filter(($) => $ !== m);
|
|
2730
|
+
s(E);
|
|
2731
|
+
}, F = () => {
|
|
2732
|
+
if (_) {
|
|
2733
|
+
const m = new Set(C.map((b) => b.id));
|
|
2734
|
+
s(o.filter((b) => !m.has(b)));
|
|
2672
2735
|
} else {
|
|
2673
2736
|
const m = /* @__PURE__ */ new Set([
|
|
2674
2737
|
...o,
|
|
2675
|
-
...
|
|
2738
|
+
...C.map((b) => b.id)
|
|
2676
2739
|
]);
|
|
2677
2740
|
s(Array.from(m));
|
|
2678
2741
|
}
|
|
2679
|
-
},
|
|
2680
|
-
const
|
|
2681
|
-
|
|
2682
|
-
},
|
|
2683
|
-
if (
|
|
2684
|
-
const m = new Set(
|
|
2685
|
-
|
|
2742
|
+
}, P = (m, b) => {
|
|
2743
|
+
const E = b ? [...a, m] : a.filter(($) => $ !== m);
|
|
2744
|
+
i(E);
|
|
2745
|
+
}, K = () => {
|
|
2746
|
+
if (Y) {
|
|
2747
|
+
const m = new Set(T.map((b) => b.id));
|
|
2748
|
+
i(a.filter((b) => !m.has(b)));
|
|
2686
2749
|
} else {
|
|
2687
|
-
const m = /* @__PURE__ */ new Set([...
|
|
2688
|
-
|
|
2750
|
+
const m = /* @__PURE__ */ new Set([...a, ...T.map((b) => b.id)]);
|
|
2751
|
+
i(Array.from(m));
|
|
2689
2752
|
}
|
|
2690
|
-
},
|
|
2691
|
-
s([]),
|
|
2692
|
-
},
|
|
2753
|
+
}, q = () => {
|
|
2754
|
+
s([]), i([]), g?.();
|
|
2755
|
+
}, V = (m) => p ? p(m) : m.name, B = (m) => m.colorHex || m.color || "#069AD7";
|
|
2693
2756
|
return /* @__PURE__ */ n(
|
|
2694
2757
|
"div",
|
|
2695
2758
|
{
|
|
2696
|
-
className:
|
|
2759
|
+
className: u(
|
|
2697
2760
|
"flex min-w-72 max-w-72 flex-col rounded-lg border bg-white shadow-sm",
|
|
2698
2761
|
f
|
|
2699
2762
|
),
|
|
2700
2763
|
children: [
|
|
2701
2764
|
/* @__PURE__ */ n("header", { className: "flex items-start justify-between gap-2 px-4 pb-2 pt-4", children: [
|
|
2702
2765
|
/* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
2703
|
-
/* @__PURE__ */ e("h3", { className: "text-base font-semibold text-foreground", children:
|
|
2704
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children:
|
|
2766
|
+
/* @__PURE__ */ e("h3", { className: "text-base font-semibold text-foreground", children: L.title }),
|
|
2767
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: L.subtitle })
|
|
2705
2768
|
] }),
|
|
2706
|
-
|
|
2769
|
+
w > 0 && /* @__PURE__ */ n(
|
|
2707
2770
|
"button",
|
|
2708
2771
|
{
|
|
2709
2772
|
type: "button",
|
|
2710
|
-
onClick:
|
|
2773
|
+
onClick: q,
|
|
2711
2774
|
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",
|
|
2712
2775
|
children: [
|
|
2713
|
-
/* @__PURE__ */ e(
|
|
2714
|
-
|
|
2776
|
+
/* @__PURE__ */ e(vr, { className: "h-3.5 w-3.5" }),
|
|
2777
|
+
L.clearAll
|
|
2715
2778
|
]
|
|
2716
2779
|
}
|
|
2717
2780
|
)
|
|
@@ -2719,29 +2782,29 @@ function en({
|
|
|
2719
2782
|
/* @__PURE__ */ e("div", { className: "h-px w-full bg-border/60" }),
|
|
2720
2783
|
/* @__PURE__ */ n("section", { className: "flex flex-col", children: [
|
|
2721
2784
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between px-4 py-3", children: [
|
|
2722
|
-
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children:
|
|
2785
|
+
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children: L.scheduleTypes }),
|
|
2723
2786
|
/* @__PURE__ */ e(
|
|
2724
2787
|
"button",
|
|
2725
2788
|
{
|
|
2726
2789
|
type: "button",
|
|
2727
|
-
onClick:
|
|
2790
|
+
onClick: F,
|
|
2728
2791
|
className: "text-xs font-medium text-primary transition-colors hover:text-primary/80",
|
|
2729
|
-
children:
|
|
2792
|
+
children: _ ? L.unselectAll : L.selectAll
|
|
2730
2793
|
}
|
|
2731
2794
|
)
|
|
2732
2795
|
] }),
|
|
2733
2796
|
t.length > 6 && /* @__PURE__ */ e("div", { className: "px-4 pb-3", children: /* @__PURE__ */ e(
|
|
2734
|
-
|
|
2797
|
+
_e,
|
|
2735
2798
|
{
|
|
2736
|
-
value:
|
|
2737
|
-
onChange:
|
|
2738
|
-
placeholder:
|
|
2799
|
+
value: A,
|
|
2800
|
+
onChange: z,
|
|
2801
|
+
placeholder: L.searchScheduleTypes
|
|
2739
2802
|
}
|
|
2740
2803
|
) }),
|
|
2741
2804
|
/* @__PURE__ */ n("div", { className: "flex max-h-[220px] flex-col gap-2 overflow-y-auto px-4 pb-2 scrollbar-thin", children: [
|
|
2742
|
-
|
|
2805
|
+
l ? (
|
|
2743
2806
|
// Loading skeletons
|
|
2744
|
-
Array.from({ length: 4 }).map((m,
|
|
2807
|
+
Array.from({ length: 4 }).map((m, b) => /* @__PURE__ */ n(
|
|
2745
2808
|
"div",
|
|
2746
2809
|
{
|
|
2747
2810
|
className: "flex animate-pulse items-center gap-2 rounded-md border border-border/60 bg-muted/40 p-2",
|
|
@@ -2750,40 +2813,40 @@ function en({
|
|
|
2750
2813
|
/* @__PURE__ */ e("div", { className: "h-3 w-24 rounded bg-muted-foreground/20" })
|
|
2751
2814
|
]
|
|
2752
2815
|
},
|
|
2753
|
-
`skeleton-${
|
|
2816
|
+
`skeleton-${b}`
|
|
2754
2817
|
))
|
|
2755
|
-
) :
|
|
2756
|
-
const
|
|
2818
|
+
) : C.map((m) => {
|
|
2819
|
+
const b = o.includes(m.id), E = B(m);
|
|
2757
2820
|
return /* @__PURE__ */ n(
|
|
2758
|
-
|
|
2821
|
+
Me,
|
|
2759
2822
|
{
|
|
2760
|
-
checked:
|
|
2761
|
-
onCheckedChange: (
|
|
2762
|
-
className:
|
|
2823
|
+
checked: b,
|
|
2824
|
+
onCheckedChange: ($) => W(m.id, $),
|
|
2825
|
+
className: u(
|
|
2763
2826
|
"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",
|
|
2764
|
-
|
|
2827
|
+
b && "border-primary bg-primary/5"
|
|
2765
2828
|
),
|
|
2766
2829
|
children: [
|
|
2767
2830
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2768
2831
|
/* @__PURE__ */ e(
|
|
2769
2832
|
"span",
|
|
2770
2833
|
{
|
|
2771
|
-
className:
|
|
2834
|
+
className: u(
|
|
2772
2835
|
"flex h-4 w-4 items-center justify-center rounded border border-border text-xs transition-colors",
|
|
2773
|
-
|
|
2836
|
+
b && "border-primary bg-primary text-primary-foreground"
|
|
2774
2837
|
),
|
|
2775
|
-
children:
|
|
2838
|
+
children: b && /* @__PURE__ */ e(De, { className: "h-3 w-3" })
|
|
2776
2839
|
}
|
|
2777
2840
|
),
|
|
2778
|
-
/* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children:
|
|
2841
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children: V(m) })
|
|
2779
2842
|
] }),
|
|
2780
2843
|
/* @__PURE__ */ e(
|
|
2781
2844
|
"div",
|
|
2782
2845
|
{
|
|
2783
2846
|
className: "h-4 w-4 rounded-full border",
|
|
2784
2847
|
style: {
|
|
2785
|
-
backgroundColor:
|
|
2786
|
-
borderColor:
|
|
2848
|
+
backgroundColor: E,
|
|
2849
|
+
borderColor: E
|
|
2787
2850
|
}
|
|
2788
2851
|
}
|
|
2789
2852
|
)
|
|
@@ -2792,38 +2855,38 @@ function en({
|
|
|
2792
2855
|
m.id
|
|
2793
2856
|
);
|
|
2794
2857
|
}),
|
|
2795
|
-
!
|
|
2858
|
+
!l && C.length === 0 && /* @__PURE__ */ e("p", { className: "px-2 py-1 text-xs text-muted-foreground", children: L.noScheduleTypes })
|
|
2796
2859
|
] })
|
|
2797
2860
|
] }),
|
|
2798
2861
|
/* @__PURE__ */ e("div", { className: "h-px w-full bg-border/60" }),
|
|
2799
2862
|
/* @__PURE__ */ n("section", { className: "flex flex-col", children: [
|
|
2800
2863
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between px-4 py-3", children: [
|
|
2801
|
-
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children:
|
|
2864
|
+
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-foreground", children: L.participants }),
|
|
2802
2865
|
/* @__PURE__ */ e(
|
|
2803
|
-
|
|
2866
|
+
Me,
|
|
2804
2867
|
{
|
|
2805
|
-
checked:
|
|
2806
|
-
onCheckedChange: () =>
|
|
2807
|
-
className:
|
|
2868
|
+
checked: Y,
|
|
2869
|
+
onCheckedChange: () => K(),
|
|
2870
|
+
className: u(
|
|
2808
2871
|
"flex h-5 w-5 items-center justify-center rounded border border-border bg-white transition-colors hover:border-primary/50",
|
|
2809
|
-
|
|
2872
|
+
Y && "border-primary bg-primary text-primary-foreground"
|
|
2810
2873
|
),
|
|
2811
|
-
children:
|
|
2874
|
+
children: Y && /* @__PURE__ */ e(De, { className: "h-3.5 w-3.5" })
|
|
2812
2875
|
}
|
|
2813
2876
|
)
|
|
2814
2877
|
] }),
|
|
2815
2878
|
/* @__PURE__ */ e("div", { className: "px-4 pb-3", children: /* @__PURE__ */ e(
|
|
2816
|
-
|
|
2879
|
+
_e,
|
|
2817
2880
|
{
|
|
2818
|
-
value:
|
|
2819
|
-
onChange:
|
|
2820
|
-
placeholder:
|
|
2881
|
+
value: j,
|
|
2882
|
+
onChange: I,
|
|
2883
|
+
placeholder: L.searchParticipants
|
|
2821
2884
|
}
|
|
2822
2885
|
) }),
|
|
2823
2886
|
/* @__PURE__ */ n("div", { className: "flex max-h-[400px] flex-col gap-2 overflow-y-auto px-4 pb-4 scrollbar-thin", children: [
|
|
2824
2887
|
x ? (
|
|
2825
2888
|
// Loading skeletons
|
|
2826
|
-
Array.from({ length: 4 }).map((m,
|
|
2889
|
+
Array.from({ length: 4 }).map((m, b) => /* @__PURE__ */ n(
|
|
2827
2890
|
"div",
|
|
2828
2891
|
{
|
|
2829
2892
|
className: "flex animate-pulse items-center gap-3 rounded-md border border-border/60 bg-muted/40 p-3",
|
|
@@ -2836,33 +2899,33 @@ function en({
|
|
|
2836
2899
|
] })
|
|
2837
2900
|
]
|
|
2838
2901
|
},
|
|
2839
|
-
`p-skeleton-${
|
|
2902
|
+
`p-skeleton-${b}`
|
|
2840
2903
|
))
|
|
2841
|
-
) :
|
|
2842
|
-
const
|
|
2904
|
+
) : T.map((m) => {
|
|
2905
|
+
const b = a.includes(m.id);
|
|
2843
2906
|
return /* @__PURE__ */ n(
|
|
2844
|
-
|
|
2907
|
+
Me,
|
|
2845
2908
|
{
|
|
2846
|
-
checked:
|
|
2847
|
-
onCheckedChange: (
|
|
2848
|
-
className:
|
|
2909
|
+
checked: b,
|
|
2910
|
+
onCheckedChange: (E) => P(m.id, E),
|
|
2911
|
+
className: u(
|
|
2849
2912
|
"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",
|
|
2850
|
-
|
|
2913
|
+
b && "border-primary bg-zinc-50"
|
|
2851
2914
|
),
|
|
2852
2915
|
children: [
|
|
2853
2916
|
/* @__PURE__ */ e(
|
|
2854
2917
|
"span",
|
|
2855
2918
|
{
|
|
2856
|
-
className:
|
|
2919
|
+
className: u(
|
|
2857
2920
|
"flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border border-border transition-colors",
|
|
2858
|
-
|
|
2921
|
+
b && "border-primary bg-primary text-primary-foreground"
|
|
2859
2922
|
),
|
|
2860
|
-
children:
|
|
2923
|
+
children: b && /* @__PURE__ */ e(De, { className: "h-2.5 w-2.5" })
|
|
2861
2924
|
}
|
|
2862
2925
|
),
|
|
2863
2926
|
/* @__PURE__ */ n("div", { className: "flex flex-1 items-start gap-2", children: [
|
|
2864
2927
|
/* @__PURE__ */ e(
|
|
2865
|
-
|
|
2928
|
+
wr,
|
|
2866
2929
|
{
|
|
2867
2930
|
src: m.avatar ?? null,
|
|
2868
2931
|
alt: m.name,
|
|
@@ -2887,14 +2950,14 @@ function en({
|
|
|
2887
2950
|
m.id
|
|
2888
2951
|
);
|
|
2889
2952
|
}),
|
|
2890
|
-
!x &&
|
|
2953
|
+
!x && T.length === 0 && /* @__PURE__ */ e("p", { className: "px-4 text-xs text-muted-foreground", children: L.noParticipants })
|
|
2891
2954
|
] })
|
|
2892
2955
|
] })
|
|
2893
2956
|
]
|
|
2894
2957
|
}
|
|
2895
2958
|
);
|
|
2896
2959
|
}
|
|
2897
|
-
function
|
|
2960
|
+
function yr({ className: t }) {
|
|
2898
2961
|
return /* @__PURE__ */ n(
|
|
2899
2962
|
"svg",
|
|
2900
2963
|
{
|
|
@@ -2915,19 +2978,19 @@ function pr({ className: t }) {
|
|
|
2915
2978
|
}
|
|
2916
2979
|
);
|
|
2917
2980
|
}
|
|
2918
|
-
function
|
|
2981
|
+
function sn({
|
|
2919
2982
|
scheduleTypes: t,
|
|
2920
2983
|
value: r,
|
|
2921
2984
|
onChange: o,
|
|
2922
2985
|
allLabel: s = "All types",
|
|
2923
|
-
className:
|
|
2924
|
-
label:
|
|
2986
|
+
className: a,
|
|
2987
|
+
label: i
|
|
2925
2988
|
}) {
|
|
2926
|
-
const g = (
|
|
2927
|
-
o(
|
|
2928
|
-
}, f = t.find((
|
|
2929
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2930
|
-
|
|
2989
|
+
const g = (l) => {
|
|
2990
|
+
o(l.target.value);
|
|
2991
|
+
}, f = t.find((l) => String(l.id) === r);
|
|
2992
|
+
return /* @__PURE__ */ n("div", { className: u("flex flex-col gap-1", a), children: [
|
|
2993
|
+
i && /* @__PURE__ */ e(ne, { className: "text-xs text-muted-foreground", children: i }),
|
|
2931
2994
|
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2932
2995
|
f ? /* @__PURE__ */ e(
|
|
2933
2996
|
"span",
|
|
@@ -2935,23 +2998,23 @@ function tn({
|
|
|
2935
2998
|
className: "pointer-events-none absolute left-2.5 top-1/2 size-3 -translate-y-1/2 rounded-full",
|
|
2936
2999
|
style: { backgroundColor: f.color }
|
|
2937
3000
|
}
|
|
2938
|
-
) : /* @__PURE__ */ e(
|
|
3001
|
+
) : /* @__PURE__ */ e(yr, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
|
|
2939
3002
|
/* @__PURE__ */ n(
|
|
2940
|
-
|
|
3003
|
+
le,
|
|
2941
3004
|
{
|
|
2942
3005
|
value: r,
|
|
2943
3006
|
onChange: g,
|
|
2944
3007
|
className: "h-9 w-full min-w-[140px] pl-8 pr-8 text-sm",
|
|
2945
3008
|
children: [
|
|
2946
3009
|
/* @__PURE__ */ e("option", { value: "all", children: s }),
|
|
2947
|
-
t.map((
|
|
3010
|
+
t.map((l) => /* @__PURE__ */ e("option", { value: String(l.id), children: l.label }, l.id))
|
|
2948
3011
|
]
|
|
2949
3012
|
}
|
|
2950
3013
|
)
|
|
2951
3014
|
] })
|
|
2952
3015
|
] });
|
|
2953
3016
|
}
|
|
2954
|
-
function
|
|
3017
|
+
function kr({ className: t }) {
|
|
2955
3018
|
return /* @__PURE__ */ n(
|
|
2956
3019
|
"svg",
|
|
2957
3020
|
{
|
|
@@ -2974,23 +3037,23 @@ function vr({ className: t }) {
|
|
|
2974
3037
|
}
|
|
2975
3038
|
);
|
|
2976
3039
|
}
|
|
2977
|
-
function
|
|
3040
|
+
function an({
|
|
2978
3041
|
users: t,
|
|
2979
3042
|
value: r,
|
|
2980
3043
|
onChange: o,
|
|
2981
3044
|
allLabel: s = "All users",
|
|
2982
|
-
className:
|
|
2983
|
-
label:
|
|
3045
|
+
className: a,
|
|
3046
|
+
label: i
|
|
2984
3047
|
}) {
|
|
2985
3048
|
const g = (f) => {
|
|
2986
3049
|
o(f.target.value);
|
|
2987
3050
|
};
|
|
2988
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2989
|
-
|
|
3051
|
+
return /* @__PURE__ */ n("div", { className: u("flex flex-col gap-1", a), children: [
|
|
3052
|
+
i && /* @__PURE__ */ e(ne, { className: "text-xs text-muted-foreground", children: i }),
|
|
2990
3053
|
/* @__PURE__ */ n("div", { className: "relative", children: [
|
|
2991
|
-
/* @__PURE__ */ e(
|
|
3054
|
+
/* @__PURE__ */ e(kr, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
|
|
2992
3055
|
/* @__PURE__ */ n(
|
|
2993
|
-
|
|
3056
|
+
le,
|
|
2994
3057
|
{
|
|
2995
3058
|
value: r,
|
|
2996
3059
|
onChange: g,
|
|
@@ -3004,7 +3067,7 @@ function rn({
|
|
|
3004
3067
|
] })
|
|
3005
3068
|
] });
|
|
3006
3069
|
}
|
|
3007
|
-
function
|
|
3070
|
+
function Nr({ className: t }) {
|
|
3008
3071
|
return /* @__PURE__ */ n(
|
|
3009
3072
|
"svg",
|
|
3010
3073
|
{
|
|
@@ -3031,7 +3094,7 @@ function wr({ className: t }) {
|
|
|
3031
3094
|
}
|
|
3032
3095
|
);
|
|
3033
3096
|
}
|
|
3034
|
-
function
|
|
3097
|
+
function Cr({ className: t }) {
|
|
3035
3098
|
return /* @__PURE__ */ n(
|
|
3036
3099
|
"svg",
|
|
3037
3100
|
{
|
|
@@ -3054,7 +3117,7 @@ function br({ className: t }) {
|
|
|
3054
3117
|
}
|
|
3055
3118
|
);
|
|
3056
3119
|
}
|
|
3057
|
-
function
|
|
3120
|
+
function Dr({ className: t }) {
|
|
3058
3121
|
return /* @__PURE__ */ e(
|
|
3059
3122
|
"svg",
|
|
3060
3123
|
{
|
|
@@ -3070,7 +3133,7 @@ function yr({ className: t }) {
|
|
|
3070
3133
|
}
|
|
3071
3134
|
);
|
|
3072
3135
|
}
|
|
3073
|
-
function
|
|
3136
|
+
function Mr({ className: t }) {
|
|
3074
3137
|
return /* @__PURE__ */ n(
|
|
3075
3138
|
"svg",
|
|
3076
3139
|
{
|
|
@@ -3090,25 +3153,25 @@ function kr({ className: t }) {
|
|
|
3090
3153
|
}
|
|
3091
3154
|
);
|
|
3092
3155
|
}
|
|
3093
|
-
function
|
|
3156
|
+
function Sr(t) {
|
|
3094
3157
|
const r = t.getFullYear(), o = String(t.getMonth() + 1).padStart(2, "0"), s = String(t.getDate()).padStart(2, "0");
|
|
3095
3158
|
return `${r}-${o}-${s}`;
|
|
3096
3159
|
}
|
|
3097
|
-
function
|
|
3098
|
-
const r = t.getHours(), o = t.getMinutes(), s = r >= 12 ? "PM" : "AM",
|
|
3099
|
-
return `${
|
|
3160
|
+
function Re(t) {
|
|
3161
|
+
const r = t.getHours(), o = t.getMinutes(), s = r >= 12 ? "PM" : "AM", a = r % 12 || 12, i = String(o).padStart(2, "0");
|
|
3162
|
+
return `${a}:${i} ${s}`;
|
|
3100
3163
|
}
|
|
3101
|
-
function
|
|
3102
|
-
const r =
|
|
3164
|
+
function Er(t) {
|
|
3165
|
+
const r = Re(t.startDate), o = Re(t.endDate);
|
|
3103
3166
|
return `${r} - ${o}`;
|
|
3104
3167
|
}
|
|
3105
|
-
function
|
|
3106
|
-
const r =
|
|
3168
|
+
function zr(t) {
|
|
3169
|
+
const r = Je(/* @__PURE__ */ new Date(), 1);
|
|
3107
3170
|
return t.getFullYear() === r.getFullYear() && t.getMonth() === r.getMonth() && t.getDate() === r.getDate();
|
|
3108
3171
|
}
|
|
3109
|
-
function
|
|
3110
|
-
if (
|
|
3111
|
-
if (
|
|
3172
|
+
function Hr(t) {
|
|
3173
|
+
if (te(t)) return "Today";
|
|
3174
|
+
if (zr(t)) return "Tomorrow";
|
|
3112
3175
|
const r = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], o = [
|
|
3113
3176
|
"Jan",
|
|
3114
3177
|
"Feb",
|
|
@@ -3122,41 +3185,41 @@ function Mr(t) {
|
|
|
3122
3185
|
"Oct",
|
|
3123
3186
|
"Nov",
|
|
3124
3187
|
"Dec"
|
|
3125
|
-
], s = r[t.getDay()],
|
|
3126
|
-
return `${s}, ${
|
|
3188
|
+
], s = r[t.getDay()], a = o[t.getMonth()], i = t.getDate();
|
|
3189
|
+
return `${s}, ${a} ${i}`;
|
|
3127
3190
|
}
|
|
3128
|
-
function
|
|
3191
|
+
function Lr(t, r) {
|
|
3129
3192
|
const o = /* @__PURE__ */ new Map();
|
|
3130
3193
|
for (const s of t) {
|
|
3131
|
-
const
|
|
3132
|
-
|
|
3194
|
+
const a = Sr(s.startDate), i = o.get(a) ?? [];
|
|
3195
|
+
i.push(s), o.set(a, i);
|
|
3133
3196
|
}
|
|
3134
|
-
return Array.from(o.entries()).map(([s,
|
|
3135
|
-
const
|
|
3136
|
-
(f,
|
|
3137
|
-
), g = r > 0 ?
|
|
3197
|
+
return Array.from(o.entries()).map(([s, a]) => {
|
|
3198
|
+
const i = [...a].sort(
|
|
3199
|
+
(f, l) => f.startDate.getTime() - l.startDate.getTime()
|
|
3200
|
+
), g = r > 0 ? i.slice(0, r) : i;
|
|
3138
3201
|
return {
|
|
3139
3202
|
date: new Date(s),
|
|
3140
3203
|
dateKey: s,
|
|
3141
3204
|
events: g,
|
|
3142
|
-
hasMore: r > 0 &&
|
|
3205
|
+
hasMore: r > 0 && i.length > r
|
|
3143
3206
|
};
|
|
3144
|
-
}).sort((s,
|
|
3207
|
+
}).sort((s, a) => s.date.getTime() - a.date.getTime());
|
|
3145
3208
|
}
|
|
3146
|
-
function
|
|
3147
|
-
const r =
|
|
3209
|
+
function Tr(t) {
|
|
3210
|
+
const r = ye(/* @__PURE__ */ new Date()), o = qe(/* @__PURE__ */ new Date());
|
|
3148
3211
|
return t.filter((s) => s.startDate >= r && s.startDate <= o).length;
|
|
3149
3212
|
}
|
|
3150
|
-
function
|
|
3151
|
-
return /* @__PURE__ */ e("div", { className:
|
|
3213
|
+
function Se({ className: t }) {
|
|
3214
|
+
return /* @__PURE__ */ e("div", { className: u("animate-pulse rounded-md bg-muted", t) });
|
|
3152
3215
|
}
|
|
3153
|
-
function
|
|
3216
|
+
function Ir({ event: t, onClick: r }) {
|
|
3154
3217
|
return /* @__PURE__ */ n(
|
|
3155
3218
|
"button",
|
|
3156
3219
|
{
|
|
3157
3220
|
type: "button",
|
|
3158
3221
|
onClick: () => r?.(t),
|
|
3159
|
-
className:
|
|
3222
|
+
className: u(
|
|
3160
3223
|
"w-full text-left rounded-lg transition-colors",
|
|
3161
3224
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3162
3225
|
"flex items-start gap-3 p-2"
|
|
@@ -3171,58 +3234,58 @@ function zr({ event: t, onClick: r }) {
|
|
|
3171
3234
|
),
|
|
3172
3235
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
3173
3236
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium truncate", children: t.title }),
|
|
3174
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground truncate", children:
|
|
3237
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground truncate", children: Er(t) })
|
|
3175
3238
|
] }),
|
|
3176
|
-
r && /* @__PURE__ */ e(
|
|
3239
|
+
r && /* @__PURE__ */ e(Dr, { className: "shrink-0 size-4 text-muted-foreground/50 mt-1" })
|
|
3177
3240
|
]
|
|
3178
3241
|
}
|
|
3179
3242
|
);
|
|
3180
3243
|
}
|
|
3181
|
-
function
|
|
3244
|
+
function jr({ group: t, onEventClick: r }) {
|
|
3182
3245
|
return /* @__PURE__ */ n("div", { className: "space-y-1", children: [
|
|
3183
3246
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between px-2 py-1.5", children: [
|
|
3184
|
-
/* @__PURE__ */ e("h3", { className:
|
|
3247
|
+
/* @__PURE__ */ e("h3", { className: u("text-xs font-semibold", te(t.date) && "text-primary"), children: Hr(t.date) }),
|
|
3185
3248
|
t.hasMore && /* @__PURE__ */ n("span", { className: "text-[10px] text-muted-foreground", children: [
|
|
3186
3249
|
"+",
|
|
3187
3250
|
t.events.length,
|
|
3188
3251
|
" more"
|
|
3189
3252
|
] })
|
|
3190
3253
|
] }),
|
|
3191
|
-
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((o) => /* @__PURE__ */ e(
|
|
3254
|
+
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((o) => /* @__PURE__ */ e(Ir, { event: o, onClick: r }, o.id)) })
|
|
3192
3255
|
] });
|
|
3193
3256
|
}
|
|
3194
|
-
function
|
|
3257
|
+
function ln({
|
|
3195
3258
|
events: t,
|
|
3196
3259
|
isLoading: r = !1,
|
|
3197
3260
|
className: o,
|
|
3198
3261
|
daysAhead: s = 7,
|
|
3199
|
-
maxEventsPerDay:
|
|
3200
|
-
onEventClick:
|
|
3262
|
+
maxEventsPerDay: a = 3,
|
|
3263
|
+
onEventClick: i,
|
|
3201
3264
|
onNavigateToAgenda: g
|
|
3202
3265
|
}) {
|
|
3203
|
-
const [f,
|
|
3204
|
-
const
|
|
3205
|
-
return t.filter((
|
|
3206
|
-
}, [t, s]),
|
|
3207
|
-
() =>
|
|
3208
|
-
[x,
|
|
3209
|
-
), p =
|
|
3210
|
-
|
|
3211
|
-
},
|
|
3212
|
-
|
|
3266
|
+
const [f, l] = de(!1), x = U(() => {
|
|
3267
|
+
const z = ye(/* @__PURE__ */ new Date()), j = Je(z, s);
|
|
3268
|
+
return t.filter((I) => I.endDate >= z && I.startDate < j);
|
|
3269
|
+
}, [t, s]), y = U(
|
|
3270
|
+
() => Lr(x, a),
|
|
3271
|
+
[x, a]
|
|
3272
|
+
), p = U(() => Tr(t), [t]), L = (z) => {
|
|
3273
|
+
l(!1), i?.(z);
|
|
3274
|
+
}, A = () => {
|
|
3275
|
+
l(!1), g?.();
|
|
3213
3276
|
};
|
|
3214
|
-
return /* @__PURE__ */ n(
|
|
3277
|
+
return /* @__PURE__ */ n(Ye, { open: f, onOpenChange: l, children: [
|
|
3215
3278
|
/* @__PURE__ */ n(
|
|
3216
|
-
|
|
3279
|
+
Ge,
|
|
3217
3280
|
{
|
|
3218
|
-
className:
|
|
3281
|
+
className: u(
|
|
3219
3282
|
"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",
|
|
3220
3283
|
o
|
|
3221
3284
|
),
|
|
3222
3285
|
children: [
|
|
3223
|
-
/* @__PURE__ */ e(
|
|
3286
|
+
/* @__PURE__ */ e(Nr, { className: "h-4 w-4" }),
|
|
3224
3287
|
p > 0 && /* @__PURE__ */ e(
|
|
3225
|
-
|
|
3288
|
+
ut,
|
|
3226
3289
|
{
|
|
3227
3290
|
variant: "destructive",
|
|
3228
3291
|
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",
|
|
@@ -3232,7 +3295,7 @@ function nn({
|
|
|
3232
3295
|
]
|
|
3233
3296
|
}
|
|
3234
3297
|
),
|
|
3235
|
-
/* @__PURE__ */ n(
|
|
3298
|
+
/* @__PURE__ */ n(Ke, { className: "w-80 rounded-xl p-0", align: "end", side: "bottom", sideOffset: 8, children: [
|
|
3236
3299
|
/* @__PURE__ */ n("div", { className: "flex items-center justify-between border-b p-4", children: [
|
|
3237
3300
|
/* @__PURE__ */ n("div", { children: [
|
|
3238
3301
|
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: "Upcoming" }),
|
|
@@ -3242,41 +3305,41 @@ function nn({
|
|
|
3242
3305
|
"button",
|
|
3243
3306
|
{
|
|
3244
3307
|
type: "button",
|
|
3245
|
-
onClick:
|
|
3308
|
+
onClick: A,
|
|
3246
3309
|
className: "text-xs text-primary hover:underline flex items-center gap-1",
|
|
3247
3310
|
children: [
|
|
3248
3311
|
"View all",
|
|
3249
|
-
/* @__PURE__ */ e(
|
|
3312
|
+
/* @__PURE__ */ e(Mr, { className: "size-3" })
|
|
3250
3313
|
]
|
|
3251
3314
|
}
|
|
3252
3315
|
)
|
|
3253
3316
|
] }),
|
|
3254
|
-
/* @__PURE__ */ e("div", { className: "max-h-80 overflow-y-auto p-2", children: r ? /* @__PURE__ */ e("div", { className: "space-y-2 p-2", children: Array.from({ length: 3 }).map((
|
|
3255
|
-
/* @__PURE__ */ e(
|
|
3317
|
+
/* @__PURE__ */ e("div", { className: "max-h-80 overflow-y-auto p-2", children: r ? /* @__PURE__ */ e("div", { className: "space-y-2 p-2", children: Array.from({ length: 3 }).map((z, j) => /* @__PURE__ */ n("div", { className: "flex space-x-3", children: [
|
|
3318
|
+
/* @__PURE__ */ e(Se, { className: "h-2 w-2 rounded-full mt-2" }),
|
|
3256
3319
|
/* @__PURE__ */ n("div", { className: "flex-1 space-y-2", children: [
|
|
3257
|
-
/* @__PURE__ */ e(
|
|
3258
|
-
/* @__PURE__ */ e(
|
|
3320
|
+
/* @__PURE__ */ e(Se, { className: "h-4 w-full" }),
|
|
3321
|
+
/* @__PURE__ */ e(Se, { className: "h-3 w-3/4" })
|
|
3259
3322
|
] })
|
|
3260
|
-
] },
|
|
3261
|
-
/* @__PURE__ */ e(
|
|
3323
|
+
] }, j)) }) : y.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-8 text-center", children: [
|
|
3324
|
+
/* @__PURE__ */ e(Cr, { className: "mb-2 h-8 w-8 text-muted-foreground/50" }),
|
|
3262
3325
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "No upcoming events" }),
|
|
3263
3326
|
/* @__PURE__ */ n("p", { className: "text-xs text-muted-foreground/70", children: [
|
|
3264
3327
|
"Your schedule is clear for the next ",
|
|
3265
3328
|
s,
|
|
3266
3329
|
" days"
|
|
3267
3330
|
] })
|
|
3268
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-3 divide-y", children:
|
|
3269
|
-
|
|
3331
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-3 divide-y", children: y.map((z) => /* @__PURE__ */ e(
|
|
3332
|
+
jr,
|
|
3270
3333
|
{
|
|
3271
|
-
group:
|
|
3272
|
-
onEventClick:
|
|
3334
|
+
group: z,
|
|
3335
|
+
onEventClick: L
|
|
3273
3336
|
},
|
|
3274
|
-
|
|
3337
|
+
z.dateKey
|
|
3275
3338
|
)) }) })
|
|
3276
3339
|
] })
|
|
3277
3340
|
] });
|
|
3278
3341
|
}
|
|
3279
|
-
function
|
|
3342
|
+
function Wr({ className: t }) {
|
|
3280
3343
|
return /* @__PURE__ */ n(
|
|
3281
3344
|
"svg",
|
|
3282
3345
|
{
|
|
@@ -3301,7 +3364,7 @@ function Lr({ className: t }) {
|
|
|
3301
3364
|
}
|
|
3302
3365
|
);
|
|
3303
3366
|
}
|
|
3304
|
-
function
|
|
3367
|
+
function Qe({ className: t }) {
|
|
3305
3368
|
return /* @__PURE__ */ e(
|
|
3306
3369
|
"svg",
|
|
3307
3370
|
{
|
|
@@ -3319,53 +3382,53 @@ function Ge({ className: t }) {
|
|
|
3319
3382
|
}
|
|
3320
3383
|
);
|
|
3321
3384
|
}
|
|
3322
|
-
function
|
|
3385
|
+
function Ar(t) {
|
|
3323
3386
|
const r = /* @__PURE__ */ new Date();
|
|
3324
3387
|
return r.setDate(r.getDate() + 1), t.getFullYear() === r.getFullYear() && t.getMonth() === r.getMonth() && t.getDate() === r.getDate();
|
|
3325
3388
|
}
|
|
3326
|
-
function
|
|
3389
|
+
function Ve(t) {
|
|
3327
3390
|
const r = t.getHours(), o = t.getMinutes(), s = r >= 12 ? "PM" : "AM";
|
|
3328
3391
|
return `${r % 12 || 12}:${o.toString().padStart(2, "0")} ${s}`;
|
|
3329
3392
|
}
|
|
3330
|
-
function
|
|
3393
|
+
function Fr(t) {
|
|
3331
3394
|
return new Intl.DateTimeFormat("en-US", {
|
|
3332
3395
|
weekday: "long",
|
|
3333
3396
|
month: "short",
|
|
3334
3397
|
day: "numeric"
|
|
3335
3398
|
}).format(t);
|
|
3336
3399
|
}
|
|
3337
|
-
function
|
|
3338
|
-
const r =
|
|
3400
|
+
function Br(t) {
|
|
3401
|
+
const r = Ve(t.startDate), o = Ve(t.endDate);
|
|
3339
3402
|
return `${r} - ${o}`;
|
|
3340
3403
|
}
|
|
3341
|
-
function
|
|
3342
|
-
return
|
|
3404
|
+
function $r(t) {
|
|
3405
|
+
return te(t) ? "Today" : Ar(t) ? "Tomorrow" : Fr(t);
|
|
3343
3406
|
}
|
|
3344
|
-
function
|
|
3407
|
+
function Or(t, r) {
|
|
3345
3408
|
const o = /* @__PURE__ */ new Map();
|
|
3346
3409
|
for (const s of t) {
|
|
3347
|
-
const
|
|
3348
|
-
|
|
3410
|
+
const a = bt(s.startDate), i = o.get(a) ?? [];
|
|
3411
|
+
i.push(s), o.set(a, i);
|
|
3349
3412
|
}
|
|
3350
|
-
return Array.from(o.entries()).map(([s,
|
|
3351
|
-
const
|
|
3352
|
-
(f,
|
|
3353
|
-
), g = r > 0 ?
|
|
3413
|
+
return Array.from(o.entries()).map(([s, a]) => {
|
|
3414
|
+
const i = [...a].sort(
|
|
3415
|
+
(f, l) => f.startDate.getTime() - l.startDate.getTime()
|
|
3416
|
+
), g = r > 0 ? i.slice(0, r) : i;
|
|
3354
3417
|
return {
|
|
3355
3418
|
date: new Date(s),
|
|
3356
3419
|
dateKey: s,
|
|
3357
3420
|
events: g,
|
|
3358
|
-
hasMore: r > 0 &&
|
|
3421
|
+
hasMore: r > 0 && i.length > r
|
|
3359
3422
|
};
|
|
3360
|
-
}).sort((s,
|
|
3423
|
+
}).sort((s, a) => s.date.getTime() - a.date.getTime());
|
|
3361
3424
|
}
|
|
3362
|
-
function
|
|
3425
|
+
function _r({ event: t, onClick: r, compact: o }) {
|
|
3363
3426
|
return /* @__PURE__ */ n(
|
|
3364
3427
|
"button",
|
|
3365
3428
|
{
|
|
3366
3429
|
type: "button",
|
|
3367
3430
|
onClick: () => r?.(t),
|
|
3368
|
-
className:
|
|
3431
|
+
className: u(
|
|
3369
3432
|
"w-full text-left rounded-lg transition-colors",
|
|
3370
3433
|
"hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3371
3434
|
"flex items-start gap-3",
|
|
@@ -3375,41 +3438,41 @@ function Fr({ event: t, onClick: r, compact: o }) {
|
|
|
3375
3438
|
/* @__PURE__ */ e(
|
|
3376
3439
|
"div",
|
|
3377
3440
|
{
|
|
3378
|
-
className:
|
|
3441
|
+
className: u("shrink-0 rounded-full mt-1", o ? "size-2" : "size-2.5"),
|
|
3379
3442
|
style: { backgroundColor: t.color ?? "#3b82f6" }
|
|
3380
3443
|
}
|
|
3381
3444
|
),
|
|
3382
3445
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
3383
|
-
/* @__PURE__ */ e("p", { className:
|
|
3384
|
-
/* @__PURE__ */ e("p", { className:
|
|
3446
|
+
/* @__PURE__ */ e("p", { className: u("font-medium truncate", o ? "text-xs" : "text-sm"), children: t.title }),
|
|
3447
|
+
/* @__PURE__ */ e("p", { className: u("text-muted-foreground truncate", o ? "text-[10px]" : "text-xs"), children: Br(t) })
|
|
3385
3448
|
] }),
|
|
3386
3449
|
r && /* @__PURE__ */ e(
|
|
3387
|
-
|
|
3450
|
+
Qe,
|
|
3388
3451
|
{
|
|
3389
|
-
className:
|
|
3452
|
+
className: u("shrink-0 text-muted-foreground/50", o ? "size-3" : "size-4")
|
|
3390
3453
|
}
|
|
3391
3454
|
)
|
|
3392
3455
|
]
|
|
3393
3456
|
}
|
|
3394
3457
|
);
|
|
3395
3458
|
}
|
|
3396
|
-
function
|
|
3459
|
+
function Pr({
|
|
3397
3460
|
group: t,
|
|
3398
3461
|
onEventClick: r,
|
|
3399
3462
|
onViewMore: o,
|
|
3400
3463
|
compact: s
|
|
3401
3464
|
}) {
|
|
3402
3465
|
return /* @__PURE__ */ n("div", { className: "space-y-1", children: [
|
|
3403
|
-
/* @__PURE__ */ n("div", { className:
|
|
3466
|
+
/* @__PURE__ */ n("div", { className: u("flex items-center justify-between px-2", s ? "py-1" : "py-1.5"), children: [
|
|
3404
3467
|
/* @__PURE__ */ e(
|
|
3405
3468
|
"h3",
|
|
3406
3469
|
{
|
|
3407
|
-
className:
|
|
3470
|
+
className: u(
|
|
3408
3471
|
"font-semibold",
|
|
3409
3472
|
s ? "text-xs" : "text-sm",
|
|
3410
|
-
|
|
3473
|
+
te(t.date) && "text-primary"
|
|
3411
3474
|
),
|
|
3412
|
-
children:
|
|
3475
|
+
children: $r(t.date)
|
|
3413
3476
|
}
|
|
3414
3477
|
),
|
|
3415
3478
|
t.hasMore && o && /* @__PURE__ */ e(
|
|
@@ -3417,96 +3480,96 @@ function $r({
|
|
|
3417
3480
|
{
|
|
3418
3481
|
type: "button",
|
|
3419
3482
|
onClick: () => o(t.date),
|
|
3420
|
-
className:
|
|
3483
|
+
className: u("text-primary hover:underline", s ? "text-[10px]" : "text-xs"),
|
|
3421
3484
|
children: "+more"
|
|
3422
3485
|
}
|
|
3423
3486
|
)
|
|
3424
3487
|
] }),
|
|
3425
|
-
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((
|
|
3488
|
+
/* @__PURE__ */ e("div", { className: "space-y-0.5", children: t.events.map((a) => /* @__PURE__ */ e(_r, { event: a, onClick: r, compact: s }, a.id)) })
|
|
3426
3489
|
] });
|
|
3427
3490
|
}
|
|
3428
|
-
function
|
|
3491
|
+
function cn({
|
|
3429
3492
|
events: t,
|
|
3430
3493
|
daysAhead: r = 7,
|
|
3431
3494
|
maxEventsPerDay: o = 3,
|
|
3432
3495
|
onEventClick: s,
|
|
3433
|
-
onViewAll:
|
|
3434
|
-
className:
|
|
3496
|
+
onViewAll: a,
|
|
3497
|
+
className: i,
|
|
3435
3498
|
emptyState: g,
|
|
3436
3499
|
title: f = "Upcoming",
|
|
3437
|
-
showHeader:
|
|
3500
|
+
showHeader: l = !0,
|
|
3438
3501
|
compact: x = !1
|
|
3439
3502
|
}) {
|
|
3440
|
-
const
|
|
3441
|
-
const
|
|
3442
|
-
return
|
|
3443
|
-
}, [
|
|
3444
|
-
() =>
|
|
3445
|
-
[
|
|
3446
|
-
),
|
|
3447
|
-
return
|
|
3448
|
-
|
|
3503
|
+
const y = Ue(), p = y?.filteredEvents, L = y?.currentDate ?? /* @__PURE__ */ new Date(), A = t ?? p ?? [], z = U(() => {
|
|
3504
|
+
const C = ye(L), T = new Date(C);
|
|
3505
|
+
return T.setDate(T.getDate() + r), A.filter((_) => _.endDate >= C && _.startDate < T);
|
|
3506
|
+
}, [A, r, L]), j = U(
|
|
3507
|
+
() => Or(z, o),
|
|
3508
|
+
[z, o]
|
|
3509
|
+
), I = z.length;
|
|
3510
|
+
return j.length === 0 ? /* @__PURE__ */ n("div", { className: u("rounded-lg border bg-card", i), children: [
|
|
3511
|
+
l && /* @__PURE__ */ e(
|
|
3449
3512
|
"div",
|
|
3450
3513
|
{
|
|
3451
|
-
className:
|
|
3514
|
+
className: u(
|
|
3452
3515
|
"border-b px-4 flex items-center justify-between",
|
|
3453
3516
|
x ? "py-2" : "py-3"
|
|
3454
3517
|
),
|
|
3455
|
-
children: /* @__PURE__ */ e("h2", { className:
|
|
3518
|
+
children: /* @__PURE__ */ e("h2", { className: u("font-semibold", x ? "text-sm" : "text-base"), children: f })
|
|
3456
3519
|
}
|
|
3457
3520
|
),
|
|
3458
3521
|
/* @__PURE__ */ e(
|
|
3459
3522
|
"div",
|
|
3460
3523
|
{
|
|
3461
|
-
className:
|
|
3524
|
+
className: u(
|
|
3462
3525
|
"flex flex-col items-center justify-center text-center",
|
|
3463
3526
|
x ? "py-6 px-4" : "py-10 px-6"
|
|
3464
3527
|
),
|
|
3465
|
-
children: g ?? /* @__PURE__ */ n(
|
|
3528
|
+
children: g ?? /* @__PURE__ */ n(ce, { children: [
|
|
3466
3529
|
/* @__PURE__ */ e(
|
|
3467
|
-
|
|
3530
|
+
Wr,
|
|
3468
3531
|
{
|
|
3469
|
-
className:
|
|
3532
|
+
className: u("text-muted-foreground/50 mb-2", x ? "size-8" : "size-10")
|
|
3470
3533
|
}
|
|
3471
3534
|
),
|
|
3472
|
-
/* @__PURE__ */ e("p", { className:
|
|
3535
|
+
/* @__PURE__ */ e("p", { className: u("text-muted-foreground", x ? "text-xs" : "text-sm"), children: "No upcoming events" })
|
|
3473
3536
|
] })
|
|
3474
3537
|
}
|
|
3475
3538
|
)
|
|
3476
|
-
] }) : /* @__PURE__ */ n("div", { className:
|
|
3477
|
-
|
|
3539
|
+
] }) : /* @__PURE__ */ n("div", { className: u("rounded-lg border bg-card overflow-hidden", i), children: [
|
|
3540
|
+
l && /* @__PURE__ */ n(
|
|
3478
3541
|
"div",
|
|
3479
3542
|
{
|
|
3480
|
-
className:
|
|
3543
|
+
className: u(
|
|
3481
3544
|
"border-b px-4 flex items-center justify-between",
|
|
3482
3545
|
x ? "py-2" : "py-3"
|
|
3483
3546
|
),
|
|
3484
3547
|
children: [
|
|
3485
3548
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
3486
|
-
/* @__PURE__ */ e("h2", { className:
|
|
3549
|
+
/* @__PURE__ */ e("h2", { className: u("font-semibold", x ? "text-sm" : "text-base"), children: f }),
|
|
3487
3550
|
/* @__PURE__ */ e(
|
|
3488
3551
|
"span",
|
|
3489
3552
|
{
|
|
3490
|
-
className:
|
|
3553
|
+
className: u(
|
|
3491
3554
|
"text-muted-foreground bg-muted rounded-full px-2",
|
|
3492
3555
|
x ? "text-[10px] py-0" : "text-xs py-0.5"
|
|
3493
3556
|
),
|
|
3494
|
-
children:
|
|
3557
|
+
children: I
|
|
3495
3558
|
}
|
|
3496
3559
|
)
|
|
3497
3560
|
] }),
|
|
3498
|
-
|
|
3561
|
+
a && /* @__PURE__ */ n(
|
|
3499
3562
|
"button",
|
|
3500
3563
|
{
|
|
3501
3564
|
type: "button",
|
|
3502
|
-
onClick: () =>
|
|
3503
|
-
className:
|
|
3565
|
+
onClick: () => a(),
|
|
3566
|
+
className: u(
|
|
3504
3567
|
"text-primary hover:underline flex items-center gap-0.5",
|
|
3505
3568
|
x ? "text-xs" : "text-sm"
|
|
3506
3569
|
),
|
|
3507
3570
|
children: [
|
|
3508
3571
|
"View all",
|
|
3509
|
-
/* @__PURE__ */ e(
|
|
3572
|
+
/* @__PURE__ */ e(Qe, { className: "size-3" })
|
|
3510
3573
|
]
|
|
3511
3574
|
}
|
|
3512
3575
|
)
|
|
@@ -3516,39 +3579,39 @@ function on({
|
|
|
3516
3579
|
/* @__PURE__ */ e(
|
|
3517
3580
|
"div",
|
|
3518
3581
|
{
|
|
3519
|
-
className:
|
|
3582
|
+
className: u(
|
|
3520
3583
|
"divide-y overflow-auto",
|
|
3521
3584
|
x ? "p-2 max-h-[280px]" : "p-3 max-h-[400px]"
|
|
3522
3585
|
),
|
|
3523
|
-
children:
|
|
3524
|
-
|
|
3586
|
+
children: j.map((C) => /* @__PURE__ */ e(
|
|
3587
|
+
Pr,
|
|
3525
3588
|
{
|
|
3526
|
-
group:
|
|
3589
|
+
group: C,
|
|
3527
3590
|
onEventClick: s,
|
|
3528
|
-
onViewMore:
|
|
3591
|
+
onViewMore: a ? (T) => a(T) : void 0,
|
|
3529
3592
|
compact: x
|
|
3530
3593
|
},
|
|
3531
|
-
|
|
3594
|
+
C.dateKey
|
|
3532
3595
|
))
|
|
3533
3596
|
}
|
|
3534
3597
|
)
|
|
3535
3598
|
] });
|
|
3536
3599
|
}
|
|
3537
3600
|
export {
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3601
|
+
ln as A,
|
|
3602
|
+
en as B,
|
|
3603
|
+
Jr as C,
|
|
3604
|
+
nn as D,
|
|
3605
|
+
Xr as E,
|
|
3606
|
+
Qr as I,
|
|
3607
|
+
sn as S,
|
|
3608
|
+
fe as T,
|
|
3609
|
+
an as U,
|
|
3610
|
+
tn as V,
|
|
3611
|
+
rn as W,
|
|
3612
|
+
Qt as Y,
|
|
3613
|
+
cn as a,
|
|
3614
|
+
on as b,
|
|
3615
|
+
Zr as c
|
|
3553
3616
|
};
|
|
3554
|
-
//# sourceMappingURL=agenda-widget-
|
|
3617
|
+
//# sourceMappingURL=agenda-widget-ssrwyMvF.js.map
|