@innosolutions/inno-calendar 1.0.64 → 1.0.66
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/dist/{agenda-widget-A-xsyqRf.cjs → agenda-widget-BNnhQds1.cjs} +2 -2
- package/dist/{agenda-widget-A-xsyqRf.cjs.map → agenda-widget-BNnhQds1.cjs.map} +1 -1
- package/dist/{agenda-widget-duVkXi_m.js → agenda-widget-qwbBw3IK.js} +7 -7
- package/dist/agenda-widget-qwbBw3IK.js.map +1 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/core/context/inno-calendar-provider.d.ts.map +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.mjs +168 -155
- package/dist/core/utils/index.d.ts +1 -0
- package/dist/core/utils/index.d.ts.map +1 -1
- package/dist/core/utils/view-storage.d.ts +85 -0
- package/dist/core/utils/view-storage.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +215 -202
- package/dist/{position-utils-DMVQFywD.js → position-utils-BzmOPdvQ.js} +447 -345
- package/dist/position-utils-BzmOPdvQ.js.map +1 -0
- package/dist/position-utils-EQTCC4tZ.cjs +2 -0
- package/dist/position-utils-EQTCC4tZ.cjs.map +1 -0
- package/dist/presets/index.cjs +1 -1
- package/dist/presets/index.mjs +1 -1
- package/dist/{slot-selection-context-CRstOosL.js → slot-selection-context-CjS_VIPj.js} +162 -163
- package/dist/slot-selection-context-CjS_VIPj.js.map +1 -0
- package/dist/slot-selection-context-CmE-aWgt.cjs +2 -0
- package/dist/slot-selection-context-CmE-aWgt.cjs.map +1 -0
- package/dist/{tailwind-calendar-CNhXkxzW.js → tailwind-calendar-B6qsueM3.js} +61 -61
- package/dist/{tailwind-calendar-CNhXkxzW.js.map → tailwind-calendar-B6qsueM3.js.map} +1 -1
- package/dist/{tailwind-calendar-VRvPJQwa.cjs → tailwind-calendar-KJ1XJ4gr.cjs} +2 -2
- package/dist/{tailwind-calendar-VRvPJQwa.cjs.map → tailwind-calendar-KJ1XJ4gr.cjs.map} +1 -1
- package/dist/{use-calendar-D8XaVe44.js → use-calendar--JnbGA3L.js} +57 -57
- package/dist/{use-calendar-D8XaVe44.js.map → use-calendar--JnbGA3L.js.map} +1 -1
- package/dist/{use-calendar-DkT1_V3j.cjs → use-calendar-BwqE_WNA.cjs} +2 -2
- package/dist/{use-calendar-DkT1_V3j.cjs.map → use-calendar-BwqE_WNA.cjs.map} +1 -1
- package/dist/{use-slot-selection-CWRk_17s.js → use-slot-selection-BLCDzQzo.js} +8 -8
- package/dist/{use-slot-selection-CWRk_17s.js.map → use-slot-selection-BLCDzQzo.js.map} +1 -1
- package/dist/{use-slot-selection-Dj_tWg1O.cjs → use-slot-selection-C1tk-o0j.cjs} +2 -2
- package/dist/{use-slot-selection-Dj_tWg1O.cjs.map → use-slot-selection-C1tk-o0j.cjs.map} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.mjs +121 -108
- package/dist/{week-view-DY167Wok.js → week-view-B1KsZsC3.js} +3 -3
- package/dist/{week-view-DY167Wok.js.map → week-view-B1KsZsC3.js.map} +1 -1
- package/dist/{week-view-C1Vu2ErD.cjs → week-view-Dv-Uz0eT.cjs} +2 -2
- package/dist/{week-view-C1Vu2ErD.cjs.map → week-view-Dv-Uz0eT.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/agenda-widget-duVkXi_m.js.map +0 -1
- package/dist/position-utils-BQpbtF6N.cjs +0 -2
- package/dist/position-utils-BQpbtF6N.cjs.map +0 -1
- package/dist/position-utils-DMVQFywD.js.map +0 -1
- package/dist/slot-selection-context-CRstOosL.js.map +0 -1
- package/dist/slot-selection-context-DBCZI2Dn.cjs +0 -2
- package/dist/slot-selection-context-DBCZI2Dn.cjs.map +0 -1
|
@@ -1,16 +1,104 @@
|
|
|
1
|
-
import { isValidElement as
|
|
2
|
-
|
|
1
|
+
import { isValidElement as q } from "react";
|
|
2
|
+
const Q = "inno-calendar-preferences";
|
|
3
|
+
function I(t) {
|
|
3
4
|
if (t == null || typeof t == "boolean") return "";
|
|
4
5
|
if (typeof t == "string") return t;
|
|
5
6
|
if (typeof t == "number") return String(t);
|
|
6
|
-
if (Array.isArray(t)) return t.map(
|
|
7
|
-
if (
|
|
7
|
+
if (Array.isArray(t)) return t.map(I).join("");
|
|
8
|
+
if (q(t)) {
|
|
8
9
|
const e = t.props;
|
|
9
|
-
return
|
|
10
|
+
return I(e.children);
|
|
10
11
|
}
|
|
11
12
|
return "";
|
|
12
13
|
}
|
|
13
|
-
const
|
|
14
|
+
const A = "inno-calendar-view", O = "inno-calendar-resource-view", Z = [
|
|
15
|
+
"day",
|
|
16
|
+
"week",
|
|
17
|
+
"month",
|
|
18
|
+
"year",
|
|
19
|
+
"agenda"
|
|
20
|
+
], tt = [
|
|
21
|
+
"timeline-day",
|
|
22
|
+
"timeline-3day",
|
|
23
|
+
"timeline-week",
|
|
24
|
+
"resource-day",
|
|
25
|
+
"resource-week"
|
|
26
|
+
];
|
|
27
|
+
function F(t) {
|
|
28
|
+
return typeof t == "string" && Z.includes(t);
|
|
29
|
+
}
|
|
30
|
+
function x(t) {
|
|
31
|
+
return typeof t == "string" && tt.includes(t);
|
|
32
|
+
}
|
|
33
|
+
function C() {
|
|
34
|
+
return typeof window < "u" && typeof window.localStorage < "u";
|
|
35
|
+
}
|
|
36
|
+
function N(t) {
|
|
37
|
+
if (!C()) return null;
|
|
38
|
+
try {
|
|
39
|
+
return window.localStorage.getItem(t);
|
|
40
|
+
} catch {
|
|
41
|
+
return console.warn(`[InnoCalendar] Failed to read "${t}" from localStorage`), null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function B(t, e) {
|
|
45
|
+
if (C())
|
|
46
|
+
try {
|
|
47
|
+
window.localStorage.setItem(t, e);
|
|
48
|
+
} catch {
|
|
49
|
+
console.warn(`[InnoCalendar] Failed to write "${t}" to localStorage`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function P(t) {
|
|
53
|
+
if (C())
|
|
54
|
+
try {
|
|
55
|
+
window.localStorage.removeItem(t);
|
|
56
|
+
} catch {
|
|
57
|
+
console.warn(`[InnoCalendar] Failed to remove "${t}" from localStorage`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function et(t, e = A) {
|
|
61
|
+
F(t) && B(e, t);
|
|
62
|
+
}
|
|
63
|
+
function nt(t = A) {
|
|
64
|
+
const e = N(t);
|
|
65
|
+
return F(e) ? e : null;
|
|
66
|
+
}
|
|
67
|
+
function Tt(t = A) {
|
|
68
|
+
P(t);
|
|
69
|
+
}
|
|
70
|
+
function rt(t, e = O) {
|
|
71
|
+
x(t) && B(e, t);
|
|
72
|
+
}
|
|
73
|
+
function at(t = O) {
|
|
74
|
+
const e = N(t);
|
|
75
|
+
return x(e) ? e : null;
|
|
76
|
+
}
|
|
77
|
+
function Et(t = O) {
|
|
78
|
+
P(t);
|
|
79
|
+
}
|
|
80
|
+
function St(t) {
|
|
81
|
+
if (F(t)) {
|
|
82
|
+
et(t);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
x(t) && rt(t);
|
|
86
|
+
}
|
|
87
|
+
function ot() {
|
|
88
|
+
if (!C()) return null;
|
|
89
|
+
try {
|
|
90
|
+
const t = window.localStorage.getItem(Q);
|
|
91
|
+
if (!t) return null;
|
|
92
|
+
const n = JSON.parse(t)?.view;
|
|
93
|
+
return F(n) || x(n) ? n : null;
|
|
94
|
+
} catch {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function Mt() {
|
|
99
|
+
return nt() ?? at() ?? ot();
|
|
100
|
+
}
|
|
101
|
+
const bt = [
|
|
14
102
|
"day",
|
|
15
103
|
"week",
|
|
16
104
|
"month",
|
|
@@ -20,7 +108,7 @@ const at = [
|
|
|
20
108
|
"resource-week",
|
|
21
109
|
"timeline-day",
|
|
22
110
|
"timeline-week"
|
|
23
|
-
],
|
|
111
|
+
], Ht = {
|
|
24
112
|
startHour: 8,
|
|
25
113
|
endHour: 18,
|
|
26
114
|
firstDayOfWeek: 1,
|
|
@@ -30,13 +118,13 @@ const at = [
|
|
|
30
118
|
timeFormat: "24h",
|
|
31
119
|
badgeVariant: "colored",
|
|
32
120
|
showCanceledEvents: !1
|
|
33
|
-
},
|
|
121
|
+
}, It = {
|
|
34
122
|
startHour: 0,
|
|
35
123
|
endHour: 24
|
|
36
|
-
},
|
|
124
|
+
}, kt = {
|
|
37
125
|
startHour: 8,
|
|
38
126
|
endHour: 18
|
|
39
|
-
},
|
|
127
|
+
}, Ft = {
|
|
40
128
|
day: {
|
|
41
129
|
type: "day",
|
|
42
130
|
slotMinTime: "00:00",
|
|
@@ -97,7 +185,7 @@ const at = [
|
|
|
97
185
|
type: "timeline-week",
|
|
98
186
|
slotDuration: "01:00:00"
|
|
99
187
|
}
|
|
100
|
-
},
|
|
188
|
+
}, xt = {
|
|
101
189
|
blue: "#3b82f6",
|
|
102
190
|
green: "#22c55e",
|
|
103
191
|
red: "#ef4444",
|
|
@@ -108,7 +196,7 @@ const at = [
|
|
|
108
196
|
teal: "#14b8a6",
|
|
109
197
|
gray: "#6b7280",
|
|
110
198
|
indigo: "#6366f1"
|
|
111
|
-
},
|
|
199
|
+
}, Ct = {
|
|
112
200
|
blue: { bg: "bg-blue-100", text: "text-blue-800", border: "border-blue-300" },
|
|
113
201
|
green: { bg: "bg-green-100", text: "text-green-800", border: "border-green-300" },
|
|
114
202
|
red: { bg: "bg-red-100", text: "text-red-800", border: "border-red-300" },
|
|
@@ -119,7 +207,7 @@ const at = [
|
|
|
119
207
|
teal: { bg: "bg-teal-100", text: "text-teal-800", border: "border-teal-300" },
|
|
120
208
|
gray: { bg: "bg-gray-100", text: "text-gray-800", border: "border-gray-300" },
|
|
121
209
|
indigo: { bg: "bg-indigo-100", text: "text-indigo-800", border: "border-indigo-300" }
|
|
122
|
-
},
|
|
210
|
+
}, Rt = {
|
|
123
211
|
"#3b82f6": "blue",
|
|
124
212
|
"#22c55e": "green",
|
|
125
213
|
"#ef4444": "red",
|
|
@@ -130,12 +218,12 @@ const at = [
|
|
|
130
218
|
"#14b8a6": "teal",
|
|
131
219
|
"#6b7280": "gray",
|
|
132
220
|
"#6366f1": "indigo"
|
|
133
|
-
},
|
|
134
|
-
function
|
|
221
|
+
}, _t = 24, $t = 60, st = 60 * 1e3, ut = 60 * st, At = 24 * ut, R = 64, Ot = 32, Wt = 56, vt = 200, it = 20;
|
|
222
|
+
function g(t) {
|
|
135
223
|
const e = new Date(t);
|
|
136
224
|
return e.setHours(0, 0, 0, 0), e;
|
|
137
225
|
}
|
|
138
|
-
function
|
|
226
|
+
function w(t) {
|
|
139
227
|
const e = new Date(t);
|
|
140
228
|
return e.setHours(23, 59, 59, 999), e;
|
|
141
229
|
}
|
|
@@ -143,19 +231,19 @@ function l(t, e) {
|
|
|
143
231
|
const n = new Date(t);
|
|
144
232
|
return n.setDate(n.getDate() + e), n;
|
|
145
233
|
}
|
|
146
|
-
function
|
|
234
|
+
function Ut(t, e) {
|
|
147
235
|
return l(t, -e);
|
|
148
236
|
}
|
|
149
237
|
function p(t, e) {
|
|
150
238
|
return t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate();
|
|
151
239
|
}
|
|
152
|
-
function
|
|
240
|
+
function G(t) {
|
|
153
241
|
return p(t, /* @__PURE__ */ new Date());
|
|
154
242
|
}
|
|
155
|
-
function
|
|
243
|
+
function Vt(t) {
|
|
156
244
|
return t.getDay();
|
|
157
245
|
}
|
|
158
|
-
function
|
|
246
|
+
function K(t) {
|
|
159
247
|
const e = t.getDay();
|
|
160
248
|
return e === 0 || e === 6;
|
|
161
249
|
}
|
|
@@ -163,108 +251,108 @@ function m(t, e = 1) {
|
|
|
163
251
|
const n = new Date(t), r = n.getDay(), a = (r < e ? 7 : 0) + r - e;
|
|
164
252
|
return n.setDate(n.getDate() - a), n.setHours(0, 0, 0, 0), n;
|
|
165
253
|
}
|
|
166
|
-
function
|
|
254
|
+
function T(t, e = 1) {
|
|
167
255
|
const n = m(t, e);
|
|
168
256
|
return n.setDate(n.getDate() + 6), n.setHours(23, 59, 59, 999), n;
|
|
169
257
|
}
|
|
170
|
-
function
|
|
258
|
+
function k(t, e) {
|
|
171
259
|
return l(t, e * 7);
|
|
172
260
|
}
|
|
173
|
-
function
|
|
261
|
+
function Yt(t, e) {
|
|
174
262
|
return l(t, -e * 7);
|
|
175
263
|
}
|
|
176
|
-
function
|
|
264
|
+
function Lt(t) {
|
|
177
265
|
const e = new Date(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate())), n = e.getUTCDay() || 7;
|
|
178
266
|
e.setUTCDate(e.getUTCDate() + 4 - n);
|
|
179
267
|
const r = new Date(Date.UTC(e.getUTCFullYear(), 0, 1));
|
|
180
268
|
return Math.ceil(((e.getTime() - r.getTime()) / 864e5 + 1) / 7);
|
|
181
269
|
}
|
|
182
|
-
function
|
|
270
|
+
function Nt(t, e, n = 1) {
|
|
183
271
|
const r = m(t, n), a = m(e, n);
|
|
184
272
|
return p(r, a);
|
|
185
273
|
}
|
|
186
|
-
function
|
|
274
|
+
function S(t) {
|
|
187
275
|
const e = new Date(t);
|
|
188
276
|
return e.setDate(1), e.setHours(0, 0, 0, 0), e;
|
|
189
277
|
}
|
|
190
|
-
function
|
|
278
|
+
function M(t) {
|
|
191
279
|
const e = new Date(t.getFullYear(), t.getMonth() + 1, 0);
|
|
192
280
|
return e.setHours(23, 59, 59, 999), e;
|
|
193
281
|
}
|
|
194
|
-
function
|
|
282
|
+
function _(t, e) {
|
|
195
283
|
const n = new Date(t);
|
|
196
284
|
return n.setMonth(n.getMonth() + e), n;
|
|
197
285
|
}
|
|
198
|
-
function
|
|
199
|
-
return
|
|
286
|
+
function Bt(t, e) {
|
|
287
|
+
return _(t, -e);
|
|
200
288
|
}
|
|
201
|
-
function
|
|
289
|
+
function Pt(t) {
|
|
202
290
|
return new Date(t.getFullYear(), t.getMonth() + 1, 0).getDate();
|
|
203
291
|
}
|
|
204
|
-
function
|
|
292
|
+
function W(t, e) {
|
|
205
293
|
return t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth();
|
|
206
294
|
}
|
|
207
|
-
function
|
|
295
|
+
function z(t) {
|
|
208
296
|
return new Date(t.getFullYear(), 0, 1, 0, 0, 0, 0);
|
|
209
297
|
}
|
|
210
|
-
function
|
|
298
|
+
function ct(t) {
|
|
211
299
|
return new Date(t.getFullYear(), 11, 31, 23, 59, 59, 999);
|
|
212
300
|
}
|
|
213
|
-
function
|
|
301
|
+
function v(t, e) {
|
|
214
302
|
const n = new Date(t);
|
|
215
303
|
return n.setFullYear(n.getFullYear() + e), n;
|
|
216
304
|
}
|
|
217
|
-
function
|
|
218
|
-
return
|
|
305
|
+
function Gt(t, e) {
|
|
306
|
+
return v(t, -e);
|
|
219
307
|
}
|
|
220
|
-
function
|
|
308
|
+
function Kt(t, e) {
|
|
221
309
|
return t.getFullYear() === e.getFullYear();
|
|
222
310
|
}
|
|
223
|
-
function
|
|
311
|
+
function lt(t, e) {
|
|
224
312
|
const n = new Date(t);
|
|
225
313
|
return n.setHours(n.getHours() + e), n;
|
|
226
314
|
}
|
|
227
|
-
function
|
|
315
|
+
function zt(t, e) {
|
|
228
316
|
const n = new Date(t);
|
|
229
317
|
return n.setMinutes(n.getMinutes() + e), n;
|
|
230
318
|
}
|
|
231
|
-
function
|
|
319
|
+
function Jt(t, e, n = 0, r = 0) {
|
|
232
320
|
const a = new Date(t);
|
|
233
321
|
return a.setHours(e, n, r, 0), a;
|
|
234
322
|
}
|
|
235
|
-
function
|
|
323
|
+
function jt(t) {
|
|
236
324
|
return t.getHours() + t.getMinutes() / 60;
|
|
237
325
|
}
|
|
238
|
-
function
|
|
326
|
+
function Xt(t, e) {
|
|
239
327
|
return t.getTime() < e.getTime();
|
|
240
328
|
}
|
|
241
|
-
function
|
|
329
|
+
function qt(t, e) {
|
|
242
330
|
return t.getTime() > e.getTime();
|
|
243
331
|
}
|
|
244
|
-
function
|
|
332
|
+
function Qt(t, e, n) {
|
|
245
333
|
const r = t.getTime();
|
|
246
334
|
return r >= e.getTime() && r <= n.getTime();
|
|
247
335
|
}
|
|
248
|
-
function
|
|
336
|
+
function Zt(t) {
|
|
249
337
|
if (t.length !== 0)
|
|
250
338
|
return t.reduce((e, n) => n < e ? n : e);
|
|
251
339
|
}
|
|
252
|
-
function
|
|
340
|
+
function te(t) {
|
|
253
341
|
if (t.length !== 0)
|
|
254
342
|
return t.reduce((e, n) => n > e ? n : e);
|
|
255
343
|
}
|
|
256
|
-
function
|
|
344
|
+
function U(t, e) {
|
|
257
345
|
return t.getTime() - e.getTime();
|
|
258
346
|
}
|
|
259
|
-
function
|
|
260
|
-
return Math.floor(
|
|
347
|
+
function ee(t, e) {
|
|
348
|
+
return Math.floor(U(t, e) / 6e4);
|
|
261
349
|
}
|
|
262
|
-
function
|
|
263
|
-
return Math.floor(
|
|
350
|
+
function ne(t, e) {
|
|
351
|
+
return Math.floor(U(t, e) / 36e5);
|
|
264
352
|
}
|
|
265
|
-
function
|
|
266
|
-
const n =
|
|
267
|
-
return Math.floor(
|
|
353
|
+
function re(t, e) {
|
|
354
|
+
const n = g(t), r = g(e);
|
|
355
|
+
return Math.floor(U(n, r) / 864e5);
|
|
268
356
|
}
|
|
269
357
|
function H(t, e = "24h") {
|
|
270
358
|
const n = t.getHours(), r = t.getMinutes();
|
|
@@ -274,155 +362,155 @@ function H(t, e = "24h") {
|
|
|
274
362
|
}
|
|
275
363
|
return `${n.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}`;
|
|
276
364
|
}
|
|
277
|
-
function
|
|
365
|
+
function ae(t) {
|
|
278
366
|
const e = t.getFullYear(), n = (t.getMonth() + 1).toString().padStart(2, "0"), r = t.getDate().toString().padStart(2, "0");
|
|
279
367
|
return `${e}-${n}-${r}`;
|
|
280
368
|
}
|
|
281
|
-
function
|
|
369
|
+
function oe(t) {
|
|
282
370
|
return new Date(t);
|
|
283
371
|
}
|
|
284
|
-
function
|
|
372
|
+
function ft(t, e) {
|
|
285
373
|
const n = [];
|
|
286
|
-
let r =
|
|
287
|
-
const a =
|
|
374
|
+
let r = g(t);
|
|
375
|
+
const a = g(e);
|
|
288
376
|
for (; r <= a; )
|
|
289
377
|
n.push(new Date(r)), r = l(r, 1);
|
|
290
378
|
return n;
|
|
291
379
|
}
|
|
292
|
-
function
|
|
380
|
+
function se(t, e) {
|
|
293
381
|
const n = [];
|
|
294
382
|
let r = new Date(t);
|
|
295
383
|
for (; r <= e; )
|
|
296
|
-
n.push(new Date(r)), r =
|
|
384
|
+
n.push(new Date(r)), r = lt(r, 1);
|
|
297
385
|
return n;
|
|
298
386
|
}
|
|
299
|
-
function
|
|
387
|
+
function ue(t = "en-US", e = "short") {
|
|
300
388
|
const n = new Intl.DateTimeFormat(t, { weekday: e }), r = [], a = new Date(2024, 0, 7);
|
|
301
|
-
for (let
|
|
302
|
-
r.push(n.format(l(a,
|
|
389
|
+
for (let o = 0; o < 7; o++)
|
|
390
|
+
r.push(n.format(l(a, o)));
|
|
303
391
|
return r;
|
|
304
392
|
}
|
|
305
|
-
function
|
|
393
|
+
function ie(t = "en-US", e = "long") {
|
|
306
394
|
const n = new Intl.DateTimeFormat(t, { month: e }), r = [];
|
|
307
395
|
for (let a = 0; a < 12; a++)
|
|
308
396
|
r.push(n.format(new Date(2024, a, 1)));
|
|
309
397
|
return r;
|
|
310
398
|
}
|
|
311
|
-
function
|
|
399
|
+
function ce(t) {
|
|
312
400
|
const e = [];
|
|
313
401
|
for (let n = t.startHour; n <= t.endHour; n++)
|
|
314
402
|
e.push(n);
|
|
315
403
|
return e;
|
|
316
404
|
}
|
|
317
|
-
function
|
|
405
|
+
function le(t, e = "24h") {
|
|
318
406
|
if (e === "12h") {
|
|
319
407
|
const n = t >= 12 ? "PM" : "AM";
|
|
320
408
|
return `${t % 12 || 12} ${n}`;
|
|
321
409
|
}
|
|
322
410
|
return `${String(t).padStart(2, "0")}:00`;
|
|
323
411
|
}
|
|
324
|
-
function
|
|
412
|
+
function fe(t, e = 1) {
|
|
325
413
|
const n = m(t, e), r = [];
|
|
326
414
|
for (let a = 0; a < 7; a++)
|
|
327
415
|
r.push(l(n, a));
|
|
328
416
|
return r;
|
|
329
417
|
}
|
|
330
|
-
function
|
|
331
|
-
const n =
|
|
332
|
-
return
|
|
418
|
+
function de(t, e = 1) {
|
|
419
|
+
const n = S(t), r = M(t), a = m(n, e), o = T(r, e), s = t.getMonth();
|
|
420
|
+
return ft(a, o).map((c) => ({
|
|
333
421
|
date: c,
|
|
334
|
-
isCurrentMonth: c.getMonth() ===
|
|
422
|
+
isCurrentMonth: c.getMonth() === s,
|
|
335
423
|
isWeekend: c.getDay() === 0 || c.getDay() === 6
|
|
336
424
|
}));
|
|
337
425
|
}
|
|
338
|
-
function
|
|
426
|
+
function V(t) {
|
|
339
427
|
if (t.isAllDay === !0) return !0;
|
|
340
428
|
if (t.isAllDay === !1) return !1;
|
|
341
|
-
const e = t.startDate.getHours(), n = t.startDate.getMinutes(), r = t.endDate.getHours(), a = t.endDate.getMinutes(),
|
|
429
|
+
const e = t.startDate.getHours(), n = t.startDate.getMinutes(), r = t.endDate.getHours(), a = t.endDate.getMinutes(), o = e === 0 && n === 0, s = r === 0 && a === 0 || // midnight next day
|
|
342
430
|
r === 23 && a >= 59;
|
|
343
|
-
return !!(
|
|
431
|
+
return !!(o && s);
|
|
344
432
|
}
|
|
345
|
-
function
|
|
433
|
+
function ge(t) {
|
|
346
434
|
const e = [], n = [];
|
|
347
435
|
for (const r of t)
|
|
348
|
-
|
|
436
|
+
V(r) ? n.push(r) : p(r.startDate, r.endDate) ? e.push(r) : n.push(r);
|
|
349
437
|
return { singleDay: e, multiDay: n };
|
|
350
438
|
}
|
|
351
|
-
function
|
|
439
|
+
function me(t, e, n) {
|
|
352
440
|
return t.filter((r) => r.startDate <= n && r.endDate >= e);
|
|
353
441
|
}
|
|
354
|
-
function
|
|
442
|
+
function De(t, e, n) {
|
|
355
443
|
if (!n) return !0;
|
|
356
444
|
const r = t.getDay(), a = n[r];
|
|
357
445
|
return !a || !(a.enabled !== !1) || a.from === a.to ? !1 : e >= a.from && e < a.to;
|
|
358
446
|
}
|
|
359
|
-
function
|
|
447
|
+
function he(t, e) {
|
|
360
448
|
const n = t.getDay(), r = e[n];
|
|
361
449
|
return !r || !(r.enabled !== !1) || r.from === r.to ? null : { from: r.from, to: r.to };
|
|
362
450
|
}
|
|
363
|
-
function
|
|
451
|
+
function ye(t) {
|
|
364
452
|
const e = [];
|
|
365
453
|
for (let n = 0; n < 12; n++)
|
|
366
454
|
e.push(new Date(t, n, 1));
|
|
367
455
|
return e;
|
|
368
456
|
}
|
|
369
|
-
function
|
|
370
|
-
const r =
|
|
371
|
-
return t.filter((
|
|
372
|
-
const
|
|
373
|
-
return
|
|
457
|
+
function dt(t, e, n) {
|
|
458
|
+
const r = g(e), a = w(n);
|
|
459
|
+
return t.filter((o) => {
|
|
460
|
+
const s = o.startDate, u = o.endDate;
|
|
461
|
+
return s <= a && u >= r;
|
|
374
462
|
});
|
|
375
463
|
}
|
|
376
|
-
function
|
|
464
|
+
function gt(t, e) {
|
|
377
465
|
return e.length === 0 ? t : t.filter(
|
|
378
466
|
(n) => n.scheduleTypeId !== void 0 && e.includes(n.scheduleTypeId)
|
|
379
467
|
);
|
|
380
468
|
}
|
|
381
|
-
function
|
|
469
|
+
function mt(t, e) {
|
|
382
470
|
return e.length === 0 ? t : t.filter(
|
|
383
471
|
(n) => n.resourceId !== void 0 && e.includes(n.resourceId)
|
|
384
472
|
);
|
|
385
473
|
}
|
|
386
|
-
function
|
|
474
|
+
function Dt(t, e) {
|
|
387
475
|
if (!e.trim()) return t;
|
|
388
476
|
const n = e.toLowerCase();
|
|
389
477
|
return t.filter((r) => {
|
|
390
|
-
const a =
|
|
391
|
-
return a ||
|
|
478
|
+
const a = I(r.title).toLowerCase().includes(n), o = I(r.description).toLowerCase().includes(n);
|
|
479
|
+
return a || o;
|
|
392
480
|
});
|
|
393
481
|
}
|
|
394
|
-
function
|
|
482
|
+
function ht(t) {
|
|
395
483
|
return t.filter((e) => !e.isCanceled);
|
|
396
484
|
}
|
|
397
|
-
function
|
|
485
|
+
function pe(t, e) {
|
|
398
486
|
let n = [...t];
|
|
399
|
-
return e.dateRange && (n =
|
|
487
|
+
return e.dateRange && (n = dt(
|
|
400
488
|
n,
|
|
401
489
|
e.dateRange.startDate,
|
|
402
490
|
e.dateRange.endDate
|
|
403
|
-
)), e.scheduleTypeIds && e.scheduleTypeIds.length > 0 && (n =
|
|
491
|
+
)), e.scheduleTypeIds && e.scheduleTypeIds.length > 0 && (n = gt(n, e.scheduleTypeIds)), e.resourceIds && e.resourceIds.length > 0 && (n = mt(n, e.resourceIds)), e.search && (n = Dt(n, e.search)), e.showCanceled || (n = ht(n)), n;
|
|
404
492
|
}
|
|
405
|
-
function
|
|
493
|
+
function we(t) {
|
|
406
494
|
return [...t].sort((e, n) => e.startDate.getTime() - n.startDate.getTime());
|
|
407
495
|
}
|
|
408
|
-
function
|
|
496
|
+
function Te(t) {
|
|
409
497
|
return [...t].sort((e, n) => e.endDate.getTime() - n.endDate.getTime());
|
|
410
498
|
}
|
|
411
|
-
function
|
|
499
|
+
function Ee(t) {
|
|
412
500
|
return [...t].sort((e, n) => {
|
|
413
501
|
const r = e.endDate.getTime() - e.startDate.getTime();
|
|
414
502
|
return n.endDate.getTime() - n.startDate.getTime() - r;
|
|
415
503
|
});
|
|
416
504
|
}
|
|
417
|
-
function
|
|
505
|
+
function Se(t) {
|
|
418
506
|
const e = /* @__PURE__ */ new Map();
|
|
419
507
|
for (const n of t) {
|
|
420
|
-
const r =
|
|
508
|
+
const r = g(n.startDate).toISOString(), a = e.get(r) ?? [];
|
|
421
509
|
a.push(n), e.set(r, a);
|
|
422
510
|
}
|
|
423
511
|
return e;
|
|
424
512
|
}
|
|
425
|
-
function
|
|
513
|
+
function Me(t) {
|
|
426
514
|
const e = /* @__PURE__ */ new Map();
|
|
427
515
|
for (const n of t) {
|
|
428
516
|
const r = e.get(n.scheduleTypeId) ?? [];
|
|
@@ -430,7 +518,7 @@ function re(t) {
|
|
|
430
518
|
}
|
|
431
519
|
return e;
|
|
432
520
|
}
|
|
433
|
-
function
|
|
521
|
+
function be(t) {
|
|
434
522
|
const e = /* @__PURE__ */ new Map();
|
|
435
523
|
for (const n of t) {
|
|
436
524
|
const r = e.get(n.resourceId) ?? [];
|
|
@@ -438,31 +526,31 @@ function ae(t) {
|
|
|
438
526
|
}
|
|
439
527
|
return e;
|
|
440
528
|
}
|
|
441
|
-
function
|
|
529
|
+
function He(t, e) {
|
|
442
530
|
return t.filter((n) => {
|
|
443
|
-
const r =
|
|
531
|
+
const r = g(e), a = w(e);
|
|
444
532
|
return n.startDate <= a && n.endDate >= r;
|
|
445
533
|
});
|
|
446
534
|
}
|
|
447
|
-
function
|
|
535
|
+
function Ie(t) {
|
|
448
536
|
return t.filter((e) => e.isAllDay);
|
|
449
537
|
}
|
|
450
|
-
function
|
|
538
|
+
function ke(t) {
|
|
451
539
|
return t.filter((e) => !e.isAllDay);
|
|
452
540
|
}
|
|
453
|
-
function
|
|
541
|
+
function Fe(t) {
|
|
454
542
|
return t.filter((e) => e.isMultiDay ? !0 : !p(e.startDate, e.endDate));
|
|
455
543
|
}
|
|
456
|
-
function
|
|
544
|
+
function xe(t) {
|
|
457
545
|
return t.isMultiDay ? !0 : !p(t.startDate, t.endDate);
|
|
458
546
|
}
|
|
459
|
-
function
|
|
547
|
+
function Ce(t) {
|
|
460
548
|
return Math.floor((t.endDate.getTime() - t.startDate.getTime()) / 6e4);
|
|
461
549
|
}
|
|
462
|
-
function
|
|
550
|
+
function Re(t, e = "blue") {
|
|
463
551
|
return t.color ?? e;
|
|
464
552
|
}
|
|
465
|
-
function
|
|
553
|
+
function _e(t, e, n = "blue") {
|
|
466
554
|
if (t.color) return t.color;
|
|
467
555
|
if (t.scheduleTypeId !== void 0 && e) {
|
|
468
556
|
const r = e.get(t.scheduleTypeId);
|
|
@@ -470,8 +558,8 @@ function ge(t, e, n = "blue") {
|
|
|
470
558
|
}
|
|
471
559
|
return n;
|
|
472
560
|
}
|
|
473
|
-
function
|
|
474
|
-
if (
|
|
561
|
+
function $e(t) {
|
|
562
|
+
if (V(t)) {
|
|
475
563
|
if (p(t.startDate, t.endDate))
|
|
476
564
|
return "All day";
|
|
477
565
|
const n = t.startDate.toLocaleDateString(void 0, {
|
|
@@ -495,55 +583,55 @@ function de(t) {
|
|
|
495
583
|
}
|
|
496
584
|
return `${H(t.startDate)} - ${H(t.endDate)}`;
|
|
497
585
|
}
|
|
498
|
-
function
|
|
499
|
-
return !
|
|
586
|
+
function Ae(t) {
|
|
587
|
+
return !V(t);
|
|
500
588
|
}
|
|
501
|
-
function
|
|
589
|
+
function yt(t, e, n = 1) {
|
|
502
590
|
switch (e) {
|
|
503
591
|
case "day":
|
|
504
592
|
case "resource-day":
|
|
505
593
|
case "timeline-day":
|
|
506
594
|
return {
|
|
507
|
-
startDate:
|
|
508
|
-
endDate:
|
|
595
|
+
startDate: g(t),
|
|
596
|
+
endDate: w(t)
|
|
509
597
|
};
|
|
510
598
|
case "week":
|
|
511
599
|
case "resource-week":
|
|
512
600
|
case "timeline-week":
|
|
513
601
|
return {
|
|
514
602
|
startDate: m(t, n),
|
|
515
|
-
endDate:
|
|
603
|
+
endDate: T(t, n)
|
|
516
604
|
};
|
|
517
605
|
case "month": {
|
|
518
|
-
const r =
|
|
606
|
+
const r = S(t), a = M(t);
|
|
519
607
|
return {
|
|
520
608
|
startDate: m(r, n),
|
|
521
|
-
endDate:
|
|
609
|
+
endDate: T(a, n)
|
|
522
610
|
};
|
|
523
611
|
}
|
|
524
612
|
case "timeline-3day":
|
|
525
613
|
return {
|
|
526
|
-
startDate:
|
|
527
|
-
endDate:
|
|
614
|
+
startDate: g(t),
|
|
615
|
+
endDate: w(l(t, 2))
|
|
528
616
|
};
|
|
529
617
|
case "year":
|
|
530
618
|
return {
|
|
531
|
-
startDate:
|
|
532
|
-
endDate:
|
|
619
|
+
startDate: z(t),
|
|
620
|
+
endDate: ct(t)
|
|
533
621
|
};
|
|
534
622
|
case "agenda":
|
|
535
623
|
return {
|
|
536
|
-
startDate:
|
|
537
|
-
endDate:
|
|
624
|
+
startDate: g(t),
|
|
625
|
+
endDate: w(l(t, 29))
|
|
538
626
|
};
|
|
539
627
|
default:
|
|
540
628
|
return {
|
|
541
|
-
startDate:
|
|
542
|
-
endDate:
|
|
629
|
+
startDate: g(t),
|
|
630
|
+
endDate: w(t)
|
|
543
631
|
};
|
|
544
632
|
}
|
|
545
633
|
}
|
|
546
|
-
function
|
|
634
|
+
function Oe(t, e) {
|
|
547
635
|
switch (e) {
|
|
548
636
|
case "day":
|
|
549
637
|
case "resource-day":
|
|
@@ -554,18 +642,18 @@ function De(t, e) {
|
|
|
554
642
|
case "week":
|
|
555
643
|
case "resource-week":
|
|
556
644
|
case "timeline-week":
|
|
557
|
-
return
|
|
645
|
+
return k(t, 1);
|
|
558
646
|
case "month":
|
|
559
|
-
return
|
|
647
|
+
return _(t, 1);
|
|
560
648
|
case "year":
|
|
561
|
-
return
|
|
649
|
+
return v(t, 1);
|
|
562
650
|
case "agenda":
|
|
563
|
-
return
|
|
651
|
+
return k(t, 1);
|
|
564
652
|
default:
|
|
565
653
|
return l(t, 1);
|
|
566
654
|
}
|
|
567
655
|
}
|
|
568
|
-
function
|
|
656
|
+
function We(t, e) {
|
|
569
657
|
switch (e) {
|
|
570
658
|
case "day":
|
|
571
659
|
case "resource-day":
|
|
@@ -576,54 +664,54 @@ function he(t, e) {
|
|
|
576
664
|
case "week":
|
|
577
665
|
case "resource-week":
|
|
578
666
|
case "timeline-week":
|
|
579
|
-
return
|
|
667
|
+
return k(t, -1);
|
|
580
668
|
case "month":
|
|
581
|
-
return
|
|
669
|
+
return _(t, -1);
|
|
582
670
|
case "year":
|
|
583
|
-
return
|
|
671
|
+
return v(t, -1);
|
|
584
672
|
case "agenda":
|
|
585
|
-
return
|
|
673
|
+
return k(t, -1);
|
|
586
674
|
default:
|
|
587
675
|
return l(t, -1);
|
|
588
676
|
}
|
|
589
677
|
}
|
|
590
|
-
function
|
|
591
|
-
return
|
|
678
|
+
function ve() {
|
|
679
|
+
return g(/* @__PURE__ */ new Date());
|
|
592
680
|
}
|
|
593
|
-
function
|
|
594
|
-
const n =
|
|
681
|
+
function Ue(t, e = 1) {
|
|
682
|
+
const n = S(t), r = M(t), a = m(n, e), o = T(r, e), s = [];
|
|
595
683
|
let u = a;
|
|
596
|
-
for (; u <=
|
|
597
|
-
|
|
684
|
+
for (; u <= o; )
|
|
685
|
+
s.push({
|
|
598
686
|
date: new Date(u),
|
|
599
|
-
isToday:
|
|
600
|
-
isCurrentMonth:
|
|
601
|
-
isWeekend:
|
|
687
|
+
isToday: G(u),
|
|
688
|
+
isCurrentMonth: W(u, t),
|
|
689
|
+
isWeekend: K(u),
|
|
602
690
|
dayOfWeek: u.getDay()
|
|
603
691
|
}), u = l(u, 1);
|
|
604
|
-
return
|
|
692
|
+
return s;
|
|
605
693
|
}
|
|
606
|
-
function
|
|
694
|
+
function Ve(t, e = 1) {
|
|
607
695
|
const n = m(t, e), r = [];
|
|
608
696
|
for (let a = 0; a < 7; a++) {
|
|
609
|
-
const
|
|
697
|
+
const o = l(n, a);
|
|
610
698
|
r.push({
|
|
611
|
-
date:
|
|
612
|
-
isToday:
|
|
613
|
-
isCurrentMonth:
|
|
614
|
-
isWeekend:
|
|
615
|
-
dayOfWeek:
|
|
699
|
+
date: o,
|
|
700
|
+
isToday: G(o),
|
|
701
|
+
isCurrentMonth: W(o, t),
|
|
702
|
+
isWeekend: K(o),
|
|
703
|
+
dayOfWeek: o.getDay()
|
|
616
704
|
});
|
|
617
705
|
}
|
|
618
706
|
return r;
|
|
619
707
|
}
|
|
620
|
-
function
|
|
621
|
-
const e =
|
|
708
|
+
function Ye(t) {
|
|
709
|
+
const e = z(t), n = [];
|
|
622
710
|
for (let r = 0; r < 12; r++) {
|
|
623
|
-
const a =
|
|
711
|
+
const a = _(e, r);
|
|
624
712
|
n.push({
|
|
625
713
|
date: a,
|
|
626
|
-
isToday:
|
|
714
|
+
isToday: W(a, /* @__PURE__ */ new Date()),
|
|
627
715
|
isCurrentMonth: !0,
|
|
628
716
|
isWeekend: !1,
|
|
629
717
|
dayOfWeek: a.getDay()
|
|
@@ -631,33 +719,33 @@ function we(t) {
|
|
|
631
719
|
}
|
|
632
720
|
return n;
|
|
633
721
|
}
|
|
634
|
-
function
|
|
722
|
+
function Le(t, e, n = 30) {
|
|
635
723
|
const r = [], a = 60 / n;
|
|
636
|
-
for (let
|
|
637
|
-
for (let
|
|
638
|
-
const u =
|
|
724
|
+
for (let o = t; o < e; o++)
|
|
725
|
+
for (let s = 0; s < a; s++) {
|
|
726
|
+
const u = s * n;
|
|
639
727
|
r.push({
|
|
640
|
-
hour:
|
|
728
|
+
hour: o,
|
|
641
729
|
minute: u,
|
|
642
|
-
label: `${
|
|
730
|
+
label: `${o.toString().padStart(2, "0")}:${u.toString().padStart(2, "0")}`
|
|
643
731
|
});
|
|
644
732
|
}
|
|
645
733
|
return r;
|
|
646
734
|
}
|
|
647
|
-
function
|
|
735
|
+
function Ne(t, e, n = "24h") {
|
|
648
736
|
const r = [];
|
|
649
737
|
for (let a = t; a <= e; a++) {
|
|
650
|
-
let
|
|
738
|
+
let o;
|
|
651
739
|
if (n === "12h") {
|
|
652
|
-
const
|
|
653
|
-
|
|
740
|
+
const s = a >= 12 ? "PM" : "AM";
|
|
741
|
+
o = `${a % 12 || 12} ${s}`;
|
|
654
742
|
} else
|
|
655
|
-
|
|
656
|
-
r.push({ hour: a, label:
|
|
743
|
+
o = `${a.toString().padStart(2, "0")}:00`;
|
|
744
|
+
r.push({ hour: a, label: o });
|
|
657
745
|
}
|
|
658
746
|
return r;
|
|
659
747
|
}
|
|
660
|
-
function
|
|
748
|
+
function Be(t, e, n = "en-US") {
|
|
661
749
|
const r = new Intl.DateTimeFormat(n, {
|
|
662
750
|
weekday: "short",
|
|
663
751
|
month: "short",
|
|
@@ -669,34 +757,34 @@ function Se(t, e, n = "en-US") {
|
|
|
669
757
|
case "timeline-day":
|
|
670
758
|
return r.format(t);
|
|
671
759
|
case "timeline-3day": {
|
|
672
|
-
const
|
|
673
|
-
return `${a.format(
|
|
760
|
+
const o = g(t), s = l(t, 2);
|
|
761
|
+
return `${a.format(o)} - ${a.format(s)}`;
|
|
674
762
|
}
|
|
675
763
|
case "week":
|
|
676
764
|
case "resource-week":
|
|
677
765
|
case "timeline-week": {
|
|
678
|
-
const
|
|
679
|
-
return `${a.format(
|
|
766
|
+
const o = m(t, 1), s = T(t, 1);
|
|
767
|
+
return `${a.format(o)} - ${a.format(s)}`;
|
|
680
768
|
}
|
|
681
769
|
case "month": {
|
|
682
|
-
const
|
|
683
|
-
return `${a.format(
|
|
770
|
+
const o = S(t), s = M(t);
|
|
771
|
+
return `${a.format(o)} - ${a.format(s)}`;
|
|
684
772
|
}
|
|
685
773
|
case "year":
|
|
686
774
|
return `Jan 1 - Dec 31, ${t.getFullYear()}`;
|
|
687
775
|
case "agenda": {
|
|
688
|
-
const
|
|
689
|
-
return `${a.format(
|
|
776
|
+
const o = S(t), s = M(t);
|
|
777
|
+
return `${a.format(o)} - ${a.format(s)}`;
|
|
690
778
|
}
|
|
691
779
|
default:
|
|
692
780
|
return "";
|
|
693
781
|
}
|
|
694
782
|
}
|
|
695
|
-
function
|
|
696
|
-
const a =
|
|
697
|
-
return t.filter((
|
|
783
|
+
function Pe(t, e, n, r = 1) {
|
|
784
|
+
const a = yt(e, n, r);
|
|
785
|
+
return t.filter((o) => o.startDate <= a.endDate && o.endDate >= a.startDate).length;
|
|
698
786
|
}
|
|
699
|
-
function
|
|
787
|
+
function Ge(t, e, n = "en-US") {
|
|
700
788
|
const r = new Intl.DateTimeFormat(n, { month: "long", year: "numeric" }), a = new Intl.DateTimeFormat(n, {
|
|
701
789
|
weekday: "long",
|
|
702
790
|
month: "long",
|
|
@@ -711,8 +799,8 @@ function He(t, e, n = "en-US") {
|
|
|
711
799
|
case "week":
|
|
712
800
|
case "resource-week":
|
|
713
801
|
case "timeline-week": {
|
|
714
|
-
const
|
|
715
|
-
return u === c ? `${u} ${
|
|
802
|
+
const o = m(t, 1), s = T(t, 1), u = new Intl.DateTimeFormat(n, { month: "short" }).format(o), c = new Intl.DateTimeFormat(n, { month: "short" }).format(s), i = o.getFullYear();
|
|
803
|
+
return u === c ? `${u} ${o.getDate()} - ${s.getDate()}, ${i}` : `${u} ${o.getDate()} - ${c} ${s.getDate()}, ${i}`;
|
|
716
804
|
}
|
|
717
805
|
case "month":
|
|
718
806
|
return r.format(t);
|
|
@@ -724,10 +812,10 @@ function He(t, e, n = "en-US") {
|
|
|
724
812
|
return r.format(t);
|
|
725
813
|
}
|
|
726
814
|
}
|
|
727
|
-
function
|
|
728
|
-
const r = new Intl.DateTimeFormat(n, { weekday: e }), a = [],
|
|
729
|
-
for (let
|
|
730
|
-
const u = (t +
|
|
815
|
+
function Ke(t = 1, e = "short", n = "en-US") {
|
|
816
|
+
const r = new Intl.DateTimeFormat(n, { weekday: e }), a = [], o = new Date(2024, 0, 7);
|
|
817
|
+
for (let s = 0; s < 7; s++) {
|
|
818
|
+
const u = (t + s) % 7, c = l(o, u);
|
|
731
819
|
a.push({
|
|
732
820
|
dayOfWeek: u,
|
|
733
821
|
label: r.format(c)
|
|
@@ -735,8 +823,8 @@ function ke(t = 1, e = "short", n = "en-US") {
|
|
|
735
823
|
}
|
|
736
824
|
return a;
|
|
737
825
|
}
|
|
738
|
-
function
|
|
739
|
-
const { startHour: a, endHour:
|
|
826
|
+
function pt(t, e, n, r = R) {
|
|
827
|
+
const { startHour: a, endHour: o } = n, s = o - a, u = s * r, c = t.startDate.getHours() + t.startDate.getMinutes() / 60, i = t.endDate.getHours() + t.endDate.getMinutes() / 60, d = Math.max(c, a), y = Math.min(i, o), D = (d - a) / s * u, h = (y - a) / s * u, f = Math.max(h - D, it);
|
|
740
828
|
return {
|
|
741
829
|
top: D,
|
|
742
830
|
height: f,
|
|
@@ -745,70 +833,70 @@ function nt(t, e, n, r = x) {
|
|
|
745
833
|
zIndex: 1
|
|
746
834
|
};
|
|
747
835
|
}
|
|
748
|
-
function
|
|
836
|
+
function ze(t, e, n, r = R) {
|
|
749
837
|
if (t.length === 0) return [];
|
|
750
|
-
const a = [...t].sort((i,
|
|
751
|
-
const y = i.startDate.getTime() -
|
|
838
|
+
const a = [...t].sort((i, d) => {
|
|
839
|
+
const y = i.startDate.getTime() - d.startDate.getTime();
|
|
752
840
|
if (y !== 0) return y;
|
|
753
841
|
const D = i.endDate.getTime() - i.startDate.getTime();
|
|
754
|
-
return
|
|
755
|
-
}),
|
|
756
|
-
let
|
|
842
|
+
return d.endDate.getTime() - d.startDate.getTime() - D;
|
|
843
|
+
}), o = [];
|
|
844
|
+
let s = [], u = 0;
|
|
757
845
|
for (const i of a)
|
|
758
|
-
|
|
759
|
-
|
|
846
|
+
s.length === 0 || i.startDate.getTime() < u ? (s.push(i), u = Math.max(u, i.endDate.getTime())) : (o.push(s), s = [i], u = i.endDate.getTime());
|
|
847
|
+
s.length > 0 && o.push(s);
|
|
760
848
|
const c = [];
|
|
761
|
-
for (const i of
|
|
762
|
-
const
|
|
849
|
+
for (const i of o) {
|
|
850
|
+
const d = [];
|
|
763
851
|
for (const f of i) {
|
|
764
|
-
const
|
|
765
|
-
let
|
|
766
|
-
for (let b = 0; b <
|
|
767
|
-
const $ =
|
|
852
|
+
const J = f.startDate.getTime(), j = f.endDate.getTime();
|
|
853
|
+
let E = -1;
|
|
854
|
+
for (let b = 0; b < d.length; b++) {
|
|
855
|
+
const $ = d[b];
|
|
768
856
|
if (!$) continue;
|
|
769
|
-
const
|
|
770
|
-
if (
|
|
771
|
-
|
|
857
|
+
const L = $[$.length - 1];
|
|
858
|
+
if (L && L.endTime <= J) {
|
|
859
|
+
E = b;
|
|
772
860
|
break;
|
|
773
861
|
}
|
|
774
862
|
}
|
|
775
|
-
|
|
776
|
-
const
|
|
777
|
-
|
|
778
|
-
const
|
|
863
|
+
E === -1 && (E = d.length, d.push([]));
|
|
864
|
+
const Y = d[E];
|
|
865
|
+
Y && Y.push({ event: f, endTime: j });
|
|
866
|
+
const X = pt(f, e, n, r);
|
|
779
867
|
c.push({
|
|
780
868
|
event: f,
|
|
781
|
-
position:
|
|
782
|
-
column:
|
|
869
|
+
position: X,
|
|
870
|
+
column: E,
|
|
783
871
|
columnSpan: 1
|
|
784
872
|
});
|
|
785
873
|
}
|
|
786
|
-
const D = 100 /
|
|
874
|
+
const D = 100 / d.length, h = new Set(i.map((f) => f.id));
|
|
787
875
|
for (const f of c)
|
|
788
876
|
h.has(f.event.id) && (f.position.left = f.column * D, f.position.width = D * f.columnSpan, f.position.zIndex = f.column + 1);
|
|
789
877
|
}
|
|
790
878
|
return c;
|
|
791
879
|
}
|
|
792
|
-
function
|
|
793
|
-
const { startHour:
|
|
880
|
+
function Je(t, e, n, r = R, a = 30) {
|
|
881
|
+
const { startHour: o, endHour: s } = n, u = s - o, c = u * r, i = t / c * u, y = (o + i) * 60, D = Math.round(y / a) * a, h = new Date(e);
|
|
794
882
|
return h.setHours(0, 0, 0, 0), h.setMinutes(D), h;
|
|
795
883
|
}
|
|
796
|
-
function
|
|
797
|
-
const { startHour: r, endHour: a } = e,
|
|
798
|
-
return (Math.max(r, Math.min(u, a)) - r) /
|
|
884
|
+
function je(t, e, n = R) {
|
|
885
|
+
const { startHour: r, endHour: a } = e, o = a - r, s = o * n, u = t.getHours() + t.getMinutes() / 60;
|
|
886
|
+
return (Math.max(r, Math.min(u, a)) - r) / o * s;
|
|
799
887
|
}
|
|
800
|
-
function
|
|
888
|
+
function Xe(t, e) {
|
|
801
889
|
return t.startDate < e.endDate && t.endDate > e.startDate;
|
|
802
890
|
}
|
|
803
|
-
function
|
|
891
|
+
function qe(t) {
|
|
804
892
|
if (t.length === 0) return [];
|
|
805
|
-
const e = [...t].sort((
|
|
893
|
+
const e = [...t].sort((o, s) => o.startDate.getTime() - s.startDate.getTime()), n = [];
|
|
806
894
|
let r = [], a = 0;
|
|
807
|
-
for (const
|
|
808
|
-
r.length === 0 ||
|
|
895
|
+
for (const o of e)
|
|
896
|
+
r.length === 0 || o.startDate.getTime() < a ? (r.push(o), a = Math.max(a, o.endDate.getTime())) : (r.length > 0 && n.push(r), r = [o], a = o.endDate.getTime());
|
|
809
897
|
return r.length > 0 && n.push(r), n;
|
|
810
898
|
}
|
|
811
|
-
function
|
|
899
|
+
function Qe(t, e, n) {
|
|
812
900
|
const r = Math.max(0, Math.min(t, e)), a = Math.min(n, Math.max(t, e));
|
|
813
901
|
return {
|
|
814
902
|
top: r,
|
|
@@ -816,121 +904,135 @@ function Ce(t, e, n) {
|
|
|
816
904
|
};
|
|
817
905
|
}
|
|
818
906
|
export {
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
907
|
+
H as $,
|
|
908
|
+
V as A,
|
|
909
|
+
re as B,
|
|
910
|
+
bt as C,
|
|
911
|
+
kt as D,
|
|
912
|
+
xt as E,
|
|
913
|
+
ne as F,
|
|
914
|
+
U as G,
|
|
915
|
+
Rt as H,
|
|
916
|
+
ee as I,
|
|
917
|
+
ft as J,
|
|
918
|
+
se as K,
|
|
919
|
+
w as L,
|
|
920
|
+
$t as M,
|
|
921
|
+
M as N,
|
|
922
|
+
T as O,
|
|
835
923
|
Q as P,
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
z as
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
924
|
+
ct as Q,
|
|
925
|
+
O as R,
|
|
926
|
+
Xe as S,
|
|
927
|
+
dt as T,
|
|
928
|
+
mt as U,
|
|
929
|
+
gt as V,
|
|
930
|
+
Dt as W,
|
|
931
|
+
ht as X,
|
|
932
|
+
ae as Y,
|
|
933
|
+
$e as Z,
|
|
934
|
+
le as _,
|
|
935
|
+
A as a,
|
|
936
|
+
Ee as a$,
|
|
937
|
+
Ne as a0,
|
|
938
|
+
Ue as a1,
|
|
939
|
+
de as a2,
|
|
940
|
+
Le as a3,
|
|
941
|
+
Ve as a4,
|
|
942
|
+
Ye as a5,
|
|
943
|
+
Ie as a6,
|
|
944
|
+
Vt as a7,
|
|
945
|
+
Pt as a8,
|
|
946
|
+
jt as a9,
|
|
947
|
+
xe as aA,
|
|
948
|
+
x as aB,
|
|
949
|
+
p as aC,
|
|
950
|
+
W as aD,
|
|
951
|
+
Nt as aE,
|
|
952
|
+
Kt as aF,
|
|
953
|
+
G as aG,
|
|
954
|
+
K as aH,
|
|
955
|
+
De as aI,
|
|
956
|
+
te as aJ,
|
|
957
|
+
Zt as aK,
|
|
958
|
+
Oe as aL,
|
|
959
|
+
We as aM,
|
|
960
|
+
ve as aN,
|
|
961
|
+
oe as aO,
|
|
962
|
+
I as aP,
|
|
963
|
+
nt as aQ,
|
|
964
|
+
Mt as aR,
|
|
965
|
+
ot as aS,
|
|
966
|
+
at as aT,
|
|
967
|
+
_e as aU,
|
|
968
|
+
et as aV,
|
|
969
|
+
rt as aW,
|
|
970
|
+
St as aX,
|
|
971
|
+
ge as aY,
|
|
972
|
+
Jt as aZ,
|
|
973
|
+
Ae as a_,
|
|
974
|
+
Re as aa,
|
|
975
|
+
Ce as ab,
|
|
976
|
+
Pe as ac,
|
|
977
|
+
He as ad,
|
|
978
|
+
me as ae,
|
|
979
|
+
ie as af,
|
|
980
|
+
Fe as ag,
|
|
981
|
+
qe as ah,
|
|
982
|
+
Be as ai,
|
|
983
|
+
ke as aj,
|
|
984
|
+
yt as ak,
|
|
985
|
+
Ge as al,
|
|
986
|
+
ce as am,
|
|
987
|
+
fe as an,
|
|
988
|
+
Lt as ao,
|
|
989
|
+
Ke as ap,
|
|
990
|
+
ue as aq,
|
|
991
|
+
he as ar,
|
|
992
|
+
ye as as,
|
|
993
|
+
Se as at,
|
|
994
|
+
be as au,
|
|
995
|
+
Me as av,
|
|
996
|
+
qt as aw,
|
|
997
|
+
Xt as ax,
|
|
998
|
+
Qt as ay,
|
|
999
|
+
F as az,
|
|
1000
|
+
Wt as b,
|
|
1001
|
+
Te as b0,
|
|
1002
|
+
we as b1,
|
|
1003
|
+
g as b2,
|
|
1004
|
+
S as b3,
|
|
1005
|
+
m as b4,
|
|
1006
|
+
z as b5,
|
|
1007
|
+
Ut as b6,
|
|
1008
|
+
Bt as b7,
|
|
1009
|
+
Yt as b8,
|
|
1010
|
+
Gt as b9,
|
|
1011
|
+
je as ba,
|
|
1012
|
+
Je as bb,
|
|
1013
|
+
R as c,
|
|
1014
|
+
Ht as d,
|
|
1015
|
+
vt as e,
|
|
1016
|
+
Ot as f,
|
|
1017
|
+
Ft as g,
|
|
1018
|
+
It as h,
|
|
1019
|
+
Ct as i,
|
|
1020
|
+
_t as j,
|
|
1021
|
+
it as k,
|
|
1022
|
+
At as l,
|
|
1023
|
+
ut as m,
|
|
1024
|
+
st as n,
|
|
1025
|
+
l as o,
|
|
1026
|
+
lt as p,
|
|
1027
|
+
zt as q,
|
|
1028
|
+
_ as r,
|
|
1029
|
+
k as s,
|
|
1030
|
+
v as t,
|
|
1031
|
+
pe as u,
|
|
1032
|
+
pt as v,
|
|
1033
|
+
ze as w,
|
|
1034
|
+
Qe as x,
|
|
1035
|
+
Tt as y,
|
|
1036
|
+
Et as z
|
|
935
1037
|
};
|
|
936
|
-
//# sourceMappingURL=position-utils-
|
|
1038
|
+
//# sourceMappingURL=position-utils-BzmOPdvQ.js.map
|