@luckydye/calendar 1.1.1 → 1.1.3
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 +1387 -1301
- package/package.json +4 -3
- package/src/ActiveCalendarStore.ts +96 -0
- package/src/CalDAVConfig.ts +1025 -0
- package/src/CalDAVSource.ts +506 -0
- package/src/CalendarIntegration.ts +67 -0
- package/src/CalendarInternal.ts +628 -0
- package/src/CalendarStorage.ts +54 -0
- package/src/CalendarView.ts +5507 -0
- package/src/Color.ts +64 -0
- package/src/GoogleCalendarSource.ts +710 -0
- package/src/ICal.ts +400 -0
- package/src/InMemorySource.ts +74 -0
- package/src/IndexedDBStorage.ts +393 -0
- package/src/InhouseBookingSource.ts +522 -0
- package/src/Keybinds.ts +46 -0
- package/src/NotificationScheduler.ts +91 -0
- package/src/StatusBar.ts +128 -0
- package/src/StatusMessage.ts +122 -0
- package/src/Theme.ts +228 -0
- package/src/app.css +32 -0
- package/src/app.ts +1042 -0
- package/src/lib.ts +4 -0
- package/src/service-worker.js +177 -0
package/dist/calendar.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
1
|
+
const be = globalThis, Ve = be.ShadowRoot && (be.ShadyCSS === void 0 || be.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, je = /* @__PURE__ */ Symbol(), ai = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
let Wi = class {
|
|
3
3
|
constructor(t, e, i) {
|
|
4
|
-
if (this._$cssResult$ = !0, i !==
|
|
4
|
+
if (this._$cssResult$ = !0, i !== je) 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 (Ve && t === void 0) {
|
|
11
11
|
const i = e !== void 0 && e.length === 1;
|
|
12
|
-
i && (t =
|
|
12
|
+
i && (t = ai.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && ai.set(e, t));
|
|
13
13
|
}
|
|
14
14
|
return t;
|
|
15
15
|
}
|
|
@@ -17,28 +17,28 @@ let Li = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const
|
|
20
|
+
const cn = (n) => new Wi(typeof n == "string" ? n : n + "", void 0, je), 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 Wi(e, n, je);
|
|
27
|
+
}, hn = (n, t) => {
|
|
28
|
+
if (Ve) 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 = be.litNonce;
|
|
31
31
|
s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, n.appendChild(i);
|
|
32
32
|
}
|
|
33
|
-
},
|
|
33
|
+
}, li = Ve ? (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 cn(e);
|
|
37
37
|
})(n) : n;
|
|
38
|
-
const { is:
|
|
38
|
+
const { is: dn, defineProperty: un, getOwnPropertyDescriptor: fn, getOwnPropertyNames: gn, getOwnPropertySymbols: pn, getPrototypeOf: vn } = Object, Ce = globalThis, ci = Ce.trustedTypes, mn = ci ? ci.emptyScript : "", yn = Ce.reactiveElementPolyfillSupport, re = (n, t) => n, He = { toAttribute(n, t) {
|
|
39
39
|
switch (t) {
|
|
40
40
|
case Boolean:
|
|
41
|
-
n = n ?
|
|
41
|
+
n = n ? mn : null;
|
|
42
42
|
break;
|
|
43
43
|
case Object:
|
|
44
44
|
case Array:
|
|
@@ -63,23 +63,23 @@ const { is: hn, defineProperty: dn, getOwnPropertyDescriptor: un, getOwnProperty
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return e;
|
|
66
|
-
} },
|
|
67
|
-
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"),
|
|
68
|
-
let
|
|
66
|
+
} }, Fi = (n, t) => !dn(n, t), hi = { attribute: !0, type: String, converter: He, reflect: !1, useDefault: !1, hasChanged: Fi };
|
|
67
|
+
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), Ce.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
|
+
let Vt = 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 = hi) {
|
|
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 && un(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 } = fn(this.prototype, t) ?? { get() {
|
|
83
83
|
return this[e];
|
|
84
84
|
}, set(o) {
|
|
85
85
|
this[e] = o;
|
|
@@ -90,17 +90,17 @@ let Bt = 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) ?? hi;
|
|
94
94
|
}
|
|
95
95
|
static _$Ei() {
|
|
96
|
-
if (this.hasOwnProperty(
|
|
97
|
-
const t =
|
|
96
|
+
if (this.hasOwnProperty(re("elementProperties"))) return;
|
|
97
|
+
const t = vn(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(re("finalized"))) return;
|
|
102
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(re("properties"))) {
|
|
103
|
+
const e = this.properties, i = [...gn(e), ...pn(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 Bt = 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(li(s));
|
|
123
|
+
} else t !== void 0 && e.push(li(t));
|
|
124
124
|
return e;
|
|
125
125
|
}
|
|
126
126
|
static _$Eu(t, e) {
|
|
@@ -146,7 +146,7 @@ let Bt = class extends HTMLElement {
|
|
|
146
146
|
}
|
|
147
147
|
createRenderRoot() {
|
|
148
148
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
149
|
-
return
|
|
149
|
+
return hn(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?.());
|
|
@@ -178,7 +178,7 @@ let Bt = 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 ?? Fi)(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 Bt = class extends HTMLElement {
|
|
|
246
246
|
firstUpdated(t) {
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
|
|
250
|
-
const
|
|
251
|
-
\f\r]`,
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), pi = /'/g,
|
|
253
|
-
function
|
|
254
|
-
if (!
|
|
255
|
-
return
|
|
249
|
+
Vt.elementStyles = [], Vt.shadowRootOptions = { mode: "open" }, Vt[re("elementProperties")] = /* @__PURE__ */ new Map(), Vt[re("finalized")] = /* @__PURE__ */ new Map(), yn?.({ ReactiveElement: Vt }), (Ce.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
|
+
const Ke = globalThis, di = (n) => n, we = Ke.trustedTypes, ui = we ? we.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Bi = "$lit$", At = `lit$${Math.random().toFixed(9).slice(2)}$`, qi = "?" + At, bn = `<${qi}>`, Ut = document, le = () => Ut.createComment(""), ce = (n) => n === null || typeof n != "object" && typeof n != "function", Xe = Array.isArray, wn = (n) => Xe(n) || typeof n?.[Symbol.iterator] == "function", _e = `[
|
|
251
|
+
\f\r]`, ne = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, fi = /-->/g, gi = />/g, Ht = RegExp(`>|${_e}(?:([^\\s"'>=/]+)(${_e}*=${_e}*(?:[^
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), pi = /'/g, vi = /"/g, Vi = /^(?:script|style|textarea|title)$/i, En = (n) => (t, ...e) => ({ _$litType$: n, strings: t, values: e }), _ = En(1), Xt = /* @__PURE__ */ Symbol.for("lit-noChange"), G = /* @__PURE__ */ Symbol.for("lit-nothing"), mi = /* @__PURE__ */ new WeakMap(), Nt = Ut.createTreeWalker(Ut, 129);
|
|
253
|
+
function ji(n, t) {
|
|
254
|
+
if (!Xe(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
|
+
return ui !== void 0 ? ui.createHTML(t) : t;
|
|
256
256
|
}
|
|
257
|
-
const
|
|
257
|
+
const xn = (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 = ne;
|
|
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, d, h = -1, u = 0;
|
|
263
|
+
for (; u < l.length && (o.lastIndex = u, d = o.exec(l), d !== null); ) u = o.lastIndex, o === ne ? d[1] === "!--" ? o = fi : d[1] !== void 0 ? o = gi : d[2] !== void 0 ? (Vi.test(d[2]) && (s = RegExp("</" + d[2], "g")), o = Ht) : d[3] !== void 0 && (o = Ht) : o === Ht ? d[0] === ">" ? (o = s ?? ne, h = -1) : d[1] === void 0 ? h = -2 : (h = o.lastIndex - d[2].length, c = d[1], o = d[3] === void 0 ? Ht : d[3] === '"' ? vi : pi) : o === vi || o === pi ? o = Ht : o === fi || o === gi ? o = ne : (o = Ht, s = void 0);
|
|
264
|
+
const f = o === Ht && n[a + 1].startsWith("/>") ? " " : "";
|
|
265
|
+
r += o === ne ? l + bn : h >= 0 ? (i.push(c), l.slice(0, h) + Bi + l.slice(h) + At + f) : l + At + (h === -2 ? a : f);
|
|
266
266
|
}
|
|
267
|
-
return [
|
|
267
|
+
return [ji(n, r + (n[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
|
|
268
268
|
};
|
|
269
|
-
class
|
|
269
|
+
class he {
|
|
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, d] = xn(t, e);
|
|
275
|
+
if (this.el = he.createElement(c, i), Nt.currentNode = this.el.content, e === 2 || e === 3) {
|
|
276
|
+
const h = this.el.content.firstChild;
|
|
277
|
+
h.replaceWith(...h.childNodes);
|
|
278
278
|
}
|
|
279
|
-
for (; (s =
|
|
279
|
+
for (; (s = Nt.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:
|
|
284
|
-
} else
|
|
285
|
-
if (
|
|
286
|
-
const
|
|
281
|
+
if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(Bi)) {
|
|
282
|
+
const u = d[o++], f = s.getAttribute(h).split(At), p = /([.?@])?(.*)/.exec(u);
|
|
283
|
+
l.push({ type: 1, index: r, name: p[2], strings: f, ctor: p[1] === "." ? Tn : p[1] === "?" ? kn : p[1] === "@" ? Dn : Me }), s.removeAttribute(h);
|
|
284
|
+
} else h.startsWith(At) && (l.push({ type: 6, index: r }), s.removeAttribute(h));
|
|
285
|
+
if (Vi.test(s.tagName)) {
|
|
286
|
+
const h = s.textContent.split(At), u = h.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 = we ? we.emptyScript : "";
|
|
289
|
+
for (let f = 0; f < u; f++) s.append(h[f], le()), Nt.nextNode(), l.push({ type: 2, index: ++r });
|
|
290
|
+
s.append(h[u], le());
|
|
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 h = -1;
|
|
296
|
+
for (; (h = s.data.indexOf(At, h + 1)) !== -1; ) l.push({ type: 7, index: r }), h += At.length - 1;
|
|
297
297
|
}
|
|
298
298
|
r++;
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
static createElement(t, e) {
|
|
302
|
-
const i =
|
|
302
|
+
const i = Ut.createElement("template");
|
|
303
303
|
return i.innerHTML = t, i;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
if (t ===
|
|
306
|
+
function Zt(n, t, e = n, i) {
|
|
307
|
+
if (t === Xt) 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 = ce(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 = Zt(n, s._$AS(n, t.values), s, i)), t;
|
|
311
311
|
}
|
|
312
|
-
class
|
|
312
|
+
class Sn {
|
|
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 xn {
|
|
|
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 ?? Ut).importNode(e, !0);
|
|
324
|
+
Nt.currentNode = s;
|
|
325
|
+
let r = Nt.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 ue(r, r.nextSibling, this, t) : l.type === 1 ? c = new l.ctor(r, l.name, l.strings, this, t) : l.type === 6 && (c = new Cn(r, this, t)), this._$AV.push(c), l = i[++a];
|
|
330
330
|
}
|
|
331
|
-
o !== l?.index && (r =
|
|
331
|
+
o !== l?.index && (r = Nt.nextNode(), o++);
|
|
332
332
|
}
|
|
333
|
-
return
|
|
333
|
+
return Nt.currentNode = Ut, 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 ue {
|
|
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 = G, 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 he {
|
|
|
356
356
|
return this._$AB;
|
|
357
357
|
}
|
|
358
358
|
_$AI(t, e = this) {
|
|
359
|
-
t =
|
|
359
|
+
t = Zt(this, t, e), ce(t) ? t === G || t == null || t === "" ? (this._$AH !== G && this._$AR(), this._$AH = G) : t !== this._$AH && t !== Xt && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : wn(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 he {
|
|
|
365
365
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
366
366
|
}
|
|
367
367
|
_(t) {
|
|
368
|
-
this._$AH !==
|
|
368
|
+
this._$AH !== G && ce(this._$AH) ? this._$AA.nextSibling.data = t : this.T(Ut.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 = he.createElement(ji(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 Sn(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 = mi.get(t.strings);
|
|
380
|
+
return e === void 0 && mi.set(t.strings, e = new he(t)), e;
|
|
381
381
|
}
|
|
382
382
|
k(t) {
|
|
383
|
-
|
|
383
|
+
Xe(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 ue(this.O(le()), this.O(le()), 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 = di(t).nextSibling;
|
|
392
|
+
di(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 Me {
|
|
400
400
|
get tagName() {
|
|
401
401
|
return this.element.tagName;
|
|
402
402
|
}
|
|
@@ -404,53 +404,53 @@ class Ce {
|
|
|
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 = G, 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 = G;
|
|
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 = Zt(this, t, e, 0), o = !ce(t) || t !== this._$AH && t !== Xt, 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 = Zt(this, a[i + l], e, l), c === Xt && (c = this._$AH[l]), o ||= !ce(c) || c !== this._$AH[l], c === G ? t = G : t !== G && (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 === G ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
class
|
|
424
|
+
class Tn extends Me {
|
|
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 === G ? void 0 : t;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
class
|
|
432
|
+
class kn extends Me {
|
|
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 !== G);
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
class
|
|
440
|
+
class Dn extends Me {
|
|
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 = Zt(this, t, e, 0) ?? G) === Xt) return;
|
|
446
|
+
const i = this._$AH, s = t === G && i !== G || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, r = t !== G && (i === G || 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 Cn {
|
|
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 Dn {
|
|
|
458
458
|
return this._$AM._$AU;
|
|
459
459
|
}
|
|
460
460
|
_$AI(t) {
|
|
461
|
-
|
|
461
|
+
Zt(this, t);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
const
|
|
465
|
-
|
|
464
|
+
const Mn = Ke.litHtmlPolyfillSupport;
|
|
465
|
+
Mn?.(he, ue), (Ke.litHtmlVersions ??= []).push("3.3.2");
|
|
466
466
|
const $n = (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 ue(t.insertBefore(le(), r), r, void 0, e ?? {});
|
|
472
472
|
}
|
|
473
473
|
return s._$AI(n), s;
|
|
474
474
|
};
|
|
475
|
-
const
|
|
476
|
-
class Kt extends
|
|
475
|
+
const Ze = globalThis;
|
|
476
|
+
class Kt extends Vt {
|
|
477
477
|
constructor() {
|
|
478
478
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
479
479
|
}
|
|
@@ -492,14 +492,14 @@ class Kt extends Bt {
|
|
|
492
492
|
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
493
493
|
}
|
|
494
494
|
render() {
|
|
495
|
-
return
|
|
495
|
+
return Xt;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
Kt._$litElement$ = !0, Kt.finalized = !0,
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
(
|
|
502
|
-
var
|
|
498
|
+
Kt._$litElement$ = !0, Kt.finalized = !0, Ze.litElementHydrateSupport?.({ LitElement: Kt });
|
|
499
|
+
const An = Ze.litElementPolyfillSupport;
|
|
500
|
+
An?.({ LitElement: Kt });
|
|
501
|
+
(Ze.litElementVersions ??= []).push("4.2.2");
|
|
502
|
+
var Ye = [
|
|
503
503
|
"MO",
|
|
504
504
|
"TU",
|
|
505
505
|
"WE",
|
|
@@ -516,30 +516,30 @@ var Pe = [
|
|
|
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(Ye.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 = Ye[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
|
+
), V = function(n) {
|
|
532
532
|
return n != null;
|
|
533
|
-
},
|
|
533
|
+
}, mt = function(n) {
|
|
534
534
|
return typeof n == "number";
|
|
535
|
-
},
|
|
536
|
-
return typeof n == "string" &&
|
|
537
|
-
}, ot = Array.isArray,
|
|
535
|
+
}, yi = function(n) {
|
|
536
|
+
return typeof n == "string" && Ye.includes(n);
|
|
537
|
+
}, ot = Array.isArray, bt = 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
|
+
}, H = function(n, t) {
|
|
543
543
|
var e = 0, i = [];
|
|
544
544
|
if (ot(n))
|
|
545
545
|
for (; e < t; e++)
|
|
@@ -548,89 +548,89 @@ var Pe = [
|
|
|
548
548
|
for (; e < t; e++)
|
|
549
549
|
i[e] = n;
|
|
550
550
|
return i;
|
|
551
|
-
},
|
|
551
|
+
}, On = function(n) {
|
|
552
552
|
return ot(n) ? n : [n];
|
|
553
553
|
};
|
|
554
|
-
function
|
|
554
|
+
function Bt(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 += H(e, t / e.length)), e.slice(0, t) + String(i));
|
|
558
558
|
}
|
|
559
|
-
var
|
|
559
|
+
var _n = 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
|
+
}, lt = 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
|
+
}, Pe = function(n, t) {
|
|
566
|
+
return { div: Math.floor(n / t), mod: lt(n, t) };
|
|
567
|
+
}, yt = function(n) {
|
|
568
|
+
return !V(n) || n.length === 0;
|
|
569
|
+
}, Z = function(n) {
|
|
570
|
+
return !yt(n);
|
|
571
|
+
}, F = function(n, t) {
|
|
572
|
+
return Z(n) && n.indexOf(t) !== -1;
|
|
573
|
+
}, Lt = 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
|
+
}, Pn = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Ki = 1e3 * 60 * 60 * 24, Xi = 9999, Zi = Lt(1970, 1, 1), Rn = [6, 0, 1, 2, 3, 4, 5], oe = function(n) {
|
|
576
576
|
return n % 4 === 0 && n % 100 !== 0 || n % 400 === 0;
|
|
577
|
-
},
|
|
577
|
+
}, Gi = function(n) {
|
|
578
578
|
return n instanceof Date;
|
|
579
|
-
},
|
|
580
|
-
return
|
|
581
|
-
},
|
|
579
|
+
}, se = function(n) {
|
|
580
|
+
return Gi(n) && !isNaN(n.getTime());
|
|
581
|
+
}, In = 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(
|
|
583
|
+
return Math.round(s / Ki);
|
|
584
|
+
}, Ne = function(n) {
|
|
585
|
+
return In(n, Zi);
|
|
586
|
+
}, Ji = function(n) {
|
|
587
|
+
return new Date(Zi.getTime() + n * Ki);
|
|
588
588
|
}, Hn = 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 && oe(n.getUTCFullYear()) ? 29 : Pn[t];
|
|
591
|
+
}, Gt = function(n) {
|
|
592
|
+
return Rn[n.getUTCDay()];
|
|
593
|
+
}, bi = function(n, t) {
|
|
594
|
+
var e = Lt(n, t + 1, 1);
|
|
595
|
+
return [Gt(e), Hn(e)];
|
|
596
|
+
}, Qi = 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
|
+
}, Ue = function(n) {
|
|
599
599
|
var t = new Date(n.getTime());
|
|
600
600
|
return t;
|
|
601
|
-
},
|
|
601
|
+
}, wi = function(n) {
|
|
602
602
|
for (var t = [], e = 0; e < n.length; e++)
|
|
603
|
-
t.push(
|
|
603
|
+
t.push(Ue(n[e]));
|
|
604
604
|
return t;
|
|
605
|
-
},
|
|
605
|
+
}, de = function(n) {
|
|
606
606
|
n.sort(function(t, e) {
|
|
607
607
|
return t.getTime() - e.getTime();
|
|
608
608
|
});
|
|
609
|
-
},
|
|
609
|
+
}, Ge = function(n, t) {
|
|
610
610
|
t === void 0 && (t = !0);
|
|
611
611
|
var e = new Date(n);
|
|
612
612
|
return [
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
613
|
+
Bt(e.getUTCFullYear().toString(), 4, "0"),
|
|
614
|
+
Bt(e.getUTCMonth() + 1, 2, "0"),
|
|
615
|
+
Bt(e.getUTCDate(), 2, "0"),
|
|
616
616
|
"T",
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
617
|
+
Bt(e.getUTCHours(), 2, "0"),
|
|
618
|
+
Bt(e.getUTCMinutes(), 2, "0"),
|
|
619
|
+
Bt(e.getUTCSeconds(), 2, "0"),
|
|
620
620
|
t ? "Z" : ""
|
|
621
621
|
].join("");
|
|
622
|
-
},
|
|
622
|
+
}, Je = 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
|
+
}, Ei = 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
|
+
}, Yn = function(n, t) {
|
|
631
|
+
var e = Intl.DateTimeFormat().resolvedOptions().timeZone, i = new Date(Ei(n, e)), s = new Date(Ei(n, t ?? "UTC")), r = s.getTime() - i.getTime();
|
|
632
632
|
return new Date(n.getTime() - r);
|
|
633
|
-
},
|
|
633
|
+
}, jt = (
|
|
634
634
|
/** @class */
|
|
635
635
|
(function() {
|
|
636
636
|
function n(t, e) {
|
|
@@ -665,17 +665,17 @@ var On = function(n, t, e) {
|
|
|
665
665
|
return new n(this.method, this.args);
|
|
666
666
|
}, n;
|
|
667
667
|
})()
|
|
668
|
-
),
|
|
669
|
-
return
|
|
668
|
+
), Le = function(n, t) {
|
|
669
|
+
return Le = 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
|
+
}, Le(n, t);
|
|
674
674
|
};
|
|
675
|
-
function
|
|
675
|
+
function Qe(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
|
+
Le(n, t);
|
|
679
679
|
function e() {
|
|
680
680
|
this.constructor = n;
|
|
681
681
|
}
|
|
@@ -690,15 +690,15 @@ var at = function() {
|
|
|
690
690
|
return t;
|
|
691
691
|
}, at.apply(this, arguments);
|
|
692
692
|
};
|
|
693
|
-
function
|
|
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 xi = (
|
|
699
699
|
/** @class */
|
|
700
700
|
(function(n) {
|
|
701
|
-
|
|
701
|
+
Qe(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 Ei = (
|
|
|
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
|
+
})(jt)
|
|
710
|
+
), Ee = {
|
|
711
711
|
dayNames: [
|
|
712
712
|
"Sunday",
|
|
713
713
|
"Monday",
|
|
@@ -775,38 +775,38 @@ var Ei = (
|
|
|
775
775
|
december: /^dec(ember)?/i,
|
|
776
776
|
comma: /^(,\s*|(and|or)\s*)+/i
|
|
777
777
|
}
|
|
778
|
-
},
|
|
778
|
+
}, Si = function(n, t) {
|
|
779
779
|
return n.indexOf(t) !== -1;
|
|
780
|
-
},
|
|
780
|
+
}, Nn = function(n) {
|
|
781
781
|
return n.toString();
|
|
782
|
-
},
|
|
782
|
+
}, Un = function(n, t, e) {
|
|
783
783
|
return "".concat(t, " ").concat(e, ", ").concat(n);
|
|
784
|
-
},
|
|
784
|
+
}, St = (
|
|
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 = Nn), i === void 0 && (i = Ee), s === void 0 && (s = Un), this.text = [], this.language = i || Ee, 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 h - d;
|
|
792
|
-
}), o.sort(function(h, d) {
|
|
790
|
+
r.sort(function(d, h) {
|
|
793
791
|
return d - h;
|
|
792
|
+
}), o.sort(function(d, h) {
|
|
793
|
+
return h - d;
|
|
794
794
|
}), this.bymonthday = r.concat(o), this.bymonthday.length || (this.bymonthday = null);
|
|
795
795
|
}
|
|
796
|
-
if (
|
|
796
|
+
if (V(this.origOptions.byweekday)) {
|
|
797
797
|
var a = ot(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(d) {
|
|
800
|
+
return !d.n;
|
|
801
801
|
}),
|
|
802
|
-
someWeeks: a.filter(function(
|
|
803
|
-
return !!
|
|
802
|
+
someWeeks: a.filter(function(d) {
|
|
803
|
+
return !!d.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(d, h) {
|
|
809
|
+
return d.weekday - h.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 Ei = (
|
|
|
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 (Si(["dtstart", "tzid", "wkst", "freq"], i))
|
|
821
821
|
return !0;
|
|
822
|
-
if (!
|
|
822
|
+
if (!Si(n.IMPLEMENTED[t.options.freq], i))
|
|
823
823
|
return !1;
|
|
824
824
|
}
|
|
825
825
|
return e;
|
|
@@ -829,7 +829,7 @@ var Ei = (
|
|
|
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[k.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 Ei = (
|
|
|
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 = mt(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;
|
|
@@ -900,10 +900,10 @@ var Ei = (
|
|
|
900
900
|
}, n.prototype.list = function(t, e, i, s) {
|
|
901
901
|
var r = this;
|
|
902
902
|
s === void 0 && (s = ","), ot(t) || (t = [t]);
|
|
903
|
-
var o = function(l, c,
|
|
904
|
-
for (var
|
|
905
|
-
u !== 0 && (u === l.length - 1 ?
|
|
906
|
-
return
|
|
903
|
+
var o = function(l, c, d) {
|
|
904
|
+
for (var h = "", u = 0; u < l.length; u++)
|
|
905
|
+
u !== 0 && (u === l.length - 1 ? h += " " + d + " " : h += c + " "), h += l[u];
|
|
906
|
+
return h;
|
|
907
907
|
};
|
|
908
908
|
e = e || function(l) {
|
|
909
909
|
return l.toString();
|
|
@@ -914,7 +914,7 @@ var Ei = (
|
|
|
914
914
|
return i ? o(t.map(a), s, i) : t.map(a).join(s + " ");
|
|
915
915
|
}, n;
|
|
916
916
|
})()
|
|
917
|
-
),
|
|
917
|
+
), Ln = (
|
|
918
918
|
/** @class */
|
|
919
919
|
(function() {
|
|
920
920
|
function n(t) {
|
|
@@ -961,9 +961,9 @@ var Ei = (
|
|
|
961
961
|
}, n;
|
|
962
962
|
})()
|
|
963
963
|
);
|
|
964
|
-
function
|
|
965
|
-
t === void 0 && (t =
|
|
966
|
-
var e = {}, i = new
|
|
964
|
+
function tn(n, t) {
|
|
965
|
+
t === void 0 && (t = Ee);
|
|
966
|
+
var e = {}, i = new Ln(t.tokens);
|
|
967
967
|
if (!i.start(n))
|
|
968
968
|
return null;
|
|
969
969
|
return s(), e;
|
|
@@ -974,27 +974,27 @@ function Qi(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 = k.DAILY, i.nextSymbol() && (o(), h());
|
|
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 = k.WEEKLY, e.byweekday = [k.MO, k.TU, k.WE, k.TH, k.FR], i.nextSymbol(), o(), h();
|
|
983
983
|
break;
|
|
984
984
|
case "week(s)":
|
|
985
|
-
e.freq =
|
|
985
|
+
e.freq = k.WEEKLY, i.nextSymbol() && (r(), o(), h());
|
|
986
986
|
break;
|
|
987
987
|
case "hour(s)":
|
|
988
|
-
e.freq =
|
|
988
|
+
e.freq = k.HOURLY, i.nextSymbol() && (r(), h());
|
|
989
989
|
break;
|
|
990
990
|
case "minute(s)":
|
|
991
|
-
e.freq =
|
|
991
|
+
e.freq = k.MINUTELY, i.nextSymbol() && (r(), h());
|
|
992
992
|
break;
|
|
993
993
|
case "month(s)":
|
|
994
|
-
e.freq =
|
|
994
|
+
e.freq = k.MONTHLY, i.nextSymbol() && (r(), h());
|
|
995
995
|
break;
|
|
996
996
|
case "year(s)":
|
|
997
|
-
e.freq =
|
|
997
|
+
e.freq = k.YEARLY, i.nextSymbol() && (r(), h());
|
|
998
998
|
break;
|
|
999
999
|
case "monday":
|
|
1000
1000
|
case "tuesday":
|
|
@@ -1003,19 +1003,19 @@ function Qi(n, t) {
|
|
|
1003
1003
|
case "friday":
|
|
1004
1004
|
case "saturday":
|
|
1005
1005
|
case "sunday":
|
|
1006
|
-
e.freq =
|
|
1006
|
+
e.freq = k.WEEKLY;
|
|
1007
1007
|
var f = i.symbol.substr(0, 2).toUpperCase();
|
|
1008
|
-
if (e.byweekday = [
|
|
1008
|
+
if (e.byweekday = [k[f]], !i.nextSymbol())
|
|
1009
1009
|
return;
|
|
1010
1010
|
for (; i.accept("comma"); ) {
|
|
1011
1011
|
if (i.isDone())
|
|
1012
1012
|
throw new Error("Unexpected end");
|
|
1013
|
-
var
|
|
1014
|
-
if (!
|
|
1013
|
+
var p = l();
|
|
1014
|
+
if (!p)
|
|
1015
1015
|
throw new Error("Unexpected symbol " + i.symbol + ", expected weekday");
|
|
1016
|
-
e.byweekday.push(
|
|
1016
|
+
e.byweekday.push(k[p]), i.nextSymbol();
|
|
1017
1017
|
}
|
|
1018
|
-
o(),
|
|
1018
|
+
o(), d(), h();
|
|
1019
1019
|
break;
|
|
1020
1020
|
case "january":
|
|
1021
1021
|
case "february":
|
|
@@ -1029,17 +1029,17 @@ function Qi(n, t) {
|
|
|
1029
1029
|
case "october":
|
|
1030
1030
|
case "november":
|
|
1031
1031
|
case "december":
|
|
1032
|
-
if (e.freq =
|
|
1032
|
+
if (e.freq = k.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 g = a();
|
|
1038
|
+
if (!g)
|
|
1039
1039
|
throw new Error("Unexpected symbol " + i.symbol + ", expected month");
|
|
1040
|
-
e.bymonth.push(
|
|
1040
|
+
e.bymonth.push(g), i.nextSymbol();
|
|
1041
1041
|
}
|
|
1042
|
-
r(),
|
|
1042
|
+
r(), h();
|
|
1043
1043
|
break;
|
|
1044
1044
|
default:
|
|
1045
1045
|
throw new Error("Unknown symbol");
|
|
@@ -1049,25 +1049,25 @@ function Qi(n, t) {
|
|
|
1049
1049
|
var u = i.accept("on"), f = i.accept("the");
|
|
1050
1050
|
if (u || f)
|
|
1051
1051
|
do {
|
|
1052
|
-
var
|
|
1053
|
-
if (
|
|
1054
|
-
|
|
1055
|
-
else if (
|
|
1056
|
-
i.nextSymbol(), e.byweekday || (e.byweekday = []), e.byweekday.push(
|
|
1052
|
+
var p = c(), g = l(), v = a();
|
|
1053
|
+
if (p)
|
|
1054
|
+
g ? (i.nextSymbol(), e.byweekday || (e.byweekday = []), e.byweekday.push(k[g].nth(p))) : (e.bymonthday || (e.bymonthday = []), e.bymonthday.push(p), i.accept("day(s)"));
|
|
1055
|
+
else if (g)
|
|
1056
|
+
i.nextSymbol(), e.byweekday || (e.byweekday = []), e.byweekday.push(k[g]);
|
|
1057
1057
|
else if (i.symbol === "weekday(s)")
|
|
1058
|
-
i.nextSymbol(), e.byweekday || (e.byweekday = [
|
|
1058
|
+
i.nextSymbol(), e.byweekday || (e.byweekday = [k.MO, k.TU, k.WE, k.TH, k.FR]);
|
|
1059
1059
|
else if (i.symbol === "week(s)") {
|
|
1060
1060
|
i.nextSymbol();
|
|
1061
|
-
var
|
|
1062
|
-
if (!
|
|
1061
|
+
var y = i.acceptNumber();
|
|
1062
|
+
if (!y)
|
|
1063
1063
|
throw new Error("Unexpected symbol " + i.symbol + ", expected week number");
|
|
1064
|
-
for (e.byweekno = [parseInt(
|
|
1065
|
-
if (
|
|
1064
|
+
for (e.byweekno = [parseInt(y[0], 10)]; i.accept("comma"); ) {
|
|
1065
|
+
if (y = i.acceptNumber(), !y)
|
|
1066
1066
|
throw new Error("Unexpected symbol " + i.symbol + "; expected monthday");
|
|
1067
|
-
e.byweekno.push(parseInt(
|
|
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 (v)
|
|
1070
|
+
i.nextSymbol(), e.bymonth || (e.bymonth = []), e.bymonth.push(v);
|
|
1071
1071
|
else
|
|
1072
1072
|
return;
|
|
1073
1073
|
} while (i.accept("comma") || i.accept("the") || i.accept("on"));
|
|
@@ -1149,7 +1149,7 @@ function Qi(n, t) {
|
|
|
1149
1149
|
return !1;
|
|
1150
1150
|
}
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1152
|
+
function d() {
|
|
1153
1153
|
i.accept("on"), i.accept("the");
|
|
1154
1154
|
var u = c();
|
|
1155
1155
|
if (u)
|
|
@@ -1159,7 +1159,7 @@ function Qi(n, t) {
|
|
|
1159
1159
|
e.bymonthday.push(u), i.nextSymbol();
|
|
1160
1160
|
}
|
|
1161
1161
|
}
|
|
1162
|
-
function
|
|
1162
|
+
function h() {
|
|
1163
1163
|
if (i.symbol === "until") {
|
|
1164
1164
|
var u = Date.parse(i.text);
|
|
1165
1165
|
if (!u)
|
|
@@ -1168,16 +1168,16 @@ function Qi(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 Y;
|
|
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
|
+
})(Y || (Y = {}));
|
|
1175
|
+
function ti(n) {
|
|
1176
|
+
return n < Y.HOURLY;
|
|
1177
1177
|
}
|
|
1178
|
-
var
|
|
1179
|
-
return t === void 0 && (t =
|
|
1180
|
-
},
|
|
1178
|
+
var Wn = function(n, t) {
|
|
1179
|
+
return t === void 0 && (t = Ee), new k(tn(n, t) || void 0);
|
|
1180
|
+
}, Jt = [
|
|
1181
1181
|
"count",
|
|
1182
1182
|
"until",
|
|
1183
1183
|
"interval",
|
|
@@ -1185,16 +1185,16 @@ var Ln = function(n, t) {
|
|
|
1185
1185
|
"bymonthday",
|
|
1186
1186
|
"bymonth"
|
|
1187
1187
|
];
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1188
|
+
St.IMPLEMENTED = [];
|
|
1189
|
+
St.IMPLEMENTED[Y.HOURLY] = Jt;
|
|
1190
|
+
St.IMPLEMENTED[Y.MINUTELY] = Jt;
|
|
1191
|
+
St.IMPLEMENTED[Y.DAILY] = ["byhour"].concat(Jt);
|
|
1192
|
+
St.IMPLEMENTED[Y.WEEKLY] = Jt;
|
|
1193
|
+
St.IMPLEMENTED[Y.MONTHLY] = Jt;
|
|
1194
|
+
St.IMPLEMENTED[Y.YEARLY] = ["byweekno", "byyearday"].concat(Jt);
|
|
1195
1195
|
var zn = function(n, t, e, i) {
|
|
1196
|
-
return new
|
|
1197
|
-
},
|
|
1196
|
+
return new St(n, t, e, i).toString();
|
|
1197
|
+
}, Fn = St.isFullyConvertible, xe = (
|
|
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
|
+
), Bn = (
|
|
1216
1216
|
/** @class */
|
|
1217
1217
|
(function(n) {
|
|
1218
|
-
|
|
1218
|
+
Qe(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 Gt(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 = lt(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,89 +1246,89 @@ 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 = Pe(this.hour, 24), o = r.div, a = r.mod;
|
|
1250
|
+
if (o && (this.hour = a, this.addDaily(o)), yt(s) || F(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 = Pe(this.minute, 60), a = o.div, l = o.mod;
|
|
1257
|
+
if (a && (this.minute = l, this.addHours(a, !1, s)), (yt(s) || F(s, this.hour)) && (yt(r) || F(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 = Pe(this.second, 60), l = a.div, c = a.mod;
|
|
1264
|
+
if (l && (this.second = c, this.addMinutes(l, !1, s, r)), (yt(s) || F(s, this.hour)) && (yt(r) || F(r, this.minute)) && (yt(o) || F(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 = bi(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 > Xi))
|
|
1273
1273
|
return;
|
|
1274
|
-
e =
|
|
1274
|
+
e = bi(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 Y.YEARLY:
|
|
1281
1281
|
return this.addYears(r);
|
|
1282
|
-
case
|
|
1282
|
+
case Y.MONTHLY:
|
|
1283
1283
|
return this.addMonths(r);
|
|
1284
|
-
case
|
|
1284
|
+
case Y.WEEKLY:
|
|
1285
1285
|
return this.addWeekly(r, o);
|
|
1286
|
-
case
|
|
1286
|
+
case Y.DAILY:
|
|
1287
1287
|
return this.addDaily(r);
|
|
1288
|
-
case
|
|
1288
|
+
case Y.HOURLY:
|
|
1289
1289
|
return this.addHours(r, i, a);
|
|
1290
|
-
case
|
|
1290
|
+
case Y.MINUTELY:
|
|
1291
1291
|
return this.addMinutes(r, i, a, l);
|
|
1292
|
-
case
|
|
1292
|
+
case Y.SECONDLY:
|
|
1293
1293
|
return this.addSeconds(r, i, a, l, c);
|
|
1294
1294
|
}
|
|
1295
1295
|
}, t;
|
|
1296
|
-
})(
|
|
1296
|
+
})(xe)
|
|
1297
1297
|
);
|
|
1298
|
-
function
|
|
1298
|
+
function en(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
|
+
F(ws, r) || t.push(r), Gi(n[r]) && !se(n[r]) && t.push(r);
|
|
1302
1302
|
}
|
|
1303
1303
|
if (t.length)
|
|
1304
1304
|
throw new Error("Invalid options: " + t.join(", "));
|
|
1305
1305
|
return at({}, n);
|
|
1306
1306
|
}
|
|
1307
|
-
function
|
|
1308
|
-
var t = at(at({},
|
|
1309
|
-
if (
|
|
1307
|
+
function qn(n) {
|
|
1308
|
+
var t = at(at({}, ei), en(n));
|
|
1309
|
+
if (V(t.byeaster) && (t.freq = k.YEARLY), !(V(t.freq) && k.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))), V(t.wkst) ? mt(t.wkst) || (t.wkst = t.wkst.weekday) : t.wkst = k.MO.weekday, V(t.bysetpos)) {
|
|
1312
|
+
mt(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 || Z(t.byweekno) || Z(t.byyearday) || t.bymonthday || Z(t.bymonthday) || V(t.byweekday) || V(t.byeaster)))
|
|
1320
1320
|
switch (t.freq) {
|
|
1321
|
-
case
|
|
1321
|
+
case k.YEARLY:
|
|
1322
1322
|
t.bymonth || (t.bymonth = t.dtstart.getUTCMonth() + 1), t.bymonthday = t.dtstart.getUTCDate();
|
|
1323
1323
|
break;
|
|
1324
|
-
case
|
|
1324
|
+
case k.MONTHLY:
|
|
1325
1325
|
t.bymonthday = t.dtstart.getUTCDate();
|
|
1326
1326
|
break;
|
|
1327
|
-
case
|
|
1328
|
-
t.byweekday = [
|
|
1327
|
+
case k.WEEKLY:
|
|
1328
|
+
t.byweekday = [Gt(t.dtstart)];
|
|
1329
1329
|
break;
|
|
1330
1330
|
}
|
|
1331
|
-
if (
|
|
1331
|
+
if (V(t.bymonth) && !ot(t.bymonth) && (t.bymonth = [t.bymonth]), V(t.byyearday) && !ot(t.byyearday) && mt(t.byyearday) && (t.byyearday = [t.byyearday]), !V(t.bymonthday))
|
|
1332
1332
|
t.bymonthday = [], t.bynmonthday = [];
|
|
1333
1333
|
else if (ot(t.bymonthday)) {
|
|
1334
1334
|
for (var s = [], r = [], e = 0; e < t.bymonthday.length; e++) {
|
|
@@ -1337,84 +1337,84 @@ function Bn(n) {
|
|
|
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 (V(t.byweekno) && !ot(t.byweekno) && (t.byweekno = [t.byweekno]), !V(t.byweekday))
|
|
1341
1341
|
t.bynweekday = null;
|
|
1342
|
-
else if (
|
|
1342
|
+
else if (mt(t.byweekday))
|
|
1343
1343
|
t.byweekday = [t.byweekday], t.bynweekday = null;
|
|
1344
|
-
else if (
|
|
1344
|
+
else if (yi(t.byweekday))
|
|
1345
1345
|
t.byweekday = [it.fromStr(t.byweekday).weekday], t.bynweekday = null;
|
|
1346
1346
|
else if (t.byweekday instanceof it)
|
|
1347
|
-
!t.byweekday.n || t.freq >
|
|
1347
|
+
!t.byweekday.n || t.freq > k.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 (mt(l)) {
|
|
1352
1352
|
o.push(l);
|
|
1353
1353
|
continue;
|
|
1354
|
-
} else if (
|
|
1354
|
+
} else if (yi(l)) {
|
|
1355
1355
|
o.push(it.fromStr(l).weekday);
|
|
1356
1356
|
continue;
|
|
1357
1357
|
}
|
|
1358
|
-
!l.n || t.freq >
|
|
1358
|
+
!l.n || t.freq > k.MONTHLY ? o.push(l.weekday) : a.push([l.weekday, l.n]);
|
|
1359
1359
|
}
|
|
1360
|
-
t.byweekday =
|
|
1360
|
+
t.byweekday = Z(o) ? o : null, t.bynweekday = Z(a) ? a : null;
|
|
1361
1361
|
}
|
|
1362
|
-
return
|
|
1362
|
+
return V(t.byhour) ? mt(t.byhour) && (t.byhour = [t.byhour]) : t.byhour = t.freq < k.HOURLY ? [t.dtstart.getUTCHours()] : null, V(t.byminute) ? mt(t.byminute) && (t.byminute = [t.byminute]) : t.byminute = t.freq < k.MINUTELY ? [t.dtstart.getUTCMinutes()] : null, V(t.bysecond) ? mt(t.bysecond) && (t.bysecond = [t.bysecond]) : t.bysecond = t.freq < k.SECONDLY ? [t.dtstart.getUTCSeconds()] : null, { parsedOptions: t };
|
|
1363
1363
|
}
|
|
1364
|
-
function
|
|
1364
|
+
function Vn(n) {
|
|
1365
1365
|
var t = n.dtstart.getTime() % 1e3;
|
|
1366
|
-
if (!
|
|
1366
|
+
if (!ti(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 xe(i, s, r, t));
|
|
1373
1373
|
});
|
|
1374
1374
|
});
|
|
1375
1375
|
}), e;
|
|
1376
1376
|
}
|
|
1377
|
-
function
|
|
1377
|
+
function We(n) {
|
|
1378
1378
|
var t = n.split(`
|
|
1379
|
-
`).map(
|
|
1379
|
+
`).map(jn).filter(function(e) {
|
|
1380
1380
|
return e !== null;
|
|
1381
1381
|
});
|
|
1382
1382
|
return at(at({}, t[0]), t[1]);
|
|
1383
1383
|
}
|
|
1384
|
-
function
|
|
1384
|
+
function Se(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 = Je(s), t;
|
|
1390
1390
|
}
|
|
1391
|
-
function
|
|
1391
|
+
function jn(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 Ti(n);
|
|
1397
1397
|
var e = t[1];
|
|
1398
1398
|
switch (e.toUpperCase()) {
|
|
1399
1399
|
case "RRULE":
|
|
1400
1400
|
case "EXRULE":
|
|
1401
|
-
return
|
|
1401
|
+
return Ti(n);
|
|
1402
1402
|
case "DTSTART":
|
|
1403
|
-
return
|
|
1403
|
+
return Se(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 Ti(n) {
|
|
1409
|
+
var t = n.replace(/^RRULE:/i, ""), e = Se(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 = Y[a.toUpperCase()];
|
|
1415
1415
|
break;
|
|
1416
1416
|
case "WKST":
|
|
1417
|
-
e.wkst =
|
|
1417
|
+
e.wkst = dt[a.toUpperCase()];
|
|
1418
1418
|
break;
|
|
1419
1419
|
case "COUNT":
|
|
1420
1420
|
case "INTERVAL":
|
|
@@ -1426,20 +1426,20 @@ function Si(n) {
|
|
|
1426
1426
|
case "BYHOUR":
|
|
1427
1427
|
case "BYMINUTE":
|
|
1428
1428
|
case "BYSECOND":
|
|
1429
|
-
var l =
|
|
1429
|
+
var l = Kn(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 = Xn(a);
|
|
1435
1435
|
break;
|
|
1436
1436
|
case "DTSTART":
|
|
1437
1437
|
case "TZID":
|
|
1438
|
-
var
|
|
1439
|
-
e.tzid =
|
|
1438
|
+
var d = Se(n);
|
|
1439
|
+
e.tzid = d.tzid, e.dtstart = d.dtstart;
|
|
1440
1440
|
break;
|
|
1441
1441
|
case "UNTIL":
|
|
1442
|
-
e.until =
|
|
1442
|
+
e.until = Je(a);
|
|
1443
1443
|
break;
|
|
1444
1444
|
case "BYEASTER":
|
|
1445
1445
|
e.byeaster = Number(a);
|
|
@@ -1449,29 +1449,29 @@ function Si(n) {
|
|
|
1449
1449
|
}
|
|
1450
1450
|
}), e;
|
|
1451
1451
|
}
|
|
1452
|
-
function
|
|
1452
|
+
function Kn(n) {
|
|
1453
1453
|
if (n.indexOf(",") !== -1) {
|
|
1454
1454
|
var t = n.split(",");
|
|
1455
|
-
return t.map(
|
|
1455
|
+
return t.map(ki);
|
|
1456
1456
|
}
|
|
1457
|
-
return
|
|
1457
|
+
return ki(n);
|
|
1458
1458
|
}
|
|
1459
|
-
function
|
|
1459
|
+
function ki(n) {
|
|
1460
1460
|
return /^[+-]?\d+$/.test(n) ? Number(n) : n;
|
|
1461
1461
|
}
|
|
1462
|
-
function
|
|
1462
|
+
function Xn(n) {
|
|
1463
1463
|
var t = n.split(",");
|
|
1464
1464
|
return t.map(function(e) {
|
|
1465
1465
|
if (e.length === 2)
|
|
1466
|
-
return
|
|
1466
|
+
return dt[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 =
|
|
1470
|
+
var s = Number(i[1]), r = i[2], o = dt[r].weekday;
|
|
1471
1471
|
return new it(o, s);
|
|
1472
1472
|
});
|
|
1473
1473
|
}
|
|
1474
|
-
var
|
|
1474
|
+
var Te = (
|
|
1475
1475
|
/** @class */
|
|
1476
1476
|
(function() {
|
|
1477
1477
|
function n(t, e) {
|
|
@@ -1486,42 +1486,42 @@ var Se = (
|
|
|
1486
1486
|
enumerable: !1,
|
|
1487
1487
|
configurable: !0
|
|
1488
1488
|
}), n.prototype.toString = function() {
|
|
1489
|
-
var t =
|
|
1489
|
+
var t = Ge(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 : Yn(this.date, this.tzid);
|
|
1495
1495
|
}, n;
|
|
1496
1496
|
})()
|
|
1497
1497
|
);
|
|
1498
1498
|
function ze(n) {
|
|
1499
|
-
for (var t = [], e = "", i = Object.keys(n), s = Object.keys(
|
|
1500
|
-
if (i[r] !== "tzid" &&
|
|
1499
|
+
for (var t = [], e = "", i = Object.keys(n), s = Object.keys(ei), r = 0; r < i.length; r++)
|
|
1500
|
+
if (i[r] !== "tzid" && F(s, i[r])) {
|
|
1501
1501
|
var o = i[r].toUpperCase(), a = n[i[r]], l = "";
|
|
1502
|
-
if (!(!
|
|
1502
|
+
if (!(!V(a) || ot(a) && !a.length)) {
|
|
1503
1503
|
switch (o) {
|
|
1504
1504
|
case "FREQ":
|
|
1505
|
-
l =
|
|
1505
|
+
l = k.FREQUENCIES[n.freq];
|
|
1506
1506
|
break;
|
|
1507
1507
|
case "WKST":
|
|
1508
|
-
|
|
1508
|
+
mt(a) ? l = new it(a).toString() : l = a.toString();
|
|
1509
1509
|
break;
|
|
1510
1510
|
case "BYWEEKDAY":
|
|
1511
|
-
o = "BYDAY", l =
|
|
1511
|
+
o = "BYDAY", l = On(a).map(function(f) {
|
|
1512
1512
|
return f instanceof it ? f : ot(f) ? new it(f[0], f[1]) : new it(f);
|
|
1513
1513
|
}).toString();
|
|
1514
1514
|
break;
|
|
1515
1515
|
case "DTSTART":
|
|
1516
|
-
e =
|
|
1516
|
+
e = Zn(a, n.tzid);
|
|
1517
1517
|
break;
|
|
1518
1518
|
case "UNTIL":
|
|
1519
|
-
l =
|
|
1519
|
+
l = Ge(a, !n.tzid);
|
|
1520
1520
|
break;
|
|
1521
1521
|
default:
|
|
1522
1522
|
if (ot(a)) {
|
|
1523
|
-
for (var c = [],
|
|
1524
|
-
c[
|
|
1523
|
+
for (var c = [], d = 0; d < a.length; d++)
|
|
1524
|
+
c[d] = String(a[d]);
|
|
1525
1525
|
l = c.toString();
|
|
1526
1526
|
} else
|
|
1527
1527
|
l = String(a);
|
|
@@ -1529,36 +1529,36 @@ function ze(n) {
|
|
|
1529
1529
|
l && t.push([o, l]);
|
|
1530
1530
|
}
|
|
1531
1531
|
}
|
|
1532
|
-
var
|
|
1533
|
-
var
|
|
1534
|
-
return "".concat(
|
|
1532
|
+
var h = t.map(function(f) {
|
|
1533
|
+
var p = f[0], g = f[1];
|
|
1534
|
+
return "".concat(p, "=").concat(g.toString());
|
|
1535
1535
|
}).join(";"), u = "";
|
|
1536
|
-
return
|
|
1536
|
+
return h !== "" && (u = "RRULE:".concat(h)), [e, u].filter(function(f) {
|
|
1537
1537
|
return !!f;
|
|
1538
1538
|
}).join(`
|
|
1539
1539
|
`);
|
|
1540
1540
|
}
|
|
1541
|
-
function Xn(n, t) {
|
|
1542
|
-
return n ? "DTSTART" + new Se(new Date(n), t).toString() : "";
|
|
1543
|
-
}
|
|
1544
1541
|
function Zn(n, t) {
|
|
1542
|
+
return n ? "DTSTART" + new Te(new Date(n), t).toString() : "";
|
|
1543
|
+
}
|
|
1544
|
+
function Gn(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 Jn = (
|
|
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 ? Ue(e) : wi(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(d) {
|
|
1559
|
+
for (var h = 0; h < s.length; h++) {
|
|
1560
|
+
var u = s[h];
|
|
1561
|
+
if (!Gn(e[u], d[u]))
|
|
1562
1562
|
return !0;
|
|
1563
1563
|
}
|
|
1564
1564
|
return !1;
|
|
@@ -1574,97 +1574,97 @@ var Gn = (
|
|
|
1574
1574
|
}
|
|
1575
1575
|
}
|
|
1576
1576
|
if (!i && this.all) {
|
|
1577
|
-
for (var c = new
|
|
1577
|
+
for (var c = new jt(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 ot(i) ?
|
|
1581
|
+
return ot(i) ? wi(i) : i instanceof Date ? Ue(i) : i;
|
|
1582
1582
|
}, n;
|
|
1583
1583
|
})()
|
|
1584
|
-
),
|
|
1584
|
+
), Qn = m(m(m(m(m(m(m(m(m(m(m(m(m([], H(1, 31), !0), H(2, 28), !0), H(3, 31), !0), H(4, 30), !0), H(5, 31), !0), H(6, 30), !0), H(7, 31), !0), H(8, 31), !0), H(9, 30), !0), H(10, 31), !0), H(11, 30), !0), H(12, 31), !0), H(1, 7), !0), ts = m(m(m(m(m(m(m(m(m(m(m(m(m([], H(1, 31), !0), H(2, 29), !0), H(3, 31), !0), H(4, 30), !0), H(5, 31), !0), H(6, 30), !0), H(7, 31), !0), H(8, 31), !0), H(9, 30), !0), H(10, 31), !0), H(11, 30), !0), H(12, 31), !0), H(1, 7), !0), es = bt(1, 29), is = bt(1, 30), Ot = bt(1, 31), tt = bt(1, 32), ns = m(m(m(m(m(m(m(m(m(m(m(m(m([], tt, !0), is, !0), tt, !0), Ot, !0), tt, !0), Ot, !0), tt, !0), tt, !0), Ot, !0), tt, !0), Ot, !0), tt, !0), tt.slice(0, 7), !0), ss = m(m(m(m(m(m(m(m(m(m(m(m(m([], tt, !0), es, !0), tt, !0), Ot, !0), tt, !0), Ot, !0), tt, !0), tt, !0), Ot, !0), tt, !0), Ot, !0), tt, !0), tt.slice(0, 7), !0), rs = bt(-28, 0), os = bt(-29, 0), _t = bt(-30, 0), et = bt(-31, 0), as = m(m(m(m(m(m(m(m(m(m(m(m(m([], et, !0), os, !0), et, !0), _t, !0), et, !0), _t, !0), et, !0), et, !0), _t, !0), et, !0), _t, !0), et, !0), et.slice(0, 7), !0), ls = m(m(m(m(m(m(m(m(m(m(m(m(m([], et, !0), rs, !0), et, !0), _t, !0), et, !0), _t, !0), et, !0), et, !0), _t, !0), et, !0), _t, !0), et, !0), et.slice(0, 7), !0), cs = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366], hs = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365], Di = (function() {
|
|
1585
1585
|
for (var n = [], t = 0; t < 55; t++)
|
|
1586
|
-
n = n.concat(
|
|
1586
|
+
n = n.concat(bt(7));
|
|
1587
1587
|
return n;
|
|
1588
1588
|
})();
|
|
1589
|
-
function
|
|
1590
|
-
var e =
|
|
1591
|
-
if (
|
|
1589
|
+
function ds(n, t) {
|
|
1590
|
+
var e = Lt(n, 1, 1), i = oe(n) ? 366 : 365, s = oe(n + 1) ? 366 : 365, r = Ne(e), o = Gt(e), a = at(at({ yearlen: i, nextyearlen: s, yearordinal: r, yearweekday: o }, us(n)), { wnomask: null });
|
|
1591
|
+
if (yt(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
|
|
1593
|
+
a.wnomask = H(0, i + 7);
|
|
1594
|
+
var l, c, d = l = lt(7 - o + t.wkst, 7);
|
|
1595
|
+
d >= 4 ? (d = 0, c = a.yearlen + lt(o - t.wkst, 7)) : c = i - d;
|
|
1596
|
+
for (var h = Math.floor(c / 7), u = lt(c, 7), f = Math.floor(h + u / 4), p = 0; p < t.byweekno.length; p++) {
|
|
1597
|
+
var g = t.byweekno[p];
|
|
1598
|
+
if (g < 0 && (g += f + 1), g > 0 && g <= f) {
|
|
1599
|
+
var v = void 0;
|
|
1600
|
+
g > 1 ? (v = d + (g - 1) * 7, d !== l && (v -= 7 - l)) : v = d;
|
|
1601
|
+
for (var y = 0; y < 7 && (a.wnomask[v] = 1, v++, a.wdaymask[v] !== t.wkst); y++)
|
|
1602
1602
|
;
|
|
1603
1603
|
}
|
|
1604
1604
|
}
|
|
1605
|
-
if (
|
|
1606
|
-
var
|
|
1607
|
-
if (
|
|
1608
|
-
for (var
|
|
1605
|
+
if (F(t.byweekno, 1)) {
|
|
1606
|
+
var v = d + f * 7;
|
|
1607
|
+
if (d !== l && (v -= 7 - l), v < i)
|
|
1608
|
+
for (var p = 0; p < 7 && (a.wnomask[v] = 1, v += 1, a.wdaymask[v] !== t.wkst); p++)
|
|
1609
1609
|
;
|
|
1610
1610
|
}
|
|
1611
|
-
if (
|
|
1612
|
-
var
|
|
1613
|
-
if (
|
|
1614
|
-
|
|
1611
|
+
if (d) {
|
|
1612
|
+
var A = void 0;
|
|
1613
|
+
if (F(t.byweekno, -1))
|
|
1614
|
+
A = -1;
|
|
1615
1615
|
else {
|
|
1616
|
-
var
|
|
1617
|
-
|
|
1616
|
+
var P = Gt(Lt(n - 1, 1, 1)), C = lt(7 - P.valueOf() + t.wkst, 7), x = oe(n - 1) ? 366 : 365, M = void 0;
|
|
1617
|
+
C >= 4 ? (C = 0, M = x + lt(P - t.wkst, 7)) : M = i - d, A = Math.floor(52 + lt(M, 7) / 4);
|
|
1618
1618
|
}
|
|
1619
|
-
if (
|
|
1620
|
-
for (var
|
|
1621
|
-
a.wnomask[
|
|
1619
|
+
if (F(t.byweekno, A))
|
|
1620
|
+
for (var v = 0; v < d; v++)
|
|
1621
|
+
a.wnomask[v] = 1;
|
|
1622
1622
|
}
|
|
1623
1623
|
return a;
|
|
1624
1624
|
}
|
|
1625
|
-
function
|
|
1626
|
-
var t =
|
|
1625
|
+
function us(n) {
|
|
1626
|
+
var t = oe(n) ? 366 : 365, e = Lt(n, 1, 1), i = Gt(e);
|
|
1627
1627
|
return t === 365 ? {
|
|
1628
|
-
mmask:
|
|
1628
|
+
mmask: Qn,
|
|
1629
|
+
mdaymask: ss,
|
|
1630
|
+
nmdaymask: ls,
|
|
1631
|
+
wdaymask: Di.slice(i),
|
|
1632
|
+
mrange: hs
|
|
1633
|
+
} : {
|
|
1634
|
+
mmask: ts,
|
|
1629
1635
|
mdaymask: ns,
|
|
1630
1636
|
nmdaymask: as,
|
|
1631
|
-
wdaymask:
|
|
1637
|
+
wdaymask: Di.slice(i),
|
|
1632
1638
|
mrange: cs
|
|
1633
|
-
} : {
|
|
1634
|
-
mmask: Qn,
|
|
1635
|
-
mdaymask: is,
|
|
1636
|
-
nmdaymask: os,
|
|
1637
|
-
wdaymask: ki.slice(i),
|
|
1638
|
-
mrange: ls
|
|
1639
1639
|
};
|
|
1640
1640
|
}
|
|
1641
|
-
function
|
|
1641
|
+
function fs(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 === k.YEARLY)
|
|
1648
|
+
if (yt(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 === k.MONTHLY && (a = [i.slice(t - 1, t + 1)]);
|
|
1654
|
+
if (yt(a))
|
|
1655
1655
|
return o;
|
|
1656
|
-
o.nwdaymask =
|
|
1656
|
+
o.nwdaymask = H(0, e);
|
|
1657
1657
|
for (var l = 0; l < a.length; l++)
|
|
1658
|
-
for (var c = a[l],
|
|
1659
|
-
var f = void 0,
|
|
1660
|
-
|
|
1658
|
+
for (var c = a[l], d = c[0], h = c[1] - 1, u = 0; u < r.bynweekday.length; u++) {
|
|
1659
|
+
var f = void 0, p = r.bynweekday[u], g = p[0], v = p[1];
|
|
1660
|
+
v < 0 ? (f = h + (v + 1) * 7, f -= lt(s[f] - g, 7)) : (f = d + (v - 1) * 7, f += lt(7 - s[f] + g, 7)), d <= f && f <= h && (o.nwdaymask[f] = 1);
|
|
1661
1661
|
}
|
|
1662
1662
|
return o;
|
|
1663
1663
|
}
|
|
1664
|
-
function
|
|
1664
|
+
function gs(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, d = Math.floor(s / 4), h = s % 4, u = Math.floor(32 + 2 * o + 2 * d - c - h) % 7, f = Math.floor((e + 11 * c + 22 * u) / 451), p = Math.floor((c + u - 7 * f + 114) / 31), g = (c + u - 7 * f + 114) % 31 + 1, v = Date.UTC(n, p - 1, g + t), y = Date.UTC(n, 0, 1);
|
|
1667
|
+
return [Math.ceil((v - y) / (1e3 * 60 * 60 * 24))];
|
|
1668
1668
|
}
|
|
1669
1669
|
var ps = (
|
|
1670
1670
|
/** @class */
|
|
@@ -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 = ds(t, i)), Z(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 = fs(t, e, r, o, a, i);
|
|
1680
1680
|
}
|
|
1681
|
-
|
|
1681
|
+
V(i.byeaster) && (this.eastermask = gs(t, i.byeaster));
|
|
1682
1682
|
}, Object.defineProperty(n.prototype, "lastyear", {
|
|
1683
1683
|
get: function() {
|
|
1684
1684
|
return this.monthinfo ? this.monthinfo.lastyear : null;
|
|
@@ -1752,131 +1752,131 @@ var ps = (
|
|
|
1752
1752
|
enumerable: !1,
|
|
1753
1753
|
configurable: !0
|
|
1754
1754
|
}), n.prototype.ydayset = function() {
|
|
1755
|
-
return [
|
|
1755
|
+
return [bt(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 = H(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 = H(null, this.yearlen + 7), r = Ne(Lt(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 = H(null, this.yearlen), r = Ne(Lt(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
|
+
}), de(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 xe(t, e, o, s);
|
|
1775
1775
|
});
|
|
1776
|
-
return
|
|
1776
|
+
return de(r), r;
|
|
1777
1777
|
}, n.prototype.stimeset = function(t, e, i, s) {
|
|
1778
|
-
return [new
|
|
1778
|
+
return [new xe(t, e, i, s)];
|
|
1779
1779
|
}, n.prototype.getdayset = function(t) {
|
|
1780
1780
|
switch (t) {
|
|
1781
|
-
case
|
|
1781
|
+
case Y.YEARLY:
|
|
1782
1782
|
return this.ydayset.bind(this);
|
|
1783
|
-
case
|
|
1783
|
+
case Y.MONTHLY:
|
|
1784
1784
|
return this.mdayset.bind(this);
|
|
1785
|
-
case
|
|
1785
|
+
case Y.WEEKLY:
|
|
1786
1786
|
return this.wdayset.bind(this);
|
|
1787
|
-
case
|
|
1787
|
+
case Y.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 Y.HOURLY:
|
|
1795
1795
|
return this.htimeset.bind(this);
|
|
1796
|
-
case
|
|
1796
|
+
case Y.MINUTELY:
|
|
1797
1797
|
return this.mtimeset.bind(this);
|
|
1798
|
-
case
|
|
1798
|
+
case Y.SECONDLY:
|
|
1799
1799
|
return this.stimeset.bind(this);
|
|
1800
1800
|
}
|
|
1801
1801
|
}, n;
|
|
1802
1802
|
})()
|
|
1803
1803
|
);
|
|
1804
|
-
function
|
|
1804
|
+
function vs(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, d = n[a];
|
|
1807
|
+
d < 0 ? (l = Math.floor(d / t.length), c = lt(d, t.length)) : (l = Math.floor((d - 1) / t.length), c = lt(d - 1, t.length));
|
|
1808
|
+
for (var h = [], u = e; u < i; u++) {
|
|
1809
1809
|
var f = r[u];
|
|
1810
|
-
|
|
1810
|
+
V(f) && h.push(f);
|
|
1811
1811
|
}
|
|
1812
|
-
var
|
|
1813
|
-
l < 0 ?
|
|
1814
|
-
var
|
|
1815
|
-
|
|
1812
|
+
var p = void 0;
|
|
1813
|
+
l < 0 ? p = h.slice(l)[0] : p = h[l];
|
|
1814
|
+
var g = t[c], v = Ji(s.yearordinal + p), y = Qi(v, g);
|
|
1815
|
+
F(o, y) || o.push(y);
|
|
1816
1816
|
}
|
|
1817
|
-
return
|
|
1817
|
+
return de(o), o;
|
|
1818
1818
|
}
|
|
1819
|
-
function
|
|
1819
|
+
function nn(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 xt(n);
|
|
1823
|
+
var l = Bn.fromDate(e), c = new ps(t);
|
|
1824
1824
|
c.rebuild(l.year, l.month);
|
|
1825
|
-
for (var
|
|
1826
|
-
var
|
|
1827
|
-
if (
|
|
1828
|
-
for (var
|
|
1829
|
-
var
|
|
1830
|
-
if (r &&
|
|
1831
|
-
return
|
|
1832
|
-
if (
|
|
1833
|
-
var
|
|
1834
|
-
if (!n.accept(
|
|
1835
|
-
return
|
|
1825
|
+
for (var d = bs(c, l, t); ; ) {
|
|
1826
|
+
var h = c.getdayset(i)(l.year, l.month, l.day), u = h[0], f = h[1], p = h[2], g = ys(u, f, p, c, t);
|
|
1827
|
+
if (Z(o))
|
|
1828
|
+
for (var v = vs(o, d, f, p, c, u), y = 0; y < v.length; y++) {
|
|
1829
|
+
var A = v[y];
|
|
1830
|
+
if (r && A > r)
|
|
1831
|
+
return xt(n);
|
|
1832
|
+
if (A >= e) {
|
|
1833
|
+
var P = Ci(A, t);
|
|
1834
|
+
if (!n.accept(P) || a && (--a, !a))
|
|
1835
|
+
return xt(n);
|
|
1836
1836
|
}
|
|
1837
1837
|
}
|
|
1838
1838
|
else
|
|
1839
|
-
for (var
|
|
1840
|
-
var
|
|
1841
|
-
if (
|
|
1842
|
-
for (var
|
|
1843
|
-
var
|
|
1844
|
-
if (r &&
|
|
1845
|
-
return
|
|
1846
|
-
if (
|
|
1847
|
-
var
|
|
1848
|
-
if (!n.accept(
|
|
1849
|
-
return
|
|
1839
|
+
for (var y = f; y < p; y++) {
|
|
1840
|
+
var C = u[y];
|
|
1841
|
+
if (V(C))
|
|
1842
|
+
for (var x = Ji(c.yearordinal + C), M = 0; M < d.length; M++) {
|
|
1843
|
+
var w = d[M], A = Qi(x, w);
|
|
1844
|
+
if (r && A > r)
|
|
1845
|
+
return xt(n);
|
|
1846
|
+
if (A >= e) {
|
|
1847
|
+
var P = Ci(A, t);
|
|
1848
|
+
if (!n.accept(P) || a && (--a, !a))
|
|
1849
|
+
return xt(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, g), l.year > Xi))
|
|
1854
|
+
return xt(n);
|
|
1855
|
+
ti(i) || (d = c.gettimeset(i)(l.hour, l.minute, l.second, 0)), c.rebuild(l.year, l.month);
|
|
1856
1856
|
}
|
|
1857
1857
|
}
|
|
1858
|
-
function
|
|
1858
|
+
function ms(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 Z(i) && !F(i, n.mmask[t]) || Z(s) && !n.wnomask[t] || Z(r) && !F(r, n.wdaymask[t]) || Z(n.nwdaymask) && !n.nwdaymask[t] || o !== null && !F(n.eastermask, t) || (Z(a) || Z(l)) && !F(a, n.mdaymask[t]) && !F(l, n.nmdaymask[t]) || Z(c) && (t < n.yearlen && !F(c, t + 1) && !F(c, -n.yearlen + t) || t >= n.yearlen && !F(c, t + 1 - n.yearlen) && !F(c, -n.nextyearlen + t - n.yearlen));
|
|
1861
1861
|
}
|
|
1862
|
-
function
|
|
1863
|
-
return new
|
|
1862
|
+
function Ci(n, t) {
|
|
1863
|
+
return new Te(n, t.tzid).rezonedDate();
|
|
1864
1864
|
}
|
|
1865
|
-
function
|
|
1865
|
+
function xt(n) {
|
|
1866
1866
|
return n.getValue();
|
|
1867
1867
|
}
|
|
1868
|
-
function
|
|
1868
|
+
function ys(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 = ms(i, a, s), r && (n[a] = null);
|
|
1872
1872
|
}
|
|
1873
1873
|
return r;
|
|
1874
1874
|
}
|
|
1875
|
-
function
|
|
1875
|
+
function bs(n, t, e) {
|
|
1876
1876
|
var i = e.freq, s = e.byhour, r = e.byminute, o = e.bysecond;
|
|
1877
|
-
return
|
|
1877
|
+
return ti(i) ? Vn(e) : i >= k.HOURLY && Z(s) && !F(s, t.hour) || i >= k.MINUTELY && Z(r) && !F(r, t.minute) || i >= k.SECONDLY && Z(o) && !F(o, t.second) ? [] : n.gettimeset(i)(t.hour, t.minute, t.second, t.millisecond);
|
|
1878
1878
|
}
|
|
1879
|
-
var
|
|
1879
|
+
var dt = {
|
|
1880
1880
|
MO: new it(0),
|
|
1881
1881
|
TU: new it(1),
|
|
1882
1882
|
WE: new it(2),
|
|
@@ -1884,11 +1884,11 @@ var ft = {
|
|
|
1884
1884
|
FR: new it(4),
|
|
1885
1885
|
SA: new it(5),
|
|
1886
1886
|
SU: new it(6)
|
|
1887
|
-
},
|
|
1888
|
-
freq:
|
|
1887
|
+
}, ei = {
|
|
1888
|
+
freq: Y.YEARLY,
|
|
1889
1889
|
dtstart: null,
|
|
1890
1890
|
interval: 1,
|
|
1891
|
-
wkst:
|
|
1891
|
+
wkst: dt.MO,
|
|
1892
1892
|
count: null,
|
|
1893
1893
|
until: null,
|
|
1894
1894
|
tzid: null,
|
|
@@ -1904,22 +1904,22 @@ var ft = {
|
|
|
1904
1904
|
byminute: null,
|
|
1905
1905
|
bysecond: null,
|
|
1906
1906
|
byeaster: null
|
|
1907
|
-
},
|
|
1907
|
+
}, ws = Object.keys(ei), k = (
|
|
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 Jn(), this.origOptions = en(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 tn(t, e);
|
|
1917
1917
|
}, n.fromText = function(t, e) {
|
|
1918
|
-
return
|
|
1918
|
+
return Wn(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 nn(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 ft = {
|
|
|
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 xi("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 jt("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), !se(t) || !se(e))
|
|
1935
1935
|
throw new Error("Invalid date passed in to RRule.between");
|
|
1936
1936
|
var r = {
|
|
1937
1937
|
before: e,
|
|
@@ -1939,19 +1939,19 @@ var ft = {
|
|
|
1939
1939
|
inc: i
|
|
1940
1940
|
};
|
|
1941
1941
|
if (s)
|
|
1942
|
-
return this._iter(new
|
|
1942
|
+
return this._iter(new xi("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 jt("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), !se(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 jt("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), !se(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 jt("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() {
|
|
@@ -1959,7 +1959,7 @@ var ft = {
|
|
|
1959
1959
|
}, n.prototype.toText = function(t, e, i) {
|
|
1960
1960
|
return zn(this, t, e, i);
|
|
1961
1961
|
}, n.prototype.isFullyConvertibleToText = function() {
|
|
1962
|
-
return
|
|
1962
|
+
return Fn(this);
|
|
1963
1963
|
}, n.prototype.clone = function() {
|
|
1964
1964
|
return new n(this.origOptions);
|
|
1965
1965
|
}, n.FREQUENCIES = [
|
|
@@ -1970,20 +1970,20 @@ var ft = {
|
|
|
1970
1970
|
"HOURLY",
|
|
1971
1971
|
"MINUTELY",
|
|
1972
1972
|
"SECONDLY"
|
|
1973
|
-
], n.YEARLY =
|
|
1973
|
+
], n.YEARLY = Y.YEARLY, n.MONTHLY = Y.MONTHLY, n.WEEKLY = Y.WEEKLY, n.DAILY = Y.DAILY, n.HOURLY = Y.HOURLY, n.MINUTELY = Y.MINUTELY, n.SECONDLY = Y.SECONDLY, n.MO = dt.MO, n.TU = dt.TU, n.WE = dt.WE, n.TH = dt.TH, n.FR = dt.FR, n.SA = dt.SA, n.SU = dt.SU, n.parseString = We, n.optionsToString = ze, n;
|
|
1974
1974
|
})()
|
|
1975
1975
|
);
|
|
1976
|
-
function
|
|
1976
|
+
function Es(n, t, e, i, s, r) {
|
|
1977
1977
|
var o = {}, a = n.accept;
|
|
1978
1978
|
function l(u, f) {
|
|
1979
|
-
e.forEach(function(
|
|
1980
|
-
|
|
1981
|
-
o[Number(
|
|
1979
|
+
e.forEach(function(p) {
|
|
1980
|
+
p.between(u, f, !0).forEach(function(g) {
|
|
1981
|
+
o[Number(g)] = !0;
|
|
1982
1982
|
});
|
|
1983
1983
|
});
|
|
1984
1984
|
}
|
|
1985
1985
|
s.forEach(function(u) {
|
|
1986
|
-
var f = new
|
|
1986
|
+
var f = new Te(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 ws(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 d = new Te(i[c], r).rezonedDate();
|
|
1997
|
+
if (!n.accept(new Date(d.getTime())))
|
|
1998
1998
|
break;
|
|
1999
1999
|
}
|
|
2000
2000
|
t.forEach(function(u) {
|
|
2001
|
-
|
|
2001
|
+
nn(n, u.options);
|
|
2002
2002
|
});
|
|
2003
|
-
var
|
|
2004
|
-
switch (
|
|
2003
|
+
var h = n._result;
|
|
2004
|
+
switch (de(h), n.method) {
|
|
2005
2005
|
case "all":
|
|
2006
2006
|
case "between":
|
|
2007
|
-
return
|
|
2007
|
+
return h;
|
|
2008
2008
|
case "before":
|
|
2009
|
-
return
|
|
2009
|
+
return h.length && h[h.length - 1] || null;
|
|
2010
2010
|
default:
|
|
2011
|
-
return
|
|
2011
|
+
return h.length && h[0] || null;
|
|
2012
2012
|
}
|
|
2013
2013
|
}
|
|
2014
|
-
var
|
|
2014
|
+
var Mi = {
|
|
2015
2015
|
dtstart: null,
|
|
2016
2016
|
cache: !1,
|
|
2017
2017
|
unfold: !1,
|
|
@@ -2019,29 +2019,29 @@ var Ci = {
|
|
|
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 xs(n, t) {
|
|
2023
|
+
var e = [], i = [], s = [], r = [], o = Se(n), a = o.dtstart, l = o.tzid, c = Cs(n, t.unfold);
|
|
2024
|
+
return c.forEach(function(d) {
|
|
2025
|
+
var h;
|
|
2026
|
+
if (d) {
|
|
2027
|
+
var u = Ds(d), f = u.name, p = u.parms, g = u.value;
|
|
2028
2028
|
switch (f.toUpperCase()) {
|
|
2029
2029
|
case "RRULE":
|
|
2030
|
-
if (
|
|
2031
|
-
throw new Error("unsupported RRULE parm: ".concat(
|
|
2032
|
-
e.push(
|
|
2030
|
+
if (p.length)
|
|
2031
|
+
throw new Error("unsupported RRULE parm: ".concat(p.join(",")));
|
|
2032
|
+
e.push(We(d));
|
|
2033
2033
|
break;
|
|
2034
2034
|
case "RDATE":
|
|
2035
|
-
var
|
|
2036
|
-
|
|
2035
|
+
var v = (h = /RDATE(?:;TZID=([^:=]+))?/i.exec(d)) !== null && h !== void 0 ? h : [], y = v[1];
|
|
2036
|
+
y && !l && (l = y), i = i.concat($i(g, p));
|
|
2037
2037
|
break;
|
|
2038
2038
|
case "EXRULE":
|
|
2039
|
-
if (
|
|
2040
|
-
throw new Error("unsupported EXRULE parm: ".concat(
|
|
2041
|
-
s.push(
|
|
2039
|
+
if (p.length)
|
|
2040
|
+
throw new Error("unsupported EXRULE parm: ".concat(p.join(",")));
|
|
2041
|
+
s.push(We(g));
|
|
2042
2042
|
break;
|
|
2043
2043
|
case "EXDATE":
|
|
2044
|
-
r = r.concat($i(
|
|
2044
|
+
r = r.concat($i(g, p));
|
|
2045
2045
|
break;
|
|
2046
2046
|
case "DTSTART":
|
|
2047
2047
|
break;
|
|
@@ -2058,51 +2058,51 @@ function Es(n, t) {
|
|
|
2058
2058
|
exdatevals: r
|
|
2059
2059
|
};
|
|
2060
2060
|
}
|
|
2061
|
-
function
|
|
2062
|
-
var e =
|
|
2061
|
+
function Ss(n, t) {
|
|
2062
|
+
var e = xs(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 d = new $s(c);
|
|
2065
|
+
return d.dtstart(a), d.tzid(l || void 0), i.forEach(function(u) {
|
|
2066
|
+
d.rrule(new k(Re(u, a, l), c));
|
|
2067
2067
|
}), s.forEach(function(u) {
|
|
2068
|
-
|
|
2068
|
+
d.rdate(u);
|
|
2069
2069
|
}), r.forEach(function(u) {
|
|
2070
|
-
|
|
2070
|
+
d.exrule(new k(Re(u, a, l), c));
|
|
2071
2071
|
}), o.forEach(function(u) {
|
|
2072
|
-
|
|
2073
|
-
}), t.compatible && t.dtstart &&
|
|
2072
|
+
d.exdate(u);
|
|
2073
|
+
}), t.compatible && t.dtstart && d.rdate(a), d;
|
|
2074
2074
|
}
|
|
2075
|
-
var
|
|
2076
|
-
return new
|
|
2075
|
+
var h = i[0] || {};
|
|
2076
|
+
return new k(Re(h, h.dtstart || t.dtstart || a, h.tzid || t.tzid || l), c);
|
|
2077
2077
|
}
|
|
2078
|
-
function
|
|
2079
|
-
return t === void 0 && (t = {}),
|
|
2078
|
+
function Fe(n, t) {
|
|
2079
|
+
return t === void 0 && (t = {}), Ss(n, Ts(t));
|
|
2080
2080
|
}
|
|
2081
|
-
function
|
|
2081
|
+
function Re(n, t, e) {
|
|
2082
2082
|
return at(at({}, n), { dtstart: t, tzid: e });
|
|
2083
2083
|
}
|
|
2084
|
-
function
|
|
2085
|
-
var t = [], e = Object.keys(n), i = Object.keys(
|
|
2084
|
+
function Ts(n) {
|
|
2085
|
+
var t = [], e = Object.keys(n), i = Object.keys(Mi);
|
|
2086
2086
|
if (e.forEach(function(s) {
|
|
2087
|
-
|
|
2087
|
+
F(i, s) || t.push(s);
|
|
2088
2088
|
}), t.length)
|
|
2089
2089
|
throw new Error("Invalid options: " + t.join(", "));
|
|
2090
|
-
return at(at({},
|
|
2090
|
+
return at(at({}, Mi), n);
|
|
2091
2091
|
}
|
|
2092
|
-
function
|
|
2092
|
+
function ks(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 = _n(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 Ds(n) {
|
|
2105
|
+
var t = ks(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 ks(n) {
|
|
|
2111
2111
|
value: i
|
|
2112
2112
|
};
|
|
2113
2113
|
}
|
|
2114
|
-
function
|
|
2114
|
+
function Cs(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 Ds(n, t) {
|
|
|
2123
2123
|
}
|
|
2124
2124
|
return e;
|
|
2125
2125
|
}
|
|
2126
|
-
function
|
|
2126
|
+
function Ms(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
2132
|
function $i(n, t) {
|
|
2133
|
-
return
|
|
2134
|
-
return
|
|
2133
|
+
return Ms(t), n.split(",").map(function(e) {
|
|
2134
|
+
return Je(e);
|
|
2135
2135
|
});
|
|
2136
2136
|
}
|
|
2137
|
-
function
|
|
2137
|
+
function Ai(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)
|
|
@@ -2149,29 +2149,29 @@ function Mi(n) {
|
|
|
2149
2149
|
var $s = (
|
|
2150
2150
|
/** @class */
|
|
2151
2151
|
(function(n) {
|
|
2152
|
-
|
|
2152
|
+
Qe(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 = Ai.apply(i, ["dtstart"]), i.tzid = Ai.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 Es(e, this._rrule, this._exrule, this._rdate, this._exdate, this.tzid());
|
|
2160
2160
|
}, t.prototype.rrule = function(e) {
|
|
2161
|
-
|
|
2161
|
+
Oi(e, this._rrule);
|
|
2162
2162
|
}, t.prototype.exrule = function(e) {
|
|
2163
|
-
|
|
2163
|
+
Oi(e, this._exrule);
|
|
2164
2164
|
}, t.prototype.rdate = function(e) {
|
|
2165
|
-
|
|
2165
|
+
_i(e, this._rdate);
|
|
2166
2166
|
}, t.prototype.exdate = function(e) {
|
|
2167
|
-
|
|
2167
|
+
_i(e, this._exdate);
|
|
2168
2168
|
}, t.prototype.rrules = function() {
|
|
2169
2169
|
return this._rrule.map(function(e) {
|
|
2170
|
-
return
|
|
2170
|
+
return Fe(e.toString());
|
|
2171
2171
|
});
|
|
2172
2172
|
}, t.prototype.exrules = function() {
|
|
2173
2173
|
return this._exrule.map(function(e) {
|
|
2174
|
-
return
|
|
2174
|
+
return Fe(e.toString());
|
|
2175
2175
|
});
|
|
2176
2176
|
}, t.prototype.rdates = function() {
|
|
2177
2177
|
return this._rdate.map(function(e) {
|
|
@@ -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(Pi("RDATE", this._rdate, this.tzid())), this._exdate.length && e.push(Pi("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
|
+
})(k)
|
|
2213
2213
|
);
|
|
2214
|
-
function
|
|
2215
|
-
if (!(n instanceof
|
|
2214
|
+
function Oi(n, t) {
|
|
2215
|
+
if (!(n instanceof k))
|
|
2216
2216
|
throw new TypeError(String(n) + " is not RRule instance");
|
|
2217
|
-
|
|
2217
|
+
F(t.map(String), String(n)) || t.push(n);
|
|
2218
2218
|
}
|
|
2219
|
-
function
|
|
2219
|
+
function _i(n, t) {
|
|
2220
2220
|
if (!(n instanceof Date))
|
|
2221
2221
|
throw new TypeError(String(n) + " is not Date instance");
|
|
2222
|
-
|
|
2222
|
+
F(t.map(Number), Number(n)) || (t.push(n), de(t));
|
|
2223
2223
|
}
|
|
2224
|
-
function
|
|
2224
|
+
function Pi(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 Ge(o.valueOf(), i);
|
|
2227
2227
|
}).join(",");
|
|
2228
2228
|
return "".concat(s).concat(r);
|
|
2229
2229
|
}
|
|
2230
|
-
const
|
|
2230
|
+
const As = [
|
|
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 Ms = [
|
|
|
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
|
+
], Os = 12, _s = 12, Ps = 96;
|
|
2239
|
+
class U {
|
|
2240
2240
|
constructor(t) {
|
|
2241
|
-
this.startDate = /* @__PURE__ */ new Date(), this.endDate =
|
|
2241
|
+
this.startDate = /* @__PURE__ */ new Date(), this.endDate = U.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 L {
|
|
|
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 || U.getWeekStartFromLocale(this.locale), this.startDate = this.getStartOfWeek(U.addDays(/* @__PURE__ */ new Date(), -182));
|
|
2258
2258
|
const e = {
|
|
2259
2259
|
start: (i) => {
|
|
2260
2260
|
this.controller = i;
|
|
@@ -2280,21 +2280,24 @@ class L {
|
|
|
2280
2280
|
setEnabledCalendars(t) {
|
|
2281
2281
|
this.enabledCalendars = new Set(t), this.sendEvents();
|
|
2282
2282
|
}
|
|
2283
|
+
setLockedCalendars(t) {
|
|
2284
|
+
this.lockedCalendars = new Set(t), this.sendEvents();
|
|
2285
|
+
}
|
|
2283
2286
|
expandRecurringEvent(t) {
|
|
2284
2287
|
if (!t.rrule)
|
|
2285
2288
|
return [t];
|
|
2286
2289
|
try {
|
|
2287
|
-
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"),
|
|
2288
|
-
RRULE:${t.rrule}`,
|
|
2290
|
+
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"), d = `DTSTART:${`${i}${s}${r}T${o}${a}${l}Z`}
|
|
2291
|
+
RRULE:${t.rrule}`, h = Fe(d), u = /* @__PURE__ */ new Date();
|
|
2289
2292
|
u.setFullYear(u.getFullYear() - 2);
|
|
2290
2293
|
const f = /* @__PURE__ */ new Date();
|
|
2291
|
-
return f.setFullYear(f.getFullYear() + 2),
|
|
2292
|
-
const
|
|
2294
|
+
return f.setFullYear(f.getFullYear() + 2), h.between(u, f, !0).map((g) => {
|
|
2295
|
+
const v = t.end.getTime() - t.start.getTime(), y = new Date(g.getTime() + v);
|
|
2293
2296
|
return {
|
|
2294
2297
|
...t,
|
|
2295
|
-
id: `${t.id}-${
|
|
2296
|
-
start:
|
|
2297
|
-
end:
|
|
2298
|
+
id: `${t.id}-${g.getTime()}`,
|
|
2299
|
+
start: g,
|
|
2300
|
+
end: y
|
|
2298
2301
|
};
|
|
2299
2302
|
});
|
|
2300
2303
|
} catch (e) {
|
|
@@ -2302,14 +2305,14 @@ RRULE:${t.rrule}`, d = We(h), u = /* @__PURE__ */ new Date();
|
|
|
2302
2305
|
}
|
|
2303
2306
|
}
|
|
2304
2307
|
getFilteredEvents(t) {
|
|
2305
|
-
const e = Array.from(this.calendarEvents.values()), i = this.enabledCalendars.size > 0 ? e.filter((
|
|
2306
|
-
for (const
|
|
2307
|
-
const
|
|
2308
|
-
|
|
2308
|
+
const e = Array.from(this.calendarEvents.values()), i = this.enabledCalendars.size > 0 ? e.filter((o) => o.calendarId && this.enabledCalendars.has(o.calendarId) || o.sourceId && this.enabledCalendars.has(o.sourceId)) : e, s = this.lockedCalendars.size > 0 ? i.map((o) => o.calendarId && this.lockedCalendars.has(o.calendarId) || o.sourceId && this.lockedCalendars.has(o.sourceId) ? { ...o, readOnly: !0 } : o) : i, r = [];
|
|
2309
|
+
for (const o of s) {
|
|
2310
|
+
const a = this.expandRecurringEvent(o);
|
|
2311
|
+
r.push(...a);
|
|
2309
2312
|
}
|
|
2310
|
-
return t ?
|
|
2311
|
-
(
|
|
2312
|
-
) :
|
|
2313
|
+
return t ? r.filter(
|
|
2314
|
+
(o) => o.title.toLowerCase().includes(t.toLowerCase())
|
|
2315
|
+
) : r;
|
|
2313
2316
|
}
|
|
2314
2317
|
sendEvents() {
|
|
2315
2318
|
const e = this.getFilteredEvents(this.filter).filter((i) => !0);
|
|
@@ -2418,10 +2421,10 @@ RRULE:${t.rrule}`, d = We(h), u = /* @__PURE__ */ new Date();
|
|
|
2418
2421
|
for (; s < e; ) {
|
|
2419
2422
|
const r = [];
|
|
2420
2423
|
for (let l = 0; l < 7; l++)
|
|
2421
|
-
r.push(new Date(s)), s =
|
|
2424
|
+
r.push(new Date(s)), s = U.addDays(s, 1);
|
|
2422
2425
|
const o = r[0], a = r[3];
|
|
2423
2426
|
o && a && i.push({
|
|
2424
|
-
weekNumber:
|
|
2427
|
+
weekNumber: U.getWeekNumber(o),
|
|
2425
2428
|
year: a.getFullYear(),
|
|
2426
2429
|
// Use Thursday for year
|
|
2427
2430
|
days: r,
|
|
@@ -2433,17 +2436,17 @@ RRULE:${t.rrule}`, d = We(h), u = /* @__PURE__ */ new Date();
|
|
|
2433
2436
|
}
|
|
2434
2437
|
// Extends the date range and returns new weeks added
|
|
2435
2438
|
extendRange(t) {
|
|
2436
|
-
const e =
|
|
2439
|
+
const e = _s, i = [];
|
|
2437
2440
|
if (t === "past") {
|
|
2438
|
-
const s =
|
|
2441
|
+
const s = U.addDays(this.startDate, -e * 7);
|
|
2439
2442
|
let r = new Date(s);
|
|
2440
2443
|
for (; r < this.startDate; ) {
|
|
2441
2444
|
const o = [];
|
|
2442
2445
|
for (let c = 0; c < 7; c++)
|
|
2443
|
-
o.push(new Date(r)), r =
|
|
2446
|
+
o.push(new Date(r)), r = U.addDays(r, 1);
|
|
2444
2447
|
const a = o[0], l = o[3];
|
|
2445
2448
|
a && l && i.push({
|
|
2446
|
-
weekNumber:
|
|
2449
|
+
weekNumber: U.getWeekNumber(a),
|
|
2447
2450
|
year: l.getFullYear(),
|
|
2448
2451
|
days: o,
|
|
2449
2452
|
yOffset: 0,
|
|
@@ -2452,15 +2455,15 @@ RRULE:${t.rrule}`, d = We(h), u = /* @__PURE__ */ new Date();
|
|
|
2452
2455
|
}
|
|
2453
2456
|
this.startDate = s;
|
|
2454
2457
|
} else {
|
|
2455
|
-
const s =
|
|
2458
|
+
const s = U.addDays(this.endDate, e * 7);
|
|
2456
2459
|
let r = new Date(this.endDate);
|
|
2457
2460
|
for (; r < s; ) {
|
|
2458
2461
|
const o = [];
|
|
2459
2462
|
for (let c = 0; c < 7; c++)
|
|
2460
|
-
o.push(new Date(r)), r =
|
|
2463
|
+
o.push(new Date(r)), r = U.addDays(r, 1);
|
|
2461
2464
|
const a = o[0], l = o[3];
|
|
2462
2465
|
a && l && i.push({
|
|
2463
|
-
weekNumber:
|
|
2466
|
+
weekNumber: U.getWeekNumber(a),
|
|
2464
2467
|
year: l.getFullYear(),
|
|
2465
2468
|
days: o,
|
|
2466
2469
|
yOffset: 0,
|
|
@@ -2472,18 +2475,18 @@ RRULE:${t.rrule}`, d = We(h), u = /* @__PURE__ */ new Date();
|
|
|
2472
2475
|
return i;
|
|
2473
2476
|
}
|
|
2474
2477
|
getBufferWeeks() {
|
|
2475
|
-
return
|
|
2478
|
+
return Os;
|
|
2476
2479
|
}
|
|
2477
2480
|
getMaxWeeks() {
|
|
2478
|
-
return
|
|
2481
|
+
return Ps;
|
|
2479
2482
|
}
|
|
2480
2483
|
trimRange(t, e) {
|
|
2481
|
-
t === "past" ? this.startDate =
|
|
2484
|
+
t === "past" ? this.startDate = U.addDays(this.startDate, -e * 7) : this.endDate = U.addDays(this.endDate, -e * 7);
|
|
2482
2485
|
}
|
|
2483
2486
|
// Resets the range to be centered around the target date
|
|
2484
2487
|
resetRangeAroundDate(t) {
|
|
2485
2488
|
const e = new Date(t);
|
|
2486
|
-
return e.setHours(0, 0, 0, 0), this.startDate = this.getStartOfWeek(
|
|
2489
|
+
return e.setHours(0, 0, 0, 0), this.startDate = this.getStartOfWeek(U.addDays(e, -182)), this.endDate = U.addDays(e, 182), this.generateWeeks();
|
|
2487
2490
|
}
|
|
2488
2491
|
getWeekdayNames() {
|
|
2489
2492
|
const t = new Intl.DateTimeFormat(this.locale, { weekday: "short" }), e = [];
|
|
@@ -2518,26 +2521,26 @@ RRULE:${t.rrule}`, d = We(h), u = /* @__PURE__ */ new Date();
|
|
|
2518
2521
|
}
|
|
2519
2522
|
// Returns timestamp for end of day using pure math (no Date object creation)
|
|
2520
2523
|
static endOfDayTime(t) {
|
|
2521
|
-
return t ?
|
|
2524
|
+
return t ? U.startOfDayTime(t) + 864e5 - 1 : 0;
|
|
2522
2525
|
}
|
|
2523
2526
|
static getWeekStartFromLocale(t) {
|
|
2524
2527
|
const e = ["en-US", "en-CA", "ja-JP", "ko-KR", "zh-TW"], i = t.split("-")[0];
|
|
2525
2528
|
return e.includes(t) || i === "he" || i === "ar" ? 0 : 1;
|
|
2526
2529
|
}
|
|
2527
2530
|
}
|
|
2528
|
-
function
|
|
2531
|
+
function Ie(n) {
|
|
2529
2532
|
return [
|
|
2530
2533
|
parseInt(`${n[1]}${n[2]}`, 16),
|
|
2531
2534
|
parseInt(`${n[3]}${n[4]}`, 16),
|
|
2532
2535
|
parseInt(`${n[5]}${n[6]}`, 16)
|
|
2533
2536
|
];
|
|
2534
2537
|
}
|
|
2535
|
-
function
|
|
2538
|
+
function Rs([n, t, e]) {
|
|
2536
2539
|
n /= 255, t /= 255, e /= 255;
|
|
2537
2540
|
let i = Math.min(n, t, e), s = Math.max(n, t, e), r = s - i, o = 0, a = 0, l = 0;
|
|
2538
2541
|
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];
|
|
2539
2542
|
}
|
|
2540
|
-
const
|
|
2543
|
+
const ii = {
|
|
2541
2544
|
dark: {
|
|
2542
2545
|
name: "dark",
|
|
2543
2546
|
label: "Dark",
|
|
@@ -2683,43 +2686,43 @@ const ei = {
|
|
|
2683
2686
|
}
|
|
2684
2687
|
}
|
|
2685
2688
|
};
|
|
2686
|
-
function
|
|
2689
|
+
function Is() {
|
|
2687
2690
|
return window.matchMedia?.("(prefers-color-scheme: dark)")?.matches ? "dark" : "light";
|
|
2688
2691
|
}
|
|
2689
2692
|
function Hs(n) {
|
|
2690
|
-
return n === "auto" ?
|
|
2693
|
+
return n === "auto" ? Is() : n;
|
|
2691
2694
|
}
|
|
2692
|
-
function
|
|
2695
|
+
function Ys(n) {
|
|
2693
2696
|
const t = document.querySelector('meta[name="theme-color"]');
|
|
2694
2697
|
t && t.setAttribute("content", n);
|
|
2695
2698
|
}
|
|
2696
|
-
function
|
|
2697
|
-
const e = Hs(n), i =
|
|
2699
|
+
function Ns(n, t = document.body) {
|
|
2700
|
+
const e = Hs(n), i = ii[e];
|
|
2698
2701
|
if (i) {
|
|
2699
2702
|
for (const [s, r] of Object.entries(i.variables))
|
|
2700
2703
|
t.style.setProperty(s, r);
|
|
2701
|
-
t.setAttribute("data-theme", e),
|
|
2704
|
+
t.setAttribute("data-theme", e), Ys(i.variables["--bg-primary"]);
|
|
2702
2705
|
}
|
|
2703
2706
|
}
|
|
2704
|
-
function
|
|
2707
|
+
function Us(n) {
|
|
2705
2708
|
localStorage.setItem("calendar-theme", n);
|
|
2706
2709
|
}
|
|
2707
|
-
function
|
|
2710
|
+
function Ls() {
|
|
2708
2711
|
const n = localStorage.getItem("calendar-theme");
|
|
2709
|
-
return n && (n in
|
|
2712
|
+
return n && (n in ii || n === "auto") ? n : "auto";
|
|
2710
2713
|
}
|
|
2711
|
-
const
|
|
2714
|
+
const Ws = [
|
|
2712
2715
|
{ name: "auto", label: "Auto" },
|
|
2713
|
-
...Object.values(
|
|
2716
|
+
...Object.values(ii).map((n) => ({
|
|
2714
2717
|
name: n.name,
|
|
2715
2718
|
label: n.label
|
|
2716
2719
|
}))
|
|
2717
2720
|
];
|
|
2718
|
-
function
|
|
2721
|
+
function Ri(n) {
|
|
2719
2722
|
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");
|
|
2720
2723
|
return `${t}${e}${i}T${s}${r}${o}`;
|
|
2721
2724
|
}
|
|
2722
|
-
function
|
|
2725
|
+
function Ii(n) {
|
|
2723
2726
|
const t = n.getFullYear(), e = String(n.getMonth() + 1).padStart(2, "0"), i = String(n.getDate()).padStart(2, "0");
|
|
2724
2727
|
return `${t}${e}${i}`;
|
|
2725
2728
|
}
|
|
@@ -2730,31 +2733,31 @@ function Hi(n) {
|
|
|
2730
2733
|
"PRODID:-//Calendar//EN"
|
|
2731
2734
|
];
|
|
2732
2735
|
for (const e of n)
|
|
2733
|
-
t.push("BEGIN:VEVENT"), t.push(`UID:${e.id}`), t.push(`SUMMARY:${e.title}`), e.isAllDay ? (t.push(`DTSTART;VALUE=DATE:${
|
|
2736
|
+
t.push("BEGIN:VEVENT"), t.push(`UID:${e.id}`), t.push(`SUMMARY:${e.title}`), e.isAllDay ? (t.push(`DTSTART;VALUE=DATE:${Ii(e.start)}`), t.push(`DTEND;VALUE=DATE:${Ii(e.end)}`)) : (t.push(`DTSTART:${Ri(e.start)}`), t.push(`DTEND:${Ri(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");
|
|
2734
2737
|
return t.push("END:VCALENDAR"), t.join(`\r
|
|
2735
2738
|
`);
|
|
2736
2739
|
}
|
|
2737
|
-
const
|
|
2738
|
-
let
|
|
2739
|
-
function
|
|
2740
|
-
|
|
2740
|
+
const Be = [];
|
|
2741
|
+
let ae = null;
|
|
2742
|
+
function Yt(n) {
|
|
2743
|
+
Be.push({
|
|
2741
2744
|
text: n,
|
|
2742
2745
|
timestamp: Date.now()
|
|
2743
|
-
}),
|
|
2746
|
+
}), ae && ae.processQueue();
|
|
2744
2747
|
}
|
|
2745
|
-
const
|
|
2748
|
+
const ke = class ke extends Kt {
|
|
2746
2749
|
constructor() {
|
|
2747
2750
|
super(...arguments), this.currentMessage = "", this.isShowing = !1, this.timeoutId = null;
|
|
2748
2751
|
}
|
|
2749
2752
|
connectedCallback() {
|
|
2750
|
-
super.connectedCallback(),
|
|
2753
|
+
super.connectedCallback(), ae = this, this.processQueue();
|
|
2751
2754
|
}
|
|
2752
2755
|
disconnectedCallback() {
|
|
2753
|
-
super.disconnectedCallback(),
|
|
2756
|
+
super.disconnectedCallback(), ae === this && (ae = null), this.timeoutId !== null && clearTimeout(this.timeoutId);
|
|
2754
2757
|
}
|
|
2755
2758
|
processQueue() {
|
|
2756
|
-
if (this.isShowing ||
|
|
2757
|
-
const t =
|
|
2759
|
+
if (this.isShowing || Be.length === 0) return;
|
|
2760
|
+
const t = Be.shift();
|
|
2758
2761
|
t && (this.currentMessage = t.text, this.isShowing = !0, this.requestUpdate(), this.timeoutId = window.setTimeout(() => {
|
|
2759
2762
|
this.hideMessage();
|
|
2760
2763
|
}, 2e3));
|
|
@@ -2766,10 +2769,10 @@ const Te = class Te extends Kt {
|
|
|
2766
2769
|
}, 200));
|
|
2767
2770
|
}
|
|
2768
2771
|
render() {
|
|
2769
|
-
return !this.isShowing || !this.currentMessage ?
|
|
2772
|
+
return !this.isShowing || !this.currentMessage ? _`` : _`<div class="message">${this.currentMessage}</div>`;
|
|
2770
2773
|
}
|
|
2771
2774
|
};
|
|
2772
|
-
|
|
2775
|
+
ke.styles = zi`
|
|
2773
2776
|
:host {
|
|
2774
2777
|
display: block;
|
|
2775
2778
|
position: relative;
|
|
@@ -2799,13 +2802,13 @@ Te.styles = zi`
|
|
|
2799
2802
|
opacity: 0;
|
|
2800
2803
|
}
|
|
2801
2804
|
}
|
|
2802
|
-
`,
|
|
2805
|
+
`, ke.properties = {
|
|
2803
2806
|
currentMessage: { type: String },
|
|
2804
2807
|
isShowing: { type: Boolean }
|
|
2805
2808
|
};
|
|
2806
|
-
let
|
|
2809
|
+
let qe = ke;
|
|
2807
2810
|
try {
|
|
2808
|
-
customElements.define("status-message",
|
|
2811
|
+
customElements.define("status-message", qe);
|
|
2809
2812
|
} catch (n) {
|
|
2810
2813
|
console.error("Failed to register custom element:", n);
|
|
2811
2814
|
}
|
|
@@ -2854,12 +2857,12 @@ class zs {
|
|
|
2854
2857
|
async queryEvents(t, e) {
|
|
2855
2858
|
const i = await this.open();
|
|
2856
2859
|
return new Promise((s, r) => {
|
|
2857
|
-
const l = i.transaction(this.storeName, "readonly").objectStore(this.storeName).index("start"), c = t.toISOString(),
|
|
2860
|
+
const l = i.transaction(this.storeName, "readonly").objectStore(this.storeName).index("start"), c = t.toISOString(), d = e.toISOString(), h = IDBKeyRange.upperBound(d), u = l.getAll(h);
|
|
2858
2861
|
u.onerror = () => {
|
|
2859
2862
|
r(new Error(`Failed to query events: ${u.error?.message}`));
|
|
2860
2863
|
}, u.onsuccess = () => {
|
|
2861
|
-
const
|
|
2862
|
-
s(
|
|
2864
|
+
const g = u.result.filter((v) => v.end >= c).map((v) => this.deserializeEvent(v));
|
|
2865
|
+
s(g);
|
|
2863
2866
|
};
|
|
2864
2867
|
});
|
|
2865
2868
|
}
|
|
@@ -2868,16 +2871,16 @@ class zs {
|
|
|
2868
2871
|
return new Promise((s, r) => {
|
|
2869
2872
|
const o = i.transaction(this.storeName, "readwrite"), a = o.objectStore(this.storeName), l = a.index("calendar");
|
|
2870
2873
|
for (const c of t) {
|
|
2871
|
-
const
|
|
2872
|
-
a.put(
|
|
2874
|
+
const d = this.serializeEvent(c);
|
|
2875
|
+
a.put(d);
|
|
2873
2876
|
}
|
|
2874
|
-
for (const [c,
|
|
2875
|
-
const
|
|
2877
|
+
for (const [c, d] of e.entries()) {
|
|
2878
|
+
const h = d.toISOString(), u = IDBKeyRange.only(c), f = l.openCursor(u);
|
|
2876
2879
|
f.onsuccess = () => {
|
|
2877
|
-
const
|
|
2878
|
-
if (
|
|
2879
|
-
const
|
|
2880
|
-
(!
|
|
2880
|
+
const p = f.result;
|
|
2881
|
+
if (p) {
|
|
2882
|
+
const g = p.value;
|
|
2883
|
+
(!g.lastSynced || g.lastSynced < h) && (console.debug("sync deleted", g.id), a.delete(g.id)), p.continue();
|
|
2881
2884
|
}
|
|
2882
2885
|
}, f.onerror = () => {
|
|
2883
2886
|
r(new Error(`Failed to query calendar events: ${f.error?.message}`));
|
|
@@ -3004,10 +3007,27 @@ class zs {
|
|
|
3004
3007
|
});
|
|
3005
3008
|
}
|
|
3006
3009
|
}
|
|
3007
|
-
const
|
|
3010
|
+
const qt = 100, me = 3e3, z = 60, Yi = 12, ye = 20, ni = class ni extends Kt {
|
|
3008
3011
|
constructor() {
|
|
3009
|
-
super(), this._dayHeight =
|
|
3010
|
-
|
|
3012
|
+
super(), this._dayHeight = qt, 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.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 = Ls(), this.activeCalendarColor = null, this.scrollToToday = () => {
|
|
3013
|
+
const t = /* @__PURE__ */ new Date();
|
|
3014
|
+
let e = this.weeks.findIndex(
|
|
3015
|
+
(s) => s.days.some((r) => U.isSameDay(r, t))
|
|
3016
|
+
);
|
|
3017
|
+
e < 0 && (this.weeks = this.internal.resetRangeAroundDate(t), this.updateWeekOffsets(), e = this.weeks.findIndex(
|
|
3018
|
+
(s) => s.days.some((r) => U.isSameDay(r, t))
|
|
3019
|
+
));
|
|
3020
|
+
let i = 0.5;
|
|
3021
|
+
if (e >= 0) {
|
|
3022
|
+
const r = this.weeks[e].days.findIndex(
|
|
3023
|
+
(o) => U.isSameDay(o, t)
|
|
3024
|
+
);
|
|
3025
|
+
if (r >= 0) {
|
|
3026
|
+
const o = Math.floor(r / this._columnsPerRow), a = (t.getHours() + t.getMinutes() / 60) / 24;
|
|
3027
|
+
i = (o + a) / this.rowsPerWeek;
|
|
3028
|
+
}
|
|
3029
|
+
}
|
|
3030
|
+
this.scrollToDate(t, i, !0, !0);
|
|
3011
3031
|
}, this.goBack = () => {
|
|
3012
3032
|
this.saveHistoryTimeout && (clearTimeout(this.saveHistoryTimeout), this.saveHistoryTimeout = null), this.historyIndex++;
|
|
3013
3033
|
const t = this.historyStack[this.historyIndex];
|
|
@@ -3029,8 +3049,8 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
3029
3049
|
}
|
|
3030
3050
|
t.preventDefault();
|
|
3031
3051
|
const s = t.deltaY * (this.dayHeight / 100), r = Math.max(
|
|
3032
|
-
|
|
3033
|
-
Math.min(
|
|
3052
|
+
qt,
|
|
3053
|
+
Math.min(me, this.dayHeight - s)
|
|
3034
3054
|
), o = this.dayHeight, a = r / o, l = this.zoomOriginY * a, c = l - this.zoomViewportY;
|
|
3035
3055
|
this.setView(r, c), this.zoomOriginY = l;
|
|
3036
3056
|
}, this.lastPointerY = 0, this.onZoomHandleMouseDown = (t) => {
|
|
@@ -3061,7 +3081,7 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
3061
3081
|
console.warn("DownloadURL not supported:", o);
|
|
3062
3082
|
}
|
|
3063
3083
|
}, this.onDragEnd = (t) => {
|
|
3064
|
-
t.dataTransfer?.dropEffect === "none" && this.movingEvent &&
|
|
3084
|
+
t.dataTransfer?.dropEffect === "none" && this.movingEvent && Yt("Event exported as .ics file"), this.isDraggingFile = !1, this.resetDragState(), this.requestUpdate();
|
|
3065
3085
|
}, this.onMouseMove = (t) => {
|
|
3066
3086
|
if (this.isPanning && this.scrollContainer) {
|
|
3067
3087
|
const e = t.clientY - this.panStartY;
|
|
@@ -3072,8 +3092,8 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
3072
3092
|
let e = 0;
|
|
3073
3093
|
this.lastPointerY && (e = t.clientY - this.lastPointerY);
|
|
3074
3094
|
const i = e * (this.dayHeight / 100), s = Math.max(
|
|
3075
|
-
|
|
3076
|
-
Math.min(
|
|
3095
|
+
qt,
|
|
3096
|
+
Math.min(me, this.dayHeight - i)
|
|
3077
3097
|
), r = this.dayHeight, o = s / r, a = this.zoomOriginY * o, l = a - this.zoomViewportY;
|
|
3078
3098
|
this.setView(s, l, !1), this.zoomOriginY = a, this.isFiltered && this.historyIndex === 0 ? this.replaceFilterInHistory() : this.debouncedSaveToHistory();
|
|
3079
3099
|
} else
|
|
@@ -3142,9 +3162,9 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
3142
3162
|
this.eventCreationEnd.y
|
|
3143
3163
|
);
|
|
3144
3164
|
if (r && o) {
|
|
3145
|
-
const a = (
|
|
3146
|
-
const
|
|
3147
|
-
return
|
|
3165
|
+
const a = (d) => {
|
|
3166
|
+
const h = d.getMinutes();
|
|
3167
|
+
return d.setMinutes(Math.round(h / 15) * 15, 0, 0), d;
|
|
3148
3168
|
};
|
|
3149
3169
|
let l, c;
|
|
3150
3170
|
this.eventCreationShiftPressed && this.eventCreationInitialDuration !== null ? (c = a(new Date(o)), l = a(
|
|
@@ -3191,56 +3211,12 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
3191
3211
|
})
|
|
3192
3212
|
), this.potentialSelectionStart = null;
|
|
3193
3213
|
}
|
|
3194
|
-
}, this.onKeyDown = (t) => {
|
|
3195
|
-
if ((t.metaKey || t.ctrlKey) && t.shiftKey && t.key === "r")
|
|
3196
|
-
t.preventDefault(), this.dispatchEvent(
|
|
3197
|
-
new CustomEvent("force-sync", {
|
|
3198
|
-
bubbles: !0
|
|
3199
|
-
})
|
|
3200
|
-
);
|
|
3201
|
-
else if ((t.metaKey || t.ctrlKey) && t.key === "c") {
|
|
3202
|
-
if (t.target.matches('input, textarea, [contenteditable="true"]'))
|
|
3203
|
-
return;
|
|
3204
|
-
const i = this.internal.getSelectedEvents();
|
|
3205
|
-
if (i.length === 0) return;
|
|
3206
|
-
t.preventDefault();
|
|
3207
|
-
const s = Hi(i), r = new Blob([s], { type: "text/plain" }), o = new ClipboardItem({ "text/plain": r });
|
|
3208
|
-
navigator.clipboard.write([o]).then(() => {
|
|
3209
|
-
const a = i.length;
|
|
3210
|
-
Rt(
|
|
3211
|
-
`Copied ${a} event${a === 1 ? "" : "s"} to clipboard`
|
|
3212
|
-
);
|
|
3213
|
-
});
|
|
3214
|
-
} else if (t.key === "Backspace" || t.key === "Delete") {
|
|
3215
|
-
if (t.target.matches('input, textarea, [contenteditable="true"]'))
|
|
3216
|
-
return;
|
|
3217
|
-
const i = this.internal.getSelectedEvents();
|
|
3218
|
-
if (i.length === 0) return;
|
|
3219
|
-
const s = i.filter((r) => !r.readOnly);
|
|
3220
|
-
if (s.length === 0) return;
|
|
3221
|
-
t.preventDefault(), this.dispatchEvent(
|
|
3222
|
-
new CustomEvent("delete-events", {
|
|
3223
|
-
detail: { events: s },
|
|
3224
|
-
bubbles: !0
|
|
3225
|
-
})
|
|
3226
|
-
), this.internal.clearSelection(), this.selectedEventForDetail = null, this.selectedEventRect = null, this.dispatchEvent(
|
|
3227
|
-
new CustomEvent("selection-change", {
|
|
3228
|
-
detail: { selectedEvents: [] },
|
|
3229
|
-
bubbles: !0
|
|
3230
|
-
})
|
|
3231
|
-
);
|
|
3232
|
-
} else t.key === "Escape" && (this.isCreatingEvent || this.eventCreationStart ? (t.preventDefault(), this.clearEventCreationState(), this.renderCanvas(), Rt("Event creation cancelled")) : this.isDraggingEvent || this.movingEvent ? (t.preventDefault(), this.resetDragState(), this.renderCanvas(), Rt("Event move cancelled")) : this.isResizingEvent ? (t.preventDefault(), this.isResizingEvent = !1, this.resizeEvent = null, this.resizeStartY = 0, this.resizeEdge = null, this.renderCanvas(), Rt("Event resize cancelled")) : (this.internal.getSelectedEvents().length > 0 || this.selectedEventForDetail) && (t.preventDefault(), this.internal.clearSelection(), this.selectedEventForDetail = null, this.selectedEventRect = null, this.isDescriptionExpanded = !1, this.renderCanvas(), this.requestUpdate(), this.dispatchEvent(
|
|
3233
|
-
new CustomEvent("selection-change", {
|
|
3234
|
-
detail: { selectedEvents: [] },
|
|
3235
|
-
bubbles: !0
|
|
3236
|
-
})
|
|
3237
|
-
)));
|
|
3238
3214
|
}, this.onScrollContainerMouseMove = (t) => {
|
|
3239
3215
|
if (!this.scrollContainer || this.isDraggingZoom) return;
|
|
3240
3216
|
const e = this.scrollContainer.getBoundingClientRect(), i = t.clientX - e.left, s = t.clientY - e.top + this.scrollTop;
|
|
3241
3217
|
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 = "");
|
|
3242
3218
|
const o = this.getEventAtPosition(i, s), a = o ? o.id : null;
|
|
3243
|
-
a !== this.hoveredEventId && (this.hoveredEventId = a, this.renderCanvas()), this.requestUpdate(), i <
|
|
3219
|
+
a !== this.hoveredEventId && (this.hoveredEventId = a, this.renderCanvas()), this.requestUpdate(), i < z ? this.scrollContainer.classList.add("zoom-cursor") : this.scrollContainer.classList.remove("zoom-cursor");
|
|
3244
3220
|
}, this.onMinimapMouseDown = (t) => {
|
|
3245
3221
|
this.scrollContainer && (t.preventDefault(), this.isDraggingMinimap = !0, this.scrollToMinimapPosition(t));
|
|
3246
3222
|
}, this.onMinimapMouseMove = (t) => {
|
|
@@ -3272,24 +3248,24 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
3272
3248
|
this.movingEventOrigin.y
|
|
3273
3249
|
), l = this.convertPositionToDateTime(r, o);
|
|
3274
3250
|
if (a && l) {
|
|
3275
|
-
const c = l.getTime() - a.getTime(),
|
|
3276
|
-
const
|
|
3277
|
-
return f.setMinutes(Math.floor(
|
|
3278
|
-
},
|
|
3251
|
+
const c = l.getTime() - a.getTime(), d = (f) => {
|
|
3252
|
+
const p = f.getMinutes();
|
|
3253
|
+
return f.setMinutes(Math.floor(p / 15) * 15, 0, 0), f;
|
|
3254
|
+
}, h = d(
|
|
3279
3255
|
new Date(this.movingEvent.start.getTime() + c)
|
|
3280
|
-
), u =
|
|
3256
|
+
), u = d(
|
|
3281
3257
|
new Date(this.movingEvent.end.getTime() + c)
|
|
3282
3258
|
);
|
|
3283
3259
|
this.movingEventDuplicateMode ? this.dispatchEvent(
|
|
3284
3260
|
new CustomEvent("create-event", {
|
|
3285
|
-
detail: { start:
|
|
3261
|
+
detail: { start: h, end: u },
|
|
3286
3262
|
bubbles: !0
|
|
3287
3263
|
})
|
|
3288
3264
|
) : this.dispatchEvent(
|
|
3289
3265
|
new CustomEvent("move-event", {
|
|
3290
3266
|
detail: {
|
|
3291
3267
|
event: this.movingEvent,
|
|
3292
|
-
start:
|
|
3268
|
+
start: h,
|
|
3293
3269
|
end: u
|
|
3294
3270
|
},
|
|
3295
3271
|
bubbles: !0
|
|
@@ -3322,7 +3298,7 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
3322
3298
|
return;
|
|
3323
3299
|
}
|
|
3324
3300
|
const e = this.scrollContainer.getBoundingClientRect(), i = t.clientX - e.left, s = t.clientY - e.top + this.scrollTop;
|
|
3325
|
-
if (i <
|
|
3301
|
+
if (i < z) {
|
|
3326
3302
|
this.onZoomHandleMouseDown(t);
|
|
3327
3303
|
return;
|
|
3328
3304
|
}
|
|
@@ -3355,24 +3331,22 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
3355
3331
|
}, this.onFilterInput = (t) => {
|
|
3356
3332
|
const e = t.target;
|
|
3357
3333
|
this.internal.setFilter(e.value);
|
|
3358
|
-
}, this.onCalDAVClick = () => {
|
|
3359
|
-
this.dispatchEvent(new CustomEvent("caldav-config", { bubbles: !0 }));
|
|
3360
3334
|
}, this.onNotificationPopoverToggle = async () => {
|
|
3361
3335
|
this.notificationPopoverOpen = !this.notificationPopoverOpen, this.notificationPopoverOpen && this.dispatchEvent(new CustomEvent("load-notifications", { bubbles: !0 })), this.requestUpdate();
|
|
3362
3336
|
}, this.setScheduledNotifications = (t) => {
|
|
3363
3337
|
this.scheduledNotifications = t, this.requestUpdate();
|
|
3364
3338
|
}, this.onThemeChange = (t) => {
|
|
3365
3339
|
const i = t.target.value;
|
|
3366
|
-
this.currentTheme = i,
|
|
3340
|
+
this.currentTheme = i, Us(i), Ns(i), this.renderCanvas();
|
|
3367
3341
|
}, this.onZoomSliderChange = (t) => {
|
|
3368
3342
|
const e = t.target, i = parseInt(e.value, 10), s = this.dayHeight;
|
|
3369
3343
|
if (!this.scrollContainer) {
|
|
3370
3344
|
this.setView(i, this.scrollTop);
|
|
3371
3345
|
return;
|
|
3372
3346
|
}
|
|
3373
|
-
const o = this.scrollContainer.clientHeight / 2, a = this.scrollTop + o, l = i / s,
|
|
3374
|
-
this.setView(i,
|
|
3375
|
-
}, this.minimapCanvas = document.createElement("canvas"), this.internal = new
|
|
3347
|
+
const o = this.scrollContainer.clientHeight / 2, a = this.scrollTop + o, l = i / s, d = a * l - o;
|
|
3348
|
+
this.setView(i, d);
|
|
3349
|
+
}, this.minimapCanvas = document.createElement("canvas"), this.internal = new U({
|
|
3376
3350
|
locale: this.getAttribute("locale") || void 0,
|
|
3377
3351
|
weekStart: Number(this.getAttribute("week-start")),
|
|
3378
3352
|
storage: new zs()
|
|
@@ -3393,6 +3367,33 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
3393
3367
|
setView(t, e, i = !0) {
|
|
3394
3368
|
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();
|
|
3395
3369
|
}
|
|
3370
|
+
set columnsPerRow(t) {
|
|
3371
|
+
const e = Math.max(1, Math.min(7, Math.floor(t)));
|
|
3372
|
+
this._columnsPerRow !== e && (this._columnsPerRow = e, this.updateWeekOffsets(), this.renderCanvas(), this.requestUpdate());
|
|
3373
|
+
}
|
|
3374
|
+
get columnsPerRow() {
|
|
3375
|
+
return this._columnsPerRow;
|
|
3376
|
+
}
|
|
3377
|
+
get rowsPerWeek() {
|
|
3378
|
+
return Math.ceil(7 / this._columnsPerRow);
|
|
3379
|
+
}
|
|
3380
|
+
getDayVisualPosition(t) {
|
|
3381
|
+
const e = Math.floor(t / this._columnsPerRow), i = t % this._columnsPerRow;
|
|
3382
|
+
return { row: e, col: i };
|
|
3383
|
+
}
|
|
3384
|
+
getVisualPositionFromCoords(t, e, i) {
|
|
3385
|
+
if (!this.scrollContainer) return null;
|
|
3386
|
+
const s = i / this._columnsPerRow, r = Math.floor((t - z) / s);
|
|
3387
|
+
if (r < 0 || r >= this._columnsPerRow) return null;
|
|
3388
|
+
const o = this.weeks.find(
|
|
3389
|
+
(h) => h.height > 0 && e >= h.yOffset && e < h.yOffset + h.height
|
|
3390
|
+
);
|
|
3391
|
+
if (!o) return null;
|
|
3392
|
+
const a = this.dayHeight, c = Math.floor((e - o.yOffset) / a) * this._columnsPerRow + r;
|
|
3393
|
+
if (c < 0 || c > 6) return null;
|
|
3394
|
+
const d = (e - o.yOffset) % a / a;
|
|
3395
|
+
return { dayIndex: c, timeFraction: d, weekYOffset: o.yOffset };
|
|
3396
|
+
}
|
|
3396
3397
|
get filter() {
|
|
3397
3398
|
return this.internal.getFilter();
|
|
3398
3399
|
}
|
|
@@ -3402,9 +3403,9 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
3402
3403
|
loadDayHeight() {
|
|
3403
3404
|
const t = localStorage.getItem("calendar-dayHeight");
|
|
3404
3405
|
return t ? Math.max(
|
|
3405
|
-
|
|
3406
|
-
Math.min(
|
|
3407
|
-
) :
|
|
3406
|
+
qt,
|
|
3407
|
+
Math.min(me, parseFloat(t))
|
|
3408
|
+
) : qt;
|
|
3408
3409
|
}
|
|
3409
3410
|
saveDayHeight() {
|
|
3410
3411
|
localStorage.setItem("calendar-dayHeight", this.dayHeight.toString());
|
|
@@ -3450,10 +3451,10 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
3450
3451
|
}
|
|
3451
3452
|
scrollToDate(t, e = 0.5, i = !1, s = !1) {
|
|
3452
3453
|
let r = this.weeks.findIndex(
|
|
3453
|
-
(o) => o.days.some((a) =>
|
|
3454
|
+
(o) => o.days.some((a) => U.isSameDay(a, t)) || o.days[0] && o.days[6] && o.days[0] <= t && t <= o.days[6]
|
|
3454
3455
|
);
|
|
3455
3456
|
if (r < 0 && s && (this.weeks = this.internal.resetRangeAroundDate(t), this.updateWeekOffsets(), r = this.weeks.findIndex(
|
|
3456
|
-
(o) => o.days.some((a) =>
|
|
3457
|
+
(o) => o.days.some((a) => U.isSameDay(a, t)) || o.days[0] && o.days[6] && o.days[0] <= t && t <= o.days[6]
|
|
3457
3458
|
)), r >= 0) {
|
|
3458
3459
|
const o = this.weeks[r];
|
|
3459
3460
|
if (o) {
|
|
@@ -3466,8 +3467,8 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
3466
3467
|
if (this.cancelScrollAnimation(), !this.scrollContainer) return;
|
|
3467
3468
|
const e = this.scrollTop, i = t - e, s = 800, r = performance.now(), o = (l) => l === 1 ? 1 : 1 - 2 ** (-10 * l), a = (l) => {
|
|
3468
3469
|
if (!this.scrollAnimationFrame) return;
|
|
3469
|
-
const c = l - r,
|
|
3470
|
-
this.scrollTop = e + i *
|
|
3470
|
+
const c = l - r, d = Math.min(c / s, 1), h = o(d);
|
|
3471
|
+
this.scrollTop = e + i * h, d < 1 ? this.scrollAnimationFrame = requestAnimationFrame(a) : this.scrollAnimationFrame = null;
|
|
3471
3472
|
};
|
|
3472
3473
|
this.scrollAnimationFrame = requestAnimationFrame(a);
|
|
3473
3474
|
}
|
|
@@ -3492,10 +3493,10 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
3492
3493
|
}
|
|
3493
3494
|
}
|
|
3494
3495
|
connectedCallback() {
|
|
3495
|
-
super.connectedCallback(), window.addEventListener("mousemove", this.onMouseMove), window.addEventListener("mouseup", this.onMouseUp), window.addEventListener("wheel", this.onWheel, { passive: !1 }), window.addEventListener("
|
|
3496
|
+
super.connectedCallback(), window.addEventListener("mousemove", this.onMouseMove), window.addEventListener("mouseup", this.onMouseUp), window.addEventListener("wheel", this.onWheel, { passive: !1 }), window.addEventListener("paste", this.onPaste), 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);
|
|
3496
3497
|
}
|
|
3497
3498
|
disconnectedCallback() {
|
|
3498
|
-
super.disconnectedCallback(), document.removeEventListener("mousemove", this.onMouseMove), document.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("
|
|
3499
|
+
super.disconnectedCallback(), document.removeEventListener("mousemove", this.onMouseMove), document.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("paste", this.onPaste), this.removeEventListener("dragstart", this.onDragStart), this.removeEventListener("dragend", this.onDragEnd), this.removeEventListener("dragover", this.onDragOver), this.removeEventListener("dragleave", this.onDragLeave), this.removeEventListener("drop", this.onDrop), this.scrollContainer && this.scrollContainer.removeEventListener(
|
|
3499
3500
|
"mouseleave",
|
|
3500
3501
|
this.onScrollContainerMouseLeave
|
|
3501
3502
|
), this.resizeObserver && this.resizeObserver.disconnect(), this.animationFrame && cancelAnimationFrame(this.animationFrame), this.timeUpdateInterval && clearInterval(this.timeUpdateInterval);
|
|
@@ -3527,402 +3528,418 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
3527
3528
|
}
|
|
3528
3529
|
updateWeekOffsets() {
|
|
3529
3530
|
let t = 0;
|
|
3531
|
+
const e = this.dayHeight * this.rowsPerWeek;
|
|
3530
3532
|
if (this.filter) {
|
|
3531
|
-
const
|
|
3532
|
-
start:
|
|
3533
|
-
end:
|
|
3533
|
+
const s = this.events.map((r) => ({
|
|
3534
|
+
start: U.startOfDayTime(r.start),
|
|
3535
|
+
end: U.endOfDayTime(r.end)
|
|
3534
3536
|
}));
|
|
3535
|
-
for (const
|
|
3536
|
-
|
|
3537
|
-
const
|
|
3538
|
-
(
|
|
3537
|
+
for (const r of this.weeks) {
|
|
3538
|
+
r.yOffset = t;
|
|
3539
|
+
const o = r.days[0]?.getTime() ?? 0, a = r.days[6]?.getTime() ?? 0, l = s.some(
|
|
3540
|
+
(c) => c.end >= o && c.start <= a
|
|
3539
3541
|
);
|
|
3540
|
-
|
|
3542
|
+
r.height = l ? e : 0, t += r.height;
|
|
3541
3543
|
}
|
|
3542
3544
|
} else
|
|
3543
|
-
for (const
|
|
3544
|
-
|
|
3545
|
+
for (const i of this.weeks)
|
|
3546
|
+
i.yOffset = t, i.height = e, t += i.height;
|
|
3545
3547
|
this.totalHeight = t;
|
|
3546
3548
|
}
|
|
3547
3549
|
handleResize() {
|
|
3548
3550
|
if (!this.canvas || !this.scrollContainer) return;
|
|
3549
3551
|
const t = this.scrollContainer.getBoundingClientRect(), e = window.devicePixelRatio || 1;
|
|
3550
3552
|
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) {
|
|
3551
|
-
const i = t.width -
|
|
3553
|
+
const i = t.width - z - Yi;
|
|
3552
3554
|
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);
|
|
3553
3555
|
}
|
|
3554
|
-
this.renderCanvas();
|
|
3556
|
+
this.updateColumnsForViewport(), this.renderCanvas();
|
|
3557
|
+
}
|
|
3558
|
+
updateColumnsForViewport() {
|
|
3559
|
+
if (!this.scrollContainer) return;
|
|
3560
|
+
const e = this.scrollContainer.getBoundingClientRect().width - z, s = Math.max(1, Math.min(7, Math.floor(e / 120)));
|
|
3561
|
+
this._columnsPerRow !== s && (this._columnsPerRow = s, this.updateWeekOffsets());
|
|
3555
3562
|
}
|
|
3556
3563
|
renderCanvas() {
|
|
3557
3564
|
if (!this.ctx || !this.canvas || !this.scrollContainer) return;
|
|
3558
|
-
const t = this.ctx, e = this.canvas.width / (window.devicePixelRatio || 1), i = this.canvas.height / (window.devicePixelRatio || 1);
|
|
3565
|
+
const t = this.ctx, e = this.canvas.width / (window.devicePixelRatio || 1), i = this.canvas.height / (window.devicePixelRatio || 1), s = getComputedStyle(this).fontFamily;
|
|
3559
3566
|
t.clearRect(0, 0, e, i);
|
|
3560
|
-
const
|
|
3561
|
-
(h) => h.height > 0 && h.yOffset + h.height >
|
|
3562
|
-
),
|
|
3563
|
-
for (const h of
|
|
3564
|
-
const
|
|
3565
|
-
(
|
|
3567
|
+
const r = this.scrollTop, a = (e - z) / this._columnsPerRow, l = /* @__PURE__ */ new Date(), c = this.weeks.filter(
|
|
3568
|
+
(h) => h.height > 0 && h.yOffset + h.height > r && h.yOffset < r + i
|
|
3569
|
+
), d = this.dayHeight >= 300;
|
|
3570
|
+
for (const h of c) {
|
|
3571
|
+
const u = h.days.findIndex(
|
|
3572
|
+
(f) => U.isSameDay(f, l)
|
|
3566
3573
|
);
|
|
3567
|
-
if (
|
|
3568
|
-
const u =
|
|
3569
|
-
if (t.fillStyle =
|
|
3570
|
-
const
|
|
3571
|
-
if (
|
|
3572
|
-
const
|
|
3573
|
-
t.strokeStyle =
|
|
3574
|
+
if (u >= 0) {
|
|
3575
|
+
const { row: f, col: p } = this.getDayVisualPosition(u), g = z + p * a, v = h.yOffset + f * this.dayHeight - r, y = getComputedStyle(this).getPropertyValue("--bg-today").trim() || "rgba(255, 255, 255, 0.05)";
|
|
3576
|
+
if (t.fillStyle = y, t.fillRect(g, v, a, this.dayHeight), d) {
|
|
3577
|
+
const A = /* @__PURE__ */ new Date(), P = A.getHours() * 60 + A.getMinutes(), C = v + P / 1440 * this.dayHeight;
|
|
3578
|
+
if (C >= 0 && C <= i) {
|
|
3579
|
+
const x = getComputedStyle(this).getPropertyValue("--accent-current-time").trim() || "rgba(255, 0, 0, 0.8)";
|
|
3580
|
+
t.strokeStyle = x, t.lineWidth = 1, t.beginPath(), t.moveTo(g, C), t.lineTo(g + a, C), t.stroke(), t.lineWidth = 1;
|
|
3574
3581
|
}
|
|
3575
3582
|
}
|
|
3576
3583
|
}
|
|
3577
3584
|
}
|
|
3578
3585
|
t.strokeStyle = getComputedStyle(this).getPropertyValue("--grid-color").trim() || "rgba(255, 255, 255, 0.1)", t.lineWidth = 1;
|
|
3579
|
-
for (let h = 1; h <=
|
|
3580
|
-
const
|
|
3581
|
-
t.beginPath(), t.moveTo(
|
|
3582
|
-
}
|
|
3583
|
-
for (let h = 0; h <
|
|
3584
|
-
const
|
|
3585
|
-
if (!
|
|
3586
|
-
const
|
|
3586
|
+
for (let h = 1; h <= this._columnsPerRow; h++) {
|
|
3587
|
+
const u = z + h * a;
|
|
3588
|
+
t.beginPath(), t.moveTo(u, 0), t.lineTo(u, i), t.stroke();
|
|
3589
|
+
}
|
|
3590
|
+
for (let h = 0; h < c.length; h++) {
|
|
3591
|
+
const u = c[h];
|
|
3592
|
+
if (!u) continue;
|
|
3593
|
+
const f = u.yOffset - r;
|
|
3587
3594
|
if (this.filter && h > 0) {
|
|
3588
|
-
const
|
|
3589
|
-
if (!
|
|
3590
|
-
const
|
|
3591
|
-
if (
|
|
3592
|
-
const
|
|
3593
|
-
t.strokeStyle =
|
|
3594
|
-
const
|
|
3595
|
-
t.fillStyle =
|
|
3596
|
-
const
|
|
3597
|
-
t.fillStyle =
|
|
3595
|
+
const w = c[h - 1];
|
|
3596
|
+
if (!w) continue;
|
|
3597
|
+
const S = this.weeks.indexOf(w), $ = this.weeks.indexOf(u) - S - 1;
|
|
3598
|
+
if ($ > 0) {
|
|
3599
|
+
const b = f, E = getComputedStyle(this).getPropertyValue("--grid-color-strong").trim() || "rgba(255, 255, 255, 0.3)";
|
|
3600
|
+
t.strokeStyle = E, t.lineWidth = 1, t.setLineDash([4, 4]), t.beginPath(), t.moveTo(z, b), t.lineTo(e, b), t.stroke(), t.setLineDash([]);
|
|
3601
|
+
const T = getComputedStyle(this).getPropertyValue("--text-muted").trim() || "rgba(255, 255, 255, 0.4)";
|
|
3602
|
+
t.fillStyle = T, t.textAlign = "center";
|
|
3603
|
+
const D = `⋯ ${$} week${$ > 1 ? "s" : ""}`, N = t.measureText(D).width, L = 8, R = (z + e) / 2 - N / 2 - L, B = b - 8, I = N + L * 2, W = 16, K = getComputedStyle(this).getPropertyValue("--bg-primary").trim() || "rgba(30, 30, 30, 0.9)";
|
|
3604
|
+
t.fillStyle = K, t.beginPath(), t.roundRect(R, B, I, W, 8), t.fill(), t.fillStyle = T, t.fillText(D, (z + e) / 2, b + 4);
|
|
3598
3605
|
}
|
|
3599
3606
|
}
|
|
3600
|
-
t.strokeStyle = getComputedStyle(this).getPropertyValue("--grid-color").trim() || "rgba(255, 255, 255, 0.1)", t.beginPath(), t.moveTo(
|
|
3601
|
-
|
|
3607
|
+
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();
|
|
3608
|
+
for (let w = 1; w < this.rowsPerWeek; w++) {
|
|
3609
|
+
const S = f + w * this.dayHeight;
|
|
3610
|
+
S >= 0 && S <= i && (t.beginPath(), t.moveTo(z, S), t.lineTo(e, S), t.stroke());
|
|
3611
|
+
}
|
|
3612
|
+
const p = Math.max(
|
|
3602
3613
|
0,
|
|
3603
3614
|
Math.min(1, (this.dayHeight - 300) / 300)
|
|
3604
3615
|
);
|
|
3605
|
-
t.textAlign = "right";
|
|
3606
|
-
const
|
|
3607
|
-
t.strokeStyle =
|
|
3616
|
+
t.font = `500 11px ${s}`, t.textBaseline = "bottom", t.textAlign = "right";
|
|
3617
|
+
const g = getComputedStyle(this).getPropertyValue("--grid-color").trim() || "rgba(255, 255, 255, 0.1)", v = getComputedStyle(this).getPropertyValue("--text-muted").trim() || "rgba(255, 255, 255, 0.4)";
|
|
3618
|
+
t.strokeStyle = g.replace(
|
|
3608
3619
|
/[\d.]+\)$/,
|
|
3609
|
-
`${0.05 *
|
|
3610
|
-
), t.fillStyle =
|
|
3620
|
+
`${0.05 * p})`
|
|
3621
|
+
), t.fillStyle = v.replace(
|
|
3611
3622
|
/[\d.]+\)$/,
|
|
3612
|
-
`${0.4 *
|
|
3623
|
+
`${0.4 * p})`
|
|
3613
3624
|
);
|
|
3614
|
-
for (let
|
|
3615
|
-
const
|
|
3616
|
-
|
|
3617
|
-
const
|
|
3618
|
-
t.
|
|
3625
|
+
for (let w = 0; w < this.rowsPerWeek; w++) {
|
|
3626
|
+
const S = f + w * this.dayHeight;
|
|
3627
|
+
for (let O = 0; O < 24; O++) {
|
|
3628
|
+
const $ = S + O / 24 * this.dayHeight;
|
|
3629
|
+
if ($ >= 0 && $ <= i && (t.beginPath(), t.moveTo(z, $), t.lineTo(e, $), t.stroke(), p > 0.1)) {
|
|
3630
|
+
const b = `${O.toString().padStart(2, "0")}:00`;
|
|
3631
|
+
t.fillText(b, 48, $ + 4);
|
|
3632
|
+
}
|
|
3619
3633
|
}
|
|
3620
3634
|
}
|
|
3621
|
-
if (
|
|
3622
|
-
const
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
)
|
|
3626
|
-
const
|
|
3627
|
-
if (
|
|
3628
|
-
const
|
|
3635
|
+
if (p > 0.1) {
|
|
3636
|
+
const w = /* @__PURE__ */ new Date(), S = u.days.findIndex(
|
|
3637
|
+
(O) => U.isSameDay(O, w)
|
|
3638
|
+
);
|
|
3639
|
+
if (S >= 0) {
|
|
3640
|
+
const { row: O } = this.getDayVisualPosition(S), $ = w.getHours() * 60 + w.getMinutes(), b = f + O * this.dayHeight + $ / 1440 * this.dayHeight;
|
|
3641
|
+
if (b >= 0 && b <= i) {
|
|
3642
|
+
const E = w.getHours().toString().padStart(2, "0"), T = w.getMinutes().toString().padStart(2, "0"), D = `${E}:${T}`;
|
|
3629
3643
|
t.save(), t.textAlign = "right", t.textBaseline = "middle";
|
|
3630
|
-
const
|
|
3631
|
-
t.fillStyle =
|
|
3632
|
-
|
|
3644
|
+
const N = t.measureText(D).width, L = 6, R = 48, B = b, I = getComputedStyle(this).getPropertyValue("--bg-elevated").trim() || "rgba(0, 0, 0, 0.7)";
|
|
3645
|
+
t.fillStyle = I, t.beginPath(), t.roundRect(
|
|
3646
|
+
R - N - L,
|
|
3633
3647
|
B - 8,
|
|
3634
|
-
|
|
3648
|
+
N + L * 2,
|
|
3635
3649
|
16,
|
|
3636
3650
|
4
|
|
3637
|
-
), t.fill(), t.fillStyle = "white", t.fillText(
|
|
3651
|
+
), t.fill(), t.fillStyle = "white", t.fillText(D, R, B), t.restore();
|
|
3638
3652
|
}
|
|
3639
3653
|
}
|
|
3640
3654
|
}
|
|
3641
|
-
const
|
|
3655
|
+
const y = Math.max(
|
|
3642
3656
|
0,
|
|
3643
3657
|
Math.min(1, 1 - (this.dayHeight - 300) / 50)
|
|
3644
|
-
),
|
|
3645
|
-
t.fillStyle =
|
|
3658
|
+
), A = getComputedStyle(this).getPropertyValue("--text-muted").trim() || "rgba(255, 255, 255, 0.4)";
|
|
3659
|
+
t.fillStyle = A.replace(
|
|
3646
3660
|
/[\d.]+\)$/,
|
|
3647
|
-
`${0.4 *
|
|
3661
|
+
`${0.4 * y})`
|
|
3648
3662
|
), t.textAlign = "center";
|
|
3649
|
-
const
|
|
3663
|
+
const P = `W${u.weekNumber}`, C = f, x = f + u.height, M = Math.max(
|
|
3650
3664
|
14,
|
|
3651
|
-
Math.min(
|
|
3665
|
+
Math.min(C + u.height / 2 + 4, x - 4)
|
|
3652
3666
|
);
|
|
3653
|
-
|
|
3667
|
+
M >= Math.max(0, C + 4) && M <= Math.min(i, x) && y > 0.1 && t.fillText(P, 30, M);
|
|
3654
3668
|
}
|
|
3655
|
-
this.renderEventsOnCanvas(t,
|
|
3669
|
+
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();
|
|
3656
3670
|
}
|
|
3657
3671
|
renderEventsOnCanvas(t, e, i, s, r) {
|
|
3658
3672
|
const o = this.events, a = getComputedStyle(this).fontFamily, l = e + i, c = this.dayHeight >= 300;
|
|
3659
3673
|
if (this.eventRects = [], r.length === 0) return;
|
|
3660
|
-
const
|
|
3661
|
-
for (const
|
|
3662
|
-
const
|
|
3663
|
-
if (
|
|
3674
|
+
const d = r[0], h = r[r.length - 1], u = d.days[0], f = h.days[6], p = u.getTime(), g = f.getTime() + 864e5 - 1, v = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), A = [], P = [], C = [];
|
|
3675
|
+
for (const b of o) {
|
|
3676
|
+
const E = b.start.getTime(), T = b.end.getTime();
|
|
3677
|
+
if (T < p || E > g)
|
|
3664
3678
|
continue;
|
|
3665
|
-
const
|
|
3666
|
-
for (const
|
|
3667
|
-
const
|
|
3668
|
-
if (!
|
|
3669
|
-
const
|
|
3670
|
-
if (
|
|
3671
|
-
const
|
|
3672
|
-
|
|
3679
|
+
const D = [];
|
|
3680
|
+
for (const R of r) {
|
|
3681
|
+
const B = R.days[0], I = R.days[6];
|
|
3682
|
+
if (!B || !I) continue;
|
|
3683
|
+
const W = B.getTime(), K = I.getTime() + 86399999;
|
|
3684
|
+
if (T >= W && E <= K) {
|
|
3685
|
+
const J = this.weeks.indexOf(R);
|
|
3686
|
+
D.push({ weekIndex: J, week: R });
|
|
3673
3687
|
}
|
|
3674
3688
|
}
|
|
3675
|
-
const
|
|
3676
|
-
for (let
|
|
3677
|
-
const { weekIndex:
|
|
3678
|
-
let
|
|
3679
|
-
if (
|
|
3680
|
-
const
|
|
3681
|
-
|
|
3689
|
+
const N = D.length, L = b.isAllDay === !0;
|
|
3690
|
+
for (let R = 0; R < D.length; R++) {
|
|
3691
|
+
const { weekIndex: B, week: I } = D[R], W = R === 0, K = R === D.length - 1;
|
|
3692
|
+
let J = 0, wt = 6;
|
|
3693
|
+
if (W && (J = Ui(I, b.start)), K) {
|
|
3694
|
+
const ut = L ? new Date(b.end.getTime() - 1) : b.end;
|
|
3695
|
+
wt = Ui(I, ut);
|
|
3682
3696
|
}
|
|
3683
|
-
const
|
|
3684
|
-
event:
|
|
3685
|
-
weekIndex:
|
|
3686
|
-
week:
|
|
3687
|
-
startDayIndex:
|
|
3688
|
-
endDayIndex:
|
|
3689
|
-
isStart:
|
|
3690
|
-
isEnd:
|
|
3691
|
-
totalWeeks:
|
|
3697
|
+
const rt = {
|
|
3698
|
+
event: b,
|
|
3699
|
+
weekIndex: B,
|
|
3700
|
+
week: I,
|
|
3701
|
+
startDayIndex: J,
|
|
3702
|
+
endDayIndex: wt,
|
|
3703
|
+
isStart: W,
|
|
3704
|
+
isEnd: K,
|
|
3705
|
+
totalWeeks: N
|
|
3692
3706
|
};
|
|
3693
|
-
|
|
3707
|
+
L ? P.push(rt) : C.push(rt);
|
|
3694
3708
|
}
|
|
3695
3709
|
}
|
|
3696
|
-
const
|
|
3697
|
-
if (
|
|
3698
|
-
const
|
|
3699
|
-
for (let
|
|
3700
|
-
|
|
3701
|
-
...
|
|
3702
|
-
startDayIndex:
|
|
3703
|
-
endDayIndex:
|
|
3704
|
-
isStart:
|
|
3705
|
-
isEnd:
|
|
3710
|
+
const x = c ? C.flatMap((b) => {
|
|
3711
|
+
if (b.startDayIndex === b.endDayIndex) return [b];
|
|
3712
|
+
const E = [];
|
|
3713
|
+
for (let T = b.startDayIndex; T <= b.endDayIndex; T++)
|
|
3714
|
+
E.push({
|
|
3715
|
+
...b,
|
|
3716
|
+
startDayIndex: T,
|
|
3717
|
+
endDayIndex: T,
|
|
3718
|
+
isStart: T === b.startDayIndex && b.isStart,
|
|
3719
|
+
isEnd: T === b.endDayIndex && b.isEnd,
|
|
3706
3720
|
totalWeeks: 1
|
|
3707
3721
|
});
|
|
3708
|
-
return
|
|
3709
|
-
}) :
|
|
3710
|
-
|
|
3711
|
-
const
|
|
3712
|
-
for (const
|
|
3713
|
-
const
|
|
3714
|
-
if (c && !
|
|
3715
|
-
for (let
|
|
3716
|
-
const
|
|
3717
|
-
|
|
3722
|
+
return E;
|
|
3723
|
+
}) : C;
|
|
3724
|
+
A.push(...P, ...x);
|
|
3725
|
+
const M = /* @__PURE__ */ new Map();
|
|
3726
|
+
for (const b of A) {
|
|
3727
|
+
const E = b.event.isAllDay === !0;
|
|
3728
|
+
if (c && !E)
|
|
3729
|
+
for (let T = b.startDayIndex; T <= b.endDayIndex; T++) {
|
|
3730
|
+
const D = `${b.weekIndex}-${T}`;
|
|
3731
|
+
M.has(D) || M.set(D, []), M.get(D).push(b);
|
|
3718
3732
|
}
|
|
3719
3733
|
}
|
|
3720
|
-
const
|
|
3721
|
-
for (const [
|
|
3722
|
-
const [
|
|
3723
|
-
for (const
|
|
3724
|
-
const
|
|
3725
|
-
if (!
|
|
3726
|
-
const
|
|
3734
|
+
const w = /* @__PURE__ */ new Map();
|
|
3735
|
+
for (const [b, E] of M) {
|
|
3736
|
+
const [T, D] = b.split("-"), N = parseInt(D), L = parseInt(T), R = [];
|
|
3737
|
+
for (const I of E) {
|
|
3738
|
+
const W = this.weeks[L];
|
|
3739
|
+
if (!W) continue;
|
|
3740
|
+
const K = new Date(W.days[N]).setHours(
|
|
3727
3741
|
0,
|
|
3728
3742
|
0,
|
|
3729
3743
|
0,
|
|
3730
3744
|
0
|
|
3731
|
-
),
|
|
3745
|
+
), J = new Date(W.days[N]).setHours(
|
|
3732
3746
|
23,
|
|
3733
3747
|
59,
|
|
3734
3748
|
59,
|
|
3735
3749
|
999
|
|
3736
|
-
),
|
|
3737
|
-
|
|
3750
|
+
), wt = I.event.start.getTime(), rt = I.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();
|
|
3751
|
+
R.push({ segment: I, startMinutes: Qt, endMinutes: kt });
|
|
3738
3752
|
}
|
|
3739
|
-
|
|
3740
|
-
const
|
|
3741
|
-
for (const
|
|
3742
|
-
let
|
|
3743
|
-
for (;
|
|
3753
|
+
R.sort((I, W) => I.startMinutes !== W.startMinutes ? I.startMinutes - W.startMinutes : W.endMinutes - W.startMinutes - (I.endMinutes - I.startMinutes));
|
|
3754
|
+
const B = [];
|
|
3755
|
+
for (const I of R) {
|
|
3756
|
+
let W = 0;
|
|
3757
|
+
for (; W < B.length && !(B[W].endMinutes <= I.startMinutes); W++)
|
|
3744
3758
|
;
|
|
3745
|
-
|
|
3746
|
-
const
|
|
3747
|
-
|
|
3748
|
-
column:
|
|
3749
|
-
totalColumns:
|
|
3759
|
+
W === B.length ? B.push({ endMinutes: I.endMinutes }) : B[W].endMinutes = I.endMinutes;
|
|
3760
|
+
const K = `${I.segment.weekIndex}-${I.segment.event.id}-${N}`;
|
|
3761
|
+
w.set(K, {
|
|
3762
|
+
column: W,
|
|
3763
|
+
totalColumns: B.length
|
|
3750
3764
|
});
|
|
3751
3765
|
}
|
|
3752
|
-
for (const
|
|
3753
|
-
const
|
|
3754
|
-
|
|
3766
|
+
for (const I of R) {
|
|
3767
|
+
const W = `${I.segment.weekIndex}-${I.segment.event.id}-${N}`, K = w.get(W);
|
|
3768
|
+
K && (K.totalColumns = B.length);
|
|
3755
3769
|
}
|
|
3756
3770
|
}
|
|
3757
|
-
for (const
|
|
3771
|
+
for (const b of A) {
|
|
3758
3772
|
const {
|
|
3759
|
-
event:
|
|
3760
|
-
week:
|
|
3761
|
-
weekIndex:
|
|
3762
|
-
startDayIndex:
|
|
3763
|
-
endDayIndex:
|
|
3764
|
-
isStart:
|
|
3765
|
-
isEnd:
|
|
3766
|
-
totalWeeks:
|
|
3767
|
-
} =
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3773
|
+
event: E,
|
|
3774
|
+
week: T,
|
|
3775
|
+
weekIndex: D,
|
|
3776
|
+
startDayIndex: N,
|
|
3777
|
+
endDayIndex: L,
|
|
3778
|
+
isStart: R,
|
|
3779
|
+
isEnd: B,
|
|
3780
|
+
totalWeeks: I
|
|
3781
|
+
} = b, W = T.yOffset, K = E.isAllDay === !0, J = this.getDayVisualPosition(N), wt = this.getDayVisualPosition(L);
|
|
3782
|
+
J.row, wt.row;
|
|
3783
|
+
let rt, ut;
|
|
3784
|
+
if (c && !K) {
|
|
3785
|
+
const nt = new Date(T.days[N]).setHours(
|
|
3771
3786
|
0,
|
|
3772
3787
|
0,
|
|
3773
3788
|
0,
|
|
3774
3789
|
0
|
|
3775
|
-
),
|
|
3790
|
+
), q = new Date(T.days[L]).setHours(
|
|
3776
3791
|
23,
|
|
3777
3792
|
59,
|
|
3778
3793
|
59,
|
|
3779
3794
|
999
|
|
3780
|
-
),
|
|
3781
|
-
|
|
3795
|
+
), Et = E.start.getTime(), gt = E.end.getTime() - 6e4, st = Math.max(Et, nt), j = Math.min(gt, q), pt = new Date(st), vt = new Date(j), Rt = pt.getHours() * 60 + pt.getMinutes(), It = vt.getHours() * 60 + vt.getMinutes(), $t = W + J.row * this.dayHeight;
|
|
3796
|
+
rt = $t + Rt / 1440 * this.dayHeight, ut = $t + It / 1440 * this.dayHeight;
|
|
3782
3797
|
} else {
|
|
3783
|
-
const
|
|
3784
|
-
let
|
|
3785
|
-
if (
|
|
3786
|
-
for (
|
|
3787
|
-
let
|
|
3788
|
-
for (let
|
|
3789
|
-
const
|
|
3790
|
-
if (
|
|
3791
|
-
|
|
3798
|
+
const nt = `${D}-${E.id}`;
|
|
3799
|
+
let q = y.get(nt);
|
|
3800
|
+
if (q === void 0) {
|
|
3801
|
+
for (q = 0; ; ) {
|
|
3802
|
+
let st = !0;
|
|
3803
|
+
for (let j = N; j <= L; j++) {
|
|
3804
|
+
const pt = `${D}-${j}`;
|
|
3805
|
+
if (v.get(pt)?.has(q)) {
|
|
3806
|
+
st = !1;
|
|
3792
3807
|
break;
|
|
3793
3808
|
}
|
|
3794
3809
|
}
|
|
3795
|
-
if (
|
|
3796
|
-
|
|
3810
|
+
if (st) break;
|
|
3811
|
+
q++;
|
|
3797
3812
|
}
|
|
3798
|
-
|
|
3813
|
+
y.set(nt, q);
|
|
3799
3814
|
}
|
|
3800
|
-
for (let
|
|
3801
|
-
const
|
|
3802
|
-
let
|
|
3803
|
-
|
|
3815
|
+
for (let st = N; st <= L; st++) {
|
|
3816
|
+
const j = `${D}-${st}`;
|
|
3817
|
+
let pt = v.get(j);
|
|
3818
|
+
pt || (pt = /* @__PURE__ */ new Set(), v.set(j, pt)), pt.add(q);
|
|
3804
3819
|
}
|
|
3805
|
-
const
|
|
3806
|
-
(
|
|
3820
|
+
const Et = Math.floor(
|
|
3821
|
+
(this.dayHeight - 4) / (ye + 2)
|
|
3807
3822
|
);
|
|
3808
|
-
if (
|
|
3809
|
-
|
|
3823
|
+
if (q >= Et) continue;
|
|
3824
|
+
rt = W + J.row * this.dayHeight + 4 + q * (ye + 2), ut = rt + ye;
|
|
3810
3825
|
}
|
|
3811
|
-
const
|
|
3812
|
-
c ? 4 :
|
|
3813
|
-
|
|
3826
|
+
const Q = Math.max(
|
|
3827
|
+
c ? 4 : ye,
|
|
3828
|
+
ut - rt
|
|
3814
3829
|
);
|
|
3815
|
-
let
|
|
3816
|
-
const
|
|
3817
|
-
if (c && !
|
|
3818
|
-
const
|
|
3819
|
-
|
|
3820
|
-
} else
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
const
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3830
|
+
let X, Tt;
|
|
3831
|
+
const Qt = `${D}-${E.id}-${N}`, kt = w.get(Qt);
|
|
3832
|
+
if (c && !K && kt && kt.totalColumns > 1) {
|
|
3833
|
+
const nt = s / kt.totalColumns;
|
|
3834
|
+
X = z + J.col * s + kt.column * nt, Tt = nt;
|
|
3835
|
+
} else {
|
|
3836
|
+
const nt = wt.col - J.col + 1;
|
|
3837
|
+
X = z + J.col * s, Tt = nt * s;
|
|
3838
|
+
}
|
|
3839
|
+
const ft = rt - e;
|
|
3840
|
+
if (ft + Q < 0 || ft > i) continue;
|
|
3841
|
+
const $e = E.color || "#888888", Pt = this.internal.isEventSelected(E), sn = this.hoveredEventId === E.id, ct = 2, Dt = Tt - ct * 2, te = 3, si = 6;
|
|
3842
|
+
let Ct = 4, Wt = 4, Mt = 4, zt = 4;
|
|
3843
|
+
I > 1 && (R && !B ? (Wt = 0, zt = 0) : !R && B ? (Ct = 0, Mt = 0) : !R && !B && (Ct = 0, Wt = 0, Mt = 0, zt = 0)), t.save(), E.readOnly && (t.globalAlpha = 0.5);
|
|
3844
|
+
const Ft = Rs(Ie($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 = Pt ? $e : `hsla(${Ft[0]}, ${Math.min(Ft[1] * 0.9, 90)}%, ${Math.min(
|
|
3845
|
+
Ft[2] + 15,
|
|
3829
3846
|
40
|
|
3830
|
-
)}%, 0.45)`,
|
|
3831
|
-
|
|
3847
|
+
)}%, 0.45)`, on = Pt ? $e : `hsla(${Ft[0]}, ${Math.min(Ft[1] * 0.9, 90)}%, ${Math.min(
|
|
3848
|
+
Ft[2] + 10,
|
|
3832
3849
|
70
|
|
3833
|
-
)}%, 1)`,
|
|
3834
|
-
if (t.beginPath(), t.roundRect(
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
]), t.fillStyle =
|
|
3840
|
-
const
|
|
3841
|
-
if (
|
|
3842
|
-
t.save(), t.beginPath(), t.roundRect(
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3850
|
+
)}%, 1)`, an = this.shouldRenderEventWithStripes(E);
|
|
3851
|
+
if (t.beginPath(), t.roundRect(X + ct, ft, Dt, Q, [
|
|
3852
|
+
Ct,
|
|
3853
|
+
Wt,
|
|
3854
|
+
zt,
|
|
3855
|
+
Mt
|
|
3856
|
+
]), t.fillStyle = rn, t.fill(), an) {
|
|
3857
|
+
const nt = this.getStripePatternCanvas();
|
|
3858
|
+
if (nt) {
|
|
3859
|
+
t.save(), t.beginPath(), t.roundRect(X + ct, ft, Dt, Q, [
|
|
3860
|
+
Ct,
|
|
3861
|
+
Wt,
|
|
3862
|
+
zt,
|
|
3863
|
+
Mt
|
|
3847
3864
|
]), t.clip();
|
|
3848
|
-
const
|
|
3849
|
-
for (let
|
|
3850
|
-
for (let j =
|
|
3851
|
-
t.drawImage(
|
|
3865
|
+
const q = 12, Et = Math.floor((X + ct) / q) * q, gt = Math.floor(rt / q) * q - e;
|
|
3866
|
+
for (let st = gt; st < ft + Q; st += q)
|
|
3867
|
+
for (let j = Et; j < X + ct + Dt; j += q)
|
|
3868
|
+
t.drawImage(nt, j, st, q, q);
|
|
3852
3869
|
t.restore();
|
|
3853
3870
|
}
|
|
3854
3871
|
}
|
|
3855
|
-
if (
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
[
|
|
3861
|
-
), t.fill()),
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
]), t.stroke()),
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
]), t.stroke()),
|
|
3872
|
-
const
|
|
3873
|
-
t.fillStyle =
|
|
3874
|
-
const
|
|
3875
|
-
let
|
|
3872
|
+
if (Pt || (t.fillStyle = on, t.beginPath(), t.roundRect(
|
|
3873
|
+
X + ct + 2,
|
|
3874
|
+
ft + 2,
|
|
3875
|
+
te,
|
|
3876
|
+
Q - 4,
|
|
3877
|
+
[Ct, Ct, Mt, Mt]
|
|
3878
|
+
), t.fill()), Pt && (t.strokeStyle = Ae, t.lineWidth = 1, t.beginPath(), t.roundRect(X + ct, ft, Dt, Q, [
|
|
3879
|
+
Ct,
|
|
3880
|
+
Wt,
|
|
3881
|
+
zt,
|
|
3882
|
+
Mt
|
|
3883
|
+
]), t.stroke()), sn && !Pt && (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, [
|
|
3884
|
+
Ct,
|
|
3885
|
+
Wt,
|
|
3886
|
+
zt,
|
|
3887
|
+
Mt
|
|
3888
|
+
]), t.stroke()), R && Q >= 16) {
|
|
3889
|
+
const nt = Pt ? Ae : ri;
|
|
3890
|
+
t.fillStyle = nt, t.font = `11px ${a}`, t.textAlign = "left", t.textBaseline = "top";
|
|
3891
|
+
const q = X + ct + te + si + 1, Et = ft + 6;
|
|
3892
|
+
let gt = Dt - te - si - 4;
|
|
3876
3893
|
if (t.save(), t.beginPath(), t.rect(
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
), t.clip(),
|
|
3894
|
+
X + ct + te,
|
|
3895
|
+
ft,
|
|
3896
|
+
Dt - te,
|
|
3897
|
+
Q
|
|
3898
|
+
), t.clip(), E.rrule) {
|
|
3882
3899
|
t.font = `11px ${a}`;
|
|
3883
|
-
const
|
|
3884
|
-
t.fillText(
|
|
3900
|
+
const vt = "⟳", Rt = t.measureText(vt).width;
|
|
3901
|
+
t.fillText(vt, q, Et), gt -= Rt + 4;
|
|
3885
3902
|
}
|
|
3886
|
-
const
|
|
3887
|
-
let j =
|
|
3888
|
-
if (t.font = `11px ${a}`, t.measureText(j).width >
|
|
3889
|
-
const
|
|
3890
|
-
let It = 0,
|
|
3891
|
-
for (; It <=
|
|
3892
|
-
const
|
|
3893
|
-
t.measureText(
|
|
3903
|
+
const st = q + (E.rrule ? t.measureText("⟳").width + 4 : 0);
|
|
3904
|
+
let j = E.title;
|
|
3905
|
+
if (t.font = `11px ${a}`, t.measureText(j).width > gt) {
|
|
3906
|
+
const Rt = t.measureText("…").width;
|
|
3907
|
+
let It = 0, $t = j.length, fe = 0;
|
|
3908
|
+
for (; It <= $t; ) {
|
|
3909
|
+
const ht = Math.floor((It + $t) / 2), oi = j.substring(0, ht);
|
|
3910
|
+
t.measureText(oi).width + Rt <= gt ? (fe = ht, It = ht + 1) : $t = ht - 1;
|
|
3894
3911
|
}
|
|
3895
|
-
j = j.substring(0,
|
|
3912
|
+
j = j.substring(0, fe) + "…";
|
|
3896
3913
|
}
|
|
3897
|
-
if (t.fillText(j,
|
|
3898
|
-
const
|
|
3899
|
-
const pe =
|
|
3900
|
-
return `${pe % 12 || 12}:${
|
|
3901
|
-
},
|
|
3902
|
-
t.fillStyle =
|
|
3903
|
-
let
|
|
3904
|
-
if (t.measureText(
|
|
3914
|
+
if (t.fillText(j, st, Et), Q >= 32) {
|
|
3915
|
+
const vt = (ge) => {
|
|
3916
|
+
const pe = ge.getHours(), ee = ge.getMinutes(), ie = pe >= 12 ? "PM" : "AM";
|
|
3917
|
+
return `${pe % 12 || 12}:${ee.toString().padStart(2, "0")} ${ie}`;
|
|
3918
|
+
}, Rt = vt(E.start), It = vt(E.end), $t = `${Rt} – ${It}`, fe = Pt ? Ae : ri;
|
|
3919
|
+
t.fillStyle = fe, t.font = `10px ${a}`;
|
|
3920
|
+
let ht = $t;
|
|
3921
|
+
if (t.measureText(ht).width > gt) {
|
|
3905
3922
|
const pe = t.measureText("…").width;
|
|
3906
|
-
let
|
|
3907
|
-
for (;
|
|
3908
|
-
const
|
|
3909
|
-
t.measureText(
|
|
3923
|
+
let ee = 0, ie = ht.length, Oe = 0;
|
|
3924
|
+
for (; ee <= ie; ) {
|
|
3925
|
+
const ve = Math.floor((ee + ie) / 2), ln = ht.substring(0, ve);
|
|
3926
|
+
t.measureText(ln).width + pe <= gt ? (Oe = ve, ee = ve + 1) : ie = ve - 1;
|
|
3910
3927
|
}
|
|
3911
|
-
|
|
3928
|
+
ht = ht.substring(0, Oe) + "…";
|
|
3912
3929
|
}
|
|
3913
|
-
t.fillText(
|
|
3930
|
+
t.fillText(ht, q, Et + 14);
|
|
3914
3931
|
}
|
|
3915
3932
|
t.restore();
|
|
3916
3933
|
}
|
|
3917
3934
|
t.restore(), this.eventRects.push({
|
|
3918
|
-
event:
|
|
3919
|
-
x:
|
|
3920
|
-
y:
|
|
3921
|
-
width:
|
|
3922
|
-
height:
|
|
3935
|
+
event: E,
|
|
3936
|
+
x: X + ct,
|
|
3937
|
+
y: rt,
|
|
3938
|
+
width: Dt,
|
|
3939
|
+
height: Q
|
|
3923
3940
|
});
|
|
3924
3941
|
}
|
|
3925
|
-
const
|
|
3942
|
+
const S = [
|
|
3926
3943
|
"January",
|
|
3927
3944
|
"February",
|
|
3928
3945
|
"March",
|
|
@@ -3935,38 +3952,38 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
3935
3952
|
"October",
|
|
3936
3953
|
"November",
|
|
3937
3954
|
"December"
|
|
3938
|
-
],
|
|
3939
|
-
for (const
|
|
3940
|
-
const
|
|
3941
|
-
if (!
|
|
3942
|
-
const
|
|
3943
|
-
if (
|
|
3944
|
-
|
|
3945
|
-
const
|
|
3946
|
-
|
|
3947
|
-
monthKey:
|
|
3948
|
-
monthName:
|
|
3949
|
-
year:
|
|
3950
|
-
yOffset:
|
|
3955
|
+
], O = [], $ = /* @__PURE__ */ new Set();
|
|
3956
|
+
for (const b of r) {
|
|
3957
|
+
const E = b.days[0];
|
|
3958
|
+
if (!E) continue;
|
|
3959
|
+
const T = E.getMonth(), D = E.getFullYear(), N = `${T}-${D}`;
|
|
3960
|
+
if (!$.has(N)) {
|
|
3961
|
+
$.add(N);
|
|
3962
|
+
const L = S[T];
|
|
3963
|
+
L && O.push({
|
|
3964
|
+
monthKey: N,
|
|
3965
|
+
monthName: L,
|
|
3966
|
+
year: D,
|
|
3967
|
+
yOffset: b.yOffset
|
|
3951
3968
|
});
|
|
3952
3969
|
}
|
|
3953
3970
|
}
|
|
3954
|
-
for (let
|
|
3955
|
-
const
|
|
3956
|
-
if (
|
|
3957
|
-
if (
|
|
3958
|
-
const
|
|
3971
|
+
for (let b = 0; b < O.length; b++) {
|
|
3972
|
+
const E = O[b], T = O[b + 1], D = E.yOffset, N = T ? T.yOffset : this.totalHeight;
|
|
3973
|
+
if (N < e) continue;
|
|
3974
|
+
if (D > l) break;
|
|
3975
|
+
const L = [12, 0, 0, 12], R = Math.max(0, e - D), B = N - D - 24, I = Math.min(R, B), K = D + I - e + 32;
|
|
3959
3976
|
t.save(), t.font = `bold 18px ${a}`, t.textAlign = "left", t.textBaseline = "top";
|
|
3960
|
-
const
|
|
3961
|
-
t.fillStyle =
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3977
|
+
const J = `${E.monthName} ${E.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)";
|
|
3978
|
+
t.fillStyle = Qt, t.beginPath(), t.roundRect(
|
|
3979
|
+
ut - X,
|
|
3980
|
+
Q - 4,
|
|
3981
|
+
wt + X + Tt,
|
|
3965
3982
|
26,
|
|
3966
3983
|
6
|
|
3967
3984
|
), t.fill();
|
|
3968
|
-
const
|
|
3969
|
-
t.fillStyle =
|
|
3985
|
+
const kt = getComputedStyle(this).getPropertyValue("--text-primary").trim() || "rgba(255, 255, 255, 0.95)";
|
|
3986
|
+
t.fillStyle = kt, t.fillText(J, ut, Q), t.restore();
|
|
3970
3987
|
}
|
|
3971
3988
|
}
|
|
3972
3989
|
resetDragState() {
|
|
@@ -3978,13 +3995,49 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
3978
3995
|
this.zoomViewportY = e, this.zoomOriginY = e + this.scrollTop;
|
|
3979
3996
|
}
|
|
3980
3997
|
}
|
|
3998
|
+
forceSync() {
|
|
3999
|
+
this.dispatchEvent(new CustomEvent("force-sync", { bubbles: !0 }));
|
|
4000
|
+
}
|
|
4001
|
+
copySelectedEvents() {
|
|
4002
|
+
const t = this.internal.getSelectedEvents();
|
|
4003
|
+
if (t.length === 0) return;
|
|
4004
|
+
const e = Hi(t), i = new Blob([e], { type: "text/plain" }), s = new ClipboardItem({ "text/plain": i });
|
|
4005
|
+
navigator.clipboard.write([s]).then(() => {
|
|
4006
|
+
const r = t.length;
|
|
4007
|
+
Yt(`Copied ${r} event${r === 1 ? "" : "s"} to clipboard`);
|
|
4008
|
+
});
|
|
4009
|
+
}
|
|
4010
|
+
deleteSelectedEvents() {
|
|
4011
|
+
const t = this.internal.getSelectedEvents();
|
|
4012
|
+
if (t.length === 0) return;
|
|
4013
|
+
const e = t.filter((i) => !i.readOnly);
|
|
4014
|
+
e.length !== 0 && (this.dispatchEvent(
|
|
4015
|
+
new CustomEvent("delete-events", {
|
|
4016
|
+
detail: { events: e },
|
|
4017
|
+
bubbles: !0
|
|
4018
|
+
})
|
|
4019
|
+
), this.internal.clearSelection(), this.selectedEventForDetail = null, this.selectedEventRect = null, this.dispatchEvent(
|
|
4020
|
+
new CustomEvent("selection-change", {
|
|
4021
|
+
detail: { selectedEvents: [] },
|
|
4022
|
+
bubbles: !0
|
|
4023
|
+
})
|
|
4024
|
+
));
|
|
4025
|
+
}
|
|
4026
|
+
escape() {
|
|
4027
|
+
this.isCreatingEvent || this.eventCreationStart ? (this.clearEventCreationState(), this.renderCanvas(), Yt("Event creation cancelled")) : this.isDraggingEvent || this.movingEvent ? (this.resetDragState(), this.renderCanvas(), Yt("Event move cancelled")) : this.isResizingEvent ? (this.isResizingEvent = !1, this.resizeEvent = null, this.resizeStartY = 0, this.resizeEdge = null, this.renderCanvas(), Yt("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(
|
|
4028
|
+
new CustomEvent("selection-change", {
|
|
4029
|
+
detail: { selectedEvents: [] },
|
|
4030
|
+
bubbles: !0
|
|
4031
|
+
})
|
|
4032
|
+
));
|
|
4033
|
+
}
|
|
3981
4034
|
async handleFileImport(t) {
|
|
3982
4035
|
const i = Array.from(t).filter((s) => {
|
|
3983
4036
|
const r = s.name.toLowerCase(), o = r.endsWith(".ics") || r.endsWith(".ical"), a = s.type === "text/calendar" || s.type === "text/plain" || s.type === "";
|
|
3984
4037
|
return o && a && s.size <= 10485760;
|
|
3985
4038
|
});
|
|
3986
4039
|
if (i.length === 0) {
|
|
3987
|
-
|
|
4040
|
+
Yt("No valid .ics files found");
|
|
3988
4041
|
return;
|
|
3989
4042
|
}
|
|
3990
4043
|
for (const s of i)
|
|
@@ -3997,7 +4050,7 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
3997
4050
|
})
|
|
3998
4051
|
);
|
|
3999
4052
|
} catch (r) {
|
|
4000
|
-
console.error(`Failed to read ${s.name}:`, r),
|
|
4053
|
+
console.error(`Failed to read ${s.name}:`, r), Yt(`Failed to read ${s.name}: ${r.message}`);
|
|
4001
4054
|
}
|
|
4002
4055
|
}
|
|
4003
4056
|
readFileAsText(t) {
|
|
@@ -4065,74 +4118,81 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4065
4118
|
*/
|
|
4066
4119
|
handleSelectionComplete() {
|
|
4067
4120
|
if (!this.selection || !this.scrollContainer) return;
|
|
4068
|
-
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 -
|
|
4121
|
+
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 - z) / this._columnsPerRow, l = Math.max(
|
|
4069
4122
|
0,
|
|
4070
|
-
Math.min(
|
|
4123
|
+
Math.min(this._columnsPerRow - 1, Math.floor((t - z) / a))
|
|
4071
4124
|
), c = Math.max(
|
|
4072
4125
|
0,
|
|
4073
|
-
Math.min(
|
|
4074
|
-
),
|
|
4075
|
-
(
|
|
4126
|
+
Math.min(this._columnsPerRow - 1, Math.floor((e - z) / a))
|
|
4127
|
+
), d = this.weeks.filter(
|
|
4128
|
+
(g) => g.height > 0 && g.yOffset < s && g.yOffset + g.height > i
|
|
4076
4129
|
);
|
|
4077
|
-
if (
|
|
4078
|
-
const
|
|
4130
|
+
if (d.length === 0) return;
|
|
4131
|
+
const h = [];
|
|
4079
4132
|
if (this.dayHeight >= 200)
|
|
4080
|
-
for (const
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
w.
|
|
4089
|
-
|
|
4090
|
-
|
|
4133
|
+
for (const g of d)
|
|
4134
|
+
for (let v = 0; v < 7; v++) {
|
|
4135
|
+
const y = g.days[v];
|
|
4136
|
+
if (!y) continue;
|
|
4137
|
+
const { row: A, col: P } = this.getDayVisualPosition(v);
|
|
4138
|
+
if (P < l || P > c) continue;
|
|
4139
|
+
const C = g.yOffset + A * this.dayHeight, x = C + this.dayHeight;
|
|
4140
|
+
if (s < C || i > x) continue;
|
|
4141
|
+
const M = Math.max(i, C), w = Math.min(s, x), S = M - C, O = Math.floor(
|
|
4142
|
+
S / this.dayHeight * 24 * 60
|
|
4143
|
+
), $ = Math.floor(O / 60), b = O % 60, E = w - C, T = Math.ceil(E / this.dayHeight * 24 * 60), D = Math.floor(T / 60), N = T % 60, L = new Date(y);
|
|
4144
|
+
L.setHours($, b, 0, 0);
|
|
4145
|
+
const R = new Date(y);
|
|
4146
|
+
R.setHours(D, N, 59, 999), h.push({ start: L, end: R });
|
|
4091
4147
|
}
|
|
4092
|
-
}
|
|
4093
4148
|
else
|
|
4094
|
-
for (const
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4149
|
+
for (const g of d)
|
|
4150
|
+
for (let v = 0; v < 7; v++) {
|
|
4151
|
+
const y = g.days[v];
|
|
4152
|
+
if (!y) continue;
|
|
4153
|
+
const { row: A, col: P } = this.getDayVisualPosition(v);
|
|
4154
|
+
if (P < l || P > c) continue;
|
|
4155
|
+
const C = g.yOffset + A * this.dayHeight, x = C + this.dayHeight;
|
|
4156
|
+
if (s < C || i > x) continue;
|
|
4157
|
+
const M = new Date(y);
|
|
4158
|
+
M.setHours(0, 0, 0, 0);
|
|
4159
|
+
const w = new Date(y);
|
|
4160
|
+
w.setHours(23, 59, 59, 999), h.push({ start: M, end: w });
|
|
4161
|
+
}
|
|
4102
4162
|
const f = /* @__PURE__ */ new Set();
|
|
4103
|
-
for (const
|
|
4104
|
-
if (
|
|
4105
|
-
const
|
|
4106
|
-
for (const
|
|
4107
|
-
const
|
|
4108
|
-
if (!(
|
|
4109
|
-
f.add(
|
|
4163
|
+
for (const g of this.events) {
|
|
4164
|
+
if (g.isAllDay) continue;
|
|
4165
|
+
const v = g.start.getTime(), y = g.end.getTime();
|
|
4166
|
+
for (const A of h) {
|
|
4167
|
+
const P = A.start.getTime(), C = A.end.getTime();
|
|
4168
|
+
if (!(y < P || v > C)) {
|
|
4169
|
+
f.add(g);
|
|
4110
4170
|
break;
|
|
4111
4171
|
}
|
|
4112
4172
|
}
|
|
4113
4173
|
}
|
|
4114
|
-
const
|
|
4174
|
+
const p = Array.from(f);
|
|
4115
4175
|
this.selectionModifierKey || (this.internal.clearSelection(), this.selectedEventForDetail = null, this.selectedEventRect = null);
|
|
4116
|
-
for (const
|
|
4117
|
-
this.internal.selectEvent(
|
|
4176
|
+
for (const g of p)
|
|
4177
|
+
this.internal.selectEvent(g, "add");
|
|
4118
4178
|
this.requestUpdate(), this.dispatchEvent(
|
|
4119
4179
|
new CustomEvent("selection-change", {
|
|
4120
|
-
detail: { selectedEvents:
|
|
4180
|
+
detail: { selectedEvents: p },
|
|
4121
4181
|
bubbles: !0
|
|
4122
4182
|
})
|
|
4123
4183
|
), this.dispatchEvent(
|
|
4124
4184
|
new CustomEvent("selection", {
|
|
4125
4185
|
detail: {
|
|
4126
|
-
timeRanges:
|
|
4127
|
-
start:
|
|
4128
|
-
end:
|
|
4186
|
+
timeRanges: h,
|
|
4187
|
+
start: h[0]?.start,
|
|
4188
|
+
end: h[h.length - 1]?.end
|
|
4129
4189
|
},
|
|
4130
4190
|
bubbles: !0
|
|
4131
4191
|
})
|
|
4132
4192
|
), this.renderCanvas();
|
|
4133
4193
|
}
|
|
4134
4194
|
renderEvents() {
|
|
4135
|
-
return
|
|
4195
|
+
return _``;
|
|
4136
4196
|
}
|
|
4137
4197
|
checkAndExtendRange() {
|
|
4138
4198
|
if (this.isExtendingRange || this.filter) return;
|
|
@@ -4279,7 +4339,7 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4279
4339
|
this.movingEventEnd.y
|
|
4280
4340
|
);
|
|
4281
4341
|
} else {
|
|
4282
|
-
const a =
|
|
4342
|
+
const a = Ie(this.movingEvent.color || "#888888");
|
|
4283
4343
|
this.renderVirtualEvent(
|
|
4284
4344
|
r,
|
|
4285
4345
|
o,
|
|
@@ -4317,7 +4377,7 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4317
4377
|
i.setMinutes(Math.round(i.getMinutes() / 15) * 15, 0, 0), s.setMinutes(Math.round(s.getMinutes() / 15) * 15, 0, 0);
|
|
4318
4378
|
let r, o;
|
|
4319
4379
|
if (this.activeCalendarColor) {
|
|
4320
|
-
const a =
|
|
4380
|
+
const a = Ie(this.activeCalendarColor);
|
|
4321
4381
|
r = `rgba(${a[0]}, ${a[1]}, ${a[2]}, 0.3)`, o = `rgba(${a[0]}, ${a[1]}, ${a[2]}, 0.8)`;
|
|
4322
4382
|
} else {
|
|
4323
4383
|
const a = getComputedStyle(this).getPropertyValue("--accent-primary").trim() || "rgb(100, 150, 255)";
|
|
@@ -4337,65 +4397,71 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4337
4397
|
renderVirtualEvent(t, e, i, s) {
|
|
4338
4398
|
if (!this.overlayCanvas || !this.overlayCtx || !this.scrollContainer)
|
|
4339
4399
|
return;
|
|
4340
|
-
const r = this.overlayCtx, o = getComputedStyle(this).fontFamily, c = (this.scrollContainer.getBoundingClientRect().width -
|
|
4341
|
-
const
|
|
4342
|
-
(
|
|
4400
|
+
const r = this.overlayCtx, o = getComputedStyle(this).fontFamily, c = (this.scrollContainer.getBoundingClientRect().width - z - Yi) / this._columnsPerRow, d = (S, O, $) => {
|
|
4401
|
+
const b = this.weeks.find(
|
|
4402
|
+
(L) => L.days.some((R) => R.toDateString() === S.toDateString())
|
|
4343
4403
|
);
|
|
4344
|
-
if (!
|
|
4345
|
-
const
|
|
4346
|
-
|
|
4347
|
-
}, d = (E) => {
|
|
4348
|
-
const M = this.weeks.find(
|
|
4349
|
-
(y) => y.days.some((w) => w.toDateString() === E.toDateString())
|
|
4404
|
+
if (!b) return null;
|
|
4405
|
+
const E = b.days.findIndex(
|
|
4406
|
+
(L) => L.toDateString() === S.toDateString()
|
|
4350
4407
|
);
|
|
4351
|
-
if (
|
|
4352
|
-
const
|
|
4353
|
-
|
|
4408
|
+
if (E < 0) return null;
|
|
4409
|
+
const { row: T } = this.getDayVisualPosition(E), D = O * 60 + $;
|
|
4410
|
+
return b.yOffset + T * this.dayHeight + D / 1440 * this.dayHeight - this.scrollTop;
|
|
4411
|
+
}, h = (S) => {
|
|
4412
|
+
const O = this.weeks.find(
|
|
4413
|
+
(E) => E.days.some((T) => T.toDateString() === S.toDateString())
|
|
4354
4414
|
);
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4415
|
+
if (!O) return null;
|
|
4416
|
+
const $ = O.days.findIndex(
|
|
4417
|
+
(E) => E.toDateString() === S.toDateString()
|
|
4418
|
+
);
|
|
4419
|
+
if ($ < 0) return null;
|
|
4420
|
+
const { col: b } = this.getDayVisualPosition($);
|
|
4421
|
+
return b * c;
|
|
4422
|
+
}, u = (S, O, $) => {
|
|
4423
|
+
const b = S + 2, E = c - 4, T = Math.max(4, $ - O);
|
|
4424
|
+
r.fillStyle = i.fill, r.beginPath(), r.roundRect(b, O, E, T, 4), r.fill(), r.strokeStyle = i.stroke, r.lineWidth = 1, r.setLineDash([6, 3]), r.stroke(), r.setLineDash([]);
|
|
4359
4425
|
}, f = t.toDateString() === e.toDateString();
|
|
4360
4426
|
if (f) {
|
|
4361
|
-
const
|
|
4362
|
-
|
|
4427
|
+
const S = h(t), O = d(t, t.getHours(), t.getMinutes()), $ = d(e, e.getHours(), e.getMinutes());
|
|
4428
|
+
S != null && O != null && $ != null && u(S, O, $);
|
|
4363
4429
|
} else {
|
|
4364
|
-
const
|
|
4365
|
-
|
|
4366
|
-
const
|
|
4367
|
-
for (
|
|
4368
|
-
const
|
|
4369
|
-
if (
|
|
4370
|
-
const
|
|
4371
|
-
let
|
|
4372
|
-
|
|
4430
|
+
const S = new Date(t);
|
|
4431
|
+
S.setHours(0, 0, 0, 0);
|
|
4432
|
+
const O = new Date(e);
|
|
4433
|
+
for (O.setHours(23, 59, 59, 999); S <= O; ) {
|
|
4434
|
+
const $ = h(S);
|
|
4435
|
+
if ($ != null) {
|
|
4436
|
+
const b = S.toDateString() === t.toDateString(), E = S.toDateString() === e.toDateString();
|
|
4437
|
+
let T, D;
|
|
4438
|
+
b ? (T = d(S, t.getHours(), t.getMinutes()), D = d(S, 23, 59)) : E ? (T = d(S, 0, 0), D = d(S, e.getHours(), e.getMinutes())) : (T = d(S, 0, 0), D = d(S, 23, 59)), T != null && D != null && u($, T, D);
|
|
4373
4439
|
}
|
|
4374
|
-
|
|
4440
|
+
S.setDate(S.getDate() + 1);
|
|
4375
4441
|
}
|
|
4376
4442
|
}
|
|
4377
|
-
const
|
|
4378
|
-
if (
|
|
4443
|
+
const p = (S) => `${S.getHours().toString().padStart(2, "0")}:${S.getMinutes().toString().padStart(2, "0")}`, g = (S) => `${S.getDate()}.${S.getMonth() + 1}`, v = f ? `${p(t)} – ${p(e)}` : `${g(t)} ${p(t)} – ${g(e)} ${p(e)}`, P = Math.abs(e.getTime() - t.getTime()) / (1e3 * 60) < 15, C = h(t), x = h(e), M = d(t, t.getHours(), t.getMinutes()), w = d(e, e.getHours(), e.getMinutes());
|
|
4444
|
+
if (C != null && x != null && M != null && w != null) {
|
|
4379
4445
|
r.font = `600 11px ${o}`, r.fillStyle = i.text, r.textAlign = "left";
|
|
4380
|
-
let
|
|
4446
|
+
let S = !0;
|
|
4381
4447
|
if (s !== void 0) {
|
|
4382
|
-
const
|
|
4383
|
-
|
|
4448
|
+
const $ = s - this.scrollTop, b = Math.abs($ - M), E = Math.abs($ - w);
|
|
4449
|
+
S = b < E;
|
|
4384
4450
|
}
|
|
4385
|
-
const
|
|
4386
|
-
if (
|
|
4387
|
-
const
|
|
4388
|
-
r.fillStyle =
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4451
|
+
const O = S ? C : x;
|
|
4452
|
+
if (P) {
|
|
4453
|
+
const $ = S ? M : w, b = $ + 6, E = $ + 10, T = r.measureText(v).width, D = 6, N = getComputedStyle(this).getPropertyValue("--bg-elevated").trim() || "rgba(0, 0, 0, 0.8)";
|
|
4454
|
+
r.fillStyle = N, r.beginPath(), r.roundRect(
|
|
4455
|
+
O + 4,
|
|
4456
|
+
b,
|
|
4457
|
+
T + D * 2,
|
|
4392
4458
|
16,
|
|
4393
4459
|
4
|
|
4394
|
-
), r.fill(), r.fillStyle = "white", r.textBaseline = "top", r.fillText(
|
|
4460
|
+
), r.fill(), r.fillStyle = "white", r.textBaseline = "top", r.fillText(v, O + 4 + D, E);
|
|
4395
4461
|
} else {
|
|
4396
4462
|
r.textBaseline = "top";
|
|
4397
|
-
const
|
|
4398
|
-
r.fillText(
|
|
4463
|
+
const $ = S ? M + 4 : w - 18;
|
|
4464
|
+
r.fillText(v, O + 8, $);
|
|
4399
4465
|
}
|
|
4400
4466
|
}
|
|
4401
4467
|
}
|
|
@@ -4404,7 +4470,7 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4404
4470
|
return;
|
|
4405
4471
|
const t = this.overlayCtx, e = this.overlayCanvas.width / (window.devicePixelRatio || 1), i = this.overlayCanvas.height / (window.devicePixelRatio || 1);
|
|
4406
4472
|
t.clearRect(0, 0, e, i);
|
|
4407
|
-
const s = e /
|
|
4473
|
+
const s = e / this._columnsPerRow, r = this.scrollTop, o = getComputedStyle(this).fontFamily;
|
|
4408
4474
|
t.font = `600 10px ${o}`;
|
|
4409
4475
|
const a = getComputedStyle(this).getPropertyValue("--text-secondary").trim() || "rgba(255, 255, 255, 0.6)";
|
|
4410
4476
|
t.fillStyle = a, t.textAlign = "right", t.textBaseline = "top";
|
|
@@ -4412,30 +4478,57 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4412
4478
|
if (l.height !== 0 && !(l.yOffset + l.height < r)) {
|
|
4413
4479
|
if (l.yOffset > r + this.viewportHeight) break;
|
|
4414
4480
|
for (let c = 0; c < 7; c++) {
|
|
4415
|
-
const
|
|
4416
|
-
if (!
|
|
4417
|
-
const
|
|
4481
|
+
const d = l.days[c];
|
|
4482
|
+
if (!d) continue;
|
|
4483
|
+
const { row: h, col: u } = this.getDayVisualPosition(c), f = u * s, p = l.yOffset + h * this.dayHeight - r, g = p + this.dayHeight;
|
|
4418
4484
|
if (c === 5 || c === 6) {
|
|
4419
|
-
const
|
|
4420
|
-
t.fillStyle =
|
|
4485
|
+
const x = getComputedStyle(this).getPropertyValue("--bg-weekend").trim() || "rgba(255, 255, 255, 0.03)";
|
|
4486
|
+
t.fillStyle = x, t.fillRect(f, p, s, this.dayHeight);
|
|
4421
4487
|
}
|
|
4422
|
-
const v = this.dayHeight >= 300,
|
|
4423
|
-
if (!v &&
|
|
4424
|
-
const
|
|
4425
|
-
t.strokeStyle =
|
|
4488
|
+
const v = this.dayHeight >= 300, y = /* @__PURE__ */ new Date();
|
|
4489
|
+
if (!v && U.isSameDay(d, y)) {
|
|
4490
|
+
const x = getComputedStyle(this).getPropertyValue("--accent-current-time").trim() || "rgba(255, 0, 0, 0.8)";
|
|
4491
|
+
t.strokeStyle = x, t.lineWidth = 1, t.strokeRect(f + 1, p + 1, s - 2, this.dayHeight - 2), t.lineWidth = 1;
|
|
4426
4492
|
}
|
|
4427
|
-
const
|
|
4428
|
-
|
|
4429
|
-
i -
|
|
4493
|
+
const A = 12, C = Math.min(
|
|
4494
|
+
g - A - 8,
|
|
4495
|
+
i - A - 64
|
|
4430
4496
|
);
|
|
4431
|
-
|
|
4497
|
+
p < i && g > 0 && C > p && (t.fillStyle = a, t.fillText(d.getDate().toString(), f + s - 12, C));
|
|
4432
4498
|
}
|
|
4433
4499
|
}
|
|
4434
4500
|
}
|
|
4501
|
+
renderWeekdayLabels(t, e, i, s, r) {
|
|
4502
|
+
if (i.length === 0) return;
|
|
4503
|
+
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)";
|
|
4504
|
+
t.font = `500 12px ${a}`, t.textAlign = "center", t.textBaseline = "top";
|
|
4505
|
+
const d = 16, h = 12, u = i[0];
|
|
4506
|
+
if (u)
|
|
4507
|
+
for (let f = 0; f < this.rowsPerWeek; f++) {
|
|
4508
|
+
const p = u.yOffset + f * this.dayHeight - s, g = p + this.dayHeight;
|
|
4509
|
+
if (g < 0 || p > r) continue;
|
|
4510
|
+
const v = Math.min(h, g - d - 2);
|
|
4511
|
+
if (!(v < 0))
|
|
4512
|
+
for (let y = 0; y < this._columnsPerRow; y++) {
|
|
4513
|
+
const A = f * this._columnsPerRow + y;
|
|
4514
|
+
if (A >= 7) continue;
|
|
4515
|
+
const P = o[A];
|
|
4516
|
+
if (!P) continue;
|
|
4517
|
+
const C = z + y * e + e / 2, x = t.measureText(P).width, M = 6, w = 2;
|
|
4518
|
+
t.fillStyle = c, t.beginPath(), t.roundRect(
|
|
4519
|
+
C - x / 2 - M,
|
|
4520
|
+
v,
|
|
4521
|
+
x + M * 2,
|
|
4522
|
+
d,
|
|
4523
|
+
4
|
|
4524
|
+
), t.fill(), t.fillStyle = l, t.fillText(P, C, v + w + 1);
|
|
4525
|
+
}
|
|
4526
|
+
}
|
|
4527
|
+
}
|
|
4435
4528
|
renderSelection() {
|
|
4436
|
-
if (!this.selection) return
|
|
4529
|
+
if (!this.selection) return _``;
|
|
4437
4530
|
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);
|
|
4438
|
-
return
|
|
4531
|
+
return _`
|
|
4439
4532
|
<div
|
|
4440
4533
|
class="selection"
|
|
4441
4534
|
style="
|
|
@@ -4453,28 +4546,28 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4453
4546
|
this.minimapBufferCanvas.width = t, this.minimapBufferCanvas.height = e, i.clearRect(0, 0, t, e);
|
|
4454
4547
|
const s = this.events, r = this.weeks[0].days[0].getTime(), o = 10080 * 60 * 1e3, a = 1440 * 60 * 1e3, l = 60 * 1e3;
|
|
4455
4548
|
for (const c of s) {
|
|
4456
|
-
const
|
|
4457
|
-
(h - r) / o
|
|
4458
|
-
), f = Math.floor(
|
|
4549
|
+
const d = c.start.getTime(), h = c.end.getTime(), u = Math.floor(
|
|
4459
4550
|
(d - r) / o
|
|
4460
|
-
),
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
const
|
|
4465
|
-
if (!
|
|
4466
|
-
const
|
|
4467
|
-
|
|
4468
|
-
), M = Math.floor(
|
|
4469
|
-
|
|
4470
|
-
),
|
|
4471
|
-
|
|
4551
|
+
), f = Math.floor(
|
|
4552
|
+
(h - r) / o
|
|
4553
|
+
), p = Math.max(0, u), g = Math.min(this.weeks.length - 1, f);
|
|
4554
|
+
for (let v = p; v <= g; v++) {
|
|
4555
|
+
const y = this.weeks[v];
|
|
4556
|
+
if (!y || y.height === 0) continue;
|
|
4557
|
+
const A = y.days[0], P = y.days[6];
|
|
4558
|
+
if (!A || !P) continue;
|
|
4559
|
+
const C = A.getTime(), x = P.getTime() + a - 1, M = Math.max(d, C), w = Math.min(h, x), S = Math.floor(
|
|
4560
|
+
M % a / l
|
|
4561
|
+
), O = Math.floor(
|
|
4562
|
+
w % a / l
|
|
4563
|
+
), $ = y.yOffset / this.totalHeight * e + S / 1440 * (y.height / this.totalHeight * e), b = y.yOffset / this.totalHeight * e + O / 1440 * (y.height / this.totalHeight * e);
|
|
4564
|
+
i.globalAlpha = c.readOnly ? 0.333 * 0.5 : 0.333, i.fillStyle = c.color || "#888", i.fillRect(2, $, t - 4, Math.max(b - $, 2));
|
|
4472
4565
|
}
|
|
4473
4566
|
}
|
|
4474
4567
|
}
|
|
4475
4568
|
renderMinimap() {
|
|
4476
|
-
if (this.totalHeight === 0 || this.weeks.length === 0) return
|
|
4477
|
-
if (!this.minimapBufferCanvas) return
|
|
4569
|
+
if (this.totalHeight === 0 || this.weeks.length === 0) return _``;
|
|
4570
|
+
if (!this.minimapBufferCanvas) return _``;
|
|
4478
4571
|
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");
|
|
4479
4572
|
if (o.width = t, o.height = e, !a) throw new Error("Failed to get 2d context");
|
|
4480
4573
|
a.drawImage(this.minimapBufferCanvas, 0, 0), getComputedStyle(this).getPropertyValue("--grid-color").trim();
|
|
@@ -4523,36 +4616,38 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4523
4616
|
*/
|
|
4524
4617
|
convertPositionToDateTime(t, e, i) {
|
|
4525
4618
|
if (!this.scrollContainer) return null;
|
|
4526
|
-
const o = (this.scrollContainer.getBoundingClientRect().width -
|
|
4527
|
-
if (t <
|
|
4619
|
+
const o = (this.scrollContainer.getBoundingClientRect().width - z) / this._columnsPerRow;
|
|
4620
|
+
if (t < z) return null;
|
|
4528
4621
|
const a = Math.max(
|
|
4529
4622
|
0,
|
|
4530
|
-
Math.min(
|
|
4623
|
+
Math.min(this._columnsPerRow - 1, Math.floor((t - z) / o))
|
|
4531
4624
|
), l = this.weeks.find(
|
|
4532
|
-
(
|
|
4625
|
+
(g) => g.height > 0 && g.yOffset <= e && g.yOffset + g.height > e
|
|
4533
4626
|
);
|
|
4534
4627
|
if (!l) return null;
|
|
4535
|
-
const c = l.
|
|
4536
|
-
if (
|
|
4537
|
-
|
|
4628
|
+
const c = Math.floor((e - l.yOffset) / this.dayHeight), d = c * this._columnsPerRow + a;
|
|
4629
|
+
if (d < 0 || d > 6) return null;
|
|
4630
|
+
const h = l.days[d];
|
|
4631
|
+
if (!h) return null;
|
|
4632
|
+
let u = 0, f = 0;
|
|
4538
4633
|
if (this.dayHeight >= 200) {
|
|
4539
|
-
const
|
|
4540
|
-
|
|
4634
|
+
const g = e - (l.yOffset + c * this.dayHeight), v = Math.floor(g / this.dayHeight * 24 * 60);
|
|
4635
|
+
u = Math.floor(v / 60), f = v % 60;
|
|
4541
4636
|
} else
|
|
4542
|
-
|
|
4543
|
-
const
|
|
4544
|
-
return
|
|
4637
|
+
u = 12;
|
|
4638
|
+
const p = new Date(h);
|
|
4639
|
+
return p.setHours(u, f, 0, 0), p;
|
|
4545
4640
|
}
|
|
4546
4641
|
convertDateTimeToPosition(t) {
|
|
4547
4642
|
if (!this.scrollContainer) return null;
|
|
4548
|
-
const s = (this.scrollContainer.getBoundingClientRect().width -
|
|
4549
|
-
(v) => v.days.some((
|
|
4643
|
+
const s = (this.scrollContainer.getBoundingClientRect().width - z) / this._columnsPerRow, r = t.toDateString(), o = this.weeks.find(
|
|
4644
|
+
(v) => v.days.some((y) => y.toDateString() === r)
|
|
4550
4645
|
);
|
|
4551
4646
|
if (!o) return null;
|
|
4552
4647
|
const a = o.days.findIndex((v) => v.toDateString() === r);
|
|
4553
4648
|
if (a === -1) return null;
|
|
4554
|
-
const l =
|
|
4555
|
-
return { x:
|
|
4649
|
+
const { row: l, col: c } = this.getDayVisualPosition(a), d = z + c * s + s / 2, h = t.getHours(), u = t.getMinutes(), p = (h * 60 + u) / 1440 * this.dayHeight, g = o.yOffset + l * this.dayHeight + p;
|
|
4650
|
+
return { x: d, y: g };
|
|
4556
4651
|
}
|
|
4557
4652
|
getCursorTime() {
|
|
4558
4653
|
if (!this.cursorPosition) return null;
|
|
@@ -4610,7 +4705,7 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4610
4705
|
), this.selectedEventForDetail = null, this.selectedEventRect = null, this.requestUpdate();
|
|
4611
4706
|
}
|
|
4612
4707
|
renderNotificationsList(t) {
|
|
4613
|
-
return t.reminders?.length ? t.reminders.map((e) =>
|
|
4708
|
+
return t.reminders?.length ? t.reminders.map((e) => _`
|
|
4614
4709
|
<div class="notification-item">
|
|
4615
4710
|
<select
|
|
4616
4711
|
class="notification-select"
|
|
@@ -4620,14 +4715,14 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4620
4715
|
this.updateNotification(t, e.id, { triggerOffset: s });
|
|
4621
4716
|
}}
|
|
4622
4717
|
>
|
|
4623
|
-
${
|
|
4718
|
+
${As.map((i) => _`<option value="${i.value}" ?selected=${i.value === e.triggerOffset}>${i.label}</option>`)}
|
|
4624
4719
|
</select>
|
|
4625
4720
|
<button
|
|
4626
4721
|
class="notification-remove-button"
|
|
4627
4722
|
@click=${() => this.removeNotification(t, e.id)}
|
|
4628
4723
|
>×</button>
|
|
4629
4724
|
</div>
|
|
4630
|
-
`) :
|
|
4725
|
+
`) : _`<div class="notification-empty-state">No notifications set</div>`;
|
|
4631
4726
|
}
|
|
4632
4727
|
addNotification(t) {
|
|
4633
4728
|
const e = {
|
|
@@ -4679,66 +4774,66 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4679
4774
|
renderEventDetail() {
|
|
4680
4775
|
if (!this.selectedEventForDetail || !this.selectedEventRect)
|
|
4681
4776
|
return null;
|
|
4682
|
-
const t = this.selectedEventForDetail, e = (
|
|
4777
|
+
const t = this.selectedEventForDetail, e = (x) => new Intl.DateTimeFormat(this.locale, {
|
|
4683
4778
|
weekday: "short",
|
|
4684
4779
|
year: "numeric",
|
|
4685
4780
|
month: "short",
|
|
4686
4781
|
day: "numeric"
|
|
4687
|
-
}).format(
|
|
4782
|
+
}).format(x), i = (x) => new Intl.DateTimeFormat(this.locale, {
|
|
4688
4783
|
hour: "numeric",
|
|
4689
4784
|
minute: "2-digit"
|
|
4690
|
-
}).format(
|
|
4691
|
-
return
|
|
4692
|
-
<div class="event-detail-overlay" style="${
|
|
4785
|
+
}).format(x), s = U.isSameDay(t.start, t.end), r = 320, o = 550, a = 8, l = this.scrollContainer?.clientWidth || 800, c = this.scrollContainer?.clientHeight || 600, d = this.selectedEventRect.x + this.selectedEventRect.width + a, h = this.selectedEventRect.x - r - a, u = d + r <= l ? d : h, f = z + a, p = l - r - a, g = Math.max(f, Math.min(p, u)), v = this.selectedEventRect.y - this.scrollTop, y = a, A = c - o - a, P = Math.max(y, Math.min(A, v)), C = `left: ${g}px; top: ${P}px; --calendar-color: ${t.color || "#888888"};`;
|
|
4786
|
+
return _`
|
|
4787
|
+
<div class="event-detail-overlay" style="${C}">
|
|
4693
4788
|
<div class="event-detail-color-bar" style="opacity: ${t.readOnly ? "0.5" : "1"}"></div>
|
|
4694
4789
|
|
|
4695
4790
|
<div class="event-detail-content">
|
|
4696
4791
|
<div class="event-detail-header">
|
|
4697
4792
|
<div class="event-detail-header-content">
|
|
4698
|
-
${t.calendar ?
|
|
4793
|
+
${t.calendar ? _`
|
|
4699
4794
|
<div class="event-detail-section event-detail-calendar">
|
|
4700
4795
|
<div class="event-detail-value">${t.calendar}</div>
|
|
4701
4796
|
</div>
|
|
4702
4797
|
` : null}
|
|
4703
|
-
${t.readOnly ?
|
|
4704
|
-
<h3 class="event-detail-title">${t.rrule ?
|
|
4705
|
-
` :
|
|
4798
|
+
${t.readOnly || t.organizer != null && !this.currentUserEmails.has(t.organizer.email) ? _`
|
|
4799
|
+
<h3 class="event-detail-title">${t.rrule ? _`<span style="opacity: 0.6">⟳</span> ` : ""}${t.title}</h3>
|
|
4800
|
+
` : _`
|
|
4706
4801
|
<textarea
|
|
4707
4802
|
class="event-detail-title-input"
|
|
4708
4803
|
.value=${t.title}
|
|
4709
4804
|
placeholder="Event title"
|
|
4710
|
-
@input=${(
|
|
4711
|
-
const
|
|
4712
|
-
|
|
4805
|
+
@input=${(x) => {
|
|
4806
|
+
const w = x.target.value;
|
|
4807
|
+
w !== t.title && (this.updateEventTimeout && clearTimeout(this.updateEventTimeout), this.updateEventTimeout = setTimeout(() => {
|
|
4713
4808
|
this.dispatchEvent(
|
|
4714
4809
|
new CustomEvent("update-event", {
|
|
4715
|
-
detail: { event: t, updates: { title:
|
|
4810
|
+
detail: { event: t, updates: { title: w } },
|
|
4716
4811
|
bubbles: !0,
|
|
4717
4812
|
composed: !0
|
|
4718
4813
|
})
|
|
4719
4814
|
), this.updateEventTimeout = null;
|
|
4720
4815
|
}, 500));
|
|
4721
4816
|
}}
|
|
4722
|
-
@keydown=${(
|
|
4723
|
-
if (
|
|
4817
|
+
@keydown=${(x) => {
|
|
4818
|
+
if (x.key === "Enter") {
|
|
4724
4819
|
this.updateEventTimeout && (clearTimeout(this.updateEventTimeout), this.updateEventTimeout = null);
|
|
4725
|
-
const
|
|
4726
|
-
|
|
4820
|
+
const M = x.target, w = M.value;
|
|
4821
|
+
w !== t.title && this.dispatchEvent(
|
|
4727
4822
|
new CustomEvent("update-event", {
|
|
4728
|
-
detail: { event: t, updates: { title:
|
|
4823
|
+
detail: { event: t, updates: { title: w } },
|
|
4729
4824
|
bubbles: !0,
|
|
4730
4825
|
composed: !0
|
|
4731
4826
|
})
|
|
4732
|
-
),
|
|
4827
|
+
), M.blur();
|
|
4733
4828
|
}
|
|
4734
4829
|
}}
|
|
4735
4830
|
/>
|
|
4736
4831
|
`}
|
|
4737
4832
|
<div class="event-detail-time">
|
|
4738
|
-
${s ?
|
|
4833
|
+
${s ? _`
|
|
4739
4834
|
<div>${e(t.start)}</div>
|
|
4740
4835
|
<div>${i(t.start)} – ${i(t.end)}</div>
|
|
4741
|
-
` :
|
|
4836
|
+
` : _`
|
|
4742
4837
|
<div>${e(t.start)}, ${i(t.start)}</div>
|
|
4743
4838
|
<div>${e(t.end)}, ${i(t.end)}</div>
|
|
4744
4839
|
`}
|
|
@@ -4753,14 +4848,14 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4753
4848
|
</div>
|
|
4754
4849
|
|
|
4755
4850
|
<div class="event-detail-body">
|
|
4756
|
-
${t.location ?
|
|
4851
|
+
${t.location ? _`
|
|
4757
4852
|
<div class="event-detail-section">
|
|
4758
4853
|
<div class="event-detail-label">Location</div>
|
|
4759
4854
|
<div class="event-detail-value">${t.location}</div>
|
|
4760
4855
|
</div>
|
|
4761
4856
|
` : null}
|
|
4762
4857
|
|
|
4763
|
-
${t.url ?
|
|
4858
|
+
${t.url ? _`
|
|
4764
4859
|
<div class="event-detail-section">
|
|
4765
4860
|
<div class="event-detail-label">URL</div>
|
|
4766
4861
|
<div class="event-detail-value">
|
|
@@ -4771,7 +4866,7 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4771
4866
|
</div>
|
|
4772
4867
|
` : null}
|
|
4773
4868
|
|
|
4774
|
-
${t.organizer ?
|
|
4869
|
+
${t.organizer ? _`
|
|
4775
4870
|
<div class="event-detail-section">
|
|
4776
4871
|
<div class="event-detail-label">Organizer</div>
|
|
4777
4872
|
<div class="event-detail-value">
|
|
@@ -4782,17 +4877,17 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4782
4877
|
|
|
4783
4878
|
${(() => {
|
|
4784
4879
|
if (!t.attendees || t.attendees.length === 0) return null;
|
|
4785
|
-
const
|
|
4786
|
-
return
|
|
4880
|
+
const x = this.findCurrentUserAttendee(t), M = x ? t.attendees.filter((w) => w !== x) : t.attendees;
|
|
4881
|
+
return M.length > 0 ? _`
|
|
4787
4882
|
<div class="event-detail-section">
|
|
4788
|
-
<div class="event-detail-label">Participants (${
|
|
4883
|
+
<div class="event-detail-label">Participants (${M.length})</div>
|
|
4789
4884
|
<div class="event-detail-value">
|
|
4790
|
-
${
|
|
4791
|
-
(
|
|
4885
|
+
${M.map(
|
|
4886
|
+
(w) => _`
|
|
4792
4887
|
<div style="margin-bottom: 4px">
|
|
4793
|
-
<span title=${
|
|
4794
|
-
${
|
|
4795
|
-
|
|
4888
|
+
<span title=${w.email}>${w.name || w.email}</span>
|
|
4889
|
+
${w.status ? _`<span style="opacity: 0.7"> - ${this.formatAttendeeStatus(
|
|
4890
|
+
w.status
|
|
4796
4891
|
)}</span>` : null}
|
|
4797
4892
|
</div>
|
|
4798
4893
|
`
|
|
@@ -4802,19 +4897,22 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4802
4897
|
` : null;
|
|
4803
4898
|
})()}
|
|
4804
4899
|
|
|
4805
|
-
${t.readOnly ? null :
|
|
4900
|
+
${t.readOnly ? null : _`
|
|
4806
4901
|
<div class="event-detail-section">
|
|
4807
|
-
<div class="event-detail-label">
|
|
4902
|
+
<div class="event-detail-label">
|
|
4903
|
+
<span>Notifications</span>
|
|
4904
|
+
|
|
4905
|
+
<button class="notification-add-button" title="Add notification" @click=${() => this.addNotification(t)}>
|
|
4906
|
+
+
|
|
4907
|
+
</button>
|
|
4908
|
+
</div>
|
|
4808
4909
|
<div class="event-notifications">
|
|
4809
4910
|
${this.renderNotificationsList(t)}
|
|
4810
|
-
<button class="notification-add-button" @click=${() => this.addNotification(t)}>
|
|
4811
|
-
+ Add notification
|
|
4812
|
-
</button>
|
|
4813
4911
|
</div>
|
|
4814
4912
|
</div>
|
|
4815
4913
|
`}
|
|
4816
4914
|
|
|
4817
|
-
${t.description ?
|
|
4915
|
+
${t.readOnly || t.organizer != null && !this.currentUserEmails.has(t.organizer.email) ? t.description ? _`
|
|
4818
4916
|
<div class="event-detail-section">
|
|
4819
4917
|
<div class="event-detail-label">Description</div>
|
|
4820
4918
|
<div class="event-detail-description ${this.isDescriptionExpanded ? "expanded" : ""}">
|
|
@@ -4825,7 +4923,7 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4825
4923
|
)}</pre>
|
|
4826
4924
|
</div>
|
|
4827
4925
|
${t.description.length > 300 || t.description.split(`
|
|
4828
|
-
`).length > 8 ?
|
|
4926
|
+
`).length > 8 ? _`
|
|
4829
4927
|
<button
|
|
4830
4928
|
class="description-see-more"
|
|
4831
4929
|
@click=${() => {
|
|
@@ -4836,34 +4934,66 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4836
4934
|
</button>
|
|
4837
4935
|
` : null}
|
|
4838
4936
|
</div>
|
|
4839
|
-
` : null
|
|
4937
|
+
` : null : _`
|
|
4938
|
+
<div class="event-detail-section">
|
|
4939
|
+
<div class="event-detail-label">Description</div>
|
|
4940
|
+
<textarea
|
|
4941
|
+
class="event-detail-description-input"
|
|
4942
|
+
.value=${t.description ?? ""}
|
|
4943
|
+
placeholder="Add description..."
|
|
4944
|
+
rows="3"
|
|
4945
|
+
@input=${(x) => {
|
|
4946
|
+
const w = x.target.value;
|
|
4947
|
+
this.updateEventTimeout && clearTimeout(this.updateEventTimeout), this.updateEventTimeout = setTimeout(() => {
|
|
4948
|
+
this.dispatchEvent(
|
|
4949
|
+
new CustomEvent("update-event", {
|
|
4950
|
+
detail: { event: t, updates: { description: w } },
|
|
4951
|
+
bubbles: !0,
|
|
4952
|
+
composed: !0
|
|
4953
|
+
})
|
|
4954
|
+
), this.updateEventTimeout = null;
|
|
4955
|
+
}, 500);
|
|
4956
|
+
}}
|
|
4957
|
+
@blur=${(x) => {
|
|
4958
|
+
const w = x.target.value;
|
|
4959
|
+
this.updateEventTimeout && (clearTimeout(this.updateEventTimeout), this.updateEventTimeout = null), w !== (t.description ?? "") && this.dispatchEvent(
|
|
4960
|
+
new CustomEvent("update-event", {
|
|
4961
|
+
detail: { event: t, updates: { description: w } },
|
|
4962
|
+
bubbles: !0,
|
|
4963
|
+
composed: !0
|
|
4964
|
+
})
|
|
4965
|
+
);
|
|
4966
|
+
}}
|
|
4967
|
+
/>
|
|
4968
|
+
</div>
|
|
4969
|
+
`}
|
|
4840
4970
|
</div>
|
|
4841
4971
|
|
|
4842
4972
|
${(() => {
|
|
4843
4973
|
if (!t.attendees || t.attendees.length === 0) return null;
|
|
4844
|
-
const
|
|
4845
|
-
return !
|
|
4974
|
+
const x = this.findCurrentUserAttendee(t);
|
|
4975
|
+
return !x || t.readOnly || t.organizer?.email === x.email ? null : _`
|
|
4846
4976
|
<div class="event-detail-footer">
|
|
4847
4977
|
<div class="invite-response-buttons">
|
|
4848
4978
|
<button
|
|
4849
|
-
class="invite-response-button ${
|
|
4850
|
-
@click=${() => this.updateAttendeeStatus(t,
|
|
4979
|
+
class="invite-response-button ${x.status === "ACCEPTED" ? "active" : ""}"
|
|
4980
|
+
@click=${() => this.updateAttendeeStatus(t, x, "ACCEPTED")}
|
|
4851
4981
|
>
|
|
4852
4982
|
Accept
|
|
4853
4983
|
</button>
|
|
4854
4984
|
<button
|
|
4855
|
-
class="invite-response-button ${
|
|
4985
|
+
class="invite-response-button ${x.status === "TENTATIVE" ? "active" : ""}"
|
|
4856
4986
|
@click=${() => this.updateAttendeeStatus(
|
|
4857
4987
|
t,
|
|
4858
|
-
|
|
4988
|
+
x,
|
|
4859
4989
|
"TENTATIVE"
|
|
4860
4990
|
)}
|
|
4861
4991
|
>
|
|
4862
4992
|
Maybe
|
|
4863
4993
|
</button>
|
|
4864
4994
|
<button
|
|
4865
|
-
class="invite-response-button ${
|
|
4866
|
-
@click=${() => this.updateAttendeeStatus(t,
|
|
4995
|
+
class="invite-response-button ${x.status === "DECLINED" ? "active" : ""}"
|
|
4996
|
+
@click=${() => this.updateAttendeeStatus(t, x, "DECLINED")}
|
|
4867
4997
|
>
|
|
4868
4998
|
Decline
|
|
4869
4999
|
</button>
|
|
@@ -4876,16 +5006,12 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4876
5006
|
`;
|
|
4877
5007
|
}
|
|
4878
5008
|
render() {
|
|
4879
|
-
return
|
|
5009
|
+
return _`
|
|
4880
5010
|
<div class="container ${this.isDraggingFile ? "dragging-file" : ""}">
|
|
4881
5011
|
<div class="toolbar">
|
|
4882
5012
|
<div class="toolbar-left">
|
|
4883
|
-
<
|
|
4884
|
-
|
|
4885
|
-
</button>
|
|
4886
|
-
<button class="toolbar-button" title="Upcoming Notifications" @click=${this.onNotificationPopoverToggle}>
|
|
4887
|
-
🔔
|
|
4888
|
-
</button>
|
|
5013
|
+
<slot name="toolbar-center"></slot>
|
|
5014
|
+
|
|
4889
5015
|
<button class="toolbar-button" title="Today" @click=${this.scrollToToday}>
|
|
4890
5016
|
Today
|
|
4891
5017
|
</button>
|
|
@@ -4896,12 +5022,11 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4896
5022
|
→
|
|
4897
5023
|
</button>
|
|
4898
5024
|
<div class="toolbar-zoom">
|
|
4899
|
-
<span class="toolbar-zoom-label">Zoom</span>
|
|
4900
5025
|
<input
|
|
4901
5026
|
type="range"
|
|
4902
5027
|
class="toolbar-zoom-slider"
|
|
4903
|
-
min="${
|
|
4904
|
-
max="${
|
|
5028
|
+
min="${qt}"
|
|
5029
|
+
max="${me}"
|
|
4905
5030
|
.value=${this.dayHeight}
|
|
4906
5031
|
@input=${this.onZoomSliderChange}
|
|
4907
5032
|
title="Adjust zoom level"
|
|
@@ -4916,8 +5041,8 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4916
5041
|
@change=${this.onThemeChange}
|
|
4917
5042
|
title="Select theme"
|
|
4918
5043
|
>
|
|
4919
|
-
${
|
|
4920
|
-
(t) =>
|
|
5044
|
+
${Ws.map(
|
|
5045
|
+
(t) => _`<option value="${t.name}">${t.label}</option>`
|
|
4921
5046
|
)}
|
|
4922
5047
|
</select>-->
|
|
4923
5048
|
<div class="toolbar-search">
|
|
@@ -4930,17 +5055,8 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4930
5055
|
@input=${this.onFilterInput}
|
|
4931
5056
|
/>
|
|
4932
5057
|
</div>
|
|
4933
|
-
|
|
4934
|
-
<slot name="toolbar-center"></slot>
|
|
4935
5058
|
</div>
|
|
4936
5059
|
</div>
|
|
4937
|
-
|
|
4938
|
-
<div class="header">
|
|
4939
|
-
<div class="header-gutter"></div>
|
|
4940
|
-
<div class="weekdays">
|
|
4941
|
-
${this.internal.getWeekdayNames().map((t) => O`<div class="weekday">${t}</div>`)}
|
|
4942
|
-
</div>
|
|
4943
|
-
</div>
|
|
4944
5060
|
|
|
4945
5061
|
<div class="body">
|
|
4946
5062
|
<div class="calendar-area">
|
|
@@ -4978,7 +5094,7 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4978
5094
|
hour: "numeric",
|
|
4979
5095
|
minute: "2-digit"
|
|
4980
5096
|
});
|
|
4981
|
-
return
|
|
5097
|
+
return _`
|
|
4982
5098
|
<div class="notification-popover-overlay" @click=${this.onNotificationPopoverToggle}></div>
|
|
4983
5099
|
<div class="notification-popover">
|
|
4984
5100
|
<div class="notification-popover-header">
|
|
@@ -4986,8 +5102,8 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4986
5102
|
<button class="notification-popover-close" @click=${this.onNotificationPopoverToggle}>×</button>
|
|
4987
5103
|
</div>
|
|
4988
5104
|
<div class="notification-popover-content">
|
|
4989
|
-
${this.scheduledNotifications.length === 0 ?
|
|
4990
|
-
(i) =>
|
|
5105
|
+
${this.scheduledNotifications.length === 0 ? _`<div class="notification-popover-empty">No scheduled notifications</div>` : this.scheduledNotifications.map(
|
|
5106
|
+
(i) => _`
|
|
4991
5107
|
<div class="notification-popover-item">
|
|
4992
5108
|
<div class="notification-popover-item-header">
|
|
4993
5109
|
<div class="notification-popover-item-title">${i.eventTitle}</div>
|
|
@@ -4995,7 +5111,7 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
4995
5111
|
</div>
|
|
4996
5112
|
<div class="notification-popover-item-details">
|
|
4997
5113
|
<div class="notification-popover-item-event-time">📅 ${e(i.eventStart)}</div>
|
|
4998
|
-
${i.eventLocation ?
|
|
5114
|
+
${i.eventLocation ? _`<div class="notification-popover-item-location">📍 ${i.eventLocation}</div>` : null}
|
|
4999
5115
|
</div>
|
|
5000
5116
|
</div>
|
|
5001
5117
|
`
|
|
@@ -5005,7 +5121,7 @@ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
|
|
|
5005
5121
|
`;
|
|
5006
5122
|
}
|
|
5007
5123
|
};
|
|
5008
|
-
|
|
5124
|
+
ni.styles = zi`
|
|
5009
5125
|
:host {
|
|
5010
5126
|
display: block;
|
|
5011
5127
|
position: relative;
|
|
@@ -5032,8 +5148,7 @@ ii.styles = zi`
|
|
|
5032
5148
|
display: var(--toolbar-display, flex);
|
|
5033
5149
|
align-items: center;
|
|
5034
5150
|
justify-content: space-between;
|
|
5035
|
-
|
|
5036
|
-
padding: 0 16px;
|
|
5151
|
+
padding: 8px 10px;
|
|
5037
5152
|
background: var(--bg-secondary, rgba(36, 36, 38, 0.5));
|
|
5038
5153
|
border: 1px solid var(--grid-color, rgba(255, 255, 255, 0.1));
|
|
5039
5154
|
flex-shrink: 0;
|
|
@@ -5078,7 +5193,7 @@ ii.styles = zi`
|
|
|
5078
5193
|
background: transparent;
|
|
5079
5194
|
border: 1px solid var(--grid-color, rgba(255, 255, 255, 0.1));
|
|
5080
5195
|
color: var(--text-primary, rgba(255, 255, 255, 0.9));
|
|
5081
|
-
padding:
|
|
5196
|
+
padding: 4px 8px;
|
|
5082
5197
|
border-radius: var(--border-radius-sm, 4px);
|
|
5083
5198
|
font-size: 13px;
|
|
5084
5199
|
line-height: 16px;
|
|
@@ -5120,7 +5235,7 @@ ii.styles = zi`
|
|
|
5120
5235
|
background: var(--bg-input, rgba(0, 0, 0, 0.3));
|
|
5121
5236
|
border: 1px solid var(--grid-color, rgba(255, 255, 255, 0.1));
|
|
5122
5237
|
color: var(--text-primary, rgba(255, 255, 255, 0.9));
|
|
5123
|
-
padding:
|
|
5238
|
+
padding: 4px 8px 4px 32px;
|
|
5124
5239
|
border-radius: var(--border-radius-sm, 4px);
|
|
5125
5240
|
font-size: 13px;
|
|
5126
5241
|
outline: none;
|
|
@@ -5143,12 +5258,6 @@ ii.styles = zi`
|
|
|
5143
5258
|
gap: 8px;
|
|
5144
5259
|
}
|
|
5145
5260
|
|
|
5146
|
-
.toolbar-zoom-label {
|
|
5147
|
-
color: var(--text-muted, rgba(255, 255, 255, 0.6));
|
|
5148
|
-
font-size: 13px;
|
|
5149
|
-
white-space: nowrap;
|
|
5150
|
-
}
|
|
5151
|
-
|
|
5152
5261
|
.toolbar-zoom-slider {
|
|
5153
5262
|
width: 100px;
|
|
5154
5263
|
height: 4px;
|
|
@@ -5189,38 +5298,6 @@ ii.styles = zi`
|
|
|
5189
5298
|
background: var(--text-primary, rgba(255, 255, 255, 1));
|
|
5190
5299
|
}
|
|
5191
5300
|
|
|
5192
|
-
.header {
|
|
5193
|
-
display: flex;
|
|
5194
|
-
height: 32px;
|
|
5195
|
-
flex-shrink: 0;
|
|
5196
|
-
padding-right: 1rem;
|
|
5197
|
-
}
|
|
5198
|
-
|
|
5199
|
-
.weekday:nth-child(7),
|
|
5200
|
-
.weekday:nth-child(6) {
|
|
5201
|
-
background: var(--bg-weekend, rgba(255, 255, 255, 0.03));
|
|
5202
|
-
}
|
|
5203
|
-
|
|
5204
|
-
.header-gutter {
|
|
5205
|
-
width: 60px;
|
|
5206
|
-
flex-shrink: 0;
|
|
5207
|
-
}
|
|
5208
|
-
|
|
5209
|
-
.weekdays {
|
|
5210
|
-
display: flex;
|
|
5211
|
-
flex: 1;
|
|
5212
|
-
}
|
|
5213
|
-
|
|
5214
|
-
.weekday {
|
|
5215
|
-
flex: 1;
|
|
5216
|
-
display: flex;
|
|
5217
|
-
align-items: center;
|
|
5218
|
-
justify-content: center;
|
|
5219
|
-
font-size: 12px;
|
|
5220
|
-
color: var(--text-muted, rgba(255, 255, 255, 0.4));
|
|
5221
|
-
text-transform: uppercase;
|
|
5222
|
-
}
|
|
5223
|
-
|
|
5224
5301
|
.body {
|
|
5225
5302
|
position: relative;
|
|
5226
5303
|
flex: 1;
|
|
@@ -5359,6 +5436,18 @@ ii.styles = zi`
|
|
|
5359
5436
|
resize: none;
|
|
5360
5437
|
}
|
|
5361
5438
|
|
|
5439
|
+
.event-detail-description-input {
|
|
5440
|
+
font-size: 14px;
|
|
5441
|
+
color: inherit;
|
|
5442
|
+
width: 100%;
|
|
5443
|
+
padding: 0.25rem;
|
|
5444
|
+
margin: -0.25rem;
|
|
5445
|
+
border: none;
|
|
5446
|
+
background: none;
|
|
5447
|
+
field-sizing: content;
|
|
5448
|
+
resize: none;
|
|
5449
|
+
}
|
|
5450
|
+
|
|
5362
5451
|
.event-detail-title-input:focus {
|
|
5363
5452
|
border-color: var(--input-border-focus, rgba(255, 255, 255, 0.3));
|
|
5364
5453
|
background: var(--input-bg-focus, rgba(0, 0, 0, 0.3));
|
|
@@ -5408,6 +5497,9 @@ ii.styles = zi`
|
|
|
5408
5497
|
text-transform: uppercase;
|
|
5409
5498
|
color: var(--text-muted, rgba(255, 255, 255, 0.4));
|
|
5410
5499
|
letter-spacing: 0.5px;
|
|
5500
|
+
display: flex;
|
|
5501
|
+
align-items: center;
|
|
5502
|
+
justify-content: space-between;
|
|
5411
5503
|
}
|
|
5412
5504
|
|
|
5413
5505
|
.event-detail-value {
|
|
@@ -5431,6 +5523,11 @@ ii.styles = zi`
|
|
|
5431
5523
|
.event-detail-link {
|
|
5432
5524
|
color: var(--accent-primary, rgb(100, 150, 255));
|
|
5433
5525
|
text-decoration: none;
|
|
5526
|
+
white-space: nowrap;
|
|
5527
|
+
overflow: hidden;
|
|
5528
|
+
text-overflow: ellipsis;
|
|
5529
|
+
width: 100%;
|
|
5530
|
+
display: block;
|
|
5434
5531
|
}
|
|
5435
5532
|
|
|
5436
5533
|
.event-detail-link:hover {
|
|
@@ -5513,10 +5610,10 @@ ii.styles = zi`
|
|
|
5513
5610
|
border: 1px solid var(--grid-color);
|
|
5514
5611
|
border-radius: 4px;
|
|
5515
5612
|
color: var(--text-primary);
|
|
5516
|
-
padding:
|
|
5613
|
+
padding: 4px 8px;
|
|
5614
|
+
margin: -4px 0;
|
|
5517
5615
|
font-size: 13px;
|
|
5518
5616
|
cursor: pointer;
|
|
5519
|
-
width: 100%;
|
|
5520
5617
|
}
|
|
5521
5618
|
|
|
5522
5619
|
.notification-add-button:hover {
|
|
@@ -5710,8 +5807,8 @@ ii.styles = zi`
|
|
|
5710
5807
|
background: var(--bg-drag-over, rgba(59, 130, 246, 0.05));
|
|
5711
5808
|
}
|
|
5712
5809
|
`;
|
|
5713
|
-
let
|
|
5714
|
-
function
|
|
5810
|
+
let Ni = ni;
|
|
5811
|
+
function Ui(n, t) {
|
|
5715
5812
|
const e = new Date(t).setHours(0, 0, 0, 0);
|
|
5716
5813
|
for (let s = 0; s < 7; s++) {
|
|
5717
5814
|
const r = n.days[s];
|
|
@@ -5721,7 +5818,7 @@ function Ni(n, t) {
|
|
|
5721
5818
|
const i = new Date(n.days[0]).setHours(0, 0, 0, 0);
|
|
5722
5819
|
return e < i ? 0 : 6;
|
|
5723
5820
|
}
|
|
5724
|
-
class
|
|
5821
|
+
class Vs {
|
|
5725
5822
|
constructor(t, e, i = "#3b82f6", s = !0) {
|
|
5726
5823
|
this.id = t, this.name = e, this.color = i, this.enabled = s, this.type = "in-memory", this.credentials = {}, this.events = /* @__PURE__ */ new Map();
|
|
5727
5824
|
}
|
|
@@ -5748,17 +5845,6 @@ class qs {
|
|
|
5748
5845
|
};
|
|
5749
5846
|
return this.events.set(t, s), s;
|
|
5750
5847
|
}
|
|
5751
|
-
async moveEvent(t, e, i) {
|
|
5752
|
-
const s = this.events.get(t);
|
|
5753
|
-
if (!s)
|
|
5754
|
-
throw new Error(`Event ${t} not found`);
|
|
5755
|
-
const r = {
|
|
5756
|
-
...s,
|
|
5757
|
-
start: e,
|
|
5758
|
-
end: i
|
|
5759
|
-
};
|
|
5760
|
-
return this.events.set(t, r), r;
|
|
5761
|
-
}
|
|
5762
5848
|
async deleteEvent(t) {
|
|
5763
5849
|
if (!this.events.delete(t))
|
|
5764
5850
|
throw new Error(`Event ${t} not found`);
|
|
@@ -5770,14 +5856,14 @@ class qs {
|
|
|
5770
5856
|
this.events.clear();
|
|
5771
5857
|
}
|
|
5772
5858
|
}
|
|
5773
|
-
const
|
|
5859
|
+
const De = class De {
|
|
5774
5860
|
// 5 minutes
|
|
5775
5861
|
constructor(t) {
|
|
5776
5862
|
this.internals = t;
|
|
5777
5863
|
}
|
|
5778
5864
|
async shouldSync(t) {
|
|
5779
5865
|
const e = await this.internals.storage.getSyncMetadata(t.id);
|
|
5780
|
-
return e ? Date.now() - e.lastSync.getTime() >=
|
|
5866
|
+
return e ? Date.now() - e.lastSync.getTime() >= De.SYNC_INTERVAL_MS : !0;
|
|
5781
5867
|
}
|
|
5782
5868
|
async sync(t, e) {
|
|
5783
5869
|
if (!t.enabled) return [];
|
|
@@ -5789,12 +5875,12 @@ const ke = class ke {
|
|
|
5789
5875
|
}), r;
|
|
5790
5876
|
}
|
|
5791
5877
|
};
|
|
5792
|
-
|
|
5793
|
-
let
|
|
5878
|
+
De.SYNC_INTERVAL_MS = 300 * 1e3;
|
|
5879
|
+
let Li = De;
|
|
5794
5880
|
export {
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5881
|
+
Li as CalendarIntegration,
|
|
5882
|
+
U as CalendarInternal,
|
|
5883
|
+
Ni as CalendarViewElement,
|
|
5884
|
+
Vs as InMemorySource,
|
|
5885
|
+
As as NOTIFICATION_PRESETS
|
|
5800
5886
|
};
|