@weekwise/react 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/dist/components/day-week-view/useTimeColumnWidth.d.ts +7 -1
- package/dist/components/month-view/MonthView.utils.d.ts +0 -2
- package/dist/components/month-view/MonthViewEvent.d.ts +3 -1
- package/dist/components/month-view/MonthViewWeek.d.ts +2 -0
- package/dist/components/month-view/useMonthResize.d.ts +5 -1
- package/dist/contexts/DayWeekDrawerContext.d.ts +11 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useAbsEventRect.d.ts +3 -1
- package/dist/hooks/useEventResize.d.ts +4 -0
- package/dist/hooks/useItemsLayout.d.ts +33 -0
- package/dist/hooks/useMove.d.ts +1 -0
- package/dist/hooks/useMove.types.d.ts +9 -0
- package/dist/hooks/useRefList.d.ts +13 -0
- package/dist/hooks/useScrollIntent.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1041 -906
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +9 -9
package/LICENSE
CHANGED
|
@@ -4,6 +4,12 @@ import { type RefObject } from "react";
|
|
|
4
4
|
* `undefined` while the theme's `--ww-time-column` holds them. Measured again when the
|
|
5
5
|
* labels change and once the fonts have loaded.
|
|
6
6
|
*/
|
|
7
|
-
export default function useTimeColumnWidth(
|
|
7
|
+
export default function useTimeColumnWidth(
|
|
8
|
+
/** The view's root, which sets `--ww-time-column` for its own content. */
|
|
9
|
+
rootRef: RefObject<HTMLElement | null>,
|
|
10
|
+
/** The `<time>` label elements, e.g. from `useRefList`. */
|
|
11
|
+
labelsRef: {
|
|
12
|
+
readonly current: readonly (HTMLElement | null)[];
|
|
13
|
+
}, labels: readonly string[],
|
|
8
14
|
/** Width of the time column when `--ww-time-column` is not set. */
|
|
9
15
|
defaultWidth: number): number | undefined;
|
|
@@ -7,6 +7,4 @@ type CSSVariables = Record<`--${string}`, number>;
|
|
|
7
7
|
export declare function cssVariables(variables: CSSVariables, style?: CSSProperties): CSSProperties;
|
|
8
8
|
/** Splits the month grid's days into weeks of 7. */
|
|
9
9
|
export declare function splitIntoWeeks(days: CalendarDate[]): CalendarDate[][];
|
|
10
|
-
/** Index (`data-day-index`) of the day cell in `container` under the point, or of the nearest one; -1 without cells. */
|
|
11
|
-
export declare function getNearestDayIndex(container: HTMLElement | null, x: number, y: number): number;
|
|
12
10
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CalendarDate } from "@weekwise/core";
|
|
2
|
-
import type { DetailedHTMLProps, HTMLAttributes } from "react";
|
|
2
|
+
import type { DetailedHTMLProps, HTMLAttributes, RefObject } from "react";
|
|
3
3
|
import { type MonthBar } from "@weekwise/core";
|
|
4
4
|
import type { EventData } from "../../Calendar.types";
|
|
5
5
|
import type { MonthResizeActions } from "./useMonthResize";
|
|
@@ -8,6 +8,8 @@ export type MonthViewEventProps = DetailedHTMLProps<HTMLAttributes<HTMLDivElemen
|
|
|
8
8
|
eventData: MonthBar<unknown, CalendarDate>;
|
|
9
9
|
/** The days of the week row the bar is in. */
|
|
10
10
|
weekDays: CalendarDate[];
|
|
11
|
+
/** The week row the bar lies in: where it is grabbed picks the day the drag moves. */
|
|
12
|
+
weekRef: RefObject<HTMLDivElement | null>;
|
|
11
13
|
/** Whether the bar's edges stretch the event into other days. */
|
|
12
14
|
resizable?: boolean;
|
|
13
15
|
/** Resizing by the bar's edges, run by the view. */
|
|
@@ -4,6 +4,8 @@ export interface MonthViewWeekProps {
|
|
|
4
4
|
days: CalendarDate[];
|
|
5
5
|
/** Index of the week's first day in the month grid. */
|
|
6
6
|
firstDayIndex: number;
|
|
7
|
+
/** Ref for the cell of the day at an index in the month grid. */
|
|
8
|
+
cellRef: (index: number) => (node: HTMLDivElement | null) => void;
|
|
7
9
|
/** Bars to draw: with the resized event's new range while it changes. */
|
|
8
10
|
layout: MonthWeekLayout<unknown, CalendarDate>;
|
|
9
11
|
/**
|
|
@@ -10,9 +10,13 @@ export interface MonthResizeActions {
|
|
|
10
10
|
end: (commit?: boolean) => void;
|
|
11
11
|
}
|
|
12
12
|
interface UseMonthResizeParams<TValue> {
|
|
13
|
-
/** Days of the month grid
|
|
13
|
+
/** Days of the month grid. */
|
|
14
14
|
days: CalendarDate[];
|
|
15
15
|
viewportRef: RefObject<HTMLElement | null>;
|
|
16
|
+
/** The day cells, in the order of `days`: the edge goes into the one nearest the pointer. */
|
|
17
|
+
cellsRef: {
|
|
18
|
+
readonly current: readonly (HTMLElement | null)[];
|
|
19
|
+
};
|
|
16
20
|
dateUtils: DateAdapter<CalendarDate>;
|
|
17
21
|
eventMap: EventMap<TValue, CalendarDate>;
|
|
18
22
|
disabled: boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
/** The day column an event of the day/week view is drawn in. */
|
|
3
|
+
export type DayWeekDrawerContextValue = {
|
|
4
|
+
/** The whole column: what an event resized in it is bounded by. */
|
|
5
|
+
drawerRef: RefObject<HTMLDivElement | null>;
|
|
6
|
+
/** The events' container, which their positions are relative to. */
|
|
7
|
+
containerRef: RefObject<HTMLDivElement | null>;
|
|
8
|
+
};
|
|
9
|
+
declare const DayWeekDrawerContext: import("react").Context<DayWeekDrawerContextValue | undefined>;
|
|
10
|
+
export default DayWeekDrawerContext;
|
|
11
|
+
export declare function useDayWeekDrawerContext(): DayWeekDrawerContextValue;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -6,9 +6,11 @@ export { default as useDocumentCursor, type DocumentCursor } from "./useDocument
|
|
|
6
6
|
export { default as useEventCallback } from "./useEventCallback";
|
|
7
7
|
export { default as useGlobalListeners } from "./useGlobalListeners";
|
|
8
8
|
export { default as useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect";
|
|
9
|
+
export { default as useItemsLayout, type ItemsLayout } from "./useItemsLayout";
|
|
9
10
|
export { default as useMergedRefs } from "./useMergedRefs";
|
|
10
11
|
export { default as useMove } from "./useMove";
|
|
11
12
|
export { default as usePrevious } from "./usePrevious";
|
|
13
|
+
export { default as useRefList, type RefList } from "./useRefList";
|
|
12
14
|
export { default as useResizeObserver } from "./useResizeObserver";
|
|
13
15
|
export { useScrollBarSize } from "./useScrollBarSize";
|
|
14
16
|
export { default as useStateRef } from "./useStateRef";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { type RefObject } from "react";
|
|
2
2
|
import type { MeasuredEventData } from "../components/day-week-view";
|
|
3
|
-
export default function useAbsEventRect(rootRef: RefObject<HTMLDivElement | null>,
|
|
3
|
+
export default function useAbsEventRect(rootRef: RefObject<HTMLDivElement | null>,
|
|
4
|
+
/** The element the event is positioned in. */
|
|
5
|
+
containerRef: RefObject<HTMLElement | null>, relativeRect: MeasuredEventData["rect"]): import("@weekwise/core").LayoutRect | null;
|
|
@@ -20,6 +20,10 @@ export interface EventResizeActions {
|
|
|
20
20
|
interface UseEventResizeParams {
|
|
21
21
|
days: CalendarDate[];
|
|
22
22
|
viewportRef: RefObject<HTMLElement | null>;
|
|
23
|
+
/** The day columns by day index, where the pointer picks the day. */
|
|
24
|
+
columnsRef: {
|
|
25
|
+
readonly current: readonly (HTMLElement | null)[];
|
|
26
|
+
};
|
|
23
27
|
dateUtils: DateAdapter<CalendarDate>;
|
|
24
28
|
bounds: TimeBounds;
|
|
25
29
|
timeStep: number;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
import { Rect } from "@weekwise/core";
|
|
3
|
+
export interface ItemsLayout {
|
|
4
|
+
/**
|
|
5
|
+
* Measures the container and its items for a gesture, and again whenever the container
|
|
6
|
+
* changes size, until {@link ItemsLayout.release}. `false` without a container.
|
|
7
|
+
*/
|
|
8
|
+
measure: () => boolean;
|
|
9
|
+
/** Ends the gesture: the measurements stop following the container's size. */
|
|
10
|
+
release: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* The container's box where it is now: it follows the scroll of the container's scrollable
|
|
13
|
+
* ancestors without measuring again. `null` before {@link ItemsLayout.measure}.
|
|
14
|
+
*/
|
|
15
|
+
container: () => Rect | null;
|
|
16
|
+
/**
|
|
17
|
+
* Index of the item under the point, or of the nearest one; `-1` without items. With
|
|
18
|
+
* `axis: "x"` only the horizontal distance counts (columns as tall as the container).
|
|
19
|
+
*/
|
|
20
|
+
nearestIndex: (x: number, y: number, axis?: "x" | "xy") => number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Where a container and the items in it (day columns, day cells) are during a pointer gesture,
|
|
24
|
+
* measured once at its start instead of on every move. The items scroll with the container, so
|
|
25
|
+
* their boxes are kept from its corner and only the container follows the scroll.
|
|
26
|
+
*/
|
|
27
|
+
export default function useItemsLayout(containerRef: RefObject<HTMLElement | null>,
|
|
28
|
+
/** The items by index, e.g. from `useRefList`; an unmounted one is `null`. */
|
|
29
|
+
itemsRef: ItemsRef): ItemsLayout;
|
|
30
|
+
type ItemsRef = {
|
|
31
|
+
readonly current: readonly (HTMLElement | null)[];
|
|
32
|
+
};
|
|
33
|
+
export {};
|
package/dist/hooks/useMove.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ import { type DOMAttributes } from "react";
|
|
|
2
2
|
import type { UseMoveParams } from "./useMove.types";
|
|
3
3
|
export default function useMove<Element extends HTMLElement = HTMLElement>(params: UseMoveParams): {
|
|
4
4
|
listeners: DOMAttributes<Element>;
|
|
5
|
+
ref: (node: Element | null) => void;
|
|
5
6
|
};
|
|
@@ -18,10 +18,19 @@ export interface MoveData extends PointerCoordinates {
|
|
|
18
18
|
initialClientX: number;
|
|
19
19
|
initialClientY: number;
|
|
20
20
|
isDistanceReached: boolean;
|
|
21
|
+
/** Pending start of a touch that holds for `touchDelay`. */
|
|
22
|
+
holdTimer: ReturnType<typeof setTimeout> | null;
|
|
23
|
+
/** A touch gesture is under way: the page must not scroll under it. */
|
|
24
|
+
isTouchActive: boolean;
|
|
21
25
|
}
|
|
22
26
|
export interface UseMoveParams {
|
|
23
27
|
/** The minimum distance in pixels that a move event should be considered. */
|
|
24
28
|
distance?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Milliseconds a touch holds still before the move starts. Moving earlier scrolls the page
|
|
31
|
+
* instead, as a long press does in mobile calendars. `0` (default) starts at once.
|
|
32
|
+
*/
|
|
33
|
+
touchDelay?: number;
|
|
25
34
|
/** Handler that is called when a move interaction starts. */
|
|
26
35
|
onMoveStart: (e: MoveStartEvent) => boolean | void;
|
|
27
36
|
/** Handler that is called when the element is moved. */
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface RefList<T> {
|
|
2
|
+
/** The mounted elements by index; an unmounted one is `null`. Read it in handlers, not in render. */
|
|
3
|
+
readonly elements: {
|
|
4
|
+
readonly current: readonly (T | null)[];
|
|
5
|
+
};
|
|
6
|
+
/** A callback ref that keeps the element at `index`, the same function for an index every render. */
|
|
7
|
+
refAt: (index: number) => (node: T | null) => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Refs to the elements of a rendered list: `<div ref={refAt(index)} />` for each item, then
|
|
11
|
+
* `elements.current[index]` in an event handler.
|
|
12
|
+
*/
|
|
13
|
+
export default function useRefList<T extends Element>(): RefList<T>;
|
|
@@ -7,7 +7,7 @@ interface ScrollIntent {
|
|
|
7
7
|
x: Record<ScrollDirection, boolean>;
|
|
8
8
|
y: Record<ScrollDirection, boolean>;
|
|
9
9
|
}
|
|
10
|
-
export default function useScrollIntent({ delta, disabled
|
|
10
|
+
export default function useScrollIntent({ delta, disabled }: {
|
|
11
11
|
delta: Coordinates;
|
|
12
12
|
disabled: boolean;
|
|
13
13
|
}): ScrollIntent;
|
package/dist/index.cjs
CHANGED
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
A component is changing the default state of an uncontrolled value after being initialized.
|
|
10
10
|
To suppress this warning opt to use a controlled value.
|
|
11
11
|
More info: https://reactjs.org/link/controlled-components
|
|
12
|
-
${a.current.stack}`)},[i,r,t])}function y(n){let{controlled:r,default:i}=n,[a,o]=(0,e.useState)(()=>i===void 0&&`initialState`in n&&n.initialState!==void 0?n.initialState:i),[s]=(0,e.useState)(i),c=_(r);t.isDevEnvironment&&v(c,r,s,i);let l=(0,e.useCallback)(e=>{c||o(e)},[c]);return[c?r:a,l,c]}function b(t){(0,e.useEffect)(()=>{if(!t)return;let e=`ww-cursor-${t}`,n=document.documentElement;return n.classList.add(e),()=>n.classList.remove(e)},[t])}var x={};function S(t,n){let r=(0,e.useRef)(x);return r.current===x&&(r.current=t(n)),r}function C(){if(t.isDevEnvironment)throw Error(`useEventCallback: Cannot call an event handler while rendering.`)}function w(){let e={next:void 0,callback:C,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function T(t){let n=S(w).current;return n.next=t,(0,e.useInsertionEffect)(n.effect),n.trampoline}function E(){let[t]=(0,e.useState)(()=>({current:new Map})),{addGlobalListener:n,removeGlobalListener:r,removeAllGlobalListeners:i}=(0,e.useMemo)(()=>{function e(e,n,r,i){let a=typeof i!=`boolean`&&i?.once?n=>{t.current.delete(r),e instanceof Document?r.call(e,n):r(n)}:r;e.addEventListener(n,r,i),t.current.set(r,{type:n,target:e,fn:a,options:i})}function n(e,n,r,i){let a=t.current.get(r)?.fn||r;e.removeEventListener(n,a,i),t.current.delete(r)}function r(){t.current.forEach(({target:e,type:t,options:r},i)=>{n(e,t,i,r)})}return{addGlobalListener:e,removeGlobalListener:n,removeAllGlobalListeners:r}},[t]);return(0,e.useEffect)(()=>i,[i]),{addGlobalListener:n,removeGlobalListener:r,removeAllGlobalListeners:i}}var D=e=>!e||typeof e==`function`?e:t=>{e.current=t};function O(...e){return t=>{e.forEach(e=>{D(e)?.(t)})}}function k(...t){return(0,e.useMemo)(()=>O(...t),t)}function A(t){let[{state:n}]=(0,e.useState)(()=>({state:{activePointId:null,clientX:0,clientY:0,initialClientX:0,initialClientY:0,isDistanceReached:!1}})),r=(0,e.useRef)(t);r.current=t;let{addGlobalListener:i,removeGlobalListener:a}=E();return{listeners:(0,e.useMemo)(()=>{let e={},t=e=>{`stopPropagation`in e&&`preventDefault`in e&&(e.stopPropagation(),e.preventDefault())},o=(e,t)=>{let{current:{distance:i=0,...a}}=r,{clientX:o,clientY:s}=e,{clientX:c,clientY:l}=n;n.clientX=o,n.clientY=s,t!==void 0&&(n.activePointId=t);let u=e=>({shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,clientX:o,clientY:s});return{start(e,t){return n.initialClientX=o,n.initialClientY=s,n.isDistanceReached=i===0,a.onMoveStart({type:`movestart`,pointerType:e,...u(t)})},move(e,t,r,d){let f=o-n.initialClientX,p=s-n.initialClientY;!n.isDistanceReached&&f**2+p**2>=i**2&&(n.isDistanceReached=!0),n.isDistanceReached&&a.onMove({type:`move`,pointerType:e,deltaX:r??o-c,deltaY:d??s-l,initialDeltaX:f,initialDeltaY:p,...u(t)})},end(e,t){a.onMoveEnd({type:`moveend`,pointerType:e,...u(t)})}}};if(typeof PointerEvent>`u`){let r=e=>{e.button===0&&o(e).move(`mouse`,e)},s=e=>{e.button===0&&o(e).end(`mouse`,e)};e.onMouseDown=e=>{e.button===0&&(o(e).start(`mouse`,e)===!1?o(e,null):(i(window,`mousemove`,r,!1),i(window,`mouseup`,s,!1),t(e)))};let c=e=>{let t=[...e.changedTouches].findIndex(({identifier:e})=>e===n.activePointId);if(t>=0){let n=e.changedTouches[t];o(n).move(`touch`,e)}},l=e=>{let t=[...e.changedTouches].findIndex(({identifier:e})=>e===n.activePointId);t>=0&&(o(e.changedTouches[t],null).end(`touch`,e),i(window,`touchmove`,c),a(window,`touchend`,l),a(window,`touchcancel`,l))};e.onTouchStart=e=>{if(e.changedTouches.length===0||n.activePointId!==null)return;let r=e.changedTouches[0];o(r,r.identifier).start(`touch`,e)===!1?o(r,null):(i(window,`touchmove`,c,!1),i(window,`touchend`,l,!1),i(window,`touchcancel`,l,!1),t(e))}}else{let r=e=>{if(e.pointerId===n.activePointId){let t=e.pointerType||`mouse`;o(e).move(t,e)}},s=e=>{if(e.pointerId===n.activePointId){let t=e.pointerType||`mouse`;o(e,null).end(t,e),a(window,`pointermove`,r,!1),a(window,`pointerup`,s,!1),a(window,`pointercancel`,s,!1)}};e.onPointerDown=e=>{if(e.button===0&&n.activePointId===null){let n=e.pointerType||`mouse`;o(e,e.pointerId).start(n,e)===!1?o(e,null):(i(window,`pointermove`,r,!1),i(window,`pointerup`,s,!1),i(window,`pointercancel`,s,!1),t(e))}}}let s=(e,t,n)=>{let{start:r,move:i,end:a}=o({clientX:0,clientY:0});r(`keyboard`,e)?(i(`keyboard`,e,t,n),a(`keyboard`,e)):o({clientX:0,clientY:0},null)};return e.onKeyDown=e=>{switch(e.key){case`Left`:case`ArrowLeft`:t(e),s(e,-1,0);break;case`Right`:case`ArrowRight`:t(e),s(e,1,0);break;case`Up`:case`ArrowUp`:t(e),s(e,0,-1);break;case`Down`:case`ArrowDown`:t(e),s(e,0,1)}},e},[i,a,n])}}function j(t){let n=(0,e.useRef)(void 0);return(0,e.useEffect)(()=>{n.current=t},[t]),n.current}function M(){let t=null,n=0,r=e=>(n+=1,t===null&&(t=document.createElement(`div`),t.style.width=`99px`,t.style.height=`99px`,t.style.overflow=`scroll`,t.style.position=`absolute`,t.style.top=`-9999px`,t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`role`,`presentation`),document.body.appendChild(t),window.addEventListener(`resize`,e)),{element:t,cleanup:()=>{t&&--n<=0&&(document.body.removeChild(t),window.removeEventListener(`resize`,e),t=null,n=0)}});return function(){let[t,n]=(0,e.useState)({height:0,width:0});return f(()=>{let t=()=>{let t=i.offsetHeight-i.clientHeight,r=i.offsetWidth-i.clientWidth;(0,e.startTransition)(()=>{n(e=>{let{height:n,width:i}=e;return n!==t||i!==r?{height:t,width:r}:e})})},{element:i,cleanup:a}=r(t);return t(),a},[]),t}}var N=M();function P(t){let[n,r]=(0,e.useState)(t),i=(0,e.useRef)(t);return[n,(0,e.useCallback)(e=>{i.current=e,r(e)},[]),i]}function F(t,n,r=!0){let i=(0,e.useRef)(null),a=h(t);(0,e.useEffect)(()=>{if(r){let e=new Date,t=n-(e.getMinutes()*60+e.getSeconds())*1e3%n;i.current=setTimeout(()=>{a.current(),i.current=setInterval(a.current,n)},t),a.current()}return()=>{i.current&&clearTimeout(i.current)}},[a,n,r])}var I=e=>e.toMillis(e.getToday());function L(){let t=l(),[n,r]=(0,e.useState)(()=>({dateUtils:t,today:I(t)})),i=n;n.dateUtils!==t&&(i={dateUtils:t,today:I(t)},r(i));let{today:a}=i;return(0,e.useEffect)(()=>{let e=t.toMillis(t.addDays(t.fromMillis(a),1)),n=Math.max(e-Date.now(),0)+1e3,i=setTimeout(()=>r({dateUtils:t,today:I(t)}),n);return()=>clearTimeout(i)},[t,a]),a}var R=(0,e.createContext)(void 0);t.isDevEnvironment&&(R.displayName=`CalendarContext`);function z(){let t=(0,e.useContext)(R);if(!t)throw Error(`CalendarContext is required`);return t}var B=(0,e.createContext)(null);t.isDevEnvironment&&(B.displayName=`ThemeSourceContext`);function V(n){let{view:r,defaultView:i,startWeek:a,viewValue:o,defaultViewValue:s,dateUtils:c,onChangeView:l,onChangeViewValue:u}=n,[d,f]=y({controlled:r,default:i,initialState:`week`}),p=(0,e.useCallback)((e,n)=>(0,t.normalizeViewValue)(c,e,n,a),[c,a]),[m,g]=y({controlled:o,default:s,initialState:p(d)}),_=T((e,t)=>{g(e),u?.(e,t)}),v=T((0,t.mergeCallbacks)(e=>{f(e)},l)),b=h(m),x=(0,e.useRef)(d),S=(0,e.useRef)(a),C=(0,e.useRef)(c);return(0,e.useEffect)(()=>{let e=x.current,n=S.current!==a,r=C.current,i=r===c?b.current:(0,t.transferDay)(r,c,b.current);x.current=d,S.current=a,C.current=c;let o=e===d&&!n?p(d,i):(0,t.getViewChangeTarget)(c,e,d,i,a);_(o,d)},[p,_,d,b,c,a]),{view:d,viewValue:m,changeViewValue:_,changeView:v}}function H(e){let{dateUtils:n,view:r,viewValue:i,changeViewValue:a,startWeek:o}=e,s=(e,i)=>()=>a((0,t.getNavigationTarget)(n,r,e,i,o),r);return{goForward:T(s(i,1)),goBackward:T(s(i,-1)),goToday:T(s(n.getToday(),0))}}function U(e){return(0,a.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,height:`12`,viewBox:`0 0 13 12`,width:`13`,...e,children:(0,a.jsx)(`path`,{d:`M1.77498 2.29504L6.35498 6.87504L10.945 2.29504L12.355 3.70504L6.35498 9.70504L0.35498 3.70504L1.77498 2.29504Z`,fill:`currentColor`})})}var ee=()=>()=>{},W=()=>!0,te=()=>!1;function ne(){return(0,e.useSyncExternalStore)(ee,W,te)}function re(e){let n={display:`contents`};if(!e)return n;let r=getComputedStyle(e);for(let e of t.THEME_PROPERTIES){let t=r.getPropertyValue(e).trim();t&&(n[e===`font-family`?`fontFamily`:e]=t)}return n}function G({children:t,container:n}){let r=ne(),i=(0,e.useContext)(B);return r?n?(0,o.createPortal)(t,n):(0,o.createPortal)((0,a.jsx)(`div`,{style:re(i?.current),children:t}),document.body):null}var K={root:`_root_1aojr_1`,root__toggle:`_root__toggle_1aojr_6`,root__toggleLabel:`_root__toggleLabel_1aojr_30`,root__toggleIcon:`_root__toggleIcon_1aojr_37`,root__toggleIcon_open:`_root__toggleIcon_open_1aojr_43`,popover:`_popover_1aojr_47`,popover__header:`_popover__header_1aojr_71`,popover__title:`_popover__title_1aojr_93`,popover__navBackward:`_popover__navBackward_1aojr_98`,popover__navForward:`_popover__navForward_1aojr_102`,popover__grid:`_popover__grid_1aojr_106`,popover__weekday:`_popover__weekday_1aojr_112`,popover__day:`_popover__day_1aojr_122`,popover__day_outside:`_popover__day_outside_1aojr_140`,popover__day_selected:`_popover__day_selected_1aojr_145`,popover__day_rangeStart:`_popover__day_rangeStart_1aojr_152`,popover__day_rangeEnd:`_popover__day_rangeEnd_1aojr_157`,popover__day_today:`_popover__day_today_1aojr_162`};function ie({renderHeading:n,type:r=`button`,onClick:o,onKeyDown:s,className:c,...u}){let{view:f,viewValue:p,changeViewValue:m,startWeek:h}=z(),g=l(),_=d(),{getStartOfWeek:v,getStartOfMonth:y,addMonths:b}=g,[x,S]=(0,e.useState)(!1),[C,w]=(0,e.useState)(()=>y(p)),T=(0,e.useRef)(null),{refs:E,floatingStyles:D}=(0,i.useFloating)({placement:`bottom`,middleware:[(0,i.offset)(6),(0,i.flip)({padding:8}),(0,i.shift)({padding:8})],whileElementsMounted:i.autoUpdate});(0,e.useEffect)(()=>{x&&w(y(p))},[x,y,p]),(0,e.useEffect)(()=>{if(!x)return;let e=e=>{let t=e.target;T.current?.contains(t)||E.floating.current?.contains(t)||S(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[x,E.floating]);let O=(0,e.useMemo)(()=>n?n(p,f):(0,t.getViewHeading)(g,f,p,h),[g,n,h,f,p]),k=(0,e.useMemo)(()=>(0,t.getMonthGrid)(g,C,h),[g,C,h]),A=e=>{o?.(e),S(e=>!e)},j=e=>{s?.(e),e.key===`Escape`&&S(!1)},M=e=>{m(f===`week`?v(e,h):e,f),S(!1)};return(0,a.jsxs)(`div`,{ref:T,className:K.root,children:[(0,a.jsxs)(`button`,{type:r,"aria-label":_.chooseDate,"aria-expanded":x,"aria-haspopup":`dialog`,...u,onClick:A,onKeyDown:j,ref:E.setReference,className:(0,t.cx)(c,K.root__toggle),children:[(0,a.jsx)(`span`,{className:K.root__toggleLabel,children:O}),(0,a.jsx)(U,{className:(0,t.cx)(K.root__toggleIcon,{[K.root__toggleIcon_open]:x})})]}),x&&(0,a.jsx)(G,{children:(0,a.jsxs)(`div`,{ref:E.setFloating,style:D,role:`dialog`,"aria-label":_.chooseDate,className:K.popover,children:[(0,a.jsxs)(`div`,{className:K.popover__header,children:[(0,a.jsx)(`button`,{type:`button`,"aria-label":_.previousMonth,onClick:()=>w(e=>b(e,-1)),children:(0,a.jsx)(U,{className:K.popover__navBackward})}),(0,a.jsx)(`div`,{className:K.popover__title,children:(0,t.formatMonthYear)(g,C)}),(0,a.jsx)(`button`,{type:`button`,"aria-label":_.nextMonth,onClick:()=>w(e=>b(e,1)),children:(0,a.jsx)(U,{className:K.popover__navForward})})]}),(0,a.jsxs)(`div`,{className:K.popover__grid,children:[k.slice(0,7).map(e=>(0,a.jsx)(`div`,{className:K.popover__weekday,children:g.weekDayShortName(g.getWeekDay(e))},g.getWeekDay(e))),k.map((e,n)=>{let r=g.getMonths(e)!==g.getMonths(C),i=g.isToday(e),o=f!==`month`&&(0,t.isInViewPeriod)(g,f,p,e),s=o&&(f===`day`||n%7==0),c=o&&(f===`day`||n%7==6);return(0,a.jsx)(`button`,{type:`button`,onClick:()=>M(e),className:(0,t.cx)(K.popover__day,{[K.popover__day_outside]:r,[K.popover__day_today]:i,[K.popover__day_selected]:o,[K.popover__day_rangeStart]:s,[K.popover__day_rangeEnd]:c}),children:g.getMonthDay(e)},g.toMillis(e))})]})]})})]})}var q={root:`_root_l1csz_1`,root__icon:`_root__icon_l1csz_21`,root__icon_forward:`_root__icon_forward_l1csz_25`,root__icon_backward:`_root__icon_backward_l1csz_29`};function ae({direction:e=`forward`,type:n=`button`,onClick:r,className:i,children:o,...s}){let{goForward:c,goBackward:l}=z(),u=d(),f=T((0,t.mergeCallbacks)(r,()=>{e===`forward`?c():e===`backward`&&l()}));return(0,a.jsx)(`button`,{type:n,"aria-label":e===`forward`?u.next:u.previous,...s,onClick:f,className:(0,t.cx)(i,q.root),children:o??(0,a.jsx)(U,{className:(0,t.cx)(q.root__icon,{[q.root__icon_backward]:e===`backward`,[q.root__icon_forward]:e===`forward`})})})}var J={root:`_root_gpxmh_1`,root__icon:`_root__icon_gpxmh_25`,root__icon_open:`_root__icon_open_gpxmh_32`,list:`_list_gpxmh_36`,list__option:`_list__option_gpxmh_48`,list__option_active:`_list__option_active_gpxmh_68`,list__check:`_list__check_gpxmh_76`},Y=[`day`,`week`,`month`];function oe({className:n}){let{view:r,changeView:o}=z(),s=d(),{addGlobalListener:c,removeGlobalListener:l}=E(),u=(0,e.useId)(),[f,p]=(0,e.useState)(!1),[m,h]=(0,e.useState)(r),g=(0,e.useRef)(new Map),{refs:_,floatingStyles:v}=(0,i.useFloating)({placement:`bottom-end`,middleware:[(0,i.offset)(6),(0,i.flip)({padding:8}),(0,i.shift)({padding:8})],whileElementsMounted:i.autoUpdate}),y=e=>{p(!1);let t=_.reference.current;e&&t instanceof HTMLElement&&t.focus()},b=(e=r)=>{h(e),p(!0)},x=e=>{y(!0),o(e)};(0,e.useEffect)(()=>{f&&g.current.get(m)?.focus()},[f,m]),(0,e.useEffect)(()=>{if(!f)return;let e=e=>{let t=e.target,n=_.reference.current;n instanceof Node&&n.contains(t)||_.floating.current?.contains(t)||p(!1)};return c(document,`pointerdown`,e),()=>l(document,`pointerdown`,e)},[c,f,_.floating,_.reference,l]);let S=e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),b())},C=e=>{let t=Y.indexOf(m),n=t=>{e.preventDefault(),h(Y[(t+Y.length)%Y.length]??m)};switch(e.key){case`ArrowDown`:return n(t+1);case`ArrowUp`:return n(t-1);case`Home`:return n(0);case`End`:return n(Y.length-1);case`Enter`:case` `:return e.preventDefault(),x(m);case`Escape`:return e.preventDefault(),y(!0);case`Tab`:return y(!1)}},w=`${u}-list`;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(`button`,{ref:_.setReference,type:`button`,"aria-haspopup":`listbox`,"aria-expanded":f,"aria-controls":f?w:void 0,"aria-label":`${s.chooseView}: ${s[r]}`,className:(0,t.cx)(n,J.root),onClick:()=>f?y(!1):b(),onKeyDown:S,children:[s[r],(0,a.jsx)(U,{"aria-hidden":`true`,className:(0,t.cx)(J.root__icon,{[J.root__icon_open]:f})})]}),f&&(0,a.jsx)(G,{children:(0,a.jsx)(`div`,{ref:_.setFloating,id:w,role:`listbox`,"aria-label":s.chooseView,style:v,className:J.list,onKeyDown:C,children:Y.map(e=>(0,a.jsxs)(`div`,{ref:t=>{t?g.current.set(e,t):g.current.delete(e)},id:`${u}-${e}`,role:`option`,tabIndex:-1,"aria-selected":e===r,className:(0,t.cx)(J.list__option,{[J.list__option_active]:e===m}),onClick:()=>x(e),onPointerMove:()=>h(e),children:[s[e],e===r&&(0,a.jsx)(`svg`,{"aria-hidden":`true`,className:J.list__check,viewBox:`0 0 16 16`,width:`14`,height:`14`,children:(0,a.jsx)(`path`,{d:`M3 8.5 6.5 12 13 4.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})]},e))})})]})}var X={root:`_root_1lvdm_1`,root__navigationPane:`_root__navigationPane_1lvdm_12`,root__viewList:`_root__viewList_1lvdm_13`,root__today:`_root__today_1lvdm_26`,root__viewTab:`_root__viewTab_1lvdm_55`,root__viewTab_isActive:`_root__viewTab_isActive_1lvdm_75`,root__viewTab_disabled:`_root__viewTab_disabled_1lvdm_83`,root__viewSelect:`_root__viewSelect_1lvdm_89`};function se(e){let{goToday:n,changeView:r,view:i}=z(),o=d(),s=e,c={day:{type:`button`,"aria-selected":i===`day`,onClick:(0,t.mergeCallbacks)(void 0,()=>r(`day`)),className:(0,t.cx)(X.root__viewTab,{[X.root__viewTab_isActive]:i===`day`}),children:o.day},week:{type:`button`,"aria-selected":i===`week`,onClick:(0,t.mergeCallbacks)(void 0,()=>r(`week`)),className:(0,t.cx)(X.root__viewTab,{[X.root__viewTab_isActive]:i===`week`}),children:o.week},month:{type:`button`,"aria-selected":i===`month`,onClick:(0,t.mergeCallbacks)(void 0,()=>r(`month`)),className:(0,t.cx)(X.root__viewTab,{[X.root__viewTab_isActive]:i===`month`}),children:o.month}},l={type:`button`,onClick:T(n),className:X.root__today,children:o.today};return(0,a.jsxs)(`div`,{...s,className:(0,t.cx)(s.className,X.root),children:[(0,a.jsx)(ie,{}),(0,a.jsxs)(`div`,{className:X.root__navigationPane,role:`group`,children:[(0,a.jsx)(ae,{direction:`backward`}),(0,a.jsx)(`button`,{...l}),(0,a.jsx)(ae,{direction:`forward`})]}),(0,a.jsxs)(`div`,{className:X.root__viewList,children:[(0,a.jsx)(`button`,{...c.day}),(0,a.jsx)(`button`,{...c.week}),(0,a.jsx)(`button`,{...c.month})]}),(0,a.jsx)(`div`,{className:X.root__viewSelect,children:(0,a.jsx)(oe,{})})]})}var ce=(0,e.createContext)(void 0);t.isDevEnvironment&&(ce.displayName=`CalendarViewportContext`);function le(){let t=(0,e.useContext)(ce);if(!t)throw Error(`CalendarViewportContext is required`);return t}var ue={root:`_root_1pvvm_1`};function de({coordinates:e,className:n,style:r,...i}){return(0,a.jsx)(`span`,{tabIndex:-1,...i,className:(0,t.cx)(n,ue.root),style:{...r,...e?{top:`calc(${e.y}px + 20px)`,left:`calc(${e.x}px + 20px)`}:null}})}var fe={root:`_root_ssdmn_1`,root_isDragging:`_root_isDragging_ssdmn_14`,root_isReturning:`_root_isReturning_ssdmn_23`,"ww-drag-return":`_ww-drag-return_ssdmn_39`,root_isBlocked:`_root_isBlocked_ssdmn_36`},pe={isStart:!0,isEnd:!0};function me({showPreview:n=!0,pxPerMinute:i=1,...o}){let{eventMap:s,eventRenderer:c,pointerPreviewRenderer:l,view:u}=z(),{viewportRef:d}=le(),{isDragging:p,canDrop:m,dropData:h,eventItem:g,source:_,x:v,y,...x}=(0,r.useDragAndDrop)(({draggable:e,overlay:t,droppable:n,canDrop:r})=>{let i=[...n.dropTargets.values()].shift(),a=[...e.dragTargets.values()].shift();return{...t.transform,source:[...e.dragTargets.keys()].shift()??null,canDrop:r(),dropData:i,eventItem:a?a.filter(e=>e.event)[0]:null,isDragging:e.isDragging,x:e.x,y:e.y}}),S=(0,e.useMemo)(()=>{if(!g)return null;let{key:e}=JSON.parse(g.event);return s.get(e)?.value??null},[g,s]),C=(0,e.useRef)(null),w=(0,e.useRef)(!1),[T,E]=(0,e.useState)(!1),[D,O]=(0,e.useState)(null);if(f(()=>{if(p){w.current=m,h&&_&&(C.current={transform:x,source:_,eventValue:S},E(!0),O(null));return}E(!1);let e=C.current;C.current=null;let t=d.current;if(!e||w.current||!t||!e.source.isConnected)return;let{transform:n}=e,r=e.source.getBoundingClientRect(),i=t.getBoundingClientRect();O({container:t,eventValue:e.eventValue,style:{left:r.left-i.left,top:r.top-i.top,width:r.width,height:r.height,"--ww-return-left":`${n.left}px`,"--ww-return-top":`${n.top}px`,"--ww-return-width":`${n.width}px`,"--ww-return-height":`${n.height}px`}})}),b(p?m?`grabbing`:`not-allowed`:null),!p)return D?(0,a.jsx)(G,{container:D.container,children:(0,a.jsx)(`div`,{...o,className:(0,t.cx)(o.className,fe.root,fe.root_isReturning),style:D.style,onAnimationEnd:()=>O(null),children:D.eventValue==null?null:c.current?.(D.eventValue,u,pe)})}):null;if(!T)return null;let k=!m;return(0,a.jsxs)(G,{container:d.current,children:[(0,a.jsx)(`div`,{...o,className:(0,t.cx)(o.className,fe.root,{[fe.root_isDragging]:p,[fe.root_isBlocked]:k}),style:{...x},children:S==null?null:c.current?.(S,u,pe)}),n&&!k&&(0,a.jsx)(de,{coordinates:{x:v,y},children:h?l.current?.(h.date,Math.round(x.top/i),Math.round(x.height/i)):null})]})}function he(e,t){return{...t,...e}}function ge(e){return Array.from({length:Math.ceil(e.length/7)},(t,n)=>e.slice(n*7,n*7+7))}function _e(e,t,n){let r=e?.querySelectorAll(`[data-day-index]`)??[],i=-1,a=1/0;for(let e of r){let r=e.getBoundingClientRect(),o=t<r.left?r.left-t:t>=r.right?t-r.right:0,s=n<r.top?r.top-n:n>=r.bottom?n-r.bottom:0,c=Math.hypot(o,s);c<a&&(a=c,i=Number(e.dataset.dayIndex))}return i}var Z={root:`_root_fq0jy_1`,root__head:`_root__head_fq0jy_11`,root__weekday:`_root__weekday_fq0jy_21`,root__body:`_root__body_fq0jy_31`,root__viewport:`_root__viewport_fq0jy_37`,root__week:`_root__week_fq0jy_21`,root__day:`_root__day_fq0jy_62`,root__day_isOver:`_root__day_isOver_fq0jy_86`,root__dayNumber:`_root__dayNumber_fq0jy_100`,root__event:`_root__event_fq0jy_122`,root__event_span:`_root__event_span_fq0jy_153`,root__event_continuesBefore:`_root__event_continuesBefore_fq0jy_159`,root__event_continuesAfter:`_root__event_continuesAfter_fq0jy_165`,root__event_isResizing:`_root__event_isResizing_fq0jy_171`,root__event_isResizeSource:`_root__event_isResizeSource_fq0jy_175`,root__resize:`_root__resize_fq0jy_180`,root__resizeStart:`_root__resizeStart_fq0jy_188`,root__resizeEnd:`_root__resizeEnd_fq0jy_192`,root_isResizing:`_root_isResizing_fq0jy_196`,root__event_isDragging:`_root__event_isDragging_fq0jy_201`,root__dragOverlay:`_root__dragOverlay_fq0jy_206`,root__more:`_root__more_fq0jy_231`};function ve(n){let{ref:i,targetDate:o,children:s,onDoubleClick:c,...u}=n,{onEventChange:d,onEventCreate:f,getIsDayDisabled:p,disabled:m,eventMap:h}=z(),g=l(),{getHours:_,getMinutes:v,getNow:y}=g,b=(0,e.useRef)(null),{register:x,isOver:S}=(0,r.useDragAndDrop)(({registerDropTarget:e,isOver:t})=>({register:e,isOver:t(b.current)}));(0,e.useEffect)(()=>{let e=b.current;if(e)return x(e,{data:{date:o},onDrop:async e=>{let[n]=await Promise.all(e.items.filter(e=>e.kind===`text`&&e.types.has(`event`)&&`getText`in e).map(async e=>{let t=await e.getText(`event`);return JSON.parse(t)})),r=n&&h.get(n.key);if(!r)return;let i=g.fromMillis(n.day??n.date),a=(0,t.toDayMinutes)(g,i,o)/1440;a!==0&&d(r.key,g.addDays(g.getStartOfDay(r.date),a),{from:_(r.date)*60+v(r.date),duration:r.duration})},getDropOperationForPoint:(e,t)=>m||!e.has(`event`)||p&&p(o)?`cancel`:t[0]})},[g,m,h,_,p,v,d,x,o]);let C=T(e=>{if(c?.(e),e.defaultPrevented||m||p&&p(o))return;let t=y();f(o,{from:_(t)*60+v(t),duration:60})}),w=k(b,i);return(0,a.jsx)(`div`,{...u,ref:w,onDoubleClick:C,className:(0,t.cx)(u.className,Z.root__day,{[Z.root__day_isOver]:S}),children:s})}function ye(){let t=(0,e.useRef)(null);return[(0,e.useCallback)((e,n)=>{t.current=setInterval(e,n)},[]),(0,e.useCallback)(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[])]}var be={x:{[-1]:!1,1:!1},y:{[-1]:!1,1:!1}};function xe({delta:e,disabled:t}){let n=j(e);return g(r=>{if(t||!n||!r)return be;let i={x:Math.sign(e.x-n.x),y:Math.sign(e.y-n.y)};return{x:{[-1]:r.x[-1]||i.x===-1,1:r.x[1]||i.x===1},y:{[-1]:r.y[-1]||i.y===-1,1:r.y[1]||i.y===1}}},[t,e,n])}function Se(n){let{acceleration:r,activator:i=0,canScroll:a,enabled:o,interval:s=5,pointerCoordinates:c,order:l=0,delta:u,threshold:d,activeNodeRect:f,scrollableAncestors:p,scrollableAncestorsRects:m}=n,[h,g]=ye(),_=xe({delta:u,disabled:!o}),v=(0,e.useRef)({x:0,y:0}),y=(0,e.useRef)({x:0,y:0}),b=(0,e.useRef)(null),x=(0,e.useMemo)(()=>l===0?[[...p].reverse(),[...m].reverse()]:[[...p],[...m]],[l,p,m]),S=(0,e.useMemo)(()=>{switch(i){case 0:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case 1:return f}},[i,f,c]),C=(0,e.useCallback)(()=>{let e=b.current;if(!e)return;let t=v.current.x*y.current.x,n=v.current.y*y.current.y;e.scrollBy(t,n)},[]);(0,e.useEffect)(()=>{let[e,n]=x;if(!o||!e.length||!S)g();else{for(let[i,o]of e.entries()){if(!o||a?.(o)===!1)continue;let e=n[i];if(!e)continue;let{direction:c,speed:l}=(0,t.getScrollDirectionAndSpeed)(o,e,S,r,d);for(let e of[`x`,`y`])_[e][c[e]]||(l[e]=0,c[e]=0);if(l.x>0||l.y>0){g(),h(C,s),b.current=o,v.current=l,y.current=c;return}}v.current={x:0,y:0},y.current={x:0,y:0},g()}},[r,C,a,o,s,S,p,x,d,g,h,...Object.entries(S||{}),...Object.entries(_),...Object.entries(d||{})])}function Ce(t,n=!1){let r=(0,e.useRef)(t);r.current=t;let i=(0,e.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window,{current:t}=r;return new e(t)},[n]);return(0,e.useEffect)(()=>()=>i?.disconnect(),[i]),i}function we(n,r=t.getClientRect,i){let[a,o]=(0,e.useReducer)(l,null),s=Ce(e=>{if(n)for(let r of e){let{type:e,target:i}=r;if(e===`childList`&&(0,t.isHTMLElement)(i)&&i.contains(n)){o();break}}}),c=p(o);return f(()=>{o(),n?(c?.observe(n),s?.observe(document.body,{childList:!0,subtree:!0})):(c?.disconnect(),s?.disconnect())},[n,s,c]),a;function l(e){if(!n)return null;if(n.isConnected===!1)return e??i??null;let a=r(n);return(0,t.shallowEqual)(a,e)?e:a}}var Te=[];function Ee(n,r){let i=(0,e.useRef)(n),a=(0,e.useMemo)(()=>n?(0,t.getScrollableAncestors)(n,r):Te,[n,r]);return(0,e.useEffect)(()=>{i.current=n},[n]),a}var De=[];function Oe(n,r=t.getClientRect){let[i,a]=(0,e.useReducer)(s,De),o=p(a);return n.length>0&&i===De&&a(),f(()=>{n.length?n.forEach(e=>o?.observe(e)):(o?.disconnect(),a())},[n,o]),i;function s(){return n.length?n.map(e=>{if(e===document.scrollingElement){let n=(0,t.getWindow)(e),r=n.innerWidth,i=n.innerHeight;return{top:0,left:0,right:r,bottom:i,width:r,height:i}}return new t.Rect(r(e),e)}):De}}function ke(n){let[r,i]=(0,e.useState)(null),a=(0,e.useRef)(n),o=(0,e.useCallback)(e=>{let n=(0,t.getScrollableElement)(e.target);n&&i(e=>e?(e.set(n,(0,t.getScrollCoordinates)(n)),new Map(e)):null)},[]);return(0,e.useEffect)(()=>{let e=a.current;if(n!==e){r(e);let s=n.map(e=>{let n=(0,t.getScrollableElement)(e);return n?(n.addEventListener(`scroll`,o,{passive:!0}),[n,(0,t.getScrollCoordinates)(n)]):null}).filter(e=>(0,t.isNotNull)(e));i(s.length?new Map(s):null),a.current=n}return()=>{r(n),r(e)};function r(e){e.forEach(e=>{let n=(0,t.getScrollableElement)(e);n&&n.removeEventListener(`scroll`,o)})}},[o,n]),(0,e.useMemo)(()=>n.length?r?Array.from(r.values()).reduce((e,n)=>(0,t.add)(e,n),t.defaultCoordinates):(0,t.getScrollOffsets)(n):t.defaultCoordinates,[n,r])}function Ae(n,r=t.emptyArray){let i=(0,e.useRef)(null);return(0,e.useEffect)(()=>{i.current=null},r),(0,e.useEffect)(()=>{let e=n!==t.defaultCoordinates;e&&!i.current&&(i.current=n),!e&&i.current&&(i.current=null)},[n]),i.current?(0,t.subtract)(n,i.current):t.defaultCoordinates}var je={Start:`start`,Move:`move`,Stop:`stop`},Me={isActive:!1,initialTranslate:{x:0,y:0},translate:{x:0,y:0},delta:{x:0,y:0},context:null};function Ne({autoScrollEnabled:n=!0,modifiers:r=[],activeNode:i=null,containerNode:a=null}){let[o,s]=(0,e.useReducer)(Pe,Me),c=typeof i==`function`?i(o.context):i,l=typeof a==`function`?a(o.context):a,u=we(o.isActive?c:null),d=we(o.isActive?l:null),f=Ee(o.isActive?c:null),p=Oe(f),m=Ae(ke(f)),h=(0,e.useMemo)(()=>{let e=e=>(t,n)=>{s({type:e,coordinates:t,context:n})};return{start:e(je.Start),move:e(je.Move),stop:e(je.Stop)}},[]),g=(0,t.add)(o.initialTranslate,o.translate);Se({delta:o.translate,enabled:n&&o.isActive,activeNodeRect:u,pointerCoordinates:g,scrollableAncestors:f,scrollableAncestorsRects:p});let _=(0,t.add)(o.translate,m),v=(0,t.adjustScrollRect)(u,m),y=(0,t.adjustScrollRect)(d,m),b=(0,t.applyMoveTransformModifiers)(r,{delta:o.delta,transform:{...o.translate,left:o.translate.x,top:o.translate.y,height:u?.height||0,width:u?.width||0},context:o.context,activeNodeRect:u,containerNodeRect:d,translate:_,initialTranslate:o.initialTranslate});return[{context:o.context,isActive:o.currentAction===`move`,transform:b,translate:o.translate,initialTranslate:o.initialTranslate,containerNodeRect:d,activeNodeRect:u,delta:o.delta},h,{pointerCoordinates:g,scrollAdjustmentActiveNodeRect:v,scrollAdjustmentContainerNodeRect:y}]}function Pe(e,n){let r={[je.Start]:(e,{coordinates:t,context:n})=>({...e,isActive:!0,currentAction:je.Start,initialTranslate:{...t},context:n}),[je.Move]:(e,{coordinates:t})=>({...e,currentAction:je.Move,translate:{x:t.x-e.initialTranslate.x,y:t.y-e.initialTranslate.y},delta:{x:t.x-(e.translate.x+e.initialTranslate.x),y:t.y-(e.translate.y+e.initialTranslate.y)}}),[je.Stop]:()=>({...Me,currentAction:je.Stop})};return(0,t.match)(n.type,r,e,n)}var Fe=6;function Ie(n){let{ref:i,eventData:o,weekDays:s,resizable:c=!1,resize:u,isResizeSource:d=!1,isAnyResizing:f=!1,children:p,...m}=n,{disabled:h}=z(),g=l(),{viewportRef:_}=le(),v=(0,e.useRef)(null),y=(0,e.useRef)(null),{attributes:b,isDragging:x,overElement:S,register:C,setOverlayTransform:w}=(0,r.useDragAndDrop)(({registerDragSource:e,draggable:t,droppable:n,setTransform:r,isActive:i})=>{let a=i(v.current),[o]=a?[...n.dropTargets].pop()??[null]:[null];return{attributes:t.attributes,isDragging:a,overElement:o,register:e,setOverlayTransform:r}}),E=we(x?S:null),[{transform:D,context:O},j]=Ne({autoScrollEnabled:!1,activeNode:()=>v.current,containerNode:()=>_.current,modifiers:[function({activeNodeRect:e,containerNodeRect:n,transform:r,translate:i,initialTranslate:a}){if(!n||!e||!E)return r;r.x=i.x+a.x-n.left,r.y=i.y+a.y-n.top,r.left=E.left-n.left+Fe,r.width=E.width-12,r.height=e.height;let o=e.top+i.y,s=E.top+t.MONTH_WEEK_GEOMETRY.header,c=E.top+E.height-e.height;return r.top=Math.max(s,Math.min(o,c))-n.top,r}]}),M=T(e=>{O===`overlay`&&S&&w(e)});(0,e.useEffect)(()=>{M(D)},[M,...Object.values(D)]);let N=T(()=>{let e=y.current??s[o.column],t={...o,date:g.toMillis(o.date),day:e&&g.toMillis(e)};return[{event:JSON.stringify(t)}]});(0,e.useEffect)(()=>{if(v.current&&!h)return C(v.current,{getItems:N,onDragStart(e){j.start({x:e.x,y:e.y},`overlay`)},onDragMove(e){j.move({x:e.x,y:e.y})},onDragEnd(e){j.stop({x:e.x,y:e.y})},getAllowedDropOperations(){return[`move`]}})},[j,h,N,C]);let P=e=>{e.stopPropagation();let t=e.currentTarget.parentElement;if(!t)return;let n=t.getBoundingClientRect(),r=Math.floor((e.clientX-n.left)/n.width*s.length),i=Math.min(Math.max(r,o.column),o.column+o.span-1);y.current=s[i]??null},F=e=>({onMoveStart:()=>(u?.start(o.key,e),!0),onMove:e=>u?.move(e.clientX,e.clientY),onMoveEnd:()=>u?.end()}),{listeners:I}=A(F(`start`)),{listeners:L}=A(F(`end`)),R=k(v,i),B=o.span>1||!o.isStart||!o.isEnd,V=he({"--ww-column":o.column+1,"--ww-span":o.span,"--ww-row":o.lane+2},m.style);return(0,a.jsxs)(`div`,{...m,...f?null:b,ref:R,style:V,"data-key":String(o.key),"data-continues-before":o.isStart?void 0:``,"data-continues-after":o.isEnd?void 0:``,onPointerDown:P,onDoubleClick:e=>e.stopPropagation(),className:(0,t.cx)(m.className,Z.root__event,{[Z.root__event_span]:B,[Z.root__event_continuesBefore]:!o.isStart,[Z.root__event_continuesAfter]:!o.isEnd,[Z.root__event_isDragging]:x,[Z.root__event_isResizeSource]:d}),children:[p,c&&o.isStart&&(0,a.jsx)(`div`,{...I,"data-edge":`start`,className:(0,t.cx)(Z.root__resize,Z.root__resizeStart)}),c&&o.isEnd&&(0,a.jsx)(`div`,{...L,"data-edge":`end`,className:(0,t.cx)(Z.root__resize,Z.root__resizeEnd)})]})}function Le({bar:e,children:n}){return(0,a.jsx)(`div`,{"aria-hidden":`true`,"data-key":String(e.key),"data-continues-before":e.isStart?void 0:``,"data-continues-after":e.isEnd?void 0:``,className:(0,t.cx)(Z.root__event,Z.root__event_isResizing,{[Z.root__event_span]:e.span>1||!e.isStart||!e.isEnd,[Z.root__event_continuesBefore]:!e.isStart,[Z.root__event_continuesAfter]:!e.isEnd}),style:he({"--ww-column":e.column+1,"--ww-span":e.span,"--ww-row":e.lane+2}),children:n})}function Re(e){let{days:t,firstDayIndex:n,layout:r,sourceBars:i,lanes:o,resizingKey:s,resize:c}=e,{viewValue:u,eventRenderer:f,view:p,disabled:m}=z(),{getMonthDay:h,isSameMonth:g,isToday:_,toMillis:v}=l(),y=d(),b=s!==void 0,x=e=>f.current?.(e.value,p,{isStart:e.isStart,isEnd:e.isEnd}),S=(e,n=!1)=>(0,a.jsx)(Ie,{eventData:e,weekDays:t,resizable:!m,resize:c,isResizeSource:n,isAnyResizing:b,children:x(e)},e.key);return(0,a.jsxs)(`div`,{className:Z.root__week,children:[t.map((e,t)=>(0,a.jsx)(ve,{targetDate:e,"data-day-index":n+t,"data-is-outside":!g(e,u)||void 0,"data-is-today":_(e)?!0:void 0,style:he({"--ww-column":t+1}),children:(0,a.jsx)(`span`,{className:Z.root__dayNumber,children:h(e)})},v(e))),[...r.bars.map(e=>e.key===s?(0,a.jsx)(Le,{bar:e,children:x(e)},`preview-${e.key}`):S(e)),...i.map(e=>S(e,!0))],t.map((e,t)=>r.hidden[t]>0&&(0,a.jsx)(`span`,{className:Z.root__more,style:he({"--ww-column":t+1,"--ww-row":o+2}),children:y.more(r.hidden[t])},`more-${v(e)}`))]})}function ze(n,r){let[i,a]=(0,e.useState)(r),o=()=>{let e=n.current?.firstElementChild;e?.clientHeight&&a((0,t.getMonthLaneCount)(e.clientHeight,r))},s=p(o);return f(()=>{o();let e=n.current?.firstElementChild;return e&&s?.observe(e),()=>{e&&s?.unobserve(e)}},[s,r]),i}function Be(n){let{days:r,viewportRef:i,dateUtils:a,eventMap:o,disabled:s,getIsDayDisabled:c,onEventChange:l}=n,[u,d,f]=P(null),{addGlobalListener:p,removeAllGlobalListeners:m}=E(),h=T((e=!0)=>{let t=f.current;t&&(m(),d(null),e&&t.result&&l(t.key,t.result.date,t.result.info))}),g=T(e=>{e.key===`Escape`&&h(!1)}),_=T((e,t)=>{s||f.current||(d({key:e,edge:t,result:null}),p(document,`keydown`,g,!0))}),v=T((e,n)=>{let s=f.current,l=s&&o.get(s.key),u=r[_e(i.current,e,n)];s&&l&&u&&!c?.(u)&&d({...s,result:(0,t.resizeEventDays)(a,l,s.edge,u)})}),y=(0,e.useMemo)(()=>({start:_,move:v,end:h}),[h,v,_]),b=(0,e.useMemo)(()=>{let e=u?.result&&o.get(u.key);if(!u?.result||!e)return o;let[n]=(0,t.getEventTimeFrameFromInfo)(a,u.result.date,u.result.info);return new Map(o).set(u.key,{...e,date:n,duration:u.result.info.duration})},[a,o,u]);return{resizingKey:u?.key,actions:y,eventMap:b}}var Ve=[];function He(n){let{className:r,style:i,...o}=n,{viewValue:s,eventMap:c,startWeek:u,disabled:d,getIsDayDisabled:f,onEventChange:p}=z(),m=l();L();let h=(0,e.useRef)(null),g=(0,e.useMemo)(()=>(0,t.getMonthGrid)(m,s,u),[m,u,s]),_=(0,e.useMemo)(()=>ge(g),[g]),v=(0,e.useMemo)(()=>(0,t.getWeekdayNames)(m,u),[m,u]),y=Be({days:g,viewportRef:h,dateUtils:m,eventMap:c,disabled:d,getIsDayDisabled:f,onEventChange:p}),b=ze(h,3),x=(0,e.useMemo)(()=>_.map(e=>(0,t.arrangeMonthWeek)(c,m,e,b)),[m,c,b,_]),S=(0,e.useMemo)(()=>y.eventMap===c?x:_.map(e=>(0,t.arrangeMonthWeek)(y.eventMap,m,e,b)),[m,c,b,x,y.eventMap,_]),C=(0,e.useMemo)(()=>({viewportRef:h}),[]);return(0,a.jsxs)(ce.Provider,{value:C,children:[(0,a.jsxs)(`div`,{...o,className:(0,t.cx)(r,Z.root,{[Z.root_isResizing]:y.resizingKey!==void 0}),style:he({"--ww-month-lanes":b},i),children:[(0,a.jsx)(`div`,{className:Z.root__head,children:v.map(e=>(0,a.jsx)(`div`,{className:Z.root__weekday,children:e},e))}),(0,a.jsx)(`div`,{className:Z.root__body,children:(0,a.jsx)(`div`,{ref:h,className:Z.root__viewport,children:_.map((e,t)=>(0,a.jsx)(Re,{days:e,firstDayIndex:t*7,layout:S[t],sourceBars:y.resizingKey===void 0?Ve:x[t].bars.filter(e=>e.key===y.resizingKey),lanes:b,resizingKey:y.resizingKey,resize:y.actions},m.toMillis(e[0])))})})]}),(0,a.jsx)(me,{className:Z.root__dragOverlay,showPreview:!1})]})}var Ue=1440;function We(n){let{days:r,viewportRef:i,dateUtils:a,bounds:o,timeStep:s,preventOutBoundsChanges:c}=n,[l,u]=(0,e.useState)(null),d=(0,e.useRef)(null),f=(0,e.useRef)(n);f.current=n;let p=o.hideMinMaxTime?o.hourMin*60:0,m=o.hideMinMaxTime?(o.hourMax-o.hourMin)*60:Ue,h=(0,e.useCallback)((e,n)=>{let l=d.current,p=i.current;if(!l||!p)return;l.x=e,l.y=n;let{disabled:h,getIsDayDisabled:g}=f.current,_=[...p.querySelectorAll(`[data-day-index]`)],v=p.getBoundingClientRect(),y=(e=>Math.round(e/s)*s)(Math.min(Math.max((n-v.top)/v.height*m,0),m)),b=0,x=1/0;_.forEach(t=>{let n=t.getBoundingClientRect(),r=e<n.left?n.left-e:e>n.right?e-n.right:0;r<x&&(x=r,b=Number(t.dataset.dayIndex))});let S=(0,t.resizeEventRange)({start:l.original[0],end:l.original[1]},l.edge,b,y,{dayCount:r.length,bounds:o,timeStep:s,crossDays:!c||o.hourMin<=0&&o.hourMax>=24,getFrame:e=>{if(!c)return[0,m];let[n,i]=(0,t.getTimeFrame)(a,r[e],o);return[Math.ceil(n/s)*s,Math.min(Math.ceil(i/s)*s,m)]},canEditDay:e=>!h&&!g?.(r[e])&&!(c&&(0,t.isPastDay)(a,r[e]))});S&&(l.range=S),u({key:l.key,range:l.range,x:e,y:n,blocked:!S})},[o,a,r,c,s,m,i]),g=(0,e.useMemo)(()=>({start(e,n,i,o){let s=f.current.eventMap.get(e);if(!s||!r[0])return;let c=(0,t.toDayMinutes)(a,r[0],s.date),l=[c,c+s.duration];d.current={key:e,edge:n,original:l,range:l,x:i,y:o},u({key:e,range:l,x:i,y:o,blocked:!1})},move:h,end(){let e=d.current;if(d.current=null,u(null),!e)return;let[n,i]=e.range;if(n===e.original[0]&&i===e.original[1])return;let o=Math.floor(n/Ue);f.current.onEventChange(e.key,(0,t.fromDayMinutes)(a,r[0],o*Ue),{from:n-o*Ue,duration:i-n})}}),[a,r,h]),_=l!==null;return(0,e.useEffect)(()=>{if(!_)return;let e=()=>d.current&&h(d.current.x,d.current.y);return document.addEventListener(`scroll`,e,!0),()=>document.removeEventListener(`scroll`,e,!0)},[_,h]),b(l?.blocked?`not-allowed`:null),{state:l,actions:g,previewOf:e=>{let n=Math.floor(e[0]/Ue);return{date:(0,t.fromDayMinutes)(a,r[0],n*Ue),top:e[0]-n*Ue-p,duration:e[1]-e[0]}}}}var Ge=(0,e.createContext)(void 0);t.isDevEnvironment&&(Ge.displayName=`DayWeekViewContext`);function Ke(){let t=(0,e.useContext)(Ge);if(!t)throw Error(`DayWeekViewContext is required`);return t}function qe(n=!0,r=6e4){let{hideMinMaxTime:i,hourMin:a,hourMax:o}=z(),s=l(),[c,u]=(0,e.useState)(null);return F(()=>u(Date.now()),r,n),(0,e.useMemo)(()=>c===null?[0,!0]:(0,t.getNowOffset)(s,{hourMin:a,hourMax:o,hideMinMaxTime:i}),[c,s,a,o,i])}var Je={root:`_root_1l2ji_1`,root_timeLimit:`_root_timeLimit_1l2ji_8`,root_isToday:`_root_isToday_1l2ji_8`,root_isPast:`_root_isPast_1l2ji_18`,root__container:`_root__container_1l2ji_36`,root__spotlight:`_root__spotlight_1l2ji_57`,root__timeLine:`_root__timeLine_1l2ji_67`,root_offLimits:`_root_offLimits_1l2ji_121`};function Ye(n){let{ref:i,targetDate:o,children:s,...c}=n,{onEventChange:u,onEventCreate:d,getIsDayDisabled:f,pointerPreviewRenderer:p,eventMap:m,...h}=z(),{viewportRef:g,getTimeFrame:_,pxPerMinute:v}=Ke(),{hideMinMaxTime:y,preventOutBoundsChanges:b,timeStep:x,hourMin:S,hourMax:C,disabled:w}=h,T=l(),{isBefore:E,isToday:D}=T,O=x*v,j=e=>Xe(e,v,x),M=e=>_(e).map(e=>e*v),N=(0,e.useRef)(null),P=(0,e.useRef)(null),{register:F,getTransform:I}=(0,r.useDragAndDrop)(({registerDropTarget:e,getTransform:t})=>({register:e,getTransform:t})),R=L(),B=(0,e.useMemo)(()=>{let e=D(o);return{isToday:e,isPast:E(o)&&!e}},[E,D,o,R]),[{isActive:V,transform:H},U,{scrollAdjustmentActiveNodeRect:ee}]=Ne({activeNode:N.current,containerNode:N.current?.parentElement,modifiers:[function({activeNodeRect:e,initialTranslate:t,translate:n,transform:r}){if(!e)return r;let i=t.y-e.top;r.x=r.left+t.x,r.y=r.top+t.y,r.top=Math.floor(i/O)*O,r.height=O,r.left=0,r.width=e.width;let a;return n.y>0?(a=O-i%O,r.height=Math.ceil((r.height+n.y-a)/O)*O):(a=i%O,r.height=Math.ceil((r.height-n.y-a)/O)*O,r.top-=r.height-O),r.height=Math.max(r.height,O),r},function({transform:e}){if(!b)return e;let[t,n]=_(o).map(e=>Math.ceil(e/x)*O);return e.top<t&&(e.height=Math.max(e.height-(t-e.top),O),e.top=t),e.height+e.top>=n&&(e.height=Math.max(n-e.top,O)),e},t.boundingResizableContainerModifier,(0,t.getTimeStepEqualizerModifier)(O)]}),[W,te]=qe(B.isToday);(0,e.useEffect)(()=>{let e=N.current;if(e)return F(e,{data:{date:o},onDrop:async e=>{let[n]=await Promise.all(e.items.filter(e=>e.kind===`text`&&e.types.has(`event`)&&`getText`in e).map(async e=>{let t=await e.getText(`event`);return JSON.parse(t)})),r=I(),i=Xe(r.top,v,x),a=Xe(r.height,v,x),s=y?S*60:0,c=m.get(n.key),l=c?(0,t.toDayMinutes)(T,c.date,c.date):0;if(c&&l+c.duration>1440){if(b&&(S>0||C<24)){U.stop({x:e.x,y:e.y});return}let r=T.getStartOfDay(T.fromMillis(n.date)),a=(0,t.toDayMinutes)(T,c.date,r)+s+n.start-l,d=s+i-a,f=Math.floor(d/1440);u(n.key,T.addDays(o,f),{from:d-f*24*60,duration:c.duration})}else y?u(n.key,o,{from:i+S*60,duration:a}):u(n.key,o,{from:i,duration:a});U.stop({x:e.x,y:e.y})},getDropOperationForPoint:(e,t)=>{if(w||!e.has(`event`)||f&&f(o))return`cancel`;let{isPast:n,isToday:r}=B;if(b){if(!r&&n)return`cancel`;let[e,t]=_(o).map(e=>e*v),i=I();if(i.y<e||i.y>t||r&&i.height>t-e)return`cancel`}return t[0]}})},[U,T,w,m,f,_,I,y,C,S,u,b,v,F,o,x,B]);let{listeners:ne}=A({distance:Math.max(Math.min(5,x),1),onMoveStart:e=>{if(!w){if(b){let{isToday:e,isPast:t}=B;if(t&&!e)return!1}U.start({x:e.clientX,y:e.clientY})}},onMove:e=>{if(V)U.move({x:e.clientX,y:e.clientY});else if(ee){if(b){let[t,n]=M(o),r=e.clientY-ee.top;if(r<t||r>n){U.stop({x:e.clientX,y:e.clientY});return}}V||U.move({x:e.clientX,y:e.clientY})}},onMoveEnd:e=>{U.stop({x:e.clientX,y:e.clientY}),V&&(y?d(o,{from:j(H.top)+S*60,duration:j(H.height)}):d(o,{from:j(H.top),duration:j(H.height)}))}}),re=k(N,i),K=(0,t.formatNowOffset)(T,W,{hourMin:S,hideMinMaxTime:y}),ie=()=>p.current?.(o,j(H.top),j(H.height));return(0,a.jsxs)(`div`,{...c,...ne,ref:re,className:(0,t.cx)(c.className,Je.root,{[Je.root_timeLimit]:b,[Je.root_isToday]:B.isToday,[Je.root_isPast]:B.isPast,[Je.root_offLimits]:te}),style:{...c.style,"--offset":W*v},children:[B.isToday&&!te&&(0,a.jsx)(G,{container:g.current,children:(0,a.jsx)(`span`,{tabIndex:-1,className:Je.root__timeLine,"data-now":K,style:{"--offset":W*v}})}),(0,a.jsx)(`div`,{ref:P,className:Je.root__container,children:s}),V&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{className:Je.root__spotlight,style:H?{...H}:void 0}),(0,a.jsx)(de,{coordinates:{x:H.x,y:H.y},children:ie()})]})]})}function Xe(e,t,n){return Math.round(e/t/n)*n}function Ze(n,r){let[i,a]=(0,e.useState)(null);return f(()=>{let e=n.current,i=n.current?.parentElement;if(e&&i){let{height:n,width:o,...s}=(0,t.getClientRect)(e),{left:c,top:l}=(0,t.subtract)(s,(0,t.getClientRect)(i));a((0,t.round)(r,{height:n,width:o,x:c,y:l}))}},[n,...Object.values(r)]),i}function Qe(t,n){let[r,i]=(0,e.useState)(!0),{preventOutBoundsChanges:a}=z(),{isBefore:o,isToday:s}=l(),{getTimeFrame:c}=Ke();return f(()=>{if(n&&a){if(o(t)&&!s(t))i(!1);else if(s(t)){let{height:e,y:r}=n,a=e+r,[o,s]=c(t);i(a>o&&r<s)}}},[t,n,c,a,o,s]),r}var Q={root:`_root_d2kfg_1`,root_isDragging:`_root_isDragging_d2kfg_10`,root__resizeTop:`_root__resizeTop_d2kfg_10`,root__resizeBottom:`_root__resizeBottom_d2kfg_12`,root_isResizing:`_root_isResizing_d2kfg_14`,root_isDisabled:`_root_isDisabled_d2kfg_41`,root__container:`_root__container_d2kfg_57`,root__dragPreview:`_root__dragPreview_d2kfg_104`,root_isPreview:`_root_isPreview_d2kfg_110`,root_isResizeSource:`_root_isResizeSource_d2kfg_115`};function $e(n){let{ref:i,eventData:o,children:s,...c}=n,{eventMap:u,...d}=z(),f=l(),{timeStep:p,preventOutBoundsChanges:m,disabled:h}=d,g=(0,e.useRef)(null),_=(0,e.useRef)(null),v=(0,e.useRef)(null),{viewportRef:y,getTimeFrame:b,pxPerMinute:x,resize:S,resizing:C}=Ke(),w=p*x,E=Ze(g,o.rect),D=Qe(u.get(o.key)?.date??o.date,E),{attributes:O,isDragging:j,overElement:M,overData:N,register:P,setOverlayTransform:F}=(0,r.useDragAndDrop)(({registerDragSource:e,draggable:t,droppable:n,setTransform:r,isActive:i})=>{let a=i(g.current),[o,s]=a?[...n.dropTargets].pop()??[null,null]:[null,null];return{attributes:t.attributes,overElement:o,overData:s,isDragging:a,register:e,setOverlayTransform:r}}),I=we(j?M:null),[{isActive:L,transform:R,context:B},V]=Ne({activeNode:e=>e===`overlay`?g.current:e===`top`?_.current:v.current,containerNode:e=>e===`overlay`?y.current:g.current?.parentElement?.parentElement??null,modifiers:[function({activeNodeRect:e,containerNodeRect:t,context:n,transform:r,translate:i,initialTranslate:a}){if(n!==`overlay`||!t||!e||!I)return r;r.x=i.x+a.x-t.left,r.y=i.y+a.y-t.top,r.left=I.left-t.left,r.width=I.width,r.top=e.top-t.top,r.height=e.height;let o;return i.y>0?(o=w-(a.y-e.top)%w,r.top+=Math.ceil((i.y-o)/w)*w):(o=(a.y-e.top)%w,r.top+=Math.floor((i.y+o)/w)*w),r},function({transform:e,context:t}){if(!m||t!==`overlay`||!N)return e;let[n,r]=b(N.date).map(e=>Math.ceil(e/p)*w);return e.top<n&&(e.top=n),e.top+e.height>r&&(e.top=r-e.height),e},et(w)]}),H=(0,t.mergeCallbacks)(()=>S.end(),e=>{V.stop({x:e.clientX,y:e.clientY})}),U=e=>({onMoveStart:t=>(V.start({x:t.clientX,y:t.clientY},e),S.start(o.key,e,t.clientX,t.clientY),!0),onMove:e=>{V.move({x:e.clientX,y:e.clientY}),S.move(e.clientX,e.clientY)},onMoveEnd:H}),{listeners:ee}=A(U(`bottom`)),{listeners:W}=A(U(`top`)),te=k(g,i),ne=L&&j&&B===`overlay`,re=C?.key===o.key,G=T(e=>{B===`overlay`&&M&&F(e)});(0,e.useEffect)(()=>{G(R)},[G,...Object.values(R)]),(0,e.useEffect)(()=>{if(!g.current)return;let e={...(0,t.omit)(o,`rect`),date:f.toMillis(o.date)},n=[{event:JSON.stringify(e)}];return P(g.current,{getItems(){return n},onDragStart(e){V.start({x:e.x,y:e.y},`overlay`)},onDragMove(e){V.move({x:e.x,y:e.y})},onDragEnd(e){V.stop({x:e.x,y:e.y})},getAllowedDropOperations(){return[`move`]}})},[V,o,P]);let K=(0,t.cx)(c.className,Q.root,{[Q.root_isDragging]:ne,[Q.root_isResizeSource]:re,[Q.root_isDisabled]:h}),ie={...c.style,top:`${o.rect.y}%`,left:`${o.rect.x}%`,width:`${o.rect.width}%`,height:`${o.rect.height}%`},q=T((0,t.mergeCallbacks)(c.onPointerDown,e=>e.stopPropagation()));return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(`div`,{...c,...O,ref:te,className:K,style:ie,onPointerDown:q,"data-continues-before":o.isStart?void 0:``,"data-continues-after":o.isEnd?void 0:``,children:[D&&o.isStart&&(0,a.jsx)(`div`,{...W,ref:_,className:Q.root__resizeTop}),(0,a.jsx)(`div`,{role:`button`,tabIndex:0,className:Q.root__container,children:s}),D&&o.isEnd&&(0,a.jsx)(`div`,{...ee,ref:v,className:Q.root__resizeBottom})]})})}function et(e){return n=>{let r=[(0,t.getTimeStepEqualizerModifier)(e)];return n.context===`overlay`&&r.push(t.boundingDraggableContainerModifier),(0,t.applyMoveTransformModifiers)(r,n)}}function tt({part:e,timelineMinutes:t,children:n}){let r=e=>`${e/t*100}%`;return(0,a.jsx)(`div`,{"aria-hidden":`true`,className:`${Q.root} ${Q.root_isResizing} ${Q.root_isPreview}`,"data-continues-before":e.isStart?void 0:``,"data-continues-after":e.isEnd?void 0:``,style:{top:r(e.start),height:r(e.duration),left:0,width:`100%`},children:(0,a.jsx)(`div`,{className:Q.root__container,children:n})})}var $={root:`_root_19kk1_1`,root_scrollable:`_root_scrollable_19kk1_11`,root__body:`_root__body_19kk1_11`,root__head:`_root__head_19kk1_15`,root__main:`_root__main_19kk1_30`,root__viewport:`_root__viewport_19kk1_44`,root__column:`_root__column_19kk1_52`,root__headerCell:`_root__headerCell_19kk1_77`,root__headerCellDay:`_root__headerCellDay_19kk1_104`,root__headerCellLabel:`_root__headerCellLabel_19kk1_111`,root__headerCellName:`_root__headerCellName_19kk1_118`,root__headerCellToday:`_root__headerCellToday_19kk1_125`,root__row:`_root__row_19kk1_140`,root__timeStep:`_root__timeStep_19kk1_162`,root__timeStep_overTime:`_root__timeStep_overTime_19kk1_174`,root__rowHeadTime:`_root__rowHeadTime_19kk1_178`,root__hiddenEventsLayer:`_root__hiddenEventsLayer_19kk1_194`,root__hiddenEventsColumn:`_root__hiddenEventsColumn_19kk1_207`,root__hiddenEvents:`_root__hiddenEvents_19kk1_194`,root__hiddenEventsIcon:`_root__hiddenEventsIcon_19kk1_254`};function nt({scrollerRef:n,columns:r,rowHeight:i}){let{hourMin:o,hideMinMaxTime:s,size:c}=z(),u=l(),f=d(),{addGlobalListener:m,removeGlobalListener:h}=E(),[g,_]=(0,e.useState)(null),v=i/60,y=T(()=>{let e=n.current;if(!e)return;let t={top:e.scrollTop,height:e.clientHeight};_(e=>e?.top===t.top&&e.height===t.height?e:t)}),b=p(y);(0,e.useEffect)(()=>{let e=n.current;if(e)return y(),m(e,`scroll`,y,{passive:!0}),b?.observe(e),()=>{h(e,`scroll`,y),b?.unobserve(e)}},[m,y,h,b,n]),(0,e.useEffect)(y,[y,i,r]);let x=(0,e.useMemo)(()=>g&&g.height>0?r.map(e=>(0,t.getHiddenEvents)(e,v,g.top,g.height)):null,[r,v,g]);if(!x||!g)return null;let S=e=>n.current?.scrollTo({top:(0,t.getRevealScrollTop)(e,v,g.top,g.height),behavior:`smooth`}),C=(e,n)=>{let[r]=e;if(!r)return null;let i=e.length===1&&c!==`narrow`?(0,t.formatNowOffset)(u,r.start,{hourMin:o,hideMinMaxTime:s}):e.length;return(0,a.jsxs)(`button`,{type:`button`,className:$.root__hiddenEvents,"data-direction":n,"aria-label":n===`above`?f.earlier(e.length):f.later(e.length),onClick:()=>S(r),children:[(0,a.jsx)(U,{"aria-hidden":`true`,className:$.root__hiddenEventsIcon}),i]})};return(0,a.jsxs)(`div`,{className:$.root__hiddenEventsLayer,children:[(0,a.jsx)(`div`,{}),x.map(({above:e,below:t},n)=>(0,a.jsxs)(`div`,{className:$.root__hiddenEventsColumn,children:[C(e,`above`),C(t,`below`)]},n))]})}function rt(t,n,r){let[i,a]=(0,e.useState)();return f(()=>{let e=!1,n=()=>{let n=t.current;if(e||!n)return;let i=0,o=document.createRange();if(typeof o.getBoundingClientRect!=`function`)return;for(let e of n.querySelectorAll(`time`)){o.selectNodeContents(e);let t=getComputedStyle(e),n=o.getBoundingClientRect().width;i=Math.max(i,n+parseFloat(t.paddingLeft)+parseFloat(t.paddingRight))}let s=n.closest(`.${$.root}`)?.parentElement??document.body,c=parseFloat(getComputedStyle(s).getPropertyValue(`--ww-time-column`));a(i>(Number.isNaN(c)?r:c)?Math.ceil(i):void 0)};return n(),document.fonts?.ready.then(n),()=>{e=!0}},[r,n.join(`|`),t]),i}var it={regular:64,compact:44,narrow:40};function at({rowHeight:n,...r}){let{viewValue:i,hourMin:o,hourMax:s,view:c,eventMap:u,preventOutBoundsChanges:f,eventRenderer:p,timeStep:m,scrollable:h,size:g,hideMinMaxTime:_,disabled:v,getIsDayDisabled:y,onEventChange:b,pointerPreviewRenderer:x}=z(),S=l(),C=d(),{getMonthDay:w,getWeekDay:T,isToday:E,weekDayShortName:D}=S,O=L(),A=n??t.ROW_HEIGHTS[g],j=(0,e.useRef)(null),M=(0,e.useRef)(null),P=(0,e.useMemo)(()=>(0,t.buildTimeRows)(S,m,{hourMin:o,hourMax:s,hideMinMaxTime:_},f),[S,m,o,s,_,f]),F=rt(j,(0,e.useMemo)(()=>P.map(({time:e})=>e),[P]),it[g]),I=(0,e.useMemo)(()=>(0,t.getVisibleDays)(S,c,i),[S,c,i]),R=(0,e.useMemo)(()=>({hourMin:o,hourMax:s,hideMinMaxTime:_}),[o,s,_]),B=(0,e.useMemo)(()=>(0,t.arrangeEventsByDay)(u,S,P.length*60,I,R),[u,S,P.length,I,R]),V=(0,e.useMemo)(()=>B.map(({events:e})=>e),[B]),{state:H,actions:U,previewOf:ee}=We({days:I,viewportRef:j,dateUtils:S,bounds:R,timeStep:m,preventOutBoundsChanges:f,disabled:v,getIsDayDisabled:y,eventMap:u,onEventChange:b}),W=(0,e.useMemo)(()=>H?(0,t.splitIntoDays)(H.range[0],H.range[1],I.length,R):[],[H,I.length,R]),te=H?u.get(H.key)?.value:void 0,ne=(0,e.useCallback)(e=>(0,t.getTimeFrame)(S,e,{hourMin:o,hourMax:s,hideMinMaxTime:_}),[S,_,s,o]),re=(0,e.useMemo)(()=>I.map((e,t)=>{let n=T(e),r=E(e),i=B[t]?.events??[];return{attributes:r?{"data-is-today":!0}:void 0,events:i,day:w(e),isToday:r,targetDate:e,weekDayName:D(n),weekDayNumber:n}}),[O,S,I,B,w,T,E,D]),G=N(),K=r,ie=$.root__head,q=$.root__body,ae=$.root__viewport,J=$.root__column,Y=$.root__headerCell,oe=$.root__headerCellDay,X=$.root__row,se=$.root__rowHeadTime,le=$.root__timeStep,ue=k(j),fe=(0,e.useMemo)(()=>({viewportRef:j,getTimeFrame:ne,pxPerMinute:A/60,resize:U,resizing:H}),[j,ne,A,U,H]),pe=(0,e.useMemo)(()=>({viewportRef:j}),[j]),he=(e,t)=>(0,a.jsx)($e,{"data-idx":t,eventData:e,children:p.current?.(e.value,c,{isStart:e.isStart,isEnd:e.isEnd})},e.key);return(0,a.jsx)(Ge.Provider,{value:fe,children:(0,a.jsx)(ce.Provider,{value:pe,children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(`div`,{...K,className:(0,t.cx)(K.className,$.root,{[$.root_scrollable]:h}),style:{...K.style,"--calendar-column-count":re.length,"--scrollbar-width":G.width,"--scrollbar-height":G.height,...F!==void 0&&{"--ww-time-column":`${F}px`}},children:[(0,a.jsxs)(`div`,{className:ie,children:[(0,a.jsx)(`div`,{className:Y}),re.map(e=>(0,a.jsxs)(`div`,{className:Y,...e.attributes,children:[(0,a.jsx)(`span`,{className:oe,children:e.day}),(0,a.jsxs)(`span`,{className:$.root__headerCellLabel,children:[(0,a.jsx)(`span`,{className:$.root__headerCellName,children:e.weekDayName}),e.isToday&&(0,a.jsx)(`span`,{className:$.root__headerCellToday,children:C.today})]})]},e.weekDayNumber))]}),(0,a.jsxs)(`div`,{className:$.root__main,children:[(0,a.jsx)(`div`,{ref:M,className:q,children:(0,a.jsxs)(`div`,{ref:ue,className:ae,style:{height:P.length*A},children:[(0,a.jsx)(`div`,{className:J,children:P.map(({time:e,value:n,steps:r},i)=>(0,a.jsxs)(`div`,{className:X,style:{height:A,"--translateY":i*A,"--calendar-rows-count":r.length},children:[(0,a.jsx)(`time`,{className:se,children:e}),r.map(([e,,n])=>(0,a.jsx)(`div`,{className:(0,t.cx)(le,{[$.root__timeStep_overTime]:n})},e))]},n))}),re.map((e,t)=>(0,a.jsx)(`div`,{className:J,"data-day-index":t,...e.attributes,children:(0,a.jsxs)(Ye,{id:`${e.weekDayNumber}`,targetDate:e.targetDate,children:[e.events.map((e,t)=>he(e,t)),W.filter(e=>e.dayIndex===t).map(e=>(0,a.jsx)(tt,{part:e,timelineMinutes:P.length*60,children:te===void 0?null:p.current?.(te,c,{isStart:e.isStart,isEnd:e.isEnd})},`resize`))]})},e.weekDayNumber))]})}),h&&(0,a.jsx)(nt,{scrollerRef:M,columns:V,rowHeight:A})]})]}),(0,a.jsx)(me,{pxPerMinute:A/60}),H&&!H.blocked&&(0,a.jsx)(de,{coordinates:{x:H.x,y:H.y},children:(()=>{let{date:e,top:t,duration:n}=ee(H.range);return x.current?.(e,t,n)})()})]})})})}var ot={root:`_root_uggip_2`,root__head:`_root__head_uggip_22`,root__body:`_root__body_uggip_26`,root__body_readonly:`_root__body_readonly_uggip_35`};function st(i){let{ref:o,disabled:s=!1,children:c,hideMinMaxTime:u=!1,timeFrame:d,startWeek:f,timeStep:p=15,items:g,onEventCreate:_,onEventChange:v,onEventDelete:y,onEventEdit:b,eventTimeFrameResolver:x,eventKeyResolver:C,getIsDayDisabled:w,pointerPreviewFormat:E,scrollable:D=!1,view:O,defaultView:A,viewValue:j,defaultViewValue:M,onChangeView:N,onChangeViewValue:P,...F}=i,{hourMax:I,hourMin:L}={hourMin:0,hourMax:24,...d},z=h({eventTimeFrameResolver:x,eventKeyResolver:C}),U=l(),ee=f??U.weekStartsOn,W=(0,e.useRef)(null),te=k(W,o),{viewValue:ne,changeViewValue:re,view:G,changeView:K}=V({view:O,defaultView:A,viewValue:j,defaultViewValue:M,onChangeView:N,onChangeViewValue:P,dateUtils:U,startWeek:ee}),ie=m(W),q=S(()=>(0,n.createDragAndDropApi)({input:`pointer`})).current,ae=(0,e.useMemo)(()=>(0,t.buildEventMap)(g,z.current,U,{hourMin:L,hideMinMaxTime:u}),[U,u,L,g,z]),{goBackward:J,goForward:Y,goToday:oe}=H({changeViewValue:re,dateUtils:U,startWeek:ee,view:G,viewValue:ne}),X=T((e,n,r)=>{let i=ae.get(e);i&&v?.(i.value,...(0,t.getEventTimeFrameFromInfo)(U,n,r))}),ce=T((e,n)=>{_?.(...(0,t.getEventTimeFrameFromInfo)(U,e,n))}),le=T(e=>{let t=ae.get(e);t&&b?.(t.value)}),ue=T(e=>{let t=ae.get(e);t&&y?.(t.value)}),de=h((e,n,r)=>{let[i,a]=(0,t.getTimelineRange)(U,e,n,r,{hourMin:L,hideMinMaxTime:u});return E?E(i,a):(0,t.formatTimelineRange)(U,i,a)}),fe=h(c);(0,e.useEffect)(()=>{if(W.current)return q.getState().registerRootElement(W.current)},[q]);let pe={...F,ref:te},me=(0,e.useMemo)(()=>({disabled:s,getIsDayDisabled:w,preventOutBoundsChanges:!!d,changeView:K,changeViewValue:re,eventMap:ae,goBackward:J,goForward:Y,goToday:oe,hideMinMaxTime:u,hourMax:I,hourMin:L,timeStep:p,scrollable:D,size:ie,startWeek:ee,view:G,viewValue:ne,onEventCreate:ce,onEventChange:X,onEventDelete:ue,onEventEdit:le,eventRenderer:fe,pointerPreviewRenderer:de}),[s,de,w,K,re,ae,J,Y,oe,u,I,L,D,ie,ee,p,G,ne,ce,X,ue,le,fe]);return(0,a.jsx)(`div`,{...pe,className:(0,t.cx)(pe.className,ot.root),"data-ww-size":ie===`regular`?void 0:ie,children:(0,a.jsx)(R.Provider,{value:me,children:(0,a.jsx)(r.DragAndDropContext.Provider,{value:q,children:(0,a.jsxs)(B.Provider,{value:W,children:[(0,a.jsx)(`div`,{className:ot.root__head,children:(0,a.jsx)(se,{})}),(0,a.jsx)(`div`,{className:ot.root__body,children:G===`month`?(0,a.jsx)(He,{}):(0,a.jsx)(at,{})})]})})})})}exports.Calendar=st,exports.default=st,exports.DateLocalizationContext=s,exports.DateLocalizationProvider=function(n){let{adapter:r,messages:i,children:o}=n,c=(0,e.useMemo)(()=>typeof r==`function`?new r:r,[r]),l=(0,e.useMemo)(()=>(0,t.resolveMessages)(c.locale,i),[c.locale,i]);return(0,a.jsx)(s.Provider,{value:c,children:(0,a.jsx)(u.Provider,{value:l,children:o})})},exports.MessagesContext=u,Object.defineProperty(exports,"builtInMessages",{enumerable:!0,get:function(){return t.builtInMessages}}),Object.defineProperty(exports,"resolveMessages",{enumerable:!0,get:function(){return t.resolveMessages}}),exports.useDateUtils=c,exports.useMessages=d;
|
|
12
|
+
${a.current.stack}`)},[i,r,t])}function y(n){let{controlled:r,default:i}=n,[a,o]=(0,e.useState)(()=>i===void 0&&`initialState`in n&&n.initialState!==void 0?n.initialState:i),[s]=(0,e.useState)(i),c=_(r);t.isDevEnvironment&&v(c,r,s,i);let l=(0,e.useCallback)(e=>{c||o(e)},[c]);return[c?r:a,l,c]}function b(t){(0,e.useEffect)(()=>{if(!t)return;let e=`ww-cursor-${t}`,n=document.documentElement;return n.classList.add(e),()=>n.classList.remove(e)},[t])}var x={};function S(t,n){let r=(0,e.useRef)(x);return r.current===x&&(r.current=t(n)),r}function C(){if(t.isDevEnvironment)throw Error(`useEventCallback: Cannot call an event handler while rendering.`)}function w(){let e={next:void 0,callback:C,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function T(t){let n=S(w).current;return n.next=t,(0,e.useInsertionEffect)(n.effect),n.trampoline}function E(){let[t]=(0,e.useState)(()=>({current:new Map})),{addGlobalListener:n,removeGlobalListener:r,removeAllGlobalListeners:i}=(0,e.useMemo)(()=>{function e(e,n,r,i){let a=typeof i!=`boolean`&&i?.once?n=>{t.current.delete(r),e instanceof Document?r.call(e,n):r(n)}:r;e.addEventListener(n,r,i),t.current.set(r,{type:n,target:e,fn:a,options:i})}function n(e,n,r,i){let a=t.current.get(r)?.fn||r;e.removeEventListener(n,a,i),t.current.delete(r)}function r(){t.current.forEach(({target:e,type:t,options:r},i)=>{n(e,t,i,r)})}return{addGlobalListener:e,removeGlobalListener:n,removeAllGlobalListeners:r}},[t]);return(0,e.useEffect)(()=>i,[i]),{addGlobalListener:n,removeGlobalListener:r,removeAllGlobalListeners:i}}function D(t,n){let r=S(O,{containerRef:t,itemsRef:n}).current;return(0,e.useEffect)(()=>r.release,[r]),r}function O({containerRef:e,itemsRef:n}){let r=null,i=[],a=null;function o(){let a=e.current;if(!a)return!1;let o=new t.Rect((0,t.getClientRect)(a),a);return r=o,i=n.current.map(e=>{if(!e)return null;let{left:t,top:n,right:r,bottom:i}=e.getBoundingClientRect();return{left:t-o.left,top:n-o.top,right:r-o.left,bottom:i-o.top}}),!0}return{measure(){return o()?(typeof ResizeObserver<`u`&&e.current&&(a??=new ResizeObserver(()=>{r&&o()}),a.observe(e.current)),!0):!1},release(){a?.disconnect(),r=null,i=[]},container:()=>r,nearestIndex(e,t,n=`xy`){if(!r)return-1;let a=e-r.left,o=t-r.top,s=-1,c=1/0;return i.forEach((e,t)=>{if(!e)return;let r=a<e.left?e.left-a:a>=e.right?a-e.right:0,i=n===`x`?0:o<e.top?e.top-o:o>=e.bottom?o-e.bottom:0,l=Math.hypot(r,i);l<c&&(c=l,s=t)}),s}}}var k=e=>!e||typeof e==`function`?e:t=>{e.current=t};function A(...e){return t=>{e.forEach(e=>{k(e)?.(t)})}}function ee(...t){return(0,e.useMemo)(()=>A(...t),t)}function j(t){let[{state:n}]=(0,e.useState)(()=>({state:{activePointId:null,clientX:0,clientY:0,initialClientX:0,initialClientY:0,isDistanceReached:!1,holdTimer:null,isTouchActive:!1}})),r=(0,e.useRef)(t);r.current=t;let{addGlobalListener:i,removeGlobalListener:a}=E();(0,e.useEffect)(()=>()=>P(n),[n]);let{listeners:o,ref:s}=(0,e.useMemo)(()=>{let e={},t=e=>{`stopPropagation`in e&&`preventDefault`in e&&(e.stopPropagation(),e.preventDefault())},o=(e,t)=>{let{current:{distance:i=0,...a}}=r,{clientX:o,clientY:s}=e,{clientX:c,clientY:l}=n;n.clientX=o,n.clientY=s,t!==void 0&&(n.activePointId=t);let u=e=>({shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,clientX:o,clientY:s});return{start(e,t){return n.initialClientX=o,n.initialClientY=s,n.isDistanceReached=i===0,a.onMoveStart({type:`movestart`,pointerType:e,...u(t)})},move(e,t,r,d){let f=o-n.initialClientX,p=s-n.initialClientY;!n.isDistanceReached&&f**2+p**2>=i**2&&(n.isDistanceReached=!0),n.isDistanceReached&&a.onMove({type:`move`,pointerType:e,deltaX:r??o-c,deltaY:d??s-l,initialDeltaX:f,initialDeltaY:p,...u(t)})},end(e,t){a.onMoveEnd({type:`moveend`,pointerType:e,...u(t)})}}};if(typeof PointerEvent>`u`){let r=e=>{e.button===0&&o(e).move(`mouse`,e)},s=e=>{e.button===0&&o(e).end(`mouse`,e)};e.onMouseDown=e=>{e.button===0&&(o(e).start(`mouse`,e)===!1?o(e,null):(i(window,`mousemove`,r,!1),i(window,`mouseup`,s,!1),t(e)))};let c=e=>{let t=[...e.changedTouches].findIndex(({identifier:e})=>e===n.activePointId);if(t>=0){let n=e.changedTouches[t];o(n).move(`touch`,e)}},l=e=>{let t=[...e.changedTouches].findIndex(({identifier:e})=>e===n.activePointId);t>=0&&(o(e.changedTouches[t],null).end(`touch`,e),a(window,`touchmove`,c,!1),a(window,`touchend`,l),a(window,`touchcancel`,l))};e.onTouchStart=e=>{if(e.changedTouches.length===0||n.activePointId!==null)return;let r=e.changedTouches[0];o(r,r.identifier).start(`touch`,e)===!1?o(r,null):(i(window,`touchmove`,c,!1),i(window,`touchend`,l,!1),i(window,`touchcancel`,l,!1),t(e))}}else{let s=()=>{a(window,`pointermove`,l,!1),a(window,`pointerup`,u,!1),a(window,`pointercancel`,u,!1)},c=()=>{P(n),s(),o(n,null)},l=e=>{if(e.pointerId!==n.activePointId)return;if(n.holdTimer!==null){let t=e.clientX-n.initialClientX,r=e.clientY-n.initialClientY;t**2+r**2>N**2?c():o(e);return}let t=e.pointerType||`mouse`;o(e).move(t,e)},u=e=>{if(e.pointerId!==n.activePointId)return;if(n.holdTimer!==null){c();return}let t=e.pointerType||`mouse`;n.isTouchActive=!1,o(e,null).end(t,e),s()},d=(e,t)=>o(n).start(e,t)!==!1&&(n.isTouchActive=e===`touch`,!0);e.onPointerDown=e=>{if(e.button!==0||n.activePointId!==null)return;let a=e.pointerType||`mouse`,{touchDelay:s=0}=r.current;if(o(e,e.pointerId),a===`touch`&&s>0){n.initialClientX=e.clientX,n.initialClientY=e.clientY;let t=e.nativeEvent;n.holdTimer=setTimeout(()=>{n.holdTimer=null,d(a,t)?`vibrate`in navigator&&navigator.vibrate(M):c()},s)}else if(!d(a,e)){o(e,null);return}i(window,`pointermove`,l,!1),i(window,`pointerup`,u,!1),i(window,`pointercancel`,u,!1),t(e)},e.onContextMenu=e=>{(n.holdTimer!==null||n.isTouchActive)&&e.preventDefault()}}let s=(e,t,n)=>{let{start:r,move:i,end:a}=o({clientX:0,clientY:0});r(`keyboard`,e)?(i(`keyboard`,e,t,n),a(`keyboard`,e)):o({clientX:0,clientY:0},null)};e.onKeyDown=e=>{switch(e.key){case`Left`:case`ArrowLeft`:t(e),s(e,-1,0);break;case`Right`:case`ArrowRight`:t(e),s(e,1,0);break;case`Up`:case`ArrowUp`:t(e),s(e,0,-1);break;case`Down`:case`ArrowDown`:t(e),s(e,0,1)}};let c=e=>{n.isTouchActive&&e.cancelable&&e.preventDefault()},l={target:null};return{listeners:e,ref:e=>{l.target&&a(l.target,`touchmove`,c),l.target=e,e&&i(e,`touchmove`,c,{passive:!1})}}},[i,a,n]);return{listeners:o,ref:s}}var M=10,N=10;function P(e){e.holdTimer!==null&&(clearTimeout(e.holdTimer),e.holdTimer=null)}function F(t){let n=(0,e.useRef)(void 0);return(0,e.useEffect)(()=>{n.current=t},[t]),n.current}function I(){return S(L).current}function L(){let e=[],t=new Map;return{elements:{current:e},refAt(n){let r=t.get(n);return r||(r=t=>{e[n]=t},t.set(n,r)),r}}}function R(){let t=null,n=0,r=e=>(n+=1,t===null&&(t=document.createElement(`div`),t.style.width=`99px`,t.style.height=`99px`,t.style.overflow=`scroll`,t.style.position=`absolute`,t.style.top=`-9999px`,t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`role`,`presentation`),document.body.appendChild(t),window.addEventListener(`resize`,e)),{element:t,cleanup:()=>{t&&--n<=0&&(document.body.removeChild(t),window.removeEventListener(`resize`,e),t=null,n=0)}});return function(){let[t,n]=(0,e.useState)({height:0,width:0});return f(()=>{let t=()=>{let t=i.offsetHeight-i.clientHeight,r=i.offsetWidth-i.clientWidth;(0,e.startTransition)(()=>{n(e=>{let{height:n,width:i}=e;return n!==t||i!==r?{height:t,width:r}:e})})},{element:i,cleanup:a}=r(t);return t(),a},[]),t}}var z=R();function B(t){let[n,r]=(0,e.useState)(t),i=(0,e.useRef)(t);return[n,(0,e.useCallback)(e=>{i.current=e,r(e)},[]),i]}function V(t,n,r=!0){let i=(0,e.useRef)(null),a=h(t);(0,e.useEffect)(()=>{if(r){let e=new Date,t=n-(e.getMinutes()*60+e.getSeconds())*1e3%n;i.current=setTimeout(()=>{a.current(),i.current=setInterval(a.current,n)},t),a.current()}return()=>{i.current&&clearTimeout(i.current)}},[a,n,r])}var H=e=>e.toMillis(e.getToday());function te(){let t=l(),[n,r]=(0,e.useState)(()=>({dateUtils:t,today:H(t)})),i=n;n.dateUtils!==t&&(i={dateUtils:t,today:H(t)},r(i));let{today:a}=i;return(0,e.useEffect)(()=>{let e=t.toMillis(t.addDays(t.fromMillis(a),1)),n=Math.max(e-Date.now(),0)+1e3,i=setTimeout(()=>r({dateUtils:t,today:H(t)}),n);return()=>clearTimeout(i)},[t,a]),a}var ne=(0,e.createContext)(void 0);t.isDevEnvironment&&(ne.displayName=`CalendarContext`);function U(){let t=(0,e.useContext)(ne);if(!t)throw Error(`CalendarContext is required`);return t}var W=(0,e.createContext)(null);t.isDevEnvironment&&(W.displayName=`ThemeSourceContext`);function re(n){let{view:r,defaultView:i,startWeek:a,viewValue:o,defaultViewValue:s,dateUtils:c,onChangeView:l,onChangeViewValue:u}=n,[d,f]=y({controlled:r,default:i,initialState:`week`}),p=(0,e.useCallback)((e,n)=>(0,t.normalizeViewValue)(c,e,n,a),[c,a]),[m,g]=y({controlled:o,default:s,initialState:p(d)}),_=T((e,t)=>{g(e),u?.(e,t)}),v=T((0,t.mergeCallbacks)(e=>{f(e)},l)),b=h(m),x=(0,e.useRef)(d),S=(0,e.useRef)(a),C=(0,e.useRef)(c);return(0,e.useEffect)(()=>{let e=x.current,n=S.current!==a,r=C.current,i=r===c?b.current:(0,t.transferDay)(r,c,b.current);x.current=d,S.current=a,C.current=c;let o=e===d&&!n?p(d,i):(0,t.getViewChangeTarget)(c,e,d,i,a);_(o,d)},[p,_,d,b,c,a]),{view:d,viewValue:m,changeViewValue:_,changeView:v}}function ie(e){let{dateUtils:n,view:r,viewValue:i,changeViewValue:a,startWeek:o}=e,s=(e,i)=>()=>a((0,t.getNavigationTarget)(n,r,e,i,o),r);return{goForward:T(s(i,1)),goBackward:T(s(i,-1)),goToday:T(s(n.getToday(),0))}}function G(e){return(0,a.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,height:`12`,viewBox:`0 0 13 12`,width:`13`,...e,children:(0,a.jsx)(`path`,{d:`M1.77498 2.29504L6.35498 6.87504L10.945 2.29504L12.355 3.70504L6.35498 9.70504L0.35498 3.70504L1.77498 2.29504Z`,fill:`currentColor`})})}var K=()=>()=>{},ae=()=>!0,q=()=>!1;function oe(){return(0,e.useSyncExternalStore)(K,ae,q)}function se(e){let n={display:`contents`};if(!e)return n;let r=getComputedStyle(e);for(let e of t.THEME_PROPERTIES){let t=r.getPropertyValue(e).trim();t&&(n[e===`font-family`?`fontFamily`:e]=t)}return n}function ce({children:t,container:n}){let r=oe(),i=(0,e.useContext)(W);return r?n?(0,o.createPortal)(t,n):(0,o.createPortal)((0,a.jsx)(`div`,{style:se(i?.current),children:t}),document.body):null}var J={root:`_root_39am3_1`,root__toggle:`_root__toggle_39am3_6`,root__toggleLabel:`_root__toggleLabel_39am3_30`,root__toggleIcon:`_root__toggleIcon_39am3_37`,root__toggleIcon_open:`_root__toggleIcon_open_39am3_43`,popover:`_popover_39am3_47`,popover__header:`_popover__header_39am3_73`,popover__title:`_popover__title_39am3_95`,popover__navBackward:`_popover__navBackward_39am3_100`,popover__navForward:`_popover__navForward_39am3_104`,popover__grid:`_popover__grid_39am3_108`,popover__weekday:`_popover__weekday_39am3_114`,popover__day:`_popover__day_39am3_124`,popover__day_outside:`_popover__day_outside_39am3_142`,popover__day_selected:`_popover__day_selected_39am3_147`,popover__day_rangeStart:`_popover__day_rangeStart_39am3_154`,popover__day_rangeEnd:`_popover__day_rangeEnd_39am3_159`,popover__day_today:`_popover__day_today_39am3_164`};function le({renderHeading:n,type:r=`button`,onClick:o,onKeyDown:s,className:c,...u}){let{view:f,viewValue:p,changeViewValue:m,startWeek:h}=U(),g=l(),_=d(),{getStartOfWeek:v,getStartOfMonth:y,addMonths:b}=g,[x,S]=(0,e.useState)(!1),[C,w]=(0,e.useState)(()=>y(p)),T=(0,e.useRef)(null),{addGlobalListener:D,removeGlobalListener:O}=E(),{refs:k,floatingStyles:A}=(0,i.useFloating)({placement:`bottom`,middleware:[(0,i.offset)(6),(0,i.flip)({padding:8}),(0,i.shift)({padding:8})],whileElementsMounted:i.autoUpdate});(0,e.useEffect)(()=>{x&&w(y(p))},[x,y,p]),(0,e.useEffect)(()=>{if(!x)return;let e=e=>{let t=e.target;T.current?.contains(t)||k.floating.current?.contains(t)||S(!1)};return D(document,`pointerdown`,e),()=>O(document,`pointerdown`,e)},[D,x,k.floating,O]);let ee=(0,e.useMemo)(()=>n?n(p,f):(0,t.getViewHeading)(g,f,p,h),[g,n,h,f,p]),j=(0,e.useMemo)(()=>(0,t.getMonthGrid)(g,C,h),[g,C,h]),M=e=>{o?.(e),S(e=>!e)},N=e=>{s?.(e),e.key===`Escape`&&S(!1)},P=e=>{m(f===`week`?v(e,h):e,f),S(!1)};return(0,a.jsxs)(`div`,{ref:T,className:J.root,children:[(0,a.jsxs)(`button`,{type:r,"aria-label":_.chooseDate,"aria-expanded":x,"aria-haspopup":`dialog`,...u,onClick:M,onKeyDown:N,ref:k.setReference,className:(0,t.cx)(c,J.root__toggle),children:[(0,a.jsx)(`span`,{className:J.root__toggleLabel,children:ee}),(0,a.jsx)(G,{className:(0,t.cx)(J.root__toggleIcon,{[J.root__toggleIcon_open]:x})})]}),x&&(0,a.jsx)(ce,{children:(0,a.jsxs)(`div`,{ref:k.setFloating,style:A,role:`dialog`,"aria-label":_.chooseDate,className:J.popover,children:[(0,a.jsxs)(`div`,{className:J.popover__header,children:[(0,a.jsx)(`button`,{type:`button`,"aria-label":_.previousMonth,onClick:()=>w(e=>b(e,-1)),children:(0,a.jsx)(G,{className:J.popover__navBackward})}),(0,a.jsx)(`div`,{className:J.popover__title,children:(0,t.formatMonthYear)(g,C)}),(0,a.jsx)(`button`,{type:`button`,"aria-label":_.nextMonth,onClick:()=>w(e=>b(e,1)),children:(0,a.jsx)(G,{className:J.popover__navForward})})]}),(0,a.jsxs)(`div`,{className:J.popover__grid,children:[j.slice(0,7).map(e=>(0,a.jsx)(`div`,{className:J.popover__weekday,children:g.weekDayShortName(g.getWeekDay(e))},g.getWeekDay(e))),j.map((e,n)=>{let r=g.getMonths(e)!==g.getMonths(C),i=g.isToday(e),o=f!==`month`&&(0,t.isInViewPeriod)(g,f,p,e),s=o&&(f===`day`||n%7==0),c=o&&(f===`day`||n%7==6);return(0,a.jsx)(`button`,{type:`button`,onClick:()=>P(e),className:(0,t.cx)(J.popover__day,{[J.popover__day_outside]:r,[J.popover__day_today]:i,[J.popover__day_selected]:o,[J.popover__day_rangeStart]:s,[J.popover__day_rangeEnd]:c}),children:g.getMonthDay(e)},g.toMillis(e))})]})]})})]})}var ue={root:`_root_uo171_1`,root__icon:`_root__icon_uo171_23`,root__icon_forward:`_root__icon_forward_uo171_27`,root__icon_backward:`_root__icon_backward_uo171_31`};function de({direction:e=`forward`,type:n=`button`,onClick:r,className:i,children:o,...s}){let{goForward:c,goBackward:l}=U(),u=d(),f=T((0,t.mergeCallbacks)(r,()=>{e===`forward`?c():e===`backward`&&l()}));return(0,a.jsx)(`button`,{type:n,"aria-label":e===`forward`?u.next:u.previous,...s,onClick:f,className:(0,t.cx)(i,ue.root),children:o??(0,a.jsx)(G,{className:(0,t.cx)(ue.root__icon,{[ue.root__icon_backward]:e===`backward`,[ue.root__icon_forward]:e===`forward`})})})}var Y={root:`_root_5dy7b_1`,root__icon:`_root__icon_5dy7b_27`,root__icon_open:`_root__icon_open_5dy7b_34`,list:`_list_5dy7b_38`,list__option:`_list__option_5dy7b_52`,list__option_active:`_list__option_active_5dy7b_72`,list__check:`_list__check_5dy7b_80`},fe=[`day`,`week`,`month`];function pe({className:n}){let{view:r,changeView:o}=U(),s=d(),{addGlobalListener:c,removeGlobalListener:l}=E(),u=(0,e.useId)(),[f,p]=(0,e.useState)(!1),[m,h]=(0,e.useState)(r),g=(0,e.useRef)(new Map),{refs:_,floatingStyles:v}=(0,i.useFloating)({placement:`bottom-end`,middleware:[(0,i.offset)(6),(0,i.flip)({padding:8}),(0,i.shift)({padding:8})],whileElementsMounted:i.autoUpdate}),y=e=>{p(!1);let t=_.reference.current;e&&t instanceof HTMLElement&&t.focus()},b=(e=r)=>{h(e),p(!0)},x=e=>{y(!0),o(e)};(0,e.useEffect)(()=>{f&&g.current.get(m)?.focus()},[f,m]),(0,e.useEffect)(()=>{if(!f)return;let e=e=>{let t=e.target,n=_.reference.current;n instanceof Node&&n.contains(t)||_.floating.current?.contains(t)||p(!1)};return c(document,`pointerdown`,e),()=>l(document,`pointerdown`,e)},[c,f,_.floating,_.reference,l]);let S=e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),b())},C=e=>{let t=fe.indexOf(m),n=t=>{e.preventDefault(),h(fe[(t+fe.length)%fe.length]??m)};switch(e.key){case`ArrowDown`:return n(t+1);case`ArrowUp`:return n(t-1);case`Home`:return n(0);case`End`:return n(fe.length-1);case`Enter`:case` `:return e.preventDefault(),x(m);case`Escape`:return e.preventDefault(),y(!0);case`Tab`:return y(!1)}},w=`${u}-list`;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(`button`,{ref:_.setReference,type:`button`,"aria-haspopup":`listbox`,"aria-expanded":f,"aria-controls":f?w:void 0,"aria-label":`${s.chooseView}: ${s[r]}`,className:(0,t.cx)(n,Y.root),onClick:()=>f?y(!1):b(),onKeyDown:S,children:[s[r],(0,a.jsx)(G,{"aria-hidden":`true`,className:(0,t.cx)(Y.root__icon,{[Y.root__icon_open]:f})})]}),f&&(0,a.jsx)(ce,{children:(0,a.jsx)(`div`,{ref:_.setFloating,id:w,role:`listbox`,"aria-label":s.chooseView,style:v,className:Y.list,onKeyDown:C,children:fe.map(e=>(0,a.jsxs)(`div`,{ref:t=>{t?g.current.set(e,t):g.current.delete(e)},id:`${u}-${e}`,role:`option`,tabIndex:-1,"aria-selected":e===r,className:(0,t.cx)(Y.list__option,{[Y.list__option_active]:e===m}),onClick:()=>x(e),onPointerMove:()=>h(e),children:[s[e],e===r&&(0,a.jsx)(`svg`,{"aria-hidden":`true`,className:Y.list__check,viewBox:`0 0 16 16`,width:`14`,height:`14`,children:(0,a.jsx)(`path`,{d:`M3 8.5 6.5 12 13 4.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})]},e))})})]})}var X={root:`_root_1gqqu_1`,root__navigationPane:`_root__navigationPane_1gqqu_12`,root__viewList:`_root__viewList_1gqqu_13`,root__today:`_root__today_1gqqu_28`,root__viewTab:`_root__viewTab_1gqqu_57`,root__viewTab_isActive:`_root__viewTab_isActive_1gqqu_79`,root__viewTab_disabled:`_root__viewTab_disabled_1gqqu_87`,root__viewSelect:`_root__viewSelect_1gqqu_93`};function me(e){let{goToday:n,changeView:r,view:i}=U(),o=d(),s=e,c={day:{type:`button`,"aria-selected":i===`day`,onClick:(0,t.mergeCallbacks)(void 0,()=>r(`day`)),className:(0,t.cx)(X.root__viewTab,{[X.root__viewTab_isActive]:i===`day`}),children:o.day},week:{type:`button`,"aria-selected":i===`week`,onClick:(0,t.mergeCallbacks)(void 0,()=>r(`week`)),className:(0,t.cx)(X.root__viewTab,{[X.root__viewTab_isActive]:i===`week`}),children:o.week},month:{type:`button`,"aria-selected":i===`month`,onClick:(0,t.mergeCallbacks)(void 0,()=>r(`month`)),className:(0,t.cx)(X.root__viewTab,{[X.root__viewTab_isActive]:i===`month`}),children:o.month}},l={type:`button`,onClick:T(n),className:X.root__today,children:o.today};return(0,a.jsxs)(`div`,{...s,className:(0,t.cx)(s.className,X.root),children:[(0,a.jsx)(le,{}),(0,a.jsxs)(`div`,{className:X.root__navigationPane,role:`group`,children:[(0,a.jsx)(de,{direction:`backward`}),(0,a.jsx)(`button`,{...l}),(0,a.jsx)(de,{direction:`forward`})]}),(0,a.jsxs)(`div`,{className:X.root__viewList,children:[(0,a.jsx)(`button`,{...c.day}),(0,a.jsx)(`button`,{...c.week}),(0,a.jsx)(`button`,{...c.month})]}),(0,a.jsx)(`div`,{className:X.root__viewSelect,children:(0,a.jsx)(pe,{})})]})}var he=(0,e.createContext)(void 0);t.isDevEnvironment&&(he.displayName=`CalendarViewportContext`);function ge(){let t=(0,e.useContext)(he);if(!t)throw Error(`CalendarViewportContext is required`);return t}var _e={root:`_root_1pvvm_1`};function ve({coordinates:e,className:n,style:r,...i}){return(0,a.jsx)(`span`,{tabIndex:-1,...i,className:(0,t.cx)(n,_e.root),style:{...r,...e?{top:`calc(${e.y}px + 20px)`,left:`calc(${e.x}px + 20px)`}:null}})}var ye={root:`_root_ssdmn_1`,root_isDragging:`_root_isDragging_ssdmn_14`,root_isReturning:`_root_isReturning_ssdmn_23`,"ww-drag-return":`_ww-drag-return_ssdmn_39`,root_isBlocked:`_root_isBlocked_ssdmn_36`},be={isStart:!0,isEnd:!0};function xe({showPreview:n=!0,pxPerMinute:i=1,...o}){let{eventMap:s,eventRenderer:c,pointerPreviewRenderer:l,view:u}=U(),{viewportRef:d}=ge(),{isDragging:p,canDrop:m,dropData:h,eventItem:g,source:_,x:v,y,...x}=(0,r.useDragAndDrop)(({draggable:e,overlay:t,droppable:n,canDrop:r})=>{let i=[...n.dropTargets.values()].shift(),a=[...e.dragTargets.values()].shift();return{...t.transform,source:[...e.dragTargets.keys()].shift()??null,canDrop:r(),dropData:i,eventItem:a?a.filter(e=>e.event)[0]:null,isDragging:e.isDragging,x:e.x,y:e.y}}),S=(0,e.useMemo)(()=>{if(!g)return null;let{key:e}=JSON.parse(g.event);return s.get(e)?.value??null},[g,s]),C=(0,e.useRef)(null),w=(0,e.useRef)(!1),[T,E]=(0,e.useState)(!1),[D,O]=(0,e.useState)(null);if(f(()=>{if(p){w.current=m,h&&_&&(C.current={transform:x,source:_,eventValue:S},E(!0),O(null));return}E(!1);let e=C.current;C.current=null;let t=d.current;if(!e||w.current||!t||!e.source.isConnected)return;let{transform:n}=e,r=e.source.getBoundingClientRect(),i=t.getBoundingClientRect();O({container:t,eventValue:e.eventValue,style:{left:r.left-i.left,top:r.top-i.top,width:r.width,height:r.height,"--ww-return-left":`${n.left}px`,"--ww-return-top":`${n.top}px`,"--ww-return-width":`${n.width}px`,"--ww-return-height":`${n.height}px`}})}),b(p?m?`grabbing`:`not-allowed`:null),!p)return D?(0,a.jsx)(ce,{container:D.container,children:(0,a.jsx)(`div`,{...o,className:(0,t.cx)(o.className,ye.root,ye.root_isReturning),style:D.style,onAnimationEnd:()=>O(null),children:D.eventValue==null?null:c.current?.(D.eventValue,u,be)})}):null;if(!T)return null;let k=!m;return(0,a.jsxs)(ce,{container:d.current,children:[(0,a.jsx)(`div`,{...o,className:(0,t.cx)(o.className,ye.root,{[ye.root_isDragging]:p,[ye.root_isBlocked]:k}),style:{...x},children:S==null?null:c.current?.(S,u,be)}),n&&!k&&(0,a.jsx)(ve,{coordinates:{x:v,y},children:h?l.current?.(h.date,Math.round(x.top/i),Math.round(x.height/i)):null})]})}function Se(e,t){return{...t,...e}}function Ce(e){return Array.from({length:Math.ceil(e.length/7)},(t,n)=>e.slice(n*7,n*7+7))}var Z={root:`_root_1mb26_1`,root__head:`_root__head_1mb26_11`,root__weekday:`_root__weekday_1mb26_21`,root__body:`_root__body_1mb26_31`,root__viewport:`_root__viewport_1mb26_37`,root__week:`_root__week_1mb26_21`,root__day:`_root__day_1mb26_62`,root__day_isOver:`_root__day_isOver_1mb26_86`,root__dayNumber:`_root__dayNumber_1mb26_100`,root__event:`_root__event_1mb26_122`,root__event_span:`_root__event_span_1mb26_155`,root__event_continuesBefore:`_root__event_continuesBefore_1mb26_161`,root__event_continuesAfter:`_root__event_continuesAfter_1mb26_167`,root__event_isResizing:`_root__event_isResizing_1mb26_173`,root__event_isResizeSource:`_root__event_isResizeSource_1mb26_177`,root__resize:`_root__resize_1mb26_182`,root__resizeStart:`_root__resizeStart_1mb26_192`,root__resizeEnd:`_root__resizeEnd_1mb26_196`,root_isResizing:`_root_isResizing_1mb26_200`,root__event_isDragging:`_root__event_isDragging_1mb26_205`,root__dragOverlay:`_root__dragOverlay_1mb26_210`,root__more:`_root__more_1mb26_235`};function we(n){let{ref:i,targetDate:o,children:s,onDoubleClick:c,...u}=n,{onEventChange:d,onEventCreate:f,getIsDayDisabled:p,disabled:m,eventMap:h}=U(),g=l(),{getHours:_,getMinutes:v,getNow:y}=g,b=(0,e.useRef)(null),{register:x,isOver:S}=(0,r.useDragAndDrop)(({registerDropTarget:e,isOver:t})=>({register:e,isOver:t(b.current)}));(0,e.useEffect)(()=>{let e=b.current;if(e)return x(e,{data:{date:o},onDrop:async e=>{let[n]=await Promise.all(e.items.filter(e=>e.kind===`text`&&e.types.has(`event`)&&`getText`in e).map(async e=>{let t=await e.getText(`event`);return JSON.parse(t)})),r=n&&h.get(n.key);if(!r)return;let i=g.fromMillis(n.day??n.date),a=(0,t.toDayMinutes)(g,i,o)/1440;a!==0&&d(r.key,g.addDays(g.getStartOfDay(r.date),a),{from:_(r.date)*60+v(r.date),duration:r.duration})},getDropOperationForPoint:(e,t)=>m||!e.has(`event`)||p&&p(o)?`cancel`:t[0]})},[g,m,h,_,p,v,d,x,o]);let C=T(e=>{if(c?.(e),e.defaultPrevented||m||p&&p(o))return;let t=y();f(o,{from:_(t)*60+v(t),duration:60})}),w=ee(b,i);return(0,a.jsx)(`div`,{...u,ref:w,onDoubleClick:C,className:(0,t.cx)(u.className,Z.root__day,{[Z.root__day_isOver]:S}),children:s})}function Te(){let t=(0,e.useRef)(null);return[(0,e.useCallback)((e,n)=>{t.current=setInterval(e,n)},[]),(0,e.useCallback)(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[])]}var Ee={x:{[-1]:!1,1:!1},y:{[-1]:!1,1:!1}};function De({delta:e,disabled:t}){let n=F(e);return g(r=>{if(t||!n||!r)return Ee;let i={x:Math.sign(e.x-n.x),y:Math.sign(e.y-n.y)};return{x:{[-1]:r.x[-1]||i.x===-1,1:r.x[1]||i.x===1},y:{[-1]:r.y[-1]||i.y===-1,1:r.y[1]||i.y===1}}},[t,e,n])}function Oe(n){let{acceleration:r,activator:i=0,canScroll:a,enabled:o,interval:s=5,pointerCoordinates:c,order:l=0,delta:u,threshold:d,activeNodeRect:f,scrollableAncestors:p,scrollableAncestorsRects:m}=n,[h,g]=Te(),_=De({delta:u,disabled:!o}),v=(0,e.useRef)({x:0,y:0}),y=(0,e.useRef)({x:0,y:0}),b=(0,e.useRef)(null),x=(0,e.useMemo)(()=>l===0?[[...p].reverse(),[...m].reverse()]:[[...p],[...m]],[l,p,m]),S=(0,e.useMemo)(()=>{switch(i){case 0:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case 1:return f}},[i,f,c]),C=(0,e.useCallback)(()=>{let e=b.current;if(!e)return;let t=v.current.x*y.current.x,n=v.current.y*y.current.y;e.scrollBy(t,n)},[]);(0,e.useEffect)(()=>{let[e,n]=x;if(!o||!e.length||!S)g();else{for(let[i,o]of e.entries()){if(!o||a?.(o)===!1)continue;let e=n[i];if(!e)continue;let{direction:c,speed:l}=(0,t.getScrollDirectionAndSpeed)(o,e,S,r,d);for(let e of[`x`,`y`])_[e][c[e]]||(l[e]=0,c[e]=0);if(l.x>0||l.y>0){g(),h(C,s),b.current=o,v.current=l,y.current=c;return}}v.current={x:0,y:0},y.current={x:0,y:0},g()}},[r,C,a,o,s,S,p,x,d,g,h,...Object.entries(S||{}),...Object.entries(_),...Object.entries(d||{})])}function ke(t,n=!1){let r=(0,e.useRef)(t);r.current=t;let i=(0,e.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window,{current:t}=r;return new e(t)},[n]);return(0,e.useEffect)(()=>()=>i?.disconnect(),[i]),i}function Ae(n,r=t.getClientRect,i){let[a,o]=(0,e.useReducer)(l,null),s=ke(e=>{if(n)for(let r of e){let{type:e,target:i}=r;if(e===`childList`&&(0,t.isHTMLElement)(i)&&i.contains(n)){o();break}}}),c=p(o);return f(()=>{o(),n?(c?.observe(n),s?.observe(document.body,{childList:!0,subtree:!0})):(c?.disconnect(),s?.disconnect())},[n,s,c]),a;function l(e){if(!n)return null;if(!n.isConnected)return e??i??null;let a=r(n);return(0,t.shallowEqual)(a,e)?e:a}}var je=[];function Me(n,r){let i=(0,e.useRef)(n),a=(0,e.useMemo)(()=>n?(0,t.getScrollableAncestors)(n,r):je,[n,r]);return(0,e.useEffect)(()=>{i.current=n},[n]),a}var Ne=[];function Pe(n,r=t.getClientRect){let[i,a]=(0,e.useReducer)(s,Ne),o=p(a);return n.length>0&&i===Ne&&a(),f(()=>{n.length?n.forEach(e=>o?.observe(e)):(o?.disconnect(),a())},[n,o]),i;function s(){return n.length?n.map(e=>{if(e===document.scrollingElement){let n=(0,t.getWindow)(e),r=n.innerWidth,i=n.innerHeight;return{top:0,left:0,right:r,bottom:i,width:r,height:i}}return new t.Rect(r(e),e)}):Ne}}function Fe(n){let[r,i]=(0,e.useState)(null),a=(0,e.useRef)(n),o=(0,e.useCallback)(e=>{let n=(0,t.getScrollableElement)(e.target);n&&i(e=>e?(e.set(n,(0,t.getScrollCoordinates)(n)),new Map(e)):null)},[]);return(0,e.useEffect)(()=>{let e=a.current;if(n!==e){r(e);let s=n.map(e=>{let n=(0,t.getScrollableElement)(e);return n?(n.addEventListener(`scroll`,o,{passive:!0}),[n,(0,t.getScrollCoordinates)(n)]):null}).filter(e=>(0,t.isNotNull)(e));i(s.length?new Map(s):null),a.current=n}return()=>{r(n),r(e)};function r(e){e.forEach(e=>{let n=(0,t.getScrollableElement)(e);n&&n.removeEventListener(`scroll`,o)})}},[o,n]),(0,e.useMemo)(()=>n.length?r?Array.from(r.values()).reduce((e,n)=>(0,t.add)(e,n),t.defaultCoordinates):(0,t.getScrollOffsets)(n):t.defaultCoordinates,[n,r])}function Ie(n,r=t.emptyArray){let i=(0,e.useRef)(null);return(0,e.useEffect)(()=>{i.current=null},r),(0,e.useEffect)(()=>{let e=n!==t.defaultCoordinates;e&&!i.current&&(i.current=n),!e&&i.current&&(i.current=null)},[n]),i.current?(0,t.subtract)(n,i.current):t.defaultCoordinates}var Le={Start:`start`,Move:`move`,Stop:`stop`},Re={isActive:!1,initialTranslate:{x:0,y:0},translate:{x:0,y:0},delta:{x:0,y:0},context:null};function ze({autoScrollEnabled:n=!0,modifiers:r=[],activeNode:i=null,containerNode:a=null}){let[o,s]=(0,e.useReducer)(Be,Re),c=typeof i==`function`?i(o.context):i,l=typeof a==`function`?a(o.context):a,u=Ae(o.isActive?c:null),d=Ae(o.isActive?l:null),f=Me(o.isActive?c:null),p=Pe(f),m=Ie(Fe(f)),h=(0,e.useMemo)(()=>{let e=e=>(t,n)=>{s({type:e,coordinates:t,context:n})};return{start:e(Le.Start),move:e(Le.Move),stop:e(Le.Stop)}},[]),g=(0,t.add)(o.initialTranslate,o.translate);Oe({delta:o.translate,enabled:n&&o.isActive,activeNodeRect:u,pointerCoordinates:g,scrollableAncestors:f,scrollableAncestorsRects:p});let _=(0,t.add)(o.translate,m),v=(0,t.adjustScrollRect)(u,m),y=(0,t.adjustScrollRect)(d,m),b=(0,t.applyMoveTransformModifiers)(r,{delta:o.delta,transform:{...o.translate,left:o.translate.x,top:o.translate.y,height:u?.height||0,width:u?.width||0},context:o.context,activeNodeRect:u,containerNodeRect:d,translate:_,initialTranslate:o.initialTranslate});return[{context:o.context,isActive:o.currentAction===`move`,transform:b,translate:o.translate,initialTranslate:o.initialTranslate,containerNodeRect:d,activeNodeRect:u,delta:o.delta},h,{pointerCoordinates:g,scrollAdjustmentActiveNodeRect:v,scrollAdjustmentContainerNodeRect:y}]}function Be(e,n){let r={[Le.Start]:(e,{coordinates:t,context:n})=>({...e,isActive:!0,currentAction:Le.Start,initialTranslate:{...t},context:n}),[Le.Move]:(e,{coordinates:t})=>({...e,currentAction:Le.Move,translate:{x:t.x-e.initialTranslate.x,y:t.y-e.initialTranslate.y},delta:{x:t.x-(e.translate.x+e.initialTranslate.x),y:t.y-(e.translate.y+e.initialTranslate.y)}}),[Le.Stop]:()=>({...Re,currentAction:Le.Stop})};return(0,t.match)(n.type,r,e,n)}var Ve=6;function He(n){let{ref:i,eventData:o,weekDays:s,weekRef:c,resizable:u=!1,resize:d,isResizeSource:f=!1,isAnyResizing:p=!1,children:m,...h}=n,{disabled:g}=U(),_=l(),{viewportRef:v}=ge(),y=(0,e.useRef)(null),b=(0,e.useRef)(null),{attributes:x,isDragging:S,overElement:C,register:w,setOverlayTransform:E}=(0,r.useDragAndDrop)(({registerDragSource:e,draggable:t,droppable:n,setTransform:r,isActive:i})=>{let a=i(y.current),[o]=a?[...n.dropTargets].pop()??[null]:[null];return{attributes:t.attributes,isDragging:a,overElement:o,register:e,setOverlayTransform:r}}),D=Ae(S?C:null),[{transform:O,context:k},A]=ze({autoScrollEnabled:!1,activeNode:()=>y.current,containerNode:()=>v.current,modifiers:[function({activeNodeRect:e,containerNodeRect:n,transform:r,translate:i,initialTranslate:a}){if(!n||!e||!D)return r;r.x=i.x+a.x-n.left,r.y=i.y+a.y-n.top,r.left=D.left-n.left+Ve,r.width=D.width-12,r.height=e.height;let o=e.top+i.y,s=D.top+t.MONTH_WEEK_GEOMETRY.header,c=D.top+D.height-e.height;return r.top=Math.max(s,Math.min(o,c))-n.top,r}]}),M=T(e=>{k===`overlay`&&C&&E(e)});(0,e.useEffect)(()=>{M(O)},[M,...Object.values(O)]);let N=T(()=>{let e=b.current??s[o.column],t={...o,date:_.toMillis(o.date),day:e&&_.toMillis(e)};return[{event:JSON.stringify(t)}]});(0,e.useEffect)(()=>{if(y.current&&!g)return w(y.current,{getItems:N,onDragStart(e){A.start({x:e.x,y:e.y},`overlay`)},onDragMove(e){A.move({x:e.x,y:e.y})},onDragEnd(e){A.stop({x:e.x,y:e.y})},getAllowedDropOperations(){return[`move`]}})},[A,g,N,w]);let P=e=>{e.stopPropagation();let t=c.current;if(!t)return;let n=t.getBoundingClientRect(),r=Math.floor((e.clientX-n.left)/n.width*s.length),i=Math.min(Math.max(r,o.column),o.column+o.span-1);b.current=s[i]??null},F=e=>({onMoveStart:()=>(d?.start(o.key,e),!0),onMove:e=>d?.move(e.clientX,e.clientY),onMoveEnd:()=>d?.end()}),{listeners:I}=j(F(`start`)),{listeners:L}=j(F(`end`)),R=ee(y,i),z=o.span>1||!o.isStart||!o.isEnd,B=Se({"--ww-column":o.column+1,"--ww-span":o.span,"--ww-row":o.lane+2},h.style);return(0,a.jsxs)(`div`,{...h,...p?null:x,ref:R,style:B,"data-key":String(o.key),"data-continues-before":o.isStart?void 0:``,"data-continues-after":o.isEnd?void 0:``,onPointerDown:P,onDoubleClick:e=>e.stopPropagation(),className:(0,t.cx)(h.className,Z.root__event,{[Z.root__event_span]:z,[Z.root__event_continuesBefore]:!o.isStart,[Z.root__event_continuesAfter]:!o.isEnd,[Z.root__event_isDragging]:S,[Z.root__event_isResizeSource]:f}),children:[m,u&&o.isStart&&(0,a.jsx)(`div`,{...I,"data-edge":`start`,className:(0,t.cx)(Z.root__resize,Z.root__resizeStart)}),u&&o.isEnd&&(0,a.jsx)(`div`,{...L,"data-edge":`end`,className:(0,t.cx)(Z.root__resize,Z.root__resizeEnd)})]})}function Ue({bar:e,children:n}){return(0,a.jsx)(`div`,{"aria-hidden":`true`,"data-key":String(e.key),"data-continues-before":e.isStart?void 0:``,"data-continues-after":e.isEnd?void 0:``,className:(0,t.cx)(Z.root__event,Z.root__event_isResizing,{[Z.root__event_span]:e.span>1||!e.isStart||!e.isEnd,[Z.root__event_continuesBefore]:!e.isStart,[Z.root__event_continuesAfter]:!e.isEnd}),style:Se({"--ww-column":e.column+1,"--ww-span":e.span,"--ww-row":e.lane+2}),children:n})}function We(t){let{days:n,firstDayIndex:r,cellRef:i,layout:o,sourceBars:s,lanes:c,resizingKey:u,resize:f}=t,p=(0,e.useRef)(null),{viewValue:m,eventRenderer:h,view:g,disabled:_}=U(),{getMonthDay:v,isSameMonth:y,isToday:b,toMillis:x}=l(),S=d(),C=u!==void 0,w=e=>h.current?.(e.value,g,{isStart:e.isStart,isEnd:e.isEnd}),T=(e,t=!1)=>(0,a.jsx)(He,{eventData:e,weekDays:n,weekRef:p,resizable:!_,resize:f,isResizeSource:t,isAnyResizing:C,children:w(e)},e.key);return(0,a.jsxs)(`div`,{ref:p,className:Z.root__week,children:[n.map((e,t)=>(0,a.jsx)(we,{ref:i(r+t),targetDate:e,"data-day-index":r+t,"data-is-outside":!y(e,m)||void 0,"data-is-today":b(e)?!0:void 0,style:Se({"--ww-column":t+1}),children:(0,a.jsx)(`span`,{className:Z.root__dayNumber,children:v(e)})},x(e))),[...o.bars.map(e=>e.key===u?(0,a.jsx)(Ue,{bar:e,children:w(e)},`preview-${e.key}`):T(e)),...s.map(e=>T(e,!0))],n.map((e,t)=>o.hidden[t]>0&&(0,a.jsx)(`span`,{className:Z.root__more,style:Se({"--ww-column":t+1,"--ww-row":c+2}),children:S.more(o.hidden[t])},`more-${x(e)}`))]})}function Ge(n,r){let[i,a]=(0,e.useState)(r),o=()=>{let e=n.current?.firstElementChild;e?.clientHeight&&a((0,t.getMonthLaneCount)(e.clientHeight,r))},s=p(o);return f(()=>{o();let e=n.current?.firstElementChild;return e&&s?.observe(e),()=>{e&&s?.unobserve(e)}},[s,r]),i}function Ke(n){let{days:r,viewportRef:i,cellsRef:a,dateUtils:o,eventMap:s,disabled:c,getIsDayDisabled:l,onEventChange:u}=n,[d,f,p]=B(null),{addGlobalListener:m,removeAllGlobalListeners:h}=E(),g=D(i,a),_=T((e=!0)=>{let t=p.current;t&&(h(),g.release(),f(null),e&&t.result&&u(t.key,t.result.date,t.result.info))}),v=T(e=>{e.key===`Escape`&&_(!1)}),y=T((e,t)=>{c||p.current||(g.measure(),f({key:e,edge:t,result:null}),m(document,`keydown`,v,!0))}),b=T((e,n)=>{let i=p.current,a=i&&s.get(i.key),c=r[g.nearestIndex(e,n)];i&&a&&c&&!l?.(c)&&f({...i,result:(0,t.resizeEventDays)(o,a,i.edge,c)})}),x=(0,e.useMemo)(()=>({start:y,move:b,end:_}),[_,b,y]),S=(0,e.useMemo)(()=>{let e=d?.result&&s.get(d.key);if(!d?.result||!e)return s;let[n]=(0,t.getEventTimeFrameFromInfo)(o,d.result.date,d.result.info);return new Map(s).set(d.key,{...e,date:n,duration:d.result.info.duration})},[o,s,d]);return{resizingKey:d?.key,actions:x,eventMap:S}}var qe=[];function Je(n){let{className:r,style:i,...o}=n,{viewValue:s,eventMap:c,startWeek:u,disabled:d,getIsDayDisabled:f,onEventChange:p}=U(),m=l();te();let h=(0,e.useRef)(null),g=I(),_=(0,e.useMemo)(()=>(0,t.getMonthGrid)(m,s,u),[m,u,s]),v=(0,e.useMemo)(()=>Ce(_),[_]),y=(0,e.useMemo)(()=>(0,t.getWeekdayNames)(m,u),[m,u]),b=Ke({days:_,viewportRef:h,cellsRef:g.elements,dateUtils:m,eventMap:c,disabled:d,getIsDayDisabled:f,onEventChange:p}),x=Ge(h,3),S=(0,e.useMemo)(()=>v.map(e=>(0,t.arrangeMonthWeek)(c,m,e,x)),[m,c,x,v]),C=(0,e.useMemo)(()=>b.eventMap===c?S:v.map(e=>(0,t.arrangeMonthWeek)(b.eventMap,m,e,x)),[m,c,x,S,b.eventMap,v]),w=(0,e.useMemo)(()=>({viewportRef:h}),[]);return(0,a.jsxs)(he.Provider,{value:w,children:[(0,a.jsxs)(`div`,{...o,className:(0,t.cx)(r,Z.root,{[Z.root_isResizing]:b.resizingKey!==void 0}),style:Se({"--ww-month-lanes":x},i),children:[(0,a.jsx)(`div`,{className:Z.root__head,children:y.map(e=>(0,a.jsx)(`div`,{className:Z.root__weekday,children:e},e))}),(0,a.jsx)(`div`,{className:Z.root__body,children:(0,a.jsx)(`div`,{ref:h,className:Z.root__viewport,children:v.map((e,t)=>(0,a.jsx)(We,{days:e,firstDayIndex:t*7,cellRef:g.refAt,layout:C[t],sourceBars:b.resizingKey===void 0?qe:S[t].bars.filter(e=>e.key===b.resizingKey),lanes:x,resizingKey:b.resizingKey,resize:b.actions},m.toMillis(e[0])))})})]}),(0,a.jsx)(xe,{className:Z.root__dragOverlay,showPreview:!1})]})}var Ye=1440;function Xe(n){let{days:r,viewportRef:i,columnsRef:a,dateUtils:o,bounds:s,timeStep:c,preventOutBoundsChanges:l}=n,[u,d]=(0,e.useState)(null),f=(0,e.useRef)(null),{addGlobalListener:p,removeGlobalListener:m}=E(),h=D(i,a),g=(0,e.useRef)(n);g.current=n;let _=s.hideMinMaxTime?s.hourMin*60:0,v=s.hideMinMaxTime?(s.hourMax-s.hourMin)*60:Ye,y=(0,e.useCallback)((e,n)=>{let i=f.current,a=h.container();if(!i||!a)return;i.x=e,i.y=n;let{disabled:u,getIsDayDisabled:p}=g.current,m=(e=>Math.round(e/c)*c)(Math.min(Math.max((n-a.top)/a.height*v,0),v)),_=Math.max(h.nearestIndex(e,n,`x`),0),y=(0,t.resizeEventRange)({start:i.original[0],end:i.original[1]},i.edge,_,m,{dayCount:r.length,bounds:s,timeStep:c,crossDays:!l||s.hourMin<=0&&s.hourMax>=24,getFrame:e=>{if(!l)return[0,v];let[n,i]=(0,t.getTimeFrame)(o,r[e],s);return[Math.ceil(n/c)*c,Math.min(Math.ceil(i/c)*c,v)]},canEditDay:e=>!u&&!p?.(r[e])&&!(l&&(0,t.isPastDay)(o,r[e]))});y&&(i.range=y),d({key:i.key,range:i.range,x:e,y:n,blocked:!y})},[s,o,r,h,l,c,v]),x=T(()=>{let e=f.current;e&&y(e.x,e.y)}),S=(0,e.useMemo)(()=>({start(e,n,i,a){let s=g.current.eventMap.get(e);if(!s||!r[0]||!h.measure())return;let c=(0,t.toDayMinutes)(o,r[0],s.date),l=[c,c+s.duration];f.current={key:e,edge:n,original:l,range:l,x:i,y:a},p(document,`scroll`,x,!0),d({key:e,range:l,x:i,y:a,blocked:!1})},move:y,end(){let e=f.current;if(e&&y(e.x,e.y),f.current=null,m(document,`scroll`,x,!0),h.release(),d(null),!e)return;let[n,i]=e.range;if(n===e.original[0]&&i===e.original[1])return;let a=Math.floor(n/Ye);g.current.onEventChange(e.key,(0,t.fromDayMinutes)(o,r[0],a*Ye),{from:n-a*Ye,duration:i-n})}}),[p,o,r,x,h,m,y]);return b(u?.blocked?`not-allowed`:null),{state:u,actions:S,previewOf:e=>{let n=Math.floor(e[0]/Ye);return{date:(0,t.fromDayMinutes)(o,r[0],n*Ye),top:e[0]-n*Ye-_,duration:e[1]-e[0]}}}}var Ze=(0,e.createContext)(void 0);t.isDevEnvironment&&(Ze.displayName=`DayWeekViewContext`);function Qe(){let t=(0,e.useContext)(Ze);if(!t)throw Error(`DayWeekViewContext is required`);return t}var $e=(0,e.createContext)(void 0);t.isDevEnvironment&&($e.displayName=`DayWeekDrawerContext`);function et(){let t=(0,e.useContext)($e);if(!t)throw Error(`DayWeekDrawerContext is required: render the event inside a DayWeekDrawer`);return t}function tt(n=!0,r=6e4){let{hideMinMaxTime:i,hourMin:a,hourMax:o}=U(),s=l(),[c,u]=(0,e.useState)(null);return V(()=>u(Date.now()),r,n),(0,e.useMemo)(()=>c===null?[0,!0]:(0,t.getNowOffset)(s,{hourMin:a,hourMax:o,hideMinMaxTime:i}),[c,s,a,o,i])}var nt={root:`_root_1d4hh_1`,root_timeLimit:`_root_timeLimit_1d4hh_12`,root_isToday:`_root_isToday_1d4hh_12`,root_isPast:`_root_isPast_1d4hh_22`,root__container:`_root__container_1d4hh_40`,root__spotlight:`_root__spotlight_1d4hh_61`,root__timeLine:`_root__timeLine_1d4hh_71`,root_offLimits:`_root_offLimits_1d4hh_125`};function rt(n){let{ref:i,targetDate:o,children:s,...c}=n,{onEventChange:u,onEventCreate:d,getIsDayDisabled:f,pointerPreviewRenderer:p,eventMap:m,...h}=U(),{viewportRef:g,getTimeFrame:_,pxPerMinute:v}=Qe(),{hideMinMaxTime:y,preventOutBoundsChanges:b,timeStep:x,hourMin:S,hourMax:C,disabled:w}=h,T=l(),{isBefore:E,isToday:D}=T,O=x*v,k=e=>it(e,v,x),A=e=>_(e).map(e=>e*v),M=(0,e.useRef)(null),N=(0,e.useRef)(null),{register:P,getTransform:F}=(0,r.useDragAndDrop)(({registerDropTarget:e,getTransform:t})=>({register:e,getTransform:t})),I=te(),L=(0,e.useMemo)(()=>{let e=D(o);return{isToday:e,isPast:E(o)&&!e}},[E,D,o,I]),[{isActive:R,transform:z},B,{scrollAdjustmentActiveNodeRect:V}]=ze({activeNode:M.current,containerNode:M.current,modifiers:[function({activeNodeRect:e,initialTranslate:t,translate:n,transform:r}){if(!e)return r;let i=t.y-e.top;r.x=r.left+t.x,r.y=r.top+t.y,r.top=Math.floor(i/O)*O,r.height=O,r.left=0,r.width=e.width;let a;return n.y>0?(a=O-i%O,r.height=Math.ceil((r.height+n.y-a)/O)*O):(a=i%O,r.height=Math.ceil((r.height-n.y-a)/O)*O,r.top-=r.height-O),r.height=Math.max(r.height,O),r},function({transform:e}){if(!b)return e;let[t,n]=_(o).map(e=>Math.ceil(e/x)*O);return e.top<t&&(e.height=Math.max(e.height-(t-e.top),O),e.top=t),e.height+e.top>=n&&(e.height=Math.max(n-e.top,O)),e},t.boundingResizableContainerModifier,(0,t.getTimeStepEqualizerModifier)(O)]}),[H,ne]=tt(L.isToday);(0,e.useEffect)(()=>{let e=M.current;if(e)return P(e,{data:{date:o},onDrop:async e=>{let[n]=await Promise.all(e.items.filter(e=>e.kind===`text`&&e.types.has(`event`)&&`getText`in e).map(async e=>{let t=await e.getText(`event`);return JSON.parse(t)})),r=F(),i=it(r.top,v,x),a=it(r.height,v,x),s=y?S*60:0,c=m.get(n.key),l=c?(0,t.toDayMinutes)(T,c.date,c.date):0;if(c&&l+c.duration>1440){if(b&&(S>0||C<24)){B.stop({x:e.x,y:e.y});return}let r=T.getStartOfDay(T.fromMillis(n.date)),a=(0,t.toDayMinutes)(T,c.date,r)+s+n.start-l,d=s+i-a,f=Math.floor(d/1440);u(n.key,T.addDays(o,f),{from:d-f*24*60,duration:c.duration})}else y?u(n.key,o,{from:i+S*60,duration:a}):u(n.key,o,{from:i,duration:a});B.stop({x:e.x,y:e.y})},getDropOperationForPoint:(e,t)=>{if(w||!e.has(`event`)||f&&f(o))return`cancel`;let{isPast:n,isToday:r}=L;if(b){if(!r&&n)return`cancel`;let[e,t]=_(o).map(e=>e*v),i=F();if(i.y<e||i.y>t||r&&i.height>t-e)return`cancel`}return t[0]}})},[B,T,w,m,f,_,F,y,C,S,u,b,v,P,o,x,L]);let{listeners:W,ref:re}=j({distance:Math.max(Math.min(5,x),1),touchDelay:t.TOUCH_HOLD_DELAY,onMoveStart:e=>{if(!w){if(b){let{isToday:e,isPast:t}=L;if(t&&!e)return!1}B.start({x:e.clientX,y:e.clientY}),e.pointerType===`touch`&&B.move({x:e.clientX,y:e.clientY})}},onMove:e=>{if(R)B.move({x:e.clientX,y:e.clientY});else if(V){if(b){let[t,n]=A(o),r=e.clientY-V.top;if(r<t||r>n){B.stop({x:e.clientX,y:e.clientY});return}}R||B.move({x:e.clientX,y:e.clientY})}},onMoveEnd:e=>{B.stop({x:e.clientX,y:e.clientY}),R&&(y?d(o,{from:k(z.top)+S*60,duration:k(z.height)}):d(o,{from:k(z.top),duration:k(z.height)}))}}),ie=(0,e.useMemo)(()=>({drawerRef:M,containerRef:N}),[]),G=ee(M,re,i),K=(0,t.formatNowOffset)(T,H,{hourMin:S,hideMinMaxTime:y}),ae=()=>p.current?.(o,k(z.top),k(z.height));return(0,a.jsxs)(`div`,{...c,...W,ref:G,className:(0,t.cx)(c.className,nt.root,{[nt.root_timeLimit]:b,[nt.root_isToday]:L.isToday,[nt.root_isPast]:L.isPast,[nt.root_offLimits]:ne}),style:{...c.style,"--offset":H*v},children:[L.isToday&&!ne&&(0,a.jsx)(ce,{container:g.current,children:(0,a.jsx)(`span`,{tabIndex:-1,className:nt.root__timeLine,"data-now":K,style:{"--offset":H*v}})}),(0,a.jsx)(`div`,{ref:N,className:nt.root__container,children:(0,a.jsx)($e.Provider,{value:ie,children:s})}),R&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{className:nt.root__spotlight,style:z?{...z}:void 0}),(0,a.jsx)(ve,{coordinates:{x:z.x,y:z.y},children:ae()})]})]})}function it(e,t,n){return Math.round(e/t/n)*n}function at(n,r,i){let[a,o]=(0,e.useState)(null);return f(()=>{let e=n.current,a=r.current;if(e&&a){let{height:n,width:r,...s}=(0,t.getClientRect)(e),{left:c,top:l}=(0,t.subtract)(s,(0,t.getClientRect)(a));o((0,t.round)(i,{height:n,width:r,x:c,y:l}))}},[n,r,...Object.values(i)]),a}function ot(t,n){let[r,i]=(0,e.useState)(!0),{preventOutBoundsChanges:a}=U(),{isBefore:o,isToday:s}=l(),{getTimeFrame:c}=Qe();return f(()=>{if(n&&a){if(o(t)&&!s(t))i(!1);else if(s(t)){let{height:e,y:r}=n,a=e+r,[o,s]=c(t);i(a>o&&r<s)}}},[t,n,c,a,o,s]),r}var Q={root:`_root_1g6ad_1`,root_isDragging:`_root_isDragging_1g6ad_12`,root__resizeTop:`_root__resizeTop_1g6ad_12`,root__resizeBottom:`_root__resizeBottom_1g6ad_14`,root_isResizing:`_root_isResizing_1g6ad_16`,root_isDisabled:`_root_isDisabled_1g6ad_43`,root__container:`_root__container_1g6ad_59`,root__dragPreview:`_root__dragPreview_1g6ad_108`,root_isPreview:`_root_isPreview_1g6ad_114`,root_isResizeSource:`_root_isResizeSource_1g6ad_119`};function st(n){let{ref:i,eventData:o,children:s,...c}=n,{eventMap:u,...d}=U(),f=l(),{timeStep:p,preventOutBoundsChanges:m,disabled:h}=d,g=(0,e.useRef)(null),_=(0,e.useRef)(null),v=(0,e.useRef)(null),{viewportRef:y,getTimeFrame:b,pxPerMinute:x,resize:S,resizing:C}=Qe(),w=p*x,{drawerRef:E,containerRef:D}=et(),O=at(g,D,o.rect),k=ot(u.get(o.key)?.date??o.date,O),{attributes:A,isDragging:M,overElement:N,overData:P,register:F,setOverlayTransform:I}=(0,r.useDragAndDrop)(({registerDragSource:e,draggable:t,droppable:n,setTransform:r,isActive:i})=>{let a=i(g.current),[o,s]=a?[...n.dropTargets].pop()??[null,null]:[null,null];return{attributes:t.attributes,overElement:o,overData:s,isDragging:a,register:e,setOverlayTransform:r}}),L=Ae(M?N:null),[{isActive:R,transform:z,context:B},V]=ze({activeNode:e=>e===`overlay`?g.current:e===`top`?_.current:v.current,containerNode:e=>e===`overlay`?y.current:E.current,modifiers:[function({activeNodeRect:e,containerNodeRect:t,context:n,transform:r,translate:i,initialTranslate:a}){if(n!==`overlay`||!t||!e||!L)return r;r.x=i.x+a.x-t.left,r.y=i.y+a.y-t.top,r.left=L.left-t.left,r.width=L.width,r.top=e.top-t.top,r.height=e.height;let o;return i.y>0?(o=w-(a.y-e.top)%w,r.top+=Math.ceil((i.y-o)/w)*w):(o=(a.y-e.top)%w,r.top+=Math.floor((i.y+o)/w)*w),r},function({transform:e,context:t}){if(!m||t!==`overlay`||!P)return e;let[n,r]=b(P.date).map(e=>Math.ceil(e/p)*w);return e.top<n&&(e.top=n),e.top+e.height>r&&(e.top=r-e.height),e},ct(w)]}),H=(0,t.mergeCallbacks)(()=>S.end(),e=>{V.stop({x:e.clientX,y:e.clientY})}),te=e=>({onMoveStart:t=>(V.start({x:t.clientX,y:t.clientY},e),S.start(o.key,e,t.clientX,t.clientY),!0),onMove:e=>{V.move({x:e.clientX,y:e.clientY}),S.move(e.clientX,e.clientY)},onMoveEnd:H}),{listeners:ne}=j(te(`bottom`)),{listeners:W}=j(te(`top`)),re=ee(g,i),ie=R&&M&&B===`overlay`,G=C?.key===o.key,K=T(e=>{B===`overlay`&&N&&I(e)});(0,e.useEffect)(()=>{K(z)},[K,...Object.values(z)]),(0,e.useEffect)(()=>{if(!g.current)return;let e={...(0,t.omit)(o,`rect`),date:f.toMillis(o.date)},n=[{event:JSON.stringify(e)}];return F(g.current,{getItems(){return n},onDragStart(e){V.start({x:e.x,y:e.y},`overlay`)},onDragMove(e){V.move({x:e.x,y:e.y})},onDragEnd(e){V.stop({x:e.x,y:e.y})},getAllowedDropOperations(){return[`move`]}})},[V,o,F]);let ae=(0,t.cx)(c.className,Q.root,{[Q.root_isDragging]:ie,[Q.root_isResizeSource]:G,[Q.root_isDisabled]:h}),q={...c.style,top:`${o.rect.y}%`,left:`${o.rect.x}%`,width:`${o.rect.width}%`,height:`${o.rect.height}%`},oe=T((0,t.mergeCallbacks)(c.onPointerDown,e=>e.stopPropagation()));return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(`div`,{...c,...A,ref:re,className:ae,style:q,onPointerDown:oe,"data-continues-before":o.isStart?void 0:``,"data-continues-after":o.isEnd?void 0:``,children:[k&&o.isStart&&(0,a.jsx)(`div`,{...W,ref:_,className:Q.root__resizeTop}),(0,a.jsx)(`div`,{role:`button`,tabIndex:0,className:Q.root__container,children:s}),k&&o.isEnd&&(0,a.jsx)(`div`,{...ne,ref:v,className:Q.root__resizeBottom})]})})}function ct(e){return n=>{let r=[(0,t.getTimeStepEqualizerModifier)(e)];return n.context===`overlay`&&r.push(t.boundingDraggableContainerModifier),(0,t.applyMoveTransformModifiers)(r,n)}}function lt({part:e,timelineMinutes:t,children:n}){let r=e=>`${e/t*100}%`;return(0,a.jsx)(`div`,{"aria-hidden":`true`,className:`${Q.root} ${Q.root_isResizing} ${Q.root_isPreview}`,"data-continues-before":e.isStart?void 0:``,"data-continues-after":e.isEnd?void 0:``,style:{top:r(e.start),height:r(e.duration),left:0,width:`100%`},children:(0,a.jsx)(`div`,{className:Q.root__container,children:n})})}var $={root:`_root_143fq_1`,root_scrollable:`_root_scrollable_143fq_11`,root__body:`_root__body_143fq_11`,root__head:`_root__head_143fq_15`,root__main:`_root__main_143fq_33`,root__viewport:`_root__viewport_143fq_47`,root__column:`_root__column_143fq_58`,root__headerCell:`_root__headerCell_143fq_83`,root__headerCellDay:`_root__headerCellDay_143fq_110`,root__headerCellLabel:`_root__headerCellLabel_143fq_117`,root__headerCellName:`_root__headerCellName_143fq_124`,root__headerCellToday:`_root__headerCellToday_143fq_131`,root__row:`_root__row_143fq_146`,root__timeStep:`_root__timeStep_143fq_168`,root__timeStep_overTime:`_root__timeStep_overTime_143fq_180`,root__rowHeadTime:`_root__rowHeadTime_143fq_184`,root__hiddenEventsLayer:`_root__hiddenEventsLayer_143fq_200`,root__hiddenEventsColumn:`_root__hiddenEventsColumn_143fq_216`,root__hiddenEvents:`_root__hiddenEvents_143fq_200`,root__hiddenEventsIcon:`_root__hiddenEventsIcon_143fq_265`};function ut({scrollerRef:n,columns:r,rowHeight:i}){let{hourMin:o,hideMinMaxTime:s,size:c}=U(),u=l(),f=d(),{addGlobalListener:m,removeGlobalListener:h}=E(),[g,_]=(0,e.useState)(null),v=i/60,y=T(()=>{let e=n.current;if(!e)return;let t={top:e.scrollTop,height:e.clientHeight};_(e=>e?.top===t.top&&e.height===t.height?e:t)}),b=p(y);(0,e.useEffect)(()=>{let e=n.current;if(e)return y(),m(e,`scroll`,y,{passive:!0}),b?.observe(e),()=>{h(e,`scroll`,y),b?.unobserve(e)}},[m,y,h,b,n]),(0,e.useEffect)(y,[y,i,r]);let x=(0,e.useMemo)(()=>g&&g.height>0?r.map(e=>(0,t.getHiddenEvents)(e,v,g.top,g.height)):null,[r,v,g]);if(!x||!g)return null;let S=e=>n.current?.scrollTo({top:(0,t.getRevealScrollTop)(e,v,g.top,g.height),behavior:`smooth`}),C=(e,n)=>{let[r]=e;if(!r)return null;let i=e.length===1&&c!==`narrow`?(0,t.formatNowOffset)(u,r.start,{hourMin:o,hideMinMaxTime:s}):e.length;return(0,a.jsxs)(`button`,{type:`button`,className:$.root__hiddenEvents,"data-direction":n,"aria-label":n===`above`?f.earlier(e.length):f.later(e.length),onClick:()=>S(r),children:[(0,a.jsx)(G,{"aria-hidden":`true`,className:$.root__hiddenEventsIcon}),i]})};return(0,a.jsxs)(`div`,{className:$.root__hiddenEventsLayer,children:[(0,a.jsx)(`div`,{}),x.map(({above:e,below:t},n)=>(0,a.jsxs)(`div`,{className:$.root__hiddenEventsColumn,children:[C(e,`above`),C(t,`below`)]},n))]})}function dt(t,n,r,i){let[a,o]=(0,e.useState)();return f(()=>{let e=!1,r=()=>{let r=t.current;if(e||!r)return;let a=0,s=document.createRange();if(typeof s.getBoundingClientRect!=`function`)return;for(let e of n.current){if(!e)continue;s.selectNodeContents(e);let t=getComputedStyle(e),n=s.getBoundingClientRect().width;a=Math.max(a,n+parseFloat(t.paddingLeft)+parseFloat(t.paddingRight))}let c=r.parentElement??document.body,l=parseFloat(getComputedStyle(c).getPropertyValue(`--ww-time-column`));o(a>(Number.isNaN(l)?i:l)?Math.ceil(a):void 0)};return r(),document.fonts?.ready.then(r),()=>{e=!0}},[i,r.join(`|`),n,t]),a}var ft={regular:64,compact:44,narrow:40};function pt({rowHeight:n,...r}){let{viewValue:i,hourMin:o,hourMax:s,view:c,eventMap:u,preventOutBoundsChanges:f,eventRenderer:p,timeStep:m,scrollable:h,size:g,hideMinMaxTime:_,disabled:v,getIsDayDisabled:y,onEventChange:b,pointerPreviewRenderer:x}=U(),S=l(),C=d(),{getMonthDay:w,getWeekDay:T,isToday:E,weekDayShortName:D}=S,O=te(),k=n??t.ROW_HEIGHTS[g],A=(0,e.useRef)(null),j=(0,e.useRef)(null),M=(0,e.useRef)(null),N=I(),P=(0,e.useMemo)(()=>(0,t.buildTimeRows)(S,m,{hourMin:o,hourMax:s,hideMinMaxTime:_},f),[S,m,o,s,_,f]),F=(0,e.useMemo)(()=>P.map(({time:e})=>e),[P]),L=I(),R=dt(A,L.elements,F,ft[g]),B=(0,e.useMemo)(()=>(0,t.getVisibleDays)(S,c,i),[S,c,i]),V=(0,e.useMemo)(()=>({hourMin:o,hourMax:s,hideMinMaxTime:_}),[o,s,_]),H=(0,e.useMemo)(()=>(0,t.arrangeEventsByDay)(u,S,P.length*60,B,V),[u,S,P.length,B,V]),ne=(0,e.useMemo)(()=>H.map(({events:e})=>e),[H]),{state:W,actions:re,previewOf:ie}=Xe({days:B,viewportRef:j,columnsRef:N.elements,dateUtils:S,bounds:V,timeStep:m,preventOutBoundsChanges:f,disabled:v,getIsDayDisabled:y,eventMap:u,onEventChange:b}),G=(0,e.useMemo)(()=>W?(0,t.splitIntoDays)(W.range[0],W.range[1],B.length,V):[],[W,B.length,V]),K=W?u.get(W.key)?.value:void 0,ae=(0,e.useCallback)(e=>(0,t.getTimeFrame)(S,e,{hourMin:o,hourMax:s,hideMinMaxTime:_}),[S,_,s,o]),q=(0,e.useMemo)(()=>B.map((e,t)=>{let n=T(e),r=E(e),i=H[t]?.events??[];return{attributes:r?{"data-is-today":!0}:void 0,events:i,day:w(e),isToday:r,targetDate:e,weekDayName:D(n),weekDayNumber:n}}),[O,S,B,H,w,T,E,D]),oe=z(),se=r,ce=$.root__head,J=$.root__body,le=$.root__viewport,ue=$.root__column,de=$.root__headerCell,Y=$.root__headerCellDay,fe=$.root__row,pe=$.root__rowHeadTime,X=$.root__timeStep,me=ee(j),ge=(0,e.useMemo)(()=>({viewportRef:j,getTimeFrame:ae,pxPerMinute:k/60,resize:re,resizing:W}),[j,ae,k,re,W]),_e=(0,e.useMemo)(()=>({viewportRef:j}),[j]),ye=(e,t)=>(0,a.jsx)(st,{"data-idx":t,eventData:e,children:p.current?.(e.value,c,{isStart:e.isStart,isEnd:e.isEnd})},e.key);return(0,a.jsx)(Ze.Provider,{value:ge,children:(0,a.jsx)(he.Provider,{value:_e,children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(`div`,{...se,ref:A,className:(0,t.cx)(se.className,$.root,{[$.root_scrollable]:h}),style:{...se.style,"--calendar-column-count":q.length,"--scrollbar-width":oe.width,"--scrollbar-height":oe.height,...R!==void 0&&{"--ww-time-column":`${R}px`}},children:[(0,a.jsxs)(`div`,{className:ce,children:[(0,a.jsx)(`div`,{className:de}),q.map(e=>(0,a.jsxs)(`div`,{className:de,...e.attributes,children:[(0,a.jsx)(`span`,{className:Y,children:e.day}),(0,a.jsxs)(`span`,{className:$.root__headerCellLabel,children:[(0,a.jsx)(`span`,{className:$.root__headerCellName,children:e.weekDayName}),e.isToday&&(0,a.jsx)(`span`,{className:$.root__headerCellToday,children:C.today})]})]},e.weekDayNumber))]}),(0,a.jsxs)(`div`,{className:$.root__main,children:[(0,a.jsx)(`div`,{ref:M,className:J,children:(0,a.jsxs)(`div`,{ref:me,className:le,style:{height:P.length*k},children:[(0,a.jsx)(`div`,{className:ue,children:P.map(({time:e,value:n,steps:r},i)=>(0,a.jsxs)(`div`,{className:fe,style:{height:k,"--translateY":i*k,"--calendar-rows-count":r.length},children:[(0,a.jsx)(`time`,{ref:L.refAt(i),className:pe,children:e}),r.map(([e,,n])=>(0,a.jsx)(`div`,{className:(0,t.cx)(X,{[$.root__timeStep_overTime]:n})},e))]},n))}),q.map((e,t)=>(0,a.jsx)(`div`,{ref:N.refAt(t),className:ue,"data-day-index":t,...e.attributes,children:(0,a.jsxs)(rt,{id:`${e.weekDayNumber}`,targetDate:e.targetDate,children:[e.events.map((e,t)=>ye(e,t)),G.filter(e=>e.dayIndex===t).map(e=>(0,a.jsx)(lt,{part:e,timelineMinutes:P.length*60,children:K===void 0?null:p.current?.(K,c,{isStart:e.isStart,isEnd:e.isEnd})},`resize`))]})},e.weekDayNumber))]})}),h&&(0,a.jsx)(ut,{scrollerRef:M,columns:ne,rowHeight:k})]})]}),(0,a.jsx)(xe,{pxPerMinute:k/60}),W&&!W.blocked&&(0,a.jsx)(ve,{coordinates:{x:W.x,y:W.y},children:(()=>{let{date:e,top:t,duration:n}=ie(W.range);return x.current?.(e,t,n)})()})]})})})}var mt={root:`_root_szob5_2`,root__head:`_root__head_szob5_22`,root__body:`_root__body_szob5_26`,root__body_readonly:`_root__body_readonly_szob5_37`};function ht(i){let{ref:o,disabled:s=!1,children:c,hideMinMaxTime:u=!1,timeFrame:d,startWeek:f,timeStep:p=15,items:g,onEventCreate:_,onEventChange:v,onEventDelete:y,onEventEdit:b,eventTimeFrameResolver:x,eventKeyResolver:C,getIsDayDisabled:w,pointerPreviewFormat:E,scrollable:D=!1,view:O,defaultView:k,viewValue:A,defaultViewValue:j,onChangeView:M,onChangeViewValue:N,...P}=i,{hourMax:F,hourMin:I}={hourMin:0,hourMax:24,...d},L=h({eventTimeFrameResolver:x,eventKeyResolver:C}),R=l(),z=f??R.weekStartsOn,B=(0,e.useRef)(null),V=ee(B,o),{viewValue:H,changeViewValue:te,view:U,changeView:G}=re({view:O,defaultView:k,viewValue:A,defaultViewValue:j,onChangeView:M,onChangeViewValue:N,dateUtils:R,startWeek:z}),K=m(B),ae=S(()=>(0,n.createDragAndDropApi)({input:`pointer`,touchDelay:t.TOUCH_HOLD_DELAY})).current,q=(0,e.useMemo)(()=>(0,t.buildEventMap)(g,L.current,R,{hourMin:I,hideMinMaxTime:u}),[R,u,I,g,L]),{goBackward:oe,goForward:se,goToday:ce}=ie({changeViewValue:te,dateUtils:R,startWeek:z,view:U,viewValue:H}),J=T((e,n,r)=>{let i=q.get(e);i&&v?.(i.value,...(0,t.getEventTimeFrameFromInfo)(R,n,r))}),le=T((e,n)=>{_?.(...(0,t.getEventTimeFrameFromInfo)(R,e,n))}),ue=T(e=>{let t=q.get(e);t&&b?.(t.value)}),de=T(e=>{let t=q.get(e);t&&y?.(t.value)}),Y=h((e,n,r)=>{let[i,a]=(0,t.getTimelineRange)(R,e,n,r,{hourMin:I,hideMinMaxTime:u});return E?E(i,a):(0,t.formatTimelineRange)(R,i,a)}),fe=h(c);(0,e.useEffect)(()=>{if(B.current)return ae.getState().registerRootElement(B.current)},[ae]);let pe={...P,ref:V},X=(0,e.useMemo)(()=>({disabled:s,getIsDayDisabled:w,preventOutBoundsChanges:!!d,changeView:G,changeViewValue:te,eventMap:q,goBackward:oe,goForward:se,goToday:ce,hideMinMaxTime:u,hourMax:F,hourMin:I,timeStep:p,scrollable:D,size:K,startWeek:z,view:U,viewValue:H,onEventCreate:le,onEventChange:J,onEventDelete:de,onEventEdit:ue,eventRenderer:fe,pointerPreviewRenderer:Y}),[s,Y,w,G,te,q,oe,se,ce,u,F,I,D,K,z,p,U,H,le,J,de,ue,fe]);return(0,a.jsx)(`div`,{...pe,className:(0,t.cx)(pe.className,mt.root),"data-ww-size":K===`regular`?void 0:K,children:(0,a.jsx)(ne.Provider,{value:X,children:(0,a.jsx)(r.DragAndDropContext.Provider,{value:ae,children:(0,a.jsxs)(W.Provider,{value:B,children:[(0,a.jsx)(`div`,{className:mt.root__head,children:(0,a.jsx)(me,{})}),(0,a.jsx)(`div`,{className:mt.root__body,children:U===`month`?(0,a.jsx)(Je,{}):(0,a.jsx)(pt,{})})]})})})})}exports.Calendar=ht,exports.default=ht,exports.DateLocalizationContext=s,exports.DateLocalizationProvider=function(n){let{adapter:r,messages:i,children:o}=n,c=(0,e.useMemo)(()=>typeof r==`function`?new r:r,[r]),l=(0,e.useMemo)(()=>(0,t.resolveMessages)(c.locale,i),[c.locale,i]);return(0,a.jsx)(s.Provider,{value:c,children:(0,a.jsx)(u.Provider,{value:l,children:o})})},exports.MessagesContext=u,Object.defineProperty(exports,"builtInMessages",{enumerable:!0,get:function(){return t.builtInMessages}}),Object.defineProperty(exports,"resolveMessages",{enumerable:!0,get:function(){return t.resolveMessages}}),exports.useDateUtils=c,exports.useMessages=d;
|
|
13
13
|
//# sourceMappingURL=index.cjs.map
|