@luckydye/calendar 1.1.0 → 1.1.2

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 CHANGED
@@ -1,15 +1,15 @@
1
- const me = globalThis, Be = me.ShadowRoot && (me.ShadyCSS === void 0 || me.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, qe = /* @__PURE__ */ Symbol(), ri = /* @__PURE__ */ new WeakMap();
2
- let Ui = class {
1
+ const ye = globalThis, qe = ye.ShadowRoot && (ye.ShadyCSS === void 0 || ye.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Ke = /* @__PURE__ */ Symbol(), oi = /* @__PURE__ */ new WeakMap();
2
+ let Li = class {
3
3
  constructor(t, e, i) {
4
- if (this._$cssResult$ = !0, i !== qe) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
4
+ if (this._$cssResult$ = !0, i !== Ke) 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 (Be && t === void 0) {
10
+ if (qe && t === void 0) {
11
11
  const i = e !== void 0 && e.length === 1;
12
- i && (t = ri.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && ri.set(e, t));
12
+ i && (t = oi.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && oi.set(e, t));
13
13
  }
14
14
  return t;
15
15
  }
@@ -17,28 +17,28 @@ let Ui = class {
17
17
  return this.cssText;
18
18
  }
19
19
  };
20
- const an = (n) => new Ui(typeof n == "string" ? n : n + "", void 0, qe), Li = (n, ...t) => {
20
+ const ln = (n) => new Li(typeof n == "string" ? n : n + "", void 0, Ke), 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 Ui(e, n, qe);
27
- }, ln = (n, t) => {
28
- if (Be) n.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
26
+ return new Li(e, n, Ke);
27
+ }, cn = (n, t) => {
28
+ if (qe) 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 = me.litNonce;
30
+ const i = document.createElement("style"), s = ye.litNonce;
31
31
  s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, n.appendChild(i);
32
32
  }
33
- }, oi = Be ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((t) => {
33
+ }, ai = qe ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((t) => {
34
34
  let e = "";
35
35
  for (const i of t.cssRules) e += i.cssText;
36
- return an(e);
36
+ return ln(e);
37
37
  })(n) : n;
38
- const { is: cn, defineProperty: hn, getOwnPropertyDescriptor: dn, getOwnPropertyNames: un, getOwnPropertySymbols: fn, getPrototypeOf: gn } = Object, ke = globalThis, ai = ke.trustedTypes, pn = ai ? ai.emptyScript : "", vn = ke.reactiveElementPolyfillSupport, ie = (n, t) => n, Ne = { toAttribute(n, t) {
38
+ const { is: hn, defineProperty: dn, getOwnPropertyDescriptor: un, getOwnPropertyNames: fn, getOwnPropertySymbols: pn, getPrototypeOf: gn } = Object, De = globalThis, li = De.trustedTypes, vn = li ? li.emptyScript : "", mn = De.reactiveElementPolyfillSupport, ne = (n, t) => n, He = { toAttribute(n, t) {
39
39
  switch (t) {
40
40
  case Boolean:
41
- n = n ? pn : null;
41
+ n = n ? vn : null;
42
42
  break;
43
43
  case Object:
44
44
  case Array:
@@ -63,23 +63,23 @@ const { is: cn, defineProperty: hn, getOwnPropertyDescriptor: dn, getOwnProperty
63
63
  }
64
64
  }
65
65
  return e;
66
- } }, zi = (n, t) => !cn(n, t), li = { attribute: !0, type: String, converter: Ne, reflect: !1, useDefault: !1, hasChanged: zi };
67
- Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), ke.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
68
- let Ft = class extends HTMLElement {
66
+ } }, Wi = (n, t) => !hn(n, t), ci = { attribute: !0, type: String, converter: He, reflect: !1, useDefault: !1, hasChanged: Wi };
67
+ Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), De.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
68
+ let Bt = 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 = li) {
75
+ static createProperty(t, e = ci) {
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 && hn(this.prototype, t, s);
78
+ s !== void 0 && dn(this.prototype, t, s);
79
79
  }
80
80
  }
81
81
  static getPropertyDescriptor(t, e, i) {
82
- const { get: s, set: r } = dn(this.prototype, t) ?? { get() {
82
+ const { get: s, set: r } = un(this.prototype, t) ?? { get() {
83
83
  return this[e];
84
84
  }, set(o) {
85
85
  this[e] = o;
@@ -90,17 +90,17 @@ let Ft = class extends HTMLElement {
90
90
  }, configurable: !0, enumerable: !0 };
91
91
  }
92
92
  static getPropertyOptions(t) {
93
- return this.elementProperties.get(t) ?? li;
93
+ return this.elementProperties.get(t) ?? ci;
94
94
  }
95
95
  static _$Ei() {
96
- if (this.hasOwnProperty(ie("elementProperties"))) return;
96
+ if (this.hasOwnProperty(ne("elementProperties"))) return;
97
97
  const t = gn(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(ie("finalized"))) return;
102
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(ie("properties"))) {
103
- const e = this.properties, i = [...un(e), ...fn(e)];
101
+ if (this.hasOwnProperty(ne("finalized"))) return;
102
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(ne("properties"))) {
103
+ const e = this.properties, i = [...fn(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 Ft = 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(oi(s));
123
- } else t !== void 0 && e.push(oi(t));
122
+ for (const s of i) e.unshift(ai(s));
123
+ } else t !== void 0 && e.push(ai(t));
124
124
  return e;
125
125
  }
126
126
  static _$Eu(t, e) {
@@ -146,7 +146,7 @@ let Ft = class extends HTMLElement {
146
146
  }
147
147
  createRenderRoot() {
148
148
  const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
149
- return ln(t, this.constructor.elementStyles), t;
149
+ return cn(t, this.constructor.elementStyles), t;
150
150
  }
151
151
  connectedCallback() {
152
152
  this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((t) => t.hostConnected?.());
@@ -162,14 +162,14 @@ let Ft = class extends HTMLElement {
162
162
  _$ET(t, e) {
163
163
  const i = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, i);
164
164
  if (s !== void 0 && i.reflect === !0) {
165
- const r = (i.converter?.toAttribute !== void 0 ? i.converter : Ne).toAttribute(e, i.type);
165
+ const r = (i.converter?.toAttribute !== void 0 ? i.converter : He).toAttribute(e, i.type);
166
166
  this._$Em = t, r == null ? this.removeAttribute(s) : this.setAttribute(s, r), this._$Em = null;
167
167
  }
168
168
  }
169
169
  _$AK(t, e) {
170
170
  const i = this.constructor, s = i._$Eh.get(t);
171
171
  if (s !== void 0 && this._$Em !== s) {
172
- const r = i.getPropertyOptions(s), o = typeof r.converter == "function" ? { fromAttribute: r.converter } : r.converter?.fromAttribute !== void 0 ? r.converter : Ne;
172
+ const r = i.getPropertyOptions(s), o = typeof r.converter == "function" ? { fromAttribute: r.converter } : r.converter?.fromAttribute !== void 0 ? r.converter : He;
173
173
  this._$Em = s;
174
174
  const a = o.fromAttribute(e, r.type);
175
175
  this[s] = a ?? this._$Ej?.get(s) ?? a, this._$Em = null;
@@ -178,7 +178,7 @@ let Ft = 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 ?? zi)(r, e) || i.useDefault && i.reflect && r === this._$Ej?.get(t) && !this.hasAttribute(o._$Eu(t, i)))) return;
181
+ if (s === !1 && (r = this[t]), i ??= o.getPropertyOptions(t), !((i.hasChanged ?? Wi)(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 Ft = class extends HTMLElement {
246
246
  firstUpdated(t) {
247
247
  }
248
248
  };
249
- Ft.elementStyles = [], Ft.shadowRootOptions = { mode: "open" }, Ft[ie("elementProperties")] = /* @__PURE__ */ new Map(), Ft[ie("finalized")] = /* @__PURE__ */ new Map(), vn?.({ ReactiveElement: Ft }), (ke.reactiveElementVersions ??= []).push("2.1.2");
250
- const je = globalThis, ci = (n) => n, ye = je.trustedTypes, hi = ye ? ye.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Wi = "$lit$", Dt = `lit$${Math.random().toFixed(9).slice(2)}$`, Fi = "?" + Dt, mn = `<${Fi}>`, Rt = document, re = () => Rt.createComment(""), oe = (n) => n === null || typeof n != "object" && typeof n != "function", Ke = Array.isArray, yn = (n) => Ke(n) || typeof n?.[Symbol.iterator] == "function", Ae = `[
251
- \f\r]`, te = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, di = /-->/g, ui = />/g, _t = RegExp(`>|${Ae}(?:([^\\s"'>=/]+)(${Ae}*=${Ae}*(?:[^
252
- \f\r"'\`<>=]|("|')|))|$)`, "g"), fi = /'/g, gi = /"/g, Bi = /^(?:script|style|textarea|title)$/i, bn = (n) => (t, ...e) => ({ _$litType$: n, strings: t, values: e }), O = bn(1), jt = /* @__PURE__ */ Symbol.for("lit-noChange"), j = /* @__PURE__ */ Symbol.for("lit-nothing"), pi = /* @__PURE__ */ new WeakMap(), Nt = Rt.createTreeWalker(Rt, 129);
253
- function qi(n, t) {
254
- if (!Ke(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
255
- return hi !== void 0 ? hi.createHTML(t) : t;
249
+ Bt.elementStyles = [], Bt.shadowRootOptions = { mode: "open" }, Bt[ne("elementProperties")] = /* @__PURE__ */ new Map(), Bt[ne("finalized")] = /* @__PURE__ */ new Map(), mn?.({ ReactiveElement: Bt }), (De.reactiveElementVersions ??= []).push("2.1.2");
250
+ const je = globalThis, hi = (n) => n, be = je.trustedTypes, di = be ? be.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Fi = "$lit$", Ct = `lit$${Math.random().toFixed(9).slice(2)}$`, Bi = "?" + Ct, yn = `<${Bi}>`, Pt = document, oe = () => Pt.createComment(""), ae = (n) => n === null || typeof n != "object" && typeof n != "function", Ve = Array.isArray, bn = (n) => Ve(n) || typeof n?.[Symbol.iterator] == "function", Oe = `[
251
+ \f\r]`, ee = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ui = /-->/g, fi = />/g, _t = RegExp(`>|${Oe}(?:([^\\s"'>=/]+)(${Oe}*=${Oe}*(?:[^
252
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), pi = /'/g, gi = /"/g, qi = /^(?:script|style|textarea|title)$/i, wn = (n) => (t, ...e) => ({ _$litType$: n, strings: t, values: e }), O = wn(1), jt = /* @__PURE__ */ Symbol.for("lit-noChange"), Z = /* @__PURE__ */ Symbol.for("lit-nothing"), vi = /* @__PURE__ */ new WeakMap(), Ht = Pt.createTreeWalker(Pt, 129);
253
+ function Ki(n, t) {
254
+ if (!Ve(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
255
+ return di !== void 0 ? di.createHTML(t) : t;
256
256
  }
257
- const wn = (n, t) => {
257
+ const En = (n, t) => {
258
258
  const e = n.length - 1, i = [];
259
- let s, r = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = te;
259
+ let s, r = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = ee;
260
260
  for (let a = 0; a < e; a++) {
261
261
  const l = n[a];
262
262
  let c, h, d = -1, u = 0;
263
- for (; u < l.length && (o.lastIndex = u, h = o.exec(l), h !== null); ) u = o.lastIndex, o === te ? h[1] === "!--" ? o = di : h[1] !== void 0 ? o = ui : h[2] !== void 0 ? (Bi.test(h[2]) && (s = RegExp("</" + h[2], "g")), o = _t) : h[3] !== void 0 && (o = _t) : o === _t ? h[0] === ">" ? (o = s ?? te, d = -1) : h[1] === void 0 ? d = -2 : (d = o.lastIndex - h[2].length, c = h[1], o = h[3] === void 0 ? _t : h[3] === '"' ? gi : fi) : o === gi || o === fi ? o = _t : o === di || o === ui ? o = te : (o = _t, s = void 0);
263
+ for (; u < l.length && (o.lastIndex = u, h = o.exec(l), h !== null); ) u = o.lastIndex, o === ee ? h[1] === "!--" ? o = ui : h[1] !== void 0 ? o = fi : h[2] !== void 0 ? (qi.test(h[2]) && (s = RegExp("</" + h[2], "g")), o = _t) : h[3] !== void 0 && (o = _t) : o === _t ? h[0] === ">" ? (o = s ?? ee, d = -1) : h[1] === void 0 ? d = -2 : (d = o.lastIndex - h[2].length, c = h[1], o = h[3] === void 0 ? _t : h[3] === '"' ? gi : pi) : o === gi || o === pi ? o = _t : o === ui || o === fi ? o = ee : (o = _t, s = void 0);
264
264
  const f = o === _t && n[a + 1].startsWith("/>") ? " " : "";
265
- r += o === te ? l + mn : d >= 0 ? (i.push(c), l.slice(0, d) + Wi + l.slice(d) + Dt + f) : l + Dt + (d === -2 ? a : f);
265
+ r += o === ee ? l + yn : d >= 0 ? (i.push(c), l.slice(0, d) + Fi + l.slice(d) + Ct + f) : l + Ct + (d === -2 ? a : f);
266
266
  }
267
- return [qi(n, r + (n[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
267
+ return [Ki(n, r + (n[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
268
268
  };
269
- class ae {
269
+ class le {
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, h] = wn(t, e);
275
- if (this.el = ae.createElement(c, i), Nt.currentNode = this.el.content, e === 2 || e === 3) {
274
+ const a = t.length - 1, l = this.parts, [c, h] = En(t, e);
275
+ if (this.el = le.createElement(c, i), Ht.currentNode = this.el.content, e === 2 || e === 3) {
276
276
  const d = this.el.content.firstChild;
277
277
  d.replaceWith(...d.childNodes);
278
278
  }
279
- for (; (s = Nt.nextNode()) !== null && l.length < a; ) {
279
+ for (; (s = Ht.nextNode()) !== null && l.length < a; ) {
280
280
  if (s.nodeType === 1) {
281
- if (s.hasAttributes()) for (const d of s.getAttributeNames()) if (d.endsWith(Wi)) {
282
- const u = h[o++], f = s.getAttribute(d).split(Dt), v = /([.?@])?(.*)/.exec(u);
283
- l.push({ type: 1, index: r, name: v[2], strings: f, ctor: v[1] === "." ? Sn : v[1] === "?" ? xn : v[1] === "@" ? Tn : De }), s.removeAttribute(d);
284
- } else d.startsWith(Dt) && (l.push({ type: 6, index: r }), s.removeAttribute(d));
285
- if (Bi.test(s.tagName)) {
286
- const d = s.textContent.split(Dt), u = d.length - 1;
281
+ if (s.hasAttributes()) for (const d of s.getAttributeNames()) if (d.endsWith(Fi)) {
282
+ const u = h[o++], f = s.getAttribute(d).split(Ct), v = /([.?@])?(.*)/.exec(u);
283
+ l.push({ type: 1, index: r, name: v[2], strings: f, ctor: v[1] === "." ? Sn : v[1] === "?" ? Tn : v[1] === "@" ? kn : Ce }), s.removeAttribute(d);
284
+ } else d.startsWith(Ct) && (l.push({ type: 6, index: r }), s.removeAttribute(d));
285
+ if (qi.test(s.tagName)) {
286
+ const d = s.textContent.split(Ct), u = d.length - 1;
287
287
  if (u > 0) {
288
- s.textContent = ye ? ye.emptyScript : "";
289
- for (let f = 0; f < u; f++) s.append(d[f], re()), Nt.nextNode(), l.push({ type: 2, index: ++r });
290
- s.append(d[u], re());
288
+ s.textContent = be ? be.emptyScript : "";
289
+ for (let f = 0; f < u; f++) s.append(d[f], oe()), Ht.nextNode(), l.push({ type: 2, index: ++r });
290
+ s.append(d[u], oe());
291
291
  }
292
292
  }
293
- } else if (s.nodeType === 8) if (s.data === Fi) l.push({ type: 2, index: r });
293
+ } else if (s.nodeType === 8) if (s.data === Bi) l.push({ type: 2, index: r });
294
294
  else {
295
295
  let d = -1;
296
- for (; (d = s.data.indexOf(Dt, d + 1)) !== -1; ) l.push({ type: 7, index: r }), d += Dt.length - 1;
296
+ for (; (d = s.data.indexOf(Ct, d + 1)) !== -1; ) l.push({ type: 7, index: r }), d += Ct.length - 1;
297
297
  }
298
298
  r++;
299
299
  }
300
300
  }
301
301
  static createElement(t, e) {
302
- const i = Rt.createElement("template");
302
+ const i = Pt.createElement("template");
303
303
  return i.innerHTML = t, i;
304
304
  }
305
305
  }
306
- function Kt(n, t, e = n, i) {
306
+ function Vt(n, t, e = n, i) {
307
307
  if (t === jt) return t;
308
308
  let s = i !== void 0 ? e._$Co?.[i] : e._$Cl;
309
- const r = oe(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 = Kt(n, s._$AS(n, t.values), s, i)), t;
309
+ const r = ae(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 = Vt(n, s._$AS(n, t.values), s, i)), t;
311
311
  }
312
- class En {
312
+ class xn {
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 En {
320
320
  return this._$AM._$AU;
321
321
  }
322
322
  u(t) {
323
- const { el: { content: e }, parts: i } = this._$AD, s = (t?.creationScope ?? Rt).importNode(e, !0);
324
- Nt.currentNode = s;
325
- let r = Nt.nextNode(), o = 0, a = 0, l = i[0];
323
+ const { el: { content: e }, parts: i } = this._$AD, s = (t?.creationScope ?? Pt).importNode(e, !0);
324
+ Ht.currentNode = s;
325
+ let r = Ht.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 ce(r, r.nextSibling, this, t) : l.type === 1 ? c = new l.ctor(r, l.name, l.strings, this, t) : l.type === 6 && (c = new kn(r, this, t)), this._$AV.push(c), l = i[++a];
329
+ l.type === 2 ? c = new he(r, r.nextSibling, this, t) : l.type === 1 ? c = new l.ctor(r, l.name, l.strings, this, t) : l.type === 6 && (c = new Dn(r, this, t)), this._$AV.push(c), l = i[++a];
330
330
  }
331
- o !== l?.index && (r = Nt.nextNode(), o++);
331
+ o !== l?.index && (r = Ht.nextNode(), o++);
332
332
  }
333
- return Nt.currentNode = Rt, s;
333
+ return Ht.currentNode = Pt, 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 ce {
340
+ class he {
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 = j, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cv = s?.isConnected ?? !0;
345
+ this.type = 2, this._$AH = Z, 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 ce {
356
356
  return this._$AB;
357
357
  }
358
358
  _$AI(t, e = this) {
359
- t = Kt(this, t, e), oe(t) ? t === j || t == null || t === "" ? (this._$AH !== j && this._$AR(), this._$AH = j) : t !== this._$AH && t !== jt && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : yn(t) ? this.k(t) : this._(t);
359
+ t = Vt(this, t, e), ae(t) ? t === Z || t == null || t === "" ? (this._$AH !== Z && this._$AR(), this._$AH = Z) : t !== this._$AH && t !== jt && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : bn(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 ce {
365
365
  this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
366
366
  }
367
367
  _(t) {
368
- this._$AH !== j && oe(this._$AH) ? this._$AA.nextSibling.data = t : this.T(Rt.createTextNode(t)), this._$AH = t;
368
+ this._$AH !== Z && ae(this._$AH) ? this._$AA.nextSibling.data = t : this.T(Pt.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 = ae.createElement(qi(i.h, i.h[0]), this.options)), i);
371
+ const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = le.createElement(Ki(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 En(s, this), o = r.u(this.options);
374
+ const r = new xn(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 = pi.get(t.strings);
380
- return e === void 0 && pi.set(t.strings, e = new ae(t)), e;
379
+ let e = vi.get(t.strings);
380
+ return e === void 0 && vi.set(t.strings, e = new le(t)), e;
381
381
  }
382
382
  k(t) {
383
- Ke(this._$AH) || (this._$AH = [], this._$AR());
383
+ Ve(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 ce(this.O(re()), this.O(re()), this, this.options)) : i = e[s], i._$AI(r), s++;
386
+ for (const r of t) s === e.length ? e.push(i = new he(this.O(oe()), this.O(oe()), 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 = ci(t).nextSibling;
392
- ci(t).remove(), t = i;
391
+ const i = hi(t).nextSibling;
392
+ hi(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 De {
399
+ class Ce {
400
400
  get tagName() {
401
401
  return this.element.tagName;
402
402
  }
@@ -404,53 +404,53 @@ class De {
404
404
  return this._$AM._$AU;
405
405
  }
406
406
  constructor(t, e, i, s, r) {
407
- this.type = 1, this._$AH = j, 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 = j;
407
+ this.type = 1, this._$AH = Z, 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 = Z;
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 = Kt(this, t, e, 0), o = !oe(t) || t !== this._$AH && t !== jt, o && (this._$AH = t);
412
+ if (r === void 0) t = Vt(this, t, e, 0), o = !ae(t) || t !== this._$AH && t !== jt, 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 = Kt(this, a[i + l], e, l), c === jt && (c = this._$AH[l]), o ||= !oe(c) || c !== this._$AH[l], c === j ? t = j : t !== j && (t += (c ?? "") + r[l + 1]), this._$AH[l] = c;
416
+ for (t = r[0], l = 0; l < r.length - 1; l++) c = Vt(this, a[i + l], e, l), c === jt && (c = this._$AH[l]), o ||= !ae(c) || c !== this._$AH[l], c === Z ? t = Z : t !== Z && (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 === j ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
421
+ t === Z ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
422
422
  }
423
423
  }
424
- class Sn extends De {
424
+ class Sn extends Ce {
425
425
  constructor() {
426
426
  super(...arguments), this.type = 3;
427
427
  }
428
428
  j(t) {
429
- this.element[this.name] = t === j ? void 0 : t;
429
+ this.element[this.name] = t === Z ? void 0 : t;
430
430
  }
431
431
  }
432
- class xn extends De {
432
+ class Tn extends Ce {
433
433
  constructor() {
434
434
  super(...arguments), this.type = 4;
435
435
  }
436
436
  j(t) {
437
- this.element.toggleAttribute(this.name, !!t && t !== j);
437
+ this.element.toggleAttribute(this.name, !!t && t !== Z);
438
438
  }
439
439
  }
440
- class Tn extends De {
440
+ class kn extends Ce {
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 = Kt(this, t, e, 0) ?? j) === jt) return;
446
- const i = this._$AH, s = t === j && i !== j || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, r = t !== j && (i === j || s);
445
+ if ((t = Vt(this, t, e, 0) ?? Z) === jt) return;
446
+ const i = this._$AH, s = t === Z && i !== Z || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, r = t !== Z && (i === Z || 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 kn {
453
+ class Dn {
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 kn {
458
458
  return this._$AM._$AU;
459
459
  }
460
460
  _$AI(t) {
461
- Kt(this, t);
461
+ Vt(this, t);
462
462
  }
463
463
  }
464
- const Dn = je.litHtmlPolyfillSupport;
465
- Dn?.(ae, ce), (je.litHtmlVersions ??= []).push("3.3.2");
466
- const Cn = (n, t, e) => {
464
+ const Cn = je.litHtmlPolyfillSupport;
465
+ Cn?.(le, he), (je.litHtmlVersions ??= []).push("3.3.2");
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 ce(t.insertBefore(re(), r), r, void 0, e ?? {});
471
+ i._$litPart$ = s = new he(t.insertBefore(oe(), r), r, void 0, e ?? {});
472
472
  }
473
473
  return s._$AI(n), s;
474
474
  };
475
- const Ve = globalThis;
476
- class qt extends Ft {
475
+ const Xe = globalThis;
476
+ class Kt extends Bt {
477
477
  constructor() {
478
478
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
479
479
  }
@@ -483,7 +483,7 @@ class qt extends Ft {
483
483
  }
484
484
  update(t) {
485
485
  const e = this.render();
486
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Cn(e, this.renderRoot, this.renderOptions);
486
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = $n(e, this.renderRoot, this.renderOptions);
487
487
  }
488
488
  connectedCallback() {
489
489
  super.connectedCallback(), this._$Do?.setConnected(!0);
@@ -495,11 +495,11 @@ class qt extends Ft {
495
495
  return jt;
496
496
  }
497
497
  }
498
- qt._$litElement$ = !0, qt.finalized = !0, Ve.litElementHydrateSupport?.({ LitElement: qt });
499
- const $n = Ve.litElementPolyfillSupport;
500
- $n?.({ LitElement: qt });
501
- (Ve.litElementVersions ??= []).push("4.2.2");
502
- var Re = [
498
+ Kt._$litElement$ = !0, Kt.finalized = !0, Xe.litElementHydrateSupport?.({ LitElement: Kt });
499
+ const Mn = Xe.litElementPolyfillSupport;
500
+ Mn?.({ LitElement: Kt });
501
+ (Xe.litElementVersions ??= []).push("4.2.2");
502
+ var Pe = [
503
503
  "MO",
504
504
  "TU",
505
505
  "WE",
@@ -507,7 +507,7 @@ var Re = [
507
507
  "FR",
508
508
  "SA",
509
509
  "SU"
510
- ], Q = (
510
+ ], it = (
511
511
  /** @class */
512
512
  (function() {
513
513
  function n(t, e) {
@@ -516,121 +516,121 @@ var Re = [
516
516
  this.weekday = t, this.n = e;
517
517
  }
518
518
  return n.fromStr = function(t) {
519
- return new n(Re.indexOf(t));
519
+ return new n(Pe.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 = Re[this.weekday];
525
+ var t = Pe[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
- ), W = function(n) {
531
+ ), K = function(n) {
532
532
  return n != null;
533
- }, ft = function(n) {
533
+ }, pt = function(n) {
534
534
  return typeof n == "number";
535
- }, vi = function(n) {
536
- return typeof n == "string" && Re.includes(n);
537
- }, rt = Array.isArray, pt = function(n, t) {
535
+ }, mi = function(n) {
536
+ return typeof n == "string" && Pe.includes(n);
537
+ }, ot = Array.isArray, vt = 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
- }, N = function(n, t) {
542
+ }, _ = function(n, t) {
543
543
  var e = 0, i = [];
544
- if (rt(n))
544
+ if (ot(n))
545
545
  for (; e < t; e++)
546
546
  i[e] = [].concat(n);
547
547
  else
548
548
  for (; e < t; e++)
549
549
  i[e] = n;
550
550
  return i;
551
- }, Mn = function(n) {
552
- return rt(n) ? n : [n];
551
+ }, An = function(n) {
552
+ return ot(n) ? n : [n];
553
553
  };
554
- function zt(n, t, e) {
554
+ function Wt(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 += N(e, t / e.length)), e.slice(0, t) + String(i));
557
+ return t = t >> 0, i.length > t ? String(i) : (t = t - i.length, t > e.length && (e += _(e, t / e.length)), e.slice(0, t) + String(i));
558
558
  }
559
- var An = function(n, t, e) {
559
+ var On = 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
- }, ct = function(n, t) {
562
+ }, ht = function(n, t) {
563
563
  var e = n % t;
564
564
  return e * t < 0 ? e + t : e;
565
- }, Oe = function(n, t) {
566
- return { div: Math.floor(n / t), mod: ct(n, t) };
565
+ }, Ie = function(n, t) {
566
+ return { div: Math.floor(n / t), mod: ht(n, t) };
567
567
  }, gt = function(n) {
568
- return !W(n) || n.length === 0;
569
- }, q = function(n) {
568
+ return !K(n) || n.length === 0;
569
+ }, X = function(n) {
570
570
  return !gt(n);
571
- }, H = function(n, t) {
572
- return q(n) && n.indexOf(t) !== -1;
573
- }, Pt = function(n, t, e, i, s, r) {
571
+ }, N = function(n, t) {
572
+ return X(n) && n.indexOf(t) !== -1;
573
+ }, Yt = 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
- }, On = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], ji = 1e3 * 60 * 60 * 24, Ki = 9999, Vi = Pt(1970, 1, 1), _n = [6, 0, 1, 2, 3, 4, 5], ne = function(n) {
575
+ }, In = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], ji = 1e3 * 60 * 60 * 24, Vi = 9999, Xi = Yt(1970, 1, 1), _n = [6, 0, 1, 2, 3, 4, 5], se = function(n) {
576
576
  return n % 4 === 0 && n % 100 !== 0 || n % 400 === 0;
577
- }, Xi = function(n) {
577
+ }, Zi = function(n) {
578
578
  return n instanceof Date;
579
- }, ee = function(n) {
580
- return Xi(n) && !isNaN(n.getTime());
581
- }, In = function(n, t) {
579
+ }, ie = function(n) {
580
+ return Zi(n) && !isNaN(n.getTime());
581
+ }, Rn = function(n, t) {
582
582
  var e = n.getTime(), i = t.getTime(), s = e - i;
583
583
  return Math.round(s / ji);
584
- }, Pe = function(n) {
585
- return In(n, Vi);
586
- }, Zi = function(n) {
587
- return new Date(Vi.getTime() + n * ji);
588
- }, Nn = function(n) {
584
+ }, Ye = function(n) {
585
+ return Rn(n, Xi);
586
+ }, Gi = function(n) {
587
+ return new Date(Xi.getTime() + n * ji);
588
+ }, Hn = function(n) {
589
589
  var t = n.getUTCMonth();
590
- return t === 1 && ne(n.getUTCFullYear()) ? 29 : On[t];
591
- }, Vt = function(n) {
590
+ return t === 1 && se(n.getUTCFullYear()) ? 29 : In[t];
591
+ }, Xt = function(n) {
592
592
  return _n[n.getUTCDay()];
593
- }, mi = function(n, t) {
594
- var e = Pt(n, t + 1, 1);
595
- return [Vt(e), Nn(e)];
596
- }, Gi = function(n, t) {
593
+ }, yi = function(n, t) {
594
+ var e = Yt(n, t + 1, 1);
595
+ return [Xt(e), Hn(e)];
596
+ }, Ji = 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
- }, He = function(n) {
598
+ }, Ne = function(n) {
599
599
  var t = new Date(n.getTime());
600
600
  return t;
601
- }, yi = function(n) {
601
+ }, bi = function(n) {
602
602
  for (var t = [], e = 0; e < n.length; e++)
603
- t.push(He(n[e]));
603
+ t.push(Ne(n[e]));
604
604
  return t;
605
- }, le = function(n) {
605
+ }, ce = function(n) {
606
606
  n.sort(function(t, e) {
607
607
  return t.getTime() - e.getTime();
608
608
  });
609
- }, Xe = function(n, t) {
609
+ }, Ze = function(n, t) {
610
610
  t === void 0 && (t = !0);
611
611
  var e = new Date(n);
612
612
  return [
613
- zt(e.getUTCFullYear().toString(), 4, "0"),
614
- zt(e.getUTCMonth() + 1, 2, "0"),
615
- zt(e.getUTCDate(), 2, "0"),
613
+ Wt(e.getUTCFullYear().toString(), 4, "0"),
614
+ Wt(e.getUTCMonth() + 1, 2, "0"),
615
+ Wt(e.getUTCDate(), 2, "0"),
616
616
  "T",
617
- zt(e.getUTCHours(), 2, "0"),
618
- zt(e.getUTCMinutes(), 2, "0"),
619
- zt(e.getUTCSeconds(), 2, "0"),
617
+ Wt(e.getUTCHours(), 2, "0"),
618
+ Wt(e.getUTCMinutes(), 2, "0"),
619
+ Wt(e.getUTCSeconds(), 2, "0"),
620
620
  t ? "Z" : ""
621
621
  ].join("");
622
- }, Ze = function(n) {
622
+ }, Ge = 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
- }, bi = function(n, t) {
627
+ }, wi = function(n, t) {
628
628
  var e = n.toLocaleString("sv-SE", { timeZone: t });
629
629
  return e.replace(" ", "T") + "Z";
630
- }, Rn = function(n, t) {
631
- var e = Intl.DateTimeFormat().resolvedOptions().timeZone, i = new Date(bi(n, e)), s = new Date(bi(n, t ?? "UTC")), r = s.getTime() - i.getTime();
630
+ }, Pn = function(n, t) {
631
+ var e = Intl.DateTimeFormat().resolvedOptions().timeZone, i = new Date(wi(n, e)), s = new Date(wi(n, t ?? "UTC")), r = s.getTime() - i.getTime();
632
632
  return new Date(n.getTime() - r);
633
- }, Bt = (
633
+ }, qt = (
634
634
  /** @class */
635
635
  (function() {
636
636
  function n(t, e) {
@@ -665,40 +665,40 @@ var An = function(n, t, e) {
665
665
  return new n(this.method, this.args);
666
666
  }, n;
667
667
  })()
668
- ), Ye = function(n, t) {
669
- return Ye = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, i) {
668
+ ), Ue = function(n, t) {
669
+ return Ue = 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
- }, Ye(n, t);
673
+ }, Ue(n, t);
674
674
  };
675
- function Ge(n, t) {
675
+ function Je(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
- Ye(n, t);
678
+ Ue(n, t);
679
679
  function e() {
680
680
  this.constructor = n;
681
681
  }
682
682
  n.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
683
683
  }
684
- var ot = function() {
685
- return ot = Object.assign || function(t) {
684
+ var at = function() {
685
+ return at = Object.assign || function(t) {
686
686
  for (var e, i = 1, s = arguments.length; i < s; i++) {
687
687
  e = arguments[i];
688
688
  for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
689
689
  }
690
690
  return t;
691
- }, ot.apply(this, arguments);
691
+ }, at.apply(this, arguments);
692
692
  };
693
- function p(n, t, e) {
693
+ function g(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 wi = (
698
+ var Ei = (
699
699
  /** @class */
700
700
  (function(n) {
701
- Ge(t, n);
701
+ Je(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 wi = (
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
- })(Bt)
710
- ), be = {
709
+ })(qt)
710
+ ), we = {
711
711
  dayNames: [
712
712
  "Sunday",
713
713
  "Monday",
@@ -775,17 +775,17 @@ var wi = (
775
775
  december: /^dec(ember)?/i,
776
776
  comma: /^(,\s*|(and|or)\s*)+/i
777
777
  }
778
- }, Ei = function(n, t) {
778
+ }, xi = function(n, t) {
779
779
  return n.indexOf(t) !== -1;
780
- }, Pn = function(n) {
780
+ }, Yn = function(n) {
781
781
  return n.toString();
782
- }, Hn = function(n, t, e) {
782
+ }, Nn = function(n, t, e) {
783
783
  return "".concat(t, " ").concat(e, ", ").concat(n);
784
- }, Et = (
784
+ }, xt = (
785
785
  /** @class */
786
786
  (function() {
787
787
  function n(t, e, i, s) {
788
- if (e === void 0 && (e = Pn), i === void 0 && (i = be), s === void 0 && (s = Hn), this.text = [], this.language = i || be, this.gettext = e, this.dateFormatter = s, this.rrule = t, this.options = t.options, this.origOptions = t.origOptions, this.origOptions.bymonthday) {
788
+ if (e === void 0 && (e = Yn), i === void 0 && (i = we), s === void 0 && (s = Nn), this.text = [], this.language = i || we, 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
790
  r.sort(function(h, d) {
791
791
  return h - d;
@@ -793,8 +793,8 @@ var wi = (
793
793
  return d - h;
794
794
  }), this.bymonthday = r.concat(o), this.bymonthday.length || (this.bymonthday = null);
795
795
  }
796
- if (W(this.origOptions.byweekday)) {
797
- var a = rt(this.origOptions.byweekday) ? this.origOptions.byweekday : [this.origOptions.byweekday], l = String(a);
796
+ if (K(this.origOptions.byweekday)) {
797
+ var a = ot(this.origOptions.byweekday) ? this.origOptions.byweekday : [this.origOptions.byweekday], l = String(a);
798
798
  this.byweekday = {
799
799
  allWeeks: a.filter(function(h) {
800
800
  return !h.n;
@@ -817,9 +817,9 @@ var wi = (
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 (Ei(["dtstart", "tzid", "wkst", "freq"], i))
820
+ if (xi(["dtstart", "tzid", "wkst", "freq"], i))
821
821
  return !0;
822
- if (!Ei(n.IMPLEMENTED[t.options.freq], i))
822
+ if (!xi(n.IMPLEMENTED[t.options.freq], i))
823
823
  return !1;
824
824
  }
825
825
  return e;
@@ -829,7 +829,7 @@ var wi = (
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[T.FREQUENCIES[this.options.freq]](), this.options.until) {
832
+ if (this.text = [t("every")], this[S.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 wi = (
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 = ft(t) ? (t + 1) % 7 : t.getJsWeekday();
894
+ var e = pt(t) ? (t + 1) % 7 : t.getJsWeekday();
895
895
  return (t.n ? this.nth(t.n) + " " : "") + this.language.dayNames[e];
896
896
  }, n.prototype.plural = function(t) {
897
897
  return t % 100 !== 1;
@@ -899,7 +899,7 @@ var wi = (
899
899
  return this.text.push(" "), this.text.push(t), this;
900
900
  }, n.prototype.list = function(t, e, i, s) {
901
901
  var r = this;
902
- s === void 0 && (s = ","), rt(t) || (t = [t]);
902
+ s === void 0 && (s = ","), ot(t) || (t = [t]);
903
903
  var o = function(l, c, h) {
904
904
  for (var d = "", u = 0; u < l.length; u++)
905
905
  u !== 0 && (u === l.length - 1 ? d += " " + h + " " : d += c + " "), d += l[u];
@@ -914,7 +914,7 @@ var wi = (
914
914
  return i ? o(t.map(a), s, i) : t.map(a).join(s + " ");
915
915
  }, n;
916
916
  })()
917
- ), Yn = (
917
+ ), Un = (
918
918
  /** @class */
919
919
  (function() {
920
920
  function n(t) {
@@ -961,9 +961,9 @@ var wi = (
961
961
  }, n;
962
962
  })()
963
963
  );
964
- function Ji(n, t) {
965
- t === void 0 && (t = be);
966
- var e = {}, i = new Yn(t.tokens);
964
+ function Qi(n, t) {
965
+ t === void 0 && (t = we);
966
+ var e = {}, i = new Un(t.tokens);
967
967
  if (!i.start(n))
968
968
  return null;
969
969
  return s(), e;
@@ -974,27 +974,27 @@ function Ji(n, t) {
974
974
  throw new Error("Unexpected end");
975
975
  switch (i.symbol) {
976
976
  case "day(s)":
977
- e.freq = T.DAILY, i.nextSymbol() && (o(), d());
977
+ e.freq = S.DAILY, i.nextSymbol() && (o(), d());
978
978
  break;
979
979
  // FIXME Note: every 2 weekdays != every two weeks on weekdays.
980
980
  // DAILY on weekdays is not a valid rule
981
981
  case "weekday(s)":
982
- e.freq = T.WEEKLY, e.byweekday = [T.MO, T.TU, T.WE, T.TH, T.FR], i.nextSymbol(), o(), d();
982
+ e.freq = S.WEEKLY, e.byweekday = [S.MO, S.TU, S.WE, S.TH, S.FR], i.nextSymbol(), o(), d();
983
983
  break;
984
984
  case "week(s)":
985
- e.freq = T.WEEKLY, i.nextSymbol() && (r(), o(), d());
985
+ e.freq = S.WEEKLY, i.nextSymbol() && (r(), o(), d());
986
986
  break;
987
987
  case "hour(s)":
988
- e.freq = T.HOURLY, i.nextSymbol() && (r(), d());
988
+ e.freq = S.HOURLY, i.nextSymbol() && (r(), d());
989
989
  break;
990
990
  case "minute(s)":
991
- e.freq = T.MINUTELY, i.nextSymbol() && (r(), d());
991
+ e.freq = S.MINUTELY, i.nextSymbol() && (r(), d());
992
992
  break;
993
993
  case "month(s)":
994
- e.freq = T.MONTHLY, i.nextSymbol() && (r(), d());
994
+ e.freq = S.MONTHLY, i.nextSymbol() && (r(), d());
995
995
  break;
996
996
  case "year(s)":
997
- e.freq = T.YEARLY, i.nextSymbol() && (r(), d());
997
+ e.freq = S.YEARLY, i.nextSymbol() && (r(), d());
998
998
  break;
999
999
  case "monday":
1000
1000
  case "tuesday":
@@ -1003,9 +1003,9 @@ function Ji(n, t) {
1003
1003
  case "friday":
1004
1004
  case "saturday":
1005
1005
  case "sunday":
1006
- e.freq = T.WEEKLY;
1006
+ e.freq = S.WEEKLY;
1007
1007
  var f = i.symbol.substr(0, 2).toUpperCase();
1008
- if (e.byweekday = [T[f]], !i.nextSymbol())
1008
+ if (e.byweekday = [S[f]], !i.nextSymbol())
1009
1009
  return;
1010
1010
  for (; i.accept("comma"); ) {
1011
1011
  if (i.isDone())
@@ -1013,7 +1013,7 @@ function Ji(n, t) {
1013
1013
  var v = l();
1014
1014
  if (!v)
1015
1015
  throw new Error("Unexpected symbol " + i.symbol + ", expected weekday");
1016
- e.byweekday.push(T[v]), i.nextSymbol();
1016
+ e.byweekday.push(S[v]), i.nextSymbol();
1017
1017
  }
1018
1018
  o(), h(), d();
1019
1019
  break;
@@ -1029,15 +1029,15 @@ function Ji(n, t) {
1029
1029
  case "october":
1030
1030
  case "november":
1031
1031
  case "december":
1032
- if (e.freq = T.YEARLY, e.bymonth = [a()], !i.nextSymbol())
1032
+ if (e.freq = S.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 g = a();
1038
- if (!g)
1037
+ var p = a();
1038
+ if (!p)
1039
1039
  throw new Error("Unexpected symbol " + i.symbol + ", expected month");
1040
- e.bymonth.push(g), i.nextSymbol();
1040
+ e.bymonth.push(p), i.nextSymbol();
1041
1041
  }
1042
1042
  r(), d();
1043
1043
  break;
@@ -1049,13 +1049,13 @@ function Ji(n, t) {
1049
1049
  var u = i.accept("on"), f = i.accept("the");
1050
1050
  if (u || f)
1051
1051
  do {
1052
- var v = c(), g = l(), m = a();
1052
+ var v = c(), p = l(), m = a();
1053
1053
  if (v)
1054
- g ? (i.nextSymbol(), e.byweekday || (e.byweekday = []), e.byweekday.push(T[g].nth(v))) : (e.bymonthday || (e.bymonthday = []), e.bymonthday.push(v), i.accept("day(s)"));
1055
- else if (g)
1056
- i.nextSymbol(), e.byweekday || (e.byweekday = []), e.byweekday.push(T[g]);
1054
+ p ? (i.nextSymbol(), e.byweekday || (e.byweekday = []), e.byweekday.push(S[p].nth(v))) : (e.bymonthday || (e.bymonthday = []), e.bymonthday.push(v), i.accept("day(s)"));
1055
+ else if (p)
1056
+ i.nextSymbol(), e.byweekday || (e.byweekday = []), e.byweekday.push(S[p]);
1057
1057
  else if (i.symbol === "weekday(s)")
1058
- i.nextSymbol(), e.byweekday || (e.byweekday = [T.MO, T.TU, T.WE, T.TH, T.FR]);
1058
+ i.nextSymbol(), e.byweekday || (e.byweekday = [S.MO, S.TU, S.WE, S.TH, S.FR]);
1059
1059
  else if (i.symbol === "week(s)") {
1060
1060
  i.nextSymbol();
1061
1061
  var b = i.acceptNumber();
@@ -1172,12 +1172,12 @@ var R;
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
1174
  })(R || (R = {}));
1175
- function Je(n) {
1175
+ function Qe(n) {
1176
1176
  return n < R.HOURLY;
1177
1177
  }
1178
- var Un = function(n, t) {
1179
- return t === void 0 && (t = be), new T(Ji(n, t) || void 0);
1180
- }, Xt = [
1178
+ var Ln = function(n, t) {
1179
+ return t === void 0 && (t = we), new S(Qi(n, t) || void 0);
1180
+ }, Zt = [
1181
1181
  "count",
1182
1182
  "until",
1183
1183
  "interval",
@@ -1185,16 +1185,16 @@ var Un = function(n, t) {
1185
1185
  "bymonthday",
1186
1186
  "bymonth"
1187
1187
  ];
1188
- Et.IMPLEMENTED = [];
1189
- Et.IMPLEMENTED[R.HOURLY] = Xt;
1190
- Et.IMPLEMENTED[R.MINUTELY] = Xt;
1191
- Et.IMPLEMENTED[R.DAILY] = ["byhour"].concat(Xt);
1192
- Et.IMPLEMENTED[R.WEEKLY] = Xt;
1193
- Et.IMPLEMENTED[R.MONTHLY] = Xt;
1194
- Et.IMPLEMENTED[R.YEARLY] = ["byweekno", "byyearday"].concat(Xt);
1195
- var Ln = function(n, t, e, i) {
1196
- return new Et(n, t, e, i).toString();
1197
- }, zn = Et.isFullyConvertible, we = (
1188
+ xt.IMPLEMENTED = [];
1189
+ xt.IMPLEMENTED[R.HOURLY] = Zt;
1190
+ xt.IMPLEMENTED[R.MINUTELY] = Zt;
1191
+ xt.IMPLEMENTED[R.DAILY] = ["byhour"].concat(Zt);
1192
+ xt.IMPLEMENTED[R.WEEKLY] = Zt;
1193
+ xt.IMPLEMENTED[R.MONTHLY] = Zt;
1194
+ xt.IMPLEMENTED[R.YEARLY] = ["byweekno", "byyearday"].concat(Zt);
1195
+ var zn = function(n, t, e, i) {
1196
+ return new xt(n, t, e, i).toString();
1197
+ }, Wn = xt.isFullyConvertible, Ee = (
1198
1198
  /** @class */
1199
1199
  (function() {
1200
1200
  function n(t, e, i, s) {
@@ -1212,10 +1212,10 @@ var Ln = 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
- ), Wn = (
1215
+ ), Fn = (
1216
1216
  /** @class */
1217
1217
  (function(n) {
1218
- Ge(t, n);
1218
+ Je(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 Ln = 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 Vt(new Date(this.getTime()));
1226
+ return Xt(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 Ln = 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 = ct(this.month, 12);
1239
+ var i = Math.floor(this.month / 12), s = ht(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,32 +1246,32 @@ var Ln = 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 = Oe(this.hour, 24), o = r.div, a = r.mod;
1250
- if (o && (this.hour = a, this.addDaily(o)), gt(s) || H(s, this.hour))
1249
+ var r = Ie(this.hour, 24), o = r.div, a = r.mod;
1250
+ if (o && (this.hour = a, this.addDaily(o)), gt(s) || N(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 = Oe(this.minute, 60), a = o.div, l = o.mod;
1257
- if (a && (this.minute = l, this.addHours(a, !1, s)), (gt(s) || H(s, this.hour)) && (gt(r) || H(r, this.minute)))
1256
+ var o = Ie(this.minute, 60), a = o.div, l = o.mod;
1257
+ if (a && (this.minute = l, this.addHours(a, !1, s)), (gt(s) || N(s, this.hour)) && (gt(r) || N(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 = Oe(this.second, 60), l = a.div, c = a.mod;
1264
- if (l && (this.second = c, this.addMinutes(l, !1, s, r)), (gt(s) || H(s, this.hour)) && (gt(r) || H(r, this.minute)) && (gt(o) || H(o, this.second)))
1263
+ var a = Ie(this.second, 60), l = a.div, c = a.mod;
1264
+ if (l && (this.second = c, this.addMinutes(l, !1, s, r)), (gt(s) || N(s, this.hour)) && (gt(r) || N(r, this.minute)) && (gt(o) || N(o, this.second)))
1265
1265
  break;
1266
1266
  }
1267
1267
  }, t.prototype.fixDay = function() {
1268
1268
  if (!(this.day <= 28)) {
1269
- var e = mi(this.year, this.month - 1)[1];
1269
+ var e = yi(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 > Ki))
1272
+ if (this.day -= e, ++this.month, this.month === 13 && (this.month = 1, ++this.year, this.year > Vi))
1273
1273
  return;
1274
- e = mi(this.year, this.month - 1)[1];
1274
+ e = yi(this.year, this.month - 1)[1];
1275
1275
  }
1276
1276
  }
1277
1277
  }, t.prototype.add = function(e, i) {
@@ -1293,102 +1293,102 @@ var Ln = function(n, t, e, i) {
1293
1293
  return this.addSeconds(r, i, a, l, c);
1294
1294
  }
1295
1295
  }, t;
1296
- })(we)
1296
+ })(Ee)
1297
1297
  );
1298
- function Qi(n) {
1298
+ function tn(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
- H(ys, r) || t.push(r), Xi(n[r]) && !ee(n[r]) && t.push(r);
1301
+ N(bs, r) || t.push(r), Zi(n[r]) && !ie(n[r]) && t.push(r);
1302
1302
  }
1303
1303
  if (t.length)
1304
1304
  throw new Error("Invalid options: " + t.join(", "));
1305
- return ot({}, n);
1305
+ return at({}, n);
1306
1306
  }
1307
- function Fn(n) {
1308
- var t = ot(ot({}, Qe), Qi(n));
1309
- if (W(t.byeaster) && (t.freq = T.YEARLY), !(W(t.freq) && T.FREQUENCIES[t.freq]))
1307
+ function Bn(n) {
1308
+ var t = at(at({}, ti), tn(n));
1309
+ if (K(t.byeaster) && (t.freq = S.YEARLY), !(K(t.freq) && S.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))), W(t.wkst) ? ft(t.wkst) || (t.wkst = t.wkst.weekday) : t.wkst = T.MO.weekday, W(t.bysetpos)) {
1312
- ft(t.bysetpos) && (t.bysetpos = [t.bysetpos]);
1311
+ if (t.dtstart || (t.dtstart = new Date((/* @__PURE__ */ new Date()).setMilliseconds(0))), K(t.wkst) ? pt(t.wkst) || (t.wkst = t.wkst.weekday) : t.wkst = S.MO.weekday, K(t.bysetpos)) {
1312
+ pt(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 || q(t.byweekno) || q(t.byyearday) || t.bymonthday || q(t.bymonthday) || W(t.byweekday) || W(t.byeaster)))
1319
+ if (!(t.byweekno || X(t.byweekno) || X(t.byyearday) || t.bymonthday || X(t.bymonthday) || K(t.byweekday) || K(t.byeaster)))
1320
1320
  switch (t.freq) {
1321
- case T.YEARLY:
1321
+ case S.YEARLY:
1322
1322
  t.bymonth || (t.bymonth = t.dtstart.getUTCMonth() + 1), t.bymonthday = t.dtstart.getUTCDate();
1323
1323
  break;
1324
- case T.MONTHLY:
1324
+ case S.MONTHLY:
1325
1325
  t.bymonthday = t.dtstart.getUTCDate();
1326
1326
  break;
1327
- case T.WEEKLY:
1328
- t.byweekday = [Vt(t.dtstart)];
1327
+ case S.WEEKLY:
1328
+ t.byweekday = [Xt(t.dtstart)];
1329
1329
  break;
1330
1330
  }
1331
- if (W(t.bymonth) && !rt(t.bymonth) && (t.bymonth = [t.bymonth]), W(t.byyearday) && !rt(t.byyearday) && ft(t.byyearday) && (t.byyearday = [t.byyearday]), !W(t.bymonthday))
1331
+ if (K(t.bymonth) && !ot(t.bymonth) && (t.bymonth = [t.bymonth]), K(t.byyearday) && !ot(t.byyearday) && pt(t.byyearday) && (t.byyearday = [t.byyearday]), !K(t.bymonthday))
1332
1332
  t.bymonthday = [], t.bynmonthday = [];
1333
- else if (rt(t.bymonthday)) {
1333
+ else if (ot(t.bymonthday)) {
1334
1334
  for (var s = [], r = [], e = 0; e < t.bymonthday.length; e++) {
1335
1335
  var i = t.bymonthday[e];
1336
1336
  i > 0 ? s.push(i) : i < 0 && r.push(i);
1337
1337
  }
1338
1338
  t.bymonthday = s, t.bynmonthday = r;
1339
1339
  } else t.bymonthday < 0 ? (t.bynmonthday = [t.bymonthday], t.bymonthday = []) : (t.bynmonthday = [], t.bymonthday = [t.bymonthday]);
1340
- if (W(t.byweekno) && !rt(t.byweekno) && (t.byweekno = [t.byweekno]), !W(t.byweekday))
1340
+ if (K(t.byweekno) && !ot(t.byweekno) && (t.byweekno = [t.byweekno]), !K(t.byweekday))
1341
1341
  t.bynweekday = null;
1342
- else if (ft(t.byweekday))
1342
+ else if (pt(t.byweekday))
1343
1343
  t.byweekday = [t.byweekday], t.bynweekday = null;
1344
- else if (vi(t.byweekday))
1345
- t.byweekday = [Q.fromStr(t.byweekday).weekday], t.bynweekday = null;
1346
- else if (t.byweekday instanceof Q)
1347
- !t.byweekday.n || t.freq > T.MONTHLY ? (t.byweekday = [t.byweekday.weekday], t.bynweekday = null) : (t.bynweekday = [[t.byweekday.weekday, t.byweekday.n]], t.byweekday = null);
1344
+ else if (mi(t.byweekday))
1345
+ t.byweekday = [it.fromStr(t.byweekday).weekday], t.bynweekday = null;
1346
+ else if (t.byweekday instanceof it)
1347
+ !t.byweekday.n || t.freq > S.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 (ft(l)) {
1351
+ if (pt(l)) {
1352
1352
  o.push(l);
1353
1353
  continue;
1354
- } else if (vi(l)) {
1355
- o.push(Q.fromStr(l).weekday);
1354
+ } else if (mi(l)) {
1355
+ o.push(it.fromStr(l).weekday);
1356
1356
  continue;
1357
1357
  }
1358
- !l.n || t.freq > T.MONTHLY ? o.push(l.weekday) : a.push([l.weekday, l.n]);
1358
+ !l.n || t.freq > S.MONTHLY ? o.push(l.weekday) : a.push([l.weekday, l.n]);
1359
1359
  }
1360
- t.byweekday = q(o) ? o : null, t.bynweekday = q(a) ? a : null;
1360
+ t.byweekday = X(o) ? o : null, t.bynweekday = X(a) ? a : null;
1361
1361
  }
1362
- return W(t.byhour) ? ft(t.byhour) && (t.byhour = [t.byhour]) : t.byhour = t.freq < T.HOURLY ? [t.dtstart.getUTCHours()] : null, W(t.byminute) ? ft(t.byminute) && (t.byminute = [t.byminute]) : t.byminute = t.freq < T.MINUTELY ? [t.dtstart.getUTCMinutes()] : null, W(t.bysecond) ? ft(t.bysecond) && (t.bysecond = [t.bysecond]) : t.bysecond = t.freq < T.SECONDLY ? [t.dtstart.getUTCSeconds()] : null, { parsedOptions: t };
1362
+ return K(t.byhour) ? pt(t.byhour) && (t.byhour = [t.byhour]) : t.byhour = t.freq < S.HOURLY ? [t.dtstart.getUTCHours()] : null, K(t.byminute) ? pt(t.byminute) && (t.byminute = [t.byminute]) : t.byminute = t.freq < S.MINUTELY ? [t.dtstart.getUTCMinutes()] : null, K(t.bysecond) ? pt(t.bysecond) && (t.bysecond = [t.bysecond]) : t.bysecond = t.freq < S.SECONDLY ? [t.dtstart.getUTCSeconds()] : null, { parsedOptions: t };
1363
1363
  }
1364
- function Bn(n) {
1364
+ function qn(n) {
1365
1365
  var t = n.dtstart.getTime() % 1e3;
1366
- if (!Je(n.freq))
1366
+ if (!Qe(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 we(i, s, r, t));
1372
+ e.push(new Ee(i, s, r, t));
1373
1373
  });
1374
1374
  });
1375
1375
  }), e;
1376
1376
  }
1377
- function Ue(n) {
1377
+ function Le(n) {
1378
1378
  var t = n.split(`
1379
- `).map(qn).filter(function(e) {
1379
+ `).map(Kn).filter(function(e) {
1380
1380
  return e !== null;
1381
1381
  });
1382
- return ot(ot({}, t[0]), t[1]);
1382
+ return at(at({}, t[0]), t[1]);
1383
1383
  }
1384
- function Ee(n) {
1384
+ function xe(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 = Ze(s), t;
1389
+ return i && (t.tzid = i), t.dtstart = Ge(s), t;
1390
1390
  }
1391
- function qn(n) {
1391
+ function Kn(n) {
1392
1392
  if (n = n.replace(/^\s+|\s+$/, ""), !n.length)
1393
1393
  return null;
1394
1394
  var t = /^([A-Z]+?)[:;]/.exec(n.toUpperCase());
@@ -1400,13 +1400,13 @@ function qn(n) {
1400
1400
  case "EXRULE":
1401
1401
  return Si(n);
1402
1402
  case "DTSTART":
1403
- return Ee(n);
1403
+ return xe(n);
1404
1404
  default:
1405
1405
  throw new Error("Unsupported RFC prop ".concat(e, " in ").concat(n));
1406
1406
  }
1407
1407
  }
1408
1408
  function Si(n) {
1409
- var t = n.replace(/^RRULE:/i, ""), e = Ee(t), i = n.replace(/^(?:RRULE|EXRULE):/i, "").split(";");
1409
+ var t = n.replace(/^RRULE:/i, ""), e = xe(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()) {
@@ -1414,7 +1414,7 @@ function Si(n) {
1414
1414
  e.freq = R[a.toUpperCase()];
1415
1415
  break;
1416
1416
  case "WKST":
1417
- e.wkst = ut[a.toUpperCase()];
1417
+ e.wkst = ft[a.toUpperCase()];
1418
1418
  break;
1419
1419
  case "COUNT":
1420
1420
  case "INTERVAL":
@@ -1431,15 +1431,15 @@ function Si(n) {
1431
1431
  break;
1432
1432
  case "BYWEEKDAY":
1433
1433
  case "BYDAY":
1434
- e.byweekday = Kn(a);
1434
+ e.byweekday = Vn(a);
1435
1435
  break;
1436
1436
  case "DTSTART":
1437
1437
  case "TZID":
1438
- var h = Ee(n);
1438
+ var h = xe(n);
1439
1439
  e.tzid = h.tzid, e.dtstart = h.dtstart;
1440
1440
  break;
1441
1441
  case "UNTIL":
1442
- e.until = Ze(a);
1442
+ e.until = Ge(a);
1443
1443
  break;
1444
1444
  case "BYEASTER":
1445
1445
  e.byeaster = Number(a);
@@ -1452,23 +1452,23 @@ function Si(n) {
1452
1452
  function jn(n) {
1453
1453
  if (n.indexOf(",") !== -1) {
1454
1454
  var t = n.split(",");
1455
- return t.map(xi);
1455
+ return t.map(Ti);
1456
1456
  }
1457
- return xi(n);
1457
+ return Ti(n);
1458
1458
  }
1459
- function xi(n) {
1459
+ function Ti(n) {
1460
1460
  return /^[+-]?\d+$/.test(n) ? Number(n) : n;
1461
1461
  }
1462
- function Kn(n) {
1462
+ function Vn(n) {
1463
1463
  var t = n.split(",");
1464
1464
  return t.map(function(e) {
1465
1465
  if (e.length === 2)
1466
- return ut[e];
1466
+ return ft[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 = ut[r].weekday;
1471
- return new Q(o, s);
1470
+ var s = Number(i[1]), r = i[2], o = ft[r].weekday;
1471
+ return new it(o, s);
1472
1472
  });
1473
1473
  }
1474
1474
  var Se = (
@@ -1486,40 +1486,40 @@ var Se = (
1486
1486
  enumerable: !1,
1487
1487
  configurable: !0
1488
1488
  }), n.prototype.toString = function() {
1489
- var t = Xe(this.date.getTime(), this.isUTC);
1489
+ var t = Ze(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 : Rn(this.date, this.tzid);
1494
+ return this.isUTC ? this.date : Pn(this.date, this.tzid);
1495
1495
  }, n;
1496
1496
  })()
1497
1497
  );
1498
- function Le(n) {
1499
- for (var t = [], e = "", i = Object.keys(n), s = Object.keys(Qe), r = 0; r < i.length; r++)
1500
- if (i[r] !== "tzid" && H(s, i[r])) {
1498
+ function ze(n) {
1499
+ for (var t = [], e = "", i = Object.keys(n), s = Object.keys(ti), r = 0; r < i.length; r++)
1500
+ if (i[r] !== "tzid" && N(s, i[r])) {
1501
1501
  var o = i[r].toUpperCase(), a = n[i[r]], l = "";
1502
- if (!(!W(a) || rt(a) && !a.length)) {
1502
+ if (!(!K(a) || ot(a) && !a.length)) {
1503
1503
  switch (o) {
1504
1504
  case "FREQ":
1505
- l = T.FREQUENCIES[n.freq];
1505
+ l = S.FREQUENCIES[n.freq];
1506
1506
  break;
1507
1507
  case "WKST":
1508
- ft(a) ? l = new Q(a).toString() : l = a.toString();
1508
+ pt(a) ? l = new it(a).toString() : l = a.toString();
1509
1509
  break;
1510
1510
  case "BYWEEKDAY":
1511
- o = "BYDAY", l = Mn(a).map(function(f) {
1512
- return f instanceof Q ? f : rt(f) ? new Q(f[0], f[1]) : new Q(f);
1511
+ o = "BYDAY", l = An(a).map(function(f) {
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 = Vn(a, n.tzid);
1516
+ e = Xn(a, n.tzid);
1517
1517
  break;
1518
1518
  case "UNTIL":
1519
- l = Xe(a, !n.tzid);
1519
+ l = Ze(a, !n.tzid);
1520
1520
  break;
1521
1521
  default:
1522
- if (rt(a)) {
1522
+ if (ot(a)) {
1523
1523
  for (var c = [], h = 0; h < a.length; h++)
1524
1524
  c[h] = String(a[h]);
1525
1525
  l = c.toString();
@@ -1530,42 +1530,42 @@ function Le(n) {
1530
1530
  }
1531
1531
  }
1532
1532
  var d = t.map(function(f) {
1533
- var v = f[0], g = f[1];
1534
- return "".concat(v, "=").concat(g.toString());
1533
+ var v = f[0], p = f[1];
1534
+ return "".concat(v, "=").concat(p.toString());
1535
1535
  }).join(";"), u = "";
1536
1536
  return d !== "" && (u = "RRULE:".concat(d)), [e, u].filter(function(f) {
1537
1537
  return !!f;
1538
1538
  }).join(`
1539
1539
  `);
1540
1540
  }
1541
- function Vn(n, t) {
1541
+ function Xn(n, t) {
1542
1542
  return n ? "DTSTART" + new Se(new Date(n), t).toString() : "";
1543
1543
  }
1544
- function Xn(n, t) {
1544
+ function Zn(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 Zn = (
1549
+ var Gn = (
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 ? He(e) : yi(e)), t === "all" ? this.all = e : (i._value = e, this[t].push(i));
1556
+ e && (e = e instanceof Date ? Ne(e) : bi(e)), t === "all" ? this.all = e : (i._value = e, this[t].push(i));
1557
1557
  }, n.prototype._cacheGet = function(t, e) {
1558
1558
  var i = !1, s = e ? Object.keys(e) : [], r = function(h) {
1559
1559
  for (var d = 0; d < s.length; d++) {
1560
1560
  var u = s[d];
1561
- if (!Xn(e[u], h[u]))
1561
+ if (!Zn(e[u], h[u]))
1562
1562
  return !0;
1563
1563
  }
1564
1564
  return !1;
1565
1565
  }, o = this[t];
1566
1566
  if (t === "all")
1567
1567
  i = this.all;
1568
- else if (rt(o))
1568
+ else if (ot(o))
1569
1569
  for (var a = 0; a < o.length; a++) {
1570
1570
  var l = o[a];
1571
1571
  if (!(s.length && r(l))) {
@@ -1574,99 +1574,99 @@ var Zn = (
1574
1574
  }
1575
1575
  }
1576
1576
  if (!i && this.all) {
1577
- for (var c = new Bt(t, e), a = 0; a < this.all.length && c.accept(this.all[a]); a++)
1577
+ for (var c = new qt(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 rt(i) ? yi(i) : i instanceof Date ? He(i) : i;
1581
+ return ot(i) ? bi(i) : i instanceof Date ? Ne(i) : i;
1582
1582
  }, n;
1583
1583
  })()
1584
- ), Gn = p(p(p(p(p(p(p(p(p(p(p(p(p([], N(1, 31), !0), N(2, 28), !0), N(3, 31), !0), N(4, 30), !0), N(5, 31), !0), N(6, 30), !0), N(7, 31), !0), N(8, 31), !0), N(9, 30), !0), N(10, 31), !0), N(11, 30), !0), N(12, 31), !0), N(1, 7), !0), Jn = p(p(p(p(p(p(p(p(p(p(p(p(p([], N(1, 31), !0), N(2, 29), !0), N(3, 31), !0), N(4, 30), !0), N(5, 31), !0), N(6, 30), !0), N(7, 31), !0), N(8, 31), !0), N(9, 30), !0), N(10, 31), !0), N(11, 30), !0), N(12, 31), !0), N(1, 7), !0), Qn = pt(1, 29), ts = pt(1, 30), Ct = pt(1, 31), Z = pt(1, 32), es = p(p(p(p(p(p(p(p(p(p(p(p(p([], Z, !0), ts, !0), Z, !0), Ct, !0), Z, !0), Ct, !0), Z, !0), Z, !0), Ct, !0), Z, !0), Ct, !0), Z, !0), Z.slice(0, 7), !0), is = p(p(p(p(p(p(p(p(p(p(p(p(p([], Z, !0), Qn, !0), Z, !0), Ct, !0), Z, !0), Ct, !0), Z, !0), Z, !0), Ct, !0), Z, !0), Ct, !0), Z, !0), Z.slice(0, 7), !0), ns = pt(-28, 0), ss = pt(-29, 0), $t = pt(-30, 0), G = pt(-31, 0), rs = p(p(p(p(p(p(p(p(p(p(p(p(p([], G, !0), ss, !0), G, !0), $t, !0), G, !0), $t, !0), G, !0), G, !0), $t, !0), G, !0), $t, !0), G, !0), G.slice(0, 7), !0), os = p(p(p(p(p(p(p(p(p(p(p(p(p([], G, !0), ns, !0), G, !0), $t, !0), G, !0), $t, !0), G, !0), G, !0), $t, !0), G, !0), $t, !0), G, !0), G.slice(0, 7), !0), as = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366], ls = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365], Ti = (function() {
1584
+ ), Jn = g(g(g(g(g(g(g(g(g(g(g(g(g([], _(1, 31), !0), _(2, 28), !0), _(3, 31), !0), _(4, 30), !0), _(5, 31), !0), _(6, 30), !0), _(7, 31), !0), _(8, 31), !0), _(9, 30), !0), _(10, 31), !0), _(11, 30), !0), _(12, 31), !0), _(1, 7), !0), Qn = g(g(g(g(g(g(g(g(g(g(g(g(g([], _(1, 31), !0), _(2, 29), !0), _(3, 31), !0), _(4, 30), !0), _(5, 31), !0), _(6, 30), !0), _(7, 31), !0), _(8, 31), !0), _(9, 30), !0), _(10, 31), !0), _(11, 30), !0), _(12, 31), !0), _(1, 7), !0), ts = vt(1, 29), es = vt(1, 30), $t = vt(1, 31), tt = vt(1, 32), is = g(g(g(g(g(g(g(g(g(g(g(g(g([], tt, !0), es, !0), tt, !0), $t, !0), tt, !0), $t, !0), tt, !0), tt, !0), $t, !0), tt, !0), $t, !0), tt, !0), tt.slice(0, 7), !0), ns = g(g(g(g(g(g(g(g(g(g(g(g(g([], tt, !0), ts, !0), tt, !0), $t, !0), tt, !0), $t, !0), tt, !0), tt, !0), $t, !0), tt, !0), $t, !0), tt, !0), tt.slice(0, 7), !0), ss = vt(-28, 0), rs = vt(-29, 0), Mt = vt(-30, 0), et = vt(-31, 0), os = g(g(g(g(g(g(g(g(g(g(g(g(g([], et, !0), rs, !0), et, !0), Mt, !0), et, !0), Mt, !0), et, !0), et, !0), Mt, !0), et, !0), Mt, !0), et, !0), et.slice(0, 7), !0), as = g(g(g(g(g(g(g(g(g(g(g(g(g([], et, !0), ss, !0), et, !0), Mt, !0), et, !0), Mt, !0), et, !0), et, !0), Mt, !0), et, !0), Mt, !0), et, !0), et.slice(0, 7), !0), ls = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366], cs = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365], ki = (function() {
1585
1585
  for (var n = [], t = 0; t < 55; t++)
1586
- n = n.concat(pt(7));
1586
+ n = n.concat(vt(7));
1587
1587
  return n;
1588
1588
  })();
1589
- function cs(n, t) {
1590
- var e = Pt(n, 1, 1), i = ne(n) ? 366 : 365, s = ne(n + 1) ? 366 : 365, r = Pe(e), o = Vt(e), a = ot(ot({ yearlen: i, nextyearlen: s, yearordinal: r, yearweekday: o }, hs(n)), { wnomask: null });
1589
+ function hs(n, t) {
1590
+ var e = Yt(n, 1, 1), i = se(n) ? 366 : 365, s = se(n + 1) ? 366 : 365, r = Ye(e), o = Xt(e), a = at(at({ yearlen: i, nextyearlen: s, yearordinal: r, yearweekday: o }, ds(n)), { wnomask: null });
1591
1591
  if (gt(t.byweekno))
1592
1592
  return a;
1593
- a.wnomask = N(0, i + 7);
1594
- var l, c, h = l = ct(7 - o + t.wkst, 7);
1595
- h >= 4 ? (h = 0, c = a.yearlen + ct(o - t.wkst, 7)) : c = i - h;
1596
- for (var d = Math.floor(c / 7), u = ct(c, 7), f = Math.floor(d + u / 4), v = 0; v < t.byweekno.length; v++) {
1597
- var g = t.byweekno[v];
1598
- if (g < 0 && (g += f + 1), g > 0 && g <= f) {
1593
+ a.wnomask = _(0, i + 7);
1594
+ var l, c, h = l = ht(7 - o + t.wkst, 7);
1595
+ h >= 4 ? (h = 0, c = a.yearlen + ht(o - t.wkst, 7)) : c = i - h;
1596
+ for (var d = Math.floor(c / 7), u = ht(c, 7), f = Math.floor(d + u / 4), v = 0; v < t.byweekno.length; v++) {
1597
+ var p = t.byweekno[v];
1598
+ if (p < 0 && (p += f + 1), p > 0 && p <= f) {
1599
1599
  var m = void 0;
1600
- g > 1 ? (m = h + (g - 1) * 7, h !== l && (m -= 7 - l)) : m = h;
1600
+ p > 1 ? (m = h + (p - 1) * 7, h !== l && (m -= 7 - l)) : m = h;
1601
1601
  for (var b = 0; b < 7 && (a.wnomask[m] = 1, m++, a.wdaymask[m] !== t.wkst); b++)
1602
1602
  ;
1603
1603
  }
1604
1604
  }
1605
- if (H(t.byweekno, 1)) {
1605
+ if (N(t.byweekno, 1)) {
1606
1606
  var m = h + f * 7;
1607
1607
  if (h !== l && (m -= 7 - l), m < i)
1608
1608
  for (var v = 0; v < 7 && (a.wnomask[m] = 1, m += 1, a.wdaymask[m] !== t.wkst); v++)
1609
1609
  ;
1610
1610
  }
1611
1611
  if (h) {
1612
- var $ = void 0;
1613
- if (H(t.byweekno, -1))
1614
- $ = -1;
1612
+ var C = void 0;
1613
+ if (N(t.byweekno, -1))
1614
+ C = -1;
1615
1615
  else {
1616
- var I = Vt(Pt(n - 1, 1, 1)), z = ct(7 - I.valueOf() + t.wkst, 7), C = ne(n - 1) ? 366 : 365, k = void 0;
1617
- z >= 4 ? (z = 0, k = C + ct(I - t.wkst, 7)) : k = i - h, $ = Math.floor(52 + ct(k, 7) / 4);
1616
+ var I = Xt(Yt(n - 1, 1, 1)), z = ht(7 - I.valueOf() + t.wkst, 7), D = se(n - 1) ? 366 : 365, T = void 0;
1617
+ z >= 4 ? (z = 0, T = D + ht(I - t.wkst, 7)) : T = i - h, C = Math.floor(52 + ht(T, 7) / 4);
1618
1618
  }
1619
- if (H(t.byweekno, $))
1619
+ if (N(t.byweekno, C))
1620
1620
  for (var m = 0; m < h; m++)
1621
1621
  a.wnomask[m] = 1;
1622
1622
  }
1623
1623
  return a;
1624
1624
  }
1625
- function hs(n) {
1626
- var t = ne(n) ? 366 : 365, e = Pt(n, 1, 1), i = Vt(e);
1625
+ function ds(n) {
1626
+ var t = se(n) ? 366 : 365, e = Yt(n, 1, 1), i = Xt(e);
1627
1627
  return t === 365 ? {
1628
- mmask: Gn,
1628
+ mmask: Jn,
1629
+ mdaymask: ns,
1630
+ nmdaymask: as,
1631
+ wdaymask: ki.slice(i),
1632
+ mrange: cs
1633
+ } : {
1634
+ mmask: Qn,
1629
1635
  mdaymask: is,
1630
1636
  nmdaymask: os,
1631
- wdaymask: Ti.slice(i),
1637
+ wdaymask: ki.slice(i),
1632
1638
  mrange: ls
1633
- } : {
1634
- mmask: Jn,
1635
- mdaymask: es,
1636
- nmdaymask: rs,
1637
- wdaymask: Ti.slice(i),
1638
- mrange: as
1639
1639
  };
1640
1640
  }
1641
- function ds(n, t, e, i, s, r) {
1641
+ function us(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 === T.YEARLY)
1647
+ if (r.freq === S.YEARLY)
1648
1648
  if (gt(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 === T.MONTHLY && (a = [i.slice(t - 1, t + 1)]);
1653
+ else r.freq === S.MONTHLY && (a = [i.slice(t - 1, t + 1)]);
1654
1654
  if (gt(a))
1655
1655
  return o;
1656
- o.nwdaymask = N(0, e);
1656
+ o.nwdaymask = _(0, e);
1657
1657
  for (var l = 0; l < a.length; l++)
1658
1658
  for (var c = a[l], h = c[0], d = c[1] - 1, u = 0; u < r.bynweekday.length; u++) {
1659
- var f = void 0, v = r.bynweekday[u], g = v[0], m = v[1];
1660
- m < 0 ? (f = d + (m + 1) * 7, f -= ct(s[f] - g, 7)) : (f = h + (m - 1) * 7, f += ct(7 - s[f] + g, 7)), h <= f && f <= d && (o.nwdaymask[f] = 1);
1659
+ var f = void 0, v = r.bynweekday[u], p = v[0], m = v[1];
1660
+ m < 0 ? (f = d + (m + 1) * 7, f -= ht(s[f] - p, 7)) : (f = h + (m - 1) * 7, f += ht(7 - s[f] + p, 7)), h <= f && f <= d && (o.nwdaymask[f] = 1);
1661
1661
  }
1662
1662
  return o;
1663
1663
  }
1664
- function us(n, t) {
1664
+ function fs(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, h = Math.floor(s / 4), d = s % 4, u = Math.floor(32 + 2 * o + 2 * h - c - d) % 7, f = Math.floor((e + 11 * c + 22 * u) / 451), v = Math.floor((c + u - 7 * f + 114) / 31), g = (c + u - 7 * f + 114) % 31 + 1, m = Date.UTC(n, v - 1, g + t), b = Date.UTC(n, 0, 1);
1666
+ var e = n % 19, i = Math.floor(n / 100), s = n % 100, r = Math.floor(i / 4), o = i % 4, a = Math.floor((i + 8) / 25), l = Math.floor((i - a + 1) / 3), c = Math.floor(19 * e + i - r - l + 15) % 30, h = Math.floor(s / 4), d = s % 4, u = Math.floor(32 + 2 * o + 2 * h - c - d) % 7, f = Math.floor((e + 11 * c + 22 * u) / 451), v = Math.floor((c + u - 7 * f + 114) / 31), p = (c + u - 7 * f + 114) % 31 + 1, m = Date.UTC(n, v - 1, p + t), b = Date.UTC(n, 0, 1);
1667
1667
  return [Math.ceil((m - b) / (1e3 * 60 * 60 * 24))];
1668
1668
  }
1669
- var fs = (
1669
+ var ps = (
1670
1670
  /** @class */
1671
1671
  (function() {
1672
1672
  function n(t) {
@@ -1674,11 +1674,11 @@ var fs = (
1674
1674
  }
1675
1675
  return n.prototype.rebuild = function(t, e) {
1676
1676
  var i = this.options;
1677
- if (t !== this.lastyear && (this.yearinfo = cs(t, i)), q(i.bynweekday) && (e !== this.lastmonth || t !== this.lastyear)) {
1677
+ if (t !== this.lastyear && (this.yearinfo = hs(t, i)), X(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 = ds(t, e, r, o, a, i);
1679
+ this.monthinfo = us(t, e, r, o, a, i);
1680
1680
  }
1681
- W(i.byeaster) && (this.eastermask = us(t, i.byeaster));
1681
+ K(i.byeaster) && (this.eastermask = fs(t, i.byeaster));
1682
1682
  }, Object.defineProperty(n.prototype, "lastyear", {
1683
1683
  get: function() {
1684
1684
  return this.monthinfo ? this.monthinfo.lastyear : null;
@@ -1752,30 +1752,30 @@ var fs = (
1752
1752
  enumerable: !1,
1753
1753
  configurable: !0
1754
1754
  }), n.prototype.ydayset = function() {
1755
- return [pt(this.yearlen), 0, this.yearlen];
1755
+ return [vt(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 = N(null, this.yearlen), o = i; o < s; o++)
1757
+ for (var i = this.mrange[e - 1], s = this.mrange[e], r = _(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 = N(null, this.yearlen + 7), r = Pe(Pt(t, e, i)) - this.yearordinal, o = r, a = 0; a < 7 && (s[r] = r, ++r, this.wdaymask[r] !== this.options.wkst); a++)
1761
+ for (var s = _(null, this.yearlen + 7), r = Ye(Yt(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 = N(null, this.yearlen), r = Pe(Pt(t, e, i)) - this.yearordinal;
1765
+ var s = _(null, this.yearlen), r = Ye(Yt(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
- }), le(o), o;
1771
+ }), ce(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 we(t, e, o, s);
1774
+ return new Ee(t, e, o, s);
1775
1775
  });
1776
- return le(r), r;
1776
+ return ce(r), r;
1777
1777
  }, n.prototype.stimeset = function(t, e, i, s) {
1778
- return [new we(t, e, i, s)];
1778
+ return [new Ee(t, e, i, s)];
1779
1779
  }, n.prototype.getdayset = function(t) {
1780
1780
  switch (t) {
1781
1781
  case R.YEARLY:
@@ -1804,91 +1804,91 @@ var fs = (
1804
1804
  function gs(n, t, e, i, s, r) {
1805
1805
  for (var o = [], a = 0; a < n.length; a++) {
1806
1806
  var l = void 0, c = void 0, h = n[a];
1807
- h < 0 ? (l = Math.floor(h / t.length), c = ct(h, t.length)) : (l = Math.floor((h - 1) / t.length), c = ct(h - 1, t.length));
1807
+ h < 0 ? (l = Math.floor(h / t.length), c = ht(h, t.length)) : (l = Math.floor((h - 1) / t.length), c = ht(h - 1, t.length));
1808
1808
  for (var d = [], u = e; u < i; u++) {
1809
1809
  var f = r[u];
1810
- W(f) && d.push(f);
1810
+ K(f) && d.push(f);
1811
1811
  }
1812
1812
  var v = void 0;
1813
1813
  l < 0 ? v = d.slice(l)[0] : v = d[l];
1814
- var g = t[c], m = Zi(s.yearordinal + v), b = Gi(m, g);
1815
- H(o, b) || o.push(b);
1814
+ var p = t[c], m = Gi(s.yearordinal + v), b = Ji(m, p);
1815
+ N(o, b) || o.push(b);
1816
1816
  }
1817
- return le(o), o;
1817
+ return ce(o), o;
1818
1818
  }
1819
- function tn(n, t) {
1819
+ function en(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 wt(n);
1823
- var l = Wn.fromDate(e), c = new fs(t);
1822
+ return Et(n);
1823
+ var l = Fn.fromDate(e), c = new ps(t);
1824
1824
  c.rebuild(l.year, l.month);
1825
- for (var h = ms(c, l, t); ; ) {
1826
- var d = c.getdayset(i)(l.year, l.month, l.day), u = d[0], f = d[1], v = d[2], g = vs(u, f, v, c, t);
1827
- if (q(o))
1825
+ for (var h = ys(c, l, t); ; ) {
1826
+ var d = c.getdayset(i)(l.year, l.month, l.day), u = d[0], f = d[1], v = d[2], p = ms(u, f, v, c, t);
1827
+ if (X(o))
1828
1828
  for (var m = gs(o, h, f, v, c, u), b = 0; b < m.length; b++) {
1829
- var $ = m[b];
1830
- if (r && $ > r)
1831
- return wt(n);
1832
- if ($ >= e) {
1833
- var I = ki($, t);
1829
+ var C = m[b];
1830
+ if (r && C > r)
1831
+ return Et(n);
1832
+ if (C >= e) {
1833
+ var I = Di(C, t);
1834
1834
  if (!n.accept(I) || a && (--a, !a))
1835
- return wt(n);
1835
+ return Et(n);
1836
1836
  }
1837
1837
  }
1838
1838
  else
1839
1839
  for (var b = f; b < v; b++) {
1840
1840
  var z = u[b];
1841
- if (W(z))
1842
- for (var C = Zi(c.yearordinal + z), k = 0; k < h.length; k++) {
1843
- var M = h[k], $ = Gi(C, M);
1844
- if (r && $ > r)
1845
- return wt(n);
1846
- if ($ >= e) {
1847
- var I = ki($, t);
1841
+ if (K(z))
1842
+ for (var D = Gi(c.yearordinal + z), T = 0; T < h.length; T++) {
1843
+ var $ = h[T], C = Ji(D, $);
1844
+ if (r && C > r)
1845
+ return Et(n);
1846
+ if (C >= e) {
1847
+ var I = Di(C, t);
1848
1848
  if (!n.accept(I) || a && (--a, !a))
1849
- return wt(n);
1849
+ return Et(n);
1850
1850
  }
1851
1851
  }
1852
1852
  }
1853
- if (t.interval === 0 || (l.add(t, g), l.year > Ki))
1854
- return wt(n);
1855
- Je(i) || (h = c.gettimeset(i)(l.hour, l.minute, l.second, 0)), c.rebuild(l.year, l.month);
1853
+ if (t.interval === 0 || (l.add(t, p), l.year > Vi))
1854
+ return Et(n);
1855
+ Qe(i) || (h = c.gettimeset(i)(l.hour, l.minute, l.second, 0)), c.rebuild(l.year, l.month);
1856
1856
  }
1857
1857
  }
1858
- function ps(n, t, e) {
1858
+ function vs(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 q(i) && !H(i, n.mmask[t]) || q(s) && !n.wnomask[t] || q(r) && !H(r, n.wdaymask[t]) || q(n.nwdaymask) && !n.nwdaymask[t] || o !== null && !H(n.eastermask, t) || (q(a) || q(l)) && !H(a, n.mdaymask[t]) && !H(l, n.nmdaymask[t]) || q(c) && (t < n.yearlen && !H(c, t + 1) && !H(c, -n.yearlen + t) || t >= n.yearlen && !H(c, t + 1 - n.yearlen) && !H(c, -n.nextyearlen + t - n.yearlen));
1860
+ return X(i) && !N(i, n.mmask[t]) || X(s) && !n.wnomask[t] || X(r) && !N(r, n.wdaymask[t]) || X(n.nwdaymask) && !n.nwdaymask[t] || o !== null && !N(n.eastermask, t) || (X(a) || X(l)) && !N(a, n.mdaymask[t]) && !N(l, n.nmdaymask[t]) || X(c) && (t < n.yearlen && !N(c, t + 1) && !N(c, -n.yearlen + t) || t >= n.yearlen && !N(c, t + 1 - n.yearlen) && !N(c, -n.nextyearlen + t - n.yearlen));
1861
1861
  }
1862
- function ki(n, t) {
1862
+ function Di(n, t) {
1863
1863
  return new Se(n, t.tzid).rezonedDate();
1864
1864
  }
1865
- function wt(n) {
1865
+ function Et(n) {
1866
1866
  return n.getValue();
1867
1867
  }
1868
- function vs(n, t, e, i, s) {
1868
+ function ms(n, t, e, i, s) {
1869
1869
  for (var r = !1, o = t; o < e; o++) {
1870
1870
  var a = n[o];
1871
- r = ps(i, a, s), r && (n[a] = null);
1871
+ r = vs(i, a, s), r && (n[a] = null);
1872
1872
  }
1873
1873
  return r;
1874
1874
  }
1875
- function ms(n, t, e) {
1875
+ function ys(n, t, e) {
1876
1876
  var i = e.freq, s = e.byhour, r = e.byminute, o = e.bysecond;
1877
- return Je(i) ? Bn(e) : i >= T.HOURLY && q(s) && !H(s, t.hour) || i >= T.MINUTELY && q(r) && !H(r, t.minute) || i >= T.SECONDLY && q(o) && !H(o, t.second) ? [] : n.gettimeset(i)(t.hour, t.minute, t.second, t.millisecond);
1877
+ return Qe(i) ? qn(e) : i >= S.HOURLY && X(s) && !N(s, t.hour) || i >= S.MINUTELY && X(r) && !N(r, t.minute) || i >= S.SECONDLY && X(o) && !N(o, t.second) ? [] : n.gettimeset(i)(t.hour, t.minute, t.second, t.millisecond);
1878
1878
  }
1879
- var ut = {
1880
- MO: new Q(0),
1881
- TU: new Q(1),
1882
- WE: new Q(2),
1883
- TH: new Q(3),
1884
- FR: new Q(4),
1885
- SA: new Q(5),
1886
- SU: new Q(6)
1887
- }, Qe = {
1879
+ var ft = {
1880
+ MO: new it(0),
1881
+ TU: new it(1),
1882
+ WE: new it(2),
1883
+ TH: new it(3),
1884
+ FR: new it(4),
1885
+ SA: new it(5),
1886
+ SU: new it(6)
1887
+ }, ti = {
1888
1888
  freq: R.YEARLY,
1889
1889
  dtstart: null,
1890
1890
  interval: 1,
1891
- wkst: ut.MO,
1891
+ wkst: ft.MO,
1892
1892
  count: null,
1893
1893
  until: null,
1894
1894
  tzid: null,
@@ -1904,22 +1904,22 @@ var ut = {
1904
1904
  byminute: null,
1905
1905
  bysecond: null,
1906
1906
  byeaster: null
1907
- }, ys = Object.keys(Qe), T = (
1907
+ }, bs = Object.keys(ti), S = (
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 Zn(), this.origOptions = Qi(t);
1912
- var i = Fn(t).parsedOptions;
1911
+ t === void 0 && (t = {}), e === void 0 && (e = !1), this._cache = e ? null : new Gn(), this.origOptions = tn(t);
1912
+ var i = Bn(t).parsedOptions;
1913
1913
  this.options = i;
1914
1914
  }
1915
1915
  return n.parseText = function(t, e) {
1916
- return Ji(t, e);
1916
+ return Qi(t, e);
1917
1917
  }, n.fromText = function(t, e) {
1918
- return Un(t, e);
1918
+ return Ln(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 tn(t, this.options);
1922
+ return en(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 ut = {
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 wi("all", {}, t));
1930
+ return this._iter(new Ei("all", {}, t));
1931
1931
  var e = this._cacheGet("all");
1932
- return e === !1 && (e = this._iter(new Bt("all", {})), this._cacheAdd("all", e)), e;
1932
+ return e === !1 && (e = this._iter(new qt("all", {})), this._cacheAdd("all", e)), e;
1933
1933
  }, n.prototype.between = function(t, e, i, s) {
1934
- if (i === void 0 && (i = !1), !ee(t) || !ee(e))
1934
+ if (i === void 0 && (i = !1), !ie(t) || !ie(e))
1935
1935
  throw new Error("Invalid date passed in to RRule.between");
1936
1936
  var r = {
1937
1937
  before: e,
@@ -1939,27 +1939,27 @@ var ut = {
1939
1939
  inc: i
1940
1940
  };
1941
1941
  if (s)
1942
- return this._iter(new wi("between", r, s));
1942
+ return this._iter(new Ei("between", r, s));
1943
1943
  var o = this._cacheGet("between", r);
1944
- return o === !1 && (o = this._iter(new Bt("between", r)), this._cacheAdd("between", o, r)), o;
1944
+ return o === !1 && (o = this._iter(new qt("between", r)), this._cacheAdd("between", o, r)), o;
1945
1945
  }, n.prototype.before = function(t, e) {
1946
- if (e === void 0 && (e = !1), !ee(t))
1946
+ if (e === void 0 && (e = !1), !ie(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 Bt("before", i)), this._cacheAdd("before", s, i)), s;
1949
+ return s === !1 && (s = this._iter(new qt("before", i)), this._cacheAdd("before", s, i)), s;
1950
1950
  }, n.prototype.after = function(t, e) {
1951
- if (e === void 0 && (e = !1), !ee(t))
1951
+ if (e === void 0 && (e = !1), !ie(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 Bt("after", i)), this._cacheAdd("after", s, i)), s;
1954
+ return s === !1 && (s = this._iter(new qt("after", i)), this._cacheAdd("after", s, i)), s;
1955
1955
  }, n.prototype.count = function() {
1956
1956
  return this.all().length;
1957
1957
  }, n.prototype.toString = function() {
1958
- return Le(this.origOptions);
1958
+ return ze(this.origOptions);
1959
1959
  }, n.prototype.toText = function(t, e, i) {
1960
- return Ln(this, t, e, i);
1960
+ return zn(this, t, e, i);
1961
1961
  }, n.prototype.isFullyConvertibleToText = function() {
1962
- return zn(this);
1962
+ return Wn(this);
1963
1963
  }, n.prototype.clone = function() {
1964
1964
  return new n(this.origOptions);
1965
1965
  }, n.FREQUENCIES = [
@@ -1970,15 +1970,15 @@ var ut = {
1970
1970
  "HOURLY",
1971
1971
  "MINUTELY",
1972
1972
  "SECONDLY"
1973
- ], n.YEARLY = R.YEARLY, n.MONTHLY = R.MONTHLY, n.WEEKLY = R.WEEKLY, n.DAILY = R.DAILY, n.HOURLY = R.HOURLY, n.MINUTELY = R.MINUTELY, n.SECONDLY = R.SECONDLY, n.MO = ut.MO, n.TU = ut.TU, n.WE = ut.WE, n.TH = ut.TH, n.FR = ut.FR, n.SA = ut.SA, n.SU = ut.SU, n.parseString = Ue, n.optionsToString = Le, n;
1973
+ ], n.YEARLY = R.YEARLY, n.MONTHLY = R.MONTHLY, n.WEEKLY = R.WEEKLY, n.DAILY = R.DAILY, n.HOURLY = R.HOURLY, n.MINUTELY = R.MINUTELY, n.SECONDLY = R.SECONDLY, n.MO = ft.MO, n.TU = ft.TU, n.WE = ft.WE, n.TH = ft.TH, n.FR = ft.FR, n.SA = ft.SA, n.SU = ft.SU, n.parseString = Le, n.optionsToString = ze, n;
1974
1974
  })()
1975
1975
  );
1976
- function bs(n, t, e, i, s, r) {
1976
+ function ws(n, t, e, i, s, r) {
1977
1977
  var o = {}, a = n.accept;
1978
1978
  function l(u, f) {
1979
1979
  e.forEach(function(v) {
1980
- v.between(u, f, !0).forEach(function(g) {
1981
- o[Number(g)] = !0;
1980
+ v.between(u, f, !0).forEach(function(p) {
1981
+ o[Number(p)] = !0;
1982
1982
  });
1983
1983
  });
1984
1984
  }
@@ -1998,10 +1998,10 @@ function bs(n, t, e, i, s, r) {
1998
1998
  break;
1999
1999
  }
2000
2000
  t.forEach(function(u) {
2001
- tn(n, u.options);
2001
+ en(n, u.options);
2002
2002
  });
2003
2003
  var d = n._result;
2004
- switch (le(d), n.method) {
2004
+ switch (ce(d), n.method) {
2005
2005
  case "all":
2006
2006
  case "between":
2007
2007
  return d;
@@ -2011,7 +2011,7 @@ function bs(n, t, e, i, s, r) {
2011
2011
  return d.length && d[0] || null;
2012
2012
  }
2013
2013
  }
2014
- var Di = {
2014
+ var Ci = {
2015
2015
  dtstart: null,
2016
2016
  cache: !1,
2017
2017
  unfold: !1,
@@ -2019,29 +2019,29 @@ var Di = {
2019
2019
  compatible: !1,
2020
2020
  tzid: null
2021
2021
  };
2022
- function ws(n, t) {
2023
- var e = [], i = [], s = [], r = [], o = Ee(n), a = o.dtstart, l = o.tzid, c = ks(n, t.unfold);
2022
+ function Es(n, t) {
2023
+ var e = [], i = [], s = [], r = [], o = xe(n), a = o.dtstart, l = o.tzid, c = Ds(n, t.unfold);
2024
2024
  return c.forEach(function(h) {
2025
2025
  var d;
2026
2026
  if (h) {
2027
- var u = Ts(h), f = u.name, v = u.parms, g = u.value;
2027
+ var u = ks(h), f = u.name, v = u.parms, p = u.value;
2028
2028
  switch (f.toUpperCase()) {
2029
2029
  case "RRULE":
2030
2030
  if (v.length)
2031
2031
  throw new Error("unsupported RRULE parm: ".concat(v.join(",")));
2032
- e.push(Ue(h));
2032
+ e.push(Le(h));
2033
2033
  break;
2034
2034
  case "RDATE":
2035
2035
  var m = (d = /RDATE(?:;TZID=([^:=]+))?/i.exec(h)) !== null && d !== void 0 ? d : [], b = m[1];
2036
- b && !l && (l = b), i = i.concat(Ci(g, v));
2036
+ b && !l && (l = b), i = i.concat($i(p, v));
2037
2037
  break;
2038
2038
  case "EXRULE":
2039
2039
  if (v.length)
2040
2040
  throw new Error("unsupported EXRULE parm: ".concat(v.join(",")));
2041
- s.push(Ue(g));
2041
+ s.push(Le(p));
2042
2042
  break;
2043
2043
  case "EXDATE":
2044
- r = r.concat(Ci(g, v));
2044
+ r = r.concat($i(p, v));
2045
2045
  break;
2046
2046
  case "DTSTART":
2047
2047
  break;
@@ -2058,51 +2058,51 @@ function ws(n, t) {
2058
2058
  exdatevals: r
2059
2059
  };
2060
2060
  }
2061
- function Es(n, t) {
2062
- var e = ws(n, t), i = e.rrulevals, s = e.rdatevals, r = e.exrulevals, o = e.exdatevals, a = e.dtstart, l = e.tzid, c = t.cache === !1;
2061
+ function xs(n, t) {
2062
+ var e = Es(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 h = new Cs(c);
2064
+ var h = new $s(c);
2065
2065
  return h.dtstart(a), h.tzid(l || void 0), i.forEach(function(u) {
2066
- h.rrule(new T(_e(u, a, l), c));
2066
+ h.rrule(new S(_e(u, a, l), c));
2067
2067
  }), s.forEach(function(u) {
2068
2068
  h.rdate(u);
2069
2069
  }), r.forEach(function(u) {
2070
- h.exrule(new T(_e(u, a, l), c));
2070
+ h.exrule(new S(_e(u, a, l), c));
2071
2071
  }), o.forEach(function(u) {
2072
2072
  h.exdate(u);
2073
2073
  }), t.compatible && t.dtstart && h.rdate(a), h;
2074
2074
  }
2075
2075
  var d = i[0] || {};
2076
- return new T(_e(d, d.dtstart || t.dtstart || a, d.tzid || t.tzid || l), c);
2076
+ return new S(_e(d, d.dtstart || t.dtstart || a, d.tzid || t.tzid || l), c);
2077
2077
  }
2078
- function ze(n, t) {
2079
- return t === void 0 && (t = {}), Es(n, Ss(t));
2078
+ function We(n, t) {
2079
+ return t === void 0 && (t = {}), xs(n, Ss(t));
2080
2080
  }
2081
2081
  function _e(n, t, e) {
2082
- return ot(ot({}, n), { dtstart: t, tzid: e });
2082
+ return at(at({}, n), { dtstart: t, tzid: e });
2083
2083
  }
2084
2084
  function Ss(n) {
2085
- var t = [], e = Object.keys(n), i = Object.keys(Di);
2085
+ var t = [], e = Object.keys(n), i = Object.keys(Ci);
2086
2086
  if (e.forEach(function(s) {
2087
- H(i, s) || t.push(s);
2087
+ N(i, s) || t.push(s);
2088
2088
  }), t.length)
2089
2089
  throw new Error("Invalid options: " + t.join(", "));
2090
- return ot(ot({}, Di), n);
2090
+ return at(at({}, Ci), n);
2091
2091
  }
2092
- function xs(n) {
2092
+ function Ts(n) {
2093
2093
  if (n.indexOf(":") === -1)
2094
2094
  return {
2095
2095
  name: "RRULE",
2096
2096
  value: n
2097
2097
  };
2098
- var t = An(n, ":", 1), e = t[0], i = t[1];
2098
+ var t = On(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 Ts(n) {
2105
- var t = xs(n), e = t.name, i = t.value, s = e.split(";");
2104
+ function ks(n) {
2105
+ var t = Ts(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 Ts(n) {
2111
2111
  value: i
2112
2112
  };
2113
2113
  }
2114
- function ks(n, t) {
2114
+ function Ds(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 ks(n, t) {
2123
2123
  }
2124
2124
  return e;
2125
2125
  }
2126
- function Ds(n) {
2126
+ function Cs(n) {
2127
2127
  n.forEach(function(t) {
2128
2128
  if (!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))
2129
2129
  throw new Error("unsupported RDATE/EXDATE parm: " + t);
2130
2130
  });
2131
2131
  }
2132
- function Ci(n, t) {
2133
- return Ds(t), n.split(",").map(function(e) {
2134
- return Ze(e);
2132
+ function $i(n, t) {
2133
+ return Cs(t), n.split(",").map(function(e) {
2134
+ return Ge(e);
2135
2135
  });
2136
2136
  }
2137
- function $i(n) {
2137
+ function Mi(n) {
2138
2138
  var t = this;
2139
2139
  return function(e) {
2140
2140
  if (e !== void 0 && (t["_".concat(n)] = e), t["_".concat(n)] !== void 0)
@@ -2146,32 +2146,32 @@ function $i(n) {
2146
2146
  }
2147
2147
  };
2148
2148
  }
2149
- var Cs = (
2149
+ var $s = (
2150
2150
  /** @class */
2151
2151
  (function(n) {
2152
- Ge(t, n);
2152
+ Je(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 = $i.apply(i, ["dtstart"]), i.tzid = $i.apply(i, ["tzid"]), i._rrule = [], i._rdate = [], i._exrule = [], i._exdate = [], i;
2156
+ return i.dtstart = Mi.apply(i, ["dtstart"]), i.tzid = Mi.apply(i, ["tzid"]), i._rrule = [], i._rdate = [], i._exrule = [], i._exdate = [], i;
2157
2157
  }
2158
2158
  return t.prototype._iter = function(e) {
2159
- return bs(e, this._rrule, this._exrule, this._rdate, this._exdate, this.tzid());
2159
+ return ws(e, this._rrule, this._exrule, this._rdate, this._exdate, this.tzid());
2160
2160
  }, t.prototype.rrule = function(e) {
2161
- Mi(e, this._rrule);
2161
+ Ai(e, this._rrule);
2162
2162
  }, t.prototype.exrule = function(e) {
2163
- Mi(e, this._exrule);
2163
+ Ai(e, this._exrule);
2164
2164
  }, t.prototype.rdate = function(e) {
2165
- Ai(e, this._rdate);
2165
+ Oi(e, this._rdate);
2166
2166
  }, t.prototype.exdate = function(e) {
2167
- Ai(e, this._exdate);
2167
+ Oi(e, this._exdate);
2168
2168
  }, t.prototype.rrules = function() {
2169
2169
  return this._rrule.map(function(e) {
2170
- return ze(e.toString());
2170
+ return We(e.toString());
2171
2171
  });
2172
2172
  }, t.prototype.exrules = function() {
2173
2173
  return this._exrule.map(function(e) {
2174
- return ze(e.toString());
2174
+ return We(e.toString());
2175
2175
  });
2176
2176
  }, t.prototype.rdates = function() {
2177
2177
  return this._rdate.map(function(e) {
@@ -2183,7 +2183,7 @@ var Cs = (
2183
2183
  });
2184
2184
  }, t.prototype.valueOf = function() {
2185
2185
  var e = [];
2186
- return !this._rrule.length && this._dtstart && (e = e.concat(Le({ dtstart: this._dtstart }))), this._rrule.forEach(function(i) {
2186
+ return !this._rrule.length && this._dtstart && (e = e.concat(ze({ dtstart: this._dtstart }))), this._rrule.forEach(function(i) {
2187
2187
  e = e.concat(i.toString().split(`
2188
2188
  `));
2189
2189
  }), this._exrule.forEach(function(i) {
@@ -2193,7 +2193,7 @@ var Cs = (
2193
2193
  }).filter(function(s) {
2194
2194
  return !/^DTSTART/.test(s);
2195
2195
  }));
2196
- }), this._rdate.length && e.push(Oi("RDATE", this._rdate, this.tzid())), this._exdate.length && e.push(Oi("EXDATE", this._exdate, this.tzid())), e;
2196
+ }), this._rdate.length && e.push(Ii("RDATE", this._rdate, this.tzid())), this._exdate.length && e.push(Ii("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 Cs = (
2209
2209
  return e.exdate(new Date(i.getTime()));
2210
2210
  }), e;
2211
2211
  }, t;
2212
- })(T)
2212
+ })(S)
2213
2213
  );
2214
- function Mi(n, t) {
2215
- if (!(n instanceof T))
2214
+ function Ai(n, t) {
2215
+ if (!(n instanceof S))
2216
2216
  throw new TypeError(String(n) + " is not RRule instance");
2217
- H(t.map(String), String(n)) || t.push(n);
2217
+ N(t.map(String), String(n)) || t.push(n);
2218
2218
  }
2219
- function Ai(n, t) {
2219
+ function Oi(n, t) {
2220
2220
  if (!(n instanceof Date))
2221
2221
  throw new TypeError(String(n) + " is not Date instance");
2222
- H(t.map(Number), Number(n)) || (t.push(n), le(t));
2222
+ N(t.map(Number), Number(n)) || (t.push(n), ce(t));
2223
2223
  }
2224
- function Oi(n, t, e) {
2224
+ function Ii(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 Xe(o.valueOf(), i);
2226
+ return Ze(o.valueOf(), i);
2227
2227
  }).join(",");
2228
2228
  return "".concat(s).concat(r);
2229
2229
  }
2230
- const $s = [
2230
+ const Ms = [
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 $s = [
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
- ], Ms = 12, As = 12, Os = 96;
2239
- class Y {
2238
+ ], As = 12, Os = 12, Is = 96;
2239
+ class L {
2240
2240
  constructor(t) {
2241
- this.startDate = /* @__PURE__ */ new Date(), this.endDate = Y.addDays(/* @__PURE__ */ new Date(), 182), this.weekStart = 0, this.filter = "", this.calendarEvents = /* @__PURE__ */ new Map(), this.selectedEvents = /* @__PURE__ */ new Set(), this.enabledCalendars = /* @__PURE__ */ new Set(), this.sync = (i, s, r) => {
2241
+ this.startDate = /* @__PURE__ */ new Date(), this.endDate = L.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.sync = (i, s, r) => {
2242
2242
  const o = [];
2243
2243
  for (const l of r) {
2244
2244
  const c = {
@@ -2251,18 +2251,16 @@ class Y {
2251
2251
  c.calendar === i && (!c.lastSynced || c.lastSynced < s) && this.calendarEvents.delete(l);
2252
2252
  this.sendEvents();
2253
2253
  const a = /* @__PURE__ */ new Map([[i, s]]);
2254
- this.storage?.sync(o, a).catch((l) => {
2254
+ return this.storage?.sync(o, a).catch((l) => {
2255
2255
  console.error("Failed to persist events:", l);
2256
- }), this.scheduleNotificationsForEvents(o).catch((l) => {
2257
- console.error("Failed to schedule notifications:", l);
2258
- });
2259
- }, this.locale = t?.locale || navigator.language, this.weekStart = t?.weekStart || Y.getWeekStartFromLocale(this.locale), this.startDate = this.getStartOfWeek(Y.addDays(/* @__PURE__ */ new Date(), -182));
2256
+ }), o;
2257
+ }, this.locale = t?.locale || navigator.language, this.weekStart = t?.weekStart || L.getWeekStartFromLocale(this.locale), this.startDate = this.getStartOfWeek(L.addDays(/* @__PURE__ */ new Date(), -182));
2260
2258
  const e = {
2261
2259
  start: (i) => {
2262
2260
  this.controller = i;
2263
2261
  }
2264
2262
  };
2265
- this.stream = new ReadableStream(e), this.storage = t?.storage, this.notificationScheduler = t?.notificationScheduler, this.initPromise = this.loadFromStorage();
2263
+ this.stream = new ReadableStream(e), this.storage = t?.storage, this.initPromise = this.loadFromStorage();
2266
2264
  }
2267
2265
  getFilter() {
2268
2266
  return this.filter;
@@ -2274,38 +2272,7 @@ class Y {
2274
2272
  const t = await this.storage?.loadEvents() || [];
2275
2273
  for (const e of t)
2276
2274
  this.calendarEvents.set(e.id, e);
2277
- this.sendEvents(), this.scheduleNotificationsForEvents(t).catch((e) => {
2278
- console.error("Failed to schedule notifications on load:", e);
2279
- });
2280
- }
2281
- /**
2282
- * Imports VALARM notifications from parsed iCalendar data
2283
- */
2284
- async importNotifications(t) {
2285
- if (this.storage) {
2286
- for (const [e, i] of t)
2287
- await this.storage.setNotifications(e, i);
2288
- console.log(`Imported notifications for ${t.size} events from VALARM`);
2289
- }
2290
- }
2291
- /**
2292
- * Schedules notifications for events using local notification storage
2293
- */
2294
- async scheduleNotificationsForEvents(t) {
2295
- if (!(!this.notificationScheduler || !this.storage))
2296
- try {
2297
- const e = /* @__PURE__ */ new Date(), i = new Date(e.getTime() + 1440 * 60 * 1e3), s = await this.storage.getAllNotifications(), o = t.filter(
2298
- (a) => a.start >= e && a.start <= i
2299
- ).map((a) => ({
2300
- ...a,
2301
- notifications: s.get(a.id) || []
2302
- })).filter((a) => a.notifications.length > 0);
2303
- for (const a of o)
2304
- await this.notificationScheduler.cancelEventNotifications(a.id), await this.notificationScheduler.scheduleEventNotifications(a);
2305
- o.length > 0 && console.log(`Scheduled notifications for ${o.length} events`);
2306
- } catch (e) {
2307
- console.error("Error scheduling notifications:", e);
2308
- }
2275
+ return this.sendEvents(), t;
2309
2276
  }
2310
2277
  setFilter(t) {
2311
2278
  this.filter = t, this.sendEvents();
@@ -2318,15 +2285,15 @@ class Y {
2318
2285
  return [t];
2319
2286
  try {
2320
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"), h = `DTSTART:${`${i}${s}${r}T${o}${a}${l}Z`}
2321
- RRULE:${t.rrule}`, d = ze(h), u = /* @__PURE__ */ new Date();
2288
+ RRULE:${t.rrule}`, d = We(h), u = /* @__PURE__ */ new Date();
2322
2289
  u.setFullYear(u.getFullYear() - 2);
2323
2290
  const f = /* @__PURE__ */ new Date();
2324
- return f.setFullYear(f.getFullYear() + 2), d.between(u, f, !0).map((g) => {
2325
- const m = t.end.getTime() - t.start.getTime(), b = new Date(g.getTime() + m);
2291
+ return f.setFullYear(f.getFullYear() + 2), d.between(u, f, !0).map((p) => {
2292
+ const m = t.end.getTime() - t.start.getTime(), b = new Date(p.getTime() + m);
2326
2293
  return {
2327
2294
  ...t,
2328
- id: `${t.id}-${g.getTime()}`,
2329
- start: g,
2295
+ id: `${t.id}-${p.getTime()}`,
2296
+ start: p,
2330
2297
  end: b
2331
2298
  };
2332
2299
  });
@@ -2451,10 +2418,10 @@ RRULE:${t.rrule}`, d = ze(h), u = /* @__PURE__ */ new Date();
2451
2418
  for (; s < e; ) {
2452
2419
  const r = [];
2453
2420
  for (let l = 0; l < 7; l++)
2454
- r.push(new Date(s)), s = Y.addDays(s, 1);
2421
+ r.push(new Date(s)), s = L.addDays(s, 1);
2455
2422
  const o = r[0], a = r[3];
2456
2423
  o && a && i.push({
2457
- weekNumber: Y.getWeekNumber(o),
2424
+ weekNumber: L.getWeekNumber(o),
2458
2425
  year: a.getFullYear(),
2459
2426
  // Use Thursday for year
2460
2427
  days: r,
@@ -2466,17 +2433,17 @@ RRULE:${t.rrule}`, d = ze(h), u = /* @__PURE__ */ new Date();
2466
2433
  }
2467
2434
  // Extends the date range and returns new weeks added
2468
2435
  extendRange(t) {
2469
- const e = As, i = [];
2436
+ const e = Os, i = [];
2470
2437
  if (t === "past") {
2471
- const s = Y.addDays(this.startDate, -e * 7);
2438
+ const s = L.addDays(this.startDate, -e * 7);
2472
2439
  let r = new Date(s);
2473
2440
  for (; r < this.startDate; ) {
2474
2441
  const o = [];
2475
2442
  for (let c = 0; c < 7; c++)
2476
- o.push(new Date(r)), r = Y.addDays(r, 1);
2443
+ o.push(new Date(r)), r = L.addDays(r, 1);
2477
2444
  const a = o[0], l = o[3];
2478
2445
  a && l && i.push({
2479
- weekNumber: Y.getWeekNumber(a),
2446
+ weekNumber: L.getWeekNumber(a),
2480
2447
  year: l.getFullYear(),
2481
2448
  days: o,
2482
2449
  yOffset: 0,
@@ -2485,15 +2452,15 @@ RRULE:${t.rrule}`, d = ze(h), u = /* @__PURE__ */ new Date();
2485
2452
  }
2486
2453
  this.startDate = s;
2487
2454
  } else {
2488
- const s = Y.addDays(this.endDate, e * 7);
2455
+ const s = L.addDays(this.endDate, e * 7);
2489
2456
  let r = new Date(this.endDate);
2490
2457
  for (; r < s; ) {
2491
2458
  const o = [];
2492
2459
  for (let c = 0; c < 7; c++)
2493
- o.push(new Date(r)), r = Y.addDays(r, 1);
2460
+ o.push(new Date(r)), r = L.addDays(r, 1);
2494
2461
  const a = o[0], l = o[3];
2495
2462
  a && l && i.push({
2496
- weekNumber: Y.getWeekNumber(a),
2463
+ weekNumber: L.getWeekNumber(a),
2497
2464
  year: l.getFullYear(),
2498
2465
  days: o,
2499
2466
  yOffset: 0,
@@ -2505,18 +2472,18 @@ RRULE:${t.rrule}`, d = ze(h), u = /* @__PURE__ */ new Date();
2505
2472
  return i;
2506
2473
  }
2507
2474
  getBufferWeeks() {
2508
- return Ms;
2475
+ return As;
2509
2476
  }
2510
2477
  getMaxWeeks() {
2511
- return Os;
2478
+ return Is;
2512
2479
  }
2513
2480
  trimRange(t, e) {
2514
- t === "past" ? this.startDate = Y.addDays(this.startDate, -e * 7) : this.endDate = Y.addDays(this.endDate, -e * 7);
2481
+ t === "past" ? this.startDate = L.addDays(this.startDate, -e * 7) : this.endDate = L.addDays(this.endDate, -e * 7);
2515
2482
  }
2516
2483
  // Resets the range to be centered around the target date
2517
2484
  resetRangeAroundDate(t) {
2518
2485
  const e = new Date(t);
2519
- return e.setHours(0, 0, 0, 0), this.startDate = this.getStartOfWeek(Y.addDays(e, -182)), this.endDate = Y.addDays(e, 182), this.generateWeeks();
2486
+ return e.setHours(0, 0, 0, 0), this.startDate = this.getStartOfWeek(L.addDays(e, -182)), this.endDate = L.addDays(e, 182), this.generateWeeks();
2520
2487
  }
2521
2488
  getWeekdayNames() {
2522
2489
  const t = new Intl.DateTimeFormat(this.locale, { weekday: "short" }), e = [];
@@ -2551,14 +2518,14 @@ RRULE:${t.rrule}`, d = ze(h), u = /* @__PURE__ */ new Date();
2551
2518
  }
2552
2519
  // Returns timestamp for end of day using pure math (no Date object creation)
2553
2520
  static endOfDayTime(t) {
2554
- return t ? Y.startOfDayTime(t) + 864e5 - 1 : 0;
2521
+ return t ? L.startOfDayTime(t) + 864e5 - 1 : 0;
2555
2522
  }
2556
2523
  static getWeekStartFromLocale(t) {
2557
2524
  const e = ["en-US", "en-CA", "ja-JP", "ko-KR", "zh-TW"], i = t.split("-")[0];
2558
2525
  return e.includes(t) || i === "he" || i === "ar" ? 0 : 1;
2559
2526
  }
2560
2527
  }
2561
- function Ie(n) {
2528
+ function Re(n) {
2562
2529
  return [
2563
2530
  parseInt(`${n[1]}${n[2]}`, 16),
2564
2531
  parseInt(`${n[3]}${n[4]}`, 16),
@@ -2570,7 +2537,7 @@ function _s([n, t, e]) {
2570
2537
  let i = Math.min(n, t, e), s = Math.max(n, t, e), r = s - i, o = 0, a = 0, l = 0;
2571
2538
  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];
2572
2539
  }
2573
- const ti = {
2540
+ const ei = {
2574
2541
  dark: {
2575
2542
  name: "dark",
2576
2543
  label: "Dark",
@@ -2716,34 +2683,34 @@ const ti = {
2716
2683
  }
2717
2684
  }
2718
2685
  };
2719
- function Is() {
2686
+ function Rs() {
2720
2687
  return window.matchMedia?.("(prefers-color-scheme: dark)")?.matches ? "dark" : "light";
2721
2688
  }
2722
- function Ns(n) {
2723
- return n === "auto" ? Is() : n;
2689
+ function Hs(n) {
2690
+ return n === "auto" ? Rs() : n;
2724
2691
  }
2725
- function Rs(n) {
2692
+ function Ps(n) {
2726
2693
  const t = document.querySelector('meta[name="theme-color"]');
2727
2694
  t && t.setAttribute("content", n);
2728
2695
  }
2729
- function Ps(n, t = document.body) {
2730
- const e = Ns(n), i = ti[e];
2696
+ function Ys(n, t = document.body) {
2697
+ const e = Hs(n), i = ei[e];
2731
2698
  if (i) {
2732
2699
  for (const [s, r] of Object.entries(i.variables))
2733
2700
  t.style.setProperty(s, r);
2734
- t.setAttribute("data-theme", e), Rs(i.variables["--bg-primary"]);
2701
+ t.setAttribute("data-theme", e), Ps(i.variables["--bg-primary"]);
2735
2702
  }
2736
2703
  }
2737
- function Hs(n) {
2704
+ function Ns(n) {
2738
2705
  localStorage.setItem("calendar-theme", n);
2739
2706
  }
2740
- function Ys() {
2707
+ function Us() {
2741
2708
  const n = localStorage.getItem("calendar-theme");
2742
- return n && (n in ti || n === "auto") ? n : "auto";
2709
+ return n && (n in ei || n === "auto") ? n : "auto";
2743
2710
  }
2744
- const Us = [
2711
+ const Ls = [
2745
2712
  { name: "auto", label: "Auto" },
2746
- ...Object.values(ti).map((n) => ({
2713
+ ...Object.values(ei).map((n) => ({
2747
2714
  name: n.name,
2748
2715
  label: n.label
2749
2716
  }))
@@ -2752,42 +2719,42 @@ function _i(n) {
2752
2719
  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");
2753
2720
  return `${t}${e}${i}T${s}${r}${o}`;
2754
2721
  }
2755
- function Ii(n) {
2722
+ function Ri(n) {
2756
2723
  const t = n.getFullYear(), e = String(n.getMonth() + 1).padStart(2, "0"), i = String(n.getDate()).padStart(2, "0");
2757
2724
  return `${t}${e}${i}`;
2758
2725
  }
2759
- function Ni(n) {
2726
+ function Hi(n) {
2760
2727
  const t = [
2761
2728
  "BEGIN:VCALENDAR",
2762
2729
  "VERSION:2.0",
2763
2730
  "PRODID:-//Calendar//EN"
2764
2731
  ];
2765
2732
  for (const e of n)
2766
- 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:${_i(e.start)}`), t.push(`DTEND:${_i(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");
2733
+ t.push("BEGIN:VEVENT"), t.push(`UID:${e.id}`), t.push(`SUMMARY:${e.title}`), e.isAllDay ? (t.push(`DTSTART;VALUE=DATE:${Ri(e.start)}`), t.push(`DTEND;VALUE=DATE:${Ri(e.end)}`)) : (t.push(`DTSTART:${_i(e.start)}`), t.push(`DTEND:${_i(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");
2767
2734
  return t.push("END:VCALENDAR"), t.join(`\r
2768
2735
  `);
2769
2736
  }
2770
- const We = [];
2771
- let se = null;
2772
- function It(n) {
2773
- We.push({
2737
+ const Fe = [];
2738
+ let re = null;
2739
+ function Rt(n) {
2740
+ Fe.push({
2774
2741
  text: n,
2775
2742
  timestamp: Date.now()
2776
- }), se && se.processQueue();
2743
+ }), re && re.processQueue();
2777
2744
  }
2778
- const xe = class xe extends qt {
2745
+ const Te = class Te extends Kt {
2779
2746
  constructor() {
2780
2747
  super(...arguments), this.currentMessage = "", this.isShowing = !1, this.timeoutId = null;
2781
2748
  }
2782
2749
  connectedCallback() {
2783
- super.connectedCallback(), se = this, this.processQueue();
2750
+ super.connectedCallback(), re = this, this.processQueue();
2784
2751
  }
2785
2752
  disconnectedCallback() {
2786
- super.disconnectedCallback(), se === this && (se = null), this.timeoutId !== null && clearTimeout(this.timeoutId);
2753
+ super.disconnectedCallback(), re === this && (re = null), this.timeoutId !== null && clearTimeout(this.timeoutId);
2787
2754
  }
2788
2755
  processQueue() {
2789
- if (this.isShowing || We.length === 0) return;
2790
- const t = We.shift();
2756
+ if (this.isShowing || Fe.length === 0) return;
2757
+ const t = Fe.shift();
2791
2758
  t && (this.currentMessage = t.text, this.isShowing = !0, this.requestUpdate(), this.timeoutId = window.setTimeout(() => {
2792
2759
  this.hideMessage();
2793
2760
  }, 2e3));
@@ -2802,7 +2769,7 @@ const xe = class xe extends qt {
2802
2769
  return !this.isShowing || !this.currentMessage ? O`` : O`<div class="message">${this.currentMessage}</div>`;
2803
2770
  }
2804
2771
  };
2805
- xe.styles = Li`
2772
+ Te.styles = zi`
2806
2773
  :host {
2807
2774
  display: block;
2808
2775
  position: relative;
@@ -2832,19 +2799,19 @@ xe.styles = Li`
2832
2799
  opacity: 0;
2833
2800
  }
2834
2801
  }
2835
- `, xe.properties = {
2802
+ `, Te.properties = {
2836
2803
  currentMessage: { type: String },
2837
2804
  isShowing: { type: Boolean }
2838
2805
  };
2839
- let Fe = xe;
2806
+ let Be = Te;
2840
2807
  try {
2841
- customElements.define("status-message", Fe);
2808
+ customElements.define("status-message", Be);
2842
2809
  } catch (n) {
2843
2810
  console.error("Failed to register custom element:", n);
2844
2811
  }
2845
- class Ls {
2812
+ class zs {
2846
2813
  constructor() {
2847
- this.dbName = "calendar-events", this.storeName = "events", this.metadataStoreName = "metadata", this.notificationsStoreName = "notifications", this.version = 7;
2814
+ this.dbName = "calendar-events", this.storeName = "events", this.metadataStoreName = "metadata", this.version = 8;
2848
2815
  }
2849
2816
  async recreateDatabase() {
2850
2817
  return this.db && (this.db.close(), this.db = void 0), this.openPromise = void 0, new Promise((t, e) => {
@@ -2868,7 +2835,7 @@ class Ls {
2868
2835
  if (!o)
2869
2836
  throw new Error("Transaction not available during upgrade");
2870
2837
  let a;
2871
- r.objectStoreNames.contains(this.storeName) ? (a = o.objectStore(this.storeName), a.indexNames.contains("calendar") || a.createIndex("calendar", "calendar", { unique: !1 }), a.indexNames.contains("calendarSync") || a.createIndex("calendarSync", ["calendar", "lastSynced"], { unique: !1 })) : (a = r.createObjectStore(this.storeName, { keyPath: "id" }), a.createIndex("start", "start", { unique: !1 }), a.createIndex("end", "end", { unique: !1 }), a.createIndex("calendar", "calendar", { unique: !1 }), a.createIndex("calendarSync", ["calendar", "lastSynced"], { unique: !1 })), r.objectStoreNames.contains(this.metadataStoreName) || r.createObjectStore(this.metadataStoreName, { keyPath: "sourceId" }), r.objectStoreNames.contains(this.notificationsStoreName) || r.createObjectStore(this.notificationsStoreName, { keyPath: "eventId" });
2838
+ r.objectStoreNames.contains(this.storeName) ? (a = o.objectStore(this.storeName), a.indexNames.contains("calendar") || a.createIndex("calendar", "calendar", { unique: !1 }), a.indexNames.contains("calendarSync") || a.createIndex("calendarSync", ["calendar", "lastSynced"], { unique: !1 })) : (a = r.createObjectStore(this.storeName, { keyPath: "id" }), a.createIndex("start", "start", { unique: !1 }), a.createIndex("end", "end", { unique: !1 }), a.createIndex("calendar", "calendar", { unique: !1 }), a.createIndex("calendarSync", ["calendar", "lastSynced"], { unique: !1 })), r.objectStoreNames.contains(this.metadataStoreName) || r.createObjectStore(this.metadataStoreName, { keyPath: "sourceId" });
2872
2839
  };
2873
2840
  }), this.openPromise);
2874
2841
  }
@@ -2891,8 +2858,8 @@ class Ls {
2891
2858
  u.onerror = () => {
2892
2859
  r(new Error(`Failed to query events: ${u.error?.message}`));
2893
2860
  }, u.onsuccess = () => {
2894
- const g = u.result.filter((m) => m.end >= c).map((m) => this.deserializeEvent(m));
2895
- s(g);
2861
+ const p = u.result.filter((m) => m.end >= c).map((m) => this.deserializeEvent(m));
2862
+ s(p);
2896
2863
  };
2897
2864
  });
2898
2865
  }
@@ -2909,8 +2876,8 @@ class Ls {
2909
2876
  f.onsuccess = () => {
2910
2877
  const v = f.result;
2911
2878
  if (v) {
2912
- const g = v.value;
2913
- (!g.lastSynced || g.lastSynced < d) && (console.debug("sync deleted", g.id), a.delete(g.id)), v.continue();
2879
+ const p = v.value;
2880
+ (!p.lastSynced || p.lastSynced < d) && (console.debug("sync deleted", p.id), a.delete(p.id)), v.continue();
2914
2881
  }
2915
2882
  }, f.onerror = () => {
2916
2883
  r(new Error(`Failed to query calendar events: ${f.error?.message}`));
@@ -2985,9 +2952,9 @@ class Ls {
2985
2952
  lastSynced: t.lastSynced?.toISOString(),
2986
2953
  organizer: t.organizer,
2987
2954
  attendees: t.attendees,
2988
- currentUserEmail: t.currentUserEmail,
2989
2955
  status: t.status,
2990
- isAllDay: t.isAllDay
2956
+ isAllDay: t.isAllDay,
2957
+ reminders: t.reminders
2991
2958
  };
2992
2959
  }
2993
2960
  deserializeEvent(t) {
@@ -3024,65 +2991,22 @@ class Ls {
3024
2991
  lastSynced: t.lastSynced ? new Date(t.lastSynced) : void 0,
3025
2992
  organizer: t.organizer,
3026
2993
  attendees: t.attendees,
3027
- currentUserEmail: t.currentUserEmail,
3028
2994
  status: t.status,
3029
- isAllDay: t.isAllDay
2995
+ isAllDay: t.isAllDay,
2996
+ reminders: t.reminders
3030
2997
  };
3031
2998
  }
3032
- async setNotifications(t, e) {
3033
- await this.ensureNotificationsStore();
3034
- const i = this.db;
3035
- return new Promise((s, r) => {
3036
- const o = i.transaction(this.notificationsStoreName, "readwrite"), a = o.objectStore(this.notificationsStoreName);
3037
- e.length === 0 ? a.delete(t) : a.put({ eventId: t, notifications: e }), o.oncomplete = () => s(), o.onerror = () => r(o.error);
3038
- });
3039
- }
3040
- async getNotifications(t) {
3041
- await this.ensureNotificationsStore();
3042
- const e = this.db;
3043
- return new Promise((i, s) => {
3044
- const a = e.transaction(this.notificationsStoreName, "readonly").objectStore(this.notificationsStoreName).get(t);
3045
- a.onsuccess = () => {
3046
- const l = a.result;
3047
- i(l?.notifications || []);
3048
- }, a.onerror = () => s(a.error);
3049
- });
3050
- }
3051
- async deleteNotifications(t) {
3052
- await this.ensureNotificationsStore();
3053
- const e = this.db;
2999
+ async putEvent(t) {
3000
+ const e = await this.open();
3054
3001
  return new Promise((i, s) => {
3055
- const r = e.transaction(this.notificationsStoreName, "readwrite");
3056
- r.objectStore(this.notificationsStoreName).delete(t), r.oncomplete = () => i(), r.onerror = () => s(r.error);
3057
- });
3058
- }
3059
- async getAllNotifications() {
3060
- await this.ensureNotificationsStore();
3061
- const t = this.db;
3062
- return new Promise((e, i) => {
3063
- const o = t.transaction(this.notificationsStoreName, "readonly").objectStore(this.notificationsStoreName).getAll();
3064
- o.onsuccess = () => {
3065
- const a = /* @__PURE__ */ new Map();
3066
- for (const l of o.result)
3067
- a.set(l.eventId, l.notifications);
3068
- e(a);
3069
- }, o.onerror = () => i(o.error);
3002
+ const r = e.transaction(this.storeName, "readwrite");
3003
+ r.objectStore(this.storeName).put(this.serializeEvent(t)), r.oncomplete = () => i(), r.onerror = () => s(r.error);
3070
3004
  });
3071
3005
  }
3072
- async ensureNotificationsStore() {
3073
- if (this.upgradePromise) {
3074
- await this.upgradePromise;
3075
- return;
3076
- }
3077
- (await this.open()).objectStoreNames.contains(this.notificationsStoreName) || (this.upgradePromise = this.upgradeDatabase(), await this.upgradePromise, this.upgradePromise = void 0);
3078
- }
3079
- async upgradeDatabase() {
3080
- this.db && (this.db.close(), this.db = void 0), this.openPromise = void 0, await this.open();
3081
- }
3082
3006
  }
3083
- const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
3007
+ const Ft = 100, ve = 3e3, F = 60, Pi = 12, me = 20, ii = class ii extends Kt {
3084
3008
  constructor() {
3085
- super(), this._dayHeight = Wt, 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.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.currentTheme = Ys(), this.activeCalendarColor = null, this.scrollToToday = () => {
3009
+ super(), this._dayHeight = Ft, 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.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 = Us(), this.activeCalendarColor = null, this.scrollToToday = () => {
3086
3010
  this.scrollToDate(/* @__PURE__ */ new Date(), 0.5, !0, !0);
3087
3011
  }, this.goBack = () => {
3088
3012
  this.saveHistoryTimeout && (clearTimeout(this.saveHistoryTimeout), this.saveHistoryTimeout = null), this.historyIndex++;
@@ -3105,8 +3029,8 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
3105
3029
  }
3106
3030
  t.preventDefault();
3107
3031
  const s = t.deltaY * (this.dayHeight / 100), r = Math.max(
3108
- Wt,
3109
- Math.min(pe, this.dayHeight - s)
3032
+ Ft,
3033
+ Math.min(ve, this.dayHeight - s)
3110
3034
  ), o = this.dayHeight, a = r / o, l = this.zoomOriginY * a, c = l - this.zoomViewportY;
3111
3035
  this.setView(r, c), this.zoomOriginY = l;
3112
3036
  }, this.lastPointerY = 0, this.onZoomHandleMouseDown = (t) => {
@@ -3117,7 +3041,7 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
3117
3041
  }, this.onDragStart = (t) => {
3118
3042
  if (!this.movingEvent || !t.dataTransfer) return;
3119
3043
  this.isDraggingOut = !0, this.isDraggingEvent = !0;
3120
- const e = this.movingEvent, i = Ni([e]);
3044
+ const e = this.movingEvent, i = Hi([e]);
3121
3045
  t.dataTransfer.setData("application/x-calendar-event", e.id), t.dataTransfer.setData("text/plain", i), t.dataTransfer.effectAllowed = "copyMove";
3122
3046
  try {
3123
3047
  const o = `${e.title.replace(/[^a-z0-9]/gi, "_")}.ics`, a = new File([i], o, { type: "text/calendar" });
@@ -3137,7 +3061,7 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
3137
3061
  console.warn("DownloadURL not supported:", o);
3138
3062
  }
3139
3063
  }, this.onDragEnd = (t) => {
3140
- t.dataTransfer?.dropEffect === "none" && this.movingEvent && It("Event exported as .ics file"), this.isDraggingFile = !1, this.resetDragState(), this.requestUpdate();
3064
+ t.dataTransfer?.dropEffect === "none" && this.movingEvent && Rt("Event exported as .ics file"), this.isDraggingFile = !1, this.resetDragState(), this.requestUpdate();
3141
3065
  }, this.onMouseMove = (t) => {
3142
3066
  if (this.isPanning && this.scrollContainer) {
3143
3067
  const e = t.clientY - this.panStartY;
@@ -3148,8 +3072,8 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
3148
3072
  let e = 0;
3149
3073
  this.lastPointerY && (e = t.clientY - this.lastPointerY);
3150
3074
  const i = e * (this.dayHeight / 100), s = Math.max(
3151
- Wt,
3152
- Math.min(pe, this.dayHeight - i)
3075
+ Ft,
3076
+ Math.min(ve, this.dayHeight - i)
3153
3077
  ), r = this.dayHeight, o = s / r, a = this.zoomOriginY * o, l = a - this.zoomViewportY;
3154
3078
  this.setView(s, l, !1), this.zoomOriginY = a, this.isFiltered && this.historyIndex === 0 ? this.replaceFilterInHistory() : this.debouncedSaveToHistory();
3155
3079
  } else
@@ -3280,10 +3204,10 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
3280
3204
  const i = this.internal.getSelectedEvents();
3281
3205
  if (i.length === 0) return;
3282
3206
  t.preventDefault();
3283
- const s = Ni(i), r = new Blob([s], { type: "text/plain" }), o = new ClipboardItem({ "text/plain": r });
3207
+ const s = Hi(i), r = new Blob([s], { type: "text/plain" }), o = new ClipboardItem({ "text/plain": r });
3284
3208
  navigator.clipboard.write([o]).then(() => {
3285
3209
  const a = i.length;
3286
- It(
3210
+ Rt(
3287
3211
  `Copied ${a} event${a === 1 ? "" : "s"} to clipboard`
3288
3212
  );
3289
3213
  });
@@ -3305,7 +3229,7 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
3305
3229
  bubbles: !0
3306
3230
  })
3307
3231
  );
3308
- } else t.key === "Escape" && (this.isCreatingEvent || this.eventCreationStart ? (t.preventDefault(), this.clearEventCreationState(), this.renderCanvas(), It("Event creation cancelled")) : this.isDraggingEvent || this.movingEvent ? (t.preventDefault(), this.resetDragState(), this.renderCanvas(), It("Event move cancelled")) : this.isResizingEvent ? (t.preventDefault(), this.isResizingEvent = !1, this.resizeEvent = null, this.resizeStartY = 0, this.resizeEdge = null, this.renderCanvas(), It("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(
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(
3309
3233
  new CustomEvent("selection-change", {
3310
3234
  detail: { selectedEvents: [] },
3311
3235
  bubbles: !0
@@ -3316,7 +3240,7 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
3316
3240
  const e = this.scrollContainer.getBoundingClientRect(), i = t.clientX - e.left, s = t.clientY - e.top + this.scrollTop;
3317
3241
  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 = "");
3318
3242
  const o = this.getEventAtPosition(i, s), a = o ? o.id : null;
3319
- a !== this.hoveredEventId && (this.hoveredEventId = a, this.renderCanvas()), this.requestUpdate(), i < L ? this.scrollContainer.classList.add("zoom-cursor") : this.scrollContainer.classList.remove("zoom-cursor");
3243
+ a !== this.hoveredEventId && (this.hoveredEventId = a, this.renderCanvas()), this.requestUpdate(), i < F ? this.scrollContainer.classList.add("zoom-cursor") : this.scrollContainer.classList.remove("zoom-cursor");
3320
3244
  }, this.onMinimapMouseDown = (t) => {
3321
3245
  this.scrollContainer && (t.preventDefault(), this.isDraggingMinimap = !0, this.scrollToMinimapPosition(t));
3322
3246
  }, this.onMinimapMouseMove = (t) => {
@@ -3398,7 +3322,7 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
3398
3322
  return;
3399
3323
  }
3400
3324
  const e = this.scrollContainer.getBoundingClientRect(), i = t.clientX - e.left, s = t.clientY - e.top + this.scrollTop;
3401
- if (i < L) {
3325
+ if (i < F) {
3402
3326
  this.onZoomHandleMouseDown(t);
3403
3327
  return;
3404
3328
  }
@@ -3439,7 +3363,7 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
3439
3363
  this.scheduledNotifications = t, this.requestUpdate();
3440
3364
  }, this.onThemeChange = (t) => {
3441
3365
  const i = t.target.value;
3442
- this.currentTheme = i, Hs(i), Ps(i), this.renderCanvas();
3366
+ this.currentTheme = i, Ns(i), Ys(i), this.renderCanvas();
3443
3367
  }, this.onZoomSliderChange = (t) => {
3444
3368
  const e = t.target, i = parseInt(e.value, 10), s = this.dayHeight;
3445
3369
  if (!this.scrollContainer) {
@@ -3448,10 +3372,10 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
3448
3372
  }
3449
3373
  const o = this.scrollContainer.clientHeight / 2, a = this.scrollTop + o, l = i / s, h = a * l - o;
3450
3374
  this.setView(i, h);
3451
- }, this.minimapCanvas = document.createElement("canvas"), this.internal = new Y({
3375
+ }, this.minimapCanvas = document.createElement("canvas"), this.internal = new L({
3452
3376
  locale: this.getAttribute("locale") || void 0,
3453
3377
  weekStart: Number(this.getAttribute("week-start")),
3454
- storage: new Ls()
3378
+ storage: new zs()
3455
3379
  });
3456
3380
  }
3457
3381
  set dayHeight(t) {
@@ -3478,9 +3402,9 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
3478
3402
  loadDayHeight() {
3479
3403
  const t = localStorage.getItem("calendar-dayHeight");
3480
3404
  return t ? Math.max(
3481
- Wt,
3482
- Math.min(pe, parseFloat(t))
3483
- ) : Wt;
3405
+ Ft,
3406
+ Math.min(ve, parseFloat(t))
3407
+ ) : Ft;
3484
3408
  }
3485
3409
  saveDayHeight() {
3486
3410
  localStorage.setItem("calendar-dayHeight", this.dayHeight.toString());
@@ -3526,10 +3450,10 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
3526
3450
  }
3527
3451
  scrollToDate(t, e = 0.5, i = !1, s = !1) {
3528
3452
  let r = this.weeks.findIndex(
3529
- (o) => o.days.some((a) => Y.isSameDay(a, t)) || o.days[0] && o.days[6] && o.days[0] <= t && t <= o.days[6]
3453
+ (o) => o.days.some((a) => L.isSameDay(a, t)) || o.days[0] && o.days[6] && o.days[0] <= t && t <= o.days[6]
3530
3454
  );
3531
3455
  if (r < 0 && s && (this.weeks = this.internal.resetRangeAroundDate(t), this.updateWeekOffsets(), r = this.weeks.findIndex(
3532
- (o) => o.days.some((a) => Y.isSameDay(a, t)) || o.days[0] && o.days[6] && o.days[0] <= t && t <= o.days[6]
3456
+ (o) => o.days.some((a) => L.isSameDay(a, t)) || o.days[0] && o.days[6] && o.days[0] <= t && t <= o.days[6]
3533
3457
  )), r >= 0) {
3534
3458
  const o = this.weeks[r];
3535
3459
  if (o) {
@@ -3605,8 +3529,8 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
3605
3529
  let t = 0;
3606
3530
  if (this.filter) {
3607
3531
  const i = this.events.map((s) => ({
3608
- start: Y.startOfDayTime(s.start),
3609
- end: Y.endOfDayTime(s.end)
3532
+ start: L.startOfDayTime(s.start),
3533
+ end: L.endOfDayTime(s.end)
3610
3534
  }));
3611
3535
  for (const s of this.weeks) {
3612
3536
  s.yOffset = t;
@@ -3624,7 +3548,7 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
3624
3548
  if (!this.canvas || !this.scrollContainer) return;
3625
3549
  const t = this.scrollContainer.getBoundingClientRect(), e = window.devicePixelRatio || 1;
3626
3550
  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) {
3627
- const i = t.width - L - Ri;
3551
+ const i = t.width - F - Pi;
3628
3552
  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);
3629
3553
  }
3630
3554
  this.renderCanvas();
@@ -3633,27 +3557,27 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
3633
3557
  if (!this.ctx || !this.canvas || !this.scrollContainer) return;
3634
3558
  const t = this.ctx, e = this.canvas.width / (window.devicePixelRatio || 1), i = this.canvas.height / (window.devicePixelRatio || 1);
3635
3559
  t.clearRect(0, 0, e, i);
3636
- const s = this.scrollTop, o = (e - L) / 7, a = /* @__PURE__ */ new Date(), l = this.weeks.filter(
3560
+ const s = this.scrollTop, o = (e - F) / 7, a = /* @__PURE__ */ new Date(), l = this.weeks.filter(
3637
3561
  (h) => h.height > 0 && h.yOffset + h.height > s && h.yOffset < s + i
3638
3562
  ), c = this.dayHeight >= 300;
3639
3563
  for (const h of l) {
3640
3564
  const d = h.days.findIndex(
3641
- (u) => Y.isSameDay(u, a)
3565
+ (u) => L.isSameDay(u, a)
3642
3566
  );
3643
3567
  if (d >= 0) {
3644
- const u = L + d * o, f = h.yOffset - s, v = getComputedStyle(this).getPropertyValue("--bg-today").trim() || "rgba(255, 255, 255, 0.05)";
3568
+ const u = F + d * o, f = h.yOffset - s, v = getComputedStyle(this).getPropertyValue("--bg-today").trim() || "rgba(255, 255, 255, 0.05)";
3645
3569
  if (t.fillStyle = v, t.fillRect(u, f, o, h.height), c) {
3646
- const g = /* @__PURE__ */ new Date(), m = g.getHours() * 60 + g.getMinutes(), b = f + m / 1440 * h.height;
3570
+ const p = /* @__PURE__ */ new Date(), m = p.getHours() * 60 + p.getMinutes(), b = f + m / 1440 * h.height;
3647
3571
  if (b >= 0 && b <= i) {
3648
- const $ = getComputedStyle(this).getPropertyValue("--accent-current-time").trim() || "rgba(255, 0, 0, 0.8)";
3649
- t.strokeStyle = $, t.lineWidth = 1, t.beginPath(), t.moveTo(u, b), t.lineTo(u + o, b), t.stroke(), t.lineWidth = 1;
3572
+ const C = getComputedStyle(this).getPropertyValue("--accent-current-time").trim() || "rgba(255, 0, 0, 0.8)";
3573
+ t.strokeStyle = C, t.lineWidth = 1, t.beginPath(), t.moveTo(u, b), t.lineTo(u + o, b), t.stroke(), t.lineWidth = 1;
3650
3574
  }
3651
3575
  }
3652
3576
  }
3653
3577
  }
3654
3578
  t.strokeStyle = getComputedStyle(this).getPropertyValue("--grid-color").trim() || "rgba(255, 255, 255, 0.1)", t.lineWidth = 1;
3655
3579
  for (let h = 1; h <= 7; h++) {
3656
- const d = L + h * o;
3580
+ const d = F + h * o;
3657
3581
  t.beginPath(), t.moveTo(d, 0), t.lineTo(d, i), t.stroke();
3658
3582
  }
3659
3583
  for (let h = 0; h < l.length; h++) {
@@ -3661,56 +3585,56 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
3661
3585
  if (!d) continue;
3662
3586
  const u = d.yOffset - s;
3663
3587
  if (this.filter && h > 0) {
3664
- const k = l[h - 1];
3665
- if (!k) continue;
3666
- const M = this.weeks.indexOf(k), _ = this.weeks.indexOf(d) - M - 1;
3667
- if (_ > 0) {
3668
- const y = u, w = getComputedStyle(this).getPropertyValue("--grid-color-strong").trim() || "rgba(255, 255, 255, 0.3)";
3669
- t.strokeStyle = w, t.lineWidth = 1, t.setLineDash([4, 4]), t.beginPath(), t.moveTo(L, y), t.lineTo(e, y), t.stroke(), t.setLineDash([]);
3670
- const D = getComputedStyle(this).getPropertyValue("--text-muted").trim() || "rgba(255, 255, 255, 0.4)";
3671
- t.fillStyle = D, t.textAlign = "center";
3672
- const E = `⋯ ${_} week${_ > 1 ? "s" : ""}`, x = t.measureText(E).width, A = 8, P = (L + e) / 2 - x / 2 - A, K = y - 8, tt = x + A * 2, J = 16, et = getComputedStyle(this).getPropertyValue("--bg-primary").trim() || "rgba(30, 30, 30, 0.9)";
3673
- t.fillStyle = et, t.beginPath(), t.roundRect(P, K, tt, J, 8), t.fill(), t.fillStyle = D, t.fillText(E, (L + e) / 2, y + 4);
3588
+ const T = l[h - 1];
3589
+ if (!T) continue;
3590
+ const $ = this.weeks.indexOf(T), M = this.weeks.indexOf(d) - $ - 1;
3591
+ if (M > 0) {
3592
+ const A = u, y = getComputedStyle(this).getPropertyValue("--grid-color-strong").trim() || "rgba(255, 255, 255, 0.3)";
3593
+ t.strokeStyle = y, t.lineWidth = 1, t.setLineDash([4, 4]), t.beginPath(), t.moveTo(F, A), t.lineTo(e, A), t.stroke(), t.setLineDash([]);
3594
+ const w = getComputedStyle(this).getPropertyValue("--text-muted").trim() || "rgba(255, 255, 255, 0.4)";
3595
+ t.fillStyle = w, t.textAlign = "center";
3596
+ const x = `⋯ ${M} week${M > 1 ? "s" : ""}`, k = t.measureText(x).width, P = 8, B = (F + e) / 2 - k / 2 - P, U = A - 8, q = k + P * 2, H = 16, Y = getComputedStyle(this).getPropertyValue("--bg-primary").trim() || "rgba(30, 30, 30, 0.9)";
3597
+ t.fillStyle = Y, t.beginPath(), t.roundRect(B, U, q, H, 8), t.fill(), t.fillStyle = w, t.fillText(x, (F + e) / 2, A + 4);
3674
3598
  }
3675
3599
  }
3676
- t.strokeStyle = getComputedStyle(this).getPropertyValue("--grid-color").trim() || "rgba(255, 255, 255, 0.1)", t.beginPath(), t.moveTo(L, u), t.lineTo(e, u), t.stroke();
3600
+ t.strokeStyle = getComputedStyle(this).getPropertyValue("--grid-color").trim() || "rgba(255, 255, 255, 0.1)", t.beginPath(), t.moveTo(F, u), t.lineTo(e, u), t.stroke();
3677
3601
  const f = Math.max(
3678
3602
  0,
3679
3603
  Math.min(1, (this.dayHeight - 300) / 300)
3680
3604
  );
3681
3605
  t.textAlign = "right";
3682
- const v = getComputedStyle(this).getPropertyValue("--grid-color").trim() || "rgba(255, 255, 255, 0.1)", g = getComputedStyle(this).getPropertyValue("--text-muted").trim() || "rgba(255, 255, 255, 0.4)";
3606
+ const v = getComputedStyle(this).getPropertyValue("--grid-color").trim() || "rgba(255, 255, 255, 0.1)", p = getComputedStyle(this).getPropertyValue("--text-muted").trim() || "rgba(255, 255, 255, 0.4)";
3683
3607
  t.strokeStyle = v.replace(
3684
3608
  /[\d.]+\)$/,
3685
3609
  `${0.05 * f})`
3686
- ), t.fillStyle = g.replace(
3610
+ ), t.fillStyle = p.replace(
3687
3611
  /[\d.]+\)$/,
3688
3612
  `${0.4 * f})`
3689
3613
  );
3690
- for (let k = 0; k < 24; k++) {
3691
- const M = u + k / 24 * d.height;
3692
- if (M >= 0 && M <= i && (t.beginPath(), t.moveTo(L, M), t.lineTo(e, M), t.stroke(), f > 0.1)) {
3693
- const S = `${k.toString().padStart(2, "0")}:00`;
3694
- t.fillText(S, 48, M + 4);
3614
+ for (let T = 0; T < 24; T++) {
3615
+ const $ = u + T / 24 * d.height;
3616
+ if ($ >= 0 && $ <= i && (t.beginPath(), t.moveTo(F, $), t.lineTo(e, $), t.stroke(), f > 0.1)) {
3617
+ const E = `${T.toString().padStart(2, "0")}:00`;
3618
+ t.fillText(E, 48, $ + 4);
3695
3619
  }
3696
3620
  }
3697
3621
  if (f > 0.1) {
3698
- const k = /* @__PURE__ */ new Date();
3622
+ const T = /* @__PURE__ */ new Date();
3699
3623
  if (d.days.some(
3700
- (S) => Y.isSameDay(S, k)
3624
+ (E) => L.isSameDay(E, T)
3701
3625
  )) {
3702
- const S = k.getHours() * 60 + k.getMinutes(), _ = u + S / 1440 * d.height;
3703
- if (_ >= 0 && _ <= i) {
3704
- const y = k.getHours().toString().padStart(2, "0"), w = k.getMinutes().toString().padStart(2, "0"), D = `${y}:${w}`;
3626
+ const E = T.getHours() * 60 + T.getMinutes(), M = u + E / 1440 * d.height;
3627
+ if (M >= 0 && M <= i) {
3628
+ const A = T.getHours().toString().padStart(2, "0"), y = T.getMinutes().toString().padStart(2, "0"), w = `${A}:${y}`;
3705
3629
  t.save(), t.textAlign = "right", t.textBaseline = "middle";
3706
- const E = t.measureText(D).width, x = 6, A = 48, P = _, K = getComputedStyle(this).getPropertyValue("--bg-elevated").trim() || "rgba(0, 0, 0, 0.7)";
3707
- t.fillStyle = K, t.beginPath(), t.roundRect(
3708
- A - E - x,
3709
- P - 8,
3710
- E + x * 2,
3630
+ const x = t.measureText(w).width, k = 6, P = 48, B = M, U = getComputedStyle(this).getPropertyValue("--bg-elevated").trim() || "rgba(0, 0, 0, 0.7)";
3631
+ t.fillStyle = U, t.beginPath(), t.roundRect(
3632
+ P - x - k,
3633
+ B - 8,
3634
+ x + k * 2,
3711
3635
  16,
3712
3636
  4
3713
- ), t.fill(), t.fillStyle = "white", t.fillText(D, A, P), t.restore();
3637
+ ), t.fill(), t.fillStyle = "white", t.fillText(w, P, B), t.restore();
3714
3638
  }
3715
3639
  }
3716
3640
  }
@@ -3722,269 +3646,283 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
3722
3646
  /[\d.]+\)$/,
3723
3647
  `${0.4 * m})`
3724
3648
  ), t.textAlign = "center";
3725
- const $ = `W${d.weekNumber}`, I = u, z = u + d.height, C = Math.max(
3649
+ const C = `W${d.weekNumber}`, I = u, z = u + d.height, D = Math.max(
3726
3650
  14,
3727
3651
  Math.min(I + d.height / 2 + 4, z - 4)
3728
3652
  );
3729
- C >= Math.max(0, I + 4) && C <= Math.min(i, z) && m > 0.1 && t.fillText($, 30, C);
3653
+ D >= Math.max(0, I + 4) && D <= Math.min(i, z) && m > 0.1 && t.fillText(C, 30, D);
3730
3654
  }
3731
3655
  this.renderEventsOnCanvas(t, s, i, o, l), this.renderDateLabels(), this.isCreatingEvent && this.renderEventCreationPreview(), this.isDraggingEvent && this.renderEventMovePreview(), this.renderMinimap();
3732
3656
  }
3733
3657
  renderEventsOnCanvas(t, e, i, s, r) {
3734
3658
  const o = this.events, a = getComputedStyle(this).fontFamily, l = e + i, c = this.dayHeight >= 300;
3735
3659
  if (this.eventRects = [], r.length === 0) return;
3736
- const h = r[0], d = r[r.length - 1], u = h.days[0], f = d.days[6], v = u.getTime(), g = f.getTime() + 864e5 - 1, m = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), $ = [], I = [], z = [];
3660
+ const h = r[0], d = r[r.length - 1], u = h.days[0], f = d.days[6], v = u.getTime(), p = f.getTime() + 864e5 - 1, m = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), C = [], I = [], z = [];
3737
3661
  for (const y of o) {
3738
- const w = y.start.getTime(), D = y.end.getTime();
3739
- if (D < v || w > g)
3662
+ const w = y.start.getTime(), x = y.end.getTime();
3663
+ if (x < v || w > p)
3740
3664
  continue;
3741
- const E = [];
3742
- for (const P of r) {
3743
- const K = P.days[0], tt = P.days[6];
3744
- if (!K || !tt) continue;
3745
- const J = K.getTime(), et = tt.getTime() + 86399999;
3746
- if (D >= J && w <= et) {
3747
- const at = this.weeks.indexOf(P);
3748
- E.push({ weekIndex: at, week: P });
3665
+ const k = [];
3666
+ for (const U of r) {
3667
+ const q = U.days[0], H = U.days[6];
3668
+ if (!q || !H) continue;
3669
+ const Y = q.getTime(), G = H.getTime() + 86399999;
3670
+ if (x >= Y && w <= G) {
3671
+ const lt = this.weeks.indexOf(U);
3672
+ k.push({ weekIndex: lt, week: U });
3749
3673
  }
3750
3674
  }
3751
- const x = E.length, A = y.isAllDay === !0;
3752
- for (let P = 0; P < E.length; P++) {
3753
- const { weekIndex: K, week: tt } = E[P], J = P === 0, et = P === E.length - 1;
3754
- let at = 0, it = 6;
3755
- if (J && (at = Hi(tt, y.start)), et) {
3756
- const B = A ? new Date(y.end.getTime() - 1) : y.end;
3757
- it = Hi(tt, B);
3675
+ const P = k.length, B = y.isAllDay === !0;
3676
+ for (let U = 0; U < k.length; U++) {
3677
+ const { weekIndex: q, week: H } = k[U], Y = U === 0, G = U === k.length - 1;
3678
+ let lt = 0, nt = 6;
3679
+ if (Y && (lt = Ni(H, y.start)), G) {
3680
+ const V = B ? new Date(y.end.getTime() - 1) : y.end;
3681
+ nt = Ni(H, V);
3758
3682
  }
3759
- const vt = {
3683
+ const mt = {
3760
3684
  event: y,
3761
- weekIndex: K,
3762
- week: tt,
3763
- startDayIndex: at,
3764
- endDayIndex: it,
3765
- isStart: J,
3766
- isEnd: et,
3767
- totalWeeks: x
3685
+ weekIndex: q,
3686
+ week: H,
3687
+ startDayIndex: lt,
3688
+ endDayIndex: nt,
3689
+ isStart: Y,
3690
+ isEnd: G,
3691
+ totalWeeks: P
3768
3692
  };
3769
- A ? I.push(vt) : z.push(vt);
3693
+ B ? I.push(mt) : z.push(mt);
3770
3694
  }
3771
3695
  }
3772
- $.push(...I, ...z);
3773
- const C = /* @__PURE__ */ new Map();
3774
- for (const y of $) {
3696
+ const D = c ? z.flatMap((y) => {
3697
+ if (y.startDayIndex === y.endDayIndex) return [y];
3698
+ const w = [];
3699
+ for (let x = y.startDayIndex; x <= y.endDayIndex; x++)
3700
+ w.push({
3701
+ ...y,
3702
+ startDayIndex: x,
3703
+ endDayIndex: x,
3704
+ isStart: x === y.startDayIndex && y.isStart,
3705
+ isEnd: x === y.endDayIndex && y.isEnd,
3706
+ totalWeeks: 1
3707
+ });
3708
+ return w;
3709
+ }) : z;
3710
+ C.push(...I, ...D);
3711
+ const T = /* @__PURE__ */ new Map();
3712
+ for (const y of C) {
3775
3713
  const w = y.event.isAllDay === !0;
3776
3714
  if (c && !w)
3777
- for (let D = y.startDayIndex; D <= y.endDayIndex; D++) {
3778
- const E = `${y.weekIndex}-${D}`;
3779
- C.has(E) || C.set(E, []), C.get(E).push(y);
3715
+ for (let x = y.startDayIndex; x <= y.endDayIndex; x++) {
3716
+ const k = `${y.weekIndex}-${x}`;
3717
+ T.has(k) || T.set(k, []), T.get(k).push(y);
3780
3718
  }
3781
3719
  }
3782
- const k = /* @__PURE__ */ new Map();
3783
- for (const [y, w] of C) {
3784
- const D = [];
3785
- for (const x of w) {
3786
- const [A, P] = y.split("-"), K = parseInt(P), tt = parseInt(A), J = this.weeks[tt];
3787
- if (!J) continue;
3788
- const et = new Date(J.days[K]).setHours(
3720
+ const $ = /* @__PURE__ */ new Map();
3721
+ for (const [y, w] of T) {
3722
+ const [x, k] = y.split("-"), P = parseInt(k), B = parseInt(x), U = [];
3723
+ for (const H of w) {
3724
+ const Y = this.weeks[B];
3725
+ if (!Y) continue;
3726
+ const G = new Date(Y.days[P]).setHours(
3789
3727
  0,
3790
3728
  0,
3791
3729
  0,
3792
3730
  0
3793
- ), at = new Date(J.days[K]).setHours(
3731
+ ), lt = new Date(Y.days[P]).setHours(
3794
3732
  23,
3795
3733
  59,
3796
3734
  59,
3797
3735
  999
3798
- ), it = x.event.start.getTime(), vt = x.event.end.getTime() - 6e4, B = Math.max(it, et), V = Math.min(vt, at), mt = new Date(B), Ht = new Date(V), St = mt.getHours() * 60 + mt.getMinutes(), nt = Ht.getHours() * 60 + Ht.getMinutes();
3799
- D.push({ segment: x, startMinutes: St, endMinutes: nt });
3736
+ ), nt = H.event.start.getTime(), mt = H.event.end.getTime() - 6e4, V = Math.max(nt, G), J = Math.min(mt, lt), yt = new Date(V), Nt = new Date(J), St = yt.getHours() * 60 + yt.getMinutes(), st = Nt.getHours() * 60 + Nt.getMinutes();
3737
+ U.push({ segment: H, startMinutes: St, endMinutes: st });
3800
3738
  }
3801
- D.sort((x, A) => x.startMinutes !== A.startMinutes ? x.startMinutes - A.startMinutes : A.endMinutes - A.startMinutes - (x.endMinutes - x.startMinutes));
3802
- const E = [];
3803
- for (const x of D) {
3804
- let A = 0;
3805
- for (; A < E.length && !(E[A].endMinutes <= x.startMinutes); A++)
3739
+ U.sort((H, Y) => H.startMinutes !== Y.startMinutes ? H.startMinutes - Y.startMinutes : Y.endMinutes - Y.startMinutes - (H.endMinutes - H.startMinutes));
3740
+ const q = [];
3741
+ for (const H of U) {
3742
+ let Y = 0;
3743
+ for (; Y < q.length && !(q[Y].endMinutes <= H.startMinutes); Y++)
3806
3744
  ;
3807
- A === E.length ? E.push({ endMinutes: x.endMinutes }) : E[A].endMinutes = x.endMinutes;
3808
- const P = `${x.segment.weekIndex}-${x.segment.event.id}`;
3809
- k.set(P, {
3810
- column: A,
3811
- totalColumns: E.length
3745
+ Y === q.length ? q.push({ endMinutes: H.endMinutes }) : q[Y].endMinutes = H.endMinutes;
3746
+ const G = `${H.segment.weekIndex}-${H.segment.event.id}-${P}`;
3747
+ $.set(G, {
3748
+ column: Y,
3749
+ totalColumns: q.length
3812
3750
  });
3813
3751
  }
3814
- for (const x of D) {
3815
- const A = `${x.segment.weekIndex}-${x.segment.event.id}`, P = k.get(A);
3816
- P && (P.totalColumns = E.length);
3752
+ for (const H of U) {
3753
+ const Y = `${H.segment.weekIndex}-${H.segment.event.id}-${P}`, G = $.get(Y);
3754
+ G && (G.totalColumns = q.length);
3817
3755
  }
3818
3756
  }
3819
- for (const y of $) {
3757
+ for (const y of C) {
3820
3758
  const {
3821
3759
  event: w,
3822
- week: D,
3823
- weekIndex: E,
3824
- startDayIndex: x,
3825
- endDayIndex: A,
3826
- isStart: P,
3827
- isEnd: K,
3828
- totalWeeks: tt
3829
- } = y, J = D.height, et = D.yOffset, at = w.isAllDay === !0;
3830
- let it, vt;
3831
- if (c && !at) {
3832
- const lt = new Date(D.days[x]).setHours(
3760
+ week: x,
3761
+ weekIndex: k,
3762
+ startDayIndex: P,
3763
+ endDayIndex: B,
3764
+ isStart: U,
3765
+ isEnd: q,
3766
+ totalWeeks: H
3767
+ } = y, Y = x.height, G = x.yOffset, lt = w.isAllDay === !0;
3768
+ let nt, mt;
3769
+ if (c && !lt) {
3770
+ const ct = new Date(x.days[P]).setHours(
3833
3771
  0,
3834
3772
  0,
3835
3773
  0,
3836
3774
  0
3837
- ), U = new Date(D.days[A]).setHours(
3775
+ ), W = new Date(x.days[B]).setHours(
3838
3776
  23,
3839
3777
  59,
3840
3778
  59,
3841
3779
  999
3842
- ), yt = w.start.getTime(), X = w.end.getTime() - 6e4, st = Math.max(yt, lt), F = Math.min(X, U), he = new Date(st), bt = new Date(F), At = he.getHours() * 60 + he.getMinutes(), Ot = bt.getHours() * 60 + bt.getMinutes();
3843
- it = et + At / 1440 * J, vt = et + Ot / 1440 * J;
3780
+ ), bt = w.start.getTime(), Q = w.end.getTime() - 6e4, rt = Math.max(bt, ct), j = Math.min(Q, W), de = new Date(rt), wt = new Date(j), Ot = de.getHours() * 60 + de.getMinutes(), It = wt.getHours() * 60 + wt.getMinutes();
3781
+ nt = G + Ot / 1440 * Y, mt = G + It / 1440 * Y;
3844
3782
  } else {
3845
- const lt = `${E}-${w.id}`;
3846
- let U = b.get(lt);
3847
- if (U === void 0) {
3848
- for (U = 0; ; ) {
3849
- let X = !0;
3850
- for (let st = x; st <= A; st++) {
3851
- const F = `${E}-${st}`;
3852
- if (m.get(F)?.has(U)) {
3853
- X = !1;
3783
+ const ct = `${k}-${w.id}`;
3784
+ let W = b.get(ct);
3785
+ if (W === void 0) {
3786
+ for (W = 0; ; ) {
3787
+ let Q = !0;
3788
+ for (let rt = P; rt <= B; rt++) {
3789
+ const j = `${k}-${rt}`;
3790
+ if (m.get(j)?.has(W)) {
3791
+ Q = !1;
3854
3792
  break;
3855
3793
  }
3856
3794
  }
3857
- if (X) break;
3858
- U++;
3795
+ if (Q) break;
3796
+ W++;
3859
3797
  }
3860
- b.set(lt, U);
3798
+ b.set(ct, W);
3861
3799
  }
3862
- for (let X = x; X <= A; X++) {
3863
- const st = `${E}-${X}`;
3864
- let F = m.get(st);
3865
- F || (F = /* @__PURE__ */ new Set(), m.set(st, F)), F.add(U);
3800
+ for (let Q = P; Q <= B; Q++) {
3801
+ const rt = `${k}-${Q}`;
3802
+ let j = m.get(rt);
3803
+ j || (j = /* @__PURE__ */ new Set(), m.set(rt, j)), j.add(W);
3866
3804
  }
3867
- const yt = Math.floor(
3868
- (J - 4) / (ve + 2)
3805
+ const bt = Math.floor(
3806
+ (Y - 4) / (me + 2)
3869
3807
  );
3870
- if (U >= yt) continue;
3871
- it = et + 4 + U * (ve + 2), vt = it + ve;
3808
+ if (W >= bt) continue;
3809
+ nt = G + 4 + W * (me + 2), mt = nt + me;
3872
3810
  }
3873
- const B = Math.max(
3874
- c ? 4 : ve,
3875
- vt - it
3811
+ const V = Math.max(
3812
+ c ? 4 : me,
3813
+ mt - nt
3876
3814
  );
3877
- let V, mt;
3878
- const Ht = `${E}-${w.id}`, St = k.get(Ht);
3879
- if (c && !at && St && St.totalColumns > 1) {
3880
- const lt = s / St.totalColumns;
3881
- V = L + x * s + St.column * lt, mt = lt;
3815
+ let J, yt;
3816
+ const Nt = `${k}-${w.id}-${P}`, St = $.get(Nt);
3817
+ if (c && !lt && St && St.totalColumns > 1) {
3818
+ const ct = s / St.totalColumns;
3819
+ J = F + P * s + St.column * ct, yt = ct;
3882
3820
  } else
3883
- V = L + x * s, mt = (A - x + 1) * s;
3884
- const nt = it - e;
3885
- if (nt + B < 0 || nt > i) continue;
3886
- const Ce = w.color || "#888888", Mt = this.internal.isEventSelected(w), en = this.hoveredEventId === w.id, ht = 2, xt = mt - ht * 2, Zt = 3, ii = 6;
3887
- let Tt = 4, Yt = 4, kt = 4, Ut = 4;
3888
- tt > 1 && (P && !K ? (Yt = 0, Ut = 0) : !P && K ? (Tt = 0, kt = 0) : !P && !K && (Tt = 0, Yt = 0, kt = 0, Ut = 0)), t.save(), w.readOnly && (t.globalAlpha = 0.5);
3889
- const Lt = _s(Ie(Ce)), ni = getComputedStyle(this).getPropertyValue("--text-primary").trim() || "rgba(255, 255, 255, 0.9)", $e = getComputedStyle(this).getPropertyValue("--text-inverse").trim() || "rgb(0, 0, 0)", nn = Mt ? Ce : `hsla(${Lt[0]}, ${Math.min(Lt[1] * 0.9, 90)}%, ${Math.min(
3890
- Lt[2] + 15,
3821
+ J = F + P * s, yt = (B - P + 1) * s;
3822
+ const st = nt - e;
3823
+ if (st + V < 0 || st > i) continue;
3824
+ const $e = w.color || "#888888", At = this.internal.isEventSelected(w), nn = this.hoveredEventId === w.id, dt = 2, Tt = yt - dt * 2, Gt = 3, ni = 6;
3825
+ let kt = 4, Ut = 4, Dt = 4, Lt = 4;
3826
+ H > 1 && (U && !q ? (Ut = 0, Lt = 0) : !U && q ? (kt = 0, Dt = 0) : !U && !q && (kt = 0, Ut = 0, Dt = 0, Lt = 0)), t.save(), w.readOnly && (t.globalAlpha = 0.5);
3827
+ const zt = _s(Re($e)), si = getComputedStyle(this).getPropertyValue("--text-primary").trim() || "rgba(255, 255, 255, 0.9)", Me = getComputedStyle(this).getPropertyValue("--text-inverse").trim() || "rgb(0, 0, 0)", sn = At ? $e : `hsla(${zt[0]}, ${Math.min(zt[1] * 0.9, 90)}%, ${Math.min(
3828
+ zt[2] + 15,
3891
3829
  40
3892
- )}%, 0.45)`, sn = Mt ? Ce : `hsla(${Lt[0]}, ${Math.min(Lt[1] * 0.9, 90)}%, ${Math.min(
3893
- Lt[2] + 10,
3830
+ )}%, 0.45)`, rn = At ? $e : `hsla(${zt[0]}, ${Math.min(zt[1] * 0.9, 90)}%, ${Math.min(
3831
+ zt[2] + 10,
3894
3832
  70
3895
- )}%, 1)`, rn = this.shouldRenderEventWithStripes(w);
3896
- if (t.beginPath(), t.roundRect(V + ht, nt, xt, B, [
3897
- Tt,
3898
- Yt,
3833
+ )}%, 1)`, on = this.shouldRenderEventWithStripes(w);
3834
+ if (t.beginPath(), t.roundRect(J + dt, st, Tt, V, [
3835
+ kt,
3899
3836
  Ut,
3900
- kt
3901
- ]), t.fillStyle = nn, t.fill(), rn) {
3902
- const lt = this.getStripePatternCanvas();
3903
- if (lt) {
3904
- t.save(), t.beginPath(), t.roundRect(V + ht, nt, xt, B, [
3905
- Tt,
3906
- Yt,
3837
+ Lt,
3838
+ Dt
3839
+ ]), t.fillStyle = sn, t.fill(), on) {
3840
+ const ct = this.getStripePatternCanvas();
3841
+ if (ct) {
3842
+ t.save(), t.beginPath(), t.roundRect(J + dt, st, Tt, V, [
3843
+ kt,
3907
3844
  Ut,
3908
- kt
3845
+ Lt,
3846
+ Dt
3909
3847
  ]), t.clip();
3910
- const U = 12, yt = Math.floor((V + ht) / U) * U, X = Math.floor(it / U) * U - e;
3911
- for (let st = X; st < nt + B; st += U)
3912
- for (let F = yt; F < V + ht + xt; F += U)
3913
- t.drawImage(lt, F, st, U, U);
3848
+ const W = 12, bt = Math.floor((J + dt) / W) * W, Q = Math.floor(nt / W) * W - e;
3849
+ for (let rt = Q; rt < st + V; rt += W)
3850
+ for (let j = bt; j < J + dt + Tt; j += W)
3851
+ t.drawImage(ct, j, rt, W, W);
3914
3852
  t.restore();
3915
3853
  }
3916
3854
  }
3917
- if (Mt || (t.fillStyle = sn, t.beginPath(), t.roundRect(
3918
- V + ht + 2,
3919
- nt + 2,
3920
- Zt,
3921
- B - 4,
3922
- [Tt, Tt, kt, kt]
3923
- ), t.fill()), Mt && (t.strokeStyle = $e, t.lineWidth = 1, t.beginPath(), t.roundRect(V + ht, nt, xt, B, [
3924
- Tt,
3925
- Yt,
3855
+ if (At || (t.fillStyle = rn, t.beginPath(), t.roundRect(
3856
+ J + dt + 2,
3857
+ st + 2,
3858
+ Gt,
3859
+ V - 4,
3860
+ [kt, kt, Dt, Dt]
3861
+ ), t.fill()), At && (t.strokeStyle = Me, t.lineWidth = 1, t.beginPath(), t.roundRect(J + dt, st, Tt, V, [
3862
+ kt,
3926
3863
  Ut,
3927
- kt
3928
- ]), t.stroke()), en && !Mt && (t.strokeStyle = getComputedStyle(this).getPropertyValue("--grid-color-hover").trim() || "rgba(255, 255, 255, 0.2)", t.lineWidth = 1, t.beginPath(), t.roundRect(V + ht, nt, xt, B, [
3929
- Tt,
3930
- Yt,
3864
+ Lt,
3865
+ Dt
3866
+ ]), t.stroke()), nn && !At && (t.strokeStyle = getComputedStyle(this).getPropertyValue("--grid-color-hover").trim() || "rgba(255, 255, 255, 0.2)", t.lineWidth = 1, t.beginPath(), t.roundRect(J + dt, st, Tt, V, [
3867
+ kt,
3931
3868
  Ut,
3932
- kt
3933
- ]), t.stroke()), P && B >= 16) {
3934
- const lt = Mt ? $e : ni;
3935
- t.fillStyle = lt, t.font = `11px ${a}`, t.textAlign = "left", t.textBaseline = "top";
3936
- const U = V + ht + Zt + ii + 1, yt = nt + 6;
3937
- let X = xt - Zt - ii - 4;
3869
+ Lt,
3870
+ Dt
3871
+ ]), t.stroke()), U && V >= 16) {
3872
+ const ct = At ? Me : si;
3873
+ t.fillStyle = ct, t.font = `11px ${a}`, t.textAlign = "left", t.textBaseline = "top";
3874
+ const W = J + dt + Gt + ni + 1, bt = st + 6;
3875
+ let Q = Tt - Gt - ni - 4;
3938
3876
  if (t.save(), t.beginPath(), t.rect(
3939
- V + ht + Zt,
3940
- nt,
3941
- xt - Zt,
3942
- B
3877
+ J + dt + Gt,
3878
+ st,
3879
+ Tt - Gt,
3880
+ V
3943
3881
  ), t.clip(), w.rrule) {
3944
3882
  t.font = `11px ${a}`;
3945
- const bt = "⟳", At = t.measureText(bt).width;
3946
- t.fillText(bt, U, yt), X -= At + 4;
3883
+ const wt = "⟳", Ot = t.measureText(wt).width;
3884
+ t.fillText(wt, W, bt), Q -= Ot + 4;
3947
3885
  }
3948
- const st = U + (w.rrule ? t.measureText("⟳").width + 4 : 0);
3949
- let F = w.title;
3950
- if (t.font = `11px ${a}`, t.measureText(F).width > X) {
3951
- const At = t.measureText("…").width;
3952
- let Ot = 0, Gt = F.length, de = 0;
3953
- for (; Ot <= Gt; ) {
3954
- const dt = Math.floor((Ot + Gt) / 2), si = F.substring(0, dt);
3955
- t.measureText(si).width + At <= X ? (de = dt, Ot = dt + 1) : Gt = dt - 1;
3886
+ const rt = W + (w.rrule ? t.measureText("⟳").width + 4 : 0);
3887
+ let j = w.title;
3888
+ if (t.font = `11px ${a}`, t.measureText(j).width > Q) {
3889
+ const Ot = t.measureText("…").width;
3890
+ let It = 0, Jt = j.length, ue = 0;
3891
+ for (; It <= Jt; ) {
3892
+ const ut = Math.floor((It + Jt) / 2), ri = j.substring(0, ut);
3893
+ t.measureText(ri).width + Ot <= Q ? (ue = ut, It = ut + 1) : Jt = ut - 1;
3956
3894
  }
3957
- F = F.substring(0, de) + "…";
3895
+ j = j.substring(0, ue) + "…";
3958
3896
  }
3959
- if (t.fillText(F, st, yt), B >= 32) {
3960
- const bt = (ue) => {
3961
- const fe = ue.getHours(), Jt = ue.getMinutes(), Qt = fe >= 12 ? "PM" : "AM";
3962
- return `${fe % 12 || 12}:${Jt.toString().padStart(2, "0")} ${Qt}`;
3963
- }, At = bt(w.start), Ot = bt(w.end), Gt = `${At} – ${Ot}`, de = Mt ? $e : ni;
3964
- t.fillStyle = de, t.font = `10px ${a}`;
3965
- let dt = Gt;
3966
- if (t.measureText(dt).width > X) {
3967
- const fe = t.measureText("…").width;
3968
- let Jt = 0, Qt = dt.length, Me = 0;
3969
- for (; Jt <= Qt; ) {
3970
- const ge = Math.floor((Jt + Qt) / 2), on = dt.substring(0, ge);
3971
- t.measureText(on).width + fe <= X ? (Me = ge, Jt = ge + 1) : Qt = ge - 1;
3897
+ if (t.fillText(j, rt, bt), V >= 32) {
3898
+ const wt = (fe) => {
3899
+ const pe = fe.getHours(), Qt = fe.getMinutes(), te = pe >= 12 ? "PM" : "AM";
3900
+ return `${pe % 12 || 12}:${Qt.toString().padStart(2, "0")} ${te}`;
3901
+ }, Ot = wt(w.start), It = wt(w.end), Jt = `${Ot} – ${It}`, ue = At ? Me : si;
3902
+ t.fillStyle = ue, t.font = `10px ${a}`;
3903
+ let ut = Jt;
3904
+ if (t.measureText(ut).width > Q) {
3905
+ const pe = t.measureText("…").width;
3906
+ let Qt = 0, te = ut.length, Ae = 0;
3907
+ for (; Qt <= te; ) {
3908
+ const ge = Math.floor((Qt + te) / 2), an = ut.substring(0, ge);
3909
+ t.measureText(an).width + pe <= Q ? (Ae = ge, Qt = ge + 1) : te = ge - 1;
3972
3910
  }
3973
- dt = dt.substring(0, Me) + "…";
3911
+ ut = ut.substring(0, Ae) + "…";
3974
3912
  }
3975
- t.fillText(dt, U, yt + 14);
3913
+ t.fillText(ut, W, bt + 14);
3976
3914
  }
3977
3915
  t.restore();
3978
3916
  }
3979
3917
  t.restore(), this.eventRects.push({
3980
3918
  event: w,
3981
- x: V + ht,
3982
- y: it,
3983
- width: xt,
3984
- height: B
3919
+ x: J + dt,
3920
+ y: nt,
3921
+ width: Tt,
3922
+ height: V
3985
3923
  });
3986
3924
  }
3987
- const M = [
3925
+ const E = [
3988
3926
  "January",
3989
3927
  "February",
3990
3928
  "March",
@@ -3997,38 +3935,38 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
3997
3935
  "October",
3998
3936
  "November",
3999
3937
  "December"
4000
- ], S = [], _ = /* @__PURE__ */ new Set();
3938
+ ], M = [], A = /* @__PURE__ */ new Set();
4001
3939
  for (const y of r) {
4002
3940
  const w = y.days[0];
4003
3941
  if (!w) continue;
4004
- const D = w.getMonth(), E = w.getFullYear(), x = `${D}-${E}`;
4005
- if (!_.has(x)) {
4006
- _.add(x);
4007
- const A = M[D];
4008
- A && S.push({
4009
- monthKey: x,
4010
- monthName: A,
4011
- year: E,
3942
+ const x = w.getMonth(), k = w.getFullYear(), P = `${x}-${k}`;
3943
+ if (!A.has(P)) {
3944
+ A.add(P);
3945
+ const B = E[x];
3946
+ B && M.push({
3947
+ monthKey: P,
3948
+ monthName: B,
3949
+ year: k,
4012
3950
  yOffset: y.yOffset
4013
3951
  });
4014
3952
  }
4015
3953
  }
4016
- for (let y = 0; y < S.length; y++) {
4017
- const w = S[y], D = S[y + 1], E = w.yOffset, x = D ? D.yOffset : this.totalHeight;
4018
- if (x < e) continue;
4019
- if (E > l) break;
4020
- const A = [12, 0, 0, 12], P = Math.max(0, e - E), K = x - E - 24, tt = Math.min(P, K), et = E + tt - e + 0;
3954
+ for (let y = 0; y < M.length; y++) {
3955
+ const w = M[y], x = M[y + 1], k = w.yOffset, P = x ? x.yOffset : this.totalHeight;
3956
+ if (P < e) continue;
3957
+ if (k > l) break;
3958
+ const B = [12, 0, 0, 12], U = Math.max(0, e - k), q = P - k - 24, H = Math.min(U, q), G = k + H - e + 0;
4021
3959
  t.save(), t.font = `bold 18px ${a}`, t.textAlign = "left", t.textBaseline = "top";
4022
- const at = `${w.monthName} ${w.year}`, it = t.measureText(at).width, B = 0 + A[3] + 8, V = et + A[0], mt = 8, Ht = 8, St = getComputedStyle(this).getPropertyValue("--bg-elevated").trim() || "rgba(0, 0, 0, 0.7)";
3960
+ const lt = `${w.monthName} ${w.year}`, nt = t.measureText(lt).width, V = 0 + B[3] + 8, J = G + B[0], yt = 8, Nt = 8, St = getComputedStyle(this).getPropertyValue("--bg-elevated").trim() || "rgba(0, 0, 0, 0.7)";
4023
3961
  t.fillStyle = St, t.beginPath(), t.roundRect(
4024
- B - mt,
4025
- V - 4,
4026
- it + mt + Ht,
3962
+ V - yt,
3963
+ J - 4,
3964
+ nt + yt + Nt,
4027
3965
  26,
4028
3966
  6
4029
3967
  ), t.fill();
4030
- const nt = getComputedStyle(this).getPropertyValue("--text-primary").trim() || "rgba(255, 255, 255, 0.95)";
4031
- t.fillStyle = nt, t.fillText(at, B, V), t.restore();
3968
+ const st = getComputedStyle(this).getPropertyValue("--text-primary").trim() || "rgba(255, 255, 255, 0.95)";
3969
+ t.fillStyle = st, t.fillText(lt, V, J), t.restore();
4032
3970
  }
4033
3971
  }
4034
3972
  resetDragState() {
@@ -4046,7 +3984,7 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4046
3984
  return o && a && s.size <= 10485760;
4047
3985
  });
4048
3986
  if (i.length === 0) {
4049
- It("No valid .ics files found");
3987
+ Rt("No valid .ics files found");
4050
3988
  return;
4051
3989
  }
4052
3990
  for (const s of i)
@@ -4059,7 +3997,7 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4059
3997
  })
4060
3998
  );
4061
3999
  } catch (r) {
4062
- console.error(`Failed to read ${s.name}:`, r), It(`Failed to read ${s.name}: ${r.message}`);
4000
+ console.error(`Failed to read ${s.name}:`, r), Rt(`Failed to read ${s.name}: ${r.message}`);
4063
4001
  }
4064
4002
  }
4065
4003
  readFileAsText(t) {
@@ -4127,56 +4065,56 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4127
4065
  */
4128
4066
  handleSelectionComplete() {
4129
4067
  if (!this.selection || !this.scrollContainer) return;
4130
- 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 - L) / 7, l = Math.max(
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 - F) / 7, l = Math.max(
4131
4069
  0,
4132
- Math.min(6, Math.floor((t - L) / a))
4070
+ Math.min(6, Math.floor((t - F) / a))
4133
4071
  ), c = Math.max(
4134
4072
  0,
4135
- Math.min(6, Math.floor((e - L) / a))
4073
+ Math.min(6, Math.floor((e - F) / a))
4136
4074
  ), h = this.weeks.filter(
4137
- (g) => g.height > 0 && g.yOffset < s && g.yOffset + g.height > i
4075
+ (p) => p.height > 0 && p.yOffset < s && p.yOffset + p.height > i
4138
4076
  );
4139
4077
  if (h.length === 0) return;
4140
4078
  const d = [];
4141
4079
  if (this.dayHeight >= 200)
4142
- for (const g of h) {
4143
- const m = Math.max(i, g.yOffset), b = Math.min(s, g.yOffset + g.height);
4144
- for (let $ = l; $ <= c; $++) {
4145
- const I = g.days[$];
4080
+ for (const p of h) {
4081
+ const m = Math.max(i, p.yOffset), b = Math.min(s, p.yOffset + p.height);
4082
+ for (let C = l; C <= c; C++) {
4083
+ const I = p.days[C];
4146
4084
  if (!I) continue;
4147
- const z = m - g.yOffset, C = Math.floor(
4148
- z / g.height * 24 * 60
4149
- ), k = Math.floor(C / 60), M = C % 60, S = b - g.yOffset, _ = Math.ceil(S / g.height * 24 * 60), y = Math.floor(_ / 60), w = _ % 60, D = new Date(I);
4150
- D.setHours(k, M, 0, 0);
4151
- const E = new Date(I);
4152
- E.setHours(y, w, 59, 999), d.push({ start: D, end: E });
4085
+ const z = m - p.yOffset, D = Math.floor(
4086
+ z / p.height * 24 * 60
4087
+ ), T = Math.floor(D / 60), $ = D % 60, E = b - p.yOffset, M = Math.ceil(E / p.height * 24 * 60), A = Math.floor(M / 60), y = M % 60, w = new Date(I);
4088
+ w.setHours(T, $, 0, 0);
4089
+ const x = new Date(I);
4090
+ x.setHours(A, y, 59, 999), d.push({ start: w, end: x });
4153
4091
  }
4154
4092
  }
4155
4093
  else
4156
- for (const g of h) {
4157
- const m = g.days[l], b = g.days[c];
4094
+ for (const p of h) {
4095
+ const m = p.days[l], b = p.days[c];
4158
4096
  if (!m || !b) continue;
4159
- const $ = new Date(m);
4160
- $.setHours(0, 0, 0, 0);
4097
+ const C = new Date(m);
4098
+ C.setHours(0, 0, 0, 0);
4161
4099
  const I = new Date(b);
4162
- I.setHours(23, 59, 59, 999), d.push({ start: $, end: I });
4100
+ I.setHours(23, 59, 59, 999), d.push({ start: C, end: I });
4163
4101
  }
4164
4102
  const f = /* @__PURE__ */ new Set();
4165
- for (const g of this.events) {
4166
- if (g.isAllDay) continue;
4167
- const m = g.start.getTime(), b = g.end.getTime();
4168
- for (const $ of d) {
4169
- const I = $.start.getTime(), z = $.end.getTime();
4103
+ for (const p of this.events) {
4104
+ if (p.isAllDay) continue;
4105
+ const m = p.start.getTime(), b = p.end.getTime();
4106
+ for (const C of d) {
4107
+ const I = C.start.getTime(), z = C.end.getTime();
4170
4108
  if (!(b < I || m > z)) {
4171
- f.add(g);
4109
+ f.add(p);
4172
4110
  break;
4173
4111
  }
4174
4112
  }
4175
4113
  }
4176
4114
  const v = Array.from(f);
4177
4115
  this.selectionModifierKey || (this.internal.clearSelection(), this.selectedEventForDetail = null, this.selectedEventRect = null);
4178
- for (const g of v)
4179
- this.internal.selectEvent(g, "add");
4116
+ for (const p of v)
4117
+ this.internal.selectEvent(p, "add");
4180
4118
  this.requestUpdate(), this.dispatchEvent(
4181
4119
  new CustomEvent("selection-change", {
4182
4120
  detail: { selectedEvents: v },
@@ -4231,14 +4169,13 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4231
4169
  if (console.log(t), i ? this.internal.selectEvent(t, "toggle") : this.internal.selectEvent(t, "replace"), i)
4232
4170
  this.selectedEventForDetail = null, this.selectedEventRect = null, this.isDescriptionExpanded = !1, this.requestUpdate();
4233
4171
  else {
4234
- const s = await this.internal.storage?.getNotifications(t.id) || [];
4235
- this.selectedEventForDetail = { ...t, notifications: s }, this.isDescriptionExpanded = !1;
4236
- const r = this.eventRects.find((o) => o.event === t);
4237
- r && (this.selectedEventRect = {
4238
- x: r.x,
4239
- y: r.y,
4240
- width: r.width,
4241
- height: r.height
4172
+ this.selectedEventForDetail = t, this.isDescriptionExpanded = !1;
4173
+ const s = this.eventRects.find((r) => r.event === t);
4174
+ s && (this.selectedEventRect = {
4175
+ x: s.x,
4176
+ y: s.y,
4177
+ width: s.width,
4178
+ height: s.height
4242
4179
  }), this.requestUpdate();
4243
4180
  }
4244
4181
  this.dispatchEvent(
@@ -4342,7 +4279,7 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4342
4279
  this.movingEventEnd.y
4343
4280
  );
4344
4281
  } else {
4345
- const a = Ie(this.movingEvent.color || "#888888");
4282
+ const a = Re(this.movingEvent.color || "#888888");
4346
4283
  this.renderVirtualEvent(
4347
4284
  r,
4348
4285
  o,
@@ -4380,7 +4317,7 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4380
4317
  i.setMinutes(Math.round(i.getMinutes() / 15) * 15, 0, 0), s.setMinutes(Math.round(s.getMinutes() / 15) * 15, 0, 0);
4381
4318
  let r, o;
4382
4319
  if (this.activeCalendarColor) {
4383
- const a = Ie(this.activeCalendarColor);
4320
+ const a = Re(this.activeCalendarColor);
4384
4321
  r = `rgba(${a[0]}, ${a[1]}, ${a[2]}, 0.3)`, o = `rgba(${a[0]}, ${a[1]}, ${a[2]}, 0.8)`;
4385
4322
  } else {
4386
4323
  const a = getComputedStyle(this).getPropertyValue("--accent-primary").trim() || "rgb(100, 150, 255)";
@@ -4400,65 +4337,65 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4400
4337
  renderVirtualEvent(t, e, i, s) {
4401
4338
  if (!this.overlayCanvas || !this.overlayCtx || !this.scrollContainer)
4402
4339
  return;
4403
- const r = this.overlayCtx, o = getComputedStyle(this).fontFamily, c = (this.scrollContainer.getBoundingClientRect().width - L - Ri) / 7, h = (S, _, y) => {
4404
- const w = this.weeks.find(
4405
- (E) => E.days.some((x) => x.toDateString() === S.toDateString())
4340
+ const r = this.overlayCtx, o = getComputedStyle(this).fontFamily, c = (this.scrollContainer.getBoundingClientRect().width - F - Pi) / 7, h = (E, M, A) => {
4341
+ const y = this.weeks.find(
4342
+ (x) => x.days.some((k) => k.toDateString() === E.toDateString())
4406
4343
  );
4407
- if (!w) return null;
4408
- const D = _ * 60 + y;
4409
- return w.yOffset + D / 1440 * w.height - this.scrollTop;
4410
- }, d = (S) => {
4411
- const _ = this.weeks.find(
4412
- (w) => w.days.some((D) => D.toDateString() === S.toDateString())
4344
+ if (!y) return null;
4345
+ const w = M * 60 + A;
4346
+ return y.yOffset + w / 1440 * y.height - this.scrollTop;
4347
+ }, d = (E) => {
4348
+ const M = this.weeks.find(
4349
+ (y) => y.days.some((w) => w.toDateString() === E.toDateString())
4413
4350
  );
4414
- if (!_) return null;
4415
- const y = _.days.findIndex(
4416
- (w) => w.toDateString() === S.toDateString()
4351
+ if (!M) return null;
4352
+ const A = M.days.findIndex(
4353
+ (y) => y.toDateString() === E.toDateString()
4417
4354
  );
4418
- return y < 0 ? null : y * c;
4419
- }, u = (S, _, y) => {
4420
- const w = S + 2, D = c - 4, E = Math.max(4, y - _);
4421
- r.fillStyle = i.fill, r.beginPath(), r.roundRect(w, _, D, E, 4), r.fill(), r.strokeStyle = i.stroke, r.lineWidth = 1, r.setLineDash([6, 3]), r.stroke(), r.setLineDash([]);
4355
+ return A < 0 ? null : A * c;
4356
+ }, u = (E, M, A) => {
4357
+ const y = E + 2, w = c - 4, x = Math.max(4, A - M);
4358
+ r.fillStyle = i.fill, r.beginPath(), r.roundRect(y, M, w, x, 4), r.fill(), r.strokeStyle = i.stroke, r.lineWidth = 1, r.setLineDash([6, 3]), r.stroke(), r.setLineDash([]);
4422
4359
  }, f = t.toDateString() === e.toDateString();
4423
4360
  if (f) {
4424
- const S = d(t), _ = h(t, t.getHours(), t.getMinutes()), y = h(e, e.getHours(), e.getMinutes());
4425
- S != null && _ != null && y != null && u(S, _, y);
4361
+ const E = d(t), M = h(t, t.getHours(), t.getMinutes()), A = h(e, e.getHours(), e.getMinutes());
4362
+ E != null && M != null && A != null && u(E, M, A);
4426
4363
  } else {
4427
- const S = new Date(t);
4428
- S.setHours(0, 0, 0, 0);
4429
- const _ = new Date(e);
4430
- for (_.setHours(23, 59, 59, 999); S <= _; ) {
4431
- const y = d(S);
4432
- if (y != null) {
4433
- const w = S.toDateString() === t.toDateString(), D = S.toDateString() === e.toDateString();
4434
- let E, x;
4435
- w ? (E = h(S, t.getHours(), t.getMinutes()), x = h(S, 23, 59)) : D ? (E = h(S, 0, 0), x = h(S, e.getHours(), e.getMinutes())) : (E = h(S, 0, 0), x = h(S, 23, 59)), E != null && x != null && u(y, E, x);
4364
+ const E = new Date(t);
4365
+ E.setHours(0, 0, 0, 0);
4366
+ const M = new Date(e);
4367
+ for (M.setHours(23, 59, 59, 999); E <= M; ) {
4368
+ const A = d(E);
4369
+ if (A != null) {
4370
+ const y = E.toDateString() === t.toDateString(), w = E.toDateString() === e.toDateString();
4371
+ let x, k;
4372
+ y ? (x = h(E, t.getHours(), t.getMinutes()), k = h(E, 23, 59)) : w ? (x = h(E, 0, 0), k = h(E, e.getHours(), e.getMinutes())) : (x = h(E, 0, 0), k = h(E, 23, 59)), x != null && k != null && u(A, x, k);
4436
4373
  }
4437
- S.setDate(S.getDate() + 1);
4374
+ E.setDate(E.getDate() + 1);
4438
4375
  }
4439
4376
  }
4440
- const v = (S) => `${S.getHours().toString().padStart(2, "0")}:${S.getMinutes().toString().padStart(2, "0")}`, g = (S) => `${S.getDate()}.${S.getMonth() + 1}`, m = f ? `${v(t)} – ${v(e)}` : `${g(t)} ${v(t)} – ${g(e)} ${v(e)}`, I = Math.abs(e.getTime() - t.getTime()) / (1e3 * 60) < 15, z = d(t), C = d(e), k = h(t, t.getHours(), t.getMinutes()), M = h(e, e.getHours(), e.getMinutes());
4441
- if (z != null && C != null && k != null && M != null) {
4377
+ const v = (E) => `${E.getHours().toString().padStart(2, "0")}:${E.getMinutes().toString().padStart(2, "0")}`, p = (E) => `${E.getDate()}.${E.getMonth() + 1}`, m = f ? `${v(t)} – ${v(e)}` : `${p(t)} ${v(t)} – ${p(e)} ${v(e)}`, I = Math.abs(e.getTime() - t.getTime()) / (1e3 * 60) < 15, z = d(t), D = d(e), T = h(t, t.getHours(), t.getMinutes()), $ = h(e, e.getHours(), e.getMinutes());
4378
+ if (z != null && D != null && T != null && $ != null) {
4442
4379
  r.font = `600 11px ${o}`, r.fillStyle = i.text, r.textAlign = "left";
4443
- let S = !0;
4380
+ let E = !0;
4444
4381
  if (s !== void 0) {
4445
- const y = s - this.scrollTop, w = Math.abs(y - k), D = Math.abs(y - M);
4446
- S = w < D;
4382
+ const A = s - this.scrollTop, y = Math.abs(A - T), w = Math.abs(A - $);
4383
+ E = y < w;
4447
4384
  }
4448
- const _ = S ? z : C;
4385
+ const M = E ? z : D;
4449
4386
  if (I) {
4450
- const y = S ? k : M, w = y + 6, D = y + 10, E = r.measureText(m).width, x = 6, A = getComputedStyle(this).getPropertyValue("--bg-elevated").trim() || "rgba(0, 0, 0, 0.8)";
4451
- r.fillStyle = A, r.beginPath(), r.roundRect(
4452
- _ + 4,
4453
- w,
4454
- E + x * 2,
4387
+ const A = E ? T : $, y = A + 6, w = A + 10, x = r.measureText(m).width, k = 6, P = getComputedStyle(this).getPropertyValue("--bg-elevated").trim() || "rgba(0, 0, 0, 0.8)";
4388
+ r.fillStyle = P, r.beginPath(), r.roundRect(
4389
+ M + 4,
4390
+ y,
4391
+ x + k * 2,
4455
4392
  16,
4456
4393
  4
4457
- ), r.fill(), r.fillStyle = "white", r.textBaseline = "top", r.fillText(m, _ + 4 + x, D);
4394
+ ), r.fill(), r.fillStyle = "white", r.textBaseline = "top", r.fillText(m, M + 4 + k, w);
4458
4395
  } else {
4459
4396
  r.textBaseline = "top";
4460
- const y = S ? k + 4 : M - 18;
4461
- r.fillText(m, _ + 8, y);
4397
+ const A = E ? T + 4 : $ - 18;
4398
+ r.fillText(m, M + 8, A);
4462
4399
  }
4463
4400
  }
4464
4401
  }
@@ -4482,16 +4419,16 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4482
4419
  const I = getComputedStyle(this).getPropertyValue("--bg-weekend").trim() || "rgba(255, 255, 255, 0.03)";
4483
4420
  t.fillStyle = I, t.fillRect(d, u, s, l.height);
4484
4421
  }
4485
- const v = this.dayHeight >= 300, g = /* @__PURE__ */ new Date();
4486
- if (!v && Y.isSameDay(h, g)) {
4422
+ const v = this.dayHeight >= 300, p = /* @__PURE__ */ new Date();
4423
+ if (!v && L.isSameDay(h, p)) {
4487
4424
  const I = getComputedStyle(this).getPropertyValue("--accent-current-time").trim() || "rgba(255, 0, 0, 0.8)";
4488
4425
  t.strokeStyle = I, t.lineWidth = 1, t.strokeRect(d + 1, u + 1, s - 2, l.height - 2), t.lineWidth = 1;
4489
4426
  }
4490
- const m = 12, $ = Math.min(
4427
+ const m = 12, C = Math.min(
4491
4428
  f - m,
4492
4429
  i - m - 64
4493
4430
  );
4494
- u < i && f > 0 && $ > u && (t.fillStyle = a, t.fillText(h.getDate().toString(), d + s - 12, $));
4431
+ u < i && f > 0 && C > u && (t.fillStyle = a, t.fillText(h.getDate().toString(), d + s - 12, C));
4495
4432
  }
4496
4433
  }
4497
4434
  }
@@ -4520,18 +4457,18 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4520
4457
  (h - r) / o
4521
4458
  ), f = Math.floor(
4522
4459
  (d - r) / o
4523
- ), v = Math.max(0, u), g = Math.min(this.weeks.length - 1, f);
4524
- for (let m = v; m <= g; m++) {
4460
+ ), v = Math.max(0, u), p = Math.min(this.weeks.length - 1, f);
4461
+ for (let m = v; m <= p; m++) {
4525
4462
  const b = this.weeks[m];
4526
4463
  if (!b || b.height === 0) continue;
4527
- const $ = b.days[0], I = b.days[6];
4528
- if (!$ || !I) continue;
4529
- const z = $.getTime(), C = I.getTime() + a - 1, k = Math.max(h, z), M = Math.min(d, C), S = Math.floor(
4530
- k % a / l
4531
- ), _ = Math.floor(
4532
- M % a / l
4533
- ), y = b.yOffset / this.totalHeight * e + S / 1440 * (b.height / this.totalHeight * e), w = b.yOffset / this.totalHeight * e + _ / 1440 * (b.height / this.totalHeight * e);
4534
- i.globalAlpha = c.readOnly ? 0.333 * 0.5 : 0.333, i.fillStyle = c.color || "#888", i.fillRect(2, y, t - 4, Math.max(w - y, 2));
4464
+ const C = b.days[0], I = b.days[6];
4465
+ if (!C || !I) continue;
4466
+ const z = C.getTime(), D = I.getTime() + a - 1, T = Math.max(h, z), $ = Math.min(d, D), E = Math.floor(
4467
+ T % a / l
4468
+ ), M = Math.floor(
4469
+ $ % a / l
4470
+ ), A = b.yOffset / this.totalHeight * e + E / 1440 * (b.height / this.totalHeight * e), y = b.yOffset / this.totalHeight * e + M / 1440 * (b.height / this.totalHeight * e);
4471
+ i.globalAlpha = c.readOnly ? 0.333 * 0.5 : 0.333, i.fillStyle = c.color || "#888", i.fillRect(2, A, t - 4, Math.max(y - A, 2));
4535
4472
  }
4536
4473
  }
4537
4474
  }
@@ -4586,11 +4523,11 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4586
4523
  */
4587
4524
  convertPositionToDateTime(t, e, i) {
4588
4525
  if (!this.scrollContainer) return null;
4589
- const o = (this.scrollContainer.getBoundingClientRect().width - L) / 7;
4590
- if (t < L) return null;
4526
+ const o = (this.scrollContainer.getBoundingClientRect().width - F) / 7;
4527
+ if (t < F) return null;
4591
4528
  const a = Math.max(
4592
4529
  0,
4593
- Math.min(6, Math.floor((t - L) / o))
4530
+ Math.min(6, Math.floor((t - F) / o))
4594
4531
  ), l = this.weeks.find(
4595
4532
  (f) => f.height > 0 && f.yOffset <= e && f.yOffset + f.height > e
4596
4533
  );
@@ -4608,13 +4545,13 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4608
4545
  }
4609
4546
  convertDateTimeToPosition(t) {
4610
4547
  if (!this.scrollContainer) return null;
4611
- const s = (this.scrollContainer.getBoundingClientRect().width - L) / 7, r = t.toDateString(), o = this.weeks.find(
4612
- (v) => v.days.some((g) => g.toDateString() === r)
4548
+ const s = (this.scrollContainer.getBoundingClientRect().width - F) / 7, r = t.toDateString(), o = this.weeks.find(
4549
+ (v) => v.days.some((p) => p.toDateString() === r)
4613
4550
  );
4614
4551
  if (!o) return null;
4615
4552
  const a = o.days.findIndex((v) => v.toDateString() === r);
4616
4553
  if (a === -1) return null;
4617
- const l = L + a * s + s / 2, c = t.getHours(), h = t.getMinutes(), u = (c * 60 + h) / 1440 * o.height, f = o.yOffset + u;
4554
+ const l = F + a * s + s / 2, c = t.getHours(), h = t.getMinutes(), u = (c * 60 + h) / 1440 * o.height, f = o.yOffset + u;
4618
4555
  return { x: l, y: f };
4619
4556
  }
4620
4557
  getCursorTime() {
@@ -4652,6 +4589,10 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4652
4589
  DELEGATED: "Delegated"
4653
4590
  }[t] || t;
4654
4591
  }
4592
+ findCurrentUserAttendee(t) {
4593
+ if (t.attendees)
4594
+ return t.attendees.find((e) => this.currentUserEmails.has(e.email));
4595
+ }
4655
4596
  updateAttendeeStatus(t, e, i) {
4656
4597
  if (!t.attendees) return;
4657
4598
  const s = t.attendees.map(
@@ -4669,7 +4610,7 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4669
4610
  ), this.selectedEventForDetail = null, this.selectedEventRect = null, this.requestUpdate();
4670
4611
  }
4671
4612
  renderNotificationsList(t) {
4672
- return t.notifications?.length ? t.notifications.map((e) => O`
4613
+ return t.reminders?.length ? t.reminders.map((e) => O`
4673
4614
  <div class="notification-item">
4674
4615
  <select
4675
4616
  class="notification-select"
@@ -4679,7 +4620,7 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4679
4620
  this.updateNotification(t, e.id, { triggerOffset: s });
4680
4621
  }}
4681
4622
  >
4682
- ${$s.map((i) => O`<option value="${i.value}">${i.label}</option>`)}
4623
+ ${Ms.map((i) => O`<option value="${i.value}" ?selected=${i.value === e.triggerOffset}>${i.label}</option>`)}
4683
4624
  </select>
4684
4625
  <button
4685
4626
  class="notification-remove-button"
@@ -4693,27 +4634,27 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4693
4634
  id: `${t.id}-notif-${Date.now()}`,
4694
4635
  triggerOffset: 15,
4695
4636
  enabled: !0
4696
- }, i = [...t.notifications || [], e];
4637
+ }, i = [...t.reminders || [], e];
4697
4638
  this.dispatchEvent(new CustomEvent("update-event", {
4698
- detail: { event: t, updates: { notifications: i } },
4639
+ detail: { event: t, updates: { reminders: i } },
4699
4640
  bubbles: !0,
4700
4641
  composed: !0
4701
4642
  }));
4702
4643
  }
4703
4644
  updateNotification(t, e, i) {
4704
- const s = (t.notifications || []).map(
4645
+ const s = (t.reminders || []).map(
4705
4646
  (r) => r.id === e ? { ...r, ...i } : r
4706
4647
  );
4707
4648
  this.dispatchEvent(new CustomEvent("update-event", {
4708
- detail: { event: t, updates: { notifications: s } },
4649
+ detail: { event: t, updates: { reminders: s } },
4709
4650
  bubbles: !0,
4710
4651
  composed: !0
4711
4652
  }));
4712
4653
  }
4713
4654
  removeNotification(t, e) {
4714
- const i = (t.notifications || []).filter((s) => s.id !== e);
4655
+ const i = (t.reminders || []).filter((s) => s.id !== e);
4715
4656
  this.dispatchEvent(new CustomEvent("update-event", {
4716
- detail: { event: t, updates: { notifications: i } },
4657
+ detail: { event: t, updates: { reminders: i } },
4717
4658
  bubbles: !0,
4718
4659
  composed: !0
4719
4660
  }));
@@ -4721,10 +4662,8 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4721
4662
  shouldRenderEventWithStripes(t) {
4722
4663
  if (t.status === "TENTATIVE")
4723
4664
  return !0;
4724
- if (!t.attendees || !t.currentUserEmail) return !1;
4725
- const e = t.attendees.find(
4726
- (i) => i.email.toLowerCase().includes(t.currentUserEmail.toLowerCase())
4727
- );
4665
+ if (!t.attendees) return !1;
4666
+ const e = this.findCurrentUserAttendee(t);
4728
4667
  return e ? e.status !== "ACCEPTED" : !1;
4729
4668
  }
4730
4669
  getStripePatternCanvas() {
@@ -4740,15 +4679,15 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4740
4679
  renderEventDetail() {
4741
4680
  if (!this.selectedEventForDetail || !this.selectedEventRect)
4742
4681
  return null;
4743
- const t = this.selectedEventForDetail, e = (C) => new Intl.DateTimeFormat(this.locale, {
4682
+ const t = this.selectedEventForDetail, e = (D) => new Intl.DateTimeFormat(this.locale, {
4744
4683
  weekday: "short",
4745
4684
  year: "numeric",
4746
4685
  month: "short",
4747
4686
  day: "numeric"
4748
- }).format(C), i = (C) => new Intl.DateTimeFormat(this.locale, {
4687
+ }).format(D), i = (D) => new Intl.DateTimeFormat(this.locale, {
4749
4688
  hour: "numeric",
4750
4689
  minute: "2-digit"
4751
- }).format(C), s = Y.isSameDay(t.start, t.end), r = 320, o = 550, a = 8, l = this.scrollContainer?.clientWidth || 800, c = this.scrollContainer?.clientHeight || 600, h = this.selectedEventRect.x + this.selectedEventRect.width + a, d = this.selectedEventRect.x - r - a, u = h + r <= l ? h : d, f = L + a, v = l - r - a, g = Math.max(f, Math.min(v, u)), m = this.selectedEventRect.y - this.scrollTop, b = a, $ = c - o - a, I = Math.max(b, Math.min($, m)), z = `left: ${g}px; top: ${I}px; --calendar-color: ${t.color || "#888888"};`;
4690
+ }).format(D), s = L.isSameDay(t.start, t.end), r = 320, o = 550, a = 8, l = this.scrollContainer?.clientWidth || 800, c = this.scrollContainer?.clientHeight || 600, h = this.selectedEventRect.x + this.selectedEventRect.width + a, d = this.selectedEventRect.x - r - a, u = h + r <= l ? h : d, f = F + a, v = l - r - a, p = Math.max(f, Math.min(v, u)), m = this.selectedEventRect.y - this.scrollTop, b = a, C = c - o - a, I = Math.max(b, Math.min(C, m)), z = `left: ${p}px; top: ${I}px; --calendar-color: ${t.color || "#888888"};`;
4752
4691
  return O`
4753
4692
  <div class="event-detail-overlay" style="${z}">
4754
4693
  <div class="event-detail-color-bar" style="opacity: ${t.readOnly ? "0.5" : "1"}"></div>
@@ -4768,29 +4707,29 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4768
4707
  class="event-detail-title-input"
4769
4708
  .value=${t.title}
4770
4709
  placeholder="Event title"
4771
- @input=${(C) => {
4772
- const M = C.target.value;
4773
- M !== t.title && (this.updateEventTimeout && clearTimeout(this.updateEventTimeout), this.updateEventTimeout = setTimeout(() => {
4710
+ @input=${(D) => {
4711
+ const $ = D.target.value;
4712
+ $ !== t.title && (this.updateEventTimeout && clearTimeout(this.updateEventTimeout), this.updateEventTimeout = setTimeout(() => {
4774
4713
  this.dispatchEvent(
4775
4714
  new CustomEvent("update-event", {
4776
- detail: { event: t, updates: { title: M } },
4715
+ detail: { event: t, updates: { title: $ } },
4777
4716
  bubbles: !0,
4778
4717
  composed: !0
4779
4718
  })
4780
4719
  ), this.updateEventTimeout = null;
4781
4720
  }, 500));
4782
4721
  }}
4783
- @keydown=${(C) => {
4784
- if (C.key === "Enter") {
4722
+ @keydown=${(D) => {
4723
+ if (D.key === "Enter") {
4785
4724
  this.updateEventTimeout && (clearTimeout(this.updateEventTimeout), this.updateEventTimeout = null);
4786
- const k = C.target, M = k.value;
4787
- M !== t.title && this.dispatchEvent(
4725
+ const T = D.target, $ = T.value;
4726
+ $ !== t.title && this.dispatchEvent(
4788
4727
  new CustomEvent("update-event", {
4789
- detail: { event: t, updates: { title: M } },
4728
+ detail: { event: t, updates: { title: $ } },
4790
4729
  bubbles: !0,
4791
4730
  composed: !0
4792
4731
  })
4793
- ), k.blur();
4732
+ ), T.blur();
4794
4733
  }
4795
4734
  }}
4796
4735
  />
@@ -4843,19 +4782,17 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4843
4782
 
4844
4783
  ${(() => {
4845
4784
  if (!t.attendees || t.attendees.length === 0) return null;
4846
- const C = t.currentUserEmail ? t.attendees.find(
4847
- (M) => M.email.toLowerCase().includes(t.currentUserEmail.toLowerCase())
4848
- ) : null, k = C ? t.attendees.filter((M) => M !== C) : t.attendees;
4849
- return k.length > 0 ? O`
4785
+ const D = this.findCurrentUserAttendee(t), T = D ? t.attendees.filter(($) => $ !== D) : t.attendees;
4786
+ return T.length > 0 ? O`
4850
4787
  <div class="event-detail-section">
4851
- <div class="event-detail-label">Participants (${k.length})</div>
4788
+ <div class="event-detail-label">Participants (${T.length})</div>
4852
4789
  <div class="event-detail-value">
4853
- ${k.map(
4854
- (M) => O`
4790
+ ${T.map(
4791
+ ($) => O`
4855
4792
  <div style="margin-bottom: 4px">
4856
- <span title=${M.email}>${M.name || M.email}</span>
4857
- ${M.status ? O`<span style="opacity: 0.7"> - ${this.formatAttendeeStatus(
4858
- M.status
4793
+ <span title=${$.email}>${$.name || $.email}</span>
4794
+ ${$.status ? O`<span style="opacity: 0.7"> - ${this.formatAttendeeStatus(
4795
+ $.status
4859
4796
  )}</span>` : null}
4860
4797
  </div>
4861
4798
  `
@@ -4904,31 +4841,29 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4904
4841
 
4905
4842
  ${(() => {
4906
4843
  if (!t.attendees || t.attendees.length === 0) return null;
4907
- const C = t.currentUserEmail ? t.attendees.find(
4908
- (k) => k.email.toLowerCase().includes(t.currentUserEmail.toLowerCase())
4909
- ) : null;
4910
- return !C || t.readOnly || t.organizer?.email === C.email ? null : O`
4844
+ const D = this.findCurrentUserAttendee(t);
4845
+ return !D || t.readOnly || t.organizer?.email === D.email ? null : O`
4911
4846
  <div class="event-detail-footer">
4912
4847
  <div class="invite-response-buttons">
4913
4848
  <button
4914
- class="invite-response-button ${C.status === "ACCEPTED" ? "active" : ""}"
4915
- @click=${() => this.updateAttendeeStatus(t, C, "ACCEPTED")}
4849
+ class="invite-response-button ${D.status === "ACCEPTED" ? "active" : ""}"
4850
+ @click=${() => this.updateAttendeeStatus(t, D, "ACCEPTED")}
4916
4851
  >
4917
4852
  Accept
4918
4853
  </button>
4919
4854
  <button
4920
- class="invite-response-button ${C.status === "TENTATIVE" ? "active" : ""}"
4855
+ class="invite-response-button ${D.status === "TENTATIVE" ? "active" : ""}"
4921
4856
  @click=${() => this.updateAttendeeStatus(
4922
4857
  t,
4923
- C,
4858
+ D,
4924
4859
  "TENTATIVE"
4925
4860
  )}
4926
4861
  >
4927
4862
  Maybe
4928
4863
  </button>
4929
4864
  <button
4930
- class="invite-response-button ${C.status === "DECLINED" ? "active" : ""}"
4931
- @click=${() => this.updateAttendeeStatus(t, C, "DECLINED")}
4865
+ class="invite-response-button ${D.status === "DECLINED" ? "active" : ""}"
4866
+ @click=${() => this.updateAttendeeStatus(t, D, "DECLINED")}
4932
4867
  >
4933
4868
  Decline
4934
4869
  </button>
@@ -4965,8 +4900,8 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4965
4900
  <input
4966
4901
  type="range"
4967
4902
  class="toolbar-zoom-slider"
4968
- min="${Wt}"
4969
- max="${pe}"
4903
+ min="${Ft}"
4904
+ max="${ve}"
4970
4905
  .value=${this.dayHeight}
4971
4906
  @input=${this.onZoomSliderChange}
4972
4907
  title="Adjust zoom level"
@@ -4981,7 +4916,7 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
4981
4916
  @change=${this.onThemeChange}
4982
4917
  title="Select theme"
4983
4918
  >
4984
- ${Us.map(
4919
+ ${Ls.map(
4985
4920
  (t) => O`<option value="${t.name}">${t.label}</option>`
4986
4921
  )}
4987
4922
  </select>-->
@@ -5070,7 +5005,7 @@ const Wt = 100, pe = 3e3, L = 60, Ri = 12, ve = 20, ei = class ei extends qt {
5070
5005
  `;
5071
5006
  }
5072
5007
  };
5073
- ei.styles = Li`
5008
+ ii.styles = zi`
5074
5009
  :host {
5075
5010
  display: block;
5076
5011
  position: relative;
@@ -5775,8 +5710,8 @@ ei.styles = Li`
5775
5710
  background: var(--bg-drag-over, rgba(59, 130, 246, 0.05));
5776
5711
  }
5777
5712
  `;
5778
- let Pi = ei;
5779
- function Hi(n, t) {
5713
+ let Yi = ii;
5714
+ function Ni(n, t) {
5780
5715
  const e = new Date(t).setHours(0, 0, 0, 0);
5781
5716
  for (let s = 0; s < 7; s++) {
5782
5717
  const r = n.days[s];
@@ -5786,7 +5721,7 @@ function Hi(n, t) {
5786
5721
  const i = new Date(n.days[0]).setHours(0, 0, 0, 0);
5787
5722
  return e < i ? 0 : 6;
5788
5723
  }
5789
- class Bs {
5724
+ class qs {
5790
5725
  constructor(t, e, i = "#3b82f6", s = !0) {
5791
5726
  this.id = t, this.name = e, this.color = i, this.enabled = s, this.type = "in-memory", this.credentials = {}, this.events = /* @__PURE__ */ new Map();
5792
5727
  }
@@ -5835,30 +5770,31 @@ class Bs {
5835
5770
  this.events.clear();
5836
5771
  }
5837
5772
  }
5838
- const Te = class Te {
5773
+ const ke = class ke {
5839
5774
  // 5 minutes
5840
5775
  constructor(t) {
5841
5776
  this.internals = t;
5842
5777
  }
5843
5778
  async shouldSync(t) {
5844
5779
  const e = await this.internals.storage.getSyncMetadata(t.id);
5845
- return e ? Date.now() - e.lastSync.getTime() >= Te.SYNC_INTERVAL_MS : !0;
5780
+ return e ? Date.now() - e.lastSync.getTime() >= ke.SYNC_INTERVAL_MS : !0;
5846
5781
  }
5847
5782
  async sync(t, e) {
5848
- if (!t.enabled || !e?.force && !await this.shouldSync(t))
5849
- return;
5850
- const i = await t.fetchEvents(), s = /* @__PURE__ */ new Date();
5851
- this.internals.sync(t.name, s, i), await this.internals.storage.setSyncMetadata(t.id, {
5783
+ if (!t.enabled) return [];
5784
+ if (!e?.force && !await this.shouldSync(t))
5785
+ return [];
5786
+ const i = await t.fetchEvents(), s = /* @__PURE__ */ new Date(), r = this.internals.sync(t.name, s, i);
5787
+ return await this.internals.storage.setSyncMetadata(t.id, {
5852
5788
  lastSync: /* @__PURE__ */ new Date()
5853
- });
5789
+ }), r;
5854
5790
  }
5855
5791
  };
5856
- Te.SYNC_INTERVAL_MS = 300 * 1e3;
5857
- let Yi = Te;
5792
+ ke.SYNC_INTERVAL_MS = 300 * 1e3;
5793
+ let Ui = ke;
5858
5794
  export {
5859
- Yi as CalendarIntegration,
5860
- Y as CalendarInternal,
5861
- Pi as CalendarViewElement,
5862
- Bs as InMemorySource,
5863
- $s as NOTIFICATION_PRESETS
5795
+ Ui as CalendarIntegration,
5796
+ L as CalendarInternal,
5797
+ Yi as CalendarViewElement,
5798
+ qs as InMemorySource,
5799
+ Ms as NOTIFICATION_PRESETS
5864
5800
  };