@luckydye/calendar 1.3.0 → 1.3.1
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/calendar.js +1548 -1373
- package/package.json +2 -2
- package/src/CalDAVConfig.ts +50 -1
- package/src/CalendarInternal.ts +9 -4
- package/src/CalendarLayer.ts +28 -0
- package/src/CalendarView.ts +277 -1110
- package/src/GoogleCalendarSource.ts +25 -0
- package/src/IndexedDBStorage.ts +3 -0
- package/src/Keybinds.ts +3 -18
- package/src/StatusBar.ts +11 -0
- package/src/Theme.ts +4 -4
- package/src/TimeseriesJson.ts +114 -0
- package/src/app.ts +44 -4
- package/src/layers/EventsLayer.ts +958 -0
- package/src/layers/GridLayer.ts +296 -0
- package/src/layers/TimeseriesHeatmapLayer.ts +132 -0
- package/src/lib.ts +1 -0
package/dist/calendar.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
1
|
+
const Ce = globalThis, ti = Ce.ShadowRoot && (Ce.ShadyCSS === void 0 || Ce.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ei = /* @__PURE__ */ Symbol(), gi = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
let Xi = class {
|
|
3
3
|
constructor(t, e, i) {
|
|
4
|
-
if (this._$cssResult$ = !0, i !==
|
|
4
|
+
if (this._$cssResult$ = !0, i !== ei) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
5
|
this.cssText = t, this.t = e;
|
|
6
6
|
}
|
|
7
7
|
get styleSheet() {
|
|
8
8
|
let t = this.o;
|
|
9
9
|
const e = this.t;
|
|
10
|
-
if (
|
|
10
|
+
if (ti && t === void 0) {
|
|
11
11
|
const i = e !== void 0 && e.length === 1;
|
|
12
|
-
i && (t =
|
|
12
|
+
i && (t = gi.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && gi.set(e, t));
|
|
13
13
|
}
|
|
14
14
|
return t;
|
|
15
15
|
}
|
|
@@ -17,28 +17,28 @@ let Wi = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const
|
|
20
|
+
const mn = (n) => new Xi(typeof n == "string" ? n : n + "", void 0, ei), Zi = (n, ...t) => {
|
|
21
21
|
const e = n.length === 1 ? n[0] : t.reduce((i, s, r) => i + ((o) => {
|
|
22
22
|
if (o._$cssResult$ === !0) return o.cssText;
|
|
23
23
|
if (typeof o == "number") return o;
|
|
24
24
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
25
|
})(s) + n[r + 1], n[0]);
|
|
26
|
-
return new
|
|
27
|
-
},
|
|
28
|
-
if (
|
|
26
|
+
return new Xi(e, n, ei);
|
|
27
|
+
}, yn = (n, t) => {
|
|
28
|
+
if (ti) n.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
29
29
|
else for (const e of t) {
|
|
30
|
-
const i = document.createElement("style"), s =
|
|
30
|
+
const i = document.createElement("style"), s = Ce.litNonce;
|
|
31
31
|
s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, n.appendChild(i);
|
|
32
32
|
}
|
|
33
|
-
},
|
|
33
|
+
}, vi = ti ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((t) => {
|
|
34
34
|
let e = "";
|
|
35
35
|
for (const i of t.cssRules) e += i.cssText;
|
|
36
|
-
return
|
|
36
|
+
return mn(e);
|
|
37
37
|
})(n) : n;
|
|
38
|
-
const { is:
|
|
38
|
+
const { is: bn, defineProperty: wn, getOwnPropertyDescriptor: En, getOwnPropertyNames: xn, getOwnPropertySymbols: Sn, getPrototypeOf: Tn } = Object, Pe = globalThis, mi = Pe.trustedTypes, kn = mi ? mi.emptyScript : "", Dn = Pe.reactiveElementPolyfillSupport, fe = (n, t) => n, Fe = { toAttribute(n, t) {
|
|
39
39
|
switch (t) {
|
|
40
40
|
case Boolean:
|
|
41
|
-
n = n ?
|
|
41
|
+
n = n ? kn : null;
|
|
42
42
|
break;
|
|
43
43
|
case Object:
|
|
44
44
|
case Array:
|
|
@@ -63,23 +63,23 @@ const { is: dn, defineProperty: un, getOwnPropertyDescriptor: fn, getOwnProperty
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return e;
|
|
66
|
-
} },
|
|
67
|
-
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"),
|
|
68
|
-
let
|
|
66
|
+
} }, Gi = (n, t) => !bn(n, t), yi = { attribute: !0, type: String, converter: Fe, reflect: !1, useDefault: !1, hasChanged: Gi };
|
|
67
|
+
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), Pe.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
|
+
let te = class extends HTMLElement {
|
|
69
69
|
static addInitializer(t) {
|
|
70
70
|
this._$Ei(), (this.l ??= []).push(t);
|
|
71
71
|
}
|
|
72
72
|
static get observedAttributes() {
|
|
73
73
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
74
74
|
}
|
|
75
|
-
static createProperty(t, e =
|
|
75
|
+
static createProperty(t, e = yi) {
|
|
76
76
|
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
77
77
|
const i = /* @__PURE__ */ Symbol(), s = this.getPropertyDescriptor(t, i, e);
|
|
78
|
-
s !== void 0 &&
|
|
78
|
+
s !== void 0 && wn(this.prototype, t, s);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
static getPropertyDescriptor(t, e, i) {
|
|
82
|
-
const { get: s, set: r } =
|
|
82
|
+
const { get: s, set: r } = En(this.prototype, t) ?? { get() {
|
|
83
83
|
return this[e];
|
|
84
84
|
}, set(o) {
|
|
85
85
|
this[e] = o;
|
|
@@ -90,17 +90,17 @@ let Vt = class extends HTMLElement {
|
|
|
90
90
|
}, configurable: !0, enumerable: !0 };
|
|
91
91
|
}
|
|
92
92
|
static getPropertyOptions(t) {
|
|
93
|
-
return this.elementProperties.get(t) ??
|
|
93
|
+
return this.elementProperties.get(t) ?? yi;
|
|
94
94
|
}
|
|
95
95
|
static _$Ei() {
|
|
96
|
-
if (this.hasOwnProperty(
|
|
97
|
-
const t =
|
|
96
|
+
if (this.hasOwnProperty(fe("elementProperties"))) return;
|
|
97
|
+
const t = Tn(this);
|
|
98
98
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
99
99
|
}
|
|
100
100
|
static finalize() {
|
|
101
|
-
if (this.hasOwnProperty(
|
|
102
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
103
|
-
const e = this.properties, i = [...
|
|
101
|
+
if (this.hasOwnProperty(fe("finalized"))) return;
|
|
102
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(fe("properties"))) {
|
|
103
|
+
const e = this.properties, i = [...xn(e), ...Sn(e)];
|
|
104
104
|
for (const s of i) this.createProperty(s, e[s]);
|
|
105
105
|
}
|
|
106
106
|
const t = this[Symbol.metadata];
|
|
@@ -119,8 +119,8 @@ let Vt = class extends HTMLElement {
|
|
|
119
119
|
const e = [];
|
|
120
120
|
if (Array.isArray(t)) {
|
|
121
121
|
const i = new Set(t.flat(1 / 0).reverse());
|
|
122
|
-
for (const s of i) e.unshift(
|
|
123
|
-
} else t !== void 0 && e.push(
|
|
122
|
+
for (const s of i) e.unshift(vi(s));
|
|
123
|
+
} else t !== void 0 && e.push(vi(t));
|
|
124
124
|
return e;
|
|
125
125
|
}
|
|
126
126
|
static _$Eu(t, e) {
|
|
@@ -146,7 +146,7 @@ let Vt = class extends HTMLElement {
|
|
|
146
146
|
}
|
|
147
147
|
createRenderRoot() {
|
|
148
148
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
149
|
-
return
|
|
149
|
+
return yn(t, this.constructor.elementStyles), t;
|
|
150
150
|
}
|
|
151
151
|
connectedCallback() {
|
|
152
152
|
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((t) => t.hostConnected?.());
|
|
@@ -162,14 +162,14 @@ let Vt = class extends HTMLElement {
|
|
|
162
162
|
_$ET(t, e) {
|
|
163
163
|
const i = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, i);
|
|
164
164
|
if (s !== void 0 && i.reflect === !0) {
|
|
165
|
-
const r = (i.converter?.toAttribute !== void 0 ? i.converter :
|
|
165
|
+
const r = (i.converter?.toAttribute !== void 0 ? i.converter : Fe).toAttribute(e, i.type);
|
|
166
166
|
this._$Em = t, r == null ? this.removeAttribute(s) : this.setAttribute(s, r), this._$Em = null;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
_$AK(t, e) {
|
|
170
170
|
const i = this.constructor, s = i._$Eh.get(t);
|
|
171
171
|
if (s !== void 0 && this._$Em !== s) {
|
|
172
|
-
const r = i.getPropertyOptions(s), o = typeof r.converter == "function" ? { fromAttribute: r.converter } : r.converter?.fromAttribute !== void 0 ? r.converter :
|
|
172
|
+
const r = i.getPropertyOptions(s), o = typeof r.converter == "function" ? { fromAttribute: r.converter } : r.converter?.fromAttribute !== void 0 ? r.converter : Fe;
|
|
173
173
|
this._$Em = s;
|
|
174
174
|
const a = o.fromAttribute(e, r.type);
|
|
175
175
|
this[s] = a ?? this._$Ej?.get(s) ?? a, this._$Em = null;
|
|
@@ -178,7 +178,7 @@ let Vt = class extends HTMLElement {
|
|
|
178
178
|
requestUpdate(t, e, i, s = !1, r) {
|
|
179
179
|
if (t !== void 0) {
|
|
180
180
|
const o = this.constructor;
|
|
181
|
-
if (s === !1 && (r = this[t]), i ??= o.getPropertyOptions(t), !((i.hasChanged ??
|
|
181
|
+
if (s === !1 && (r = this[t]), i ??= o.getPropertyOptions(t), !((i.hasChanged ?? Gi)(r, e) || i.useDefault && i.reflect && r === this._$Ej?.get(t) && !this.hasAttribute(o._$Eu(t, i)))) return;
|
|
182
182
|
this.C(t, e, i);
|
|
183
183
|
}
|
|
184
184
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
@@ -246,70 +246,70 @@ let Vt = class extends HTMLElement {
|
|
|
246
246
|
firstUpdated(t) {
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
|
|
250
|
-
const
|
|
251
|
-
\f\r]`,
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
253
|
-
function
|
|
254
|
-
if (!
|
|
255
|
-
return
|
|
249
|
+
te.elementStyles = [], te.shadowRootOptions = { mode: "open" }, te[fe("elementProperties")] = /* @__PURE__ */ new Map(), te[fe("finalized")] = /* @__PURE__ */ new Map(), Dn?.({ ReactiveElement: te }), (Pe.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
|
+
const ii = globalThis, bi = (n) => n, Me = ii.trustedTypes, wi = Me ? Me.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Ji = "$lit$", Nt = `lit$${Math.random().toFixed(9).slice(2)}$`, Qi = "?" + Nt, Cn = `<${Qi}>`, Kt = document, ve = () => Kt.createComment(""), me = (n) => n === null || typeof n != "object" && typeof n != "function", ni = Array.isArray, Mn = (n) => ni(n) || typeof n?.[Symbol.iterator] == "function", Le = `[
|
|
251
|
+
\f\r]`, de = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Ei = /-->/g, xi = />/g, Bt = RegExp(`>|${Le}(?:([^\\s"'>=/]+)(${Le}*=${Le}*(?:[^
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Si = /'/g, Ti = /"/g, tn = /^(?:script|style|textarea|title)$/i, $n = (n) => (t, ...e) => ({ _$litType$: n, strings: t, values: e }), $ = $n(1), ne = /* @__PURE__ */ Symbol.for("lit-noChange"), it = /* @__PURE__ */ Symbol.for("lit-nothing"), ki = /* @__PURE__ */ new WeakMap(), Vt = Kt.createTreeWalker(Kt, 129);
|
|
253
|
+
function en(n, t) {
|
|
254
|
+
if (!ni(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
|
+
return wi !== void 0 ? wi.createHTML(t) : t;
|
|
256
256
|
}
|
|
257
|
-
const
|
|
257
|
+
const An = (n, t) => {
|
|
258
258
|
const e = n.length - 1, i = [];
|
|
259
|
-
let s, r = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o =
|
|
259
|
+
let s, r = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = de;
|
|
260
260
|
for (let a = 0; a < e; a++) {
|
|
261
261
|
const l = n[a];
|
|
262
|
-
let c,
|
|
263
|
-
for (; u < l.length && (o.lastIndex = u,
|
|
264
|
-
const f = o ===
|
|
265
|
-
r += o ===
|
|
262
|
+
let c, h, d = -1, u = 0;
|
|
263
|
+
for (; u < l.length && (o.lastIndex = u, h = o.exec(l), h !== null); ) u = o.lastIndex, o === de ? h[1] === "!--" ? o = Ei : h[1] !== void 0 ? o = xi : h[2] !== void 0 ? (tn.test(h[2]) && (s = RegExp("</" + h[2], "g")), o = Bt) : h[3] !== void 0 && (o = Bt) : o === Bt ? h[0] === ">" ? (o = s ?? de, d = -1) : h[1] === void 0 ? d = -2 : (d = o.lastIndex - h[2].length, c = h[1], o = h[3] === void 0 ? Bt : h[3] === '"' ? Ti : Si) : o === Ti || o === Si ? o = Bt : o === Ei || o === xi ? o = de : (o = Bt, s = void 0);
|
|
264
|
+
const f = o === Bt && n[a + 1].startsWith("/>") ? " " : "";
|
|
265
|
+
r += o === de ? l + Cn : d >= 0 ? (i.push(c), l.slice(0, d) + Ji + l.slice(d) + Nt + f) : l + Nt + (d === -2 ? a : f);
|
|
266
266
|
}
|
|
267
|
-
return [
|
|
267
|
+
return [en(n, r + (n[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
|
|
268
268
|
};
|
|
269
|
-
class
|
|
269
|
+
class ye {
|
|
270
270
|
constructor({ strings: t, _$litType$: e }, i) {
|
|
271
271
|
let s;
|
|
272
272
|
this.parts = [];
|
|
273
273
|
let r = 0, o = 0;
|
|
274
|
-
const a = t.length - 1, l = this.parts, [c,
|
|
275
|
-
if (this.el =
|
|
276
|
-
const
|
|
277
|
-
|
|
274
|
+
const a = t.length - 1, l = this.parts, [c, h] = An(t, e);
|
|
275
|
+
if (this.el = ye.createElement(c, i), Vt.currentNode = this.el.content, e === 2 || e === 3) {
|
|
276
|
+
const d = this.el.content.firstChild;
|
|
277
|
+
d.replaceWith(...d.childNodes);
|
|
278
278
|
}
|
|
279
|
-
for (; (s =
|
|
279
|
+
for (; (s = Vt.nextNode()) !== null && l.length < a; ) {
|
|
280
280
|
if (s.nodeType === 1) {
|
|
281
|
-
if (s.hasAttributes()) for (const
|
|
282
|
-
const u =
|
|
283
|
-
l.push({ type: 1, index: r, name: v[2], strings: f, ctor: v[1] === "." ?
|
|
284
|
-
} else
|
|
285
|
-
if (
|
|
286
|
-
const
|
|
281
|
+
if (s.hasAttributes()) for (const d of s.getAttributeNames()) if (d.endsWith(Ji)) {
|
|
282
|
+
const u = h[o++], f = s.getAttribute(d).split(Nt), v = /([.?@])?(.*)/.exec(u);
|
|
283
|
+
l.push({ type: 1, index: r, name: v[2], strings: f, ctor: v[1] === "." ? _n : v[1] === "?" ? Rn : v[1] === "@" ? In : He }), s.removeAttribute(d);
|
|
284
|
+
} else d.startsWith(Nt) && (l.push({ type: 6, index: r }), s.removeAttribute(d));
|
|
285
|
+
if (tn.test(s.tagName)) {
|
|
286
|
+
const d = s.textContent.split(Nt), u = d.length - 1;
|
|
287
287
|
if (u > 0) {
|
|
288
|
-
s.textContent =
|
|
289
|
-
for (let f = 0; f < u; f++) s.append(
|
|
290
|
-
s.append(
|
|
288
|
+
s.textContent = Me ? Me.emptyScript : "";
|
|
289
|
+
for (let f = 0; f < u; f++) s.append(d[f], ve()), Vt.nextNode(), l.push({ type: 2, index: ++r });
|
|
290
|
+
s.append(d[u], ve());
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
} else if (s.nodeType === 8) if (s.data ===
|
|
293
|
+
} else if (s.nodeType === 8) if (s.data === Qi) l.push({ type: 2, index: r });
|
|
294
294
|
else {
|
|
295
|
-
let
|
|
296
|
-
for (; (
|
|
295
|
+
let d = -1;
|
|
296
|
+
for (; (d = s.data.indexOf(Nt, d + 1)) !== -1; ) l.push({ type: 7, index: r }), d += Nt.length - 1;
|
|
297
297
|
}
|
|
298
298
|
r++;
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
static createElement(t, e) {
|
|
302
|
-
const i =
|
|
302
|
+
const i = Kt.createElement("template");
|
|
303
303
|
return i.innerHTML = t, i;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
if (t ===
|
|
306
|
+
function se(n, t, e = n, i) {
|
|
307
|
+
if (t === ne) return t;
|
|
308
308
|
let s = i !== void 0 ? e._$Co?.[i] : e._$Cl;
|
|
309
|
-
const r =
|
|
310
|
-
return s?.constructor !== r && (s?._$AO?.(!1), r === void 0 ? s = void 0 : (s = new r(n), s._$AT(n, e, i)), i !== void 0 ? (e._$Co ??= [])[i] = s : e._$Cl = s), s !== void 0 && (t =
|
|
309
|
+
const r = me(t) ? void 0 : t._$litDirective$;
|
|
310
|
+
return s?.constructor !== r && (s?._$AO?.(!1), r === void 0 ? s = void 0 : (s = new r(n), s._$AT(n, e, i)), i !== void 0 ? (e._$Co ??= [])[i] = s : e._$Cl = s), s !== void 0 && (t = se(n, s._$AS(n, t.values), s, i)), t;
|
|
311
311
|
}
|
|
312
|
-
class
|
|
312
|
+
class On {
|
|
313
313
|
constructor(t, e) {
|
|
314
314
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
315
315
|
}
|
|
@@ -320,29 +320,29 @@ class Sn {
|
|
|
320
320
|
return this._$AM._$AU;
|
|
321
321
|
}
|
|
322
322
|
u(t) {
|
|
323
|
-
const { el: { content: e }, parts: i } = this._$AD, s = (t?.creationScope ??
|
|
324
|
-
|
|
325
|
-
let r =
|
|
323
|
+
const { el: { content: e }, parts: i } = this._$AD, s = (t?.creationScope ?? Kt).importNode(e, !0);
|
|
324
|
+
Vt.currentNode = s;
|
|
325
|
+
let r = Vt.nextNode(), o = 0, a = 0, l = i[0];
|
|
326
326
|
for (; l !== void 0; ) {
|
|
327
327
|
if (o === l.index) {
|
|
328
328
|
let c;
|
|
329
|
-
l.type === 2 ? c = new
|
|
329
|
+
l.type === 2 ? c = new we(r, r.nextSibling, this, t) : l.type === 1 ? c = new l.ctor(r, l.name, l.strings, this, t) : l.type === 6 && (c = new Pn(r, this, t)), this._$AV.push(c), l = i[++a];
|
|
330
330
|
}
|
|
331
|
-
o !== l?.index && (r =
|
|
331
|
+
o !== l?.index && (r = Vt.nextNode(), o++);
|
|
332
332
|
}
|
|
333
|
-
return
|
|
333
|
+
return Vt.currentNode = Kt, s;
|
|
334
334
|
}
|
|
335
335
|
p(t) {
|
|
336
336
|
let e = 0;
|
|
337
337
|
for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
class
|
|
340
|
+
class we {
|
|
341
341
|
get _$AU() {
|
|
342
342
|
return this._$AM?._$AU ?? this._$Cv;
|
|
343
343
|
}
|
|
344
344
|
constructor(t, e, i, s) {
|
|
345
|
-
this.type = 2, this._$AH =
|
|
345
|
+
this.type = 2, this._$AH = it, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cv = s?.isConnected ?? !0;
|
|
346
346
|
}
|
|
347
347
|
get parentNode() {
|
|
348
348
|
let t = this._$AA.parentNode;
|
|
@@ -356,7 +356,7 @@ class ue {
|
|
|
356
356
|
return this._$AB;
|
|
357
357
|
}
|
|
358
358
|
_$AI(t, e = this) {
|
|
359
|
-
t =
|
|
359
|
+
t = se(this, t, e), me(t) ? t === it || t == null || t === "" ? (this._$AH !== it && this._$AR(), this._$AH = it) : t !== this._$AH && t !== ne && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Mn(t) ? this.k(t) : this._(t);
|
|
360
360
|
}
|
|
361
361
|
O(t) {
|
|
362
362
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -365,38 +365,38 @@ class ue {
|
|
|
365
365
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
366
366
|
}
|
|
367
367
|
_(t) {
|
|
368
|
-
this._$AH !==
|
|
368
|
+
this._$AH !== it && me(this._$AH) ? this._$AA.nextSibling.data = t : this.T(Kt.createTextNode(t)), this._$AH = t;
|
|
369
369
|
}
|
|
370
370
|
$(t) {
|
|
371
|
-
const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el =
|
|
371
|
+
const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = ye.createElement(en(i.h, i.h[0]), this.options)), i);
|
|
372
372
|
if (this._$AH?._$AD === s) this._$AH.p(e);
|
|
373
373
|
else {
|
|
374
|
-
const r = new
|
|
374
|
+
const r = new On(s, this), o = r.u(this.options);
|
|
375
375
|
r.p(e), this.T(o), this._$AH = r;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
_$AC(t) {
|
|
379
|
-
let e =
|
|
380
|
-
return e === void 0 &&
|
|
379
|
+
let e = ki.get(t.strings);
|
|
380
|
+
return e === void 0 && ki.set(t.strings, e = new ye(t)), e;
|
|
381
381
|
}
|
|
382
382
|
k(t) {
|
|
383
|
-
|
|
383
|
+
ni(this._$AH) || (this._$AH = [], this._$AR());
|
|
384
384
|
const e = this._$AH;
|
|
385
385
|
let i, s = 0;
|
|
386
|
-
for (const r of t) s === e.length ? e.push(i = new
|
|
386
|
+
for (const r of t) s === e.length ? e.push(i = new we(this.O(ve()), this.O(ve()), this, this.options)) : i = e[s], i._$AI(r), s++;
|
|
387
387
|
s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
|
|
388
388
|
}
|
|
389
389
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
390
390
|
for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
|
|
391
|
-
const i =
|
|
392
|
-
|
|
391
|
+
const i = bi(t).nextSibling;
|
|
392
|
+
bi(t).remove(), t = i;
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
setConnected(t) {
|
|
396
396
|
this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
|
-
class
|
|
399
|
+
class He {
|
|
400
400
|
get tagName() {
|
|
401
401
|
return this.element.tagName;
|
|
402
402
|
}
|
|
@@ -404,53 +404,53 @@ class Me {
|
|
|
404
404
|
return this._$AM._$AU;
|
|
405
405
|
}
|
|
406
406
|
constructor(t, e, i, s, r) {
|
|
407
|
-
this.type = 1, this._$AH =
|
|
407
|
+
this.type = 1, this._$AH = it, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = r, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = it;
|
|
408
408
|
}
|
|
409
409
|
_$AI(t, e = this, i, s) {
|
|
410
410
|
const r = this.strings;
|
|
411
411
|
let o = !1;
|
|
412
|
-
if (r === void 0) t =
|
|
412
|
+
if (r === void 0) t = se(this, t, e, 0), o = !me(t) || t !== this._$AH && t !== ne, o && (this._$AH = t);
|
|
413
413
|
else {
|
|
414
414
|
const a = t;
|
|
415
415
|
let l, c;
|
|
416
|
-
for (t = r[0], l = 0; l < r.length - 1; l++) c =
|
|
416
|
+
for (t = r[0], l = 0; l < r.length - 1; l++) c = se(this, a[i + l], e, l), c === ne && (c = this._$AH[l]), o ||= !me(c) || c !== this._$AH[l], c === it ? t = it : t !== it && (t += (c ?? "") + r[l + 1]), this._$AH[l] = c;
|
|
417
417
|
}
|
|
418
418
|
o && !s && this.j(t);
|
|
419
419
|
}
|
|
420
420
|
j(t) {
|
|
421
|
-
t ===
|
|
421
|
+
t === it ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
class
|
|
424
|
+
class _n extends He {
|
|
425
425
|
constructor() {
|
|
426
426
|
super(...arguments), this.type = 3;
|
|
427
427
|
}
|
|
428
428
|
j(t) {
|
|
429
|
-
this.element[this.name] = t ===
|
|
429
|
+
this.element[this.name] = t === it ? void 0 : t;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
class
|
|
432
|
+
class Rn extends He {
|
|
433
433
|
constructor() {
|
|
434
434
|
super(...arguments), this.type = 4;
|
|
435
435
|
}
|
|
436
436
|
j(t) {
|
|
437
|
-
this.element.toggleAttribute(this.name, !!t && t !==
|
|
437
|
+
this.element.toggleAttribute(this.name, !!t && t !== it);
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
class
|
|
440
|
+
class In extends He {
|
|
441
441
|
constructor(t, e, i, s, r) {
|
|
442
442
|
super(t, e, i, s, r), this.type = 5;
|
|
443
443
|
}
|
|
444
444
|
_$AI(t, e = this) {
|
|
445
|
-
if ((t =
|
|
446
|
-
const i = this._$AH, s = t ===
|
|
445
|
+
if ((t = se(this, t, e, 0) ?? it) === ne) return;
|
|
446
|
+
const i = this._$AH, s = t === it && i !== it || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, r = t !== it && (i === it || s);
|
|
447
447
|
s && this.element.removeEventListener(this.name, this, i), r && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
448
448
|
}
|
|
449
449
|
handleEvent(t) {
|
|
450
450
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
|
-
class
|
|
453
|
+
class Pn {
|
|
454
454
|
constructor(t, e, i) {
|
|
455
455
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
|
|
456
456
|
}
|
|
@@ -458,22 +458,22 @@ class Cn {
|
|
|
458
458
|
return this._$AM._$AU;
|
|
459
459
|
}
|
|
460
460
|
_$AI(t) {
|
|
461
|
-
|
|
461
|
+
se(this, t);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
const
|
|
464
|
+
const Hn = ii.litHtmlPolyfillSupport;
|
|
465
|
+
Hn?.(ye, we), (ii.litHtmlVersions ??= []).push("3.3.2");
|
|
466
|
+
const Yn = (n, t, e) => {
|
|
467
467
|
const i = e?.renderBefore ?? t;
|
|
468
468
|
let s = i._$litPart$;
|
|
469
469
|
if (s === void 0) {
|
|
470
470
|
const r = e?.renderBefore ?? null;
|
|
471
|
-
i._$litPart$ = s = new
|
|
471
|
+
i._$litPart$ = s = new we(t.insertBefore(ve(), r), r, void 0, e ?? {});
|
|
472
472
|
}
|
|
473
473
|
return s._$AI(n), s;
|
|
474
474
|
};
|
|
475
|
-
const
|
|
476
|
-
class
|
|
475
|
+
const si = globalThis;
|
|
476
|
+
class ie extends te {
|
|
477
477
|
constructor() {
|
|
478
478
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
479
479
|
}
|
|
@@ -483,7 +483,7 @@ class Kt extends Vt {
|
|
|
483
483
|
}
|
|
484
484
|
update(t) {
|
|
485
485
|
const e = this.render();
|
|
486
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do =
|
|
486
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Yn(e, this.renderRoot, this.renderOptions);
|
|
487
487
|
}
|
|
488
488
|
connectedCallback() {
|
|
489
489
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -492,14 +492,14 @@ class Kt extends Vt {
|
|
|
492
492
|
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
493
493
|
}
|
|
494
494
|
render() {
|
|
495
|
-
return
|
|
495
|
+
return ne;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
(
|
|
502
|
-
var
|
|
498
|
+
ie._$litElement$ = !0, ie.finalized = !0, si.litElementHydrateSupport?.({ LitElement: ie });
|
|
499
|
+
const Nn = si.litElementPolyfillSupport;
|
|
500
|
+
Nn?.({ LitElement: ie });
|
|
501
|
+
(si.litElementVersions ??= []).push("4.2.2");
|
|
502
|
+
var Be = [
|
|
503
503
|
"MO",
|
|
504
504
|
"TU",
|
|
505
505
|
"WE",
|
|
@@ -507,7 +507,7 @@ var Ye = [
|
|
|
507
507
|
"FR",
|
|
508
508
|
"SA",
|
|
509
509
|
"SU"
|
|
510
|
-
],
|
|
510
|
+
], ct = (
|
|
511
511
|
/** @class */
|
|
512
512
|
(function() {
|
|
513
513
|
function n(t, e) {
|
|
@@ -516,121 +516,121 @@ var Ye = [
|
|
|
516
516
|
this.weekday = t, this.n = e;
|
|
517
517
|
}
|
|
518
518
|
return n.fromStr = function(t) {
|
|
519
|
-
return new n(
|
|
519
|
+
return new n(Be.indexOf(t));
|
|
520
520
|
}, n.prototype.nth = function(t) {
|
|
521
521
|
return this.n === t ? this : new n(this.weekday, t);
|
|
522
522
|
}, n.prototype.equals = function(t) {
|
|
523
523
|
return this.weekday === t.weekday && this.n === t.n;
|
|
524
524
|
}, n.prototype.toString = function() {
|
|
525
|
-
var t =
|
|
525
|
+
var t = Be[this.weekday];
|
|
526
526
|
return this.n && (t = (this.n > 0 ? "+" : "") + String(this.n) + t), t;
|
|
527
527
|
}, n.prototype.getJsWeekday = function() {
|
|
528
528
|
return this.weekday === 6 ? 0 : this.weekday + 1;
|
|
529
529
|
}, n;
|
|
530
530
|
})()
|
|
531
|
-
),
|
|
531
|
+
), Z = function(n) {
|
|
532
532
|
return n != null;
|
|
533
|
-
},
|
|
533
|
+
}, kt = function(n) {
|
|
534
534
|
return typeof n == "number";
|
|
535
|
-
},
|
|
536
|
-
return typeof n == "string" &&
|
|
537
|
-
},
|
|
535
|
+
}, Di = function(n) {
|
|
536
|
+
return typeof n == "string" && Be.includes(n);
|
|
537
|
+
}, ft = Array.isArray, Ct = function(n, t) {
|
|
538
538
|
t === void 0 && (t = n), arguments.length === 1 && (t = n, n = 0);
|
|
539
539
|
for (var e = [], i = n; i < t; i++)
|
|
540
540
|
e.push(i);
|
|
541
541
|
return e;
|
|
542
|
-
},
|
|
542
|
+
}, A = function(n, t) {
|
|
543
543
|
var e = 0, i = [];
|
|
544
|
-
if (
|
|
544
|
+
if (ft(n))
|
|
545
545
|
for (; e < t; e++)
|
|
546
546
|
i[e] = [].concat(n);
|
|
547
547
|
else
|
|
548
548
|
for (; e < t; e++)
|
|
549
549
|
i[e] = n;
|
|
550
550
|
return i;
|
|
551
|
-
},
|
|
552
|
-
return
|
|
551
|
+
}, Un = function(n) {
|
|
552
|
+
return ft(n) ? n : [n];
|
|
553
553
|
};
|
|
554
|
-
function
|
|
554
|
+
function Qt(n, t, e) {
|
|
555
555
|
e === void 0 && (e = " ");
|
|
556
556
|
var i = String(n);
|
|
557
|
-
return t = t >> 0, i.length > t ? String(i) : (t = t - i.length, t > e.length && (e +=
|
|
557
|
+
return t = t >> 0, i.length > t ? String(i) : (t = t - i.length, t > e.length && (e += A(e, t / e.length)), e.slice(0, t) + String(i));
|
|
558
558
|
}
|
|
559
|
-
var
|
|
559
|
+
var Ln = function(n, t, e) {
|
|
560
560
|
var i = n.split(t);
|
|
561
561
|
return e ? i.slice(0, e).concat([i.slice(e).join(t)]) : i;
|
|
562
|
-
},
|
|
562
|
+
}, gt = function(n, t) {
|
|
563
563
|
var e = n % t;
|
|
564
564
|
return e * t < 0 ? e + t : e;
|
|
565
|
-
},
|
|
566
|
-
return { div: Math.floor(n / t), mod:
|
|
567
|
-
},
|
|
568
|
-
return !
|
|
569
|
-
},
|
|
570
|
-
return !
|
|
571
|
-
},
|
|
572
|
-
return
|
|
573
|
-
},
|
|
565
|
+
}, We = function(n, t) {
|
|
566
|
+
return { div: Math.floor(n / t), mod: gt(n, t) };
|
|
567
|
+
}, Dt = function(n) {
|
|
568
|
+
return !Z(n) || n.length === 0;
|
|
569
|
+
}, et = function(n) {
|
|
570
|
+
return !Dt(n);
|
|
571
|
+
}, L = function(n, t) {
|
|
572
|
+
return et(n) && n.indexOf(t) !== -1;
|
|
573
|
+
}, Xt = function(n, t, e, i, s, r) {
|
|
574
574
|
return i === void 0 && (i = 0), s === void 0 && (s = 0), r === void 0 && (r = 0), new Date(Date.UTC(n, t - 1, e, i, s, r));
|
|
575
|
-
},
|
|
575
|
+
}, Wn = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], nn = 1e3 * 60 * 60 * 24, sn = 9999, rn = Xt(1970, 1, 1), zn = [6, 0, 1, 2, 3, 4, 5], pe = function(n) {
|
|
576
576
|
return n % 4 === 0 && n % 100 !== 0 || n % 400 === 0;
|
|
577
|
-
},
|
|
577
|
+
}, on = function(n) {
|
|
578
578
|
return n instanceof Date;
|
|
579
|
-
},
|
|
580
|
-
return
|
|
581
|
-
},
|
|
579
|
+
}, ue = function(n) {
|
|
580
|
+
return on(n) && !isNaN(n.getTime());
|
|
581
|
+
}, Fn = function(n, t) {
|
|
582
582
|
var e = n.getTime(), i = t.getTime(), s = e - i;
|
|
583
|
-
return Math.round(s /
|
|
584
|
-
},
|
|
585
|
-
return
|
|
586
|
-
},
|
|
587
|
-
return new Date(
|
|
588
|
-
},
|
|
583
|
+
return Math.round(s / nn);
|
|
584
|
+
}, qe = function(n) {
|
|
585
|
+
return Fn(n, rn);
|
|
586
|
+
}, an = function(n) {
|
|
587
|
+
return new Date(rn.getTime() + n * nn);
|
|
588
|
+
}, Bn = function(n) {
|
|
589
589
|
var t = n.getUTCMonth();
|
|
590
|
-
return t === 1 &&
|
|
591
|
-
},
|
|
592
|
-
return
|
|
593
|
-
},
|
|
594
|
-
var e =
|
|
595
|
-
return [
|
|
596
|
-
},
|
|
590
|
+
return t === 1 && pe(n.getUTCFullYear()) ? 29 : Wn[t];
|
|
591
|
+
}, re = function(n) {
|
|
592
|
+
return zn[n.getUTCDay()];
|
|
593
|
+
}, Ci = function(n, t) {
|
|
594
|
+
var e = Xt(n, t + 1, 1);
|
|
595
|
+
return [re(e), Bn(e)];
|
|
596
|
+
}, ln = function(n, t) {
|
|
597
597
|
return t = t || n, new Date(Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate(), t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds()));
|
|
598
|
-
},
|
|
598
|
+
}, je = function(n) {
|
|
599
599
|
var t = new Date(n.getTime());
|
|
600
600
|
return t;
|
|
601
|
-
},
|
|
601
|
+
}, Mi = function(n) {
|
|
602
602
|
for (var t = [], e = 0; e < n.length; e++)
|
|
603
|
-
t.push(
|
|
603
|
+
t.push(je(n[e]));
|
|
604
604
|
return t;
|
|
605
|
-
},
|
|
605
|
+
}, be = function(n) {
|
|
606
606
|
n.sort(function(t, e) {
|
|
607
607
|
return t.getTime() - e.getTime();
|
|
608
608
|
});
|
|
609
|
-
},
|
|
609
|
+
}, ri = function(n, t) {
|
|
610
610
|
t === void 0 && (t = !0);
|
|
611
611
|
var e = new Date(n);
|
|
612
612
|
return [
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
613
|
+
Qt(e.getUTCFullYear().toString(), 4, "0"),
|
|
614
|
+
Qt(e.getUTCMonth() + 1, 2, "0"),
|
|
615
|
+
Qt(e.getUTCDate(), 2, "0"),
|
|
616
616
|
"T",
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
617
|
+
Qt(e.getUTCHours(), 2, "0"),
|
|
618
|
+
Qt(e.getUTCMinutes(), 2, "0"),
|
|
619
|
+
Qt(e.getUTCSeconds(), 2, "0"),
|
|
620
620
|
t ? "Z" : ""
|
|
621
621
|
].join("");
|
|
622
|
-
},
|
|
622
|
+
}, oi = function(n) {
|
|
623
623
|
var t = /^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/, e = t.exec(n);
|
|
624
624
|
if (!e)
|
|
625
625
|
throw new Error("Invalid UNTIL value: ".concat(n));
|
|
626
626
|
return new Date(Date.UTC(parseInt(e[1], 10), parseInt(e[2], 10) - 1, parseInt(e[3], 10), parseInt(e[5], 10) || 0, parseInt(e[6], 10) || 0, parseInt(e[7], 10) || 0));
|
|
627
|
-
},
|
|
627
|
+
}, $i = function(n, t) {
|
|
628
628
|
var e = n.toLocaleString("sv-SE", { timeZone: t });
|
|
629
629
|
return e.replace(" ", "T") + "Z";
|
|
630
|
-
},
|
|
631
|
-
var e = Intl.DateTimeFormat().resolvedOptions().timeZone, i = new Date(
|
|
630
|
+
}, qn = function(n, t) {
|
|
631
|
+
var e = Intl.DateTimeFormat().resolvedOptions().timeZone, i = new Date($i(n, e)), s = new Date($i(n, t ?? "UTC")), r = s.getTime() - i.getTime();
|
|
632
632
|
return new Date(n.getTime() - r);
|
|
633
|
-
},
|
|
633
|
+
}, ee = (
|
|
634
634
|
/** @class */
|
|
635
635
|
(function() {
|
|
636
636
|
function n(t, e) {
|
|
@@ -665,40 +665,40 @@ var _n = function(n, t, e) {
|
|
|
665
665
|
return new n(this.method, this.args);
|
|
666
666
|
}, n;
|
|
667
667
|
})()
|
|
668
|
-
),
|
|
669
|
-
return
|
|
668
|
+
), Ve = function(n, t) {
|
|
669
|
+
return Ve = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, i) {
|
|
670
670
|
e.__proto__ = i;
|
|
671
671
|
} || function(e, i) {
|
|
672
672
|
for (var s in i) Object.prototype.hasOwnProperty.call(i, s) && (e[s] = i[s]);
|
|
673
|
-
},
|
|
673
|
+
}, Ve(n, t);
|
|
674
674
|
};
|
|
675
|
-
function
|
|
675
|
+
function ai(n, t) {
|
|
676
676
|
if (typeof t != "function" && t !== null)
|
|
677
677
|
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
678
|
-
|
|
678
|
+
Ve(n, t);
|
|
679
679
|
function e() {
|
|
680
680
|
this.constructor = n;
|
|
681
681
|
}
|
|
682
682
|
n.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
|
|
683
683
|
}
|
|
684
|
-
var
|
|
685
|
-
return
|
|
684
|
+
var pt = function() {
|
|
685
|
+
return pt = Object.assign || function(t) {
|
|
686
686
|
for (var e, i = 1, s = arguments.length; i < s; i++) {
|
|
687
687
|
e = arguments[i];
|
|
688
688
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
|
|
689
689
|
}
|
|
690
690
|
return t;
|
|
691
|
-
},
|
|
691
|
+
}, pt.apply(this, arguments);
|
|
692
692
|
};
|
|
693
693
|
function m(n, t, e) {
|
|
694
694
|
if (e || arguments.length === 2) for (var i = 0, s = t.length, r; i < s; i++)
|
|
695
695
|
(r || !(i in t)) && (r || (r = Array.prototype.slice.call(t, 0, i)), r[i] = t[i]);
|
|
696
696
|
return n.concat(r || Array.prototype.slice.call(t));
|
|
697
697
|
}
|
|
698
|
-
var
|
|
698
|
+
var Ai = (
|
|
699
699
|
/** @class */
|
|
700
700
|
(function(n) {
|
|
701
|
-
|
|
701
|
+
ai(t, n);
|
|
702
702
|
function t(e, i, s) {
|
|
703
703
|
var r = n.call(this, e, i) || this;
|
|
704
704
|
return r.iterator = s, r;
|
|
@@ -706,8 +706,8 @@ var xi = (
|
|
|
706
706
|
return t.prototype.add = function(e) {
|
|
707
707
|
return this.iterator(e, this._result.length) ? (this._result.push(e), !0) : !1;
|
|
708
708
|
}, t;
|
|
709
|
-
})(
|
|
710
|
-
),
|
|
709
|
+
})(ee)
|
|
710
|
+
), $e = {
|
|
711
711
|
dayNames: [
|
|
712
712
|
"Sunday",
|
|
713
713
|
"Monday",
|
|
@@ -775,38 +775,38 @@ var xi = (
|
|
|
775
775
|
december: /^dec(ember)?/i,
|
|
776
776
|
comma: /^(,\s*|(and|or)\s*)+/i
|
|
777
777
|
}
|
|
778
|
-
},
|
|
778
|
+
}, Oi = function(n, t) {
|
|
779
779
|
return n.indexOf(t) !== -1;
|
|
780
|
-
},
|
|
780
|
+
}, jn = function(n) {
|
|
781
781
|
return n.toString();
|
|
782
|
-
},
|
|
782
|
+
}, Vn = function(n, t, e) {
|
|
783
783
|
return "".concat(t, " ").concat(e, ", ").concat(n);
|
|
784
|
-
},
|
|
784
|
+
}, At = (
|
|
785
785
|
/** @class */
|
|
786
786
|
(function() {
|
|
787
787
|
function n(t, e, i, s) {
|
|
788
|
-
if (e === void 0 && (e =
|
|
788
|
+
if (e === void 0 && (e = jn), i === void 0 && (i = $e), s === void 0 && (s = Vn), this.text = [], this.language = i || $e, this.gettext = e, this.dateFormatter = s, this.rrule = t, this.options = t.options, this.origOptions = t.origOptions, this.origOptions.bymonthday) {
|
|
789
789
|
var r = [].concat(this.options.bymonthday), o = [].concat(this.options.bynmonthday);
|
|
790
|
-
r.sort(function(
|
|
791
|
-
return d - h;
|
|
792
|
-
}), o.sort(function(d, h) {
|
|
790
|
+
r.sort(function(h, d) {
|
|
793
791
|
return h - d;
|
|
792
|
+
}), o.sort(function(h, d) {
|
|
793
|
+
return d - h;
|
|
794
794
|
}), this.bymonthday = r.concat(o), this.bymonthday.length || (this.bymonthday = null);
|
|
795
795
|
}
|
|
796
|
-
if (
|
|
797
|
-
var a =
|
|
796
|
+
if (Z(this.origOptions.byweekday)) {
|
|
797
|
+
var a = ft(this.origOptions.byweekday) ? this.origOptions.byweekday : [this.origOptions.byweekday], l = String(a);
|
|
798
798
|
this.byweekday = {
|
|
799
|
-
allWeeks: a.filter(function(
|
|
800
|
-
return !
|
|
799
|
+
allWeeks: a.filter(function(h) {
|
|
800
|
+
return !h.n;
|
|
801
801
|
}),
|
|
802
|
-
someWeeks: a.filter(function(
|
|
803
|
-
return !!
|
|
802
|
+
someWeeks: a.filter(function(h) {
|
|
803
|
+
return !!h.n;
|
|
804
804
|
}),
|
|
805
805
|
isWeekdays: l.indexOf("MO") !== -1 && l.indexOf("TU") !== -1 && l.indexOf("WE") !== -1 && l.indexOf("TH") !== -1 && l.indexOf("FR") !== -1 && l.indexOf("SA") === -1 && l.indexOf("SU") === -1,
|
|
806
806
|
isEveryDay: l.indexOf("MO") !== -1 && l.indexOf("TU") !== -1 && l.indexOf("WE") !== -1 && l.indexOf("TH") !== -1 && l.indexOf("FR") !== -1 && l.indexOf("SA") !== -1 && l.indexOf("SU") !== -1
|
|
807
807
|
};
|
|
808
|
-
var c = function(
|
|
809
|
-
return
|
|
808
|
+
var c = function(h, d) {
|
|
809
|
+
return h.weekday - d.weekday;
|
|
810
810
|
};
|
|
811
811
|
this.byweekday.allWeeks.sort(c), this.byweekday.someWeeks.sort(c), this.byweekday.allWeeks.length || (this.byweekday.allWeeks = null), this.byweekday.someWeeks.length || (this.byweekday.someWeeks = null);
|
|
812
812
|
} else
|
|
@@ -817,9 +817,9 @@ var xi = (
|
|
|
817
817
|
if (!(t.options.freq in n.IMPLEMENTED) || t.origOptions.until && t.origOptions.count)
|
|
818
818
|
return !1;
|
|
819
819
|
for (var i in t.origOptions) {
|
|
820
|
-
if (
|
|
820
|
+
if (Oi(["dtstart", "tzid", "wkst", "freq"], i))
|
|
821
821
|
return !0;
|
|
822
|
-
if (!
|
|
822
|
+
if (!Oi(n.IMPLEMENTED[t.options.freq], i))
|
|
823
823
|
return !1;
|
|
824
824
|
}
|
|
825
825
|
return e;
|
|
@@ -829,7 +829,7 @@ var xi = (
|
|
|
829
829
|
var t = this.gettext;
|
|
830
830
|
if (!(this.options.freq in n.IMPLEMENTED))
|
|
831
831
|
return t("RRule error: Unable to fully convert this rrule to text");
|
|
832
|
-
if (this.text = [t("every")], this[
|
|
832
|
+
if (this.text = [t("every")], this[E.FREQUENCIES[this.options.freq]](), this.options.until) {
|
|
833
833
|
this.add(t("until"));
|
|
834
834
|
var e = this.options.until;
|
|
835
835
|
this.add(this.dateFormatter(e.getUTCFullYear(), this.language.monthNames[e.getUTCMonth()], e.getUTCDate()));
|
|
@@ -891,7 +891,7 @@ var xi = (
|
|
|
891
891
|
}, n.prototype.monthtext = function(t) {
|
|
892
892
|
return this.language.monthNames[t - 1];
|
|
893
893
|
}, n.prototype.weekdaytext = function(t) {
|
|
894
|
-
var e =
|
|
894
|
+
var e = kt(t) ? (t + 1) % 7 : t.getJsWeekday();
|
|
895
895
|
return (t.n ? this.nth(t.n) + " " : "") + this.language.dayNames[e];
|
|
896
896
|
}, n.prototype.plural = function(t) {
|
|
897
897
|
return t % 100 !== 1;
|
|
@@ -899,11 +899,11 @@ var xi = (
|
|
|
899
899
|
return this.text.push(" "), this.text.push(t), this;
|
|
900
900
|
}, n.prototype.list = function(t, e, i, s) {
|
|
901
901
|
var r = this;
|
|
902
|
-
s === void 0 && (s = ","),
|
|
903
|
-
var o = function(l, c,
|
|
904
|
-
for (var
|
|
905
|
-
u !== 0 && (u === l.length - 1 ?
|
|
906
|
-
return
|
|
902
|
+
s === void 0 && (s = ","), ft(t) || (t = [t]);
|
|
903
|
+
var o = function(l, c, h) {
|
|
904
|
+
for (var d = "", u = 0; u < l.length; u++)
|
|
905
|
+
u !== 0 && (u === l.length - 1 ? d += " " + h + " " : d += c + " "), d += l[u];
|
|
906
|
+
return d;
|
|
907
907
|
};
|
|
908
908
|
e = e || function(l) {
|
|
909
909
|
return l.toString();
|
|
@@ -914,7 +914,7 @@ var xi = (
|
|
|
914
914
|
return i ? o(t.map(a), s, i) : t.map(a).join(s + " ");
|
|
915
915
|
}, n;
|
|
916
916
|
})()
|
|
917
|
-
),
|
|
917
|
+
), Kn = (
|
|
918
918
|
/** @class */
|
|
919
919
|
(function() {
|
|
920
920
|
function n(t) {
|
|
@@ -961,9 +961,9 @@ var xi = (
|
|
|
961
961
|
}, n;
|
|
962
962
|
})()
|
|
963
963
|
);
|
|
964
|
-
function
|
|
965
|
-
t === void 0 && (t =
|
|
966
|
-
var e = {}, i = new
|
|
964
|
+
function cn(n, t) {
|
|
965
|
+
t === void 0 && (t = $e);
|
|
966
|
+
var e = {}, i = new Kn(t.tokens);
|
|
967
967
|
if (!i.start(n))
|
|
968
968
|
return null;
|
|
969
969
|
return s(), e;
|
|
@@ -974,27 +974,27 @@ function tn(n, t) {
|
|
|
974
974
|
throw new Error("Unexpected end");
|
|
975
975
|
switch (i.symbol) {
|
|
976
976
|
case "day(s)":
|
|
977
|
-
e.freq =
|
|
977
|
+
e.freq = E.DAILY, i.nextSymbol() && (o(), d());
|
|
978
978
|
break;
|
|
979
979
|
// FIXME Note: every 2 weekdays != every two weeks on weekdays.
|
|
980
980
|
// DAILY on weekdays is not a valid rule
|
|
981
981
|
case "weekday(s)":
|
|
982
|
-
e.freq =
|
|
982
|
+
e.freq = E.WEEKLY, e.byweekday = [E.MO, E.TU, E.WE, E.TH, E.FR], i.nextSymbol(), o(), d();
|
|
983
983
|
break;
|
|
984
984
|
case "week(s)":
|
|
985
|
-
e.freq =
|
|
985
|
+
e.freq = E.WEEKLY, i.nextSymbol() && (r(), o(), d());
|
|
986
986
|
break;
|
|
987
987
|
case "hour(s)":
|
|
988
|
-
e.freq =
|
|
988
|
+
e.freq = E.HOURLY, i.nextSymbol() && (r(), d());
|
|
989
989
|
break;
|
|
990
990
|
case "minute(s)":
|
|
991
|
-
e.freq =
|
|
991
|
+
e.freq = E.MINUTELY, i.nextSymbol() && (r(), d());
|
|
992
992
|
break;
|
|
993
993
|
case "month(s)":
|
|
994
|
-
e.freq =
|
|
994
|
+
e.freq = E.MONTHLY, i.nextSymbol() && (r(), d());
|
|
995
995
|
break;
|
|
996
996
|
case "year(s)":
|
|
997
|
-
e.freq =
|
|
997
|
+
e.freq = E.YEARLY, i.nextSymbol() && (r(), d());
|
|
998
998
|
break;
|
|
999
999
|
case "monday":
|
|
1000
1000
|
case "tuesday":
|
|
@@ -1003,9 +1003,9 @@ function tn(n, t) {
|
|
|
1003
1003
|
case "friday":
|
|
1004
1004
|
case "saturday":
|
|
1005
1005
|
case "sunday":
|
|
1006
|
-
e.freq =
|
|
1006
|
+
e.freq = E.WEEKLY;
|
|
1007
1007
|
var f = i.symbol.substr(0, 2).toUpperCase();
|
|
1008
|
-
if (e.byweekday = [
|
|
1008
|
+
if (e.byweekday = [E[f]], !i.nextSymbol())
|
|
1009
1009
|
return;
|
|
1010
1010
|
for (; i.accept("comma"); ) {
|
|
1011
1011
|
if (i.isDone())
|
|
@@ -1013,9 +1013,9 @@ function tn(n, t) {
|
|
|
1013
1013
|
var v = l();
|
|
1014
1014
|
if (!v)
|
|
1015
1015
|
throw new Error("Unexpected symbol " + i.symbol + ", expected weekday");
|
|
1016
|
-
e.byweekday.push(
|
|
1016
|
+
e.byweekday.push(E[v]), i.nextSymbol();
|
|
1017
1017
|
}
|
|
1018
|
-
o(),
|
|
1018
|
+
o(), h(), d();
|
|
1019
1019
|
break;
|
|
1020
1020
|
case "january":
|
|
1021
1021
|
case "february":
|
|
@@ -1029,17 +1029,17 @@ function tn(n, t) {
|
|
|
1029
1029
|
case "october":
|
|
1030
1030
|
case "november":
|
|
1031
1031
|
case "december":
|
|
1032
|
-
if (e.freq =
|
|
1032
|
+
if (e.freq = E.YEARLY, e.bymonth = [a()], !i.nextSymbol())
|
|
1033
1033
|
return;
|
|
1034
1034
|
for (; i.accept("comma"); ) {
|
|
1035
1035
|
if (i.isDone())
|
|
1036
1036
|
throw new Error("Unexpected end");
|
|
1037
|
-
var
|
|
1038
|
-
if (!
|
|
1037
|
+
var p = a();
|
|
1038
|
+
if (!p)
|
|
1039
1039
|
throw new Error("Unexpected symbol " + i.symbol + ", expected month");
|
|
1040
|
-
e.bymonth.push(
|
|
1040
|
+
e.bymonth.push(p), i.nextSymbol();
|
|
1041
1041
|
}
|
|
1042
|
-
r(),
|
|
1042
|
+
r(), d();
|
|
1043
1043
|
break;
|
|
1044
1044
|
default:
|
|
1045
1045
|
throw new Error("Unknown symbol");
|
|
@@ -1049,13 +1049,13 @@ function tn(n, t) {
|
|
|
1049
1049
|
var u = i.accept("on"), f = i.accept("the");
|
|
1050
1050
|
if (u || f)
|
|
1051
1051
|
do {
|
|
1052
|
-
var v = c(),
|
|
1052
|
+
var v = c(), p = l(), g = a();
|
|
1053
1053
|
if (v)
|
|
1054
|
-
|
|
1055
|
-
else if (
|
|
1056
|
-
i.nextSymbol(), e.byweekday || (e.byweekday = []), e.byweekday.push(
|
|
1054
|
+
p ? (i.nextSymbol(), e.byweekday || (e.byweekday = []), e.byweekday.push(E[p].nth(v))) : (e.bymonthday || (e.bymonthday = []), e.bymonthday.push(v), i.accept("day(s)"));
|
|
1055
|
+
else if (p)
|
|
1056
|
+
i.nextSymbol(), e.byweekday || (e.byweekday = []), e.byweekday.push(E[p]);
|
|
1057
1057
|
else if (i.symbol === "weekday(s)")
|
|
1058
|
-
i.nextSymbol(), e.byweekday || (e.byweekday = [
|
|
1058
|
+
i.nextSymbol(), e.byweekday || (e.byweekday = [E.MO, E.TU, E.WE, E.TH, E.FR]);
|
|
1059
1059
|
else if (i.symbol === "week(s)") {
|
|
1060
1060
|
i.nextSymbol();
|
|
1061
1061
|
var y = i.acceptNumber();
|
|
@@ -1066,8 +1066,8 @@ function tn(n, t) {
|
|
|
1066
1066
|
throw new Error("Unexpected symbol " + i.symbol + "; expected monthday");
|
|
1067
1067
|
e.byweekno.push(parseInt(y[0], 10));
|
|
1068
1068
|
}
|
|
1069
|
-
} else if (
|
|
1070
|
-
i.nextSymbol(), e.bymonth || (e.bymonth = []), e.bymonth.push(
|
|
1069
|
+
} else if (g)
|
|
1070
|
+
i.nextSymbol(), e.bymonth || (e.bymonth = []), e.bymonth.push(g);
|
|
1071
1071
|
else
|
|
1072
1072
|
return;
|
|
1073
1073
|
} while (i.accept("comma") || i.accept("the") || i.accept("on"));
|
|
@@ -1149,7 +1149,7 @@ function tn(n, t) {
|
|
|
1149
1149
|
return !1;
|
|
1150
1150
|
}
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1152
|
+
function h() {
|
|
1153
1153
|
i.accept("on"), i.accept("the");
|
|
1154
1154
|
var u = c();
|
|
1155
1155
|
if (u)
|
|
@@ -1159,7 +1159,7 @@ function tn(n, t) {
|
|
|
1159
1159
|
e.bymonthday.push(u), i.nextSymbol();
|
|
1160
1160
|
}
|
|
1161
1161
|
}
|
|
1162
|
-
function
|
|
1162
|
+
function d() {
|
|
1163
1163
|
if (i.symbol === "until") {
|
|
1164
1164
|
var u = Date.parse(i.text);
|
|
1165
1165
|
if (!u)
|
|
@@ -1168,16 +1168,16 @@ function tn(n, t) {
|
|
|
1168
1168
|
} else i.accept("for") && (e.count = parseInt(i.value[0], 10), i.expect("number"));
|
|
1169
1169
|
}
|
|
1170
1170
|
}
|
|
1171
|
-
var
|
|
1171
|
+
var O;
|
|
1172
1172
|
(function(n) {
|
|
1173
1173
|
n[n.YEARLY = 0] = "YEARLY", n[n.MONTHLY = 1] = "MONTHLY", n[n.WEEKLY = 2] = "WEEKLY", n[n.DAILY = 3] = "DAILY", n[n.HOURLY = 4] = "HOURLY", n[n.MINUTELY = 5] = "MINUTELY", n[n.SECONDLY = 6] = "SECONDLY";
|
|
1174
|
-
})(
|
|
1175
|
-
function
|
|
1176
|
-
return n <
|
|
1174
|
+
})(O || (O = {}));
|
|
1175
|
+
function li(n) {
|
|
1176
|
+
return n < O.HOURLY;
|
|
1177
1177
|
}
|
|
1178
|
-
var
|
|
1179
|
-
return t === void 0 && (t =
|
|
1180
|
-
},
|
|
1178
|
+
var Xn = function(n, t) {
|
|
1179
|
+
return t === void 0 && (t = $e), new E(cn(n, t) || void 0);
|
|
1180
|
+
}, oe = [
|
|
1181
1181
|
"count",
|
|
1182
1182
|
"until",
|
|
1183
1183
|
"interval",
|
|
@@ -1185,16 +1185,16 @@ var Wn = function(n, t) {
|
|
|
1185
1185
|
"bymonthday",
|
|
1186
1186
|
"bymonth"
|
|
1187
1187
|
];
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
var
|
|
1196
|
-
return new
|
|
1197
|
-
},
|
|
1188
|
+
At.IMPLEMENTED = [];
|
|
1189
|
+
At.IMPLEMENTED[O.HOURLY] = oe;
|
|
1190
|
+
At.IMPLEMENTED[O.MINUTELY] = oe;
|
|
1191
|
+
At.IMPLEMENTED[O.DAILY] = ["byhour"].concat(oe);
|
|
1192
|
+
At.IMPLEMENTED[O.WEEKLY] = oe;
|
|
1193
|
+
At.IMPLEMENTED[O.MONTHLY] = oe;
|
|
1194
|
+
At.IMPLEMENTED[O.YEARLY] = ["byweekno", "byyearday"].concat(oe);
|
|
1195
|
+
var Zn = function(n, t, e, i) {
|
|
1196
|
+
return new At(n, t, e, i).toString();
|
|
1197
|
+
}, Gn = At.isFullyConvertible, Ae = (
|
|
1198
1198
|
/** @class */
|
|
1199
1199
|
(function() {
|
|
1200
1200
|
function n(t, e, i, s) {
|
|
@@ -1212,10 +1212,10 @@ var zn = function(n, t, e, i) {
|
|
|
1212
1212
|
return (this.hour * 60 * 60 + this.minute * 60 + this.second) * 1e3 + this.millisecond;
|
|
1213
1213
|
}, n;
|
|
1214
1214
|
})()
|
|
1215
|
-
),
|
|
1215
|
+
), Jn = (
|
|
1216
1216
|
/** @class */
|
|
1217
1217
|
(function(n) {
|
|
1218
|
-
|
|
1218
|
+
ai(t, n);
|
|
1219
1219
|
function t(e, i, s, r, o, a, l) {
|
|
1220
1220
|
var c = n.call(this, r, o, a, l) || this;
|
|
1221
1221
|
return c.year = e, c.month = i, c.day = s, c;
|
|
@@ -1223,7 +1223,7 @@ var zn = function(n, t, e, i) {
|
|
|
1223
1223
|
return t.fromDate = function(e) {
|
|
1224
1224
|
return new this(e.getUTCFullYear(), e.getUTCMonth() + 1, e.getUTCDate(), e.getUTCHours(), e.getUTCMinutes(), e.getUTCSeconds(), e.valueOf() % 1e3);
|
|
1225
1225
|
}, t.prototype.getWeekday = function() {
|
|
1226
|
-
return
|
|
1226
|
+
return re(new Date(this.getTime()));
|
|
1227
1227
|
}, t.prototype.getTime = function() {
|
|
1228
1228
|
return new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond)).getTime();
|
|
1229
1229
|
}, t.prototype.getDay = function() {
|
|
@@ -1236,7 +1236,7 @@ var zn = function(n, t, e, i) {
|
|
|
1236
1236
|
this.year += e;
|
|
1237
1237
|
}, t.prototype.addMonths = function(e) {
|
|
1238
1238
|
if (this.month += e, this.month > 12) {
|
|
1239
|
-
var i = Math.floor(this.month / 12), s =
|
|
1239
|
+
var i = Math.floor(this.month / 12), s = gt(this.month, 12);
|
|
1240
1240
|
this.month = s, this.year += i, this.month === 0 && (this.month = 12, --this.year);
|
|
1241
1241
|
}
|
|
1242
1242
|
}, t.prototype.addWeekly = function(e, i) {
|
|
@@ -1246,175 +1246,175 @@ var zn = function(n, t, e, i) {
|
|
|
1246
1246
|
}, t.prototype.addHours = function(e, i, s) {
|
|
1247
1247
|
for (i && (this.hour += Math.floor((23 - this.hour) / e) * e); ; ) {
|
|
1248
1248
|
this.hour += e;
|
|
1249
|
-
var r =
|
|
1250
|
-
if (o && (this.hour = a, this.addDaily(o)),
|
|
1249
|
+
var r = We(this.hour, 24), o = r.div, a = r.mod;
|
|
1250
|
+
if (o && (this.hour = a, this.addDaily(o)), Dt(s) || L(s, this.hour))
|
|
1251
1251
|
break;
|
|
1252
1252
|
}
|
|
1253
1253
|
}, t.prototype.addMinutes = function(e, i, s, r) {
|
|
1254
1254
|
for (i && (this.minute += Math.floor((1439 - (this.hour * 60 + this.minute)) / e) * e); ; ) {
|
|
1255
1255
|
this.minute += e;
|
|
1256
|
-
var o =
|
|
1257
|
-
if (a && (this.minute = l, this.addHours(a, !1, s)), (
|
|
1256
|
+
var o = We(this.minute, 60), a = o.div, l = o.mod;
|
|
1257
|
+
if (a && (this.minute = l, this.addHours(a, !1, s)), (Dt(s) || L(s, this.hour)) && (Dt(r) || L(r, this.minute)))
|
|
1258
1258
|
break;
|
|
1259
1259
|
}
|
|
1260
1260
|
}, t.prototype.addSeconds = function(e, i, s, r, o) {
|
|
1261
1261
|
for (i && (this.second += Math.floor((86399 - (this.hour * 3600 + this.minute * 60 + this.second)) / e) * e); ; ) {
|
|
1262
1262
|
this.second += e;
|
|
1263
|
-
var a =
|
|
1264
|
-
if (l && (this.second = c, this.addMinutes(l, !1, s, r)), (
|
|
1263
|
+
var a = We(this.second, 60), l = a.div, c = a.mod;
|
|
1264
|
+
if (l && (this.second = c, this.addMinutes(l, !1, s, r)), (Dt(s) || L(s, this.hour)) && (Dt(r) || L(r, this.minute)) && (Dt(o) || L(o, this.second)))
|
|
1265
1265
|
break;
|
|
1266
1266
|
}
|
|
1267
1267
|
}, t.prototype.fixDay = function() {
|
|
1268
1268
|
if (!(this.day <= 28)) {
|
|
1269
|
-
var e =
|
|
1269
|
+
var e = Ci(this.year, this.month - 1)[1];
|
|
1270
1270
|
if (!(this.day <= e))
|
|
1271
1271
|
for (; this.day > e; ) {
|
|
1272
|
-
if (this.day -= e, ++this.month, this.month === 13 && (this.month = 1, ++this.year, this.year >
|
|
1272
|
+
if (this.day -= e, ++this.month, this.month === 13 && (this.month = 1, ++this.year, this.year > sn))
|
|
1273
1273
|
return;
|
|
1274
|
-
e =
|
|
1274
|
+
e = Ci(this.year, this.month - 1)[1];
|
|
1275
1275
|
}
|
|
1276
1276
|
}
|
|
1277
1277
|
}, t.prototype.add = function(e, i) {
|
|
1278
1278
|
var s = e.freq, r = e.interval, o = e.wkst, a = e.byhour, l = e.byminute, c = e.bysecond;
|
|
1279
1279
|
switch (s) {
|
|
1280
|
-
case
|
|
1280
|
+
case O.YEARLY:
|
|
1281
1281
|
return this.addYears(r);
|
|
1282
|
-
case
|
|
1282
|
+
case O.MONTHLY:
|
|
1283
1283
|
return this.addMonths(r);
|
|
1284
|
-
case
|
|
1284
|
+
case O.WEEKLY:
|
|
1285
1285
|
return this.addWeekly(r, o);
|
|
1286
|
-
case
|
|
1286
|
+
case O.DAILY:
|
|
1287
1287
|
return this.addDaily(r);
|
|
1288
|
-
case
|
|
1288
|
+
case O.HOURLY:
|
|
1289
1289
|
return this.addHours(r, i, a);
|
|
1290
|
-
case
|
|
1290
|
+
case O.MINUTELY:
|
|
1291
1291
|
return this.addMinutes(r, i, a, l);
|
|
1292
|
-
case
|
|
1292
|
+
case O.SECONDLY:
|
|
1293
1293
|
return this.addSeconds(r, i, a, l, c);
|
|
1294
1294
|
}
|
|
1295
1295
|
}, t;
|
|
1296
|
-
})(
|
|
1296
|
+
})(Ae)
|
|
1297
1297
|
);
|
|
1298
|
-
function
|
|
1298
|
+
function hn(n) {
|
|
1299
1299
|
for (var t = [], e = Object.keys(n), i = 0, s = e; i < s.length; i++) {
|
|
1300
1300
|
var r = s[i];
|
|
1301
|
-
|
|
1301
|
+
L(Ms, r) || t.push(r), on(n[r]) && !ue(n[r]) && t.push(r);
|
|
1302
1302
|
}
|
|
1303
1303
|
if (t.length)
|
|
1304
1304
|
throw new Error("Invalid options: " + t.join(", "));
|
|
1305
|
-
return
|
|
1305
|
+
return pt({}, n);
|
|
1306
1306
|
}
|
|
1307
|
-
function
|
|
1308
|
-
var t =
|
|
1309
|
-
if (
|
|
1307
|
+
function Qn(n) {
|
|
1308
|
+
var t = pt(pt({}, ci), hn(n));
|
|
1309
|
+
if (Z(t.byeaster) && (t.freq = E.YEARLY), !(Z(t.freq) && E.FREQUENCIES[t.freq]))
|
|
1310
1310
|
throw new Error("Invalid frequency: ".concat(t.freq, " ").concat(n.freq));
|
|
1311
|
-
if (t.dtstart || (t.dtstart = new Date((/* @__PURE__ */ new Date()).setMilliseconds(0))),
|
|
1312
|
-
|
|
1311
|
+
if (t.dtstart || (t.dtstart = new Date((/* @__PURE__ */ new Date()).setMilliseconds(0))), Z(t.wkst) ? kt(t.wkst) || (t.wkst = t.wkst.weekday) : t.wkst = E.MO.weekday, Z(t.bysetpos)) {
|
|
1312
|
+
kt(t.bysetpos) && (t.bysetpos = [t.bysetpos]);
|
|
1313
1313
|
for (var e = 0; e < t.bysetpos.length; e++) {
|
|
1314
1314
|
var i = t.bysetpos[e];
|
|
1315
1315
|
if (i === 0 || !(i >= -366 && i <= 366))
|
|
1316
1316
|
throw new Error("bysetpos must be between 1 and 366, or between -366 and -1");
|
|
1317
1317
|
}
|
|
1318
1318
|
}
|
|
1319
|
-
if (!(t.byweekno ||
|
|
1319
|
+
if (!(t.byweekno || et(t.byweekno) || et(t.byyearday) || t.bymonthday || et(t.bymonthday) || Z(t.byweekday) || Z(t.byeaster)))
|
|
1320
1320
|
switch (t.freq) {
|
|
1321
|
-
case
|
|
1321
|
+
case E.YEARLY:
|
|
1322
1322
|
t.bymonth || (t.bymonth = t.dtstart.getUTCMonth() + 1), t.bymonthday = t.dtstart.getUTCDate();
|
|
1323
1323
|
break;
|
|
1324
|
-
case
|
|
1324
|
+
case E.MONTHLY:
|
|
1325
1325
|
t.bymonthday = t.dtstart.getUTCDate();
|
|
1326
1326
|
break;
|
|
1327
|
-
case
|
|
1328
|
-
t.byweekday = [
|
|
1327
|
+
case E.WEEKLY:
|
|
1328
|
+
t.byweekday = [re(t.dtstart)];
|
|
1329
1329
|
break;
|
|
1330
1330
|
}
|
|
1331
|
-
if (
|
|
1331
|
+
if (Z(t.bymonth) && !ft(t.bymonth) && (t.bymonth = [t.bymonth]), Z(t.byyearday) && !ft(t.byyearday) && kt(t.byyearday) && (t.byyearday = [t.byyearday]), !Z(t.bymonthday))
|
|
1332
1332
|
t.bymonthday = [], t.bynmonthday = [];
|
|
1333
|
-
else if (
|
|
1333
|
+
else if (ft(t.bymonthday)) {
|
|
1334
1334
|
for (var s = [], r = [], e = 0; e < t.bymonthday.length; e++) {
|
|
1335
1335
|
var i = t.bymonthday[e];
|
|
1336
1336
|
i > 0 ? s.push(i) : i < 0 && r.push(i);
|
|
1337
1337
|
}
|
|
1338
1338
|
t.bymonthday = s, t.bynmonthday = r;
|
|
1339
1339
|
} else t.bymonthday < 0 ? (t.bynmonthday = [t.bymonthday], t.bymonthday = []) : (t.bynmonthday = [], t.bymonthday = [t.bymonthday]);
|
|
1340
|
-
if (
|
|
1340
|
+
if (Z(t.byweekno) && !ft(t.byweekno) && (t.byweekno = [t.byweekno]), !Z(t.byweekday))
|
|
1341
1341
|
t.bynweekday = null;
|
|
1342
|
-
else if (
|
|
1342
|
+
else if (kt(t.byweekday))
|
|
1343
1343
|
t.byweekday = [t.byweekday], t.bynweekday = null;
|
|
1344
|
-
else if (
|
|
1345
|
-
t.byweekday = [
|
|
1346
|
-
else if (t.byweekday instanceof
|
|
1347
|
-
!t.byweekday.n || t.freq >
|
|
1344
|
+
else if (Di(t.byweekday))
|
|
1345
|
+
t.byweekday = [ct.fromStr(t.byweekday).weekday], t.bynweekday = null;
|
|
1346
|
+
else if (t.byweekday instanceof ct)
|
|
1347
|
+
!t.byweekday.n || t.freq > E.MONTHLY ? (t.byweekday = [t.byweekday.weekday], t.bynweekday = null) : (t.bynweekday = [[t.byweekday.weekday, t.byweekday.n]], t.byweekday = null);
|
|
1348
1348
|
else {
|
|
1349
1349
|
for (var o = [], a = [], e = 0; e < t.byweekday.length; e++) {
|
|
1350
1350
|
var l = t.byweekday[e];
|
|
1351
|
-
if (
|
|
1351
|
+
if (kt(l)) {
|
|
1352
1352
|
o.push(l);
|
|
1353
1353
|
continue;
|
|
1354
|
-
} else if (
|
|
1355
|
-
o.push(
|
|
1354
|
+
} else if (Di(l)) {
|
|
1355
|
+
o.push(ct.fromStr(l).weekday);
|
|
1356
1356
|
continue;
|
|
1357
1357
|
}
|
|
1358
|
-
!l.n || t.freq >
|
|
1358
|
+
!l.n || t.freq > E.MONTHLY ? o.push(l.weekday) : a.push([l.weekday, l.n]);
|
|
1359
1359
|
}
|
|
1360
|
-
t.byweekday =
|
|
1360
|
+
t.byweekday = et(o) ? o : null, t.bynweekday = et(a) ? a : null;
|
|
1361
1361
|
}
|
|
1362
|
-
return
|
|
1362
|
+
return Z(t.byhour) ? kt(t.byhour) && (t.byhour = [t.byhour]) : t.byhour = t.freq < E.HOURLY ? [t.dtstart.getUTCHours()] : null, Z(t.byminute) ? kt(t.byminute) && (t.byminute = [t.byminute]) : t.byminute = t.freq < E.MINUTELY ? [t.dtstart.getUTCMinutes()] : null, Z(t.bysecond) ? kt(t.bysecond) && (t.bysecond = [t.bysecond]) : t.bysecond = t.freq < E.SECONDLY ? [t.dtstart.getUTCSeconds()] : null, { parsedOptions: t };
|
|
1363
1363
|
}
|
|
1364
|
-
function
|
|
1364
|
+
function ts(n) {
|
|
1365
1365
|
var t = n.dtstart.getTime() % 1e3;
|
|
1366
|
-
if (!
|
|
1366
|
+
if (!li(n.freq))
|
|
1367
1367
|
return [];
|
|
1368
1368
|
var e = [];
|
|
1369
1369
|
return n.byhour.forEach(function(i) {
|
|
1370
1370
|
n.byminute.forEach(function(s) {
|
|
1371
1371
|
n.bysecond.forEach(function(r) {
|
|
1372
|
-
e.push(new
|
|
1372
|
+
e.push(new Ae(i, s, r, t));
|
|
1373
1373
|
});
|
|
1374
1374
|
});
|
|
1375
1375
|
}), e;
|
|
1376
1376
|
}
|
|
1377
|
-
function
|
|
1377
|
+
function Ke(n) {
|
|
1378
1378
|
var t = n.split(`
|
|
1379
|
-
`).map(
|
|
1379
|
+
`).map(es).filter(function(e) {
|
|
1380
1380
|
return e !== null;
|
|
1381
1381
|
});
|
|
1382
|
-
return
|
|
1382
|
+
return pt(pt({}, t[0]), t[1]);
|
|
1383
1383
|
}
|
|
1384
|
-
function
|
|
1384
|
+
function Oe(n) {
|
|
1385
1385
|
var t = {}, e = /DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(n);
|
|
1386
1386
|
if (!e)
|
|
1387
1387
|
return t;
|
|
1388
1388
|
var i = e[1], s = e[2];
|
|
1389
|
-
return i && (t.tzid = i), t.dtstart =
|
|
1389
|
+
return i && (t.tzid = i), t.dtstart = oi(s), t;
|
|
1390
1390
|
}
|
|
1391
|
-
function
|
|
1391
|
+
function es(n) {
|
|
1392
1392
|
if (n = n.replace(/^\s+|\s+$/, ""), !n.length)
|
|
1393
1393
|
return null;
|
|
1394
1394
|
var t = /^([A-Z]+?)[:;]/.exec(n.toUpperCase());
|
|
1395
1395
|
if (!t)
|
|
1396
|
-
return
|
|
1396
|
+
return _i(n);
|
|
1397
1397
|
var e = t[1];
|
|
1398
1398
|
switch (e.toUpperCase()) {
|
|
1399
1399
|
case "RRULE":
|
|
1400
1400
|
case "EXRULE":
|
|
1401
|
-
return
|
|
1401
|
+
return _i(n);
|
|
1402
1402
|
case "DTSTART":
|
|
1403
|
-
return
|
|
1403
|
+
return Oe(n);
|
|
1404
1404
|
default:
|
|
1405
1405
|
throw new Error("Unsupported RFC prop ".concat(e, " in ").concat(n));
|
|
1406
1406
|
}
|
|
1407
1407
|
}
|
|
1408
|
-
function
|
|
1409
|
-
var t = n.replace(/^RRULE:/i, ""), e =
|
|
1408
|
+
function _i(n) {
|
|
1409
|
+
var t = n.replace(/^RRULE:/i, ""), e = Oe(t), i = n.replace(/^(?:RRULE|EXRULE):/i, "").split(";");
|
|
1410
1410
|
return i.forEach(function(s) {
|
|
1411
1411
|
var r = s.split("="), o = r[0], a = r[1];
|
|
1412
1412
|
switch (o.toUpperCase()) {
|
|
1413
1413
|
case "FREQ":
|
|
1414
|
-
e.freq =
|
|
1414
|
+
e.freq = O[a.toUpperCase()];
|
|
1415
1415
|
break;
|
|
1416
1416
|
case "WKST":
|
|
1417
|
-
e.wkst =
|
|
1417
|
+
e.wkst = bt[a.toUpperCase()];
|
|
1418
1418
|
break;
|
|
1419
1419
|
case "COUNT":
|
|
1420
1420
|
case "INTERVAL":
|
|
@@ -1426,20 +1426,20 @@ function Ti(n) {
|
|
|
1426
1426
|
case "BYHOUR":
|
|
1427
1427
|
case "BYMINUTE":
|
|
1428
1428
|
case "BYSECOND":
|
|
1429
|
-
var l =
|
|
1429
|
+
var l = is(a), c = o.toLowerCase();
|
|
1430
1430
|
e[c] = l;
|
|
1431
1431
|
break;
|
|
1432
1432
|
case "BYWEEKDAY":
|
|
1433
1433
|
case "BYDAY":
|
|
1434
|
-
e.byweekday =
|
|
1434
|
+
e.byweekday = ns(a);
|
|
1435
1435
|
break;
|
|
1436
1436
|
case "DTSTART":
|
|
1437
1437
|
case "TZID":
|
|
1438
|
-
var
|
|
1439
|
-
e.tzid =
|
|
1438
|
+
var h = Oe(n);
|
|
1439
|
+
e.tzid = h.tzid, e.dtstart = h.dtstart;
|
|
1440
1440
|
break;
|
|
1441
1441
|
case "UNTIL":
|
|
1442
|
-
e.until =
|
|
1442
|
+
e.until = oi(a);
|
|
1443
1443
|
break;
|
|
1444
1444
|
case "BYEASTER":
|
|
1445
1445
|
e.byeaster = Number(a);
|
|
@@ -1449,29 +1449,29 @@ function Ti(n) {
|
|
|
1449
1449
|
}
|
|
1450
1450
|
}), e;
|
|
1451
1451
|
}
|
|
1452
|
-
function
|
|
1452
|
+
function is(n) {
|
|
1453
1453
|
if (n.indexOf(",") !== -1) {
|
|
1454
1454
|
var t = n.split(",");
|
|
1455
|
-
return t.map(
|
|
1455
|
+
return t.map(Ri);
|
|
1456
1456
|
}
|
|
1457
|
-
return
|
|
1457
|
+
return Ri(n);
|
|
1458
1458
|
}
|
|
1459
|
-
function
|
|
1459
|
+
function Ri(n) {
|
|
1460
1460
|
return /^[+-]?\d+$/.test(n) ? Number(n) : n;
|
|
1461
1461
|
}
|
|
1462
|
-
function
|
|
1462
|
+
function ns(n) {
|
|
1463
1463
|
var t = n.split(",");
|
|
1464
1464
|
return t.map(function(e) {
|
|
1465
1465
|
if (e.length === 2)
|
|
1466
|
-
return
|
|
1466
|
+
return bt[e];
|
|
1467
1467
|
var i = e.match(/^([+-]?\d{1,2})([A-Z]{2})$/);
|
|
1468
1468
|
if (!i || i.length < 3)
|
|
1469
1469
|
throw new SyntaxError("Invalid weekday string: ".concat(e));
|
|
1470
|
-
var s = Number(i[1]), r = i[2], o =
|
|
1471
|
-
return new
|
|
1470
|
+
var s = Number(i[1]), r = i[2], o = bt[r].weekday;
|
|
1471
|
+
return new ct(o, s);
|
|
1472
1472
|
});
|
|
1473
1473
|
}
|
|
1474
|
-
var
|
|
1474
|
+
var _e = (
|
|
1475
1475
|
/** @class */
|
|
1476
1476
|
(function() {
|
|
1477
1477
|
function n(t, e) {
|
|
@@ -1486,42 +1486,42 @@ var Te = (
|
|
|
1486
1486
|
enumerable: !1,
|
|
1487
1487
|
configurable: !0
|
|
1488
1488
|
}), n.prototype.toString = function() {
|
|
1489
|
-
var t =
|
|
1489
|
+
var t = ri(this.date.getTime(), this.isUTC);
|
|
1490
1490
|
return this.isUTC ? ":".concat(t) : ";TZID=".concat(this.tzid, ":").concat(t);
|
|
1491
1491
|
}, n.prototype.getTime = function() {
|
|
1492
1492
|
return this.date.getTime();
|
|
1493
1493
|
}, n.prototype.rezonedDate = function() {
|
|
1494
|
-
return this.isUTC ? this.date :
|
|
1494
|
+
return this.isUTC ? this.date : qn(this.date, this.tzid);
|
|
1495
1495
|
}, n;
|
|
1496
1496
|
})()
|
|
1497
1497
|
);
|
|
1498
|
-
function
|
|
1499
|
-
for (var t = [], e = "", i = Object.keys(n), s = Object.keys(
|
|
1500
|
-
if (i[r] !== "tzid" &&
|
|
1498
|
+
function Xe(n) {
|
|
1499
|
+
for (var t = [], e = "", i = Object.keys(n), s = Object.keys(ci), r = 0; r < i.length; r++)
|
|
1500
|
+
if (i[r] !== "tzid" && L(s, i[r])) {
|
|
1501
1501
|
var o = i[r].toUpperCase(), a = n[i[r]], l = "";
|
|
1502
|
-
if (!(!
|
|
1502
|
+
if (!(!Z(a) || ft(a) && !a.length)) {
|
|
1503
1503
|
switch (o) {
|
|
1504
1504
|
case "FREQ":
|
|
1505
|
-
l =
|
|
1505
|
+
l = E.FREQUENCIES[n.freq];
|
|
1506
1506
|
break;
|
|
1507
1507
|
case "WKST":
|
|
1508
|
-
|
|
1508
|
+
kt(a) ? l = new ct(a).toString() : l = a.toString();
|
|
1509
1509
|
break;
|
|
1510
1510
|
case "BYWEEKDAY":
|
|
1511
|
-
o = "BYDAY", l =
|
|
1512
|
-
return f instanceof
|
|
1511
|
+
o = "BYDAY", l = Un(a).map(function(f) {
|
|
1512
|
+
return f instanceof ct ? f : ft(f) ? new ct(f[0], f[1]) : new ct(f);
|
|
1513
1513
|
}).toString();
|
|
1514
1514
|
break;
|
|
1515
1515
|
case "DTSTART":
|
|
1516
|
-
e =
|
|
1516
|
+
e = ss(a, n.tzid);
|
|
1517
1517
|
break;
|
|
1518
1518
|
case "UNTIL":
|
|
1519
|
-
l =
|
|
1519
|
+
l = ri(a, !n.tzid);
|
|
1520
1520
|
break;
|
|
1521
1521
|
default:
|
|
1522
|
-
if (
|
|
1523
|
-
for (var c = [],
|
|
1524
|
-
c[
|
|
1522
|
+
if (ft(a)) {
|
|
1523
|
+
for (var c = [], h = 0; h < a.length; h++)
|
|
1524
|
+
c[h] = String(a[h]);
|
|
1525
1525
|
l = c.toString();
|
|
1526
1526
|
} else
|
|
1527
1527
|
l = String(a);
|
|
@@ -1529,43 +1529,43 @@ function ze(n) {
|
|
|
1529
1529
|
l && t.push([o, l]);
|
|
1530
1530
|
}
|
|
1531
1531
|
}
|
|
1532
|
-
var
|
|
1533
|
-
var v = f[0],
|
|
1534
|
-
return "".concat(v, "=").concat(
|
|
1532
|
+
var d = t.map(function(f) {
|
|
1533
|
+
var v = f[0], p = f[1];
|
|
1534
|
+
return "".concat(v, "=").concat(p.toString());
|
|
1535
1535
|
}).join(";"), u = "";
|
|
1536
|
-
return
|
|
1536
|
+
return d !== "" && (u = "RRULE:".concat(d)), [e, u].filter(function(f) {
|
|
1537
1537
|
return !!f;
|
|
1538
1538
|
}).join(`
|
|
1539
1539
|
`);
|
|
1540
1540
|
}
|
|
1541
|
-
function
|
|
1542
|
-
return n ? "DTSTART" + new
|
|
1541
|
+
function ss(n, t) {
|
|
1542
|
+
return n ? "DTSTART" + new _e(new Date(n), t).toString() : "";
|
|
1543
1543
|
}
|
|
1544
|
-
function
|
|
1544
|
+
function rs(n, t) {
|
|
1545
1545
|
return Array.isArray(n) ? !Array.isArray(t) || n.length !== t.length ? !1 : n.every(function(e, i) {
|
|
1546
1546
|
return e.getTime() === t[i].getTime();
|
|
1547
1547
|
}) : n instanceof Date ? t instanceof Date && n.getTime() === t.getTime() : n === t;
|
|
1548
1548
|
}
|
|
1549
|
-
var
|
|
1549
|
+
var os = (
|
|
1550
1550
|
/** @class */
|
|
1551
1551
|
(function() {
|
|
1552
1552
|
function n() {
|
|
1553
1553
|
this.all = !1, this.before = [], this.after = [], this.between = [];
|
|
1554
1554
|
}
|
|
1555
1555
|
return n.prototype._cacheAdd = function(t, e, i) {
|
|
1556
|
-
e && (e = e instanceof Date ?
|
|
1556
|
+
e && (e = e instanceof Date ? je(e) : Mi(e)), t === "all" ? this.all = e : (i._value = e, this[t].push(i));
|
|
1557
1557
|
}, n.prototype._cacheGet = function(t, e) {
|
|
1558
|
-
var i = !1, s = e ? Object.keys(e) : [], r = function(
|
|
1559
|
-
for (var
|
|
1560
|
-
var u = s[
|
|
1561
|
-
if (!
|
|
1558
|
+
var i = !1, s = e ? Object.keys(e) : [], r = function(h) {
|
|
1559
|
+
for (var d = 0; d < s.length; d++) {
|
|
1560
|
+
var u = s[d];
|
|
1561
|
+
if (!rs(e[u], h[u]))
|
|
1562
1562
|
return !0;
|
|
1563
1563
|
}
|
|
1564
1564
|
return !1;
|
|
1565
1565
|
}, o = this[t];
|
|
1566
1566
|
if (t === "all")
|
|
1567
1567
|
i = this.all;
|
|
1568
|
-
else if (
|
|
1568
|
+
else if (ft(o))
|
|
1569
1569
|
for (var a = 0; a < o.length; a++) {
|
|
1570
1570
|
var l = o[a];
|
|
1571
1571
|
if (!(s.length && r(l))) {
|
|
@@ -1574,99 +1574,99 @@ var Jn = (
|
|
|
1574
1574
|
}
|
|
1575
1575
|
}
|
|
1576
1576
|
if (!i && this.all) {
|
|
1577
|
-
for (var c = new
|
|
1577
|
+
for (var c = new ee(t, e), a = 0; a < this.all.length && c.accept(this.all[a]); a++)
|
|
1578
1578
|
;
|
|
1579
1579
|
i = c.getValue(), this._cacheAdd(t, i, e);
|
|
1580
1580
|
}
|
|
1581
|
-
return
|
|
1581
|
+
return ft(i) ? Mi(i) : i instanceof Date ? je(i) : i;
|
|
1582
1582
|
}, n;
|
|
1583
1583
|
})()
|
|
1584
|
-
),
|
|
1584
|
+
), as = m(m(m(m(m(m(m(m(m(m(m(m(m([], A(1, 31), !0), A(2, 28), !0), A(3, 31), !0), A(4, 30), !0), A(5, 31), !0), A(6, 30), !0), A(7, 31), !0), A(8, 31), !0), A(9, 30), !0), A(10, 31), !0), A(11, 30), !0), A(12, 31), !0), A(1, 7), !0), ls = m(m(m(m(m(m(m(m(m(m(m(m(m([], A(1, 31), !0), A(2, 29), !0), A(3, 31), !0), A(4, 30), !0), A(5, 31), !0), A(6, 30), !0), A(7, 31), !0), A(8, 31), !0), A(9, 30), !0), A(10, 31), !0), A(11, 30), !0), A(12, 31), !0), A(1, 7), !0), cs = Ct(1, 29), hs = Ct(1, 30), Ut = Ct(1, 31), ot = Ct(1, 32), ds = m(m(m(m(m(m(m(m(m(m(m(m(m([], ot, !0), hs, !0), ot, !0), Ut, !0), ot, !0), Ut, !0), ot, !0), ot, !0), Ut, !0), ot, !0), Ut, !0), ot, !0), ot.slice(0, 7), !0), us = m(m(m(m(m(m(m(m(m(m(m(m(m([], ot, !0), cs, !0), ot, !0), Ut, !0), ot, !0), Ut, !0), ot, !0), ot, !0), Ut, !0), ot, !0), Ut, !0), ot, !0), ot.slice(0, 7), !0), fs = Ct(-28, 0), ps = Ct(-29, 0), Lt = Ct(-30, 0), at = Ct(-31, 0), gs = m(m(m(m(m(m(m(m(m(m(m(m(m([], at, !0), ps, !0), at, !0), Lt, !0), at, !0), Lt, !0), at, !0), at, !0), Lt, !0), at, !0), Lt, !0), at, !0), at.slice(0, 7), !0), vs = m(m(m(m(m(m(m(m(m(m(m(m(m([], at, !0), fs, !0), at, !0), Lt, !0), at, !0), Lt, !0), at, !0), at, !0), Lt, !0), at, !0), Lt, !0), at, !0), at.slice(0, 7), !0), ms = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366], ys = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365], Ii = (function() {
|
|
1585
1585
|
for (var n = [], t = 0; t < 55; t++)
|
|
1586
|
-
n = n.concat(
|
|
1586
|
+
n = n.concat(Ct(7));
|
|
1587
1587
|
return n;
|
|
1588
1588
|
})();
|
|
1589
|
-
function
|
|
1590
|
-
var e =
|
|
1591
|
-
if (
|
|
1589
|
+
function bs(n, t) {
|
|
1590
|
+
var e = Xt(n, 1, 1), i = pe(n) ? 366 : 365, s = pe(n + 1) ? 366 : 365, r = qe(e), o = re(e), a = pt(pt({ yearlen: i, nextyearlen: s, yearordinal: r, yearweekday: o }, ws(n)), { wnomask: null });
|
|
1591
|
+
if (Dt(t.byweekno))
|
|
1592
1592
|
return a;
|
|
1593
|
-
a.wnomask =
|
|
1594
|
-
var l, c,
|
|
1595
|
-
|
|
1596
|
-
for (var
|
|
1597
|
-
var
|
|
1598
|
-
if (
|
|
1599
|
-
var
|
|
1600
|
-
|
|
1601
|
-
for (var y = 0; y < 7 && (a.wnomask[
|
|
1593
|
+
a.wnomask = A(0, i + 7);
|
|
1594
|
+
var l, c, h = l = gt(7 - o + t.wkst, 7);
|
|
1595
|
+
h >= 4 ? (h = 0, c = a.yearlen + gt(o - t.wkst, 7)) : c = i - h;
|
|
1596
|
+
for (var d = Math.floor(c / 7), u = gt(c, 7), f = Math.floor(d + u / 4), v = 0; v < t.byweekno.length; v++) {
|
|
1597
|
+
var p = t.byweekno[v];
|
|
1598
|
+
if (p < 0 && (p += f + 1), p > 0 && p <= f) {
|
|
1599
|
+
var g = void 0;
|
|
1600
|
+
p > 1 ? (g = h + (p - 1) * 7, h !== l && (g -= 7 - l)) : g = h;
|
|
1601
|
+
for (var y = 0; y < 7 && (a.wnomask[g] = 1, g++, a.wdaymask[g] !== t.wkst); y++)
|
|
1602
1602
|
;
|
|
1603
1603
|
}
|
|
1604
1604
|
}
|
|
1605
|
-
if (
|
|
1606
|
-
var
|
|
1607
|
-
if (
|
|
1608
|
-
for (var v = 0; v < 7 && (a.wnomask[
|
|
1605
|
+
if (L(t.byweekno, 1)) {
|
|
1606
|
+
var g = h + f * 7;
|
|
1607
|
+
if (h !== l && (g -= 7 - l), g < i)
|
|
1608
|
+
for (var v = 0; v < 7 && (a.wnomask[g] = 1, g += 1, a.wdaymask[g] !== t.wkst); v++)
|
|
1609
1609
|
;
|
|
1610
1610
|
}
|
|
1611
|
-
if (
|
|
1611
|
+
if (h) {
|
|
1612
1612
|
var M = void 0;
|
|
1613
|
-
if (
|
|
1613
|
+
if (L(t.byweekno, -1))
|
|
1614
1614
|
M = -1;
|
|
1615
1615
|
else {
|
|
1616
|
-
var
|
|
1617
|
-
|
|
1616
|
+
var T = re(Xt(n - 1, 1, 1)), x = gt(7 - T.valueOf() + t.wkst, 7), b = pe(n - 1) ? 366 : 365, S = void 0;
|
|
1617
|
+
x >= 4 ? (x = 0, S = b + gt(T - t.wkst, 7)) : S = i - h, M = Math.floor(52 + gt(S, 7) / 4);
|
|
1618
1618
|
}
|
|
1619
|
-
if (
|
|
1620
|
-
for (var
|
|
1621
|
-
a.wnomask[
|
|
1619
|
+
if (L(t.byweekno, M))
|
|
1620
|
+
for (var g = 0; g < h; g++)
|
|
1621
|
+
a.wnomask[g] = 1;
|
|
1622
1622
|
}
|
|
1623
1623
|
return a;
|
|
1624
1624
|
}
|
|
1625
|
-
function
|
|
1626
|
-
var t =
|
|
1625
|
+
function ws(n) {
|
|
1626
|
+
var t = pe(n) ? 366 : 365, e = Xt(n, 1, 1), i = re(e);
|
|
1627
1627
|
return t === 365 ? {
|
|
1628
|
-
mmask:
|
|
1629
|
-
mdaymask:
|
|
1630
|
-
nmdaymask:
|
|
1631
|
-
wdaymask:
|
|
1632
|
-
mrange:
|
|
1628
|
+
mmask: as,
|
|
1629
|
+
mdaymask: us,
|
|
1630
|
+
nmdaymask: vs,
|
|
1631
|
+
wdaymask: Ii.slice(i),
|
|
1632
|
+
mrange: ys
|
|
1633
1633
|
} : {
|
|
1634
|
-
mmask:
|
|
1635
|
-
mdaymask:
|
|
1636
|
-
nmdaymask:
|
|
1637
|
-
wdaymask:
|
|
1638
|
-
mrange:
|
|
1634
|
+
mmask: ls,
|
|
1635
|
+
mdaymask: ds,
|
|
1636
|
+
nmdaymask: gs,
|
|
1637
|
+
wdaymask: Ii.slice(i),
|
|
1638
|
+
mrange: ms
|
|
1639
1639
|
};
|
|
1640
1640
|
}
|
|
1641
|
-
function
|
|
1641
|
+
function Es(n, t, e, i, s, r) {
|
|
1642
1642
|
var o = {
|
|
1643
1643
|
lastyear: n,
|
|
1644
1644
|
lastmonth: t,
|
|
1645
1645
|
nwdaymask: []
|
|
1646
1646
|
}, a = [];
|
|
1647
|
-
if (r.freq ===
|
|
1648
|
-
if (
|
|
1647
|
+
if (r.freq === E.YEARLY)
|
|
1648
|
+
if (Dt(r.bymonth))
|
|
1649
1649
|
a = [[0, e]];
|
|
1650
1650
|
else
|
|
1651
1651
|
for (var l = 0; l < r.bymonth.length; l++)
|
|
1652
1652
|
t = r.bymonth[l], a.push(i.slice(t - 1, t + 1));
|
|
1653
|
-
else r.freq ===
|
|
1654
|
-
if (
|
|
1653
|
+
else r.freq === E.MONTHLY && (a = [i.slice(t - 1, t + 1)]);
|
|
1654
|
+
if (Dt(a))
|
|
1655
1655
|
return o;
|
|
1656
|
-
o.nwdaymask =
|
|
1656
|
+
o.nwdaymask = A(0, e);
|
|
1657
1657
|
for (var l = 0; l < a.length; l++)
|
|
1658
|
-
for (var c = a[l],
|
|
1659
|
-
var f = void 0, v = r.bynweekday[u],
|
|
1660
|
-
|
|
1658
|
+
for (var c = a[l], h = c[0], d = c[1] - 1, u = 0; u < r.bynweekday.length; u++) {
|
|
1659
|
+
var f = void 0, v = r.bynweekday[u], p = v[0], g = v[1];
|
|
1660
|
+
g < 0 ? (f = d + (g + 1) * 7, f -= gt(s[f] - p, 7)) : (f = h + (g - 1) * 7, f += gt(7 - s[f] + p, 7)), h <= f && f <= d && (o.nwdaymask[f] = 1);
|
|
1661
1661
|
}
|
|
1662
1662
|
return o;
|
|
1663
1663
|
}
|
|
1664
|
-
function
|
|
1664
|
+
function xs(n, t) {
|
|
1665
1665
|
t === void 0 && (t = 0);
|
|
1666
|
-
var e = n % 19, i = Math.floor(n / 100), s = n % 100, r = Math.floor(i / 4), o = i % 4, a = Math.floor((i + 8) / 25), l = Math.floor((i - a + 1) / 3), c = Math.floor(19 * e + i - r - l + 15) % 30,
|
|
1667
|
-
return [Math.ceil((
|
|
1666
|
+
var e = n % 19, i = Math.floor(n / 100), s = n % 100, r = Math.floor(i / 4), o = i % 4, a = Math.floor((i + 8) / 25), l = Math.floor((i - a + 1) / 3), c = Math.floor(19 * e + i - r - l + 15) % 30, h = Math.floor(s / 4), d = s % 4, u = Math.floor(32 + 2 * o + 2 * h - c - d) % 7, f = Math.floor((e + 11 * c + 22 * u) / 451), v = Math.floor((c + u - 7 * f + 114) / 31), p = (c + u - 7 * f + 114) % 31 + 1, g = Date.UTC(n, v - 1, p + t), y = Date.UTC(n, 0, 1);
|
|
1667
|
+
return [Math.ceil((g - y) / (1e3 * 60 * 60 * 24))];
|
|
1668
1668
|
}
|
|
1669
|
-
var
|
|
1669
|
+
var Ss = (
|
|
1670
1670
|
/** @class */
|
|
1671
1671
|
(function() {
|
|
1672
1672
|
function n(t) {
|
|
@@ -1674,11 +1674,11 @@ var ps = (
|
|
|
1674
1674
|
}
|
|
1675
1675
|
return n.prototype.rebuild = function(t, e) {
|
|
1676
1676
|
var i = this.options;
|
|
1677
|
-
if (t !== this.lastyear && (this.yearinfo =
|
|
1677
|
+
if (t !== this.lastyear && (this.yearinfo = bs(t, i)), et(i.bynweekday) && (e !== this.lastmonth || t !== this.lastyear)) {
|
|
1678
1678
|
var s = this.yearinfo, r = s.yearlen, o = s.mrange, a = s.wdaymask;
|
|
1679
|
-
this.monthinfo =
|
|
1679
|
+
this.monthinfo = Es(t, e, r, o, a, i);
|
|
1680
1680
|
}
|
|
1681
|
-
|
|
1681
|
+
Z(i.byeaster) && (this.eastermask = xs(t, i.byeaster));
|
|
1682
1682
|
}, Object.defineProperty(n.prototype, "lastyear", {
|
|
1683
1683
|
get: function() {
|
|
1684
1684
|
return this.monthinfo ? this.monthinfo.lastyear : null;
|
|
@@ -1752,143 +1752,143 @@ var ps = (
|
|
|
1752
1752
|
enumerable: !1,
|
|
1753
1753
|
configurable: !0
|
|
1754
1754
|
}), n.prototype.ydayset = function() {
|
|
1755
|
-
return [
|
|
1755
|
+
return [Ct(this.yearlen), 0, this.yearlen];
|
|
1756
1756
|
}, n.prototype.mdayset = function(t, e) {
|
|
1757
|
-
for (var i = this.mrange[e - 1], s = this.mrange[e], r =
|
|
1757
|
+
for (var i = this.mrange[e - 1], s = this.mrange[e], r = A(null, this.yearlen), o = i; o < s; o++)
|
|
1758
1758
|
r[o] = o;
|
|
1759
1759
|
return [r, i, s];
|
|
1760
1760
|
}, n.prototype.wdayset = function(t, e, i) {
|
|
1761
|
-
for (var s =
|
|
1761
|
+
for (var s = A(null, this.yearlen + 7), r = qe(Xt(t, e, i)) - this.yearordinal, o = r, a = 0; a < 7 && (s[r] = r, ++r, this.wdaymask[r] !== this.options.wkst); a++)
|
|
1762
1762
|
;
|
|
1763
1763
|
return [s, o, r];
|
|
1764
1764
|
}, n.prototype.ddayset = function(t, e, i) {
|
|
1765
|
-
var s =
|
|
1765
|
+
var s = A(null, this.yearlen), r = qe(Xt(t, e, i)) - this.yearordinal;
|
|
1766
1766
|
return s[r] = r, [s, r, r + 1];
|
|
1767
1767
|
}, n.prototype.htimeset = function(t, e, i, s) {
|
|
1768
1768
|
var r = this, o = [];
|
|
1769
1769
|
return this.options.byminute.forEach(function(a) {
|
|
1770
1770
|
o = o.concat(r.mtimeset(t, a, i, s));
|
|
1771
|
-
}),
|
|
1771
|
+
}), be(o), o;
|
|
1772
1772
|
}, n.prototype.mtimeset = function(t, e, i, s) {
|
|
1773
1773
|
var r = this.options.bysecond.map(function(o) {
|
|
1774
|
-
return new
|
|
1774
|
+
return new Ae(t, e, o, s);
|
|
1775
1775
|
});
|
|
1776
|
-
return
|
|
1776
|
+
return be(r), r;
|
|
1777
1777
|
}, n.prototype.stimeset = function(t, e, i, s) {
|
|
1778
|
-
return [new
|
|
1778
|
+
return [new Ae(t, e, i, s)];
|
|
1779
1779
|
}, n.prototype.getdayset = function(t) {
|
|
1780
1780
|
switch (t) {
|
|
1781
|
-
case
|
|
1781
|
+
case O.YEARLY:
|
|
1782
1782
|
return this.ydayset.bind(this);
|
|
1783
|
-
case
|
|
1783
|
+
case O.MONTHLY:
|
|
1784
1784
|
return this.mdayset.bind(this);
|
|
1785
|
-
case
|
|
1785
|
+
case O.WEEKLY:
|
|
1786
1786
|
return this.wdayset.bind(this);
|
|
1787
|
-
case
|
|
1787
|
+
case O.DAILY:
|
|
1788
1788
|
return this.ddayset.bind(this);
|
|
1789
1789
|
default:
|
|
1790
1790
|
return this.ddayset.bind(this);
|
|
1791
1791
|
}
|
|
1792
1792
|
}, n.prototype.gettimeset = function(t) {
|
|
1793
1793
|
switch (t) {
|
|
1794
|
-
case
|
|
1794
|
+
case O.HOURLY:
|
|
1795
1795
|
return this.htimeset.bind(this);
|
|
1796
|
-
case
|
|
1796
|
+
case O.MINUTELY:
|
|
1797
1797
|
return this.mtimeset.bind(this);
|
|
1798
|
-
case
|
|
1798
|
+
case O.SECONDLY:
|
|
1799
1799
|
return this.stimeset.bind(this);
|
|
1800
1800
|
}
|
|
1801
1801
|
}, n;
|
|
1802
1802
|
})()
|
|
1803
1803
|
);
|
|
1804
|
-
function
|
|
1804
|
+
function Ts(n, t, e, i, s, r) {
|
|
1805
1805
|
for (var o = [], a = 0; a < n.length; a++) {
|
|
1806
|
-
var l = void 0, c = void 0,
|
|
1807
|
-
|
|
1808
|
-
for (var
|
|
1806
|
+
var l = void 0, c = void 0, h = n[a];
|
|
1807
|
+
h < 0 ? (l = Math.floor(h / t.length), c = gt(h, t.length)) : (l = Math.floor((h - 1) / t.length), c = gt(h - 1, t.length));
|
|
1808
|
+
for (var d = [], u = e; u < i; u++) {
|
|
1809
1809
|
var f = r[u];
|
|
1810
|
-
|
|
1810
|
+
Z(f) && d.push(f);
|
|
1811
1811
|
}
|
|
1812
1812
|
var v = void 0;
|
|
1813
|
-
l < 0 ? v =
|
|
1814
|
-
var
|
|
1815
|
-
|
|
1813
|
+
l < 0 ? v = d.slice(l)[0] : v = d[l];
|
|
1814
|
+
var p = t[c], g = an(s.yearordinal + v), y = ln(g, p);
|
|
1815
|
+
L(o, y) || o.push(y);
|
|
1816
1816
|
}
|
|
1817
|
-
return
|
|
1817
|
+
return be(o), o;
|
|
1818
1818
|
}
|
|
1819
|
-
function
|
|
1819
|
+
function dn(n, t) {
|
|
1820
1820
|
var e = t.dtstart, i = t.freq, s = t.interval, r = t.until, o = t.bysetpos, a = t.count;
|
|
1821
1821
|
if (a === 0 || s === 0)
|
|
1822
|
-
return
|
|
1823
|
-
var l =
|
|
1822
|
+
return $t(n);
|
|
1823
|
+
var l = Jn.fromDate(e), c = new Ss(t);
|
|
1824
1824
|
c.rebuild(l.year, l.month);
|
|
1825
|
-
for (var
|
|
1826
|
-
var
|
|
1827
|
-
if (
|
|
1828
|
-
for (var
|
|
1829
|
-
var M =
|
|
1825
|
+
for (var h = Cs(c, l, t); ; ) {
|
|
1826
|
+
var d = c.getdayset(i)(l.year, l.month, l.day), u = d[0], f = d[1], v = d[2], p = Ds(u, f, v, c, t);
|
|
1827
|
+
if (et(o))
|
|
1828
|
+
for (var g = Ts(o, h, f, v, c, u), y = 0; y < g.length; y++) {
|
|
1829
|
+
var M = g[y];
|
|
1830
1830
|
if (r && M > r)
|
|
1831
|
-
return
|
|
1831
|
+
return $t(n);
|
|
1832
1832
|
if (M >= e) {
|
|
1833
|
-
var
|
|
1834
|
-
if (!n.accept(
|
|
1835
|
-
return
|
|
1833
|
+
var T = Pi(M, t);
|
|
1834
|
+
if (!n.accept(T) || a && (--a, !a))
|
|
1835
|
+
return $t(n);
|
|
1836
1836
|
}
|
|
1837
1837
|
}
|
|
1838
1838
|
else
|
|
1839
1839
|
for (var y = f; y < v; y++) {
|
|
1840
|
-
var
|
|
1841
|
-
if (
|
|
1842
|
-
for (var
|
|
1843
|
-
var
|
|
1840
|
+
var x = u[y];
|
|
1841
|
+
if (Z(x))
|
|
1842
|
+
for (var b = an(c.yearordinal + x), S = 0; S < h.length; S++) {
|
|
1843
|
+
var k = h[S], M = ln(b, k);
|
|
1844
1844
|
if (r && M > r)
|
|
1845
|
-
return
|
|
1845
|
+
return $t(n);
|
|
1846
1846
|
if (M >= e) {
|
|
1847
|
-
var
|
|
1848
|
-
if (!n.accept(
|
|
1849
|
-
return
|
|
1847
|
+
var T = Pi(M, t);
|
|
1848
|
+
if (!n.accept(T) || a && (--a, !a))
|
|
1849
|
+
return $t(n);
|
|
1850
1850
|
}
|
|
1851
1851
|
}
|
|
1852
1852
|
}
|
|
1853
|
-
if (t.interval === 0 || (l.add(t,
|
|
1854
|
-
return
|
|
1855
|
-
|
|
1853
|
+
if (t.interval === 0 || (l.add(t, p), l.year > sn))
|
|
1854
|
+
return $t(n);
|
|
1855
|
+
li(i) || (h = c.gettimeset(i)(l.hour, l.minute, l.second, 0)), c.rebuild(l.year, l.month);
|
|
1856
1856
|
}
|
|
1857
1857
|
}
|
|
1858
|
-
function
|
|
1858
|
+
function ks(n, t, e) {
|
|
1859
1859
|
var i = e.bymonth, s = e.byweekno, r = e.byweekday, o = e.byeaster, a = e.bymonthday, l = e.bynmonthday, c = e.byyearday;
|
|
1860
|
-
return
|
|
1860
|
+
return et(i) && !L(i, n.mmask[t]) || et(s) && !n.wnomask[t] || et(r) && !L(r, n.wdaymask[t]) || et(n.nwdaymask) && !n.nwdaymask[t] || o !== null && !L(n.eastermask, t) || (et(a) || et(l)) && !L(a, n.mdaymask[t]) && !L(l, n.nmdaymask[t]) || et(c) && (t < n.yearlen && !L(c, t + 1) && !L(c, -n.yearlen + t) || t >= n.yearlen && !L(c, t + 1 - n.yearlen) && !L(c, -n.nextyearlen + t - n.yearlen));
|
|
1861
1861
|
}
|
|
1862
|
-
function
|
|
1863
|
-
return new
|
|
1862
|
+
function Pi(n, t) {
|
|
1863
|
+
return new _e(n, t.tzid).rezonedDate();
|
|
1864
1864
|
}
|
|
1865
|
-
function
|
|
1865
|
+
function $t(n) {
|
|
1866
1866
|
return n.getValue();
|
|
1867
1867
|
}
|
|
1868
|
-
function
|
|
1868
|
+
function Ds(n, t, e, i, s) {
|
|
1869
1869
|
for (var r = !1, o = t; o < e; o++) {
|
|
1870
1870
|
var a = n[o];
|
|
1871
|
-
r =
|
|
1871
|
+
r = ks(i, a, s), r && (n[a] = null);
|
|
1872
1872
|
}
|
|
1873
1873
|
return r;
|
|
1874
1874
|
}
|
|
1875
|
-
function
|
|
1875
|
+
function Cs(n, t, e) {
|
|
1876
1876
|
var i = e.freq, s = e.byhour, r = e.byminute, o = e.bysecond;
|
|
1877
|
-
return
|
|
1877
|
+
return li(i) ? ts(e) : i >= E.HOURLY && et(s) && !L(s, t.hour) || i >= E.MINUTELY && et(r) && !L(r, t.minute) || i >= E.SECONDLY && et(o) && !L(o, t.second) ? [] : n.gettimeset(i)(t.hour, t.minute, t.second, t.millisecond);
|
|
1878
1878
|
}
|
|
1879
|
-
var
|
|
1880
|
-
MO: new
|
|
1881
|
-
TU: new
|
|
1882
|
-
WE: new
|
|
1883
|
-
TH: new
|
|
1884
|
-
FR: new
|
|
1885
|
-
SA: new
|
|
1886
|
-
SU: new
|
|
1887
|
-
},
|
|
1888
|
-
freq:
|
|
1879
|
+
var bt = {
|
|
1880
|
+
MO: new ct(0),
|
|
1881
|
+
TU: new ct(1),
|
|
1882
|
+
WE: new ct(2),
|
|
1883
|
+
TH: new ct(3),
|
|
1884
|
+
FR: new ct(4),
|
|
1885
|
+
SA: new ct(5),
|
|
1886
|
+
SU: new ct(6)
|
|
1887
|
+
}, ci = {
|
|
1888
|
+
freq: O.YEARLY,
|
|
1889
1889
|
dtstart: null,
|
|
1890
1890
|
interval: 1,
|
|
1891
|
-
wkst:
|
|
1891
|
+
wkst: bt.MO,
|
|
1892
1892
|
count: null,
|
|
1893
1893
|
until: null,
|
|
1894
1894
|
tzid: null,
|
|
@@ -1904,22 +1904,22 @@ var dt = {
|
|
|
1904
1904
|
byminute: null,
|
|
1905
1905
|
bysecond: null,
|
|
1906
1906
|
byeaster: null
|
|
1907
|
-
},
|
|
1907
|
+
}, Ms = Object.keys(ci), E = (
|
|
1908
1908
|
/** @class */
|
|
1909
1909
|
(function() {
|
|
1910
1910
|
function n(t, e) {
|
|
1911
|
-
t === void 0 && (t = {}), e === void 0 && (e = !1), this._cache = e ? null : new
|
|
1912
|
-
var i =
|
|
1911
|
+
t === void 0 && (t = {}), e === void 0 && (e = !1), this._cache = e ? null : new os(), this.origOptions = hn(t);
|
|
1912
|
+
var i = Qn(t).parsedOptions;
|
|
1913
1913
|
this.options = i;
|
|
1914
1914
|
}
|
|
1915
1915
|
return n.parseText = function(t, e) {
|
|
1916
|
-
return
|
|
1916
|
+
return cn(t, e);
|
|
1917
1917
|
}, n.fromText = function(t, e) {
|
|
1918
|
-
return
|
|
1918
|
+
return Xn(t, e);
|
|
1919
1919
|
}, n.fromString = function(t) {
|
|
1920
1920
|
return new n(n.parseString(t) || void 0);
|
|
1921
1921
|
}, n.prototype._iter = function(t) {
|
|
1922
|
-
return
|
|
1922
|
+
return dn(t, this.options);
|
|
1923
1923
|
}, n.prototype._cacheGet = function(t, e) {
|
|
1924
1924
|
return this._cache ? this._cache._cacheGet(t, e) : !1;
|
|
1925
1925
|
}, n.prototype._cacheAdd = function(t, e, i) {
|
|
@@ -1927,11 +1927,11 @@ var dt = {
|
|
|
1927
1927
|
return this._cache._cacheAdd(t, e, i);
|
|
1928
1928
|
}, n.prototype.all = function(t) {
|
|
1929
1929
|
if (t)
|
|
1930
|
-
return this._iter(new
|
|
1930
|
+
return this._iter(new Ai("all", {}, t));
|
|
1931
1931
|
var e = this._cacheGet("all");
|
|
1932
|
-
return e === !1 && (e = this._iter(new
|
|
1932
|
+
return e === !1 && (e = this._iter(new ee("all", {})), this._cacheAdd("all", e)), e;
|
|
1933
1933
|
}, n.prototype.between = function(t, e, i, s) {
|
|
1934
|
-
if (i === void 0 && (i = !1), !
|
|
1934
|
+
if (i === void 0 && (i = !1), !ue(t) || !ue(e))
|
|
1935
1935
|
throw new Error("Invalid date passed in to RRule.between");
|
|
1936
1936
|
var r = {
|
|
1937
1937
|
before: e,
|
|
@@ -1939,27 +1939,27 @@ var dt = {
|
|
|
1939
1939
|
inc: i
|
|
1940
1940
|
};
|
|
1941
1941
|
if (s)
|
|
1942
|
-
return this._iter(new
|
|
1942
|
+
return this._iter(new Ai("between", r, s));
|
|
1943
1943
|
var o = this._cacheGet("between", r);
|
|
1944
|
-
return o === !1 && (o = this._iter(new
|
|
1944
|
+
return o === !1 && (o = this._iter(new ee("between", r)), this._cacheAdd("between", o, r)), o;
|
|
1945
1945
|
}, n.prototype.before = function(t, e) {
|
|
1946
|
-
if (e === void 0 && (e = !1), !
|
|
1946
|
+
if (e === void 0 && (e = !1), !ue(t))
|
|
1947
1947
|
throw new Error("Invalid date passed in to RRule.before");
|
|
1948
1948
|
var i = { dt: t, inc: e }, s = this._cacheGet("before", i);
|
|
1949
|
-
return s === !1 && (s = this._iter(new
|
|
1949
|
+
return s === !1 && (s = this._iter(new ee("before", i)), this._cacheAdd("before", s, i)), s;
|
|
1950
1950
|
}, n.prototype.after = function(t, e) {
|
|
1951
|
-
if (e === void 0 && (e = !1), !
|
|
1951
|
+
if (e === void 0 && (e = !1), !ue(t))
|
|
1952
1952
|
throw new Error("Invalid date passed in to RRule.after");
|
|
1953
1953
|
var i = { dt: t, inc: e }, s = this._cacheGet("after", i);
|
|
1954
|
-
return s === !1 && (s = this._iter(new
|
|
1954
|
+
return s === !1 && (s = this._iter(new ee("after", i)), this._cacheAdd("after", s, i)), s;
|
|
1955
1955
|
}, n.prototype.count = function() {
|
|
1956
1956
|
return this.all().length;
|
|
1957
1957
|
}, n.prototype.toString = function() {
|
|
1958
|
-
return
|
|
1958
|
+
return Xe(this.origOptions);
|
|
1959
1959
|
}, n.prototype.toText = function(t, e, i) {
|
|
1960
|
-
return
|
|
1960
|
+
return Zn(this, t, e, i);
|
|
1961
1961
|
}, n.prototype.isFullyConvertibleToText = function() {
|
|
1962
|
-
return
|
|
1962
|
+
return Gn(this);
|
|
1963
1963
|
}, n.prototype.clone = function() {
|
|
1964
1964
|
return new n(this.origOptions);
|
|
1965
1965
|
}, n.FREQUENCIES = [
|
|
@@ -1970,20 +1970,20 @@ var dt = {
|
|
|
1970
1970
|
"HOURLY",
|
|
1971
1971
|
"MINUTELY",
|
|
1972
1972
|
"SECONDLY"
|
|
1973
|
-
], n.YEARLY =
|
|
1973
|
+
], n.YEARLY = O.YEARLY, n.MONTHLY = O.MONTHLY, n.WEEKLY = O.WEEKLY, n.DAILY = O.DAILY, n.HOURLY = O.HOURLY, n.MINUTELY = O.MINUTELY, n.SECONDLY = O.SECONDLY, n.MO = bt.MO, n.TU = bt.TU, n.WE = bt.WE, n.TH = bt.TH, n.FR = bt.FR, n.SA = bt.SA, n.SU = bt.SU, n.parseString = Ke, n.optionsToString = Xe, n;
|
|
1974
1974
|
})()
|
|
1975
1975
|
);
|
|
1976
|
-
function
|
|
1976
|
+
function $s(n, t, e, i, s, r) {
|
|
1977
1977
|
var o = {}, a = n.accept;
|
|
1978
1978
|
function l(u, f) {
|
|
1979
1979
|
e.forEach(function(v) {
|
|
1980
|
-
v.between(u, f, !0).forEach(function(
|
|
1981
|
-
o[Number(
|
|
1980
|
+
v.between(u, f, !0).forEach(function(p) {
|
|
1981
|
+
o[Number(p)] = !0;
|
|
1982
1982
|
});
|
|
1983
1983
|
});
|
|
1984
1984
|
}
|
|
1985
1985
|
s.forEach(function(u) {
|
|
1986
|
-
var f = new
|
|
1986
|
+
var f = new _e(u, r).rezonedDate();
|
|
1987
1987
|
o[Number(f)] = !0;
|
|
1988
1988
|
}), n.accept = function(u) {
|
|
1989
1989
|
var f = Number(u);
|
|
@@ -1993,25 +1993,25 @@ function Es(n, t, e, i, s, r) {
|
|
|
1993
1993
|
return o[f] ? !0 : (o[f] = !0, a.call(this, u));
|
|
1994
1994
|
});
|
|
1995
1995
|
for (var c = 0; c < i.length; c++) {
|
|
1996
|
-
var
|
|
1997
|
-
if (!n.accept(new Date(
|
|
1996
|
+
var h = new _e(i[c], r).rezonedDate();
|
|
1997
|
+
if (!n.accept(new Date(h.getTime())))
|
|
1998
1998
|
break;
|
|
1999
1999
|
}
|
|
2000
2000
|
t.forEach(function(u) {
|
|
2001
|
-
|
|
2001
|
+
dn(n, u.options);
|
|
2002
2002
|
});
|
|
2003
|
-
var
|
|
2004
|
-
switch (
|
|
2003
|
+
var d = n._result;
|
|
2004
|
+
switch (be(d), n.method) {
|
|
2005
2005
|
case "all":
|
|
2006
2006
|
case "between":
|
|
2007
|
-
return
|
|
2007
|
+
return d;
|
|
2008
2008
|
case "before":
|
|
2009
|
-
return
|
|
2009
|
+
return d.length && d[d.length - 1] || null;
|
|
2010
2010
|
default:
|
|
2011
|
-
return
|
|
2011
|
+
return d.length && d[0] || null;
|
|
2012
2012
|
}
|
|
2013
2013
|
}
|
|
2014
|
-
var
|
|
2014
|
+
var Hi = {
|
|
2015
2015
|
dtstart: null,
|
|
2016
2016
|
cache: !1,
|
|
2017
2017
|
unfold: !1,
|
|
@@ -2019,29 +2019,29 @@ var Mi = {
|
|
|
2019
2019
|
compatible: !1,
|
|
2020
2020
|
tzid: null
|
|
2021
2021
|
};
|
|
2022
|
-
function
|
|
2023
|
-
var e = [], i = [], s = [], r = [], o =
|
|
2024
|
-
return c.forEach(function(
|
|
2025
|
-
var
|
|
2026
|
-
if (
|
|
2027
|
-
var u =
|
|
2022
|
+
function As(n, t) {
|
|
2023
|
+
var e = [], i = [], s = [], r = [], o = Oe(n), a = o.dtstart, l = o.tzid, c = Ps(n, t.unfold);
|
|
2024
|
+
return c.forEach(function(h) {
|
|
2025
|
+
var d;
|
|
2026
|
+
if (h) {
|
|
2027
|
+
var u = Is(h), f = u.name, v = u.parms, p = u.value;
|
|
2028
2028
|
switch (f.toUpperCase()) {
|
|
2029
2029
|
case "RRULE":
|
|
2030
2030
|
if (v.length)
|
|
2031
2031
|
throw new Error("unsupported RRULE parm: ".concat(v.join(",")));
|
|
2032
|
-
e.push(
|
|
2032
|
+
e.push(Ke(h));
|
|
2033
2033
|
break;
|
|
2034
2034
|
case "RDATE":
|
|
2035
|
-
var
|
|
2036
|
-
y && !l && (l = y), i = i.concat(
|
|
2035
|
+
var g = (d = /RDATE(?:;TZID=([^:=]+))?/i.exec(h)) !== null && d !== void 0 ? d : [], y = g[1];
|
|
2036
|
+
y && !l && (l = y), i = i.concat(Yi(p, v));
|
|
2037
2037
|
break;
|
|
2038
2038
|
case "EXRULE":
|
|
2039
2039
|
if (v.length)
|
|
2040
2040
|
throw new Error("unsupported EXRULE parm: ".concat(v.join(",")));
|
|
2041
|
-
s.push(
|
|
2041
|
+
s.push(Ke(p));
|
|
2042
2042
|
break;
|
|
2043
2043
|
case "EXDATE":
|
|
2044
|
-
r = r.concat(
|
|
2044
|
+
r = r.concat(Yi(p, v));
|
|
2045
2045
|
break;
|
|
2046
2046
|
case "DTSTART":
|
|
2047
2047
|
break;
|
|
@@ -2058,51 +2058,51 @@ function xs(n, t) {
|
|
|
2058
2058
|
exdatevals: r
|
|
2059
2059
|
};
|
|
2060
2060
|
}
|
|
2061
|
-
function
|
|
2062
|
-
var e =
|
|
2061
|
+
function Os(n, t) {
|
|
2062
|
+
var e = As(n, t), i = e.rrulevals, s = e.rdatevals, r = e.exrulevals, o = e.exdatevals, a = e.dtstart, l = e.tzid, c = t.cache === !1;
|
|
2063
2063
|
if (t.compatible && (t.forceset = !0, t.unfold = !0), t.forceset || i.length > 1 || s.length || r.length || o.length) {
|
|
2064
|
-
var
|
|
2065
|
-
return
|
|
2066
|
-
|
|
2064
|
+
var h = new Ys(c);
|
|
2065
|
+
return h.dtstart(a), h.tzid(l || void 0), i.forEach(function(u) {
|
|
2066
|
+
h.rrule(new E(ze(u, a, l), c));
|
|
2067
2067
|
}), s.forEach(function(u) {
|
|
2068
|
-
|
|
2068
|
+
h.rdate(u);
|
|
2069
2069
|
}), r.forEach(function(u) {
|
|
2070
|
-
|
|
2070
|
+
h.exrule(new E(ze(u, a, l), c));
|
|
2071
2071
|
}), o.forEach(function(u) {
|
|
2072
|
-
|
|
2073
|
-
}), t.compatible && t.dtstart &&
|
|
2072
|
+
h.exdate(u);
|
|
2073
|
+
}), t.compatible && t.dtstart && h.rdate(a), h;
|
|
2074
2074
|
}
|
|
2075
|
-
var
|
|
2076
|
-
return new
|
|
2075
|
+
var d = i[0] || {};
|
|
2076
|
+
return new E(ze(d, d.dtstart || t.dtstart || a, d.tzid || t.tzid || l), c);
|
|
2077
2077
|
}
|
|
2078
|
-
function
|
|
2079
|
-
return t === void 0 && (t = {}),
|
|
2078
|
+
function Ze(n, t) {
|
|
2079
|
+
return t === void 0 && (t = {}), Os(n, _s(t));
|
|
2080
2080
|
}
|
|
2081
|
-
function
|
|
2082
|
-
return
|
|
2081
|
+
function ze(n, t, e) {
|
|
2082
|
+
return pt(pt({}, n), { dtstart: t, tzid: e });
|
|
2083
2083
|
}
|
|
2084
|
-
function
|
|
2085
|
-
var t = [], e = Object.keys(n), i = Object.keys(
|
|
2084
|
+
function _s(n) {
|
|
2085
|
+
var t = [], e = Object.keys(n), i = Object.keys(Hi);
|
|
2086
2086
|
if (e.forEach(function(s) {
|
|
2087
|
-
|
|
2087
|
+
L(i, s) || t.push(s);
|
|
2088
2088
|
}), t.length)
|
|
2089
2089
|
throw new Error("Invalid options: " + t.join(", "));
|
|
2090
|
-
return
|
|
2090
|
+
return pt(pt({}, Hi), n);
|
|
2091
2091
|
}
|
|
2092
|
-
function
|
|
2092
|
+
function Rs(n) {
|
|
2093
2093
|
if (n.indexOf(":") === -1)
|
|
2094
2094
|
return {
|
|
2095
2095
|
name: "RRULE",
|
|
2096
2096
|
value: n
|
|
2097
2097
|
};
|
|
2098
|
-
var t =
|
|
2098
|
+
var t = Ln(n, ":", 1), e = t[0], i = t[1];
|
|
2099
2099
|
return {
|
|
2100
2100
|
name: e,
|
|
2101
2101
|
value: i
|
|
2102
2102
|
};
|
|
2103
2103
|
}
|
|
2104
|
-
function
|
|
2105
|
-
var t =
|
|
2104
|
+
function Is(n) {
|
|
2105
|
+
var t = Rs(n), e = t.name, i = t.value, s = e.split(";");
|
|
2106
2106
|
if (!s)
|
|
2107
2107
|
throw new Error("empty property name");
|
|
2108
2108
|
return {
|
|
@@ -2111,7 +2111,7 @@ function Ds(n) {
|
|
|
2111
2111
|
value: i
|
|
2112
2112
|
};
|
|
2113
2113
|
}
|
|
2114
|
-
function
|
|
2114
|
+
function Ps(n, t) {
|
|
2115
2115
|
if (t === void 0 && (t = !1), n = n && n.trim(), !n)
|
|
2116
2116
|
throw new Error("Invalid empty string");
|
|
2117
2117
|
if (!t)
|
|
@@ -2123,18 +2123,18 @@ function Cs(n, t) {
|
|
|
2123
2123
|
}
|
|
2124
2124
|
return e;
|
|
2125
2125
|
}
|
|
2126
|
-
function
|
|
2126
|
+
function Hs(n) {
|
|
2127
2127
|
n.forEach(function(t) {
|
|
2128
2128
|
if (!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))
|
|
2129
2129
|
throw new Error("unsupported RDATE/EXDATE parm: " + t);
|
|
2130
2130
|
});
|
|
2131
2131
|
}
|
|
2132
|
-
function
|
|
2133
|
-
return
|
|
2134
|
-
return
|
|
2132
|
+
function Yi(n, t) {
|
|
2133
|
+
return Hs(t), n.split(",").map(function(e) {
|
|
2134
|
+
return oi(e);
|
|
2135
2135
|
});
|
|
2136
2136
|
}
|
|
2137
|
-
function
|
|
2137
|
+
function Ni(n) {
|
|
2138
2138
|
var t = this;
|
|
2139
2139
|
return function(e) {
|
|
2140
2140
|
if (e !== void 0 && (t["_".concat(n)] = e), t["_".concat(n)] !== void 0)
|
|
@@ -2146,32 +2146,32 @@ function Ai(n) {
|
|
|
2146
2146
|
}
|
|
2147
2147
|
};
|
|
2148
2148
|
}
|
|
2149
|
-
var
|
|
2149
|
+
var Ys = (
|
|
2150
2150
|
/** @class */
|
|
2151
2151
|
(function(n) {
|
|
2152
|
-
|
|
2152
|
+
ai(t, n);
|
|
2153
2153
|
function t(e) {
|
|
2154
2154
|
e === void 0 && (e = !1);
|
|
2155
2155
|
var i = n.call(this, {}, e) || this;
|
|
2156
|
-
return i.dtstart =
|
|
2156
|
+
return i.dtstart = Ni.apply(i, ["dtstart"]), i.tzid = Ni.apply(i, ["tzid"]), i._rrule = [], i._rdate = [], i._exrule = [], i._exdate = [], i;
|
|
2157
2157
|
}
|
|
2158
2158
|
return t.prototype._iter = function(e) {
|
|
2159
|
-
return
|
|
2159
|
+
return $s(e, this._rrule, this._exrule, this._rdate, this._exdate, this.tzid());
|
|
2160
2160
|
}, t.prototype.rrule = function(e) {
|
|
2161
|
-
|
|
2161
|
+
Ui(e, this._rrule);
|
|
2162
2162
|
}, t.prototype.exrule = function(e) {
|
|
2163
|
-
|
|
2163
|
+
Ui(e, this._exrule);
|
|
2164
2164
|
}, t.prototype.rdate = function(e) {
|
|
2165
|
-
|
|
2165
|
+
Li(e, this._rdate);
|
|
2166
2166
|
}, t.prototype.exdate = function(e) {
|
|
2167
|
-
|
|
2167
|
+
Li(e, this._exdate);
|
|
2168
2168
|
}, t.prototype.rrules = function() {
|
|
2169
2169
|
return this._rrule.map(function(e) {
|
|
2170
|
-
return
|
|
2170
|
+
return Ze(e.toString());
|
|
2171
2171
|
});
|
|
2172
2172
|
}, t.prototype.exrules = function() {
|
|
2173
2173
|
return this._exrule.map(function(e) {
|
|
2174
|
-
return
|
|
2174
|
+
return Ze(e.toString());
|
|
2175
2175
|
});
|
|
2176
2176
|
}, t.prototype.rdates = function() {
|
|
2177
2177
|
return this._rdate.map(function(e) {
|
|
@@ -2183,7 +2183,7 @@ var $s = (
|
|
|
2183
2183
|
});
|
|
2184
2184
|
}, t.prototype.valueOf = function() {
|
|
2185
2185
|
var e = [];
|
|
2186
|
-
return !this._rrule.length && this._dtstart && (e = e.concat(
|
|
2186
|
+
return !this._rrule.length && this._dtstart && (e = e.concat(Xe({ dtstart: this._dtstart }))), this._rrule.forEach(function(i) {
|
|
2187
2187
|
e = e.concat(i.toString().split(`
|
|
2188
2188
|
`));
|
|
2189
2189
|
}), this._exrule.forEach(function(i) {
|
|
@@ -2193,7 +2193,7 @@ var $s = (
|
|
|
2193
2193
|
}).filter(function(s) {
|
|
2194
2194
|
return !/^DTSTART/.test(s);
|
|
2195
2195
|
}));
|
|
2196
|
-
}), this._rdate.length && e.push(
|
|
2196
|
+
}), this._rdate.length && e.push(Wi("RDATE", this._rdate, this.tzid())), this._exdate.length && e.push(Wi("EXDATE", this._exdate, this.tzid())), e;
|
|
2197
2197
|
}, t.prototype.toString = function() {
|
|
2198
2198
|
return this.valueOf().join(`
|
|
2199
2199
|
`);
|
|
@@ -2209,25 +2209,25 @@ var $s = (
|
|
|
2209
2209
|
return e.exdate(new Date(i.getTime()));
|
|
2210
2210
|
}), e;
|
|
2211
2211
|
}, t;
|
|
2212
|
-
})(
|
|
2212
|
+
})(E)
|
|
2213
2213
|
);
|
|
2214
|
-
function
|
|
2215
|
-
if (!(n instanceof
|
|
2214
|
+
function Ui(n, t) {
|
|
2215
|
+
if (!(n instanceof E))
|
|
2216
2216
|
throw new TypeError(String(n) + " is not RRule instance");
|
|
2217
|
-
|
|
2217
|
+
L(t.map(String), String(n)) || t.push(n);
|
|
2218
2218
|
}
|
|
2219
|
-
function
|
|
2219
|
+
function Li(n, t) {
|
|
2220
2220
|
if (!(n instanceof Date))
|
|
2221
2221
|
throw new TypeError(String(n) + " is not Date instance");
|
|
2222
|
-
|
|
2222
|
+
L(t.map(Number), Number(n)) || (t.push(n), be(t));
|
|
2223
2223
|
}
|
|
2224
|
-
function
|
|
2224
|
+
function Wi(n, t, e) {
|
|
2225
2225
|
var i = !e || e.toUpperCase() === "UTC", s = i ? "".concat(n, ":") : "".concat(n, ";TZID=").concat(e, ":"), r = t.map(function(o) {
|
|
2226
|
-
return
|
|
2226
|
+
return ri(o.valueOf(), i);
|
|
2227
2227
|
}).join(",");
|
|
2228
2228
|
return "".concat(s).concat(r);
|
|
2229
2229
|
}
|
|
2230
|
-
const
|
|
2230
|
+
const Ns = [
|
|
2231
2231
|
{ label: "At time of event", value: 0 },
|
|
2232
2232
|
{ label: "5 minutes before", value: 5 },
|
|
2233
2233
|
{ label: "15 minutes before", value: 15 },
|
|
@@ -2235,10 +2235,10 @@ const As = [
|
|
|
2235
2235
|
{ label: "1 hour before", value: 60 },
|
|
2236
2236
|
{ label: "2 hours before", value: 120 },
|
|
2237
2237
|
{ label: "1 day before", value: 1440 }
|
|
2238
|
-
],
|
|
2239
|
-
class
|
|
2238
|
+
], Us = 12, Ls = 12, Ws = 96;
|
|
2239
|
+
class Y {
|
|
2240
2240
|
constructor(t) {
|
|
2241
|
-
this.startDate = /* @__PURE__ */ new Date(), this.endDate =
|
|
2241
|
+
this.startDate = /* @__PURE__ */ new Date(), this.endDate = Y.addDays(/* @__PURE__ */ new Date(), 182), this.weekStart = 0, this.filter = "", this.calendarEvents = /* @__PURE__ */ new Map(), this.selectedEvents = /* @__PURE__ */ new Set(), this.enabledCalendars = /* @__PURE__ */ new Set(), this.lockedCalendars = /* @__PURE__ */ new Set(), this.sync = (i, s, r) => {
|
|
2242
2242
|
const o = [];
|
|
2243
2243
|
for (const l of r) {
|
|
2244
2244
|
const c = {
|
|
@@ -2254,7 +2254,7 @@ class N {
|
|
|
2254
2254
|
return this.storage?.sync(o, a).catch((l) => {
|
|
2255
2255
|
console.error("Failed to persist events:", l);
|
|
2256
2256
|
}), o;
|
|
2257
|
-
}, this.locale = t?.locale || navigator.language, this.weekStart = t?.weekStart ||
|
|
2257
|
+
}, this.locale = t?.locale || navigator.language, this.weekStart = t?.weekStart || Y.getWeekStartFromLocale(this.locale), this.startDate = this.getStartOfWeek(Y.addDays(/* @__PURE__ */ new Date(), -182));
|
|
2258
2258
|
const e = {
|
|
2259
2259
|
start: (i) => {
|
|
2260
2260
|
this.controller = i;
|
|
@@ -2295,16 +2295,16 @@ class N {
|
|
|
2295
2295
|
if (!t.rrule)
|
|
2296
2296
|
return [t];
|
|
2297
2297
|
try {
|
|
2298
|
-
const e = t.start, i = e.getUTCFullYear(), s = String(e.getUTCMonth() + 1).padStart(2, "0"), r = String(e.getUTCDate()).padStart(2, "0"), o = String(e.getUTCHours()).padStart(2, "0"), a = String(e.getUTCMinutes()).padStart(2, "0"), l = String(e.getUTCSeconds()).padStart(2, "0"),
|
|
2299
|
-
RRULE:${t.rrule}`,
|
|
2298
|
+
const e = t.start, i = e.getUTCFullYear(), s = String(e.getUTCMonth() + 1).padStart(2, "0"), r = String(e.getUTCDate()).padStart(2, "0"), o = String(e.getUTCHours()).padStart(2, "0"), a = String(e.getUTCMinutes()).padStart(2, "0"), l = String(e.getUTCSeconds()).padStart(2, "0"), h = `DTSTART:${`${i}${s}${r}T${o}${a}${l}Z`}
|
|
2299
|
+
RRULE:${t.rrule}`, d = Ze(h), u = /* @__PURE__ */ new Date();
|
|
2300
2300
|
u.setFullYear(u.getFullYear() - 2);
|
|
2301
2301
|
const f = /* @__PURE__ */ new Date();
|
|
2302
|
-
return f.setFullYear(f.getFullYear() + 2),
|
|
2303
|
-
const
|
|
2302
|
+
return f.setFullYear(f.getFullYear() + 2), d.between(u, f, !0).map((p) => {
|
|
2303
|
+
const g = t.end.getTime() - t.start.getTime(), y = new Date(p.getTime() + g);
|
|
2304
2304
|
return {
|
|
2305
2305
|
...t,
|
|
2306
|
-
id: `${t.id}-${
|
|
2307
|
-
start:
|
|
2306
|
+
id: `${t.id}-${p.getTime()}`,
|
|
2307
|
+
start: p,
|
|
2308
2308
|
end: y
|
|
2309
2309
|
};
|
|
2310
2310
|
});
|
|
@@ -2429,10 +2429,10 @@ RRULE:${t.rrule}`, h = Fe(d), u = /* @__PURE__ */ new Date();
|
|
|
2429
2429
|
for (; s < e; ) {
|
|
2430
2430
|
const r = [];
|
|
2431
2431
|
for (let l = 0; l < 7; l++)
|
|
2432
|
-
r.push(new Date(s)), s =
|
|
2432
|
+
r.push(new Date(s)), s = Y.addDays(s, 1);
|
|
2433
2433
|
const o = r[0], a = r[3];
|
|
2434
2434
|
o && a && i.push({
|
|
2435
|
-
weekNumber:
|
|
2435
|
+
weekNumber: Y.getWeekNumber(o),
|
|
2436
2436
|
year: a.getFullYear(),
|
|
2437
2437
|
// Use Thursday for year
|
|
2438
2438
|
days: r,
|
|
@@ -2444,17 +2444,17 @@ RRULE:${t.rrule}`, h = Fe(d), u = /* @__PURE__ */ new Date();
|
|
|
2444
2444
|
}
|
|
2445
2445
|
// Extends the date range and returns new weeks added
|
|
2446
2446
|
extendRange(t) {
|
|
2447
|
-
const e =
|
|
2447
|
+
const e = Ls, i = [];
|
|
2448
2448
|
if (t === "past") {
|
|
2449
|
-
const s =
|
|
2449
|
+
const s = Y.addDays(this.startDate, -e * 7);
|
|
2450
2450
|
let r = new Date(s);
|
|
2451
2451
|
for (; r < this.startDate; ) {
|
|
2452
2452
|
const o = [];
|
|
2453
2453
|
for (let c = 0; c < 7; c++)
|
|
2454
|
-
o.push(new Date(r)), r =
|
|
2454
|
+
o.push(new Date(r)), r = Y.addDays(r, 1);
|
|
2455
2455
|
const a = o[0], l = o[3];
|
|
2456
2456
|
a && l && i.push({
|
|
2457
|
-
weekNumber:
|
|
2457
|
+
weekNumber: Y.getWeekNumber(a),
|
|
2458
2458
|
year: l.getFullYear(),
|
|
2459
2459
|
days: o,
|
|
2460
2460
|
yOffset: 0,
|
|
@@ -2463,15 +2463,15 @@ RRULE:${t.rrule}`, h = Fe(d), u = /* @__PURE__ */ new Date();
|
|
|
2463
2463
|
}
|
|
2464
2464
|
this.startDate = s;
|
|
2465
2465
|
} else {
|
|
2466
|
-
const s =
|
|
2466
|
+
const s = Y.addDays(this.endDate, e * 7);
|
|
2467
2467
|
let r = new Date(this.endDate);
|
|
2468
2468
|
for (; r < s; ) {
|
|
2469
2469
|
const o = [];
|
|
2470
2470
|
for (let c = 0; c < 7; c++)
|
|
2471
|
-
o.push(new Date(r)), r =
|
|
2471
|
+
o.push(new Date(r)), r = Y.addDays(r, 1);
|
|
2472
2472
|
const a = o[0], l = o[3];
|
|
2473
2473
|
a && l && i.push({
|
|
2474
|
-
weekNumber:
|
|
2474
|
+
weekNumber: Y.getWeekNumber(a),
|
|
2475
2475
|
year: l.getFullYear(),
|
|
2476
2476
|
days: o,
|
|
2477
2477
|
yOffset: 0,
|
|
@@ -2483,18 +2483,18 @@ RRULE:${t.rrule}`, h = Fe(d), u = /* @__PURE__ */ new Date();
|
|
|
2483
2483
|
return i;
|
|
2484
2484
|
}
|
|
2485
2485
|
getBufferWeeks() {
|
|
2486
|
-
return
|
|
2486
|
+
return Us;
|
|
2487
2487
|
}
|
|
2488
2488
|
getMaxWeeks() {
|
|
2489
|
-
return
|
|
2489
|
+
return Ws;
|
|
2490
2490
|
}
|
|
2491
2491
|
trimRange(t, e) {
|
|
2492
|
-
t === "past" ? this.startDate =
|
|
2492
|
+
t === "past" ? this.startDate = Y.addDays(this.startDate, -e * 7) : this.endDate = Y.addDays(this.endDate, -e * 7);
|
|
2493
2493
|
}
|
|
2494
2494
|
// Resets the range to be centered around the target date
|
|
2495
2495
|
resetRangeAroundDate(t) {
|
|
2496
2496
|
const e = new Date(t);
|
|
2497
|
-
return e.setHours(0, 0, 0, 0), this.startDate = this.getStartOfWeek(
|
|
2497
|
+
return e.setHours(0, 0, 0, 0), this.startDate = this.getStartOfWeek(Y.addDays(e, -182)), this.endDate = Y.addDays(e, 182), this.generateWeeks();
|
|
2498
2498
|
}
|
|
2499
2499
|
getWeekdayNames() {
|
|
2500
2500
|
const t = new Intl.DateTimeFormat(this.locale, { weekday: "short" }), e = [];
|
|
@@ -2529,26 +2529,26 @@ RRULE:${t.rrule}`, h = Fe(d), u = /* @__PURE__ */ new Date();
|
|
|
2529
2529
|
}
|
|
2530
2530
|
// Returns timestamp for end of day using pure math (no Date object creation)
|
|
2531
2531
|
static endOfDayTime(t) {
|
|
2532
|
-
return t ?
|
|
2532
|
+
return t ? Y.startOfDayTime(t) + 864e5 - 1 : 0;
|
|
2533
2533
|
}
|
|
2534
2534
|
static getWeekStartFromLocale(t) {
|
|
2535
2535
|
const e = ["en-US", "en-CA", "ja-JP", "ko-KR", "zh-TW"], i = t.split("-")[0];
|
|
2536
2536
|
return e.includes(t) || i === "he" || i === "ar" ? 0 : 1;
|
|
2537
2537
|
}
|
|
2538
2538
|
}
|
|
2539
|
-
function
|
|
2539
|
+
function Ge(n) {
|
|
2540
2540
|
return [
|
|
2541
2541
|
parseInt(`${n[1]}${n[2]}`, 16),
|
|
2542
2542
|
parseInt(`${n[3]}${n[4]}`, 16),
|
|
2543
2543
|
parseInt(`${n[5]}${n[6]}`, 16)
|
|
2544
2544
|
];
|
|
2545
2545
|
}
|
|
2546
|
-
function
|
|
2546
|
+
function zs([n, t, e]) {
|
|
2547
2547
|
n /= 255, t /= 255, e /= 255;
|
|
2548
2548
|
let i = Math.min(n, t, e), s = Math.max(n, t, e), r = s - i, o = 0, a = 0, l = 0;
|
|
2549
2549
|
return r === 0 ? o = 0 : s === n ? o = (t - e) / r % 6 : s === t ? o = (e - n) / r + 2 : o = (n - t) / r + 4, o = Math.round(o * 60), o < 0 && (o += 360), l = (s + i) / 2, a = r === 0 ? 0 : r / (1 - Math.abs(2 * l - 1)), a = +(a * 100).toFixed(1), l = +(l * 100).toFixed(1), [o, a, l];
|
|
2550
2550
|
}
|
|
2551
|
-
const
|
|
2551
|
+
const hi = {
|
|
2552
2552
|
dark: {
|
|
2553
2553
|
name: "dark",
|
|
2554
2554
|
label: "Dark",
|
|
@@ -2563,7 +2563,7 @@ const ii = {
|
|
|
2563
2563
|
"--bg-button-active": "rgba(255, 255, 255, 0.1)",
|
|
2564
2564
|
"--bg-today": "rgba(255, 255, 255, 0.05)",
|
|
2565
2565
|
"--bg-selection": "rgba(255, 255, 255, 0.1)",
|
|
2566
|
-
"--bg-weekend": "
|
|
2566
|
+
"--bg-weekend": "transparent",
|
|
2567
2567
|
"--bg-item": "rgba(255, 255, 255, 0.05)",
|
|
2568
2568
|
"--bg-item-hover": "rgba(255, 255, 255, 0.08)",
|
|
2569
2569
|
"--grid-color": "rgba(255, 255, 255, 0.1)",
|
|
@@ -2599,7 +2599,7 @@ const ii = {
|
|
|
2599
2599
|
"--bg-button-active": "rgba(0, 0, 0, 0.08)",
|
|
2600
2600
|
"--bg-today": "rgba(0, 100, 255, 0.08)",
|
|
2601
2601
|
"--bg-selection": "rgba(0, 100, 255, 0.15)",
|
|
2602
|
-
"--bg-weekend": "
|
|
2602
|
+
"--bg-weekend": "transparent",
|
|
2603
2603
|
"--bg-item": "rgba(0, 0, 0, 0.03)",
|
|
2604
2604
|
"--bg-item-hover": "rgba(0, 0, 0, 0.06)",
|
|
2605
2605
|
"--grid-color": "rgba(0, 0, 0, 0.08)",
|
|
@@ -2635,7 +2635,7 @@ const ii = {
|
|
|
2635
2635
|
"--bg-button-active": "rgba(255, 255, 255, 0.1)",
|
|
2636
2636
|
"--bg-today": "rgba(181, 137, 0, 0.15)",
|
|
2637
2637
|
"--bg-selection": "rgba(181, 137, 0, 0.25)",
|
|
2638
|
-
"--bg-weekend": "
|
|
2638
|
+
"--bg-weekend": "transparent",
|
|
2639
2639
|
"--bg-item": "rgba(255, 255, 255, 0.05)",
|
|
2640
2640
|
"--bg-item-hover": "rgba(255, 255, 255, 0.08)",
|
|
2641
2641
|
"--grid-color": "rgba(131, 148, 150, 0.2)",
|
|
@@ -2671,7 +2671,7 @@ const ii = {
|
|
|
2671
2671
|
"--bg-button-active": "rgb(60, 60, 60)",
|
|
2672
2672
|
"--bg-today": "rgb(30, 30, 30)",
|
|
2673
2673
|
"--bg-selection": "rgb(255, 255, 0)",
|
|
2674
|
-
"--bg-weekend": "
|
|
2674
|
+
"--bg-weekend": "transparent",
|
|
2675
2675
|
"--bg-item": "rgb(20, 20, 20)",
|
|
2676
2676
|
"--bg-item-hover": "rgb(40, 40, 40)",
|
|
2677
2677
|
"--grid-color": "rgb(80, 80, 80)",
|
|
@@ -2694,78 +2694,78 @@ const ii = {
|
|
|
2694
2694
|
}
|
|
2695
2695
|
}
|
|
2696
2696
|
};
|
|
2697
|
-
function
|
|
2697
|
+
function Fs() {
|
|
2698
2698
|
return window.matchMedia?.("(prefers-color-scheme: dark)")?.matches ? "dark" : "light";
|
|
2699
2699
|
}
|
|
2700
|
-
function
|
|
2701
|
-
return n === "auto" ?
|
|
2700
|
+
function Bs(n) {
|
|
2701
|
+
return n === "auto" ? Fs() : n;
|
|
2702
2702
|
}
|
|
2703
|
-
function
|
|
2703
|
+
function qs(n) {
|
|
2704
2704
|
const t = document.querySelector('meta[name="theme-color"]');
|
|
2705
2705
|
t && t.setAttribute("content", n);
|
|
2706
2706
|
}
|
|
2707
|
-
function
|
|
2708
|
-
const e =
|
|
2707
|
+
function js(n, t = document.body) {
|
|
2708
|
+
const e = Bs(n), i = hi[e];
|
|
2709
2709
|
if (i) {
|
|
2710
2710
|
for (const [s, r] of Object.entries(i.variables))
|
|
2711
2711
|
t.style.setProperty(s, r);
|
|
2712
|
-
t.setAttribute("data-theme", e),
|
|
2712
|
+
t.setAttribute("data-theme", e), qs(i.variables["--bg-primary"]);
|
|
2713
2713
|
}
|
|
2714
2714
|
}
|
|
2715
|
-
function
|
|
2715
|
+
function Vs(n) {
|
|
2716
2716
|
localStorage.setItem("calendar-theme", n);
|
|
2717
2717
|
}
|
|
2718
|
-
function
|
|
2718
|
+
function Ks() {
|
|
2719
2719
|
const n = localStorage.getItem("calendar-theme");
|
|
2720
|
-
return n && (n in
|
|
2720
|
+
return n && (n in hi || n === "auto") ? n : "auto";
|
|
2721
2721
|
}
|
|
2722
|
-
const
|
|
2722
|
+
const Xs = [
|
|
2723
2723
|
{ name: "auto", label: "Auto" },
|
|
2724
|
-
...Object.values(
|
|
2724
|
+
...Object.values(hi).map((n) => ({
|
|
2725
2725
|
name: n.name,
|
|
2726
2726
|
label: n.label
|
|
2727
2727
|
}))
|
|
2728
2728
|
];
|
|
2729
|
-
function
|
|
2729
|
+
function zi(n) {
|
|
2730
2730
|
const t = n.getFullYear(), e = String(n.getMonth() + 1).padStart(2, "0"), i = String(n.getDate()).padStart(2, "0"), s = String(n.getHours()).padStart(2, "0"), r = String(n.getMinutes()).padStart(2, "0"), o = String(n.getSeconds()).padStart(2, "0");
|
|
2731
2731
|
return `${t}${e}${i}T${s}${r}${o}`;
|
|
2732
2732
|
}
|
|
2733
|
-
function
|
|
2733
|
+
function Fi(n) {
|
|
2734
2734
|
const t = n.getFullYear(), e = String(n.getMonth() + 1).padStart(2, "0"), i = String(n.getDate()).padStart(2, "0");
|
|
2735
2735
|
return `${t}${e}${i}`;
|
|
2736
2736
|
}
|
|
2737
|
-
function
|
|
2737
|
+
function Bi(n) {
|
|
2738
2738
|
const t = [
|
|
2739
2739
|
"BEGIN:VCALENDAR",
|
|
2740
2740
|
"VERSION:2.0",
|
|
2741
2741
|
"PRODID:-//Calendar//EN"
|
|
2742
2742
|
];
|
|
2743
2743
|
for (const e of n)
|
|
2744
|
-
t.push("BEGIN:VEVENT"), t.push(`UID:${e.id}`), t.push(`SUMMARY:${e.title}`), e.isAllDay ? (t.push(`DTSTART;VALUE=DATE:${
|
|
2744
|
+
t.push("BEGIN:VEVENT"), t.push(`UID:${e.id}`), t.push(`SUMMARY:${e.title}`), e.isAllDay ? (t.push(`DTSTART;VALUE=DATE:${Fi(e.start)}`), t.push(`DTEND;VALUE=DATE:${Fi(e.end)}`)) : (t.push(`DTSTART:${zi(e.start)}`), t.push(`DTEND:${zi(e.end)}`)), e.description && t.push(`DESCRIPTION:${e.description}`), e.location && t.push(`LOCATION:${e.location}`), e.url && t.push(`URL:${e.url}`), t.push("END:VEVENT");
|
|
2745
2745
|
return t.push("END:VCALENDAR"), t.join(`\r
|
|
2746
2746
|
`);
|
|
2747
2747
|
}
|
|
2748
|
-
const
|
|
2749
|
-
let
|
|
2750
|
-
function
|
|
2751
|
-
|
|
2748
|
+
const Je = [];
|
|
2749
|
+
let ge = null;
|
|
2750
|
+
function qt(n) {
|
|
2751
|
+
Je.push({
|
|
2752
2752
|
text: n,
|
|
2753
2753
|
timestamp: Date.now()
|
|
2754
|
-
}),
|
|
2754
|
+
}), ge && ge.processQueue();
|
|
2755
2755
|
}
|
|
2756
|
-
const
|
|
2756
|
+
const Re = class Re extends ie {
|
|
2757
2757
|
constructor() {
|
|
2758
2758
|
super(...arguments), this.currentMessage = "", this.isShowing = !1, this.timeoutId = null;
|
|
2759
2759
|
}
|
|
2760
2760
|
connectedCallback() {
|
|
2761
|
-
super.connectedCallback(),
|
|
2761
|
+
super.connectedCallback(), ge = this, this.processQueue();
|
|
2762
2762
|
}
|
|
2763
2763
|
disconnectedCallback() {
|
|
2764
|
-
super.disconnectedCallback(),
|
|
2764
|
+
super.disconnectedCallback(), ge === this && (ge = null), this.timeoutId !== null && clearTimeout(this.timeoutId);
|
|
2765
2765
|
}
|
|
2766
2766
|
processQueue() {
|
|
2767
|
-
if (this.isShowing ||
|
|
2768
|
-
const t =
|
|
2767
|
+
if (this.isShowing || Je.length === 0) return;
|
|
2768
|
+
const t = Je.shift();
|
|
2769
2769
|
t && (this.currentMessage = t.text, this.isShowing = !0, this.requestUpdate(), this.timeoutId = window.setTimeout(() => {
|
|
2770
2770
|
this.hideMessage();
|
|
2771
2771
|
}, 2e3));
|
|
@@ -2777,10 +2777,10 @@ const ke = class ke extends Kt {
|
|
|
2777
2777
|
}, 200));
|
|
2778
2778
|
}
|
|
2779
2779
|
render() {
|
|
2780
|
-
return !this.isShowing || !this.currentMessage ?
|
|
2780
|
+
return !this.isShowing || !this.currentMessage ? $`` : $`<div class="message">${this.currentMessage}</div>`;
|
|
2781
2781
|
}
|
|
2782
2782
|
};
|
|
2783
|
-
|
|
2783
|
+
Re.styles = Zi`
|
|
2784
2784
|
:host {
|
|
2785
2785
|
display: block;
|
|
2786
2786
|
position: relative;
|
|
@@ -2810,17 +2810,17 @@ ke.styles = zi`
|
|
|
2810
2810
|
opacity: 0;
|
|
2811
2811
|
}
|
|
2812
2812
|
}
|
|
2813
|
-
`,
|
|
2813
|
+
`, Re.properties = {
|
|
2814
2814
|
currentMessage: { type: String },
|
|
2815
2815
|
isShowing: { type: Boolean }
|
|
2816
2816
|
};
|
|
2817
|
-
let
|
|
2817
|
+
let Qe = Re;
|
|
2818
2818
|
try {
|
|
2819
|
-
customElements.define("status-message",
|
|
2819
|
+
customElements.define("status-message", Qe);
|
|
2820
2820
|
} catch (n) {
|
|
2821
2821
|
console.error("Failed to register custom element:", n);
|
|
2822
2822
|
}
|
|
2823
|
-
class
|
|
2823
|
+
class Zs {
|
|
2824
2824
|
constructor() {
|
|
2825
2825
|
this.dbName = "calendar-events", this.storeName = "events", this.metadataStoreName = "metadata", this.version = 8;
|
|
2826
2826
|
}
|
|
@@ -2865,12 +2865,12 @@ class zs {
|
|
|
2865
2865
|
async queryEvents(t, e) {
|
|
2866
2866
|
const i = await this.open();
|
|
2867
2867
|
return new Promise((s, r) => {
|
|
2868
|
-
const l = i.transaction(this.storeName, "readonly").objectStore(this.storeName).index("start"), c = t.toISOString(),
|
|
2868
|
+
const l = i.transaction(this.storeName, "readonly").objectStore(this.storeName).index("start"), c = t.toISOString(), h = e.toISOString(), d = IDBKeyRange.upperBound(h), u = l.getAll(d);
|
|
2869
2869
|
u.onerror = () => {
|
|
2870
2870
|
r(new Error(`Failed to query events: ${u.error?.message}`));
|
|
2871
2871
|
}, u.onsuccess = () => {
|
|
2872
|
-
const
|
|
2873
|
-
s(
|
|
2872
|
+
const p = u.result.filter((g) => g.end >= c).map((g) => this.deserializeEvent(g));
|
|
2873
|
+
s(p);
|
|
2874
2874
|
};
|
|
2875
2875
|
});
|
|
2876
2876
|
}
|
|
@@ -2879,16 +2879,16 @@ class zs {
|
|
|
2879
2879
|
return new Promise((s, r) => {
|
|
2880
2880
|
const o = i.transaction(this.storeName, "readwrite"), a = o.objectStore(this.storeName), l = a.index("calendar");
|
|
2881
2881
|
for (const c of t) {
|
|
2882
|
-
const
|
|
2883
|
-
a.put(
|
|
2882
|
+
const h = this.serializeEvent(c);
|
|
2883
|
+
a.put(h);
|
|
2884
2884
|
}
|
|
2885
|
-
for (const [c,
|
|
2886
|
-
const
|
|
2885
|
+
for (const [c, h] of e.entries()) {
|
|
2886
|
+
const d = h.toISOString(), u = IDBKeyRange.only(c), f = l.openCursor(u);
|
|
2887
2887
|
f.onsuccess = () => {
|
|
2888
2888
|
const v = f.result;
|
|
2889
2889
|
if (v) {
|
|
2890
|
-
const
|
|
2891
|
-
(!
|
|
2890
|
+
const p = v.value;
|
|
2891
|
+
(!p.lastSynced || p.lastSynced < d) && (console.debug("sync deleted", p.id), a.delete(p.id)), v.continue();
|
|
2892
2892
|
}
|
|
2893
2893
|
}, f.onerror = () => {
|
|
2894
2894
|
r(new Error(`Failed to query calendar events: ${f.error?.message}`));
|
|
@@ -3022,20 +3022,570 @@ class zs {
|
|
|
3022
3022
|
});
|
|
3023
3023
|
}
|
|
3024
3024
|
}
|
|
3025
|
-
|
|
3025
|
+
function Gs() {
|
|
3026
|
+
return {
|
|
3027
|
+
name: "grid",
|
|
3028
|
+
enabled: !0,
|
|
3029
|
+
render(n) {
|
|
3030
|
+
const {
|
|
3031
|
+
ctx: t,
|
|
3032
|
+
width: e,
|
|
3033
|
+
height: i,
|
|
3034
|
+
scrollTop: s,
|
|
3035
|
+
dayWidth: r,
|
|
3036
|
+
dayHeight: o,
|
|
3037
|
+
leftGutterWidth: a,
|
|
3038
|
+
columnsPerRow: l,
|
|
3039
|
+
rowsPerWeek: c,
|
|
3040
|
+
visibleWeeks: h,
|
|
3041
|
+
allWeeks: d,
|
|
3042
|
+
fontFamily: u,
|
|
3043
|
+
styles: f,
|
|
3044
|
+
getDayVisualPosition: v,
|
|
3045
|
+
filter: p
|
|
3046
|
+
} = n, g = /* @__PURE__ */ new Date(), y = o >= 300;
|
|
3047
|
+
for (const T of h) {
|
|
3048
|
+
const x = T.days.findIndex(
|
|
3049
|
+
(b) => Y.isSameDay(b, g)
|
|
3050
|
+
);
|
|
3051
|
+
if (x >= 0) {
|
|
3052
|
+
const { row: b, col: S } = v(x), k = a + S * r, w = T.yOffset + b * o - s;
|
|
3053
|
+
if (t.fillStyle = f["--bg-today"] || "rgba(255, 255, 255, 0.05)", t.fillRect(k, w, r, o), y) {
|
|
3054
|
+
const _ = /* @__PURE__ */ new Date(), U = _.getHours() * 60 + _.getMinutes(), W = w + U / 1440 * o;
|
|
3055
|
+
W >= 0 && W <= i && (t.strokeStyle = f["--accent-current-time"] || "rgba(255, 0, 0, 0.8)", t.lineWidth = 1, t.beginPath(), t.moveTo(k, W), t.lineTo(k + r, W), t.stroke(), t.lineWidth = 1);
|
|
3056
|
+
}
|
|
3057
|
+
}
|
|
3058
|
+
}
|
|
3059
|
+
const M = f["--grid-color"] || "rgba(255, 255, 255, 0.1)";
|
|
3060
|
+
t.strokeStyle = M, t.lineWidth = 1;
|
|
3061
|
+
for (let T = 1; T <= l; T++) {
|
|
3062
|
+
const x = a + T * r;
|
|
3063
|
+
t.beginPath(), t.moveTo(x, 0), t.lineTo(x, i), t.stroke();
|
|
3064
|
+
}
|
|
3065
|
+
for (let T = 0; T < h.length; T++) {
|
|
3066
|
+
const x = h[T];
|
|
3067
|
+
if (!x) continue;
|
|
3068
|
+
const b = x.yOffset - s;
|
|
3069
|
+
if (p && T > 0) {
|
|
3070
|
+
const I = h[T - 1];
|
|
3071
|
+
if (!I) continue;
|
|
3072
|
+
const G = d.indexOf(I), q = d.indexOf(x) - G - 1;
|
|
3073
|
+
if (q > 0) {
|
|
3074
|
+
const vt = b, D = f["--grid-color-strong"] || "rgba(255, 255, 255, 0.3)";
|
|
3075
|
+
t.strokeStyle = D, t.lineWidth = 1, t.setLineDash([4, 4]), t.beginPath(), t.moveTo(a, vt), t.lineTo(e, vt), t.stroke(), t.setLineDash([]);
|
|
3076
|
+
const C = f["--text-muted"] || "rgba(255, 255, 255, 0.4)";
|
|
3077
|
+
t.fillStyle = C, t.textAlign = "center";
|
|
3078
|
+
const R = `⋯ ${q} week${q > 1 ? "s" : ""}`, P = t.measureText(R).width, F = 8, K = (a + e) / 2 - P / 2 - F, z = vt - 8, X = P + F * 2, H = 16, N = f["--bg-primary"] || "rgba(30, 30, 30, 0.9)";
|
|
3079
|
+
t.fillStyle = N, t.beginPath(), t.roundRect(
|
|
3080
|
+
K,
|
|
3081
|
+
z,
|
|
3082
|
+
X,
|
|
3083
|
+
H,
|
|
3084
|
+
8
|
|
3085
|
+
), t.fill(), t.fillStyle = C, t.fillText(
|
|
3086
|
+
R,
|
|
3087
|
+
(a + e) / 2,
|
|
3088
|
+
vt + 4
|
|
3089
|
+
);
|
|
3090
|
+
}
|
|
3091
|
+
}
|
|
3092
|
+
t.strokeStyle = M, t.beginPath(), t.moveTo(a, b), t.lineTo(e, b), t.stroke();
|
|
3093
|
+
for (let I = 1; I < c; I++) {
|
|
3094
|
+
const G = b + I * o;
|
|
3095
|
+
G >= 0 && G <= i && (t.beginPath(), t.moveTo(a, G), t.lineTo(e, G), t.stroke());
|
|
3096
|
+
}
|
|
3097
|
+
const S = Math.max(
|
|
3098
|
+
0,
|
|
3099
|
+
Math.min(1, (o - 300) / 300)
|
|
3100
|
+
);
|
|
3101
|
+
t.font = `500 11px ${u}`, t.textBaseline = "bottom", t.textAlign = "right";
|
|
3102
|
+
const k = f["--text-muted"] || "rgba(255, 255, 255, 0.4)";
|
|
3103
|
+
t.strokeStyle = M.replace(
|
|
3104
|
+
/[\d.]+\)$/,
|
|
3105
|
+
`${0.05 * S})`
|
|
3106
|
+
), t.fillStyle = k.replace(
|
|
3107
|
+
/[\d.]+\)$/,
|
|
3108
|
+
`${0.4 * S})`
|
|
3109
|
+
);
|
|
3110
|
+
for (let I = 0; I < c; I++) {
|
|
3111
|
+
const G = b + I * o;
|
|
3112
|
+
for (let nt = 0; nt < 24; nt++) {
|
|
3113
|
+
const q = G + nt / 24 * o;
|
|
3114
|
+
if (q >= 0 && q <= i && (t.beginPath(), t.moveTo(a, q), t.lineTo(e, q), t.stroke(), S > 0.1)) {
|
|
3115
|
+
const vt = `${nt.toString().padStart(2, "0")}:00`;
|
|
3116
|
+
t.fillText(vt, 48, q + 4);
|
|
3117
|
+
}
|
|
3118
|
+
}
|
|
3119
|
+
}
|
|
3120
|
+
if (S > 0.1) {
|
|
3121
|
+
const I = x.days.findIndex(
|
|
3122
|
+
(G) => Y.isSameDay(G, g)
|
|
3123
|
+
);
|
|
3124
|
+
if (I >= 0) {
|
|
3125
|
+
const { row: G } = v(I), nt = g.getHours() * 60 + g.getMinutes(), q = b + G * o + nt / 1440 * o;
|
|
3126
|
+
if (q >= 0 && q <= i) {
|
|
3127
|
+
const vt = g.getHours().toString().padStart(2, "0"), D = g.getMinutes().toString().padStart(2, "0"), C = `${vt}:${D}`;
|
|
3128
|
+
t.save(), t.textAlign = "right", t.textBaseline = "middle";
|
|
3129
|
+
const R = t.measureText(C).width, P = 6, F = 48, K = q, z = f["--bg-elevated"] || "rgba(0, 0, 0, 0.7)";
|
|
3130
|
+
t.fillStyle = z, t.beginPath(), t.roundRect(
|
|
3131
|
+
F - R - P,
|
|
3132
|
+
K - 8,
|
|
3133
|
+
R + P * 2,
|
|
3134
|
+
16,
|
|
3135
|
+
4
|
|
3136
|
+
), t.fill(), t.fillStyle = f["--text-primary"] || "rgba(255, 255, 255, 1)", t.fillText(C, F, K), t.restore();
|
|
3137
|
+
}
|
|
3138
|
+
}
|
|
3139
|
+
}
|
|
3140
|
+
const w = Math.max(
|
|
3141
|
+
0,
|
|
3142
|
+
Math.min(1, 1 - (o - 300) / 50)
|
|
3143
|
+
), _ = f["--text-muted"] || "rgba(255, 255, 255, 0.4)";
|
|
3144
|
+
t.fillStyle = _.replace(
|
|
3145
|
+
/[\d.]+\)$/,
|
|
3146
|
+
`${0.4 * w})`
|
|
3147
|
+
), t.textAlign = "center";
|
|
3148
|
+
const U = `W${x.weekNumber}`, W = b, V = b + x.height, B = Math.max(
|
|
3149
|
+
14,
|
|
3150
|
+
Math.min(
|
|
3151
|
+
W + x.height / 2 + 4,
|
|
3152
|
+
V - 4
|
|
3153
|
+
)
|
|
3154
|
+
);
|
|
3155
|
+
B >= Math.max(0, W + 4) && B <= Math.min(i, V) && w > 0.1 && t.fillText(U, 30, B);
|
|
3156
|
+
}
|
|
3157
|
+
}
|
|
3158
|
+
};
|
|
3159
|
+
}
|
|
3160
|
+
const ke = 20;
|
|
3161
|
+
function Js(n) {
|
|
3162
|
+
const t = {
|
|
3163
|
+
name: "events",
|
|
3164
|
+
enabled: !0,
|
|
3165
|
+
eventRects: [],
|
|
3166
|
+
render(e) {
|
|
3167
|
+
const {
|
|
3168
|
+
ctx: i,
|
|
3169
|
+
width: s,
|
|
3170
|
+
height: r,
|
|
3171
|
+
scrollTop: o,
|
|
3172
|
+
dayWidth: a,
|
|
3173
|
+
dayHeight: l,
|
|
3174
|
+
leftGutterWidth: c,
|
|
3175
|
+
visibleWeeks: h,
|
|
3176
|
+
allWeeks: d,
|
|
3177
|
+
fontFamily: u,
|
|
3178
|
+
styles: f,
|
|
3179
|
+
getDayVisualPosition: v
|
|
3180
|
+
} = e, p = n.events, g = o + r, y = l >= 300;
|
|
3181
|
+
if (t.eventRects = [], h.length === 0) return;
|
|
3182
|
+
const M = h[0], T = h[h.length - 1], x = M.days[0], b = T.days[6], S = x.getTime(), k = b.getTime() + 864e5 - 1, w = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map(), U = [], W = [], V = [];
|
|
3183
|
+
for (const D of p) {
|
|
3184
|
+
const C = D.start.getTime(), R = D.end.getTime();
|
|
3185
|
+
if (R < S || C > k)
|
|
3186
|
+
continue;
|
|
3187
|
+
const P = [];
|
|
3188
|
+
for (const z of h) {
|
|
3189
|
+
const X = z.days[0], H = z.days[6];
|
|
3190
|
+
if (!X || !H) continue;
|
|
3191
|
+
const N = X.getTime(), st = H.getTime() + 86399999;
|
|
3192
|
+
if (R >= N && C <= st) {
|
|
3193
|
+
const lt = d.indexOf(z);
|
|
3194
|
+
P.push({ weekIndex: lt, week: z });
|
|
3195
|
+
}
|
|
3196
|
+
}
|
|
3197
|
+
const F = P.length, K = D.isAllDay === !0;
|
|
3198
|
+
for (let z = 0; z < P.length; z++) {
|
|
3199
|
+
const { weekIndex: X, week: H } = P[z], N = z === 0, st = z === P.length - 1;
|
|
3200
|
+
let lt = 0, Ot = 6;
|
|
3201
|
+
if (N && (lt = qi(
|
|
3202
|
+
H,
|
|
3203
|
+
D.start
|
|
3204
|
+
)), st) {
|
|
3205
|
+
const wt = K ? new Date(D.end.getTime() - 1) : D.end;
|
|
3206
|
+
Ot = qi(
|
|
3207
|
+
H,
|
|
3208
|
+
wt
|
|
3209
|
+
);
|
|
3210
|
+
}
|
|
3211
|
+
const ut = {
|
|
3212
|
+
event: D,
|
|
3213
|
+
weekIndex: X,
|
|
3214
|
+
week: H,
|
|
3215
|
+
startDayIndex: lt,
|
|
3216
|
+
endDayIndex: Ot,
|
|
3217
|
+
isStart: N,
|
|
3218
|
+
isEnd: st,
|
|
3219
|
+
totalWeeks: F
|
|
3220
|
+
};
|
|
3221
|
+
K ? W.push(ut) : V.push(ut);
|
|
3222
|
+
}
|
|
3223
|
+
}
|
|
3224
|
+
const B = y ? V.flatMap((D) => {
|
|
3225
|
+
if (D.startDayIndex === D.endDayIndex)
|
|
3226
|
+
return [D];
|
|
3227
|
+
const C = [];
|
|
3228
|
+
for (let R = D.startDayIndex; R <= D.endDayIndex; R++)
|
|
3229
|
+
C.push({
|
|
3230
|
+
...D,
|
|
3231
|
+
startDayIndex: R,
|
|
3232
|
+
endDayIndex: R,
|
|
3233
|
+
isStart: R === D.startDayIndex && D.isStart,
|
|
3234
|
+
isEnd: R === D.endDayIndex && D.isEnd,
|
|
3235
|
+
totalWeeks: 1
|
|
3236
|
+
});
|
|
3237
|
+
return C;
|
|
3238
|
+
}) : V;
|
|
3239
|
+
U.push(...W, ...B);
|
|
3240
|
+
const I = /* @__PURE__ */ new Map();
|
|
3241
|
+
for (const D of U) {
|
|
3242
|
+
const C = D.event.isAllDay === !0;
|
|
3243
|
+
if (y && !C)
|
|
3244
|
+
for (let R = D.startDayIndex; R <= D.endDayIndex; R++) {
|
|
3245
|
+
const P = `${D.weekIndex}-${R}`;
|
|
3246
|
+
I.has(P) || I.set(P, []), I.get(P).push(D);
|
|
3247
|
+
}
|
|
3248
|
+
}
|
|
3249
|
+
const G = /* @__PURE__ */ new Map();
|
|
3250
|
+
for (const [D, C] of I) {
|
|
3251
|
+
const [R, P] = D.split("-"), F = parseInt(P), K = parseInt(R), z = [];
|
|
3252
|
+
for (const H of C) {
|
|
3253
|
+
const N = d[K];
|
|
3254
|
+
if (!N) continue;
|
|
3255
|
+
const st = new Date(
|
|
3256
|
+
N.days[F]
|
|
3257
|
+
).setHours(0, 0, 0, 0), lt = new Date(
|
|
3258
|
+
N.days[F]
|
|
3259
|
+
).setHours(23, 59, 59, 999), Ot = H.event.start.getTime(), ut = H.event.end.getTime() - 6e4, wt = Math.max(
|
|
3260
|
+
Ot,
|
|
3261
|
+
st
|
|
3262
|
+
), rt = Math.min(
|
|
3263
|
+
ut,
|
|
3264
|
+
lt
|
|
3265
|
+
), Q = new Date(wt), _t = new Date(rt), ae = Q.getHours() * 60 + Q.getMinutes(), Rt = _t.getHours() * 60 + _t.getMinutes();
|
|
3266
|
+
z.push({
|
|
3267
|
+
segment: H,
|
|
3268
|
+
startMinutes: ae,
|
|
3269
|
+
endMinutes: Rt
|
|
3270
|
+
});
|
|
3271
|
+
}
|
|
3272
|
+
z.sort((H, N) => H.startMinutes !== N.startMinutes ? H.startMinutes - N.startMinutes : N.endMinutes - N.startMinutes - (H.endMinutes - H.startMinutes));
|
|
3273
|
+
const X = [];
|
|
3274
|
+
for (const H of z) {
|
|
3275
|
+
let N = 0;
|
|
3276
|
+
for (; N < X.length && !(X[N].endMinutes <= H.startMinutes); N++)
|
|
3277
|
+
;
|
|
3278
|
+
N === X.length ? X.push({ endMinutes: H.endMinutes }) : X[N].endMinutes = H.endMinutes;
|
|
3279
|
+
const st = `${H.segment.weekIndex}-${H.segment.event.id}-${F}`;
|
|
3280
|
+
G.set(st, {
|
|
3281
|
+
column: N,
|
|
3282
|
+
totalColumns: X.length
|
|
3283
|
+
});
|
|
3284
|
+
}
|
|
3285
|
+
for (const H of z) {
|
|
3286
|
+
const N = `${H.segment.weekIndex}-${H.segment.event.id}-${F}`, st = G.get(N);
|
|
3287
|
+
st && (st.totalColumns = X.length);
|
|
3288
|
+
}
|
|
3289
|
+
}
|
|
3290
|
+
for (const D of U) {
|
|
3291
|
+
const {
|
|
3292
|
+
event: C,
|
|
3293
|
+
week: R,
|
|
3294
|
+
weekIndex: P,
|
|
3295
|
+
startDayIndex: F,
|
|
3296
|
+
endDayIndex: K,
|
|
3297
|
+
isStart: z,
|
|
3298
|
+
isEnd: X,
|
|
3299
|
+
totalWeeks: H
|
|
3300
|
+
} = D, N = R.yOffset, st = C.isAllDay === !0, lt = v(F), Ot = v(K);
|
|
3301
|
+
let ut, wt;
|
|
3302
|
+
if (y && !st) {
|
|
3303
|
+
const ht = new Date(
|
|
3304
|
+
R.days[F]
|
|
3305
|
+
).setHours(0, 0, 0, 0), j = new Date(
|
|
3306
|
+
R.days[K]
|
|
3307
|
+
).setHours(23, 59, 59, 999), Mt = C.start.getTime(), xt = C.end.getTime() - 6e4, dt = Math.max(
|
|
3308
|
+
Mt,
|
|
3309
|
+
ht
|
|
3310
|
+
), J = Math.min(
|
|
3311
|
+
xt,
|
|
3312
|
+
j
|
|
3313
|
+
), St = new Date(
|
|
3314
|
+
dt
|
|
3315
|
+
), Tt = new Date(J), zt = St.getHours() * 60 + St.getMinutes(), Ft = Tt.getHours() * 60 + Tt.getMinutes(), Yt = N + lt.row * l;
|
|
3316
|
+
ut = Yt + zt / 1440 * l, wt = Yt + Ft / 1440 * l;
|
|
3317
|
+
} else {
|
|
3318
|
+
const ht = `${P}-${C.id}`;
|
|
3319
|
+
let j = _.get(ht);
|
|
3320
|
+
if (j === void 0) {
|
|
3321
|
+
for (j = 0; ; ) {
|
|
3322
|
+
let dt = !0;
|
|
3323
|
+
for (let J = F; J <= K; J++) {
|
|
3324
|
+
const St = `${P}-${J}`;
|
|
3325
|
+
if (w.get(St)?.has(j)) {
|
|
3326
|
+
dt = !1;
|
|
3327
|
+
break;
|
|
3328
|
+
}
|
|
3329
|
+
}
|
|
3330
|
+
if (dt) break;
|
|
3331
|
+
j++;
|
|
3332
|
+
}
|
|
3333
|
+
_.set(ht, j);
|
|
3334
|
+
}
|
|
3335
|
+
for (let dt = F; dt <= K; dt++) {
|
|
3336
|
+
const J = `${P}-${dt}`;
|
|
3337
|
+
let St = w.get(J);
|
|
3338
|
+
St || (St = /* @__PURE__ */ new Set(), w.set(J, St)), St.add(j);
|
|
3339
|
+
}
|
|
3340
|
+
const Mt = Math.floor(
|
|
3341
|
+
(l - 4) / (ke + 2)
|
|
3342
|
+
);
|
|
3343
|
+
if (j >= Mt) continue;
|
|
3344
|
+
ut = N + lt.row * l + 4 + j * (ke + 2), wt = ut + ke;
|
|
3345
|
+
}
|
|
3346
|
+
const rt = Math.max(
|
|
3347
|
+
y ? 4 : ke,
|
|
3348
|
+
wt - ut
|
|
3349
|
+
);
|
|
3350
|
+
let Q, _t;
|
|
3351
|
+
const ae = `${P}-${C.id}-${F}`, Rt = G.get(ae);
|
|
3352
|
+
if (y && !st && Rt && Rt.totalColumns > 1) {
|
|
3353
|
+
const ht = a / Rt.totalColumns;
|
|
3354
|
+
Q = c + lt.col * a + Rt.column * ht, _t = ht;
|
|
3355
|
+
} else {
|
|
3356
|
+
const ht = Ot.col - lt.col + 1;
|
|
3357
|
+
Q = c + lt.col * a, _t = ht * a;
|
|
3358
|
+
}
|
|
3359
|
+
const Et = ut - o;
|
|
3360
|
+
if (Et + rt < 0 || Et > r)
|
|
3361
|
+
continue;
|
|
3362
|
+
const Ye = C.color || "#888888", Wt = n.isEventSelected(C), un = n.hoveredEventId === C.id, mt = 2, It = _t - mt * 2, le = 3, ui = 6;
|
|
3363
|
+
let Pt = 4, Zt = 4, Ht = 4, Gt = 4;
|
|
3364
|
+
H > 1 && (z && !X ? (Zt = 0, Gt = 0) : !z && X ? (Pt = 0, Ht = 0) : !z && !X && (Pt = 0, Zt = 0, Ht = 0, Gt = 0)), i.save(), C.readOnly && (i.globalAlpha = 0.5);
|
|
3365
|
+
const Jt = zs(Ge(Ye)), fi = f["--text-primary"] || "rgba(255, 255, 255, 0.9)", Ne = f["--text-inverse"] || "rgb(0, 0, 0)", fn = Wt ? Ye : `hsla(${Jt[0]}, ${Math.min(Jt[1] * 0.9, 90)}%, ${Math.min(Jt[2] + 15, 40)}%, 0.45)`, pn = Wt ? Ye : `hsla(${Jt[0]}, ${Math.min(Jt[1] * 0.9, 90)}%, ${Math.min(Jt[2] + 10, 70)}%, 1)`, gn = n.shouldRenderEventWithStripes(C);
|
|
3366
|
+
if (i.beginPath(), i.roundRect(
|
|
3367
|
+
Q + mt,
|
|
3368
|
+
Et,
|
|
3369
|
+
It,
|
|
3370
|
+
rt,
|
|
3371
|
+
[
|
|
3372
|
+
Pt,
|
|
3373
|
+
Zt,
|
|
3374
|
+
Gt,
|
|
3375
|
+
Ht
|
|
3376
|
+
]
|
|
3377
|
+
), i.fillStyle = fn, i.fill(), gn) {
|
|
3378
|
+
const ht = n.getStripePatternCanvas();
|
|
3379
|
+
if (ht) {
|
|
3380
|
+
i.save(), i.beginPath(), i.roundRect(
|
|
3381
|
+
Q + mt,
|
|
3382
|
+
Et,
|
|
3383
|
+
It,
|
|
3384
|
+
rt,
|
|
3385
|
+
[
|
|
3386
|
+
Pt,
|
|
3387
|
+
Zt,
|
|
3388
|
+
Gt,
|
|
3389
|
+
Ht
|
|
3390
|
+
]
|
|
3391
|
+
), i.clip();
|
|
3392
|
+
const j = 12, Mt = Math.floor((Q + mt) / j) * j, xt = Math.floor(ut / j) * j - o;
|
|
3393
|
+
for (let dt = xt; dt < Et + rt; dt += j)
|
|
3394
|
+
for (let J = Mt; J < Q + mt + It; J += j)
|
|
3395
|
+
i.drawImage(
|
|
3396
|
+
ht,
|
|
3397
|
+
J,
|
|
3398
|
+
dt,
|
|
3399
|
+
j,
|
|
3400
|
+
j
|
|
3401
|
+
);
|
|
3402
|
+
i.restore();
|
|
3403
|
+
}
|
|
3404
|
+
}
|
|
3405
|
+
if (Wt || (i.fillStyle = pn, i.beginPath(), i.roundRect(
|
|
3406
|
+
Q + mt + 2,
|
|
3407
|
+
Et + 2,
|
|
3408
|
+
le,
|
|
3409
|
+
rt - 4,
|
|
3410
|
+
[
|
|
3411
|
+
Pt,
|
|
3412
|
+
Pt,
|
|
3413
|
+
Ht,
|
|
3414
|
+
Ht
|
|
3415
|
+
]
|
|
3416
|
+
), i.fill()), Wt && (i.strokeStyle = Ne, i.lineWidth = 1, i.beginPath(), i.roundRect(
|
|
3417
|
+
Q + mt,
|
|
3418
|
+
Et,
|
|
3419
|
+
It,
|
|
3420
|
+
rt,
|
|
3421
|
+
[
|
|
3422
|
+
Pt,
|
|
3423
|
+
Zt,
|
|
3424
|
+
Gt,
|
|
3425
|
+
Ht
|
|
3426
|
+
]
|
|
3427
|
+
), i.stroke()), un && !Wt && (i.strokeStyle = f["--grid-color-hover"] || "rgba(255, 255, 255, 0.2)", i.lineWidth = 1, i.beginPath(), i.roundRect(
|
|
3428
|
+
Q + mt,
|
|
3429
|
+
Et,
|
|
3430
|
+
It,
|
|
3431
|
+
rt,
|
|
3432
|
+
[
|
|
3433
|
+
Pt,
|
|
3434
|
+
Zt,
|
|
3435
|
+
Gt,
|
|
3436
|
+
Ht
|
|
3437
|
+
]
|
|
3438
|
+
), i.stroke()), z && rt >= 16) {
|
|
3439
|
+
const ht = Wt ? Ne : fi;
|
|
3440
|
+
i.fillStyle = ht, i.font = `11px ${u}`, i.textAlign = "left", i.textBaseline = "top";
|
|
3441
|
+
const j = Q + mt + le + ui + 1, Mt = Et + 6;
|
|
3442
|
+
let xt = It - le - ui - 4;
|
|
3443
|
+
if (i.save(), i.beginPath(), i.rect(
|
|
3444
|
+
Q + mt + le,
|
|
3445
|
+
Et,
|
|
3446
|
+
It - le,
|
|
3447
|
+
rt
|
|
3448
|
+
), i.clip(), C.rrule) {
|
|
3449
|
+
i.font = `11px ${u}`;
|
|
3450
|
+
const Tt = "⟳", zt = i.measureText(Tt).width;
|
|
3451
|
+
i.fillText(Tt, j, Mt), xt -= zt + 4;
|
|
3452
|
+
}
|
|
3453
|
+
const dt = j + (C.rrule ? i.measureText("⟳").width + 4 : 0);
|
|
3454
|
+
let J = C.title;
|
|
3455
|
+
if (i.font = `11px ${u}`, i.measureText(J).width > xt) {
|
|
3456
|
+
const zt = i.measureText("…").width;
|
|
3457
|
+
let Ft = 0, Yt = J.length, Ee = 0;
|
|
3458
|
+
for (; Ft <= Yt; ) {
|
|
3459
|
+
const yt = Math.floor(
|
|
3460
|
+
(Ft + Yt) / 2
|
|
3461
|
+
), pi = J.substring(
|
|
3462
|
+
0,
|
|
3463
|
+
yt
|
|
3464
|
+
);
|
|
3465
|
+
i.measureText(pi).width + zt <= xt ? (Ee = yt, Ft = yt + 1) : Yt = yt - 1;
|
|
3466
|
+
}
|
|
3467
|
+
J = J.substring(0, Ee) + "…";
|
|
3468
|
+
}
|
|
3469
|
+
if (i.fillText(
|
|
3470
|
+
J,
|
|
3471
|
+
dt,
|
|
3472
|
+
Mt
|
|
3473
|
+
), rt >= 32) {
|
|
3474
|
+
const Tt = (xe) => {
|
|
3475
|
+
const Se = xe.getHours(), ce = xe.getMinutes(), he = Se >= 12 ? "PM" : "AM";
|
|
3476
|
+
return `${Se % 12 || 12}:${ce.toString().padStart(2, "0")} ${he}`;
|
|
3477
|
+
}, zt = Tt(
|
|
3478
|
+
C.start
|
|
3479
|
+
), Ft = Tt(C.end), Yt = `${zt} – ${Ft}`, Ee = Wt ? Ne : fi;
|
|
3480
|
+
i.fillStyle = Ee, i.font = `10px ${u}`;
|
|
3481
|
+
let yt = Yt;
|
|
3482
|
+
if (i.measureText(yt).width > xt) {
|
|
3483
|
+
const Se = i.measureText("…").width;
|
|
3484
|
+
let ce = 0, he = yt.length, Ue = 0;
|
|
3485
|
+
for (; ce <= he; ) {
|
|
3486
|
+
const Te = Math.floor(
|
|
3487
|
+
(ce + he) / 2
|
|
3488
|
+
), vn = yt.substring(0, Te);
|
|
3489
|
+
i.measureText(vn).width + Se <= xt ? (Ue = Te, ce = Te + 1) : he = Te - 1;
|
|
3490
|
+
}
|
|
3491
|
+
yt = yt.substring(0, Ue) + "…";
|
|
3492
|
+
}
|
|
3493
|
+
i.fillText(
|
|
3494
|
+
yt,
|
|
3495
|
+
j,
|
|
3496
|
+
Mt + 14
|
|
3497
|
+
);
|
|
3498
|
+
}
|
|
3499
|
+
i.restore();
|
|
3500
|
+
}
|
|
3501
|
+
i.restore(), t.eventRects.push({
|
|
3502
|
+
event: C,
|
|
3503
|
+
x: Q + mt,
|
|
3504
|
+
y: ut,
|
|
3505
|
+
width: It,
|
|
3506
|
+
height: rt
|
|
3507
|
+
});
|
|
3508
|
+
}
|
|
3509
|
+
const nt = [
|
|
3510
|
+
"January",
|
|
3511
|
+
"February",
|
|
3512
|
+
"March",
|
|
3513
|
+
"April",
|
|
3514
|
+
"May",
|
|
3515
|
+
"June",
|
|
3516
|
+
"July",
|
|
3517
|
+
"August",
|
|
3518
|
+
"September",
|
|
3519
|
+
"October",
|
|
3520
|
+
"November",
|
|
3521
|
+
"December"
|
|
3522
|
+
], q = [], vt = /* @__PURE__ */ new Set();
|
|
3523
|
+
for (const D of h) {
|
|
3524
|
+
const C = D.days[0];
|
|
3525
|
+
if (!C) continue;
|
|
3526
|
+
const R = C.getMonth(), P = C.getFullYear(), F = `${R}-${P}`;
|
|
3527
|
+
if (!vt.has(F)) {
|
|
3528
|
+
vt.add(F);
|
|
3529
|
+
const K = nt[R];
|
|
3530
|
+
K && q.push({
|
|
3531
|
+
monthKey: F,
|
|
3532
|
+
monthName: K,
|
|
3533
|
+
year: P,
|
|
3534
|
+
yOffset: D.yOffset
|
|
3535
|
+
});
|
|
3536
|
+
}
|
|
3537
|
+
}
|
|
3538
|
+
for (let D = 0; D < q.length; D++) {
|
|
3539
|
+
const C = q[D], R = q[D + 1], P = C.yOffset, F = R ? R.yOffset : 1 / 0;
|
|
3540
|
+
if (F < o) continue;
|
|
3541
|
+
if (P > g) break;
|
|
3542
|
+
const K = [12, 0, 0, 12], z = Math.max(
|
|
3543
|
+
0,
|
|
3544
|
+
o - P
|
|
3545
|
+
), X = F - P - 24, H = Math.min(
|
|
3546
|
+
z,
|
|
3547
|
+
X
|
|
3548
|
+
), st = P + H - o + 32;
|
|
3549
|
+
i.save(), i.font = `bold 18px ${u}`, i.textAlign = "left", i.textBaseline = "top";
|
|
3550
|
+
const lt = `${C.monthName} ${C.year}`, Ot = i.measureText(lt).width, wt = 64 + K[3] + 8, rt = st + K[0], Q = 8, _t = 8, ae = f["--bg-elevated"] || "rgba(0, 0, 0, 0.7)";
|
|
3551
|
+
i.fillStyle = ae, i.beginPath(), i.roundRect(
|
|
3552
|
+
wt - Q,
|
|
3553
|
+
rt - 4,
|
|
3554
|
+
Ot + Q + _t,
|
|
3555
|
+
26,
|
|
3556
|
+
6
|
|
3557
|
+
), i.fill();
|
|
3558
|
+
const Rt = f["--text-primary"] || "rgba(255, 255, 255, 0.95)";
|
|
3559
|
+
i.fillStyle = Rt, i.fillText(lt, wt, rt), i.restore();
|
|
3560
|
+
}
|
|
3561
|
+
}
|
|
3562
|
+
};
|
|
3563
|
+
return t;
|
|
3564
|
+
}
|
|
3565
|
+
function qi(n, t) {
|
|
3566
|
+
const e = new Date(t).setHours(0, 0, 0, 0);
|
|
3567
|
+
for (let s = 0; s < 7; s++) {
|
|
3568
|
+
const r = n.days[s];
|
|
3569
|
+
if (r && new Date(r).setHours(0, 0, 0, 0) === e)
|
|
3570
|
+
return s;
|
|
3571
|
+
}
|
|
3572
|
+
const i = new Date(n.days[0]).setHours(0, 0, 0, 0);
|
|
3573
|
+
return e < i ? 0 : 6;
|
|
3574
|
+
}
|
|
3575
|
+
const jt = 100, De = 3e3, tt = 60, ji = 12, di = class di extends ie {
|
|
3026
3576
|
constructor() {
|
|
3027
|
-
super(), this._dayHeight =
|
|
3577
|
+
super(), this._dayHeight = jt, this._scrollTop = 0, this.viewportHeight = 0, this.currentTime = /* @__PURE__ */ new Date(), this.selection = null, this.canvas = null, this.ctx = null, this.overlayCanvas = null, this.overlayCtx = null, this.minimapBufferCanvas = null, this.minimapBufferCtx = null, this.stripePatternCanvas = null, this.layers = [], this.eventsLayer = null, this.scrollContainer = null, this.scrollContent = null, this.resizeObserver = null, this.totalHeight = 0, this.isDraggingZoom = !1, this.zoomDragStartY = 0, this.zoomDragStartHeight = 0, this.zoomOriginY = 0, this.zoomViewportY = 0, this.isPanning = !1, this.panStartX = 0, this.panStartY = 0, this.panStartScrollTop = 0, this.isSelecting = !1, this.selectionStartX = 0, this.selectionStartY = 0, this.potentialSelectionStart = null, this.selectionModifierKey = !1, this.cursorPosition = null, this.animationFrame = null, this.isDraggingMinimap = !1, this.isFiltered = !1, this.timeUpdateInterval = null, this.isExtendingRange = !1, this.isCreatingEvent = !1, this.eventCreationStart = null, this.eventCreationEnd = null, this.eventCreationShiftPressed = !1, this.eventCreationPreviousShiftPressed = !1, this.eventCreationInitialDuration = null, this.movingEvent = null, this.movingEventOrigin = null, this.movingEventEnd = null, this.isDraggingEvent = !1, this.movingEventDuplicateMode = !1, this.movingEventMouseEvent = null, this.isDraggingFile = !1, this.resizingEvent = null, this.resizingEdge = null, this.resizingOriginalStart = null, this.resizingOriginalEnd = null, this.isResizingEvent = !1, this._columnsPerRow = 7, this.historyStack = [], this.historyIndex = 0, this.saveHistoryTimeout = null, this.weeks = [], this.events = [], this.eventRects = [], this.hoveredEventId = null, this.selectedEventForDetail = null, this.selectedEventRect = null, this.isDescriptionExpanded = !1, this.notificationPopoverOpen = !1, this.scheduledNotifications = [], this.updateEventTimeout = null, this.currentUserEmails = /* @__PURE__ */ new Set(), this.currentTheme = Ks(), this.activeCalendarColor = null, this.activeCalendarId = null, this.scrollToToday = (t = !0) => {
|
|
3028
3578
|
const e = /* @__PURE__ */ new Date();
|
|
3029
3579
|
let i = this.weeks.findIndex(
|
|
3030
|
-
(r) => r.days.some((o) =>
|
|
3580
|
+
(r) => r.days.some((o) => Y.isSameDay(o, e))
|
|
3031
3581
|
);
|
|
3032
3582
|
i < 0 && (this.weeks = this.internal.resetRangeAroundDate(e), i = this.weeks.findIndex(
|
|
3033
|
-
(r) => r.days.some((o) =>
|
|
3583
|
+
(r) => r.days.some((o) => Y.isSameDay(o, e))
|
|
3034
3584
|
));
|
|
3035
3585
|
let s = 0.5;
|
|
3036
3586
|
if (i >= 0) {
|
|
3037
3587
|
const o = this.weeks[i].days.findIndex(
|
|
3038
|
-
(a) =>
|
|
3588
|
+
(a) => Y.isSameDay(a, e)
|
|
3039
3589
|
);
|
|
3040
3590
|
if (o >= 0) {
|
|
3041
3591
|
const a = Math.floor(o / this._columnsPerRow), l = (e.getHours() + e.getMinutes() / 60) / 24;
|
|
@@ -3045,7 +3595,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3045
3595
|
this.scrollToDate(e, s, t, !0, 900);
|
|
3046
3596
|
}, this.scrollToMonth = (t = !0) => {
|
|
3047
3597
|
const e = /* @__PURE__ */ new Date(), i = new Date(e.getFullYear(), e.getMonth(), 15), s = Math.max(
|
|
3048
|
-
|
|
3598
|
+
jt,
|
|
3049
3599
|
Math.round(this.viewportHeight / 5)
|
|
3050
3600
|
);
|
|
3051
3601
|
this.scrollToDate(i, 0.5, t, !0, s);
|
|
@@ -3071,8 +3621,8 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3071
3621
|
}
|
|
3072
3622
|
t.preventDefault();
|
|
3073
3623
|
const s = t.deltaY * (this.dayHeight / 100), r = Math.max(
|
|
3074
|
-
|
|
3075
|
-
Math.min(
|
|
3624
|
+
jt,
|
|
3625
|
+
Math.min(De, this.dayHeight - s)
|
|
3076
3626
|
), o = this.dayHeight, a = r / o, l = this.zoomOriginY * a, c = l - this.zoomViewportY;
|
|
3077
3627
|
this.setView(r, c), this.zoomOriginY = l;
|
|
3078
3628
|
}, this.lastPointerY = 0, this.onZoomHandleMouseDown = (t) => {
|
|
@@ -3083,7 +3633,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3083
3633
|
}, this.onDragStart = (t) => {
|
|
3084
3634
|
if (!this.movingEvent || !t.dataTransfer) return;
|
|
3085
3635
|
this.isDraggingOut = !0, this.isDraggingEvent = !0;
|
|
3086
|
-
const e = this.movingEvent, i =
|
|
3636
|
+
const e = this.movingEvent, i = Bi([e]);
|
|
3087
3637
|
t.dataTransfer.setData("application/x-calendar-event", e.id), t.dataTransfer.setData("text/plain", i), t.dataTransfer.effectAllowed = "copyMove";
|
|
3088
3638
|
try {
|
|
3089
3639
|
const o = `${e.title.replace(/[^a-z0-9]/gi, "_")}.ics`, a = new File([i], o, { type: "text/calendar" });
|
|
@@ -3103,7 +3653,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3103
3653
|
console.warn("DownloadURL not supported:", o);
|
|
3104
3654
|
}
|
|
3105
3655
|
}, this.onDragEnd = (t) => {
|
|
3106
|
-
t.dataTransfer?.dropEffect === "none" && this.movingEvent &&
|
|
3656
|
+
t.dataTransfer?.dropEffect === "none" && this.movingEvent && qt("Event exported as .ics file"), this.isDraggingFile = !1, this.resetDragState(), this.requestUpdate();
|
|
3107
3657
|
}, this.onMouseMove = (t) => {
|
|
3108
3658
|
if (this.isPanning && this.scrollContainer) {
|
|
3109
3659
|
const e = t.clientY - this.panStartY;
|
|
@@ -3114,8 +3664,8 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3114
3664
|
let e = 0;
|
|
3115
3665
|
this.lastPointerY && (e = t.clientY - this.lastPointerY);
|
|
3116
3666
|
const i = e * (this.dayHeight / 100), s = Math.max(
|
|
3117
|
-
|
|
3118
|
-
Math.min(
|
|
3667
|
+
jt,
|
|
3668
|
+
Math.min(De, this.dayHeight - i)
|
|
3119
3669
|
), r = this.dayHeight, o = s / r, a = this.zoomOriginY * o, l = a - this.zoomViewportY;
|
|
3120
3670
|
this.setView(s, l, !1), this.zoomOriginY = a, this.isFiltered && this.historyIndex === 0 ? this.replaceFilterInHistory() : this.debouncedSaveToHistory();
|
|
3121
3671
|
} else
|
|
@@ -3184,9 +3734,9 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3184
3734
|
this.eventCreationEnd.y
|
|
3185
3735
|
);
|
|
3186
3736
|
if (r && o) {
|
|
3187
|
-
const a = (
|
|
3188
|
-
const
|
|
3189
|
-
return
|
|
3737
|
+
const a = (h) => {
|
|
3738
|
+
const d = h.getMinutes();
|
|
3739
|
+
return h.setMinutes(Math.round(d / 15) * 15, 0, 0), h;
|
|
3190
3740
|
};
|
|
3191
3741
|
let l, c;
|
|
3192
3742
|
this.eventCreationShiftPressed && this.eventCreationInitialDuration !== null ? (c = a(new Date(o)), l = a(
|
|
@@ -3238,7 +3788,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3238
3788
|
const e = this.scrollContainer.getBoundingClientRect(), i = t.clientX - e.left, s = t.clientY - e.top + this.scrollTop;
|
|
3239
3789
|
this.cursorPosition = { x: i, y: s }, this.getResizeHandle(i, s) && !this.isResizingEvent && !this.isDraggingEvent ? this.scrollContainer.style.cursor = "ns-resize" : !this.isResizingEvent && !this.isDraggingEvent && (this.scrollContainer.style.cursor = "");
|
|
3240
3790
|
const o = this.getEventAtPosition(i, s), a = o ? o.id : null;
|
|
3241
|
-
a !== this.hoveredEventId && (this.hoveredEventId = a, this.renderCanvas()), this.requestUpdate(), i <
|
|
3791
|
+
a !== this.hoveredEventId && (this.hoveredEventId = a, this.renderCanvas()), this.requestUpdate(), i < tt ? this.scrollContainer.classList.add("zoom-cursor") : this.scrollContainer.classList.remove("zoom-cursor");
|
|
3242
3792
|
}, this.onMinimapMouseDown = (t) => {
|
|
3243
3793
|
this.scrollContainer && (t.preventDefault(), this.isDraggingMinimap = !0, this.scrollToMinimapPosition(t));
|
|
3244
3794
|
}, this.onMinimapMouseMove = (t) => {
|
|
@@ -3270,24 +3820,24 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3270
3820
|
this.movingEventOrigin.y
|
|
3271
3821
|
), l = this.convertPositionToDateTime(r, o);
|
|
3272
3822
|
if (a && l) {
|
|
3273
|
-
const c = l.getTime() - a.getTime(),
|
|
3823
|
+
const c = l.getTime() - a.getTime(), h = (f) => {
|
|
3274
3824
|
const v = f.getMinutes();
|
|
3275
3825
|
return f.setMinutes(Math.round(v / 15) * 15, 0, 0), f;
|
|
3276
|
-
},
|
|
3826
|
+
}, d = h(
|
|
3277
3827
|
new Date(this.movingEvent.start.getTime() + c)
|
|
3278
|
-
), u =
|
|
3828
|
+
), u = h(
|
|
3279
3829
|
new Date(this.movingEvent.end.getTime() + c)
|
|
3280
3830
|
);
|
|
3281
3831
|
this.movingEventDuplicateMode ? this.dispatchEvent(
|
|
3282
3832
|
new CustomEvent("create-event", {
|
|
3283
|
-
detail: { start:
|
|
3833
|
+
detail: { start: d, end: u },
|
|
3284
3834
|
bubbles: !0
|
|
3285
3835
|
})
|
|
3286
3836
|
) : this.dispatchEvent(
|
|
3287
3837
|
new CustomEvent("move-event", {
|
|
3288
3838
|
detail: {
|
|
3289
3839
|
event: this.movingEvent,
|
|
3290
|
-
start:
|
|
3840
|
+
start: d,
|
|
3291
3841
|
end: u
|
|
3292
3842
|
},
|
|
3293
3843
|
bubbles: !0
|
|
@@ -3320,7 +3870,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3320
3870
|
return;
|
|
3321
3871
|
}
|
|
3322
3872
|
const e = this.scrollContainer.getBoundingClientRect(), i = t.clientX - e.left, s = t.clientY - e.top + this.scrollTop;
|
|
3323
|
-
if (i <
|
|
3873
|
+
if (i < tt) {
|
|
3324
3874
|
this.onZoomHandleMouseDown(t);
|
|
3325
3875
|
return;
|
|
3326
3876
|
}
|
|
@@ -3361,19 +3911,19 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3361
3911
|
this.scheduledNotifications = t, this.requestUpdate();
|
|
3362
3912
|
}, this.onThemeChange = (t) => {
|
|
3363
3913
|
const i = t.target.value;
|
|
3364
|
-
this.currentTheme = i,
|
|
3914
|
+
this.currentTheme = i, Vs(i), js(i), this.renderCanvas();
|
|
3365
3915
|
}, this.onZoomSliderChange = (t) => {
|
|
3366
3916
|
const e = t.target, i = parseInt(e.value, 10), s = this.dayHeight;
|
|
3367
3917
|
if (!this.scrollContainer) {
|
|
3368
3918
|
this.setView(i, this.scrollTop);
|
|
3369
3919
|
return;
|
|
3370
3920
|
}
|
|
3371
|
-
const o = this.scrollContainer.clientHeight / 2, a = this.scrollTop + o, l = i / s,
|
|
3372
|
-
this.setView(i,
|
|
3373
|
-
}, this.minimapCanvas = document.createElement("canvas"), this.internal = new
|
|
3921
|
+
const o = this.scrollContainer.clientHeight / 2, a = this.scrollTop + o, l = i / s, h = a * l - o;
|
|
3922
|
+
this.setView(i, h);
|
|
3923
|
+
}, this.minimapCanvas = document.createElement("canvas"), this.internal = new Y({
|
|
3374
3924
|
locale: this.getAttribute("locale") || void 0,
|
|
3375
3925
|
weekStart: Number(this.getAttribute("week-start")),
|
|
3376
|
-
storage: new
|
|
3926
|
+
storage: new Zs()
|
|
3377
3927
|
}), this.addEventListener("wheel", this.onWheel, { passive: !1 }), this.addEventListener("dragstart", this.onDragStart), this.addEventListener("dragend", this.onDragEnd), this.addEventListener("dragover", this.onDragOver), this.addEventListener("dragleave", this.onDragLeave), this.addEventListener("drop", this.onDrop);
|
|
3378
3928
|
}
|
|
3379
3929
|
set dayHeight(t) {
|
|
@@ -3394,14 +3944,14 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3394
3944
|
this._dayHeight = t, this.updateWeekOffsets();
|
|
3395
3945
|
const l = this.totalHeight;
|
|
3396
3946
|
this._dayHeight = r, this.updateWeekOffsets();
|
|
3397
|
-
const c = a > 0 ? o / a : 0,
|
|
3947
|
+
const c = a > 0 ? o / a : 0, h = l > 0 ? e / l : 0, d = 600, u = performance.now(), f = (g) => g === 1 ? 1 : 1 - 2 ** (-10 * g), v = (g) => 1 - (1 - g) ** 3, p = (g) => {
|
|
3398
3948
|
if (!this.scrollAnimationFrame) return;
|
|
3399
|
-
const y = Math.min((
|
|
3949
|
+
const y = Math.min((g - u) / d, 1);
|
|
3400
3950
|
this._dayHeight = r + (t - r) * f(y), this.updateWeekOffsets();
|
|
3401
|
-
const M = c + (
|
|
3402
|
-
this._scrollTop = Math.max(0, M * this.totalHeight), this.scrollContainer && (this.scrollContent && this.scrollContainer.scrollHeight < this._scrollTop && (this.scrollContent.style.minHeight = this._scrollTop + window.innerHeight + "px"), this.scrollContainer.scrollTop = this._scrollTop), this.renderCanvas(), y < 1 ? this.scrollAnimationFrame = requestAnimationFrame(
|
|
3951
|
+
const M = c + (h - c) * v(y);
|
|
3952
|
+
this._scrollTop = Math.max(0, M * this.totalHeight), this.scrollContainer && (this.scrollContent && this.scrollContainer.scrollHeight < this._scrollTop && (this.scrollContent.style.minHeight = this._scrollTop + window.innerHeight + "px"), this.scrollContainer.scrollTop = this._scrollTop), this.renderCanvas(), y < 1 ? this.scrollAnimationFrame = requestAnimationFrame(p) : (this._dayHeight = t, this._scrollTop = e, this.saveDayHeight(), this.saveScrollPosition(), this.scrollAnimationFrame = null, this.renderCanvas());
|
|
3403
3953
|
};
|
|
3404
|
-
this.scrollAnimationFrame = requestAnimationFrame(
|
|
3954
|
+
this.scrollAnimationFrame = requestAnimationFrame(p);
|
|
3405
3955
|
return;
|
|
3406
3956
|
}
|
|
3407
3957
|
this._dayHeight = t, this._scrollTop = e, this.saveDayHeight(), this.updateWeekOffsets(), i && this.scrollContainer && this.scrollContent && (this.scrollContainer.scrollHeight < e && (this.scrollContent.style.minHeight = `${e + window.innerHeight}px`), this.scrollContainer.scrollTop = e), this.saveScrollPosition(), this.renderCanvas();
|
|
@@ -3422,16 +3972,16 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3422
3972
|
}
|
|
3423
3973
|
getVisualPositionFromCoords(t, e, i) {
|
|
3424
3974
|
if (!this.scrollContainer) return null;
|
|
3425
|
-
const s = i / this._columnsPerRow, r = Math.floor((t -
|
|
3975
|
+
const s = i / this._columnsPerRow, r = Math.floor((t - tt) / s);
|
|
3426
3976
|
if (r < 0 || r >= this._columnsPerRow) return null;
|
|
3427
3977
|
const o = this.weeks.find(
|
|
3428
|
-
(
|
|
3978
|
+
(d) => d.height > 0 && e >= d.yOffset && e < d.yOffset + d.height
|
|
3429
3979
|
);
|
|
3430
3980
|
if (!o) return null;
|
|
3431
3981
|
const a = this.dayHeight, c = Math.floor((e - o.yOffset) / a) * this._columnsPerRow + r;
|
|
3432
3982
|
if (c < 0 || c > 6) return null;
|
|
3433
|
-
const
|
|
3434
|
-
return { dayIndex: c, timeFraction:
|
|
3983
|
+
const h = (e - o.yOffset) % a / a;
|
|
3984
|
+
return { dayIndex: c, timeFraction: h, weekYOffset: o.yOffset };
|
|
3435
3985
|
}
|
|
3436
3986
|
get filter() {
|
|
3437
3987
|
return this.internal.getFilter();
|
|
@@ -3442,9 +3992,9 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3442
3992
|
loadDayHeight() {
|
|
3443
3993
|
const t = localStorage.getItem("calendar-dayHeight");
|
|
3444
3994
|
return t ? Math.max(
|
|
3445
|
-
|
|
3446
|
-
Math.min(
|
|
3447
|
-
) :
|
|
3995
|
+
jt,
|
|
3996
|
+
Math.min(De, parseFloat(t))
|
|
3997
|
+
) : jt;
|
|
3448
3998
|
}
|
|
3449
3999
|
saveDayHeight() {
|
|
3450
4000
|
localStorage.setItem("calendar-dayHeight", this.dayHeight.toString());
|
|
@@ -3491,17 +4041,17 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3491
4041
|
scrollToDate(t, e = 0.5, i = !1, s = !1, r) {
|
|
3492
4042
|
const o = r ?? this._dayHeight;
|
|
3493
4043
|
let a = this.weeks.findIndex(
|
|
3494
|
-
(l) => l.days.some((c) =>
|
|
4044
|
+
(l) => l.days.some((c) => Y.isSameDay(c, t)) || l.days[0] && l.days[6] && l.days[0] <= t && t <= l.days[6]
|
|
3495
4045
|
);
|
|
3496
4046
|
if (a < 0 && s && (this.weeks = this.internal.resetRangeAroundDate(t), a = this.weeks.findIndex(
|
|
3497
|
-
(l) => l.days.some((c) =>
|
|
4047
|
+
(l) => l.days.some((c) => Y.isSameDay(c, t)) || l.days[0] && l.days[6] && l.days[0] <= t && t <= l.days[6]
|
|
3498
4048
|
)), a >= 0) {
|
|
3499
4049
|
const l = this._dayHeight;
|
|
3500
4050
|
this._dayHeight = o, this.updateWeekOffsets();
|
|
3501
4051
|
const c = this.weeks[a];
|
|
3502
4052
|
if (c) {
|
|
3503
|
-
const
|
|
3504
|
-
this._dayHeight = l, i && this.updateWeekOffsets(), this.setView(o,
|
|
4053
|
+
const h = c.yOffset + c.height * e, d = Math.max(0, h - this.viewportHeight / 2);
|
|
4054
|
+
this._dayHeight = l, i && this.updateWeekOffsets(), this.setView(o, d, !0, i);
|
|
3505
4055
|
} else
|
|
3506
4056
|
this._dayHeight = l, this.updateWeekOffsets();
|
|
3507
4057
|
}
|
|
@@ -3546,9 +4096,21 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3546
4096
|
t.style.top = `${l}px`;
|
|
3547
4097
|
}
|
|
3548
4098
|
async firstUpdated() {
|
|
3549
|
-
this.canvas = this.renderRoot.querySelector(".canvas-layer canvas"), this.overlayCanvas = this.renderRoot.querySelector(".overlay-canvas"), this.scrollContainer = this.renderRoot.querySelector(".scroll-container"), this.scrollContent = this.renderRoot.querySelector(".scroll-content"), this.ctx = this.canvas?.getContext("2d") ?? null, this.overlayCtx = this.overlayCanvas?.getContext("2d") ?? null, this.minimapBufferCanvas = document.createElement("canvas"), this.minimapBufferCtx = this.minimapBufferCanvas.getContext("2d")
|
|
3550
|
-
const t = this
|
|
3551
|
-
|
|
4099
|
+
this.canvas = this.renderRoot.querySelector(".canvas-layer canvas"), this.overlayCanvas = this.renderRoot.querySelector(".overlay-canvas"), this.scrollContainer = this.renderRoot.querySelector(".scroll-container"), this.scrollContent = this.renderRoot.querySelector(".scroll-content"), this.ctx = this.canvas?.getContext("2d") ?? null, this.overlayCtx = this.overlayCanvas?.getContext("2d") ?? null, this.minimapBufferCanvas = document.createElement("canvas"), this.minimapBufferCtx = this.minimapBufferCanvas.getContext("2d");
|
|
4100
|
+
const t = this, e = {
|
|
4101
|
+
get events() {
|
|
4102
|
+
return t.events;
|
|
4103
|
+
},
|
|
4104
|
+
get hoveredEventId() {
|
|
4105
|
+
return t.hoveredEventId;
|
|
4106
|
+
},
|
|
4107
|
+
isEventSelected: (r) => t.internal.isEventSelected(r),
|
|
4108
|
+
shouldRenderEventWithStripes: (r) => t.shouldRenderEventWithStripes(r),
|
|
4109
|
+
getStripePatternCanvas: () => t.getStripePatternCanvas()
|
|
4110
|
+
};
|
|
4111
|
+
this.eventsLayer = Js(e), this.layers = [Gs(), this.eventsLayer], this.weeks = this.internal.generateWeeks();
|
|
4112
|
+
const i = this.loadDayHeight();
|
|
4113
|
+
i !== 80 && (this.dayHeight = i), this.scrollContainer && (this.scrollContainer.addEventListener("scroll", this.onScroll, {
|
|
3552
4114
|
passive: !1
|
|
3553
4115
|
}), this.scrollContainer.addEventListener(
|
|
3554
4116
|
"mouseleave",
|
|
@@ -3558,15 +4120,15 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3558
4120
|
}), this.resizeObserver.observe(this), this.timeUpdateInterval = setInterval(() => {
|
|
3559
4121
|
this.currentTime = /* @__PURE__ */ new Date(), this.renderCanvas(), this.requestUpdate();
|
|
3560
4122
|
}, 1e4), this.loadScrollPosition();
|
|
3561
|
-
let
|
|
3562
|
-
for await (const
|
|
3563
|
-
this.events =
|
|
3564
|
-
const
|
|
3565
|
-
!
|
|
4123
|
+
let s = this.filter;
|
|
4124
|
+
for await (const r of this.internal.events()) {
|
|
4125
|
+
this.events = r, this.renderCanvas();
|
|
4126
|
+
const o = this.filter, a = s && s.trim().length > 0, l = o && o.trim().length > 0;
|
|
4127
|
+
!a && l ? (this.pushFilterToHistory(), this.isFiltered = !0, this.updateWeekOffsets(), this.renderCanvas(), this.renderMinimapBuffer()) : a && !l ? (this.updateWeekOffsets(), this.renderCanvas(), this.renderMinimapBuffer(), requestAnimationFrame(() => {
|
|
3566
4128
|
this.popFilterFromHistory(), this.isFiltered = !1;
|
|
3567
|
-
})) :
|
|
4129
|
+
})) : a && l && s !== o ? (this.updateWeekOffsets(), this.renderCanvas(), this.renderMinimapBuffer(), requestAnimationFrame(() => {
|
|
3568
4130
|
this.replaceFilterInHistory();
|
|
3569
|
-
})) : (this.updateWeekOffsets(), this.renderCanvas(), this.renderMinimapBuffer()), this.requestUpdate(),
|
|
4131
|
+
})) : (this.updateWeekOffsets(), this.renderCanvas(), this.renderMinimapBuffer()), this.requestUpdate(), s = this.filter;
|
|
3570
4132
|
}
|
|
3571
4133
|
}
|
|
3572
4134
|
updateWeekOffsets() {
|
|
@@ -3574,8 +4136,8 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3574
4136
|
const e = this.dayHeight * this.rowsPerWeek;
|
|
3575
4137
|
if (this.filter) {
|
|
3576
4138
|
const s = this.events.map((r) => ({
|
|
3577
|
-
start:
|
|
3578
|
-
end:
|
|
4139
|
+
start: Y.startOfDayTime(r.start),
|
|
4140
|
+
end: Y.endOfDayTime(r.end)
|
|
3579
4141
|
}));
|
|
3580
4142
|
for (const r of this.weeks) {
|
|
3581
4143
|
r.yOffset = t;
|
|
@@ -3593,444 +4155,67 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
3593
4155
|
if (!this.canvas || !this.scrollContainer) return;
|
|
3594
4156
|
const t = this.scrollContainer.getBoundingClientRect(), e = window.devicePixelRatio || 1;
|
|
3595
4157
|
if (this.rect = t, this.canvas.width = t.width * e, this.canvas.height = t.height * e, this.viewportHeight = t.height, this.ctx = this.canvas.getContext("2d"), this.ctx && this.ctx.scale(e, e), this.overlayCanvas) {
|
|
3596
|
-
const i = t.width -
|
|
4158
|
+
const i = t.width - tt - ji;
|
|
3597
4159
|
this.overlayCanvas.width = i * e, this.overlayCanvas.height = t.height * e, this.overlayCanvas.style.width = `${i}px`, this.overlayCanvas.style.height = `${t.height}px`, this.overlayCtx = this.overlayCanvas.getContext("2d"), this.overlayCtx && this.overlayCtx.scale(e, e);
|
|
3598
4160
|
}
|
|
3599
4161
|
this.updateColumnsForViewport(), this.renderCanvas();
|
|
3600
4162
|
}
|
|
3601
4163
|
updateColumnsForViewport() {
|
|
3602
4164
|
if (!this.scrollContainer) return;
|
|
3603
|
-
const e = this.scrollContainer.getBoundingClientRect().width -
|
|
4165
|
+
const e = this.scrollContainer.getBoundingClientRect().width - tt, s = Math.max(
|
|
3604
4166
|
1,
|
|
3605
4167
|
Math.min(7, Math.floor(e / 120))
|
|
3606
4168
|
);
|
|
3607
4169
|
this._columnsPerRow !== s && (this._columnsPerRow = s, this.updateWeekOffsets());
|
|
3608
4170
|
}
|
|
4171
|
+
resolveStyles() {
|
|
4172
|
+
const t = getComputedStyle(this), e = [
|
|
4173
|
+
"--bg-today",
|
|
4174
|
+
"--accent-current-time",
|
|
4175
|
+
"--grid-color",
|
|
4176
|
+
"--grid-color-strong",
|
|
4177
|
+
"--grid-color-hover",
|
|
4178
|
+
"--text-muted",
|
|
4179
|
+
"--text-primary",
|
|
4180
|
+
"--text-inverse",
|
|
4181
|
+
"--bg-primary",
|
|
4182
|
+
"--bg-elevated"
|
|
4183
|
+
], i = {};
|
|
4184
|
+
for (const s of e)
|
|
4185
|
+
i[s] = t.getPropertyValue(s).trim();
|
|
4186
|
+
return i;
|
|
4187
|
+
}
|
|
3609
4188
|
renderCanvas() {
|
|
3610
4189
|
if (!this.ctx || !this.canvas || !this.scrollContainer) return;
|
|
3611
4190
|
const t = this.ctx, e = this.canvas.width / (window.devicePixelRatio || 1), i = this.canvas.height / (window.devicePixelRatio || 1), s = getComputedStyle(this).fontFamily;
|
|
3612
4191
|
t.clearRect(0, 0, e, i);
|
|
3613
|
-
const r = this.scrollTop, a = (e -
|
|
4192
|
+
const r = this.scrollTop, a = (e - tt) / this._columnsPerRow, l = this.weeks.filter(
|
|
3614
4193
|
(h) => h.height > 0 && h.yOffset + h.height > r && h.yOffset < r + i
|
|
3615
|
-
),
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
for (
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
}
|
|
3636
|
-
for (let h = 0; h < c.length; h++) {
|
|
3637
|
-
const u = c[h];
|
|
3638
|
-
if (!u) continue;
|
|
3639
|
-
const f = u.yOffset - r;
|
|
3640
|
-
if (this.filter && h > 0) {
|
|
3641
|
-
const E = c[h - 1];
|
|
3642
|
-
if (!E) continue;
|
|
3643
|
-
const S = this.weeks.indexOf(E), _ = this.weeks.indexOf(u) - S - 1;
|
|
3644
|
-
if (_ > 0) {
|
|
3645
|
-
const b = f, x = getComputedStyle(this).getPropertyValue("--grid-color-strong").trim() || "rgba(255, 255, 255, 0.3)";
|
|
3646
|
-
t.strokeStyle = x, t.lineWidth = 1, t.setLineDash([4, 4]), t.beginPath(), t.moveTo(z, b), t.lineTo(e, b), t.stroke(), t.setLineDash([]);
|
|
3647
|
-
const T = getComputedStyle(this).getPropertyValue("--text-muted").trim() || "rgba(255, 255, 255, 0.4)";
|
|
3648
|
-
t.fillStyle = T, t.textAlign = "center";
|
|
3649
|
-
const C = `⋯ ${_} week${_ > 1 ? "s" : ""}`, U = t.measureText(C).width, L = 8, P = (z + e) / 2 - U / 2 - L, B = b - 8, R = U + L * 2, W = 16, K = getComputedStyle(this).getPropertyValue("--bg-primary").trim() || "rgba(30, 30, 30, 0.9)";
|
|
3650
|
-
t.fillStyle = K, t.beginPath(), t.roundRect(P, B, R, W, 8), t.fill(), t.fillStyle = T, t.fillText(C, (z + e) / 2, b + 4);
|
|
3651
|
-
}
|
|
3652
|
-
}
|
|
3653
|
-
t.strokeStyle = getComputedStyle(this).getPropertyValue("--grid-color").trim() || "rgba(255, 255, 255, 0.1)", t.beginPath(), t.moveTo(z, f), t.lineTo(e, f), t.stroke();
|
|
3654
|
-
for (let E = 1; E < this.rowsPerWeek; E++) {
|
|
3655
|
-
const S = f + E * this.dayHeight;
|
|
3656
|
-
S >= 0 && S <= i && (t.beginPath(), t.moveTo(z, S), t.lineTo(e, S), t.stroke());
|
|
3657
|
-
}
|
|
3658
|
-
const v = Math.max(
|
|
3659
|
-
0,
|
|
3660
|
-
Math.min(1, (this.dayHeight - 300) / 300)
|
|
3661
|
-
);
|
|
3662
|
-
t.font = `500 11px ${s}`, t.textBaseline = "bottom", t.textAlign = "right";
|
|
3663
|
-
const g = getComputedStyle(this).getPropertyValue("--grid-color").trim() || "rgba(255, 255, 255, 0.1)", p = getComputedStyle(this).getPropertyValue("--text-muted").trim() || "rgba(255, 255, 255, 0.4)";
|
|
3664
|
-
t.strokeStyle = g.replace(
|
|
3665
|
-
/[\d.]+\)$/,
|
|
3666
|
-
`${0.05 * v})`
|
|
3667
|
-
), t.fillStyle = p.replace(
|
|
3668
|
-
/[\d.]+\)$/,
|
|
3669
|
-
`${0.4 * v})`
|
|
3670
|
-
);
|
|
3671
|
-
for (let E = 0; E < this.rowsPerWeek; E++) {
|
|
3672
|
-
const S = f + E * this.dayHeight;
|
|
3673
|
-
for (let A = 0; A < 24; A++) {
|
|
3674
|
-
const _ = S + A / 24 * this.dayHeight;
|
|
3675
|
-
if (_ >= 0 && _ <= i && (t.beginPath(), t.moveTo(z, _), t.lineTo(e, _), t.stroke(), v > 0.1)) {
|
|
3676
|
-
const b = `${A.toString().padStart(2, "0")}:00`;
|
|
3677
|
-
t.fillText(b, 48, _ + 4);
|
|
3678
|
-
}
|
|
3679
|
-
}
|
|
3680
|
-
}
|
|
3681
|
-
if (v > 0.1) {
|
|
3682
|
-
const E = /* @__PURE__ */ new Date(), S = u.days.findIndex(
|
|
3683
|
-
(A) => N.isSameDay(A, E)
|
|
3684
|
-
);
|
|
3685
|
-
if (S >= 0) {
|
|
3686
|
-
const { row: A } = this.getDayVisualPosition(S), _ = E.getHours() * 60 + E.getMinutes(), b = f + A * this.dayHeight + _ / 1440 * this.dayHeight;
|
|
3687
|
-
if (b >= 0 && b <= i) {
|
|
3688
|
-
const x = E.getHours().toString().padStart(2, "0"), T = E.getMinutes().toString().padStart(2, "0"), C = `${x}:${T}`;
|
|
3689
|
-
t.save(), t.textAlign = "right", t.textBaseline = "middle";
|
|
3690
|
-
const U = t.measureText(C).width, L = 6, P = 48, B = b, R = getComputedStyle(this).getPropertyValue("--bg-elevated").trim() || "rgba(0, 0, 0, 0.7)";
|
|
3691
|
-
t.fillStyle = R, t.beginPath(), t.roundRect(
|
|
3692
|
-
P - U - L,
|
|
3693
|
-
B - 8,
|
|
3694
|
-
U + L * 2,
|
|
3695
|
-
16,
|
|
3696
|
-
4
|
|
3697
|
-
), t.fill(), t.fillStyle = getComputedStyle(this).getPropertyValue("--text-primary").trim() || "rgba(255, 255, 255, 1)", t.fillText(C, P, B), t.restore();
|
|
3698
|
-
}
|
|
3699
|
-
}
|
|
3700
|
-
}
|
|
3701
|
-
const y = Math.max(
|
|
3702
|
-
0,
|
|
3703
|
-
Math.min(1, 1 - (this.dayHeight - 300) / 50)
|
|
3704
|
-
), M = getComputedStyle(this).getPropertyValue("--text-muted").trim() || "rgba(255, 255, 255, 0.4)";
|
|
3705
|
-
t.fillStyle = M.replace(
|
|
3706
|
-
/[\d.]+\)$/,
|
|
3707
|
-
`${0.4 * y})`
|
|
3708
|
-
), t.textAlign = "center";
|
|
3709
|
-
const H = `W${u.weekNumber}`, $ = f, w = f + u.height, D = Math.max(
|
|
3710
|
-
14,
|
|
3711
|
-
Math.min($ + u.height / 2 + 4, w - 4)
|
|
3712
|
-
);
|
|
3713
|
-
D >= Math.max(0, $ + 4) && D <= Math.min(i, w) && y > 0.1 && t.fillText(H, 30, D);
|
|
3714
|
-
}
|
|
3715
|
-
this.renderEventsOnCanvas(t, r, i, a, c), this.renderDateLabels(), this.renderWeekdayLabels(t, a, c, r, i), this.isCreatingEvent && this.renderEventCreationPreview(), this.isDraggingEvent && this.renderEventMovePreview(), this.renderMinimap();
|
|
4194
|
+
), c = {
|
|
4195
|
+
ctx: t,
|
|
4196
|
+
width: e,
|
|
4197
|
+
height: i,
|
|
4198
|
+
scrollTop: r,
|
|
4199
|
+
dayWidth: a,
|
|
4200
|
+
dayHeight: this.dayHeight,
|
|
4201
|
+
leftGutterWidth: tt,
|
|
4202
|
+
columnsPerRow: this._columnsPerRow,
|
|
4203
|
+
rowsPerWeek: this.rowsPerWeek,
|
|
4204
|
+
visibleWeeks: l,
|
|
4205
|
+
allWeeks: this.weeks,
|
|
4206
|
+
fontFamily: s,
|
|
4207
|
+
styles: this.resolveStyles(),
|
|
4208
|
+
getDayVisualPosition: (h) => this.getDayVisualPosition(h),
|
|
4209
|
+
filter: this.filter
|
|
4210
|
+
};
|
|
4211
|
+
for (const h of this.layers)
|
|
4212
|
+
h.enabled && (t.save(), h.render(c), t.restore());
|
|
4213
|
+
this.eventsLayer ? this.eventRects = this.eventsLayer.eventRects : this.eventRects = [], this.renderDateLabels(), this.renderWeekdayLabels(t, a, l, r, i), this.isCreatingEvent && this.renderEventCreationPreview(), this.isDraggingEvent && this.renderEventMovePreview(), this.renderMinimap();
|
|
3716
4214
|
}
|
|
3717
|
-
|
|
3718
|
-
const
|
|
3719
|
-
if (
|
|
3720
|
-
|
|
3721
|
-
for (const b of o) {
|
|
3722
|
-
const x = b.start.getTime(), T = b.end.getTime();
|
|
3723
|
-
if (T < v || x > g)
|
|
3724
|
-
continue;
|
|
3725
|
-
const C = [];
|
|
3726
|
-
for (const P of r) {
|
|
3727
|
-
const B = P.days[0], R = P.days[6];
|
|
3728
|
-
if (!B || !R) continue;
|
|
3729
|
-
const W = B.getTime(), K = R.getTime() + 86399999;
|
|
3730
|
-
if (T >= W && x <= K) {
|
|
3731
|
-
const J = this.weeks.indexOf(P);
|
|
3732
|
-
C.push({ weekIndex: J, week: P });
|
|
3733
|
-
}
|
|
3734
|
-
}
|
|
3735
|
-
const U = C.length, L = b.isAllDay === !0;
|
|
3736
|
-
for (let P = 0; P < C.length; P++) {
|
|
3737
|
-
const { weekIndex: B, week: R } = C[P], W = P === 0, K = P === C.length - 1;
|
|
3738
|
-
let J = 0, wt = 6;
|
|
3739
|
-
if (W && (J = Ui(R, b.start)), K) {
|
|
3740
|
-
const ut = L ? new Date(b.end.getTime() - 1) : b.end;
|
|
3741
|
-
wt = Ui(R, ut);
|
|
3742
|
-
}
|
|
3743
|
-
const rt = {
|
|
3744
|
-
event: b,
|
|
3745
|
-
weekIndex: B,
|
|
3746
|
-
week: R,
|
|
3747
|
-
startDayIndex: J,
|
|
3748
|
-
endDayIndex: wt,
|
|
3749
|
-
isStart: W,
|
|
3750
|
-
isEnd: K,
|
|
3751
|
-
totalWeeks: U
|
|
3752
|
-
};
|
|
3753
|
-
L ? H.push(rt) : $.push(rt);
|
|
3754
|
-
}
|
|
3755
|
-
}
|
|
3756
|
-
const w = c ? $.flatMap((b) => {
|
|
3757
|
-
if (b.startDayIndex === b.endDayIndex) return [b];
|
|
3758
|
-
const x = [];
|
|
3759
|
-
for (let T = b.startDayIndex; T <= b.endDayIndex; T++)
|
|
3760
|
-
x.push({
|
|
3761
|
-
...b,
|
|
3762
|
-
startDayIndex: T,
|
|
3763
|
-
endDayIndex: T,
|
|
3764
|
-
isStart: T === b.startDayIndex && b.isStart,
|
|
3765
|
-
isEnd: T === b.endDayIndex && b.isEnd,
|
|
3766
|
-
totalWeeks: 1
|
|
3767
|
-
});
|
|
3768
|
-
return x;
|
|
3769
|
-
}) : $;
|
|
3770
|
-
M.push(...H, ...w);
|
|
3771
|
-
const D = /* @__PURE__ */ new Map();
|
|
3772
|
-
for (const b of M) {
|
|
3773
|
-
const x = b.event.isAllDay === !0;
|
|
3774
|
-
if (c && !x)
|
|
3775
|
-
for (let T = b.startDayIndex; T <= b.endDayIndex; T++) {
|
|
3776
|
-
const C = `${b.weekIndex}-${T}`;
|
|
3777
|
-
D.has(C) || D.set(C, []), D.get(C).push(b);
|
|
3778
|
-
}
|
|
3779
|
-
}
|
|
3780
|
-
const E = /* @__PURE__ */ new Map();
|
|
3781
|
-
for (const [b, x] of D) {
|
|
3782
|
-
const [T, C] = b.split("-"), U = parseInt(C), L = parseInt(T), P = [];
|
|
3783
|
-
for (const R of x) {
|
|
3784
|
-
const W = this.weeks[L];
|
|
3785
|
-
if (!W) continue;
|
|
3786
|
-
const K = new Date(W.days[U]).setHours(
|
|
3787
|
-
0,
|
|
3788
|
-
0,
|
|
3789
|
-
0,
|
|
3790
|
-
0
|
|
3791
|
-
), J = new Date(W.days[U]).setHours(
|
|
3792
|
-
23,
|
|
3793
|
-
59,
|
|
3794
|
-
59,
|
|
3795
|
-
999
|
|
3796
|
-
), wt = R.event.start.getTime(), rt = R.event.end.getTime() - 6e4, ut = Math.max(wt, K), Q = Math.min(rt, J), X = new Date(ut), Tt = new Date(Q), Qt = X.getHours() * 60 + X.getMinutes(), kt = Tt.getHours() * 60 + Tt.getMinutes();
|
|
3797
|
-
P.push({ segment: R, startMinutes: Qt, endMinutes: kt });
|
|
3798
|
-
}
|
|
3799
|
-
P.sort((R, W) => R.startMinutes !== W.startMinutes ? R.startMinutes - W.startMinutes : W.endMinutes - W.startMinutes - (R.endMinutes - R.startMinutes));
|
|
3800
|
-
const B = [];
|
|
3801
|
-
for (const R of P) {
|
|
3802
|
-
let W = 0;
|
|
3803
|
-
for (; W < B.length && !(B[W].endMinutes <= R.startMinutes); W++)
|
|
3804
|
-
;
|
|
3805
|
-
W === B.length ? B.push({ endMinutes: R.endMinutes }) : B[W].endMinutes = R.endMinutes;
|
|
3806
|
-
const K = `${R.segment.weekIndex}-${R.segment.event.id}-${U}`;
|
|
3807
|
-
E.set(K, {
|
|
3808
|
-
column: W,
|
|
3809
|
-
totalColumns: B.length
|
|
3810
|
-
});
|
|
3811
|
-
}
|
|
3812
|
-
for (const R of P) {
|
|
3813
|
-
const W = `${R.segment.weekIndex}-${R.segment.event.id}-${U}`, K = E.get(W);
|
|
3814
|
-
K && (K.totalColumns = B.length);
|
|
3815
|
-
}
|
|
3816
|
-
}
|
|
3817
|
-
for (const b of M) {
|
|
3818
|
-
const {
|
|
3819
|
-
event: x,
|
|
3820
|
-
week: T,
|
|
3821
|
-
weekIndex: C,
|
|
3822
|
-
startDayIndex: U,
|
|
3823
|
-
endDayIndex: L,
|
|
3824
|
-
isStart: P,
|
|
3825
|
-
isEnd: B,
|
|
3826
|
-
totalWeeks: R
|
|
3827
|
-
} = b, W = T.yOffset, K = x.isAllDay === !0, J = this.getDayVisualPosition(U), wt = this.getDayVisualPosition(L);
|
|
3828
|
-
J.row, wt.row;
|
|
3829
|
-
let rt, ut;
|
|
3830
|
-
if (c && !K) {
|
|
3831
|
-
const nt = new Date(T.days[U]).setHours(
|
|
3832
|
-
0,
|
|
3833
|
-
0,
|
|
3834
|
-
0,
|
|
3835
|
-
0
|
|
3836
|
-
), q = new Date(T.days[L]).setHours(
|
|
3837
|
-
23,
|
|
3838
|
-
59,
|
|
3839
|
-
59,
|
|
3840
|
-
999
|
|
3841
|
-
), Et = x.start.getTime(), gt = x.end.getTime() - 6e4, st = Math.max(Et, nt), j = Math.min(gt, q), pt = new Date(st), vt = new Date(j), Pt = pt.getHours() * 60 + pt.getMinutes(), Rt = vt.getHours() * 60 + vt.getMinutes(), $t = W + J.row * this.dayHeight;
|
|
3842
|
-
rt = $t + Pt / 1440 * this.dayHeight, ut = $t + Rt / 1440 * this.dayHeight;
|
|
3843
|
-
} else {
|
|
3844
|
-
const nt = `${C}-${x.id}`;
|
|
3845
|
-
let q = y.get(nt);
|
|
3846
|
-
if (q === void 0) {
|
|
3847
|
-
for (q = 0; ; ) {
|
|
3848
|
-
let st = !0;
|
|
3849
|
-
for (let j = U; j <= L; j++) {
|
|
3850
|
-
const pt = `${C}-${j}`;
|
|
3851
|
-
if (p.get(pt)?.has(q)) {
|
|
3852
|
-
st = !1;
|
|
3853
|
-
break;
|
|
3854
|
-
}
|
|
3855
|
-
}
|
|
3856
|
-
if (st) break;
|
|
3857
|
-
q++;
|
|
3858
|
-
}
|
|
3859
|
-
y.set(nt, q);
|
|
3860
|
-
}
|
|
3861
|
-
for (let st = U; st <= L; st++) {
|
|
3862
|
-
const j = `${C}-${st}`;
|
|
3863
|
-
let pt = p.get(j);
|
|
3864
|
-
pt || (pt = /* @__PURE__ */ new Set(), p.set(j, pt)), pt.add(q);
|
|
3865
|
-
}
|
|
3866
|
-
const Et = Math.floor(
|
|
3867
|
-
(this.dayHeight - 4) / (ye + 2)
|
|
3868
|
-
);
|
|
3869
|
-
if (q >= Et) continue;
|
|
3870
|
-
rt = W + J.row * this.dayHeight + 4 + q * (ye + 2), ut = rt + ye;
|
|
3871
|
-
}
|
|
3872
|
-
const Q = Math.max(
|
|
3873
|
-
c ? 4 : ye,
|
|
3874
|
-
ut - rt
|
|
3875
|
-
);
|
|
3876
|
-
let X, Tt;
|
|
3877
|
-
const Qt = `${C}-${x.id}-${U}`, kt = E.get(Qt);
|
|
3878
|
-
if (c && !K && kt && kt.totalColumns > 1) {
|
|
3879
|
-
const nt = s / kt.totalColumns;
|
|
3880
|
-
X = z + J.col * s + kt.column * nt, Tt = nt;
|
|
3881
|
-
} else {
|
|
3882
|
-
const nt = wt.col - J.col + 1;
|
|
3883
|
-
X = z + J.col * s, Tt = nt * s;
|
|
3884
|
-
}
|
|
3885
|
-
const ft = rt - e;
|
|
3886
|
-
if (ft + Q < 0 || ft > i) continue;
|
|
3887
|
-
const $e = x.color || "#888888", Ht = this.internal.isEventSelected(x), sn = this.hoveredEventId === x.id, ct = 2, Dt = Tt - ct * 2, te = 3, si = 6;
|
|
3888
|
-
let Ct = 4, zt = 4, Mt = 4, Ft = 4;
|
|
3889
|
-
R > 1 && (P && !B ? (zt = 0, Ft = 0) : !P && B ? (Ct = 0, Mt = 0) : !P && !B && (Ct = 0, zt = 0, Mt = 0, Ft = 0)), t.save(), x.readOnly && (t.globalAlpha = 0.5);
|
|
3890
|
-
const Bt = Ps(Re($e)), ri = getComputedStyle(this).getPropertyValue("--text-primary").trim() || "rgba(255, 255, 255, 0.9)", Ae = getComputedStyle(this).getPropertyValue("--text-inverse").trim() || "rgb(0, 0, 0)", rn = Ht ? $e : `hsla(${Bt[0]}, ${Math.min(Bt[1] * 0.9, 90)}%, ${Math.min(
|
|
3891
|
-
Bt[2] + 15,
|
|
3892
|
-
40
|
|
3893
|
-
)}%, 0.45)`, on = Ht ? $e : `hsla(${Bt[0]}, ${Math.min(Bt[1] * 0.9, 90)}%, ${Math.min(
|
|
3894
|
-
Bt[2] + 10,
|
|
3895
|
-
70
|
|
3896
|
-
)}%, 1)`, an = this.shouldRenderEventWithStripes(x);
|
|
3897
|
-
if (t.beginPath(), t.roundRect(X + ct, ft, Dt, Q, [
|
|
3898
|
-
Ct,
|
|
3899
|
-
zt,
|
|
3900
|
-
Ft,
|
|
3901
|
-
Mt
|
|
3902
|
-
]), t.fillStyle = rn, t.fill(), an) {
|
|
3903
|
-
const nt = this.getStripePatternCanvas();
|
|
3904
|
-
if (nt) {
|
|
3905
|
-
t.save(), t.beginPath(), t.roundRect(X + ct, ft, Dt, Q, [
|
|
3906
|
-
Ct,
|
|
3907
|
-
zt,
|
|
3908
|
-
Ft,
|
|
3909
|
-
Mt
|
|
3910
|
-
]), t.clip();
|
|
3911
|
-
const q = 12, Et = Math.floor((X + ct) / q) * q, gt = Math.floor(rt / q) * q - e;
|
|
3912
|
-
for (let st = gt; st < ft + Q; st += q)
|
|
3913
|
-
for (let j = Et; j < X + ct + Dt; j += q)
|
|
3914
|
-
t.drawImage(nt, j, st, q, q);
|
|
3915
|
-
t.restore();
|
|
3916
|
-
}
|
|
3917
|
-
}
|
|
3918
|
-
if (Ht || (t.fillStyle = on, t.beginPath(), t.roundRect(
|
|
3919
|
-
X + ct + 2,
|
|
3920
|
-
ft + 2,
|
|
3921
|
-
te,
|
|
3922
|
-
Q - 4,
|
|
3923
|
-
[Ct, Ct, Mt, Mt]
|
|
3924
|
-
), t.fill()), Ht && (t.strokeStyle = Ae, t.lineWidth = 1, t.beginPath(), t.roundRect(X + ct, ft, Dt, Q, [
|
|
3925
|
-
Ct,
|
|
3926
|
-
zt,
|
|
3927
|
-
Ft,
|
|
3928
|
-
Mt
|
|
3929
|
-
]), t.stroke()), sn && !Ht && (t.strokeStyle = getComputedStyle(this).getPropertyValue("--grid-color-hover").trim() || "rgba(255, 255, 255, 0.2)", t.lineWidth = 1, t.beginPath(), t.roundRect(X + ct, ft, Dt, Q, [
|
|
3930
|
-
Ct,
|
|
3931
|
-
zt,
|
|
3932
|
-
Ft,
|
|
3933
|
-
Mt
|
|
3934
|
-
]), t.stroke()), P && Q >= 16) {
|
|
3935
|
-
const nt = Ht ? Ae : ri;
|
|
3936
|
-
t.fillStyle = nt, t.font = `11px ${a}`, t.textAlign = "left", t.textBaseline = "top";
|
|
3937
|
-
const q = X + ct + te + si + 1, Et = ft + 6;
|
|
3938
|
-
let gt = Dt - te - si - 4;
|
|
3939
|
-
if (t.save(), t.beginPath(), t.rect(
|
|
3940
|
-
X + ct + te,
|
|
3941
|
-
ft,
|
|
3942
|
-
Dt - te,
|
|
3943
|
-
Q
|
|
3944
|
-
), t.clip(), x.rrule) {
|
|
3945
|
-
t.font = `11px ${a}`;
|
|
3946
|
-
const vt = "⟳", Pt = t.measureText(vt).width;
|
|
3947
|
-
t.fillText(vt, q, Et), gt -= Pt + 4;
|
|
3948
|
-
}
|
|
3949
|
-
const st = q + (x.rrule ? t.measureText("⟳").width + 4 : 0);
|
|
3950
|
-
let j = x.title;
|
|
3951
|
-
if (t.font = `11px ${a}`, t.measureText(j).width > gt) {
|
|
3952
|
-
const Pt = t.measureText("…").width;
|
|
3953
|
-
let Rt = 0, $t = j.length, fe = 0;
|
|
3954
|
-
for (; Rt <= $t; ) {
|
|
3955
|
-
const ht = Math.floor((Rt + $t) / 2), oi = j.substring(0, ht);
|
|
3956
|
-
t.measureText(oi).width + Pt <= gt ? (fe = ht, Rt = ht + 1) : $t = ht - 1;
|
|
3957
|
-
}
|
|
3958
|
-
j = j.substring(0, fe) + "…";
|
|
3959
|
-
}
|
|
3960
|
-
if (t.fillText(j, st, Et), Q >= 32) {
|
|
3961
|
-
const vt = (ge) => {
|
|
3962
|
-
const pe = ge.getHours(), ee = ge.getMinutes(), ie = pe >= 12 ? "PM" : "AM";
|
|
3963
|
-
return `${pe % 12 || 12}:${ee.toString().padStart(2, "0")} ${ie}`;
|
|
3964
|
-
}, Pt = vt(x.start), Rt = vt(x.end), $t = `${Pt} – ${Rt}`, fe = Ht ? Ae : ri;
|
|
3965
|
-
t.fillStyle = fe, t.font = `10px ${a}`;
|
|
3966
|
-
let ht = $t;
|
|
3967
|
-
if (t.measureText(ht).width > gt) {
|
|
3968
|
-
const pe = t.measureText("…").width;
|
|
3969
|
-
let ee = 0, ie = ht.length, Oe = 0;
|
|
3970
|
-
for (; ee <= ie; ) {
|
|
3971
|
-
const ve = Math.floor((ee + ie) / 2), ln = ht.substring(0, ve);
|
|
3972
|
-
t.measureText(ln).width + pe <= gt ? (Oe = ve, ee = ve + 1) : ie = ve - 1;
|
|
3973
|
-
}
|
|
3974
|
-
ht = ht.substring(0, Oe) + "…";
|
|
3975
|
-
}
|
|
3976
|
-
t.fillText(ht, q, Et + 14);
|
|
3977
|
-
}
|
|
3978
|
-
t.restore();
|
|
3979
|
-
}
|
|
3980
|
-
t.restore(), this.eventRects.push({
|
|
3981
|
-
event: x,
|
|
3982
|
-
x: X + ct,
|
|
3983
|
-
y: rt,
|
|
3984
|
-
width: Dt,
|
|
3985
|
-
height: Q
|
|
3986
|
-
});
|
|
3987
|
-
}
|
|
3988
|
-
const S = [
|
|
3989
|
-
"January",
|
|
3990
|
-
"February",
|
|
3991
|
-
"March",
|
|
3992
|
-
"April",
|
|
3993
|
-
"May",
|
|
3994
|
-
"June",
|
|
3995
|
-
"July",
|
|
3996
|
-
"August",
|
|
3997
|
-
"September",
|
|
3998
|
-
"October",
|
|
3999
|
-
"November",
|
|
4000
|
-
"December"
|
|
4001
|
-
], A = [], _ = /* @__PURE__ */ new Set();
|
|
4002
|
-
for (const b of r) {
|
|
4003
|
-
const x = b.days[0];
|
|
4004
|
-
if (!x) continue;
|
|
4005
|
-
const T = x.getMonth(), C = x.getFullYear(), U = `${T}-${C}`;
|
|
4006
|
-
if (!_.has(U)) {
|
|
4007
|
-
_.add(U);
|
|
4008
|
-
const L = S[T];
|
|
4009
|
-
L && A.push({
|
|
4010
|
-
monthKey: U,
|
|
4011
|
-
monthName: L,
|
|
4012
|
-
year: C,
|
|
4013
|
-
yOffset: b.yOffset
|
|
4014
|
-
});
|
|
4015
|
-
}
|
|
4016
|
-
}
|
|
4017
|
-
for (let b = 0; b < A.length; b++) {
|
|
4018
|
-
const x = A[b], T = A[b + 1], C = x.yOffset, U = T ? T.yOffset : this.totalHeight;
|
|
4019
|
-
if (U < e) continue;
|
|
4020
|
-
if (C > l) break;
|
|
4021
|
-
const L = [12, 0, 0, 12], P = Math.max(0, e - C), B = U - C - 24, R = Math.min(P, B), K = C + R - e + 32;
|
|
4022
|
-
t.save(), t.font = `bold 18px ${a}`, t.textAlign = "left", t.textBaseline = "top";
|
|
4023
|
-
const J = `${x.monthName} ${x.year}`, wt = t.measureText(J).width, ut = 64 + L[3] + 8, Q = K + L[0], X = 8, Tt = 8, Qt = getComputedStyle(this).getPropertyValue("--bg-elevated").trim() || "rgba(0, 0, 0, 0.7)";
|
|
4024
|
-
t.fillStyle = Qt, t.beginPath(), t.roundRect(
|
|
4025
|
-
ut - X,
|
|
4026
|
-
Q - 4,
|
|
4027
|
-
wt + X + Tt,
|
|
4028
|
-
26,
|
|
4029
|
-
6
|
|
4030
|
-
), t.fill();
|
|
4031
|
-
const kt = getComputedStyle(this).getPropertyValue("--text-primary").trim() || "rgba(255, 255, 255, 0.95)";
|
|
4032
|
-
t.fillStyle = kt, t.fillText(J, ut, Q), t.restore();
|
|
4033
|
-
}
|
|
4215
|
+
toggleLayer(t) {
|
|
4216
|
+
const e = this.layers.find((i) => i.name === t);
|
|
4217
|
+
if (!e) throw new Error(`Layer "${t}" not found`);
|
|
4218
|
+
e.enabled = !e.enabled, this.renderCanvas();
|
|
4034
4219
|
}
|
|
4035
4220
|
resetDragState() {
|
|
4036
4221
|
this.isDraggingEvent = !1, this.movingEvent = null, this.movingEventOrigin = null, this.movingEventEnd = null, this.movingEventDuplicateMode = !1, this.movingEventMouseEvent = null, this.scrollContainer && (this.scrollContainer.draggable = !1), this.renderDateLabels();
|
|
@@ -4047,10 +4232,10 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4047
4232
|
copySelectedEvents() {
|
|
4048
4233
|
const t = this.internal.getSelectedEvents();
|
|
4049
4234
|
if (t.length === 0) return;
|
|
4050
|
-
const e =
|
|
4235
|
+
const e = Bi(t), i = new Blob([e], { type: "text/plain" }), s = new ClipboardItem({ "text/plain": i });
|
|
4051
4236
|
navigator.clipboard.write([s]).then(() => {
|
|
4052
4237
|
const r = t.length;
|
|
4053
|
-
|
|
4238
|
+
qt(
|
|
4054
4239
|
`Copied ${r} event${r === 1 ? "" : "s"} to clipboard`
|
|
4055
4240
|
);
|
|
4056
4241
|
});
|
|
@@ -4072,7 +4257,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4072
4257
|
));
|
|
4073
4258
|
}
|
|
4074
4259
|
escape() {
|
|
4075
|
-
this.isCreatingEvent || this.eventCreationStart ? (this.clearEventCreationState(), this.renderCanvas(),
|
|
4260
|
+
this.isCreatingEvent || this.eventCreationStart ? (this.clearEventCreationState(), this.renderCanvas(), qt("Event creation cancelled")) : this.isDraggingEvent || this.movingEvent ? (this.resetDragState(), this.renderCanvas(), qt("Event move cancelled")) : this.isResizingEvent ? (this.isResizingEvent = !1, this.resizeEvent = null, this.resizeStartY = 0, this.resizeEdge = null, this.renderCanvas(), qt("Event resize cancelled")) : (this.internal.getSelectedEvents().length > 0 || this.selectedEventForDetail) && (this.internal.clearSelection(), this.selectedEventForDetail = null, this.selectedEventRect = null, this.isDescriptionExpanded = !1, this.renderCanvas(), this.requestUpdate(), this.dispatchEvent(
|
|
4076
4261
|
new CustomEvent("selection-change", {
|
|
4077
4262
|
detail: { selectedEvents: [] },
|
|
4078
4263
|
bubbles: !0
|
|
@@ -4085,7 +4270,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4085
4270
|
return o && a && s.size <= 10485760;
|
|
4086
4271
|
});
|
|
4087
4272
|
if (i.length === 0) {
|
|
4088
|
-
|
|
4273
|
+
qt("No valid .ics files found");
|
|
4089
4274
|
return;
|
|
4090
4275
|
}
|
|
4091
4276
|
for (const s of i)
|
|
@@ -4098,7 +4283,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4098
4283
|
})
|
|
4099
4284
|
);
|
|
4100
4285
|
} catch (r) {
|
|
4101
|
-
console.error(`Failed to read ${s.name}:`, r),
|
|
4286
|
+
console.error(`Failed to read ${s.name}:`, r), qt(`Failed to read ${s.name}: ${r.message}`);
|
|
4102
4287
|
}
|
|
4103
4288
|
}
|
|
4104
4289
|
readFileAsText(t) {
|
|
@@ -4166,71 +4351,71 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4166
4351
|
*/
|
|
4167
4352
|
handleSelectionComplete() {
|
|
4168
4353
|
if (!this.selection || !this.scrollContainer) return;
|
|
4169
|
-
const t = Math.min(this.selection.startX, this.selection.endX), e = Math.max(this.selection.startX, this.selection.endX), i = Math.min(this.selection.startY, this.selection.endY), s = Math.max(this.selection.startY, this.selection.endY), a = (this.scrollContainer.getBoundingClientRect().width -
|
|
4354
|
+
const t = Math.min(this.selection.startX, this.selection.endX), e = Math.max(this.selection.startX, this.selection.endX), i = Math.min(this.selection.startY, this.selection.endY), s = Math.max(this.selection.startY, this.selection.endY), a = (this.scrollContainer.getBoundingClientRect().width - tt) / this._columnsPerRow, l = Math.max(
|
|
4170
4355
|
0,
|
|
4171
4356
|
Math.min(
|
|
4172
4357
|
this._columnsPerRow - 1,
|
|
4173
|
-
Math.floor((t -
|
|
4358
|
+
Math.floor((t - tt) / a)
|
|
4174
4359
|
)
|
|
4175
4360
|
), c = Math.max(
|
|
4176
4361
|
0,
|
|
4177
4362
|
Math.min(
|
|
4178
4363
|
this._columnsPerRow - 1,
|
|
4179
|
-
Math.floor((e -
|
|
4364
|
+
Math.floor((e - tt) / a)
|
|
4180
4365
|
)
|
|
4181
|
-
),
|
|
4182
|
-
(
|
|
4366
|
+
), h = this.weeks.filter(
|
|
4367
|
+
(p) => p.height > 0 && p.yOffset < s && p.yOffset + p.height > i
|
|
4183
4368
|
);
|
|
4184
|
-
if (
|
|
4185
|
-
const
|
|
4369
|
+
if (h.length === 0) return;
|
|
4370
|
+
const d = [];
|
|
4186
4371
|
if (this.dayHeight >= 200)
|
|
4187
|
-
for (const
|
|
4188
|
-
for (let
|
|
4189
|
-
const y =
|
|
4372
|
+
for (const p of h)
|
|
4373
|
+
for (let g = 0; g < 7; g++) {
|
|
4374
|
+
const y = p.days[g];
|
|
4190
4375
|
if (!y) continue;
|
|
4191
|
-
const { row: M, col:
|
|
4192
|
-
if (
|
|
4193
|
-
const
|
|
4194
|
-
if (s <
|
|
4195
|
-
const
|
|
4196
|
-
|
|
4197
|
-
),
|
|
4198
|
-
|
|
4199
|
-
),
|
|
4200
|
-
|
|
4201
|
-
const
|
|
4202
|
-
|
|
4376
|
+
const { row: M, col: T } = this.getDayVisualPosition(g);
|
|
4377
|
+
if (T < l || T > c) continue;
|
|
4378
|
+
const x = p.yOffset + M * this.dayHeight, b = x + this.dayHeight;
|
|
4379
|
+
if (s < x || i > b) continue;
|
|
4380
|
+
const S = Math.max(i, x), k = Math.min(s, b), w = S - x, _ = Math.floor(
|
|
4381
|
+
w / this.dayHeight * 24 * 60
|
|
4382
|
+
), U = Math.floor(_ / 60), W = _ % 60, V = k - x, B = Math.ceil(
|
|
4383
|
+
V / this.dayHeight * 24 * 60
|
|
4384
|
+
), I = Math.floor(B / 60), G = B % 60, nt = new Date(y);
|
|
4385
|
+
nt.setHours(U, W, 0, 0);
|
|
4386
|
+
const q = new Date(y);
|
|
4387
|
+
q.setHours(I, G, 59, 999), d.push({ start: nt, end: q });
|
|
4203
4388
|
}
|
|
4204
4389
|
else
|
|
4205
|
-
for (const
|
|
4206
|
-
for (let
|
|
4207
|
-
const y =
|
|
4390
|
+
for (const p of h)
|
|
4391
|
+
for (let g = 0; g < 7; g++) {
|
|
4392
|
+
const y = p.days[g];
|
|
4208
4393
|
if (!y) continue;
|
|
4209
|
-
const { row: M, col:
|
|
4210
|
-
if (
|
|
4211
|
-
const
|
|
4212
|
-
if (s <
|
|
4213
|
-
const
|
|
4214
|
-
|
|
4215
|
-
const
|
|
4216
|
-
|
|
4394
|
+
const { row: M, col: T } = this.getDayVisualPosition(g);
|
|
4395
|
+
if (T < l || T > c) continue;
|
|
4396
|
+
const x = p.yOffset + M * this.dayHeight, b = x + this.dayHeight;
|
|
4397
|
+
if (s < x || i > b) continue;
|
|
4398
|
+
const S = new Date(y);
|
|
4399
|
+
S.setHours(0, 0, 0, 0);
|
|
4400
|
+
const k = new Date(y);
|
|
4401
|
+
k.setHours(23, 59, 59, 999), d.push({ start: S, end: k });
|
|
4217
4402
|
}
|
|
4218
4403
|
const f = /* @__PURE__ */ new Set();
|
|
4219
|
-
for (const
|
|
4220
|
-
if (
|
|
4221
|
-
const
|
|
4222
|
-
for (const M of
|
|
4223
|
-
const
|
|
4224
|
-
if (!(y <
|
|
4225
|
-
f.add(
|
|
4404
|
+
for (const p of this.events) {
|
|
4405
|
+
if (p.isAllDay || this.activeCalendarId && p.calendarId !== this.activeCalendarId && p.sourceId !== this.activeCalendarId) continue;
|
|
4406
|
+
const g = p.start.getTime(), y = p.end.getTime();
|
|
4407
|
+
for (const M of d) {
|
|
4408
|
+
const T = M.start.getTime(), x = M.end.getTime();
|
|
4409
|
+
if (!(y < T || g > x)) {
|
|
4410
|
+
f.add(p);
|
|
4226
4411
|
break;
|
|
4227
4412
|
}
|
|
4228
4413
|
}
|
|
4229
4414
|
}
|
|
4230
4415
|
const v = Array.from(f);
|
|
4231
4416
|
this.selectionModifierKey || (this.internal.clearSelection(), this.selectedEventForDetail = null, this.selectedEventRect = null);
|
|
4232
|
-
for (const
|
|
4233
|
-
this.internal.selectEvent(
|
|
4417
|
+
for (const p of v)
|
|
4418
|
+
this.internal.selectEvent(p, "add");
|
|
4234
4419
|
this.requestUpdate(), this.dispatchEvent(
|
|
4235
4420
|
new CustomEvent("selection-change", {
|
|
4236
4421
|
detail: { selectedEvents: v },
|
|
@@ -4239,16 +4424,16 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4239
4424
|
), this.dispatchEvent(
|
|
4240
4425
|
new CustomEvent("selection", {
|
|
4241
4426
|
detail: {
|
|
4242
|
-
timeRanges:
|
|
4243
|
-
start:
|
|
4244
|
-
end:
|
|
4427
|
+
timeRanges: d,
|
|
4428
|
+
start: d[0]?.start,
|
|
4429
|
+
end: d[d.length - 1]?.end
|
|
4245
4430
|
},
|
|
4246
4431
|
bubbles: !0
|
|
4247
4432
|
})
|
|
4248
4433
|
), this.renderCanvas();
|
|
4249
4434
|
}
|
|
4250
4435
|
renderEvents() {
|
|
4251
|
-
return
|
|
4436
|
+
return $``;
|
|
4252
4437
|
}
|
|
4253
4438
|
checkAndExtendRange() {
|
|
4254
4439
|
if (this.isExtendingRange || this.filter) return;
|
|
@@ -4395,7 +4580,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4395
4580
|
l
|
|
4396
4581
|
);
|
|
4397
4582
|
} else {
|
|
4398
|
-
const c =
|
|
4583
|
+
const c = Ge(this.movingEvent.color || "#888888");
|
|
4399
4584
|
this.renderVirtualEvent(
|
|
4400
4585
|
r,
|
|
4401
4586
|
o,
|
|
@@ -4433,7 +4618,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4433
4618
|
i.setMinutes(Math.round(i.getMinutes() / 15) * 15, 0, 0), s.setMinutes(Math.round(s.getMinutes() / 15) * 15, 0, 0);
|
|
4434
4619
|
let r, o;
|
|
4435
4620
|
if (this.activeCalendarColor) {
|
|
4436
|
-
const l =
|
|
4621
|
+
const l = Ge(this.activeCalendarColor);
|
|
4437
4622
|
r = `rgba(${l[0]}, ${l[1]}, ${l[2]}, 0.3)`, o = `rgba(${l[0]}, ${l[1]}, ${l[2]}, 0.8)`;
|
|
4438
4623
|
} else {
|
|
4439
4624
|
const l = getComputedStyle(this).getPropertyValue("--accent-primary").trim() || "rgb(100, 150, 255)";
|
|
@@ -4445,66 +4630,66 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4445
4630
|
renderVirtualEvent(t, e, i, s = !0) {
|
|
4446
4631
|
if (!this.overlayCanvas || !this.overlayCtx || !this.scrollContainer)
|
|
4447
4632
|
return;
|
|
4448
|
-
const r = this.overlayCtx, o = getComputedStyle(this).fontFamily, c = (this.scrollContainer.getBoundingClientRect().width -
|
|
4449
|
-
const
|
|
4450
|
-
(
|
|
4633
|
+
const r = this.overlayCtx, o = getComputedStyle(this).fontFamily, c = (this.scrollContainer.getBoundingClientRect().width - tt - ji) / this._columnsPerRow, h = (w, _, U) => {
|
|
4634
|
+
const W = this.weeks.find(
|
|
4635
|
+
(nt) => nt.days.some((q) => q.toDateString() === w.toDateString())
|
|
4451
4636
|
);
|
|
4452
|
-
if (!
|
|
4453
|
-
const
|
|
4454
|
-
(
|
|
4637
|
+
if (!W) return null;
|
|
4638
|
+
const V = W.days.findIndex(
|
|
4639
|
+
(nt) => nt.toDateString() === w.toDateString()
|
|
4455
4640
|
);
|
|
4456
|
-
if (
|
|
4457
|
-
const { row:
|
|
4458
|
-
return
|
|
4459
|
-
},
|
|
4460
|
-
const
|
|
4461
|
-
(
|
|
4641
|
+
if (V < 0) return null;
|
|
4642
|
+
const { row: B } = this.getDayVisualPosition(V), I = _ * 60 + U;
|
|
4643
|
+
return W.yOffset + B * this.dayHeight + I / 1440 * this.dayHeight - this.scrollTop;
|
|
4644
|
+
}, d = (w) => {
|
|
4645
|
+
const _ = this.weeks.find(
|
|
4646
|
+
(V) => V.days.some((B) => B.toDateString() === w.toDateString())
|
|
4462
4647
|
);
|
|
4463
|
-
if (!
|
|
4464
|
-
const
|
|
4465
|
-
(
|
|
4648
|
+
if (!_) return null;
|
|
4649
|
+
const U = _.days.findIndex(
|
|
4650
|
+
(V) => V.toDateString() === w.toDateString()
|
|
4466
4651
|
);
|
|
4467
|
-
if (
|
|
4468
|
-
const { col:
|
|
4469
|
-
return
|
|
4470
|
-
}, u = (
|
|
4471
|
-
const
|
|
4472
|
-
r.fillStyle = i.fill, r.beginPath(), r.roundRect(
|
|
4652
|
+
if (U < 0) return null;
|
|
4653
|
+
const { col: W } = this.getDayVisualPosition(U);
|
|
4654
|
+
return W * c;
|
|
4655
|
+
}, u = (w, _, U) => {
|
|
4656
|
+
const W = w + 2, V = c - 4, B = Math.max(4, U - _);
|
|
4657
|
+
r.fillStyle = i.fill, r.beginPath(), r.roundRect(W, _, V, B, 4), r.fill(), r.strokeStyle = i.stroke, r.lineWidth = 1, r.setLineDash([6, 3]), r.stroke(), r.setLineDash([]);
|
|
4473
4658
|
}, f = t.toDateString() === e.toDateString();
|
|
4474
4659
|
if (f) {
|
|
4475
|
-
const
|
|
4476
|
-
|
|
4660
|
+
const w = d(t), _ = h(t, t.getHours(), t.getMinutes()), U = h(e, e.getHours(), e.getMinutes());
|
|
4661
|
+
w != null && _ != null && U != null && u(w, _, U);
|
|
4477
4662
|
} else {
|
|
4478
|
-
const
|
|
4479
|
-
|
|
4480
|
-
const
|
|
4481
|
-
for (
|
|
4482
|
-
const
|
|
4483
|
-
if (
|
|
4484
|
-
const
|
|
4485
|
-
let
|
|
4486
|
-
|
|
4663
|
+
const w = new Date(t);
|
|
4664
|
+
w.setHours(0, 0, 0, 0);
|
|
4665
|
+
const _ = new Date(e);
|
|
4666
|
+
for (_.setHours(23, 59, 59, 999); w <= _; ) {
|
|
4667
|
+
const U = d(w);
|
|
4668
|
+
if (U != null) {
|
|
4669
|
+
const W = w.toDateString() === t.toDateString(), V = w.toDateString() === e.toDateString();
|
|
4670
|
+
let B, I;
|
|
4671
|
+
W ? (B = h(w, t.getHours(), t.getMinutes()), I = h(w, 23, 59)) : V ? (B = h(w, 0, 0), I = h(w, e.getHours(), e.getMinutes())) : (B = h(w, 0, 0), I = h(w, 23, 59)), B != null && I != null && u(U, B, I);
|
|
4487
4672
|
}
|
|
4488
|
-
|
|
4673
|
+
w.setDate(w.getDate() + 1);
|
|
4489
4674
|
}
|
|
4490
4675
|
}
|
|
4491
|
-
const v = (
|
|
4492
|
-
if (
|
|
4676
|
+
const v = (w) => `${w.getHours().toString().padStart(2, "0")}:${w.getMinutes().toString().padStart(2, "0")}`, p = (w) => `${w.getDate()}.${w.getMonth() + 1}`, g = f ? `${v(t)} – ${v(e)}` : `${p(t)} ${v(t)} – ${p(e)} ${v(e)}`, T = Math.abs(e.getTime() - t.getTime()) / (1e3 * 60) < 15, x = d(t), b = d(e), S = h(t, t.getHours(), t.getMinutes()), k = h(e, e.getHours(), e.getMinutes());
|
|
4677
|
+
if (x != null && b != null && S != null && k != null) {
|
|
4493
4678
|
r.font = `600 11px ${o}`, r.fillStyle = i.text, r.textAlign = "left";
|
|
4494
|
-
const
|
|
4495
|
-
if (
|
|
4496
|
-
const
|
|
4497
|
-
r.fillStyle =
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4679
|
+
const w = s ? x : b;
|
|
4680
|
+
if (T) {
|
|
4681
|
+
const _ = s ? S : k, U = _ + 6, W = _ + 10, V = r.measureText(g).width, B = 6, I = getComputedStyle(this).getPropertyValue("--bg-elevated").trim() || "rgba(0, 0, 0, 0.8)";
|
|
4682
|
+
r.fillStyle = I, r.beginPath(), r.roundRect(
|
|
4683
|
+
w + 4,
|
|
4684
|
+
U,
|
|
4685
|
+
V + B * 2,
|
|
4501
4686
|
16,
|
|
4502
4687
|
4
|
|
4503
|
-
), r.fill(), r.fillStyle = "white", r.textBaseline = "top", r.fillText(
|
|
4688
|
+
), r.fill(), r.fillStyle = "white", r.textBaseline = "top", r.fillText(g, w + 4 + B, W);
|
|
4504
4689
|
} else {
|
|
4505
4690
|
r.textBaseline = "top";
|
|
4506
|
-
const
|
|
4507
|
-
r.fillText(
|
|
4691
|
+
const _ = s ? S + 4 : k - 18;
|
|
4692
|
+
r.fillText(g, w + 8, _);
|
|
4508
4693
|
}
|
|
4509
4694
|
}
|
|
4510
4695
|
}
|
|
@@ -4521,23 +4706,23 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4521
4706
|
if (l.height !== 0 && !(l.yOffset + l.height < r)) {
|
|
4522
4707
|
if (l.yOffset > r + this.viewportHeight) break;
|
|
4523
4708
|
for (let c = 0; c < 7; c++) {
|
|
4524
|
-
const
|
|
4525
|
-
if (!
|
|
4526
|
-
const { row:
|
|
4709
|
+
const h = l.days[c];
|
|
4710
|
+
if (!h) continue;
|
|
4711
|
+
const { row: d, col: u } = this.getDayVisualPosition(c), f = u * s, v = l.yOffset + d * this.dayHeight - r, p = v + this.dayHeight;
|
|
4527
4712
|
if (c === 5 || c === 6) {
|
|
4528
|
-
const
|
|
4529
|
-
t.fillStyle =
|
|
4713
|
+
const b = getComputedStyle(this).getPropertyValue("--bg-weekend").trim() || "rgba(255, 255, 255, 0.03)";
|
|
4714
|
+
t.fillStyle = b, t.fillRect(f, v, s, this.dayHeight);
|
|
4530
4715
|
}
|
|
4531
|
-
const
|
|
4532
|
-
if (!
|
|
4533
|
-
const
|
|
4534
|
-
t.strokeStyle =
|
|
4716
|
+
const g = this.dayHeight >= 300, y = /* @__PURE__ */ new Date();
|
|
4717
|
+
if (!g && Y.isSameDay(h, y)) {
|
|
4718
|
+
const b = getComputedStyle(this).getPropertyValue("--accent-current-time").trim() || "rgba(255, 0, 0, 0.8)";
|
|
4719
|
+
t.strokeStyle = b, t.lineWidth = 1, t.strokeRect(f + 1, v + 1, s - 2, this.dayHeight - 2), t.lineWidth = 1;
|
|
4535
4720
|
}
|
|
4536
|
-
const M = 12,
|
|
4537
|
-
|
|
4721
|
+
const M = 12, x = Math.min(
|
|
4722
|
+
p - M - 8,
|
|
4538
4723
|
i - M - 64
|
|
4539
4724
|
);
|
|
4540
|
-
v < i &&
|
|
4725
|
+
v < i && p > 0 && x > v && (t.fillStyle = a, t.fillText(h.getDate().toString(), f + s - 12, x));
|
|
4541
4726
|
}
|
|
4542
4727
|
}
|
|
4543
4728
|
}
|
|
@@ -4545,33 +4730,33 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4545
4730
|
if (i.length === 0) return;
|
|
4546
4731
|
const o = this.internal.getWeekdayNames(), a = getComputedStyle(this).fontFamily, l = getComputedStyle(this).getPropertyValue("--text-muted").trim() || "rgba(255, 255, 255, 0.4)", c = getComputedStyle(this).getPropertyValue("--bg-primary").trim() || "rgba(30, 30, 30, 0.9)";
|
|
4547
4732
|
t.font = `500 12px ${a}`, t.textAlign = "center", t.textBaseline = "top";
|
|
4548
|
-
const
|
|
4733
|
+
const h = 16, d = 12, u = i[0];
|
|
4549
4734
|
if (u)
|
|
4550
4735
|
for (let f = 0; f < this.rowsPerWeek; f++) {
|
|
4551
|
-
const v = u.yOffset + f * this.dayHeight - s,
|
|
4552
|
-
if (
|
|
4553
|
-
const
|
|
4554
|
-
if (!(
|
|
4736
|
+
const v = u.yOffset + f * this.dayHeight - s, p = v + this.dayHeight;
|
|
4737
|
+
if (p < 0 || v > r) continue;
|
|
4738
|
+
const g = Math.min(d, p - h - 2);
|
|
4739
|
+
if (!(g < 0))
|
|
4555
4740
|
for (let y = 0; y < this._columnsPerRow; y++) {
|
|
4556
4741
|
const M = f * this._columnsPerRow + y;
|
|
4557
4742
|
if (M >= 7) continue;
|
|
4558
|
-
const
|
|
4559
|
-
if (!
|
|
4560
|
-
const
|
|
4743
|
+
const T = o[M];
|
|
4744
|
+
if (!T) continue;
|
|
4745
|
+
const x = tt + y * e + e / 2, b = t.measureText(T).width, S = 6, k = 2;
|
|
4561
4746
|
t.fillStyle = c, t.beginPath(), t.roundRect(
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4747
|
+
x - b / 2 - S,
|
|
4748
|
+
g,
|
|
4749
|
+
b + S * 2,
|
|
4750
|
+
h,
|
|
4566
4751
|
4
|
|
4567
|
-
), t.fill(), t.fillStyle = l, t.fillText(
|
|
4752
|
+
), t.fill(), t.fillStyle = l, t.fillText(T, x, g + k + 1);
|
|
4568
4753
|
}
|
|
4569
4754
|
}
|
|
4570
4755
|
}
|
|
4571
4756
|
renderSelection() {
|
|
4572
|
-
if (!this.selection) return
|
|
4757
|
+
if (!this.selection) return $``;
|
|
4573
4758
|
const t = Math.min(this.selection.startX, this.selection.endX), e = Math.max(this.selection.startX, this.selection.endX), i = Math.min(this.selection.startY, this.selection.endY), s = Math.max(this.selection.startY, this.selection.endY);
|
|
4574
|
-
return
|
|
4759
|
+
return $`
|
|
4575
4760
|
<div
|
|
4576
4761
|
class="selection"
|
|
4577
4762
|
style="
|
|
@@ -4589,28 +4774,28 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4589
4774
|
this.minimapBufferCanvas.width = t, this.minimapBufferCanvas.height = e, i.clearRect(0, 0, t, e);
|
|
4590
4775
|
const s = this.events, r = this.weeks[0].days[0].getTime(), o = 10080 * 60 * 1e3, a = 1440 * 60 * 1e3, l = 60 * 1e3;
|
|
4591
4776
|
for (const c of s) {
|
|
4592
|
-
const
|
|
4593
|
-
(d - r) / o
|
|
4594
|
-
), f = Math.floor(
|
|
4777
|
+
const h = c.start.getTime(), d = c.end.getTime(), u = Math.floor(
|
|
4595
4778
|
(h - r) / o
|
|
4596
|
-
),
|
|
4597
|
-
|
|
4598
|
-
|
|
4779
|
+
), f = Math.floor(
|
|
4780
|
+
(d - r) / o
|
|
4781
|
+
), v = Math.max(0, u), p = Math.min(this.weeks.length - 1, f);
|
|
4782
|
+
for (let g = v; g <= p; g++) {
|
|
4783
|
+
const y = this.weeks[g];
|
|
4599
4784
|
if (!y || y.height === 0) continue;
|
|
4600
|
-
const M = y.days[0],
|
|
4601
|
-
if (!M || !
|
|
4602
|
-
const
|
|
4603
|
-
|
|
4604
|
-
),
|
|
4605
|
-
|
|
4606
|
-
),
|
|
4607
|
-
i.globalAlpha = c.readOnly ? 0.333 * 0.5 : 0.333, i.fillStyle = c.color || "#888", i.fillRect(2,
|
|
4785
|
+
const M = y.days[0], T = y.days[6];
|
|
4786
|
+
if (!M || !T) continue;
|
|
4787
|
+
const x = M.getTime(), b = T.getTime() + a - 1, S = Math.max(h, x), k = Math.min(d, b), w = Math.floor(
|
|
4788
|
+
S % a / l
|
|
4789
|
+
), _ = Math.floor(
|
|
4790
|
+
k % a / l
|
|
4791
|
+
), U = y.yOffset / this.totalHeight * e + w / 1440 * (y.height / this.totalHeight * e), W = y.yOffset / this.totalHeight * e + _ / 1440 * (y.height / this.totalHeight * e);
|
|
4792
|
+
i.globalAlpha = c.readOnly ? 0.333 * 0.5 : 0.333, i.fillStyle = c.color || "#888", i.fillRect(2, U, t - 4, Math.max(W - U, 2));
|
|
4608
4793
|
}
|
|
4609
4794
|
}
|
|
4610
4795
|
}
|
|
4611
4796
|
renderMinimap() {
|
|
4612
|
-
if (this.totalHeight === 0 || this.weeks.length === 0) return
|
|
4613
|
-
if (!this.minimapBufferCanvas) return
|
|
4797
|
+
if (this.totalHeight === 0 || this.weeks.length === 0) return $``;
|
|
4798
|
+
if (!this.minimapBufferCanvas) return $``;
|
|
4614
4799
|
const t = 32, e = 2e3, i = this.viewportHeight / this.totalHeight, s = this.scrollTop / this.totalHeight * e, r = Math.max(i * e, 4), o = this.minimapCanvas, a = o.getContext("2d");
|
|
4615
4800
|
if (o.width = t, o.height = e, !a) throw new Error("Failed to get 2d context");
|
|
4616
4801
|
a.drawImage(this.minimapBufferCanvas, 0, 0), getComputedStyle(this).getPropertyValue("--grid-color").trim();
|
|
@@ -4659,41 +4844,41 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4659
4844
|
*/
|
|
4660
4845
|
convertPositionToDateTime(t, e, i) {
|
|
4661
4846
|
if (!this.scrollContainer) return null;
|
|
4662
|
-
const o = (this.scrollContainer.getBoundingClientRect().width -
|
|
4663
|
-
if (t <
|
|
4847
|
+
const o = (this.scrollContainer.getBoundingClientRect().width - tt) / this._columnsPerRow;
|
|
4848
|
+
if (t < tt) return null;
|
|
4664
4849
|
const a = Math.max(
|
|
4665
4850
|
0,
|
|
4666
4851
|
Math.min(
|
|
4667
4852
|
this._columnsPerRow - 1,
|
|
4668
|
-
Math.floor((t -
|
|
4853
|
+
Math.floor((t - tt) / o)
|
|
4669
4854
|
)
|
|
4670
4855
|
), l = this.weeks.find(
|
|
4671
|
-
(
|
|
4856
|
+
(p) => p.height > 0 && p.yOffset <= e && p.yOffset + p.height > e
|
|
4672
4857
|
);
|
|
4673
4858
|
if (!l) return null;
|
|
4674
|
-
const c = Math.floor((e - l.yOffset) / this.dayHeight),
|
|
4675
|
-
if (
|
|
4676
|
-
const
|
|
4677
|
-
if (!
|
|
4859
|
+
const c = Math.floor((e - l.yOffset) / this.dayHeight), h = c * this._columnsPerRow + a;
|
|
4860
|
+
if (h < 0 || h > 6) return null;
|
|
4861
|
+
const d = l.days[h];
|
|
4862
|
+
if (!d) return null;
|
|
4678
4863
|
let u = 0, f = 0;
|
|
4679
4864
|
if (this.dayHeight >= 200) {
|
|
4680
|
-
const
|
|
4681
|
-
u = Math.floor(
|
|
4865
|
+
const p = e - (l.yOffset + c * this.dayHeight), g = Math.floor(p / this.dayHeight * 24 * 60);
|
|
4866
|
+
u = Math.floor(g / 60), f = g % 60;
|
|
4682
4867
|
} else
|
|
4683
4868
|
u = 12;
|
|
4684
|
-
const v = new Date(
|
|
4869
|
+
const v = new Date(d);
|
|
4685
4870
|
return v.setHours(u, f, 0, 0), v;
|
|
4686
4871
|
}
|
|
4687
4872
|
convertDateTimeToPosition(t) {
|
|
4688
4873
|
if (!this.scrollContainer) return null;
|
|
4689
|
-
const s = (this.scrollContainer.getBoundingClientRect().width -
|
|
4690
|
-
(
|
|
4874
|
+
const s = (this.scrollContainer.getBoundingClientRect().width - tt) / this._columnsPerRow, r = t.toDateString(), o = this.weeks.find(
|
|
4875
|
+
(g) => g.days.some((y) => y.toDateString() === r)
|
|
4691
4876
|
);
|
|
4692
4877
|
if (!o) return null;
|
|
4693
|
-
const a = o.days.findIndex((
|
|
4878
|
+
const a = o.days.findIndex((g) => g.toDateString() === r);
|
|
4694
4879
|
if (a === -1) return null;
|
|
4695
|
-
const { row: l, col: c } = this.getDayVisualPosition(a),
|
|
4696
|
-
return { x:
|
|
4880
|
+
const { row: l, col: c } = this.getDayVisualPosition(a), h = tt + c * s + s / 2, d = t.getHours(), u = t.getMinutes(), v = (d * 60 + u) / 1440 * this.dayHeight, p = o.yOffset + l * this.dayHeight + v;
|
|
4881
|
+
return { x: h, y: p };
|
|
4697
4882
|
}
|
|
4698
4883
|
getCursorTime() {
|
|
4699
4884
|
if (!this.cursorPosition) return null;
|
|
@@ -4752,7 +4937,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4752
4937
|
}
|
|
4753
4938
|
renderNotificationsList(t) {
|
|
4754
4939
|
return t.reminders?.length ? t.reminders.map(
|
|
4755
|
-
(e) =>
|
|
4940
|
+
(e) => $`
|
|
4756
4941
|
<div class="notification-item">
|
|
4757
4942
|
<select
|
|
4758
4943
|
class="notification-select"
|
|
@@ -4762,8 +4947,8 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4762
4947
|
this.updateNotification(t, e.id, { triggerOffset: s });
|
|
4763
4948
|
}}
|
|
4764
4949
|
>
|
|
4765
|
-
${
|
|
4766
|
-
(i) =>
|
|
4950
|
+
${Ns.map(
|
|
4951
|
+
(i) => $`<option value="${i.value}" ?selected=${i.value === e.triggerOffset}>${i.label}</option>`
|
|
4767
4952
|
)}
|
|
4768
4953
|
</select>
|
|
4769
4954
|
<button
|
|
@@ -4772,7 +4957,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4772
4957
|
>×</button>
|
|
4773
4958
|
</div>
|
|
4774
4959
|
`
|
|
4775
|
-
) :
|
|
4960
|
+
) : $`<div class="notification-empty-state">No notifications set</div>`;
|
|
4776
4961
|
}
|
|
4777
4962
|
addNotification(t) {
|
|
4778
4963
|
const e = {
|
|
@@ -4830,64 +5015,64 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4830
5015
|
renderEventDetail() {
|
|
4831
5016
|
if (!this.selectedEventForDetail || !this.selectedEventRect)
|
|
4832
5017
|
return null;
|
|
4833
|
-
const t = this.selectedEventForDetail, e = (
|
|
5018
|
+
const t = this.selectedEventForDetail, e = (b) => new Intl.DateTimeFormat(this.locale, {
|
|
4834
5019
|
weekday: "short",
|
|
4835
5020
|
year: "numeric",
|
|
4836
5021
|
month: "short",
|
|
4837
5022
|
day: "numeric"
|
|
4838
|
-
}).format(
|
|
5023
|
+
}).format(b), i = (b) => new Intl.DateTimeFormat(this.locale, {
|
|
4839
5024
|
hour: "numeric",
|
|
4840
5025
|
minute: "2-digit"
|
|
4841
|
-
}).format(
|
|
4842
|
-
return
|
|
4843
|
-
<div class="event-detail-overlay" style="${
|
|
5026
|
+
}).format(b), s = Y.isSameDay(t.start, t.end), r = 320, o = 550, a = 8, l = this.scrollContainer?.clientWidth || 800, c = this.scrollContainer?.clientHeight || 600, h = this.selectedEventRect.x + this.selectedEventRect.width + a, d = this.selectedEventRect.x - r - a, u = h + r <= l ? h : d, f = tt + a, v = l - r - a, p = Math.max(f, Math.min(v, u)), g = this.selectedEventRect.y - this.scrollTop, y = a, M = c - o - a, T = Math.max(y, Math.min(M, g)), x = `left: ${p}px; top: ${T}px; --calendar-color: ${t.color || "#888888"};`;
|
|
5027
|
+
return $`
|
|
5028
|
+
<div class="event-detail-overlay" style="${x}">
|
|
4844
5029
|
<div class="event-detail-content">
|
|
4845
5030
|
<div class="event-detail-header">
|
|
4846
5031
|
<div class="event-detail-header-content">
|
|
4847
|
-
${t.calendar ?
|
|
5032
|
+
${t.calendar ? $`
|
|
4848
5033
|
<div class="event-detail-section event-detail-calendar">
|
|
4849
5034
|
<div class="event-detail-value">${t.calendar}</div>
|
|
4850
5035
|
</div>
|
|
4851
5036
|
` : null}
|
|
4852
|
-
${t.readOnly || t.organizer != null && !this.currentUserEmails.has(t.organizer.email) ?
|
|
4853
|
-
<h3 class="event-detail-title">${t.rrule ?
|
|
4854
|
-
` :
|
|
5037
|
+
${t.readOnly || t.organizer != null && !this.currentUserEmails.has(t.organizer.email) ? $`
|
|
5038
|
+
<h3 class="event-detail-title">${t.rrule ? $`<span style="opacity: 0.6">⟳</span> ` : ""}${t.title}</h3>
|
|
5039
|
+
` : $`
|
|
4855
5040
|
<textarea
|
|
4856
5041
|
class="event-detail-title-input"
|
|
4857
5042
|
.value=${t.title}
|
|
4858
5043
|
placeholder="Event title"
|
|
4859
|
-
@input=${(
|
|
4860
|
-
const
|
|
4861
|
-
|
|
5044
|
+
@input=${(b) => {
|
|
5045
|
+
const k = b.target.value;
|
|
5046
|
+
k !== t.title && (this.updateEventTimeout && clearTimeout(this.updateEventTimeout), this.updateEventTimeout = setTimeout(() => {
|
|
4862
5047
|
this.dispatchEvent(
|
|
4863
5048
|
new CustomEvent("update-event", {
|
|
4864
|
-
detail: { event: t, updates: { title:
|
|
5049
|
+
detail: { event: t, updates: { title: k } },
|
|
4865
5050
|
bubbles: !0,
|
|
4866
5051
|
composed: !0
|
|
4867
5052
|
})
|
|
4868
5053
|
), this.updateEventTimeout = null;
|
|
4869
5054
|
}, 500));
|
|
4870
5055
|
}}
|
|
4871
|
-
@keydown=${(
|
|
4872
|
-
if (
|
|
5056
|
+
@keydown=${(b) => {
|
|
5057
|
+
if (b.key === "Enter") {
|
|
4873
5058
|
this.updateEventTimeout && (clearTimeout(this.updateEventTimeout), this.updateEventTimeout = null);
|
|
4874
|
-
const
|
|
4875
|
-
|
|
5059
|
+
const S = b.target, k = S.value;
|
|
5060
|
+
k !== t.title && this.dispatchEvent(
|
|
4876
5061
|
new CustomEvent("update-event", {
|
|
4877
|
-
detail: { event: t, updates: { title:
|
|
5062
|
+
detail: { event: t, updates: { title: k } },
|
|
4878
5063
|
bubbles: !0,
|
|
4879
5064
|
composed: !0
|
|
4880
5065
|
})
|
|
4881
|
-
),
|
|
5066
|
+
), S.blur();
|
|
4882
5067
|
}
|
|
4883
5068
|
}}
|
|
4884
5069
|
/>
|
|
4885
5070
|
`}
|
|
4886
5071
|
<div class="event-detail-time">
|
|
4887
|
-
${s ?
|
|
5072
|
+
${s ? $`
|
|
4888
5073
|
<div>${e(t.start)}</div>
|
|
4889
5074
|
<div>${i(t.start)} – ${i(t.end)}</div>
|
|
4890
|
-
` :
|
|
5075
|
+
` : $`
|
|
4891
5076
|
<div>${e(t.start)}, ${i(t.start)}</div>
|
|
4892
5077
|
<div>${e(t.end)}, ${i(t.end)}</div>
|
|
4893
5078
|
`}
|
|
@@ -4903,19 +5088,19 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4903
5088
|
|
|
4904
5089
|
<div class="event-detail-body">
|
|
4905
5090
|
${(() => {
|
|
4906
|
-
const
|
|
4907
|
-
return !t.location && !
|
|
5091
|
+
const b = t.description?.match(/https:\/\/teams\.microsoft\.com\/[^\s<>"]+/), S = b ? b[0] : null;
|
|
5092
|
+
return !t.location && !S ? null : $`
|
|
4908
5093
|
<div class="event-detail-section">
|
|
4909
5094
|
<div class="event-detail-label">Location</div>
|
|
4910
5095
|
<div class="event-detail-value">
|
|
4911
|
-
${t.location ?
|
|
4912
|
-
${
|
|
5096
|
+
${t.location ? $`<div>${t.location}</div>` : null}
|
|
5097
|
+
${S ? $`<a href="${S}" class="event-detail-link" target="_blank" rel="noopener">Join Microsoft Teams Meeting</a>` : null}
|
|
4913
5098
|
</div>
|
|
4914
5099
|
</div>
|
|
4915
5100
|
`;
|
|
4916
5101
|
})()}
|
|
4917
5102
|
|
|
4918
|
-
${t.url ?
|
|
5103
|
+
${t.url ? $`
|
|
4919
5104
|
<div class="event-detail-section">
|
|
4920
5105
|
<div class="event-detail-label">URL</div>
|
|
4921
5106
|
<div class="event-detail-value">
|
|
@@ -4926,7 +5111,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4926
5111
|
</div>
|
|
4927
5112
|
` : null}
|
|
4928
5113
|
|
|
4929
|
-
${t.organizer ?
|
|
5114
|
+
${t.organizer ? $`
|
|
4930
5115
|
<div class="event-detail-section">
|
|
4931
5116
|
<div class="event-detail-label">Organizer</div>
|
|
4932
5117
|
<div class="event-detail-value">
|
|
@@ -4937,17 +5122,17 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4937
5122
|
|
|
4938
5123
|
${(() => {
|
|
4939
5124
|
if (!t.attendees || t.attendees.length === 0) return null;
|
|
4940
|
-
const
|
|
4941
|
-
return
|
|
5125
|
+
const b = this.findCurrentUserAttendee(t), S = b ? t.attendees.filter((k) => k !== b) : t.attendees;
|
|
5126
|
+
return S.length > 0 ? $`
|
|
4942
5127
|
<div class="event-detail-section">
|
|
4943
|
-
<div class="event-detail-label">Participants (${
|
|
5128
|
+
<div class="event-detail-label">Participants (${S.length})</div>
|
|
4944
5129
|
<div class="event-detail-value">
|
|
4945
|
-
${
|
|
4946
|
-
(
|
|
5130
|
+
${S.map(
|
|
5131
|
+
(k) => $`
|
|
4947
5132
|
<div style="margin-bottom: 4px">
|
|
4948
|
-
<span title=${
|
|
4949
|
-
${
|
|
4950
|
-
|
|
5133
|
+
<span title=${k.email}>${k.name || k.email}</span>
|
|
5134
|
+
${k.status ? $`<span style="opacity: 0.7"> - ${this.formatAttendeeStatus(
|
|
5135
|
+
k.status
|
|
4951
5136
|
)}</span>` : null}
|
|
4952
5137
|
</div>
|
|
4953
5138
|
`
|
|
@@ -4957,7 +5142,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4957
5142
|
` : null;
|
|
4958
5143
|
})()}
|
|
4959
5144
|
|
|
4960
|
-
${t.readOnly ? null :
|
|
5145
|
+
${t.readOnly ? null : $`
|
|
4961
5146
|
<div class="event-detail-section">
|
|
4962
5147
|
<div class="event-detail-label">
|
|
4963
5148
|
<span>Notifications</span>
|
|
@@ -4972,7 +5157,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4972
5157
|
</div>
|
|
4973
5158
|
`}
|
|
4974
5159
|
|
|
4975
|
-
${t.readOnly || t.organizer != null && !this.currentUserEmails.has(t.organizer.email) ? t.description ?
|
|
5160
|
+
${t.readOnly || t.organizer != null && !this.currentUserEmails.has(t.organizer.email) ? t.description ? $`
|
|
4976
5161
|
<div class="event-detail-section">
|
|
4977
5162
|
<div class="event-detail-label">Description</div>
|
|
4978
5163
|
<div class="event-detail-description ${this.isDescriptionExpanded ? "expanded" : ""}">
|
|
@@ -4983,7 +5168,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4983
5168
|
)}</pre>
|
|
4984
5169
|
</div>
|
|
4985
5170
|
${t.description.length > 300 || t.description.split(`
|
|
4986
|
-
`).length > 8 ?
|
|
5171
|
+
`).length > 8 ? $`
|
|
4987
5172
|
<button
|
|
4988
5173
|
class="description-see-more"
|
|
4989
5174
|
@click=${() => {
|
|
@@ -4994,7 +5179,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
4994
5179
|
</button>
|
|
4995
5180
|
` : null}
|
|
4996
5181
|
</div>
|
|
4997
|
-
` : null :
|
|
5182
|
+
` : null : $`
|
|
4998
5183
|
<div class="event-detail-section">
|
|
4999
5184
|
<div class="event-detail-label">Description</div>
|
|
5000
5185
|
<textarea
|
|
@@ -5002,14 +5187,14 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
5002
5187
|
.value=${t.description ?? ""}
|
|
5003
5188
|
placeholder="Add description..."
|
|
5004
5189
|
rows="3"
|
|
5005
|
-
@input=${(
|
|
5006
|
-
const
|
|
5190
|
+
@input=${(b) => {
|
|
5191
|
+
const k = b.target.value;
|
|
5007
5192
|
this.updateEventTimeout && clearTimeout(this.updateEventTimeout), this.updateEventTimeout = setTimeout(() => {
|
|
5008
5193
|
this.dispatchEvent(
|
|
5009
5194
|
new CustomEvent("update-event", {
|
|
5010
5195
|
detail: {
|
|
5011
5196
|
event: t,
|
|
5012
|
-
updates: { description:
|
|
5197
|
+
updates: { description: k }
|
|
5013
5198
|
},
|
|
5014
5199
|
bubbles: !0,
|
|
5015
5200
|
composed: !0
|
|
@@ -5017,13 +5202,13 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
5017
5202
|
), this.updateEventTimeout = null;
|
|
5018
5203
|
}, 500);
|
|
5019
5204
|
}}
|
|
5020
|
-
@blur=${(
|
|
5021
|
-
const
|
|
5022
|
-
this.updateEventTimeout && (clearTimeout(this.updateEventTimeout), this.updateEventTimeout = null),
|
|
5205
|
+
@blur=${(b) => {
|
|
5206
|
+
const k = b.target.value;
|
|
5207
|
+
this.updateEventTimeout && (clearTimeout(this.updateEventTimeout), this.updateEventTimeout = null), k !== (t.description ?? "") && this.dispatchEvent(
|
|
5023
5208
|
new CustomEvent("update-event", {
|
|
5024
5209
|
detail: {
|
|
5025
5210
|
event: t,
|
|
5026
|
-
updates: { description:
|
|
5211
|
+
updates: { description: k }
|
|
5027
5212
|
},
|
|
5028
5213
|
bubbles: !0,
|
|
5029
5214
|
composed: !0
|
|
@@ -5037,29 +5222,29 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
5037
5222
|
|
|
5038
5223
|
${(() => {
|
|
5039
5224
|
if (!t.attendees || t.attendees.length === 0) return null;
|
|
5040
|
-
const
|
|
5041
|
-
return !
|
|
5225
|
+
const b = this.findCurrentUserAttendee(t);
|
|
5226
|
+
return !b || t.readOnly || t.organizer?.email === b.email ? null : $`
|
|
5042
5227
|
<div class="event-detail-footer">
|
|
5043
5228
|
<div class="invite-response-buttons">
|
|
5044
5229
|
<button
|
|
5045
|
-
class="invite-response-button ${
|
|
5046
|
-
@click=${() => this.updateAttendeeStatus(t,
|
|
5230
|
+
class="invite-response-button ${b.status === "ACCEPTED" ? "active" : ""}"
|
|
5231
|
+
@click=${() => this.updateAttendeeStatus(t, b, "ACCEPTED")}
|
|
5047
5232
|
>
|
|
5048
5233
|
Accept
|
|
5049
5234
|
</button>
|
|
5050
5235
|
<button
|
|
5051
|
-
class="invite-response-button ${
|
|
5236
|
+
class="invite-response-button ${b.status === "TENTATIVE" ? "active" : ""}"
|
|
5052
5237
|
@click=${() => this.updateAttendeeStatus(
|
|
5053
5238
|
t,
|
|
5054
|
-
|
|
5239
|
+
b,
|
|
5055
5240
|
"TENTATIVE"
|
|
5056
5241
|
)}
|
|
5057
5242
|
>
|
|
5058
5243
|
Maybe
|
|
5059
5244
|
</button>
|
|
5060
5245
|
<button
|
|
5061
|
-
class="invite-response-button ${
|
|
5062
|
-
@click=${() => this.updateAttendeeStatus(t,
|
|
5246
|
+
class="invite-response-button ${b.status === "DECLINED" ? "active" : ""}"
|
|
5247
|
+
@click=${() => this.updateAttendeeStatus(t, b, "DECLINED")}
|
|
5063
5248
|
>
|
|
5064
5249
|
Decline
|
|
5065
5250
|
</button>
|
|
@@ -5072,7 +5257,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
5072
5257
|
`;
|
|
5073
5258
|
}
|
|
5074
5259
|
render() {
|
|
5075
|
-
return
|
|
5260
|
+
return $`
|
|
5076
5261
|
<div class="container ${this.isDraggingFile ? "dragging-file" : ""}">
|
|
5077
5262
|
<div class="body">
|
|
5078
5263
|
<slot name="sidebar"></slot>
|
|
@@ -5114,8 +5299,8 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
5114
5299
|
<input
|
|
5115
5300
|
type="range"
|
|
5116
5301
|
class="toolbar-zoom-slider"
|
|
5117
|
-
min="${
|
|
5118
|
-
max="${
|
|
5302
|
+
min="${jt}"
|
|
5303
|
+
max="${De}"
|
|
5119
5304
|
.value=${this.dayHeight}
|
|
5120
5305
|
@input=${this.onZoomSliderChange}
|
|
5121
5306
|
title="Adjust zoom level"
|
|
@@ -5130,8 +5315,8 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
5130
5315
|
@change=${this.onThemeChange}
|
|
5131
5316
|
title="Select theme"
|
|
5132
5317
|
>
|
|
5133
|
-
${
|
|
5134
|
-
(t) =>
|
|
5318
|
+
${Xs.map(
|
|
5319
|
+
(t) => $`<option value="${t.name}">${t.label}</option>`
|
|
5135
5320
|
)}
|
|
5136
5321
|
</select>-->
|
|
5137
5322
|
<div class="toolbar-search">
|
|
@@ -5162,7 +5347,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
5162
5347
|
hour: "numeric",
|
|
5163
5348
|
minute: "2-digit"
|
|
5164
5349
|
});
|
|
5165
|
-
return
|
|
5350
|
+
return $`
|
|
5166
5351
|
<div class="notification-popover-overlay" @click=${this.onNotificationPopoverToggle}></div>
|
|
5167
5352
|
<div class="notification-popover">
|
|
5168
5353
|
<div class="notification-popover-header">
|
|
@@ -5170,8 +5355,8 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
5170
5355
|
<button class="notification-popover-close" @click=${this.onNotificationPopoverToggle}>×</button>
|
|
5171
5356
|
</div>
|
|
5172
5357
|
<div class="notification-popover-content">
|
|
5173
|
-
${this.scheduledNotifications.length === 0 ?
|
|
5174
|
-
(i) =>
|
|
5358
|
+
${this.scheduledNotifications.length === 0 ? $`<div class="notification-popover-empty">No scheduled notifications</div>` : this.scheduledNotifications.map(
|
|
5359
|
+
(i) => $`
|
|
5175
5360
|
<div class="notification-popover-item">
|
|
5176
5361
|
<div class="notification-popover-item-header">
|
|
5177
5362
|
<div class="notification-popover-item-title">${i.eventTitle}</div>
|
|
@@ -5183,7 +5368,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
5183
5368
|
<div class="notification-popover-item-event-time">📅 ${e(
|
|
5184
5369
|
i.eventStart
|
|
5185
5370
|
)}</div>
|
|
5186
|
-
${i.eventLocation ?
|
|
5371
|
+
${i.eventLocation ? $`<div class="notification-popover-item-location">📍 ${i.eventLocation}</div>` : null}
|
|
5187
5372
|
</div>
|
|
5188
5373
|
</div>
|
|
5189
5374
|
`
|
|
@@ -5193,7 +5378,7 @@ const Nt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
|
5193
5378
|
`;
|
|
5194
5379
|
}
|
|
5195
5380
|
};
|
|
5196
|
-
|
|
5381
|
+
di.styles = Zi`
|
|
5197
5382
|
:host {
|
|
5198
5383
|
display: block;
|
|
5199
5384
|
position: relative;
|
|
@@ -5879,18 +6064,8 @@ ni.styles = zi`
|
|
|
5879
6064
|
background: var(--bg-drag-over, rgba(59, 130, 246, 0.05));
|
|
5880
6065
|
}
|
|
5881
6066
|
`;
|
|
5882
|
-
let
|
|
5883
|
-
|
|
5884
|
-
const e = new Date(t).setHours(0, 0, 0, 0);
|
|
5885
|
-
for (let s = 0; s < 7; s++) {
|
|
5886
|
-
const r = n.days[s];
|
|
5887
|
-
if (r && new Date(r).setHours(0, 0, 0, 0) === e)
|
|
5888
|
-
return s;
|
|
5889
|
-
}
|
|
5890
|
-
const i = new Date(n.days[0]).setHours(0, 0, 0, 0);
|
|
5891
|
-
return e < i ? 0 : 6;
|
|
5892
|
-
}
|
|
5893
|
-
class Vs {
|
|
6067
|
+
let Vi = di;
|
|
6068
|
+
class ir {
|
|
5894
6069
|
constructor(t, e, i = "#3b82f6", s = !0) {
|
|
5895
6070
|
this.id = t, this.name = e, this.color = i, this.enabled = s, this.type = "in-memory", this.credentials = {}, this.events = /* @__PURE__ */ new Map();
|
|
5896
6071
|
}
|
|
@@ -5928,14 +6103,14 @@ class Vs {
|
|
|
5928
6103
|
this.events.clear();
|
|
5929
6104
|
}
|
|
5930
6105
|
}
|
|
5931
|
-
const
|
|
6106
|
+
const Ie = class Ie {
|
|
5932
6107
|
// 5 minutes
|
|
5933
6108
|
constructor(t) {
|
|
5934
6109
|
this.internals = t;
|
|
5935
6110
|
}
|
|
5936
6111
|
async shouldSync(t) {
|
|
5937
6112
|
const e = await this.internals.storage.getSyncMetadata(t.id);
|
|
5938
|
-
return e ? Date.now() - e.lastSync.getTime() >=
|
|
6113
|
+
return e ? Date.now() - e.lastSync.getTime() >= Ie.SYNC_INTERVAL_MS : !0;
|
|
5939
6114
|
}
|
|
5940
6115
|
async sync(t, e) {
|
|
5941
6116
|
if (!t.enabled) return [];
|
|
@@ -5947,12 +6122,12 @@ const De = class De {
|
|
|
5947
6122
|
}), r;
|
|
5948
6123
|
}
|
|
5949
6124
|
};
|
|
5950
|
-
|
|
5951
|
-
let
|
|
6125
|
+
Ie.SYNC_INTERVAL_MS = 300 * 1e3;
|
|
6126
|
+
let Ki = Ie;
|
|
5952
6127
|
export {
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
6128
|
+
Ki as CalendarIntegration,
|
|
6129
|
+
Y as CalendarInternal,
|
|
6130
|
+
Vi as CalendarViewElement,
|
|
6131
|
+
ir as InMemorySource,
|
|
6132
|
+
Ns as NOTIFICATION_PRESETS
|
|
5958
6133
|
};
|