@forcecalendar/interface 1.0.18 → 1.0.20

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.
@@ -1,7 +1,7 @@
1
- var Y = Object.defineProperty;
2
- var j = (u, e, t) => e in u ? Y(u, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[e] = t;
3
- var z = (u, e, t) => j(u, typeof e != "symbol" ? e + "" : e, t);
4
- class _ extends HTMLElement {
1
+ var V = Object.defineProperty;
2
+ var W = (u, e, t) => e in u ? V(u, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[e] = t;
3
+ var $ = (u, e, t) => W(u, typeof e != "symbol" ? e + "" : e, t);
4
+ class O extends HTMLElement {
5
5
  constructor() {
6
6
  super(), this.attachShadow({ mode: "open" }), this._listeners = [], this._state = null, this._props = /* @__PURE__ */ new Map(), this._initialized = !1;
7
7
  }
@@ -108,7 +108,7 @@ class _ extends HTMLElement {
108
108
  this.setProp(e, s), this._initialized && this.render();
109
109
  }
110
110
  }
111
- class W {
111
+ class j {
112
112
  constructor() {
113
113
  this.timezones = {
114
114
  // UTC
@@ -673,25 +673,25 @@ class W {
673
673
  };
674
674
  }
675
675
  }
676
- let C = null;
677
- class S {
676
+ let k = null;
677
+ class C {
678
678
  /**
679
679
  * Get the shared singleton instance of TimezoneManager
680
680
  * This should be used instead of creating new instances to avoid memory bloat
681
681
  * @returns {TimezoneManager} The shared instance
682
682
  */
683
683
  static getInstance() {
684
- return C || (C = new S()), C;
684
+ return k || (k = new C()), k;
685
685
  }
686
686
  /**
687
687
  * Reset the singleton instance (useful for testing)
688
688
  * @private
689
689
  */
690
690
  static _resetInstance() {
691
- C && C.clearCache(), C = null;
691
+ k && k.clearCache(), k = null;
692
692
  }
693
693
  constructor() {
694
- this.database = new W(), this.offsetCache = /* @__PURE__ */ new Map(), this.dstCache = /* @__PURE__ */ new Map(), this.maxCacheSize = 1e3, this.cacheHits = 0, this.cacheMisses = 0;
694
+ this.database = new j(), this.offsetCache = /* @__PURE__ */ new Map(), this.dstCache = /* @__PURE__ */ new Map(), this.maxCacheSize = 1e3, this.cacheHits = 0, this.cacheMisses = 0;
695
695
  }
696
696
  /**
697
697
  * Convert date from one timezone to another
@@ -976,7 +976,7 @@ class S {
976
976
  }
977
977
  }
978
978
  }
979
- class D {
979
+ class w {
980
980
  /**
981
981
  * Normalize event data
982
982
  * @param {import('../../types.js').EventData} data - Raw event data
@@ -1039,27 +1039,27 @@ class D {
1039
1039
  color: o = null,
1040
1040
  backgroundColor: c = null,
1041
1041
  borderColor: l = null,
1042
- textColor: d = null,
1043
- recurring: h = !1,
1044
- recurrenceRule: m = null,
1042
+ textColor: h = null,
1043
+ recurring: d = !1,
1044
+ recurrenceRule: p = null,
1045
1045
  timeZone: b = null,
1046
- endTimeZone: x = null,
1047
- status: A = "confirmed",
1048
- visibility: k = "public",
1049
- organizer: M = null,
1050
- attendees: $ = [],
1046
+ endTimeZone: v = null,
1047
+ status: M = "confirmed",
1048
+ visibility: D = "public",
1049
+ organizer: T = null,
1050
+ attendees: A = [],
1051
1051
  reminders: I = [],
1052
1052
  category: R,
1053
1053
  // Support singular category (no default)
1054
1054
  categories: B,
1055
1055
  // Support plural categories (no default)
1056
- attachments: V = [],
1057
- conferenceData: N = null,
1058
- metadata: P = {},
1059
- ...U
1056
+ attachments: U = [],
1057
+ conferenceData: Y = null,
1058
+ metadata: N = {},
1059
+ ...P
1060
1060
  // Capture any extra properties
1061
1061
  }) {
1062
- const g = D.normalize({
1062
+ const g = w.normalize({
1063
1063
  id: e,
1064
1064
  title: t,
1065
1065
  start: s,
@@ -1070,27 +1070,27 @@ class D {
1070
1070
  color: o,
1071
1071
  backgroundColor: c,
1072
1072
  borderColor: l,
1073
- textColor: d,
1074
- recurring: h,
1075
- recurrenceRule: m,
1073
+ textColor: h,
1074
+ recurring: d,
1075
+ recurrenceRule: p,
1076
1076
  timeZone: b,
1077
- endTimeZone: x,
1078
- status: A,
1079
- visibility: k,
1080
- organizer: M,
1081
- attendees: $,
1077
+ endTimeZone: v,
1078
+ status: M,
1079
+ visibility: D,
1080
+ organizer: T,
1081
+ attendees: A,
1082
1082
  reminders: I,
1083
1083
  category: R,
1084
1084
  // Pass category to normalize
1085
1085
  categories: B,
1086
1086
  // Pass categories to normalize
1087
- attachments: V,
1088
- conferenceData: N,
1089
- metadata: P,
1090
- ...U
1087
+ attachments: U,
1088
+ conferenceData: Y,
1089
+ metadata: N,
1090
+ ...P
1091
1091
  // Pass any extra properties
1092
1092
  });
1093
- D.validate(g), this.id = g.id, this.title = g.title, this._timezoneManager = S.getInstance(), this.timeZone = g.timeZone || this._timezoneManager.getSystemTimezone(), this.endTimeZone = g.endTimeZone || this.timeZone, this.start = g.start, this.end = g.end, this.startUTC = this._timezoneManager.toUTC(this.start, this.timeZone), this.endUTC = this._timezoneManager.toUTC(this.end, this.endTimeZone), this.allDay = g.allDay, this.description = g.description, this.location = g.location, this.color = g.color, this.backgroundColor = g.backgroundColor, this.borderColor = g.borderColor, this.textColor = g.textColor, this.recurring = g.recurring, this.recurrenceRule = g.recurrenceRule, this._originalTimeZone = g.timeZone || null, this.status = g.status, this.visibility = g.visibility, this.organizer = g.organizer, this.attendees = [...g.attendees], this.reminders = [...g.reminders], this.categories = g.categories ? [...g.categories] : [], this.attachments = [...g.attachments], this.conferenceData = g.conferenceData, this.metadata = { ...g.metadata }, this._cache = {}, this._validateAttendees(), this._validateReminders();
1093
+ w.validate(g), this.id = g.id, this.title = g.title, this._timezoneManager = C.getInstance(), this.timeZone = g.timeZone || this._timezoneManager.getSystemTimezone(), this.endTimeZone = g.endTimeZone || this.timeZone, this.start = g.start, this.end = g.end, this.startUTC = this._timezoneManager.toUTC(this.start, this.timeZone), this.endUTC = this._timezoneManager.toUTC(this.end, this.endTimeZone), this.allDay = g.allDay, this.description = g.description, this.location = g.location, this.color = g.color, this.backgroundColor = g.backgroundColor, this.borderColor = g.borderColor, this.textColor = g.textColor, this.recurring = g.recurring, this.recurrenceRule = g.recurrenceRule, this._originalTimeZone = g.timeZone || null, this.status = g.status, this.visibility = g.visibility, this.organizer = g.organizer, this.attendees = [...g.attendees], this.reminders = [...g.reminders], this.categories = g.categories ? [...g.categories] : [], this.attachments = [...g.attachments], this.conferenceData = g.conferenceData, this.metadata = { ...g.metadata }, this._cache = {}, this._validateAttendees(), this._validateReminders();
1094
1094
  }
1095
1095
  /**
1096
1096
  * Get event duration in milliseconds
@@ -1180,7 +1180,7 @@ class D {
1180
1180
  * @throws {Error} If otherEvent is not an Event instance or doesn't have start/end
1181
1181
  */
1182
1182
  overlaps(e) {
1183
- if (e instanceof D)
1183
+ if (e instanceof w)
1184
1184
  return !(this.end <= e.start || this.start >= e.end);
1185
1185
  if (e && e.start && e.end)
1186
1186
  return !(this.end <= e.start || this.start >= e.end);
@@ -1200,7 +1200,7 @@ class D {
1200
1200
  * @returns {Event} New Event instance with updated properties
1201
1201
  */
1202
1202
  clone(e = {}) {
1203
- return new D({
1203
+ return new w({
1204
1204
  id: this.id,
1205
1205
  title: this.title,
1206
1206
  start: new Date(this.start),
@@ -1264,7 +1264,7 @@ class D {
1264
1264
  * @returns {Event} New Event instance
1265
1265
  */
1266
1266
  static fromObject(e) {
1267
- return new D(e);
1267
+ return new w(e);
1268
1268
  }
1269
1269
  /**
1270
1270
  * Compare events for equality
@@ -1272,7 +1272,7 @@ class D {
1272
1272
  * @returns {boolean} True if events are equal
1273
1273
  */
1274
1274
  equals(e) {
1275
- return e instanceof D ? this.id === e.id && this.title === e.title && this.start.getTime() === e.start.getTime() && this.end.getTime() === e.end.getTime() && this.allDay === e.allDay && this.description === e.description && this.location === e.location && this.recurring === e.recurring && this.recurrenceRule === e.recurrenceRule && this.status === e.status : !1;
1275
+ return e instanceof w ? this.id === e.id && this.title === e.title && this.start.getTime() === e.start.getTime() && this.end.getTime() === e.end.getTime() && this.allDay === e.allDay && this.description === e.description && this.location === e.location && this.recurring === e.recurring && this.recurrenceRule === e.recurrenceRule && this.status === e.status : !1;
1276
1276
  }
1277
1277
  // ============ Attendee Management Methods ============
1278
1278
  /**
@@ -1531,7 +1531,7 @@ class D {
1531
1531
  return this.conferenceData !== null;
1532
1532
  }
1533
1533
  }
1534
- let f = class w {
1534
+ let f = class y {
1535
1535
  /**
1536
1536
  * Get the start of a day
1537
1537
  * @param {Date} date - The date
@@ -1567,7 +1567,7 @@ let f = class w {
1567
1567
  * @returns {Date}
1568
1568
  */
1569
1569
  static endOfWeek(e, t = 0) {
1570
- const s = w.startOfWeek(e, t);
1570
+ const s = y.startOfWeek(e, t);
1571
1571
  return s.setDate(s.getDate() + 6), s.setHours(23, 59, 59, 999), s;
1572
1572
  }
1573
1573
  /**
@@ -1619,7 +1619,7 @@ let f = class w {
1619
1619
  * @returns {Date}
1620
1620
  */
1621
1621
  static addWeeks(e, t) {
1622
- return w.addDays(e, t * 7);
1622
+ return y.addDays(e, t * 7);
1623
1623
  }
1624
1624
  /**
1625
1625
  * Add months to a date
@@ -1701,7 +1701,7 @@ let f = class w {
1701
1701
  * @returns {boolean}
1702
1702
  */
1703
1703
  static isSameWeek(e, t, s = 0) {
1704
- const i = w.startOfWeek(e, s), r = w.startOfWeek(t, s);
1704
+ const i = y.startOfWeek(e, s), r = y.startOfWeek(t, s);
1705
1705
  return i.toDateString() === r.toDateString();
1706
1706
  }
1707
1707
  /**
@@ -1739,7 +1739,7 @@ let f = class w {
1739
1739
  * @returns {number}
1740
1740
  */
1741
1741
  static differenceInWeeks(e, t) {
1742
- return Math.floor(w.differenceInDays(e, t) / 7);
1742
+ return Math.floor(y.differenceInDays(e, t) / 7);
1743
1743
  }
1744
1744
  /**
1745
1745
  * Get the difference in months between two dates
@@ -1795,7 +1795,7 @@ let f = class w {
1795
1795
  * @returns {string}
1796
1796
  */
1797
1797
  static getMonthName(e, t = "en-US", s = "long") {
1798
- return w.format(e, t, { month: s });
1798
+ return y.format(e, t, { month: s });
1799
1799
  }
1800
1800
  /**
1801
1801
  * Get day name
@@ -1805,7 +1805,7 @@ let f = class w {
1805
1805
  * @returns {string}
1806
1806
  */
1807
1807
  static getDayName(e, t = "en-US", s = "long") {
1808
- return w.format(e, t, { weekday: s });
1808
+ return y.format(e, t, { weekday: s });
1809
1809
  }
1810
1810
  /**
1811
1811
  * Format time
@@ -1815,7 +1815,7 @@ let f = class w {
1815
1815
  * @returns {string}
1816
1816
  */
1817
1817
  static formatTime(e, t = "en-US", s = !1) {
1818
- return w.format(e, t, {
1818
+ return y.format(e, t, {
1819
1819
  hour: "numeric",
1820
1820
  minute: "2-digit",
1821
1821
  hour12: !s
@@ -1837,7 +1837,7 @@ let f = class w {
1837
1837
  * @returns {Date}
1838
1838
  */
1839
1839
  static setTime(e, t) {
1840
- const s = new Date(e), { hours: i, minutes: r } = w.parseTime(t);
1840
+ const s = new Date(e), { hours: i, minutes: r } = y.parseTime(t);
1841
1841
  return s.setHours(i, r, 0, 0), s;
1842
1842
  }
1843
1843
  /**
@@ -1916,7 +1916,7 @@ let f = class w {
1916
1916
  * @returns {boolean}
1917
1917
  */
1918
1918
  static isDST(e, t) {
1919
- const s = new Date(e.getFullYear(), 0, 1), i = new Date(e.getFullYear(), 6, 1), r = w.getTimezoneOffset(s, t), n = w.getTimezoneOffset(i, t), a = w.getTimezoneOffset(e, t);
1919
+ const s = new Date(e.getFullYear(), 0, 1), i = new Date(e.getFullYear(), 6, 1), r = y.getTimezoneOffset(s, t), n = y.getTimezoneOffset(i, t), a = y.getTimezoneOffset(e, t);
1920
1920
  return Math.max(r, n) === a;
1921
1921
  }
1922
1922
  /**
@@ -1927,9 +1927,9 @@ let f = class w {
1927
1927
  * @returns {Date}
1928
1928
  */
1929
1929
  static addHoursWithDST(e, t, s) {
1930
- const i = new Date(e), r = w.getTimezoneOffset(e, s);
1930
+ const i = new Date(e), r = y.getTimezoneOffset(e, s);
1931
1931
  i.setTime(i.getTime() + t * 60 * 60 * 1e3);
1932
- const n = w.getTimezoneOffset(i, s);
1932
+ const n = y.getTimezoneOffset(i, s);
1933
1933
  if (r !== n) {
1934
1934
  const a = (n - r) * 6e4;
1935
1935
  i.setTime(i.getTime() + a);
@@ -1948,8 +1948,8 @@ let f = class w {
1948
1948
  * @returns {Date}
1949
1949
  */
1950
1950
  static createInTimeZone(e, t, s, i = 0, r = 0, n = 0, a) {
1951
- const o = `${e}-${String(t + 1).padStart(2, "0")}-${String(s).padStart(2, "0")}`, c = `${String(i).padStart(2, "0")}:${String(r).padStart(2, "0")}:${String(n).padStart(2, "0")}`, l = /* @__PURE__ */ new Date(`${o}T${c}`), d = w.getTimezoneOffset(l, a), h = l.getTime() + d * 6e4;
1952
- return new Date(h);
1951
+ const o = `${e}-${String(t + 1).padStart(2, "0")}-${String(s).padStart(2, "0")}`, c = `${String(i).padStart(2, "0")}:${String(r).padStart(2, "0")}:${String(n).padStart(2, "0")}`, l = /* @__PURE__ */ new Date(`${o}T${c}`), h = y.getTimezoneOffset(l, a), d = l.getTime() + h * 6e4;
1952
+ return new Date(d);
1953
1953
  }
1954
1954
  };
1955
1955
  class Z {
@@ -2219,35 +2219,35 @@ class q {
2219
2219
  static expandEvent(e, t, s, i = 365, r = null) {
2220
2220
  if (!e.recurring || !e.recurrenceRule)
2221
2221
  return [{ start: e.start, end: e.end, timezone: e.timeZone }];
2222
- const n = this.parseRule(e.recurrenceRule), a = [], o = e.end - e.start, c = r || e.timeZone || "UTC", l = S.getInstance();
2223
- let d = new Date(e.start), h = 0;
2222
+ const n = this.parseRule(e.recurrenceRule), a = [], o = e.end - e.start, c = r || e.timeZone || "UTC", l = C.getInstance();
2223
+ let h = new Date(e.start), d = 0;
2224
2224
  n.until && n.until < s && (s = n.until);
2225
- let m = l.getTimezoneOffset(d, c), b = 0;
2226
- const x = 3;
2227
- for (; d <= s && h < i; ) {
2228
- if (d >= t) {
2229
- const k = new Date(d), M = new Date(d.getTime() + o), $ = l.getTimezoneOffset(k, c);
2230
- if ($ !== m) {
2231
- const I = m - $;
2232
- k.setMinutes(k.getMinutes() + I), M.setMinutes(M.getMinutes() + I);
2225
+ let p = l.getTimezoneOffset(h, c), b = 0;
2226
+ const v = 3;
2227
+ for (; h <= s && d < i; ) {
2228
+ if (h >= t) {
2229
+ const D = new Date(h), T = new Date(h.getTime() + o), A = l.getTimezoneOffset(D, c);
2230
+ if (A !== p) {
2231
+ const I = p - A;
2232
+ D.setMinutes(D.getMinutes() + I), T.setMinutes(T.getMinutes() + I);
2233
2233
  }
2234
- m = $, this.isException(k, n, e.id) || a.push({
2235
- start: k,
2236
- end: M,
2234
+ p = A, this.isException(D, n, e.id) || a.push({
2235
+ start: D,
2236
+ end: T,
2237
2237
  recurringEventId: e.id,
2238
2238
  timezone: c,
2239
2239
  originalStart: e.start
2240
2240
  });
2241
2241
  }
2242
- const A = d.getTime();
2243
- if (d = this.getNextOccurrence(d, n, c), h++, d.getTime() === A) {
2244
- if (b++, b >= x) {
2242
+ const M = h.getTime();
2243
+ if (h = this.getNextOccurrence(h, n, c), d++, h.getTime() === M) {
2244
+ if (b++, b >= v) {
2245
2245
  console.warn("RecurrenceEngine: Date not advancing, breaking to prevent infinite loop");
2246
2246
  break;
2247
2247
  }
2248
2248
  } else
2249
2249
  b = 0;
2250
- if (n.count && h >= n.count)
2250
+ if (n.count && d >= n.count)
2251
2251
  break;
2252
2252
  }
2253
2253
  return a;
@@ -2446,7 +2446,7 @@ class q {
2446
2446
  return r && (n = `${r === -1 ? "Last" : ["", "1st", "2nd", "3rd", "4th", "5th"][r] || `${r}th`} ${n}`), n;
2447
2447
  }
2448
2448
  }
2449
- class L {
2449
+ class _ {
2450
2450
  /**
2451
2451
  * Create a new LRU Cache
2452
2452
  * @param {number} capacity - Maximum number of items in cache
@@ -2766,7 +2766,7 @@ class G {
2766
2766
  enableAdaptiveMemory: !0,
2767
2767
  // Enable adaptive memory management
2768
2768
  ...e
2769
- }, this.eventCache = new L(this.config.cacheCapacity), this.queryCache = new L(Math.floor(this.config.cacheCapacity / 2)), this.dateRangeCache = new L(Math.floor(this.config.cacheCapacity / 4)), this.config.enableAdaptiveMemory && (this.memoryManager = new K({
2769
+ }, this.eventCache = new _(this.config.cacheCapacity), this.queryCache = new _(Math.floor(this.config.cacheCapacity / 2)), this.dateRangeCache = new _(Math.floor(this.config.cacheCapacity / 4)), this.config.enableAdaptiveMemory && (this.memoryManager = new K({
2770
2770
  checkInterval: 3e4,
2771
2771
  memoryThreshold: 0.75,
2772
2772
  criticalThreshold: 0.9
@@ -3085,8 +3085,8 @@ class Q {
3085
3085
  throw new Error("Event must have start and end dates");
3086
3086
  const i = [], r = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), a = new Date(e.start.getTime() - s.bufferMinutes * 6e4), o = new Date(e.end.getTime() + s.bufferMinutes * 6e4), c = this.eventStore.getEventsInRange(a, o, !1).filter((l) => !(l.id === e.id || s.excludeEventIds.includes(l.id) || !s.includeStatuses.includes(l.status) || s.ignoreAllDay && (l.allDay || e.allDay) || l.status === "cancelled"));
3087
3087
  for (const l of c) {
3088
- const d = this._detectEventConflicts(e, l, s);
3089
- d.length > 0 && (i.push(...d), r.add(e.id), r.add(l.id), e.attendees && e.attendees.forEach((h) => n.add(h.email)), l.attendees && l.attendees.forEach((h) => n.add(h.email)));
3088
+ const h = this._detectEventConflicts(e, l, s);
3089
+ h.length > 0 && (i.push(...h), r.add(e.id), r.add(l.id), e.attendees && e.attendees.forEach((d) => n.add(d.email)), l.attendees && l.attendees.forEach((d) => n.add(d.email)));
3090
3090
  }
3091
3091
  return this._buildConflictSummary(i, r, n);
3092
3092
  }
@@ -3356,7 +3356,7 @@ class J {
3356
3356
  byCategory: /* @__PURE__ */ new Map(),
3357
3357
  /** @type {Map<string, Set<string>>} Status -> Set of event IDs */
3358
3358
  byStatus: /* @__PURE__ */ new Map()
3359
- }, this.timezoneManager = S.getInstance(), this.defaultTimezone = e.timezone || this.timezoneManager.getSystemTimezone(), this.optimizer = new G(e.performance), this.conflictDetector = new Q(this), this.isBatchMode = !1, this.batchNotifications = [], this.batchBackup = null, this.version = 0, this.listeners = /* @__PURE__ */ new Set();
3359
+ }, this.timezoneManager = C.getInstance(), this.defaultTimezone = e.timezone || this.timezoneManager.getSystemTimezone(), this.optimizer = new G(e.performance), this.conflictDetector = new Q(this), this.isBatchMode = !1, this.batchNotifications = [], this.batchBackup = null, this.version = 0, this.listeners = /* @__PURE__ */ new Set();
3360
3360
  }
3361
3361
  /**
3362
3362
  * Add an event to the store
@@ -3366,7 +3366,7 @@ class J {
3366
3366
  */
3367
3367
  addEvent(e) {
3368
3368
  return this.optimizer.measure("addEvent", () => {
3369
- if (e instanceof D || (e = new D(e)), this.events.has(e.id))
3369
+ if (e instanceof w || (e = new w(e)), this.events.has(e.id))
3370
3370
  throw new Error(`Event with id ${e.id} already exists`);
3371
3371
  return this.events.set(e.id, e), this.optimizer.cache(e.id, e, "event"), this._indexEvent(e), this.isBatchMode ? this.batchNotifications.push({
3372
3372
  type: "add",
@@ -3481,10 +3481,10 @@ class J {
3481
3481
  t = t || this.defaultTimezone, f.getLocalDateString(e);
3482
3482
  const s = /* @__PURE__ */ new Set(), i = new Date(e);
3483
3483
  for (let l = -1; l <= 1; l++) {
3484
- const d = new Date(i);
3485
- d.setDate(d.getDate() + l);
3486
- const h = f.getLocalDateString(d), m = this.indices.byDate.get(h);
3487
- m && m.forEach((b) => s.add(b));
3484
+ const h = new Date(i);
3485
+ h.setDate(h.getDate() + l);
3486
+ const d = f.getLocalDateString(h), p = this.indices.byDate.get(d);
3487
+ p && p.forEach((b) => s.add(b));
3488
3488
  }
3489
3489
  const r = `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}`, n = this.indices.byMonth.get(r);
3490
3490
  n && n.forEach((l) => s.add(l));
@@ -3493,15 +3493,15 @@ class J {
3493
3493
  const c = new Date(e);
3494
3494
  c.setHours(23, 59, 59, 999);
3495
3495
  for (const l of s) {
3496
- const d = this.events.get(l);
3497
- if (d) {
3498
- const h = d.getStartInTimezone(t), m = d.getEndInTimezone(t);
3499
- h <= c && m >= o && a.push(d);
3496
+ const h = this.events.get(l);
3497
+ if (h) {
3498
+ const d = h.getStartInTimezone(t), p = h.getEndInTimezone(t);
3499
+ d <= c && p >= o && a.push(h);
3500
3500
  }
3501
3501
  }
3502
- return a.sort((l, d) => {
3503
- const h = l.getStartInTimezone(t), m = d.getStartInTimezone(t), b = h - m;
3504
- return b !== 0 ? b : d.duration - l.duration;
3502
+ return a.sort((l, h) => {
3503
+ const d = l.getStartInTimezone(t), p = h.getStartInTimezone(t), b = d - p;
3504
+ return b !== 0 ? b : h.duration - l.duration;
3505
3505
  });
3506
3506
  }
3507
3507
  /**
@@ -3515,11 +3515,11 @@ class J {
3515
3515
  const i = [], r = f.startOfDay(e), n = f.endOfDay(t), a = f.getDateRange(r, n), o = /* @__PURE__ */ new Set();
3516
3516
  return a.forEach((c) => {
3517
3517
  const l = f.getLocalDateString(c);
3518
- (this.indices.byDate.get(l) || /* @__PURE__ */ new Set()).forEach((h) => {
3519
- if (!o.has(h) && h !== s) {
3520
- o.add(h);
3521
- const m = this.events.get(h);
3522
- m && m.overlaps({ start: e, end: t }) && i.push(m);
3518
+ (this.indices.byDate.get(l) || /* @__PURE__ */ new Set()).forEach((d) => {
3519
+ if (!o.has(d) && d !== s) {
3520
+ o.add(d);
3521
+ const p = this.events.get(d);
3522
+ p && p.overlaps({ start: e, end: t }) && i.push(p);
3523
3523
  }
3524
3524
  });
3525
3525
  }), i.sort((c, l) => c.start - l.start);
@@ -3612,8 +3612,8 @@ class J {
3612
3612
  } else
3613
3613
  o.push(c);
3614
3614
  }), o.sort((c, l) => {
3615
- const d = c.getStartInTimezone(i), h = l.getStartInTimezone(i);
3616
- return d - h;
3615
+ const h = c.getStartInTimezone(i), d = l.getStartInTimezone(i);
3616
+ return h - d;
3617
3617
  });
3618
3618
  }
3619
3619
  /**
@@ -3712,9 +3712,9 @@ class J {
3712
3712
  c.setDate(c.getDate() - 7), f.getDateRange(
3713
3713
  c > i ? c : i,
3714
3714
  r
3715
- ).forEach((d) => {
3716
- const h = f.getLocalDateString(d);
3717
- this.indices.byDate.has(h) || this.indices.byDate.set(h, /* @__PURE__ */ new Set()), this.indices.byDate.get(h).add(e.id);
3715
+ ).forEach((h) => {
3716
+ const d = f.getLocalDateString(h);
3717
+ this.indices.byDate.has(d) || this.indices.byDate.set(d, /* @__PURE__ */ new Set()), this.indices.byDate.get(d).add(e.id);
3718
3718
  });
3719
3719
  }
3720
3720
  const o = new Date(i.getFullYear(), i.getMonth(), 1);
@@ -4410,7 +4410,7 @@ class ee {
4410
4410
  * @param {import('../../types.js').CalendarConfig} [config={}] - Configuration options
4411
4411
  */
4412
4412
  constructor(e = {}) {
4413
- this.timezoneManager = S.getInstance(), this.config = {
4413
+ this.timezoneManager = C.getInstance(), this.config = {
4414
4414
  view: "month",
4415
4415
  date: /* @__PURE__ */ new Date(),
4416
4416
  weekStartsOn: 0,
@@ -4516,7 +4516,7 @@ class ee {
4516
4516
  * @returns {import('../events/Event.js').Event} The added event
4517
4517
  */
4518
4518
  addEvent(e) {
4519
- !(e instanceof D) && !e.timeZone && (e = { ...e, timeZone: this.config.timeZone });
4519
+ !(e instanceof w) && !e.timeZone && (e = { ...e, timeZone: this.config.timeZone });
4520
4520
  const t = this.eventStore.addEvent(e);
4521
4521
  return this._emit("eventAdd", { event: t }), t;
4522
4522
  }
@@ -4716,24 +4716,24 @@ class ee {
4716
4716
  _getMonthViewData(e) {
4717
4717
  const t = e.getFullYear(), s = e.getMonth(), i = this.state.get("weekStartsOn"), r = this.state.get("fixedWeekCount"), n = new Date(t, s, 1), a = new Date(t, s + 1, 0), o = f.startOfWeek(n, i), c = [];
4718
4718
  let l = new Date(o);
4719
- const d = r ? 6 : Math.ceil((a.getDate() + f.getDayOfWeek(n, i)) / 7);
4720
- for (let h = 0; h < d; h++) {
4721
- const m = {
4719
+ const h = r ? 6 : Math.ceil((a.getDate() + f.getDayOfWeek(n, i)) / 7);
4720
+ for (let d = 0; d < h; d++) {
4721
+ const p = {
4722
4722
  weekNumber: f.getWeekNumber(l),
4723
4723
  days: []
4724
4724
  };
4725
4725
  for (let b = 0; b < 7; b++) {
4726
- const x = new Date(l), A = x.getMonth() === s, k = f.isToday(x), M = x.getDay() === 0 || x.getDay() === 6;
4727
- m.days.push({
4728
- date: x,
4729
- dayOfMonth: x.getDate(),
4730
- isCurrentMonth: A,
4731
- isToday: k,
4732
- isWeekend: M,
4733
- events: this.getEventsForDate(x)
4726
+ const v = new Date(l), M = v.getMonth() === s, D = f.isToday(v), T = v.getDay() === 0 || v.getDay() === 6;
4727
+ p.days.push({
4728
+ date: v,
4729
+ dayOfMonth: v.getDate(),
4730
+ isCurrentMonth: M,
4731
+ isToday: D,
4732
+ isWeekend: T,
4733
+ events: this.getEventsForDate(v)
4734
4734
  }), l = f.addDays(l, 1);
4735
4735
  }
4736
- c.push(m);
4736
+ c.push(p);
4737
4737
  }
4738
4738
  return {
4739
4739
  type: "month",
@@ -5067,7 +5067,7 @@ class te {
5067
5067
  return e;
5068
5068
  }
5069
5069
  }
5070
- const p = new te();
5070
+ const m = new te();
5071
5071
  class se {
5072
5072
  constructor(e = {}) {
5073
5073
  this.calendar = new ee({
@@ -5147,51 +5147,51 @@ class se {
5147
5147
  (i) => e[i] !== t[i]
5148
5148
  );
5149
5149
  s.forEach((i) => {
5150
- p.emit(`state:${i}:changed`, {
5150
+ m.emit(`state:${i}:changed`, {
5151
5151
  oldValue: e[i],
5152
5152
  newValue: t[i],
5153
5153
  state: t
5154
5154
  });
5155
- }), s.length > 0 && p.emit("state:changed", { oldState: e, newState: t, changedKeys: s });
5155
+ }), s.length > 0 && m.emit("state:changed", { oldState: e, newState: t, changedKeys: s });
5156
5156
  }
5157
5157
  // Calendar operations
5158
5158
  setView(e) {
5159
- this.calendar.setView(e), this.setState({ view: e }), p.emit("view:changed", { view: e });
5159
+ this.calendar.setView(e), this.setState({ view: e }), m.emit("view:changed", { view: e });
5160
5160
  }
5161
5161
  getView() {
5162
5162
  return this.state.view;
5163
5163
  }
5164
5164
  setDate(e) {
5165
- this.calendar.goToDate(e), this.setState({ currentDate: this.calendar.getCurrentDate() }), p.emit("date:changed", { date: this.state.currentDate });
5165
+ this.calendar.goToDate(e), this.setState({ currentDate: this.calendar.getCurrentDate() }), m.emit("date:changed", { date: this.state.currentDate });
5166
5166
  }
5167
5167
  getCurrentDate() {
5168
5168
  return this.state.currentDate;
5169
5169
  }
5170
5170
  // Navigation
5171
5171
  next() {
5172
- this.calendar.next(), this.setState({ currentDate: this.calendar.getCurrentDate() }), p.emit("navigation:next", { date: this.state.currentDate });
5172
+ this.calendar.next(), this.setState({ currentDate: this.calendar.getCurrentDate() }), m.emit("navigation:next", { date: this.state.currentDate });
5173
5173
  }
5174
5174
  previous() {
5175
- this.calendar.previous(), this.setState({ currentDate: this.calendar.getCurrentDate() }), p.emit("navigation:previous", { date: this.state.currentDate });
5175
+ this.calendar.previous(), this.setState({ currentDate: this.calendar.getCurrentDate() }), m.emit("navigation:previous", { date: this.state.currentDate });
5176
5176
  }
5177
5177
  today() {
5178
- this.calendar.today(), this.setState({ currentDate: this.calendar.getCurrentDate() }), p.emit("navigation:today", { date: this.state.currentDate });
5178
+ this.calendar.today(), this.setState({ currentDate: this.calendar.getCurrentDate() }), m.emit("navigation:today", { date: this.state.currentDate });
5179
5179
  }
5180
5180
  goToDate(e) {
5181
- this.calendar.goToDate(e), this.setState({ currentDate: this.calendar.getCurrentDate() }), p.emit("navigation:goto", { date: this.state.currentDate });
5181
+ this.calendar.goToDate(e), this.setState({ currentDate: this.calendar.getCurrentDate() }), m.emit("navigation:goto", { date: this.state.currentDate });
5182
5182
  }
5183
5183
  // Event management
5184
5184
  addEvent(e) {
5185
5185
  const t = this.calendar.addEvent(e);
5186
- return t ? (this._syncEventsFromCore(), p.emit("event:added", { event: t }), t) : (console.error("Failed to add event to calendar"), p.emit("event:error", { action: "add", event: e, error: "Failed to add event" }), null);
5186
+ return t ? (this._syncEventsFromCore(), m.emit("event:added", { event: t }), t) : (console.error("Failed to add event to calendar"), m.emit("event:error", { action: "add", event: e, error: "Failed to add event" }), null);
5187
5187
  }
5188
5188
  updateEvent(e, t) {
5189
5189
  this._syncEventsFromCore({ silent: !0 });
5190
5190
  const s = this.calendar.updateEvent(e, t);
5191
- return s ? (this._syncEventsFromCore(), p.emit("event:updated", { event: s }), s) : (console.error(`Failed to update event: ${e}`), p.emit("event:error", { action: "update", eventId: e, updates: t, error: "Event not found in calendar" }), null);
5191
+ return s ? (this._syncEventsFromCore(), m.emit("event:updated", { event: s }), s) : (console.error(`Failed to update event: ${e}`), m.emit("event:error", { action: "update", eventId: e, updates: t, error: "Event not found in calendar" }), null);
5192
5192
  }
5193
5193
  deleteEvent(e) {
5194
- return this._syncEventsFromCore({ silent: !0 }), this.calendar.removeEvent(e) ? (this._syncEventsFromCore(), p.emit("event:deleted", { eventId: e }), !0) : (console.error(`Failed to delete event: ${e}`), p.emit("event:error", { action: "delete", eventId: e, error: "Event not found" }), !1);
5194
+ return this._syncEventsFromCore({ silent: !0 }), this.calendar.removeEvent(e) ? (this._syncEventsFromCore(), m.emit("event:deleted", { eventId: e }), !0) : (console.error(`Failed to delete event: ${e}`), m.emit("event:error", { action: "delete", eventId: e, error: "Event not found" }), !1);
5195
5195
  }
5196
5196
  getEvents() {
5197
5197
  return this.calendar.getEvents() || [];
@@ -5242,20 +5242,20 @@ class se {
5242
5242
  }
5243
5243
  // Selection management
5244
5244
  selectEvent(e) {
5245
- this.setState({ selectedEvent: e }), p.emit("event:selected", { event: e });
5245
+ this.setState({ selectedEvent: e }), m.emit("event:selected", { event: e });
5246
5246
  }
5247
5247
  selectEventById(e) {
5248
5248
  const t = this.state.events.find((s) => s.id === e);
5249
5249
  t && this.selectEvent(t);
5250
5250
  }
5251
5251
  deselectEvent() {
5252
- this.setState({ selectedEvent: null }), p.emit("event:deselected", {});
5252
+ this.setState({ selectedEvent: null }), m.emit("event:deselected", {});
5253
5253
  }
5254
5254
  selectDate(e) {
5255
- this.setState({ selectedDate: e }), p.emit("date:selected", { date: e });
5255
+ this.setState({ selectedDate: e }), m.emit("date:selected", { date: e });
5256
5256
  }
5257
5257
  deselectDate() {
5258
- this.setState({ selectedDate: null }), p.emit("date:deselected", {});
5258
+ this.setState({ selectedDate: null }), m.emit("date:deselected", {});
5259
5259
  }
5260
5260
  // Utility methods
5261
5261
  isToday(e) {
@@ -5275,7 +5275,7 @@ class se {
5275
5275
  }
5276
5276
  // Error handling
5277
5277
  setError(e) {
5278
- this.setState({ error: e }), e && p.emit("error", { error: e });
5278
+ this.setState({ error: e }), e && m.emit("error", { error: e });
5279
5279
  }
5280
5280
  clearError() {
5281
5281
  this.setState({ error: null });
@@ -5289,7 +5289,7 @@ class se {
5289
5289
  this.subscribers.clear(), this._subscriberIds && (this._subscriberIds.clear(), this._subscriberIds = null), this.state = null, this.calendar = null;
5290
5290
  }
5291
5291
  }
5292
- class v extends f {
5292
+ class S extends f {
5293
5293
  /**
5294
5294
  * Format date for display
5295
5295
  */
@@ -5351,8 +5351,8 @@ class v extends f {
5351
5351
  * Get relative time string (e.g., "2 hours ago", "in 3 days")
5352
5352
  */
5353
5353
  static getRelativeTime(e, t = /* @__PURE__ */ new Date(), s = "en-US") {
5354
- const i = new Intl.RelativeTimeFormat(s, { numeric: "auto" }), r = e - t, n = Math.floor(r / 1e3), a = Math.floor(n / 60), o = Math.floor(a / 60), c = Math.floor(o / 24), l = Math.floor(c / 7), d = Math.floor(c / 30), h = Math.floor(c / 365);
5355
- return Math.abs(n) < 60 ? i.format(n, "second") : Math.abs(a) < 60 ? i.format(a, "minute") : Math.abs(o) < 24 ? i.format(o, "hour") : Math.abs(c) < 7 ? i.format(c, "day") : Math.abs(l) < 4 ? i.format(l, "week") : Math.abs(d) < 12 ? i.format(d, "month") : i.format(h, "year");
5354
+ const i = new Intl.RelativeTimeFormat(s, { numeric: "auto" }), r = e - t, n = Math.floor(r / 1e3), a = Math.floor(n / 60), o = Math.floor(a / 60), c = Math.floor(o / 24), l = Math.floor(c / 7), h = Math.floor(c / 30), d = Math.floor(c / 365);
5355
+ return Math.abs(n) < 60 ? i.format(n, "second") : Math.abs(a) < 60 ? i.format(a, "minute") : Math.abs(o) < 24 ? i.format(o, "hour") : Math.abs(c) < 7 ? i.format(c, "day") : Math.abs(l) < 4 ? i.format(l, "week") : Math.abs(h) < 12 ? i.format(h, "month") : i.format(d, "year");
5356
5356
  }
5357
5357
  /**
5358
5358
  * Check if date is today
@@ -5403,7 +5403,7 @@ class v extends f {
5403
5403
  return r && (r.toLowerCase() === "pm" && n < 12 ? o = n + 12 : r.toLowerCase() === "am" && n === 12 && (o = 0)), s.setHours(o, a || 0, 0, 0), s;
5404
5404
  }
5405
5405
  }
5406
- class T {
5406
+ class L {
5407
5407
  /**
5408
5408
  * Create element with attributes and children
5409
5409
  */
@@ -5598,7 +5598,7 @@ class T {
5598
5598
  return e.addEventListener("keydown", r), s == null || s.focus(), () => e.removeEventListener("keydown", r);
5599
5599
  }
5600
5600
  }
5601
- class y {
5601
+ class x {
5602
5602
  /**
5603
5603
  * Get CSS variable value
5604
5604
  */
@@ -5935,7 +5935,7 @@ class y {
5935
5935
  /**
5936
5936
  * Default theme colors
5937
5937
  */
5938
- z(y, "colors", {
5938
+ $(x, "colors", {
5939
5939
  primary: "#3B82F6",
5940
5940
  // Modern Blue
5941
5941
  secondary: "#64748B",
@@ -5968,7 +5968,7 @@ z(y, "colors", {
5968
5968
  }), /**
5969
5969
  * Common CSS variables
5970
5970
  */
5971
- z(y, "cssVariables", {
5971
+ $(x, "cssVariables", {
5972
5972
  // "Pro" Palette - Functional & Sharp
5973
5973
  "--fc-primary-color": "#2563EB",
5974
5974
  // International Blue (Focus)
@@ -6036,7 +6036,7 @@ z(y, "cssVariables", {
6036
6036
  }), /**
6037
6037
  * Get responsive breakpoints
6038
6038
  */
6039
- z(y, "breakpoints", {
6039
+ $(x, "breakpoints", {
6040
6040
  xs: "320px",
6041
6041
  sm: "576px",
6042
6042
  md: "768px",
@@ -6044,7 +6044,7 @@ z(y, "breakpoints", {
6044
6044
  xl: "1200px",
6045
6045
  "2xl": "1400px"
6046
6046
  });
6047
- class O {
6047
+ class H {
6048
6048
  /**
6049
6049
  * @param {HTMLElement} container - The DOM element to render into
6050
6050
  * @param {StateManager} stateManager - The state manager instance
@@ -6083,7 +6083,7 @@ class O {
6083
6083
  * @returns {string}
6084
6084
  */
6085
6085
  escapeHTML(e) {
6086
- return e == null ? "" : T.escapeHTML(String(e));
6086
+ return e == null ? "" : L.escapeHTML(String(e));
6087
6087
  }
6088
6088
  /**
6089
6089
  * Check if a date is today
@@ -6153,12 +6153,12 @@ class O {
6153
6153
  * @returns {string} HTML string
6154
6154
  */
6155
6155
  renderTimedEvent(e, t = {}) {
6156
- const { compact: s = !0 } = t, i = new Date(e.start), r = new Date(e.end), n = i.getHours() * 60 + i.getMinutes(), a = Math.max((r - i) / (1e3 * 60), s ? 20 : 30), o = e.backgroundColor || "#2563eb", c = s ? "4px 8px" : "8px 12px", l = s ? "11px" : "13px", d = s ? "2px" : "12px", h = s ? "2px" : "24px", m = s ? "4px" : "6px";
6156
+ const { compact: s = !0 } = t, i = new Date(e.start), r = new Date(e.end), n = i.getHours() * 60 + i.getMinutes(), a = Math.max((r - i) / (1e3 * 60), s ? 20 : 30), o = e.backgroundColor || "#2563eb", c = s ? "4px 8px" : "8px 12px", l = s ? "11px" : "13px", h = s ? "2px" : "12px", d = s ? "2px" : "24px", p = s ? "4px" : "6px";
6157
6157
  return `
6158
6158
  <div class="fc-event fc-timed-event" data-event-id="${this.escapeHTML(e.id)}"
6159
6159
  style="position: absolute; top: ${n}px; height: ${a}px;
6160
- left: ${d}; right: ${h};
6161
- background-color: ${o}; border-radius: ${m};
6160
+ left: ${h}; right: ${d};
6161
+ background-color: ${o}; border-radius: ${p};
6162
6162
  padding: ${c}; font-size: ${l};
6163
6163
  font-weight: 500; color: white; overflow: hidden;
6164
6164
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
@@ -6185,7 +6185,7 @@ class O {
6185
6185
  });
6186
6186
  }
6187
6187
  }
6188
- class E extends O {
6188
+ class E extends H {
6189
6189
  constructor(e, t) {
6190
6190
  super(e, t), this.maxEventsToShow = 3;
6191
6191
  }
@@ -6261,7 +6261,7 @@ class E extends O {
6261
6261
  }), this.attachCommonEventHandlers();
6262
6262
  }
6263
6263
  }
6264
- class H extends O {
6264
+ class z extends H {
6265
6265
  constructor(e, t) {
6266
6266
  super(e, t), this.hourHeight = 60, this.totalHeight = 24 * this.hourHeight;
6267
6267
  }
@@ -6383,7 +6383,7 @@ class H extends O {
6383
6383
  e && (e.scrollTop = 8 * this.hourHeight - 50, this._scrolled = !0);
6384
6384
  }
6385
6385
  }
6386
- class F extends O {
6386
+ class F extends H {
6387
6387
  constructor(e, t) {
6388
6388
  super(e, t), this.hourHeight = 60, this.totalHeight = 24 * this.hourHeight;
6389
6389
  }
@@ -6399,11 +6399,11 @@ class F extends O {
6399
6399
  this.container.innerHTML = s, this._attachEventHandlers(), this._scrollToCurrentTime();
6400
6400
  }
6401
6401
  _renderDayView(e, t) {
6402
- var d, h;
6403
- const s = ((h = (d = this.stateManager) == null ? void 0 : d.getState()) == null ? void 0 : h.currentDate) || /* @__PURE__ */ new Date(), i = this._extractDayData(e, s);
6402
+ var h, d;
6403
+ const s = ((d = (h = this.stateManager) == null ? void 0 : h.getState()) == null ? void 0 : d.currentDate) || /* @__PURE__ */ new Date(), i = this._extractDayData(e, s);
6404
6404
  if (!i)
6405
6405
  return '<div style="padding: 20px; text-align: center; color: #666;">No data available for day view.</div>';
6406
- const { dayDate: r, dayName: n, isToday: a, allDayEvents: o, timedEvents: c } = i, l = Array.from({ length: 24 }, (m, b) => b);
6406
+ const { dayDate: r, dayName: n, isToday: a, allDayEvents: o, timedEvents: c } = i, l = Array.from({ length: 24 }, (p, b) => b);
6407
6407
  return `
6408
6408
  <div class="fc-day-view" style="display: flex; flex-direction: column; height: 100%; background: #fff; overflow: hidden;">
6409
6409
  ${this._renderHeader(r, n, a)}
@@ -6419,17 +6419,17 @@ class F extends O {
6419
6419
  if (s = new Date(e.date), i = e.dayName || o[s.getDay()], r = e.isToday !== void 0 ? e.isToday : this.isToday(s), n = e.allDayEvents || [], e.hours && Array.isArray(e.hours)) {
6420
6420
  const c = /* @__PURE__ */ new Map();
6421
6421
  e.hours.forEach((l) => {
6422
- (l.events || []).forEach((d) => {
6423
- c.has(d.id) || c.set(d.id, d);
6422
+ (l.events || []).forEach((h) => {
6423
+ c.has(h.id) || c.set(h.id, h);
6424
6424
  });
6425
6425
  }), a = Array.from(c.values());
6426
6426
  } else
6427
6427
  a = [];
6428
6428
  else if (e.days && e.days.length > 0) {
6429
- const c = e.days.find((d) => this.isSameDay(new Date(d.date), t)) || e.days[0];
6429
+ const c = e.days.find((h) => this.isSameDay(new Date(h.date), t)) || e.days[0];
6430
6430
  s = new Date(c.date), i = o[s.getDay()], r = this.isToday(s);
6431
6431
  const l = c.events || [];
6432
- n = l.filter((d) => d.allDay), a = l.filter((d) => !d.allDay);
6432
+ n = l.filter((h) => h.allDay), a = l.filter((h) => !h.allDay);
6433
6433
  } else
6434
6434
  return null;
6435
6435
  return { dayDate: s, dayName: i, isToday: r, allDayEvents: n, timedEvents: a };
@@ -6516,1125 +6516,7 @@ class F extends O {
6516
6516
  e && (e.scrollTop = 8 * this.hourHeight - 50, this._scrolled = !0);
6517
6517
  }
6518
6518
  }
6519
- class ie extends _ {
6520
- constructor() {
6521
- super(), this._stateManager = null, this.viewData = null, this.config = {
6522
- maxEventsToShow: 3
6523
- }, this._registryCheckInterval = null;
6524
- }
6525
- connectedCallback() {
6526
- super.connectedCallback(), console.log("[MonthView] connectedCallback - starting registry polling"), this._startRegistryPolling();
6527
- }
6528
- disconnectedCallback() {
6529
- super.disconnectedCallback(), this._stopRegistryPolling();
6530
- }
6531
- _startRegistryPolling() {
6532
- this._checkRegistry();
6533
- let e = 0;
6534
- this._registryCheckInterval = setInterval(() => {
6535
- if (e++, this._stateManager || e > 50) {
6536
- this._stopRegistryPolling();
6537
- return;
6538
- }
6539
- this._checkRegistry();
6540
- }, 100);
6541
- }
6542
- _stopRegistryPolling() {
6543
- this._registryCheckInterval && (clearInterval(this._registryCheckInterval), this._registryCheckInterval = null);
6544
- }
6545
- _checkRegistry() {
6546
- const e = this.getAttribute("data-state-registry");
6547
- if (console.log("[MonthView] Checking registry for ID:", e), e && window.__forceCalendarRegistry && window.__forceCalendarRegistry[e]) {
6548
- const t = window.__forceCalendarRegistry[e];
6549
- console.log("[MonthView] Found stateManager in registry"), this._stopRegistryPolling(), this.setStateManager(t);
6550
- }
6551
- }
6552
- set stateManager(e) {
6553
- console.log("[MonthView] stateManager setter called with:", !!e), this.setStateManager(e);
6554
- }
6555
- // Method alternative for Salesforce Locker Service compatibility
6556
- setStateManager(e) {
6557
- if (console.log("[MonthView] setStateManager method called with:", !!e), this._stateManager === e) {
6558
- console.log("[MonthView] stateManager already set, skipping");
6559
- return;
6560
- }
6561
- this._stateManager = e, e && (console.log("[MonthView] Subscribing to state changes and loading view data"), this.unsubscribe = e.subscribe(this.handleStateUpdate.bind(this)), this.loadViewData());
6562
- }
6563
- get stateManager() {
6564
- return this._stateManager;
6565
- }
6566
- handleStateUpdate(e, t) {
6567
- if (e.currentDate !== t.currentDate) {
6568
- this.loadViewData();
6569
- return;
6570
- }
6571
- e.events !== t.events && this.updateEvents(), e.selectedDate !== t.selectedDate && this.updateSelection(e.selectedDate, t.selectedDate);
6572
- }
6573
- updateEvents() {
6574
- this.loadViewData();
6575
- }
6576
- updateSelection(e, t) {
6577
- if (t) {
6578
- const s = this.shadowRoot.querySelector(`[data-date^="${t.toISOString().split("T")[0]}"]`);
6579
- s && s.classList.remove("selected");
6580
- }
6581
- if (e) {
6582
- const s = this.shadowRoot.querySelector(`[data-date^="${e.toISOString().split("T")[0]}"]`);
6583
- s && s.classList.add("selected");
6584
- }
6585
- }
6586
- loadViewData() {
6587
- if (console.log("[MonthView] loadViewData called, stateManager:", !!this.stateManager), !this.stateManager) return;
6588
- const e = this.stateManager.getViewData();
6589
- console.log("[MonthView] viewData from stateManager:", e), this.viewData = this.processViewData(e), console.log("[MonthView] processed viewData:", this.viewData), this.render(), console.log("[MonthView] render completed");
6590
- }
6591
- processViewData(e) {
6592
- var i, r;
6593
- if (!e || !e.weeks) return null;
6594
- const t = (r = (i = this.stateManager) == null ? void 0 : i.getState()) == null ? void 0 : r.selectedDate, s = e.weeks.map((n) => n.days.map((a) => {
6595
- const o = new Date(a.date), c = t && o.toDateString() === t.toDateString(), l = a.events.map((d) => ({
6596
- ...d,
6597
- textColor: this.getContrastingTextColor(d.backgroundColor)
6598
- }));
6599
- return {
6600
- ...a,
6601
- date: o,
6602
- isOtherMonth: !a.isCurrentMonth,
6603
- isSelected: c,
6604
- events: l
6605
- };
6606
- }));
6607
- return {
6608
- ...e,
6609
- weeks: s,
6610
- month: e.month,
6611
- year: e.year
6612
- };
6613
- }
6614
- getContrastingTextColor(e) {
6615
- if (!e || typeof e != "string") return "white";
6616
- const t = e.charAt(0) === "#" ? e.substring(1) : e;
6617
- if (!/^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(t))
6618
- return "white";
6619
- const s = t.length === 3 ? t[0] + t[0] + t[1] + t[1] + t[2] + t[2] : t, i = parseInt(s.substring(0, 2), 16), r = parseInt(s.substring(2, 4), 16), n = parseInt(s.substring(4, 6), 16);
6620
- if (isNaN(i) || isNaN(r) || isNaN(n))
6621
- return "white";
6622
- const o = [i / 255, r / 255, n / 255].map((l) => l <= 0.03928 ? l / 12.92 : Math.pow((l + 0.055) / 1.055, 2.4));
6623
- return 0.2126 * o[0] + 0.7152 * o[1] + 0.0722 * o[2] > 0.179 ? "black" : "white";
6624
- }
6625
- isSelectedDate(e) {
6626
- var s, i;
6627
- const t = (i = (s = this.stateManager) == null ? void 0 : s.getState()) == null ? void 0 : i.selectedDate;
6628
- return t && e.toDateString() === t.toDateString();
6629
- }
6630
- getStyles() {
6631
- return `
6632
- :host {
6633
- display: block;
6634
- height: 100%;
6635
- }
6636
-
6637
- .month-view {
6638
- display: flex;
6639
- flex-direction: column;
6640
- height: 100%;
6641
- background: var(--fc-background);
6642
- }
6643
-
6644
- .month-header {
6645
- display: grid;
6646
- grid-template-columns: repeat(7, 1fr);
6647
- background: var(--fc-background);
6648
- border-bottom: 1px solid var(--fc-border-color);
6649
- z-index: 5;
6650
- }
6651
-
6652
- .month-header-cell {
6653
- padding: var(--fc-spacing-sm);
6654
- text-align: left; /* Align with dates */
6655
- font-weight: var(--fc-font-weight-bold);
6656
- font-size: 10px;
6657
- color: var(--fc-text-light);
6658
- text-transform: uppercase;
6659
- letter-spacing: 0.1em;
6660
- border-left: 1px solid transparent; /* Alignment hack */
6661
- padding-left: 8px;
6662
- }
6663
-
6664
- .month-body {
6665
- flex: 1;
6666
- display: flex;
6667
- flex-direction: column;
6668
- overflow: hidden;
6669
- }
6670
-
6671
- .month-week {
6672
- flex: 1;
6673
- display: grid;
6674
- grid-template-columns: repeat(7, 1fr);
6675
- border-bottom: 1px solid var(--fc-border-color);
6676
- }
6677
-
6678
- .month-week:last-child {
6679
- border-bottom: none;
6680
- }
6681
-
6682
- .month-day {
6683
- background: var(--fc-background);
6684
- padding: 4px;
6685
- position: relative;
6686
- cursor: default;
6687
- overflow: hidden;
6688
- min-height: 80px;
6689
- border-right: 1px solid var(--fc-border-color);
6690
- display: flex;
6691
- flex-direction: column;
6692
- min-width: 0; /* Critical for Grid Item shrinking */
6693
- }
6694
-
6695
- .month-day:last-child {
6696
- border-right: none;
6697
- }
6698
-
6699
- .month-day:hover {
6700
- background: var(--fc-background-alt);
6701
- }
6702
-
6703
- .month-day.other-month {
6704
- background: var(--fc-background-alt);
6705
- background-image: linear-gradient(45deg, #f9fafb 25%, transparent 25%, transparent 50%, #f9fafb 50%, #f9fafb 75%, transparent 75%, transparent);
6706
- background-size: 10px 10px;
6707
- }
6708
-
6709
- .month-day.other-month .day-number {
6710
- color: var(--fc-text-light);
6711
- opacity: 0.5;
6712
- }
6713
-
6714
- .month-day.selected {
6715
- background: var(--fc-background-hover);
6716
- }
6717
-
6718
- .day-header {
6719
- display: flex;
6720
- align-items: center;
6721
- justify-content: space-between;
6722
- padding: 4px;
6723
- margin-bottom: 2px;
6724
- }
6725
-
6726
- .day-number {
6727
- font-size: 12px;
6728
- font-family: var(--fc-font-family); /* Ensure monospaced feel if available */
6729
- font-weight: var(--fc-font-weight-medium);
6730
- color: var(--fc-text-color);
6731
- line-height: 1;
6732
- }
6733
-
6734
- .month-day.today .day-number {
6735
- color: white;
6736
- background: var(--fc-danger-color); /* Red for Today (Calendar standard) */
6737
- width: 20px;
6738
- height: 20px;
6739
- display: flex;
6740
- align-items: center;
6741
- justify-content: center;
6742
- border-radius: 50%;
6743
- margin-left: -4px; /* Optical adjustment */
6744
- }
6745
-
6746
- .day-events {
6747
- display: flex;
6748
- flex-direction: column;
6749
- gap: 2px;
6750
- flex: 1;
6751
- overflow: hidden;
6752
- }
6753
-
6754
- /* Precision Event Style */
6755
- .event-item {
6756
- font-size: 11px;
6757
- padding: 2px 6px;
6758
- border-radius: 2px; /* Micro rounding */
6759
-
6760
- /* High Contrast */
6761
- background: var(--fc-primary-color);
6762
- color: white;
6763
-
6764
- overflow: hidden;
6765
- text-overflow: ellipsis;
6766
- white-space: nowrap;
6767
- cursor: pointer;
6768
- line-height: 1.3;
6769
- font-weight: var(--fc-font-weight-medium);
6770
- margin: 0 1px;
6771
- border: 1px solid rgba(0,0,0,0.05); /* Subtle border for definition */
6772
- }
6773
-
6774
- .event-item:hover {
6775
- opacity: 0.9;
6776
- }
6777
-
6778
- .event-time {
6779
- font-weight: var(--fc-font-weight-bold);
6780
- margin-right: 4px;
6781
- opacity: 0.9;
6782
- font-size: 10px;
6783
- }
6784
-
6785
- .more-events {
6786
- font-size: 10px;
6787
- color: var(--fc-text-secondary);
6788
- cursor: pointer;
6789
- padding: 1px 4px;
6790
- font-weight: var(--fc-font-weight-medium);
6791
- text-align: right;
6792
- }
6793
-
6794
- .more-events:hover {
6795
- color: var(--fc-text-color);
6796
- text-decoration: underline;
6797
- }
6798
-
6799
- /* Responsive adjustments */
6800
- @media (max-width: 768px) {
6801
- .month-day {
6802
- min-height: 60px;
6803
- padding: 2px;
6804
- }
6805
-
6806
- .day-number {
6807
- font-size: 11px;
6808
- }
6809
-
6810
- .event-item {
6811
- font-size: 10px;
6812
- padding: 1px 3px;
6813
- }
6814
-
6815
- .month-header-cell {
6816
- font-size: 9px;
6817
- padding: 4px;
6818
- }
6819
- }
6820
-
6821
- /* Loading state */
6822
- .month-loading {
6823
- display: flex;
6824
- align-items: center;
6825
- justify-content: center;
6826
- height: 100%;
6827
- color: var(--fc-text-secondary);
6828
- font-weight: var(--fc-font-weight-medium);
6829
- }
6830
-
6831
- /* Empty state */
6832
- .month-empty {
6833
- display: flex;
6834
- flex-direction: column;
6835
- align-items: center;
6836
- justify-content: center;
6837
- height: 100%;
6838
- color: var(--fc-text-secondary);
6839
- gap: var(--fc-spacing-md);
6840
- }
6841
-
6842
- .empty-icon {
6843
- width: 48px;
6844
- height: 48px;
6845
- opacity: 0.3;
6846
- }
6847
- `;
6848
- }
6849
- template() {
6850
- return this.viewData ? `
6851
- <div class="month-view">
6852
- ${this.renderHeader()}
6853
- ${this.renderBody()}
6854
- </div>
6855
- ` : `
6856
- <div class="month-view">
6857
- <div class="month-loading">Loading calendar...</div>
6858
- </div>
6859
- `;
6860
- }
6861
- renderHeader() {
6862
- const { config: e } = this.stateManager.getState(), t = [], s = e.weekStartsOn || 0;
6863
- for (let i = 0; i < 7; i++) {
6864
- const r = (s + i) % 7, n = v.getDayAbbreviation(r, e.locale);
6865
- t.push(`<div class="month-header-cell">${n}</div>`);
6866
- }
6867
- return `
6868
- <div class="month-header">
6869
- ${t.join("")}
6870
- </div>
6871
- `;
6872
- }
6873
- renderBody() {
6874
- return !this.viewData.weeks || this.viewData.weeks.length === 0 ? `
6875
- <div class="month-body">
6876
- <div class="month-empty">
6877
- <svg class="empty-icon" viewBox="0 0 24 24">
6878
- <path fill="currentColor" d="M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11z"/>
6879
- </svg>
6880
- <p>No calendar data available</p>
6881
- </div>
6882
- </div>
6883
- ` : `
6884
- <div class="month-body">
6885
- ${this.viewData.weeks.map((t) => this.renderWeek(t)).join("")}
6886
- </div>
6887
- `;
6888
- }
6889
- renderWeek(e) {
6890
- return `
6891
- <div class="month-week">
6892
- ${e.map((s) => this.renderDay(s)).join("")}
6893
- </div>
6894
- `;
6895
- }
6896
- renderDay(e) {
6897
- const { date: t, dayOfMonth: s, isOtherMonth: i, isToday: r, isSelected: n, isWeekend: a, events: o = [] } = e, c = s, l = ["month-day"];
6898
- i && l.push("other-month"), r && l.push("today"), n && l.push("selected"), a && l.push("weekend");
6899
- const d = o.slice(0, this.config.maxEventsToShow), h = o.length - this.config.maxEventsToShow, m = d.map((x) => this.renderEvent(x)).join(""), b = h > 0 ? `<div class="more-events">+${h} more</div>` : "";
6900
- return `
6901
- <div class="${l.join(" ")}"
6902
- data-date="${t.toISOString()}"
6903
- data-day="${c}">
6904
- <div class="day-header">
6905
- <span class="day-number">${c}</span>
6906
- </div>
6907
- <div class="day-events">
6908
- ${m}
6909
- ${b}
6910
- </div>
6911
- </div>
6912
- `;
6913
- }
6914
- renderEvent(e) {
6915
- const { title: t, start: s, allDay: i, backgroundColor: r, textColor: n } = e;
6916
- let a = "";
6917
- if (r) {
6918
- const l = y.sanitizeColor(r), d = y.sanitizeColor(n, "white");
6919
- a += `background-color: ${l}; color: ${d};`;
6920
- }
6921
- let o = "";
6922
- !i && s && (o = v.formatTime(new Date(s), !1, !1));
6923
- const c = ["event-item"];
6924
- return i && c.push("all-day"), `
6925
- <div class="${c.join(" ")}"
6926
- style="${a}"
6927
- data-event-id="${e.id}"
6928
- title="${T.escapeHTML(t)}">
6929
- ${o ? `<span class="event-time">${o}</span>` : ""}
6930
- <span class="event-title">${T.escapeHTML(t)}</span>
6931
- </div>
6932
- `;
6933
- }
6934
- afterRender() {
6935
- this.$$(".month-day").forEach((e) => {
6936
- this.addListener(e, "click", this.handleDayClick);
6937
- }), this.$$(".event-item").forEach((e) => {
6938
- this.addListener(e, "click", this.handleEventClick);
6939
- }), this.$$(".more-events").forEach((e) => {
6940
- this.addListener(e, "click", this.handleMoreClick);
6941
- });
6942
- }
6943
- handleDayClick(e) {
6944
- e.stopPropagation();
6945
- const t = e.currentTarget, s = new Date(t.dataset.date);
6946
- this.stateManager.selectDate(s), this.emit("day-click", { date: s });
6947
- }
6948
- handleEventClick(e) {
6949
- e.stopPropagation();
6950
- const s = e.currentTarget.dataset.eventId, i = this.stateManager.getEvents().find((r) => r.id === s);
6951
- i && (this.stateManager.selectEvent(i), this.emit("event-click", { event: i }));
6952
- }
6953
- handleMoreClick(e) {
6954
- e.stopPropagation();
6955
- const t = e.currentTarget.closest(".month-day"), s = new Date(t.dataset.date), i = this.stateManager.getEventsForDate(s);
6956
- this.emit("more-events-click", { date: s, events: i });
6957
- }
6958
- unmount() {
6959
- this.unsubscribe && this.unsubscribe();
6960
- }
6961
- }
6962
- class re extends _ {
6963
- constructor() {
6964
- super(), this._stateManager = null, this.viewData = null, this.hours = Array.from({ length: 24 }, (e, t) => t), this._registryCheckInterval = null;
6965
- }
6966
- connectedCallback() {
6967
- super.connectedCallback(), this._startRegistryPolling();
6968
- }
6969
- disconnectedCallback() {
6970
- super.disconnectedCallback(), this._registryCheckInterval && clearInterval(this._registryCheckInterval);
6971
- }
6972
- _startRegistryPolling() {
6973
- this._checkRegistry();
6974
- let e = 0;
6975
- this._registryCheckInterval = setInterval(() => {
6976
- if (e++, this._stateManager || e > 50) {
6977
- clearInterval(this._registryCheckInterval);
6978
- return;
6979
- }
6980
- this._checkRegistry();
6981
- }, 100);
6982
- }
6983
- _checkRegistry() {
6984
- const e = this.getAttribute("data-state-registry");
6985
- e && window.__forceCalendarRegistry && window.__forceCalendarRegistry[e] && (clearInterval(this._registryCheckInterval), this.setStateManager(window.__forceCalendarRegistry[e]));
6986
- }
6987
- set stateManager(e) {
6988
- this.setStateManager(e);
6989
- }
6990
- setStateManager(e) {
6991
- this._stateManager !== e && (this._stateManager = e, e && (this.unsubscribe = e.subscribe(this.handleStateUpdate.bind(this)), this.loadViewData()));
6992
- }
6993
- get stateManager() {
6994
- return this._stateManager;
6995
- }
6996
- handleStateUpdate(e, t) {
6997
- if (e.currentDate !== (t == null ? void 0 : t.currentDate) || e.view !== (t == null ? void 0 : t.view)) {
6998
- this.loadViewData();
6999
- return;
7000
- }
7001
- e.events !== (t == null ? void 0 : t.events) && this.loadViewData(), e.selectedDate !== (t == null ? void 0 : t.selectedDate) && this.updateSelection(e.selectedDate, t == null ? void 0 : t.selectedDate);
7002
- }
7003
- updateSelection(e, t) {
7004
- if (t) {
7005
- const s = this.shadowRoot.querySelector(`[data-date^="${t.toISOString().split("T")[0]}"]`);
7006
- s && s.classList.remove("selected");
7007
- }
7008
- if (e) {
7009
- const s = this.shadowRoot.querySelector(`[data-date^="${e.toISOString().split("T")[0]}"]`);
7010
- s && s.classList.add("selected");
7011
- }
7012
- }
7013
- loadViewData() {
7014
- if (!this.stateManager) return;
7015
- const e = this.stateManager.getViewData();
7016
- this.viewData = this.processViewData(e), this.render();
7017
- }
7018
- processViewData(e) {
7019
- if (!e) return null;
7020
- let t = [];
7021
- return e.weeks && e.weeks.length > 0 ? t = e.weeks[0].days : e.days && (t = e.days), !t || t.length === 0 ? null : {
7022
- ...e,
7023
- days: t.map((s) => {
7024
- const i = new Date(s.date);
7025
- return {
7026
- ...s,
7027
- date: i,
7028
- isToday: v.isToday(i),
7029
- timedEvents: (s.events || []).filter((r) => !r.allDay),
7030
- allDayEvents: (s.events || []).filter((r) => r.allDay)
7031
- };
7032
- })
7033
- };
7034
- }
7035
- getStyles() {
7036
- return `
7037
- :host {
7038
- display: flex;
7039
- flex-direction: column;
7040
- height: 100%;
7041
- min-height: 0;
7042
- }
7043
-
7044
- .week-view {
7045
- display: flex;
7046
- flex-direction: column;
7047
- height: 100%;
7048
- background: var(--fc-background);
7049
- min-height: 0;
7050
- overflow: hidden;
7051
- }
7052
-
7053
- /* Header Section */
7054
- .week-header {
7055
- display: grid;
7056
- grid-template-columns: 60px repeat(7, 1fr);
7057
- border-bottom: 1px solid var(--fc-border-color);
7058
- background: var(--fc-background);
7059
- z-index: 20;
7060
- flex-shrink: 0;
7061
- }
7062
-
7063
- .day-column-header {
7064
- padding: 12px 8px;
7065
- text-align: center;
7066
- border-right: 1px solid var(--fc-border-color);
7067
- display: flex;
7068
- flex-direction: column;
7069
- align-items: center;
7070
- gap: 4px;
7071
- }
7072
-
7073
- .day-name {
7074
- font-size: 10px;
7075
- font-weight: 700;
7076
- color: var(--fc-text-light);
7077
- text-transform: uppercase;
7078
- letter-spacing: 0.1em;
7079
- }
7080
-
7081
- .day-number {
7082
- font-size: 16px;
7083
- font-weight: 500;
7084
- width: 28px;
7085
- height: 28px;
7086
- display: flex;
7087
- align-items: center;
7088
- justify-content: center;
7089
- border-radius: 50%;
7090
- color: var(--fc-text-color);
7091
- }
7092
-
7093
- .is-today .day-number {
7094
- background: var(--fc-danger-color);
7095
- color: white;
7096
- font-weight: 700;
7097
- }
7098
-
7099
- /* All Day Events Row */
7100
- .all-day-row {
7101
- display: grid;
7102
- grid-template-columns: 60px repeat(7, 1fr);
7103
- border-bottom: 1px solid var(--fc-border-color);
7104
- background: var(--fc-background-alt);
7105
- min-height: 32px;
7106
- flex-shrink: 0;
7107
- }
7108
-
7109
- .all-day-label {
7110
- font-size: 9px;
7111
- color: var(--fc-text-light);
7112
- display: flex;
7113
- align-items: center;
7114
- justify-content: center;
7115
- border-right: 1px solid var(--fc-border-color);
7116
- text-transform: uppercase;
7117
- font-weight: 700;
7118
- }
7119
-
7120
- .all-day-cell {
7121
- border-right: 1px solid var(--fc-border-color);
7122
- padding: 4px;
7123
- display: flex;
7124
- flex-direction: column;
7125
- gap: 2px;
7126
- }
7127
-
7128
- /* Body Section */
7129
- .week-body {
7130
- flex: 1;
7131
- overflow-y: auto;
7132
- overflow-x: hidden;
7133
- position: relative;
7134
- display: grid;
7135
- grid-template-columns: 60px repeat(7, 1fr);
7136
- background: var(--fc-background);
7137
- }
7138
-
7139
- .time-gutter {
7140
- border-right: 1px solid var(--fc-border-color);
7141
- background: var(--fc-background-alt);
7142
- height: 1440px;
7143
- }
7144
-
7145
- .time-slot-label {
7146
- height: 60px;
7147
- font-size: 10px;
7148
- color: var(--fc-text-light);
7149
- text-align: right;
7150
- padding-right: 8px;
7151
- font-weight: 500;
7152
- }
7153
-
7154
- .day-column {
7155
- border-right: 1px solid var(--fc-border-color);
7156
- position: relative;
7157
- height: 1440px;
7158
- }
7159
-
7160
- .day-column.selected {
7161
- background: var(--fc-background-hover);
7162
- }
7163
-
7164
- /* Grid Lines Layer */
7165
- .grid-lines {
7166
- position: absolute;
7167
- top: 0;
7168
- left: 60px;
7169
- right: 0;
7170
- bottom: 0;
7171
- pointer-events: none;
7172
- }
7173
-
7174
- .grid-line {
7175
- height: 60px;
7176
- border-bottom: 1px solid var(--fc-border-color);
7177
- width: 100%;
7178
- }
7179
-
7180
- .grid-line:last-child {
7181
- border-bottom: none;
7182
- }
7183
-
7184
- .event-container {
7185
- position: absolute;
7186
- left: 2px;
7187
- right: 2px;
7188
- border-radius: 4px;
7189
- padding: 4px 8px;
7190
- font-size: 11px;
7191
- font-weight: 500;
7192
- color: white;
7193
- background: var(--fc-primary-color);
7194
- border: 1px solid rgba(0,0,0,0.1);
7195
- overflow: hidden;
7196
- box-shadow: var(--fc-shadow-sm);
7197
- cursor: pointer;
7198
- transition: transform 0.1s;
7199
- z-index: 5;
7200
- }
7201
-
7202
- .event-container:hover {
7203
- z-index: 10;
7204
- transform: scale(1.02);
7205
- }
7206
-
7207
- .now-indicator {
7208
- position: absolute;
7209
- left: 0;
7210
- right: 0;
7211
- height: 2px;
7212
- background: var(--fc-danger-color);
7213
- z-index: 15;
7214
- pointer-events: none;
7215
- }
7216
- `;
7217
- }
7218
- template() {
7219
- return this.viewData ? `
7220
- <div class="week-view">
7221
- <div class="week-header">
7222
- <div class="time-gutter-header"></div>
7223
- ${this.viewData.days.map((e) => `
7224
- <div class="day-column-header ${e.isToday ? "is-today" : ""}">
7225
- <span class="day-name">${v.getDayAbbreviation(e.date.getDay())}</span>
7226
- <span class="day-number">${e.date.getDate()}</span>
7227
- </div>
7228
- `).join("")}
7229
- </div>
7230
-
7231
- <div class="all-day-row">
7232
- <div class="all-day-label">All day</div>
7233
- ${this.viewData.days.map((e) => `
7234
- <div class="all-day-cell">
7235
- ${e.allDayEvents.map((t) => this.renderAllDayEvent(t)).join("")}
7236
- </div>
7237
- `).join("")}
7238
- </div>
7239
-
7240
- <div class="week-body" id="scroll-container">
7241
- <div class="grid-lines">
7242
- ${this.hours.map(() => '<div class="grid-line"></div>').join("")}
7243
- </div>
7244
-
7245
- <div class="time-gutter">
7246
- ${this.hours.map((e) => `
7247
- <div class="time-slot-label">
7248
- ${e === 0 ? "" : v.formatTime((/* @__PURE__ */ new Date()).setHours(e, 0), !1)}
7249
- </div>
7250
- `).join("")}
7251
- </div>
7252
-
7253
- ${this.viewData.days.map((e) => `
7254
- <div class="day-column" data-date="${e.date.toISOString()}">
7255
- ${e.isToday ? this.renderNowIndicator() : ""}
7256
- ${e.timedEvents.map((t) => this.renderTimedEvent(t)).join("")}
7257
- </div>
7258
- `).join("")}
7259
- </div>
7260
- </div>
7261
- ` : '<div class="week-view">Loading...</div>';
7262
- }
7263
- renderTimedEvent(e) {
7264
- const t = new Date(e.start), s = new Date(e.end), i = t.getHours() * 60 + t.getMinutes(), r = (s - t) / (1e3 * 60), n = i, a = Math.max(r, 20), o = y.sanitizeColor(e.backgroundColor), c = y.sanitizeColor(y.getContrastColor(o), "white");
7265
- return `
7266
- <div class="event-container"
7267
- style="top: ${n}px; height: ${a}px; background-color: ${o}; color: ${c};"
7268
- data-event-id="${e.id}">
7269
- <span class="event-title">${T.escapeHTML(e.title)}</span>
7270
- <span class="event-time">${v.formatTime(t)}</span>
7271
- </div>
7272
- `;
7273
- }
7274
- renderAllDayEvent(e) {
7275
- const t = y.sanitizeColor(e.backgroundColor), s = y.sanitizeColor(y.getContrastColor(t), "white");
7276
- return `
7277
- <div class="event-item"
7278
- style="background-color: ${t}; color: ${s}; font-size: 10px; padding: 2px 4px; border-radius: 2px; cursor: pointer; margin-bottom: 2px;"
7279
- data-event-id="${e.id}">
7280
- ${T.escapeHTML(e.title)}
7281
- </div>
7282
- `;
7283
- }
7284
- renderNowIndicator() {
7285
- const e = /* @__PURE__ */ new Date();
7286
- return `<div class="now-indicator" style="top: ${e.getHours() * 60 + e.getMinutes()}px"></div>`;
7287
- }
7288
- afterRender() {
7289
- const e = this.$("#scroll-container");
7290
- e && !this._scrolled && (e.scrollTop = 8 * 60 - 50, this._scrolled = !0), this.$$("[data-event-id]").forEach((t) => {
7291
- this.addListener(t, "click", (s) => {
7292
- s.stopPropagation();
7293
- const i = s.currentTarget.dataset.eventId, r = this.stateManager.getEvents().find((n) => n.id === i);
7294
- r && this.emit("event-click", { event: r });
7295
- });
7296
- }), this.$$(".day-column").forEach((t) => {
7297
- this.addListener(t, "click", (s) => {
7298
- const i = s.currentTarget, r = this.$("#scroll-container"), n = i.getBoundingClientRect(), a = s.clientY - n.top + (r ? r.scrollTop : 0), o = new Date(i.dataset.date);
7299
- o.setHours(Math.floor(a / 60), Math.floor(a % 60), 0, 0), this.stateManager.selectDate(o), this.emit("day-click", { date: o });
7300
- });
7301
- });
7302
- }
7303
- unmount() {
7304
- this.unsubscribe && this.unsubscribe();
7305
- }
7306
- }
7307
- class ne extends _ {
7308
- constructor() {
7309
- super(), this._stateManager = null, this.viewData = null, this.hours = Array.from({ length: 24 }, (e, t) => t), this._registryCheckInterval = null;
7310
- }
7311
- connectedCallback() {
7312
- super.connectedCallback(), this._startRegistryPolling();
7313
- }
7314
- disconnectedCallback() {
7315
- super.disconnectedCallback(), this._registryCheckInterval && clearInterval(this._registryCheckInterval);
7316
- }
7317
- _startRegistryPolling() {
7318
- this._checkRegistry();
7319
- let e = 0;
7320
- this._registryCheckInterval = setInterval(() => {
7321
- if (e++, this._stateManager || e > 50) {
7322
- clearInterval(this._registryCheckInterval);
7323
- return;
7324
- }
7325
- this._checkRegistry();
7326
- }, 100);
7327
- }
7328
- _checkRegistry() {
7329
- const e = this.getAttribute("data-state-registry");
7330
- e && window.__forceCalendarRegistry && window.__forceCalendarRegistry[e] && (clearInterval(this._registryCheckInterval), this.setStateManager(window.__forceCalendarRegistry[e]));
7331
- }
7332
- set stateManager(e) {
7333
- this.setStateManager(e);
7334
- }
7335
- setStateManager(e) {
7336
- this._stateManager !== e && (this._stateManager = e, e && (this.unsubscribe = e.subscribe(this.handleStateUpdate.bind(this)), this.loadViewData()));
7337
- }
7338
- get stateManager() {
7339
- return this._stateManager;
7340
- }
7341
- handleStateUpdate(e, t) {
7342
- if (e.currentDate !== (t == null ? void 0 : t.currentDate) || e.view !== (t == null ? void 0 : t.view)) {
7343
- this.loadViewData();
7344
- return;
7345
- }
7346
- e.events !== (t == null ? void 0 : t.events) && this.loadViewData(), e.selectedDate !== (t == null ? void 0 : t.selectedDate) && this.updateSelection(e.selectedDate, t == null ? void 0 : t.selectedDate);
7347
- }
7348
- updateSelection(e, t) {
7349
- const s = this.shadowRoot.querySelector(".day-column");
7350
- if (!s) return;
7351
- ((r) => r && v.isSameDay(r, new Date(s.dataset.date)))(e) ? s.classList.add("selected") : s.classList.remove("selected");
7352
- }
7353
- loadViewData() {
7354
- if (!this.stateManager) return;
7355
- const e = this.stateManager.getViewData();
7356
- this.viewData = this.processViewData(e), this.render();
7357
- }
7358
- processViewData(e) {
7359
- var n;
7360
- if (!e) return null;
7361
- let t = null;
7362
- const s = (n = this.stateManager) == null ? void 0 : n.getState(), i = (s == null ? void 0 : s.currentDate) || /* @__PURE__ */ new Date();
7363
- if (e.days && Array.isArray(e.days) && e.days.length > 0)
7364
- t = e.days.find((a) => v.isSameDay(new Date(a.date), i)) || e.days[0];
7365
- else if (e.weeks && Array.isArray(e.weeks) && e.weeks.length > 0) {
7366
- const a = e.weeks.flatMap((o) => o.days || []);
7367
- t = a.find((o) => v.isSameDay(new Date(o.date), i)) || a[0];
7368
- } else e.date && (t = e);
7369
- if (!t) return null;
7370
- const r = new Date(t.date);
7371
- return {
7372
- ...e,
7373
- day: {
7374
- ...t,
7375
- date: r,
7376
- isToday: v.isToday(r),
7377
- timedEvents: (t.events || []).filter((a) => !a.allDay),
7378
- allDayEvents: (t.events || []).filter((a) => a.allDay)
7379
- }
7380
- };
7381
- }
7382
- getStyles() {
7383
- return `
7384
- :host {
7385
- display: flex;
7386
- flex-direction: column;
7387
- height: 100%;
7388
- min-height: 0;
7389
- }
7390
-
7391
- .day-view {
7392
- display: flex;
7393
- flex-direction: column;
7394
- height: 100%;
7395
- background: var(--fc-background);
7396
- min-height: 0;
7397
- overflow: hidden;
7398
- }
7399
-
7400
- /* Header */
7401
- .day-header {
7402
- display: grid;
7403
- grid-template-columns: 60px 1fr;
7404
- border-bottom: 1px solid var(--fc-border-color);
7405
- background: var(--fc-background);
7406
- z-index: 20;
7407
- flex-shrink: 0;
7408
- }
7409
-
7410
- .day-column-header {
7411
- padding: 16px 24px;
7412
- text-align: left;
7413
- display: flex;
7414
- flex-direction: column;
7415
- gap: 4px;
7416
- }
7417
-
7418
- .day-name {
7419
- font-size: 12px;
7420
- font-weight: 700;
7421
- color: var(--fc-text-light);
7422
- text-transform: uppercase;
7423
- letter-spacing: 0.1em;
7424
- }
7425
-
7426
- .day-number {
7427
- font-size: 24px;
7428
- font-weight: 600;
7429
- color: var(--fc-text-color);
7430
- }
7431
-
7432
- .is-today .day-number {
7433
- color: var(--fc-danger-color);
7434
- }
7435
-
7436
- /* All Day Events */
7437
- .all-day-row {
7438
- display: grid;
7439
- grid-template-columns: 60px 1fr;
7440
- border-bottom: 1px solid var(--fc-border-color);
7441
- background: var(--fc-background-alt);
7442
- min-height: 36px;
7443
- flex-shrink: 0;
7444
- }
7445
-
7446
- .all-day-label {
7447
- font-size: 9px;
7448
- color: var(--fc-text-light);
7449
- display: flex;
7450
- align-items: center;
7451
- justify-content: center;
7452
- border-right: 1px solid var(--fc-border-color);
7453
- text-transform: uppercase;
7454
- font-weight: 700;
7455
- }
7456
-
7457
- .all-day-cell {
7458
- padding: 6px 12px;
7459
- display: flex;
7460
- flex-wrap: wrap;
7461
- gap: 4px;
7462
- }
7463
-
7464
- /* Body */
7465
- .day-body {
7466
- flex: 1;
7467
- overflow-y: auto;
7468
- overflow-x: hidden;
7469
- position: relative;
7470
- display: grid;
7471
- grid-template-columns: 60px 1fr;
7472
- background: var(--fc-background);
7473
- }
7474
-
7475
- .time-gutter {
7476
- border-right: 1px solid var(--fc-border-color);
7477
- background: var(--fc-background-alt);
7478
- height: 1440px;
7479
- }
7480
-
7481
- .time-slot-label {
7482
- height: 60px;
7483
- font-size: 11px;
7484
- color: var(--fc-text-light);
7485
- text-align: right;
7486
- padding-right: 12px;
7487
- font-weight: 500;
7488
- }
7489
-
7490
- .day-column {
7491
- position: relative;
7492
- height: 1440px;
7493
- }
7494
-
7495
- .day-column.selected {
7496
- background: var(--fc-background-hover);
7497
- }
7498
-
7499
- /* Grid Lines */
7500
- .grid-lines {
7501
- position: absolute;
7502
- top: 0;
7503
- left: 60px;
7504
- right: 0;
7505
- bottom: 0;
7506
- pointer-events: none;
7507
- }
7508
-
7509
- .grid-line {
7510
- height: 60px;
7511
- border-bottom: 1px solid var(--fc-border-color);
7512
- width: 100%;
7513
- }
7514
-
7515
- /* Event Style */
7516
- .event-container {
7517
- position: absolute;
7518
- left: 12px;
7519
- right: 24px;
7520
- border-radius: 6px;
7521
- padding: 8px 12px;
7522
- font-size: 13px;
7523
- font-weight: 500;
7524
- color: white;
7525
- background: var(--fc-primary-color);
7526
- border: 1px solid rgba(0,0,0,0.1);
7527
- overflow: hidden;
7528
- box-shadow: var(--fc-shadow);
7529
- cursor: pointer;
7530
- transition: all 0.15s ease;
7531
- z-index: 5;
7532
- }
7533
-
7534
- .event-container:hover {
7535
- z-index: 10;
7536
- transform: translateX(4px);
7537
- }
7538
-
7539
- .now-indicator {
7540
- position: absolute;
7541
- left: 0;
7542
- right: 0;
7543
- height: 2px;
7544
- background: var(--fc-danger-color);
7545
- z-index: 15;
7546
- pointer-events: none;
7547
- }
7548
- `;
7549
- }
7550
- template() {
7551
- var i, r, n;
7552
- if (!this.viewData || !this.viewData.day)
7553
- return '<div class="day-view" style="padding: 20px; color: var(--fc-text-light);">No data available.</div>';
7554
- const { day: e } = this.viewData, t = ((n = (r = (i = this.stateManager) == null ? void 0 : i.state) == null ? void 0 : r.config) == null ? void 0 : n.locale) || "en-US", s = v.formatDate(e.date, "day", t).split(" ")[0];
7555
- return `
7556
- <div class="day-view">
7557
- <div class="day-header">
7558
- <div class="time-gutter-header"></div>
7559
- <div class="day-column-header ${e.isToday ? "is-today" : ""}">
7560
- <span class="day-name">${s}</span>
7561
- <span class="day-number">${e.date.getDate()}</span>
7562
- </div>
7563
- </div>
7564
-
7565
- <div class="all-day-row">
7566
- <div class="all-day-label">All day</div>
7567
- <div class="all-day-cell">
7568
- ${e.allDayEvents.map((a) => this.renderAllDayEvent(a)).join("")}
7569
- </div>
7570
- </div>
7571
-
7572
- <div class="day-body" id="scroll-container">
7573
- <div class="grid-lines">
7574
- ${this.hours.map(() => '<div class="grid-line"></div>').join("")}
7575
- </div>
7576
-
7577
- <div class="time-gutter">
7578
- ${this.hours.map((a) => `
7579
- <div class="time-slot-label">
7580
- ${a === 0 ? "" : v.formatTime((/* @__PURE__ */ new Date()).setHours(a, 0), !1)}
7581
- </div>
7582
- `).join("")}
7583
- </div>
7584
-
7585
- <div class="day-column" data-date="${e.date.toISOString()}">
7586
- ${e.isToday ? this.renderNowIndicator() : ""}
7587
- ${e.timedEvents.map((a) => this.renderTimedEvent(a)).join("")}
7588
- </div>
7589
- </div>
7590
- </div>
7591
- `;
7592
- }
7593
- renderTimedEvent(e) {
7594
- const t = new Date(e.start), s = new Date(e.end), i = t.getHours() * 60 + t.getMinutes(), r = (s - t) / (1e3 * 60), n = i, a = Math.max(r, 30), o = y.sanitizeColor(e.backgroundColor), c = y.sanitizeColor(y.getContrastColor(o), "white");
7595
- return `
7596
- <div class="event-container"
7597
- style="top: ${n}px; height: ${a}px; background-color: ${o}; color: ${c};"
7598
- data-event-id="${e.id}">
7599
- <span class="event-title">${T.escapeHTML(e.title)}</span>
7600
- <span class="event-time">${v.formatTime(t)} - ${v.formatTime(s)}</span>
7601
- </div>
7602
- `;
7603
- }
7604
- renderAllDayEvent(e) {
7605
- const t = y.sanitizeColor(e.backgroundColor), s = y.sanitizeColor(y.getContrastColor(t), "white");
7606
- return `
7607
- <div class="event-item"
7608
- style="background-color: ${t}; color: ${s}; font-size: 12px; padding: 4px 8px; border-radius: 4px; cursor: pointer; font-weight: 500; margin-bottom: 2px;"
7609
- data-event-id="${e.id}">
7610
- ${T.escapeHTML(e.title)}
7611
- </div>
7612
- `;
7613
- }
7614
- renderNowIndicator() {
7615
- const e = /* @__PURE__ */ new Date();
7616
- return `<div class="now-indicator" style="top: ${e.getHours() * 60 + e.getMinutes()}px"></div>`;
7617
- }
7618
- afterRender() {
7619
- const e = this.$("#scroll-container");
7620
- e && !this._scrolled && (e.scrollTop = 8 * 60 - 50, this._scrolled = !0), this.$$("[data-event-id]").forEach((s) => {
7621
- this.addListener(s, "click", (i) => {
7622
- i.stopPropagation();
7623
- const r = i.currentTarget.dataset.eventId, n = this.stateManager.getEvents().find((a) => a.id === r);
7624
- n && this.emit("event-click", { event: n });
7625
- });
7626
- });
7627
- const t = this.$(".day-column");
7628
- t && this.addListener(t, "click", (s) => {
7629
- const i = s.currentTarget, r = this.$("#scroll-container"), n = i.getBoundingClientRect(), a = s.clientY - n.top + (r ? r.scrollTop : 0), o = new Date(i.dataset.date);
7630
- o.setHours(Math.floor(a / 60), Math.floor(a % 60), 0, 0), this.stateManager.selectDate(o), this.emit("day-click", { date: o });
7631
- });
7632
- }
7633
- unmount() {
7634
- this.unsubscribe && this.unsubscribe();
7635
- }
7636
- }
7637
- class ae extends _ {
6519
+ class ie extends O {
7638
6520
  constructor() {
7639
6521
  super(), this._isVisible = !1, this._cleanupFocusTrap = null, this.config = {
7640
6522
  title: "New Event",
@@ -7664,8 +6546,8 @@ class ae extends _ {
7664
6546
  }
7665
6547
  getStyles() {
7666
6548
  return `
7667
- ${y.getBaseStyles()}
7668
- ${y.getButtonStyles()}
6549
+ ${x.getBaseStyles()}
6550
+ ${x.getButtonStyles()}
7669
6551
 
7670
6552
  :host {
7671
6553
  display: none;
@@ -7908,7 +6790,7 @@ class ae extends _ {
7908
6790
  });
7909
6791
  }
7910
6792
  open(e = /* @__PURE__ */ new Date()) {
7911
- this.hasAttribute("open") || this.setAttribute("open", ""), this.titleGroup.classList.remove("has-error"), this.endGroup.classList.remove("has-error"), this._formData.start = e, this._formData.end = new Date(e.getTime() + this.config.defaultDuration * 60 * 1e3), this._formData.title = "", this._formData.color = this.config.colors[0].color, this.startInput && (this.titleInput.value = "", this.startInput.value = this.formatDateForInput(this._formData.start), this.endInput.value = this.formatDateForInput(this._formData.end), this.updateColorSelection(), this._cleanupFocusTrap = T.trapFocus(this.modalContent));
6793
+ this.hasAttribute("open") || this.setAttribute("open", ""), this.titleGroup.classList.remove("has-error"), this.endGroup.classList.remove("has-error"), this._formData.start = e, this._formData.end = new Date(e.getTime() + this.config.defaultDuration * 60 * 1e3), this._formData.title = "", this._formData.color = this.config.colors[0].color, this.startInput && (this.titleInput.value = "", this.startInput.value = this.formatDateForInput(this._formData.start), this.endInput.value = this.formatDateForInput(this._formData.end), this.updateColorSelection(), this._cleanupFocusTrap = L.trapFocus(this.modalContent));
7912
6794
  }
7913
6795
  close() {
7914
6796
  this.removeAttribute("open"), this._cleanupFocusTrap && (this._cleanupFocusTrap(), this._cleanupFocusTrap = null);
@@ -7937,11 +6819,8 @@ class ae extends _ {
7937
6819
  this._cleanupFocusTrap && this._cleanupFocusTrap(), this._handleKeyDown && (window.removeEventListener("keydown", this._handleKeyDown), this._handleKeyDown = null, this._keydownListenerAdded = !1);
7938
6820
  }
7939
6821
  }
7940
- customElements.get("forcecal-event-form") || customElements.define("forcecal-event-form", ae);
7941
- customElements.get("forcecal-month") || customElements.define("forcecal-month", ie);
7942
- customElements.get("forcecal-week") || customElements.define("forcecal-week", re);
7943
- customElements.get("forcecal-day") || customElements.define("forcecal-day", ne);
7944
- class oe extends _ {
6822
+ customElements.get("forcecal-event-form") || customElements.define("forcecal-event-form", ie);
6823
+ class re extends O {
7945
6824
  static get observedAttributes() {
7946
6825
  return ["view", "date", "locale", "timezone", "week-starts-on", "height"];
7947
6826
  }
@@ -7959,13 +6838,13 @@ class oe extends _ {
7959
6838
  this.stateManager = new se(e), this.stateManager.subscribe(this.handleStateChange.bind(this)), this.setupEventListeners();
7960
6839
  }
7961
6840
  setupEventListeners() {
7962
- p.on("navigation:*", (e, t) => {
6841
+ m.on("navigation:*", (e, t) => {
7963
6842
  this.emit("calendar-navigate", { action: t.split(":")[1], ...e });
7964
- }), p.on("view:changed", (e) => {
6843
+ }), m.on("view:changed", (e) => {
7965
6844
  this.emit("calendar-view-change", e);
7966
- }), p.on("event:*", (e, t) => {
6845
+ }), m.on("event:*", (e, t) => {
7967
6846
  this.emit(`calendar-event-${t.split(":")[1]}`, e);
7968
- }), p.on("date:selected", (e) => {
6847
+ }), m.on("date:selected", (e) => {
7969
6848
  this.emit("calendar-date-select", e);
7970
6849
  });
7971
6850
  }
@@ -8010,7 +6889,7 @@ class oe extends _ {
8010
6889
  try {
8011
6890
  const s = {
8012
6891
  month: E,
8013
- week: H,
6892
+ week: z,
8014
6893
  day: F
8015
6894
  }[this.currentView] || E, i = new s(e, this.stateManager);
8016
6895
  i._viewType = this.currentView, this._currentViewInstance = i, i.render();
@@ -8034,10 +6913,10 @@ class oe extends _ {
8034
6913
  getStyles() {
8035
6914
  const e = this.getAttribute("height") || "800px";
8036
6915
  return `
8037
- ${y.getBaseStyles()}
8038
- ${y.getButtonStyles()}
8039
- ${y.getGridStyles()}
8040
- ${y.getAnimations()}
6916
+ ${x.getBaseStyles()}
6917
+ ${x.getButtonStyles()}
6918
+ ${x.getGridStyles()}
6919
+ ${x.getAnimations()}
8041
6920
 
8042
6921
  :host {
8043
6922
  --calendar-height: ${e};
@@ -8426,7 +7305,7 @@ class oe extends _ {
8426
7305
  return `
8427
7306
  <div class="force-calendar">
8428
7307
  <div class="fc-error">
8429
- <p><strong>Error:</strong> ${T.escapeHTML(r.message || "An error occurred")}</p>
7308
+ <p><strong>Error:</strong> ${L.escapeHTML(r.message || "An error occurred")}</p>
8430
7309
  </div>
8431
7310
  </div>
8432
7311
  `;
@@ -8494,7 +7373,7 @@ class oe extends _ {
8494
7373
  try {
8495
7374
  const r = {
8496
7375
  month: E,
8497
- week: H,
7376
+ week: z,
8498
7377
  day: F
8499
7378
  }[this.currentView] || E, n = new r(e, this.stateManager);
8500
7379
  n._viewType = this.currentView, this._currentViewInstance = n, n.render();
@@ -8529,7 +7408,7 @@ class oe extends _ {
8529
7408
  _createViewRenderer(e) {
8530
7409
  const s = {
8531
7410
  month: E,
8532
- week: H,
7411
+ week: z,
8533
7412
  day: F
8534
7413
  }[e] || E;
8535
7414
  return new s(null, null);
@@ -8555,14 +7434,14 @@ class oe extends _ {
8555
7434
  const s = this.stateManager.state.config.locale;
8556
7435
  switch (t) {
8557
7436
  case "month":
8558
- return v.formatDate(e, "month", s);
7437
+ return S.formatDate(e, "month", s);
8559
7438
  case "week":
8560
- const i = v.startOfWeek(e), r = v.endOfWeek(e);
8561
- return v.formatDateRange(i, r, s);
7439
+ const i = S.startOfWeek(e), r = S.endOfWeek(e);
7440
+ return S.formatDateRange(i, r, s);
8562
7441
  case "day":
8563
- return v.formatDate(e, "long", s);
7442
+ return S.formatDate(e, "long", s);
8564
7443
  default:
8565
- return v.formatDate(e, "month", s);
7444
+ return S.formatDate(e, "month", s);
8566
7445
  }
8567
7446
  }
8568
7447
  getIcon(e) {
@@ -8613,26 +7492,23 @@ class oe extends _ {
8613
7492
  this.stateManager.today();
8614
7493
  }
8615
7494
  destroy() {
8616
- this.stateManager && this.stateManager.destroy(), p.clear(), super.cleanup();
7495
+ this.stateManager && this.stateManager.destroy(), m.clear(), super.cleanup();
8617
7496
  }
8618
7497
  }
8619
- customElements.get("forcecal-main") || customElements.define("forcecal-main", oe);
7498
+ customElements.get("forcecal-main") || customElements.define("forcecal-main", re);
8620
7499
  typeof window < "u" && typeof customElements < "u" && console.log("Force Calendar Interface loading...");
8621
7500
  export {
8622
- _ as BaseComponent,
8623
- O as BaseViewRenderer,
8624
- T as DOMUtils,
8625
- v as DateUtils,
8626
- ne as DayView,
7501
+ O as BaseComponent,
7502
+ H as BaseViewRenderer,
7503
+ L as DOMUtils,
7504
+ S as DateUtils,
8627
7505
  F as DayViewRenderer,
8628
7506
  te as EventBus,
8629
- oe as ForceCalendar,
8630
- ie as MonthView,
7507
+ re as ForceCalendar,
8631
7508
  E as MonthViewRenderer,
8632
7509
  se as StateManager,
8633
- y as StyleUtils,
8634
- re as WeekView,
8635
- H as WeekViewRenderer,
8636
- p as eventBus
7510
+ x as StyleUtils,
7511
+ z as WeekViewRenderer,
7512
+ m as eventBus
8637
7513
  };
8638
7514
  //# sourceMappingURL=force-calendar-interface.esm.js.map