@forcecalendar/interface 1.0.51 → 1.0.52

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.
@@ -12,7 +12,7 @@
12
12
  ${this.getBaseStyles()}
13
13
  ${this.getStyles()}
14
14
  </style>
15
- `,e=this.template();this.shadowRoot.innerHTML=t+e,this.afterRender()}template(){return""}afterRender(){}$(t){return this.shadowRoot.querySelector(t)}$$(t){return this.shadowRoot.querySelectorAll(t)}static get observedAttributes(){return[]}attributeChangedCallback(t,e,r){this.setProp(t,r),this._initialized&&this.render()}}class ${constructor(){this.events=new Map,this.wildcardHandlers=new Set}on(t,e,r={}){const{once:i=!1,priority:n=0}=r;if(t.includes("*")){const o={pattern:t,handler:e,once:i,priority:n};return this.wildcardHandlers.add(o),()=>this.wildcardHandlers.delete(o)}this.events.has(t)||this.events.set(t,[]);const s={handler:e,once:i,priority:n},a=this.events.get(t);return a.push(s),a.sort((o,c)=>c.priority-o.priority),()=>{const o=a.indexOf(s);o>-1&&a.splice(o,1)}}once(t,e,r={}){return this.on(t,e,{...r,once:!0})}off(t,e){if(t.includes("*")){for(const n of this.wildcardHandlers)if(n.pattern===t&&n.handler===e){this.wildcardHandlers.delete(n);return}return}if(!this.events.has(t))return;const r=this.events.get(t),i=r.findIndex(n=>n.handler===e);i>-1&&r.splice(i,1),r.length===0&&this.events.delete(t)}offWildcard(t){for(const e of[...this.wildcardHandlers])e.pattern===t&&this.wildcardHandlers.delete(e)}offAll(t){for(const[e,r]of this.events){const i=r.findIndex(n=>n.handler===t);i>-1&&r.splice(i,1),r.length===0&&this.events.delete(e)}for(const e of[...this.wildcardHandlers])e.handler===t&&this.wildcardHandlers.delete(e)}emit(t,e){if(this.events.has(t)){const i=[...this.events.get(t)];for(const n of i){const{handler:s,once:a}=n;a&&this.off(t,s);try{s(e,t)}catch(o){console.error(`Error in event handler for ${t}:`,o)}}}const r=[];for(const i of[...this.wildcardHandlers])if(this.matchesPattern(t,i.pattern)){const{handler:n,once:s}=i;s&&r.push(i);try{n(e,t)}catch(a){console.error(`Error in wildcard handler for ${t}:`,a)}}r.forEach(i=>this.wildcardHandlers.delete(i))}matchesPattern(t,e){return new RegExp("^"+e.replace(/\*/g,".*")+"$").test(t)}clear(){this.events.clear(),this.wildcardHandlers.clear()}getEventNames(){return Array.from(this.events.keys())}getHandlerCount(t){return this.events.has(t)?this.events.get(t).length:0}getWildcardHandlerCount(){return this.wildcardHandlers.size}getTotalHandlerCount(){let t=this.wildcardHandlers.size;for(const e of this.events.values())t+=e.length;return t}}const V=new $;class S{constructor(t={}){this.eventBus=new $,this.calendar=new f.Calendar({view:t.view||"month",date:t.date||new Date,weekStartsOn:t.weekStartsOn??0,locale:t.locale||"en-US",timeZone:t.timeZone||Intl.DateTimeFormat().resolvedOptions().timeZone,...t}),this.state={view:this.calendar.getView(),currentDate:this.calendar.getCurrentDate(),events:[],selectedEvent:null,selectedDate:null,loading:!1,error:null,config:{...t}},this.subscribers=new Set,this.subscribe=this.subscribe.bind(this),this.unsubscribe=this.unsubscribe.bind(this),this.setState=this.setState.bind(this),this._syncEventsFromCore({silent:!0})}_syncEventsFromCore(t={}){const{force:e=!1}=t,r=this.calendar.getEvents()||[];return(e||this.state.events.length!==r.length||!this._eventsMatch(this.state.events,r))&&this.setState({events:[...r]},t),r}_eventsMatch(t,e){if(t.length!==e.length)return!1;const r=new Set(t.map(i=>i.id));return e.every(i=>r.has(i.id))}getState(){return{...this.state,config:{...this.state.config},events:[...this.state.events]}}setState(t,e={}){const{silent:r=!1}=e,i={...this.state};return this.state={...this.state,...t},r||(this.notifySubscribers(i,this.state),this.emitStateChange(i,this.state)),this.state}subscribe(t,e=null){return this.subscribers.add(t),e&&(this._subscriberIds||(this._subscriberIds=new Map),this._subscriberIds.set(e,t)),()=>this.unsubscribe(t,e)}unsubscribe(t,e=null){this.subscribers.delete(t),e&&this._subscriberIds&&this._subscriberIds.delete(e)}unsubscribeById(t){if(!this._subscriberIds)return!1;const e=this._subscriberIds.get(t);return e?(this.subscribers.delete(e),this._subscriberIds.delete(t),!0):!1}getSubscriberCount(){return this.subscribers.size}notifySubscribers(t,e){this.subscribers.forEach(r=>{try{r(e,t)}catch(i){console.error("Error in state subscriber:",i)}})}emitStateChange(t,e){const r=Object.keys(e).filter(i=>t[i]!==e[i]);r.forEach(i=>{this.eventBus.emit(`state:${i}:changed`,{oldValue:t[i],newValue:e[i],state:e})}),r.length>0&&this.eventBus.emit("state:changed",{oldState:t,newState:e,changedKeys:r})}setView(t){this.calendar.setView(t),this.setState({view:t}),this.eventBus.emit("view:changed",{view:t})}getView(){return this.state.view}setDate(t){this.calendar.goToDate(t),this.setState({currentDate:this.calendar.getCurrentDate()}),this.eventBus.emit("date:changed",{date:this.state.currentDate})}getCurrentDate(){return this.state.currentDate}next(){this.calendar.next(),this.setState({currentDate:this.calendar.getCurrentDate()}),this.eventBus.emit("navigation:next",{date:this.state.currentDate})}previous(){this.calendar.previous(),this.setState({currentDate:this.calendar.getCurrentDate()}),this.eventBus.emit("navigation:previous",{date:this.state.currentDate})}today(){this.calendar.today(),this.setState({currentDate:this.calendar.getCurrentDate()}),this.eventBus.emit("navigation:today",{date:this.state.currentDate})}goToDate(t){this.calendar.goToDate(t),this.setState({currentDate:this.calendar.getCurrentDate()}),this.eventBus.emit("navigation:goto",{date:this.state.currentDate})}addEvent(t){const e=this.calendar.addEvent(t);return e?(this._syncEventsFromCore(),this.eventBus.emit("event:add",{event:e}),this.eventBus.emit("event:added",{event:e}),e):(console.error("Failed to add event to calendar"),this.eventBus.emit("event:error",{action:"add",event:t,error:"Failed to add event"}),null)}updateEvent(t,e){this._syncEventsFromCore({silent:!0});const r=this.calendar.updateEvent(t,e);return r?(this._syncEventsFromCore({force:!0}),this.eventBus.emit("event:update",{event:r}),this.eventBus.emit("event:updated",{event:r}),r):(console.error(`Failed to update event: ${t}`),this.eventBus.emit("event:error",{action:"update",eventId:t,updates:e,error:"Event not found in calendar"}),null)}deleteEvent(t){return this._syncEventsFromCore({silent:!0}),this.calendar.removeEvent(t)?(this._syncEventsFromCore(),this.eventBus.emit("event:remove",{eventId:t}),this.eventBus.emit("event:deleted",{eventId:t}),!0):(console.error(`Failed to delete event: ${t}`),this.eventBus.emit("event:error",{action:"delete",eventId:t,error:"Event not found"}),!1)}getEvents(){return this.calendar.getEvents()||[]}syncEvents(){return this._syncEventsFromCore()}getEventsForDate(t){return this.calendar.getEventsForDate(t)}getEventsInRange(t,e){return this.calendar.getEventsInRange(t,e)}getViewData(){const t=this.calendar.getViewData();return this.enrichViewData(t)}enrichViewData(t){var i;const e={...t},r=(i=this.state.selectedDate)==null?void 0:i.toDateString();if(e.weeks&&(e.weeks=e.weeks.map(n=>({...n,days:n.days.map(s=>{const a=new Date(s.date);return{...s,isSelected:a.toDateString()===r,events:s.events||this.getEventsForDate(a)}})}))),e.days&&(e.days=e.days.map(n=>{const s=new Date(n.date);return{...n,isSelected:s.toDateString()===r,events:n.events||this.getEventsForDate(s)}})),e.date&&!e.days&&!e.weeks){const n=new Date(e.date);e.isSelected=n.toDateString()===r,e.events=e.events||this.getEventsForDate(n)}return e}selectEvent(t){this.setState({selectedEvent:t}),this.eventBus.emit("event:selected",{event:t})}selectEventById(t){const e=this.state.events.find(r=>r.id===t);e&&this.selectEvent(e)}deselectEvent(){this.setState({selectedEvent:null}),this.eventBus.emit("event:deselected",{})}selectDate(t){this.setState({selectedDate:t}),this.eventBus.emit("date:selected",{date:t})}deselectDate(){this.setState({selectedDate:null}),this.eventBus.emit("date:deselected",{})}isToday(t){const e=new Date;return t.toDateString()===e.toDateString()}isSelectedDate(t){return this.state.selectedDate&&t.toDateString()===this.state.selectedDate.toDateString()}isWeekend(t){const e=t.getDay();return e===0||e===6}setLoading(t){this.setState({loading:t})}setError(t){this.setState({error:t}),t&&this.eventBus.emit("error",{error:t})}clearError(){this.setState({error:null})}updateConfig(t){this.setState({config:{...this.state.config,...t}}),t.weekStartsOn!==void 0&&this.calendar.setWeekStartsOn(t.weekStartsOn),t.locale!==void 0&&this.calendar.setLocale(t.locale),t.timeZone!==void 0&&this.calendar.setTimezone(t.timeZone)}destroy(){this.subscribers.clear(),this._subscriberIds&&(this._subscriberIds.clear(),this._subscriberIds=null),this.eventBus&&(this.eventBus.clear(),this.eventBus=null),this.state=null,this.calendar=null}}class p extends f.DateUtils{static formatDate(t,e="default",r="en-US"){if(!t)return"";const i={default:{year:"numeric",month:"long",day:"numeric"},short:{year:"numeric",month:"short",day:"numeric"},long:{weekday:"long",year:"numeric",month:"long",day:"numeric"},month:{year:"numeric",month:"long"},monthShort:{year:"numeric",month:"short"},day:{weekday:"long",day:"numeric"},dayShort:{weekday:"short",day:"numeric"},time:{hour:"numeric",minute:"2-digit"},timeShort:{hour:"numeric"},datetime:{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}},n=i[e]||i.default;return new Intl.DateTimeFormat(r,n).format(t)}static formatTime(t,e=!0,r=!1,i="en-US"){if(!t)return"";const n={hour:"numeric",minute:e?"2-digit":void 0,hour12:!r};return new Intl.DateTimeFormat(i,n).format(t)}static formatDateRange(t,e,r="en-US"){if(!t)return"";if(!e||this.isSameDay(t,e))return this.formatDate(t,"default",r);const i=this.isSameYear(t,e)?"short":"default";return`${this.formatDate(t,i,r)} - ${this.formatDate(e,"default",r)}`}static formatTimeRange(t,e,r="en-US"){if(!t)return"";const i=this.formatTime(t,!0,!1,r);if(!e)return i;const n=this.formatTime(e,!0,!1,r);return`${i} - ${n}`}static getRelativeTime(t,e=new Date,r="en-US"){const i=new Intl.RelativeTimeFormat(r,{numeric:"auto"}),n=t-e,s=Math.floor(n/1e3),a=Math.floor(s/60),o=Math.floor(a/60),c=Math.floor(o/24),d=Math.floor(c/7),h=Math.floor(c/30),m=Math.floor(c/365);return Math.abs(s)<60?i.format(s,"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(d)<4?i.format(d,"week"):Math.abs(h)<12?i.format(h,"month"):i.format(m,"year")}static isToday(t){const e=new Date;return this.isSameDay(t,e)}static isPast(t){return t<new Date}static isFuture(t){return t>new Date}static getWeekNumber(t){const e=new Date(t.getFullYear(),0,1),r=(t-e)/864e5;return Math.ceil((r+e.getDay()+1)/7)}static getDayAbbreviation(t,e="en-US"){const r=new Date(2024,0,7+t);return new Intl.DateTimeFormat(e,{weekday:"short"}).format(r)}static getDayName(t,e="en-US"){const r=new Date(2024,0,7+t);return new Intl.DateTimeFormat(e,{weekday:"long"}).format(r)}static getMonthName(t,e="long",r="en-US"){const i=new Date(2024,t,1);return new Intl.DateTimeFormat(r,{month:e}).format(i)}static parseTimeString(t,e=new Date){const r=new Date(e),[i,n]=t.split(/\s+/),[s,a]=i.split(":").map(Number);let o=s;return n&&(n.toLowerCase()==="pm"&&s<12?o=s+12:n.toLowerCase()==="am"&&s===12&&(o=0)),r.setHours(o,a||0,0,0),r}}class w{static createElement(t,e={},r=[]){const i=document.createElement(t);return Object.entries(e).forEach(([n,s])=>{if(n==="className")i.className=s;else if(n==="style"&&typeof s=="object")Object.assign(i.style,s);else if(n.startsWith("data-"))i.setAttribute(n,s);else if(n.startsWith("on")&&typeof s=="function"){const a=n.slice(2).toLowerCase();i.addEventListener(a,s)}else i[n]=s}),r.forEach(n=>{typeof n=="string"?i.appendChild(document.createTextNode(n)):n instanceof Node&&i.appendChild(n)}),i}static addEventListeners(t,e){return Object.entries(e).forEach(([r,i])=>{t.addEventListener(r,i)}),()=>{Object.entries(e).forEach(([r,i])=>{t.removeEventListener(r,i)})}}static delegate(t,e,r,i){const n=s=>{const a=s.target.closest(e);a&&t.contains(a)&&i.call(a,s)};return t.addEventListener(r,n),()=>t.removeEventListener(r,n)}static getPosition(t){const e=t.getBoundingClientRect();return{top:e.top+window.scrollY,left:e.left+window.scrollX,bottom:e.bottom+window.scrollY,right:e.right+window.scrollX,width:e.width,height:e.height}}static isInViewport(t,e=0){const r=t.getBoundingClientRect();return r.top>=-e&&r.left>=-e&&r.bottom<=(window.innerHeight||document.documentElement.clientHeight)+e&&r.right<=(window.innerWidth||document.documentElement.clientWidth)+e}static scrollToElement(t,e={}){const{behavior:r="smooth",block:i="start",inline:n="nearest"}=e;t.scrollIntoView({behavior:r,block:i,inline:n})}static getStyle(t,e){return window.getComputedStyle(t).getPropertyValue(e)}static setStyles(t,e){Object.assign(t.style,e)}static async animateClass(t,e,r=300){t.classList.add(e),await this.wait(r),t.classList.remove(e)}static waitForAnimation(t,e="animationend"){return new Promise(r=>{const i=()=>{t.removeEventListener(e,i),r()};t.addEventListener(e,i)})}static wait(t){return new Promise(e=>setTimeout(e,t))}static parseHTML(t){const e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstChild}static escapeHTML(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}static debounce(t,e=250){let r;return function(...n){const s=()=>{clearTimeout(r),t(...n)};clearTimeout(r),r=setTimeout(s,e)}}static throttle(t,e=250){let r;return function(...i){r||(t.apply(this,i),r=!0,setTimeout(()=>r=!1,e))}}static closest(t,e){return t.closest(e)}static parents(t,e){const r=[];let i=t.parentElement;for(;i;)i.matches(e)&&r.push(i),i=i.parentElement;return r}static getOuterDimensions(t){const e=window.getComputedStyle(t),r={top:parseInt(e.marginTop),right:parseInt(e.marginRight),bottom:parseInt(e.marginBottom),left:parseInt(e.marginLeft)};return{width:t.offsetWidth+r.left+r.right,height:t.offsetHeight+r.top+r.bottom,margin:r}}static cloneWithEvents(t,e=!0){return t.cloneNode(e)}static trapFocus(t){const e=t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(e.length===0)return t.setAttribute("tabindex","-1"),t.focus(),()=>t.removeAttribute("tabindex");const r=e[0],i=e[e.length-1],n=s=>{s.key==="Tab"&&(s.shiftKey?document.activeElement===r&&(i==null||i.focus(),s.preventDefault()):document.activeElement===i&&(r==null||r.focus(),s.preventDefault()))};return t.addEventListener("keydown",n),r==null||r.focus(),()=>t.removeEventListener("keydown",n)}}class u{static getCSSVariable(t,e=document.documentElement){return getComputedStyle(e).getPropertyValue(t).trim()}static setCSSVariables(t,e=document.documentElement){Object.entries(t).forEach(([r,i])=>{e.style.setProperty(r,i)})}static getBaseStyles(){return`
15
+ `,e=this.template();this.shadowRoot.innerHTML=t+e,this.afterRender()}template(){return""}afterRender(){}$(t){return this.shadowRoot.querySelector(t)}$$(t){return this.shadowRoot.querySelectorAll(t)}static get observedAttributes(){return[]}attributeChangedCallback(t,e,r){this.setProp(t,r),this._initialized&&this.render()}}class ${constructor(){this.events=new Map,this.wildcardHandlers=new Set}on(t,e,r={}){const{once:i=!1,priority:n=0}=r;if(t.includes("*")){const o={pattern:t,handler:e,once:i,priority:n};return this.wildcardHandlers.add(o),()=>this.wildcardHandlers.delete(o)}this.events.has(t)||this.events.set(t,[]);const s={handler:e,once:i,priority:n},a=this.events.get(t);return a.push(s),a.sort((o,c)=>c.priority-o.priority),()=>{const o=a.indexOf(s);o>-1&&a.splice(o,1)}}once(t,e,r={}){return this.on(t,e,{...r,once:!0})}off(t,e){if(t.includes("*")){for(const n of this.wildcardHandlers)if(n.pattern===t&&n.handler===e){this.wildcardHandlers.delete(n);return}return}if(!this.events.has(t))return;const r=this.events.get(t),i=r.findIndex(n=>n.handler===e);i>-1&&r.splice(i,1),r.length===0&&this.events.delete(t)}offWildcard(t){for(const e of[...this.wildcardHandlers])e.pattern===t&&this.wildcardHandlers.delete(e)}offAll(t){for(const[e,r]of this.events){const i=r.findIndex(n=>n.handler===t);i>-1&&r.splice(i,1),r.length===0&&this.events.delete(e)}for(const e of[...this.wildcardHandlers])e.handler===t&&this.wildcardHandlers.delete(e)}emit(t,e){if(this.events.has(t)){const i=[...this.events.get(t)];for(const n of i){const{handler:s,once:a}=n;a&&this.off(t,s);try{s(e,t)}catch(o){console.error(`Error in event handler for ${t}:`,o)}}}const r=[];for(const i of[...this.wildcardHandlers])if(this.matchesPattern(t,i.pattern)){const{handler:n,once:s}=i;s&&r.push(i);try{n(e,t)}catch(a){console.error(`Error in wildcard handler for ${t}:`,a)}}r.forEach(i=>this.wildcardHandlers.delete(i))}matchesPattern(t,e){return new RegExp("^"+e.replace(/\*/g,".*")+"$").test(t)}clear(){this.events.clear(),this.wildcardHandlers.clear()}getEventNames(){return Array.from(this.events.keys())}getHandlerCount(t){return this.events.has(t)?this.events.get(t).length:0}getWildcardHandlerCount(){return this.wildcardHandlers.size}getTotalHandlerCount(){let t=this.wildcardHandlers.size;for(const e of this.events.values())t+=e.length;return t}}const L=new $;class S{constructor(t={}){this.eventBus=new $,this.calendar=new f.Calendar({view:t.view||"month",date:t.date||new Date,weekStartsOn:t.weekStartsOn??0,locale:t.locale||"en-US",timeZone:t.timeZone||Intl.DateTimeFormat().resolvedOptions().timeZone,...t}),this.state={view:this.calendar.getView(),currentDate:this.calendar.getCurrentDate(),events:[],selectedEvent:null,selectedDate:null,loading:!1,error:null,config:{...t}},this.subscribers=new Set,this.subscribe=this.subscribe.bind(this),this.unsubscribe=this.unsubscribe.bind(this),this.setState=this.setState.bind(this),this._syncEventsFromCore({silent:!0})}_syncEventsFromCore(t={}){const{force:e=!1}=t,r=this.calendar.getEvents()||[];return(e||this.state.events.length!==r.length||!this._eventsMatch(this.state.events,r))&&this.setState({events:[...r]},t),r}_eventsMatch(t,e){if(t.length!==e.length)return!1;const r=new Set(t.map(i=>i.id));return e.every(i=>r.has(i.id))}getState(){return{...this.state,config:{...this.state.config},events:[...this.state.events]}}setState(t,e={}){const{silent:r=!1}=e,i={...this.state};return this.state={...this.state,...t},r||(this.notifySubscribers(i,this.state),this.emitStateChange(i,this.state)),this.state}subscribe(t,e=null){return this.subscribers.add(t),e&&(this._subscriberIds||(this._subscriberIds=new Map),this._subscriberIds.set(e,t)),()=>this.unsubscribe(t,e)}unsubscribe(t,e=null){this.subscribers.delete(t),e&&this._subscriberIds&&this._subscriberIds.delete(e)}unsubscribeById(t){if(!this._subscriberIds)return!1;const e=this._subscriberIds.get(t);return e?(this.subscribers.delete(e),this._subscriberIds.delete(t),!0):!1}getSubscriberCount(){return this.subscribers.size}notifySubscribers(t,e){this.subscribers.forEach(r=>{try{r(e,t)}catch(i){console.error("Error in state subscriber:",i)}})}emitStateChange(t,e){const r=Object.keys(e).filter(i=>t[i]!==e[i]);r.forEach(i=>{this.eventBus.emit(`state:${i}:changed`,{oldValue:t[i],newValue:e[i],state:e})}),r.length>0&&this.eventBus.emit("state:changed",{oldState:t,newState:e,changedKeys:r})}setView(t){this.calendar.setView(t),this.setState({view:t}),this.eventBus.emit("view:changed",{view:t})}getView(){return this.state.view}setDate(t){this.calendar.goToDate(t),this.setState({currentDate:this.calendar.getCurrentDate()}),this.eventBus.emit("date:changed",{date:this.state.currentDate})}getCurrentDate(){return this.state.currentDate}next(){this.calendar.next(),this.setState({currentDate:this.calendar.getCurrentDate()}),this.eventBus.emit("navigation:next",{date:this.state.currentDate})}previous(){this.calendar.previous(),this.setState({currentDate:this.calendar.getCurrentDate()}),this.eventBus.emit("navigation:previous",{date:this.state.currentDate})}today(){this.calendar.today(),this.setState({currentDate:this.calendar.getCurrentDate()}),this.eventBus.emit("navigation:today",{date:this.state.currentDate})}goToDate(t){this.calendar.goToDate(t),this.setState({currentDate:this.calendar.getCurrentDate()}),this.eventBus.emit("navigation:goto",{date:this.state.currentDate})}addEvent(t){const e=this.calendar.addEvent(t);return e?(this._syncEventsFromCore(),this.eventBus.emit("event:add",{event:e}),this.eventBus.emit("event:added",{event:e}),e):(console.error("Failed to add event to calendar"),this.eventBus.emit("event:error",{action:"add",event:t,error:"Failed to add event"}),null)}updateEvent(t,e){this._syncEventsFromCore({silent:!0});const r=this.calendar.updateEvent(t,e);return r?(this._syncEventsFromCore({force:!0}),this.eventBus.emit("event:update",{event:r}),this.eventBus.emit("event:updated",{event:r}),r):(console.error(`Failed to update event: ${t}`),this.eventBus.emit("event:error",{action:"update",eventId:t,updates:e,error:"Event not found in calendar"}),null)}deleteEvent(t){return this._syncEventsFromCore({silent:!0}),this.calendar.removeEvent(t)?(this._syncEventsFromCore(),this.eventBus.emit("event:remove",{eventId:t}),this.eventBus.emit("event:deleted",{eventId:t}),!0):(console.error(`Failed to delete event: ${t}`),this.eventBus.emit("event:error",{action:"delete",eventId:t,error:"Event not found"}),!1)}getEvents(){return this.calendar.getEvents()||[]}syncEvents(){return this._syncEventsFromCore()}getEventsForDate(t){return this.calendar.getEventsForDate(t)}getEventsInRange(t,e){return this.calendar.getEventsInRange(t,e)}getViewData(){const t=this.calendar.getViewData();return this.enrichViewData(t)}enrichViewData(t){var i;const e={...t},r=(i=this.state.selectedDate)==null?void 0:i.toDateString();if(e.weeks&&(e.weeks=e.weeks.map(n=>({...n,days:n.days.map(s=>{const a=new Date(s.date);return{...s,isSelected:a.toDateString()===r,events:s.events||this.getEventsForDate(a)}})}))),e.days&&(e.days=e.days.map(n=>{const s=new Date(n.date);return{...n,isSelected:s.toDateString()===r,events:n.events||this.getEventsForDate(s)}})),e.date&&!e.days&&!e.weeks){const n=new Date(e.date);e.isSelected=n.toDateString()===r,e.events=e.events||this.getEventsForDate(n)}return e}selectEvent(t){this.setState({selectedEvent:t}),this.eventBus.emit("event:selected",{event:t})}selectEventById(t){const e=this.state.events.find(r=>r.id===t);e&&this.selectEvent(e)}deselectEvent(){this.setState({selectedEvent:null}),this.eventBus.emit("event:deselected",{})}selectDate(t){this.setState({selectedDate:t}),this.eventBus.emit("date:selected",{date:t})}deselectDate(){this.setState({selectedDate:null}),this.eventBus.emit("date:deselected",{})}isToday(t){const e=new Date;return t.toDateString()===e.toDateString()}isSelectedDate(t){return this.state.selectedDate&&t.toDateString()===this.state.selectedDate.toDateString()}isWeekend(t){const e=t.getDay();return e===0||e===6}setLoading(t){this.setState({loading:t})}setError(t){this.setState({error:t}),t&&this.eventBus.emit("error",{error:t})}clearError(){this.setState({error:null})}updateConfig(t){this.setState({config:{...this.state.config,...t}}),t.weekStartsOn!==void 0&&this.calendar.setWeekStartsOn(t.weekStartsOn),t.locale!==void 0&&this.calendar.setLocale(t.locale),t.timeZone!==void 0&&this.calendar.setTimezone(t.timeZone)}destroy(){this.subscribers.clear(),this._subscriberIds&&(this._subscriberIds.clear(),this._subscriberIds=null),this.eventBus&&(this.eventBus.clear(),this.eventBus=null),this.state=null,this.calendar=null}}class p extends f.DateUtils{static formatDate(t,e="default",r="en-US"){if(!t)return"";const i={default:{year:"numeric",month:"long",day:"numeric"},short:{year:"numeric",month:"short",day:"numeric"},long:{weekday:"long",year:"numeric",month:"long",day:"numeric"},month:{year:"numeric",month:"long"},monthShort:{year:"numeric",month:"short"},day:{weekday:"long",day:"numeric"},dayShort:{weekday:"short",day:"numeric"},time:{hour:"numeric",minute:"2-digit"},timeShort:{hour:"numeric"},datetime:{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}},n=i[e]||i.default;return new Intl.DateTimeFormat(r,n).format(t)}static formatTime(t,e=!0,r=!1,i="en-US"){if(!t)return"";const n={hour:"numeric",minute:e?"2-digit":void 0,hour12:!r};return new Intl.DateTimeFormat(i,n).format(t)}static formatDateRange(t,e,r="en-US"){if(!t)return"";if(!e||this.isSameDay(t,e))return this.formatDate(t,"default",r);const i=this.isSameYear(t,e)?"short":"default";return`${this.formatDate(t,i,r)} - ${this.formatDate(e,"default",r)}`}static formatTimeRange(t,e,r="en-US"){if(!t)return"";const i=this.formatTime(t,!0,!1,r);if(!e)return i;const n=this.formatTime(e,!0,!1,r);return`${i} - ${n}`}static getRelativeTime(t,e=new Date,r="en-US"){const i=new Intl.RelativeTimeFormat(r,{numeric:"auto"}),n=t-e,s=Math.floor(n/1e3),a=Math.floor(s/60),o=Math.floor(a/60),c=Math.floor(o/24),d=Math.floor(c/7),h=Math.floor(c/30),m=Math.floor(c/365);return Math.abs(s)<60?i.format(s,"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(d)<4?i.format(d,"week"):Math.abs(h)<12?i.format(h,"month"):i.format(m,"year")}static isToday(t){const e=new Date;return this.isSameDay(t,e)}static isPast(t){return t<new Date}static isFuture(t){return t>new Date}static getWeekNumber(t){const e=new Date(t.getFullYear(),0,1),r=(t-e)/864e5;return Math.ceil((r+e.getDay()+1)/7)}static getDayAbbreviation(t,e="en-US"){const r=new Date(2024,0,7+t);return new Intl.DateTimeFormat(e,{weekday:"short"}).format(r)}static getDayName(t,e="en-US"){const r=new Date(2024,0,7+t);return new Intl.DateTimeFormat(e,{weekday:"long"}).format(r)}static getMonthName(t,e="long",r="en-US"){const i=new Date(2024,t,1);return new Intl.DateTimeFormat(r,{month:e}).format(i)}static parseTimeString(t,e=new Date){const r=new Date(e),[i,n]=t.split(/\s+/),[s,a]=i.split(":").map(Number);let o=s;return n&&(n.toLowerCase()==="pm"&&s<12?o=s+12:n.toLowerCase()==="am"&&s===12&&(o=0)),r.setHours(o,a||0,0,0),r}}class w{static createElement(t,e={},r=[]){const i=document.createElement(t);return Object.entries(e).forEach(([n,s])=>{if(n==="className")i.className=s;else if(n==="style"&&typeof s=="object")Object.assign(i.style,s);else if(n.startsWith("data-"))i.setAttribute(n,s);else if(n.startsWith("on")&&typeof s=="function"){const a=n.slice(2).toLowerCase();i.addEventListener(a,s)}else i[n]=s}),r.forEach(n=>{typeof n=="string"?i.appendChild(document.createTextNode(n)):n instanceof Node&&i.appendChild(n)}),i}static addEventListeners(t,e){return Object.entries(e).forEach(([r,i])=>{t.addEventListener(r,i)}),()=>{Object.entries(e).forEach(([r,i])=>{t.removeEventListener(r,i)})}}static delegate(t,e,r,i){const n=s=>{const a=s.target.closest(e);a&&t.contains(a)&&i.call(a,s)};return t.addEventListener(r,n),()=>t.removeEventListener(r,n)}static getPosition(t){const e=t.getBoundingClientRect();return{top:e.top+window.scrollY,left:e.left+window.scrollX,bottom:e.bottom+window.scrollY,right:e.right+window.scrollX,width:e.width,height:e.height}}static isInViewport(t,e=0){const r=t.getBoundingClientRect();return r.top>=-e&&r.left>=-e&&r.bottom<=(window.innerHeight||document.documentElement.clientHeight)+e&&r.right<=(window.innerWidth||document.documentElement.clientWidth)+e}static scrollToElement(t,e={}){const{behavior:r="smooth",block:i="start",inline:n="nearest"}=e;t.scrollIntoView({behavior:r,block:i,inline:n})}static getStyle(t,e){return window.getComputedStyle(t).getPropertyValue(e)}static setStyles(t,e){Object.assign(t.style,e)}static async animateClass(t,e,r=300){t.classList.add(e),await this.wait(r),t.classList.remove(e)}static waitForAnimation(t,e="animationend"){return new Promise(r=>{const i=()=>{t.removeEventListener(e,i),r()};t.addEventListener(e,i)})}static wait(t){return new Promise(e=>setTimeout(e,t))}static parseHTML(t){const e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstChild}static escapeHTML(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}static debounce(t,e=250){let r;return function(...n){const s=()=>{clearTimeout(r),t(...n)};clearTimeout(r),r=setTimeout(s,e)}}static throttle(t,e=250){let r;return function(...i){r||(t.apply(this,i),r=!0,setTimeout(()=>r=!1,e))}}static closest(t,e){return t.closest(e)}static parents(t,e){const r=[];let i=t.parentElement;for(;i;)i.matches(e)&&r.push(i),i=i.parentElement;return r}static getOuterDimensions(t){const e=window.getComputedStyle(t),r={top:parseInt(e.marginTop),right:parseInt(e.marginRight),bottom:parseInt(e.marginBottom),left:parseInt(e.marginLeft)};return{width:t.offsetWidth+r.left+r.right,height:t.offsetHeight+r.top+r.bottom,margin:r}}static cloneWithEvents(t,e=!0){return t.cloneNode(e)}static trapFocus(t){const e=t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(e.length===0)return t.setAttribute("tabindex","-1"),t.focus(),()=>t.removeAttribute("tabindex");const r=e[0],i=e[e.length-1],n=s=>{s.key==="Tab"&&(s.shiftKey?document.activeElement===r&&(i==null||i.focus(),s.preventDefault()):document.activeElement===i&&(r==null||r.focus(),s.preventDefault()))};return t.addEventListener("keydown",n),r==null||r.focus(),()=>t.removeEventListener("keydown",n)}}class u{static getCSSVariable(t,e=document.documentElement){return getComputedStyle(e).getPropertyValue(t).trim()}static setCSSVariables(t,e=document.documentElement){Object.entries(t).forEach(([r,i])=>{e.style.setProperty(r,i)})}static getBaseStyles(){return`
16
16
  :host {
17
17
  /* Apply CSS variables */
18
18
  ${Object.entries(this.cssVariables).map(([t,e])=>`${t}: ${e};`).join(`
@@ -235,10 +235,10 @@
235
235
  .fc-scale-in {
236
236
  animation: fc-scale-in var(--fc-transition);
237
237
  }
238
- `}}x(u,"colors",{primary:"#3B82F6",secondary:"#64748B",accent:"#F59E0B",danger:"#EF4444",warning:"#F97316",info:"#06B6D4",success:"#22C55E",light:"#F8FAFC",dark:"#0F172A",white:"#FFFFFF",gray:{50:"#F8FAFC",100:"#F1F5F9",200:"#E2E8F0",300:"#CBD5E1",400:"#94A3B8",500:"#64748B",600:"#475569",700:"#334155",800:"#1E293B",900:"#0F172A"}}),x(u,"cssVariables",{"--fc-primary-color":"#2563EB","--fc-primary-hover":"#1D4ED8","--fc-primary-light":"#EFF6FF","--fc-text-color":"#111827","--fc-text-secondary":"#6B7280","--fc-text-light":"#9CA3AF","--fc-border-color":"#E5E7EB","--fc-border-color-hover":"#D1D5DB","--fc-background":"#FFFFFF","--fc-background-alt":"#FAFAFA","--fc-background-hover":"#F3F4F6","--fc-background-active":"#E5E7EB","--fc-accent-color":"#F59E0B","--fc-danger-color":"#EF4444","--fc-success-color":"#10B981","--fc-font-family":'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',"--fc-font-size-xs":"11px","--fc-font-size-sm":"12px","--fc-font-size-base":"13px","--fc-font-size-lg":"15px","--fc-font-size-xl":"18px","--fc-font-size-2xl":"24px","--fc-line-height":"1.4","--fc-font-weight-normal":"400","--fc-font-weight-medium":"500","--fc-font-weight-semibold":"600","--fc-font-weight-bold":"700","--fc-spacing-xs":"2px","--fc-spacing-sm":"6px","--fc-spacing-md":"10px","--fc-spacing-lg":"14px","--fc-spacing-xl":"20px","--fc-spacing-2xl":"28px","--fc-border-width":"1px","--fc-border-radius-sm":"3px","--fc-border-radius":"5px","--fc-border-radius-lg":"8px","--fc-border-radius-full":"9999px","--fc-shadow-sm":"0 1px 1px rgba(0,0,0,0.05)","--fc-shadow":"0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06)","--fc-shadow-md":"0 4px 6px -1px rgba(0, 0, 0, 0.1)","--fc-shadow-lg":"0 10px 15px -3px rgba(0, 0, 0, 0.1)","--fc-transition-fast":"100ms ease-out","--fc-transition":"150ms ease-out","--fc-transition-slow":"250ms ease-out","--fc-z-dropdown":"1000","--fc-z-modal":"2000","--fc-z-tooltip":"3000"}),x(u,"breakpoints",{xs:"320px",sm:"576px",md:"768px",lg:"992px",xl:"1200px","2xl":"1400px"});class D{constructor(t,e){this.container=t,this.stateManager=e,this._listeners=[],this._scrolled=!1}render(){throw new Error("render() must be implemented by subclass")}cleanup(){this._listeners.forEach(({element:t,event:e,handler:r})=>{t.removeEventListener(e,r)}),this._listeners=[]}addListener(t,e,r){const i=r.bind(this);t.addEventListener(e,i),this._listeners.push({element:t,event:e,handler:i})}escapeHTML(t){return t==null?"":w.escapeHTML(String(t))}isToday(t){const e=new Date;return t.getDate()===e.getDate()&&t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}isSameDay(t,e){return t.getDate()===e.getDate()&&t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}formatHour(t){const e=t>=12?"PM":"AM";return`${t%12||12} ${e}`}formatTime(t){const e=t.getHours(),r=t.getMinutes(),i=e>=12?"PM":"AM",n=e%12||12;return r===0?`${n} ${i}`:`${n}:${r.toString().padStart(2,"0")} ${i}`}getContrastingTextColor(t){return!t||typeof t!="string"||t.charAt(0)!=="#"?"white":u.getContrastColor(t)}renderNowIndicator(){const t=new Date;return`<div class="fc-now-indicator" style="position: absolute; left: 0; right: 0; top: ${t.getHours()*60+t.getMinutes()}px; height: 2px; background: var(--fc-danger-color); z-index: 15; pointer-events: none;"></div>`}computeOverlapLayout(t){if(!t||t.length===0)return new Map;const e=t.map(o=>{const c=new Date(o.start),d=new Date(o.end),h=c.getHours()*60+c.getMinutes(),m=Math.max(h+1,d.getHours()*60+d.getMinutes());return{id:o.id,startMin:h,endMin:m}});e.sort((o,c)=>o.startMin-c.startMin||c.endMin-c.startMin-(o.endMin-o.startMin));const r=[],i=new Map;for(const o of e){let c=!1;for(let d=0;d<r.length;d++)if(r[d]<=o.startMin){r[d]=o.endMin,i.set(o.id,{column:d,totalColumns:0}),c=!0;break}c||(i.set(o.id,{column:r.length,totalColumns:0}),r.push(o.endMin))}const n=[];let s=[],a=0;for(const o of e)s.length===0||o.startMin<a?(s.push(o),a=Math.max(a,o.endMin)):(n.push(s),s=[o],a=o.endMin);s.length>0&&n.push(s);for(const o of n){const c=Math.max(...o.map(d=>i.get(d.id).column))+1;for(const d of o)i.get(d.id).totalColumns=c}return i}renderTimedEvent(t,e={}){const{compact:r=!0,overlapLayout:i=null}=e,n=new Date(t.start),s=new Date(t.end),a=n.getHours()*60+n.getMinutes(),o=Math.max((s-n)/(1e3*60),r?20:30),c=this.getEventColor(t),d=this.getContrastingTextColor(c),h=r?"4px 8px":"8px 12px",m=r?"11px":"13px",y=r?2:12,_=r?2:24,z=r?"4px":"6px";let M,C;if(i&&i.has(t.id)){const{column:B,totalColumns:H}=i.get(t.id),L=`(100% - ${y+_}px)`;M=`calc(${y}px + ${B} * ${L} / ${H})`,C=`calc(${L} / ${H})`}else M=`${y}px`,C=`calc(100% - ${y+_}px)`;return`
238
+ `}}x(u,"colors",{primary:"#3B82F6",secondary:"#64748B",accent:"#F59E0B",danger:"#EF4444",warning:"#F97316",info:"#06B6D4",success:"#22C55E",light:"#F8FAFC",dark:"#0F172A",white:"#FFFFFF",gray:{50:"#F8FAFC",100:"#F1F5F9",200:"#E2E8F0",300:"#CBD5E1",400:"#94A3B8",500:"#64748B",600:"#475569",700:"#334155",800:"#1E293B",900:"#0F172A"}}),x(u,"cssVariables",{"--fc-primary-color":"#2563EB","--fc-primary-hover":"#1D4ED8","--fc-primary-light":"#EFF6FF","--fc-text-color":"#111827","--fc-text-secondary":"#6B7280","--fc-text-light":"#9CA3AF","--fc-border-color":"#E5E7EB","--fc-border-color-hover":"#D1D5DB","--fc-background":"#FFFFFF","--fc-background-alt":"#FAFAFA","--fc-background-hover":"#F3F4F6","--fc-background-active":"#E5E7EB","--fc-accent-color":"#F59E0B","--fc-danger-color":"#EF4444","--fc-success-color":"#10B981","--fc-font-family":'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',"--fc-font-size-xs":"11px","--fc-font-size-sm":"12px","--fc-font-size-base":"13px","--fc-font-size-lg":"15px","--fc-font-size-xl":"18px","--fc-font-size-2xl":"24px","--fc-line-height":"1.4","--fc-font-weight-normal":"400","--fc-font-weight-medium":"500","--fc-font-weight-semibold":"600","--fc-font-weight-bold":"700","--fc-spacing-xs":"2px","--fc-spacing-sm":"6px","--fc-spacing-md":"10px","--fc-spacing-lg":"14px","--fc-spacing-xl":"20px","--fc-spacing-2xl":"28px","--fc-border-width":"1px","--fc-border-radius-sm":"3px","--fc-border-radius":"5px","--fc-border-radius-lg":"8px","--fc-border-radius-full":"9999px","--fc-shadow-sm":"0 1px 1px rgba(0,0,0,0.05)","--fc-shadow":"0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06)","--fc-shadow-md":"0 4px 6px -1px rgba(0, 0, 0, 0.1)","--fc-shadow-lg":"0 10px 15px -3px rgba(0, 0, 0, 0.1)","--fc-transition-fast":"100ms ease-out","--fc-transition":"150ms ease-out","--fc-transition-slow":"250ms ease-out","--fc-z-dropdown":"1000","--fc-z-modal":"2000","--fc-z-tooltip":"3000"}),x(u,"breakpoints",{xs:"320px",sm:"576px",md:"768px",lg:"992px",xl:"1200px","2xl":"1400px"});class D{constructor(t,e){this.container=t,this.stateManager=e,this._listeners=[],this._scrolled=!1,this._nowIndicatorTimer=null}render(){throw new Error("render() must be implemented by subclass")}cleanup(){this._listeners.forEach(({element:t,event:e,handler:r})=>{t.removeEventListener(e,r)}),this._listeners=[],this._nowIndicatorTimer&&(clearInterval(this._nowIndicatorTimer),this._nowIndicatorTimer=null)}addListener(t,e,r){const i=r.bind(this);t.addEventListener(e,i),this._listeners.push({element:t,event:e,handler:i})}escapeHTML(t){return t==null?"":w.escapeHTML(String(t))}isToday(t){const e=new Date;return t.getDate()===e.getDate()&&t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}isSameDay(t,e){return t.getDate()===e.getDate()&&t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}formatHour(t){const e=t>=12?"PM":"AM";return`${t%12||12} ${e}`}formatTime(t){const e=t.getHours(),r=t.getMinutes(),i=e>=12?"PM":"AM",n=e%12||12;return r===0?`${n} ${i}`:`${n}:${r.toString().padStart(2,"0")} ${i}`}getContrastingTextColor(t){return!t||typeof t!="string"||t.charAt(0)!=="#"?"white":u.getContrastColor(t)}renderNowIndicator(){const t=new Date;return`<div class="fc-now-indicator" style="position: absolute; left: 0; right: 0; top: ${t.getHours()*60+t.getMinutes()}px; height: 2px; background: var(--fc-danger-color); z-index: 15; pointer-events: none;"></div>`}startNowIndicatorTimer(){this._nowIndicatorTimer&&clearInterval(this._nowIndicatorTimer),this._nowIndicatorTimer=setInterval(()=>{const t=this.container.querySelector(".fc-now-indicator");if(t){const e=new Date;t.style.top=`${e.getHours()*60+e.getMinutes()}px`}},6e4)}computeOverlapLayout(t){if(!t||t.length===0)return new Map;const e=t.map(o=>{const c=new Date(o.start),d=new Date(o.end),h=c.getHours()*60+c.getMinutes(),m=Math.max(h+1,d.getHours()*60+d.getMinutes());return{id:o.id,startMin:h,endMin:m}});e.sort((o,c)=>o.startMin-c.startMin||c.endMin-c.startMin-(o.endMin-o.startMin));const r=[],i=new Map;for(const o of e){let c=!1;for(let d=0;d<r.length;d++)if(r[d]<=o.startMin){r[d]=o.endMin,i.set(o.id,{column:d,totalColumns:0}),c=!0;break}c||(i.set(o.id,{column:r.length,totalColumns:0}),r.push(o.endMin))}const n=[];let s=[],a=0;for(const o of e)s.length===0||o.startMin<a?(s.push(o),a=Math.max(a,o.endMin)):(n.push(s),s=[o],a=o.endMin);s.length>0&&n.push(s);for(const o of n){const c=Math.max(...o.map(d=>i.get(d.id).column))+1;for(const d of o)i.get(d.id).totalColumns=c}return i}renderTimedEvent(t,e={}){const{compact:r=!0,overlapLayout:i=null}=e,n=new Date(t.start),s=new Date(t.end),a=n.getHours()*60+n.getMinutes(),o=Math.max((s-n)/(1e3*60),r?20:30),c=this.getEventColor(t),d=this.getContrastingTextColor(c),h=r?"4px 8px":"8px 12px",m=r?"11px":"13px",y=r?2:12,_=r?2:24,z=r?"4px":"6px";let M,T;if(i&&i.has(t.id)){const{column:B,totalColumns:H}=i.get(t.id),I=`(100% - ${y+_}px)`;M=`calc(${y}px + ${B} * ${I} / ${H})`,T=`calc(${I} / ${H})`}else M=`${y}px`,T=`calc(100% - ${y+_}px)`;return`
239
239
  <div class="fc-event fc-timed-event" data-event-id="${this.escapeHTML(t.id)}"
240
240
  style="position: absolute; top: ${a}px; height: ${o}px;
241
- left: ${M}; width: ${C};
241
+ left: ${M}; width: ${T};
242
242
  background-color: ${c}; border-radius: ${z};
243
243
  padding: ${h}; font-size: ${m};
244
244
  font-weight: 500; color: ${d}; overflow: hidden;
@@ -273,7 +273,7 @@
273
273
  style="background-color: ${e}; font-size: 11px; padding: 2px 6px; border-radius: 3px; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;">
274
274
  ${this.escapeHTML(t.title)}
275
275
  </div>
276
- `}_attachEventHandlers(){this.addListener(this.container,"click",t=>{const e=t.target.closest(".fc-month-day");if(!e||!this.container.contains(e)||t.target.closest(".fc-event"))return;const r=new Date(e.dataset.date);this.stateManager.selectDate(r)}),this.attachCommonEventHandlers()}}class T extends D{constructor(t,e){super(t,e),this.hourHeight=60,this.totalHeight=24*this.hourHeight}render(){if(!this.container||!this.stateManager)return;const t=this.stateManager.getViewData();if(!t||!t.days||t.days.length===0){this.container.innerHTML='<div style="padding: 20px; text-align: center; color: var(--fc-text-secondary);">No data available for week view.</div>';return}this.cleanup(),this._scrolled=!1;const e=this.stateManager.getState().config,r=this._renderWeekView(t,e);this.container.innerHTML=r,this._attachEventHandlers(),this._scrollToCurrentTime()}_renderWeekView(t,e){const r=t.days,i=this.stateManager.getState().config.locale||"en-US",n=Array.from({length:24},(a,o)=>o),s=r.map(a=>{const o=new Date(a.date),c=a.events||[];return{...a,date:o,dayName:p.getDayAbbreviation(o.getDay(),i),dayOfMonth:o.getDate(),isToday:this.isToday(o),timedEvents:c.filter(d=>!d.allDay),allDayEvents:c.filter(d=>d.allDay)}});return`
276
+ `}_attachEventHandlers(){this.addListener(this.container,"click",t=>{const e=t.target.closest(".fc-month-day");if(!e||!this.container.contains(e)||t.target.closest(".fc-event"))return;const r=new Date(e.dataset.date);this.stateManager.selectDate(r)}),this.attachCommonEventHandlers()}}class C extends D{constructor(t,e){super(t,e),this.hourHeight=60,this.totalHeight=24*this.hourHeight}render(){if(!this.container||!this.stateManager)return;const t=this.stateManager.getViewData();if(!t||!t.days||t.days.length===0){this.container.innerHTML='<div style="padding: 20px; text-align: center; color: var(--fc-text-secondary);">No data available for week view.</div>';return}this.cleanup(),this._scrolled=!1;const e=this.stateManager.getState().config,r=this._renderWeekView(t,e);this.container.innerHTML=r,this._attachEventHandlers(),this._scrollToCurrentTime(),this.startNowIndicatorTimer()}_renderWeekView(t,e){const r=t.days,i=this.stateManager.getState().config.locale||"en-US",n=Array.from({length:24},(a,o)=>o),s=r.map(a=>{const o=new Date(a.date),c=a.events||[];return{...a,date:o,dayName:p.getDayAbbreviation(o.getDay(),i),dayOfMonth:o.getDate(),isToday:this.isToday(o),timedEvents:c.filter(d=>!d.allDay),allDayEvents:c.filter(d=>d.allDay)}});return`
277
277
  <div class="fc-week-view" style="display: flex; flex-direction: column; height: 100%; background: var(--fc-background); overflow: hidden;">
278
278
  ${this._renderHeader(s)}
279
279
  ${this._renderAllDayRow(s)}
@@ -335,7 +335,7 @@
335
335
  <!-- Timed events -->
336
336
  ${(()=>{const r=this.computeOverlapLayout(t.timedEvents);return t.timedEvents.map(i=>this.renderTimedEvent(i,{compact:!0,overlapLayout:r})).join("")})()}
337
337
  </div>
338
- `}_attachEventHandlers(){this.addListener(this.container,"click",t=>{const e=t.target.closest(".fc-week-day-column");if(!e||!this.container.contains(e)||t.target.closest(".fc-event"))return;const r=new Date(e.dataset.date),i=this.container.querySelector("#week-scroll-container"),n=e.offsetTop,s=t.clientY-e.getBoundingClientRect().top+(i?i.scrollTop:0)-n,a=Math.max(0,Math.min(s+n,this.totalHeight));r.setHours(Math.floor(a/this.hourHeight),Math.floor(a%this.hourHeight/(this.hourHeight/60)),0,0),this.stateManager.selectDate(r)}),this.attachCommonEventHandlers()}_scrollToCurrentTime(){if(this._scrolled)return;const t=this.container.querySelector("#week-scroll-container");t&&(t.scrollTop=8*this.hourHeight-50,this._scrolled=!0)}}class F extends D{constructor(t,e){super(t,e),this.hourHeight=60,this.totalHeight=24*this.hourHeight}render(){if(!this.container||!this.stateManager)return;const t=this.stateManager.getViewData();if(!t){this.container.innerHTML='<div style="padding: 20px; text-align: center; color: var(--fc-text-secondary);">No data available for day view.</div>';return}this.cleanup(),this._scrolled=!1;const e=this.stateManager.getState().config,r=this._renderDayView(t,e);this.container.innerHTML=r,this._attachEventHandlers(),this._scrollToCurrentTime()}_renderDayView(t,e){var h,m;const r=((m=(h=this.stateManager)==null?void 0:h.getState())==null?void 0:m.currentDate)||new Date,i=this._extractDayData(t,r);if(!i)return'<div style="padding: 20px; text-align: center; color: var(--fc-text-secondary);">No data available for day view.</div>';const{dayDate:n,dayName:s,isToday:a,allDayEvents:o,timedEvents:c}=i,d=Array.from({length:24},(y,_)=>_);return`
338
+ `}_attachEventHandlers(){this.addListener(this.container,"click",t=>{const e=t.target.closest(".fc-week-day-column");if(!e||!this.container.contains(e)||t.target.closest(".fc-event"))return;const r=new Date(e.dataset.date),i=this.container.querySelector("#week-scroll-container"),n=e.offsetTop,s=t.clientY-e.getBoundingClientRect().top+(i?i.scrollTop:0)-n,a=Math.max(0,Math.min(s+n,this.totalHeight));r.setHours(Math.floor(a/this.hourHeight),Math.floor(a%this.hourHeight/(this.hourHeight/60)),0,0),this.stateManager.selectDate(r)}),this.attachCommonEventHandlers()}_scrollToCurrentTime(){if(this._scrolled)return;const t=this.container.querySelector("#week-scroll-container");t&&(t.scrollTop=8*this.hourHeight-50,this._scrolled=!0)}}class F extends D{constructor(t,e){super(t,e),this.hourHeight=60,this.totalHeight=24*this.hourHeight}render(){if(!this.container||!this.stateManager)return;const t=this.stateManager.getViewData();if(!t){this.container.innerHTML='<div style="padding: 20px; text-align: center; color: var(--fc-text-secondary);">No data available for day view.</div>';return}this.cleanup(),this._scrolled=!1;const e=this.stateManager.getState().config,r=this._renderDayView(t,e);this.container.innerHTML=r,this._attachEventHandlers(),this._scrollToCurrentTime(),this.startNowIndicatorTimer()}_renderDayView(t,e){var h,m;const r=((m=(h=this.stateManager)==null?void 0:h.getState())==null?void 0:m.currentDate)||new Date,i=this._extractDayData(t,r);if(!i)return'<div style="padding: 20px; text-align: center; color: var(--fc-text-secondary);">No data available for day view.</div>';const{dayDate:n,dayName:s,isToday:a,allDayEvents:o,timedEvents:c}=i,d=Array.from({length:24},(y,_)=>_);return`
339
339
  <div class="fc-day-view" style="display: flex; flex-direction: column; height: 100%; background: var(--fc-background); overflow: hidden;">
340
340
  ${this._renderHeader(n,s,a)}
341
341
  ${this._renderAllDayRow(o,n)}
@@ -393,7 +393,7 @@
393
393
  <!-- Timed events -->
394
394
  ${(()=>{const n=this.computeOverlapLayout(t);return t.map(s=>this.renderTimedEvent(s,{compact:!1,overlapLayout:n})).join("")})()}
395
395
  </div>
396
- `}_attachEventHandlers(){this.addListener(this.container,"click",t=>{const e=t.target.closest(".fc-day-column");if(!e||!this.container.contains(e)||t.target.closest(".fc-event"))return;const r=new Date(e.dataset.date),i=this.container.querySelector("#day-scroll-container"),n=e.offsetTop,s=t.clientY-e.getBoundingClientRect().top+(i?i.scrollTop:0)-n,a=Math.max(0,Math.min(s+n,this.totalHeight));r.setHours(Math.floor(a/this.hourHeight),Math.floor(a%this.hourHeight/(this.hourHeight/60)),0,0),this.stateManager.selectDate(r)}),this.attachCommonEventHandlers()}_scrollToCurrentTime(){if(this._scrolled)return;const t=this.container.querySelector("#day-scroll-container");t&&(t.scrollTop=8*this.hourHeight-50,this._scrolled=!0)}}class I extends v{constructor(){super(),this._isVisible=!1,this._cleanupFocusTrap=null,this.config={title:"New Event",defaultDuration:60,colors:[{color:"#2563EB",label:"Blue"},{color:"#10B981",label:"Green"},{color:"#F59E0B",label:"Amber"},{color:"#EF4444",label:"Red"},{color:"#8B5CF6",label:"Purple"},{color:"#6B7280",label:"Gray"}]},this._formData={title:"",start:new Date,end:new Date,allDay:!1,color:this.config.colors[0].color}}static get observedAttributes(){return["open"]}attributeChangedCallback(t,e,r){t==="open"&&(r!==null?this.open():this.close())}getStyles(){return`
396
+ `}_attachEventHandlers(){this.addListener(this.container,"click",t=>{const e=t.target.closest(".fc-day-column");if(!e||!this.container.contains(e)||t.target.closest(".fc-event"))return;const r=new Date(e.dataset.date),i=this.container.querySelector("#day-scroll-container"),n=e.offsetTop,s=t.clientY-e.getBoundingClientRect().top+(i?i.scrollTop:0)-n,a=Math.max(0,Math.min(s+n,this.totalHeight));r.setHours(Math.floor(a/this.hourHeight),Math.floor(a%this.hourHeight/(this.hourHeight/60)),0,0),this.stateManager.selectDate(r)}),this.attachCommonEventHandlers()}_scrollToCurrentTime(){if(this._scrolled)return;const t=this.container.querySelector("#day-scroll-container");t&&(t.scrollTop=8*this.hourHeight-50,this._scrolled=!0)}}class V extends v{constructor(){super(),this._isVisible=!1,this._cleanupFocusTrap=null,this.config={title:"New Event",defaultDuration:60,colors:[{color:"#2563EB",label:"Blue"},{color:"#10B981",label:"Green"},{color:"#F59E0B",label:"Amber"},{color:"#EF4444",label:"Red"},{color:"#8B5CF6",label:"Purple"},{color:"#6B7280",label:"Gray"}]},this._formData={title:"",start:new Date,end:new Date,allDay:!1,color:this.config.colors[0].color}}static get observedAttributes(){return["open"]}attributeChangedCallback(t,e,r){t==="open"&&(r!==null?this.open():this.close())}getStyles(){return`
397
397
  ${u.getBaseStyles()}
398
398
  ${u.getButtonStyles()}
399
399
 
@@ -615,7 +615,7 @@
615
615
  <button class="fc-btn fc-btn-primary" id="save-btn">Save Event</button>
616
616
  </footer>
617
617
  </div>
618
- `}afterRender(){this.modalContent=this.$(".modal-content"),this.titleInput=this.$("#event-title"),this.startInput=this.$("#event-start"),this.endInput=this.$("#event-end"),this.colorContainer=this.$("#color-picker"),this.titleGroup=this.$("#title-group"),this.endGroup=this.$("#end-group"),this.addListener(this.$("#close-x"),"click",()=>this.close()),this.addListener(this.$("#cancel-btn"),"click",()=>this.close()),this.addListener(this.$("#save-btn"),"click",()=>this.save()),this.colorContainer.querySelectorAll(".color-btn").forEach(t=>{this.addListener(t,"click",e=>{this._formData.color=e.currentTarget.dataset.color,this.updateColorSelection()})}),this.addListener(this,"click",t=>{t.target===this&&this.close()}),this._keydownListenerAdded||(this._handleKeyDown=t=>{t.key==="Escape"&&this.hasAttribute("open")&&this.close()},window.addEventListener("keydown",this._handleKeyDown),this._keydownListenerAdded=!0)}updateColorSelection(){this.colorContainer.querySelectorAll(".color-btn").forEach(e=>{const r=e.dataset.color===this._formData.color;e.classList.toggle("selected",r),e.setAttribute("aria-checked",r?"true":"false")})}open(t=new Date){this.hasAttribute("open")||this.setAttribute("open",""),this.titleGroup.classList.remove("has-error"),this.endGroup.classList.remove("has-error"),this._formData.start=t,this._formData.end=new Date(t.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&&this._cleanupFocusTrap(),this._cleanupFocusTrap=w.trapFocus(this.modalContent))}close(){this.removeAttribute("open"),this._cleanupFocusTrap&&(this._cleanupFocusTrap(),this._cleanupFocusTrap=null)}validate(){let t=!0;this.titleGroup.classList.remove("has-error"),this.endGroup.classList.remove("has-error"),this.titleInput.value.trim()||(this.titleGroup.classList.add("has-error"),t=!1);const e=new Date(this.startInput.value);return new Date(this.endInput.value)<=e&&(this.endGroup.classList.add("has-error"),t=!1),t}save(){if(!this.validate())return;const t={title:this.titleInput.value.trim(),start:new Date(this.startInput.value),end:new Date(this.endInput.value),backgroundColor:this._formData.color};this.emit("save",t),this.close()}formatDateForInput(t){const e=o=>String(o).padStart(2,"0"),r=t.getFullYear(),i=e(t.getMonth()+1),n=e(t.getDate()),s=e(t.getHours()),a=e(t.getMinutes());return`${r}-${i}-${n}T${s}:${a}`}unmount(){this._cleanupFocusTrap&&this._cleanupFocusTrap(),this._handleKeyDown&&(window.removeEventListener("keydown",this._handleKeyDown),this._handleKeyDown=null,this._keydownListenerAdded=!1)}}customElements.get("forcecal-event-form")||customElements.define("forcecal-event-form",I);const b=class b extends v{static get observedAttributes(){return["view","date","locale","timezone","week-starts-on","height"]}constructor(){super(),this.stateManager=null,this.currentView=null,this._hasRendered=!1,this._busUnsubscribers=[]}initialize(){const t={view:this.getAttribute("view")||"month",date:this.getAttribute("date")?new Date(this.getAttribute("date")):new Date,locale:this.getAttribute("locale")||"en-US",timeZone:this.getAttribute("timezone")||Intl.DateTimeFormat().resolvedOptions().timeZone,weekStartsOn:parseInt(this.getAttribute("week-starts-on")||"0")};this.stateManager=new S(t),this._stateUnsubscribe=this.stateManager.subscribe(this.handleStateChange.bind(this)),this.setupEventListeners()}setupEventListeners(){this._busUnsubscribers.forEach(r=>r()),this._busUnsubscribers=[];const t=this.stateManager.eventBus;this._busUnsubscribers.push(t.on("navigation:*",(r,i)=>{this.emit("calendar-navigate",{action:i.split(":")[1],...r})})),this._busUnsubscribers.push(t.on("view:changed",r=>{this.emit("calendar-view-change",r)}));const e=(r,i)=>{this.emit(`calendar-event-${r}`,i)};this._busUnsubscribers.push(t.on("event:add",r=>{e("add",r)})),this._busUnsubscribers.push(t.on("event:update",r=>{e("update",r)})),this._busUnsubscribers.push(t.on("event:remove",r=>{e("remove",r)})),this._busUnsubscribers.push(t.on("event:added",r=>{this.emit("calendar-event-added",r)})),this._busUnsubscribers.push(t.on("event:updated",r=>{this.emit("calendar-event-updated",r)})),this._busUnsubscribers.push(t.on("event:deleted",r=>{this.emit("calendar-event-deleted",r)})),this._busUnsubscribers.push(t.on("date:selected",r=>{this.emit("calendar-date-select",r)}))}handleStateChange(t,e){var o,c;if(!this._hasRendered)return;const r=t.view!==(e==null?void 0:e.view),i=((o=t.currentDate)==null?void 0:o.getTime())!==((c=e==null?void 0:e.currentDate)==null?void 0:c.getTime()),n=t.events!==(e==null?void 0:e.events),s=t.loading!==(e==null?void 0:e.loading);if(t.error!==(e==null?void 0:e.error)){this.render();return}if(s){this._updateLoadingState(t.loading);return}r&&(this.currentView=t.view),r?(this._updateTitle(),this._updateViewButtons(),this._switchView()):i?(this._updateTitle(),this._updateViewContent()):n&&this._updateViewContent()}_updateTitle(){const t=this.$(".fc-title");if(t){const e=this.stateManager.getState();t.textContent=this.getTitle(e.currentDate,e.view)}}_updateViewButtons(){const t=this.stateManager.getState();this.$$("[data-view]").forEach(e=>{const r=e.dataset.view===t.view;e.classList.toggle("active",r)})}_switchView(){const t=this.$("#calendar-view-container");if(t){this._currentViewInstance&&this._currentViewInstance.cleanup&&this._currentViewInstance.cleanup();try{const e=b.RENDERERS[this.currentView]||k,r=new e(t,this.stateManager);r._viewType=this.currentView,this._currentViewInstance=r,r.render()}catch(e){console.error("[ForceCalendar] Error switching view:",e)}}}_updateViewContent(){this._currentViewInstance&&this._currentViewInstance.render&&this._currentViewInstance.render()}_updateLoadingState(t){const e=this.$(".fc-loading"),r=this.$(".fc-view-container");e&&(e.style.display=t?"flex":"none"),r&&(r.style.display=t?"none":"flex")}mount(){this.currentView=this.stateManager.getView(),super.mount()}loadView(t){!t||this.currentView===t||(this.currentView=t,this._switchView(),this._updateViewButtons(),this._updateTitle())}getStyles(){const t=this.getAttribute("height")||"800px";return`
618
+ `}afterRender(){this.modalContent=this.$(".modal-content"),this.titleInput=this.$("#event-title"),this.startInput=this.$("#event-start"),this.endInput=this.$("#event-end"),this.colorContainer=this.$("#color-picker"),this.titleGroup=this.$("#title-group"),this.endGroup=this.$("#end-group"),this.addListener(this.$("#close-x"),"click",()=>this.close()),this.addListener(this.$("#cancel-btn"),"click",()=>this.close()),this.addListener(this.$("#save-btn"),"click",()=>this.save()),this.colorContainer.querySelectorAll(".color-btn").forEach(t=>{this.addListener(t,"click",e=>{this._formData.color=e.currentTarget.dataset.color,this.updateColorSelection()})}),this.addListener(this,"click",t=>{t.target===this&&this.close()}),this._keydownListenerAdded||(this._handleKeyDown=t=>{t.key==="Escape"&&this.hasAttribute("open")&&this.close()},window.addEventListener("keydown",this._handleKeyDown),this._keydownListenerAdded=!0)}updateColorSelection(){this.colorContainer.querySelectorAll(".color-btn").forEach(e=>{const r=e.dataset.color===this._formData.color;e.classList.toggle("selected",r),e.setAttribute("aria-checked",r?"true":"false")})}open(t=new Date){this.hasAttribute("open")||this.setAttribute("open",""),this.titleGroup.classList.remove("has-error"),this.endGroup.classList.remove("has-error"),this._formData.start=t,this._formData.end=new Date(t.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&&this._cleanupFocusTrap(),this._cleanupFocusTrap=w.trapFocus(this.modalContent))}close(){this.removeAttribute("open"),this._cleanupFocusTrap&&(this._cleanupFocusTrap(),this._cleanupFocusTrap=null)}validate(){let t=!0;this.titleGroup.classList.remove("has-error"),this.endGroup.classList.remove("has-error"),this.titleInput.value.trim()||(this.titleGroup.classList.add("has-error"),t=!1);const e=new Date(this.startInput.value);return new Date(this.endInput.value)<=e&&(this.endGroup.classList.add("has-error"),t=!1),t}save(){if(!this.validate())return;const t={title:this.titleInput.value.trim(),start:new Date(this.startInput.value),end:new Date(this.endInput.value),backgroundColor:this._formData.color};this.emit("save",t),this.close()}formatDateForInput(t){const e=o=>String(o).padStart(2,"0"),r=t.getFullYear(),i=e(t.getMonth()+1),n=e(t.getDate()),s=e(t.getHours()),a=e(t.getMinutes());return`${r}-${i}-${n}T${s}:${a}`}unmount(){this._cleanupFocusTrap&&this._cleanupFocusTrap(),this._handleKeyDown&&(window.removeEventListener("keydown",this._handleKeyDown),this._handleKeyDown=null,this._keydownListenerAdded=!1)}}customElements.get("forcecal-event-form")||customElements.define("forcecal-event-form",V);const b=class b extends v{static get observedAttributes(){return["view","date","locale","timezone","week-starts-on","height"]}constructor(){super(),this.stateManager=null,this.currentView=null,this._hasRendered=!1,this._busUnsubscribers=[]}initialize(){const t={view:this.getAttribute("view")||"month",date:this.getAttribute("date")?new Date(this.getAttribute("date")):new Date,locale:this.getAttribute("locale")||"en-US",timeZone:this.getAttribute("timezone")||Intl.DateTimeFormat().resolvedOptions().timeZone,weekStartsOn:parseInt(this.getAttribute("week-starts-on")||"0")};this.stateManager=new S(t),this._stateUnsubscribe=this.stateManager.subscribe(this.handleStateChange.bind(this)),this.setupEventListeners()}setupEventListeners(){this._busUnsubscribers.forEach(r=>r()),this._busUnsubscribers=[];const t=this.stateManager.eventBus;this._busUnsubscribers.push(t.on("navigation:*",(r,i)=>{this.emit("calendar-navigate",{action:i.split(":")[1],...r})})),this._busUnsubscribers.push(t.on("view:changed",r=>{this.emit("calendar-view-change",r)}));const e=(r,i)=>{this.emit(`calendar-event-${r}`,i)};this._busUnsubscribers.push(t.on("event:add",r=>{e("add",r)})),this._busUnsubscribers.push(t.on("event:update",r=>{e("update",r)})),this._busUnsubscribers.push(t.on("event:remove",r=>{e("remove",r)})),this._busUnsubscribers.push(t.on("event:added",r=>{this.emit("calendar-event-added",r)})),this._busUnsubscribers.push(t.on("event:updated",r=>{this.emit("calendar-event-updated",r)})),this._busUnsubscribers.push(t.on("event:deleted",r=>{this.emit("calendar-event-deleted",r)})),this._busUnsubscribers.push(t.on("date:selected",r=>{this.emit("calendar-date-select",r)}))}handleStateChange(t,e){var o,c;if(!this._hasRendered)return;const r=t.view!==(e==null?void 0:e.view),i=((o=t.currentDate)==null?void 0:o.getTime())!==((c=e==null?void 0:e.currentDate)==null?void 0:c.getTime()),n=t.events!==(e==null?void 0:e.events),s=t.loading!==(e==null?void 0:e.loading);if(t.error!==(e==null?void 0:e.error)){this.render();return}if(s){this._updateLoadingState(t.loading);return}r&&(this.currentView=t.view),r?(this._updateTitle(),this._updateViewButtons(),this._switchView()):i?(this._updateTitle(),this._updateViewContent()):n&&this._updateViewContent()}_updateTitle(){const t=this.$(".fc-title");if(t){const e=this.stateManager.getState();t.textContent=this.getTitle(e.currentDate,e.view)}}_updateViewButtons(){const t=this.stateManager.getState();this.$$("[data-view]").forEach(e=>{const r=e.dataset.view===t.view;e.classList.toggle("active",r)})}_switchView(){const t=this.$("#calendar-view-container");if(t){this._currentViewInstance&&this._currentViewInstance.cleanup&&this._currentViewInstance.cleanup();try{const e=b.RENDERERS[this.currentView]||k,r=new e(t,this.stateManager);r._viewType=this.currentView,this._currentViewInstance=r,r.render()}catch(e){console.error("[ForceCalendar] Error switching view:",e)}}}_updateViewContent(){this._currentViewInstance&&this._currentViewInstance.render&&this._currentViewInstance.render()}_updateLoadingState(t){const e=this.$(".fc-loading"),r=this.$(".fc-view-container");e&&(e.style.display=t?"flex":"none"),r&&(r.style.display=t?"none":"flex")}mount(){this.currentView=this.stateManager.getView(),super.mount()}loadView(t){!t||this.currentView===t||(this.currentView=t,this._switchView(),this._updateViewButtons(),this._updateTitle())}getStyles(){const t=this.getAttribute("height")||"800px";return`
619
619
  ${u.getBaseStyles()}
620
620
  ${u.getButtonStyles()}
621
621
  ${u.getGridStyles()}
@@ -1064,5 +1064,5 @@
1064
1064
  <svg class="fc-icon" viewBox="0 0 24 24">
1065
1065
  <path 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 16H5V8h14v11zM7 10h5v5H7z"/>
1066
1066
  </svg>
1067
- `}[t]||""}addEvent(t){return this.stateManager.addEvent(t)}updateEvent(t,e){return this.stateManager.updateEvent(t,e)}deleteEvent(t){return this.stateManager.deleteEvent(t)}getEvents(){return this.stateManager.getEvents()}setView(t){this.stateManager.setView(t)}setDate(t){this.stateManager.setDate(t)}next(){this.stateManager.next()}previous(){this.stateManager.previous()}today(){this.stateManager.today()}unmount(){this.destroy()}destroy(){this._busUnsubscribers.forEach(t=>t()),this._busUnsubscribers=[],this._stateUnsubscribe&&(this._stateUnsubscribe(),this._stateUnsubscribe=null),this._currentViewInstance&&this._currentViewInstance.cleanup&&(this._currentViewInstance.cleanup(),this._currentViewInstance=null),this.stateManager&&this.stateManager.destroy(),super.cleanup()}};x(b,"RENDERERS",{month:k,week:T,day:F});let E=b;customElements.get("forcecal-main")||customElements.define("forcecal-main",E),l.BaseComponent=v,l.BaseViewRenderer=D,l.DOMUtils=w,l.DateUtils=p,l.DayViewRenderer=F,l.EventBus=$,l.ForceCalendar=E,l.MonthViewRenderer=k,l.StateManager=S,l.StyleUtils=u,l.WeekViewRenderer=T,l.eventBus=V,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
1067
+ `}[t]||""}addEvent(t){return this.stateManager.addEvent(t)}updateEvent(t,e){return this.stateManager.updateEvent(t,e)}deleteEvent(t){return this.stateManager.deleteEvent(t)}getEvents(){return this.stateManager.getEvents()}setView(t){this.stateManager.setView(t)}setDate(t){this.stateManager.setDate(t)}next(){this.stateManager.next()}previous(){this.stateManager.previous()}today(){this.stateManager.today()}unmount(){this.destroy()}destroy(){this._busUnsubscribers.forEach(t=>t()),this._busUnsubscribers=[],this._stateUnsubscribe&&(this._stateUnsubscribe(),this._stateUnsubscribe=null),this._currentViewInstance&&this._currentViewInstance.cleanup&&(this._currentViewInstance.cleanup(),this._currentViewInstance=null),this.stateManager&&this.stateManager.destroy(),super.cleanup()}};x(b,"RENDERERS",{month:k,week:C,day:F});let E=b;customElements.get("forcecal-main")||customElements.define("forcecal-main",E),l.BaseComponent=v,l.BaseViewRenderer=D,l.DOMUtils=w,l.DateUtils=p,l.DayViewRenderer=F,l.EventBus=$,l.ForceCalendar=E,l.MonthViewRenderer=k,l.StateManager=S,l.StyleUtils=u,l.WeekViewRenderer=C,l.eventBus=L,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
1068
1068
  //# sourceMappingURL=force-calendar-interface.umd.js.map