@innosolutions/inno-calendar 1.0.49 → 1.0.50

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.
Files changed (57) hide show
  1. package/AGENT.md +1288 -359
  2. package/dist/agenda-widget-WpqvlAJP.cjs +2 -0
  3. package/dist/agenda-widget-WpqvlAJP.cjs.map +1 -0
  4. package/dist/{agenda-widget-DhCPt2vI.js → agenda-widget-ssrwyMvF.js} +1245 -1182
  5. package/dist/agenda-widget-ssrwyMvF.js.map +1 -0
  6. package/dist/components/event/event-card.d.ts +21 -2
  7. package/dist/components/event/event-card.d.ts.map +1 -1
  8. package/dist/components/header/calendar-header.d.ts +10 -2
  9. package/dist/components/header/calendar-header.d.ts.map +1 -1
  10. package/dist/components/index.cjs +1 -1
  11. package/dist/components/index.d.ts +1 -1
  12. package/dist/components/index.d.ts.map +1 -1
  13. package/dist/components/index.mjs +49 -35
  14. package/dist/components/inno-calendar.d.ts +45 -2
  15. package/dist/components/inno-calendar.d.ts.map +1 -1
  16. package/dist/components/ui/dialog.d.ts +35 -0
  17. package/dist/components/ui/dialog.d.ts.map +1 -0
  18. package/dist/components/ui/index.d.ts +2 -0
  19. package/dist/components/ui/index.d.ts.map +1 -1
  20. package/dist/components/ui/sheet.d.ts +35 -0
  21. package/dist/components/ui/sheet.d.ts.map +1 -0
  22. package/dist/components/views/timeline-view.d.ts +10 -1
  23. package/dist/components/views/timeline-view.d.ts.map +1 -1
  24. package/dist/core/context/drag-drop-context.d.ts +7 -1
  25. package/dist/core/context/drag-drop-context.d.ts.map +1 -1
  26. package/dist/core/index.cjs +1 -1
  27. package/dist/core/index.d.ts +1 -1
  28. package/dist/core/index.d.ts.map +1 -1
  29. package/dist/core/index.mjs +1 -1
  30. package/dist/core/types.d.ts +81 -0
  31. package/dist/core/types.d.ts.map +1 -1
  32. package/dist/index.cjs +1 -1
  33. package/dist/index.mjs +206 -192
  34. package/dist/presets/index.cjs +1 -1
  35. package/dist/presets/index.mjs +1 -1
  36. package/dist/{slot-selection-context-D1495hEJ.js → slot-selection-context-BwghpxKA.js} +233 -231
  37. package/dist/slot-selection-context-BwghpxKA.js.map +1 -0
  38. package/dist/slot-selection-context-CHSaOPWP.cjs +2 -0
  39. package/dist/slot-selection-context-CHSaOPWP.cjs.map +1 -0
  40. package/dist/{tailwind-calendar-BmJa4HhQ.js → tailwind-calendar-Ctfffnbn.js} +2 -2
  41. package/dist/{tailwind-calendar-BmJa4HhQ.js.map → tailwind-calendar-Ctfffnbn.js.map} +1 -1
  42. package/dist/{tailwind-calendar-CJmOutn1.cjs → tailwind-calendar-Gy1Uc9ZK.cjs} +2 -2
  43. package/dist/{tailwind-calendar-CJmOutn1.cjs.map → tailwind-calendar-Gy1Uc9ZK.cjs.map} +1 -1
  44. package/dist/week-view-ITRsM6y1.cjs +11 -0
  45. package/dist/week-view-ITRsM6y1.cjs.map +1 -0
  46. package/dist/{week-view-aRPB2cjn.js → week-view-vnIcmoVr.js} +1564 -1405
  47. package/dist/week-view-vnIcmoVr.js.map +1 -0
  48. package/package.json +2 -1
  49. package/dist/agenda-widget-B-AVTnqM.cjs +0 -2
  50. package/dist/agenda-widget-B-AVTnqM.cjs.map +0 -1
  51. package/dist/agenda-widget-DhCPt2vI.js.map +0 -1
  52. package/dist/slot-selection-context-BCsC7WT7.cjs +0 -2
  53. package/dist/slot-selection-context-BCsC7WT7.cjs.map +0 -1
  54. package/dist/slot-selection-context-D1495hEJ.js.map +0 -1
  55. package/dist/week-view-D19YRBQC.cjs +0 -11
  56. package/dist/week-view-D19YRBQC.cjs.map +0 -1
  57. package/dist/week-view-aRPB2cjn.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ "use strict";const e=require("react/jsx-runtime"),ue=require("./use-calendar-BEuelmSu.cjs"),v=require("react"),d=require("./index-D2U2F80P.cjs"),f=require("./week-view-ITRsM6y1.cjs"),ce=require("./slot-selection-context-CHSaOPWP.cjs"),U=require("./utils.cjs");function We({view:t,className:s=""}){return e.jsx("div",{className:s,style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"400px",backgroundColor:"#f9fafb",borderRadius:"0.5rem",border:"1px dashed #d1d5db"},children:e.jsxs("div",{style:{textAlign:"center",color:"#6b7280"},children:[e.jsxs("p",{style:{fontSize:"1.125rem",fontWeight:500},children:[t.charAt(0).toUpperCase()+t.slice(1)," View"]}),e.jsx("p",{style:{fontSize:"0.875rem"},children:"Implementation pending"})]})})}function ve({view:t,className:s}){return e.jsx(We,{view:t,className:s})}function Ae(t){const{events:s,resources:r,scheduleTypes:n,initialView:o="week",initialDate:i,initialFilters:m,preferences:h,locale:a,slots:g,renderEvent:y,onViewChange:p,onDateChange:H,onEventClick:A,onSlotSelect:E,onFiltersChange:F,className:I,children:C}=t,L=ue.useOptionalCalendarContext();if(L)return e.jsx("div",{className:I,style:{position:"relative"},children:C??e.jsx(ve,{view:L.view,className:I})});const R=ue.useCalendar({events:s,resources:r,scheduleTypes:n,initialView:o,initialDate:i,initialFilters:m,preferences:h,locale:a,onViewChange:p,onDateChange:H,onEventClick:A,onSlotSelect:E,onFiltersChange:F});return e.jsx(ue.CalendarProvider,{value:R,children:e.jsx("div",{className:I,style:{position:"relative"},children:C??e.jsx(ve,{view:R.view,className:I})})})}function Pe({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}),e.jsx("path",{d:"m15 5 4 4"})]})}function Le({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M3 6h18"}),e.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}),e.jsx("line",{x1:"10",x2:"10",y1:"11",y2:"17"}),e.jsx("line",{x1:"14",x2:"14",y1:"11",y2:"17"})]})}function xe({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M18 6 6 18"}),e.jsx("path",{d:"m6 6 12 12"})]})}function Oe({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"m4.9 4.9 14.2 14.2"})]})}function ae({className:t}){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:e.jsx("path",{d:"M20 6 9 17l-5-5"})})}function Be({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"m9 12 2 2 4-4"})]})}function _e({className:t}){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:e.jsx("path",{d:"m6 9 6 6 6-6"})})}function Re({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"}),e.jsx("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})}function $e({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0"}),e.jsx("circle",{cx:"12",cy:"10",r:"3"})]})}function Ve({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M8 2v4"}),e.jsx("path",{d:"M16 2v4"}),e.jsx("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),e.jsx("path",{d:"M3 10h18"})]})}function Ue({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),e.jsx("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),e.jsx("path",{d:"M10 9H8"}),e.jsx("path",{d:"M16 13H8"}),e.jsx("path",{d:"M16 17H8"})]})}function ne({className:t}){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:d.cn("animate-spin",t),children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})}const Ye={edit:"Edit",delete:"Delete",cancel:"Cancel Event",close:"Close",going:"Going",notGoing:"Not Going",confirmMeeting:"Confirm meeting took place",completed:"Completed",canceled:"Canceled",participants:"Participants",guest:"guest",guests:"guests",confirmed:"confirmed",organizer:"Organizer",client:"Client",more:"more",noDateProvided:"No date provided",eventNotFound:"Event not found",cancellationNote:"Cancellation Note",canceledOn:"Canceled on",acceptThisEvent:"Accept this event only",acceptAllEvents:"Accept all events",deleteConfirmTitle:"Delete Event",deleteConfirmDescription:"Are you sure you want to delete this event? This action cannot be undone."},le=v.forwardRef(({onClick:t,label:s,children:r,className:n,variant:o="ghost",...i},m)=>e.jsxs(f.Tooltip,{children:[e.jsx(f.TooltipTrigger,{asChild:!0,children:e.jsx("button",{type:"button",ref:m,onClick:t,className:d.cn("h-8 w-8 rounded-full flex items-center justify-center transition-colors",o==="ghost"&&"hover:bg-zinc-100 dark:hover:bg-zinc-800 text-zinc-600 dark:text-zinc-400",o==="destructive"&&"hover:bg-red-50 dark:hover:bg-red-950/30 text-zinc-600 dark:text-zinc-400 hover:text-red-600",n),"aria-label":s,...i,children:r})}),e.jsx(f.TooltipContent,{side:"bottom",className:"text-xs",children:s})]}));le.displayName="IconButton";function Ge({src:t,alt:s,initials:r,className:n,isClient:o}){const[i,m]=v.useState(!1);return e.jsx("div",{className:d.cn("relative h-7 w-7 rounded-full overflow-hidden shrink-0",n),children:t&&!i?e.jsx("img",{src:t,alt:s,className:"h-full w-full object-cover",onError:()=>m(!0)}):e.jsx("div",{className:d.cn("h-full w-full flex items-center justify-center text-[10px] font-medium",o?"bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300":"bg-zinc-200 dark:bg-zinc-700 text-zinc-700 dark:text-zinc-300"),children:r})})}function we({participant:t,isEventCanceled:s=!1,labels:r}){const n=t.name||"Unknown",o=n.split(" ").map(H=>H[0]).join("").toUpperCase().slice(0,2),i=t.isOrganizer??!1,m=t.isConfirmed,h=m===!0,a=m===!1,g=t.isClient??!1,y=t.profilePicture||t.avatar,p=s;return e.jsxs("div",{className:d.cn("flex items-center gap-3 py-0",p&&"opacity-60"),children:[e.jsxs("div",{className:"relative",children:[e.jsx(Ge,{src:y,alt:n,initials:o,isClient:g,className:d.cn(p&&"grayscale")}),p||a?e.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center",children:e.jsx("div",{className:"h-3 w-3 rounded-full bg-red-100 dark:bg-red-900/50 flex items-center justify-center",children:e.jsx(xe,{className:"h-2 w-2 text-red-600 dark:text-red-400 stroke-[3]"})})}):h?e.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-white dark:bg-zinc-900 flex items-center justify-center",children:e.jsx("div",{className:"h-3 w-3 rounded-full bg-green-100 dark:bg-green-900/50 flex items-center justify-center",children:e.jsx(ae,{className:"h-2 w-2 text-green-600 dark:text-green-400 stroke-[3]"})})}):null]}),e.jsxs("div",{className:"!h-fit min-w-0 gap-0",children:[e.jsx("div",{className:"gap-0",children:e.jsx("span",{className:d.cn("text-sm text-zinc-900 dark:text-zinc-100 truncate",p&&"line-through text-zinc-500 dark:text-zinc-500"),children:n})}),g&&e.jsx("div",{className:"text-[10px] px-1.5 w-fit py-0.5 rounded bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300 font-medium",children:r.client}),i&&!p&&e.jsx("div",{className:"text-xs text-zinc-500",children:r.organizer})]})]})}function qe({open:t,onOpenChange:s,title:r,children:n}){return v.useEffect(()=>{if(!t)return;const o=i=>{i.key==="Escape"&&s(!1)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[t,s]),v.useEffect(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[t]),t?e.jsxs("div",{className:"fixed inset-0 z-50",children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>s(!1),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&s(!1)}}),e.jsx("div",{className:"fixed inset-x-4 top-[50%] translate-y-[-50%] max-w-md mx-auto",children:e.jsxs("div",{className:"bg-white dark:bg-zinc-900 rounded-2xl shadow-xl overflow-hidden",children:[r&&e.jsx("div",{className:"sr-only",children:r}),n]})})]}):null}function Ke({open:t,onOpenChange:s,title:r,description:n,cancelLabel:o,confirmLabel:i,onConfirm:m,isLoading:h}){return t?e.jsxs("div",{className:"fixed inset-0 z-[60]",children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>s(!1),onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&s(!1)}}),e.jsx("div",{className:"fixed inset-x-4 top-[50%] translate-y-[-50%] max-w-md mx-auto",children:e.jsxs("div",{className:"bg-white dark:bg-zinc-900 rounded-lg shadow-xl p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-zinc-900 dark:text-zinc-100",children:r}),e.jsx("p",{className:"mt-2 text-sm text-zinc-600 dark:text-zinc-400",children:n}),e.jsxs("div",{className:"mt-4 flex justify-end gap-3",children:[e.jsx(f.Button,{variant:"outline",size:"sm",onClick:()=>s(!1),children:o}),e.jsxs(f.Button,{variant:"destructive",size:"sm",onClick:m,disabled:h,children:[h&&e.jsx(ne,{className:"h-4 w-4 mr-2"}),e.jsx(Le,{className:"h-4 w-4 mr-2"}),i]})]})]})})]}):null}function Je(t,s){return t.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric"})}function Xe(t,s){const r={hour:"2-digit",minute:"2-digit",hour12:!1};return`${t.toLocaleTimeString(void 0,r)} – ${s.toLocaleTimeString(void 0,r)}`}function Qe(t){return t.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})}function Ze(t){const[s,r]=v.useState(()=>typeof window<"u"?window.matchMedia(t).matches:!1);return v.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia(t),o=i=>r(i.matches);return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[t]),s}function be({event:t,labels:s,isLoading:r,onClose:n,onEdit:o,onDelete:i,onCancel:m,onAccept:h,onDecline:a,onConfirmMeeting:g,canEdit:y=!0,canDelete:p=!1,canCancel:H=!0,isCurrentUserParticipant:A=!1,isCurrentUserClient:E=!1,currentUserAcceptStatus:F,isAcceptLoading:I=!1,isDeclineLoading:C=!1,isConfirmLoading:L=!1,isDeleteLoading:R=!1,renderParticipant:G,renderHeaderActions:w,renderCancelReason:W,renderDeleteConfirmation:P,formatDate:$=Je,formatTimeRange:K=Xe}){const[J,Y]=v.useState(!1),O=!(t.isCanceled||t.meetingTookPlace),x=t.isRecurring??!1,b=t.participantDetails,S=t.participantsNames||[],B=b&&b.length>0,z=F===!0,Q=F===!1,te=A&&!E&&O,l=B?b.filter(V=>V.isConfirmed).length:t.isAccepted?S.length:0,u=B?b.length:S.length,j=t.scheduleTypeColor||t.hexColor||"#039BE5",T=v.useCallback(()=>t.startDate?$(t.startDate):s.noDateProvided,[t.startDate,$,s.noDateProvided]),k=v.useCallback(()=>t.startDate&&t.endDate?K(t.startDate,t.endDate):null,[t.startDate,t.endDate,K]),D=()=>{n(),o?.(t)},M=()=>{n(),m?.(t)},X=()=>{Y(!0)},Z=()=>{i?.(t),Y(!1)};return r?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(ne,{className:"h-6 w-6 text-zinc-400"})}):e.jsxs(f.TooltipProvider,{delayDuration:300,children:[e.jsxs("div",{className:"flex flex-col gap-0.5 p-3",children:[e.jsx("div",{className:"flex items-start justify-end gap-0.5",children:w?w({onClose:n}):e.jsxs(e.Fragment,{children:[O&&y&&o&&e.jsx(le,{onClick:D,label:s.edit,children:e.jsx(Pe,{className:"h-[18px] w-[18px]"})}),O&&H&&m&&e.jsx(le,{onClick:M,label:s.cancel,children:e.jsx(Oe,{className:"h-[18px] w-[18px]"})}),p&&i&&e.jsx(le,{onClick:X,label:s.delete,variant:"destructive",children:e.jsx(Le,{className:"h-[18px] w-[18px]"})}),e.jsx(le,{onClick:n,label:s.close,children:e.jsx(xe,{className:"h-[18px] w-[18px]"})})]})}),e.jsx("div",{children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("div",{className:"w-4 h-4 rounded mt-1 shrink-0",style:{backgroundColor:j}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h2",{className:d.cn("text-[22px] font-normal text-zinc-900 dark:text-zinc-100 leading-tight",t.isCanceled&&"line-through opacity-60"),children:t.title}),t.meetingTookPlace&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 text-xs font-medium",children:[e.jsx(Be,{className:"h-3 w-3"}),s.completed]}),t.isCanceled&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400 text-xs font-medium",children:[e.jsx(xe,{className:"h-3 w-3"}),s.canceled]})]}),e.jsxs("div",{className:"mt-1 text-sm text-zinc-600 dark:text-zinc-400",children:[e.jsx("span",{children:T()}),k()&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-1.5",children:"·"}),e.jsx("span",{children:k()})]})]}),x&&t.recurrenceSummary&&e.jsx("div",{className:"text-sm text-zinc-500 dark:text-zinc-500",children:t.recurrenceSummary})]})]})}),t.isCanceled&&e.jsx("div",{className:"mx-4 p-3 rounded-lg bg-red-50 dark:bg-red-950/30",children:W?W(t):e.jsx("div",{className:"flex items-start gap-0",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-red-700 dark:text-red-400",children:s.cancellationNote}),t.cancelReason&&e.jsxs("div",{className:"mt-1 text-sm text-red-600/80 dark:text-red-400/80 italic",children:['"',t.cancelReason,'"']}),t.canceledDate&&e.jsxs("div",{className:"mt-1.5 text-xs text-red-500/70 dark:text-red-400/60",children:[s.canceledOn," ",Qe(t.canceledDate)]})]})})}),e.jsxs("div",{className:"space-y-0.5",children:[t.address&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx($e,{className:"h-5 w-5 text-zinc-400 mt-0.5 shrink-0"}),e.jsx("span",{className:"text-sm text-zinc-700 dark:text-zinc-300",children:t.address})]}),(B||S.length>0)&&e.jsxs("div",{className:"flex items-start gap-2 py-0",children:[e.jsx(Re,{className:"h-5 w-5 text-zinc-400 mt-0.5 shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-0",children:[e.jsxs("span",{className:"text-sm text-zinc-900 dark:text-zinc-100 font-medium",children:[u," ",u!==1?s.guests:s.guest]}),u>0&&e.jsxs("span",{className:"text-xs text-zinc-500",children:["(",l," ",s.confirmed,")"]})]}),e.jsxs("div",{className:"mt-2 space-y-2",children:[B?b.slice(0,6).map((V,c)=>G?G(V,c):e.jsx(we,{participant:V,isEventCanceled:t.isCanceled,labels:s},V.id)):S.slice(0,6).map((V,c)=>{const N={id:String(c),name:V,email:"",isConfirmed:t.isAccepted,isOrganizer:c===0,isClient:!1};return G?G(N,c):e.jsx(we,{participant:N,isEventCanceled:t.isCanceled,labels:s},V)}),u>6&&e.jsxs("div",{className:"text-xs text-zinc-500 py-1.5 pl-10",children:["+",u-6," ",s.more]})]})]})]}),t.description&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ue,{className:"h-5 w-5 text-zinc-400 mt-0.5 shrink-0"}),e.jsx("p",{className:"text-sm text-zinc-700 dark:text-zinc-300 whitespace-pre-wrap",children:t.description})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ve,{className:"h-5 w-5 text-zinc-400 mt-0.5 shrink-0"}),e.jsx("div",{className:"text-sm text-zinc-700 dark:text-zinc-300",children:B&&b.find(V=>V.isOrganizer)?.name||S[0]||"Calendar"})]})]}),te&&h&&a&&e.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-800 mt-3 py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[x?e.jsxs(f.DropdownMenu,{children:[e.jsx(f.DropdownMenuTrigger,{asChild:!0,children:e.jsxs("div",{className:"flex",children:[e.jsx(f.Button,{size:"sm",variant:"outline",className:d.cn("rounded-r-none gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",z&&"!bg-green-700 !text-white hover:!bg-green-700"),onClick:V=>{V.stopPropagation(),z||h(t)},disabled:I,children:I?e.jsx(ne,{className:"h-3.5 w-3.5"}):e.jsxs(e.Fragment,{children:[z&&e.jsx(ae,{className:"h-3.5 w-3.5"}),s.going]})}),e.jsx(f.Button,{size:"sm",variant:"outline",className:d.cn("rounded-l-none px-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",z&&"!bg-green-700 !text-white hover:!bg-green-700"),children:e.jsx(_e,{className:"h-3.5 w-3.5"})})]})}),e.jsxs(f.DropdownMenuContent,{align:"start",children:[e.jsxs(f.DropdownMenuItem,{className:d.cn("gap-1.5 h-8 !border-none !bg-green-50 text-green-800 hover:!bg-green-100",z&&"!bg-green-700 !text-white hover:!bg-green-700"),onClick:()=>h(t),children:[e.jsx(ae,{className:"h-3.5 w-3.5 mr-2 text-green-600"}),s.acceptThisEvent]}),e.jsxs(f.DropdownMenuItem,{onClick:()=>h(t),children:[e.jsx(ae,{className:"h-3.5 w-3.5 mr-2 text-green-600"}),s.acceptAllEvents]})]})]}):e.jsx(f.Button,{size:"sm",variant:"outline",className:d.cn("gap-1.5 h-8 !border-none !bg-green-100 text-green-800 hover:!bg-green-200",z&&"!bg-green-700 !text-white hover:!bg-green-700"),onClick:()=>{z||h(t)},disabled:I,children:I?e.jsx(ne,{className:"h-3.5 w-3.5"}):e.jsxs(e.Fragment,{children:[z&&e.jsx(ae,{className:"h-3.5 w-3.5"}),s.going]})}),e.jsx(f.Button,{size:"sm",variant:"outline",className:d.cn("gap-1.5 h-8 !border-none !bg-rose-100 text-rose-800 hover:!bg-rose-200",Q&&"!bg-rose-700 !text-white hover:!bg-rose-700"),onClick:()=>{Q||a(t)},disabled:C,children:C?e.jsx(ne,{className:"h-3.5 w-3.5"}):e.jsxs(e.Fragment,{children:[Q&&e.jsx(xe,{className:"h-3.5 w-3.5"}),s.notGoing]})})]})}),A&&z&&!t.meetingTookPlace&&!t.isCanceled&&g&&e.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-800 py-3",children:e.jsxs(f.Button,{size:"sm",variant:"outline",className:"w-full h-9 hover:!bg-green-100 hover:text-green-700 text-green-700 !bg-green-100 !border-none dark:text-green-400 dark:hover:bg-green-950/30",onClick:()=>g(t),disabled:L,children:[L&&e.jsx(ne,{className:"h-4 w-4 mr-2"}),s.confirmMeeting]})})]}),P?J&&P({onConfirm:Z,onCancel:()=>Y(!1),isLoading:R}):e.jsx(Ke,{open:J,onOpenChange:Y,title:s.deleteConfirmTitle,description:s.deleteConfirmDescription,cancelLabel:s.cancel,confirmLabel:s.delete,onConfirm:Z,isLoading:R})]})}function et({event:t,children:s,open:r,onOpenChange:n,isLoading:o,labels:i,onEdit:m,onDelete:h,onCancel:a,onAccept:g,onDecline:y,onConfirmMeeting:p,canEdit:H=!0,canDelete:A=!1,canCancel:E=!0,isCurrentUserParticipant:F,isCurrentUserClient:I,currentUserAcceptStatus:C,isAcceptLoading:L,isDeclineLoading:R,isConfirmLoading:G,isDeleteLoading:w,renderParticipant:W,renderHeaderActions:P,renderCancelReason:$,renderDeleteConfirmation:K,formatDate:J,formatTimeRange:Y,className:O,width:x=360}){const b=Ze("(min-width: 768px)"),S={...Ye,...i},B=v.useCallback(()=>{n?.(!1)},[n]),z={event:t,labels:S,isLoading:o,onClose:B,onEdit:m,onDelete:h,onCancel:a,onAccept:g,onDecline:y,onConfirmMeeting:p,canEdit:H,canDelete:A,canCancel:E,isCurrentUserParticipant:F,isCurrentUserClient:I,currentUserAcceptStatus:C,isAcceptLoading:L,isDeclineLoading:R,isConfirmLoading:G,isDeleteLoading:w,renderParticipant:W,renderHeaderActions:P,renderCancelReason:$,renderDeleteConfirmation:K,formatDate:J,formatTimeRange:Y};return b?e.jsxs(f.Popover,{open:r??!1,onOpenChange:n??(()=>{}),children:[e.jsx(f.PopoverTrigger,{asChild:!0,children:s}),e.jsx(f.PopoverContent,{className:d.cn("p-0 shadow-lg !rounded-2xl bg-white dark:bg-zinc-900 overflow-hidden border z-50",O),style:{width:x},align:"center",side:"bottom",sideOffset:4,children:e.jsx(be,{...z})})]}):e.jsxs(e.Fragment,{children:[s,e.jsx(qe,{open:r??!1,onOpenChange:n??(()=>{}),title:t.title,children:e.jsx(be,{...z})})]})}const me=44,ye=4,tt=56,ke=8,fe=80,ie=140,Ne=100,Ce=2,st=8,rt=18;function nt(t){return t.split(" ").map(s=>s[0]).join("").toUpperCase().slice(0,2)}function ot(t,s){const r=[];for(let n=0;n<s;n++){const o=new Date(t);o.setDate(o.getDate()+n),r.push(o)}return r}function it(t,s,r){const n=[];return t.forEach((o,i)=>{for(let m=s;m<r;m++)n.push({hour:m,dayIndex:i,date:o})}),n}function at(t){return`${t.toString().padStart(2,"0")}:00`}function lt(t){return t.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}function De(t){const s=[...t].sort((o,i)=>o.startCol!==i.startCol?o.startCol-i.startCol:i.spanCols-o.spanCols),r=[],n=[];for(const o of s){let i=0;for(;n[i]!==void 0&&n[i]>o.startCol;)i++;n[i]=o.startCol+o.spanCols,r.push({...o,stackIndex:i})}return r}function ct({src:t,alt:s,fallback:r,className:n}){return e.jsx("div",{className:d.cn("relative flex shrink-0 overflow-hidden rounded-sm border bg-muted",n),children:t?e.jsx("img",{src:t,alt:s,className:"aspect-square h-full w-full object-cover"}):e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-muted text-muted-foreground",children:r})})}const dt=7;function oe({daysToShow:t=dt,events:s,users:r=[],selectedDate:n,onDateChange:o,onEventClick:i,visibleHours:m,className:h,getEventUserId:a,renderPopover:g,slots:y,classNames:p,enableDrag:H=!0}){const A=v.useRef(null),E=ce.useOptionalDragDrop(),F=n??new Date,I=!0,C=m?.from??st,L=m?.to??rt,R=L-C,G=v.useMemo(()=>{const l=new Date(F);if(t===1||t===3)return l.setHours(0,0,0,0),l;const u=l.getDay(),j=u===0?-6:1-u;return l.setDate(l.getDate()+j),l.setHours(0,0,0,0),l},[F,t]),w=v.useMemo(()=>ot(G,t),[G,t]),W=v.useMemo(()=>it(w,C,L),[I,w,C,L]),$=a??(l=>{if(l.resourceId)return l.resourceId;const u=l.data;if(u?.userId)return String(u.userId);if(u?.user&&typeof u.user=="object"&&u.user.id)return String(u.user.id);if(l.user?.id)return l.user.id;if(l.participants?.[0]?.id)return l.participants[0].id}),K=v.useMemo(()=>{const l=new Map;for(const u of r)l.set(u.id,{id:u.id,name:u.name,avatar:u.avatar??void 0,email:u.email});for(const u of s){const T=u.data?.user;T?.id&&!l.has(T.id)&&l.set(T.id,{id:T.id,name:T.name??"",avatar:T.avatar??void 0,email:T.email}),u.user?.id&&!l.has(u.user.id)&&l.set(u.user.id,{id:u.user.id,name:u.user.name,avatar:u.user.avatar??void 0,email:u.user.email});for(const k of u.participants||[])k.id&&!l.has(k.id)&&l.set(k.id,{id:k.id,name:k.name,avatar:k.avatar??void 0,email:k.email})}return Array.from(l.values())},[r,s]),J=v.useMemo(()=>{const l=[],u=new Map;for(const k of K)u.set(k.id,[]);u.set("unassigned",[]);for(const k of s){const D=$(k)??"unassigned";(u.get(D)??u.get("unassigned")).push(k)}const j=k=>{const D=[];for(const M of k){const X=M.startDate.getHours()+M.startDate.getMinutes()/60,Z=M.endDate.getHours()+M.endDate.getMinutes()/60;for(let V=0;V<w.length;V++){const c=w[V],N=U.startOfDay(c),_=U.endOfDay(c);if(M.startDate<=_&&M.endDate>=N){let q=C,ee=L;if(M.startDate>=N&&(q=Math.max(C,X)),M.endDate<=_&&(ee=Math.min(L,Z)),q=Math.max(C,Math.min(L,q)),ee=Math.max(C,Math.min(L,ee)),ee>q){const de=V*R+Math.floor(q-C),he=V*R+Math.ceil(ee-C);D.push({event:M,startCol:de,spanCols:Math.max(1,he-de)})}}}}return D};for(const k of K){const D=u.get(k.id)??[],M=j(D),X=De(M),Z=X.reduce((V,c)=>Math.max(V,c.stackIndex+1),0);l.push({user:k,events:X,maxStack:Math.max(Z,1)})}const T=u.get("unassigned")??[];if(T.length>0){const k=j(T),D=De(k),M=D.reduce((X,Z)=>Math.max(X,Z.stackIndex+1),0);l.push({user:{id:"unassigned",name:"Unassigned",avatar:void 0,email:void 0},events:D,maxStack:Math.max(M,1)})}return l.filter(k=>k.events.length>0)},[K,s,w,I,R,C,L,$]),Y=v.useMemo(()=>{const l=new Map;for(const u of J)for(const j of u.events)if(j.spanCols===1){const T=l.get(j.startCol)??0;l.set(j.startCol,T+1)}return l},[J]),O=v.useMemo(()=>{const l=W.length,u=fe,j=[];for(let T=0;T<l;T++){const k=Y.get(T)??0;k>Ce?j.push(Ne+(k-Ce)*20):k>0?j.push(Math.max(u,Ne)):j.push(u)}return j},[I,W.length,w.length,Y]),x=l=>Math.max(tt,l*(me+ye)+ke*2),b=ie+O.reduce((l,u)=>l+u,0),S=v.useMemo(()=>{const l=[0];for(let u=0;u<O.length;u++)l.push(l[u]+O[u]);return l},[O]);v.useLayoutEffect(()=>{const l=A.current;if(!l)return;const u=()=>{let j=-1;const k=new Date().getHours();{for(let D=0;D<W.length;D++){const M=W[D];if(M&&U.isToday(M.date)&&M.hour<=k&&M.hour+1>k){j=D;break}}if(j===-1)for(let D=0;D<W.length;D++){const M=W[D];if(M&&U.isToday(M.date)){j=D;break}}}if(j!==-1){const D=(S[j]??0)+ie,M=l.clientWidth,X=Math.max(0,D-M/3);l.scrollTo({left:X,behavior:"instant"})}};requestAnimationFrame(()=>{requestAnimationFrame(u)})},[F,W,w,S,I]);const B=v.useCallback((l,u)=>{const j=u.querySelector(".ic-timeline-grid");if(!j)return-1;const T=j.getBoundingClientRect(),k=l-T.left+j.scrollLeft;for(let D=0;D<S.length-1;D++){const M=S[D],X=S[D+1];if(k>=M&&k<X)return D}return-1},[S]),z=v.useCallback(l=>{if(W[l]){const u=W[l],j=new Date(u.date);return j.setHours(u.hour,0,0,0),{date:j,hour:u.hour}}return{date:new Date}},[I,W,w]),Q=v.useCallback((l,u)=>{if(l.preventDefault(),l.dataTransfer.dropEffect="move",!E?.isDragging)return;const j=B(l.clientX,l.currentTarget);if(j<0)return;const{date:T,hour:k}=z(j);E.updateDragPreview(T,k,void 0,u)},[E,B,z]),te=v.useCallback((l,u)=>{l.preventDefault(),E?.isDragging&&E.endDrag()},[E]);return e.jsx("div",{className:d.cn("flex h-full flex-col",h),children:e.jsx("div",{className:"ic-timeline-scroll-container flex-1",ref:A,children:e.jsxs("div",{className:"relative",style:{minWidth:b},children:[e.jsx("div",{className:"ic-timeline-header sticky top-0 z-20 border-b bg-background",children:e.jsxs("div",{className:"flex flex-col",children:[t>1&&e.jsxs("div",{className:"flex border-b",children:[e.jsx("div",{className:"flex shrink-0 items-center border-r bg-background px-2 py-1",style:{width:ie},children:e.jsx("span",{className:"text-[10px] font-medium uppercase text-muted-foreground",children:"Resources"})}),w.map((l,u)=>{const j=U.isToday(l),T=u*R,k=O.slice(T,T+R).reduce((D,M)=>D+M,0);return e.jsx("div",{className:d.cn("flex shrink-0 items-center justify-center border-r py-1.5 font-medium",j?"bg-primary/10 text-primary":"bg-muted/30"),style:{width:k},children:e.jsx("span",{className:"text-xs",children:lt(l)})},`day-${l.toISOString()}`)})]}),e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:d.cn("flex shrink-0 items-center border-r bg-background px-2 py-2",t>1&&"sticky left-0 z-10"),style:{width:ie},children:t===1&&e.jsx("span",{className:"text-[10px] font-medium uppercase text-muted-foreground",children:"Resources"})}),W.map((l,u)=>{const j=l.hour===C,T=U.isToday(l.date),k=O[u]??fe;return e.jsx("div",{className:d.cn("flex shrink-0 items-center justify-center py-1.5 text-[10px] text-muted-foreground",j&&u>0?"border-l-2 border-l-border":"border-r border-r-border/50",T&&"bg-primary/5"),style:{width:k},children:at(l.hour)},`hour-${l.dayIndex}-${l.hour}`)})]})]})}),J.map(l=>{const u=x(l.maxStack);return e.jsxs("div",{className:d.cn("relative flex border-b",p?.resourceRow),style:{height:u},children:[e.jsx("div",{className:"sticky left-0 z-10",style:{width:ie},children:e.jsxs("div",{className:d.cn("flex h-full items-center gap-2 sm:gap-3 border-r bg-background px-2 sm:px-4",p?.resourceHeader),children:[e.jsx(ct,{className:"size-7",src:l.user.avatar,alt:l.user.name,fallback:nt(l.user.name)}),e.jsx("span",{className:"truncate text-xs sm:text-sm font-medium",children:l.user.name})]})}),e.jsxs("div",{className:"ic-timeline-grid relative flex",onDragOver:j=>Q(j,l.user.id),onDrop:j=>te(j,l.user.id),children:[W.map((j,T)=>{const k=j.hour===C&&T>0,D=O[T]??fe;return e.jsx("div",{className:d.cn("shrink-0",k?"border-l-2 border-l-border":"border-r border-r-border/50",U.isToday(j.date)&&"bg-primary/5"),style:{width:D}},`cell-${j.dayIndex}-${j.hour}`)}),l.events.map(j=>{const T=(S[j.startCol]??0)+2,k=S[j.startCol+j.spanCols]??S[S.length-1]??0,D=S[j.startCol]??0,M=k-D-4,X=ke+j.stackIndex*(me+ye);return e.jsx("div",{className:"absolute",style:{left:T,width:Math.max(M,0),top:X,height:me},children:e.jsx(f.EventCard,{event:j.event,variant:"compact",enableDrag:H,onClick:i,renderPopover:g,className:d.cn("h-full w-full",p?.eventCardCompact)})},j.event.id)})]})]},l.user.id)}),J.length===0&&e.jsx("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:"No users or events to display"})]})})})}const ut=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],xt=["January","February","March","April","May","June","July","August","September","October","November","December"];function Me(t){const s=t.hexColor;return s?{backgroundColor:s}:{}}function ht({day:t,date:s,events:r,isCurrentMonth:n,onDayClick:o}){const i=U.isToday(s),m=3,h=r.length;return e.jsxs("button",{type:"button",onClick:()=>o?.(s),className:d.cn("flex h-9 sm:h-11 flex-1 flex-col items-center justify-start gap-0.5 rounded-md pt-0.5 sm:pt-1","hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","transition-colors",!n&&"opacity-40"),children:[e.jsx("div",{className:d.cn("flex size-5 sm:size-6 items-center justify-center rounded-full text-[10px] sm:text-xs font-medium",i&&"bg-primary font-semibold text-primary-foreground"),children:t}),h>0&&e.jsx("div",{className:"mt-0.5 flex items-center gap-0.5",children:h<=m?r.map(a=>e.jsx("div",{className:"size-1 sm:size-1.5 rounded-full bg-primary",style:Me(a)},a.id)):e.jsxs(e.Fragment,{children:[r.slice(0,m).map(a=>e.jsx("div",{className:"size-1 sm:size-1.5 rounded-full bg-primary",style:Me(a)},a.id)),e.jsxs("span",{className:"text-[6px] sm:text-[7px] font-medium text-muted-foreground",children:["+",h-m]})]})})]})}function mt({date:t,events:s,onMonthClick:r,onDayClick:n}){const o=v.useMemo(()=>U.generateMonthGrid(t,0),[t]);return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("button",{type:"button",onClick:()=>r?.(t),className:d.cn("w-full rounded-t-lg border px-2 sm:px-3 py-1.5 sm:py-2 text-xs sm:text-sm font-semibold","hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","transition-colors"),children:xt[t.getMonth()]}),e.jsxs("div",{className:"flex-1 space-y-1.5 sm:space-y-2 rounded-b-lg border border-t-0 p-2 sm:p-3",children:[e.jsx("div",{className:"grid grid-cols-7 gap-x-0.5 text-center",children:ut.map((i,m)=>e.jsxs("div",{className:"text-[9px] sm:text-xs font-medium text-muted-foreground",children:[e.jsx("span",{className:"sm:hidden",children:i[0]}),e.jsx("span",{className:"hidden sm:inline",children:i})]},m))}),e.jsx("div",{className:"grid grid-cols-7 gap-x-0.5 gap-y-1",children:o.map((i,m)=>{const h=U.getEventsForDay(s,i.date);return e.jsx(ht,{day:i.date.getDate(),date:i.date,events:h,isCurrentMonth:i.isCurrentMonth,onDayClick:n},`${m+1}-${i.date.toISOString()}`)})})]})]})}function Ie({events:t,year:s,onMonthClick:r,onDayClick:n,className:o,slots:i,classNames:m}){const h=v.useMemo(()=>U.getYearMonths(s),[s]);return e.jsxs("div",{className:d.cn("flex flex-col h-full",o),children:[e.jsx("div",{className:"flex items-center justify-center border-b px-4 py-3",children:e.jsx("h2",{className:"text-lg font-semibold",children:s})}),e.jsx("div",{className:"flex-1 overflow-auto p-4",children:e.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:h.map(a=>e.jsx(mt,{date:a,events:t,onMonthClick:r,onDayClick:n},a.getMonth()))})})]})}function ft(t){switch(t){case"day":case"week":return"time";default:return"day"}}function gt({onEventClick:t,onSlotClick:s,onSlotSelect:r,onAddEvent:n,className:o,showHeader:i=!0,minSelectionMinutes:m=30,showMoreMode:h,showMoreEventsInPopover:a=!1,isLoading:g=!1,slots:y,classNames:p,settingsContent:H,filterContent:A,headerActions:E,renderPopover:F,calendarRef:I,headerConfig:C,eventDetailMode:L,renderEventDetail:R}){const G=h??(a?"popover":"expand"),{view:w,setView:W,selectedDate:P,setSelectedDate:$,slotDuration:K,filteredEvents:J,users:Y,visibleHours:O,workingHours:x,badgeVariant:b,showWorkingHoursOnly:S,clearFocusEventId:B}=ce.useInnoCalendar(),z=v.useMemo(()=>{if(!S||!x)return{startHour:O.start,endHour:O.end};let c=24,N=0;for(const _ of Object.keys(x)){const q=x[Number(_)];!q||q.enabled===!1||(q.from<c&&(c=q.from),q.to>N&&(N=q.to))}return c>=N?{startHour:O.start,endHour:O.end}:{startHour:c,endHour:N}},[S,x,O]),Q=z,te=v.useRef(null);v.useImperativeHandle(I,()=>({scrollToToday:()=>{const c=new Date;$(c,w),requestAnimationFrame(()=>{requestAnimationFrame(()=>{const N=te.current?.querySelector(".ic-timeline-scroll-container, [class*='overflow-auto']");if(!N)return;const ee=(c.getHours()-z.startHour)*96;ee>0&&N.scrollTo({top:Math.max(0,ee-100),behavior:"smooth"})})})},scrollToWorkingHours:()=>{let c=8;if(x)for(const N of Object.keys(x)){const _=x[Number(N)];_?.enabled&&_.from<c&&(c=Math.max(_.from-1,0))}requestAnimationFrame(()=>{requestAnimationFrame(()=>{const N=te.current?.querySelector(".ic-timeline-scroll-container, [class*='overflow-auto']");if(!N)return;const q=(c-z.startHour)*96;N.scrollTo({top:Math.max(0,q),behavior:"smooth"})})})},getViewRect:()=>te.current?.getBoundingClientRect()??null,focusEvent:c=>{B(),requestAnimationFrame(()=>{B()});const N=te.current?.querySelector(`[data-event-id="${c}"]`);N&&setTimeout(()=>N.click(),150)}}),[$,w,z,x,B]);const l=v.useMemo(()=>ft(w),[w]),u=v.useCallback(c=>{if(r){r(c);return}if(s){const N=c.startDate.getHours();s(c.startDate,N)}},[r,s]),j=v.useCallback(c=>{W("day"),$(c,"day")},[$,W]),T=v.useCallback(c=>{W("month"),$(c,"month")},[$,W]),k=v.useCallback(c=>{t?.(c)},[t]),D=()=>{const c=J,N=k,_=F;switch(w){case"day":return e.jsx(f.DayView,{events:c,date:P,visibleHours:Q,workingHours:x,slotDuration:K,badgeVariant:b,onEventClick:N,renderPopover:_,...y&&{slots:y},...p&&{classNames:p}});case"week":return e.jsx(f.WeekView,{events:c,date:P,visibleHours:Q,workingHours:x,slotDuration:K,badgeVariant:b,onEventClick:N,renderPopover:_,...y&&{slots:y},...p&&{classNames:p}});case"month":return e.jsx(f.MonthView,{events:c,date:P,badgeVariant:b,onEventClick:N,onDayClick:j,renderPopover:_,showMoreMode:G,...y&&{slots:y},...p&&{classNames:p}});case"year":return e.jsx(Ie,{events:c,year:P.getFullYear(),onMonthClick:T,onDayClick:j,...y&&{slots:y},...p&&{classNames:p}});case"agenda":return e.jsx(f.AgendaView,{events:c,date:P,onEventClick:N,renderPopover:_,...y&&{slots:y},...p&&{classNames:p}});case"resource-day":return e.jsx(oe,{daysToShow:1,events:c,users:Y,selectedDate:P,visibleHours:{from:z.startHour,to:z.endHour},onEventClick:N,renderPopover:_,...y&&{slots:y},...p&&{classNames:p}});case"resource-week":return e.jsx(oe,{daysToShow:7,events:c,users:Y,selectedDate:P,visibleHours:{from:z.startHour,to:z.endHour},onEventClick:N,renderPopover:_,...y&&{slots:y},...p&&{classNames:p}});case"timeline-day":return e.jsx(oe,{daysToShow:1,events:c,users:Y,selectedDate:P,visibleHours:{from:z.startHour,to:z.endHour},onEventClick:N,renderPopover:_,...y&&{slots:y},...p&&{classNames:p}});case"timeline-3day":return e.jsx(oe,{daysToShow:3,events:c,users:Y,selectedDate:P,visibleHours:{from:z.startHour,to:z.endHour},onEventClick:N,renderPopover:_,...y&&{slots:y},...p&&{classNames:p}});case"timeline-week":return e.jsx(oe,{daysToShow:7,events:c,users:Y,selectedDate:P,visibleHours:{from:z.startHour,to:z.endHour},onEventClick:N,renderPopover:_,...y&&{slots:y},...p&&{classNames:p}});default:return e.jsx(f.MonthView,{events:c,date:P,badgeVariant:b,onEventClick:N,onDayClick:j,...y&&{slots:y},...p&&{classNames:p}})}},M=v.useRef(null),[X,Z]=v.useState(!1);v.useEffect(()=>{te.current=M.current}),v.useEffect(()=>{const c=M.current;if(!c)return;const N=()=>{const{scrollLeft:ee,scrollWidth:de,clientWidth:he}=c;Z(ee+he<de-4)};N(),c.addEventListener("scroll",N,{passive:!0});const _=new ResizeObserver(N);_.observe(c);const q=new MutationObserver(N);return q.observe(c,{childList:!0,subtree:!0}),()=>{c.removeEventListener("scroll",N),_.disconnect(),q.disconnect()}},[w]);const V=v.useCallback(()=>{M.current?.scrollBy({left:300,behavior:"smooth"})},[]);return e.jsx(ce.SlotSelectionProvider,{mode:l,onSelect:u,minDurationMinutes:m,slotDurationMinutes:K,enabled:!!(r||s),children:e.jsxs("div",{className:d.cn("inno-calendar-root flex flex-col h-full p-4",p?.root,o),children:[i&&e.jsx(f.CalendarHeader,{currentDate:P,view:w,events:J,onViewChange:W,onNavigateToday:()=>$(new Date,w),onNavigatePrev:()=>{const c=new Date(P);w==="day"||w==="timeline-day"||w==="resource-day"?c.setDate(c.getDate()-1):w==="timeline-3day"?c.setDate(c.getDate()-3):w==="week"||w==="timeline-week"||w==="resource-week"?c.setDate(c.getDate()-7):w==="month"?c.setMonth(c.getMonth()-1):w==="year"?c.setFullYear(c.getFullYear()-1):c.setDate(c.getDate()-7),$(c,w)},onNavigateNext:()=>{const c=new Date(P);w==="day"||w==="timeline-day"||w==="resource-day"?c.setDate(c.getDate()+1):w==="timeline-3day"?c.setDate(c.getDate()+3):w==="week"||w==="timeline-week"||w==="resource-week"?c.setDate(c.getDate()+7):w==="month"?c.setMonth(c.getMonth()+1):w==="year"?c.setFullYear(c.getFullYear()+1):c.setDate(c.getDate()+7),$(c,w)},availableViews:["day","week","month","agenda"],showTimelineViews:!0,showSettings:!!H,...!E&&n&&{onAddEvent:n},actions:E,settingsContent:H,filterContent:A,...C&&{headerConfig:C}}),e.jsxs("div",{className:"relative flex-1 min-h-0",children:[e.jsx("div",{ref:M,className:d.cn("h-full border rounded-lg bg-white overflow-x-auto",p?.viewContainer),children:D()}),g&&e.jsx("div",{className:"inno-calendar-loading-overlay",children:e.jsx("div",{className:"inno-calendar-spinner"})}),X&&e.jsx("button",{type:"button",onClick:V,className:"inno-scroll-right-btn","aria-label":"Scroll right",children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("title",{children:"Scroll right"}),e.jsx("path",{d:"m9 18 6-6-6-6"})]})})]})]})})}function pt({events:t,users:s=[],scheduleTypes:r=[],initialView:n="week",initialDate:o,initialSelectedUserId:i,initialScheduleTypeIds:m,initialParticipantIds:h,initialWorkingHoursView:a,initialSearchQuery:g,preferencesConfig:y,onEventClick:p,onSlotClick:H,onSlotSelect:A,onAddEvent:E,onEventDrop:F,onDateChange:I,onViewChange:C,className:L,showHeader:R=!0,minSelectionMinutes:G=30,showMoreMode:w,showMoreEventsInPopover:W=!1,isLoading:P=!1,renderPopover:$,slots:K,classNames:J,settingsContent:Y,filterContent:O,headerActions:x,focusEventId:b,headerConfig:S,eventDetailMode:B,renderEventDetail:z},Q){return e.jsx(ce.DragDropProvider,{...F&&{onEventDrop:F},children:e.jsx(ce.InnoCalendarProvider,{initialEvents:t,initialUsers:s,initialScheduleTypes:r,initialView:n,...o&&{initialDate:o},...i&&{initialSelectedUserId:i},...m&&{initialScheduleTypeIds:m},...h&&{initialParticipantIds:h},...a&&{initialWorkingHoursView:a},...g&&{initialSearchQuery:g},...y&&{preferencesConfig:y},...I&&{onDateChange:I},...C&&{onViewChange:C},...b&&{initialFocusEventId:b},children:e.jsx(gt,{...p&&{onEventClick:p},...H&&{onSlotClick:H},...A&&{onSlotSelect:A},...E&&{onAddEvent:E},...$&&{renderPopover:$},className:L,showHeader:R,minSelectionMinutes:G,...w&&{showMoreMode:w},showMoreEventsInPopover:W,isLoading:P,...K&&{slots:K},...J&&{classNames:J},settingsContent:Y,filterContent:O,headerActions:x,calendarRef:Q,...S&&{headerConfig:S},...B&&{eventDetailMode:B},...z&&{renderEventDetail:z}})})})}const jt=v.forwardRef(pt),re=v.forwardRef(({className:t,children:s,...r},n)=>e.jsx("select",{ref:n,className:d.cn("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm","ring-offset-background","focus:outline-none focus:ring-1 focus:ring-ring","disabled:cursor-not-allowed disabled:opacity-50","[&>option]:bg-background",t),...r,children:s}));re.displayName="Select";const se=v.forwardRef(({className:t,...s},r)=>e.jsx("label",{ref:r,className:d.cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t),...s}));se.displayName="Label";function vt({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 16v-4"}),e.jsx("path",{d:"M12 8h.01"})]})}function wt({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}const bt=[{value:15,label:"15 minutes"},{value:30,label:"30 minutes"},{value:60,label:"1 hour"}];function yt({value:t,onChange:s,isLocked:r=!1,className:n,labels:o={}}){const i={title:"Slot duration",lockedMessage:"This setting is locked by the administrator",infoMessage:"Set the time slot duration for day and week calendar views.",...o},m=h=>{r||s(Number(h.target.value))};return e.jsxs("div",{className:d.cn("flex flex-col gap-3",n),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(se,{className:"text-sm font-semibold",children:i.title}),r?e.jsx(f.TooltipProvider,{delayDuration:100,children:e.jsxs(f.Tooltip,{children:[e.jsx(f.TooltipTrigger,{children:e.jsx(wt,{className:"size-3 text-muted-foreground"})}),e.jsx(f.TooltipContent,{children:e.jsx("p",{children:i.lockedMessage})})]})}):e.jsx(f.TooltipProvider,{delayDuration:100,children:e.jsxs(f.Tooltip,{children:[e.jsx(f.TooltipTrigger,{children:e.jsx(vt,{className:"size-3 text-muted-foreground"})}),e.jsx(f.TooltipContent,{className:"max-w-64 text-center",children:e.jsx("p",{children:i.infoMessage})})]})})]}),e.jsx(re,{value:t.toString(),onChange:m,disabled:r,className:"h-9 w-[128px] text-sm",children:bt.map(h=>e.jsx("option",{value:h.value.toString(),children:h.label},h.value))})]})}function kt({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 16v-4"}),e.jsx("path",{d:"M12 8h.01"})]})}function Nt({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}const Ct=[{value:"dot",label:"Dot indicator"},{value:"colored",label:"Full color"},{value:"mixed",label:"Mixed"}];function Dt({value:t,onChange:s,isLocked:r=!1,className:n,labels:o={}}){const i={title:"Event display",lockedMessage:"This setting is locked by the administrator",infoMessage:"Choose how events are displayed. Dot shows a small indicator, colored fills the entire event, mixed uses both.",options:{dot:"Dot indicator",colored:"Full color",mixed:"Mixed"},...o},m=a=>i.options?.[a]??a,h=a=>{r||s(a.target.value)};return e.jsxs("div",{className:d.cn("flex flex-col gap-3",n),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(se,{className:"text-sm font-semibold",children:i.title}),r?e.jsx(f.TooltipProvider,{delayDuration:100,children:e.jsxs(f.Tooltip,{children:[e.jsx(f.TooltipTrigger,{children:e.jsx(Nt,{className:"size-3 text-muted-foreground"})}),e.jsx(f.TooltipContent,{children:e.jsx("p",{children:i.lockedMessage})})]})}):e.jsx(f.TooltipProvider,{delayDuration:100,children:e.jsxs(f.Tooltip,{children:[e.jsx(f.TooltipTrigger,{children:e.jsx(kt,{className:"size-3 text-muted-foreground"})}),e.jsx(f.TooltipContent,{className:"max-w-64 text-center",children:e.jsx("p",{children:i.infoMessage})})]})})]}),e.jsx(re,{value:t,onChange:h,disabled:r,className:"h-9 w-[128px] text-sm",children:Ct.map(a=>e.jsx("option",{value:a.value,children:m(a.value)},a.value))})]})}function Mt({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 16v-4"}),e.jsx("path",{d:"M12 8h.01"})]})}function Tt({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}function St(){return Array.from({length:25},(t,s)=>({value:s,label:`${String(s).padStart(2,"0")}:00`}))}function Et({value:t,onChange:s,isLocked:r=!1,className:n,labels:o={}}){const i={title:"Visible hours",from:"From",to:"To",lockedMessage:"This setting is locked by the administrator",infoMessage:"Set the visible hour range for day and week views. Hours outside this range will be hidden.",...o},m=St(),h=g=>{if(r)return;const y=Number(g.target.value);y<t.endHour&&s({...t,startHour:y})},a=g=>{if(r)return;const y=Number(g.target.value);y>t.startHour&&s({...t,endHour:y})};return e.jsxs("div",{className:d.cn("flex flex-col gap-3",n),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(se,{className:"text-sm font-semibold",children:i.title}),r?e.jsx(f.TooltipProvider,{delayDuration:100,children:e.jsxs(f.Tooltip,{children:[e.jsx(f.TooltipTrigger,{children:e.jsx(Tt,{className:"size-3 text-muted-foreground"})}),e.jsx(f.TooltipContent,{children:e.jsx("p",{children:i.lockedMessage})})]})}):e.jsx(f.TooltipProvider,{delayDuration:100,children:e.jsxs(f.Tooltip,{children:[e.jsx(f.TooltipTrigger,{children:e.jsx(Mt,{className:"size-3 text-muted-foreground"})}),e.jsx(f.TooltipContent,{className:"max-w-64 text-center",children:e.jsx("p",{children:i.infoMessage})})]})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(se,{className:"text-xs text-muted-foreground",children:i.from}),e.jsx(re,{value:t.startHour.toString(),onChange:h,disabled:r,className:"h-9 w-[88px] text-sm",children:m.map(g=>e.jsx("option",{value:g.value.toString(),disabled:g.value>=t.endHour,children:g.label},g.value))})]}),e.jsx("span",{className:"mt-5 text-muted-foreground",children:"—"}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(se,{className:"text-xs text-muted-foreground",children:i.to}),e.jsx(re,{value:t.endHour.toString(),onChange:a,disabled:r,className:"h-9 w-[88px] text-sm",children:m.map(g=>e.jsx("option",{value:g.value.toString(),disabled:g.value<=t.startHour,children:g.label},g.value))})]})]})]})}function zt({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 16v-4"}),e.jsx("path",{d:"M12 8h.01"})]})}function Ht({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}function Lt({className:t}){return e.jsx("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})})}const It=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];function Ft(){return Array.from({length:25},(t,s)=>({value:s,label:`${String(s).padStart(2,"0")}:00`}))}const Te={sunday:"Sun",monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat"};function Wt({dayLabel:t,config:s,onChange:r,disabled:n,hourOptions:o}){const i=()=>{n||r({...s,enabled:!s.enabled})},m=a=>{if(n)return;const g=Number(a.target.value);g<s.to&&r({...s,from:g})},h=a=>{if(n)return;const g=Number(a.target.value);g>s.from&&r({...s,to:g})};return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",role:"checkbox","aria-checked":s.enabled,"aria-label":`Enable ${t}`,onClick:i,disabled:n,className:d.cn("flex size-5 shrink-0 items-center justify-center rounded border transition-colors",s.enabled?"border-primary bg-primary text-primary-foreground":"border-input bg-background",n&&"cursor-not-allowed opacity-50"),children:s.enabled&&e.jsx(Lt,{className:"size-3"})}),e.jsx("span",{className:d.cn("w-10 text-sm",!s.enabled&&"text-muted-foreground"),children:t}),e.jsx(re,{value:s.from.toString(),onChange:m,disabled:n||!s.enabled,className:"h-8 w-[76px] text-xs",children:o.map(a=>e.jsx("option",{value:a.value.toString(),disabled:a.value>=s.to,children:a.label},a.value))}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"—"}),e.jsx(re,{value:s.to.toString(),onChange:h,disabled:n||!s.enabled,className:"h-8 w-[76px] text-xs",children:o.map(a=>e.jsx("option",{value:a.value.toString(),disabled:a.value<=s.from,children:a.label},a.value))})]})}function At({value:t,onChange:s,isLocked:r=!1,className:n,labels:o={}}){const i={title:"Working hours",lockedMessage:"This setting is locked by the administrator",infoMessage:"Configure working hours for each day of the week. Non-working hours will be grayed out in day and week views.",days:Te,...o},m=Ft(),h=(a,g)=>{r||s({...t,[a]:g})};return e.jsxs("div",{className:d.cn("flex flex-col gap-3",n),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(se,{className:"text-sm font-semibold",children:i.title}),r?e.jsx(f.TooltipProvider,{delayDuration:100,children:e.jsxs(f.Tooltip,{children:[e.jsx(f.TooltipTrigger,{children:e.jsx(Ht,{className:"size-3 text-muted-foreground"})}),e.jsx(f.TooltipContent,{children:e.jsx("p",{children:i.lockedMessage})})]})}):e.jsx(f.TooltipProvider,{delayDuration:100,children:e.jsxs(f.Tooltip,{children:[e.jsx(f.TooltipTrigger,{children:e.jsx(zt,{className:"size-3 text-muted-foreground"})}),e.jsx(f.TooltipContent,{className:"max-w-64 text-center",children:e.jsx("p",{children:i.infoMessage})})]})})]}),e.jsx("div",{className:"flex flex-col gap-2",children:It.map(a=>e.jsx(Wt,{dayLabel:i.days?.[a]??Te[a],config:t[a],onChange:g=>h(a,g),disabled:r,hourOptions:m},a))})]})}const Pt={sunday:{enabled:!1,from:8,to:18},monday:{enabled:!0,from:8,to:18},tuesday:{enabled:!0,from:8,to:18},wednesday:{enabled:!0,from:8,to:18},thursday:{enabled:!0,from:8,to:18},friday:{enabled:!0,from:8,to:18},saturday:{enabled:!1,from:8,to:18}};function ge({className:t}){return e.jsx("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}function Ot({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}function Bt({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function pe({checked:t,onCheckedChange:s,className:r,children:n}){return e.jsx("button",{type:"button",role:"checkbox","aria-checked":t,onClick:()=>s(!t),className:r,children:n})}function _t({src:t,alt:s,fallback:r,className:n}){const[o,i]=v.useState(!1);return!t||o?e.jsx("div",{className:d.cn("flex items-center justify-center bg-zinc-200 text-zinc-600 font-medium text-sm",n),children:r||"?"}):e.jsx("img",{src:t,alt:s||"",className:d.cn("object-cover",n),onError:()=>i(!0)})}function Se({value:t,onChange:s,placeholder:r,className:n}){return e.jsxs("div",{className:d.cn("relative",n),children:[e.jsx(Ot,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx("input",{type:"text",value:t,onChange:o=>s(o.target.value),placeholder:r,className:"h-9 w-full rounded-lg border border-border bg-white pl-9 pr-3 text-sm placeholder:text-muted-foreground focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary"})]})}function Ee(t,s,r,n=.3){if(!s.trim())return t;const o=s.toLowerCase();return t.filter(i=>r(i).some(h=>h?h.toLowerCase().includes(o):!1))}const Rt={title:"Filters",subtitle:"Filter calendar events",scheduleTypes:"Event Types",participants:"Participants",clearAll:"Clear all",selectAll:"Select all",unselectAll:"Unselect all",searchScheduleTypes:"Search event types...",searchParticipants:"Search participants...",noScheduleTypes:"No event types found",noParticipants:"No participants found"};function $t({scheduleTypes:t,users:s,selectedScheduleTypeIds:r,onScheduleTypeChange:n,selectedUserIds:o,onUserChange:i,onClearAll:m,className:h,scheduleTypesLoading:a=!1,usersLoading:g=!1,labels:y,getScheduleTypeName:p}){const H={...Rt,...y},[A,E]=v.useState(""),[F,I]=v.useState(""),C=v.useMemo(()=>A.trim()?Ee(t,A,x=>[x.name,p?.(x)||x.name]):t,[t,A,p]),L=v.useMemo(()=>F.trim()?Ee(s,F,x=>[x.name,x.email||""]):s,[s,F]),R=C.length>0&&C.every(x=>r.includes(x.id)),G=L.length>0&&L.every(x=>o.includes(x.id)),w=r.length+o.length,W=(x,b)=>{const S=b?[...r,x]:r.filter(B=>B!==x);n(S)},P=()=>{if(R){const x=new Set(C.map(b=>b.id));n(r.filter(b=>!x.has(b)))}else{const x=new Set([...r,...C.map(b=>b.id)]);n(Array.from(x))}},$=(x,b)=>{const S=b?[...o,x]:o.filter(B=>B!==x);i(S)},K=()=>{if(G){const x=new Set(L.map(b=>b.id));i(o.filter(b=>!x.has(b)))}else{const x=new Set([...o,...L.map(b=>b.id)]);i(Array.from(x))}},J=()=>{n([]),i([]),m?.()},Y=x=>p?p(x):x.name,O=x=>x.colorHex||x.color||"#069AD7";return e.jsxs("div",{className:d.cn("flex min-w-72 max-w-72 flex-col rounded-lg border bg-white shadow-sm",h),children:[e.jsxs("header",{className:"flex items-start justify-between gap-2 px-4 pb-2 pt-4",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("h3",{className:"text-base font-semibold text-foreground",children:H.title}),e.jsx("p",{className:"text-xs text-muted-foreground",children:H.subtitle})]}),w>0&&e.jsxs("button",{type:"button",onClick:J,className:"flex h-auto items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/10",children:[e.jsx(Bt,{className:"h-3.5 w-3.5"}),H.clearAll]})]}),e.jsx("div",{className:"h-px w-full bg-border/60"}),e.jsxs("section",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[e.jsx("h4",{className:"text-sm font-medium text-foreground",children:H.scheduleTypes}),e.jsx("button",{type:"button",onClick:P,className:"text-xs font-medium text-primary transition-colors hover:text-primary/80",children:R?H.unselectAll:H.selectAll})]}),t.length>6&&e.jsx("div",{className:"px-4 pb-3",children:e.jsx(Se,{value:A,onChange:E,placeholder:H.searchScheduleTypes})}),e.jsxs("div",{className:"flex max-h-[220px] flex-col gap-2 overflow-y-auto px-4 pb-2 scrollbar-thin",children:[a?Array.from({length:4}).map((x,b)=>e.jsxs("div",{className:"flex animate-pulse items-center gap-2 rounded-md border border-border/60 bg-muted/40 p-2",children:[e.jsx("div",{className:"h-5 w-5 rounded bg-muted-foreground/20"}),e.jsx("div",{className:"h-3 w-24 rounded bg-muted-foreground/20"})]},`skeleton-${b}`)):C.map(x=>{const b=r.includes(x.id),S=O(x);return e.jsxs(pe,{checked:b,onCheckedChange:B=>W(x.id,B),className:d.cn("relative flex w-full cursor-pointer items-center justify-between gap-3 rounded-md border border-border bg-white px-3 py-2 transition-colors hover:border-primary/50",b&&"border-primary bg-primary/5"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:d.cn("flex h-4 w-4 items-center justify-center rounded border border-border text-xs transition-colors",b&&"border-primary bg-primary text-primary-foreground"),children:b&&e.jsx(ge,{className:"h-3 w-3"})}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:Y(x)})]}),e.jsx("div",{className:"h-4 w-4 rounded-full border",style:{backgroundColor:S,borderColor:S}})]},x.id)}),!a&&C.length===0&&e.jsx("p",{className:"px-2 py-1 text-xs text-muted-foreground",children:H.noScheduleTypes})]})]}),e.jsx("div",{className:"h-px w-full bg-border/60"}),e.jsxs("section",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[e.jsx("h4",{className:"text-sm font-medium text-foreground",children:H.participants}),e.jsx(pe,{checked:G,onCheckedChange:()=>K(),className:d.cn("flex h-5 w-5 items-center justify-center rounded border border-border bg-white transition-colors hover:border-primary/50",G&&"border-primary bg-primary text-primary-foreground"),children:G&&e.jsx(ge,{className:"h-3.5 w-3.5"})})]}),e.jsx("div",{className:"px-4 pb-3",children:e.jsx(Se,{value:F,onChange:I,placeholder:H.searchParticipants})}),e.jsxs("div",{className:"flex max-h-[400px] flex-col gap-2 overflow-y-auto px-4 pb-4 scrollbar-thin",children:[g?Array.from({length:4}).map((x,b)=>e.jsxs("div",{className:"flex animate-pulse items-center gap-3 rounded-md border border-border/60 bg-muted/40 p-3",children:[e.jsx("div",{className:"h-5 w-5 rounded bg-muted-foreground/20"}),e.jsx("div",{className:"h-10 w-10 rounded-full bg-muted-foreground/20"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-3 w-24 rounded bg-muted-foreground/20"}),e.jsx("div",{className:"h-2 w-32 rounded bg-muted-foreground/10"})]})]},`p-skeleton-${b}`)):L.map(x=>{const b=o.includes(x.id);return e.jsxs(pe,{checked:b,onCheckedChange:S=>$(x.id,S),className:d.cn("relative flex w-full cursor-pointer items-start gap-2 rounded-lg border border-border bg-white p-2 transition-colors hover:border-primary/50",b&&"border-primary bg-zinc-50"),children:[e.jsx("span",{className:d.cn("flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border border-border transition-colors",b&&"border-primary bg-primary text-primary-foreground"),children:b&&e.jsx(ge,{className:"h-2.5 w-2.5"})}),e.jsxs("div",{className:"flex flex-1 items-start gap-2",children:[e.jsx(_t,{src:x.avatar??null,alt:x.name,fallback:x.name?.[0]?.toUpperCase()??"?",className:"h-10 w-10 rounded-lg"}),e.jsxs("div",{className:"flex max-w-[140px] flex-col gap-0.5 overflow-hidden",children:[e.jsx("span",{className:"line-clamp-1 text-sm font-medium text-foreground",children:x.name}),e.jsx("span",{className:"truncate text-[11px] text-muted-foreground",title:x.email,children:x.email})]})]})]},x.id)}),!g&&L.length===0&&e.jsx("p",{className:"px-4 text-xs text-muted-foreground",children:H.noParticipants})]})]})]})}function Vt({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"}),e.jsx("circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor"})]})}function Ut({scheduleTypes:t,value:s,onChange:r,allLabel:n="All types",className:o,label:i}){const m=a=>{r(a.target.value)},h=t.find(a=>String(a.id)===s);return e.jsxs("div",{className:d.cn("flex flex-col gap-1",o),children:[i&&e.jsx(se,{className:"text-xs text-muted-foreground",children:i}),e.jsxs("div",{className:"relative",children:[h?e.jsx("span",{className:"pointer-events-none absolute left-2.5 top-1/2 size-3 -translate-y-1/2 rounded-full",style:{backgroundColor:h.color}}):e.jsx(Vt,{className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),e.jsxs(re,{value:s,onChange:m,className:"h-9 w-full min-w-[140px] pl-8 pr-8 text-sm",children:[e.jsx("option",{value:"all",children:n}),t.map(a=>e.jsx("option",{value:String(a.id),children:a.label},a.id))]})]})]})}function Yt({className:t}){return e.jsxs("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"}),e.jsx("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})}function Gt({users:t,value:s,onChange:r,allLabel:n="All users",className:o,label:i}){const m=h=>{r(h.target.value)};return e.jsxs("div",{className:d.cn("flex flex-col gap-1",o),children:[i&&e.jsx(se,{className:"text-xs text-muted-foreground",children:i}),e.jsxs("div",{className:"relative",children:[e.jsx(Yt,{className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),e.jsxs(re,{value:s,onChange:m,className:"h-9 w-full min-w-[120px] pl-8 pr-8 text-sm",children:[e.jsx("option",{value:"all",children:n}),t.map(h=>e.jsx("option",{value:h.id,children:h.name},h.id))]})]})]})}function qt({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M8 2v4"}),e.jsx("path",{d:"M16 2v4"}),e.jsx("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),e.jsx("path",{d:"M3 10h18"}),e.jsx("path",{d:"M8 14h.01"}),e.jsx("path",{d:"M12 14h.01"}),e.jsx("path",{d:"M16 14h.01"}),e.jsx("path",{d:"M8 18h.01"}),e.jsx("path",{d:"M12 18h.01"}),e.jsx("path",{d:"M16 18h.01"})]})}function Kt({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5"}),e.jsx("path",{d:"M16 2v4"}),e.jsx("path",{d:"M8 2v4"}),e.jsx("path",{d:"M3 10h5"}),e.jsx("path",{d:"M17.5 17.5 16 16.3V14"}),e.jsx("circle",{cx:"16",cy:"16",r:"6"})]})}function Jt({className:t}){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:t,children:e.jsx("path",{d:"m9 18 6-6-6-6"})})}function Xt({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M15 3h6v6"}),e.jsx("path",{d:"M10 14 21 3"}),e.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})}function Qt(t){const s=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${s}-${r}-${n}`}function ze(t){const s=t.getHours(),r=t.getMinutes(),n=s>=12?"PM":"AM",o=s%12||12,i=String(r).padStart(2,"0");return`${o}:${i} ${n}`}function Zt(t){const s=ze(t.startDate),r=ze(t.endDate);return`${s} - ${r}`}function es(t){const s=U.addDays(new Date,1);return t.getFullYear()===s.getFullYear()&&t.getMonth()===s.getMonth()&&t.getDate()===s.getDate()}function ts(t){if(U.isToday(t))return"Today";if(es(t))return"Tomorrow";const s=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],n=s[t.getDay()],o=r[t.getMonth()],i=t.getDate();return`${n}, ${o} ${i}`}function ss(t,s){const r=new Map;for(const n of t){const o=Qt(n.startDate),i=r.get(o)??[];i.push(n),r.set(o,i)}return Array.from(r.entries()).map(([n,o])=>{const i=[...o].sort((h,a)=>h.startDate.getTime()-a.startDate.getTime()),m=s>0?i.slice(0,s):i;return{date:new Date(n),dateKey:n,events:m,hasMore:s>0&&i.length>s}}).sort((n,o)=>n.date.getTime()-o.date.getTime())}function rs(t){const s=U.startOfDay(new Date),r=U.endOfDay(new Date);return t.filter(n=>n.startDate>=s&&n.startDate<=r).length}function je({className:t}){return e.jsx("div",{className:d.cn("animate-pulse rounded-md bg-muted",t)})}function ns({event:t,onClick:s}){return e.jsxs("button",{type:"button",onClick:()=>s?.(t),className:d.cn("w-full text-left rounded-lg transition-colors","hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","flex items-start gap-3 p-2"),children:[e.jsx("div",{className:"shrink-0 rounded-full mt-1.5 size-2",style:{backgroundColor:t.color??"#3b82f6"}}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:t.title}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:Zt(t)})]}),s&&e.jsx(Jt,{className:"shrink-0 size-4 text-muted-foreground/50 mt-1"})]})}function os({group:t,onEventClick:s}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[e.jsx("h3",{className:d.cn("text-xs font-semibold",U.isToday(t.date)&&"text-primary"),children:ts(t.date)}),t.hasMore&&e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["+",t.events.length," more"]})]}),e.jsx("div",{className:"space-y-0.5",children:t.events.map(r=>e.jsx(ns,{event:r,onClick:s},r.id))})]})}function is({events:t,isLoading:s=!1,className:r,daysAhead:n=7,maxEventsPerDay:o=3,onEventClick:i,onNavigateToAgenda:m}){const[h,a]=v.useState(!1),g=v.useMemo(()=>{const E=U.startOfDay(new Date),F=U.addDays(E,n);return t.filter(I=>I.endDate>=E&&I.startDate<F)},[t,n]),y=v.useMemo(()=>ss(g,o),[g,o]),p=v.useMemo(()=>rs(t),[t]),H=E=>{a(!1),i?.(E)},A=()=>{a(!1),m?.()};return e.jsxs(f.Popover,{open:h,onOpenChange:a,children:[e.jsxs(f.PopoverTrigger,{className:d.cn("relative rounded-xl hover:text-zinc-700 hover:!bg-zinc-300 !bg-zinc-200 text-zinc-600 shadow-none !px-2.5 p-2 max-h-10",r),children:[e.jsx(qt,{className:"h-4 w-4"}),p>0&&e.jsx(f.Badge,{variant:"destructive",className:"absolute -right-4 -top-4 m-3 flex h-5 w-5 items-center justify-center rounded-full bg-primary p-0 text-[10px] font-medium hover:bg-primary",children:p>99?"99+":p})]}),e.jsxs(f.PopoverContent,{className:"w-80 rounded-xl p-0",align:"end",side:"bottom",sideOffset:8,children:[e.jsxs("div",{className:"flex items-center justify-between border-b p-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Upcoming"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:p>0?`${p} event${p>1?"s":""} today`:"No events today"})]}),m&&e.jsxs("button",{type:"button",onClick:A,className:"text-xs text-primary hover:underline flex items-center gap-1",children:["View all",e.jsx(Xt,{className:"size-3"})]})]}),e.jsx("div",{className:"max-h-80 overflow-y-auto p-2",children:s?e.jsx("div",{className:"space-y-2 p-2",children:Array.from({length:3}).map((E,F)=>e.jsxs("div",{className:"flex space-x-3",children:[e.jsx(je,{className:"h-2 w-2 rounded-full mt-2"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(je,{className:"h-4 w-full"}),e.jsx(je,{className:"h-3 w-3/4"})]})]},F))}):y.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(Kt,{className:"mb-2 h-8 w-8 text-muted-foreground/50"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No upcoming events"}),e.jsxs("p",{className:"text-xs text-muted-foreground/70",children:["Your schedule is clear for the next ",n," days"]})]}):e.jsx("div",{className:"space-y-3 divide-y",children:y.map(E=>e.jsx(os,{group:E,onEventClick:H},E.dateKey))})})]})]})}function as({className:t}){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[e.jsx("path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5"}),e.jsx("path",{d:"M16 2v4"}),e.jsx("path",{d:"M8 2v4"}),e.jsx("path",{d:"M3 10h5"}),e.jsx("path",{d:"M17.5 17.5 16 16.25V14"}),e.jsx("circle",{cx:"16",cy:"16",r:"6"})]})}function Fe({className:t}){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:e.jsx("path",{d:"m9 18 6-6-6-6"})})}function ls(t){const s=new Date;return s.setDate(s.getDate()+1),t.getFullYear()===s.getFullYear()&&t.getMonth()===s.getMonth()&&t.getDate()===s.getDate()}function He(t){const s=t.getHours(),r=t.getMinutes(),n=s>=12?"PM":"AM";return`${s%12||12}:${r.toString().padStart(2,"0")} ${n}`}function cs(t){return new Intl.DateTimeFormat("en-US",{weekday:"long",month:"short",day:"numeric"}).format(t)}function ds(t){const s=He(t.startDate),r=He(t.endDate);return`${s} - ${r}`}function us(t){return U.isToday(t)?"Today":ls(t)?"Tomorrow":cs(t)}function xs(t,s){const r=new Map;for(const n of t){const o=U.formatDateISO(n.startDate),i=r.get(o)??[];i.push(n),r.set(o,i)}return Array.from(r.entries()).map(([n,o])=>{const i=[...o].sort((h,a)=>h.startDate.getTime()-a.startDate.getTime()),m=s>0?i.slice(0,s):i;return{date:new Date(n),dateKey:n,events:m,hasMore:s>0&&i.length>s}}).sort((n,o)=>n.date.getTime()-o.date.getTime())}function hs({event:t,onClick:s,compact:r}){return e.jsxs("button",{type:"button",onClick:()=>s?.(t),className:d.cn("w-full text-left rounded-lg transition-colors","hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","flex items-start gap-3",r?"p-2":"p-3"),children:[e.jsx("div",{className:d.cn("shrink-0 rounded-full mt-1",r?"size-2":"size-2.5"),style:{backgroundColor:t.color??"#3b82f6"}}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:d.cn("font-medium truncate",r?"text-xs":"text-sm"),children:t.title}),e.jsx("p",{className:d.cn("text-muted-foreground truncate",r?"text-[10px]":"text-xs"),children:ds(t)})]}),s&&e.jsx(Fe,{className:d.cn("shrink-0 text-muted-foreground/50",r?"size-3":"size-4")})]})}function ms({group:t,onEventClick:s,onViewMore:r,compact:n}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:d.cn("flex items-center justify-between px-2",n?"py-1":"py-1.5"),children:[e.jsx("h3",{className:d.cn("font-semibold",n?"text-xs":"text-sm",U.isToday(t.date)&&"text-primary"),children:us(t.date)}),t.hasMore&&r&&e.jsx("button",{type:"button",onClick:()=>r(t.date),className:d.cn("text-primary hover:underline",n?"text-[10px]":"text-xs"),children:"+more"})]}),e.jsx("div",{className:"space-y-0.5",children:t.events.map(o=>e.jsx(hs,{event:o,onClick:s,compact:n},o.id))})]})}function fs({events:t,daysAhead:s=7,maxEventsPerDay:r=3,onEventClick:n,onViewAll:o,className:i,emptyState:m,title:h="Upcoming",showHeader:a=!0,compact:g=!1}){const y=ue.useOptionalCalendarContext(),p=y?.filteredEvents,H=y?.currentDate??new Date,A=t??p??[],E=v.useMemo(()=>{const C=U.startOfDay(H),L=new Date(C);return L.setDate(L.getDate()+s),A.filter(R=>R.endDate>=C&&R.startDate<L)},[A,s,H]),F=v.useMemo(()=>xs(E,r),[E,r]),I=E.length;return F.length===0?e.jsxs("div",{className:d.cn("rounded-lg border bg-card",i),children:[a&&e.jsx("div",{className:d.cn("border-b px-4 flex items-center justify-between",g?"py-2":"py-3"),children:e.jsx("h2",{className:d.cn("font-semibold",g?"text-sm":"text-base"),children:h})}),e.jsx("div",{className:d.cn("flex flex-col items-center justify-center text-center",g?"py-6 px-4":"py-10 px-6"),children:m??e.jsxs(e.Fragment,{children:[e.jsx(as,{className:d.cn("text-muted-foreground/50 mb-2",g?"size-8":"size-10")}),e.jsx("p",{className:d.cn("text-muted-foreground",g?"text-xs":"text-sm"),children:"No upcoming events"})]})})]}):e.jsxs("div",{className:d.cn("rounded-lg border bg-card overflow-hidden",i),children:[a&&e.jsxs("div",{className:d.cn("border-b px-4 flex items-center justify-between",g?"py-2":"py-3"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:d.cn("font-semibold",g?"text-sm":"text-base"),children:h}),e.jsx("span",{className:d.cn("text-muted-foreground bg-muted rounded-full px-2",g?"text-[10px] py-0":"text-xs py-0.5"),children:I})]}),o&&e.jsxs("button",{type:"button",onClick:()=>o(),className:d.cn("text-primary hover:underline flex items-center gap-0.5",g?"text-xs":"text-sm"),children:["View all",e.jsx(Fe,{className:"size-3"})]})]}),e.jsx("div",{className:d.cn("divide-y overflow-auto",g?"p-2 max-h-[280px]":"p-3 max-h-[400px]"),children:F.map(C=>e.jsx(ms,{group:C,onEventClick:n,onViewMore:o?L=>o(L):void 0,compact:g},C.dateKey))})]})}exports.AgendaDropdown=is;exports.AgendaWidget=fs;exports.BadgeVariantSetting=Dt;exports.Calendar=Ae;exports.CalendarFilterSidebar=$t;exports.DEFAULT_WEEK_WORKING_HOURS=Pt;exports.EventPopover=et;exports.InnoCalendar=jt;exports.ScheduleTypeFilter=Ut;exports.SlotDurationSetting=yt;exports.TimelineView=oe;exports.UserFilter=Gt;exports.VisibleHoursSetting=Et;exports.WorkingHoursSetting=At;exports.YearView=Ie;
2
+ //# sourceMappingURL=agenda-widget-WpqvlAJP.cjs.map