@innosolutions/inno-calendar 1.0.39 → 1.0.41

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 (35) hide show
  1. package/dist/{agenda-widget-KlPk6TpL.cjs → agenda-widget-B5Sgvvry.cjs} +2 -2
  2. package/dist/{agenda-widget-KlPk6TpL.cjs.map → agenda-widget-B5Sgvvry.cjs.map} +1 -1
  3. package/dist/{agenda-widget-Yj5oCSdd.js → agenda-widget-C5uR9Raa.js} +2 -2
  4. package/dist/{agenda-widget-Yj5oCSdd.js.map → agenda-widget-C5uR9Raa.js.map} +1 -1
  5. package/dist/components/index.cjs +1 -1
  6. package/dist/components/index.mjs +2 -2
  7. package/dist/components/primitives/index.d.ts +1 -0
  8. package/dist/components/primitives/index.d.ts.map +1 -1
  9. package/dist/components/primitives/multi-day-banner.d.ts +17 -3
  10. package/dist/components/primitives/multi-day-banner.d.ts.map +1 -1
  11. package/dist/components/primitives/week-all-day-row.d.ts +40 -0
  12. package/dist/components/primitives/week-all-day-row.d.ts.map +1 -0
  13. package/dist/components/views/day-view.d.ts.map +1 -1
  14. package/dist/components/views/week-view.d.ts.map +1 -1
  15. package/dist/core/utils/date-utils.d.ts.map +1 -1
  16. package/dist/index.cjs +1 -1
  17. package/dist/index.mjs +3 -3
  18. package/dist/presets/index.cjs +1 -1
  19. package/dist/presets/index.mjs +1 -1
  20. package/dist/{tailwind-calendar-BqhSHRk0.cjs → tailwind-calendar-B2vvMCsL.cjs} +2 -2
  21. package/dist/{tailwind-calendar-BqhSHRk0.cjs.map → tailwind-calendar-B2vvMCsL.cjs.map} +1 -1
  22. package/dist/{tailwind-calendar-BvWm9ry9.js → tailwind-calendar-C1_6GoL0.js} +2 -2
  23. package/dist/{tailwind-calendar-BvWm9ry9.js.map → tailwind-calendar-C1_6GoL0.js.map} +1 -1
  24. package/dist/utils.cjs +1 -1
  25. package/dist/utils.cjs.map +1 -1
  26. package/dist/utils.mjs +12 -11
  27. package/dist/utils.mjs.map +1 -1
  28. package/dist/week-view-DBsCYSce.cjs +11 -0
  29. package/dist/week-view-DBsCYSce.cjs.map +1 -0
  30. package/dist/{week-view-BGthazCB.js → week-view-Dh-gHd0m.js} +1486 -1189
  31. package/dist/week-view-Dh-gHd0m.js.map +1 -0
  32. package/package.json +1 -1
  33. package/dist/week-view-BGthazCB.js.map +0 -1
  34. package/dist/week-view-DOvr2VIq.cjs +0 -11
  35. package/dist/week-view-DOvr2VIq.cjs.map +0 -1
@@ -1,11 +0,0 @@
1
- "use strict";const e=require("react/jsx-runtime"),o=require("react"),i=require("./index-D2U2F80P.cjs"),Qe=require("@radix-ui/react-dropdown-menu"),b=require("./utils.cjs"),ie=require("./slot-selection-context-Bx3FKJfR.cjs"),et=require("@radix-ui/react-popover"),tt=require("@radix-ui/react-tooltip");function we(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:()=>t[r]})}}return n.default=t,Object.freeze(n)}const Y=we(o),F=we(Qe),ae=we(et),me=we(tt),ee=ae.Root,te=ae.Trigger,nt=ae.Anchor,J=Y.forwardRef(({className:t,align:n="center",sideOffset:r=4,...s},l)=>e.jsx(ae.Portal,{children:e.jsx(ae.Content,{ref:l,align:n,sideOffset:r,className:i.cn("z-50 w-72 rounded-xl border bg-white text-popover-foreground outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s})}));J.displayName=ae.Content.displayName;const rt=me.Provider,ne=me.Root,re=me.Trigger,Q=Y.forwardRef(({className:t,sideOffset:n=4,...r},s)=>e.jsx(me.Content,{ref:s,sideOffset:n,className:i.cn("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r}));Q.displayName=me.Content.displayName;function le(t){return{blue:{bg:"bg-blue-50 dark:bg-blue-950/30",text:"text-blue-700 dark:text-blue-300",dot:"bg-blue-500",dotFill:"fill-blue-600 dark:fill-blue-500",border:"border-blue-400 dark:border-blue-600",accentBorder:"border-l-blue-500 dark:border-l-blue-400"},green:{bg:"bg-green-50 dark:bg-green-950/30",text:"text-green-700 dark:text-green-300",dot:"bg-green-500",dotFill:"fill-green-600 dark:fill-green-500",border:"border-green-400 dark:border-green-600",accentBorder:"border-l-green-500 dark:border-l-green-400"},red:{bg:"bg-red-50 dark:bg-red-950/30",text:"text-red-700 dark:text-red-300",dot:"bg-red-500",dotFill:"fill-red-600 dark:fill-red-500",border:"border-red-400 dark:border-red-600",accentBorder:"border-l-red-500 dark:border-l-red-400"},yellow:{bg:"bg-yellow-50 dark:bg-yellow-950/30",text:"text-yellow-700 dark:text-yellow-300",dot:"bg-yellow-500",dotFill:"fill-yellow-600 dark:fill-yellow-500",border:"border-yellow-400 dark:border-yellow-600",accentBorder:"border-l-yellow-500 dark:border-l-yellow-400"},purple:{bg:"bg-purple-50 dark:bg-purple-950/30",text:"text-purple-700 dark:text-purple-300",dot:"bg-purple-500",dotFill:"fill-purple-600 dark:fill-purple-500",border:"border-purple-400 dark:border-purple-600",accentBorder:"border-l-purple-500 dark:border-l-purple-400"},orange:{bg:"bg-orange-50 dark:bg-orange-950/30",text:"text-orange-700 dark:text-orange-300",dot:"bg-orange-500",dotFill:"fill-orange-600 dark:fill-orange-500",border:"border-orange-400 dark:border-orange-600",accentBorder:"border-l-orange-500 dark:border-l-orange-400"},pink:{bg:"bg-pink-50 dark:bg-pink-950/30",text:"text-pink-700 dark:text-pink-300",dot:"bg-pink-500",dotFill:"fill-pink-600 dark:fill-pink-500",border:"border-pink-400 dark:border-pink-600",accentBorder:"border-l-pink-500 dark:border-l-pink-400"},teal:{bg:"bg-teal-50 dark:bg-teal-950/30",text:"text-teal-700 dark:text-teal-300",dot:"bg-teal-500",dotFill:"fill-teal-600 dark:fill-teal-500",border:"border-teal-400 dark:border-teal-600",accentBorder:"border-l-teal-500 dark:border-l-teal-400"},gray:{bg:"bg-gray-50 dark:bg-gray-950/30",text:"text-gray-700 dark:text-gray-300",dot:"bg-gray-500",dotFill:"fill-gray-600 dark:fill-gray-500",border:"border-gray-400 dark:border-gray-600",accentBorder:"border-l-gray-500 dark:border-l-gray-400"},indigo:{bg:"bg-indigo-50 dark:bg-indigo-950/30",text:"text-indigo-700 dark:text-indigo-300",dot:"bg-indigo-500",dotFill:"fill-indigo-600 dark:fill-indigo-500",border:"border-indigo-400 dark:border-indigo-600",accentBorder:"border-l-indigo-500 dark:border-l-indigo-400"}}[t??"blue"]}function Se(t){const n=new Date(t);return n.setHours(0,0,0,0),n}function xe({event:t,variant:n="full",badgeVariant:r="colored",onClick:s,className:l,showTime:y=!0,showDescription:u=!1,showParticipants:m=!1,style:C,disablePopover:p=!1,renderPopover:j,enableDrag:S=!1,enablePageTransition:c=!1,pageTransitionDuration:g=400}){const d=le(t.color),[w,_]=o.useState(!1),[I,z]=o.useState(!1),[E,R]=o.useState(!1),[L,T]=o.useState(null),M=o.useRef(null),P=ie.useOptionalDragDrop(),N=t.endDate<Se(new Date),A=t.isCanceled??!1,G=S&&P&&!A&&!N,h=t.data,f=h?.meetingTookPlace??t.meetingTookPlace??!1,W=A?e.jsx(ot,{className:"h-3 w-3 text-zinc-800 dark:text-zinc-200"}):f?e.jsx(st,{className:i.cn("h-3 w-3",d.text)}):null,H=t.scheduleTypeName||h?.scheduleTypeName||h?.typeName,O=h?.productName,v=h?.nrParticipant,a=h?.siteName,x=h?.siteCity,k=[a,x].filter(Boolean).join(", "),B=o.useCallback(()=>{if(!I){if(p&&s){s(t);return}if(c&&M.current){const q=M.current.getBoundingClientRect();T(q),R(!0)}else p||_(!0)}},[I,p,s,t,c]);o.useCallback(()=>{R(!1),T(null),p||_(!0)},[p]);const D=o.useCallback(()=>{_(!1)},[]),K=o.useCallback(q=>{G&&(q.dataTransfer.effectAllowed="move",q.dataTransfer.setData("text/plain",t.id),z(!0),P?.startDrag?.(t))},[G,t,P]),$=o.useCallback(()=>{z(!1),P?.isDragging&&P.endDrag?.()},[P]);if(n==="dot"){const q=e.jsx("button",{type:"button",onClick:B,className:i.cn("size-2 rounded-full cursor-pointer transition-opacity",N?"bg-gray-400":d.dot,t.isCanceled&&"opacity-50",l),style:C,"aria-label":t.title});return p?e.jsxs(ne,{children:[e.jsx(re,{asChild:!0,children:q}),e.jsx(Q,{children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"font-medium",children:t.title}),e.jsx("div",{className:"text-xs opacity-80",children:b.formatEventTimeDisplay(t)})]})})]}):e.jsxs(ee,{open:w,onOpenChange:_,children:[e.jsx(te,{asChild:!0,children:e.jsxs(ne,{children:[e.jsx(re,{asChild:!0,children:q}),e.jsx(Q,{children:e.jsx("div",{className:"font-medium",children:t.title})})]})}),e.jsx(J,{className:"w-80",children:j?j({event:t,onClose:D}):e.jsx(ue,{event:t,onClose:D})})]})}if(n==="compact"){const q=e.jsxs("div",{role:"button",tabIndex:0,draggable:!!G,onDragStart:K,onDragEnd:$,onClick:p?B:void 0,onKeyDown:U=>{(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),B())},className:i.cn("group flex w-full relative items-center shadow-[0_0_1px_rgba(0,0,0,0.3)] gap-0 rounded px-1.5 py-1 text-left text-xs transition-colors hover:opacity-80",G?"cursor-grab active:cursor-grabbing":"cursor-pointer",I&&"opacity-50",A||N?"bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 line-through":[r==="colored"&&[d.bg,d.text],r==="mixed"&&[d.bg,d.text],r==="dot"&&"bg-muted/50"],l),style:C,children:[["dot","mixed"].includes(r)&&!N&&e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",className:"event-dot absolute -top-1 -left-1 shrink-0","aria-hidden":"true",focusable:"false",children:e.jsx("circle",{cx:"4",cy:"4",r:"4",className:d.dotFill})}),e.jsx("span",{className:"flex-1 min-w-0 overflow-hidden",children:e.jsxs("span",{className:"",children:[e.jsx("span",{className:"relative block overflow-hidden whitespace-nowrap text-xs leading-tight",style:{maskImage:"linear-gradient(to right, transparent 0, black 8px, black calc(100% - 8px), transparent 100%)",WebkitMaskImage:"linear-gradient(to right, transparent 0, black 8px, black calc(100% - 8px), transparent 100%)"},children:e.jsxs("span",{className:"inline-flex event-marquee",children:[e.jsx("span",{className:"shrink-0 px-1",children:t.title}),e.jsx("span",{className:"shrink-0 px-1",children:"•"}),e.jsx("span",{"aria-hidden":"true",className:"shrink-0 px-1",children:t.title}),e.jsx("span",{"aria-hidden":"true",className:"shrink-0 px-1",children:"•"})]})}),e.jsx("div",{className:i.cn("w-fit mt-0.5 text-[10px] px-1 py-0.5 border border-dashed rounded-full font-medium",N?"border-zinc-400 dark:border-zinc-600":d.border),children:b.formatEventTimeDisplay(t)})]})}),e.jsx("div",{className:"flex gap-0.5",children:W})]});return p?e.jsxs(ne,{children:[e.jsx(re,{asChild:!0,children:q}),e.jsx(Q,{children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"font-medium",children:t.title}),e.jsx("div",{className:"text-xs text-muted-foreground tabular-nums",children:b.formatEventTimeDisplay(t)})]})})]}):e.jsxs(ee,{open:w,onOpenChange:_,children:[e.jsx(te,{asChild:!0,children:q}),e.jsx(J,{className:"w-80",children:j?j({event:t,onClose:D}):e.jsx(ue,{event:t,onClose:D})})]})}const V=e.jsxs("button",{type:"button",onClick:B,className:i.cn("group relative flex w-full flex-col gap-1 rounded-md border-l-[3px] px-2 py-1.5 text-left transition-all","shadow-[0_1px_3px_rgba(0,0,0,0.08)] hover:shadow-[0_2px_6px_rgba(0,0,0,0.12)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",A||N?"bg-zinc-100 dark:bg-zinc-800 border-l-zinc-400 dark:border-l-zinc-600 text-zinc-500 dark:text-zinc-400 line-through":[r==="colored"&&[d.bg,d.accentBorder,d.text],r==="mixed"&&[d.bg,d.accentBorder,d.text],r==="dot"&&"bg-muted/50 border-l-neutral-400 dark:border-l-neutral-600"],l),style:C,children:[e.jsxs("div",{className:"flex items-start justify-between gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[["dot","mixed"].includes(r)&&!N&&!A&&e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",className:"event-dot shrink-0","aria-hidden":"true",focusable:"false",children:e.jsx("circle",{cx:"4",cy:"4",r:"4",className:d.dotFill})}),e.jsxs("span",{className:i.cn("text-sm font-medium truncate",!N&&!A&&r!=="dot"&&d.text,A&&"line-through"),children:[t.title,H&&e.jsxs("span",{className:"font-normal opacity-75",children:[" ","- ",H]})]})]}),W]}),O&&e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:O}),v!=null&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(De,{className:"h-3 w-3 shrink-0"}),e.jsxs("span",{children:[v," participant",v!==1?"s":""]})]}),y&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(Te,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{children:b.formatEventTimeDisplay(t)})]}),k&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(Oe,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"truncate",children:k})]}),u&&t.description&&e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:t.description}),m&&t.participants&&t.participants.length>0&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(De,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"truncate",children:t.participants.map(q=>q.name).join(", ")})]})]});return p?e.jsxs(ne,{children:[e.jsx(re,{asChild:!0,children:V}),e.jsx(Q,{children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"font-medium",children:t.title}),e.jsx("div",{className:"text-xs text-muted-foreground tabular-nums",children:b.formatEventTimeDisplay(t)})]})})]}):e.jsxs(ee,{open:w,onOpenChange:_,children:[e.jsx(te,{asChild:!0,children:V}),e.jsx(J,{className:"w-80",children:j?j({event:t,onClose:D}):e.jsx(ue,{event:t,onClose:D})})]})}function Te({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("polyline",{points:"12 6 12 12 16 14"})]})}function st({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 ot({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 De({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 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("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 ue({event:t,onClose:n}){const r=le(t.color),s=t.isCanceled??!1;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:i.cn("size-4 rounded shrink-0 mt-0.5",r.dot)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:i.cn("font-semibold text-lg",s&&"line-through opacity-50"),children:t.title}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground mt-1",children:[e.jsx(Te,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"tabular-nums",children:b.formatEventTimeDisplay(t)})]})]})]}),t.description&&e.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[t.isAllDay&&e.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded-full font-medium",children:"All day"}),t.isRecurring&&e.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded-full font-medium",children:"Recurring"}),s&&e.jsx("span",{className:"text-xs bg-red-100 dark:bg-red-950/30 text-red-700 dark:text-red-300 px-2 py-0.5 rounded-full font-medium",children:"Canceled"})]}),e.jsx("div",{className:"flex justify-end pt-2 border-t",children:e.jsx("button",{type:"button",onClick:n,className:"text-xs text-muted-foreground hover:text-foreground px-3 py-1.5 rounded-md hover:bg-muted transition-colors",children:"Close"})})]})}function ze({event:t,position:n,hourHeight:r=96,badgeVariant:s="colored",onClick:l,className:y,disablePopover:u=!1,renderPopover:m,enableDrag:C=!0}){const p=le(t.color),[j,S]=o.useState(!1),[c,g]=o.useState(!1),d=ie.useOptionalDragDrop(),w=(t.endDate.getTime()-t.startDate.getTime())/(1e3*60),_=w/60*r-8,I=t.endDate<Se(new Date),z=t.isCanceled??!1,E=C&&d&&!z&&!I,R=w<35,L=w>25,T=w>=45,M=t.data,P=t.scheduleTypeName||M?.scheduleTypeName||M?.typeName,N=M?.productName,A=M?.nrParticipant,G=M?.siteName,h=M?.siteCity,f=[G,h].filter(Boolean).join(", "),W=s==="dot",H=o.useCallback(()=>{c||(u&&l?l(t):u||S(!0))},[c,u,l,t]),O=o.useCallback(()=>{S(!1)},[]),v=o.useCallback(D=>{if(!E)return;D.dataTransfer.effectAllowed="move",D.dataTransfer.setData("text/plain",t.id);const K=D.currentTarget,$=K.getBoundingClientRect();D.dataTransfer.setDragImage(K,D.clientX-$.left,D.clientY-$.top),g(!0),d?.startDrag?.(t)},[E,t,d]),a=o.useCallback(()=>{g(!1),d?.isDragging&&d.endDrag?.()},[d]),x=o.useCallback(D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),H())},[H]),k=e.jsxs("div",{role:"button",tabIndex:0,draggable:!!E,onDragStart:v,onDragEnd:a,onKeyDown:x,onClick:c?void 0:H,className:i.cn("group flex w-full select-none flex-col gap-0.5 overflow-hidden rounded-md border-l-[3px] px-2 py-1.5 text-xs text-left","shadow-[0_1px_3px_rgba(0,0,0,0.08)] hover:shadow-[0_2px_6px_rgba(0,0,0,0.12)]","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","transition-all",E?"cursor-grab active:cursor-grabbing":"cursor-pointer",c&&"opacity-50",z||I?"bg-zinc-100 dark:bg-zinc-800 border-l-zinc-400 dark:border-l-zinc-600 text-zinc-500 dark:text-zinc-400 line-through":[!W&&[p.bg,p.accentBorder,p.text],W&&"bg-neutral-50 dark:bg-neutral-900 border-l-neutral-400 dark:border-l-neutral-600"],R&&"py-0 justify-center",y),style:{height:`${Math.max(_,20)}px`},children:[e.jsxs("div",{className:"flex items-start gap-1.5 min-w-0",children:[["mixed","dot"].includes(s)&&!I&&!z&&e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",className:"event-dot shrink-0","aria-hidden":"true",focusable:"false",children:e.jsx("circle",{cx:"4",cy:"4",r:"4",className:p.dotFill})}),e.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:e.jsxs("p",{className:i.cn("font-semibold truncate leading-tight",!I&&!z&&W&&"text-foreground"),children:[t.title,P&&e.jsxs("span",{className:"font-normal opacity-75",children:[" ","- ",P]})]})})]}),T&&N&&e.jsx("p",{className:i.cn("text-[11px] truncate leading-tight",W?"text-muted-foreground":"opacity-80"),children:N}),T&&A!=null&&e.jsxs("div",{className:i.cn("flex items-center gap-1 text-[11px] leading-tight",W?"text-muted-foreground":"opacity-80"),children:[e.jsx(De,{className:"h-3 w-3 shrink-0"}),e.jsxs("span",{children:[A," participant",A!==1?"s":""]})]}),L&&e.jsxs("div",{className:i.cn("flex items-center gap-1 text-[11px] tabular-nums leading-tight",W?"text-muted-foreground":"opacity-90"),children:[e.jsx(Te,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{children:b.formatEventTimeDisplay(t)})]}),T&&f&&e.jsxs("div",{className:i.cn("flex items-center gap-1 text-[11px] truncate leading-tight",W?"text-muted-foreground":"opacity-80"),children:[e.jsx(Oe,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"truncate",children:f})]})]}),B=e.jsx(Q,{children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("div",{className:"font-medium",children:[t.title,P&&e.jsxs("span",{className:"font-normal opacity-75",children:[" ","- ",P]})]}),N&&e.jsx("div",{className:"text-xs text-muted-foreground",children:N}),A!=null&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:[A," participant",A!==1?"s":""]}),e.jsx("div",{className:"text-xs text-muted-foreground tabular-nums",children:b.formatEventTimeDisplay(t)}),f&&e.jsx("div",{className:"text-xs text-muted-foreground",children:f})]})});return u?e.jsx("div",{className:"absolute p-0.5",style:{top:`${n.top}px`,left:`${n.left}%`,width:n.minWidth?`max(${n.minWidth}px, ${n.width}%)`:`${n.width}%`,minWidth:n.minWidth?`${n.minWidth}px`:void 0},children:e.jsxs(ne,{children:[e.jsx(re,{asChild:!0,children:k}),B]})}):e.jsx("div",{className:"absolute p-0.5",style:{top:`${n.top}px`,left:`${n.left}%`,width:n.minWidth?`max(${n.minWidth}px, ${n.width}%)`:`${n.width}%`,minWidth:n.minWidth?`${n.minWidth}px`:void 0},children:e.jsxs(ee,{open:j,onOpenChange:S,children:[e.jsx(te,{asChild:!0,children:k}),e.jsx(J,{className:"w-80",children:m?m({event:t,onClose:O}):e.jsx(ue,{event:t,onClose:O})})]})})}function at({event:t,spanDays:n,isStart:r,isEnd:s,onClick:l,className:y,disablePopover:u=!1,renderPopover:m}){const C=le(t.color),[p,j]=o.useState(!1),S=t.endDate<Se(new Date),c=t.isCanceled??!1,g=o.useCallback(()=>{u&&l?l(t):u||j(!0)},[u,l,t]),d=o.useCallback(()=>{j(!1)},[]),w=e.jsx("button",{type:"button",onClick:g,className:i.cn("flex h-5 items-center px-1.5 text-xs font-medium transition-opacity hover:opacity-80",c||S?"bg-zinc-200 dark:bg-zinc-700 text-zinc-500 dark:text-zinc-400 line-through":[C.dot,"text-white"],r&&"rounded-l",s&&"rounded-r",!r&&"border-l-0",!s&&"border-r-0",y),style:{width:`${n*100}%`},children:r&&e.jsx("span",{className:"truncate",children:t.title})}),_=e.jsx(Q,{children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"font-medium",children:t.title}),e.jsx("div",{className:"text-xs text-muted-foreground tabular-nums",children:b.formatEventTimeDisplay(t)})]})});return u?e.jsxs(ne,{children:[e.jsx(re,{asChild:!0,children:w}),_]}):e.jsxs(ee,{open:p,onOpenChange:j,children:[e.jsx(te,{asChild:!0,children:w}),e.jsx(J,{className:"w-80",children:m?m({event:t,onClose:d}):e.jsx(ue,{event:t,onClose:d})})]})}if(typeof window<"u"&&!document.getElementById("inno-calendar-event-marquee-style")){const t=document.createElement("style");t.id="inno-calendar-event-marquee-style",t.innerHTML=`
2
- @keyframes event-marquee {
3
- 0% { transform: translateX(0); }
4
- 100% { transform: translateX(-50%); }
5
- }
6
- .event-marquee {
7
- animation: event-marquee 28s linear infinite;
8
- will-change: transform;
9
- }
10
- `,document.head.appendChild(t)}const Ae=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Be=i.clsx,Fe=(t,n)=>r=>{var s;if(n?.variants==null)return Be(t,r?.class,r?.className);const{variants:l,defaultVariants:y}=n,u=Object.keys(l).map(p=>{const j=r?.[p],S=y?.[p];if(j===null)return null;const c=Ae(j)||Ae(S);return l[p][c]}),m=r&&Object.entries(r).reduce((p,j)=>{let[S,c]=j;return c===void 0||(p[S]=c),p},{}),C=n==null||(s=n.compoundVariants)===null||s===void 0?void 0:s.reduce((p,j)=>{let{class:S,className:c,...g}=j;return Object.entries(g).every(d=>{let[w,_]=d;return Array.isArray(_)?_.includes({...y,...m}[w]):{...y,...m}[w]===_})?[...p,S,c]:p},[]);return Be(t,u,C,r?.class,r?.className)},Ve=Fe("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input active:!bg-zinc-100 hover:!bg-zinc-50 active:bg-white !bg-white hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),se=o.forwardRef(({className:t,variant:n,size:r,loading:s,disabled:l,children:y,...u},m)=>e.jsxs("button",{className:i.cn(Ve({variant:n,size:r,className:t})),ref:m,disabled:l||s,...u,children:[s&&e.jsxs("svg",{className:"animate-spin -ml-1 mr-2 size-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),y]}));se.displayName="Button";const qe=(...t)=>t.filter((n,r,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===r).join(" ").trim();const it=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const lt=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,r,s)=>s?s.toUpperCase():r.toLowerCase());const Pe=t=>{const n=lt(t);return n.charAt(0).toUpperCase()+n.slice(1)};var dt={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"};const ct=t=>{for(const n in t)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1};const ut=o.forwardRef(({color:t="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:l="",children:y,iconNode:u,...m},C)=>o.createElement("svg",{ref:C,...dt,width:n,height:n,stroke:t,strokeWidth:s?Number(r)*24/Number(n):r,className:qe("lucide",l),...!y&&!ct(m)&&{"aria-hidden":"true"},...m},[...u.map(([p,j])=>o.createElement(p,j)),...Array.isArray(y)?y:[y]]));const Ee=(t,n)=>{const r=o.forwardRef(({className:s,...l},y)=>o.createElement(ut,{ref:y,iconNode:n,className:qe(`lucide-${it(Pe(t))}`,`lucide-${t}`,s),...l}));return r.displayName=Pe(t),r};const xt=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],mt=Ee("check",xt);const ht=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],pt=Ee("chevron-right",ht);const ft=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],gt=Ee("circle",ft),Ce=F.Root,Me=F.Trigger,bt=Y.forwardRef(({className:t,inset:n,children:r,...s},l)=>e.jsxs(F.SubTrigger,{ref:l,className:i.cn("flex cursor-default select-none items-center rounded-lg px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",n&&"pl-8",t),...s,children:[r,e.jsx(pt,{className:"ml-auto h-4 w-4"})]}));bt.displayName=F.SubTrigger.displayName;const yt=Y.forwardRef(({className:t,...n},r)=>e.jsx(F.SubContent,{ref:r,className:i.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));yt.displayName=F.SubContent.displayName;const ye=Y.forwardRef(({className:t,sideOffset:n=4,...r},s)=>e.jsx(F.Portal,{children:e.jsx(F.Content,{ref:s,sideOffset:n,className:i.cn("z-50 rounded-xl border bg-popover p-1 text-popover-foreground shadow-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));ye.displayName=F.Content.displayName;const je=Y.forwardRef(({className:t,inset:n,...r},s)=>e.jsx(F.Item,{ref:s,className:i.cn("relative flex cursor-pointer select-none items-center rounded-lg px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",t),...r}));je.displayName=F.Item.displayName;const jt=Y.forwardRef(({className:t,children:n,checked:r=!1,...s},l)=>e.jsxs(F.CheckboxItem,{ref:l,className:i.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:r,...s,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(F.ItemIndicator,{children:e.jsx(mt,{className:"h-4 w-4"})})}),n]}));jt.displayName=F.CheckboxItem.displayName;const wt=Y.forwardRef(({className:t,children:n,...r},s)=>e.jsxs(F.RadioItem,{ref:s,className:i.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(F.ItemIndicator,{children:e.jsx(gt,{className:"h-2 w-2 fill-current"})})}),n]}));wt.displayName=F.RadioItem.displayName;const vt=Y.forwardRef(({className:t,inset:n,...r},s)=>e.jsx(F.Label,{ref:s,className:i.cn("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",t),...r}));vt.displayName=F.Label.displayName;const kt=Y.forwardRef(({className:t,...n},r)=>e.jsx(F.Separator,{ref:r,className:i.cn("-mx-1 my-1 h-px bg-muted",t),...n}));kt.displayName=F.Separator.displayName;const Nt=Fe("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ge({className:t,variant:n,...r}){return e.jsx("div",{className:i.cn(Nt({variant:n}),t),...r})}function Dt({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:"m15 18-6-6 6-6"})})}function Ct({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:"m9 18 6-6-6-6"})})}const Mt=["January","February","March","April","May","June","July","August","September","October","November","December"];function Ue({date:t,view:n,events:r=[],onNavigatePrev:s,onNavigateNext:l,weekStartsOn:y=1,showEventCount:u=!0,className:m}){const C=Mt[t.getMonth()],p=t.getFullYear(),j=u?b.getEventsCountInView(r,t,n,y):0,S=b.getRangeText(t,n);return e.jsxs("div",{className:i.cn("min-w-0 flex-1",m),children:[e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 flex-wrap",children:[e.jsxs("span",{className:"text-base sm:text-lg font-semibold truncate",children:[C," ",p]}),u&&e.jsx(Ge,{variant:"outline",className:"px-1 sm:px-1.5 text-[10px] sm:text-xs shrink-0",children:j})]}),e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[e.jsx(se,{variant:"outline",size:"icon",className:"size-5 sm:size-6 [&_svg]:size-3 sm:[&_svg]:size-4",onClick:s,children:e.jsx(Dt,{})}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground truncate",children:S}),e.jsx(se,{variant:"outline",size:"icon",className:"size-5 sm:size-6 [&_svg]:size-3 sm:[&_svg]:size-4",onClick:l,children:e.jsx(Ct,{})})]})]})}const St=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"];function Ke({onClick:t,className:n}){const r=new Date;return e.jsxs("button",{type:"button",className:i.cn("flex size-11 sm:size-14 flex-col items-start overflow-hidden rounded-lg border shrink-0","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","hover:bg-accent/50 transition-colors",n),onClick:t,children:[e.jsx("p",{className:"flex h-4 sm:h-6 w-full items-center justify-center bg-primary text-center text-[10px] sm:text-xs font-semibold text-primary-foreground",children:St[r.getMonth()]}),e.jsx("p",{className:"flex w-full flex-1 items-center justify-center text-sm sm:text-lg font-bold",children:r.getDate()})]})}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("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 be({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:"18",x:"3",y:"3",rx:"2"}),e.jsx("path",{d:"M9 8h7"}),e.jsx("path",{d:"M8 12h6"}),e.jsx("path",{d:"M11 16h5"})]})}function He({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:"m6 9 6 6 6-6"})})}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("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function Ie({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:"M5 12h14"}),e.jsx("path",{d:"M12 5v14"})]})}function Et({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:"7",height:"7",x:"3",y:"3",rx:"1"}),e.jsx("rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"}),e.jsx("path",{d:"M14 4h7"}),e.jsx("path",{d:"M14 9h7"}),e.jsx("path",{d:"M14 15h7"}),e.jsx("path",{d:"M14 20h7"})]})}function Lt({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:"18",x:"3",y:"3",rx:"2"}),e.jsx("path",{d:"M12 3v18"})]})}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:"18",x:"3",y:"3",rx:"2"}),e.jsx("path",{d:"M3 12h18"}),e.jsx("path",{d:"M12 3v18"})]})}function _t({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:"18",x:"3",y:"3",rx:"2"}),e.jsx("path",{d:"M3 9h18"}),e.jsx("path",{d:"M3 15h18"}),e.jsx("path",{d:"M9 3v18"}),e.jsx("path",{d:"M15 3v18"})]})}const At=[{value:"day",label:"Day",icon:Et},{value:"week",label:"Week",icon:Lt},{value:"month",label:"Month",icon:Wt},{value:"year",label:"Year",icon:_t}],$e=[{value:"timeline-day",label:"1 Day",icon:be},{value:"timeline-3day",label:"3 Days",icon:be},{value:"timeline-week",label:"7 Days",icon:be}];function Bt({currentDate:t,view:n,events:r=[],onNavigateToday:s,onNavigatePrev:l,onNavigateNext:y,onNavigate:u,onViewChange:m,onAddEvent:C,availableViews:p=["day","week","month","agenda"],showTimelineViews:j=!1,timelineViews:S,settingsContent:c,showSettings:g=!1,filterContent:d,actions:w,className:_,weekStartsOn:I=1,labels:z={}}){const E=o.useMemo(()=>({today:"Today",addEvent:"Add Event",calendarView:"Calendar View",resourceView:"Resource View",...z}),[z]),R=()=>{s?.(),u?.("today")},L=()=>{l?.(),u?.("prev")},T=()=>{y?.(),u?.("next")},M=["day","week","month","year","agenda"].includes(n),P=n.startsWith("timeline-")||n.startsWith("resource-"),N=At.filter(h=>p.includes(h.value)),A=M?N.find(h=>h.value===n):null,G=P?$e.find(h=>h.value===n):null;return e.jsxs("div",{className:i.cn("flex flex-col w-full gap-3 mb-2",_),children:[e.jsxs("div",{className:"flex lg:flex-row flex-col w-full justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[e.jsx(Ke,{onClick:R}),e.jsx(Ue,{date:t,view:n,events:r,onNavigatePrev:L,onNavigateNext:T,weekStartsOn:I})]}),C&&e.jsx(se,{size:"icon",className:"shrink-0 lg:hidden",onClick:C,children:e.jsx(Ie,{className:"size-4"})})]}),e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 overflow-x-auto pb-1 -mb-1 scrollbar-none",children:[m&&N.length>0&&e.jsxs(Ce,{children:[e.jsxs(Me,{className:i.cn("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors","h-10 px-2 sm:px-3 gap-1 sm:gap-1.5 shrink-0",M?"bg-primary text-primary-foreground hover:bg-primary/90":"border border-input bg-background hover:bg-accent hover:text-accent-foreground"),children:[e.jsx(Tt,{className:"size-4"}),e.jsx("span",{className:"text-xs sm:text-sm font-medium",children:A?.label??E.calendarView}),e.jsx(He,{className:"size-3 opacity-60"})]}),e.jsx(ye,{align:"start",className:"min-w-[120px]",children:N.map(h=>{const f=h.icon;return e.jsxs(je,{onClick:()=>m(h.value),className:i.cn("gap-2",n===h.value&&"bg-accent"),children:[e.jsx(f,{className:"size-4"}),e.jsx("span",{children:h.label})]},h.value)})})]}),j&&m&&e.jsxs(Ce,{children:[e.jsxs(Me,{className:i.cn("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors","h-10 px-2 sm:px-3 gap-1 sm:gap-1.5 shrink-0",P?"bg-primary text-primary-foreground hover:bg-primary/90":"border border-input bg-white hover:bg-zinc-50 hover:text-accent-foreground"),children:[e.jsx(be,{className:"size-4"}),e.jsx("span",{className:"text-xs sm:text-sm font-medium",children:G?.label??E.resourceView}),e.jsx(He,{className:"size-3 opacity-60"})]}),e.jsx(ye,{align:"start",className:"min-w-[120px]",children:$e.map(h=>{const f=h.icon;return e.jsxs(je,{onClick:()=>m(h.value),className:i.cn("gap-2",n===h.value&&"bg-accent"),children:[e.jsx(f,{className:"size-4"}),e.jsx("span",{children:h.label})]},h.value)})})]}),g&&c&&e.jsxs(ee,{children:[e.jsx(te,{asChild:!0,children:e.jsx(se,{variant:"outline",size:"icon",className:"min-w-10 min-h-10 shrink-0 mx-0",children:e.jsx(zt,{className:"size-4 sm:size-5"})})}),e.jsx(J,{className:"w-auto min-w-80 p-0",align:"end",sideOffset:8,children:e.jsx("div",{className:"max-h-[70vh] overflow-y-auto p-4 space-y-6",children:c})})]}),w,C&&e.jsxs(se,{className:"hidden lg:flex shrink-0 max-h-10",onClick:C,children:[e.jsx(Ie,{className:"size-4"}),E.addEvent]})]})]}),d&&e.jsx("div",{className:"flex items-center gap-2 pb-1 -mb-1 scrollbar-none",children:d})]})}function Pt({events:t,date:n,daysAhead:r=60,badgeVariant:s="colored",onEventClick:l,className:y,renderEvent:u,renderPopover:m,slots:C,classNames:p}){const j=o.useMemo(()=>{const c=new Date(n);c.setHours(0,0,0,0);const g=new Date(c);return g.setDate(g.getDate()+r),t.filter(d=>d.endDate>=c&&d.startDate<=g)},[t,r,n]),S=o.useMemo(()=>{const c=b.groupEventsByDate(j),g=[];for(const[d,w]of c)g.push({date:new Date(d),dateKey:d,events:w});return g.sort((d,w)=>d.date.getTime()-w.date.getTime()),g},[j]);return S.length===0?e.jsx("div",{className:i.cn("flex flex-col items-center justify-center h-full py-12",y),children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-muted-foreground",children:"No events found"}),e.jsx("p",{className:"text-sm text-muted-foreground/70",children:"No events scheduled for this period"})]})}):e.jsxs("div",{className:i.cn("flex flex-col h-full overflow-auto",p?.agendaList,y),children:[e.jsx("div",{className:"sticky top-0 z-10 bg-background border-b px-4 py-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-medium",children:"Schedule"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[j.length," event",j.length!==1?"s":""]})]})}),e.jsx("div",{className:"flex-1",children:S.map(({date:c,dateKey:g,events:d})=>{const w=b.isToday(c),_=c.toLocaleDateString([],{weekday:"short"}),I=c.getDate(),z=c.toLocaleDateString([],{month:"short"});return e.jsxs("div",{className:i.cn("",p?.agendaDayGroup),children:[e.jsx("div",{className:i.cn("sticky top-[52px] z-10 bg-background px-4 py-3 border-b",p?.agendaDayHeader),children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex flex-col items-center min-w-[40px]",children:[e.jsx("span",{className:i.cn("text-[11px] font-medium uppercase tracking-wide",w?"text-primary":"text-muted-foreground"),children:_}),e.jsx("span",{className:i.cn("flex items-center justify-center rounded-full mt-0.5","size-10 text-xl font-normal",w?"bg-primary text-primary-foreground":"text-foreground"),children:I})]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[z," ",c.getFullYear()]})]})}),e.jsx("div",{className:"px-4 py-3 space-y-2 border-b last:border-b-0",children:d.map(E=>u?e.jsx("div",{children:u({event:E,variant:"full"})},E.id):e.jsx(xe,{event:E,variant:"full",badgeVariant:s,onClick:l,disablePopover:!!l&&!m,renderPopover:m,showTime:!0,showDescription:!0,showParticipants:!0,...p?.eventCard&&{className:p.eventCard}},E.id))})]},g)})})]})}const he=360,pe=480,ve=280;function Ye({isOpen:t,onClose:n,date:r,events:s,anchorRect:l,badgeVariant:y="colored",onEventClick:u,renderEvent:m,renderPopover:C,className:p}){const j=o.useRef(null),S=o.useRef(null),[c,g]=o.useState("closed"),d=o.useMemo(()=>[...s].sort((L,T)=>L.startDate.getTime()-T.startDate.getTime()),[s]),w=o.useMemo(()=>{if(!l)return{top:0,left:0,width:he,maxHeight:pe};const L=typeof window<"u"?window.innerWidth:1200,T=typeof window<"u"?window.innerHeight:800;let M=l.left+l.width/2-he/2;M=Math.max(16,Math.min(M,L-he-16));const P=Math.min(s.length*68+80,pe);let N=l.top+l.height/2-P/2;return N=Math.max(16,Math.min(N,T-P-16)),{top:N,left:M,width:he,maxHeight:pe}},[l,s.length]);o.useLayoutEffect(()=>{if(t&&l)g("entering"),requestAnimationFrame(()=>{requestAnimationFrame(()=>{g("open")})});else if(!t&&c==="open"){g("exiting");const L=setTimeout(()=>{g("closed")},ve);return()=>clearTimeout(L)}},[t,l]),o.useEffect(()=>{if(c==="closed")return;const L=T=>{T.key==="Escape"&&(T.stopPropagation(),n())};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[c,n]),o.useEffect(()=>{c==="open"&&S.current&&S.current.focus()},[c]);const _=o.useCallback(L=>{L.target===j.current&&n()},[n]);if(c==="closed")return null;const I=c==="entering"||c==="exiting",z=I&&l?{position:"fixed",top:l.top,left:l.left,width:l.width,height:l.height,maxHeight:l.height,opacity:c==="entering"?.7:0,transform:"scale(1)",borderRadius:"8px"}:{position:"fixed",top:w.top,left:w.left,width:w.width,maxHeight:w.maxHeight,opacity:1,transform:"scale(1)",borderRadius:"12px"},E=I?0:1,R=r.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric"});return e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:j,role:"presentation",onClick:_,className:"ic-expansion-backdrop",style:{position:"fixed",inset:0,zIndex:50,backgroundColor:"rgba(0, 0, 0, 0.2)",opacity:E,transition:`opacity ${ve}ms cubic-bezier(0.32, 0.72, 0, 1)`}}),e.jsxs("div",{ref:S,role:"dialog","aria-modal":"true","aria-label":`Events for ${R}`,tabIndex:-1,className:i.cn("ic-expansion-panel","bg-background border border-border shadow-2xl overflow-hidden","focus:outline-none",p),style:{...z,zIndex:51,transition:`all ${ve}ms cubic-bezier(0.32, 0.72, 0, 1)`,willChange:"top, left, width, height, max-height, opacity, border-radius"},children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b bg-muted/30",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-sm font-semibold text-foreground",children:R}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s.length," event",s.length!==1?"s":""]})]}),e.jsx("button",{type:"button",onClick:n,className:"flex items-center justify-center size-7 rounded-full hover:bg-muted transition-colors text-muted-foreground hover:text-foreground","aria-label":"Close",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 6 6 18"}),e.jsx("path",{d:"m6 6 12 12"})]})})]}),e.jsxs("div",{className:"overflow-y-auto px-3 py-2 space-y-1.5",style:{maxHeight:`${pe-64}px`},children:[d.map(L=>e.jsx("div",{onPointerDown:T=>T.stopPropagation(),children:m?m({event:L,variant:"compact"}):e.jsx(xe,{event:L,variant:"compact",badgeVariant:y,onClick:T=>{n(),u?.(T)},disablePopover:!!u&&!C,renderPopover:C,showTime:!0})},L.id)),s.length===0&&e.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No events"})]})]})]})}function Le({events:t,date:n,onEventClick:r,className:s}){if(t.length===0)return null;const l=t.some(m=>b.detectAllDayEvent(m)&&b.isSameDay(m.startDate,m.endDate)),y=t.some(m=>!b.isSameDay(m.startDate,m.endDate)||b.detectAllDayEvent(m)&&!b.isSameDay(m.startDate,m.endDate)),u=l&&y?"All day / Multi-day":l?"All day":"Multi-day";return e.jsxs("div",{className:i.cn("border-b bg-muted/20 px-2 py-1.5 space-y-1","sm:px-4 sm:py-2",s),children:[e.jsx("span",{className:"text-[10px] font-medium text-muted-foreground sm:text-xs",children:u}),e.jsx("div",{className:"flex flex-wrap gap-1",children:t.map(m=>{const C=le(m.color),p=b.detectAllDayEvent(m),j=b.isSameDay(m.startDate,n),S=b.isSameDay(m.endDate,n),c=p&&b.isSameDay(m.startDate,m.endDate);return e.jsxs("button",{type:"button",onClick:()=>r?.(m),title:b.formatEventTimeDisplay(m),className:i.cn("inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium transition-opacity hover:opacity-80","sm:px-2 sm:py-1 sm:text-xs",C.bg,C.text,m.isCanceled&&"opacity-60 line-through"),children:[!c&&j&&!S&&"→ ",!c&&!j&&S&&" ←",!c&&!j&&!S&&"↔ ",e.jsx("span",{className:"truncate max-w-24 sm:max-w-32",children:m.title}),c&&e.jsx("span",{className:"text-[9px] opacity-70 sm:text-[10px]",children:"All day"})]},m.id)})})]})}const Ht=5;function Xe({slot:t,onSelectionStart:n,onSelectionMove:r,onSelectionEnd:s,isSelected:l=!1,isSelecting:y=!1,disabled:u=!1,ariaLabel:m,children:C,className:p,height:j,style:S,dataAttributes:c}){const g=o.useRef(null),d=o.useRef(!1),w=o.useRef(!1),_=o.useRef(null),[I,z]=o.useState(!1),E=ie.useOptionalDragDrop(),R=o.useCallback(h=>{u||h.button!==0&&h.pointerType==="mouse"||(h.preventDefault(),g.current={x:h.clientX,y:h.clientY},d.current=!1,w.current=!0,n?.(t))},[u,t,n]),L=o.useCallback(h=>{if(!(g.current&&w.current&&!u))return;const f=h.clientX-g.current.x,W=h.clientY-g.current.y;Math.sqrt(f*f+W*W)>=Ht&&(d.current=!0)},[u]),T=o.useCallback(h=>{u||(h.buttons>0||y)&&r?.(t)},[u,y,t,r]),M=o.useCallback(()=>{u||(s?.(),g.current=null,d.current=!1,w.current=!1)},[u,s]),P=o.useCallback(h=>{if(!E?.isDragging||u)return;h.preventDefault(),h.dataTransfer.dropEffect="move",z(!0);const f=new Date,W=t.hour??f.getHours(),H=t.minute??(f.getMinutes()>=30?30:0);E.updateDragPreview?.(t.date,W,H)},[E,u,t]),N=o.useCallback(()=>{z(!1)},[]),A=o.useCallback(h=>{h.preventDefault(),z(!1),!(!E?.isDragging||u)&&E.endDrag?.()},[E,u]);o.useEffect(()=>{const h=()=>{w.current&&(w.current=!1,g.current=null,d.current=!1)};return window.addEventListener("pointerup",h),window.addEventListener("pointercancel",h),()=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h)}},[]);const G=o.useCallback(h=>{u||(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),n?.(t),s?.())},[u,t,n,s]);return e.jsx("button",{ref:_,type:"button","aria-label":m,"aria-disabled":u,"aria-pressed":l,disabled:u,onPointerDown:R,onPointerMove:L,onPointerUp:M,onPointerEnter:T,onKeyDown:G,onDragOver:P,onDragLeave:N,onDrop:A,className:i.cn("select-none touch-none cursor-pointer transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",!(y||u)&&"hover:bg-blue-50/60",l&&"bg-blue-100/70",I&&"bg-primary/20 ring-2 ring-primary ring-inset",u&&"cursor-not-allowed opacity-50",p),style:{height:j,...S},...c,children:C})}function We({slot:t,date:n,hour:r,minute:s,ariaLabel:l,...y}){const u=t??{date:n,hour:r??0,minute:s??0},m=l??`Add event at ${(u.hour??0).toString().padStart(2,"0")}:${(u.minute??0).toString().padStart(2,"0")} on ${u.date.toLocaleDateString()}`;return e.jsx(Xe,{slot:u,ariaLabel:m,...y})}function Je({slot:t,date:n,ariaLabel:r,...s}){const l=t??{date:n},y=r??`Select ${l.date.toLocaleDateString()}`;return e.jsx(Xe,{slot:l,ariaLabel:y,...s})}const de=96,ke=72,Ne=80;function It({events:t,date:n,visibleHours:r={startHour:0,endHour:24},workingHours:s,slotDuration:l=30,badgeVariant:y="colored",onEventClick:u,onSlotSelect:m,className:C,renderEvent:p,renderPopover:j,slots:S,classNames:c}){const g=60/l,d=100/g,w=o.useMemo(()=>{const v=[];for(let a=0;a<g;a++)v.push(a*l);return v},[g,l]),_=o.useMemo(()=>b.getEventsForDay(t,n),[t,n]),{singleDay:I,multiDay:z}=o.useMemo(()=>b.separateEventsByDuration(_),[_]),E=o.useMemo(()=>{const v=b.calculateOverlappingPositions(I,n,r,de),a=new Map;for(const x of v)a.set(x.event.id,x.position);return a},[I,n,r]),R=o.useMemo(()=>b.getVisibleHoursArray(r),[r]),L=new Date,T=b.isToday(n),M=o.useMemo(()=>{if(!T)return 0;const v=L.getHours()+L.getMinutes()/60;return v<r.startHour||v>r.endHour?-1:(v-r.startHour)*de},[T,r,L]),P=o.useRef(null);o.useLayoutEffect(()=>{const v=P.current;if(!v)return;const a=()=>{let x;if(T){const B=new Date().getHours();x=Math.max(B-1,r.startHour)}else{const B=n.getDay(),D=s?.[B];D?.enabled&&D.from>0?x=Math.max(D.from-1,r.startHour):x=Math.max(7,r.startHour)}const k=(x-r.startHour)*de;v.scrollTo({top:k,behavior:"instant"})};requestAnimationFrame(()=>{requestAnimationFrame(a)})},[n,s,r,T]);const N=ie.useOptionalSlotSelection(),A=o.useCallback(v=>{N?.startSelection(v)},[N]),G=o.useCallback(v=>{N?.updateSelection(v)},[N]),h=o.useCallback(()=>{N?.endSelection()},[N]),f=o.useCallback(v=>{u?.(v)},[u]),W=n.toLocaleDateString([],{weekday:"short"}),H=n.getDate(),O=b.isToday(n);return e.jsxs("div",{className:i.cn("flex flex-col h-full",C),children:[e.jsx("div",{className:i.cn("flex items-center gap-3 border-b px-4 py-3",c?.columnHeader,O&&c?.columnHeaderToday),children:e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("span",{className:i.cn("text-[11px] font-medium uppercase tracking-wide",O?"text-primary":"text-muted-foreground"),children:W}),e.jsx("span",{className:i.cn("flex items-center justify-center rounded-full mt-0.5","size-12 text-3xl font-normal",O?"bg-primary text-primary-foreground":"text-foreground"),children:H})]})}),z.length>0&&e.jsx(Le,{events:z,date:n,onEventClick:f,...c?.multiDayBanner&&{className:c.multiDayBanner}}),e.jsx("div",{ref:P,className:i.cn("flex-1 overflow-auto",c?.scrollContainer),children:e.jsxs("div",{className:"relative min-h-full",children:[R.map((v,a)=>{const k=!b.isWorkingHour(n,v,s);return e.jsxs("div",{className:i.cn("relative flex",k&&"bg-calendar-disabled-hour",c?.timeSlot,k?c?.timeSlotNonWorking:c?.timeSlotWorking),style:{height:de},children:[e.jsx("div",{className:i.cn("relative flex-shrink-0 border-r border-border/50 bg-zinc-50 dark:bg-zinc-900",c?.timeGutter),style:{width:ke},children:e.jsx("div",{className:"absolute -top-2.5 right-1 sm:right-2 flex h-5 items-center",children:a!==0&&e.jsx("span",{className:i.cn("text-[10px] sm:text-xs text-muted-foreground",c?.timeGutterLabel),children:b.formatHourLabel(v)})})}),e.jsxs("div",{className:"relative flex-1",children:[T&&!k&&e.jsx("div",{className:"absolute inset-0 bg-primary/5"}),a!==0&&e.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 border-b border-border/50"}),w.slice(1).map(B=>e.jsx("div",{className:"pointer-events-none absolute inset-x-0 border-b border-dashed border-border/30",style:{top:`${B/60*100}%`}},B)),w.map((B,D)=>{const K={date:n,hour:v,minute:B};return e.jsx(We,{slot:K,onSelectionStart:A,onSelectionMove:G,onSelectionEnd:h,isSelected:N?.isSlotSelected(K)??!1,isSelecting:N?.isSelecting??!1,disabled:k,className:"absolute inset-x-0",style:{top:`${D*d}%`,height:`${d}%`},ariaLabel:`Add event at ${b.formatHourLabel(v)}:${String(B).padStart(2,"0")}`},B)})]})]},v)}),e.jsx("div",{className:"absolute top-0 bottom-0 right-0 pointer-events-none",style:{left:ke},children:I.map(v=>{const a=E.get(v.id);if(!a)return null;const x=`calc(${a.width}% - 2px)`,k=`max(${Ne}px, ${x})`;return p?e.jsx("div",{className:"absolute pointer-events-auto p-0.5",style:{top:`${a.top}px`,left:`${a.left}%`,width:k,minWidth:`${Ne}px`},children:p({event:v,position:a})},v.id):e.jsx(ze,{event:v,position:{top:a.top,left:a.left,width:a.width,minWidth:Ne},hourHeight:de,badgeVariant:y,onClick:u,disablePopover:!!u&&!j,renderPopover:j,className:i.cn("pointer-events-auto",c?.eventCard)},v.id)})}),T&&M>=0&&e.jsxs("div",{className:i.cn("absolute left-0 right-0 z-20 flex items-center pointer-events-none",c?.currentTimeIndicator),style:{top:M,left:ke},children:[e.jsx("div",{className:"h-2.5 w-2.5 -ml-1 rounded-full bg-red-500"}),e.jsx("div",{className:"flex-1 h-0.5 bg-red-500"})]})]})})]})}const $t=[{full:"Monday",short:"Mon",tiny:"M"},{full:"Tuesday",short:"Tue",tiny:"T"},{full:"Wednesday",short:"Wed",tiny:"W"},{full:"Thursday",short:"Thu",tiny:"T"},{full:"Friday",short:"Fri",tiny:"F"},{full:"Saturday",short:"Sat",tiny:"S"},{full:"Sunday",short:"Sun",tiny:"S"}],Rt=[{full:"Sunday",short:"Sun",tiny:"S"},{full:"Monday",short:"Mon",tiny:"M"},{full:"Tuesday",short:"Tue",tiny:"T"},{full:"Wednesday",short:"Wed",tiny:"W"},{full:"Thursday",short:"Thu",tiny:"T"},{full:"Friday",short:"Fri",tiny:"F"},{full:"Saturday",short:"Sat",tiny:"S"}],ce=3;function Ot({events:t,date:n,weekStartsOn:r=1,badgeVariant:s="colored",onEventClick:l,onSlotSelect:y,onDayClick:u,className:m,renderEvent:C,renderPopover:p,showMoreMode:j,showMoreEventsInPopover:S=!1,slots:c,classNames:g}){const d=j??(S?"popover":"expand"),w=c?.dayCellHeader,_=c?.dayCellFooter,[I,z]=o.useState(null),[E,R]=o.useState(null),L=o.useMemo(()=>b.generateMonthGrid(n,r),[n,r]),T=o.useMemo(()=>{const f=new Map;for(const W of L){const H=W.date.toDateString(),O=b.getEventsForDay(t,W.date);O.sort((v,a)=>v.startDate.getTime()-a.startDate.getTime()),f.set(H,O)}return f},[L,t]),M=ie.useOptionalSlotSelection(),P=o.useCallback(f=>{M?.startSelection(f)},[M]),N=o.useCallback(f=>{M?.updateSelection(f)},[M]),A=o.useCallback(()=>{M?.endSelection()},[M]),G=o.useCallback(f=>{u?.(f)},[u]),h=r===0?Rt:$t;return e.jsxs("div",{className:i.cn("flex flex-col h-full overflow-hidden",m),children:[e.jsx("div",{className:"flex flex-col flex-1 overflow-auto",children:e.jsxs("div",{className:"flex flex-col flex-1 min-w-[560px] sm:min-w-0",children:[e.jsx("div",{className:i.cn("grid grid-cols-7 border-b !sticky !top-0 bg-background z-10",g?.weekdayHeader),children:h.map((f,W)=>e.jsxs("div",{className:i.cn("py-2 sm:py-2.5 text-center text-[11px] uppercase font-medium tracking-wide text-muted-foreground",W>=5&&"text-muted-foreground/70",g?.weekdayLabel),children:[e.jsx("span",{className:"sm:hidden",children:f.short}),e.jsx("span",{className:"hidden sm:inline",children:f.short})]},f.full))}),e.jsx("div",{className:i.cn("grid grid-cols-7 auto-rows-min",g?.monthGrid),children:L.map(f=>{const W=f.date.toDateString(),H=T.get(W)||[],O=b.isToday(f.date),v=f.date.getDay()===0||f.date.getDay()===6,a=H.length>ce;return e.jsxs(Je,{date:f.date,dataAttributes:{"data-day-key":W},onSelectionStart:P,onSelectionMove:N,onSelectionEnd:A,isSelected:M?.isSlotSelected({date:f.date})??!1,isSelecting:M?.isSelecting??!1,className:i.cn("relative flex flex-col border-r border-b text-left min-h-[80px] sm:min-h-[100px] overflow-hidden","[&:nth-child(7n)]:border-r-0",!f.isCurrentMonth&&"bg-muted/20",v&&f.isCurrentMonth&&"bg-muted/10",g?.dayCell,O&&g?.dayCellToday,!f.isCurrentMonth&&g?.dayCellOutside,v&&g?.dayCellWeekend),ariaLabel:`${f.date.toLocaleDateString()} - ${H.length} events. Click to create event, double-click to view day.`,children:[e.jsx("div",{className:i.cn("flex items-center justify-center p-1",!f.isCurrentMonth&&"text-muted-foreground/40",g?.dayCellNumber),children:e.jsx("button",{type:"button",onClick:x=>{x.stopPropagation(),G(f.date)},className:i.cn("flex items-center justify-center rounded-full transition-colors","size-7 text-sm font-normal",O?"bg-primary text-primary-foreground":"hover:bg-muted"),children:f.date.getDate()})}),w&&e.jsx(w,{date:f.date,events:H,isToday:O,isCurrentMonth:f.isCurrentMonth,isWeekend:v,view:"month"}),e.jsxs("div",{className:i.cn("flex-1 overflow-hidden px-2 pt-1 pb-1 space-y-1",g?.dayCellContent),children:[H.slice(0,ce).map(x=>e.jsx("div",{onPointerDown:k=>{k.stopPropagation()},children:C?C({event:x,variant:"compact"}):e.jsx(xe,{event:x,variant:"compact",badgeVariant:s,onClick:l,disablePopover:!!l&&!p,renderPopover:p,showTime:!1,enableDrag:!0,...g?.eventCardCompact&&{className:g.eventCardCompact}})},x.id)),a&&d==="expand"&&e.jsxs("button",{type:"button",onPointerDown:x=>x.stopPropagation(),onClick:x=>{x.stopPropagation();const k=document.querySelector(`[data-day-key="${W}"]`);R({date:f.date,events:H,rect:k?.getBoundingClientRect()??new DOMRect(window.innerWidth/2-180,window.innerHeight/2-240,0,0)})},className:i.cn("w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer",g?.moreEventsIndicator),children:["+",H.length-ce," more"]}),a&&d==="popover"&&e.jsxs(ee,{open:I===W,onOpenChange:x=>z(x?W:null),children:[e.jsx(te,{asChild:!0,children:e.jsxs("button",{type:"button",onPointerDown:x=>x.stopPropagation(),onClick:x=>{x.stopPropagation(),z(W)},className:i.cn("w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer",g?.moreEventsIndicator),children:["+",H.length-ce," more"]})}),e.jsxs(J,{align:"start",side:"right",sideOffset:8,className:"w-72 max-h-80 overflow-y-auto p-2",onPointerDown:x=>x.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 pb-2 border-b",children:[e.jsx("span",{className:"text-sm font-medium",children:f.date.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"})}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[H.length," events"]})]}),e.jsx("div",{className:"space-y-1.5",children:H.map(x=>e.jsx("div",{children:C?C({event:x,variant:"compact"}):e.jsx(xe,{event:x,variant:"compact",badgeVariant:s,onClick:k=>{z(null),l?.(k)},disablePopover:!!l&&!p,renderPopover:p,showTime:!0})},x.id))})]})]}),a&&d==="dayView"&&e.jsxs("div",{onPointerDown:x=>{x.stopPropagation(),G(f.date)},className:i.cn("w-full text-left text-xs text-muted-foreground hover:text-foreground hover:underline px-1.5 cursor-pointer",g?.moreEventsIndicator),children:["+",H.length-ce," more"]})]}),_&&e.jsx(_,{date:f.date,events:H,isToday:O,isCurrentMonth:f.isCurrentMonth,isWeekend:v,view:"month"})]},W)})})]})}),e.jsx(Ye,{isOpen:E!==null,onClose:()=>R(null),date:E?.date??new Date,events:E?.events??[],anchorRect:E?.rect??null,badgeVariant:s,onEventClick:l,renderEvent:C,renderPopover:p})]})}const oe=96,fe=56,Re=72,X=120,ge=100,Ft=3;function Vt({events:t,date:n,weekStartsOn:r=1,visibleHours:s={startHour:0,endHour:24},workingHours:l,slotDuration:y=30,badgeVariant:u="colored",onEventClick:m,onSlotSelect:C,onDayClick:p,className:j,renderEvent:S,renderPopover:c,slots:g,classNames:d}){const w=60/y,_=100/w,I=o.useMemo(()=>{const a=[];for(let x=0;x<w;x++)a.push(x*y);return a},[w,y]),z=o.useMemo(()=>b.getWeekDays(n,r),[n,r]),E=o.useMemo(()=>b.getVisibleHoursArray(s),[s]),R=o.useMemo(()=>{const a=new Map;for(const x of z){const k=x.toDateString(),B=b.getEventsForDay(t,x),{singleDay:D,multiDay:K}=b.separateEventsByDuration(B),$=b.calculateOverlappingPositions(D,x,s,oe),V=new Map;let q=1;for(const U of $)if(V.set(U.event.id,U.position),U.position.width>0){const Z=Math.round(100/U.position.width);q=Math.max(q,Z)}a.set(k,{singleDay:D,multiDay:K,positions:V,maxOverlapping:q})}return a},[z,t,s]),L=o.useMemo(()=>{const a=new Map;for(const{multiDay:x}of R.values())for(const k of x)a.set(k.id,k);return Array.from(a.values())},[R]),T=new Date,M=z.findIndex(a=>b.isToday(a)),P=o.useMemo(()=>{if(M<0)return-1;const a=T.getHours()+T.getMinutes()/60;return a<s.startHour||a>s.endHour?-1:(a-s.startHour)*oe},[M,s,T]),N=o.useRef(null);o.useLayoutEffect(()=>{const a=N.current;if(!a)return;const x=()=>{let k;if(M!==-1){const D=new Date().getHours();k=Math.max(D-1,s.startHour)}else{const K=new Date().getDay();let $=l?.[K];if(!$?.enabled||$.from===0){const V=l?.[1];V?.enabled&&($=V)}$?.enabled&&$.from>0?k=Math.max($.from-1,s.startHour):k=Math.max(7,s.startHour)}const B=(k-s.startHour)*oe;a.scrollTo({top:B,behavior:"instant"})};requestAnimationFrame(()=>{requestAnimationFrame(x)})},[n,l,s,M]);const A=ie.useOptionalSlotSelection(),G=o.useCallback(a=>{A?.startSelection(a)},[A]),h=o.useCallback(a=>{A?.updateSelection(a)},[A]),f=o.useCallback(()=>{A?.endSelection()},[A]),W=o.useCallback(a=>{m?.(a)},[m]),H=fe+7*X,O=o.useMemo(()=>{const a=[];for(const x of z){const k=x.toDateString(),D=R.get(k)?.maxOverlapping??1;D>Ft?a.push(Math.max(X,D*ge)):a.push(X)}return a},[z,R]),v=fe+O.reduce((a,x)=>a+x,0);return e.jsxs("div",{className:i.cn("ic-week-view flex flex-col h-full",j),children:[L.length>0&&e.jsx(Le,{events:L,date:b.startOfWeek(n,r),onEventClick:W,...d?.multiDayBanner&&{className:d.multiDayBanner}}),e.jsx("div",{ref:N,className:i.cn("ic-week-scroll-container flex-1",d?.scrollContainer),children:e.jsxs("div",{style:{minWidth:Math.max(H,v)},children:[e.jsx("div",{className:"ic-week-header sticky top-0 z-20 border-b bg-background",children:e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"flex-shrink-0 flex items-end justify-center pb-2 text-[10px] text-muted-foreground/70",style:{width:fe,height:Re},children:e.jsxs("span",{className:"hidden sm:inline",children:["GMT",(()=>{const a=new Date().getTimezoneOffset(),x=Math.abs(Math.floor(a/60)),k=a<=0?"+":"-";return x>0?`${k}${String(x).padStart(2,"0")}`:""})()]})}),z.map((a,x)=>{const k=b.isToday(a),B=O[x]??X,D=B>X;return e.jsxs("div",{className:i.cn("flex-1 flex flex-col items-center justify-center border-r last:border-r-0 py-2",d?.columnHeader,k&&d?.columnHeaderToday),style:{height:Re,minWidth:D?B:X},children:[e.jsx("span",{className:i.cn("text-[11px] font-medium uppercase tracking-wide",k?"text-primary":"text-muted-foreground"),children:a.toLocaleDateString([],{weekday:"short"})}),e.jsx("button",{type:"button",onClick:()=>p?.(a),className:i.cn("flex items-center justify-center rounded-full transition-colors mt-0.5","size-10 text-2xl font-normal",k?"bg-primary text-primary-foreground":"text-foreground hover:bg-muted"),children:a.getDate()})]},a.toDateString())})]})}),e.jsxs("div",{className:"relative flex",children:[e.jsx("div",{className:i.cn("ic-hour-column sticky left-0 z-10 bg-zinc-50 border-r",d?.timeGutter),style:{width:fe},children:E.map((a,x)=>e.jsx("div",{className:"relative",style:{height:oe},children:e.jsx("div",{className:"absolute -top-2.5 right-1 sm:right-2 flex h-5 items-center",children:x!==0&&e.jsx("span",{className:i.cn("text-[10px] sm:text-xs text-muted-foreground",d?.timeGutterLabel),children:b.formatHourLabel(a)})})},a))}),e.jsx("div",{className:"ic-week-grid relative flex-1",children:e.jsx("div",{className:"flex divide-x",children:z.map((a,x)=>{const k=a.toDateString(),B=R.get(k),D=O[x]??X,K=D>X;return e.jsxs("div",{className:"ic-day-column relative flex-1",style:{minWidth:K?D:X},children:[E.map(($,V)=>{const U=!b.isWorkingHour(a,$,l);return e.jsxs("div",{className:i.cn("relative",U&&"bg-calendar-disabled-hour",b.isToday(a)&&!U&&"bg-primary/5",d?.timeSlot,U?d?.timeSlotNonWorking:d?.timeSlotWorking),style:{height:oe},children:[V!==0&&e.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 border-b border-border/50"}),I.slice(1).map(Z=>e.jsx("div",{className:"pointer-events-none absolute inset-x-0 border-b border-dashed border-border/30",style:{top:`${Z/60*100}%`}},Z)),I.map((Z,Ze)=>{const _e={date:a,hour:$,minute:Z};return e.jsx(We,{slot:_e,onSelectionStart:G,onSelectionMove:h,onSelectionEnd:f,isSelected:A?.isSlotSelected(_e)??!1,isSelecting:A?.isSelecting??!1,disabled:U,className:"absolute inset-x-0",style:{top:`${Ze*_}%`,height:`${_}%`},ariaLabel:`Add event on ${a.toLocaleDateString()} at ${b.formatHourLabel($)}:${String(Z).padStart(2,"0")}`},Z)})]},$)}),B?.singleDay.map($=>{const V=B.positions.get($.id);if(!V)return null;const q=`calc(${V.width}% - 2px)`,U=`max(${ge}px, ${q})`;return S?e.jsx("div",{className:"absolute pointer-events-auto p-0.5",style:{top:`${V.top}px`,left:`${V.left}%`,width:U,minWidth:`${ge}px`},children:S({event:$,position:V})},$.id):e.jsx(ze,{event:$,position:{top:V.top,left:V.left,width:V.width,minWidth:ge},hourHeight:oe,badgeVariant:u,onClick:m,disablePopover:!!m&&!c,renderPopover:c,className:i.cn("pointer-events-auto",d?.eventCard)},$.id)}),x===M&&P>=0&&e.jsxs("div",{className:i.cn("absolute left-0 right-0 z-20 flex items-center pointer-events-none",d?.currentTimeIndicator),style:{top:P},children:[e.jsx("div",{className:"h-2 w-2 -ml-1 rounded-full bg-red-500"}),e.jsx("div",{className:"flex-1 h-0.5 bg-red-500"})]})]},a.toDateString())})})})]})]})})]})}exports.AgendaView=Pt;exports.Badge=Ge;exports.Button=se;exports.CalendarHeader=Bt;exports.DateNavigator=Ue;exports.DayEventsExpansion=Ye;exports.DaySlot=Je;exports.DayView=It;exports.DropdownMenu=Ce;exports.DropdownMenuContent=ye;exports.DropdownMenuItem=je;exports.DropdownMenuTrigger=Me;exports.EventBlock=ze;exports.EventCard=xe;exports.MonthView=Ot;exports.MultiDayBanner=Le;exports.MultiDayEventBar=at;exports.Popover=ee;exports.PopoverAnchor=nt;exports.PopoverContent=J;exports.PopoverTrigger=te;exports.TimeSlot=We;exports.TodayButton=Ke;exports.Tooltip=ne;exports.TooltipContent=Q;exports.TooltipProvider=rt;exports.TooltipTrigger=re;exports.WeekView=Vt;exports.buttonVariants=Ve;exports.getEventColorClasses=le;
11
- //# sourceMappingURL=week-view-DOvr2VIq.cjs.map