@pglejzer/datepicker-ui 0.0.1 → 1.1.0

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.
@@ -0,0 +1,193 @@
1
+ import { B as HintLetters, G as FullDateOptions, H as formatHint, J as formatMonthYear, K as WeekStartOption, R as FormatOption, U as resolvePattern, V as formatDate, W as DatePart, X as weekdayNames, Y as resolveWeekStart, Z as CalendarMode, f as ThemeName, n as SurfaceMode, nt as Weekday, q as formatFullDate, rt as YearMonth, tt as PlainDate, z as FormatPattern } from "./shared.cjs";
2
+ interface SurfaceHost {
3
+ readonly root: HTMLElement;
4
+ readonly body: HTMLElement;
5
+ open(): Promise<void>;
6
+ close(): Promise<void>;
7
+ destroy(): void;
8
+ /** Renames the surface by the constructor's rule: a non-empty `labelledBy` sets `aria-labelledby` and removes `aria-label`; otherwise `label` becomes the `aria-label` and `aria-labelledby` is removed. */
9
+ setLabel(label: string, labelledBy?: string): void;
10
+ }
11
+ export declare function waitForExit(element: HTMLElement): Promise<void>;
12
+ export declare class DialogHost implements SurfaceHost {
13
+ readonly root: HTMLElement;
14
+ readonly body: HTMLElement;
15
+ private readonly dialog;
16
+ private readonly controller;
17
+ private readonly allowPageScroll;
18
+ private releaseScroll;
19
+ private openPromise;
20
+ private closePromise;
21
+ private pointerStartedOnBackdrop;
22
+ private destroyed;
23
+ constructor(options: {
24
+ parent: HTMLElement;
25
+ label: string;
26
+ /** Id, or space-separated ids, of a visible title that names the surface. When set, the root gets `aria-labelledby` and no `aria-label`. */
27
+ labelledBy?: string;
28
+ allowPageScroll: boolean;
29
+ onCancel(reason: "escape" | "outside"): void;
30
+ });
31
+ open(): Promise<void>;
32
+ close(): Promise<void>;
33
+ destroy(): void;
34
+ setLabel(label: string, labelledBy?: string): void;
35
+ private unlock;
36
+ }
37
+ export declare class InlineHost implements SurfaceHost {
38
+ readonly root: HTMLElement;
39
+ readonly body: HTMLElement;
40
+ constructor(options: {
41
+ container: HTMLElement;
42
+ label: string;
43
+ /** Id, or space-separated ids, of a visible title that names the surface. When set, the root gets `aria-labelledby` and no `aria-label`. */
44
+ labelledBy?: string;
45
+ });
46
+ open(): Promise<void>;
47
+ close(): Promise<void>;
48
+ destroy(): void;
49
+ setLabel(label: string, labelledBy?: string): void;
50
+ }
51
+ export declare class PopoverHost implements SurfaceHost {
52
+ readonly root: HTMLElement;
53
+ readonly body: HTMLElement;
54
+ private readonly anchor;
55
+ private readonly anchorName;
56
+ private readonly fallback;
57
+ private readonly controller;
58
+ private stopTracking;
59
+ private restoreAnchor;
60
+ private hasPopover;
61
+ private anchored;
62
+ private openPromise;
63
+ private closePromise;
64
+ private destroyed;
65
+ constructor(options: {
66
+ host: HTMLElement;
67
+ anchor: HTMLElement;
68
+ instanceId: string;
69
+ rtl: boolean;
70
+ label: string;
71
+ /** Id, or space-separated ids, of a visible title that names the surface. When set, the root gets `aria-labelledby` and no `aria-label`. */
72
+ labelledBy?: string;
73
+ inside: readonly HTMLElement[];
74
+ ignoreOutsideClick: boolean;
75
+ onOutside(): void;
76
+ onEscape(): void;
77
+ });
78
+ open(): Promise<void>;
79
+ close(): Promise<void>;
80
+ destroy(): void;
81
+ setLabel(label: string, labelledBy?: string): void;
82
+ private endTracking;
83
+ private show;
84
+ private hide;
85
+ private enableFallback;
86
+ private update;
87
+ }
88
+ export declare const createTextButton: (modifier: string, label: string) => HTMLButtonElement;
89
+ interface PagerOptions<K> {
90
+ /** Right-to-left: dragging left goes back. */
91
+ readonly rtl: boolean;
92
+ /** Drag and wheel paging. */
93
+ readonly swipe: boolean;
94
+ /** Slide animation. Reduced motion turns it into a fade. */
95
+ readonly animate: boolean;
96
+ /** Sets the pager height to the shown page through `pageHeight`. Default `false`. */
97
+ readonly fitHeight?: boolean;
98
+ /** Builds the page for `key`. */
99
+ renderPage(key: K): HTMLElement;
100
+ /** Height of the page for `key`, used with `fitHeight`. */
101
+ pageHeight?(key: K): number;
102
+ /** The key one page before (`-1`) or after (`1`) `key`. */
103
+ step(key: K, direction: -1 | 1): K;
104
+ /** Whether two keys name the same page. */
105
+ isSame(a: K, b: K): boolean;
106
+ /** A drag or wheel gesture finished on a neighbour page. Call `slide()` to show it. */
107
+ onCommit(direction: -1 | 1, source: "drag" | "wheel"): void;
108
+ }
109
+ export declare class Pager<K> {
110
+ private readonly viewport;
111
+ private readonly options;
112
+ private readonly track;
113
+ private readonly controller;
114
+ private readonly previousTouchAction;
115
+ private readonly strip;
116
+ private readonly animator;
117
+ private drag;
118
+ private wheel;
119
+ private resizeObserver;
120
+ private observedWidth;
121
+ private offset;
122
+ private revision;
123
+ constructor(viewport: HTMLElement, options: PagerOptions<K>);
124
+ /** Shows `key` without animation. */
125
+ show(key: K): void;
126
+ /** Slides to `key` in `direction`. */
127
+ slide(key: K, direction: -1 | 1): void;
128
+ /** Ends a running slide at once. */
129
+ finish(): void;
130
+ destroy(): void;
131
+ private get destroyed();
132
+ private enableSwipe;
133
+ private observeWidth;
134
+ private cancelGestures;
135
+ private release;
136
+ private settle;
137
+ private fitHeight;
138
+ private rest;
139
+ private setOffset;
140
+ private transformFor;
141
+ private pageWidth;
142
+ }
143
+ export declare const resolveSurfaceMode: (option: "auto" | "docked" | "modal", inlineEnabled: boolean, viewportWidth: number, viewportHeight: number) => SurfaceMode;
144
+ export declare const isFullscreenRange: (mode: CalendarMode, surface: SurfaceMode, viewportWidth: number, fullscreenBelow: number) => boolean;
145
+ /**
146
+ * Whether a docked surface fits the window entirely below its anchor or
147
+ * entirely above it, keeping an 8 px margin to the window edge. These are
148
+ * the two sides the popover tries, below first. The anchor is measured where
149
+ * it is now, so call it while the surface is shown.
150
+ */
151
+ export declare function fitsViewport(root: HTMLElement, anchor: HTMLElement): boolean;
152
+ type Scheme = "light" | "dark";
153
+ export declare function detectColorScheme(from: HTMLElement): Scheme;
154
+ export declare function watchColorScheme(onChange: () => void): () => void;
155
+ /** Theme settings for a surface root. */
156
+ interface SurfaceTheme {
157
+ /** Theme name, written to `data-theme`. */
158
+ readonly theme: ThemeName;
159
+ /** Resolved scheme, written to `data-color-scheme`. For `"auto"` use `detectColorScheme()`. */
160
+ readonly colorScheme: Scheme;
161
+ /** Extra classes, like `ui.cssClass`. Classes from the previous call are removed. */
162
+ readonly className?: string;
163
+ /** Right-to-left: toggles `dp-ui__container--rtl` on the surface container. */
164
+ readonly rtl?: boolean;
165
+ }
166
+ /** Applies theme settings to a surface root (`host.root`). Safe to call again. */
167
+ export declare function applyTheme(root: HTMLElement, theme: SurfaceTheme): void;
168
+ export declare function maskDateText(text: string, pattern: FormatPattern): string;
169
+ /**
170
+ * Length of the date at the start of `text`, in characters of `text` as
171
+ * given: the index just after the last digit group `pattern` expects, or the
172
+ * separator before the next group. A separator after the last group is not
173
+ * part of the date. Bidi marks, locale digits and characters the mask skips
174
+ * count as written. Returns 0 when `text` holds no digit.
175
+ */
176
+ export declare function leadingDateLength(text: string, pattern: FormatPattern): number;
177
+ /**
178
+ * Whether `text` starts with a whole date: every group `pattern` expects is
179
+ * there and the last one has all its digits. A separator closes an earlier
180
+ * group, so `1.5.2026` is complete. Text after the date is ignored.
181
+ */
182
+ export declare function isDateTextComplete(text: string, pattern: FormatPattern): boolean;
183
+ /** Maps Arabic-Indic and Persian digits to Latin digits, drops bidi marks and trims. */
184
+ export declare function normalizeDigits(text: string): string;
185
+ export declare function parseDate(text: string, pattern: FormatPattern): PlainDate | null;
186
+ export declare const RANGE_SEPARATOR = " – ";
187
+ /**
188
+ * Splits range text into its start and end text the way the picker does:
189
+ * at an en or em dash with optional spaces, or at a hyphen with spaces
190
+ * around it. Returns `null` unless the text splits into exactly two parts.
191
+ */
192
+ export declare function splitRangeText(text: string): readonly [string, string] | null;
193
+ export { type DatePart, type FormatOption, type FormatPattern, type FullDateOptions, type HintLetters, type PagerOptions, type PlainDate, type Scheme, type SurfaceHost, type SurfaceMode, type SurfaceTheme, type ThemeName, type WeekStartOption, type Weekday, type YearMonth, formatDate, formatFullDate, formatHint, formatMonthYear, resolvePattern, resolveWeekStart, weekdayNames };
@@ -0,0 +1 @@
1
+ const e=/^(\d{4})-(\d{2})-(\d{2})$/;function t(e){return e%4==0&&e%100!=0||e%400==0}function n(e,n){return n===2?t(e)?29:28:n===4||n===6||n===9||n===11?30:31}function r(e,t,n){let r=t<=2?e-1:e,i=Math.floor(r/400),a=r-i*400,o=t>2?t-3:t+9,s=Math.floor((153*o+2)/5)+n-1,c=a*365+Math.floor(a/4)-Math.floor(a/100)+s;return i*146097+c-719468}function i(e){let t=e+719468,n=Math.floor(t/146097),r=t-n*146097,i=Math.floor((r-Math.floor(r/1460)+Math.floor(r/36524)-Math.floor(r/146096))/365),a=r-(365*i+Math.floor(i/4)-Math.floor(i/100)),o=Math.floor((5*a+2)/153),s=a-Math.floor((153*o+2)/5)+1,c=o<10?o+3:o-9;return{year:i+n*400+ +(c<=2),month:c,day:s}}function a(e){switch((e%7+7)%7){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;case 4:return 4;case 5:return 5;default:return 6}}function o(e,t,r){return!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||e<1||e>9999||t<1||t>12?!1:r>=1&&r<=n(e,t)}function s(e,t,n){return o(e,t,n)?{year:e,month:t,day:n}:null}function c(e){return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}}function l(e){let t=new Date(2e3,0,1);return t.setFullYear(e.year,e.month-1,e.day),t.setHours(0,0,0,0),t}function u(t){let n=e.exec(t);return n?s(Number(n[1]),Number(n[2]),Number(n[3])):null}function d(e){return`${String(e.year).padStart(4,`0`)}-${String(e.month).padStart(2,`0`)}-${String(e.day).padStart(2,`0`)}`}function f(e,t){return e.year===t.year?e.month===t.month?e.day-t.day:e.month-t.month:e.year-t.year}function p(e,t){return e===null||t===null?!1:f(e,t)===0}function m(e,t){return i(r(e.year,e.month,e.day)+t)}function h(e,t){return r(t.year,t.month,t.day)-r(e.year,e.month,e.day)}function g(e,t){let n=e.year*12+(e.month-1)+t,r=Math.floor(n/12);return{year:r,month:n-r*12+1}}function _(e,t){return t.year*12+t.month-(e.year*12+e.month)}function v(e){return n(e.year,e.month)}function y(e){return a(r(e.year,e.month,e.day)+4)}function b(){return c(/* @__PURE__ */ new Date)}function x(e){return e===`today`?b():typeof e==`string`?u(e):Number.isNaN(e.getTime())?null:c(e)}function S(e){let t=r(e.year,e.month,e.day),n=(y(e)+6)%7+1,a=t+4-n,o=i(a).year,s=r(o,1,1);return Math.floor((a-s)/7)+1}const ee={headline:!0,navigation:`menus`,announceSelection:!0},C=e=>{let t=e.mode===`range`&&e.presets>0;if(e.layout!==`docked`||e.precision!==`day`)return{months:1,presets:t?`row`:`none`};let n=336+(e.weekNumbers&&e.mode!==`range`?48:0),r=(e,t)=>e*n+(e-1)*24+24+(t?168:0)+32,i=t&&r(1,!0)<=e.width,a=1;for(let t=2;t<=e.months;t+=1)r(t,i)<=e.width&&(a=t);let o=`none`;return i?o=`column`:t&&(o=`row`),{months:a,presets:o}},w=(e,t,n)=>{if(n!==`day`)return!1;switch(e){case`single`:return t!==`docked`;case`range`:return!0;case`multiple`:return!1}},te=e=>{switch(e){case`day`:return`days`;case`month`:return`month-grid`;case`year`:return`year-grid`}},ne=(e,t)=>{let n=t===`docked`;switch(e){case`day`:return`days`;case`month`:return n?`month-menu`:`month-grid`;case`year`:return n?`year-menu`:`year-grid`}},re=(e,t,n,r)=>t?`inline`:e===`auto`?n<600||r<480?`modal`:`docked`:e,T=(e,t,n,r)=>e===`range`&&t===`modal`&&n<r,ie=(e,t,n)=>{let{mode:r,layout:i}=t;return i===`docked`?`docked`:i===`fullscreen`?r===`range`&&e!==`docked`?`fullscreen`:`modal`:e===`modal`?T(r,e,n,t.fullscreenBelow)?`fullscreen`:`modal`:i===`modal`?`modal`:`docked`},ae=(e,t)=>e===`inline`?t:ee,oe=(e,t)=>e??t!==`inline`;function se(e){let t=[...e].sort(f);return t.filter((e,n)=>n===0||f(t[n-1],e)!==0)}function ce(e){switch(e){case`single`:return{mode:e,date:null};case`range`:return{mode:e,start:null,end:null};default:return{mode:e,dates:[]}}}function E(e){switch(e.mode){case`single`:return e.date?[e.date]:[];case`range`:return[e.start,e.end].filter(e=>e!==null);default:return e.dates}}function le(e){return E(e).length===0}function ue(e){return e.mode!==`range`||e.start===null==(e.end===null)}function de(e,t){return e===null||t===null?e===t:f(e,t)===0}function fe(e,t){if(e.mode!==t.mode)return!1;let n=E(e),r=E(t);return n.length===r.length?e.mode===`range`&&t.mode===`range`?de(e.start,t.start)&&de(e.end,t.end):n.every((e,t)=>f(e,r[t])===0):!1}function pe(e,t){return E(e).some(e=>p(e,t))}function me(e,t){return e.mode!==`range`||e.start===null||e.end===null||f(e.start,e.end)>=0?null:p(e.start,t)?`start`:p(e.end,t)?`end`:f(t,e.start)>0&&f(t,e.end)<0?`in-range`:null}function he(e,t){return e.mode===`range`&&e.start!==null&&e.end===null&&p(e.start,t)?`start`:me(e,t)}function ge(e){return E(e).at(0)??null}const _e=/* @__PURE__ */ new Set([`/`,`.`,`-`,` `]),ve=/[‎‏؜]/g,ye=/^(d{1,2}|M{1,2}|yyyy|yy)([/. -])(d{1,2}|M{1,2}|yyyy|yy)\2(d{1,2}|M{1,2}|yyyy|yy)$/,be=/^(M{1,2}|yyyy|yy)([/. -])(M{1,2}|yyyy|yy)$/,xe=/* @__PURE__ */ new Map;function Se(e){return e.startsWith(`d`)?`day`:e.startsWith(`M`)?`month`:`year`}function Ce(e){let t=ye.exec(e);if(!t)return null;let n=[t[1],t[3],t[4]],r=n.map(Se);return new Set(r).size===3?{order:r,separator:t.at(2)??`/`,padDay:n.includes(`dd`),padMonth:n.includes(`MM`),yearDigits:n.includes(`yy`)?2:4}:null}function we(e){let t=be.exec(e);if(!t)return null;let n=[t[1],t[3]],[r,i]=n.map(Se);return r===i?null:{order:r===`month`?[`day`,`month`,`year`]:[`year`,`month`,`day`],separator:t.at(2)??`/`,padDay:!0,padMonth:n.includes(`MM`),yearDigits:n.includes(`yy`)?2:4}}function Te(e){return e!==`yyyy`&&e!==`yy`?null:{order:[`month`,`day`,`year`],separator:`/`,padDay:!0,padMonth:!0,yearDigits:e===`yy`?2:4}}function Ee(e,t){let n=Ce(e);if(n!==null||t===`day`)return n;let r=we(e);return r!==null||t===`month`?r:Te(e)}function De(e,t=`day`){return e===`auto`||Ee(e.trim(),t)!==null}function Oe(e){let t={day:`2-digit`,month:`2-digit`,year:`numeric`,numberingSystem:`latn`,timeZone:`UTC`};try{return new Intl.DateTimeFormat(e,t)}catch{return new Intl.DateTimeFormat(`en-US`,t)}}function ke(e){let t=Oe(e).formatToParts(new Date(Date.UTC(2024,10,22,12))),n=[],r=``;for(let e of t)e.type===`day`||e.type===`month`||e.type===`year`?n.push(e.type):e.type===`literal`&&r===``&&(r=e.value.replace(ve,``).trim());return{order:n.length===3?n:[`month`,`day`,`year`],separator:_e.has(r)?r:`/`,padDay:!0,padMonth:!0,yearDigits:4}}function Ae(e,t,n=`day`){let r=`${e}|${t}|${n}`,i=xe.get(r);if(i)return i;let a=(e===`auto`?null:Ee(e.trim(),n))??ke(t);return xe.set(r,a),a}function je(e,t,n){switch(t){case`day`:return n.padDay?String(e.day).padStart(2,`0`):String(e.day);case`month`:return n.padMonth?String(e.month).padStart(2,`0`):String(e.month);default:return n.yearDigits===2?String(e.year%100).padStart(2,`0`):String(e.year).padStart(4,`0`)}}const Me={day:`dd`,month:`mm`,year:`yyyy`};function Ne(e){return{day:e.hintDay,month:e.hintMonth,year:e.hintYear}}function Pe(e,t=Me){return e.order.map(n=>n===`day`?t.day:n===`month`?t.month:e.yearDigits===2?t.year.slice(0,2):t.year).join(e.separator)}function D(e,t){return t.order.map(n=>je(e,n,t)).join(t.separator)}function O(){return typeof document<`u`}function k(){return typeof window>`u`}const Fe=new Set(`AG AS BD BR BS BT BW BZ CA CO DM DO ET GT GU HK HN ID IL IN IS JM JP KE KH KR LA MH MM MO MT MX MZ NI NP PA PE PH PK PR PT PY SA SG SV TH TT TW UM US VE VI WS YE ZA ZW`.split(` `)),Ie=new Set(`AF BH DJ DZ EG IQ IR JO KW LY OM QA SD SY`.split(` `)),Le=/* @__PURE__ */ new Set([`MV`]),Re=/* @__PURE__ */ new Map,ze=/* @__PURE__ */ new Map;function Be(e,t){let n=ze.get(t);if(n)return n.format(e);let r=new Intl.NumberFormat(t,{useGrouping:!1});return ze.set(t,r),r.format(e)}function A(e,t){let n=`${e}|${JSON.stringify(t)}`,r=Re.get(n);if(r)return r;let i=new Intl.DateTimeFormat(e,{...t,timeZone:`UTC`});return Re.set(n,i),i}function j(e,t,n){let r=new Date(Date.UTC(2e3,0,1,12));return r.setUTCFullYear(e,t-1,n),r}function Ve(e){switch(e){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;case 4:return 4;case 5:return 5;case 6:return 6;default:return null}}function He(e){if(!(`getWeekInfo`in e))return null;let t=Reflect.get(e,`getWeekInfo`);if(typeof t!=`function`)return null;let n=Reflect.apply(t,e,[]);if(typeof n!=`object`||!n||!(`firstDay`in n))return null;let r=n.firstDay;return typeof r==`number`?Ve(r===7?0:r):null}function Ue(e){return e===void 0?1:Fe.has(e)?0:Ie.has(e)?6:Le.has(e)?5:1}function We(e){try{let t=new Intl.Locale(e),n=He(t);return n===null?Ue(t.maximize().region):n}catch{return 1}}function Ge(e){try{return Intl.getCanonicalLocales(e).length>0}catch{return!1}}const M=e=>{let t=e?.trim();return!t||!Ge(t)?null:t};function Ke(e){let t=M(e);if(t!==null)return t;if(O()){let e=M(document.documentElement.lang);if(e!==null)return e}if(typeof navigator<`u`){let e=M(navigator.language);if(e!==null)return e}return`en-US`}function qe(e,t){let n=A(e,{month:t});return Array.from({length:12},(e,t)=>n.format(j(2024,t+1,1)))}function Je(e,t){let n=A(e,{weekday:t});return Array.from({length:7},(e,t)=>n.format(j(2024,1,7+t)))}function Ye(e,t){return A(t,{weekday:`short`,month:`short`,day:`numeric`}).format(j(e.year,e.month,e.day))}function Xe(e,t){return A(t,{month:`short`,day:`numeric`}).format(j(e.year,e.month,e.day))}function Ze(e,t,n){return A(n,{month:`short`,day:`numeric`}).formatRange(j(e.year,e.month,e.day),j(t.year,t.month,t.day))}function Qe(e,t,n={}){let r={weekday:`long`,month:`long`,day:`numeric`};return A(t,n.year===!1?r:{...r,year:`numeric`}).format(j(e.year,e.month,e.day))}function N(e,t){return A(t,{month:`long`,year:`numeric`}).format(j(e.year,e.month,1))}function $e(e,t,n){return e.year===t.year&&e.month===t.month?N(e,n):A(n,{month:`long`,year:`numeric`}).formatRange(j(e.year,e.month,1),j(t.year,t.month,1))}function et(e,t,n,r){switch(t){case`day`:return r===`headline`?Ye(e,n):Qe(e,n);case`month`:return N(e,n);default:return Be(e.year,n)}}function tt(e,t){switch(t){case`sunday`:return 0;case`monday`:return 1;case`saturday`:return 6;default:return We(e)}}const nt=/[٠-٩۰-۹]/g,rt=/[‎‏؜]/g,it=/^[‎‏؜]$/,at=/[\s./-]+/,ot=/^\d+$/,st=/^\d{8}$/;function ct(e){let t=e.charCodeAt(0);return String(t-(t>=1776?1776:1632))}function lt(e){return e.replace(nt,ct)}function P(e){return e.replace(rt,``).replace(nt,ct).trim()}function ut(e,t){if(st.test(e)){let n=[],r=0;for(let i of t){let t=i===`year`?4:2;n.push(e.slice(r,r+t)),r+=t}return n}let n=e.split(at).filter(e=>e!==``);return n.length!==3||!n.every(e=>ot.test(e))?null:n}function dt(e){let t=P(e).split(at).filter(e=>e!==``);return t.every(e=>ot.test(e))?t:null}function ft(e){if(e.length===4)return Number(e);if(e.length!==2)return null;let t=2e3+Number(e);return t<=b().year+20?t:1900+Number(e)}function pt(e,t){let n=ut(P(e),t.order);if(n===null)return null;let r=0,i=0,a=0;for(let[e,o]of t.order.entries()){let t=n[e]??``;if(o===`year`)a=ft(t);else if(t.length>2)return null;else o===`day`?r=Number(t):i=Number(t)}return a===null?null:s(a,i,r)}const mt=/^(\d{4})-(\d{2})$/,ht=/^\d{4}$/;function gt(e,t){switch(t){case`day`:return e;case`month`:return{year:e.year,month:e.month,day:1};default:return{year:e.year,month:1,day:1}}}function F(e,t){let n=d(e);switch(t){case`day`:return n;case`month`:return n.slice(0,7);default:return n.slice(0,4)}}function _t(e,t){let n=u(e);if(n!==null||t===`day`)return n===null?null:gt(n,t);if(t===`month`){let t=mt.exec(e);return t?s(Number(t[1]),Number(t[2]),1):null}return ht.test(e)?s(Number(e),1,1):null}function I(e,t){return{...e,order:e.order.filter(e=>e===`year`||t===`month`&&e===`month`)}}function vt(e,t,n){return n===`day`?D(e,t):D(e,I(t,n))}function yt(e,t,n){return Pe(t===`day`?e:I(e,t),n)}function bt(e,t,n){if(n===`day`)return pt(e,t);let{order:r}=I(t,n),i=dt(e);if(i?.length!==r.length)return null;let a=1,o=null;for(let[e,t]of r.entries()){let n=i[e]??``;if(t===`year`)o=ft(n);else if(n.length>2)return null;else a=Number(n)}return o===null?null:s(o,a,1)}function xt(e,t){return e===null?null:typeof e==`string`?O()?t?.querySelector(e)??document.querySelector(e):null:e}function L(e,t,n){let r=document.createElement(e);return t&&(r.className=t),n&&Object.entries(n).forEach(([e,t])=>{r.setAttribute(e,t)}),r}function St(e,t,n){let r=e.getBoundingClientRect(),i=t.getBoundingClientRect();n===`center`?e.scrollTop+=i.top-r.top-(r.height-i.height)/2:i.top<r.top?e.scrollTop+=i.top-r.top:i.bottom>r.bottom&&(e.scrollTop+=i.bottom-r.bottom)}function Ct(e,t,n){let r=L(`button`,e,{type:`button`});return n?(r.setAttribute(`aria-label`,t),r.innerHTML=n):r.textContent=t,r}const wt=`dp-ui--pointer`,Tt=[`Shift`,`Control`,`Alt`,`Meta`];function Et(){return k()||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Dt(e){return e?Et()?`reduced`:`full`:`none`}function Ot(e,t){e.textContent=``,e.textContent=t}function kt(e){let t=e.ownerDocument,n=()=>{e.classList.add(wt)},r=t=>{Tt.includes(t.key)||e.classList.remove(wt)};return e.addEventListener(`pointerdown`,n,!0),t.addEventListener(`keydown`,r,!0),()=>{e.removeEventListener(`pointerdown`,n,!0),t.removeEventListener(`keydown`,r,!0)}}const At=`(prefers-color-scheme: dark)`,jt=/^(rgba?|color|oklch|oklab|lab|lch)\(([^)]*)\)$/,Mt=/[\s,/]+/,Nt=[`class`,`style`,`data-theme`,`data-color-scheme`],R=e=>Math.min(1,Math.max(0,e)),z=e=>{let t=R(e);return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},Pt=(e,t,n)=>.2126*z(e)+.7152*z(t)+.0722*z(n),B=(e,t)=>{if(e===`none`)return 0;let n=parseFloat(e);return e.endsWith(`%`)?n/100*t:n},Ft=(e,t)=>{let n=+(e===`color`);if(e===`color`&&t[0]!==`srgb`)return null;let r=B(t[n]??``,e===`lab`||e===`lch`?100:1);switch(e){case`rgb`:case`rgba`:case`color`:{let r=e===`color`?1:255,[i=NaN,a=NaN,o=NaN]=[0,1,2].map(e=>B(t[n+e]??``,r)/r);return Pt(i,a,o)}case`oklab`:case`oklch`:return R(r)**3;default:return R((r+16)/116)**3}};function It(e){let t=e.trim().toLowerCase();if(t===`transparent`)return{luminance:0,alpha:0};let n=jt.exec(t),r=n?.[1],i=n?.[2];if(r===void 0||i===void 0)return null;let a=i.split(Mt).filter(e=>e!==``),o=r===`color`?4:3,s=a.length>o?B(a[o],1):1,c=Ft(r,a);return c===null||Number.isNaN(c)||Number.isNaN(s)?null:{luminance:c,alpha:R(s)}}const Lt=()=>{let e=getComputedStyle(document.documentElement).getPropertyValue(`color-scheme`);return e.includes(`dark`)?e.includes(`light`)?window.matchMedia(At).matches?`dark`:`light`:`dark`:`light`};function Rt(e){if(k()||!O())return`light`;let t=e;for(;t!==null;){let e=It(getComputedStyle(t).backgroundColor);if(e!==null&&e.alpha>=.5)return e.luminance<.179?`dark`:`light`;t=t.parentElement}return Lt()}function zt(e){if(k()||!O())return()=>void 0;let t=()=>{e()},n=new MutationObserver(t),r={attributes:!0,attributeFilter:Nt};n.observe(document.documentElement,r),n.observe(document.body,r);let i=window.matchMedia(At);return i.addEventListener(`change`,t),()=>{n.disconnect(),i.removeEventListener(`change`,t)}}const V={PAGER_SETTLE:350,DOCKED_HEIGHT:300,SELECT_FILL:150,HEADLINE_FADE:50,RIPPLE:450,SURFACE_ENTER:300,SURFACE_ENTER_FADE:100,SURFACE_ACTIONS_DELAY:150,SURFACE_EXIT:150,SCRIM_ENTER:150,SCRIM_EXIT:200,PANEL_FADE_OUT:100,PANEL_FADE_IN:200,WHEEL_SETTLE:90,VIEW_SWITCH:300,VIEW_SWITCH_FADE_OUT:75,VIEW_SWITCH_FADE_IN:150,REDUCED_FADE:150,SNAP_SCROLL_FALLBACK:700},H={DRAG_START_PX:6,COMMIT_FRACTION:.25,FLICK_VELOCITY:.4,VELOCITY_SAMPLES:5,MIN_SAMPLE_SPAN_MS:1},Bt={EMPHASIZED:`cubic-bezier(0.2, 0, 0, 1)`,EMPHASIZED_DECELERATE:`cubic-bezier(0.05, 0.7, 0.1, 1)`,EMPHASIZED_ACCELERATE:`cubic-bezier(0.3, 0, 0.8, 0.15)`},Vt=` – `,Ht=/\s*[–—]\s*|\s+-\s+/,Ut=/[,;]/;function Wt(e){let t=e.split(Ht);if(t.length!==2)return null;let[n,r]=t;return[n,r]}function Gt(e,t,n){return E(e).map(e=>vt(e,t,n)).join(e.mode===`range`?Vt:`, `)}function Kt(e,t){let n=[];for(let r of e){let e=t(r);if(e===null)return null;n.push(e)}return n}function qt(e){if(e?.length!==2)return null;let[t,n]=e;return f(t,n)>0?null:{mode:`range`,start:t,end:n}}function Jt(e,t,n,r,i){switch(t){case`single`:{let r=n(e);return r===null?null:{mode:t,date:r}}case`range`:{let t=r(e);return t===null?null:qt(Kt(t,n))}default:{let r=Kt(e.split(i).filter(e=>e.trim()!==``),n);return r===null?null:{mode:t,dates:se(r)}}}}function Yt(e,t,n,r){let i=e.trim();return i===``?ce(t):Jt(i,t,e=>bt(e.trim(),n,r),Wt,Ut)}function Xt(e,t){return e.mode===`range`?e.start===null||e.end===null?``:`${F(e.start,t)}/${F(e.end,t)}`:E(e).map(e=>F(e,t)).join(`,`)}function Zt(e,t,n){let r=e.trim();return r===``?ce(t):Jt(r,t,e=>_t(e.trim(),n),e=>e.split(`/`),/,/)}function Qt(e,t){let n=Math.max(e.getBoundingClientRect().height,e.scrollHeight),{top:r,bottom:i}=t.getBoundingClientRect(),a=window.innerHeight-i-8,o=r-8;return n<=Math.max(a,o)}const U={calendar:`<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M200-80q-33 0-56.5-23.5T120-160v-560q0-33 23.5-56.5T200-800h40v-80h80v80h320v-80h80v80h40q33 0 56.5 23.5T840-720v560q0 33-23.5 56.5T760-80H200Zm0-80h560v-400H200v400Zm0-480h560v-80H200v80Zm0 0v-80 80Z"/></svg>`,pencil:`<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z"/></svg>`,arrowDropDown:`<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M480-360 280-560h400L480-360Z"/></svg>`,keyboardArrowLeft:`<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"/></svg>`,keyboardArrowRight:`<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"/></svg>`,close:`<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e3e3e3"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg>`,check:`<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"/></svg>`},$t=e=>{let t=t=>`${e.shiftKey}+${t}`;return{previousMonth:{keys:`PageUp`,display:e.pageUpKey},nextMonth:{keys:`PageDown`,display:e.pageDownKey},previousYear:{keys:`Shift+PageUp`,display:t(e.pageUpKey)},nextYear:{keys:`Shift+PageDown`,display:t(e.pageDownKey)},chooseMonth:{keys:`Shift+M`,display:t(`M`)},chooseYear:{keys:`Shift+Y`,display:t(`Y`)}}},en=(e,t)=>`dp-ui-${e.replace(/[^\w-]/g,`-`)}-${t}`,tn=(e,t,n)=>{n!==void 0&&(e.setAttribute(`title`,`${t} (${n.display})`),e.setAttribute(`aria-keyshortcuts`,n.keys))},nn=(e,t)=>{let n=L(`span`);n.innerHTML=e;let r=n.firstElementChild;return r===null?null:(r.setAttribute(`class`,t),r.setAttribute(`aria-hidden`,`true`),r)},rn=(e,t,n,r)=>{let i=Ct(`dp-ui__icon-button dp-ui__icon-button--${e}`,t,n);return i.firstElementChild?.setAttribute(`aria-hidden`,`true`),tn(i,t,r),i},an=(e,t,n)=>{let r=L(`button`,`dp-ui__menu-button dp-ui__menu-button--${e}`,{type:`button`,"aria-haspopup":`listbox`,"aria-expanded":`false`,"aria-controls":n.controls});tn(r,n.name,n.shortcut);let i=L(`span`,`dp-ui__menu-button-label`);r.append(i);let a=nn(U.arrowDropDown,`dp-ui__menu-button-icon`);a!==null&&r.append(a);let o=(e,t=e)=>{i.textContent=e,r.setAttribute(`aria-label`,`${n.name}, ${t}`)};return o(t),{button:r,label:i,setText:o}},on=(e,t)=>Ct(`dp-ui__text-button dp-ui__text-button--${e}`,t),sn=(e,t)=>{let n=rn(`switch-view`,e.switchToInput,U.pencil);return{button:n,setInputView:r=>{n.innerHTML=r?U.calendar:U.pencil,n.firstElementChild?.setAttribute(`aria-hidden`,`true`),r?n.setAttribute(`aria-controls`,t):n.removeAttribute(`aria-controls`),n.setAttribute(`aria-label`,r?e.switchToCalendar:e.switchToInput)}}},cn=/^\d$/,ln=/* @__PURE__ */ new Set([`/`,`.`,`-`,` `]);function un(e,t){return e===`year`?t.yearDigits:2}function W(e,t){let{order:n}=t,r=n.map(e=>un(e,t)),i=[``],a=0;for(let t=0;t<e.length;t++){let o=e.charAt(t);if(it.test(o))continue;let s=lt(o),c=i.length-1,l=r[c]??0,u=i[c]??``,d=i.length===n.length;if(cn.test(s)){if(u.length>=l){if(d)break;i.push(s)}else i[c]=u+s;a=t+1}else if(ln.has(s)){if(u===``)continue;if(d)break;i[c]=u.padStart(l,`0`),i.push(``),a=t+1}}return{groups:i,end:a}}function dn(e,t){return W(e,t).groups.filter(e=>e!==``).join(t.separator)}function fn(e,t){return W(e,t).end}function pn(e,t){let{groups:n}=W(e,t),r=t.order.at(-1),i=n.at(-1);return r===void 0||i===void 0||n.length!==t.order.length?!1:i.length===un(r,t)}function mn(e,t){let n=dn(e.value,t);n!==e.value&&(e.value=n,e.setSelectionRange(n.length,n.length))}const G=`dp-ui__pager--dragging`,hn=e=>e instanceof Element&&e.closest(`button`)!==null,gn=(e,t)=>{e.push(t),e.length>H.VELOCITY_SAMPLES&&e.shift()},_n=e=>{let t=e.at(0),n=e.at(-1);return!t||!n?0:(n.x-t.x)/Math.max(H.MIN_SAMPLE_SPAN_MS,n.t-t.t)},vn=(e,t)=>{try{e.setPointerCapture(t)}catch{return}},yn=(e,t)=>{e.hasPointerCapture(t)&&e.releasePointerCapture(t)},bn=(e,t,n)=>{let r=null,i=null,a=t=>{t.controller.abort(),r===t&&(r=null),t.dragging&&(e.classList.remove(G),yn(e,t.pointerId))},o=()=>{i?.abort();let t=new AbortController;i=t,e.addEventListener(`click`,e=>{e.preventDefault(),e.stopPropagation(),t.abort()},{capture:!0,signal:t.signal}),requestAnimationFrame(()=>{t.abort()})},s=t=>{n.onBegin(),t.dragging=!0,t.width=n.pageWidth(),vn(e,t.pointerId),e.classList.add(G)},c=(e,t)=>{if(t.pointerId!==e.pointerId)return;let r=t.clientX-e.startX;if(!e.dragging){if(Math.abs(r)<=H.DRAG_START_PX)return;s(e)}e.lastX=t.clientX,gn(e.samples,{x:t.clientX,t:t.timeStamp}),n.onMove(r,e.width)},l=(e,t,r)=>{t.pointerId===e.pointerId&&(a(e),e.dragging&&(r?n.onAbort():(o(),gn(e.samples,{x:e.lastX,t:t.timeStamp}),n.onRelease({dx:e.lastX-e.startX,velocity:_n(e.samples),width:e.width}))))};e.addEventListener(`pointerdown`,t=>{if(t.button!==0||!t.isPrimary||hn(t.target))return;let i=r;i&&(a(i),i.dragging&&n.onAbort());let o=new AbortController,s={pointerId:t.pointerId,startX:t.clientX,samples:[{x:t.clientX,t:t.timeStamp}],controller:o,lastX:t.clientX,width:0,dragging:!1};r=s;let u=e.ownerDocument,d={signal:o.signal};u.addEventListener(`pointermove`,e=>{c(s,e)},d),u.addEventListener(`pointerup`,e=>{l(s,e,!1)},d),u.addEventListener(`pointercancel`,e=>{l(s,e,!0)},d)},{signal:t});let u=()=>{r&&a(r)};return{isDragging:()=>r?.dragging===!0,cancel:u,dispose:()=>{u(),i?.abort(),i=null}}},xn=(e,t)=>e.year===t.year&&e.month===t.month,Sn=(e,t,n,r)=>{let i=null,a=e=>{let n=t(e);return n.classList.add(`dp-ui__page`),{key:e,element:n}},o=e=>{i?.forEach((t,n)=>{t.element.toggleAttribute(`inert`,n!==e)})},s=(e,t,n)=>{let i=e[t];if(r(i.key,n))return e;let o=a(n);return i.element.replaceWith(o.element),t===0?[o,e[1],e[2]]:[e[0],e[1],o]};return{show:t=>{let r=[a(n(t,-1)),a(t),a(n(t,1))];e.replaceChildren(...r.map(e=>e.element)),i=r,o(1)},centerKey:()=>i?.[1].key??null,reveal:(e,t)=>{i&&(i=s(i,e,t),o(e))},recenter:e=>{if(!i)return;let t=i[e],r=a(n(t.key,-1)),s=a(n(t.key,1));i.forEach((t,n)=>{n!==e&&t.element.remove()}),t.element.before(r.element),t.element.after(s.element),i=[r,t,s],o(1)},clear:()=>{i=null}}},Cn=(e,t,n)=>{if(t<-H.FLICK_VELOCITY)return 1;if(t>H.FLICK_VELOCITY)return-1;let r=n*H.COMMIT_FRACTION;return e<-r?1:e>r?-1:0},wn=(e,t,n,r)=>{let i=Cn(e,t,n);return!r||i===0?i:i===1?-1:1},Tn=(e,t)=>{let n=null,r=null,i=()=>typeof e.animate==`function`,a=()=>{let e=r;r=null,e?.cancel()},o=()=>{a();let e=n;e&&(n=null,e.complete(),e.animation.cancel())},s=()=>{a();let e=n;n=null,e?.animation.cancel()},c=()=>{let t=e.animate([{opacity:0},{opacity:1}],{duration:V.REDUCED_FADE,easing:`linear`});r=t;let n=()=>{r===t&&(r=null)};t.finished.then(n,n)};return{run:(r,s,l)=>{a();let u=Dt(t);if(r===s||u===`none`||!i()){l();return}if(u===`reduced`){l(),c();return}let d=e.animate([{transform:r},{transform:s}],{duration:V.PAGER_SETTLE,easing:Bt.EMPHASIZED,fill:`forwards`}),f={animation:d,complete:l};n=f,d.finished.then(()=>{n===f&&o()},()=>void 0)},finish:o,cancel:s}},En=(e,t)=>Math.min(t,Math.max(-t,e)),Dn=(e,t)=>e.deltaMode===0?e.deltaX:Math.sign(e.deltaX)*t,On=(e,t,n)=>{let r=null,i=0,a=()=>{r=null;let e=i;i=0,n.onSettle(e,n.pageWidth())};return e.addEventListener(`wheel`,e=>{if(Math.abs(e.deltaX)<=Math.abs(e.deltaY)||n.isBlocked())return;e.preventDefault();let t=n.pageWidth();r===null?n.onBegin():clearTimeout(r),i-=Dn(e,t),n.onMove(En(i,t),t),r=setTimeout(a,V.WHEEL_SETTLE)},{passive:!1,signal:t}),{cancel:()=>{r!==null&&clearTimeout(r),r=null,i=0}}},kn=`dp-ui__pager--swipe`,An=`--dp-ui-pager-height`;var jn=class{viewport;options;track;controller=new AbortController;previousTouchAction;strip;animator;drag=null;wheel=null;resizeObserver=null;observedWidth=-1;offset=0;revision=0;constructor(e,t){this.viewport=e,this.options=t,this.previousTouchAction=e.style.touchAction,this.track=L(`div`,`dp-ui__pager-track`),this.strip=Sn(this.track,e=>t.renderPage(e),(e,n)=>t.step(e,n),(e,n)=>t.isSame(e,n)),this.animator=Tn(this.track,t.animate),e.classList.add(`dp-ui__pager`),e.append(this.track),t.swipe&&this.enableSwipe(),this.observeWidth()}show(e){this.destroyed||(this.revision+=1,this.animator.cancel(),this.cancelGestures(),this.strip.show(e),this.rest(),this.fitHeight(e))}slide(e,t){if(this.destroyed)return;this.finish(),this.cancelGestures();let n=this.strip.centerKey();if(n===null){this.show(e);return}if(this.revision+=1,this.options.isSame(n,e)){this.settle();return}let r=t===1?2:0;this.strip.reveal(r,e),this.fitHeight(e);let i=this.pageWidth(),a=this.transformFor(1,this.offset,i);this.offset=0,this.animator.run(a,this.transformFor(r,0,i),()=>{this.strip.recenter(r),this.rest()})}finish(){this.animator.finish()}destroy(){this.destroyed||(this.controller.abort(),this.resizeObserver?.disconnect(),this.resizeObserver=null,this.cancelGestures(),this.drag?.dispose(),this.animator.cancel(),this.track.remove(),this.strip.clear(),this.viewport.style.removeProperty(An),this.viewport.classList.remove(kn,G),this.options.swipe&&(this.viewport.style.touchAction=this.previousTouchAction))}get destroyed(){return this.controller.signal.aborted}enableSwipe(){let{signal:e}=this.controller;this.viewport.style.touchAction=`pan-y`,this.viewport.classList.add(kn),this.drag=bn(this.viewport,e,{pageWidth:()=>this.pageWidth(),onBegin:()=>{this.finish(),this.wheel?.cancel()},onMove:(e,t)=>{this.setOffset(e,t)},onRelease:({dx:e,velocity:t,width:n})=>{this.release(wn(e,t,n,this.options.rtl),`drag`)},onAbort:()=>{this.settle()}}),this.wheel=On(this.viewport,e,{pageWidth:()=>this.pageWidth(),isBlocked:()=>this.drag?.isDragging()===!0,onBegin:()=>{this.finish()},onMove:(e,t)=>{this.setOffset(e,t)},onSettle:(e,t)=>{this.release(wn(e,0,t,this.options.rtl),`wheel`)}})}observeWidth(){this.options.fitHeight===!0&&typeof ResizeObserver<`u`&&(this.resizeObserver=new ResizeObserver(e=>{let t=e.at(-1);if(t===void 0||this.destroyed)return;let n=t.contentRect.width;if(n===this.observedWidth)return;this.observedWidth=n;let r=this.strip.centerKey();r!==null&&this.fitHeight(r)}),this.resizeObserver.observe(this.viewport))}cancelGestures(){this.drag?.cancel(),this.wheel?.cancel()}release(e,t){if(e===0){this.settle();return}let n=this.revision;this.options.onCommit(e,t),this.revision===n&&!this.destroyed&&this.settle()}settle(){this.finish();let e=this.pageWidth(),t=this.transformFor(1,this.offset,e);this.offset=0,this.animator.run(t,this.transformFor(1,0,e),()=>{this.rest()})}fitHeight(e){if(this.options.fitHeight!==!0||this.viewport.hidden)return;let t=this.options.pageHeight?.(e);t!==void 0&&this.viewport.style.setProperty(An,`${String(t)}px`)}rest(){this.offset=0,this.track.style.removeProperty(`transform`),this.viewport.scrollLeft!==0&&(this.viewport.scrollLeft=0)}setOffset(e,t){this.offset=e,this.track.style.transform=this.transformFor(1,e,t)}transformFor(e,t,n){let r=this.options.rtl?1:-1;return`translateX(${String(r*e*n+t)}px)`}pageWidth(){let e=this.viewport.clientWidth;return e>0?e:360}};const K=`--dp-ui-scrollbar-gap`,Mn=[`auto`,`scroll`];let q=0,J=[],Y=``;const Nn=e=>Mn.includes(window.getComputedStyle(e).overflowY);function Pn(e){let{style:t}=e,n=e.clientWidth,r=parseFloat(window.getComputedStyle(e).paddingRight)||0;J.push({element:e,overflow:t.overflow,paddingRight:t.paddingRight}),t.overflow=`hidden`;let i=Math.max(0,e.clientWidth-n);return i>0&&(t.paddingRight=`${String(r+i)}px`),i}function Fn(){if(q===0){let{body:e,documentElement:t}=document,n=Nn(e)?Pn(e):0,r=Pn(t);Y=t.style.getPropertyValue(K),t.style.setProperty(K,`${String(Math.max(n,r))}px`)}q+=1}function In(){if(q===0||(--q,q>0))return;J.forEach(({element:e,overflow:t,paddingRight:n})=>{e.style.overflow=t,e.style.paddingRight=n});let e=document.documentElement;Y?e.style.setProperty(K,Y):e.style.removeProperty(K),J=[],Y=``}function Ln(){if(!O())return()=>void 0;Fn();let e=!1;return()=>{e||(e=!0,In())}}const Rn=e=>{let t=getComputedStyle(e).getPropertyValue(`--dp-ui-motion-surface-exit`).trim();return t.endsWith(`ms`)&&parseFloat(t)===0};function X(e,t,n){n!==void 0&&n!==``?(e.setAttribute(`aria-labelledby`,n),e.removeAttribute(`aria-label`)):(e.setAttribute(`aria-label`,t),e.removeAttribute(`aria-labelledby`))}function Z(e){if(Rn(e))return Promise.resolve();if(typeof e.getAnimations!=`function`)return new Promise(e=>{setTimeout(e,V.SURFACE_EXIT)});let t=e.getAnimations({subtree:!0});return Promise.allSettled(t.map(e=>e.finished)).then(()=>void 0)}var zn=class{root;body;dialog;controller=new AbortController;allowPageScroll;releaseScroll=null;openPromise=null;closePromise=null;pointerStartedOnBackdrop=!1;destroyed=!1;constructor(e){this.allowPageScroll=e.allowPageScroll,this.dialog=L(`dialog`,`dp-ui__dialog`),X(this.dialog,e.label,e.labelledBy),this.body=L(`div`,`dp-ui__container dp-ui__container--modal`),this.root=this.dialog,this.dialog.appendChild(this.body),e.parent.appendChild(this.dialog);let{signal:t}=this.controller;this.dialog.addEventListener(`cancel`,t=>{t.preventDefault(),this.closePromise||e.onCancel(`escape`)},{signal:t}),this.dialog.addEventListener(`pointerdown`,e=>{this.pointerStartedOnBackdrop=e.target===this.dialog},{signal:t}),this.dialog.addEventListener(`click`,t=>{let n=this.pointerStartedOnBackdrop&&t.target===this.dialog;this.pointerStartedOnBackdrop=!1,n&&!this.closePromise&&e.onCancel(`outside`)},{signal:t})}open(){return this.openPromise||(this.openPromise=Promise.resolve(),this.destroyed)||(this.allowPageScroll||(this.releaseScroll=Ln()),this.dialog.showModal()),this.openPromise}close(){return this.closePromise||=(this.dialog.open&&this.dialog.close(),Z(this.dialog).then(()=>{this.unlock()})),this.closePromise}destroy(){this.destroyed||(this.destroyed=!0,this.controller.abort(),this.unlock(),this.dialog.remove())}setLabel(e,t){X(this.dialog,e,t)}unlock(){this.releaseScroll?.(),this.releaseScroll=null}},Bn=class{root;body;constructor(e){this.root=L(`div`,`dp-ui__container dp-ui__container--inline`,{role:`group`}),X(this.root,e.label,e.labelledBy),this.body=this.root,e.container.appendChild(this.root)}open(){return Promise.resolve()}close(){return Promise.resolve()}destroy(){this.root.remove()}setLabel(e,t){X(this.root,e,t)}};const Q=`anchor-name`,Vn=e=>typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`position-try-fallbacks`,`flip-block`)&&typeof e.showPopover==`function`,Hn=e=>`--dp-ui-anchor-${e.replace(/[^\w-]/g,`-`)}`,Un=(e,t,n)=>{let{style:r}=t,i=r.getPropertyValue(Q);return r.setProperty(Q,n),e.style.setProperty(`--dp-ui-anchor-name`,n),e.setAttribute(`data-positioning`,`anchor`),()=>{i?r.setProperty(Q,i):r.removeProperty(Q)}},Wn=e=>{let{left:t,right:n}=e.getBoundingClientRect(),r=e.ownerDocument.documentElement.clientWidth;return t<-.5||n>r+.5},Gn=(e,t)=>{let n=e.getBoundingClientRect().top<t.getBoundingClientRect().top;e.setAttribute(`data-placement`,n?`top`:`bottom`)},Kn=(e,t)=>Math.round(e*t)/t;function qn({anchor:e,contentWidth:t,pickerHeight:n,minHeight:r,layoutWidth:i,viewport:a,tokens:o,request:s,rtl:c,pixelRatio:l}){let{gap:u,minWidth:d,maxWidth:f,edgeMargin:p}=o,{offsetLeft:m,offsetTop:h}=a,g=Kn(Math.min(Math.max(e.width,d,t),f,i-2*p),l),_=h+p,v=e.top-u-_,y=h+a.height-p-e.bottom-u,b=(s===`auto`?n<=y||!(n<=v)&&y>=v?`bottom`:`top`:s)===`top`,x=b?v:y,S=x<Math.min(n,r)&&(b?y:v)>x?!b:b,ee=S?`top`:`bottom`,C=S?v:y,w=n>C?Math.max(C,0):null,te=w??n,ne=S?e.top-u-te:e.bottom+u,re=c?e.right-g:e.left,T=Math.max(Math.min(re,m+a.width-g-p),m+p);return{top:Kn(Math.max(ne,_),l),left:Kn(T,l),width:g,placement:ee,availableHeight:w}}const Jn=`--dp-ui-popover-top`,Yn=`--dp-ui-popover-left`,Xn=`--dp-ui-popover-available-height`,$=(e,t,n)=>{e.style.setProperty(`max-width`,`var(--dp-ui-${t})`);let r=getComputedStyle(e).getPropertyValue(`max-width`),i=r.endsWith(`px`)?parseFloat(r):NaN;return i>=0?i:n},Zn=e=>{let t=L(`div`);t.style.cssText=`position:absolute;visibility:hidden;pointer-events:none`,e.appendChild(t);let n={gap:$(t,`popover-gap`,4),edgeMargin:$(t,`popover-edge-margin`,4),minHeight:$(t,`popover-min-height`,160)};return t.remove(),n},Qn=(e,t,n)=>{let r=null;return{enable:()=>{let{style:t}=e;t.setProperty(`position`,`fixed`),t.setProperty(`margin`,`0`),t.setProperty(`inset`,`auto`),t.setProperty(`top`,`var(${Jn})`),t.setProperty(`left`,`var(${Yn})`),e.setAttribute(`data-positioning`,`fallback`)},layout:()=>{r??=Zn(e);let i=e.ownerDocument.documentElement;e.style.removeProperty(Xn);let a=t.getBoundingClientRect(),o=e.offsetWidth,{top:s,left:c,placement:l,availableHeight:u}=qn({anchor:{top:a.top,bottom:a.bottom,left:a.left,right:a.right,width:0},contentWidth:o,pickerHeight:e.offsetHeight,minHeight:r.minHeight,layoutWidth:i.clientWidth,viewport:window.visualViewport??{width:i.clientWidth,height:i.clientHeight,offsetLeft:0,offsetTop:0},tokens:{gap:r.gap,edgeMargin:r.edgeMargin,minWidth:0,maxWidth:o},request:`auto`,rtl:n,pixelRatio:window.devicePixelRatio||1});e.style.setProperty(Jn,`${String(s)}px`),e.style.setProperty(Yn,`${String(c)}px`),u!==null&&e.style.setProperty(Xn,`${String(u)}px`),e.setAttribute(`data-placement`,l)}}},$n=e=>{document.addEventListener(`pointerdown`,t=>{if(e.isIgnored())return;let n=t.composedPath();e.inside.some(e=>n.includes(e))||e.onOutside()},{capture:!0,signal:e.signal})},er=(e,t,n)=>{let r=new AbortController,{signal:i}=r,a=0,o=()=>{a===0&&(a=requestAnimationFrame(()=>{a=0,i.aborted||n()}))};if(window.addEventListener(`resize`,o,{signal:i}),window.addEventListener(`scroll`,t=>{let{target:n}=t;n instanceof Node&&e.contains(n)||o()},{capture:!0,signal:i}),window.visualViewport?.addEventListener(`resize`,o,{signal:i}),window.visualViewport?.addEventListener(`scroll`,o,{signal:i}),typeof ResizeObserver<`u`){let n=new ResizeObserver(o);n.observe(t),n.observe(e),i.addEventListener(`abort`,()=>{n.disconnect()})}return i.addEventListener(`abort`,()=>{cancelAnimationFrame(a),a=0}),()=>{r.abort()}};var tr=class{root;body;anchor;anchorName;fallback;controller=new AbortController;stopTracking=null;restoreAnchor=null;hasPopover;anchored=!1;openPromise=null;closePromise=null;destroyed=!1;constructor(e){this.anchor=e.anchor,this.anchorName=Hn(e.instanceId),this.root=L(`div`,`dp-ui__container dp-ui__container--docked`,{role:`dialog`,"aria-modal":`false`,"data-placement":`bottom`}),X(this.root,e.label,e.labelledBy),this.body=this.root,this.fallback=Qn(this.root,this.anchor,e.rtl),this.hasPopover=typeof this.root.showPopover==`function`,this.hasPopover?this.root.setAttribute(`popover`,`manual`):this.root.style.display=`none`,e.host.appendChild(this.root);let{signal:t}=this.controller;$n({inside:[this.root,this.anchor,...e.inside],signal:t,isIgnored:()=>e.ignoreOutsideClick||this.closePromise!==null,onOutside:()=>{e.onOutside()}}),this.root.addEventListener(`keydown`,t=>{t.key!==`Escape`||t.defaultPrevented||this.closePromise||e.onEscape()},{signal:t})}open(){return this.openPromise||(this.openPromise=Promise.resolve(),this.destroyed)||(this.show(),this.update(),this.stopTracking=er(this.root,this.anchor,()=>{this.update()})),this.openPromise}close(){return this.closePromise||=(this.endTracking(),this.hide(),Z(this.root)),this.closePromise}destroy(){this.destroyed||(this.destroyed=!0,this.endTracking(),this.controller.abort(),this.restoreAnchor?.(),this.restoreAnchor=null,this.root.remove())}setLabel(e,t){X(this.root,e,t)}endTracking(){this.stopTracking?.(),this.stopTracking=null}show(){if(!this.hasPopover)this.root.style.removeProperty(`display`),this.enableFallback();else{try{this.root.showPopover()}catch{this.hasPopover=!1,this.root.removeAttribute(`popover`),this.enableFallback();return}Vn(this.root)?(this.restoreAnchor=Un(this.root,this.anchor,this.anchorName),this.anchored=!0):this.enableFallback()}}hide(){if(!this.hasPopover)this.root.style.display=`none`;else try{this.root.hidePopover()}catch{this.root.removeAttribute(`popover`),this.hasPopover=!1,this.root.style.display=`none`}}enableFallback(){this.fallback.enable(),this.anchored=!1}update(){this.anchored&&Wn(this.root)&&this.enableFallback(),this.anchored?Gn(this.root,this.anchor):this.fallback.layout()}};const nr=`dp-ui__container`,rr=/\s+/,ir=/* @__PURE__ */ new WeakMap;function ar(e){return e.split(rr).filter(e=>e!==``)}function or(e,t){e.setAttribute(`data-theme`,t.theme),e.setAttribute(`data-color-scheme`,t.colorScheme),e.classList.remove(...ir.get(e)??[]);let n=ar(t.className??``);e.classList.add(...n),ir.set(e,n),(e.classList.contains(nr)?e:e.querySelector(`.${nr}`))?.classList.toggle(`dp-ui__container--rtl`,t.rtl??!1)}Object.defineProperty(exports,"$",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return zt}}),Object.defineProperty(exports,"At",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return _t}}),Object.defineProperty(exports,"Bt",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(exports,"Ct",{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"Dt",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(exports,"Et",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"Ft",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"Ht",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return xt}}),Object.defineProperty(exports,"It",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return St}}),Object.defineProperty(exports,"Lt",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(exports,"Mt",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return Et}}),Object.defineProperty(exports,"Nt",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"Ot",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return kt}}),Object.defineProperty(exports,"Pt",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"Q",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(exports,"Rt",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(exports,"St",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return Wt}}),Object.defineProperty(exports,"Tt",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"Ut",{enumerable:!0,get:function(){return`dp-ui-`}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return yt}}),Object.defineProperty(exports,"Vt",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return $t}}),Object.defineProperty(exports,"_t",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"at",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return Vt}}),Object.defineProperty(exports,"bt",{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return pn}}),Object.defineProperty(exports,"ct",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return mn}}),Object.defineProperty(exports,"dt",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(exports,"et",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return rn}}),Object.defineProperty(exports,"ft",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return en}}),Object.defineProperty(exports,"gt",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return on}}),Object.defineProperty(exports,"ht",{enumerable:!0,get:function(){return me}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return zn}}),Object.defineProperty(exports,"it",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return Ot}}),Object.defineProperty(exports,"jt",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return Rt}}),Object.defineProperty(exports,"kt",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return fn}}),Object.defineProperty(exports,"lt",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return sn}}),Object.defineProperty(exports,"mt",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return tr}}),Object.defineProperty(exports,"nt",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return jn}}),Object.defineProperty(exports,"ot",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return an}}),Object.defineProperty(exports,"pt",{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Bn}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return xn}}),Object.defineProperty(exports,"st",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return or}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return dn}}),Object.defineProperty(exports,"ut",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"vt",{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(exports,"wt",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return Gt}}),Object.defineProperty(exports,"xt",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(exports,"yt",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return gt}}),Object.defineProperty(exports,"zt",{enumerable:!0,get:function(){return l}});