@aiquants/period-slider 0.4.2 → 0.5.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.
package/README.md CHANGED
@@ -31,9 +31,12 @@
31
31
  - **離散日付対応 (`allowedDates`)**: 実データが存在する日付のみをスナップ対象にする離散モードを内蔵。`[minDate, maxDate]` 外の要素は到達不能なため除外され、全要素が範囲外の場合は `RangeError` で失敗。
32
32
  - **ラベル配置と重なり防止自動傾斜**:
33
33
  - `labelPosition`: 上側 (`"top"`, 既定) または下側 (`"bottom"`) のラベル表示位置を選択可能。
34
- - `autoSlantLabels`: 2 つのラベルが近接した際に Smootherstep 補間により 0° 〜 90° に滑らかに自動傾斜し、テキストの重なりを数学的に完全防止。回転時もラベル下端がトラック中心から常に 10px (つまみ上端から 2px) の統一された高さを維持。
34
+ - `autoSlantLabels`: 2 つのラベルが近接した際に Smootherstep 補間により 0° 〜 90° に滑らかに自動傾斜し、テキストの重なりを数学的に完全防止。回転時もラベル下端がトラック中心から常に 10px (つまみ上端から 2px) の統一された高さを維持。角度は 2 つの値が一致する位置まで連続で、その位置で 90° に達します。
35
+ - 傾斜は Range の 1 対と、ノギスのマクロ対・ミクロ対の計 3 組へ**対ごとに独立して**適用されます (対ごとに比率も単位もラベル幅も違うため、計算を共有しません)。マクロ対とミクロ対で角度が異なるのは正常です。
36
+ - 垂直レイアウト (`isVertical={true}`、垂直ノギスを含む) では傾斜しません。傾斜幾何が X 軸方向にしか分離しないためで、垂直向けの衝突回避は未整備の保留領域です。
35
37
  - 衝突判定はラベルの実測幅 (`ResizeObserver` が返すボーダーボックス幅) のみを用います。単位や書式から推定した定数を使わないため、`locale`・`formatLabel`・ホストのフォントを変えても判定はずれません。実測値が得られるまでラベルは傾斜せず直立します。
36
- - 操作中 (ドラッグ中) のラベル・つまみを前面 (`z-index`) に強調表示。
38
+ - 2 つのつまみが同じ値に重なったときは、同一文字列のラベルを 2 枚並べず 1 枚へ畳みます。冗長な側のラベルには `data-duplicate="true"` が付いて `visibility: hidden` になり (要素は残るため実測は継続)、残った 1 枚は 90° に傾いたままつまみの中心に立ちます (畳んでも角度は変えず、離す相手が居なくなった水平方向の押し退けだけを 0 にします)。畳まれたかどうかは傾斜の可否を動かしません。値が一致していても、上記のとおり実測が揃うまで・`autoSlantLabels={false}`・垂直レイアウトでは直立のままです。同じ機構がノギスのマクロ対・ミクロ対にも適用され (判定は各対の符号化値の厳密一致)、可視ラベルは掴んだ・打鍵した・`Tab` で到達したつまみへ追従します。
39
+ - 操作中 (ドラッグ中)、直近にクリック・キー操作・フォーカスしたラベル・つまみを前面 (`z-index`) に強調表示。併合時に見えるのはこの前面側のラベルです。
37
40
  - **上限/下限交差 (クロスオーバー) の動的ハイライト追従**:
38
41
  - レンジドラッグ中につまみが相手側アンカーを超えて上限と下限が入れ替わった際、現在ポインターで操作している側のつまみへアクティブ状態 (`[data-active="true"]`、スケール縮小+ブルーグロー・波紋) がリアルタイムに自動スワップ。
39
42
  - **充実した日付セレクタ**:
@@ -251,6 +254,8 @@ export function VernierExample() {
251
254
  }
252
255
  ```
253
256
 
257
+ マクロ・ミクロ両段のラベルと `aria-valuetext` は、つまみ位置と `aria-valuenow` を決めるのと同一の符号値から復元した `Date` を整形します。したがって `macroUnit="month"` で `macroRange` に月の途中の日付を渡しても、ラベルは常に `aria-valuenow` と一致します。対の 2 つの符号値が一致したとき (例: 同一マクロ単位内に収まる `macroRange`) は、同一文字列のラベルを 2 枚描かず 1 枚へ畳みます (下記 DOM 契約の `data-duplicate`)。
258
+
254
259
  ### PeriodSlider (垂直レイアウト)
255
260
 
256
261
  `isVertical={true}` を指定することで、縦向き (下部が最小日付、上部が最大日付) のスライダーとして表示できます。
@@ -374,8 +379,8 @@ export function CustomLabelExample() {
374
379
  | `allowedDates` | `Date[]` | `undefined` | 離散スナップ対象日付配列 (指定時はこの日付のみにスナップ)。`[minDate, maxDate]` 外の要素は除外され、全要素が範囲外なら `RangeError` |
375
380
  | `snapMode` | `"index" \| "time"` | `"index"` | 離散スナップ時の配置方式 (`"index"`: 配列インデックス均等, `"time"`: 実時間比例)。実時間軸やチャートと位置を揃える場合は `"time"` を明示指定 |
376
381
  | `labelPosition` | `"top" \| "bottom"` | `"top"` | 日付ラベルの表示位置 (スライダーの上側または下側) |
377
- | `autoSlantLabels` | `boolean` | `true` | 近接時にラベルを斜め〜90° に自動傾斜させて重なりを防止 |
378
- | `tooltipStyle` | `"always" \| "hover" \| "balloon"` | `"always"` | ツールチップの表示スタイル (`"always"`: 常時, `"hover"`: ポインター操作時, `"balloon"`: 吹き出し型) |
382
+ | `autoSlantLabels` | `boolean` | `true` | 近接時にラベルを斜め〜90° に自動傾斜させて重なりを防止 (Range の 1 対とノギスの 2 対へ対ごとに適用。垂直レイアウトでは適用されない) |
383
+ | `tooltipStyle` | `"always" \| "hover" \| "balloon"` | `"always"` | ツールチップの表示スタイル (`"always"`: 常時, `"hover"`: ポインター操作時, `"balloon"`: 吹き出し型)。`"balloon"` の宣言は `!important` 付きでユーティリティ層に勝つが、ノギスのツールチップだけは段の配色 (マクロ青 / ミクロ赤) を保ち、角丸・余白・文字サイズ・高さのみ吹き出し型になる |
379
384
  | `isVertical` | `boolean` | `false` | 垂直スライダー表示の有効化 |
380
385
  | `hideConnectBar` | `boolean` | `false` | 範囲選択バー (ハイライト) を非表示にし、独立 2 点選択 UI として利用 |
381
386
  | `showTicks` | `boolean` | `false` | 離散モード時のトラック上の目盛線の表示有無 |
@@ -396,7 +401,7 @@ export function CustomLabelExample() {
396
401
  | `defaultRange` | `[Date, Date]` | `undefined` | 非制御 (Uncontrolled) 時の初期選択期間タプル。`range` 指定時は無視 |
397
402
  | `onChangeRange` | `(lower: Date, upper: Date) => void` | `undefined` | 選択期間変更時コールバック |
398
403
 
399
- `range` / `defaultRange` を共に省略した場合、両つまみは `minDate` (離散時は候補日付の先頭) に重なり、幅ゼロの期間として描画されます。意図した期間は必ずどちらかで与えてください。
404
+ `range` / `defaultRange` を共に省略した場合、両つまみは `minDate` (離散時は候補日付の先頭) に重なり、幅ゼロの期間として描画されます (この状態のラベルは 1 枚へ畳まれます)。意図した期間は必ずどちらかで与えてください。
400
405
 
401
406
  #### Point モード専用 Props (`mode="point"`)
402
407
 
@@ -423,7 +428,7 @@ export function CustomLabelExample() {
423
428
  | `microIsDiscrete` | `boolean` | `false` | ミクロ側の離散スナップ有効化フラグ。`false` の間は `microAllowedDates` が参照されない |
424
429
  | `macroAllowedDates` | `Date[]` | `allowedDates` | マクロ側の離散スナップ対象日付配列。`macroIsDiscrete={true}` との併用が必須 |
425
430
  | `microAllowedDates` | `Date[]` | `allowedDates` | ミクロ側の離散スナップ対象日付配列。`microIsDiscrete={true}` との併用が必須。候補はマクロ窓で切り出され、窓の外の日付へはキーボード・ポインターのいずれからも到達しない。窓内に候補が 1 件も残らない場合、ミクロレールは窓内の連続値として振る舞う |
426
- | `formatMacroLabel` | `(date: Date) => string` | `formatLabel` | マクロ側ラベル・ツールチップのカスタム表示文字列生成関数 |
431
+ | `formatMacroLabel` | `(date: Date) => string` | `formatLabel` | マクロ側ラベル・ツールチップのカスタム表示文字列生成関数。引数はつまみ位置・`aria-valuenow` と同一の符号値から復元した `macroUnit` 正規化済み `Date` であり、`macroRange` の生の値ではない (`macroUnit="month"` なら常に月初、`"year"` なら常に元日、`"day"` は暦日そのままで時刻が 0 時) |
427
432
  | `formatMicroLabel` | `(date: Date) => string` | `formatLabel` | ミクロ側ラベル・ツールチップのカスタム表示文字列生成関数。引数はつまみ位置と同一の `microUnit` 正規化済み `Date` (`microUnit="month"` なら常に月初) |
428
433
  | `vernierOrientation` | `"macro-top" \| "macro-bottom" \| "macro-left" \| "macro-right"` | 水平時 `"macro-top"` / `isVertical` 時 `"macro-left"` | ノギスのレール配置。水平時は上下 (`macro-top` / `macro-bottom`)、垂直時は左右 (`macro-left` / `macro-right`) を指定 |
429
434
  | `showVernierProjection` | `boolean` | `true` | マクロ窓からミクロ全幅へ広がる半透明台形プロジェクション光の表示有無 |
@@ -443,7 +448,7 @@ export function CustomLabelExample() {
443
448
  | `macroUpperAriaLabel` | `string` | `"Macro range end"` | マクロ上限つまみのアクセシブル名 (`mode="vernier"` のみ) |
444
449
  | `decreaseAriaLabel` | `string` | `"Decrease"` | 値を `minDate` 方向へ 1 単位動かすステッパーボタンのアクセシブル名 (水平時は左の `◀`、垂直時は下の `▼`) |
445
450
  | `increaseAriaLabel` | `string` | `"Increase"` | 値を `maxDate` 方向へ 1 単位動かすステッパーボタンのアクセシブル名 (水平時は右の `▶`、垂直時は上の `▲`) |
446
- | `formatAriaValueText` | `(date: Date, unit: PeriodSliderUnit) => string` | `undefined` | `aria-valuetext` の読み上げ文字列生成関数。未指定時は可視ラベルと同一の文字列 (ISO 8601、`locale` 指定時は `Intl.DateTimeFormat` 書式)。ノギスのマクロ側には `macroRange` の値がそのまま、ミクロ側には `microUnit` 正規化済みの `Date` が渡される |
451
+ | `formatAriaValueText` | `(date: Date, unit: PeriodSliderUnit) => string` | `undefined` | `aria-valuetext` の読み上げ文字列生成関数。未指定時は可視ラベルと同一の文字列 (ISO 8601、`locale` 指定時は `Intl.DateTimeFormat` 書式)。ノギスでは可視ラベルと同じく、マクロ側に `macroUnit` 正規化済み、ミクロ側に `microUnit` 正規化済みの `Date` が渡される |
447
452
 
448
453
  ステッパーの 2 つの名称は配置ではなく値への作用で定義されています。同じボタンが水平レイアウトでは左、垂直レイアウトでは下に立つため、位置で命名すると意味が反転するからです。
449
454
 
@@ -473,6 +478,10 @@ DOM 要素の特定は CSS クラス名ではなく `data-*` 属性で行いま
473
478
  | `[data-testid="period-slider-tick"]` | 目盛線。ノギスモードでは `data-tick-scale="macro" \| "micro"` が併記され上下段を判別できる |
474
479
  | `[data-testid="period-slider-hover-guide"]` | ホバーガイド |
475
480
  | `[data-testid="period-slider-hover-dot"]` | ホバーガイドの点 |
481
+ | `[data-tooltip-style="always" \| "hover" \| "balloon"]` | すべてのツールチップ (Range は 2 枚、Point は 1 枚、ノギスは 4 枚)。`tooltipStyle="hover"` ではツールチップ要素自体が描かれない。`range` / `point` のツールチップは `data-label-position` / `data-front` を併せ持つ (ノギスではこの 2 つは親つまみ側にある) |
482
+ | `[data-slanted="true"]` | 近接傾斜中のツールチップ。Range の 2 枚とノギスの 4 枚が対象 (Point モードには付かない)。ノギスは対ごとに独立して傾くため、マクロ対とミクロ対で有無が違うのは正常。垂直レイアウトでは付かない |
483
+ | `[data-duplicate="true"]` | 同じ値に重なった対のうち、冗長な (隠れている) 側のツールチップ 1 枚。対は Range の下限 / 上限、ノギスのマクロ下限 / 上限、ノギスのミクロ下限 / 上限の 3 つで、いずれも符号化値 (`aria-valuenow`) の厳密一致が条件。Point モードには付かない |
484
+ | `[data-handle-type="macro-low"] [data-tooltip-style]` | 個々のノギスラベル。ノギスのツールチップは親つまみ経由で特定する。水平レール (`macro-top` / `macro-bottom`) かつ `autoSlantLabels` 有効時はインライン `style` に `--ps-tooltip-tx` / `--ps-tooltip-ty` / `--ps-tooltip-rot` の 3 つを持ち (`--ps-tooltip-ty` はレール基準からの生のピクセル差分)、垂直レール (`macro-left` / `macro-right`) と `autoSlantLabels={false}` では `style` 属性を持たない |
476
485
 
477
486
  ### 実行時バリデーション (Fail Fast)
478
487
 
@@ -143,7 +143,7 @@ export interface BasePeriodSliderProps extends AccessibleSliderLabels {
143
143
  tooltipStyle?: "always" | "hover" | "balloon";
144
144
  /** Label position: "top" (default) or "bottom" / ラベル表示位置("top": 上側 [既定], "bottom": 下側) */
145
145
  labelPosition?: PeriodSliderLabelPosition;
146
- /** Whether to automatically slant labels when close in range mode (default: true) / Rangeモードで接近時に自動斜め表示するか(既定: true) */
146
+ /** Whether to automatically slant labels when a pair comes close, in range mode and on both vernier rails (default: true) / Range モードとノギスの両レールで、対が接近した時に自動斜め表示するか (既定: true) */
147
147
  autoSlantLabels?: boolean;
148
148
  /** Renders the slider along the vertical axis (default: false) / 垂直方向レイアウト (既定: false) */
149
149
  isVertical?: boolean;
@@ -1 +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;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc;UACjB,OAAO,GAAG,OAAO;YACf,OAAO;iBACF,OAAO;aACX,OAAO;EAwBlB,CAAA;AAisEF;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,IAAI,KAAK,CAAC,aAAa,EAAE,IAAI,KAAK,CAAC,aAAa,KAAG,OAUjF,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,GAAI,MAAM,iBAAiB,EAAE,MAAM,iBAAiB,KAAG,OAsF5F,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,+CAAyD,CAAA"}
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),Te=require("date-fns"),o=require("react"),bn={"blue-rose":{macro:"#0284c7",macroLight:"#38bdf8",micro:"#e11d48",microLight:"#fb7185",accent:"#0284c7"},"indigo-amber":{macro:"#4f46e5",macroLight:"#818cf8",micro:"#d97706",microLight:"#fbbf24",accent:"#4f46e5"},"teal-emerald":{macro:"#0d9488",macroLight:"#2dd4bf",micro:"#059669",microLight:"#34d399",accent:"#0d9488"},"violet-fuchsia":{macro:"#7c3aed",macroLight:"#a78bfa",micro:"#c026d3",microLight:"#e879f9",accent:"#7c3aed"},"slate-sky":{macro:"#475569",macroLight:"#94a3b8",micro:"#0284c7",microLight:"#38bdf8",accent:"#475569"},monochrome:{macro:"#52525b",macroLight:"#a1a1aa",micro:"#18181b",microLight:"#71717a",accent:"#27272a"}},ot=e=>e instanceof Date&&!Number.isNaN(e.getTime()),he=e=>e instanceof Date?Number.isNaN(e.getTime())?"Invalid Date":e.toISOString():String(e),qe=(e,t)=>{if(!ot(t))throw new RangeError(`normalizeDateByUnit: d must be a valid Date (received: ${he(t)})`);const r=new Date(t.getTime());return e==="year"?(r.setMonth(0,1),r.setHours(0,0,0,0)):(e==="month"&&r.setDate(1),r.setHours(0,0,0,0)),r},X=(e,t)=>{const r=qe(e,t),n=r.getFullYear(),a=r.getMonth()+1,s=r.getDate();if(e==="year")return n;if(e==="month")return n*12+(a-1);const i=new Date(0);return i.setUTCFullYear(n,a-1,s),i.setUTCHours(0,0,0,0),Math.floor(i.getTime()/(1440*60*1e3))},oe=(e,t)=>{const r=new Date(0);if(r.setHours(0,0,0,0),e==="year")return r.setFullYear(t,0,1),r;if(e==="month"){const a=Math.floor(t/12),s=t-a*12;return r.setFullYear(a,s,1),r}const n=new Date(t*24*60*60*1e3);return r.setFullYear(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()),r},Ne=(e,t,r)=>{if(!ot(t))throw new RangeError(`addUnit: d must be a valid Date (received: ${he(t)})`);return e==="year"?Te.addYears(t,r):e==="month"?Te.addMonths(t,r):Te.addDays(t,r)},at=(e,t,r)=>{if(!ot(r))throw new RangeError(`getMacroWindowEndDate: d must be a valid Date (received: ${he(r)})`);if(e===t)return qe(t,r);const n=r.getFullYear(),a=r.getMonth();if(e==="year"){if(t==="month")return new Date(n,11,1);if(t==="day")return new Date(n,11,31)}return e==="month"&&t==="day"?new Date(n,a+1,0):qe(t,r)},Zn={year:{year:"numeric"},month:{year:"numeric",month:"2-digit"},day:{year:"numeric",month:"2-digit",day:"2-digit"}},ln=new Map,Qn=(e,t)=>{const r=`${e}\0${t}`,n=ln.get(r);if(n!==void 0)return n;const a=new Intl.DateTimeFormat(t,Zn[e]);return ln.set(r,a),a},ea=(e,t)=>{const r=String(t.getFullYear()).padStart(4,"0");if(e==="year")return r;const n=String(t.getMonth()+1).padStart(2,"0");if(e==="month")return`${r}-${n}`;const a=String(t.getDate()).padStart(2,"0");return`${r}-${n}-${a}`},Ee=(e,t,r,n)=>ot(t)?r?r(t):n===void 0?ea(e,t):Qn(e,n).format(t):"",pt=(e,t,r,n)=>Ee(e,t,r,n),ve=(e,t,r)=>{if(!e||e.length===0||e.length===1)return 0;const n=X(r,t);let a=0,s=e.length-1;if(n<=X(r,e[a]))return 0;if(n>=X(r,e[s]))return s;for(;a<=s;){const w=a+s>>1,g=X(r,e[w]);if(g===n)return w;g<n?a=w+1:s=w-1}const i=Math.abs(X(r,e[a])-n),d=Math.abs(X(r,e[s])-n);return i<d?a:s},Ft=(e,t,r,n)=>{if(!Array.isArray(e)||e.length===0)return[];const a=X(t,r),s=X(t,n),i=new Map;for(const d of e){const w=qe(t,d),g=X(t,w);g<a||g>s||i.has(g)||i.set(g,w)}if(i.size===0)throw new RangeError(`getSortedAllowedDates: every allowedDates entry falls outside [minDate, maxDate] (minDate: ${he(r)}, maxDate: ${he(n)}, entries: ${e.length})`);return Array.from(i.keys()).sort((d,w)=>d-w).map(d=>i.get(d))},fr=(e,t,r,n)=>{const a=e.length-1;if(a<=0)return 0;const s=ve(e,n,t);if(r==="time"){const i=e[0].getTime(),d=e[a].getTime()-i;return d<=0?0:Math.max(0,Math.min(1,(e[s].getTime()-i)/d))}return s/a},gr=(e,t,r,n)=>{const a=e.length-1;if(a<=0)return 0;const s=Math.max(0,Math.min(1,n));if(r==="time"){const i=e[0].getTime(),d=e[a].getTime()-i;return d<=0?0:ve(e,new Date(i+s*d),t)}return Math.max(0,Math.min(a,Math.round(s*a)))},Ir=(e,t,r,n,a,s,i)=>{let d=r,w=n;return i?(d=t,w=t):e==="low"?t>n?(d=n,w=t):d=t:t<r?(w=r,d=t):w=t,[Math.max(a,Math.min(s,d)),Math.max(a,Math.min(s,w))]},wn=(e,t,r,n,a)=>a?"low":e==="low"?t>n?"high":"low":t<r?"low":"high",xn=({posDiffPct:e,startLowVal:t,startHighVal:r,rangeMin:n,rangeMax:a,isDiscrete:s,sortedAllowedDates:i,snapMode:d,unit:w})=>{if(s){const V=i.length-1;if(V<=0)return[0,0];const ee=Math.max(0,Math.min(V,Math.round(t))),p=Math.max(ee,Math.min(V,Math.round(r)));if(d==="time"){const Y=i[0].getTime(),U=i[V].getTime(),S=i[ee].getTime(),_=i[p].getTime()-S;let j=S+e*(U-Y),b=j+_;j<Y&&(j=Y,b=Y+_),b>U&&(b=U,j=U-_);const $=ve(i,new Date(j),w),N=ve(i,new Date(b),w);return[$,Math.max($,N)]}const J=Math.round(e*V);let E=ee+J,te=p+J;return E<0&&(te+=-E,E=0),te>V&&(E-=te-V,te=V),[Math.max(0,Math.min(V,E)),Math.max(0,Math.min(V,te))]}const g=V=>Math.max(n,Math.min(a,V)),k=a-n;if(k<=0)return[g(t),g(r)];const y=Math.round(e*k);let u=t+y,v=r+y;return u<n&&(v+=n-u,u=n),v>a&&(u-=v-a,v=a),[g(u),g(v)]},Mn=(e,t,r,n,a,s,i,d)=>{let w=0,g=!1,k=!1;switch(e){case"ArrowRight":case"ArrowUp":w=d;break;case"ArrowLeft":case"ArrowDown":w=-d;break;case"PageUp":w=d*5;break;case"PageDown":w=-d*5;break;case"Home":g=!0;break;case"End":k=!0;break;default:return null}if(i){let v=r;return g?v=a:k?v=s:v=Math.max(a,Math.min(s,r+w)),[v,v]}let y=r,u=n;return t==="low"?g?y=a:k?y=n:y=Math.max(a,Math.min(n,r+w)):g?u=r:k?u=s:u=Math.max(r,Math.min(s,n+w)),[y,u]},vn=8,pn=2,Dn=16,ta=12,ra=90,yn=(e,t)=>{const r=t?.estimatedHeightPx??Dn,a=vn+(t?.anchorGapY??pn)+r/2,s=e==="top"?-a:a;return{lowAngleDeg:0,highAngleDeg:0,lowOffsetX:0,highOffsetX:0,lowOffsetY:s,highOffsetY:s,isSlanted:!1,proximity:0}},Tn=(e,t,r,n="top",a)=>{const s=a?.estimatedWidthPx,i=a?.estimatedHeightPx??Dn,d=a?.paddingPx??ta,w=a?.maxAngleDeg??ra,g=vn+(a?.anchorGapY??pn),k=yn(n,a);if(!(Number.isFinite(r)&&r>0)||s===void 0||!Number.isFinite(s)||s<=0)return k;const y=Math.max(0,t-e)/100*r,u=s+d;if(y>=u)return k;const v=Math.max(0,Math.min(1,(u-y)/u)),ee=v*v*v*(v*(v*6-15)+10)*w,p=n==="top"?-ee:ee,J=ee*Math.PI/180,E=s/2*Math.abs(Math.sin(J))+i/2*Math.abs(Math.cos(J)),te=g+E,Y=n==="top"?-te:+te,U=s*Math.abs(Math.cos(J))+i*Math.abs(Math.sin(J)),S=Math.max(0,(U+d-y)/2);return{lowAngleDeg:p,highAngleDeg:p,lowOffsetX:-S,highOffsetX:S,lowOffsetY:Y,highOffsetY:Y,isSlanted:v>.001,proximity:v}};function Rn(e,t,r,n,a,s,i="macro-top",d=.05,w=!0){const g=i==="macro-top"||i==="macro-left",k=t<=0;if(g&&k||!(g||k)){const v=Math.abs(e-r),V=Math.abs(e-n);return v<=d&&v<=V?"macro-low":V<=d&&V<v?"macro-high":w&&e>=r&&e<=n?"macro-connect":v<V?"macro-low":"macro-high"}const y=Math.abs(e-a),u=Math.abs(e-s);return y<=d&&y<=u?"micro-low":u<=d&&u<y?"micro-high":w&&e>=a&&e<=s?"micro-connect":y<u?"micro-low":"micro-high"}function Sn(e,t,r,n,a){if(e==="macro-connect"){const i=t-r,d=a-n,w=Math.max(0,Math.min(1-d,n+i)),g=w+d;return[w,g,"macro-connect"]}if(e==="macro-low"){const i=Math.max(0,Math.min(1,t));return i>a?[a,i,"macro-high"]:[i,a,"macro-low"]}const s=Math.max(0,Math.min(1,t));return s<n?[s,n,"macro-low"]:[n,s,"macro-high"]}function Ln(e,t,r,n,a){if(e==="micro-connect"){const i=t-r,d=a-n,w=Math.max(0,Math.min(1-d,n+i)),g=w+d;return[w,g,"micro-connect"]}if(e==="micro-low"){const i=Math.max(0,Math.min(1,t));return i>a?[a,i,"micro-high"]:[i,a,"micro-low"]}const s=Math.max(0,Math.min(1,t));return s<n?[s,n,"micro-low"]:[n,s,"micro-high"]}const Wt=o.memo(({type:e,isTop:t=!0,isVertical:r=!1,isLeft:n=!0})=>{let a,s;r?(a=n?"M 7.375 0.625 A 7.375 7.375 0 0 0 7.375 15.375 Z":"M 0.625 0.625 A 7.375 7.375 0 0 1 0.625 15.375 Z",s=`period-slider-knob period-slider-knob-svg is-vertical ${n?"is-semicircle-left":"is-semicircle-right"}`):(a=t?"M 0.625 7.375 A 7.375 7.375 0 0 1 15.375 7.375 Z":"M 0.625 0.625 A 7.375 7.375 0 0 0 15.375 0.625 Z",s=`period-slider-knob period-slider-knob-svg ${t?"is-semicircle-top":"is-semicircle-bottom"}`);const i=e==="macro"?"period-slider-knob-path-macro":"period-slider-knob-path-micro";return f.jsx("svg",{className:s,width:r?"8":"16",height:r?"16":"8",viewBox:r?"0 0 8 16":"0 0 16 8",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:f.jsx("path",{d:a,className:i,shapeRendering:"geometricPrecision",strokeWidth:"1.25"})})});Wt.displayName="VernierKnobSvg";const na=(e,t)=>{if(!ot(e))throw new RangeError(`PeriodSlider: minDate is required and must be a valid Date (received: ${he(e)})`);if(!ot(t))throw new RangeError(`PeriodSlider: maxDate is required and must be a valid Date (received: ${he(t)})`);if(t.getTime()<=e.getTime())throw new RangeError(`PeriodSlider: maxDate must be strictly later than minDate (minDate: ${he(e)}, maxDate: ${he(t)})`)},Mr=(e,t)=>{if(!Array.isArray(t)||t.length!==2)throw new RangeError(`PeriodSlider: ${e} is required and must be a [start, end] Date tuple (received: ${he(t)})`);const[r,n]=t;if(!ot(r))throw new RangeError(`PeriodSlider: ${e}[0] must be a valid Date (received: ${he(r)})`);if(!ot(n))throw new RangeError(`PeriodSlider: ${e}[1] must be a valid Date (received: ${he(n)})`);if(n.getTime()<r.getTime())throw new RangeError(`PeriodSlider: ${e} must not be inverted (start: ${he(r)}, end: ${he(n)})`)},aa=(e,t)=>{if(!ot(t))throw new RangeError(`PeriodSlider: ${e} must be a valid Date (received: ${he(t)})`)},Nr=(e,t,r,n)=>{if(t.getTime()<r.getTime()||t.getTime()>n.getTime())throw new RangeError(`PeriodSlider: ${e} must lie within [minDate, maxDate] (received: ${he(t)}, minDate: ${he(r)}, maxDate: ${he(n)})`)},oa=(e,t,r)=>{if(e.mode==="range"){for(const n of["range","defaultRange"]){const a=e[n];a!==void 0&&(Mr(n,a),Nr(`${n}[0]`,a[0],t,r),Nr(`${n}[1]`,a[1],t,r))}return}if(e.mode==="point")for(const n of["value","defaultValue"]){const a=e[n];a!==void 0&&(aa(n,a),Nr(n,a,t,r))}},ia=(e,t,r)=>{if(Mr("macroRange",e),t!==void 0)return Mr("microRange",t),t;if(r!==void 0)return Mr("defaultMicroRange",r),r;throw new RangeError("PeriodSlider: vernier mode requires a micro selection; supply microRange (controlled) or defaultMicroRange (uncontrolled)")},hr=(e,t,r,n,a,s,i,d)=>{const w=ve(e,n,t),g=ve(e,a,t);return i?w:d?g:Math.max(w,Math.min(g,ve(e,r,t)+s))},Yr=e=>{e.timerId!==null&&clearTimeout(e.timerId),e.timerId=null,e.emit=null},la=(e,t)=>{try{Intl.DateTimeFormat.supportedLocalesOf([t])}catch{throw new RangeError(`PeriodSlider: ${e} must be a valid BCP 47 language tag (received: ${JSON.stringify(t)})`)}},sn=()=>{const[e,t]=o.useState(null),r=o.useRef(null),n=o.useCallback(a=>{if(r.current?.disconnect(),r.current=null,a===null){t(null);return}if(typeof ResizeObserver>"u")return;const s=new ResizeObserver(i=>{for(const d of i){const w=d.borderBoxSize?.[0];w!==void 0&&t(g=>g!==null&&Math.abs(g.widthPx-w.inlineSize)<.5&&Math.abs(g.heightPx-w.blockSize)<.5?g:{widthPx:w.inlineSize,heightPx:w.blockSize})}});s.observe(a),r.current=s},[]);return o.useEffect(()=>()=>{r.current?.disconnect(),r.current=null},[]),[n,e]},sa={horizontal:{decrease:"◀",increase:"▶"},vertical:{decrease:"▼",increase:"▲"}},ca={horizontal:{decrease:"period-slider-stepper-prev",increase:"period-slider-stepper-next"},vertical:{decrease:"period-slider-stepper-prev period-slider-stepper-down",increase:"period-slider-stepper-next period-slider-stepper-up"}},ua=e=>{const{unit:t,minDate:r,maxDate:n,allowedDates:a,snapMode:s="index",disabled:i=!1,className:d="",showStepper:w=!0,tooltipStyle:g="always",labelPosition:k="top",autoSlantLabels:y=!0,isVertical:u=!1,hideConnectBar:v=!1,showTicks:V=!1,colorScheme:ee="blue-rose",locale:p,decreaseAriaLabel:J="Decrease",increaseAriaLabel:E="Increase"}=e;na(r,n),oa(e,r,n),p!==void 0&&la("locale",p);const te=e.mode==="vernier"?ia(e.macroRange,e.microRange,e.defaultMicroRange):null,Y=bn[ee],U=o.useId(),S=o.useRef(e);S.current=e;const _=r.getTime(),j=n.getTime(),b=o.useMemo(()=>Ft(a,t,r,n),[a,t,_,j]),$=b.length>0,{rangeMin:N,rangeMax:O}=o.useMemo(()=>$?{rangeMin:0,rangeMax:b.length-1}:{rangeMin:X(t,r),rangeMax:X(t,n)},[$,b,t,_,j]),P=e.mode==="point",re=o.useCallback(l=>{if($){const c=Math.max(0,Math.min(b.length-1,Math.round(l)));return b[c]}return oe(t,Math.round(l))},[$,b,t]),pe=o.useCallback(l=>{if(l===void 0)return N;const c=qe(t,l);return $?ve(b,c,t):X(t,c)},[$,b,t,N]),[Z,ne]=o.useState(()=>te),ie=e.mode!=="vernier"?null:e.microRange!==void 0?e.microRange:Z,ue=e.mode==="range"?e.range?.[0]??e.defaultRange?.[0]:e.mode==="vernier"?ie?.[0]:void 0,W=e.mode==="range"?e.range?.[1]??e.defaultRange?.[1]:e.mode==="vernier"?ie?.[1]:void 0,K=e.mode==="point"?e.value??e.defaultValue:void 0,$e=e.mode==="point"?K?.getTime():ue?.getTime(),gt=e.mode==="range"?W?.getTime():$e,[Ye,Re]=o.useMemo(()=>{if(e.mode==="point"){const m=pe(K);return[m,m]}const l=pe(ue),c=pe(W);return[Math.min(l,c),Math.max(l,c)]},[e.mode,$e,gt,pe,K,ue,W]),de=e.mode==="point"?e.value!==void 0:e.mode==="range"?e.range!==void 0:e.microRange!==void 0,[H,B]=o.useState(()=>[Ye,Re]),[G,me]=o.useState(null),[L,xe]=o.useState(null),Ve=o.useRef(null);Ve.current=L;const[Qe,le]=o.useState("high"),[De,et]=o.useState(null),[Vt,Zt]=o.useState(null),fe=G?G[0]:de?Ye:H[0],ge=G?G[1]:de?Re:H[1],Tt=o.useRef([fe,ge]);Tt.current=[fe,ge];const Q=e.mode==="vernier",ht=e.mode==="vernier"?e.vernierOrientation??(u?"macro-left":"macro-top"):"macro-top",T=ht==="macro-top"||ht==="macro-left",Qt=e.mode==="vernier"?e.showVernierProjection??!0:!1,er=e.mode==="vernier"?e.showVernierTicks??!0:!1,Rt=e.mode==="vernier"?e.showHairline??!0:!1,I=Q?e.macroUnit??t:t,M=Q?e.microUnit??t:t,vr=Q?e.macroIsDiscrete??!1:$,St=Q?e.microIsDiscrete??!1:$,tr=Q?e.macroAllowedDates??a:a,pr=Q?e.microAllowedDates??a:a,h=Q?e.formatMacroLabel??e.formatLabel:e.formatLabel,C=Q?e.formatMicroLabel??e.formatLabel:e.formatLabel,ke=e.mode==="vernier"?e.macroRange[0].getTime():void 0,Lt=e.mode==="vernier"?e.macroRange[1].getTime():void 0,bt=ue?.getTime(),tt=W?.getTime(),[Pe,rr]=o.useState(null),wt=o.useRef(null);wt.current=Pe;const[Ie,nr]=o.useState("micro-high"),Ae=o.useMemo(()=>X(I,r),[_,I]),$t=o.useMemo(()=>{const l=X(I,n);if(Q&&l<=Ae)throw new RangeError(`PeriodSlider: macroUnit "${I}" cannot distinguish minDate from maxDate (minDate: ${he(r)}, maxDate: ${he(n)})`);return l},[Q,_,j,Ae,I]),Me=o.useMemo(()=>Q?Ft(tr,I,r,n):[],[Q,tr,I,_,j]),je=o.useMemo(()=>e.mode!=="vernier"?Ae:X(I,e.macroRange[0]),[e.mode,ke,Ae,I]),He=o.useMemo(()=>e.mode!=="vernier"?$t:X(I,e.macroRange[1]),[e.mode,Lt,$t,I]),ye=o.useMemo(()=>e.mode!=="vernier"?X(M,r):Math.max(X(M,e.macroRange[0]),X(M,r)),[e.mode,ke,M,_]),Ue=o.useMemo(()=>e.mode!=="vernier"?X(M,n):Math.min(X(M,at(I,M,e.macroRange[1])),X(M,n)),[e.mode,Lt,I,M,j]),ae=o.useMemo(()=>Q?Ft(pr,M,r,n).filter(c=>{const m=X(M,c);return m>=ye&&m<=Ue}):[],[Q,pr,M,_,j,ye,Ue]),kt=vr&&Me.length>0,Ke=St&&ae.length>0,be=o.useMemo(()=>ie===null?ye:X(M,ie[0]),[bt,ye,M,ie]),we=o.useMemo(()=>ie===null?Ue:X(M,ie[1]),[tt,Ue,M,ie]),it=o.useMemo(()=>oe(M,be),[M,be]),lt=o.useMemo(()=>oe(M,we),[M,we]),Ut=Math.max(1,$t-Ae),Se=kt?fr(Me,I,s,oe(I,je)):Math.max(0,Math.min(1,(je-Ae)/Ut)),Oe=Math.max(Se,kt?fr(Me,I,s,oe(I,He)):Math.min(1,(He-Ae)/Ut)),Bt=Math.max(1,Ue-ye),We=Ke?fr(ae,M,s,it):Math.max(0,Math.min(1,(be-ye)/Bt)),xt=Math.max(We,Ke?fr(ae,M,s,lt):Math.min(1,(we-ye)/Bt)),Dr=o.useRef({timerId:null,emit:null}),yr=o.useRef({timerId:null,emit:null}),Tr=o.useRef({timerId:null,emit:null});o.useEffect(()=>{const l=[Dr,yr,Tr];return()=>{for(const c of l)Yr(c.current)}},[]);const Pt=o.useCallback((l,c,m)=>{Yr(l);const{debounceMs:x}=S.current;if(m||!x||x<=0){c();return}l.emit=c,l.timerId=setTimeout(()=>{l.timerId=null,l.emit=null,c()},x)},[]),Rr=o.useCallback(l=>{const c=l.emit;Yr(l),c?.()},[]),Ct=o.useCallback(l=>new Date(Math.min(Math.max(l.getTime(),_),j)),[_,j]),Ge=o.useCallback((l,c,m=!1)=>{const[x,R]=Tt.current;if((S.current.mode==="point"?l===x:l===x&&c===R)&&Dr.current.timerId===null)return;const z=re(l),A=re(c),q=()=>{const D=S.current;D.mode==="point"?D.onChangePoint?.(z):D.mode==="range"&&D.onChangeRange?.(z,A)};Pt(Dr.current,q,m)},[re,Pt]),Nt=o.useCallback((l,c,m=!1)=>{if(S.current.mode!=="vernier")return;const x=Ct(l),R=Ct(c);Pt(yr.current,()=>{const F=S.current;F.mode==="vernier"&&F.onChangeMacroRange?.(x,R)},m)},[Ct,Pt]),Be=o.useCallback((l,c,m=!1)=>{const x=S.current;if(x.mode!=="vernier")return;const R=Ct(l),F=Ct(c);x.microRange===void 0&&ne([R,F]),Pt(Tr.current,()=>{const z=S.current;z.mode==="vernier"&&z.onChangeMicroRange?.(R,F)},m)},[Ct,Pt]),ar=o.useCallback(l=>{if($&&s==="time"&&b.length>1){const x=Math.max(0,Math.min(b.length-1,Math.round(l))),R=b[0].getTime(),z=b[b.length-1].getTime()-R;if(z<=0)return 0;const A=b[x].getTime();return Math.max(0,Math.min(100,(A-R)/z*100))}const c=O-N;if(c<=0)return 0;const m=(l-N)/c*100;return Math.max(0,Math.min(100,m))},[$,s,b,N,O]),or=o.useCallback(l=>{const c=Math.max(0,Math.min(100,l));if($){if(s==="time"&&b.length>1){const R=b[0].getTime(),z=b[b.length-1].getTime()-R,A=R+c/100*z;return ve(b,new Date(A),t)}const x=Math.round(c/100*(b.length-1));return Math.max(0,Math.min(b.length-1,x))}const m=N+c/100*(O-N);return Math.round(m)},[$,s,b,N,O,t]),rt=o.useRef(null),[Br,zr]=o.useState(0),[An,Mt]=sn(),[En,ir]=sn();o.useEffect(()=>{const l=rt.current;if(!l)return;const c=()=>{const m=l.getBoundingClientRect(),x=u?m.height:m.width;x>0&&zr(R=>Math.abs(R-x)<.5?R:x)};if(c(),typeof ResizeObserver<"u"){const m=new ResizeObserver(x=>{for(const R of x){const F=u?R.contentRect.height:R.contentRect.width;F>0&&zr(z=>Math.abs(z-F)<.5?z:F)}});return m.observe(l),()=>m.disconnect()}return window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[u]);const vt=o.useCallback((l,c,m)=>{const x=u?m.height:m.width;if(!(Number.isFinite(x)&&x>0))return null;const R=u?m.bottom-c:l-m.left;return Number.isFinite(R)?Math.max(0,Math.min(1,R/x)):null},[u]),_r=o.useCallback((l,c)=>{const m=rt.current;if(!m)return null;const x=vt(l,c,m.getBoundingClientRect());return x===null?null:x*100},[vt]),lr=o.useRef(null),Sr=o.useRef(null),Je=o.useRef(null),Lr=o.useRef(null),zt=o.useRef(null),qr=o.useCallback(l=>{if(i)return;if(Q){const D=Sr.current;if(!D||l.pointerId!==0&&l.pointerId!==D.pointerId||!rt.current)return;const se=vt(l.clientX,l.clientY,rt.current.getBoundingClientRect());if(se===null)return;if(D.handle==="macro-low"||D.handle==="macro-high"||D.handle==="macro-connect"){const[ze,ct,Le]=Sn(D.handle,se,D.startPointerRatio,D.startMacroLowRatio,D.startMacroHighRatio);Le!==wt.current&&(wt.current=Le,rr(Le),nr(Le));let ce,_e;if(kt){const dt=gr(Me,I,s,ze),mt=Math.max(dt,gr(Me,I,s,ct));ce=Me[dt],_e=Me[mt]}else{const dt=Math.round(Ae+ze*Ut),mt=Math.round(Ae+ct*Ut);ce=oe(I,dt),_e=oe(I,mt)}const _t=`${ce.getTime()}_${_e.getTime()}`;_t!==Lr.current&&(Lr.current=_t,Nt(ce,_e));let nt,ut;if(D.handle==="macro-connect"){const dt=qe(M,ce),mt=at(I,M,_e);let It,jt;if(I==="year"){const ft=ce.getFullYear()-D.startMacroLowDate.getFullYear();It=Ne("year",D.initialMicroLowDate,ft),jt=Ne("year",D.initialMicroHighDate,ft)}else if(I==="month"){const ft=(ce.getFullYear()-D.startMacroLowDate.getFullYear())*12+(ce.getMonth()-D.startMacroLowDate.getMonth());It=Ne("month",D.initialMicroLowDate,ft),jt=Ne("month",D.initialMicroHighDate,ft)}else{const ft=Math.round((ce.getTime()-D.startMacroLowDate.getTime())/864e5);It=Ne("day",D.initialMicroLowDate,ft),jt=Ne("day",D.initialMicroHighDate,ft)}const Ht=dt.getTime(),qt=mt.getTime(),on=D.initialMicroHighDate.getTime()-D.initialMicroLowDate.getTime();let Xt=It.getTime(),Kt=jt.getTime();Xt<Ht&&(Xt=Ht,Kt=Math.min(qt,Xt+on)),Kt>qt&&(Kt=qt,Xt=Math.max(Ht,Kt-on)),nt=qe(M,new Date(Xt)),ut=qe(M,new Date(Kt))}else{const dt=ce.getTime(),mt=at(I,M,_e).getTime(),It=D.initialMicroLowDate.getTime(),jt=D.initialMicroHighDate.getTime(),Ht=Math.max(dt,Math.min(mt,It)),qt=Math.max(Ht,Math.min(mt,jt));nt=qe(M,new Date(Ht)),ut=qe(M,new Date(qt))}const an=`${nt.getTime()}_${ut.getTime()}`;an!==zt.current&&(zt.current=an,Be(nt,ut))}else if(D.handle==="micro-low"||D.handle==="micro-high"||D.handle==="micro-connect"){const[ze,ct,Le]=Ln(D.handle,se,D.startPointerRatio,D.startMicroLowRatio,D.startMicroHighRatio);Le!==wt.current&&(wt.current=Le,rr(Le),nr(Le));let ce,_e;if(Ke){const nt=gr(ae,M,s,ze),ut=Math.max(nt,gr(ae,M,s,ct));ce=ae[nt],_e=ae[ut]}else{const nt=Math.round(ye+ze*Bt),ut=Math.round(ye+ct*Bt);ce=oe(M,nt),_e=oe(M,ut)}const _t=`${ce.getTime()}_${_e.getTime()}`;_t!==zt.current&&(zt.current=_t,Be(ce,_e))}return}const c=lr.current;if(!c||l.pointerId!==0&&l.pointerId!==c.pointerId||!rt.current)return;const m=rt.current.getBoundingClientRect(),x=u?l.clientY:l.clientX,R=u?m.height:m.width;if(!(Number.isFinite(R)&&R>0))return;if(c.handle==="connect"){const D=u?(c.startPointerPos-x)/R:(x-c.startPointerPos)/R,se=xn({posDiffPct:D,startLowVal:c.startLowVal,startHighVal:c.startHighVal,rangeMin:N,rangeMax:O,isDiscrete:$,sortedAllowedDates:b,snapMode:s,unit:t});if(Je.current&&Je.current[0]===se[0]&&Je.current[1]===se[1])return;Je.current=se,me(se),Ge(se[0],se[1],!1);return}const F=vt(l.clientX,l.clientY,m);if(F===null)return;const z=or(F*100),[A,q]=Ir(c.handle,z,c.startLowVal,c.startHighVal,N,O,P);if((!Je.current||Je.current[0]!==A||Je.current[1]!==q)&&(Je.current=[A,q],me([A,q]),Ge(A,q,!1)),!P&&(c.handle==="low"||c.handle==="high")){const D=wn(c.handle,z,c.startLowVal,c.startHighVal,P);Ve.current!==D&&(Ve.current=D,xe(D),le(D))}},[i,Q,u,I,M,kt,Ke,Me,ae,Ae,Ut,ye,Bt,N,O,$,b,s,t,vt,or,Ge,Nt,Be,P]),Xr=o.useCallback(l=>{if(Q){Lr.current=null,zt.current=null,Sr.current=null,wt.current=null,rr(null),Rr(yr.current),Rr(Tr.current);return}const c=lr.current;if(!c||l.pointerId!==0&&l.pointerId!==c.pointerId)return;const m=Je.current??G;m&&(Ge(m[0],m[1],!0),B(m)),Je.current=null,me(null),lr.current=null,Ve.current=null,xe(null)},[Q,G,Ge,Rr]),Kr=o.useRef(qr);Kr.current=qr;const Wr=o.useRef(Xr);Wr.current=Xr;const Gr=L!==null||Pe!==null;o.useEffect(()=>{if(!Gr)return;const l=m=>Kr.current(m),c=m=>Wr.current(m);return window.addEventListener("pointermove",l),window.addEventListener("pointerup",c),window.addEventListener("pointercancel",c),()=>{window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",c)}},[Gr]);const $r=o.useCallback((l,c,m)=>{lr.current={pointerId:l,handle:c,startPointerPos:m,startLowVal:fe,startHighVal:ge},Ve.current=c,xe(c),c!=="connect"&&le(c)},[fe,ge]),Jr=o.useCallback((l,c,m)=>{const x=S.current;x.mode==="vernier"&&(Sr.current={pointerId:l,handle:c,startPointerRatio:m,startMacroLowRatio:Se,startMacroHighRatio:Oe,startMicroLowRatio:We,startMicroHighRatio:xt,startMacroLowEnc:je,startMacroHighEnc:He,startMicroLowEnc:be,startMicroHighEnc:we,startMacroLowDate:x.macroRange[0],startMacroHighDate:x.macroRange[1],initialMicroLowDate:it,initialMicroHighDate:lt},wt.current=c,rr(c),nr(c))},[Se,Oe,We,xt,je,He,be,we,it,lt]),Zr=l=>c=>{if(i)return;c.stopPropagation(),c.preventDefault(),le(l);const m=u?c.clientY:c.clientX;$r(c.pointerId,l,m)},Yt=l=>c=>{if(i)return;c.stopPropagation(),c.preventDefault();const m=rt.current;if(!m)return;const x=vt(c.clientX,c.clientY,m.getBoundingClientRect());x!==null&&Jr(c.pointerId,l,x)},In=l=>{if(i||v)return;l.stopPropagation(),l.preventDefault();const c=u?l.clientY:l.clientX;$r(l.pointerId,"connect",c)},jn=l=>{if(i)return;if(Q){const A=rt.current;if(!A)return;const q=A.getBoundingClientRect(),D=vt(l.clientX,l.clientY,q);if(D===null)return;const se=u?l.clientX-(q.left+q.width/2):l.clientY-(q.top+q.height/2),ze=Rn(D,se,Se,Oe,We,xt,ht,void 0,!v);Jr(l.pointerId,ze,D);return}const c=_r(l.clientX,l.clientY);if(c===null)return;const m=or(c);let x="low";if(!P){const A=Math.abs(m-fe),q=Math.abs(m-ge);A<q?x="low":q<A?x="high":x=m>ge?"high":"low"}le(x);const[R,F]=Ir(x,m,fe,ge,N,O,P);me([R,F]),Ge(R,F,!0);const z=u?l.clientY:l.clientX;$r(l.pointerId,x,z)},Hn=l=>{if(i||L!==null)return;const c=_r(l.clientX,l.clientY);if(c===null)return;const m=or(c);et(m),Zt(ar(m))},On=()=>{et(null),Zt(null)},Qr=l=>c=>{if(i)return;le(l);const m=Mn(c.key,l,fe,ge,N,O,P,1);m&&(c.preventDefault(),de||B(m),Ge(m[0],m[1],!0))},sr=(l,c)=>{const m=Math.max(X(M,l),X(M,r)),x=Math.min(X(M,at(I,M,c)),X(M,n)),R=Math.max(m,Math.min(x,be)),F=Math.max(R,Math.min(x,we));R===be&&F===we||Be(oe(M,R),oe(M,F),!0)},cr=l=>c=>{if(i||!Q||e.mode!=="vernier")return;nr(l);let m=0,x=!1,R=!1;switch(c.key){case"ArrowRight":case"ArrowUp":m=1;break;case"ArrowLeft":case"ArrowDown":m=-1;break;case"PageUp":m=5;break;case"PageDown":m=-5;break;case"Home":x=!0;break;case"End":R=!0;break;default:return}if(c.preventDefault(),l==="macro-low"){const F=oe(I,je),z=oe(I,He);if(kt){const D=hr(Me,I,F,Me[0],z,m,x,R);if(D===ve(Me,F,I))return;const se=Me[D];Nt(se,z,!0),sr(se,z);return}let A;if(x?A=Ae:R?A=He:A=Math.max(Ae,Math.min(He,je+m)),A===je)return;const q=oe(I,A);Nt(q,z,!0),sr(q,z)}else if(l==="macro-high"){const F=oe(I,je),z=oe(I,He);if(kt){const D=hr(Me,I,z,F,Me[Me.length-1],m,x,R);if(D===ve(Me,z,I))return;const se=Me[D];Nt(F,se,!0),sr(F,se);return}let A;if(x?A=je:R?A=$t:A=Math.max(je,Math.min($t,He+m)),A===He)return;const q=oe(I,A);Nt(F,q,!0),sr(F,q)}else if(l==="micro-low"){const F=oe(M,be),z=oe(M,we);if(Ke){const q=hr(ae,M,F,ae[0],z,m,x,R);if(q===ve(ae,F,M))return;Be(ae[q],z,!0);return}let A;if(x?A=ye:R?A=we:A=Math.max(ye,Math.min(we,be+m)),A===be)return;Be(oe(M,A),z,!0)}else if(l==="micro-high"){const F=oe(M,be),z=oe(M,we);if(Ke){const q=hr(ae,M,z,F,ae[ae.length-1],m,x,R);if(q===ve(ae,z,M))return;Be(F,ae[q],!0);return}let A;if(x?A=be:R?A=Ue:A=Math.max(be,Math.min(Ue,we+m)),A===we)return;Be(F,oe(M,A),!0)}},Fn=o.useCallback(l=>{const c=S.current;if(!c.disabled)if(c.mode==="point"){const m=Math.max(N,Math.min(O,fe+l));de||B([m,m]),Ge(m,m,!0)}else if(c.mode==="vernier"){if(Ke){const D=ae.length-1,se=ve(ae,it,M),ze=ve(ae,lt,M),ct=ze-se;let Le=se+l,ce=ze+l;l<0&&Le<0?(Le=0,ce=Math.min(D,ct)):l>0&&ce>D&&(ce=D,Le=Math.max(0,D-ct)),(Le!==se||ce!==ze)&&Be(ae[Le],ae[ce],!0);return}const m=be,x=we,R=ye,F=Ue,z=x-m;let A=m+l,q=x+l;l<0&&A<R?(A=R,q=Math.min(F,A+z)):l>0&&q>F&&(q=F,A=Math.max(R,q-z)),(A!==m||q!==x)&&Be(oe(M,A),oe(M,q),!0)}else{const m=ge-fe;let x=fe+l,R=ge+l;l<0&&x<N?(x=N,R=Math.min(O,x+m)):l>0&&R>O&&(R=O,x=Math.max(N,R-m)),x<=R&&(de||B([x,R]),Ge(x,R,!0))}},[fe,ge,N,O,de,Ge,Be,be,we,ye,Ue,M,Ke,ae,it,lt]),At=ar(fe),Et=ar(ge),kr=re(fe),Pr=re(ge),Cr=o.useMemo(()=>{if(P)return Mt===null?void 0:{estimatedWidthPx:Mt.widthPx,estimatedHeightPx:Mt.heightPx};if(!(Mt===null||ir===null))return{estimatedWidthPx:Math.max(Mt.widthPx,ir.widthPx),estimatedHeightPx:Math.max(Mt.heightPx,ir.heightPx)}},[P,Mt,ir]),Ce=o.useMemo(()=>P||!y||u?yn(k,Cr):Tn(At,Et,Br,k,Cr),[P,y,u,At,Et,Br,k,Cr]),ur=L==="low"||L!=="high"&&Qe==="low",dr=!P&&(L==="high"||L!=="low"&&Qe==="high"),Vn=o.useMemo(()=>u?{"--ps-tooltip-origin":"100% 50%","--ps-tooltip-tx":"0px","--ps-tooltip-ty":"-50%","--ps-tooltip-rot":"0deg"}:{"--ps-tooltip-origin":"50% 50%","--ps-tooltip-tx":`calc(-50% + ${Ce.lowOffsetX}px)`,"--ps-tooltip-ty":`calc(-50% + ${Ce.lowOffsetY}px)`,"--ps-tooltip-rot":`${Ce.lowAngleDeg}deg`},[u,Ce.lowOffsetX,Ce.lowOffsetY,Ce.lowAngleDeg]),Un=o.useMemo(()=>u?{"--ps-tooltip-origin":"100% 50%","--ps-tooltip-tx":"0px","--ps-tooltip-ty":"-50%","--ps-tooltip-rot":"0deg"}:{"--ps-tooltip-origin":"50% 50%","--ps-tooltip-tx":`calc(-50% + ${Ce.highOffsetX}px)`,"--ps-tooltip-ty":`calc(-50% + ${Ce.highOffsetY}px)`,"--ps-tooltip-rot":`${Ce.highAngleDeg}deg`},[u,Ce.highOffsetX,Ce.highOffsetY,Ce.highAngleDeg]),mr=Math.min(At,Et),en=Math.max(At,Et),Bn=u?{bottom:`${mr}%`,height:`${en-mr}%`,top:"auto",left:"0",right:"0"}:{left:`${mr}%`,width:`${en-mr}%`,top:"0",bottom:"0"},zn=Math.max(.01,Oe-Se),tn=Math.max(.06,Math.min(.25,.28*Math.sqrt(zn))),_n=u?{bottom:`${At}%`,left:"50%",transform:"translate(-50%, 50%)",zIndex:ur?40:30}:{left:`${At}%`,top:"50%",transform:"translate(-50%, -50%)",zIndex:ur?40:30},qn=u?{bottom:`${Et}%`,left:"50%",transform:"translate(-50%, 50%)",zIndex:dr?40:30}:{left:`${Et}%`,top:"50%",transform:"translate(-50%, -50%)",zIndex:dr?40:30},Xn=u?{bottom:`${Vt}%`,left:"50%",transform:"translate(-50%, 50%)"}:{left:`${Vt}%`,top:"50%",transform:"translate(-50%, -50%)"},rn=De!==null?re(De):null,Kn=Ke?X(M,ae[0]):ye,Wn=Ke?X(M,ae[ae.length-1]):Ue,Gn=i||(Q?be<=Kn:P?fe<=N:fe<=N&&ge<=N),Jn=i||(Q?we>=Wn:(P||fe>=O)&&ge>=O),st=i?"cursor-not-allowed opacity-50":"cursor-pointer",nn=l=>{const c=u?"vertical":"horizontal",m=l==="decrease",x=ca[c][l];return f.jsx("button",{type:"button",className:`period-slider-stepper-btn relative after:absolute after:inset-[-11px] after:content-[''] ${x} flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-slate-300 bg-white font-bold text-[10px] text-slate-700 leading-none shadow-2xs transition-all hover:bg-slate-100 hover:text-indigo-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 active:scale-95 disabled:cursor-not-allowed disabled:opacity-30 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 ${st}`,onClick:()=>Fn(m?-1:1),disabled:m?Gn:Jn,"aria-label":m?J:E,children:sa[c][l]})};return f.jsxs("div",{style:e.style,className:`period-slider flex select-none items-center gap-2 ${u?"flex-col":"flex-row"} ${d}`,"data-disabled":i?"true":void 0,"data-unit":t,"data-mode":e.mode,"data-orientation":u?"vertical":"horizontal","data-label-position":k,"data-color-scheme":ee,children:[w&&nn(u?"increase":"decrease"),f.jsx("div",{ref:rt,"data-testid":"period-slider-track","data-orientation":u?"vertical":"horizontal","data-vernier-orientation":Q?ht:void 0,className:`period-slider-track relative flex-1 touch-none rounded-full bg-slate-200 dark:bg-slate-700 ${u?"h-48 w-2":"h-2 w-full"} ${st}`,onPointerDown:jn,onPointerMove:Hn,onPointerLeave:On,children:Q?f.jsxs(f.Fragment,{children:[Qt&&(u?f.jsxs("svg",{className:"period-slider-vernier-projection is-vertical",role:"presentation","aria-hidden":"true",width:"32",height:"100%",viewBox:"0 0 32 100",preserveAspectRatio:"none",children:[f.jsx("defs",{children:f.jsxs("linearGradient",{id:U,x1:"0",y1:"0",x2:"1",y2:"0",children:[f.jsx("stop",{offset:"0%",stopColor:T?Y.macro:Y.micro,stopOpacity:"0.28"}),f.jsx("stop",{offset:"100%",stopColor:T?Y.micro:Y.macro,stopOpacity:tn})]})}),f.jsx("polygon",{points:T?`12,${(1-Oe)*100} 12,${(1-Se)*100} 20,100 20,0`:`12,0 12,100 20,${(1-Se)*100} 20,${(1-Oe)*100}`,fill:`url(#${U})`})]}):f.jsxs("svg",{className:"period-slider-vernier-projection",role:"presentation","aria-hidden":"true",width:"100%",height:"32",viewBox:"0 0 100 32",preserveAspectRatio:"none",children:[f.jsx("defs",{children:f.jsxs("linearGradient",{id:U,x1:"0",y1:"0",x2:"0",y2:"1",children:[f.jsx("stop",{offset:"0%",stopColor:T?Y.macro:Y.micro,stopOpacity:"0.28"}),f.jsx("stop",{offset:"100%",stopColor:T?Y.micro:Y.macro,stopOpacity:tn})]})}),f.jsx("polygon",{points:T?`${Se*100},12 ${Oe*100},12 100,20 0,20`:`0,12 100,12 ${Oe*100},20 ${Se*100},20`,fill:`url(#${U})`})]})),!v&&f.jsxs(f.Fragment,{children:[f.jsx("div",{"data-testid":"period-slider-connect-macro",className:"period-slider-connect-macro",style:u?{bottom:`calc(${Se*100}% - 8px)`,height:`calc(${Math.max(0,(Oe-Se)*100)}% + 16px)`}:{left:`calc(${Se*100}% - 8px)`,width:`calc(${Math.max(0,(Oe-Se)*100)}% + 16px)`},onPointerDown:Yt("macro-connect")}),f.jsx("div",{"data-testid":"period-slider-connect-micro",className:"period-slider-connect-micro",style:u?{bottom:`calc(${We*100}% - 8px)`,height:`calc(${Math.max(0,(xt-We)*100)}% + 16px)`}:{left:`calc(${We*100}% - 8px)`,width:`calc(${Math.max(0,(xt-We)*100)}% + 16px)`},onPointerDown:Yt("micro-connect")})]}),er&&f.jsxs("div",{className:"period-slider-vernier-ticks pointer-events-none absolute inset-0",children:[[.2,.4,.6,.8].map(l=>f.jsx("div",{"data-testid":"period-slider-tick","data-tick-scale":"macro",className:"period-slider-tick period-slider-tick-macro",style:u?{bottom:`${l*100}%`}:{left:`${l*100}%`}},`macro-tick-${l}`)),[.1,.2,.3,.4,.5,.6,.7,.8,.9].map(l=>f.jsx("div",{"data-testid":"period-slider-tick","data-tick-scale":"micro",className:"period-slider-tick period-slider-tick-micro",style:u?{bottom:`${l*100}%`}:{left:`${l*100}%`}},`micro-tick-${l}`))]}),f.jsxs("div",{tabIndex:i?-1:0,role:"slider","aria-label":e.macroLowerAriaLabel??"Macro range start","aria-disabled":i?"true":void 0,"aria-valuemin":Ae,"aria-valuemax":He,"aria-valuenow":je,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(e.macroRange[0],I):pt(I,e.macroRange[0],h,p),"aria-orientation":u?"vertical":"horizontal",className:`period-slider-handle period-slider-handle-vernier ${u?"is-vertical":""} group absolute touch-none ${u?T?"after:absolute after:-inset-y-3 after:right-0 after:-left-4":"after:absolute after:-inset-y-3 after:-right-4 after:left-0":T?"after:absolute after:-inset-x-3 after:-top-4 after:bottom-0":"after:absolute after:-inset-x-3 after:top-0 after:-bottom-4"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${st}`,style:u?{bottom:`${Se*100}%`,left:T?0:"auto",right:T?"auto":0,transform:T?"translate(-100%, 50%)":"translate(100%, 50%)",zIndex:Pe==="macro-low"||Ie==="macro-low"?30:15}:{left:`${Se*100}%`,top:T?0:"auto",bottom:T?"auto":0,transform:T?"translate(-50%, -100%)":"translate(-50%, 100%)",zIndex:Pe==="macro-low"||Ie==="macro-low"?30:15},onPointerDown:Yt("macro-low"),onKeyDown:cr("macro-low"),"data-active":Pe==="macro-low"?"true":void 0,"data-front":Ie==="macro-low"?"true":void 0,"data-vernier-pos":u?T?"left":"right":T?"top":"bottom","data-handle-type":"macro-low",children:[f.jsx(Wt,{type:"macro",isTop:T,isVertical:u,isLeft:T}),Rt&&f.jsx("div",{className:"period-slider-hairline"}),g!=="hover"&&f.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${g==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":g,children:Ee(I,e.macroRange[0],h,p)})]}),f.jsxs("div",{tabIndex:i?-1:0,role:"slider","aria-label":e.macroUpperAriaLabel??"Macro range end","aria-disabled":i?"true":void 0,"aria-valuemin":je,"aria-valuemax":$t,"aria-valuenow":He,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(e.macroRange[1],I):pt(I,e.macroRange[1],h,p),"aria-orientation":u?"vertical":"horizontal",className:`period-slider-handle period-slider-handle-vernier ${u?"is-vertical":""} group absolute touch-none ${u?T?"after:absolute after:-inset-y-3 after:right-0 after:-left-4":"after:absolute after:-inset-y-3 after:-right-4 after:left-0":T?"after:absolute after:-inset-x-3 after:-top-4 after:bottom-0":"after:absolute after:-inset-x-3 after:top-0 after:-bottom-4"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${st}`,style:u?{bottom:`${Oe*100}%`,left:T?0:"auto",right:T?"auto":0,transform:T?"translate(-100%, 50%)":"translate(100%, 50%)",zIndex:Pe==="macro-high"||Ie==="macro-high"?30:15}:{left:`${Oe*100}%`,top:T?0:"auto",bottom:T?"auto":0,transform:T?"translate(-50%, -100%)":"translate(-50%, 100%)",zIndex:Pe==="macro-high"||Ie==="macro-high"?30:15},onPointerDown:Yt("macro-high"),onKeyDown:cr("macro-high"),"data-active":Pe==="macro-high"?"true":void 0,"data-front":Ie==="macro-high"?"true":void 0,"data-vernier-pos":u?T?"left":"right":T?"top":"bottom","data-handle-type":"macro-high",children:[f.jsx(Wt,{type:"macro",isTop:T,isVertical:u,isLeft:T}),Rt&&f.jsx("div",{className:"period-slider-hairline"}),g!=="hover"&&f.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${g==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":g,children:Ee(I,e.macroRange[1],h,p)})]}),f.jsxs("div",{tabIndex:i?-1:0,role:"slider","aria-label":e.lowerAriaLabel??"Micro range start","aria-disabled":i?"true":void 0,"aria-valuemin":ye,"aria-valuemax":we,"aria-valuenow":be,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(it,M):pt(M,it,C,p),"aria-orientation":u?"vertical":"horizontal",className:`period-slider-handle period-slider-handle-vernier ${u?"is-vertical":""} group absolute touch-none ${u?T?"after:absolute after:-inset-y-3 after:-right-4 after:left-0":"after:absolute after:-inset-y-3 after:right-0 after:-left-4":T?"after:absolute after:-inset-x-3 after:top-0 after:-bottom-4":"after:absolute after:-inset-x-3 after:-top-4 after:bottom-0"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${st}`,style:u?{bottom:`${We*100}%`,left:T?"auto":0,right:T?0:"auto",transform:T?"translate(100%, 50%)":"translate(-100%, 50%)",zIndex:Pe==="micro-low"||Ie==="micro-low"?30:20}:{left:`${We*100}%`,top:T?"auto":0,bottom:T?0:"auto",transform:T?"translate(-50%, 100%)":"translate(-50%, -100%)",zIndex:Pe==="micro-low"||Ie==="micro-low"?30:20},onPointerDown:Yt("micro-low"),onKeyDown:cr("micro-low"),"data-active":Pe==="micro-low"?"true":void 0,"data-front":Ie==="micro-low"?"true":void 0,"data-vernier-pos":u?T?"right":"left":T?"bottom":"top","data-handle-type":"micro-low",children:[f.jsx(Wt,{type:"micro",isTop:!T,isVertical:u,isLeft:!T}),Rt&&f.jsx("div",{className:"period-slider-hairline"}),g!=="hover"&&f.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${g==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":g,children:Ee(M,it,C,p)})]}),f.jsxs("div",{tabIndex:i?-1:0,role:"slider","aria-label":e.upperAriaLabel??"Micro range end","aria-disabled":i?"true":void 0,"aria-valuemin":be,"aria-valuemax":Ue,"aria-valuenow":we,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(lt,M):pt(M,lt,C,p),"aria-orientation":u?"vertical":"horizontal",className:`period-slider-handle period-slider-handle-vernier ${u?"is-vertical":""} group absolute touch-none ${u?T?"after:absolute after:-inset-y-3 after:-right-4 after:left-0":"after:absolute after:-inset-y-3 after:right-0 after:-left-4":T?"after:absolute after:-inset-x-3 after:top-0 after:-bottom-4":"after:absolute after:-inset-x-3 after:-top-4 after:bottom-0"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${st}`,style:u?{bottom:`${xt*100}%`,left:T?"auto":0,right:T?0:"auto",transform:T?"translate(100%, 50%)":"translate(-100%, 50%)",zIndex:Pe==="micro-high"||Ie==="micro-high"?30:20}:{left:`${xt*100}%`,top:T?"auto":0,bottom:T?0:"auto",transform:T?"translate(-50%, 100%)":"translate(-50%, -100%)",zIndex:Pe==="micro-high"||Ie==="micro-high"?30:20},onPointerDown:Yt("micro-high"),onKeyDown:cr("micro-high"),"data-active":Pe==="micro-high"?"true":void 0,"data-front":Ie==="micro-high"?"true":void 0,"data-vernier-pos":u?T?"right":"left":T?"bottom":"top","data-handle-type":"micro-high",children:[f.jsx(Wt,{type:"micro",isTop:!T,isVertical:u,isLeft:!T}),Rt&&f.jsx("div",{className:"period-slider-hairline"}),g!=="hover"&&f.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${g==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":g,children:Ee(M,lt,C,p)})]})]}):f.jsxs(f.Fragment,{children:[!v&&f.jsx("div",{"data-testid":"period-slider-connect",className:"period-slider-connect absolute rounded-full",style:Bn,onPointerDown:In}),V&&$&&b.length>1&&f.jsx("div",{className:"period-slider-ticks pointer-events-none absolute inset-0",children:b.map((l,c)=>{const m=X(t,l),x=ar(c),R=u?{bottom:`${x}%`,left:"50%",transform:"translate(-50%, 50%)"}:{left:`${x}%`,top:"50%",transform:"translate(-50%, -50%)"};return f.jsx("div",{"data-testid":"period-slider-tick",className:"period-slider-tick absolute h-1.5 w-1.5 rounded-full bg-slate-400/60 dark:bg-slate-500/60",style:R},`tick-${m}`)})}),!i&&De!==null&&Vt!==null&&L===null&&rn&&f.jsxs("div",{"data-testid":"period-slider-hover-guide",className:"period-slider-hover-guide pointer-events-none absolute z-20 h-2 w-2",style:Xn,children:[f.jsx("div",{"data-testid":"period-slider-hover-dot",className:"period-slider-hover-dot h-full w-full rounded-full border border-white/80 bg-[var(--aqps-accent-light)] shadow-[0_0_6px_var(--aqps-accent-glow)] dark:border-slate-800"}),f.jsx("div",{className:`period-slider-hover-tooltip ${k==="bottom"&&!u?"period-slider-hover-tooltip-bottom":""} rounded bg-slate-800/90 px-2 py-0.5 font-medium text-white text-xs shadow-lg backdrop-blur-xs dark:bg-slate-900/90`,children:Ee(t,rn,e.formatLabel,p)})]}),f.jsxs("div",{tabIndex:i?-1:0,role:"slider","aria-label":P?e.pointAriaLabel??"Selected date":e.lowerAriaLabel??"Range start","aria-disabled":i?"true":void 0,"aria-valuemin":N,"aria-valuemax":P?O:ge,"aria-valuenow":fe,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(kr,t):pt(t,kr,e.formatLabel,p),"aria-orientation":u?"vertical":"horizontal",className:`period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:outline-none ${st}`,style:_n,onPointerDown:Zr("low"),onKeyDown:Qr("low"),"data-active":L==="low"?"true":void 0,"data-front":ur?"true":void 0,children:[f.jsx("div",{"data-testid":"period-slider-knob",className:`period-slider-knob h-full w-full rounded-full border-2 border-white bg-[var(--aqps-accent-color)] group-focus-visible:ring-2 group-focus-visible:ring-blue-600 group-focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-[var(--aqps-accent-light)] ${L==="low"?"":"shadow-md"}`}),g!=="hover"&&f.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${g==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":g,"data-label-position":k,"data-slanted":Ce.isSlanted?"true":void 0,"data-front":ur?"true":void 0,ref:An,style:Vn,children:Ee(t,kr,e.formatLabel,p)})]}),!P&&f.jsxs("div",{tabIndex:i?-1:0,role:"slider","aria-label":e.upperAriaLabel??"Range end","aria-disabled":i?"true":void 0,"aria-valuemin":fe,"aria-valuemax":O,"aria-valuenow":ge,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(Pr,t):pt(t,Pr,e.formatLabel,p),"aria-orientation":u?"vertical":"horizontal",className:`period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:outline-none ${st}`,style:qn,onPointerDown:Zr("high"),onKeyDown:Qr("high"),"data-active":L==="high"?"true":void 0,"data-front":dr?"true":void 0,children:[f.jsx("div",{"data-testid":"period-slider-knob",className:`period-slider-knob h-full w-full rounded-full border-2 border-white bg-[var(--aqps-accent-color)] group-focus-visible:ring-2 group-focus-visible:ring-blue-600 group-focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-[var(--aqps-accent-light)] ${L==="high"?"":"shadow-md"}`}),g!=="hover"&&f.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${g==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":g,"data-label-position":k,"data-slanted":Ce.isSlanted?"true":void 0,"data-front":dr?"true":void 0,ref:En,style:Un,children:Ee(t,Pr,e.formatLabel,p)})]})]})}),w&&nn(u?"decrease":"increase")]})},Ar=(e,t)=>{if(e===t)return!0;if(!(e&&t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r].getTime()!==t[r].getTime())return!1;return!0},$n=(e,t)=>{if(e===t)return!0;if(!(e&&t))return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const a of r)if(e[a]!==t[a])return!1;return!0},da=(e,t)=>e===t?!0:e.mode!==t.mode||e.unit!==t.unit||e.minDate.getTime()!==t.minDate.getTime()||e.maxDate.getTime()!==t.maxDate.getTime()||e.labelPosition!==t.labelPosition||e.autoSlantLabels!==t.autoSlantLabels||e.isVertical!==t.isVertical||e.hideConnectBar!==t.hideConnectBar||e.showTicks!==t.showTicks||e.disabled!==t.disabled||e.showStepper!==t.showStepper||e.debounceMs!==t.debounceMs||e.tooltipStyle!==t.tooltipStyle||e.colorScheme!==t.colorScheme||e.className!==t.className||!$n(e.style,t.style)||e.snapMode!==t.snapMode||e.formatLabel!==t.formatLabel||e.locale!==t.locale||e.lowerAriaLabel!==t.lowerAriaLabel||e.upperAriaLabel!==t.upperAriaLabel||e.pointAriaLabel!==t.pointAriaLabel||e.macroLowerAriaLabel!==t.macroLowerAriaLabel||e.macroUpperAriaLabel!==t.macroUpperAriaLabel||e.decreaseAriaLabel!==t.decreaseAriaLabel||e.increaseAriaLabel!==t.increaseAriaLabel||e.formatAriaValueText!==t.formatAriaValueText||!Ar(e.allowedDates,t.allowedDates)?!1:e.mode==="point"&&t.mode==="point"?!((e.value?.getTime()??null)!==(t.value?.getTime()??null)||(e.defaultValue?.getTime()??null)!==(t.defaultValue?.getTime()??null)||e.onChangePoint!==t.onChangePoint):e.mode==="range"&&t.mode==="range"?!((e.range?.[0]?.getTime()??null)!==(t.range?.[0]?.getTime()??null)||(e.range?.[1]?.getTime()??null)!==(t.range?.[1]?.getTime()??null)||(e.defaultRange?.[0]?.getTime()??null)!==(t.defaultRange?.[0]?.getTime()??null)||(e.defaultRange?.[1]?.getTime()??null)!==(t.defaultRange?.[1]?.getTime()??null)||e.onChangeRange!==t.onChangeRange):e.mode==="vernier"&&t.mode==="vernier"?!((e.microRange?.[0]?.getTime()??null)!==(t.microRange?.[0]?.getTime()??null)||(e.microRange?.[1]?.getTime()??null)!==(t.microRange?.[1]?.getTime()??null)||(e.defaultMicroRange?.[0]?.getTime()??null)!==(t.defaultMicroRange?.[0]?.getTime()??null)||(e.defaultMicroRange?.[1]?.getTime()??null)!==(t.defaultMicroRange?.[1]?.getTime()??null)||e.macroRange[0].getTime()!==t.macroRange[0].getTime()||e.macroRange[1].getTime()!==t.macroRange[1].getTime()||e.vernierOrientation!==t.vernierOrientation||e.showVernierProjection!==t.showVernierProjection||e.showVernierTicks!==t.showVernierTicks||e.showHairline!==t.showHairline||e.macroUnit!==t.macroUnit||e.microUnit!==t.microUnit||e.macroIsDiscrete!==t.macroIsDiscrete||e.microIsDiscrete!==t.microIsDiscrete||e.formatMacroLabel!==t.formatMacroLabel||e.formatMicroLabel!==t.formatMicroLabel||e.onChangeMicroRange!==t.onChangeMicroRange||e.onChangeMacroRange!==t.onChangeMacroRange||!Ar(e.macroAllowedDates,t.macroAllowedDates)||!Ar(e.microAllowedDates,t.microAllowedDates)):!1,kn=o.memo(ua,da);kn.displayName="PeriodSlider";const Ze=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t},Gt=(e,t)=>{if(Number.isNaN(t.getTime()))throw new RangeError(`DateSelector: "${e}" must be a valid Date (received ${String(t)})`)},ma=e=>{if(e!==void 0)try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{throw new RangeError(`DateSelector: "locale" must be a valid BCP 47 language tag (received ${JSON.stringify(e)})`)}},yt=(e,t,r)=>{const n=new Date(e,t-1,r);return n.setFullYear(e),n.setHours(0,0,0,0),n},cn=e=>yt(e,1,1),fa=e=>yt(e,12,31),ga={year:{year:"numeric"},month:{month:"2-digit"},day:{day:"2-digit"}},ha={year:4,month:2,day:2},ba={year:e=>e.getFullYear(),month:e=>e.getMonth()+1,day:e=>e.getDate()},un=new Map,wa=(e,t)=>{const r=`${e}\0${t}`,n=un.get(r);if(n!==void 0)return n;const a=new Intl.DateTimeFormat(t,ga[e]);return un.set(r,a),a},Er=(e,t,r)=>r===void 0?String(ba[e](t)).padStart(ha[e],"0"):wa(e,r).format(t),xa=(e,t,r)=>{const n=t?.getTime()??null,a=r?.getTime()??null,s=new Map;return e.forEach((i,d)=>{Gt(`allowedDates[${d}]`,i);const w=Ze(i),g=w.getTime();n!==null&&g<n||a!==null&&g>a||s.has(g)||s.set(g,w)}),Array.from(s.keys()).sort((i,d)=>i-d).map(i=>s.get(i))},Ma=(e,t)=>{const r=[];let n=Ze(e);const a=Ze(t).getTime();for(;n.getTime()<=a;)r.push(n),n=Te.addDays(n,1);return r},dn=(e,t)=>{const r=[];for(let n=e.length-1;n>=0;n--)r.push({label:Ee("day",e[n],void 0,t),value:Te.format(e[n],"yyyy-MM-dd")});return r},va=e=>{const{value:t,initialDate:r,onChange:n,children:a,minYear:s,maxYear:i,minDate:d,maxDate:w,allowedDates:g,variant:k="date",className:y="",style:u,disabled:v=!1,prevDateAriaLabel:V="Previous day",nextDateAriaLabel:ee="Next day",selectAriaLabel:p="Date",yearAriaLabel:J="Year",monthAriaLabel:E="Month",dayAriaLabel:te="Day",locale:Y,formatYearOption:U,formatMonthOption:S,formatDayOption:_}=e;if(ma(Y),t!==void 0&&Gt("value",t),r!==void 0&&Gt("initialDate",r),d!==void 0&&Gt("minDate",d),w!==void 0&&Gt("maxDate",w),s!==void 0&&!Number.isInteger(s))throw new RangeError(`DateSelector: "minYear" must be an integer year (received ${String(s)})`);if(i!==void 0&&!Number.isInteger(i))throw new RangeError(`DateSelector: "maxYear" must be an integer year (received ${String(i)})`);if(k==="split-dropdown"&&g!==void 0)throw new RangeError('DateSelector: variant="split-dropdown" cannot honour "allowedDates"; use variant="dropdown" or variant="date" for a discrete date set');const j=t??r;if(j===void 0)throw new RangeError("DateSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected date is never inferred from the wall clock.");const[b,$]=o.useState(()=>Ze(j)),N=t!==void 0,O=t?.getTime(),P=o.useMemo(()=>t!==void 0?Ze(t):b,[O,b]),re=d?.getTime(),pe=w?.getTime(),Z=o.useMemo(()=>{const h=d?Ze(d):null,C=s!==void 0?cn(s):null;return h===null?C:C===null||h.getTime()>=C.getTime()?h:C},[re,s]),ne=o.useMemo(()=>{const h=w?Ze(w):null,C=i!==void 0?fa(i):null;return h===null?C:C===null||h.getTime()<=C.getTime()?h:C},[pe,i]),ie=Z?.getTime()??null,ue=ne?.getTime()??null;if(Z!==null&&ne!==null&&Z.getTime()>ne.getTime())throw new RangeError(`DateSelector: the resolved range is empty (min ${Te.format(Z,"yyyy-MM-dd")} is after max ${Te.format(ne,"yyyy-MM-dd")})`);if(k!=="date"&&g===void 0&&(Z===null||ne===null))throw new RangeError(`DateSelector: variant="${k}" needs a bounded range; supply minDate/minYear and maxDate/maxYear${k==="dropdown"?' or supply "allowedDates"':""}`);const W=g===void 0?null:g.map(h=>h.getTime()).join(","),K=o.useMemo(()=>g===void 0?null:xa(g,Z,ne),[W,ie,ue]),$e=h=>{const C=h.getTime();return K!==null?K.some(ke=>ke.getTime()===C):!(ie!==null&&C<ie||ue!==null&&C>ue)},gt=j.getTime();o.useEffect(()=>{N||$(Ze(j))},[N,gt]);const Ye=h=>{if(v)return;const C=Ze(h);$e(C)&&(N||$(C),n?.(C))},Re=P.getTime(),de=$e(P),H=o.useMemo(()=>{if(K!==null){for(let C=K.length-1;C>=0;C--)if(K[C].getTime()<Re)return K[C];return null}const h=Te.addDays(new Date(Re),-1);return $e(h)?h:null},[K,Re,ie,ue]),B=o.useMemo(()=>{if(K!==null){for(const C of K)if(C.getTime()>Re)return C;return null}const h=Te.addDays(new Date(Re),1);return $e(h)?h:null},[K,Re,ie,ue]),G=v||H===null,me=v||B===null,L=()=>{H!==null&&Ye(H)},xe=()=>{B!==null&&Ye(B)},Ve=h=>{if(h.target.value){const C=Te.parseISO(h.target.value);Number.isNaN(C.getTime())||Ye(C)}},Qe=h=>{if(h.target.value){const C=Te.parseISO(h.target.value);Number.isNaN(C.getTime())||Ye(C)}},le=P.getFullYear(),De=P.getMonth()+1,et=P.getDate(),Vt=o.useMemo(()=>k!=="dropdown"?[]:K!==null?dn(K,Y):Z===null||ne===null?[]:dn(Ma(Z,ne),Y),[k,K,ie,ue,Y]),Zt=o.useMemo(()=>{if(k!=="split-dropdown"||Z===null||ne===null)return[];const h=[];for(let C=ne.getFullYear();C>=Z.getFullYear();C--)h.push(C);return h},[k,ie,ue]),fe=o.useMemo(()=>{if(k!=="split-dropdown"||Z===null||ne===null)return[];const h=Z,C=ne,ke=le===h.getFullYear()?h.getMonth()+1:1,Lt=le===C.getFullYear()?C.getMonth()+1:12,bt=[];for(let tt=ke;tt<=Lt;tt++)bt.push(tt);return bt},[k,ie,ue,le]),ge=o.useMemo(()=>{if(k!=="split-dropdown"||Z===null||ne===null)return[];const h=Z,C=ne,ke=le===h.getFullYear()&&De===h.getMonth()+1?h.getDate():1,Lt=le===C.getFullYear()&&De===C.getMonth()+1?C.getDate():Te.getDaysInMonth(new Date(Re)),bt=[];for(let tt=ke;tt<=Lt;tt++)bt.push(tt);return bt},[k,ie,ue,Re,le,De]),Tt=(h,C,ke)=>ke>Te.getDaysInMonth(yt(h,C,1))?!1:$e(yt(h,C,ke)),Q=(h,C,ke)=>{Tt(h,C,ke)&&Ye(yt(h,C,ke))},ht=h=>U?U(h):Er("year",cn(h),Y),T=h=>S?S(h):Er("month",yt(le,h,1),Y),Qt=h=>_?_(h):Er("day",yt(le,De,h),Y),er=Te.format(P,"yyyy-MM-dd"),Rt=Ee("day",P,void 0,Y),I=Z?Te.format(Z,"yyyy-MM-dd"):void 0,M=ne?Te.format(ne,"yyyy-MM-dd"):void 0,vr=de?er:"",St="text-center font-mono text-gray-500 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-400",tr=k==="split-dropdown"?"w-auto":"w-38";return f.jsxs("div",{className:`inline-flex items-center ${tr} ${y}`,style:u,"data-variant":k,"data-out-of-range":de?void 0:"true",children:[f.jsx("button",{type:"button","aria-label":V,disabled:G,className:"relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",onClick:L,children:f.jsx("span",{className:"h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200"})}),k==="dropdown"?f.jsxs("select",{"aria-label":p,disabled:v,className:"mx-1 my-auto w-28 appearance-none rounded-md border border-gray-300 bg-gray-100 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums [text-align-last:center] [text-align:center] focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500",value:vr,onChange:Qe,children:[de?null:f.jsx("option",{value:"",disabled:!0,className:St,children:Rt}),Vt.map(h=>f.jsx("option",{value:h.value,className:"text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100",children:h.label},h.value))]}):k==="split-dropdown"?f.jsxs("div",{className:"mx-1 my-auto inline-flex items-center gap-1",children:[f.jsxs("select",{"aria-label":J,disabled:v,className:"rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",value:de?le:"",onChange:h=>Q(Number(h.target.value),De,et),children:[de?null:f.jsx("option",{value:"",disabled:!0,className:St,children:ht(le)}),Zt.map(h=>f.jsx("option",{value:h,disabled:!Tt(h,De,et),className:"dark:bg-slate-700 dark:text-slate-100",children:ht(h)},h))]}),f.jsxs("select",{"aria-label":E,disabled:v,className:"rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",value:de?De:"",onChange:h=>Q(le,Number(h.target.value),et),children:[de?null:f.jsx("option",{value:"",disabled:!0,className:St,children:T(De)}),fe.map(h=>f.jsx("option",{value:h,disabled:!Tt(le,h,et),className:"dark:bg-slate-700 dark:text-slate-100",children:T(h)},h))]}),f.jsxs("select",{"aria-label":te,disabled:v,className:"rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",value:de?et:"",onChange:h=>Q(le,De,Number(h.target.value)),children:[de?null:f.jsx("option",{value:"",disabled:!0,className:St,children:Qt(et)}),ge.map(h=>f.jsx("option",{value:h,className:"dark:bg-slate-700 dark:text-slate-100",children:Qt(h)},h))]})]}):f.jsx("input",{"aria-label":p,disabled:v,className:"mx-1 my-auto w-28 rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-gray-900 text-xs focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500 dark:placeholder:text-gray-400",value:er,min:I,max:M,onChange:Ve,type:"date"}),f.jsx("button",{type:"button","aria-label":ee,disabled:me,className:"relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",onClick:xe,children:f.jsx("span",{className:"h-0 w-0 border-y-[6px] border-y-transparent border-l-[6px] border-l-slate-500 border-solid hover:border-l-slate-700 dark:border-l-slate-400 dark:hover:border-l-slate-200"})}),a]})},Ot=e=>e===void 0?null:Ze(e).getTime(),Pn=o.memo(va,(e,t)=>!(Ot(e.value??e.initialDate)!==Ot(t.value??t.initialDate)||Ot(e.minDate)!==Ot(t.minDate)||Ot(e.maxDate)!==Ot(t.maxDate)||e.variant!==t.variant||e.disabled!==t.disabled||e.className!==t.className||e.style!==t.style||e.minYear!==t.minYear||e.maxYear!==t.maxYear||e.onChange!==t.onChange||e.allowedDates!==t.allowedDates||e.children!==t.children||e.prevDateAriaLabel!==t.prevDateAriaLabel||e.nextDateAriaLabel!==t.nextDateAriaLabel||e.selectAriaLabel!==t.selectAriaLabel||e.yearAriaLabel!==t.yearAriaLabel||e.monthAriaLabel!==t.monthAriaLabel||e.dayAriaLabel!==t.dayAriaLabel||e.locale!==t.locale||e.formatYearOption!==t.formatYearOption||e.formatMonthOption!==t.formatMonthOption||e.formatDayOption!==t.formatDayOption));Pn.displayName="DateSelector";function Xe(e,t){const r=e+Math.floor(t/12),n=(t%12+12)%12,a=new Date(r,n,1);return a.setFullYear(r),a}function Dt(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`}function br(e,t){if(e!==void 0&&(!(e instanceof Date)||Number.isNaN(e.getTime())))throw new RangeError(`MonthSelector: \`${t}\` must be a valid Date, received ${String(e)}.`)}function mn(e,t){if(e!==void 0&&!Number.isInteger(e))throw new RangeError(`MonthSelector: \`${t}\` must be an integer year, received ${String(e)}.`)}function pa(e){if(e!==void 0)try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{throw new RangeError(`MonthSelector: \`locale\` must be a valid BCP 47 language tag, received ${JSON.stringify(e)}.`)}}function Da(e,t){const r=e===void 0?null:Xe(e,0),n=t===void 0?null:Xe(t.getFullYear(),t.getMonth());return r!==null&&n!==null?r>=n?r:n:r!==null?r:n}function ya(e,t){const r=e===void 0?null:Xe(e,11),n=t===void 0?null:Xe(t.getFullYear(),t.getMonth());return r!==null&&n!==null?r<=n?r:n:r!==null?r:n}function Cn(e,t){return{label:Ee("month",e,void 0,t),value:Dt(e)}}function Ta(e,t,r){const n=e.getFullYear()*12+e.getMonth(),a=t.getFullYear()*12+t.getMonth(),s=[];for(let i=a;i>=n;i--)s.push(Cn(Xe(Math.floor(i/12),i%12),r));return s}const Ra=e=>{const{value:t,initialDate:r,onChange:n,children:a,variant:s="date",minYear:i,maxYear:d,minDate:w,maxDate:g,isWarning:k=!1,className:y="",style:u,disabled:v=!1,prevMonthAriaLabel:V="Previous month",nextMonthAriaLabel:ee="Next month",selectAriaLabel:p="Month",locale:J}=e;pa(J),br(t,"value"),br(r,"initialDate"),br(w,"minDate"),br(g,"maxDate"),mn(i,"minYear"),mn(d,"maxYear");const E=t??r;if(E===void 0)throw new RangeError("MonthSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected month is never inferred from the wall clock.");const[te,Y]=o.useState(()=>Xe(E.getFullYear(),E.getMonth())),U=t!==void 0,S=o.useMemo(()=>t!==void 0?Xe(t.getFullYear(),t.getMonth()):te,[t?.getTime(),te]),_=w?.getTime(),j=g?.getTime(),b=o.useMemo(()=>Da(i,w),[i,_]),$=o.useMemo(()=>ya(d,g),[d,j]);if(b!==null&&$!==null&&b>$)throw new RangeError(`MonthSelector: the resolved lower bound ${Dt(b)} is after the resolved upper bound ${Dt($)}.`);if(s==="dropdown"&&(b===null||$===null))throw new RangeError('MonthSelector: variant="dropdown" requires a lower bound (`minYear` or `minDate`) and an upper bound (`maxYear` or `maxDate`); the option window is never invented.');const N=b!==null&&S<b||$!==null&&S>$,O=E.getTime();o.useEffect(()=>{if(U)return;const L=Xe(E.getFullYear(),E.getMonth());Y(xe=>xe.getTime()===L.getTime()?xe:L)},[U,O]);const P=L=>(b===null||L>=b)&&($===null||L<=$),re=L=>{if(v)return;if(!P(L))throw new RangeError(`MonthSelector: refusing to emit ${Dt(L)}, which lies outside the declared bounds.`);U||Y(L);const xe=L.getFullYear()*100+(L.getMonth()+1);n?.(L,xe)},pe=o.useMemo(()=>{const L=Xe(S.getFullYear(),S.getMonth()-1);return P(L)?L:null},[S,b?.getTime(),$?.getTime()]),Z=o.useMemo(()=>{const L=Xe(S.getFullYear(),S.getMonth()+1);return P(L)?L:null},[S,b?.getTime(),$?.getTime()]),ne=v||pe===null,ie=v||Z===null,ue=()=>{pe!==null&&re(pe)},W=()=>{Z!==null&&re(Z)},K=L=>{if(!L)return;const[xe,Ve]=L.split("-"),Qe=Number(xe),le=Number(Ve)-1;if(!(Number.isInteger(Qe)&&Number.isInteger(le)))return;const De=Xe(Qe,le);P(De)&&re(De)},$e=L=>{K(L.target.value)},gt=L=>{K(L.target.value)},Ye=Dt(S),Re=b?Dt(b):void 0,de=$?Dt($):void 0,H=o.useMemo(()=>{if(s!=="dropdown"||b===null||$===null)return[];const L=Ta(b,$,J);if(!N)return L;const xe=Cn(S,J);return[...L,xe].sort((Ve,Qe)=>Qe.value.localeCompare(Ve.value))},[s,b?.getTime(),$?.getTime(),N,S,J]),B=k?"border-amber-300 bg-amber-50 text-amber-900 focus:border-amber-500 focus:ring-amber-500 dark:border-amber-900/50 dark:bg-amber-950/20 dark:text-amber-200":"border-gray-300 bg-gray-100 text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500",G=`mx-1 my-auto w-28 rounded-md border py-0.5 px-1 text-xs dark:placeholder:text-gray-400 disabled:opacity-50 ${B}`,me=`mx-1 my-auto w-28 appearance-none rounded-md border px-1 py-0.5 text-center font-mono text-xs tabular-nums [text-align-last:center] [text-align:center] disabled:opacity-50 ${B}`;return f.jsxs("div",{className:`inline-flex w-38 items-center ${y}`,style:u,children:[f.jsx("button",{type:"button","aria-label":V,disabled:ne,className:"relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",onClick:ue,children:f.jsx("span",{className:"h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200"})}),s==="dropdown"?f.jsx("select",{"aria-label":p,disabled:v,className:me,value:Ye,onChange:gt,children:H.map(L=>f.jsx("option",{value:L.value,className:"text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100",children:L.label},L.value))}):f.jsx("input",{"aria-label":p,disabled:v,className:G,value:Ye,min:Re,max:de,onChange:$e,type:"month"}),f.jsx("button",{type:"button","aria-label":ee,disabled:ie,className:"relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",onClick:W,children:f.jsx("span",{className:"h-0 w-0 border-y-[6px] border-y-transparent border-l-[6px] border-l-slate-500 border-solid hover:border-l-slate-700 dark:border-l-slate-400 dark:hover:border-l-slate-200"})}),a]})},Nn=o.memo(Ra,(e,t)=>{const r=e.value??e.initialDate,n=t.value??t.initialDate,a=r?r.getFullYear()*12+r.getMonth():null,s=n?n.getFullYear()*12+n.getMonth():null;if(a!==s||e.variant!==t.variant||e.disabled!==t.disabled||e.className!==t.className||e.style!==t.style||e.isWarning!==t.isWarning||e.minYear!==t.minYear||e.maxYear!==t.maxYear)return!1;const i=e.minDate?e.minDate.getFullYear()*12+e.minDate.getMonth():null,d=t.minDate?t.minDate.getFullYear()*12+t.minDate.getMonth():null;if(i!==d)return!1;const w=e.maxDate?e.maxDate.getFullYear()*12+e.maxDate.getMonth():null,g=t.maxDate?t.maxDate.getFullYear()*12+t.maxDate.getMonth():null;return!(w!==g||e.onChange!==t.onChange||e.children!==t.children||e.prevMonthAriaLabel!==t.prevMonthAriaLabel||e.nextMonthAriaLabel!==t.nextMonthAriaLabel||e.selectAriaLabel!==t.selectAriaLabel||e.locale!==t.locale)});Nn.displayName="MonthSelector";function Jt(e,t,r){if(!(r instanceof Date)||Number.isNaN(r.getTime()))throw new RangeError(`${e}: ${t} is required and must be a valid Date (received: ${String(r)})`)}function Vr(e,t,r){if(Jt(e,"minDate",t),Jt(e,"maxDate",r),r.getTime()<=t.getTime())throw new RangeError(`${e}: maxDate must be strictly later than minDate (minDate: ${t.toISOString()}, maxDate: ${r.toISOString()})`)}function jr(e,t,r){if(!Array.isArray(r)||r.length!==2)throw new RangeError(`${e}: ${t} is required and must be a [lower, upper] Date tuple (received: ${String(r)})`);if(Jt(e,`${t}[0]`,r[0]),Jt(e,`${t}[1]`,r[1]),r[0].getTime()>r[1].getTime())throw new RangeError(`${e}: ${t} upper must not be earlier than lower (lower: ${r[0].toISOString()}, upper: ${r[1].toISOString()})`)}function Hr(e,t,r,n,a,s){if(r.getTime()<n.getTime()||r.getTime()>a.getTime())throw new RangeError(`${e}: ${t} must lie within ${s} (value: ${r.toISOString()}, lower: ${n.toISOString()}, upper: ${a.toISOString()})`)}function Or(e,t,r,n,a,s){Hr(e,`${t}[0]`,r[0],n,a,s),Hr(e,`${t}[1]`,r[1],n,a,s)}function Fe(e,t,r){return e<t?t:e>r?r:e}function wr(e,t,r,n){const a=at(t,r,n[1]);return[Fe(e[0],n[0],a),Fe(e[1],n[0],a)]}function Fr(e,t,r,n){const a=ve(e,r,t)+n;return e[Math.max(0,Math.min(e.length-1,a))]}function Ur(e){const t=o.useRef(e),r=t.current,n=e,a=Object.keys(r),s=Object.keys(n);return a.length===s.length&&s.every(d=>Object.is(r[d],n[d]))||(t.current=e),t.current}function Sa(e){const{unit:t,minDate:r,maxDate:n,initialRange:a,onChangeRange:s,...i}=e;Vr("usePeriodSliderRange",r,n),jr("usePeriodSliderRange","initialRange",a),Or("usePeriodSliderRange","initialRange",a,r,n,"[minDate, maxDate]");const d=Ur(i),w=o.useRef(a),[g,k]=o.useState(a);let y=g;const u=[Fe(g[0],r,n),Fe(g[1],r,n)];(u[0]!==g[0]||u[1]!==g[1])&&(y=u,k(u));const v=o.useRef(y);v.current=y;const V=o.useRef({minDate:r,maxDate:n,allowedDates:d.allowedDates});V.current={minDate:r,maxDate:n,allowedDates:d.allowedDates};const ee=o.useRef(s);ee.current=s;const p=o.useCallback(b=>{const{minDate:$,maxDate:N}=V.current,O=Fe(b[0],$,N),P=Fe(b[1],$,N),re=v.current;O.getTime()===re[0].getTime()&&P.getTime()===re[1].getTime()||(v.current=[O,P],k([O,P]),ee.current?.(O,P))},[]),J=o.useCallback(b=>{const $=v.current,N=b.getTime()>$[1].getTime()?b:$[1];p([b,N])},[p]),E=o.useCallback(b=>{const $=v.current,N=b.getTime()<$[0].getTime()?b:$[0];p([N,b])},[p]),te=o.useCallback((b,$)=>{p([b,$])},[p]),Y=o.useCallback(b=>{const{minDate:$,maxDate:N,allowedDates:O}=V.current,P=v.current,re=Ft(O,t,$,N);if(re.length>0){p([Fr(re,t,P[0],b),Fr(re,t,P[1],b)]);return}p([Ne(t,P[0],b),Ne(t,P[1],b)])},[t,p]),U=o.useCallback(()=>{p(w.current)},[p]),S=o.useMemo(()=>({value:y[0],onChange:J,minDate:r,maxDate:y[1],unit:t}),[y[0],y[1],J,r,t]),_=o.useMemo(()=>({value:y[1],onChange:E,minDate:y[0],maxDate:n,unit:t}),[y[0],y[1],E,n,t]),j=o.useMemo(()=>({...d,mode:"range",unit:t,range:y,minDate:r,maxDate:n,onChangeRange:te}),[d,t,y,r,n,te]);return{range:y,lowerDate:y[0],upperDate:y[1],setRange:k,setLowerDate:J,setUpperDate:E,shiftRange:Y,resetRange:U,startSelectorProps:S,endSelectorProps:_,sliderProps:j}}function La(e){const{unit:t,minDate:r,maxDate:n,initialValue:a,onChangePoint:s,...i}=e;Vr("usePeriodSliderPoint",r,n),Jt("usePeriodSliderPoint","initialValue",a),Hr("usePeriodSliderPoint","initialValue",a,r,n,"[minDate, maxDate]");const d=Ur(i),w=o.useRef(a),[g,k]=o.useState(a);let y=g;const u=Fe(g,r,n);u!==g&&(y=u,k(u));const v=o.useRef(y);v.current=y;const V=o.useRef({minDate:r,maxDate:n,allowedDates:d.allowedDates});V.current={minDate:r,maxDate:n,allowedDates:d.allowedDates};const ee=o.useRef(s);ee.current=s;const p=o.useCallback(U=>{const{minDate:S,maxDate:_}=V.current,j=Fe(U,S,_);j.getTime()!==v.current.getTime()&&(v.current=j,k(j),ee.current?.(j))},[]),J=o.useCallback(U=>{const{minDate:S,maxDate:_,allowedDates:j}=V.current,b=Ft(j,t,S,_);if(b.length>0){p(Fr(b,t,v.current,U));return}p(Ne(t,v.current,U))},[t,p]),E=o.useCallback(()=>{p(w.current)},[p]),te=o.useMemo(()=>({value:y,onChange:p,minDate:r,maxDate:n,unit:t}),[y,p,r,n,t]),Y=o.useMemo(()=>({...d,mode:"point",unit:t,value:y,minDate:r,maxDate:n,onChangePoint:p}),[d,t,y,r,n,p]);return{value:y,setValue:k,shiftValue:J,resetValue:E,selectorProps:te,sliderProps:Y}}function $a(e){const{unit:t,minDate:r,maxDate:n,initialMacroRange:a,initialMicroRange:s,macroUnit:i=t,microUnit:d=t,onChangeMacroRange:w,onChangeMicroRange:g,...k}=e;Vr("useVernierSlider",r,n),jr("useVernierSlider","initialMacroRange",a),jr("useVernierSlider","initialMicroRange",s),Or("useVernierSlider","initialMacroRange",a,r,n,"[minDate, maxDate]"),Or("useVernierSlider","initialMicroRange",s,a[0],at(i,d,a[1]),"the initial macro window");const y=Ur(k),u=o.useRef(a),v=o.useRef(s),[V,ee]=o.useState(a),[p,J]=o.useState(s);let E=V;const te=[Fe(V[0],r,n),Fe(V[1],r,n)];(te[0]!==V[0]||te[1]!==V[1])&&(E=te,ee(te));let Y=p;const U=wr(p,i,d,E);(U[0]!==p[0]||U[1]!==p[1])&&(Y=U,J(U));const S=o.useRef(E);S.current=E;const _=o.useRef(Y);_.current=Y;const j=o.useRef({minDate:r,maxDate:n});j.current={minDate:r,maxDate:n};const b=o.useRef(w);b.current=w;const $=o.useRef(g);$.current=g;const N=o.useCallback((H,B)=>{const G=S.current,me=_.current;(H[0].getTime()!==G[0].getTime()||H[1].getTime()!==G[1].getTime())&&(S.current=H,ee(H),b.current?.(H[0],H[1])),(B[0].getTime()!==me[0].getTime()||B[1].getTime()!==me[1].getTime())&&(_.current=B,J(B),$.current?.(B[0],B[1]))},[]),O=o.useCallback((H,B)=>{const{minDate:G,maxDate:me}=j.current,L=[Fe(H,G,me),Fe(B,G,me)];N(L,wr(_.current,i,d,L))},[i,d,N]),P=o.useCallback((H,B)=>{N(S.current,wr([H,B],i,d,S.current))},[i,d,N]),re=o.useCallback(H=>{const B=S.current[1],G=H>B?H:B;O(H,G)},[O]),pe=o.useCallback(H=>{const B=S.current[0],G=H<B?H:B;O(G,H)},[O]),Z=o.useCallback(H=>{const B=_.current[1],G=H>B?H:B;P(H,G)},[P]),ne=o.useCallback(H=>{const B=_.current[0],G=H<B?H:B;P(G,H)},[P]),ie=o.useCallback(H=>{const{minDate:B,maxDate:G}=j.current,me=S.current,L=Ne(i,me[0],H),xe=Ne(i,me[1],H);L<B||xe>G||O(L,xe)},[i,O]),ue=o.useCallback(H=>{const B=S.current,G=_.current,me=Ne(d,G[0],H),L=Ne(d,G[1],H);me<B[0]||L>at(i,d,B[1])||P(me,L)},[i,d,P]),W=o.useCallback(()=>{const H=u.current;N(H,wr(v.current,i,d,H))},[i,d,N]),K=o.useMemo(()=>at(i,d,E[1]),[i,d,E[1]]),$e=o.useMemo(()=>({value:E[0],onChange:re,minDate:r,maxDate:E[1],unit:i}),[E,re,r,i]),gt=o.useMemo(()=>({value:E[1],onChange:pe,minDate:E[0],maxDate:n,unit:i}),[E,pe,n,i]),Ye=o.useMemo(()=>({value:Y[0],onChange:Z,minDate:E[0],maxDate:Y[1],unit:d}),[Y,Z,E,d]),Re=o.useMemo(()=>({value:Y[1],onChange:ne,minDate:Y[0],maxDate:K,unit:d}),[Y,ne,K,d]),de=o.useMemo(()=>({...y,mode:"vernier",unit:t,macroUnit:i,microUnit:d,minDate:r,maxDate:n,macroRange:E,microRange:Y,onChangeMacroRange:O,onChangeMicroRange:P}),[y,t,i,d,r,n,E,Y,O,P]);return{macroRange:E,setMacroRange:ee,microRange:Y,setMicroRange:J,setMacroLowerDate:re,setMacroUpperDate:pe,setMicroLowerDate:Z,setMicroUpperDate:ne,shiftMacroRange:ie,shiftMicroRange:ue,resetVernier:W,macroStartSelectorProps:$e,macroEndSelectorProps:gt,microStartSelectorProps:Ye,microEndSelectorProps:Re,sliderProps:de}}function fn(e){const t=new Date(e,0,1);return t.setFullYear(e),t}function xr(e,t){if(e!==void 0&&(!(e instanceof Date)||Number.isNaN(e.getTime())))throw new RangeError(`YearSelector: \`${t}\` must be a valid Date, received ${String(e)}.`)}function gn(e,t){if(e!==void 0&&!Number.isInteger(e))throw new RangeError(`YearSelector: \`${t}\` must be an integer year, received ${String(e)}.`)}function ka(e){if(e!==void 0)try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{throw new RangeError(`YearSelector: \`locale\` must be a valid BCP 47 language tag, received ${JSON.stringify(e)}.`)}}function hn(e,t,r){const n=e===void 0?null:e,a=t===void 0?null:t.getFullYear();return n!==null&&a!==null?r(n,a):n!==null?n:a}const Pa=e=>{const{value:t,initialDate:r,onChange:n,children:a,minYear:s,maxYear:i,minDate:d,maxDate:w,className:g="",style:k,disabled:y=!1,prevYearAriaLabel:u="Previous year",nextYearAriaLabel:v="Next year",selectAriaLabel:V="Year",locale:ee}=e;xr(t,"value"),xr(r,"initialDate"),xr(d,"minDate"),xr(w,"maxDate"),gn(s,"minYear"),gn(i,"maxYear"),ka(ee);const p=t??r;if(p===void 0)throw new RangeError("YearSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected year is never inferred from the wall clock.");const[J,E]=o.useState(()=>p.getFullYear()),te=d?.getTime(),Y=w?.getTime(),U=o.useMemo(()=>hn(s,d,Math.max),[s,te]),S=o.useMemo(()=>hn(i,w,Math.min),[i,Y]);if(U===null||S===null)throw new RangeError("YearSelector: a lower bound (`minYear` or `minDate`) and an upper bound (`maxYear` or `maxDate`) are both required; the year option list is never invented.");if(U>S)throw new RangeError(`YearSelector: the resolved lower bound ${U} is after the resolved upper bound ${S}.`);const _=t!==void 0,j=t!==void 0?t.getFullYear():J,b=j<U||j>S,$=p.getTime();o.useEffect(()=>{_||E(p.getFullYear())},[_,$]);const N=W=>W>=U&&W<=S,O=W=>{if(!y){if(!N(W))throw new RangeError(`YearSelector: refusing to emit ${W}, which lies outside the declared bounds ${U}-${S}.`);_||E(W),n?.(fn(W),W)}},P=N(j-1)?j-1:null,re=N(j+1)?j+1:null,pe=y||P===null,Z=y||re===null,ne=()=>{P!==null&&O(P)},ie=()=>{re!==null&&O(re)},ue=o.useMemo(()=>{const W=[];for(let K=S;K>=U;K--)W.push(K);return b&&(W.push(j),W.sort((K,$e)=>$e-K)),W},[U,S,b,j]);return f.jsxs("div",{className:`inline-flex w-32 items-center ${g}`,style:k,children:[f.jsx("button",{type:"button","aria-label":u,disabled:pe,className:"relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",onClick:ne,children:f.jsx("span",{className:"h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200"})}),f.jsx("select",{"aria-label":V,disabled:y,className:"mx-1 my-auto w-18 appearance-none rounded-md border border-gray-300 bg-gray-100 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums [text-align-last:center] [text-align:center] focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500",value:j,onChange:W=>{if(!W.target.value)return;const K=Number(W.target.value);Number.isInteger(K)&&O(K)},children:ue.map(W=>f.jsx("option",{value:W,className:"text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100",children:Ee("year",fn(W),void 0,ee)},W))}),f.jsx("button",{type:"button","aria-label":v,disabled:Z,className:"relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",onClick:ie,children:f.jsx("span",{className:"h-0 w-0 border-y-[6px] border-y-transparent border-l-[6px] border-l-slate-500 border-solid hover:border-l-slate-700 dark:border-l-slate-400 dark:hover:border-l-slate-200"})}),a]})},Yn=o.memo(Pa,(e,t)=>{const r=e.value??e.initialDate,n=t.value??t.initialDate,a=r?r.getFullYear():null,s=n?n.getFullYear():null;return!(a!==s||e.disabled!==t.disabled||e.className!==t.className||e.style!==t.style||e.minYear!==t.minYear||e.maxYear!==t.maxYear||e.minDate?.getFullYear()!==t.minDate?.getFullYear()||e.maxDate?.getFullYear()!==t.maxDate?.getFullYear()||e.onChange!==t.onChange||e.children!==t.children||e.prevYearAriaLabel!==t.prevYearAriaLabel||e.nextYearAriaLabel!==t.nextYearAriaLabel||e.selectAriaLabel!==t.selectAriaLabel||e.locale!==t.locale)});Yn.displayName="YearSelector";exports.COLOR_SCHEME_PALETTES=bn;exports.DateSelector=Pn;exports.MonthSelector=Nn;exports.PeriodSlider=kn;exports.YearSelector=Yn;exports.addUnit=Ne;exports.areStylesEqual=$n;exports.calculateConnectDragValues=xn;exports.calculateHandleDragValues=Ir;exports.calculateKeyboardActionValues=Mn;exports.calculateLabelSlant=Tn;exports.calculateVernierMacroDrag=Sn;exports.calculateVernierMicroDrag=Ln;exports.decode=oe;exports.encode=X;exports.findNearestDateIndex=ve;exports.formatLabel=Ee;exports.formatScreenReaderLabel=pt;exports.getActiveDragHandle=wn;exports.getMacroWindowEndDate=at;exports.getSortedAllowedDates=Ft;exports.normalizeDateByUnit=qe;exports.resolveVernierTargetHandle=Rn;exports.usePeriodSliderPoint=La;exports.usePeriodSliderRange=Sa;exports.useVernierSlider=$a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),Le=require("date-fns"),o=require("react"),On={"blue-rose":{macro:"#0284c7",macroLight:"#38bdf8",micro:"#e11d48",microLight:"#fb7185",accent:"#0284c7"},"indigo-amber":{macro:"#4f46e5",macroLight:"#818cf8",micro:"#d97706",microLight:"#fbbf24",accent:"#4f46e5"},"teal-emerald":{macro:"#0d9488",macroLight:"#2dd4bf",micro:"#059669",microLight:"#34d399",accent:"#0d9488"},"violet-fuchsia":{macro:"#7c3aed",macroLight:"#a78bfa",micro:"#c026d3",microLight:"#e879f9",accent:"#7c3aed"},"slate-sky":{macro:"#475569",macroLight:"#94a3b8",micro:"#0284c7",microLight:"#38bdf8",accent:"#475569"},monochrome:{macro:"#52525b",macroLight:"#a1a1aa",micro:"#18181b",microLight:"#71717a",accent:"#27272a"}},it=e=>e instanceof Date&&!Number.isNaN(e.getTime()),he=e=>e instanceof Date?Number.isNaN(e.getTime())?"Invalid Date":e.toISOString():String(e),qe=(e,t)=>{if(!it(t))throw new RangeError(`normalizeDateByUnit: d must be a valid Date (received: ${he(t)})`);const r=new Date(t.getTime());return e==="year"?(r.setMonth(0,1),r.setHours(0,0,0,0)):(e==="month"&&r.setDate(1),r.setHours(0,0,0,0)),r},q=(e,t)=>{const r=qe(e,t),n=r.getFullYear(),a=r.getMonth()+1,s=r.getDate();if(e==="year")return n;if(e==="month")return n*12+(a-1);const i=new Date(0);return i.setUTCFullYear(n,a-1,s),i.setUTCHours(0,0,0,0),Math.floor(i.getTime()/(1440*60*1e3))},oe=(e,t)=>{const r=new Date(0);if(r.setHours(0,0,0,0),e==="year")return r.setFullYear(t,0,1),r;if(e==="month"){const a=Math.floor(t/12),s=t-a*12;return r.setFullYear(a,s,1),r}const n=new Date(t*24*60*60*1e3);return r.setFullYear(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()),r},Ie=(e,t,r)=>{if(!it(t))throw new RangeError(`addUnit: d must be a valid Date (received: ${he(t)})`);return e==="year"?Le.addYears(t,r):e==="month"?Le.addMonths(t,r):Le.addDays(t,r)},ot=(e,t,r)=>{if(!it(r))throw new RangeError(`getMacroWindowEndDate: d must be a valid Date (received: ${he(r)})`);if(e===t)return qe(t,r);const n=r.getFullYear(),a=r.getMonth();if(e==="year"){if(t==="month")return new Date(n,11,1);if(t==="day")return new Date(n,11,31)}return e==="month"&&t==="day"?new Date(n,a+1,0):qe(t,r)},$a={year:{year:"numeric"},month:{year:"numeric",month:"2-digit"},day:{year:"numeric",month:"2-digit",day:"2-digit"}},kn=new Map,ka=(e,t)=>{const r=`${e}\0${t}`,n=kn.get(r);if(n!==void 0)return n;const a=new Intl.DateTimeFormat(t,$a[e]);return kn.set(r,a),a},Pa=(e,t)=>{const r=String(t.getFullYear()).padStart(4,"0");if(e==="year")return r;const n=String(t.getMonth()+1).padStart(2,"0");if(e==="month")return`${r}-${n}`;const a=String(t.getDate()).padStart(2,"0");return`${r}-${n}-${a}`},Oe=(e,t,r,n)=>it(t)?r?r(t):n===void 0?Pa(e,t):ka(e,n).format(t):"",pt=(e,t,r,n)=>Oe(e,t,r,n),ve=(e,t,r)=>{if(!e||e.length===0||e.length===1)return 0;const n=q(r,t);let a=0,s=e.length-1;if(n<=q(r,e[a]))return 0;if(n>=q(r,e[s]))return s;for(;a<=s;){const b=a+s>>1,f=q(r,e[b]);if(f===n)return b;f<n?a=b+1:s=b-1}const i=Math.abs(q(r,e[a])-n),u=Math.abs(q(r,e[s])-n);return i<u?a:s},Vt=(e,t,r,n)=>{if(!Array.isArray(e)||e.length===0)return[];const a=q(t,r),s=q(t,n),i=new Map;for(const u of e){const b=qe(t,u),f=q(t,b);f<a||f>s||i.has(f)||i.set(f,b)}if(i.size===0)throw new RangeError(`getSortedAllowedDates: every allowedDates entry falls outside [minDate, maxDate] (minDate: ${he(r)}, maxDate: ${he(n)}, entries: ${e.length})`);return Array.from(i.keys()).sort((u,b)=>u-b).map(u=>i.get(u))},yr=(e,t,r,n)=>{const a=e.length-1;if(a<=0)return 0;const s=ve(e,n,t);if(r==="time"){const i=e[0].getTime(),u=e[a].getTime()-i;return u<=0?0:Math.max(0,Math.min(1,(e[s].getTime()-i)/u))}return s/a},Tr=(e,t,r,n)=>{const a=e.length-1;if(a<=0)return 0;const s=Math.max(0,Math.min(1,n));if(r==="time"){const i=e[0].getTime(),u=e[a].getTime()-i;return u<=0?0:ve(e,new Date(i+s*u),t)}return Math.max(0,Math.min(a,Math.round(s*a)))},qr=(e,t,r,n,a,s,i)=>{let u=r,b=n;return i?(u=t,b=t):e==="low"?t>n?(u=n,b=t):u=t:t<r?(b=r,u=t):b=t,[Math.max(a,Math.min(s,u)),Math.max(a,Math.min(s,b))]},Fn=(e,t,r,n,a)=>a?"low":e==="low"?t>n?"high":"low":t<r?"low":"high",Vn=({posDiffPct:e,startLowVal:t,startHighVal:r,rangeMin:n,rangeMax:a,isDiscrete:s,sortedAllowedDates:i,snapMode:u,unit:b})=>{if(s){const V=i.length-1;if(V<=0)return[0,0];const ee=Math.max(0,Math.min(V,Math.round(t))),v=Math.max(ee,Math.min(V,Math.round(r)));if(u==="time"){const Y=i[0].getTime(),U=i[V].getTime(),L=i[ee].getTime(),_=i[v].getTime()-L;let H=L+e*(U-Y),w=H+_;H<Y&&(H=Y,w=Y+_),w>U&&(w=U,H=U-_);const $=ve(i,new Date(H),b),N=ve(i,new Date(w),b);return[$,Math.max($,N)]}const J=Math.round(e*V);let I=ee+J,te=v+J;return I<0&&(te+=-I,I=0),te>V&&(I-=te-V,te=V),[Math.max(0,Math.min(V,I)),Math.max(0,Math.min(V,te))]}const f=V=>Math.max(n,Math.min(a,V)),P=a-n;if(P<=0)return[f(t),f(r)];const y=Math.round(e*P);let d=t+y,p=r+y;return d<n&&(p+=n-d,d=n),p>a&&(d-=p-a,p=a),[f(d),f(p)]},Un=(e,t,r,n,a,s,i,u)=>{let b=0,f=!1,P=!1;switch(e){case"ArrowRight":case"ArrowUp":b=u;break;case"ArrowLeft":case"ArrowDown":b=-u;break;case"PageUp":b=u*5;break;case"PageDown":b=-u*5;break;case"Home":f=!0;break;case"End":P=!0;break;default:return null}if(i){let p=r;return f?p=a:P?p=s:p=Math.max(a,Math.min(s,r+b)),[p,p]}let y=r,d=n;return t==="low"?f?y=a:P?y=n:y=Math.max(a,Math.min(n,r+b)):f?d=r:P?d=s:d=Math.max(r,Math.min(s,n+b)),[y,d]},Bn=8,zn=2,_n=16,Ca=12,Na=90,Zr=(e,t)=>{const r=t?.estimatedHeightPx??_n,a=Bn+(t?.anchorGapY??zn)+r/2,s=e==="top"?-a:a;return{lowAngleDeg:0,highAngleDeg:0,lowOffsetX:0,highOffsetX:0,lowOffsetY:s,highOffsetY:s,isSlanted:!1,proximity:0}},Qr=(e,t,r,n="top",a)=>{const s=a?.estimatedWidthPx,i=a?.estimatedHeightPx??_n,u=a?.paddingPx??Ca,b=a?.maxAngleDeg??Na,f=Bn+(a?.anchorGapY??zn),P=Zr(n,a);if(!(Number.isFinite(r)&&r>0)||s===void 0||!Number.isFinite(s)||s<=0)return P;const y=Math.max(0,t-e)/100*r,d=s+u;if(y>=d)return P;const p=Math.max(0,Math.min(1,(d-y)/d)),ee=p*p*p*(p*(p*6-15)+10)*b,v=n==="top"?-ee:ee,J=ee*Math.PI/180,I=s/2*Math.abs(Math.sin(J))+i/2*Math.abs(Math.cos(J)),te=f+I,Y=n==="top"?-te:+te,U=s*Math.abs(Math.cos(J))+i*Math.abs(Math.sin(J)),L=Math.max(0,(U+u-y)/2);return{lowAngleDeg:v,highAngleDeg:v,lowOffsetX:-L,highOffsetX:L,lowOffsetY:Y,highOffsetY:Y,isSlanted:p>.001,proximity:p}},Xn=e=>({...e,lowOffsetX:0,highOffsetX:0});function qn(e,t,r,n,a,s,i="macro-top",u=.05,b=!0){const f=i==="macro-top"||i==="macro-left",P=t<=0;if(f&&P||!(f||P)){const p=Math.abs(e-r),V=Math.abs(e-n);return p<=u&&p<=V?"macro-low":V<=u&&V<p?"macro-high":b&&e>=r&&e<=n?"macro-connect":p<V?"macro-low":"macro-high"}const y=Math.abs(e-a),d=Math.abs(e-s);return y<=u&&y<=d?"micro-low":d<=u&&d<y?"micro-high":b&&e>=a&&e<=s?"micro-connect":y<d?"micro-low":"micro-high"}function Kn(e,t,r,n,a){if(e==="macro-connect"){const i=t-r,u=a-n,b=Math.max(0,Math.min(1-u,n+i)),f=b+u;return[b,f,"macro-connect"]}if(e==="macro-low"){const i=Math.max(0,Math.min(1,t));return i>a?[a,i,"macro-high"]:[i,a,"macro-low"]}const s=Math.max(0,Math.min(1,t));return s<n?[s,n,"macro-low"]:[n,s,"macro-high"]}function Wn(e,t,r,n,a){if(e==="micro-connect"){const i=t-r,u=a-n,b=Math.max(0,Math.min(1-u,n+i)),f=b+u;return[b,f,"micro-connect"]}if(e==="micro-low"){const i=Math.max(0,Math.min(1,t));return i>a?[a,i,"micro-high"]:[i,a,"micro-low"]}const s=Math.max(0,Math.min(1,t));return s<n?[s,n,"micro-low"]:[n,s,"micro-high"]}const er=o.memo(({type:e,isTop:t=!0,isVertical:r=!1,isLeft:n=!0})=>{let a,s;r?(a=n?"M 7.375 0.625 A 7.375 7.375 0 0 0 7.375 15.375 Z":"M 0.625 0.625 A 7.375 7.375 0 0 1 0.625 15.375 Z",s=`period-slider-knob period-slider-knob-svg is-vertical ${n?"is-semicircle-left":"is-semicircle-right"}`):(a=t?"M 0.625 7.375 A 7.375 7.375 0 0 1 15.375 7.375 Z":"M 0.625 0.625 A 7.375 7.375 0 0 0 15.375 0.625 Z",s=`period-slider-knob period-slider-knob-svg ${t?"is-semicircle-top":"is-semicircle-bottom"}`);const i=e==="macro"?"period-slider-knob-path-macro":"period-slider-knob-path-micro";return g.jsx("svg",{className:s,width:r?"8":"16",height:r?"16":"8",viewBox:r?"0 0 8 16":"0 0 16 8",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:g.jsx("path",{d:a,className:i,shapeRendering:"geometricPrecision",strokeWidth:"1.25"})})});er.displayName="VernierKnobSvg";const Ya=(e,t)=>{if(!it(e))throw new RangeError(`PeriodSlider: minDate is required and must be a valid Date (received: ${he(e)})`);if(!it(t))throw new RangeError(`PeriodSlider: maxDate is required and must be a valid Date (received: ${he(t)})`);if(t.getTime()<=e.getTime())throw new RangeError(`PeriodSlider: maxDate must be strictly later than minDate (minDate: ${he(e)}, maxDate: ${he(t)})`)},kr=(e,t)=>{if(!Array.isArray(t)||t.length!==2)throw new RangeError(`PeriodSlider: ${e} is required and must be a [start, end] Date tuple (received: ${he(t)})`);const[r,n]=t;if(!it(r))throw new RangeError(`PeriodSlider: ${e}[0] must be a valid Date (received: ${he(r)})`);if(!it(n))throw new RangeError(`PeriodSlider: ${e}[1] must be a valid Date (received: ${he(n)})`);if(n.getTime()<r.getTime())throw new RangeError(`PeriodSlider: ${e} must not be inverted (start: ${he(r)}, end: ${he(n)})`)},Aa=(e,t)=>{if(!it(t))throw new RangeError(`PeriodSlider: ${e} must be a valid Date (received: ${he(t)})`)},Ur=(e,t,r,n)=>{if(t.getTime()<r.getTime()||t.getTime()>n.getTime())throw new RangeError(`PeriodSlider: ${e} must lie within [minDate, maxDate] (received: ${he(t)}, minDate: ${he(r)}, maxDate: ${he(n)})`)},Ea=(e,t,r)=>{if(e.mode==="range"){for(const n of["range","defaultRange"]){const a=e[n];a!==void 0&&(kr(n,a),Ur(`${n}[0]`,a[0],t,r),Ur(`${n}[1]`,a[1],t,r))}return}if(e.mode==="point")for(const n of["value","defaultValue"]){const a=e[n];a!==void 0&&(Aa(n,a),Ur(n,a,t,r))}},Ia=(e,t,r)=>{if(kr("macroRange",e),t!==void 0)return kr("microRange",t),t;if(r!==void 0)return kr("defaultMicroRange",r),r;throw new RangeError("PeriodSlider: vernier mode requires a micro selection; supply microRange (controlled) or defaultMicroRange (uncontrolled)")},Sr=(e,t,r,n,a,s,i,u)=>{const b=ve(e,n,t),f=ve(e,a,t);return i?b:u?f:Math.max(b,Math.min(f,ve(e,r,t)+s))},Br=e=>{e.timerId!==null&&clearTimeout(e.timerId),e.timerId=null,e.emit=null},Ha=(e,t)=>{try{Intl.DateTimeFormat.supportedLocalesOf([t])}catch{throw new RangeError(`PeriodSlider: ${e} must be a valid BCP 47 language tag (received: ${JSON.stringify(t)})`)}},Ot=()=>{const[e,t]=o.useState(null),r=o.useRef(null),n=o.useCallback(a=>{if(r.current?.disconnect(),r.current=null,a===null){t(null);return}if(typeof ResizeObserver>"u")return;const s=new ResizeObserver(i=>{for(const u of i){const b=u.borderBoxSize?.[0];b!==void 0&&t(f=>f!==null&&Math.abs(f.widthPx-b.inlineSize)<.5&&Math.abs(f.heightPx-b.blockSize)<.5?f:{widthPx:b.inlineSize,heightPx:b.blockSize})}});s.observe(a),r.current=s},[]);return o.useEffect(()=>()=>{r.current?.disconnect(),r.current=null},[]),[n,e]},zr=(e,t)=>{if(!(e===null||t===null))return{estimatedWidthPx:Math.max(e.widthPx,t.widthPx),estimatedHeightPx:Math.max(e.heightPx,t.heightPx)}},Pn=(e,t,r)=>({"--ps-tooltip-tx":`calc(-50% + ${e}px)`,"--ps-tooltip-ty":`${t}px`,"--ps-tooltip-rot":`${r}deg`}),Cn=(e,t,r,n,a,s,i)=>{const u=Zr(n,a);if(!i)return{slant:u,lowStyle:void 0,highStyle:void 0};const b=Qr(e*100,t*100,r,n,a),f=s?Xn(b):b;return{slant:f,lowStyle:Pn(f.lowOffsetX,f.lowOffsetY-u.lowOffsetY,f.lowAngleDeg),highStyle:Pn(f.highOffsetX,f.highOffsetY-u.highOffsetY,f.highAngleDeg)}},ja={horizontal:{decrease:"◀",increase:"▶"},vertical:{decrease:"▼",increase:"▲"}},Oa={horizontal:{decrease:"period-slider-stepper-prev",increase:"period-slider-stepper-next"},vertical:{decrease:"period-slider-stepper-prev period-slider-stepper-down",increase:"period-slider-stepper-next period-slider-stepper-up"}},Fa=e=>{const{unit:t,minDate:r,maxDate:n,allowedDates:a,snapMode:s="index",disabled:i=!1,className:u="",showStepper:b=!0,tooltipStyle:f="always",labelPosition:P="top",autoSlantLabels:y=!0,isVertical:d=!1,hideConnectBar:p=!1,showTicks:V=!1,colorScheme:ee="blue-rose",locale:v,decreaseAriaLabel:J="Decrease",increaseAriaLabel:I="Increase"}=e;Ya(r,n),Ea(e,r,n),v!==void 0&&Ha("locale",v);const te=e.mode==="vernier"?Ia(e.macroRange,e.microRange,e.defaultMicroRange):null,Y=On[ee],U=o.useId(),L=o.useRef(e);L.current=e;const _=r.getTime(),H=n.getTime(),w=o.useMemo(()=>Vt(a,t,r,n),[a,t,_,H]),$=w.length>0,{rangeMin:N,rangeMax:O}=o.useMemo(()=>$?{rangeMin:0,rangeMax:w.length-1}:{rangeMin:q(t,r),rangeMax:q(t,n)},[$,w,t,_,H]),k=e.mode==="point",re=o.useCallback(l=>{if($){const c=Math.max(0,Math.min(w.length-1,Math.round(l)));return w[c]}return oe(t,Math.round(l))},[$,w,t]),De=o.useCallback(l=>{if(l===void 0)return N;const c=qe(t,l);return $?ve(w,c,t):q(t,c)},[$,w,t,N]),[Z,ne]=o.useState(()=>te),ie=e.mode!=="vernier"?null:e.microRange!==void 0?e.microRange:Z,me=e.mode==="range"?e.range?.[0]??e.defaultRange?.[0]:e.mode==="vernier"?ie?.[0]:void 0,W=e.mode==="range"?e.range?.[1]??e.defaultRange?.[1]:e.mode==="vernier"?ie?.[1]:void 0,K=e.mode==="point"?e.value??e.defaultValue:void 0,ke=e.mode==="point"?K?.getTime():me?.getTime(),bt=e.mode==="range"?W?.getTime():ke,[He,Re]=o.useMemo(()=>{if(e.mode==="point"){const m=De(K);return[m,m]}const l=De(me),c=De(W);return[Math.min(l,c),Math.max(l,c)]},[e.mode,ke,bt,De,K,me,W]),fe=e.mode==="point"?e.value!==void 0:e.mode==="range"?e.range!==void 0:e.microRange!==void 0,[j,B]=o.useState(()=>[He,Re]),[G,ge]=o.useState(null),[R,xe]=o.useState(null),Fe=o.useRef(null);Fe.current=R;const[Qe,le]=o.useState("high"),[ye,et]=o.useState(null),[Ut,nr]=o.useState(null),ce=G?G[0]:fe?He:j[0],ue=G?G[1]:fe?Re:j[1],yt=o.useRef([ce,ue]);yt.current=[ce,ue];const Q=e.mode==="vernier",wt=e.mode==="vernier"?e.vernierOrientation??(d?"macro-left":"macro-top"):"macro-top",D=wt==="macro-top"||wt==="macro-left",ar=e.mode==="vernier"?e.showVernierProjection??!0:!1,or=e.mode==="vernier"?e.showVernierTicks??!0:!1,Tt=e.mode==="vernier"?e.showHairline??!0:!1,A=Q?e.macroUnit??t:t,M=Q?e.microUnit??t:t,Pr=Q?e.macroIsDiscrete??!1:$,St=Q?e.microIsDiscrete??!1:$,ir=Q?e.macroAllowedDates??a:a,Cr=Q?e.microAllowedDates??a:a,h=Q?e.formatMacroLabel??e.formatLabel:e.formatLabel,C=Q?e.formatMicroLabel??e.formatLabel:e.formatLabel,Pe=e.mode==="vernier"?e.macroRange[0].getTime():void 0,Lt=e.mode==="vernier"?e.macroRange[1].getTime():void 0,xt=me?.getTime(),tt=W?.getTime(),[Ce,lr]=o.useState(null),lt=o.useRef(null);lt.current=Ce;const[Te,Bt]=o.useState("micro-high"),je=o.useMemo(()=>q(A,r),[_,A]),Rt=o.useMemo(()=>{const l=q(A,n);if(Q&&l<=je)throw new RangeError(`PeriodSlider: macroUnit "${A}" cannot distinguish minDate from maxDate (minDate: ${he(r)}, maxDate: ${he(n)})`);return l},[Q,_,H,je,A]),Me=o.useMemo(()=>Q?Vt(ir,A,r,n):[],[Q,ir,A,_,H]),Ne=o.useMemo(()=>e.mode!=="vernier"?je:q(A,e.macroRange[0]),[e.mode,Pe,je,A]),Ye=o.useMemo(()=>e.mode!=="vernier"?Rt:q(A,e.macroRange[1]),[e.mode,Lt,Rt,A]),sr=o.useMemo(()=>oe(A,Ne),[A,Ne]),cr=o.useMemo(()=>oe(A,Ye),[A,Ye]),Se=o.useMemo(()=>e.mode!=="vernier"?q(M,r):Math.max(q(M,e.macroRange[0]),q(M,r)),[e.mode,Pe,M,_]),Be=o.useMemo(()=>e.mode!=="vernier"?q(M,n):Math.min(q(M,ot(A,M,e.macroRange[1])),q(M,n)),[e.mode,Lt,A,M,H]),ae=o.useMemo(()=>Q?Vt(Cr,M,r,n).filter(c=>{const m=q(M,c);return m>=Se&&m<=Be}):[],[Q,Cr,M,_,H,Se,Be]),$t=Pr&&Me.length>0,We=St&&ae.length>0,be=o.useMemo(()=>ie===null?Se:q(M,ie[0]),[xt,Se,M,ie]),we=o.useMemo(()=>ie===null?Be:q(M,ie[1]),[tt,Be,M,ie]),st=o.useMemo(()=>oe(M,be),[M,be]),ct=o.useMemo(()=>oe(M,we),[M,we]),zt=Math.max(1,Rt-je),pe=$t?yr(Me,A,s,sr):Math.max(0,Math.min(1,(Ne-je)/zt)),Ae=Math.max(pe,$t?yr(Me,A,s,cr):Math.min(1,(Ye-je)/zt)),_t=Math.max(1,Be-Se),Ve=We?yr(ae,M,s,st):Math.max(0,Math.min(1,(be-Se)/_t)),rt=Math.max(Ve,We?yr(ae,M,s,ct):Math.min(1,(we-Se)/_t)),Nr=o.useRef({timerId:null,emit:null}),Yr=o.useRef({timerId:null,emit:null}),Ar=o.useRef({timerId:null,emit:null});o.useEffect(()=>{const l=[Nr,Yr,Ar];return()=>{for(const c of l)Br(c.current)}},[]);const kt=o.useCallback((l,c,m)=>{Br(l);const{debounceMs:x}=L.current;if(m||!x||x<=0){c();return}l.emit=c,l.timerId=setTimeout(()=>{l.timerId=null,l.emit=null,c()},x)},[]),Er=o.useCallback(l=>{const c=l.emit;Br(l),c?.()},[]),Pt=o.useCallback(l=>new Date(Math.min(Math.max(l.getTime(),_),H)),[_,H]),Ge=o.useCallback((l,c,m=!1)=>{const[x,S]=yt.current;if((L.current.mode==="point"?l===x:l===x&&c===S)&&Nr.current.timerId===null)return;const z=re(l),E=re(c),X=()=>{const T=L.current;T.mode==="point"?T.onChangePoint?.(z):T.mode==="range"&&T.onChangeRange?.(z,E)};kt(Nr.current,X,m)},[re,kt]),Ct=o.useCallback((l,c,m=!1)=>{if(L.current.mode!=="vernier")return;const x=Pt(l),S=Pt(c);kt(Yr.current,()=>{const F=L.current;F.mode==="vernier"&&F.onChangeMacroRange?.(x,S)},m)},[Pt,kt]),ze=o.useCallback((l,c,m=!1)=>{const x=L.current;if(x.mode!=="vernier")return;const S=Pt(l),F=Pt(c);x.microRange===void 0&&ne([S,F]),kt(Ar.current,()=>{const z=L.current;z.mode==="vernier"&&z.onChangeMicroRange?.(S,F)},m)},[Pt,kt]),ur=o.useCallback(l=>{if($&&s==="time"&&w.length>1){const x=Math.max(0,Math.min(w.length-1,Math.round(l))),S=w[0].getTime(),z=w[w.length-1].getTime()-S;if(z<=0)return 0;const E=w[x].getTime();return Math.max(0,Math.min(100,(E-S)/z*100))}const c=O-N;if(c<=0)return 0;const m=(l-N)/c*100;return Math.max(0,Math.min(100,m))},[$,s,w,N,O]),dr=o.useCallback(l=>{const c=Math.max(0,Math.min(100,l));if($){if(s==="time"&&w.length>1){const S=w[0].getTime(),z=w[w.length-1].getTime()-S,E=S+c/100*z;return ve(w,new Date(E),t)}const x=Math.round(c/100*(w.length-1));return Math.max(0,Math.min(w.length-1,x))}const m=N+c/100*(O-N);return Math.round(m)},[$,s,w,N,O,t]),nt=o.useRef(null),[Nt,rn]=o.useState(0),[ra,Xt]=Ot(),[na,nn]=Ot(),[aa,an]=Ot(),[oa,on]=Ot(),[ia,ln]=Ot(),[la,sn]=Ot();o.useEffect(()=>{const l=nt.current;if(!l)return;const c=()=>{const m=l.getBoundingClientRect(),x=d?m.height:m.width;x>0&&rn(S=>Math.abs(S-x)<.5?S:x)};if(c(),typeof ResizeObserver<"u"){const m=new ResizeObserver(x=>{for(const S of x){const F=d?S.contentRect.height:S.contentRect.width;F>0&&rn(z=>Math.abs(z-F)<.5?z:F)}});return m.observe(l),()=>m.disconnect()}return window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[d]);const Mt=o.useCallback((l,c,m)=>{const x=d?m.height:m.width;if(!(Number.isFinite(x)&&x>0))return null;const S=d?m.bottom-c:l-m.left;return Number.isFinite(S)?Math.max(0,Math.min(1,S/x)):null},[d]),cn=o.useCallback((l,c)=>{const m=nt.current;if(!m)return null;const x=Mt(l,c,m.getBoundingClientRect());return x===null?null:x*100},[Mt]),mr=o.useRef(null),Ir=o.useRef(null),Je=o.useRef(null),Hr=o.useRef(null),qt=o.useRef(null),un=o.useCallback(l=>{if(i)return;if(Q){const T=Ir.current;if(!T||l.pointerId!==0&&l.pointerId!==T.pointerId||!nt.current)return;const se=Mt(l.clientX,l.clientY,nt.current.getBoundingClientRect());if(se===null)return;if(T.handle==="macro-low"||T.handle==="macro-high"||T.handle==="macro-connect"){const[_e,dt,$e]=Kn(T.handle,se,T.startPointerRatio,T.startMacroLowRatio,T.startMacroHighRatio);$e!==lt.current&&(lt.current=$e,lr($e),Bt($e));let de,Xe;if($t){const ft=Tr(Me,A,s,_e),gt=Math.max(ft,Tr(Me,A,s,dt));de=Me[ft],Xe=Me[gt]}else{const ft=Math.round(je+_e*zt),gt=Math.round(je+dt*zt);de=oe(A,ft),Xe=oe(A,gt)}const Gt=`${de.getTime()}_${Xe.getTime()}`;Gt!==Hr.current&&(Hr.current=Gt,Ct(de,Xe));let at,mt;if(T.handle==="macro-connect"){const ft=qe(M,de),gt=ot(A,M,Xe);let It,Ht;if(A==="year"){const ht=de.getFullYear()-T.startMacroLowDate.getFullYear();It=Ie("year",T.initialMicroLowDate,ht),Ht=Ie("year",T.initialMicroHighDate,ht)}else if(A==="month"){const ht=(de.getFullYear()-T.startMacroLowDate.getFullYear())*12+(de.getMonth()-T.startMacroLowDate.getMonth());It=Ie("month",T.initialMicroLowDate,ht),Ht=Ie("month",T.initialMicroHighDate,ht)}else{const ht=Math.round((de.getTime()-T.startMacroLowDate.getTime())/864e5);It=Ie("day",T.initialMicroLowDate,ht),Ht=Ie("day",T.initialMicroHighDate,ht)}const jt=ft.getTime(),Jt=gt.getTime(),$n=T.initialMicroHighDate.getTime()-T.initialMicroLowDate.getTime();let Zt=It.getTime(),Qt=Ht.getTime();Zt<jt&&(Zt=jt,Qt=Math.min(Jt,Zt+$n)),Qt>Jt&&(Qt=Jt,Zt=Math.max(jt,Qt-$n)),at=qe(M,new Date(Zt)),mt=qe(M,new Date(Qt))}else{const ft=de.getTime(),gt=ot(A,M,Xe).getTime(),It=T.initialMicroLowDate.getTime(),Ht=T.initialMicroHighDate.getTime(),jt=Math.max(ft,Math.min(gt,It)),Jt=Math.max(jt,Math.min(gt,Ht));at=qe(M,new Date(jt)),mt=qe(M,new Date(Jt))}const Rn=`${at.getTime()}_${mt.getTime()}`;Rn!==qt.current&&(qt.current=Rn,ze(at,mt))}else if(T.handle==="micro-low"||T.handle==="micro-high"||T.handle==="micro-connect"){const[_e,dt,$e]=Wn(T.handle,se,T.startPointerRatio,T.startMicroLowRatio,T.startMicroHighRatio);$e!==lt.current&&(lt.current=$e,lr($e),Bt($e));let de,Xe;if(We){const at=Tr(ae,M,s,_e),mt=Math.max(at,Tr(ae,M,s,dt));de=ae[at],Xe=ae[mt]}else{const at=Math.round(Se+_e*_t),mt=Math.round(Se+dt*_t);de=oe(M,at),Xe=oe(M,mt)}const Gt=`${de.getTime()}_${Xe.getTime()}`;Gt!==qt.current&&(qt.current=Gt,ze(de,Xe))}return}const c=mr.current;if(!c||l.pointerId!==0&&l.pointerId!==c.pointerId||!nt.current)return;const m=nt.current.getBoundingClientRect(),x=d?l.clientY:l.clientX,S=d?m.height:m.width;if(!(Number.isFinite(S)&&S>0))return;if(c.handle==="connect"){const T=d?(c.startPointerPos-x)/S:(x-c.startPointerPos)/S,se=Vn({posDiffPct:T,startLowVal:c.startLowVal,startHighVal:c.startHighVal,rangeMin:N,rangeMax:O,isDiscrete:$,sortedAllowedDates:w,snapMode:s,unit:t});if(Je.current&&Je.current[0]===se[0]&&Je.current[1]===se[1])return;Je.current=se,ge(se),Ge(se[0],se[1],!1);return}const F=Mt(l.clientX,l.clientY,m);if(F===null)return;const z=dr(F*100),[E,X]=qr(c.handle,z,c.startLowVal,c.startHighVal,N,O,k);if((!Je.current||Je.current[0]!==E||Je.current[1]!==X)&&(Je.current=[E,X],ge([E,X]),Ge(E,X,!1)),!k&&(c.handle==="low"||c.handle==="high")){const T=Fn(c.handle,z,c.startLowVal,c.startHighVal,k);Fe.current!==T&&(Fe.current=T,xe(T),le(T))}},[i,Q,d,A,M,$t,We,Me,ae,je,zt,Se,_t,N,O,$,w,s,t,Mt,dr,Ge,Ct,ze,k]),dn=o.useCallback(l=>{if(Q){Hr.current=null,qt.current=null,Ir.current=null,lt.current=null,lr(null),Er(Yr.current),Er(Ar.current);return}const c=mr.current;if(!c||l.pointerId!==0&&l.pointerId!==c.pointerId)return;const m=Je.current??G;m&&(Ge(m[0],m[1],!0),B(m)),Je.current=null,ge(null),mr.current=null,Fe.current=null,xe(null)},[Q,G,Ge,Er]),mn=o.useRef(un);mn.current=un;const fn=o.useRef(dn);fn.current=dn;const gn=R!==null||Ce!==null;o.useEffect(()=>{if(!gn)return;const l=m=>mn.current(m),c=m=>fn.current(m);return window.addEventListener("pointermove",l),window.addEventListener("pointerup",c),window.addEventListener("pointercancel",c),()=>{window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",c)}},[gn]);const jr=o.useCallback((l,c,m)=>{mr.current={pointerId:l,handle:c,startPointerPos:m,startLowVal:ce,startHighVal:ue},Fe.current=c,xe(c),c!=="connect"&&le(c)},[ce,ue]),hn=o.useCallback((l,c,m)=>{const x=L.current;x.mode==="vernier"&&(Ir.current={pointerId:l,handle:c,startPointerRatio:m,startMacroLowRatio:pe,startMacroHighRatio:Ae,startMicroLowRatio:Ve,startMicroHighRatio:rt,startMacroLowEnc:Ne,startMacroHighEnc:Ye,startMicroLowEnc:be,startMicroHighEnc:we,startMacroLowDate:x.macroRange[0],startMacroHighDate:x.macroRange[1],initialMicroLowDate:st,initialMicroHighDate:ct},lt.current=c,lr(c),Bt(c))},[pe,Ae,Ve,rt,Ne,Ye,be,we,st,ct]),bn=l=>c=>{if(i)return;c.stopPropagation(),c.preventDefault(),le(l);const m=d?c.clientY:c.clientX;jr(c.pointerId,l,m)},wn=l=>()=>{i||Fe.current!==null||le(l)},fr=l=>()=>{i||lt.current!==null||Bt(l)},Yt=l=>c=>{if(i)return;c.stopPropagation(),c.preventDefault();const m=nt.current;if(!m)return;const x=Mt(c.clientX,c.clientY,m.getBoundingClientRect());x!==null&&hn(c.pointerId,l,x)},sa=l=>{if(i||p)return;l.stopPropagation(),l.preventDefault();const c=d?l.clientY:l.clientX;jr(l.pointerId,"connect",c)},ca=l=>{if(i)return;if(Q){const E=nt.current;if(!E)return;const X=E.getBoundingClientRect(),T=Mt(l.clientX,l.clientY,X);if(T===null)return;const se=d?l.clientX-(X.left+X.width/2):l.clientY-(X.top+X.height/2),_e=qn(T,se,pe,Ae,Ve,rt,wt,void 0,!p);hn(l.pointerId,_e,T);return}const c=cn(l.clientX,l.clientY);if(c===null)return;const m=dr(c);let x="low";if(!k){const E=Math.abs(m-ce),X=Math.abs(m-ue);E<X?x="low":X<E?x="high":x=m>ue?"high":"low"}le(x);const[S,F]=qr(x,m,ce,ue,N,O,k);ge([S,F]),Ge(S,F,!0);const z=d?l.clientY:l.clientX;jr(l.pointerId,x,z)},ua=l=>{if(i||R!==null)return;const c=cn(l.clientX,l.clientY);if(c===null)return;const m=dr(c);et(m),nr(ur(m))},da=()=>{et(null),nr(null)},xn=l=>c=>{if(i)return;le(l);const m=Un(c.key,l,ce,ue,N,O,k,1);m&&(c.preventDefault(),fe||B(m),Ge(m[0],m[1],!0))},gr=(l,c)=>{const m=Math.max(q(M,l),q(M,r)),x=Math.min(q(M,ot(A,M,c)),q(M,n)),S=Math.max(m,Math.min(x,be)),F=Math.max(S,Math.min(x,we));S===be&&F===we||ze(oe(M,S),oe(M,F),!0)},hr=l=>c=>{if(i||!Q||e.mode!=="vernier")return;Bt(l);let m=0,x=!1,S=!1;switch(c.key){case"ArrowRight":case"ArrowUp":m=1;break;case"ArrowLeft":case"ArrowDown":m=-1;break;case"PageUp":m=5;break;case"PageDown":m=-5;break;case"Home":x=!0;break;case"End":S=!0;break;default:return}if(c.preventDefault(),l==="macro-low"){const F=oe(A,Ne),z=oe(A,Ye);if($t){const T=Sr(Me,A,F,Me[0],z,m,x,S);if(T===ve(Me,F,A))return;const se=Me[T];Ct(se,z,!0),gr(se,z);return}let E;if(x?E=je:S?E=Ye:E=Math.max(je,Math.min(Ye,Ne+m)),E===Ne)return;const X=oe(A,E);Ct(X,z,!0),gr(X,z)}else if(l==="macro-high"){const F=oe(A,Ne),z=oe(A,Ye);if($t){const T=Sr(Me,A,z,F,Me[Me.length-1],m,x,S);if(T===ve(Me,z,A))return;const se=Me[T];Ct(F,se,!0),gr(F,se);return}let E;if(x?E=Ne:S?E=Rt:E=Math.max(Ne,Math.min(Rt,Ye+m)),E===Ye)return;const X=oe(A,E);Ct(F,X,!0),gr(F,X)}else if(l==="micro-low"){const F=oe(M,be),z=oe(M,we);if(We){const X=Sr(ae,M,F,ae[0],z,m,x,S);if(X===ve(ae,F,M))return;ze(ae[X],z,!0);return}let E;if(x?E=Se:S?E=we:E=Math.max(Se,Math.min(we,be+m)),E===be)return;ze(oe(M,E),z,!0)}else if(l==="micro-high"){const F=oe(M,be),z=oe(M,we);if(We){const X=Sr(ae,M,z,F,ae[ae.length-1],m,x,S);if(X===ve(ae,z,M))return;ze(F,ae[X],!0);return}let E;if(x?E=be:S?E=Be:E=Math.max(be,Math.min(Be,we+m)),E===we)return;ze(F,oe(M,E),!0)}},ma=o.useCallback(l=>{const c=L.current;if(!c.disabled)if(c.mode==="point"){const m=Math.max(N,Math.min(O,ce+l));fe||B([m,m]),Ge(m,m,!0)}else if(c.mode==="vernier"){if(We){const T=ae.length-1,se=ve(ae,st,M),_e=ve(ae,ct,M),dt=_e-se;let $e=se+l,de=_e+l;l<0&&$e<0?($e=0,de=Math.min(T,dt)):l>0&&de>T&&(de=T,$e=Math.max(0,T-dt)),($e!==se||de!==_e)&&ze(ae[$e],ae[de],!0);return}const m=be,x=we,S=Se,F=Be,z=x-m;let E=m+l,X=x+l;l<0&&E<S?(E=S,X=Math.min(F,E+z)):l>0&&X>F&&(X=F,E=Math.max(S,X-z)),(E!==m||X!==x)&&ze(oe(M,E),oe(M,X),!0)}else{const m=ue-ce;let x=ce+l,S=ue+l;l<0&&x<N?(x=N,S=Math.min(O,x+m)):l>0&&S>O&&(S=O,x=Math.max(N,S-m)),x<=S&&(fe||B([x,S]),Ge(x,S,!0))}},[ce,ue,N,O,fe,Ge,ze,be,we,Se,Be,M,We,ae,st,ct]),At=ur(ce),Et=ur(ue),Or=re(ce),Fr=re(ue),Vr=o.useMemo(()=>k?Xt===null?void 0:{estimatedWidthPx:Xt.widthPx,estimatedHeightPx:Xt.heightPx}:zr(Xt,nn),[k,Xt,nn]),br=!k&&ce===ue,Ee=o.useMemo(()=>{if(k||!y||d)return Zr(P,Vr);const l=Qr(At,Et,Nt,P,Vr);return br?Xn(l):l},[k,br,y,d,At,Et,Nt,P,Vr]),Kt=R==="low"||R!=="high"&&Qe==="low",Wt=!k&&(R==="high"||R!=="low"&&Qe==="high"),wr=Ne===Ye,xr=be===we,fa=wr&&Te!=="macro-low",ga=wr&&Te==="macro-low",ha=xr&&Te!=="micro-low",ba=xr&&Te==="micro-low",Mn=D?"top":"bottom",pn=D?"bottom":"top",vn=o.useMemo(()=>zr(an,on),[an,on]),Dn=o.useMemo(()=>zr(ln,sn),[ln,sn]),Mr=y&&!d,pr=o.useMemo(()=>Cn(pe,Ae,Nt,Mn,vn,wr,Mr),[pe,Ae,Nt,Mn,vn,wr,Mr]),vr=o.useMemo(()=>Cn(Ve,rt,Nt,pn,Dn,xr,Mr),[Ve,rt,Nt,pn,Dn,xr,Mr]),wa=o.useMemo(()=>d?{"--ps-tooltip-origin":"100% 50%","--ps-tooltip-tx":"0px","--ps-tooltip-ty":"-50%","--ps-tooltip-rot":"0deg"}:{"--ps-tooltip-origin":"50% 50%","--ps-tooltip-tx":`calc(-50% + ${Ee.lowOffsetX}px)`,"--ps-tooltip-ty":`calc(-50% + ${Ee.lowOffsetY}px)`,"--ps-tooltip-rot":`${Ee.lowAngleDeg}deg`},[d,Ee.lowOffsetX,Ee.lowOffsetY,Ee.lowAngleDeg]),xa=o.useMemo(()=>d?{"--ps-tooltip-origin":"100% 50%","--ps-tooltip-tx":"0px","--ps-tooltip-ty":"-50%","--ps-tooltip-rot":"0deg"}:{"--ps-tooltip-origin":"50% 50%","--ps-tooltip-tx":`calc(-50% + ${Ee.highOffsetX}px)`,"--ps-tooltip-ty":`calc(-50% + ${Ee.highOffsetY}px)`,"--ps-tooltip-rot":`${Ee.highAngleDeg}deg`},[d,Ee.highOffsetX,Ee.highOffsetY,Ee.highAngleDeg]),Dr=Math.min(At,Et),yn=Math.max(At,Et),Ma=d?{bottom:`${Dr}%`,height:`${yn-Dr}%`,top:"auto",left:"0",right:"0"}:{left:`${Dr}%`,width:`${yn-Dr}%`,top:"0",bottom:"0"},pa=Math.max(.01,Ae-pe),Tn=Math.max(.06,Math.min(.25,.28*Math.sqrt(pa))),va=d?{bottom:`${At}%`,left:"50%",transform:"translate(-50%, 50%)",zIndex:Kt?40:30}:{left:`${At}%`,top:"50%",transform:"translate(-50%, -50%)",zIndex:Kt?40:30},Da=d?{bottom:`${Et}%`,left:"50%",transform:"translate(-50%, 50%)",zIndex:Wt?40:30}:{left:`${Et}%`,top:"50%",transform:"translate(-50%, -50%)",zIndex:Wt?40:30},ya=d?{bottom:`${Ut}%`,left:"50%",transform:"translate(-50%, 50%)"}:{left:`${Ut}%`,top:"50%",transform:"translate(-50%, -50%)"},Sn=ye!==null?re(ye):null,Ta=We?q(M,ae[0]):Se,Sa=We?q(M,ae[ae.length-1]):Be,La=i||(Q?be<=Ta:k?ce<=N:ce<=N&&ue<=N),Ra=i||(Q?we>=Sa:(k||ce>=O)&&ue>=O),ut=i?"cursor-not-allowed opacity-50":"cursor-pointer",Ln=l=>{const c=d?"vertical":"horizontal",m=l==="decrease",x=Oa[c][l];return g.jsx("button",{type:"button",className:`period-slider-stepper-btn relative after:absolute after:inset-[-11px] after:content-[''] ${x} flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-slate-300 bg-white font-bold text-[10px] text-slate-700 leading-none shadow-2xs transition-all hover:bg-slate-100 hover:text-indigo-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 active:scale-95 disabled:cursor-not-allowed disabled:opacity-30 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 ${ut}`,onClick:()=>ma(m?-1:1),disabled:m?La:Ra,"aria-label":m?J:I,children:ja[c][l]})};return g.jsxs("div",{style:e.style,className:`period-slider flex select-none items-center gap-2 ${d?"flex-col":"flex-row"} ${u}`,"data-disabled":i?"true":void 0,"data-unit":t,"data-mode":e.mode,"data-orientation":d?"vertical":"horizontal","data-label-position":P,"data-color-scheme":ee,children:[b&&Ln(d?"increase":"decrease"),g.jsx("div",{ref:nt,"data-testid":"period-slider-track","data-orientation":d?"vertical":"horizontal","data-vernier-orientation":Q?wt:void 0,className:`period-slider-track relative flex-1 touch-none rounded-full bg-slate-200 dark:bg-slate-700 ${d?"h-48 w-2":"h-2 w-full"} ${ut}`,onPointerDown:ca,onPointerMove:ua,onPointerLeave:da,children:Q?g.jsxs(g.Fragment,{children:[ar&&(d?g.jsxs("svg",{className:"period-slider-vernier-projection is-vertical",role:"presentation","aria-hidden":"true",width:"32",height:"100%",viewBox:"0 0 32 100",preserveAspectRatio:"none",children:[g.jsx("defs",{children:g.jsxs("linearGradient",{id:U,x1:"0",y1:"0",x2:"1",y2:"0",children:[g.jsx("stop",{offset:"0%",stopColor:D?Y.macro:Y.micro,stopOpacity:"0.28"}),g.jsx("stop",{offset:"100%",stopColor:D?Y.micro:Y.macro,stopOpacity:Tn})]})}),g.jsx("polygon",{points:D?`12,${(1-Ae)*100} 12,${(1-pe)*100} 20,100 20,0`:`12,0 12,100 20,${(1-pe)*100} 20,${(1-Ae)*100}`,fill:`url(#${U})`})]}):g.jsxs("svg",{className:"period-slider-vernier-projection",role:"presentation","aria-hidden":"true",width:"100%",height:"32",viewBox:"0 0 100 32",preserveAspectRatio:"none",children:[g.jsx("defs",{children:g.jsxs("linearGradient",{id:U,x1:"0",y1:"0",x2:"0",y2:"1",children:[g.jsx("stop",{offset:"0%",stopColor:D?Y.macro:Y.micro,stopOpacity:"0.28"}),g.jsx("stop",{offset:"100%",stopColor:D?Y.micro:Y.macro,stopOpacity:Tn})]})}),g.jsx("polygon",{points:D?`${pe*100},12 ${Ae*100},12 100,20 0,20`:`0,12 100,12 ${Ae*100},20 ${pe*100},20`,fill:`url(#${U})`})]})),!p&&g.jsxs(g.Fragment,{children:[g.jsx("div",{"data-testid":"period-slider-connect-macro",className:"period-slider-connect-macro",style:d?{bottom:`calc(${pe*100}% - 8px)`,height:`calc(${Math.max(0,(Ae-pe)*100)}% + 16px)`}:{left:`calc(${pe*100}% - 8px)`,width:`calc(${Math.max(0,(Ae-pe)*100)}% + 16px)`},onPointerDown:Yt("macro-connect")}),g.jsx("div",{"data-testid":"period-slider-connect-micro",className:"period-slider-connect-micro",style:d?{bottom:`calc(${Ve*100}% - 8px)`,height:`calc(${Math.max(0,(rt-Ve)*100)}% + 16px)`}:{left:`calc(${Ve*100}% - 8px)`,width:`calc(${Math.max(0,(rt-Ve)*100)}% + 16px)`},onPointerDown:Yt("micro-connect")})]}),or&&g.jsxs("div",{className:"period-slider-vernier-ticks pointer-events-none absolute inset-0",children:[[.2,.4,.6,.8].map(l=>g.jsx("div",{"data-testid":"period-slider-tick","data-tick-scale":"macro",className:"period-slider-tick period-slider-tick-macro",style:d?{bottom:`${l*100}%`}:{left:`${l*100}%`}},`macro-tick-${l}`)),[.1,.2,.3,.4,.5,.6,.7,.8,.9].map(l=>g.jsx("div",{"data-testid":"period-slider-tick","data-tick-scale":"micro",className:"period-slider-tick period-slider-tick-micro",style:d?{bottom:`${l*100}%`}:{left:`${l*100}%`}},`micro-tick-${l}`))]}),g.jsxs("div",{tabIndex:i?-1:0,role:"slider","aria-label":e.macroLowerAriaLabel??"Macro range start","aria-disabled":i?"true":void 0,"aria-valuemin":je,"aria-valuemax":Ye,"aria-valuenow":Ne,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(sr,A):pt(A,sr,h,v),"aria-orientation":d?"vertical":"horizontal",className:`period-slider-handle period-slider-handle-vernier ${d?"is-vertical":""} group absolute touch-none ${d?D?"after:absolute after:-inset-y-3 after:right-0 after:-left-4":"after:absolute after:-inset-y-3 after:-right-4 after:left-0":D?"after:absolute after:-inset-x-3 after:-top-4 after:bottom-0":"after:absolute after:-inset-x-3 after:top-0 after:-bottom-4"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${ut}`,style:d?{bottom:`${pe*100}%`,left:D?0:"auto",right:D?"auto":0,transform:D?"translate(-100%, 50%)":"translate(100%, 50%)",zIndex:Ce==="macro-low"||Te==="macro-low"?30:15}:{left:`${pe*100}%`,top:D?0:"auto",bottom:D?"auto":0,transform:D?"translate(-50%, -100%)":"translate(-50%, 100%)",zIndex:Ce==="macro-low"||Te==="macro-low"?30:15},onPointerDown:Yt("macro-low"),onKeyDown:hr("macro-low"),onFocus:fr("macro-low"),"data-active":Ce==="macro-low"?"true":void 0,"data-front":Te==="macro-low"?"true":void 0,"data-vernier-pos":d?D?"left":"right":D?"top":"bottom","data-handle-type":"macro-low",children:[g.jsx(er,{type:"macro",isTop:D,isVertical:d,isLeft:D}),Tt&&g.jsx("div",{className:"period-slider-hairline"}),f!=="hover"&&g.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${f==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":f,"data-duplicate":fa?"true":void 0,"data-slanted":pr.slant.isSlanted?"true":void 0,ref:aa,style:pr.lowStyle,children:Oe(A,sr,h,v)})]}),g.jsxs("div",{tabIndex:i?-1:0,role:"slider","aria-label":e.macroUpperAriaLabel??"Macro range end","aria-disabled":i?"true":void 0,"aria-valuemin":Ne,"aria-valuemax":Rt,"aria-valuenow":Ye,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(cr,A):pt(A,cr,h,v),"aria-orientation":d?"vertical":"horizontal",className:`period-slider-handle period-slider-handle-vernier ${d?"is-vertical":""} group absolute touch-none ${d?D?"after:absolute after:-inset-y-3 after:right-0 after:-left-4":"after:absolute after:-inset-y-3 after:-right-4 after:left-0":D?"after:absolute after:-inset-x-3 after:-top-4 after:bottom-0":"after:absolute after:-inset-x-3 after:top-0 after:-bottom-4"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${ut}`,style:d?{bottom:`${Ae*100}%`,left:D?0:"auto",right:D?"auto":0,transform:D?"translate(-100%, 50%)":"translate(100%, 50%)",zIndex:Ce==="macro-high"||Te==="macro-high"?30:15}:{left:`${Ae*100}%`,top:D?0:"auto",bottom:D?"auto":0,transform:D?"translate(-50%, -100%)":"translate(-50%, 100%)",zIndex:Ce==="macro-high"||Te==="macro-high"?30:15},onPointerDown:Yt("macro-high"),onKeyDown:hr("macro-high"),onFocus:fr("macro-high"),"data-active":Ce==="macro-high"?"true":void 0,"data-front":Te==="macro-high"?"true":void 0,"data-vernier-pos":d?D?"left":"right":D?"top":"bottom","data-handle-type":"macro-high",children:[g.jsx(er,{type:"macro",isTop:D,isVertical:d,isLeft:D}),Tt&&g.jsx("div",{className:"period-slider-hairline"}),f!=="hover"&&g.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${f==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":f,"data-duplicate":ga?"true":void 0,"data-slanted":pr.slant.isSlanted?"true":void 0,ref:oa,style:pr.highStyle,children:Oe(A,cr,h,v)})]}),g.jsxs("div",{tabIndex:i?-1:0,role:"slider","aria-label":e.lowerAriaLabel??"Micro range start","aria-disabled":i?"true":void 0,"aria-valuemin":Se,"aria-valuemax":we,"aria-valuenow":be,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(st,M):pt(M,st,C,v),"aria-orientation":d?"vertical":"horizontal",className:`period-slider-handle period-slider-handle-vernier ${d?"is-vertical":""} group absolute touch-none ${d?D?"after:absolute after:-inset-y-3 after:-right-4 after:left-0":"after:absolute after:-inset-y-3 after:right-0 after:-left-4":D?"after:absolute after:-inset-x-3 after:top-0 after:-bottom-4":"after:absolute after:-inset-x-3 after:-top-4 after:bottom-0"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${ut}`,style:d?{bottom:`${Ve*100}%`,left:D?"auto":0,right:D?0:"auto",transform:D?"translate(100%, 50%)":"translate(-100%, 50%)",zIndex:Ce==="micro-low"||Te==="micro-low"?30:20}:{left:`${Ve*100}%`,top:D?"auto":0,bottom:D?0:"auto",transform:D?"translate(-50%, 100%)":"translate(-50%, -100%)",zIndex:Ce==="micro-low"||Te==="micro-low"?30:20},onPointerDown:Yt("micro-low"),onKeyDown:hr("micro-low"),onFocus:fr("micro-low"),"data-active":Ce==="micro-low"?"true":void 0,"data-front":Te==="micro-low"?"true":void 0,"data-vernier-pos":d?D?"right":"left":D?"bottom":"top","data-handle-type":"micro-low",children:[g.jsx(er,{type:"micro",isTop:!D,isVertical:d,isLeft:!D}),Tt&&g.jsx("div",{className:"period-slider-hairline"}),f!=="hover"&&g.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${f==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":f,"data-duplicate":ha?"true":void 0,"data-slanted":vr.slant.isSlanted?"true":void 0,ref:ia,style:vr.lowStyle,children:Oe(M,st,C,v)})]}),g.jsxs("div",{tabIndex:i?-1:0,role:"slider","aria-label":e.upperAriaLabel??"Micro range end","aria-disabled":i?"true":void 0,"aria-valuemin":be,"aria-valuemax":Be,"aria-valuenow":we,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(ct,M):pt(M,ct,C,v),"aria-orientation":d?"vertical":"horizontal",className:`period-slider-handle period-slider-handle-vernier ${d?"is-vertical":""} group absolute touch-none ${d?D?"after:absolute after:-inset-y-3 after:-right-4 after:left-0":"after:absolute after:-inset-y-3 after:right-0 after:-left-4":D?"after:absolute after:-inset-x-3 after:top-0 after:-bottom-4":"after:absolute after:-inset-x-3 after:-top-4 after:bottom-0"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${ut}`,style:d?{bottom:`${rt*100}%`,left:D?"auto":0,right:D?0:"auto",transform:D?"translate(100%, 50%)":"translate(-100%, 50%)",zIndex:Ce==="micro-high"||Te==="micro-high"?30:20}:{left:`${rt*100}%`,top:D?"auto":0,bottom:D?0:"auto",transform:D?"translate(-50%, 100%)":"translate(-50%, -100%)",zIndex:Ce==="micro-high"||Te==="micro-high"?30:20},onPointerDown:Yt("micro-high"),onKeyDown:hr("micro-high"),onFocus:fr("micro-high"),"data-active":Ce==="micro-high"?"true":void 0,"data-front":Te==="micro-high"?"true":void 0,"data-vernier-pos":d?D?"right":"left":D?"bottom":"top","data-handle-type":"micro-high",children:[g.jsx(er,{type:"micro",isTop:!D,isVertical:d,isLeft:!D}),Tt&&g.jsx("div",{className:"period-slider-hairline"}),f!=="hover"&&g.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${f==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":f,"data-duplicate":ba?"true":void 0,"data-slanted":vr.slant.isSlanted?"true":void 0,ref:la,style:vr.highStyle,children:Oe(M,ct,C,v)})]})]}):g.jsxs(g.Fragment,{children:[!p&&g.jsx("div",{"data-testid":"period-slider-connect",className:"period-slider-connect absolute rounded-full",style:Ma,onPointerDown:sa}),V&&$&&w.length>1&&g.jsx("div",{className:"period-slider-ticks pointer-events-none absolute inset-0",children:w.map((l,c)=>{const m=q(t,l),x=ur(c),S=d?{bottom:`${x}%`,left:"50%",transform:"translate(-50%, 50%)"}:{left:`${x}%`,top:"50%",transform:"translate(-50%, -50%)"};return g.jsx("div",{"data-testid":"period-slider-tick",className:"period-slider-tick absolute h-1.5 w-1.5 rounded-full bg-slate-400/60 dark:bg-slate-500/60",style:S},`tick-${m}`)})}),!i&&ye!==null&&Ut!==null&&R===null&&Sn&&g.jsxs("div",{"data-testid":"period-slider-hover-guide",className:"period-slider-hover-guide pointer-events-none absolute z-20 h-2 w-2",style:ya,children:[g.jsx("div",{"data-testid":"period-slider-hover-dot",className:"period-slider-hover-dot h-full w-full rounded-full border border-white/80 bg-[var(--aqps-accent-light)] shadow-[0_0_6px_var(--aqps-accent-glow)] dark:border-slate-800"}),g.jsx("div",{className:`period-slider-hover-tooltip ${P==="bottom"&&!d?"period-slider-hover-tooltip-bottom":""} rounded bg-slate-800/90 px-2 py-0.5 font-medium text-white text-xs shadow-lg backdrop-blur-xs dark:bg-slate-900/90`,children:Oe(t,Sn,e.formatLabel,v)})]}),g.jsxs("div",{tabIndex:i?-1:0,role:"slider","aria-label":k?e.pointAriaLabel??"Selected date":e.lowerAriaLabel??"Range start","aria-disabled":i?"true":void 0,"aria-valuemin":N,"aria-valuemax":k?O:ue,"aria-valuenow":ce,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(Or,t):pt(t,Or,e.formatLabel,v),"aria-orientation":d?"vertical":"horizontal",className:`period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:outline-none ${ut}`,style:va,onPointerDown:bn("low"),onKeyDown:xn("low"),onFocus:wn("low"),"data-active":R==="low"?"true":void 0,"data-front":Kt?"true":void 0,children:[g.jsx("div",{"data-testid":"period-slider-knob",className:`period-slider-knob h-full w-full rounded-full border-2 border-white bg-[var(--aqps-accent-color)] group-focus-visible:ring-2 group-focus-visible:ring-blue-600 group-focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-[var(--aqps-accent-light)] ${R==="low"?"":"shadow-md"}`}),f!=="hover"&&g.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${f==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":f,"data-label-position":P,"data-slanted":Ee.isSlanted?"true":void 0,"data-front":Kt?"true":void 0,"data-duplicate":br&&!Kt?"true":void 0,ref:ra,style:wa,children:Oe(t,Or,e.formatLabel,v)})]}),!k&&g.jsxs("div",{tabIndex:i?-1:0,role:"slider","aria-label":e.upperAriaLabel??"Range end","aria-disabled":i?"true":void 0,"aria-valuemin":ce,"aria-valuemax":O,"aria-valuenow":ue,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(Fr,t):pt(t,Fr,e.formatLabel,v),"aria-orientation":d?"vertical":"horizontal",className:`period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:outline-none ${ut}`,style:Da,onPointerDown:bn("high"),onKeyDown:xn("high"),onFocus:wn("high"),"data-active":R==="high"?"true":void 0,"data-front":Wt?"true":void 0,children:[g.jsx("div",{"data-testid":"period-slider-knob",className:`period-slider-knob h-full w-full rounded-full border-2 border-white bg-[var(--aqps-accent-color)] group-focus-visible:ring-2 group-focus-visible:ring-blue-600 group-focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-[var(--aqps-accent-light)] ${R==="high"?"":"shadow-md"}`}),f!=="hover"&&g.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${f==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":f,"data-label-position":P,"data-slanted":Ee.isSlanted?"true":void 0,"data-front":Wt?"true":void 0,"data-duplicate":br&&!Wt?"true":void 0,ref:na,style:xa,children:Oe(t,Fr,e.formatLabel,v)})]})]})}),b&&Ln(d?"decrease":"increase")]})},_r=(e,t)=>{if(e===t)return!0;if(!(e&&t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r].getTime()!==t[r].getTime())return!1;return!0},Gn=(e,t)=>{if(e===t)return!0;if(!(e&&t))return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const a of r)if(e[a]!==t[a])return!1;return!0},Va=(e,t)=>e===t?!0:e.mode!==t.mode||e.unit!==t.unit||e.minDate.getTime()!==t.minDate.getTime()||e.maxDate.getTime()!==t.maxDate.getTime()||e.labelPosition!==t.labelPosition||e.autoSlantLabels!==t.autoSlantLabels||e.isVertical!==t.isVertical||e.hideConnectBar!==t.hideConnectBar||e.showTicks!==t.showTicks||e.disabled!==t.disabled||e.showStepper!==t.showStepper||e.debounceMs!==t.debounceMs||e.tooltipStyle!==t.tooltipStyle||e.colorScheme!==t.colorScheme||e.className!==t.className||!Gn(e.style,t.style)||e.snapMode!==t.snapMode||e.formatLabel!==t.formatLabel||e.locale!==t.locale||e.lowerAriaLabel!==t.lowerAriaLabel||e.upperAriaLabel!==t.upperAriaLabel||e.pointAriaLabel!==t.pointAriaLabel||e.macroLowerAriaLabel!==t.macroLowerAriaLabel||e.macroUpperAriaLabel!==t.macroUpperAriaLabel||e.decreaseAriaLabel!==t.decreaseAriaLabel||e.increaseAriaLabel!==t.increaseAriaLabel||e.formatAriaValueText!==t.formatAriaValueText||!_r(e.allowedDates,t.allowedDates)?!1:e.mode==="point"&&t.mode==="point"?!((e.value?.getTime()??null)!==(t.value?.getTime()??null)||(e.defaultValue?.getTime()??null)!==(t.defaultValue?.getTime()??null)||e.onChangePoint!==t.onChangePoint):e.mode==="range"&&t.mode==="range"?!((e.range?.[0]?.getTime()??null)!==(t.range?.[0]?.getTime()??null)||(e.range?.[1]?.getTime()??null)!==(t.range?.[1]?.getTime()??null)||(e.defaultRange?.[0]?.getTime()??null)!==(t.defaultRange?.[0]?.getTime()??null)||(e.defaultRange?.[1]?.getTime()??null)!==(t.defaultRange?.[1]?.getTime()??null)||e.onChangeRange!==t.onChangeRange):e.mode==="vernier"&&t.mode==="vernier"?!((e.microRange?.[0]?.getTime()??null)!==(t.microRange?.[0]?.getTime()??null)||(e.microRange?.[1]?.getTime()??null)!==(t.microRange?.[1]?.getTime()??null)||(e.defaultMicroRange?.[0]?.getTime()??null)!==(t.defaultMicroRange?.[0]?.getTime()??null)||(e.defaultMicroRange?.[1]?.getTime()??null)!==(t.defaultMicroRange?.[1]?.getTime()??null)||e.macroRange[0].getTime()!==t.macroRange[0].getTime()||e.macroRange[1].getTime()!==t.macroRange[1].getTime()||e.vernierOrientation!==t.vernierOrientation||e.showVernierProjection!==t.showVernierProjection||e.showVernierTicks!==t.showVernierTicks||e.showHairline!==t.showHairline||e.macroUnit!==t.macroUnit||e.microUnit!==t.microUnit||e.macroIsDiscrete!==t.macroIsDiscrete||e.microIsDiscrete!==t.microIsDiscrete||e.formatMacroLabel!==t.formatMacroLabel||e.formatMicroLabel!==t.formatMicroLabel||e.onChangeMicroRange!==t.onChangeMicroRange||e.onChangeMacroRange!==t.onChangeMacroRange||!_r(e.macroAllowedDates,t.macroAllowedDates)||!_r(e.microAllowedDates,t.microAllowedDates)):!1,Jn=o.memo(Fa,Va);Jn.displayName="PeriodSlider";const Ze=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t},tr=(e,t)=>{if(Number.isNaN(t.getTime()))throw new RangeError(`DateSelector: "${e}" must be a valid Date (received ${String(t)})`)},Ua=e=>{if(e!==void 0)try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{throw new RangeError(`DateSelector: "locale" must be a valid BCP 47 language tag (received ${JSON.stringify(e)})`)}},Dt=(e,t,r)=>{const n=new Date(e,t-1,r);return n.setFullYear(e),n.setHours(0,0,0,0),n},Nn=e=>Dt(e,1,1),Ba=e=>Dt(e,12,31),za={year:{year:"numeric"},month:{month:"2-digit"},day:{day:"2-digit"}},_a={year:4,month:2,day:2},Xa={year:e=>e.getFullYear(),month:e=>e.getMonth()+1,day:e=>e.getDate()},Yn=new Map,qa=(e,t)=>{const r=`${e}\0${t}`,n=Yn.get(r);if(n!==void 0)return n;const a=new Intl.DateTimeFormat(t,za[e]);return Yn.set(r,a),a},Xr=(e,t,r)=>r===void 0?String(Xa[e](t)).padStart(_a[e],"0"):qa(e,r).format(t),Ka=(e,t,r)=>{const n=t?.getTime()??null,a=r?.getTime()??null,s=new Map;return e.forEach((i,u)=>{tr(`allowedDates[${u}]`,i);const b=Ze(i),f=b.getTime();n!==null&&f<n||a!==null&&f>a||s.has(f)||s.set(f,b)}),Array.from(s.keys()).sort((i,u)=>i-u).map(i=>s.get(i))},Wa=(e,t)=>{const r=[];let n=Ze(e);const a=Ze(t).getTime();for(;n.getTime()<=a;)r.push(n),n=Le.addDays(n,1);return r},An=(e,t)=>{const r=[];for(let n=e.length-1;n>=0;n--)r.push({label:Oe("day",e[n],void 0,t),value:Le.format(e[n],"yyyy-MM-dd")});return r},Ga=e=>{const{value:t,initialDate:r,onChange:n,children:a,minYear:s,maxYear:i,minDate:u,maxDate:b,allowedDates:f,variant:P="date",className:y="",style:d,disabled:p=!1,prevDateAriaLabel:V="Previous day",nextDateAriaLabel:ee="Next day",selectAriaLabel:v="Date",yearAriaLabel:J="Year",monthAriaLabel:I="Month",dayAriaLabel:te="Day",locale:Y,formatYearOption:U,formatMonthOption:L,formatDayOption:_}=e;if(Ua(Y),t!==void 0&&tr("value",t),r!==void 0&&tr("initialDate",r),u!==void 0&&tr("minDate",u),b!==void 0&&tr("maxDate",b),s!==void 0&&!Number.isInteger(s))throw new RangeError(`DateSelector: "minYear" must be an integer year (received ${String(s)})`);if(i!==void 0&&!Number.isInteger(i))throw new RangeError(`DateSelector: "maxYear" must be an integer year (received ${String(i)})`);if(P==="split-dropdown"&&f!==void 0)throw new RangeError('DateSelector: variant="split-dropdown" cannot honour "allowedDates"; use variant="dropdown" or variant="date" for a discrete date set');const H=t??r;if(H===void 0)throw new RangeError("DateSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected date is never inferred from the wall clock.");const[w,$]=o.useState(()=>Ze(H)),N=t!==void 0,O=t?.getTime(),k=o.useMemo(()=>t!==void 0?Ze(t):w,[O,w]),re=u?.getTime(),De=b?.getTime(),Z=o.useMemo(()=>{const h=u?Ze(u):null,C=s!==void 0?Nn(s):null;return h===null?C:C===null||h.getTime()>=C.getTime()?h:C},[re,s]),ne=o.useMemo(()=>{const h=b?Ze(b):null,C=i!==void 0?Ba(i):null;return h===null?C:C===null||h.getTime()<=C.getTime()?h:C},[De,i]),ie=Z?.getTime()??null,me=ne?.getTime()??null;if(Z!==null&&ne!==null&&Z.getTime()>ne.getTime())throw new RangeError(`DateSelector: the resolved range is empty (min ${Le.format(Z,"yyyy-MM-dd")} is after max ${Le.format(ne,"yyyy-MM-dd")})`);if(P!=="date"&&f===void 0&&(Z===null||ne===null))throw new RangeError(`DateSelector: variant="${P}" needs a bounded range; supply minDate/minYear and maxDate/maxYear${P==="dropdown"?' or supply "allowedDates"':""}`);const W=f===void 0?null:f.map(h=>h.getTime()).join(","),K=o.useMemo(()=>f===void 0?null:Ka(f,Z,ne),[W,ie,me]),ke=h=>{const C=h.getTime();return K!==null?K.some(Pe=>Pe.getTime()===C):!(ie!==null&&C<ie||me!==null&&C>me)},bt=H.getTime();o.useEffect(()=>{N||$(Ze(H))},[N,bt]);const He=h=>{if(p)return;const C=Ze(h);ke(C)&&(N||$(C),n?.(C))},Re=k.getTime(),fe=ke(k),j=o.useMemo(()=>{if(K!==null){for(let C=K.length-1;C>=0;C--)if(K[C].getTime()<Re)return K[C];return null}const h=Le.addDays(new Date(Re),-1);return ke(h)?h:null},[K,Re,ie,me]),B=o.useMemo(()=>{if(K!==null){for(const C of K)if(C.getTime()>Re)return C;return null}const h=Le.addDays(new Date(Re),1);return ke(h)?h:null},[K,Re,ie,me]),G=p||j===null,ge=p||B===null,R=()=>{j!==null&&He(j)},xe=()=>{B!==null&&He(B)},Fe=h=>{if(h.target.value){const C=Le.parseISO(h.target.value);Number.isNaN(C.getTime())||He(C)}},Qe=h=>{if(h.target.value){const C=Le.parseISO(h.target.value);Number.isNaN(C.getTime())||He(C)}},le=k.getFullYear(),ye=k.getMonth()+1,et=k.getDate(),Ut=o.useMemo(()=>P!=="dropdown"?[]:K!==null?An(K,Y):Z===null||ne===null?[]:An(Wa(Z,ne),Y),[P,K,ie,me,Y]),nr=o.useMemo(()=>{if(P!=="split-dropdown"||Z===null||ne===null)return[];const h=[];for(let C=ne.getFullYear();C>=Z.getFullYear();C--)h.push(C);return h},[P,ie,me]),ce=o.useMemo(()=>{if(P!=="split-dropdown"||Z===null||ne===null)return[];const h=Z,C=ne,Pe=le===h.getFullYear()?h.getMonth()+1:1,Lt=le===C.getFullYear()?C.getMonth()+1:12,xt=[];for(let tt=Pe;tt<=Lt;tt++)xt.push(tt);return xt},[P,ie,me,le]),ue=o.useMemo(()=>{if(P!=="split-dropdown"||Z===null||ne===null)return[];const h=Z,C=ne,Pe=le===h.getFullYear()&&ye===h.getMonth()+1?h.getDate():1,Lt=le===C.getFullYear()&&ye===C.getMonth()+1?C.getDate():Le.getDaysInMonth(new Date(Re)),xt=[];for(let tt=Pe;tt<=Lt;tt++)xt.push(tt);return xt},[P,ie,me,Re,le,ye]),yt=(h,C,Pe)=>Pe>Le.getDaysInMonth(Dt(h,C,1))?!1:ke(Dt(h,C,Pe)),Q=(h,C,Pe)=>{yt(h,C,Pe)&&He(Dt(h,C,Pe))},wt=h=>U?U(h):Xr("year",Nn(h),Y),D=h=>L?L(h):Xr("month",Dt(le,h,1),Y),ar=h=>_?_(h):Xr("day",Dt(le,ye,h),Y),or=Le.format(k,"yyyy-MM-dd"),Tt=Oe("day",k,void 0,Y),A=Z?Le.format(Z,"yyyy-MM-dd"):void 0,M=ne?Le.format(ne,"yyyy-MM-dd"):void 0,Pr=fe?or:"",St="text-center font-mono text-gray-500 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-400",ir=P==="split-dropdown"?"w-auto":"w-38";return g.jsxs("div",{className:`inline-flex items-center ${ir} ${y}`,style:d,"data-variant":P,"data-out-of-range":fe?void 0:"true",children:[g.jsx("button",{type:"button","aria-label":V,disabled:G,className:"relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",onClick:R,children:g.jsx("span",{className:"h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200"})}),P==="dropdown"?g.jsxs("select",{"aria-label":v,disabled:p,className:"mx-1 my-auto w-28 appearance-none rounded-md border border-gray-300 bg-gray-100 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums [text-align-last:center] [text-align:center] focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500",value:Pr,onChange:Qe,children:[fe?null:g.jsx("option",{value:"",disabled:!0,className:St,children:Tt}),Ut.map(h=>g.jsx("option",{value:h.value,className:"text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100",children:h.label},h.value))]}):P==="split-dropdown"?g.jsxs("div",{className:"mx-1 my-auto inline-flex items-center gap-1",children:[g.jsxs("select",{"aria-label":J,disabled:p,className:"rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",value:fe?le:"",onChange:h=>Q(Number(h.target.value),ye,et),children:[fe?null:g.jsx("option",{value:"",disabled:!0,className:St,children:wt(le)}),nr.map(h=>g.jsx("option",{value:h,disabled:!yt(h,ye,et),className:"dark:bg-slate-700 dark:text-slate-100",children:wt(h)},h))]}),g.jsxs("select",{"aria-label":I,disabled:p,className:"rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",value:fe?ye:"",onChange:h=>Q(le,Number(h.target.value),et),children:[fe?null:g.jsx("option",{value:"",disabled:!0,className:St,children:D(ye)}),ce.map(h=>g.jsx("option",{value:h,disabled:!yt(le,h,et),className:"dark:bg-slate-700 dark:text-slate-100",children:D(h)},h))]}),g.jsxs("select",{"aria-label":te,disabled:p,className:"rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",value:fe?et:"",onChange:h=>Q(le,ye,Number(h.target.value)),children:[fe?null:g.jsx("option",{value:"",disabled:!0,className:St,children:ar(et)}),ue.map(h=>g.jsx("option",{value:h,className:"dark:bg-slate-700 dark:text-slate-100",children:ar(h)},h))]})]}):g.jsx("input",{"aria-label":v,disabled:p,className:"mx-1 my-auto w-28 rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-gray-900 text-xs focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500 dark:placeholder:text-gray-400",value:or,min:A,max:M,onChange:Fe,type:"date"}),g.jsx("button",{type:"button","aria-label":ee,disabled:ge,className:"relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",onClick:xe,children:g.jsx("span",{className:"h-0 w-0 border-y-[6px] border-y-transparent border-l-[6px] border-l-slate-500 border-solid hover:border-l-slate-700 dark:border-l-slate-400 dark:hover:border-l-slate-200"})}),a]})},Ft=e=>e===void 0?null:Ze(e).getTime(),Zn=o.memo(Ga,(e,t)=>!(Ft(e.value??e.initialDate)!==Ft(t.value??t.initialDate)||Ft(e.minDate)!==Ft(t.minDate)||Ft(e.maxDate)!==Ft(t.maxDate)||e.variant!==t.variant||e.disabled!==t.disabled||e.className!==t.className||e.style!==t.style||e.minYear!==t.minYear||e.maxYear!==t.maxYear||e.onChange!==t.onChange||e.allowedDates!==t.allowedDates||e.children!==t.children||e.prevDateAriaLabel!==t.prevDateAriaLabel||e.nextDateAriaLabel!==t.nextDateAriaLabel||e.selectAriaLabel!==t.selectAriaLabel||e.yearAriaLabel!==t.yearAriaLabel||e.monthAriaLabel!==t.monthAriaLabel||e.dayAriaLabel!==t.dayAriaLabel||e.locale!==t.locale||e.formatYearOption!==t.formatYearOption||e.formatMonthOption!==t.formatMonthOption||e.formatDayOption!==t.formatDayOption));Zn.displayName="DateSelector";function Ke(e,t){const r=e+Math.floor(t/12),n=(t%12+12)%12,a=new Date(r,n,1);return a.setFullYear(r),a}function vt(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`}function Lr(e,t){if(e!==void 0&&(!(e instanceof Date)||Number.isNaN(e.getTime())))throw new RangeError(`MonthSelector: \`${t}\` must be a valid Date, received ${String(e)}.`)}function En(e,t){if(e!==void 0&&!Number.isInteger(e))throw new RangeError(`MonthSelector: \`${t}\` must be an integer year, received ${String(e)}.`)}function Ja(e){if(e!==void 0)try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{throw new RangeError(`MonthSelector: \`locale\` must be a valid BCP 47 language tag, received ${JSON.stringify(e)}.`)}}function Za(e,t){const r=e===void 0?null:Ke(e,0),n=t===void 0?null:Ke(t.getFullYear(),t.getMonth());return r!==null&&n!==null?r>=n?r:n:r!==null?r:n}function Qa(e,t){const r=e===void 0?null:Ke(e,11),n=t===void 0?null:Ke(t.getFullYear(),t.getMonth());return r!==null&&n!==null?r<=n?r:n:r!==null?r:n}function Qn(e,t){return{label:Oe("month",e,void 0,t),value:vt(e)}}function eo(e,t,r){const n=e.getFullYear()*12+e.getMonth(),a=t.getFullYear()*12+t.getMonth(),s=[];for(let i=a;i>=n;i--)s.push(Qn(Ke(Math.floor(i/12),i%12),r));return s}const to=e=>{const{value:t,initialDate:r,onChange:n,children:a,variant:s="date",minYear:i,maxYear:u,minDate:b,maxDate:f,isWarning:P=!1,className:y="",style:d,disabled:p=!1,prevMonthAriaLabel:V="Previous month",nextMonthAriaLabel:ee="Next month",selectAriaLabel:v="Month",locale:J}=e;Ja(J),Lr(t,"value"),Lr(r,"initialDate"),Lr(b,"minDate"),Lr(f,"maxDate"),En(i,"minYear"),En(u,"maxYear");const I=t??r;if(I===void 0)throw new RangeError("MonthSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected month is never inferred from the wall clock.");const[te,Y]=o.useState(()=>Ke(I.getFullYear(),I.getMonth())),U=t!==void 0,L=o.useMemo(()=>t!==void 0?Ke(t.getFullYear(),t.getMonth()):te,[t?.getTime(),te]),_=b?.getTime(),H=f?.getTime(),w=o.useMemo(()=>Za(i,b),[i,_]),$=o.useMemo(()=>Qa(u,f),[u,H]);if(w!==null&&$!==null&&w>$)throw new RangeError(`MonthSelector: the resolved lower bound ${vt(w)} is after the resolved upper bound ${vt($)}.`);if(s==="dropdown"&&(w===null||$===null))throw new RangeError('MonthSelector: variant="dropdown" requires a lower bound (`minYear` or `minDate`) and an upper bound (`maxYear` or `maxDate`); the option window is never invented.');const N=w!==null&&L<w||$!==null&&L>$,O=I.getTime();o.useEffect(()=>{if(U)return;const R=Ke(I.getFullYear(),I.getMonth());Y(xe=>xe.getTime()===R.getTime()?xe:R)},[U,O]);const k=R=>(w===null||R>=w)&&($===null||R<=$),re=R=>{if(p)return;if(!k(R))throw new RangeError(`MonthSelector: refusing to emit ${vt(R)}, which lies outside the declared bounds.`);U||Y(R);const xe=R.getFullYear()*100+(R.getMonth()+1);n?.(R,xe)},De=o.useMemo(()=>{const R=Ke(L.getFullYear(),L.getMonth()-1);return k(R)?R:null},[L,w?.getTime(),$?.getTime()]),Z=o.useMemo(()=>{const R=Ke(L.getFullYear(),L.getMonth()+1);return k(R)?R:null},[L,w?.getTime(),$?.getTime()]),ne=p||De===null,ie=p||Z===null,me=()=>{De!==null&&re(De)},W=()=>{Z!==null&&re(Z)},K=R=>{if(!R)return;const[xe,Fe]=R.split("-"),Qe=Number(xe),le=Number(Fe)-1;if(!(Number.isInteger(Qe)&&Number.isInteger(le)))return;const ye=Ke(Qe,le);k(ye)&&re(ye)},ke=R=>{K(R.target.value)},bt=R=>{K(R.target.value)},He=vt(L),Re=w?vt(w):void 0,fe=$?vt($):void 0,j=o.useMemo(()=>{if(s!=="dropdown"||w===null||$===null)return[];const R=eo(w,$,J);if(!N)return R;const xe=Qn(L,J);return[...R,xe].sort((Fe,Qe)=>Qe.value.localeCompare(Fe.value))},[s,w?.getTime(),$?.getTime(),N,L,J]),B=P?"border-amber-300 bg-amber-50 text-amber-900 focus:border-amber-500 focus:ring-amber-500 dark:border-amber-900/50 dark:bg-amber-950/20 dark:text-amber-200":"border-gray-300 bg-gray-100 text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500",G=`mx-1 my-auto w-28 rounded-md border py-0.5 px-1 text-xs dark:placeholder:text-gray-400 disabled:opacity-50 ${B}`,ge=`mx-1 my-auto w-28 appearance-none rounded-md border px-1 py-0.5 text-center font-mono text-xs tabular-nums [text-align-last:center] [text-align:center] disabled:opacity-50 ${B}`;return g.jsxs("div",{className:`inline-flex w-38 items-center ${y}`,style:d,children:[g.jsx("button",{type:"button","aria-label":V,disabled:ne,className:"relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",onClick:me,children:g.jsx("span",{className:"h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200"})}),s==="dropdown"?g.jsx("select",{"aria-label":v,disabled:p,className:ge,value:He,onChange:bt,children:j.map(R=>g.jsx("option",{value:R.value,className:"text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100",children:R.label},R.value))}):g.jsx("input",{"aria-label":v,disabled:p,className:G,value:He,min:Re,max:fe,onChange:ke,type:"month"}),g.jsx("button",{type:"button","aria-label":ee,disabled:ie,className:"relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",onClick:W,children:g.jsx("span",{className:"h-0 w-0 border-y-[6px] border-y-transparent border-l-[6px] border-l-slate-500 border-solid hover:border-l-slate-700 dark:border-l-slate-400 dark:hover:border-l-slate-200"})}),a]})},ea=o.memo(to,(e,t)=>{const r=e.value??e.initialDate,n=t.value??t.initialDate,a=r?r.getFullYear()*12+r.getMonth():null,s=n?n.getFullYear()*12+n.getMonth():null;if(a!==s||e.variant!==t.variant||e.disabled!==t.disabled||e.className!==t.className||e.style!==t.style||e.isWarning!==t.isWarning||e.minYear!==t.minYear||e.maxYear!==t.maxYear)return!1;const i=e.minDate?e.minDate.getFullYear()*12+e.minDate.getMonth():null,u=t.minDate?t.minDate.getFullYear()*12+t.minDate.getMonth():null;if(i!==u)return!1;const b=e.maxDate?e.maxDate.getFullYear()*12+e.maxDate.getMonth():null,f=t.maxDate?t.maxDate.getFullYear()*12+t.maxDate.getMonth():null;return!(b!==f||e.onChange!==t.onChange||e.children!==t.children||e.prevMonthAriaLabel!==t.prevMonthAriaLabel||e.nextMonthAriaLabel!==t.nextMonthAriaLabel||e.selectAriaLabel!==t.selectAriaLabel||e.locale!==t.locale)});ea.displayName="MonthSelector";function rr(e,t,r){if(!(r instanceof Date)||Number.isNaN(r.getTime()))throw new RangeError(`${e}: ${t} is required and must be a valid Date (received: ${String(r)})`)}function en(e,t,r){if(rr(e,"minDate",t),rr(e,"maxDate",r),r.getTime()<=t.getTime())throw new RangeError(`${e}: maxDate must be strictly later than minDate (minDate: ${t.toISOString()}, maxDate: ${r.toISOString()})`)}function Kr(e,t,r){if(!Array.isArray(r)||r.length!==2)throw new RangeError(`${e}: ${t} is required and must be a [lower, upper] Date tuple (received: ${String(r)})`);if(rr(e,`${t}[0]`,r[0]),rr(e,`${t}[1]`,r[1]),r[0].getTime()>r[1].getTime())throw new RangeError(`${e}: ${t} upper must not be earlier than lower (lower: ${r[0].toISOString()}, upper: ${r[1].toISOString()})`)}function Wr(e,t,r,n,a,s){if(r.getTime()<n.getTime()||r.getTime()>a.getTime())throw new RangeError(`${e}: ${t} must lie within ${s} (value: ${r.toISOString()}, lower: ${n.toISOString()}, upper: ${a.toISOString()})`)}function Gr(e,t,r,n,a,s){Wr(e,`${t}[0]`,r[0],n,a,s),Wr(e,`${t}[1]`,r[1],n,a,s)}function Ue(e,t,r){return e<t?t:e>r?r:e}function Rr(e,t,r,n){const a=ot(t,r,n[1]);return[Ue(e[0],n[0],a),Ue(e[1],n[0],a)]}function Jr(e,t,r,n){const a=ve(e,r,t)+n;return e[Math.max(0,Math.min(e.length-1,a))]}function tn(e){const t=o.useRef(e),r=t.current,n=e,a=Object.keys(r),s=Object.keys(n);return a.length===s.length&&s.every(u=>Object.is(r[u],n[u]))||(t.current=e),t.current}function ro(e){const{unit:t,minDate:r,maxDate:n,initialRange:a,onChangeRange:s,...i}=e;en("usePeriodSliderRange",r,n),Kr("usePeriodSliderRange","initialRange",a),Gr("usePeriodSliderRange","initialRange",a,r,n,"[minDate, maxDate]");const u=tn(i),b=o.useRef(a),[f,P]=o.useState(a);let y=f;const d=[Ue(f[0],r,n),Ue(f[1],r,n)];(d[0]!==f[0]||d[1]!==f[1])&&(y=d,P(d));const p=o.useRef(y);p.current=y;const V=o.useRef({minDate:r,maxDate:n,allowedDates:u.allowedDates});V.current={minDate:r,maxDate:n,allowedDates:u.allowedDates};const ee=o.useRef(s);ee.current=s;const v=o.useCallback(w=>{const{minDate:$,maxDate:N}=V.current,O=Ue(w[0],$,N),k=Ue(w[1],$,N),re=p.current;O.getTime()===re[0].getTime()&&k.getTime()===re[1].getTime()||(p.current=[O,k],P([O,k]),ee.current?.(O,k))},[]),J=o.useCallback(w=>{const $=p.current,N=w.getTime()>$[1].getTime()?w:$[1];v([w,N])},[v]),I=o.useCallback(w=>{const $=p.current,N=w.getTime()<$[0].getTime()?w:$[0];v([N,w])},[v]),te=o.useCallback((w,$)=>{v([w,$])},[v]),Y=o.useCallback(w=>{const{minDate:$,maxDate:N,allowedDates:O}=V.current,k=p.current,re=Vt(O,t,$,N);if(re.length>0){v([Jr(re,t,k[0],w),Jr(re,t,k[1],w)]);return}v([Ie(t,k[0],w),Ie(t,k[1],w)])},[t,v]),U=o.useCallback(()=>{v(b.current)},[v]),L=o.useMemo(()=>({value:y[0],onChange:J,minDate:r,maxDate:y[1],unit:t}),[y[0],y[1],J,r,t]),_=o.useMemo(()=>({value:y[1],onChange:I,minDate:y[0],maxDate:n,unit:t}),[y[0],y[1],I,n,t]),H=o.useMemo(()=>({...u,mode:"range",unit:t,range:y,minDate:r,maxDate:n,onChangeRange:te}),[u,t,y,r,n,te]);return{range:y,lowerDate:y[0],upperDate:y[1],setRange:P,setLowerDate:J,setUpperDate:I,shiftRange:Y,resetRange:U,startSelectorProps:L,endSelectorProps:_,sliderProps:H}}function no(e){const{unit:t,minDate:r,maxDate:n,initialValue:a,onChangePoint:s,...i}=e;en("usePeriodSliderPoint",r,n),rr("usePeriodSliderPoint","initialValue",a),Wr("usePeriodSliderPoint","initialValue",a,r,n,"[minDate, maxDate]");const u=tn(i),b=o.useRef(a),[f,P]=o.useState(a);let y=f;const d=Ue(f,r,n);d!==f&&(y=d,P(d));const p=o.useRef(y);p.current=y;const V=o.useRef({minDate:r,maxDate:n,allowedDates:u.allowedDates});V.current={minDate:r,maxDate:n,allowedDates:u.allowedDates};const ee=o.useRef(s);ee.current=s;const v=o.useCallback(U=>{const{minDate:L,maxDate:_}=V.current,H=Ue(U,L,_);H.getTime()!==p.current.getTime()&&(p.current=H,P(H),ee.current?.(H))},[]),J=o.useCallback(U=>{const{minDate:L,maxDate:_,allowedDates:H}=V.current,w=Vt(H,t,L,_);if(w.length>0){v(Jr(w,t,p.current,U));return}v(Ie(t,p.current,U))},[t,v]),I=o.useCallback(()=>{v(b.current)},[v]),te=o.useMemo(()=>({value:y,onChange:v,minDate:r,maxDate:n,unit:t}),[y,v,r,n,t]),Y=o.useMemo(()=>({...u,mode:"point",unit:t,value:y,minDate:r,maxDate:n,onChangePoint:v}),[u,t,y,r,n,v]);return{value:y,setValue:P,shiftValue:J,resetValue:I,selectorProps:te,sliderProps:Y}}function ao(e){const{unit:t,minDate:r,maxDate:n,initialMacroRange:a,initialMicroRange:s,macroUnit:i=t,microUnit:u=t,onChangeMacroRange:b,onChangeMicroRange:f,...P}=e;en("useVernierSlider",r,n),Kr("useVernierSlider","initialMacroRange",a),Kr("useVernierSlider","initialMicroRange",s),Gr("useVernierSlider","initialMacroRange",a,r,n,"[minDate, maxDate]"),Gr("useVernierSlider","initialMicroRange",s,a[0],ot(i,u,a[1]),"the initial macro window");const y=tn(P),d=o.useRef(a),p=o.useRef(s),[V,ee]=o.useState(a),[v,J]=o.useState(s);let I=V;const te=[Ue(V[0],r,n),Ue(V[1],r,n)];(te[0]!==V[0]||te[1]!==V[1])&&(I=te,ee(te));let Y=v;const U=Rr(v,i,u,I);(U[0]!==v[0]||U[1]!==v[1])&&(Y=U,J(U));const L=o.useRef(I);L.current=I;const _=o.useRef(Y);_.current=Y;const H=o.useRef({minDate:r,maxDate:n});H.current={minDate:r,maxDate:n};const w=o.useRef(b);w.current=b;const $=o.useRef(f);$.current=f;const N=o.useCallback((j,B)=>{const G=L.current,ge=_.current;(j[0].getTime()!==G[0].getTime()||j[1].getTime()!==G[1].getTime())&&(L.current=j,ee(j),w.current?.(j[0],j[1])),(B[0].getTime()!==ge[0].getTime()||B[1].getTime()!==ge[1].getTime())&&(_.current=B,J(B),$.current?.(B[0],B[1]))},[]),O=o.useCallback((j,B)=>{const{minDate:G,maxDate:ge}=H.current,R=[Ue(j,G,ge),Ue(B,G,ge)];N(R,Rr(_.current,i,u,R))},[i,u,N]),k=o.useCallback((j,B)=>{N(L.current,Rr([j,B],i,u,L.current))},[i,u,N]),re=o.useCallback(j=>{const B=L.current[1],G=j>B?j:B;O(j,G)},[O]),De=o.useCallback(j=>{const B=L.current[0],G=j<B?j:B;O(G,j)},[O]),Z=o.useCallback(j=>{const B=_.current[1],G=j>B?j:B;k(j,G)},[k]),ne=o.useCallback(j=>{const B=_.current[0],G=j<B?j:B;k(G,j)},[k]),ie=o.useCallback(j=>{const{minDate:B,maxDate:G}=H.current,ge=L.current,R=Ie(i,ge[0],j),xe=Ie(i,ge[1],j);R<B||xe>G||O(R,xe)},[i,O]),me=o.useCallback(j=>{const B=L.current,G=_.current,ge=Ie(u,G[0],j),R=Ie(u,G[1],j);ge<B[0]||R>ot(i,u,B[1])||k(ge,R)},[i,u,k]),W=o.useCallback(()=>{const j=d.current;N(j,Rr(p.current,i,u,j))},[i,u,N]),K=o.useMemo(()=>ot(i,u,I[1]),[i,u,I[1]]),ke=o.useMemo(()=>({value:I[0],onChange:re,minDate:r,maxDate:I[1],unit:i}),[I,re,r,i]),bt=o.useMemo(()=>({value:I[1],onChange:De,minDate:I[0],maxDate:n,unit:i}),[I,De,n,i]),He=o.useMemo(()=>({value:Y[0],onChange:Z,minDate:I[0],maxDate:Y[1],unit:u}),[Y,Z,I,u]),Re=o.useMemo(()=>({value:Y[1],onChange:ne,minDate:Y[0],maxDate:K,unit:u}),[Y,ne,K,u]),fe=o.useMemo(()=>({...y,mode:"vernier",unit:t,macroUnit:i,microUnit:u,minDate:r,maxDate:n,macroRange:I,microRange:Y,onChangeMacroRange:O,onChangeMicroRange:k}),[y,t,i,u,r,n,I,Y,O,k]);return{macroRange:I,setMacroRange:ee,microRange:Y,setMicroRange:J,setMacroLowerDate:re,setMacroUpperDate:De,setMicroLowerDate:Z,setMicroUpperDate:ne,shiftMacroRange:ie,shiftMicroRange:me,resetVernier:W,macroStartSelectorProps:ke,macroEndSelectorProps:bt,microStartSelectorProps:He,microEndSelectorProps:Re,sliderProps:fe}}function In(e){const t=new Date(e,0,1);return t.setFullYear(e),t}function $r(e,t){if(e!==void 0&&(!(e instanceof Date)||Number.isNaN(e.getTime())))throw new RangeError(`YearSelector: \`${t}\` must be a valid Date, received ${String(e)}.`)}function Hn(e,t){if(e!==void 0&&!Number.isInteger(e))throw new RangeError(`YearSelector: \`${t}\` must be an integer year, received ${String(e)}.`)}function oo(e){if(e!==void 0)try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{throw new RangeError(`YearSelector: \`locale\` must be a valid BCP 47 language tag, received ${JSON.stringify(e)}.`)}}function jn(e,t,r){const n=e===void 0?null:e,a=t===void 0?null:t.getFullYear();return n!==null&&a!==null?r(n,a):n!==null?n:a}const io=e=>{const{value:t,initialDate:r,onChange:n,children:a,minYear:s,maxYear:i,minDate:u,maxDate:b,className:f="",style:P,disabled:y=!1,prevYearAriaLabel:d="Previous year",nextYearAriaLabel:p="Next year",selectAriaLabel:V="Year",locale:ee}=e;$r(t,"value"),$r(r,"initialDate"),$r(u,"minDate"),$r(b,"maxDate"),Hn(s,"minYear"),Hn(i,"maxYear"),oo(ee);const v=t??r;if(v===void 0)throw new RangeError("YearSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected year is never inferred from the wall clock.");const[J,I]=o.useState(()=>v.getFullYear()),te=u?.getTime(),Y=b?.getTime(),U=o.useMemo(()=>jn(s,u,Math.max),[s,te]),L=o.useMemo(()=>jn(i,b,Math.min),[i,Y]);if(U===null||L===null)throw new RangeError("YearSelector: a lower bound (`minYear` or `minDate`) and an upper bound (`maxYear` or `maxDate`) are both required; the year option list is never invented.");if(U>L)throw new RangeError(`YearSelector: the resolved lower bound ${U} is after the resolved upper bound ${L}.`);const _=t!==void 0,H=t!==void 0?t.getFullYear():J,w=H<U||H>L,$=v.getTime();o.useEffect(()=>{_||I(v.getFullYear())},[_,$]);const N=W=>W>=U&&W<=L,O=W=>{if(!y){if(!N(W))throw new RangeError(`YearSelector: refusing to emit ${W}, which lies outside the declared bounds ${U}-${L}.`);_||I(W),n?.(In(W),W)}},k=N(H-1)?H-1:null,re=N(H+1)?H+1:null,De=y||k===null,Z=y||re===null,ne=()=>{k!==null&&O(k)},ie=()=>{re!==null&&O(re)},me=o.useMemo(()=>{const W=[];for(let K=L;K>=U;K--)W.push(K);return w&&(W.push(H),W.sort((K,ke)=>ke-K)),W},[U,L,w,H]);return g.jsxs("div",{className:`inline-flex w-32 items-center ${f}`,style:P,children:[g.jsx("button",{type:"button","aria-label":d,disabled:De,className:"relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",onClick:ne,children:g.jsx("span",{className:"h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200"})}),g.jsx("select",{"aria-label":V,disabled:y,className:"mx-1 my-auto w-18 appearance-none rounded-md border border-gray-300 bg-gray-100 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums [text-align-last:center] [text-align:center] focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500",value:H,onChange:W=>{if(!W.target.value)return;const K=Number(W.target.value);Number.isInteger(K)&&O(K)},children:me.map(W=>g.jsx("option",{value:W,className:"text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100",children:Oe("year",In(W),void 0,ee)},W))}),g.jsx("button",{type:"button","aria-label":p,disabled:Z,className:"relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",onClick:ie,children:g.jsx("span",{className:"h-0 w-0 border-y-[6px] border-y-transparent border-l-[6px] border-l-slate-500 border-solid hover:border-l-slate-700 dark:border-l-slate-400 dark:hover:border-l-slate-200"})}),a]})},ta=o.memo(io,(e,t)=>{const r=e.value??e.initialDate,n=t.value??t.initialDate,a=r?r.getFullYear():null,s=n?n.getFullYear():null;return!(a!==s||e.disabled!==t.disabled||e.className!==t.className||e.style!==t.style||e.minYear!==t.minYear||e.maxYear!==t.maxYear||e.minDate?.getFullYear()!==t.minDate?.getFullYear()||e.maxDate?.getFullYear()!==t.maxDate?.getFullYear()||e.onChange!==t.onChange||e.children!==t.children||e.prevYearAriaLabel!==t.prevYearAriaLabel||e.nextYearAriaLabel!==t.nextYearAriaLabel||e.selectAriaLabel!==t.selectAriaLabel||e.locale!==t.locale)});ta.displayName="YearSelector";exports.COLOR_SCHEME_PALETTES=On;exports.DateSelector=Zn;exports.MonthSelector=ea;exports.PeriodSlider=Jn;exports.YearSelector=ta;exports.addUnit=Ie;exports.areStylesEqual=Gn;exports.calculateConnectDragValues=Vn;exports.calculateHandleDragValues=qr;exports.calculateKeyboardActionValues=Un;exports.calculateLabelSlant=Qr;exports.calculateVernierMacroDrag=Kn;exports.calculateVernierMicroDrag=Wn;exports.decode=oe;exports.encode=q;exports.findNearestDateIndex=ve;exports.formatLabel=Oe;exports.formatScreenReaderLabel=pt;exports.getActiveDragHandle=Fn;exports.getMacroWindowEndDate=ot;exports.getSortedAllowedDates=Vt;exports.normalizeDateByUnit=qe;exports.resolveVernierTargetHandle=qn;exports.usePeriodSliderPoint=no;exports.usePeriodSliderRange=ro;exports.useVernierSlider=ao;