@ngrok/mantle 0.82.1 → 0.83.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion.d.ts +7 -7
- package/dist/agent.json +3 -1
- package/dist/{alert-BWwNPOMI.d.ts → alert-B1HXfkYn.d.ts} +9 -7
- package/dist/{alert-vwFd7qdp.js → alert-BuG2qS5l.js} +1 -1
- package/dist/alert-center.d.ts +3 -3
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.d.ts +18 -18
- package/dist/alert.d.ts +1 -1
- package/dist/alert.js +1 -1
- package/dist/anchor.d.ts +2 -2
- package/dist/app-layout.js +1 -1
- package/dist/area-chart.d.ts +67 -19
- package/dist/area-chart.js +1 -1
- package/dist/avatar.d.ts +319 -0
- package/dist/avatar.js +1 -0
- package/dist/bar-chart.d.ts +73 -20
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.d.ts +50 -17
- package/dist/breadcrumb.js +1 -1
- package/dist/browser-only.d.ts +3 -3
- package/dist/{button-C-gMbPso.d.ts → button-BIf69CSV.d.ts} +2 -2
- package/dist/button-BLDjW1u9.js +1 -0
- package/dist/{button-IlxHhjPK.js → button-CCkGqE1t.js} +1 -1
- package/dist/{button-C7vAl6lS.d.ts → button-DJ7AAgII.d.ts} +4 -6
- package/dist/{button-DARFK2KJ.d.ts → button-PoIujPMX.d.ts} +2 -2
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +1 -1
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +15 -15
- package/dist/{chart-1cVjAcj8.d.ts → chart-0zcFJh4n.d.ts} +75 -22
- package/dist/chart-DBxT9BNl.js +2 -0
- package/dist/{choice-BNRQXszu.d.ts → choice-CVdQrs-m.d.ts} +118 -6
- package/dist/choice.d.ts +1 -1
- package/dist/{code-block-C9uaM9-V.js → code-block-CIE0F2fu.js} +1 -1
- package/dist/{code-block-B6OlZrSI.d.ts → code-block-CZWPrV4k.d.ts} +3 -3
- package/dist/code-block.d.ts +10 -7
- package/dist/code-block.js +2 -2
- package/dist/code-block_highlight-utils.d.ts +1 -1
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/combobox.d.ts +8 -9
- package/dist/command.d.ts +668 -106
- package/dist/command.js +1 -1
- package/dist/data-table.d.ts +6 -6
- package/dist/data-table.js +1 -1
- package/dist/dialog-32Hq6w6P.js +1 -0
- package/dist/dialog-B6h1BCDL.d.ts +895 -0
- package/dist/dialog.d.ts +2 -805
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu-BcALUQMp.d.ts +1 -0
- package/dist/{dropdown-menu-D6pMAY7I.d.ts → dropdown-menu-DZOfj6HB.d.ts} +1 -1
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/field.d.ts +5 -5
- package/dist/field.js +1 -1
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +16 -17
- package/dist/hooks.js +1 -1
- package/dist/icons-DEVx1oP9.js +1 -0
- package/dist/icons.d.ts +7 -6
- package/dist/icons.js +1 -1
- package/dist/{in-view-DDEGUKDR.d.ts → in-view-gxyc9Q1_.d.ts} +1 -1
- package/dist/{input-BuYDU6CF.d.ts → input-DpnC3Xgj.d.ts} +2 -2
- package/dist/input.d.ts +1 -1
- package/dist/kbd.d.ts +1 -1
- package/dist/line-chart.d.ts +60 -13
- package/dist/line-chart.js +1 -1
- package/dist/list-CwL23L_B.js +1 -0
- package/dist/list.d.ts +2 -2
- package/dist/list.js +1 -1
- package/dist/llms.txt +3 -1
- package/dist/mantle-dark-high-contrast.css +30 -17
- package/dist/mantle-dark.css +48 -13
- package/dist/mantle-light-high-contrast.css +33 -15
- package/dist/mantle.css +436 -26
- package/dist/media-object.d.ts +5 -1
- package/dist/multi-select.d.ts +7 -7
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +4 -4
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +2 -2
- package/dist/pagination.js +1 -1
- package/dist/progress.d.ts +4 -4
- package/dist/qr-code.d.ts +2 -2
- package/dist/sandbar.d.ts +471 -0
- package/dist/sandbar.js +1 -0
- package/dist/sandboxed-on-click.d.ts +4 -6
- package/dist/scatter-plot.d.ts +69 -24
- package/dist/scatter-plot.js +1 -1
- package/dist/{select-0z7HVS6r.d.ts → select-DVHmgih8.d.ts} +13 -7
- package/dist/select-LK9NX-vV.js +1 -0
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +4 -4
- package/dist/selectable-list.js +1 -1
- package/dist/{separator-B5UmkVRL.d.ts → separator-CNDs98Dv.d.ts} +2 -2
- package/dist/separator.d.ts +1 -1
- package/dist/{sheet-BxvTfPLM.js → sheet-BOSknSN9.js} +1 -1
- package/dist/sheet.d.ts +1 -1
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +347 -366
- package/dist/sidebar.js +1 -1
- package/dist/slider.d.ts +1 -1
- package/dist/split-button.d.ts +12 -12
- package/dist/split-button.js +1 -1
- package/dist/switch.d.ts +2 -1
- package/dist/{table-CGxJwtbL.js → table-C_Nm_RSV.js} +1 -1
- package/dist/{table-CZBYEmyK.d.ts → table-D51ZtV4U.d.ts} +18 -8
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +8 -13
- package/dist/tabs.js +1 -1
- package/dist/{theme-FbfjYiD3.d.ts → theme-6OxNhf6l.d.ts} +6 -6
- package/dist/theme-CVfq037P.js +1 -0
- package/dist/theme-switcher.d.ts +3 -3
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.d.ts +86 -23
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +9 -9
- package/dist/toast.js +1 -1
- package/dist/{tooltip-mrpLz4DZ.d.ts → tooltip-DuXGxIse.d.ts} +6 -4
- package/dist/tooltip.d.ts +1 -1
- package/dist/use-breakpoint-Dqu12Szq.js +1 -0
- package/dist/use-callback-ref-IYti9y7x.js +1 -0
- package/dist/use-is-apple-platform-Cxwrb86L.js +1 -0
- package/dist/use-matches-media-query-Bd_GhhVd.js +1 -0
- package/dist/utils.d.ts +1 -1
- package/package.json +5 -3
- package/dist/button-DvHMWAPl.js +0 -1
- package/dist/chart-B3pAvmkk.js +0 -2
- package/dist/dialog-DozL6n-F.js +0 -1
- package/dist/dropdown-menu-BbbQuae2.d.ts +0 -1
- package/dist/icons-Bb_zF2OV.js +0 -1
- package/dist/list-CJABVHwi.js +0 -1
- package/dist/platform-BVD3gpKD.js +0 -1
- package/dist/select-BReznXaw.js +0 -1
- package/dist/theme-BorfgnNh.js +0 -1
- package/dist/use-breakpoint-Wd7_5-Mu.js +0 -1
- package/dist/use-matches-media-query-CMSxHR9n.js +0 -1
package/dist/browser-only.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ type Props = {
|
|
|
15
15
|
fallback?: ReactNode;
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
|
-
* A wrapper component that
|
|
19
|
-
* after hydration
|
|
18
|
+
* A wrapper component that renders its children in the browser only,
|
|
19
|
+
* after hydration completes.
|
|
20
20
|
*
|
|
21
21
|
* This is useful for components that rely on browser-only APIs
|
|
22
22
|
* (e.g. `window`, `document`, `localStorage`, media queries) or that
|
|
@@ -45,7 +45,7 @@ declare function BrowserOnly({ children, fallback }: Props): ReactNode;
|
|
|
45
45
|
* Returns `true` when running in a windowed browser context where both
|
|
46
46
|
* `window` and a real `document` exist. This will be `false` in SSR/Node.
|
|
47
47
|
*
|
|
48
|
-
* Note:
|
|
48
|
+
* Note: In a test environment with a DOM shim (e.g. JSDOM), this returns `true`.
|
|
49
49
|
*
|
|
50
50
|
* @returns {boolean} `true` if DOM APIs are available; otherwise `false`.
|
|
51
51
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
2
|
import { r as VariantProps } from "./index-DA4ig3gj.js";
|
|
3
|
-
import "./button-
|
|
4
|
-
import "./button-
|
|
3
|
+
import "./button-PoIujPMX.js";
|
|
4
|
+
import "./button-DJ7AAgII.js";
|
|
5
5
|
import { ComponentProps } from "react";
|
|
6
6
|
//#region src/components/button/button-group.d.ts
|
|
7
7
|
declare const buttonGroupVariants: (props?: ({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{cva as t}from"class-variance-authority";const n=e(`icon-button`,`inline-flex shrink-0 items-center justify-center rounded-[var(--icon-button-border-radius,0.375rem)] border`,`focus:outline-hidden focus-visible:ring-4`,`disabled:cursor-default disabled:opacity-50`,`not-disabled:active:scale-97 ease-out transition-transform duration-150`),r=t(n,{variants:{appearance:{ghost:`text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 border-transparent`,outlined:`border-accent-600 bg-form text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-accent-700 not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700`},intent:{accent:``,danger:``,neutral:``},isLoading:{false:``,true:`opacity-50`},size:{xs:`size-6`,sm:`size-7`,md:`size-9`,lg:`size-10`,xl:`size-12`}},defaultVariants:{intent:`neutral`,size:`md`},compoundVariants:[{appearance:`ghost`,intent:`danger`,class:`text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700 border-transparent`},{appearance:`outlined`,intent:`danger`,class:`border-danger-600 bg-form text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:border-danger-700 not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700`},{appearance:`ghost`,intent:`neutral`,class:`text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong border-transparent`},{appearance:`outlined`,intent:`neutral`,class:`border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong focus-visible:not-disabled:hover:border-accent-600 focus-visible:not-disabled:active:border-accent-600`}]});export{r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-lZ48P8Nn.js";import{t as n}from"./slot-DpNWVci8.js";import{t as r}from"./booleanish-BfvnW6vy.js";import{t as i}from"./button-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-lZ48P8Nn.js";import{t as n}from"./slot-DpNWVci8.js";import{t as r}from"./booleanish-BfvnW6vy.js";import{t as i}from"./button-BLDjW1u9.js";import{Children as a,cloneElement as o,isValidElement as s}from"react";import c from"tiny-invariant";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";import{CircleNotchIcon as f}from"@phosphor-icons/react/CircleNotch";const p=({"aria-disabled":p,appearance:m,asChild:h=!1,children:g,className:_,disabled:v,icon:y,intent:b,isLoading:x=!1,label:S,ref:C,size:w=`md`,type:T,...E})=>{let D=r(p??v??x),O=x?u(f,{className:`animate-spin`}):y,k={"aria-disabled":D,"data-slot":`icon-button`,className:e(i({appearance:m,intent:b,isLoading:x,size:w}),_),"data-appearance":m,"data-disabled":D,"data-icon-button":!0,"data-intent":b,"data-loading":x,"data-size":w,disabled:D,ref:C,...E},A=d(l,{children:[u(`span`,{className:`sr-only`,children:S}),u(t,{svg:O})]});return h?(c(s(g)&&a.only(g),"When using `asChild`, IconButton must be passed a single child as a JSX tag."),u(n,{...k,children:o(g,{},A)})):u(`button`,{...k,type:T??`button`,children:A})};export{p as t};
|
|
@@ -56,7 +56,8 @@ type IconButtonProps = ComponentProps<"button"> & WithAsChild & Omit<IconButtonV
|
|
|
56
56
|
*/
|
|
57
57
|
intent: ButtonIntent;
|
|
58
58
|
/**
|
|
59
|
-
* The accessible label for the icon.
|
|
59
|
+
* The accessible label for the icon. `IconButton` hides this label visually
|
|
60
|
+
* and announces it to screen readers, like the `alt` text on an `<img>`.
|
|
60
61
|
*/
|
|
61
62
|
label: string;
|
|
62
63
|
/**
|
|
@@ -84,11 +85,8 @@ type IconButtonProps = ComponentProps<"button"> & WithAsChild & Omit<IconButtonV
|
|
|
84
85
|
type?: ComponentProps<"button">["type"];
|
|
85
86
|
};
|
|
86
87
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* other assistive technology. Once activated, it then performs an action, such
|
|
90
|
-
* as submitting a form or opening a dialog.
|
|
91
|
-
* Renders only a single icon as children with an accessible, screen-reader-only label.
|
|
88
|
+
* A button that renders one icon and nothing else. Its required `label` prop
|
|
89
|
+
* carries the accessible name.
|
|
92
90
|
*
|
|
93
91
|
* `appearance` (visual weight) and `intent` (tone) are required — every call
|
|
94
92
|
* site states what it means; there are no implicit defaults. `intent="neutral"`
|
|
@@ -11,7 +11,7 @@ import { ComponentProps, ReactNode } from "react";
|
|
|
11
11
|
* - `"outlined"` — bordered on the form background
|
|
12
12
|
* - `"ghost"` — no border or fill until hovered
|
|
13
13
|
* - `"link"` — renders like an inline link (inherits surrounding typography)
|
|
14
|
-
* while remaining a button that
|
|
14
|
+
* while remaining a button that runs an action
|
|
15
15
|
*/
|
|
16
16
|
type ButtonAppearance = "filled" | "ghost" | "link" | "outlined";
|
|
17
17
|
declare const buttonVariants: (props?: ({
|
|
@@ -85,7 +85,7 @@ type ButtonProps = ComponentProps<"button"> & Omit<ButtonVariants, "appearance"
|
|
|
85
85
|
/**
|
|
86
86
|
* Renders a button or a component that looks like a button, an interactive
|
|
87
87
|
* element activated by a user with a mouse, keyboard, finger, voice command, or
|
|
88
|
-
* other assistive technology. Once activated, it then
|
|
88
|
+
* other assistive technology. Once activated, it then runs an action, such
|
|
89
89
|
* as submitting a form or opening a dialog.
|
|
90
90
|
*
|
|
91
91
|
* `appearance` (visual weight) and `intent` (tone) are required — every call
|
package/dist/button.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as ButtonIntent } from "./button-DdSKSj1c.js";
|
|
2
|
-
import { n as ButtonAppearance, r as ButtonProps, t as Button } from "./button-
|
|
3
|
-
import { n as IconButtonProps, r as IconButtonAppearance, t as IconButton } from "./button-
|
|
4
|
-
import { n as ButtonGroupProps, t as ButtonGroup } from "./button-
|
|
2
|
+
import { n as ButtonAppearance, r as ButtonProps, t as Button } from "./button-PoIujPMX.js";
|
|
3
|
+
import { n as IconButtonProps, r as IconButtonAppearance, t as IconButton } from "./button-DJ7AAgII.js";
|
|
4
|
+
import { n as ButtonGroupProps, t as ButtonGroup } from "./button-BIf69CSV.js";
|
|
5
5
|
import { t as ButtonSize } from "./button-BCoI4bhP.js";
|
|
6
6
|
export { Button, type ButtonAppearance, ButtonGroup, type ButtonGroupProps, type ButtonIntent, type ButtonProps, type ButtonSize, IconButton, type IconButtonAppearance, type IconButtonProps };
|
package/dist/button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./button-Cnja9Bsr.js";import{t}from"./button-
|
|
1
|
+
import{t as e}from"./button-Cnja9Bsr.js";import{t}from"./button-CCkGqE1t.js";import{t as n}from"./button-DmJkYfyl.js";export{e as Button,n as ButtonGroup,t as IconButton};
|
package/dist/calendar.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ type CalendarProps = ComponentProps<typeof DayPicker>;
|
|
|
5
5
|
/**
|
|
6
6
|
* A calendar component that allows users to select a date or a range of dates.
|
|
7
7
|
*
|
|
8
|
-
* @preview
|
|
8
|
+
* @preview The API is not stable and may change.
|
|
9
9
|
* There may also be bugs! Please file an issue if you find any! <3
|
|
10
10
|
*
|
|
11
11
|
* @see https://mantle.ngrok.com/components/preview/calendar
|
package/dist/calendar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-lZ48P8Nn.js";import{t as n}from"./button-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-lZ48P8Nn.js";import{t as n}from"./button-BLDjW1u9.js";import{jsx as r}from"react/jsx-runtime";import{CaretRightIcon as i}from"@phosphor-icons/react/CaretRight";import{CaretLeftIcon as a}from"@phosphor-icons/react/CaretLeft";import{DayPicker as o}from"react-day-picker";const s=n({appearance:`ghost`,intent:`neutral`,size:`sm`});function c({className:n,classNames:c,showOutsideDays:l=!1,...u}){return r(o,{"data-slot":`calendar`,animate:!1,components:{Chevron:e=>{let n=e.orientation===`left`?r(a,{}):r(i,{});return r(t,{svg:n,className:`size-4`})}},classNames:{root:e(`isolate`,n),button_next:e(s,`absolute right-0`),button_previous:e(s,`absolute left-0`),caption_label:`text-sm font-medium`,day:e(`overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 size-7 rounded-md`,u.mode===`range`&&`first:has-aria-selected:rounded-l-md last:has-aria-selected:rounded-r-md`),day_button:`day size-full rounded-md not-aria-selected:not-disabled:hover:bg-filled-accent/15`,disabled:`text-muted opacity-50`,hidden:`invisible`,month:`space-y-4`,month_caption:`flex justify-center pt-1 relative items-center`,month_grid:`w-full border-collapse space-y-1`,months:`flex flex-col sm:flex-row gap-y-4 sm:gap-x-4 sm:gap-y-0 relative max-w-min`,nav:`flex items-center absolute inset-x-0 top-1 h-5 justify-between z-10`,outside:`day-outside aria-selected:text-on-filled opacity-50 text-muted`,range_end:`day-range-end [&:not(.day-range-start)]:rounded-l-none`,range_middle:`day-range-middle not-disabled:aria-selected:bg-filled-accent/15 aria-selected:text-strong rounded-none not-disabled:aria-selected:hover:bg-filled-accent/25`,range_start:`day-range-start [&:not(.day-range-end)]:rounded-r-none`,selected:`not-disabled:bg-filled-accent text-on-filled not-disabled:hover:bg-filled-accent`,today:`not-aria-selected:not-disabled:text-accent-600 font-medium not-aria-selected:not-disabled:bg-filled-accent/10 rounded-md`,week:`flex w-full mt-1`,weekday:`text-body w-7 text-[0.8rem] text-center font-normal`,weekdays:`flex`,...c},showOutsideDays:l,...u})}export{c as Calendar};
|
package/dist/card.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { ComponentProps } from "react";
|
|
|
4
4
|
//#region src/components/card/card.d.ts
|
|
5
5
|
type CardProps = ComponentProps<"div"> & WithAsChild;
|
|
6
6
|
/**
|
|
7
|
-
* A container that
|
|
8
|
-
*
|
|
7
|
+
* A container that displays content in a box resembling a physical card. The
|
|
8
|
+
* outermost part — every other `Card` part nests inside it.
|
|
9
9
|
*
|
|
10
10
|
* @see https://mantle.ngrok.com/components/structure/card#cardroot
|
|
11
11
|
*
|
|
@@ -59,7 +59,8 @@ declare const Root: ({ asChild, className, children, ref, ...rest }: CardProps)
|
|
|
59
59
|
*/
|
|
60
60
|
declare const Body: ({ asChild, className, children, ref, ...rest }: CardProps) => import("react").JSX.Element;
|
|
61
61
|
/**
|
|
62
|
-
* The
|
|
62
|
+
* The band below `Card.Body`. Unless it is the first child, it draws a top border
|
|
63
|
+
* dividing the two. Pass it as a direct child of `Card.Root`.
|
|
63
64
|
*
|
|
64
65
|
* @see https://mantle.ngrok.com/components/structure/card#cardfooter
|
|
65
66
|
*
|
|
@@ -80,7 +81,8 @@ declare const Body: ({ asChild, className, children, ref, ...rest }: CardProps)
|
|
|
80
81
|
*/
|
|
81
82
|
declare const Footer: ({ asChild, className, children, ref, ...rest }: CardProps) => import("react").JSX.Element;
|
|
82
83
|
/**
|
|
83
|
-
* The
|
|
84
|
+
* The band above `Card.Body` that holds `Card.Title`. Pass it as a direct child
|
|
85
|
+
* of `Card.Root`.
|
|
84
86
|
*
|
|
85
87
|
* @see https://mantle.ngrok.com/components/structure/card#cardheader
|
|
86
88
|
*
|
|
@@ -102,11 +104,9 @@ declare const Footer: ({ asChild, className, children, ref, ...rest }: CardProps
|
|
|
102
104
|
declare const Header: ({ asChild, className, children, ref, ...rest }: CardProps) => import("react").JSX.Element;
|
|
103
105
|
type CardTitleProps = ComponentProps<"h3"> & WithAsChild;
|
|
104
106
|
/**
|
|
105
|
-
* The
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* element by using the `asChild` prop. It is preferred to use a heading element
|
|
109
|
-
* (h1-h6) for accessibility reasons.
|
|
107
|
+
* The heading inside `Card.Header`. Renders an `h3` by default — pass `asChild`
|
|
108
|
+
* to fit the surrounding document outline. Keep it a heading element
|
|
109
|
+
* (`h1`-`h6`) for accessibility.
|
|
110
110
|
*
|
|
111
111
|
* @see https://mantle.ngrok.com/components/structure/card#cardtitle
|
|
112
112
|
*
|
|
@@ -127,8 +127,7 @@ type CardTitleProps = ComponentProps<"h3"> & WithAsChild;
|
|
|
127
127
|
*/
|
|
128
128
|
declare const Title: ({ className, asChild, ref, ...props }: CardTitleProps) => import("react").JSX.Element;
|
|
129
129
|
/**
|
|
130
|
-
* A container that
|
|
131
|
-
* physical card.
|
|
130
|
+
* A container that displays content in a box resembling a physical card.
|
|
132
131
|
*
|
|
133
132
|
* @see https://mantle.ngrok.com/components/structure/card
|
|
134
133
|
*
|
|
@@ -165,7 +164,7 @@ declare const Title: ({ className, asChild, ref, ...props }: CardTitleProps) =>
|
|
|
165
164
|
*/
|
|
166
165
|
declare const Card: {
|
|
167
166
|
/**
|
|
168
|
-
* A container that
|
|
167
|
+
* A container that displays content in a box resembling a physical card.
|
|
169
168
|
*
|
|
170
169
|
* @see https://mantle.ngrok.com/components/structure/card#cardroot
|
|
171
170
|
*
|
|
@@ -195,7 +194,8 @@ declare const Card: {
|
|
|
195
194
|
*/
|
|
196
195
|
readonly Body: typeof Body;
|
|
197
196
|
/**
|
|
198
|
-
* The
|
|
197
|
+
* The band below `Card.Body`. Unless it is the first child, it draws a top border
|
|
198
|
+
* dividing the two. Pass it as a direct child of `Card.Root`.
|
|
199
199
|
*
|
|
200
200
|
* @see https://mantle.ngrok.com/components/structure/card#cardfooter
|
|
201
201
|
*
|
|
@@ -216,7 +216,7 @@ declare const Card: {
|
|
|
216
216
|
*/
|
|
217
217
|
readonly Footer: typeof Footer;
|
|
218
218
|
/**
|
|
219
|
-
* The
|
|
219
|
+
* The band above `Card.Body` that holds `Card.Title`.
|
|
220
220
|
*
|
|
221
221
|
* @see https://mantle.ngrok.com/components/structure/card#cardheader
|
|
222
222
|
*
|
|
@@ -237,7 +237,7 @@ declare const Card: {
|
|
|
237
237
|
*/
|
|
238
238
|
readonly Header: typeof Header;
|
|
239
239
|
/**
|
|
240
|
-
* The
|
|
240
|
+
* The heading inside `Card.Header`. Renders an `h3` by default.
|
|
241
241
|
*
|
|
242
242
|
* @see https://mantle.ngrok.com/components/structure/card#cardtitle
|
|
243
243
|
*
|
|
@@ -43,18 +43,29 @@ type ContinuousXScale = Exclude<XScaleKind, "band">;
|
|
|
43
43
|
*/
|
|
44
44
|
type SeriesMark = "bar" | "line" | "area" | "scatter";
|
|
45
45
|
/**
|
|
46
|
-
* The ordered chart color tokens.
|
|
47
|
-
*
|
|
48
|
-
*
|
|
46
|
+
* The ordered chart color tokens. Series use the first eight through automatic
|
|
47
|
+
* or fixed identity slots. `"chart-other"` is the shared neutral treatment for
|
|
48
|
+
* overflow and folded-tail series.
|
|
49
49
|
*/
|
|
50
50
|
type ChartColorToken = "chart-1" | "chart-2" | "chart-3" | "chart-4" | "chart-5" | "chart-6" | "chart-7" | "chart-8" | "chart-other";
|
|
51
|
+
/**
|
|
52
|
+
* A series' visual identity slot. Slots `1` through `8` pair one validated
|
|
53
|
+
* chart color with one point shape. `"other"` selects the shared neutral
|
|
54
|
+
* overflow treatment.
|
|
55
|
+
*/
|
|
56
|
+
type ChartSeriesSlot = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | "other";
|
|
51
57
|
/**
|
|
52
58
|
* A series color: one of the validated chart tokens (preferred — they adapt to
|
|
53
59
|
* light/dark/high-contrast themes) or any CSS color string as an escape hatch.
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* series
|
|
57
|
-
*
|
|
60
|
+
*
|
|
61
|
+
* `color` overrides only the color channel. It does not select or reserve a
|
|
62
|
+
* series slot. When sibling series can mount or unmount, use `seriesSlot` on a
|
|
63
|
+
* series part to keep its visual identity fixed.
|
|
64
|
+
*
|
|
65
|
+
* A static color (raw hex) cannot follow the four themes, so prefer a
|
|
66
|
+
* `var(--your-token)` a consumer declares per theme. A series that carries
|
|
67
|
+
* good/bad meaning (error rate, pass/fail) should wear the semantic status
|
|
68
|
+
* colors, never a categorical chart slot.
|
|
58
69
|
*/
|
|
59
70
|
type SeriesColor = ChartColorToken | (string & {});
|
|
60
71
|
/**
|
|
@@ -65,19 +76,44 @@ type CurveKind = "linear" | "monotone" | "step";
|
|
|
65
76
|
* The glyph a series' points wear: scatter marks, line canvas markers, and
|
|
66
77
|
* the hover dot on line/area charts. Shape is a redundant encoding alongside
|
|
67
78
|
* color, so series stay distinguishable without color vision.
|
|
79
|
+
*
|
|
80
|
+
* Eight values match the palette's eight series slots. This union's order is
|
|
81
|
+
* the pairing: a series that sets no `shape` wears the glyph of the slot it
|
|
82
|
+
* holds — slot 1 the circle, slot 2 the square, on down to slot 8 and the
|
|
83
|
+
* star. The shared `"chart-other"` treatment uses the circle.
|
|
84
|
+
*
|
|
85
|
+
* What each added name draws:
|
|
86
|
+
*
|
|
87
|
+
* - `"triangle-down"` is the triangle mirrored.
|
|
88
|
+
* - `"plus"` is a filled Greek cross.
|
|
89
|
+
* - `"cross"` is that plus turned 45°.
|
|
90
|
+
* - `"star"` is a filled five-pointed star.
|
|
91
|
+
*
|
|
92
|
+
* Every painted mark carries the circle's fill area, so no glyph reads louder
|
|
93
|
+
* than its siblings. Legend keys and hover dots clip those same silhouettes
|
|
94
|
+
* out of a small box instead, where a spiky glyph like the star reads lighter
|
|
95
|
+
* than the square.
|
|
68
96
|
*/
|
|
69
|
-
type PointShape = "circle" | "square" | "triangle" | "diamond";
|
|
97
|
+
type PointShape = "circle" | "square" | "triangle" | "diamond" | "triangle-down" | "plus" | "cross" | "star";
|
|
70
98
|
/**
|
|
71
99
|
* The fill texture a bar series wears: solid color (the default), diagonal
|
|
72
100
|
* hatch lines at 45° (`"hatch"`), the 135° mirror (`"hatch-reverse"`), both
|
|
73
101
|
* (`"crosshatch"`), rungs perpendicular to the bar's length
|
|
74
|
-
* (`"perpendicular"` — horizontal lines on vertical bars),
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
102
|
+
* (`"perpendicular"` — horizontal lines on vertical bars), rungs parallel to
|
|
103
|
+
* it (`"parallel"` — vertical lines on vertical bars), the orthogonal lattice
|
|
104
|
+
* of both rung directions (`"grid"`), or an offset dot field (`"dots"`).
|
|
105
|
+
*
|
|
106
|
+
* The two rung textures flip with `orientation`, in opposite senses. Every
|
|
107
|
+
* other value is direction-free, `"grid"` included — it is the orthogonal
|
|
108
|
+
* lattice against `"crosshatch"`'s diagonal one. Eight values match the
|
|
109
|
+
* palette's eight series slots.
|
|
110
|
+
*
|
|
111
|
+
* Texture is a redundant identity encoding alongside color — inked tone-on-tone
|
|
112
|
+
* at equal loudness across slots — so grouped and stacked series stay
|
|
113
|
+
* distinguishable without color vision, in grayscale print, and under forced
|
|
114
|
+
* colors.
|
|
79
115
|
*/
|
|
80
|
-
type BarTexture = "solid" | "hatch" | "hatch-reverse" | "crosshatch" | "perpendicular" | "dots";
|
|
116
|
+
type BarTexture = "solid" | "hatch" | "hatch-reverse" | "crosshatch" | "perpendicular" | "parallel" | "grid" | "dots";
|
|
81
117
|
/**
|
|
82
118
|
* The direction a bar chart's bars run: vertical columns rising from a bottom
|
|
83
119
|
* baseline (the default), or horizontal bars growing rightward from a left
|
|
@@ -97,7 +133,14 @@ type SeriesMeta = {
|
|
|
97
133
|
color: string;
|
|
98
134
|
/** The color as authored (token name or custom string) before resolution. */
|
|
99
135
|
colorInput: SeriesColor;
|
|
100
|
-
/**
|
|
136
|
+
/**
|
|
137
|
+
* The point glyph the series wears (scatter marks, legend keys, hover
|
|
138
|
+
* dots): the explicit `shape` when it set one, else the glyph paired to its
|
|
139
|
+
* series slot.
|
|
140
|
+
*
|
|
141
|
+
* A bar paints no glyph. Its legend key wears `texture` instead, so nothing
|
|
142
|
+
* draws the glyph a bar series is paired with.
|
|
143
|
+
*/
|
|
101
144
|
shape: PointShape;
|
|
102
145
|
/** The fill texture the series wears (bar marks and their legend keys). */
|
|
103
146
|
texture: BarTexture;
|
|
@@ -118,7 +161,12 @@ type HoverSnapshot = {
|
|
|
118
161
|
xValue: XValue;
|
|
119
162
|
/** The original consumer datum at the active index. */
|
|
120
163
|
datum: ChartDatum;
|
|
121
|
-
/**
|
|
164
|
+
/**
|
|
165
|
+
* Every registered series' value at the active index. Stacked, the order runs
|
|
166
|
+
* from the far end of the stack back to the baseline, so the rows match the
|
|
167
|
+
* stack a reader sees. Unstacked, the order is the paint order the series
|
|
168
|
+
* registered in.
|
|
169
|
+
*/
|
|
122
170
|
points: Array<{
|
|
123
171
|
dataKey: string;
|
|
124
172
|
label: string;
|
|
@@ -141,7 +189,12 @@ type ChartDatumEvent<TDatum extends ChartDatum = ChartDatum> = {
|
|
|
141
189
|
xValue: XValue;
|
|
142
190
|
/** The activated row itself. */
|
|
143
191
|
datum: TDatum;
|
|
144
|
-
/**
|
|
192
|
+
/**
|
|
193
|
+
* The series the pointer selects when activated by mouse; `null` for
|
|
194
|
+
* keyboard/whole-band activation. A stacked bar resolves to the segment the
|
|
195
|
+
* pointer sits in, because the mark is the filled span. Every other mark
|
|
196
|
+
* resolves to the series nearest the pointer.
|
|
197
|
+
*/
|
|
145
198
|
dataKey: string | null;
|
|
146
199
|
};
|
|
147
200
|
/**
|
|
@@ -250,7 +303,7 @@ type ChartAccessibilityProps = ({
|
|
|
250
303
|
type ChartRootBaseProps = Omit<ComponentProps<"div">, "aria-label" | "aria-labelledby"> & WithDataSlot & {
|
|
251
304
|
/** Override the automatic y domain. */
|
|
252
305
|
yDomain?: YDomain;
|
|
253
|
-
/** Stack the
|
|
306
|
+
/** Stack the series in registration order, from the baseline out (bar/area charts). */
|
|
254
307
|
stacked?: boolean;
|
|
255
308
|
/** Animate enter/update transitions. `prefers-reduced-motion` always wins. */
|
|
256
309
|
animate?: boolean;
|
|
@@ -314,9 +367,9 @@ type LegendPrimitiveProps = Omit<ComponentProps<"div">, "children"> & {
|
|
|
314
367
|
};
|
|
315
368
|
type CopyButtonPrimitiveProps = Omit<ComponentProps<"button">, "children" | "type" | "onCopy"> & SelfClosingWithAsChild & {
|
|
316
369
|
/**
|
|
317
|
-
* The accessible label for the copy button.
|
|
318
|
-
*
|
|
319
|
-
* img
|
|
370
|
+
* The accessible label for the copy button. `CopyButton` hides this label
|
|
371
|
+
* visually and announces it to screen readers, like the `alt` text on an
|
|
372
|
+
* `<img>`.
|
|
320
373
|
*
|
|
321
374
|
* @default "Copy data as Markdown"
|
|
322
375
|
*/
|
|
@@ -331,4 +384,4 @@ type CopyButtonPrimitiveProps = Omit<ComponentProps<"button">, "children" | "typ
|
|
|
331
384
|
onCopyError?: (error: unknown) => void;
|
|
332
385
|
};
|
|
333
386
|
//#endregion
|
|
334
|
-
export {
|
|
387
|
+
export { PointShape as _, LegendPrimitiveProps as a, XAxisPrimitiveProps as c, BarTexture as d, ChartDatum as f, CurveKind as g, ContinuousXScale as h, GridPrimitiveProps as i, YAxisPrimitiveProps as l, ChartSeriesSlot as m, ChartRootBaseProps as n, ReferenceLinePrimitiveProps as o, ChartDatumEvent as p, CopyButtonPrimitiveProps as r, TooltipPrimitiveProps as s, ChartAccessibilityProps as t, BarOrientation as u, SeriesColor as v };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e}from"./compose-refs-BdBMM9ga.js";import{t}from"./cx-IiQEAKf5.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./button-CCkGqE1t.js";import{t as i}from"./use-copy-to-clipboard-CSyp4Zk0.js";import{createContext as a,useContext as o,useEffect as s,useId as c,useLayoutEffect as l,useMemo as u,useRef as d,useState as f,useSyncExternalStore as p}from"react";import m from"tiny-invariant";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{CheckIcon as v}from"@phosphor-icons/react/Check";import{CopyIcon as y}from"@phosphor-icons/react/Copy";import{scaleTime as b}from"d3-scale";import{area as x,curveLinear as S,curveMonotoneX as C,curveStep as w,line as T}from"d3-shape";const E=(e,t)=>Reflect.get(e,t),D=.5,O=(e,t)=>e<0?e:t,k=e=>{let{lower:t,upper:n,toPixel:r,reveal:i,gap:a}=e,o=r(t<0?n:t),s=o+(r(O(t,n))-o)*i;if(Math.abs(o-r(0))<D)return{baseline:o,value:s};let c=Math.min(a,Math.abs(o-s)/2);return{baseline:o-Math.sign(o-s)*c,value:s}},A=e=>{let{lower:t,upper:n,pileOuter:r,toPixel:i}=e;if(Number.isNaN(r))return!1;let a=i(O(t,n));return Math.abs(a-i(r))<D},j=[`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`,`chart-6`,`chart-7`,`chart-8`,`chart-other`],ee=e=>j.includes(e),te=e=>`--color-${e}`,ne=[`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`,`chart-6`,`chart-7`,`chart-8`],re=e=>{let t=e.toLowerCase();return t.includes(`var(`)||t.includes(`currentcolor`)},M=(e,t)=>{let n=e.ownerDocument,r=n.createElement(`span`);r.style.display=`none`,r.style.color=t,e.appendChild(r);let i=n.defaultView?.getComputedStyle(r).color??``;return r.remove(),i},ie=(e,t)=>ee(t)?M(e,`var(${te(t)})`):re(t)?M(e,t):t,ae=e=>({grid:M(e,`var(--border-color-card-muted)`),baseline:M(e,`var(--border-color-card)`),tickText:M(e,`var(--text-color-muted)`),reference:M(e,`var(--color-neutral-500)`),surface:M(e,`var(--background-color-card)`)}),N=e=>`${e.className}|${e.getAttribute(`data-applied-theme`)??``}|${e.getAttribute(`data-theme`)??``}`,P=(e,t)=>{let n=new MutationObserver(t);return n.observe(e,{attributes:!0,attributeFilter:[`class`,`data-applied-theme`,`data-theme`]}),()=>n.disconnect()},F=1.5,I=1.1,L=1.6,R=e=>`oklch(from ${e} calc(l - 0.18) c h)`,z=(e,t,n)=>{let r=F;if(n===`up`){e.moveTo(-1.5,t+r),e.lineTo(t+r,-1.5),e.moveTo(-1.5,r),e.lineTo(r,-1.5),e.moveTo(t-r,t+r),e.lineTo(t+r,t-r);return}e.moveTo(-1.5,-1.5),e.lineTo(t+r,t+r),e.moveTo(t-r,-1.5),e.lineTo(t+r,r),e.moveTo(-1.5,t-r),e.lineTo(r,t+r)},B=(e,t)=>{let{size:n,width:r}=t;e.fillRect(0,n/2-r/2,n,r)},V=(e,t)=>{let{size:n,width:r}=t;e.fillRect(n/2-r/2,0,r,n)},oe={hatch:(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=F,e.beginPath(),z(e,t,`up`),e.stroke()},"hatch-reverse":(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=F,e.beginPath(),z(e,t,`down`),e.stroke()},crosshatch:(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=1,e.beginPath(),z(e,t,`up`),z(e,t,`down`),e.stroke()},perpendicular:(e,{size:t,ink:n,orientation:r})=>{e.fillStyle=n,r===`horizontal`?V(e,{size:t,width:2}):B(e,{size:t,width:2})},parallel:(e,{size:t,ink:n,orientation:r})=>{e.fillStyle=n,r===`horizontal`?B(e,{size:t,width:2}):V(e,{size:t,width:2})},grid:(e,{size:t,ink:n})=>{e.fillStyle=n,B(e,{size:t,width:I}),V(e,{size:t,width:I})},dots:(e,{size:t,ink:n})=>{e.fillStyle=n,e.beginPath(),e.arc(t/4,t/4,L,0,Math.PI*2),e.moveTo(3*t/4+L,3*t/4),e.arc(3*t/4,3*t/4,L,0,Math.PI*2),e.fill()}},se=(e,t)=>{let{texture:n,color:r,ink:i,devicePixelRatio:a,orientation:o}=t,s=e.canvas.ownerDocument.createElement(`canvas`);s.width=Math.max(1,Math.round(8*a)),s.height=s.width;let c=s.getContext(`2d`);if(c==null)return null;let l=s.width/8;c.scale(l,l),c.fillStyle=r,c.fillRect(0,0,8,8),oe[n](c,{size:8,ink:i,orientation:o});let u=e.createPattern(s,`repeat`);return u?.setTransform({a:1/l,b:0,c:0,d:1/l,e:0,f:0}),u},H=e=>{let{pointCount:t,columnCount:n,wasDecimated:r}=e;return n<=0?!1:r?t>=n*3:t>=n*4},U=e=>{let{xs:t,values:n,startIndex:r,endIndex:i,positionK:a,positionB:o,columnCount:s}=e,c=new Uint8Array(s),l=new Float64Array(s),u=new Float64Array(s),d=new Float64Array(s),f=new Float64Array(s);for(let e=r;e<=i;e++){let r=n[e]??NaN;if(Number.isNaN(r))continue;let i=t[e]??NaN,p=Math.floor(i*a+o);if(p===s&&(p=s-1),!(p<0||p>=s)){if(c[p]===0){c[p]=1,l[p]=r,u[p]=r,d[p]=r,f[p]=r;continue}r<(l[p]??1/0)&&(l[p]=r),r>(u[p]??-1/0)&&(u[p]=r),f[p]=r}}return{columnCount:s,hasData:c,minValue:l,maxValue:u,inValue:d,outValue:f}},ce=new Intl.NumberFormat,le=new Intl.NumberFormat(void 0,{maximumSignificantDigits:4}),W=new Map,G=(e,t)=>{let n=Object.is(e,-0)?0:e,r=t?.maximumFractionDigits;if(r!=null){let e=W.get(r);return e??(e=new Intl.NumberFormat(void 0,{maximumFractionDigits:r}),W.set(r,e)),e.format(n)}return n!==0&&Math.abs(n)<1?le.format(n):ce.format(n)},ue=e=>!Number.isFinite(e)||e<=0?0:Math.min(20,Math.max(0,-Math.floor(Math.log10(e)))),de=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}),fe=new Intl.DateTimeFormat(void 0,{year:`numeric`,month:`short`,day:`numeric`}),pe=e=>e.getHours()!==0||e.getMinutes()!==0||e.getSeconds()!==0||e.getMilliseconds()!==0,K=(e,t)=>typeof e==`string`?e:typeof e==`number`?G(e):Number.isNaN(e.getTime())?`—`:t?.datasetHasTimeOfDay??pe(e)?de.format(e):fe.format(e),me=(e,t,n)=>{if(t<=0)return null;let r=0,i=t-1,a=e[0]??0,o=e[i]??0;if(n<=a)return 0;if(n>=o)return i;for(;i-r>1;){let t=r+i>>1;(e[t]??0)<=n?r=t:i=t}let s=n-(e[r]??0);return(e[i]??0)-n<s?i:r},he=Math.PI/2-.05,ge=e=>({cosYaw:Math.cos(e.yaw),sinYaw:Math.sin(e.yaw),cosPitch:Math.cos(e.pitch),sinPitch:Math.sin(e.pitch)}),_e=(e,t,n,r)=>{let i=e*r.cosYaw+n*r.sinYaw,a=-e*r.sinYaw+n*r.cosYaw,o=t*r.cosPitch-a*r.sinPitch,s=t*r.sinPitch+a*r.cosPitch,c=4/(4+s);return{x:i*c,y:o*c,depth:s,scale:c}},ve=e=>Math.min(he,Math.max(-he,e)),ye=(e,t)=>{let n=t[1]-t[0];return n===0?0:(e-t[0])/n*2-1},be=[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1],[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],xe=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[1,5],[2,6],[3,7]],Se=Math.sqrt(50),Ce=Math.sqrt(10),we=Math.sqrt(2),q=(e,t,n,r)=>{let i=(t-e)/Math.max(0,n),a=r?.integer?Math.max(1,i):i,o=Math.floor(Math.log10(a)),s=a/10**o,c=s>=Se?10:s>=Ce?5:s>=we?2:1,l,u,d;return o<0?(d=10**-o/c,l=Math.round(e*d),u=Math.round(t*d),l/d<e&&(l+=1),u/d>t&&--u,d=-d):(d=10**o*c,l=Math.round(e/d),u=Math.round(t/d),l*d<e&&(l+=1),u*d>t&&--u),u<l&&.5<=n&&n<2?q(e,t,n*2,r):[l,u,d]},Te=(e,t,n,r)=>{if(!(n>0))return[];if(e===t)return r?.integer&&!Number.isInteger(e)?[]:[e];let i=t<e,[a,o,s]=i?q(t,e,n,r):q(e,t,n,r);if(!(o>=a))return[];let c=o-a+1,l=[];for(let e=0;e<c;e+=1){let t=i?o-e:a+e;l.push(s<0?t/-s:t*s)}return l},Ee=(e,t,n)=>q(e,t,n)[2],De=(e,t)=>{let n=e[1]-e[0];if(n===0)return{k:0,b:(t[0]+t[1])/2};let r=(t[1]-t[0])/n;return{k:r,b:t[0]-e[0]*r}},Oe=e=>{let{count:t,rangeStart:n,rangeEnd:r,paddingInner:i,paddingOuter:a}=e,o=r-n;if(t<=0||o<=0)return{count:Math.max(0,t),rangeStart:n,step:0,bandwidth:0,offset:0};let s=o/Math.max(1,t-i+a*2);return{count:t,rangeStart:n,step:s,bandwidth:s*(1-i),offset:s*a}},J=(e,t)=>e.rangeStart+e.offset+t*e.step,Y=(e,t)=>J(e,t)+e.bandwidth/2,ke=(e,t)=>({start:J(e,t)-(e.step-e.bandwidth)/2,size:e.step}),Ae=(e,t)=>{if(e.count===0||e.step===0)return null;let n=Math.floor((t-e.rangeStart-e.offset+e.step/2-e.bandwidth/2)/e.step);return Math.min(e.count-1,Math.max(0,n))},je=(e,t,n)=>Te(e[0],e[1],t,n);let Me=null,Ne=null;const Pe=e=>{if(Ne!=null&&Me!=null&&Me[0]===e[0]&&Me[1]===e[1])return Ne;let t=b().domain([new Date(e[0]),new Date(e[1])]);return Me=[e[0],e[1]],Ne=t,t},Fe=(e,t)=>Pe(e).ticks(t).map(e=>e.getTime()),Ie=e=>{let t=Pe(e).tickFormat();return e=>t(new Date(e))},X=(e,t)=>{if(e[0]>e[1])return X([e[1],e[0]],t);if(e[0]===e[1]){let n=e[0],r=n===0?1:Math.abs(n)*.5;return X([n-r,n+r],t)}let n=e[0],r=e[1],i=NaN;for(let e=0;e<10;e++){let e=Ee(n,r,t);if(e===i||e===0||!Number.isFinite(e))break;if(e>0)n=Math.floor(n/e)*e,r=Math.ceil(r/e)*e;else{let t=-e;n=Math.floor(n*t)/t,r=Math.ceil(r*t)/t}i=e}return[n,r]},Le=(e,t)=>{let n=X(e,t);return e[0]===0?[0,n[1]]:n},Re=e=>e===`monotone`?C:e===`step`?w:S,Z=e=>Math.round(e)+.5,ze=(e,t)=>{let{plot:n,color:r,xLines:i,yLines:a}=t;e.save(),e.strokeStyle=r,e.lineWidth=1;for(let t of i)e.globalAlpha=t.alpha,e.beginPath(),e.moveTo(Z(t.position),n.top),e.lineTo(Z(t.position),n.top+n.height),e.stroke();for(let t of a)e.globalAlpha=t.alpha,e.beginPath(),e.moveTo(n.left,Z(t.position)),e.lineTo(n.left+n.width,Z(t.position)),e.stroke();e.restore()},Be=(e,t)=>{let{plot:n,color:r,y:i}=t;e.strokeStyle=r,e.lineWidth=1,e.beginPath(),e.moveTo(n.left,Z(i)),e.lineTo(n.left+n.width,Z(i)),e.stroke()},Ve=(e,t)=>{let{plot:n,color:r,x:i}=t;e.strokeStyle=r,e.lineWidth=1,e.beginPath(),e.moveTo(Z(i),n.top),e.lineTo(Z(i),n.top+n.height),e.stroke()},He=(e,t)=>{let{fill:n,rects:r}=t;e.fillStyle=n,e.beginPath();for(let t of r){let n=Math.max(.5,t.width),r=Math.min(t.valueY,t.baselineY),i=Math.abs(t.baselineY-t.valueY);if(i===0)continue;let a=t.rounded&&n>=8?Math.min(4,n/2,i):0;if(a===0){e.rect(t.x,r,n,i);continue}t.valueY<=t.baselineY?e.roundRect(t.x,r,n,i,[a,a,0,0]):e.roundRect(t.x,r,n,i,[0,0,a,a])}e.fill()},Ue=(e,t)=>{let{fill:n,rects:r}=t;e.fillStyle=n,e.beginPath();for(let t of r){let n=Math.max(.5,t.height),r=Math.min(t.valueX,t.baselineX),i=Math.abs(t.valueX-t.baselineX);if(i===0)continue;let a=t.rounded&&n>=8?Math.min(4,n/2,i):0;if(a===0){e.rect(r,t.y,i,n);continue}t.valueX>=t.baselineX?e.roundRect(r,t.y,i,n,[0,a,a,0]):e.roundRect(r,t.y,i,n,[a,0,0,a])}e.fill()},We=(e,t)=>{let{color:n,curve:r,indexes:i,xAt:a,yAt:o,definedAt:s}=t,c=T().x(a).y(o).defined(s).curve(Re(r)).context(e);e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath(),c(i),e.stroke()},Ge=(e,t)=>{let{color:n,curve:r,indexes:i,xAt:a,y0At:o,y1At:s,definedAt:c}=t,l=x().x(a).y0(o).y1(s).defined(c).curve(Re(r)).context(e);e.beginPath(),l(i),e.save(),e.globalAlpha=.1,e.fillStyle=n,e.fill(),e.restore();let u=T().x(a).y(s).defined(c).curve(Re(r)).context(e);e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath(),u(i),e.stroke()},Ke=(e,t)=>{let{color:n,columns:r,columnToX:i,valueK:a,valueB:o}=t;e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath();let s=!1;for(let t=0;t<r.columnCount;t++){if(r.hasData[t]===0){s=!1;continue}let n=i(t),c=(r.inValue[t]??0)*a+o,l=(r.minValue[t]??0)*a+o,u=(r.maxValue[t]??0)*a+o,d=(r.outValue[t]??0)*a+o;s?e.lineTo(n,c):(e.moveTo(n,c),s=!0),(l!==c||u!==c)&&(e.lineTo(n,l),e.lineTo(n,u)),d!==u&&e.lineTo(n,d)}e.stroke()},qe=(e,t)=>{let{color:n,lowerColumns:r,upperColumns:i,columnToX:a,valueK:o,valueB:s}=t;e.beginPath();let c=-1,l=t=>{if(c<0)return;let n=!1;for(let r=c;r<=t;r++){let t=a(r),c=(i.maxValue[r]??0)*o+s;n?e.lineTo(t,c):(e.moveTo(t,c),n=!0)}for(let n=t;n>=c;n--){let t=a(n),i=(r.minValue[n]??0)*o+s;e.lineTo(t,i)}e.closePath(),c=-1};for(let e=0;e<i.columnCount;e++){if(i.hasData[e]===0){l(e-1);continue}c<0&&(c=e)}l(i.columnCount-1),e.save(),e.globalAlpha=.1,e.fillStyle=n,e.fill(),e.restore(),Ke(e,{color:n,columns:i,columnToX:a,valueK:o,valueB:s})},Je=(e,t,n,r,i)=>{let a=!1;for(let[o,s]of i)a?e.lineTo(t+o*r,n+s*r):(e.moveTo(t+o*r,n+s*r),a=!0);e.closePath()},Ye=[[-1/3,-1],[1/3,-1],[1/3,-1/3],[1,-1/3],[1,1/3],[1/3,1/3],[1/3,1],[-1/3,1],[-1/3,1/3],[-1,1/3],[-1,-1/3],[-1/3,-1/3]],Xe=Ye.map(([e,t])=>[(e-t)/Math.SQRT2,(e+t)/Math.SQRT2]),Ze=Array.from({length:10},(e,t)=>{let n=-Math.PI/2+t*Math.PI/5,r=t%2==0?1:.382;return[Math.cos(n)*r,Math.sin(n)*r]}),Qe={circle:(e,t,n,r)=>{e.arc(t,n,r,0,Math.PI*2)},square:(e,t,n,r)=>{let i=r*.886;e.moveTo(t-i,n-i),e.lineTo(t+i,n-i),e.lineTo(t+i,n+i),e.lineTo(t-i,n+i),e.closePath()},triangle:(e,t,n,r)=>{let i=r*1.55;e.moveTo(t,n-i),e.lineTo(t+i*.866,n+i*.5),e.lineTo(t-i*.866,n+i*.5),e.closePath()},diamond:(e,t,n,r)=>{let i=r*1.253;e.moveTo(t,n-i),e.lineTo(t+i,n),e.lineTo(t,n+i),e.lineTo(t-i,n),e.closePath()},"triangle-down":(e,t,n,r)=>{let i=r*1.55;e.moveTo(t,n+i),e.lineTo(t+i*.866,n-i*.5),e.lineTo(t-i*.866,n-i*.5),e.closePath()},plus:(e,t,n,r)=>{Je(e,t,n,r*1.189,Ye)},cross:(e,t,n,r)=>{Je(e,t,n,r*1.189,Xe)},star:(e,t,n,r)=>{Je(e,t,n,r*1.673,Ze)}},$e=(e,t,n,r,i)=>{Qe[i](e,t,n,r)},et=(e,t)=>{let{color:n,surface:r,shape:i,indexes:a,xAt:o,yAt:s,definedAt:c}=t;e.fillStyle=n,e.strokeStyle=r,e.lineWidth=2;for(let t of a)c(t)&&(e.beginPath(),$e(e,o(t),s(t),4,i),e.fill(),e.stroke())},tt=5e3,nt=2e4,rt=(e,t)=>{let{color:n,surface:r,shape:i,totalPointCount:a,indexes:o,xAt:s,yAt:c,radiusAt:l}=t;if(e.fillStyle=n,a>nt){e.beginPath();for(let t of o)l(t)<=0||e.rect(s(t)-1,c(t)-1,2,2);e.fill();return}let u=a<=tt;e.strokeStyle=r,e.lineWidth=2;for(let t of o){let n=l(t);n<=0||(e.beginPath(),$e(e,s(t),c(t),n,i),e.fill(),u&&e.stroke())}},it=(e,t)=>{let{count:n,order:r,screenX:i,screenY:a,radius:o,colorAt:s,shapeAt:c,alphaAt:l,surface:u}=t;if(e.save(),n>nt){let t=``,n=-1;for(let c of r){let r=s(c);r!==t&&(e.fillStyle=r,t=r);let u=l(c);u!==n&&(e.globalAlpha=u,n=u);let d=Math.max(1,(o[c]??0)/2);e.fillRect((i[c]??0)-d/2,(a[c]??0)-d/2,d,d)}e.restore();return}let d=n<=tt;e.strokeStyle=u,e.lineWidth=2;let f=``,p=-1;for(let t of r){let n=s(t);n!==f&&(e.fillStyle=n,f=n);let r=l(t);r!==p&&(e.globalAlpha=r,p=r),e.beginPath(),$e(e,i[t]??0,a[t]??0,o[t]??0,c(t)),e.fill(),d&&e.stroke()}e.restore()},at=(e,t)=>{let{gridColor:n,axisColor:r,corners:i,edges:a,cubeAlpha:o,axes:s}=t;if(e.save(),o>.01){e.globalAlpha=o,e.strokeStyle=n,e.lineWidth=1,e.beginPath();for(let[t,n]of a){let r=i[t],a=i[n];r!=null&&a!=null&&(e.moveTo(r.x,r.y),e.lineTo(a.x,a.y))}e.stroke()}e.strokeStyle=r;for(let{alpha:t,from:n,to:r}of s)t<=.01||(e.globalAlpha=t,e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(r.x,r.y),e.stroke());e.restore()},ot=(e,t)=>{let{textColor:n,fontFamily:r,plot:i,center:a,axes:o}=t;e.save(),e.fillStyle=n,e.font=`11px ${r}`,e.textAlign=`center`,e.textBaseline=`middle`;for(let{label:t,alpha:n,from:r,to:s}of o){if(n<=.01)continue;let o=Math.hypot(r.x-a.x,r.y-a.y),c=Math.hypot(s.x-a.x,s.y-a.y),l=c>=o?s:r,u=c>=o?r:s,d=Math.max(1,Math.hypot(l.x-u.x,l.y-u.y)),f=(l.x-u.x)/d*16,p=(l.y-u.y)/d*16,m=Math.min(i.left+i.width-8,Math.max(i.left+8,l.x+f)),h=Math.min(i.top+i.height-6,Math.max(i.top+6,l.y+p));e.globalAlpha=n,e.fillText(t,m,h)}e.restore()},st=(e,t)=>{let{plot:n,color:r,textColor:i,y:a,label:o,fontFamily:s}=t;e.strokeStyle=r,e.lineWidth=1,e.setLineDash([4,4]),e.beginPath(),e.moveTo(n.left,Z(a)),e.lineTo(n.left+n.width,Z(a)),e.stroke(),e.setLineDash([]),o!=null&&o.length>0&&(e.font=`11px ${s}`,e.fillStyle=i,e.textAlign=`right`,e.textBaseline=`bottom`,e.fillText(o,n.left+n.width-4,a-3))},ct=(e,t)=>{let{plot:n,color:r,textColor:i,x:a,label:o,fontFamily:s}=t;if(e.strokeStyle=r,e.lineWidth=1,e.setLineDash([4,4]),e.beginPath(),e.moveTo(Z(a),n.top),e.lineTo(Z(a),n.top+n.height),e.stroke(),e.setLineDash([]),o!=null&&o.length>0){e.font=`11px ${s}`,e.fillStyle=i;let t=e.measureText(o).width,r=a+4+t<=n.left+n.width;e.textAlign=r?`left`:`right`,e.textBaseline=`top`,e.fillText(o,r?a+4:a-4,n.top+3)}},lt=(e,t)=>{let{plot:n,color:r,fontFamily:i,xLabels:a,yLabels:o}=t;e.save(),e.font=`11px ${i}`,e.fillStyle=r,e.textAlign=`right`,e.textBaseline=`middle`;for(let t of o)e.globalAlpha=t.alpha,e.fillText(t.text,n.left-8,t.position);e.textAlign=`center`,e.textBaseline=`top`;for(let t of a)e.globalAlpha=t.alpha,e.fillText(t.text,t.position,n.top+n.height+8);e.restore()},ut=e=>{let t=e.length,n=e[0]?.length??0,r=[],i=[];for(let e=0;e<t;e++)r.push(new Float64Array(n)),i.push(new Float64Array(n));let a=0,o=0,s=new Float64Array(n),c=new Float64Array(n),l=new Int32Array(n).fill(-1),u=new Int32Array(n).fill(-1);for(let d=0;d<t;d++){let t=e[d],f=r[d],p=i[d];if(t!=null&&f!=null&&p!=null)for(let e=0;e<n;e++){let n=t[e]??NaN;if(Number.isNaN(n)){f[e]=NaN,p[e]=NaN;continue}if(n>=0){let t=s[e]??0,r=t+n;s[e]=r,f[e]=t,p[e]=r,r>o&&(o=r),n>0&&(l[e]=d)}else{let t=c[e]??0,r=t+n;c[e]=r,f[e]=r,p[e]=t,r<a&&(a=r),u[e]=d}}}return{lower:r,upper:i,min:a,max:o,positiveEnd:l,negativeEnd:u}},dt=e=>1-(1-e)**3;var ft=class{#e=new Float64Array;#t=new Float64Array;#n=new Float64Array;#r=0;#i=0;#a=!1;get active(){return this.#a}values(){return this.#n}retarget(e,t){let{duration:n,now:r}=t,i=e.length,a=this.#n.length!==i;if(a&&(this.#e=new Float64Array(i),this.#t=new Float64Array(i),this.#n=new Float64Array(i)),a||n<=0){for(let t=0;t<i;t++){let n=e[t]??NaN;this.#e[t]=n,this.#t[t]=n,this.#n[t]=n}this.#a=!1;return}let o=!1;for(let t=0;t<i;t++){let n=e[t]??NaN,r=this.#n[t]??NaN;if(r!==n&&!(Number.isNaN(r)&&Number.isNaN(n))){o=!0;break}}if(!o){for(let t=0;t<i;t++)this.#t[t]=e[t]??NaN;this.#a=!1;return}for(let t=0;t<i;t++)this.#e[t]=this.#n[t]??NaN,this.#t[t]=e[t]??NaN;this.#r=r,this.#i=n,this.#a=!0}snap(){this.#n.set(this.#t),this.#a=!1}tick(e){if(!this.#a)return!1;let t=Math.min(1,(e-this.#r)/this.#i),n=dt(t);for(let e=0;e<this.#n.length;e++){let t=this.#e[e]??NaN,r=this.#t[e]??NaN;if(Number.isNaN(t)||Number.isNaN(r)){this.#n[e]=r;continue}this.#n[e]=t+(r-t)*n}return t>=1&&(this.#a=!1),this.#a}},pt=class{#e=new Float64Array;#t=new Float64Array;#n=0;#r=!1;#i;#a;#o=0;constructor(e={}){this.#i=e.speed??.14,this.#a=e.epsilon??.001}get active(){return this.#r}values(){return this.#t}jump(e){this.#t.length!==e.length&&(this.#e=new Float64Array(e.length),this.#t=new Float64Array(e.length));for(let t=0;t<e.length;t++){let n=e[t]??NaN;this.#e[t]=n,this.#t[t]=n}this.#r=!1}aim(e,t){if(this.#t.length!==e.length){this.jump(e);return}let n=!1;for(let t=0;t<e.length;t++){let r=e[t]??NaN,i=this.#e[t]??NaN;if(i!==r&&!(Number.isNaN(i)&&Number.isNaN(r))){n=!0;break}}if(!n)return;let r=0;for(let t=0;t<e.length;t++){let n=e[t]??NaN;this.#e[t]=n;let i=Math.abs(n-(this.#t[t]??NaN));Number.isFinite(i)&&i>r&&(r=i)}this.#o=r,this.#r||(this.#r=!0,this.#n=t)}tick(e){if(!this.#r)return!1;let t=Math.min(50,Math.max(0,e-this.#n));this.#n=e;let n=1-(1-this.#i)**(t/16.67),r=Math.max(this.#o*this.#a,2**-52),i=!0;for(let e=0;e<this.#t.length;e++){let t=this.#e[e]??NaN,a=this.#t[e]??NaN;if(Number.isNaN(t)||Number.isNaN(a)){this.#t[e]=t;continue}let o=a+(t-a)*n;n>0&&o===a||Math.abs(t-o)<=r?this.#t[e]=t:(this.#t[e]=o,i=!1)}return this.#r=!i,this.#r}};const mt=e=>`${e.colorInput}|${e.texture}`,ht={bar:`BarChart.Bar`,line:`LineChart.Line`,area:`AreaChart.Area`,scatter:`ScatterPlot.Point`},gt=1e3;var _t=class{#e;#t;#n;#r={xKey:``,xScale:`linear`,yDomain:[`auto`,`auto`],orientation:`vertical`,zKey:null,dimensions:3,stacked:!1,animate:!0};#i={onDatumActivate:null,onActiveIndexChange:null};#a;#o=null;#s=null;#c=null;#l=null;#u=0;#d=0;#f=1;#p=[];#m=0;#h=new Float64Array;#g=[];#_=null;#v=null;#y=!1;#b=!1;#x=new Map;#S=0;#C=0;#w=!0;#T=!0;#E=null;#D=new pt({speed:.16});#O=new pt({speed:.2});#k=new Map;#A=new Map;#j=!1;#M=new Map;#N=new Map;#P=0;#F=!1;#I=new Map;#L={alpha:0,target:0};#R=0;#z=null;#B=null;#V=null;#H={left:0,top:0,width:0,height:0};#U=null;#W=new Float64Array;#G=[0,1];#K={yaw:.65,pitch:-.35};#q=new pt({speed:.12});#J=new pt({speed:.16});#Y=null;#X=!1;#Z=null;#Q=new Int32Array;#$=new Map;#ee=``;#te=null;#ne=null;#re=null;#ie=void 0;#ae=null;#oe=!1;#se=null;#ce=null;#le={width:0,height:0};#ue=!1;#de=!1;#fe=0;#pe=!1;constructor(e){this.#e=e.kind,this.#t=e.elements,this.#n=e.store,this.#a=e.elements.canvas.getContext(`2d`),this.#n.onSeriesChange=()=>{this.#b=!0,this.#Te()},this.#n.onPresentationChange=()=>{this.#Te()},typeof ResizeObserver<`u`&&(this.#o=new ResizeObserver(e=>{let t=e[0];t!=null&&(this.#u=t.contentRect.width,this.#d=t.contentRect.height,this.#f=this.#ke(),this.#I.clear(),this.#te=null,this.#Te())}),this.#o.observe(e.elements.plot),this.#c=new ResizeObserver(()=>{this.#le={width:this.#t.tooltip.offsetWidth,height:this.#t.tooltip.offsetHeight},this.#Ee()}),this.#c.observe(e.elements.tooltip));let t=e.elements.root.ownerDocument.documentElement;this.#s=P(t,()=>{this.#V=null,this.#Te()}),this.#me(),this.#J.jump([1,1])}destroy(){this.#pe=!0,this.#o?.disconnect(),this.#c?.disconnect(),this.#s?.(),this.#l?.(),this.#n.onSeriesChange=null,this.#n.onPresentationChange=null,this.#z!=null&&(clearTimeout(this.#z),this.#z=null),this.#fe!==0&&cancelAnimationFrame(this.#fe)}#me(){if(typeof matchMedia>`u`||this.#pe)return;this.#l?.();let e=matchMedia(`(resolution: ${this.#ke()}dppx)`),t=()=>{this.#f=this.#ke(),this.#I.clear(),this.#Te(),this.#me()};e.addEventListener(`change`,t,{once:!0}),this.#l=()=>e.removeEventListener(`change`,t)}setOptions(e){let t=this.#r;if(this.#r=e,t.xScale!==e.xScale&&this.#M.clear(),t.animate&&!e.animate&&this.#he(),t.dimensions!==e.dimensions){let t=[+(e.dimensions>=2),+(e.dimensions>=3)],n=vt(e.dimensions);if(this.#ve()===0||!this.#j)this.#J.jump(t),this.#K=n,this.#q.jump([n.yaw,n.pitch]);else{let e=n.yaw+Math.round((this.#K.yaw-n.yaw)/(Math.PI*2))*Math.PI*2;this.#J.aim(t,performance.now()),this.#q.jump([this.#K.yaw,this.#K.pitch]),this.#q.aim([e,n.pitch],performance.now())}}(t.xKey!==e.xKey||t.xScale!==e.xScale||t.zKey!==e.zKey||t.stacked!==e.stacked||t.yDomain[0]!==e.yDomain[0]||t.yDomain[1]!==e.yDomain[1])&&(this.#b=!0),this.#Te()}setCallbacks(e){this.#i=e}setRows(e){e!==this.#p&&(this.#p=e,this.#b=!0,this.#Te())}flushIngest(){!this.#b||this.#pe||(this.#b=!1,this.#ge())}setControlledActiveIndex(e){let t=this.#ae;this.#ae=null;let n=this.#ie!==void 0;if(this.#ie=e,e!==void 0){let n=t!=null&&t.index===e&&t.viaKeyboard;this.#nt(e==null?null:this.#$e(e),{viaKeyboard:n,notify:!1})}else n&&this.#nt(null,{viaKeyboard:!1,notify:!1});this.#Ee()}handlePointerMove(e,t){if(this.#Y!=null){let n=e-this.#Y.lastX,r=t-this.#Y.lastY;(this.#Y.moved||Math.abs(n)+Math.abs(r)>3)&&(this.#Y.moved=!0,this.#K={yaw:this.#K.yaw+n*.008,pitch:ve(this.#K.pitch+r*.008)},this.#q.jump([this.#K.yaw,this.#K.pitch]),this.#Y.lastX=e,this.#Y.lastY=t,this.#nt(null,{viaKeyboard:!1,notify:!1}),this.#Te());return}if(this.#se=e,this.#ce=t,this.#e===`scatter`){let n=this.#lt(e,t);this.#ne=n?.seriesKey??null,this.#te=n==null?null:{x:n.screenX,y:n.screenY},this.#nt(n?.index??null,{viaKeyboard:!1,notify:!0});return}let n=this.#et(e,t);this.#nt(n,{viaKeyboard:!1,notify:!0})}handlePointerDown(e,t){if(this.#X=!0,this.#xe()){this.#Y={lastX:e,lastY:t,moved:!1};return}this.handlePointerMove(e,t)}handlePointerUp(e,t){let n=this.#Y;this.#Y=null;let r=this.#X;if(this.#X=!1,n!=null){if(n.moved)return;this.handlePointerMove(e,t)}r&&this.handleActivate(e,t)}handlePointerLeave(){this.#se=null,this.#ce=null,this.#Y=null,this.#X=!1,this.#ne=null,this.#te=null,this.#nt(null,{viaKeyboard:!1,notify:!0})}handleActivate(e,t){let n=this.#Ze();if(n==null)return;let r=this.#Qe(n),i=this.#p[r];if(i==null)return;let a=this.#e===`scatter`?this.#ne:e==null||t==null?null:this.#tt(n,e,t);this.#i.onDatumActivate?.({index:r,xValue:this.#g[n]??``,datum:i,dataKey:a})}handleKeyDown(e){if(this.#m===0)return!1;let t=this.#m-1,n=this.#Ze(),r=this.#F?Math.max(1,Math.floor(this.#m/Math.max(1,this.#H.width*this.#f))):1,i=Math.max(1,Math.floor(this.#m/10)),a=(()=>{switch(e){case`ArrowLeft`:return Math.max(0,(n??this.#m)-r);case`ArrowRight`:return Math.min(t,(n??-1)+r);case`PageUp`:return Math.min(t,(n??0)+i);case`PageDown`:return Math.max(0,(n??t)-i);case`Home`:return 0;case`End`:return t;case`Escape`:return null;default:return}})();return a===void 0?e===`Enter`||e===` `?(this.handleActivate(null,null),!0):!1:(this.#se=null,this.#ce=null,this.#ne=null,this.#te=null,this.#nt(a,{viaKeyboard:!0,notify:!0}),!0)}invalidateColors(){this.#V=null,this.#Te()}#he(){this.#D.jump(this.#ye()),this.#O.jump(this.#be()),this.#J.jump([+(this.#r.dimensions>=2),+(this.#r.dimensions>=3)]);let e=vt(this.#r.dimensions);this.#K=e,this.#q.jump([e.yaw,e.pitch]);for(let e of this.#k.values())e.snap();for(let e of this.#A.values())e.snap();this.#L.alpha=this.#L.target,this.#Te()}#ge(){let e=this.#p,{xKey:t,xScale:n}=this.#r,r=this.#n.seriesSpecs();this.#I.clear();let i=this.#h;if(n===`band`||n===`point`){let n=e.length,r=new Float64Array(n),i=Array.from({length:n},()=>``),a=!1;for(let o=0;o<n;o++){let n=e[o],s=n==null?void 0:E(n,t);s!==void 0&&(a=!0),i[o]=typeof s==`string`||typeof s==`number`||s instanceof Date?s:String(s),r[o]=o}m(n===0||a,`${this.#Ce()} xKey "${t}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),this.#_=null,this.#v=null,this.#m=n,this.#h=r,this.#g=i,this.#T=!0}else{let r=[],i=!1,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e[s],l=c==null?void 0:E(c,t);l!==void 0&&(i=!0),l!=null&&(a=!0);let u=Ct(l,n===`time`);Number.isFinite(u)&&(r.push({source:s,x:u}),o=!0)}m(e.length===0||i,`${this.#Ce()} xKey "${t}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),m(!a||o,`${this.#Ce()} could not read any "${t}" values as ${n===`time`?`dates`:`numbers`} for the "${n}" x scale — check the xScale and the data types.`);let s=!0;for(let e=1;e<r.length;e++)if((r[e]?.x??0)<(r[e-1]?.x??0)){s=!1;break}let c=s?r:r.toSorted((e,t)=>e.x-t.x),l=c.length,u=new Float64Array(l),d=Array.from({length:l},()=>``),f=l===e.length,p=!0,h=new Int32Array(l);for(let e=0;e<l;e++){let t=c[e];t!=null&&(u[e]=t.x,Number.isInteger(t.x)||(p=!1),n===`time`?d[e]=new Date(t.x):d[e]=t.x,h[e]=t.source,t.source!==e&&(f=!1))}if(f)this.#_=null,this.#v=null;else{this.#_=h;let t=new Int32Array(e.length).fill(-1);for(let e=0;e<l;e++){let n=h[e];n!=null&&(t[n]=e)}this.#v=t}this.#m=l,this.#h=u,this.#g=d,this.#T=p}let a=!1;for(let e of this.#g)if(e instanceof Date&&pe(e)){a=!0;break}this.#y=a;let o=this.#h[0],s=this.#h[this.#m-1],c=i[0],l=i[i.length-1];!this.#xe()&&(n===`linear`||n===`time`)&&o!=null&&s!=null&&c!=null&&l!=null&&o>c&&s>=l?(this.#L.target=1,this.#R=performance.now()):(o!==c||s!==l)&&(this.#L.target=0);let u=this.#m,d=i.length===u&&u<=2500;if(d){for(let e=0;e<u;e++)if(i[e]!==this.#h[e]){d=!1;break}}let f=this.#x;this.#x=new Map;let p=1/0,h=-1/0,g=!0;for(let t of r){let n=new Float64Array(u),r=!1;for(let i=0;i<u;i++){let a=e[this.#_==null?i:this.#_[i]??i],o=a==null?void 0:E(a,t.dataKey);if(o===void 0){n[i]=NaN;continue}r=!0;let s=typeof o==`number`&&Number.isFinite(o)?o:NaN;n[i]=s,Number.isNaN(s)||(s<p&&(p=s),s>h&&(h=s),Number.isInteger(s)||(g=!1))}m(u===0||r,`${ht[t.mark]} dataKey "${t.dataKey}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),this.#x.set(t.dataKey,n)}this.#S=p===1/0?0:p,this.#C=h===-1/0?0:h,this.#w=g;let _=this.#r.zKey;if(this.#e===`scatter`&&_!=null){let t=new Float64Array(u),n=1/0,r=-1/0,i=!1;for(let a=0;a<u;a++){let o=e[this.#_==null?a:this.#_[a]??a],s=o==null?void 0:E(o,_);s!==void 0&&(i=!0);let c=typeof s==`number`&&Number.isFinite(s)?s:NaN;t[a]=c,Number.isNaN(c)||(c<n&&(n=c),c>r&&(r=c))}m(u===0||i,`ScatterPlot.Root zKey "${_}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),this.#W=t,this.#G=n===1/0?[0,1]:X([n,r],5)}else this.#W=new Float64Array;this.#Z=null,this.#te=null,this.#E=this.#r.stacked?ut(r.map(e=>this.#x.get(e.dataKey)??new Float64Array)):null,this.#F=H({pointCount:u,columnCount:Math.max(1,Math.round(this.#H.width*this.#f)),wasDecimated:this.#F});let v=this.#V;if(v!=null){for(let e of this.#n.seriesMeta())if(v.inputs.get(e.dataKey)!==mt(e)){this.#V=null;break}}this.#_e(r,f,d);let y=this.#Ze();y!=null&&this.#nt(Math.min(y,Math.max(0,u-1)),{viaKeyboard:this.#oe,notify:!1}),this.#ot({force:!0})}#_e(e,t,n){let r=performance.now(),i=this.#ve(),a=!this.#j;this.#j=this.#j||this.#m>0,a||i===0?(this.#D.jump(this.#ye()),this.#O.jump(this.#be())):(this.#D.aim(this.#ye(),r),this.#O.aim(this.#be(),r));let o=this.#m>0&&this.#m<=2500&&n,s=new Set,c=(e,t,n)=>{s.add(e);let a=this.#k.get(e);a??(a=new ft,this.#k.set(e,a));let c=o&&n&&a.values().length===t.length;a.retarget(t,{duration:c?i:0,now:r})};e.forEach((e,n)=>{let i=t.has(e.dataKey);if(this.#E==null?c(e.dataKey,this.#x.get(e.dataKey)??new Float64Array,i):(c(`${e.dataKey}:lower`,this.#E.lower[n]??new Float64Array,i),c(`${e.dataKey}:upper`,this.#E.upper[n]??new Float64Array,i)),!this.#A.has(e.dataKey)&&this.#m>0){let t=new ft;t.retarget([0],{duration:0,now:r}),t.retarget([1],{duration:this.#ve(),now:r}),this.#A.set(e.dataKey,t)}});for(let e of this.#k.keys())s.has(e)||this.#k.delete(e)}#ve(){return!this.#r.animate||typeof matchMedia<`u`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches?0:280}#ye(){let[e,t]=this.#r.yDomain,n,r;if(this.#E==null?this.#e===`line`||this.#e===`scatter`?(n=this.#S,r=this.#C):(n=Math.min(0,this.#S),r=Math.max(0,this.#C)):(n=Math.min(0,this.#E.min),r=Math.max(0,this.#E.max)),typeof e==`number`&&(n=e),typeof t==`number`&&(r=t),this.#m===0)return[0,1];let i=this.#e===`bar`||this.#e===`area`?Le([n,r],5):X([n,r],5);return[typeof e==`number`?e:i[0],typeof t==`number`?t:i[1]]}#be(){if(this.#m===0)return[0,1];let e=this.#h[0]??0,t=this.#h[this.#m-1]??0;return e===t?[e-.5,t+.5]:this.#e===`scatter`?X([e,t],5):[e,t]}#xe(){return this.#e===`scatter`&&this.#r.zKey!=null}#Se(){return this.#e===`bar`&&this.#r.orientation===`horizontal`}#Ce(){return`${ht[this.#e].split(`.`)[0]??`Chart`}.Root`}#we(e,t){let n=this.#B;n??(n=this.#t.canvas.ownerDocument.createElement(`canvas`),this.#B=n),(n.width!==e||n.height!==t)&&(n.width=e,n.height=t);let r=n.getContext(`2d`);return r==null?null:{canvas:n,ctx:r}}#Te(){this.#de=!0,this.#De()}#Ee(){this.#De()}#De(){this.#ue||this.#pe||(this.#ue=!0,this.#fe=requestAnimationFrame(()=>{this.#ue=!1,this.#fe=0,this.#Oe()}))}#Oe(){if(!this.#pe){if(this.flushIngest(),this.#de){this.#de=!1;let e=performance.now(),t=!1;t=this.#D.tick(e)||t,t=this.#O.tick(e)||t;for(let n of this.#k.values())t=n.tick(e)||t;for(let n of this.#A.values())t=n.tick(e)||t;if(t=this.#J.tick(e)||t,this.#q.tick(e)){t=!0;let e=this.#q.values();this.#K={yaw:e[0]??this.#K.yaw,pitch:e[1]??this.#K.pitch}}this.#Ae(),this.#Me(),t=this.#ze(e)||t,t&&this.#Te()}this.#dt()}}#ke(){return typeof devicePixelRatio==`number`&&devicePixelRatio>0?Math.min(devicePixelRatio,3):1}#Ae(){let e=this.#t.root,t=`${N(e.ownerDocument.documentElement)}|${this.#f}|${this.#r.orientation}`;if(this.#V?.signature===t)return;let n=e.ownerDocument.defaultView;if(n==null)return;let r=this.#a,i=new Map,a=new Map,o=new Map;for(let t of this.#n.seriesMeta()){let n=ie(e,t.colorInput);if(i.set(t.dataKey,n),a.set(t.dataKey,mt(t)),r!=null&&t.mark===`bar`&&t.texture!==`solid`){let i=se(r,{texture:t.texture,color:n,ink:M(e,R(n)),devicePixelRatio:this.#f,orientation:this.#r.orientation});i!=null&&o.set(t.dataKey,i)}}this.#V={signature:t,series:i,inputs:a,barTextures:o,chrome:ae(e),fontFamily:n.getComputedStyle(e).fontFamily||`sans-serif`}}#je(e){let t=this.#V?.signature??``;t!==this.#ee&&(this.#$.clear(),this.#ee=t);let n=this.#$.get(e);if(n!=null)return n;let r=ie(this.#t.root,e);return this.#$.set(e,r),r}#Me(){let e=this.#n.getSnapshot(),t=this.#xe(),n=this.#Se(),r=!t&&e.xAxis!=null,i=!t&&e.yAxis!=null,a=n?r:i,o=(n?i:r)?24:8,s=Math.max(0,this.#d-8-o);this.#H={left:8,top:8,width:Math.max(0,this.#u-16),height:s};let c=8;if(a){c=40;let e=this.#a;if(e!=null&&this.#V!=null){e.font=`11px ${this.#V.fontFamily}`;let t=0,r=n?this.#Re().map(e=>e.text):this.#Le().map(e=>e.text);for(let n of r){let r=e.measureText(n).width;r>t&&(t=r)}c=Math.ceil(t)+14}}this.#H={left:c,top:8,width:Math.max(0,this.#u-c-8),height:s};let l=n?this.#H.top:this.#H.left,u=n?this.#H.top+this.#H.height:this.#H.left+this.#H.width;this.#U=this.#r.xScale===`band`?Oe({count:this.#m,rangeStart:l,rangeEnd:u,paddingInner:.2,paddingOuter:.1}):this.#r.xScale===`point`?Oe({count:this.#m,rangeStart:l,rangeEnd:u,paddingInner:1,paddingOuter:.5}):null,this.#F=H({pointCount:this.#m,columnCount:Math.max(1,Math.round(this.#H.width*this.#f)),wasDecimated:this.#F})}#Ne(){let e=this.#D.values();return De([e[0]??0,e[1]??1],[this.#H.top+this.#H.height,this.#H.top])}#Pe(){let e=this.#D.values(),t=this.#Se()?[this.#H.left,this.#H.left+this.#H.width]:[this.#H.top+this.#H.height,this.#H.top];return De([e[0]??0,e[1]??1],t)}#Fe(){let e=this.#O.values();return De([e[0]??0,e[1]??1],[this.#H.left,this.#H.left+this.#H.width])}#Ie(e){let t=this.#U;if(t!=null)return Y(t,e);let{k:n,b:r}=this.#Fe();return(this.#h[e]??0)*n+r}#Le(){let e=this.#n.getSnapshot(),t=this.#D.values(),n=je([t[0]??0,t[1]??1],e.yAxis?.tickCount??5,{integer:this.#w}),r=e.yAxis?.tickFormat,i=n.length>1?ue(Math.abs((n[1]??0)-(n[0]??0))):void 0;return n.map(e=>({value:e,text:r==null?G(e,i==null?void 0:{maximumFractionDigits:i}):r(e)}))}#Re(){let e=this.#n.getSnapshot(),t=e.xAxis?.tickFormat;if(this.#U!=null){let e=this.#Se(),n=e?this.#H.height:this.#H.width,r=Math.max(1,Math.floor(n/(e?15:60))),i=Math.max(1,Math.ceil(this.#m/r)),a=[];for(let e=0;e<this.#m;e+=i){let n=this.#g[e]??``;a.push({index:e,value:e,text:t==null?K(n,{datasetHasTimeOfDay:this.#y}):t(n)})}return a}let n=this.#O.values(),r=[n[0]??0,n[1]??1],i=e.xAxis?.tickCount??Math.max(2,Math.floor(this.#H.width/90));if(this.#r.xScale===`time`){let e=Ie(r);return Fe(r,i).map(n=>({index:null,value:n,text:t==null?e(n):t(new Date(n))}))}let a=je(r,i,{integer:this.#T}),o=a.length>1?ue(Math.abs((a[1]??0)-(a[0]??0))):void 0;return a.map(e=>({index:null,value:e,text:t==null?G(e,o==null?void 0:{maximumFractionDigits:o}):t(e)}))}#ze(e){let t=this.#a,n=this.#V;if(t==null||n==null||this.#u<=0||this.#d<=0)return!1;let r=Math.min(50,Math.max(0,e-this.#P));this.#P=e;let i=this.#t.canvas,a=Math.round(this.#u*this.#f),o=Math.round(this.#d*this.#f);(i.width!==a||i.height!==o)&&(i.width=a,i.height=o),t.setTransform(this.#f,0,0,this.#f,0,0),t.clearRect(0,0,this.#u,this.#d);let s=this.#n.getSnapshot(),c=this.#H;if(c.width<=0||c.height<=0)return!1;let l=this.#Ne(),u=this.#Fe(),d=this.#n.seriesSpecs(),f=this.#xe(),p=this.#ve()===0,m=f?[]:this.#Be(t,n.fontFamily),h=f?[]:this.#Ve(t,n.fontFamily),g=yt(this.#M,m,r,p);g=yt(this.#N,h,r,p)||g;let _=this.#L;if(_.target===1){if(e-this.#R>gt)_.target=0;else if(this.#z==null){let t=gt-(e-this.#R)+17;this.#z=setTimeout(()=>{this.#z=null,this.#Te()},t)}}if(p)_.alpha=_.target;else{let e=1-(1-(_.target>_.alpha?.16:.08))**(r/16.67);_.alpha+=(_.target-_.alpha)*e,Math.abs(_.target-_.alpha)<.02&&(_.alpha=_.target)}_.alpha!==_.target&&(g=!0);let v=this.#Se(),y=v?this.#Pe():l,b=e=>this.#U==null?e*u.k+u.b:Y(this.#U,e),x=e=>e*y.k+y.b,S=[...this.#M.entries()].map(([e,t])=>({position:b(e),alpha:t.alpha})),C=[...this.#N.entries()].map(([e,t])=>({position:x(e),alpha:t.alpha}));if(s.grid!=null&&!f){let e=s.grid.lines??(v?`vertical`:`horizontal`),r=v?S:C,i=v?C:S;ze(t,{plot:c,color:n.chrome.grid,xLines:e===`horizontal`?[]:i,yLines:e===`vertical`?[]:r})}let w=Math.min(40,c.width*.25),T=t,E=null;_.alpha>.01&&w>1&&(E=this.#we(a,o),E!=null&&(E.ctx.setTransform(this.#f,0,0,this.#f,0,0),E.ctx.clearRect(0,0,this.#u,this.#d),T=E.ctx)),T.save(),T.beginPath(),T.rect(c.left,c.top,c.width,c.height+1),T.clip();let D=null;if(this.#e===`bar`?v?this.#qe(T,d):this.#Ke(T,d,l):this.#e===`scatter`?D=this.#st(T,d,l):this.#Je(T,d,l),T.restore(),E!=null){T.save(),T.globalCompositeOperation=`destination-out`;let e=T.createLinearGradient(c.left,0,c.left+w,0);e.addColorStop(0,`rgba(0, 0, 0, ${_.alpha})`),e.addColorStop(1,`rgba(0, 0, 0, 0)`),T.fillStyle=e,T.fillRect(c.left,c.top,w,c.height+1),T.restore(),t.drawImage(E.canvas,0,0,this.#u,this.#d)}D!=null&&ot(t,{textColor:n.chrome.tickText,fontFamily:n.fontFamily,plot:c,center:D.center,axes:D.axes}),this.#e===`bar`&&this.#m>0&&(v?Ve(t,{plot:c,color:n.chrome.baseline,x:x(0)}):Be(t,{plot:c,color:n.chrome.baseline,y:x(0)}));for(let e of f?[]:s.referenceLines){let r=x(e.y);if(v?r<c.left||r>c.left+c.width:r<c.top||r>c.top+c.height)continue;let i=e.color==null?n.chrome.reference:this.#je(e.color);v?ct(t,{plot:c,color:i,textColor:n.chrome.tickText,x:r,label:e.label,fontFamily:n.fontFamily}):st(t,{plot:c,color:i,textColor:n.chrome.tickText,y:r,label:e.label,fontFamily:n.fontFamily})}let O=s.xAxis==null||f?[]:[...this.#M.entries()].map(([e,t])=>({position:b(e),text:t.text,alpha:t.alpha})),k=s.yAxis==null||f?[]:[...this.#N.entries()].map(([e,t])=>({position:x(e),text:t.text,alpha:t.alpha})),A=v?k:O,j=v?O:k;return(A.length>0||j.length>0)&<(t,{plot:c,color:n.chrome.tickText,fontFamily:n.fontFamily,xLabels:A,yLabels:j}),g}#Be(e,t){e.font=`11px ${t}`;let n=this.#Se(),r=this.#Fe(),i=[],a=-1/0;for(let t of this.#Re()){let o=t.index!=null&&this.#U!=null,s=o&&this.#U!=null?Y(this.#U,t.index??0):t.value*r.k+r.b,c=n?15/2:e.measureText(t.text).width/2,l=n?2:8;s-c<a+l||(a=s+c,i.push({key:o?t.index??0:t.value,text:t.text}))}return i}#Ve(e,t){let n=this.#Le();if(!this.#Se())return n.map(e=>({key:e.value,text:e.text}));e.font=`11px ${t}`;let r=this.#Pe(),i=[],a=-1/0;for(let t of n){let n=t.value*r.k+r.b,o=e.measureText(t.text).width/2;n-o<a+8||(a=n+o,i.push({key:t.value,text:t.text}))}return i}#He(e,t){let n=t===`value`?e.dataKey:`${e.dataKey}:${t}`;if(!this.#F&&this.#m<=2500){let e=this.#k.get(n);if(e!=null&&e.values().length===this.#m)return e.values()}if(t===`value`)return this.#x.get(e.dataKey)??new Float64Array;let r=this.#n.seriesSpecs().findIndex(t=>t.dataKey===e.dataKey);return(t===`lower`?this.#E?.lower:this.#E?.upper)?.[r]??new Float64Array}#Ue(e){return this.#A.get(e)?.values()[0]??1}#We(e,t){if(e==null)return 0;let n=e[t]??0;return Number.isNaN(n)?0:n}#Ge(e,t,n){let r=this.#E;if(r==null)return!0;let i=r.lower[e]?.[t]??NaN,a=r.upper[e]?.[t]??NaN;if(Number.isNaN(i)||Number.isNaN(a))return!1;let o=i<0,s=(o?r.negativeEnd:r.positiveEnd)[t]??-1;if(s<0)return!1;let c=(o?r.lower:r.upper)[s]?.[t]??NaN;return A({lower:i,upper:a,pileOuter:c,toPixel:n})}#Ke(e,t,n){let r=this.#U,i=this.#V;if(r==null||i==null||this.#m===0||t.length===0)return;let a=this.#E!=null,o=a?1:t.length,s=r.bandwidth>=8*o?2:+(r.bandwidth>=3*o),c=(r.bandwidth-s*(o-1))/o,l=Math.min(24,c),u=e=>e*n.k+n.b;t.forEach((t,n)=>{let d=this.#Ue(t.dataKey),f=[],p=a?this.#He(t,`lower`):null,m=a?this.#He(t,`upper`):this.#He(t,`value`);for(let e=0;e<this.#m;e++){let t=m[e]??NaN;if(Number.isNaN(t))continue;let i=this.#We(p,e),h=a?J(r,e)+(r.bandwidth-l)/2:J(r,e)+(r.bandwidth-(c*o+s*(o-1)))/2+n*(c+s)+(c-l)/2,g=k({lower:i,upper:t,toPixel:u,reveal:d,gap:a?s:0});f.push({x:h,width:l,baselineY:g.baseline,valueY:g.value,rounded:this.#Ge(n,e,u)})}He(e,{fill:i.barTextures.get(t.dataKey)??i.series.get(t.dataKey)??`currentColor`,rects:f})})}#qe(e,t){let n=this.#U,r=this.#V;if(n==null||r==null||this.#m===0||t.length===0)return;let i=this.#Pe(),a=this.#E!=null,o=a?1:t.length,s=n.bandwidth>=8*o?2:+(n.bandwidth>=3*o),c=(n.bandwidth-s*(o-1))/o,l=Math.min(24,c),u=e=>e*i.k+i.b;t.forEach((t,i)=>{let d=this.#Ue(t.dataKey),f=[],p=a?this.#He(t,`lower`):null,m=a?this.#He(t,`upper`):this.#He(t,`value`);for(let e=0;e<this.#m;e++){let t=m[e]??NaN;if(Number.isNaN(t))continue;let r=this.#We(p,e),h=a?J(n,e)+(n.bandwidth-l)/2:J(n,e)+(n.bandwidth-(c*o+s*(o-1)))/2+i*(c+s)+(c-l)/2,g=k({lower:r,upper:t,toPixel:u,reveal:d,gap:a?s:0});f.push({y:h,height:l,baselineX:g.baseline,valueX:g.value,rounded:this.#Ge(i,e,u)})}Ue(e,{fill:r.barTextures.get(t.dataKey)??r.series.get(t.dataKey)??`currentColor`,rects:f})})}#Je(e,t,n){let r=this.#V;if(r==null||this.#m===0)return;let i=this.#Fe(),a=this.#U,o=e=>a==null?(this.#h[e]??0)*i.k+i.b:Y(a,e);t.forEach(t=>{let i=r.series.get(t.dataKey)??`currentColor`,a=this.#Ue(t.dataKey);if(e.save(),a<1&&(e.beginPath(),e.rect(this.#H.left,0,this.#H.width*a,this.#d),e.clip()),this.#F){this.#Ye(e,t,i,n),e.restore();return}let s=t.mark===`area`,c=this.#He(t,this.#E==null?`value`:`upper`),l=this.#E==null?null:this.#He(t,`lower`),u=e=>!Number.isNaN(c[e]??NaN),d=[];for(let e=0;e<this.#m;e++)(!t.connectNulls||u(e))&&d.push(e);let f=e=>(c[e]??0)*n.k+n.b;if(s){let r=l==null?()=>0*n.k+n.b:e=>(l[e]??0)*n.k+n.b;Ge(e,{color:i,curve:t.curve,indexes:d,xAt:o,y0At:r,y1At:f,definedAt:u})}else We(e,{color:i,curve:t.curve,indexes:d,xAt:o,yAt:f,definedAt:u}),t.markers&&this.#H.width/this.#m>=12&&et(e,{color:i,surface:r.chrome.surface,shape:this.#n.seriesShape(t.dataKey),indexes:d,xAt:o,yAt:f,definedAt:u});e.restore()})}#Ye(e,t,n,r){let i=Math.max(1,Math.round(this.#H.width*this.#f)),a=e=>this.#H.left+(e+.5)/this.#f;if(t.mark===`area`){let o=this.#Xe(`${t.dataKey}:upper`,this.#He(t,this.#E==null?`value`:`upper`),i),s=this.#E==null?null:this.#Xe(`${t.dataKey}:lower`,this.#He(t,`lower`),i);s==null?qe(e,{color:n,lowerColumns:wt(o,0),upperColumns:o,columnToX:a,valueK:r.k,valueB:r.b}):qe(e,{color:n,lowerColumns:s,upperColumns:o,columnToX:a,valueK:r.k,valueB:r.b});return}let o=this.#Xe(t.dataKey,this.#He(t,`value`),i);Ke(e,{color:n,columns:o,columnToX:a,valueK:r.k,valueB:r.b})}#Xe(e,t,n){let r=this.#O.values(),i=`${r[0]??0}:${r[1]??1}:${n}`,a=this.#I.get(e);if(a!=null&&a.key===i)return a.columns;let o=[r[0]??0,r[1]??1],s=De(o,[0,n]),c=U({xs:this.#h,values:t,startIndex:0,endIndex:this.#m-1,positionK:s.k,positionB:s.b,columnCount:n});return this.#I.set(e,{key:i,columns:c}),c}#Ze(){if(this.#m===0)return null;let e;return e=this.#ie===void 0?this.#re:this.#ie==null?null:this.#$e(this.#ie),e==null?null:Math.min(Math.max(0,e),this.#m-1)}#Qe(e){return this.#_==null?e:this.#_[e]??e}#$e(e){if(this.#p.length===0)return null;let t=Math.min(Math.max(0,e),this.#p.length-1);if(this.#v==null)return t;let n=this.#v[t]??-1;return n===-1?null:n}#et(e,t){if(this.#m===0)return null;let n=this.#U;if(n!=null)return Ae(n,this.#Se()?t:e);let{k:r,b:i}=this.#Fe();if(r===0)return 0;let a=e;if(this.#F){let t=Math.floor((e-this.#H.left)*this.#f);a=this.#H.left+(t+.5)/this.#f}return me(this.#h,this.#m,(a-i)/r)}#tt(e,t,n){let r=this.#n.seriesSpecs(),i=this.#Se(),a=this.#U;if(this.#e===`bar`&&this.#E==null&&a!=null&&r.length>1){let o=(i?n:t)-J(a,e),s=Math.floor(o/Math.max(1,a.bandwidth)*r.length);return r[Math.min(r.length-1,Math.max(0,s))]?.dataKey??null}let{k:o,b:s}=i?this.#Pe():this.#Ne(),c=i?t:n,l=this.#E;if(this.#e===`bar`&&l!=null)for(let t=0;t<r.length;t++){let n=l.lower[t]?.[e]??NaN,i=l.upper[t]?.[e]??NaN;if(Number.isNaN(n)||Number.isNaN(i)||n===i)continue;let a=n*o+s,u=i*o+s;if(c>=Math.min(a,u)&&c<=Math.max(a,u))return r[t]?.dataKey??null}let u=null,d=1/0;return r.forEach((t,n)=>{let r=(this.#E==null?this.#x.get(t.dataKey):this.#E.upper[n])?.[e]??NaN;if(Number.isNaN(r))return;let i=Math.abs(r*o+s-c);i<d&&(d=i,u=t.dataKey)}),u}#nt(e,t){let n=e==null||this.#m===0?null:Math.min(Math.max(0,e),this.#m-1),r=this.#ie!==void 0;if(t.notify&&n!==this.#Ze()){let e=n==null?null:this.#Qe(n);if(this.#i.onActiveIndexChange?.(e),r){this.#ae={index:e,viaKeyboard:t.viaKeyboard};return}}this.#oe=t.viaKeyboard,r||(this.#re=n),this.#ot(),this.#Ee()}#rt=null;#it=!1;#at=null;#ot(e={force:!1}){let t=this.#Ze();if(!e.force&&t===this.#rt&&this.#oe===this.#it&&this.#ne===this.#at)return;if(this.#rt=t,this.#it=this.#oe,this.#at=this.#ne,t==null||this.#m===0){this.#n.publishHover(null);return}let n=this.#Qe(t),r=this.#p[n]??{},i=this.#n.seriesMeta().map(e=>{let n=this.#x.get(e.dataKey)?.[t]??NaN;return{dataKey:e.dataKey,label:e.label,value:Number.isNaN(n)?null:n,color:e.color}});this.#r.stacked&&i.reverse(),this.#e===`scatter`&&(i=this.#ne==null?i.filter(e=>e.value!=null):i.filter(e=>e.dataKey===this.#ne));let a={index:n,xValue:this.#g[t]??``,datum:r,points:i,viaKeyboard:this.#oe};if(this.#xe()){let e=this.#W[t]??NaN;a.zValue=Number.isNaN(e)?null:e}this.#n.publishHover(a)}#st(e,t,n){let r=this.#V;if(r==null||this.#m===0||t.length===0)return null;if(this.#xe())return this.#ct(e,t);let i=this.#Fe(),a=t.map(e=>{let t=this.#He(e,`value`),n=[];for(let e=0;e<this.#m;e++)Number.isNaN(t[e]??NaN)||n.push(e);return n}),o=a.reduce((e,t)=>e+t.length,0);return t.forEach((t,s)=>{let c=this.#He(t,`value`),l=a[s]??[];e.save(),e.globalAlpha=this.#Ue(t.dataKey),rt(e,{color:r.series.get(t.dataKey)??`currentColor`,surface:r.chrome.surface,shape:this.#n.seriesShape(t.dataKey),totalPointCount:o,indexes:l,xAt:e=>(this.#h[e]??0)*i.k+i.b,yAt:e=>(c[e]??0)*n.k+n.b,radiusAt:()=>4}),e.restore()}),null}#ct(e,t){let n=this.#V;if(n==null)return null;let r=this.#H,i=ge(this.#K),a=r.left+r.width/2,o=r.top+r.height/2,s=this.#J.values(),c=s[0]??1,l=s[1]??1,u=.85-.22*c-.11*l,d=Math.min(r.width,r.height)/2*u,f=this.#O.values(),p=[f[0]??0,f[1]??1],m=this.#D.values(),h=[m[0]??0,m[1]??1],g=this.#G,_=t.map(e=>this.#Ue(e.dataKey)),v=this.#J.values(),y=v[0]??1,b=v[1]??1,x=(e,t,n)=>{let r=_e(e,t,n,i);return{x:a+r.x*d,y:o-r.y*d}},S=be.map(([e,t,n])=>x(e,t,n)),C=t[0],w=t.length===1&&C!=null?C.dataKey:`y`,T=[{label:this.#r.xKey,alpha:1,from:x(-1,-y,-b),to:x(1,-y,-b)},{label:w,alpha:y,from:x(-1,-1,-b),to:x(-1,1,-b)},{label:this.#r.zKey??`z`,alpha:b,from:x(-1,-y,-1),to:x(-1,-y,1)}];at(e,{gridColor:n.chrome.grid,axisColor:n.chrome.baseline,corners:S,edges:xe,cubeAlpha:b,axes:T});let E=this.#m*t.length,D=this.#Z;(D==null||D.screenX.length<E)&&(D={screenX:new Float64Array(E),screenY:new Float64Array(E),radius:new Float64Array(E),seriesIndex:new Int32Array(E),pointIndex:new Int32Array(E),depths:new Float64Array(E),count:0});let O=D.depths,k=0;t.forEach((e,t)=>{let n=this.#He(e,`value`);for(let e=0;e<this.#m;e++){let r=n[e]??NaN,s=this.#W[e]??NaN;if(Number.isNaN(r)||Number.isNaN(s))continue;let c=_e(ye(this.#h[e]??0,p),ye(r,h)*y,ye(s,g)*b,i);D.screenX[k]=a+c.x*d,D.screenY[k]=o-c.y*d,D.radius[k]=4*c.scale,D.seriesIndex[k]=t,D.pointIndex[k]=e,O[k]=c.depth,k+=1}}),D.count=k,this.#Z=D,this.#Q.length<k&&(this.#Q=new Int32Array(E));let A=this.#Q.subarray(0,k);for(let e=0;e<k;e++)A[e]=e;A.sort((e,t)=>(O[t]??0)-(O[e]??0));let j=t.map(e=>this.#n.seriesShape(e.dataKey));return it(e,{count:k,order:A,screenX:D.screenX,screenY:D.screenY,radius:D.radius,colorAt:e=>{let r=t[D.seriesIndex[e]??0];return r==null?`currentColor`:n.series.get(r.dataKey)??`currentColor`},shapeAt:e=>j[D.seriesIndex[e]??0]??`circle`,alphaAt:e=>_[D.seriesIndex[e]??0]??1,surface:n.chrome.surface}),{center:{x:a,y:o},axes:T}}#lt(e,t){let n=this.#n.seriesSpecs(),r=576,i=null;if(this.#xe()){let a=this.#Z;if(a==null)return null;for(let o=0;o<a.count;o++){let s=(a.screenX[o]??0)-e,c=(a.screenY[o]??0)-t,l=s*s+c*c;if(l<r){let e=n[a.seriesIndex[o]??0];if(e==null)continue;r=l,i={seriesKey:e.dataKey,index:a.pointIndex[o]??0,screenX:a.screenX[o]??0,screenY:a.screenY[o]??0}}}return i}let a=this.#Fe(),o=this.#Ne();for(let s of n){let n=this.#x.get(s.dataKey);if(n!=null)for(let c=0;c<this.#m;c++){let l=n[c]??NaN;if(Number.isNaN(l))continue;let u=(this.#h[c]??0)*a.k+a.b,d=l*o.k+o.b,f=u-e,p=d-t,m=f*f+p*p;m<r&&(r=m,i={seriesKey:s.dataKey,index:c,screenX:u,screenY:d})}}return i}#ut(e){let t=this.#n.seriesSpecs();if(this.#xe()){let t=this.#Z;if(t==null)return null;for(let n=0;n<t.count;n++)if((t.pointIndex[n]??-1)===e)return{x:t.screenX[n]??0,y:t.screenY[n]??0};return null}let n=this.#Fe(),r=this.#Ne();for(let i of t){let t=this.#x.get(i.dataKey)?.[e]??NaN;if(!Number.isNaN(t))return{x:(this.#h[e]??0)*n.k+n.b,y:t*r.k+r.b}}return null}#dt(){let{crosshair:e,band:t,markers:n,tooltip:r}=this.#t,i=this.#Ze(),a=i!=null&&this.#m>0,o=this.#e===`bar`,s=this.#e===`scatter`;if(e.style.opacity=a&&!o&&!s?`1`:`0`,t.style.opacity=a&&o?`1`:`0`,n.style.opacity=a&&!o?`1`:`0`,r.style.opacity=a?`1`:`0`,!a)return;let c=this.#H;if(s){let e=this.#te??this.#ut(i);if(e==null){n.style.opacity=`0`,r.style.opacity=`0`;return}for(;n.children.length>1;)n.lastElementChild?.remove();n.children.length===0&&n.appendChild(xt(n.ownerDocument));let t=n.children[0];if(t instanceof HTMLElement){let n=this.#n.seriesMeta(),r=this.#ne==null?n.find(e=>{let t=this.#x.get(e.dataKey)?.[i]??NaN;return!Number.isNaN(t)}):n.find(e=>e.dataKey===this.#ne);t.style.opacity=`1`,St(t,r?.shape??`circle`,r?.color??`currentColor`),t.style.transform=`translate3d(${e.x}px, ${e.y}px, 0)`}this.#ft(e.x,e.y);return}let l=this.#Ie(i),u=this.#Se();if(o){let e=this.#U;if(e!=null){let n=ke(e,i),r=Math.max(1,n.size),a=n.start-(r-n.size)/2;u?(t.style.transform=`translate3d(${c.left}px, ${a}px, 0)`,t.style.width=`${c.width}px`,t.style.height=`${r}px`):(t.style.transform=`translate3d(${a}px, ${c.top}px, 0)`,t.style.width=`${r}px`,t.style.height=`${c.height}px`)}}else{e.style.transform=`translate3d(${l}px, ${c.top}px, 0)`,e.style.height=`${c.height}px`;let t=this.#n.seriesMeta(),r=this.#n.seriesSpecs();for(;n.children.length>t.length;)n.lastElementChild?.remove();for(;n.children.length<t.length;)n.appendChild(xt(n.ownerDocument));let a=this.#Ne();t.forEach((e,t)=>{let o=n.children[t];if(!(o instanceof HTMLElement))return;let s=this.#x.get(e.dataKey)?.[i]??NaN,c=r[t],u=c==null?NaN:this.#He(c,this.#E==null?`value`:`upper`)[i]??NaN;if(Number.isNaN(s)||Number.isNaN(u)){o.style.opacity=`0`;return}o.style.opacity=`1`,St(o,e.shape,e.color),o.style.transform=`translate3d(${l}px, ${u*a.k+a.b}px, 0)`})}o&&u&&this.#U!=null?this.#ft(this.#se??c.left+c.width/2,Y(this.#U,i)):this.#ft(l,this.#ce??c.top+8)}#ft(e,t){let n=this.#H,r=this.#t.tooltip,i=this.#le,a=e+12;a+i.width>n.left+n.width&&e-12-i.width>=n.left&&(a=e-12-i.width);let o=Math.max(0,Math.min(t-i.height/2,n.top+n.height-i.height));r.style.transform=`translate3d(${a}px, ${o}px, 0)`}};const vt=e=>e===3?{yaw:.65,pitch:-.35}:{yaw:0,pitch:0},yt=(e,t,n,r)=>{for(let t of e.values())t.target=0;for(let n of t){let t=e.get(n.key);t==null?e.set(n.key,{alpha:+!!r,target:1,text:n.text}):(t.target=1,t.text=n.text)}let i=1-.84**(n/16.67),a=1-.88**(n/16.67),o=!1;for(let[t,n]of e){if(r)n.alpha=n.target;else{let e=n.target>n.alpha?i:a;n.alpha+=(n.target-n.alpha)*e}if(n.target===1&&n.alpha>.98&&(n.alpha=1),n.target===0&&n.alpha<.03){e.delete(t);continue}n.alpha!==n.target&&(o=!0)}return o},bt={circle:`circle(50%)`,square:`inset(8%)`,triangle:`polygon(50% 0%, 100% 100%, 0% 100%)`,diamond:`polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)`,"triangle-down":`polygon(0% 0%, 100% 0%, 50% 100%)`,plus:`polygon(33.33% 0%, 66.67% 0%, 66.67% 33.33%, 100% 33.33%, 100% 66.67%, 66.67% 66.67%, 66.67% 100%, 33.33% 100%, 33.33% 66.67%, 0% 66.67%, 0% 33.33%, 33.33% 33.33%)`,cross:`polygon(73.57% 2.86%, 97.14% 26.43%, 73.57% 50%, 97.14% 73.57%, 73.57% 97.14%, 50% 73.57%, 26.43% 97.14%, 2.86% 73.57%, 26.43% 50%, 2.86% 26.43%, 26.43% 2.86%, 50% 26.43%)`,star:`polygon(50% 2.45%, 61.8% 38.77%, 100% 38.77%, 69.1% 61.23%, 80.9% 97.55%, 50% 75.1%, 19.1% 97.55%, 30.9% 61.23%, 0% 38.77%, 38.2% 38.77%)`},xt=e=>{let t=e.createElement(`div`);t.setAttribute(`data-slot`,`chart-active-point`),t.style.position=`absolute`,t.style.width=`12px`,t.style.height=`12px`,t.style.left=`-6px`,t.style.top=`-6px`;let n=e.createElement(`div`);n.style.position=`absolute`,n.style.inset=`0`,n.style.backgroundColor=`var(--background-color-card)`;let r=e.createElement(`div`);return r.style.position=`absolute`,r.style.inset=`2px`,t.appendChild(n),t.appendChild(r),t},St=(e,t,n)=>{let r=bt[t];e.setAttribute(`data-shape`,t);let[i,a]=e.children;i instanceof HTMLElement&&(i.style.clipPath=r),a instanceof HTMLElement&&(a.style.clipPath=r,a.style.backgroundColor=n)},Ct=(e,t)=>e instanceof Date?e.getTime():typeof e==`number`?e:t&&typeof e==`string`?new Date(e).getTime():NaN,wt=(e,t)=>({columnCount:e.columnCount,hasData:e.hasData,minValue:new Float64Array(e.columnCount).fill(t),maxValue:new Float64Array(e.columnCount).fill(t),inValue:new Float64Array(e.columnCount).fill(t),outValue:new Float64Array(e.columnCount).fill(t)}),Tt=e=>e.replaceAll(`|`,`\\|`).replaceAll(/\s*\n\s*/g,` `),Et=e=>e instanceof Date?Number.isNaN(e.getTime())?`—`:e.toISOString():typeof e==`number`?Number.isFinite(e)?String(e):`—`:typeof e==`string`?Tt(e):`—`,Dt=e=>typeof e==`number`&&Number.isFinite(e)?String(e):`—`,Ot=e=>`| ${e.join(` | `)} |`,kt=({data:e,xKey:t,series:n,zKey:r})=>{let i=[Tt(t),...n.map(e=>Tt(e.label)),...r==null?[]:[Tt(r)]],a=e.map(e=>[Et(E(e,t)),...n.map(t=>Dt(E(e,t.dataKey))),...r==null?[]:[Dt(E(e,r))]]);return[Ot(i),Ot(i.map(()=>`---`)),...a.map(e=>Ot(e))].join(`
|
|
2
|
+
`)},At=(e,t)=>e==null?`var(${te(t)})`:ee(e)?`var(${te(e)})`:e,jt={"chart-1":`circle`,"chart-2":`square`,"chart-3":`triangle`,"chart-4":`diamond`,"chart-5":`triangle-down`,"chart-6":`plus`,"chart-7":`cross`,"chart-8":`star`,"chart-other":`circle`},Mt=(e,t)=>e??jt[t],Nt={1:`chart-1`,2:`chart-2`,3:`chart-3`,4:`chart-4`,5:`chart-5`,6:`chart-6`,7:`chart-7`,8:`chart-8`,other:`chart-other`},Pt=e=>{let t=new Set;for(let n of e)n.seriesSlot!=null&&n.seriesSlot!==`other`&&t.add(Nt[n.seriesSlot]);let n=new Map,r=new Set(t);for(let t of e){if(t.seriesSlot!=null){n.set(t.dataKey,Nt[t.seriesSlot]);continue}let e=ne.find(e=>!r.has(e))??`chart-other`;n.set(t.dataKey,e),r.add(e)}return n};var Ft=class{#e=new Set;#t={series:[],hover:null,grid:null,xAxis:null,yAxis:null,referenceLines:[],tooltip:null,orientation:`vertical`};#n=new Map;#r=new Map;#i=0;#a=null;#o=`vertical`;#s=null;#c=null;#l=new Map;#u=new Map;#d=null;#f=null;onSeriesChange=null;onPresentationChange=null;subscribe=e=>(this.#e.add(e),()=>{this.#e.delete(e)});getSnapshot=()=>this.#t;seriesSpecs(){return[...this.#n.values()].toSorted((e,t)=>e.sequence-t.sequence).map(e=>e.spec)}seriesShape(e){let t=this.seriesSpecs(),n=Pt(t).get(e)??`chart-other`;return Mt(t.find(t=>t.dataKey===e)?.shape,n)}registerSeries(e){let t=this.#r.get(e.dataKey)??this.#i++;return this.#r.set(e.dataKey,t),this.#n.set(e.dataKey,{spec:e,sequence:t}),this.#p({seriesChanged:!0}),()=>{this.#n.get(e.dataKey)?.spec===e&&(this.#n.delete(e.dataKey),this.#p({seriesChanged:!0}))}}setOrientation(e){this.#o!==e&&(this.#o=e,this.#p())}registerGrid(e){let t={lines:e};return this.#a=t,this.#p(),()=>{this.#a===t&&(this.#a=null,this.#p())}}registerXAxis(e){return this.#s=e,this.#p(),()=>{this.#s===e&&(this.#s=null,this.#p())}}registerYAxis(e){return this.#c=e,this.#p(),()=>{this.#c===e&&(this.#c=null,this.#p())}}registerReferenceLine(e,t){let n=this.#u.get(e)??this.#i++;return this.#u.set(e,n),this.#l.set(e,{spec:t,sequence:n}),this.#p(),()=>{this.#l.get(e)?.spec===t&&(this.#l.delete(e),this.#p())}}registerTooltip(e){return this.#d=e,this.#p(),()=>{this.#d===e&&(this.#d=null,this.#p())}}publishHover(e){this.#f!==e&&(this.#f=e,this.#t={...this.#t,hover:e},this.#m())}seriesMeta(){let e=this.seriesSpecs(),t=Pt(e);return e.map(e=>{let n=t.get(e.dataKey)??`chart-other`;return{dataKey:e.dataKey,label:e.label,mark:e.mark,color:At(e.color,n),colorInput:e.color??n,shape:Mt(e.shape,n),texture:e.texture}})}#p(e={seriesChanged:!1}){this.#t={series:this.seriesMeta(),hover:this.#f,grid:this.#a,xAxis:this.#s,yAxis:this.#c,referenceLines:[...this.#l.values()].toSorted((e,t)=>e.sequence-t.sequence).map(e=>e.spec),tooltip:this.#d,orientation:this.#o},this.#m(),e.seriesChanged?this.onSeriesChange?.():this.onPresentationChange?.()}#m(){for(let e of this.#e)e()}};const It=a(null),Q=e=>{let t=o(It);return m(t,`${e} must be composed inside ${e.split(`.`)[0]}.Root — it registers into the chart it belongs to and renders nothing on its own.`),t},Lt=e=>p(e.subscribe,e.getSnapshot,e.getSnapshot),Rt=(e,t)=>{for(let n of e){let e=E(n,t);if(e!=null)return e instanceof Date?`time`:typeof e==`number`?`linear`:`point`}return`point`},zt=[`auto`,`auto`],Bt=({kind:r,componentName:i,slotName:a,data:o,xKey:s,xScale:p,zKey:v,dimensions:y=3,yDomain:b=zt,stacked:x=!1,orientation:S=`vertical`,animate:C=!0,pending:w=!1,decorative:T=!1,activeIndex:D,onActiveIndexChange:O,onDatumActivate:k,className:A,children:j,ref:ee,"data-slot":te,"aria-label":ne,"aria-labelledby":re,"aria-hidden":M,tabIndex:ie,...ae})=>{let[N]=f(()=>new Ft),P=d(null),[F]=f(()=>({kind:r,componentName:i,store:N,engineRef:P,dataRef:{current:{data:o,xKey:s,zKey:v}}}));l(()=>{F.dataRef.current={data:o,xKey:s,zKey:v}},[F,o,s,v]);let I=d(null),L=e(I,ee),R=d(null),z=d(null),B=d(null),V=d(null),oe=d(null),se=d(null),H=c(),U=r===`bar`?`band`:p??Rt(o,s);m(r!==`scatter`||o.length===0||U!==`point`,`${i}.Root requires numeric or Date x values — the "${s}" values are not numbers or dates, so they have no position on a continuous scatter axis.`);let[ce,le]=b,W=u(()=>{for(let e of o){let t=E(e,s);if(t instanceof Date&&pe(t))return!0}return!1},[o,s]);return l(()=>{let e=I.current,t=R.current,n=z.current,i=B.current,a=V.current,o=oe.current,s=se.current;if(e==null||t==null||n==null||i==null||a==null||o==null||s==null)return;let c=new _t({kind:r,store:N,elements:{root:e,plot:t,canvas:n,crosshair:i,band:a,markers:o,tooltip:s}});return P.current=c,()=>{P.current=null,c.destroy()}},[r,N]),l(()=>{P.current?.setOptions({xKey:s,xScale:U,yDomain:[ce,le],zKey:v??null,dimensions:y,stacked:x,orientation:S,animate:C}),N.setOrientation(S)},[N,s,U,ce,le,v,y,x,S,C]),l(()=>{P.current?.setRows(o)},[o]),l(()=>{P.current?.setCallbacks(T?{onDatumActivate:null,onActiveIndexChange:null}:{onDatumActivate:k??null,onActiveIndexChange:O??null})}),l(()=>{P.current?.setControlledActiveIndex(T?void 0:D)},[T,D]),l(()=>{P.current?.flushIngest()}),g(`div`,{"data-slot":n(te,a),className:t(`relative flex aspect-video w-full flex-col`,A),"aria-hidden":T?!0:M,tabIndex:T?void 0:ie,ref:L,...ae,children:_(It.Provider,{value:F,children:[_(`div`,{"data-slot":`${a}-plot`,className:t(`relative min-h-0 w-full flex-1`,w&&`opacity-60 transition-opacity duration-300`),ref:R,children:[g(`canvas`,{"data-slot":`${a}-canvas`,ref:z,"aria-hidden":!0,className:`absolute inset-0 size-full`}),T?null:_(h,{children:[g(`div`,{role:`application`,"aria-label":ne,"aria-labelledby":re,"aria-describedby":H,tabIndex:0,className:t(`focus-visible:ring-focus-accent absolute inset-0 rounded-sm outline-none focus-visible:ring-2`,(r===`line`||r===`area`)&&`cursor-crosshair`,r===`scatter`&&v!=null&&`touch-none cursor-grab active:cursor-grabbing`),onPointerDown:e=>{e.isTrusted&&r===`scatter`&&v!=null&&e.currentTarget.setPointerCapture(e.pointerId),P.current?.handlePointerDown(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerMove:e=>{P.current?.handlePointerMove(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerUp:e=>{P.current?.handlePointerUp(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerLeave:()=>{P.current?.handlePointerLeave()},onPointerCancel:()=>{P.current?.handlePointerLeave()},onBlur:()=>{P.current?.handlePointerLeave()},onKeyDown:e=>{P.current?.handleKeyDown(e.key)&&e.preventDefault()}}),g(`span`,{id:H,className:`sr-only`,children:`Use the left and right arrow keys to move between data points, Home and End to jump to the first and last, and Enter to activate the current point.`})]}),g(`div`,{"data-slot":`${a}-crosshair`,ref:B,"aria-hidden":!0,className:`bg-neutral-500 pointer-events-none absolute left-0 top-0 w-px opacity-0`}),g(`div`,{"data-slot":`${a}-hover-band`,ref:V,"aria-hidden":!0,className:`bg-neutral-500/10 pointer-events-none absolute left-0 top-0 rounded-sm opacity-0`}),g(`div`,{"data-slot":`${a}-markers`,ref:oe,"aria-hidden":!0,className:`pointer-events-none absolute inset-0 opacity-0`}),g(Jt,{slotName:a,store:N,tooltipRef:se,xHasTimeOfDay:W})]}),j,T?null:_(h,{children:[g(tn,{store:N,xHasTimeOfDay:W}),g(nn,{data:o,label:ne,slotName:a,store:N,xHasTimeOfDay:W,xKey:s,zKey:v})]})]})})},Vt=(e,t,n)=>{let r=Q(e);m(r.kind===t,`${e} cannot be composed inside ${r.componentName}.Root — compose ${r.componentName} series parts instead.`);let{dataKey:i,label:a,seriesSlot:o,color:s,curve:c=`linear`,markers:u=!1,connectNulls:d=!1,shape:f,texture:p=`solid`}=n;return l(()=>r.store.registerSeries({dataKey:i,label:a??i,seriesSlot:o,color:s,mark:t,curve:c,markers:u,connectNulls:d,shape:f,texture:p}),[r.store,i,a,o,s,t,c,u,d,f,p]),null},Ht=(e,t)=>{let n=Q(e),{lines:r}=t;return l(()=>n.store.registerGrid(r),[n.store,r]),null},Ut=(e,t)=>{let n=Q(e),{tickFormat:r,tickCount:i}=t;return l(()=>n.store.registerXAxis({tickFormat:r,tickCount:i}),[n.store,r,i]),null},Wt=(e,t)=>{let n=Q(e),{tickFormat:r,tickCount:i}=t;return l(()=>n.store.registerYAxis({tickFormat:r,tickCount:i}),[n.store,r,i]),null},Gt=(e,t)=>{let n=Q(e),r=c(),{y:i,label:a,color:o}=t;return l(()=>n.store.registerReferenceLine(r,{y:i,label:a,color:o}),[n.store,r,i,a,o]),null},Kt=(e,t)=>{let n=Q(e),{labelFormat:r,valueFormat:i,indicator:a=`line`,footer:o,children:s,...c}=t;return l(()=>n.store.registerTooltip({labelFormat:r,valueFormat:i,indicator:a,footer:o,children:s,divProps:c})),null},qt=(e,t,n)=>e==null?`—`:n==null?G(e):n(e,t),Jt=({slotName:n,store:r,tooltipRef:i,xHasTimeOfDay:a})=>{let o=Lt(r),s=o.tooltip,c=o.hover,{className:u,ref:f,style:p,...m}=s?.divProps??{},v=d(null),y=e(i,v);l(()=>{if(f==null)return;let e=v.current;if(typeof f==`function`){let t=f(e);return()=>{typeof t==`function`?t():f(null)}}return f.current=e,()=>{f.current=null}},[f]);let b=s?.footer;return g(`div`,{"data-slot":`${n}-tooltip`,ref:y,className:t(`bg-popover border-popover text-strong pointer-events-none absolute left-0 top-0 z-10 min-w-32 rounded-md border px-2.5 py-1.5 text-xs shadow-md`,u),style:{opacity:0,...p},...m,children:c==null?null:s?.children==null?_(h,{children:[g(`div`,{className:`text-muted font-medium`,children:s?.labelFormat==null?K(c.xValue,{datasetHasTimeOfDay:a}):s.labelFormat(c.xValue)}),g(`div`,{className:`mt-1 grid gap-1`,children:c.points.map(e=>_(`div`,{className:`flex items-center gap-1.5`,children:[s?.indicator===`none`?null:g(`span`,{"aria-hidden":!0,className:`h-2.5 w-0.5 shrink-0 rounded-full`,style:{backgroundColor:e.color}}),g(`span`,{className:`text-muted`,children:e.label}),g(`span`,{className:`text-strong ml-auto pl-3 font-medium tabular-nums`,children:qt(e.value,e.dataKey,s?.valueFormat)})]},e.dataKey))}),c.zValue===void 0?null:_(`div`,{className:`mt-1 flex items-center gap-1.5`,children:[g(`span`,{className:`text-muted`,children:`z`}),g(`span`,{className:`text-strong ml-auto pl-3 font-medium tabular-nums`,children:c.zValue==null?`—`:G(c.zValue)})]}),b==null?null:g(`div`,{className:`text-muted mt-1`,children:typeof b==`function`?b(c):b})]}):s.children(c)})},$=(e,t,n=3)=>`repeating-linear-gradient(${e}, ${t} 0, ${t} 1px, transparent 1px, transparent ${n}px)`,Yt=`forced-color-adjust-none [print-color-adjust:exact] [-webkit-print-color-adjust:exact]`,Xt={hatch:({ink:e})=>({backgroundImage:$(`135deg`,e)}),"hatch-reverse":({ink:e})=>({backgroundImage:$(`45deg`,e)}),crosshatch:({ink:e})=>({backgroundImage:`${$(`135deg`,e,4)}, ${$(`45deg`,e,4)}`}),perpendicular:({ink:e,orientation:t})=>({backgroundImage:$(t===`horizontal`?`90deg`:`0deg`,e)}),parallel:({ink:e,orientation:t})=>({backgroundImage:$(t===`horizontal`?`0deg`:`90deg`,e)}),grid:({ink:e})=>({backgroundImage:`${$(`0deg`,e,4)}, ${$(`90deg`,e,4)}`}),dots:({ink:e})=>({backgroundImage:`radial-gradient(circle at 1px 1px, ${e} 0.75px, transparent 0.8px)`,backgroundSize:`3px 3px`})},Zt=(e,t,n)=>e===`solid`?{}:Xt[e]({ink:R(t),orientation:n}),Qt=({series:e,orientation:n})=>e.mark===`bar`?g(`span`,{"aria-hidden":!0,"data-texture":e.texture,className:t(`size-2 shrink-0 rounded-[2px]`,Yt),style:{backgroundColor:e.color,...Zt(e.texture,e.color,n)}}):e.mark===`line`?_(`span`,{"aria-hidden":!0,className:`relative flex h-2 w-3 shrink-0 items-center justify-center`,children:[g(`span`,{className:t(`absolute inset-x-0 top-1/2 h-0.5 -translate-y-1/2 rounded-full`,Yt),style:{backgroundColor:e.color}}),g(`span`,{"data-shape":e.shape,className:t(`relative size-2`,Yt),style:{backgroundColor:e.color,clipPath:bt[e.shape]}})]}):g(`span`,{"aria-hidden":!0,"data-shape":e.shape,className:t(`size-2 shrink-0`,Yt),style:{backgroundColor:e.color,clipPath:bt[e.shape]}}),$t=({partName:e,slotName:n,className:r,children:i,...a})=>{let o=Q(e),s=Lt(o.store);return s.series.length<2?null:g(`div`,{"data-slot":`${n}-legend`,className:t(`text-muted flex flex-wrap items-center gap-x-4 gap-y-1 pt-3 text-xs`,r),...a,children:i==null?s.series.map(e=>_(`div`,{className:`flex items-center gap-1.5`,children:[g(Qt,{series:e,orientation:s.orientation}),e.label]},e.dataKey)):i(s.series)})},en=({partName:e,slotName:t,label:n=`Copy data as Markdown`,onCopy:a,onCopyError:o,onClick:c,ref:l,...u})=>{let p=Q(e),m=i(),[h,_]=f(!1),b=d(void 0);return s(()=>()=>{b.current!=null&&clearTimeout(b.current)},[]),g(r,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,"data-slot":`${t}-copy-button`,label:n,icon:g(h?v:y,{}),ref:l,onClick:async e=>{try{if(c?.(e),e.defaultPrevented){b.current!=null&&(clearTimeout(b.current),b.current=void 0),_(!1);return}let{data:t,xKey:n,zKey:r}=p.dataRef.current,i=kt({data:t,xKey:n,zKey:r,series:p.store.getSnapshot().series});await m(i),a?.(i),_(!0),b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{_(!1)},2e3)}catch(e){o?.(e)}},...u})},tn=({store:e,xHasTimeOfDay:t})=>{let n=Lt(e),[r,i]=f(``),a=n.hover;return s(()=>{if(a==null||!a.viaKeyboard){i(``);return}let e=a.points.map(e=>`${e.label}: ${e.value==null?`no data`:G(e.value)}`).join(`, `),n=a.zValue===void 0?``:`, z: ${a.zValue==null?`no data`:G(a.zValue)}`,r=setTimeout(()=>{i(`${K(a.xValue,{datasetHasTimeOfDay:t})}. ${e}${n}`)},120);return()=>clearTimeout(r)},[a,t]),g(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:r})},nn=({data:e,label:t,slotName:n,store:r,xHasTimeOfDay:i,xKey:a,zKey:o})=>{let s=Lt(r);if(e.length===0||s.series.length===0)return null;let c=e.slice(0,150);return g(`div`,{className:`sr-only`,"data-slot":`${n}-data-table`,children:_(`table`,{children:[g(`caption`,{children:`${t==null?`Chart data`:`${t} — chart data`}${e.length>150?`. Showing the first 150 of ${e.length} rows.`:`.`}`}),g(`thead`,{children:_(`tr`,{children:[g(`th`,{scope:`col`,children:a}),s.series.map(e=>g(`th`,{scope:`col`,children:e.label},e.dataKey)),o==null?null:g(`th`,{scope:`col`,children:o})]})}),g(`tbody`,{children:c.map((e,t)=>{let n=E(e,a),r=n instanceof Date&&!Number.isNaN(n.getTime()),c=typeof n==`string`||typeof n==`number`||n instanceof Date?K(n,{datasetHasTimeOfDay:i}):String(n);return _(`tr`,{children:[g(`th`,{scope:`row`,"data-value":typeof n==`number`&&Number.isFinite(n)?n:void 0,children:r?g(`time`,{dateTime:n.toISOString(),children:c}):c}),s.series.map(t=>{let n=E(e,t.dataKey),r=typeof n==`number`&&Number.isFinite(n);return g(`td`,{"data-value":r?n:void 0,children:r?G(n):`—`},t.dataKey)}),o==null?null:(()=>{let t=E(e,o),n=typeof t==`number`&&Number.isFinite(t);return g(`td`,{"data-value":n?t:void 0,children:n?G(t):`—`})})()]},t)})})]})})};export{Gt as a,Ut as c,Ht as i,Wt as l,$t as n,Vt as o,Bt as r,Kt as s,en as t};
|