From c94d1d20de918adee2b245f1c28a91800fb53598 Mon Sep 17 00:00:00 2001 From: Valay Dave Date: Fri, 19 Sep 2025 10:29:09 -0700 Subject: [PATCH 1/3] [cards] valuebox component --- metaflow/cards.py | 1 + .../plugins/cards/card_modules/components.py | 228 ++++++++++++++++++ .../components/card-component-renderer.svelte | 2 + .../src/components/table-data-renderer.svelte | 2 + .../cards/ui/src/components/value-box.svelte | 165 +++++++++++++ metaflow/plugins/cards/ui/src/types.ts | 12 + 6 files changed, 410 insertions(+) create mode 100644 metaflow/plugins/cards/ui/src/components/value-box.svelte diff --git a/metaflow/cards.py b/metaflow/cards.py index 2497d4dd89c..334b3dcfb27 100644 --- a/metaflow/cards.py +++ b/metaflow/cards.py @@ -8,6 +8,7 @@ Markdown, VegaChart, ProgressBar, + ValueBox, PythonCode, ) from metaflow.plugins.cards.card_modules.basic import ( diff --git a/metaflow/plugins/cards/card_modules/components.py b/metaflow/plugins/cards/card_modules/components.py index 65685cc889a..32b66146b4b 100644 --- a/metaflow/plugins/cards/card_modules/components.py +++ b/metaflow/plugins/cards/card_modules/components.py @@ -753,6 +753,234 @@ def render(self): return data +class ValueBox(UserComponent): + """ + A Value Box component for displaying key metrics with styling and change indicators. + + Inspired by Shiny's value box component, this displays a primary value with optional + title, subtitle, theme, and change indicators. + + Example: + ``` + # Basic value box + value_box = ValueBox( + title="Revenue", + value="$1.2M", + subtitle="Monthly Revenue", + change_indicator="Up 15% from last month" + ) + current.card.append(value_box) + + # Themed value box + value_box = ValueBox( + title="Total Savings", + value=50000, + theme="success", + change_indicator="Up 30% from last month" + ) + current.card.append(value_box) + + # Updatable value box for real-time metrics + metrics_box = ValueBox( + title="Processing Progress", + value=0, + subtitle="Items processed" + ) + current.card.append(metrics_box) + + for i in range(1000): + metrics_box.update(value=i, change_indicator=f"Rate: {i*2}/sec") + ``` + + Parameters + ---------- + title : str, optional + The title/label for the value box (usually displayed above the value). + Must be 200 characters or less. + value : Union[str, int, float] + The main value to display prominently. Required parameter. + subtitle : str, optional + Additional descriptive text displayed below the title. + Must be 300 characters or less. + theme : str, optional + CSS class name for styling the value box. Supported themes: 'default', 'success', + 'warning', 'danger', 'bg-gradient-indigo-purple'. Custom themes must be valid CSS class names. + change_indicator : str, optional + Text indicating change or additional context (e.g., "Up 30% VS PREVIOUS 30 DAYS"). + Must be 200 characters or less. + """ + + type = "valueBox" + + REALTIME_UPDATABLE = True + + # Valid built-in themes + VALID_THEMES = { + "default", + "success", + "warning", + "danger", + "bg-gradient-indigo-purple", + } + + def __init__( + self, + title: Optional[str] = None, + value: Union[str, int, float] = "", + subtitle: Optional[str] = None, + theme: Optional[str] = None, + change_indicator: Optional[str] = None, + ): + # Validate inputs + self._validate_title(title) + self._validate_value(value) + self._validate_subtitle(subtitle) + self._validate_theme(theme) + self._validate_change_indicator(change_indicator) + + self._title = title + self._value = value + self._subtitle = subtitle + self._theme = theme + self._change_indicator = change_indicator + + def update( + self, + title: Optional[str] = None, + value: Optional[Union[str, int, float]] = None, + subtitle: Optional[str] = None, + theme: Optional[str] = None, + change_indicator: Optional[str] = None, + ): + """ + Update the value box with new data. + + Parameters + ---------- + title : str, optional + New title for the value box. + value : Union[str, int, float], optional + New value to display. + subtitle : str, optional + New subtitle text. + theme : str, optional + New theme/styling class. + change_indicator : str, optional + New change indicator text. + """ + if title is not None: + self._validate_title(title) + self._title = title + if value is not None: + self._validate_value(value) + self._value = value + if subtitle is not None: + self._validate_subtitle(subtitle) + self._subtitle = subtitle + if theme is not None: + self._validate_theme(theme) + self._theme = theme + if change_indicator is not None: + self._validate_change_indicator(change_indicator) + self._change_indicator = change_indicator + + def _validate_title(self, title: Optional[str]) -> None: + """Validate title parameter.""" + if title is not None: + if not isinstance(title, str): + raise TypeError(f"Title must be a string, got {type(title).__name__}") + if len(title) > 200: + raise ValueError( + f"Title must be 200 characters or less, got {len(title)} characters" + ) + if not title.strip(): + raise ValueError("Title cannot be empty or whitespace only") + + def _validate_value(self, value: Union[str, int, float]) -> None: + """Validate value parameter.""" + if value is None: + raise ValueError("Value is required and cannot be None") + if not isinstance(value, (str, int, float)): + raise TypeError( + f"Value must be str, int, or float, got {type(value).__name__}" + ) + if isinstance(value, str): + if len(value) > 100: + raise ValueError( + f"String value must be 100 characters or less, got {len(value)} characters" + ) + if not value.strip(): + raise ValueError("String value cannot be empty or whitespace only") + if isinstance(value, (int, float)): + if not (-1e15 <= value <= 1e15): + raise ValueError( + f"Numeric value must be between -1e15 and 1e15, got {value}" + ) + + def _validate_subtitle(self, subtitle: Optional[str]) -> None: + """Validate subtitle parameter.""" + if subtitle is not None: + if not isinstance(subtitle, str): + raise TypeError( + f"Subtitle must be a string, got {type(subtitle).__name__}" + ) + if len(subtitle) > 300: + raise ValueError( + f"Subtitle must be 300 characters or less, got {len(subtitle)} characters" + ) + if not subtitle.strip(): + raise ValueError("Subtitle cannot be empty or whitespace only") + + def _validate_theme(self, theme: Optional[str]) -> None: + """Validate theme parameter.""" + if theme is not None: + if not isinstance(theme, str): + raise TypeError(f"Theme must be a string, got {type(theme).__name__}") + if not theme.strip(): + raise ValueError("Theme cannot be empty or whitespace only") + # Allow custom themes but warn if not in valid set + if theme not in self.VALID_THEMES: + import re + + # Basic CSS class name validation + if not re.match(r"^[a-zA-Z][a-zA-Z0-9_-]*$", theme): + raise ValueError( + f"Theme must be a valid CSS class name, got '{theme}'" + ) + + def _validate_change_indicator(self, change_indicator: Optional[str]) -> None: + """Validate change_indicator parameter.""" + if change_indicator is not None: + if not isinstance(change_indicator, str): + raise TypeError( + f"Change indicator must be a string, got {type(change_indicator).__name__}" + ) + if len(change_indicator) > 200: + raise ValueError( + f"Change indicator must be 200 characters or less, got {len(change_indicator)} characters" + ) + if not change_indicator.strip(): + raise ValueError("Change indicator cannot be empty or whitespace only") + + @with_default_component_id + @render_safely + def render(self): + data = { + "type": self.type, + "id": self.component_id, + "value": self._value, + } + if self._title is not None: + data["title"] = self._title + if self._subtitle is not None: + data["subtitle"] = self._subtitle + if self._theme is not None: + data["theme"] = self._theme + if self._change_indicator is not None: + data["change_indicator"] = self._change_indicator + return data + + class VegaChart(UserComponent): type = "vegaChart" diff --git a/metaflow/plugins/cards/ui/src/components/card-component-renderer.svelte b/metaflow/plugins/cards/ui/src/components/card-component-renderer.svelte index dbeb3026f83..1705f796045 100644 --- a/metaflow/plugins/cards/ui/src/components/card-component-renderer.svelte +++ b/metaflow/plugins/cards/ui/src/components/card-component-renderer.svelte @@ -14,6 +14,7 @@ import Table from "./table.svelte"; import Text from "./text.svelte"; import Title from "./title.svelte"; + import ValueBox from "./value-box.svelte"; import VegaChart from "./vega-chart.svelte"; import PythonCode from "./python-code.svelte"; @@ -33,6 +34,7 @@ table: Table, text: Text, title: Title, + valueBox: ValueBox, vegaChart: VegaChart, pythonCode: PythonCode, }; diff --git a/metaflow/plugins/cards/ui/src/components/table-data-renderer.svelte b/metaflow/plugins/cards/ui/src/components/table-data-renderer.svelte index d1df599623d..079a180b0f6 100644 --- a/metaflow/plugins/cards/ui/src/components/table-data-renderer.svelte +++ b/metaflow/plugins/cards/ui/src/components/table-data-renderer.svelte @@ -11,6 +11,7 @@ import Markdown from "./markdown.svelte"; import Text from "./text.svelte"; import ProgressBar from "./progress-bar.svelte"; + import ValueBox from "./value-box.svelte"; import PythonCode from "./python-code.svelte"; export let componentData: types.TableDataCell; @@ -25,6 +26,7 @@ markdown: Markdown, progressBar: ProgressBar, text: Text, + valueBox: ValueBox, vegaChart: VegaChart, pythonCode: PythonCode, }; diff --git a/metaflow/plugins/cards/ui/src/components/value-box.svelte b/metaflow/plugins/cards/ui/src/components/value-box.svelte new file mode 100644 index 00000000000..39600719fac --- /dev/null +++ b/metaflow/plugins/cards/ui/src/components/value-box.svelte @@ -0,0 +1,165 @@ + + +
+
+ {#if title} +

{title}

+ {/if} + +
{displayValue}
+ + {#if subtitle} +

{subtitle}

+ {/if} + + {#if change_indicator} +
{change_indicator}
+ {/if} +
+
+ + diff --git a/metaflow/plugins/cards/ui/src/types.ts b/metaflow/plugins/cards/ui/src/types.ts index 8f17c93d710..4a632cd1972 100644 --- a/metaflow/plugins/cards/ui/src/types.ts +++ b/metaflow/plugins/cards/ui/src/types.ts @@ -34,6 +34,7 @@ export type TableDataCell = | MarkdownComponent | ProgressBarComponent | TextComponent + | ValueBoxComponent | VegaChartComponent | PythonCodeComponent; @@ -201,6 +202,16 @@ export interface PythonCodeComponent { data: string; } +export interface ValueBoxComponent { + type: "valueBox"; + id?: string; + title?: string; + value: string | number; + subtitle?: string; + theme?: string; // CSS class for styling + change_indicator?: string; // e.g., "Up 30% VS PREVIOUS 30 DAYS" +} + export interface MarkdownComponent { type: "markdown"; id?: string; @@ -229,5 +240,6 @@ export type CardComponent = | TableComponent | TextComponent | TitleComponent + | ValueBoxComponent | VegaChartComponent | PythonCodeComponent; From 076b7aaf30b4ff7054678c9688700ae15fe410c4 Mon Sep 17 00:00:00 2001 From: Valay Dave Date: Fri, 19 Sep 2025 10:36:06 -0700 Subject: [PATCH 2/3] [gh action] to build card bundle. --- .github/workflows/build-ui-assets.yml | 150 ++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 .github/workflows/build-ui-assets.yml diff --git a/.github/workflows/build-ui-assets.yml b/.github/workflows/build-ui-assets.yml new file mode 100644 index 00000000000..8e3a8830707 --- /dev/null +++ b/.github/workflows/build-ui-assets.yml @@ -0,0 +1,150 @@ +name: Build UI Assets and Create PR + +on: + workflow_dispatch: + +jobs: + build-and-pr: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + cache: 'npm' + cache-dependency-path: metaflow/plugins/cards/ui/package-lock.json + + - name: Install dependencies + working-directory: ./metaflow/plugins/cards/ui + run: npm ci + + - name: Lint and type check + working-directory: ./metaflow/plugins/cards/ui + run: | + npm run check + npm run lint + + - name: Clean previous build artifacts + run: | + # Remove previous build artifacts to ensure clean build + rm -f metaflow/plugins/cards/card_modules/main.js + rm -f metaflow/plugins/cards/card_modules/bundle.css + rm -f metaflow/plugins/cards/card_modules/main.js.map + + - name: Build UI assets + working-directory: ./metaflow/plugins/cards/ui + run: npm run build + + - name: Verify build outputs + run: | + # Check that the expected files were created + if [[ ! -f "metaflow/plugins/cards/card_modules/main.js" ]]; then + echo "::error::main.js was not created by the build process" + exit 1 + fi + + if [[ ! -f "metaflow/plugins/cards/card_modules/bundle.css" ]]; then + echo "::error::bundle.css was not created by the build process" + exit 1 + fi + + # Check file sizes (they should not be empty) + main_size=$(stat -c%s "metaflow/plugins/cards/card_modules/main.js") + css_size=$(stat -c%s "metaflow/plugins/cards/card_modules/bundle.css") + + if [[ $main_size -lt 1000 ]]; then + echo "::error::main.js seems too small ($main_size bytes), build may have failed" + exit 1 + fi + + if [[ $css_size -lt 500 ]]; then + echo "::error::bundle.css seems too small ($css_size bytes), build may have failed" + exit 1 + fi + + echo "✅ Build outputs verified:" + echo " main.js: $main_size bytes" + echo " bundle.css: $css_size bytes" + + - name: Check for changes + id: changes + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + + # Check if there are changes to the built files + if git diff --quiet metaflow/plugins/cards/card_modules/main.js metaflow/plugins/cards/card_modules/bundle.css; then + echo "No changes detected in built files" + echo "has_changes=false" >> $GITHUB_OUTPUT + else + echo "Changes detected in built files" + echo "has_changes=true" >> $GITHUB_OUTPUT + fi + + - name: Create Pull Request + if: steps.changes.outputs.has_changes == 'true' + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "chore: update UI build artifacts (main.js, bundle.css)" + title: "🔧 Update UI Build Artifacts" + body: | + ## UI Build Artifacts Update + + This PR updates the built UI assets (`main.js` and `bundle.css`) from the latest changes in the UI source code. + + ### Changes + - 📦 Updated `metaflow/plugins/cards/card_modules/main.js` + - 🎨 Updated `metaflow/plugins/cards/card_modules/bundle.css` + + ### Build Info + - **Triggered by**: @${{ github.actor }} + - **Source branch**: `${{ github.ref_name }}` + - **Build timestamp**: ${{ steps.build-info.outputs.timestamp }} + - **Node.js version**: 20.x + + ### Verification + These files were built using: + ```bash + cd metaflow/plugins/cards/ui + npm ci + npm run build + ``` + + The build process includes: + - TypeScript checking (`npm run check`) + - ESLint validation (`npm run lint`) + - Vite build with minification + + --- + *This PR was automatically created by the Build UI Assets workflow.* + branch: build/ui-assets-${{ github.run_number }} + base: ${{ github.ref_name }} + delete-branch: true + draft: false + add-paths: | + metaflow/plugins/cards/card_modules/main.js + metaflow/plugins/cards/card_modules/bundle.css + + - name: Add build timestamp + id: build-info + run: echo "timestamp=$(date -u '+%Y-%m-%d %H:%M:%S UTC')" >> $GITHUB_OUTPUT + + - name: No changes message + if: steps.changes.outputs.has_changes == 'false' + run: | + echo "::notice::No changes detected in the built UI assets. The main.js and bundle.css files are already up to date." + + - name: Success message + if: steps.changes.outputs.has_changes == 'true' + run: | + echo "::notice::Successfully created PR with updated UI build artifacts!" From fbb2802e7ca5f01b841d548f29f1d734a75e7979 Mon Sep 17 00:00:00 2001 From: valayDave Date: Fri, 19 Sep 2025 17:37:25 +0000 Subject: [PATCH 3/3] chore: update UI build artifacts (main.js, bundle.css) --- .../plugins/cards/card_modules/bundle.css | 2 +- metaflow/plugins/cards/card_modules/main.js | 56 +++++++++---------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/metaflow/plugins/cards/card_modules/bundle.css b/metaflow/plugins/cards/card_modules/bundle.css index ad551ec04f7..94b4023a07e 100644 --- a/metaflow/plugins/cards/card_modules/bundle.css +++ b/metaflow/plugins/cards/card_modules/bundle.css @@ -1 +1 @@ -@import"https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap";code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:#ffffff80}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}:root{--bg: #ffffff;--black: #333;--blue: #0c66de;--dk-grey: #767676;--dk-primary: #ef863b;--dk-secondary: #13172d;--dk-tertiary: #0f426e;--error: #cf483e;--grey: rgba(0, 0, 0, .125);--highlight: #f8d9d8;--lt-blue: #4fa7ff;--lt-grey: #f3f3f3;--lt-lt-grey: #f9f9f9;--lt-primary: #ffcb8b;--lt-secondary: #434d81;--lt-tertiary: #4189c9;--primary: #faab4a;--quadrary: #f8d9d8;--secondary: #2e3454;--tertiary: #2a679d;--white: #ffffff;--component-spacer: 3rem;--aside-width: 20rem;--embed-card-min-height: 12rem;--mono-font: ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", "Fira Mono", "Droid Sans Mono", "Courier New", monospace}html,body{margin:0;min-height:100vh;overflow-y:visible;padding:0;width:100%}.card_app{width:100%;min-height:100vh}.embed .card_app{min-height:var(--embed-card-min-height)}.mf-card *{box-sizing:border-box}.mf-card{background:var(--bg);color:var(--black);font-family:Roboto,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:14px;font-weight:400;line-height:1.5;text-size-adjust:100%;margin:0;min-height:100vh;overflow-y:visible;padding:0;text-align:left;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;width:100%}.embed .mf-card{min-height:var(--embed-card-min-height)}.mf-card :is(.mono,code.mono,pre.mono){font-family:var(--mono-font);font-weight:lighter}.mf-card :is(table,th,td){border-spacing:1px;text-align:center;color:var(--black)}.mf-card table{position:relative;min-width:100%;table-layout:inherit!important}.mf-card td{padding:.66rem 1.25rem;background:var(--lt-lt-grey);border:none}.mf-card th{border:none;color:var(--dk-grey);font-weight:400;padding:.5rem}.mf-card :is(h1,h2,h3,h4,h5){font-weight:700;margin:.5rem 0}.mf-card ul{margin:0;padding:0}.mf-card p{margin:0 0 1rem}.mf-card p:last-of-type{margin:0}.mf-card button{font-size:1rem}.mf-card .textButton{cursor:pointer;text-align:left;background:none;border:1px solid transparent;outline:none;padding:0}.mf-card :is(button.textButton:focus,a:focus,button.textButton:active){border:1px dashed var(--grey);background:transparent}.mf-card button.textButton:hover{color:var(--blue);text-decoration:none}.mf-card :is(:not(pre)>code[class*=language-],pre[class*=language-]){background:transparent!important;text-shadow:none;-webkit-user-select:auto;user-select:auto}aside.svelte-1okdv0e{display:none;line-height:2;text-align:left}@media (min-width: 60rem){aside.svelte-1okdv0e{display:flex;flex-direction:column;height:100vh;justify-content:space-between;padding:2.5rem 0 1.5rem 1.5rem;position:fixed;width:var(--aside-width)}}.embed aside{display:none}aside ul{list-style-type:none}aside a,aside button,aside a:visited{text-decoration:none;cursor:pointer;font-weight:700;color:var(--black)}aside a:hover,aside button:hover{text-decoration:underline}.logoContainer svg{width:100%;max-width:140px;margin-bottom:3.75rem;height:auto}.idCell.svelte-pt8vzv{font-weight:700;text-align:right;background:var(--lt-grey);width:12%}.codeCell.svelte-pt8vzv{text-align:left;-webkit-user-select:all;user-select:all}.container.svelte-ubs992{width:100%;overflow:auto}table.svelte-ubs992{width:100%}:root{--dag-border: #282828;--dag-bg-static: var(--lt-grey);--dag-bg-success: #a5d46a;--dag-bg-running: #ffdf80;--dag-bg-error: #ffa080;--dag-connector: #cccccc;--dag-gap: 5rem;--dag-step-height: 6.25rem;--dag-step-width: 11.25rem;--dag-selected: #ffd700}.connectorwrapper.svelte-19jpdwh{transform-origin:0 0;position:absolute;z-index:0;min-width:var(--strokeWidth)}.flip.svelte-19jpdwh{transform:scaleX(-1)}.path.svelte-19jpdwh{--strokeWidth:.5rem;--strokeColor:var(--dag-connector);--borderRadius:1.25rem;box-sizing:border-box}.straightLine.svelte-19jpdwh{position:absolute;top:0;bottom:0;left:0;right:0;border-left:var(--strokeWidth) solid var(--strokeColor)}.loop.svelte-19jpdwh{position:absolute;top:-50%;left:0;width:100%;height:100%;border-radius:var(--borderRadius);border:var(--strokeWidth) solid var(--strokeColor)}.topLeft.svelte-19jpdwh{position:absolute;top:0;left:0;right:50%;bottom:calc(var(--dag-gap) / 2 - var(--strokeWidth) / 2);border-radius:0 0 0 var(--borderRadius);border-left:var(--strokeWidth) solid var(--strokeColor);border-bottom:var(--strokeWidth) solid var(--strokeColor)}.bottomRight.svelte-19jpdwh{position:absolute;top:calc(100% - (var(--dag-gap) / 2 + var(--strokeWidth) / 2));left:50%;right:0;bottom:0;border-radius:0 var(--borderRadius) 0 0;border-top:var(--strokeWidth) solid var(--strokeColor);border-right:var(--strokeWidth) solid var(--strokeColor)}.wrapper.svelte-117ceti.svelte-117ceti{position:relative;z-index:1}.step.svelte-117ceti.svelte-117ceti{font-size:.75rem;padding:.5rem;color:var(--dk-grey)}.rectangle.svelte-117ceti.svelte-117ceti{background-color:var(--dag-bg-static);border:1px solid var(--dag-border);box-sizing:border-box;position:relative;height:var(--dag-step-height);width:var(--dag-step-width)}.rectangle.error.svelte-117ceti.svelte-117ceti{background-color:var(--dag-bg-error)}.rectangle.success.svelte-117ceti.svelte-117ceti{background-color:var(--dag-bg-success)}.rectangle.running.svelte-117ceti.svelte-117ceti{background-color:var(--dag-bg-running)}.level.svelte-117ceti.svelte-117ceti{z-index:-1;filter:contrast(.5);position:absolute}.inner.svelte-117ceti.svelte-117ceti{position:relative;height:100%;width:100%}.name.svelte-117ceti.svelte-117ceti{font-weight:700;overflow:hidden;text-overflow:ellipsis;display:block}.description.svelte-117ceti.svelte-117ceti{position:absolute;max-height:4rem;bottom:0;left:0;right:0;overflow:hidden;-webkit-line-clamp:4;line-clamp:4;display:-webkit-box;-webkit-box-orient:vertical}.overflown.description.svelte-117ceti.svelte-117ceti{cursor:help}.current.svelte-117ceti .rectangle.svelte-117ceti{box-shadow:0 0 10px var(--dag-selected)}.levelstoshow.svelte-117ceti.svelte-117ceti{position:absolute;bottom:100%;right:0;font-size:.75rem;font-weight:100;text-align:right}.stepwrapper.svelte-18aex7a{display:flex;align-items:center;flex-direction:column;width:100%;position:relative;min-width:var(--dag-step-width)}.childwrapper.svelte-18aex7a{display:flex;width:100%}.gap.svelte-18aex7a{height:var(--dag-gap)}.title.svelte-117s0ws{text-align:left}.subtitle.svelte-lu9pnn{font-size:1rem;text-align:left}header.svelte-1ugmt5d{margin-bottom:var(--component-spacer)}figure.svelte-1x96yvr{background:var(--lt-grey);padding:1rem;border-radius:5px;text-align:center;margin:0 auto var(--component-spacer)}@media (min-width: 60rem){figure.svelte-1x96yvr{margin-bottom:0}}img.svelte-1x96yvr{max-width:100%;max-height:500px}.label.svelte-1x96yvr{font-weight:700;margin:.5rem 0}.description.svelte-1x96yvr{font-size:.9rem;font-style:italic;text-align:center;margin:.5rem 0}.log.svelte-1jhmsu{background:var(--lt-grey)!important;font-size:.9rem;padding:2rem}.page.svelte-v7ihqd:last-of-type{margin-bottom:var(--component-spacer)}.page:last-of-type section:last-of-type hr{display:none}progress.svelte-ljrmzp::-webkit-progress-bar{background-color:#fff!important;min-width:100%}progress.svelte-ljrmzp{background-color:#fff;color:#326cded9!important}progress.svelte-ljrmzp::-moz-progress-bar{background-color:#326cde!important}table .container{background:transparent!important;font-size:10px!important;padding:0!important}table progress{height:4px!important}.container.svelte-ljrmzp{display:flex;align-items:center;justify-content:center;font-size:12px;border-radius:3px;background:#edf5ff;padding:3rem}.inner.svelte-ljrmzp{max-width:410px;width:100%;text-align:center}.info.svelte-ljrmzp{display:flex;justify-content:space-between}table .info{text-align:left;flex-direction:column}label.svelte-ljrmzp{font-weight:700}.labelValue.svelte-ljrmzp{border-left:1px solid rgba(0,0,0,.1);margin-left:.25rem;padding-left:.5rem}.details.svelte-ljrmzp{font-family:var(--mono-font);font-size:8px;color:#333433;line-height:18px;overflow:hidden;white-space:nowrap}progress.svelte-ljrmzp{width:100%;border:none;border-radius:5px;height:8px;background:#fff}.heading.svelte-17n0qr8{margin-bottom:1.5rem}.sectionItems.svelte-17n0qr8{display:block}.sectionItems .imageContainer{max-height:500px}.container.svelte-17n0qr8{scroll-margin:var(--component-spacer)}hr.svelte-17n0qr8{background:var(--grey);border:none;height:1px;margin:var(--component-spacer) 0;padding:0}@media (min-width: 60rem){.sectionItems.svelte-17n0qr8{display:grid;grid-gap:2rem}}td.svelte-gl9h79{text-align:left}td.labelColumn.svelte-gl9h79{text-align:right;background-color:var(--lt-grey);font-weight:700;width:12%;white-space:nowrap}.tableContainer.svelte-q3hq57{overflow:auto}th.svelte-q3hq57{position:sticky;top:-1px;z-index:2;white-space:nowrap;background:var(--white)}.mainContainer.svelte-mqeomk{max-width:110rem}main.svelte-mqeomk{flex:0 1 auto;max-width:100rem;padding:1.5rem}@media (min-width: 60rem){main.svelte-mqeomk{margin-left:var(--aside-width)}}.embed main{margin:0 auto;min-width:80%}.modal.svelte-1hhf5ym{align-items:center;background:#00000080;bottom:0;cursor:pointer;display:flex;height:100%;justify-content:center;left:0;overflow:hidden;position:fixed;right:0;top:0;width:100%;z-index:100}.modalContainer>*{background-color:#fff;border-radius:5px;cursor:default;flex:0 1 auto;padding:1rem;position:relative}.modal img{max-height:80vh!important}.cancelButton.svelte-1hhf5ym{color:#fff;cursor:pointer;font-size:2rem;position:absolute;right:1rem;top:1rem}.cancelButton.svelte-1hhf5ym:hover{color:var(--blue)}.nav.svelte-1kdpgko.svelte-1kdpgko{border-radius:0 0 5px;display:none;margin:0;top:0}ul.navList.svelte-1kdpgko.svelte-1kdpgko{list-style-type:none}ul.navList.svelte-1kdpgko ul.svelte-1kdpgko{margin:.5rem 1rem 2rem}.navList.svelte-1kdpgko li.svelte-1kdpgko{display:block;margin:0}.navItem.svelte-1kdpgko li.svelte-1kdpgko:hover{color:var(--blue)}.pageId.svelte-1kdpgko.svelte-1kdpgko{display:block;border-bottom:1px solid var(--grey);padding:0 .5rem;margin-bottom:1rem}@media (min-width: 60rem){.nav.svelte-1kdpgko.svelte-1kdpgko{display:block}ul.navList.svelte-1kdpgko.svelte-1kdpgko{text-align:left}.navList.svelte-1kdpgko li.svelte-1kdpgko{display:block;margin:.5rem 0}}.container.svelte-teyund{width:100%;display:flex;flex-direction:column;position:relative} +@import"https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap";code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:#ffffff80}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}:root{--bg: #ffffff;--black: #333;--blue: #0c66de;--dk-grey: #767676;--dk-primary: #ef863b;--dk-secondary: #13172d;--dk-tertiary: #0f426e;--error: #cf483e;--grey: rgba(0, 0, 0, .125);--highlight: #f8d9d8;--lt-blue: #4fa7ff;--lt-grey: #f3f3f3;--lt-lt-grey: #f9f9f9;--lt-primary: #ffcb8b;--lt-secondary: #434d81;--lt-tertiary: #4189c9;--primary: #faab4a;--quadrary: #f8d9d8;--secondary: #2e3454;--tertiary: #2a679d;--white: #ffffff;--component-spacer: 3rem;--aside-width: 20rem;--embed-card-min-height: 12rem;--mono-font: ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", "Fira Mono", "Droid Sans Mono", "Courier New", monospace}html,body{margin:0;min-height:100vh;overflow-y:visible;padding:0;width:100%}.card_app{width:100%;min-height:100vh}.embed .card_app{min-height:var(--embed-card-min-height)}.mf-card *{box-sizing:border-box}.mf-card{background:var(--bg);color:var(--black);font-family:Roboto,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:14px;font-weight:400;line-height:1.5;text-size-adjust:100%;margin:0;min-height:100vh;overflow-y:visible;padding:0;text-align:left;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;width:100%}.embed .mf-card{min-height:var(--embed-card-min-height)}.mf-card :is(.mono,code.mono,pre.mono){font-family:var(--mono-font);font-weight:lighter}.mf-card :is(table,th,td){border-spacing:1px;text-align:center;color:var(--black)}.mf-card table{position:relative;min-width:100%;table-layout:inherit!important}.mf-card td{padding:.66rem 1.25rem;background:var(--lt-lt-grey);border:none}.mf-card th{border:none;color:var(--dk-grey);font-weight:400;padding:.5rem}.mf-card :is(h1,h2,h3,h4,h5){font-weight:700;margin:.5rem 0}.mf-card ul{margin:0;padding:0}.mf-card p{margin:0 0 1rem}.mf-card p:last-of-type{margin:0}.mf-card button{font-size:1rem}.mf-card .textButton{cursor:pointer;text-align:left;background:none;border:1px solid transparent;outline:none;padding:0}.mf-card :is(button.textButton:focus,a:focus,button.textButton:active){border:1px dashed var(--grey);background:transparent}.mf-card button.textButton:hover{color:var(--blue);text-decoration:none}.mf-card :is(:not(pre)>code[class*=language-],pre[class*=language-]){background:transparent!important;text-shadow:none;-webkit-user-select:auto;user-select:auto}aside.svelte-1okdv0e{display:none;line-height:2;text-align:left}@media (min-width: 60rem){aside.svelte-1okdv0e{display:flex;flex-direction:column;height:100vh;justify-content:space-between;padding:2.5rem 0 1.5rem 1.5rem;position:fixed;width:var(--aside-width)}}.embed aside{display:none}aside ul{list-style-type:none}aside a,aside button,aside a:visited{text-decoration:none;cursor:pointer;font-weight:700;color:var(--black)}aside a:hover,aside button:hover{text-decoration:underline}.logoContainer svg{width:100%;max-width:140px;margin-bottom:3.75rem;height:auto}.idCell.svelte-pt8vzv{font-weight:700;text-align:right;background:var(--lt-grey);width:12%}.codeCell.svelte-pt8vzv{text-align:left;-webkit-user-select:all;user-select:all}.container.svelte-ubs992{width:100%;overflow:auto}table.svelte-ubs992{width:100%}:root{--dag-border: #282828;--dag-bg-static: var(--lt-grey);--dag-bg-success: #a5d46a;--dag-bg-running: #ffdf80;--dag-bg-error: #ffa080;--dag-connector: #cccccc;--dag-gap: 5rem;--dag-step-height: 6.25rem;--dag-step-width: 11.25rem;--dag-selected: #ffd700}.connectorwrapper.svelte-19jpdwh{transform-origin:0 0;position:absolute;z-index:0;min-width:var(--strokeWidth)}.flip.svelte-19jpdwh{transform:scaleX(-1)}.path.svelte-19jpdwh{--strokeWidth:.5rem;--strokeColor:var(--dag-connector);--borderRadius:1.25rem;box-sizing:border-box}.straightLine.svelte-19jpdwh{position:absolute;top:0;bottom:0;left:0;right:0;border-left:var(--strokeWidth) solid var(--strokeColor)}.loop.svelte-19jpdwh{position:absolute;top:-50%;left:0;width:100%;height:100%;border-radius:var(--borderRadius);border:var(--strokeWidth) solid var(--strokeColor)}.topLeft.svelte-19jpdwh{position:absolute;top:0;left:0;right:50%;bottom:calc(var(--dag-gap) / 2 - var(--strokeWidth) / 2);border-radius:0 0 0 var(--borderRadius);border-left:var(--strokeWidth) solid var(--strokeColor);border-bottom:var(--strokeWidth) solid var(--strokeColor)}.bottomRight.svelte-19jpdwh{position:absolute;top:calc(100% - (var(--dag-gap) / 2 + var(--strokeWidth) / 2));left:50%;right:0;bottom:0;border-radius:0 var(--borderRadius) 0 0;border-top:var(--strokeWidth) solid var(--strokeColor);border-right:var(--strokeWidth) solid var(--strokeColor)}.wrapper.svelte-117ceti.svelte-117ceti{position:relative;z-index:1}.step.svelte-117ceti.svelte-117ceti{font-size:.75rem;padding:.5rem;color:var(--dk-grey)}.rectangle.svelte-117ceti.svelte-117ceti{background-color:var(--dag-bg-static);border:1px solid var(--dag-border);box-sizing:border-box;position:relative;height:var(--dag-step-height);width:var(--dag-step-width)}.rectangle.error.svelte-117ceti.svelte-117ceti{background-color:var(--dag-bg-error)}.rectangle.success.svelte-117ceti.svelte-117ceti{background-color:var(--dag-bg-success)}.rectangle.running.svelte-117ceti.svelte-117ceti{background-color:var(--dag-bg-running)}.level.svelte-117ceti.svelte-117ceti{z-index:-1;filter:contrast(.5);position:absolute}.inner.svelte-117ceti.svelte-117ceti{position:relative;height:100%;width:100%}.name.svelte-117ceti.svelte-117ceti{font-weight:700;overflow:hidden;text-overflow:ellipsis;display:block}.description.svelte-117ceti.svelte-117ceti{position:absolute;max-height:4rem;bottom:0;left:0;right:0;overflow:hidden;-webkit-line-clamp:4;line-clamp:4;display:-webkit-box;-webkit-box-orient:vertical}.overflown.description.svelte-117ceti.svelte-117ceti{cursor:help}.current.svelte-117ceti .rectangle.svelte-117ceti{box-shadow:0 0 10px var(--dag-selected)}.levelstoshow.svelte-117ceti.svelte-117ceti{position:absolute;bottom:100%;right:0;font-size:.75rem;font-weight:100;text-align:right}.stepwrapper.svelte-18aex7a{display:flex;align-items:center;flex-direction:column;width:100%;position:relative;min-width:var(--dag-step-width)}.childwrapper.svelte-18aex7a{display:flex;width:100%}.gap.svelte-18aex7a{height:var(--dag-gap)}.title.svelte-117s0ws{text-align:left}.subtitle.svelte-lu9pnn{font-size:1rem;text-align:left}header.svelte-1ugmt5d{margin-bottom:var(--component-spacer)}figure.svelte-1x96yvr{background:var(--lt-grey);padding:1rem;border-radius:5px;text-align:center;margin:0 auto var(--component-spacer)}@media (min-width: 60rem){figure.svelte-1x96yvr{margin-bottom:0}}img.svelte-1x96yvr{max-width:100%;max-height:500px}.label.svelte-1x96yvr{font-weight:700;margin:.5rem 0}.description.svelte-1x96yvr{font-size:.9rem;font-style:italic;text-align:center;margin:.5rem 0}.log.svelte-1jhmsu{background:var(--lt-grey)!important;font-size:.9rem;padding:2rem}.page.svelte-v7ihqd:last-of-type{margin-bottom:var(--component-spacer)}.page:last-of-type section:last-of-type hr{display:none}progress.svelte-ljrmzp::-webkit-progress-bar{background-color:#fff!important;min-width:100%}progress.svelte-ljrmzp{background-color:#fff;color:#326cded9!important}progress.svelte-ljrmzp::-moz-progress-bar{background-color:#326cde!important}table .container{background:transparent!important;font-size:10px!important;padding:0!important}table progress{height:4px!important}.container.svelte-ljrmzp{display:flex;align-items:center;justify-content:center;font-size:12px;border-radius:3px;background:#edf5ff;padding:3rem}.inner.svelte-ljrmzp{max-width:410px;width:100%;text-align:center}.info.svelte-ljrmzp{display:flex;justify-content:space-between}table .info{text-align:left;flex-direction:column}label.svelte-ljrmzp{font-weight:700}.labelValue.svelte-ljrmzp{border-left:1px solid rgba(0,0,0,.1);margin-left:.25rem;padding-left:.5rem}.details.svelte-ljrmzp{font-family:var(--mono-font);font-size:8px;color:#333433;line-height:18px;overflow:hidden;white-space:nowrap}progress.svelte-ljrmzp{width:100%;border:none;border-radius:5px;height:8px;background:#fff}.heading.svelte-17n0qr8{margin-bottom:1.5rem}.sectionItems.svelte-17n0qr8{display:block}.sectionItems .imageContainer{max-height:500px}.container.svelte-17n0qr8{scroll-margin:var(--component-spacer)}hr.svelte-17n0qr8{background:var(--grey);border:none;height:1px;margin:var(--component-spacer) 0;padding:0}@media (min-width: 60rem){.sectionItems.svelte-17n0qr8{display:grid;grid-gap:2rem}}.value-box.svelte-175x1n5.svelte-175x1n5{border-radius:.5rem;padding:1.5rem;box-shadow:0 1px 3px #0000001a,0 1px 2px #0000000f;border:1px solid #e5e7eb;background:#fff;min-height:120px;display:flex;align-items:center}.value-box-content.svelte-175x1n5.svelte-175x1n5{width:100%}.value-box-title.svelte-175x1n5.svelte-175x1n5{font-size:.875rem;font-weight:500;color:#6b7280;margin:0 0 .5rem;text-transform:uppercase;letter-spacing:.025em}.value-box-value.svelte-175x1n5.svelte-175x1n5{font-size:2rem;font-weight:700;color:#111827;line-height:1.2;margin:0 0 .5rem}.value-box-subtitle.svelte-175x1n5.svelte-175x1n5{font-size:.875rem;color:#6b7280;margin:0 0 .5rem}.value-box-change.svelte-175x1n5.svelte-175x1n5{font-size:.75rem;font-weight:500;color:#059669;text-transform:uppercase;letter-spacing:.025em}.value-box.default.svelte-175x1n5.svelte-175x1n5{background:#fff;border-color:#e5e7eb}.value-box.bg-gradient-indigo-purple.svelte-175x1n5.svelte-175x1n5{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;border:none}.value-box.bg-gradient-indigo-purple.svelte-175x1n5 .value-box-title.svelte-175x1n5,.value-box.bg-gradient-indigo-purple.svelte-175x1n5 .value-box-subtitle.svelte-175x1n5{color:#fffc}.value-box.bg-gradient-indigo-purple.svelte-175x1n5 .value-box-value.svelte-175x1n5{color:#fff}.value-box.bg-gradient-indigo-purple.svelte-175x1n5 .value-box-change.svelte-175x1n5{color:#ffffffe6}.value-box.success.svelte-175x1n5.svelte-175x1n5{background:#f0fdf4;border-color:#bbf7d0}.value-box.success.svelte-175x1n5 .value-box-value.svelte-175x1n5{color:#065f46}.value-box.success.svelte-175x1n5 .value-box-change.svelte-175x1n5{color:#059669}.value-box.warning.svelte-175x1n5.svelte-175x1n5{background:#fffbeb;border-color:#fed7aa}.value-box.warning.svelte-175x1n5 .value-box-value.svelte-175x1n5{color:#92400e}.value-box.warning.svelte-175x1n5 .value-box-change.svelte-175x1n5{color:#d97706}.value-box.danger.svelte-175x1n5.svelte-175x1n5{background:#fef2f2;border-color:#fecaca}.value-box.danger.svelte-175x1n5 .value-box-value.svelte-175x1n5{color:#991b1b}.value-box.danger.svelte-175x1n5 .value-box-change.svelte-175x1n5{color:#dc2626}@media (max-width: 640px){.value-box.svelte-175x1n5.svelte-175x1n5{padding:1rem;min-height:100px}.value-box-value.svelte-175x1n5.svelte-175x1n5{font-size:1.5rem}}table .value-box{min-height:auto;padding:.75rem;margin:.25rem 0}table .value-box-value{font-size:1.25rem}td.svelte-gl9h79{text-align:left}td.labelColumn.svelte-gl9h79{text-align:right;background-color:var(--lt-grey);font-weight:700;width:12%;white-space:nowrap}.tableContainer.svelte-q3hq57{overflow:auto}th.svelte-q3hq57{position:sticky;top:-1px;z-index:2;white-space:nowrap;background:var(--white)}.mainContainer.svelte-mqeomk{max-width:110rem}main.svelte-mqeomk{flex:0 1 auto;max-width:100rem;padding:1.5rem}@media (min-width: 60rem){main.svelte-mqeomk{margin-left:var(--aside-width)}}.embed main{margin:0 auto;min-width:80%}.modal.svelte-1hhf5ym{align-items:center;background:#00000080;bottom:0;cursor:pointer;display:flex;height:100%;justify-content:center;left:0;overflow:hidden;position:fixed;right:0;top:0;width:100%;z-index:100}.modalContainer>*{background-color:#fff;border-radius:5px;cursor:default;flex:0 1 auto;padding:1rem;position:relative}.modal img{max-height:80vh!important}.cancelButton.svelte-1hhf5ym{color:#fff;cursor:pointer;font-size:2rem;position:absolute;right:1rem;top:1rem}.cancelButton.svelte-1hhf5ym:hover{color:var(--blue)}.nav.svelte-1kdpgko.svelte-1kdpgko{border-radius:0 0 5px;display:none;margin:0;top:0}ul.navList.svelte-1kdpgko.svelte-1kdpgko{list-style-type:none}ul.navList.svelte-1kdpgko ul.svelte-1kdpgko{margin:.5rem 1rem 2rem}.navList.svelte-1kdpgko li.svelte-1kdpgko{display:block;margin:0}.navItem.svelte-1kdpgko li.svelte-1kdpgko:hover{color:var(--blue)}.pageId.svelte-1kdpgko.svelte-1kdpgko{display:block;border-bottom:1px solid var(--grey);padding:0 .5rem;margin-bottom:1rem}@media (min-width: 60rem){.nav.svelte-1kdpgko.svelte-1kdpgko{display:block}ul.navList.svelte-1kdpgko.svelte-1kdpgko{text-align:left}.navList.svelte-1kdpgko li.svelte-1kdpgko{display:block;margin:.5rem 0}}.container.svelte-teyund{width:100%;display:flex;flex-direction:column;position:relative} diff --git a/metaflow/plugins/cards/card_modules/main.js b/metaflow/plugins/cards/card_modules/main.js index 5a036c5260e..d9ed3b6e5cf 100644 --- a/metaflow/plugins/cards/card_modules/main.js +++ b/metaflow/plugins/cards/card_modules/main.js @@ -1,11 +1,11 @@ -(function(ee,Pe){typeof exports=="object"&&typeof module<"u"?module.exports=Pe():typeof define=="function"&&define.amd?define(Pe):(ee=typeof globalThis<"u"?globalThis:ee||self,ee["Outerbounds Cards"]=Pe())})(this,function(){"use strict";var cxe=Object.defineProperty;var kz=ee=>{throw TypeError(ee)};var fxe=(ee,Pe,xi)=>Pe in ee?cxe(ee,Pe,{enumerable:!0,configurable:!0,writable:!0,value:xi}):ee[Pe]=xi;var Lt=(ee,Pe,xi)=>fxe(ee,typeof Pe!="symbol"?Pe+"":Pe,xi),dxe=(ee,Pe,xi)=>Pe.has(ee)||kz("Cannot "+xi);var Az=(ee,Pe,xi)=>Pe.has(ee)?kz("Cannot add the same private member more than once"):Pe instanceof WeakSet?Pe.add(ee):Pe.set(ee,xi);var a2=(ee,Pe,xi)=>(dxe(ee,Pe,"access private method"),xi);var Yu,g5,$z,Ez,Cz;function ee(){}function Pe(e,t){for(const n in t)e[n]=t[n];return e}function xi(e){return e()}function m5(){return Object.create(null)}function Xu(e){e.forEach(xi)}function y5(e){return typeof e=="function"}function ye(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Ih;function Ph(e,t){return e===t?!0:(Ih||(Ih=document.createElement("a")),Ih.href=t,e===Ih.href)}function Sz(e){return Object.keys(e).length===0}function Fz(e,...t){if(e==null){for(const i of t)i(void 0);return ee}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function zh(e,t,n){e.$$.on_destroy.push(Fz(t,n))}function mt(e,t,n,i){if(e){const r=b5(e,t,n,i);return e[0](r)}}function b5(e,t,n,i){return e[1]&&i?Pe(n.ctx.slice(),e[1](i(t))):n.ctx}function yt(e,t,n,i){return e[2],t.dirty}function bt(e,t,n,i,r,s){if(r){const o=b5(t,n,i,s);e.p(o,r)}}function vt(e){if(e.ctx.length>32){const t=[],n=e.ctx.length/32;for(let i=0;ie.removeEventListener(t,n,i)}function M(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}const Tz=["width","height"];function x5(e,t){const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const i in t)t[i]==null?e.removeAttribute(i):i==="style"?e.style.cssText=t[i]:i==="__value"?e.value=e[i]=t[i]:n[i]&&n[i].set&&Tz.indexOf(i)===-1?e[i]=t[i]:M(e,i,t[i])}function _5(e,t){for(const n in t)M(e,n,t[n])}function Mz(e){return Array.from(e.childNodes)}function ft(e,t){t=""+t,e.data!==t&&(e.data=t)}function _i(e,t,n,i){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,"")}function ni(e,t,n){e.classList.toggle(t,!!n)}function Nz(e,t,{bubbles:n=!1,cancelable:i=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:i})}class Rz{constructor(t=!1){Lt(this,"is_svg",!1);Lt(this,"e");Lt(this,"n");Lt(this,"t");Lt(this,"a");this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,i=null){this.e||(this.is_svg?this.e=Pi(n.nodeName):this.e=H(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(t)),this.i(i)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(t){for(let n=0;n{const r=e.$$.callbacks[t];if(r){const s=Nz(t,n,{cancelable:i});return r.slice().forEach(o=>{o.call(e,s)}),!s.defaultPrevented}return!0}}function E5(e,t){return qc().$$.context.set(e,t),t}function C5(e){return qc().$$.context.get(e)}function k5(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(i=>i.call(this,t))}const Zu=[],zi=[];let Ju=[];const c2=[],Oz=Promise.resolve();let f2=!1;function Lz(){f2||(f2=!0,Oz.then(A5))}function d2(e){Ju.push(e)}function h2(e){c2.push(e)}const p2=new Set;let Qu=0;function A5(){if(Qu!==0)return;const e=Uc;do{try{for(;Que.indexOf(i)===-1?t.push(i):n.push(i)),n.forEach(i=>i()),Ju=t}const Bh=new Set;let _a;function $e(){_a={r:0,c:[],p:_a}}function Se(){_a.r||Xu(_a.c),_a=_a.p}function F(e,t){e&&e.i&&(Bh.delete(e),e.i(t))}function N(e,t,n,i){if(e&&e.o){if(Bh.has(e))return;Bh.add(e),_a.c.push(()=>{Bh.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function Ue(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function wi(e,t){const n={},i={},r={$$scope:1};let s=e.length;for(;s--;){const o=e[s],a=t[s];if(a){for(const u in o)u in a||(i[u]=1);for(const u in a)r[u]||(n[u]=a[u],r[u]=1);e[s]=a}else for(const u in o)r[u]=1}for(const o in i)o in n||(n[o]=void 0);return n}function ar(e){return typeof e=="object"&&e!==null?e:{}}function g2(e,t,n){const i=e.$$.props[t];i!==void 0&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function de(e){e&&e.c()}function ce(e,t,n){const{fragment:i,after_update:r}=e.$$;i&&i.m(t,n),d2(()=>{const s=e.$$.on_mount.map(xi).filter(y5);e.$$.on_destroy?e.$$.on_destroy.push(...s):Xu(s),e.$$.on_mount=[]}),r.forEach(d2)}function fe(e,t){const n=e.$$;n.fragment!==null&&(Pz(n.after_update),Xu(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function zz(e,t){e.$$.dirty[0]===-1&&(Zu.push(e),Lz(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const p=h.length?h[0]:d;return l.ctx&&r(l.ctx[f],l.ctx[f]=p)&&(!l.skip_bound&&l.bound[f]&&l.bound[f](p),c&&zz(e,f)),d}):[],l.update(),c=!0,Xu(l.before_update),l.fragment=i?i(l.ctx):!1,t.target){if(t.hydrate){const f=Mz(t.target);l.fragment&&l.fragment.l(f),f.forEach(L)}else l.fragment&&l.fragment.c();t.intro&&F(e.$$.fragment),ce(e,t.target,t.anchor),A5()}jc(u)}class xe{constructor(){Lt(this,"$$");Lt(this,"$$set")}$destroy(){fe(this,1),this.$destroy=ee}$on(t,n){if(!y5(n))return ee;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(t){this.$$set&&!Sz(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Bz="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Bz);var Uz=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},Br=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,i={},r={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function h(p){return p instanceof s?new s(p.type,h(p.content),p.alias):Array.isArray(p)?p.map(h):p.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(m){var h=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(m.stack)||[])[1];if(h){var p=document.getElementsByTagName("script");for(var g in p)if(p[g].src==h)return p[g]}return null}},isActive:function(h,p,g){for(var m="no-"+p;h;){var y=h.classList;if(y.contains(p))return!0;if(y.contains(m))return!1;h=h.parentElement}return!!g}},languages:{plain:i,plaintext:i,text:i,txt:i,extend:function(h,p){var g=r.util.clone(r.languages[h]);for(var m in p)g[m]=p[m];return g},insertBefore:function(h,p,g,m){var y=(m=m||r.languages)[h],b={};for(var v in y)if(y.hasOwnProperty(v)){if(v==p)for(var x in g)g.hasOwnProperty(x)&&(b[x]=g[x]);g.hasOwnProperty(v)||(b[v]=y[v])}var _=m[h];return m[h]=b,r.languages.DFS(r.languages,function(E,w){w===_&&E!=h&&(this[E]=b)}),b},DFS:function h(p,g,m,y){y=y||{};var b=r.util.objId;for(var v in p)if(p.hasOwnProperty(v)){g.call(p,v,p[v],m||v);var x=p[v],_=r.util.type(x);_!=="Object"||y[b(x)]?_!=="Array"||y[b(x)]||(y[b(x)]=!0,h(x,g,v,y)):(y[b(x)]=!0,h(x,g,null,y))}}},plugins:{},highlightAll:function(h,p){r.highlightAllUnder(document,h,p)},highlightAllUnder:function(h,p,g){var m={callback:g,container:h,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",m),m.elements=Array.prototype.slice.apply(m.container.querySelectorAll(m.selector)),r.hooks.run("before-all-elements-highlight",m);for(var y,b=0;y=m.elements[b++];)r.highlightElement(y,p===!0,m.callback)},highlightElement:function(h,p,g){var m=r.util.getLanguage(h),y=r.languages[m];r.util.setLanguage(h,m);var b=h.parentElement;b&&b.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(b,m);var v={element:h,language:m,grammar:y,code:h.textContent};function x(E){v.highlightedCode=E,r.hooks.run("before-insert",v),v.element.innerHTML=v.highlightedCode,r.hooks.run("after-highlight",v),r.hooks.run("complete",v),g&&g.call(v.element)}if(r.hooks.run("before-sanity-check",v),(b=v.element.parentElement)&&b.nodeName.toLowerCase()==="pre"&&!b.hasAttribute("tabindex")&&b.setAttribute("tabindex","0"),!v.code)return r.hooks.run("complete",v),void(g&&g.call(v.element));if(r.hooks.run("before-highlight",v),v.grammar)if(p&&e.Worker){var _=new Worker(r.filename);_.onmessage=function(E){x(E.data)},_.postMessage(JSON.stringify({language:v.language,code:v.code,immediateClose:!0}))}else x(r.highlight(v.code,v.grammar,v.language));else x(r.util.encode(v.code))},highlight:function(h,p,g){var m={code:h,grammar:p,language:g};return r.hooks.run("before-tokenize",m),m.tokens=r.tokenize(m.code,m.grammar),r.hooks.run("after-tokenize",m),s.stringify(r.util.encode(m.tokens),m.language)},tokenize:function(h,p){var g=p.rest;if(g){for(var m in g)p[m]=g[m];delete p.rest}var y=new a;return u(y,y.head,h),function b(v,x,_,E,w,C){for(var k in _)if(_.hasOwnProperty(k)&&_[k]){var S=_[k];S=Array.isArray(S)?S:[S];for(var $=0;$=C.reach);ie+=z.value.length,z=z.next){var be=z.value;if(x.length>v.length)return;if(!(be instanceof s)){var he,Te=1;if(A){if(!(he=o(G,ie,v,D))||he.index>=v.length)break;var or=he.index,ct=he.index+he[0].length,Fe=ie;for(Fe+=z.value.length;Fe<=or;)z=z.next,Fe+=z.value.length;if(Fe-=z.value.length,ie=Fe,z.value instanceof s)continue;for(var Ot=z;Ot!==x.tail&&(FeC.reach&&(C.reach=Ie);var K=z.prev;le&&(K=u(x,K,le),ie+=le.length),l(x,K,Te);var Kt=new s(k,R?r.tokenize(Ii,R):Ii,T,Ii);if(z=u(x,K,Kt),Re&&u(x,z,Re),1C.reach&&(C.reach=Xe.reach)}}}}}}(h,y,p,y.head,0),function(b){for(var v=[],x=b.head.next;x!==b.tail;)v.push(x.value),x=x.next;return v}(y)},hooks:{all:{},add:function(h,p){var g=r.hooks.all;g[h]=g[h]||[],g[h].push(p)},run:function(h,p){var g=r.hooks.all[h];if(g&&g.length)for(var m,y=0;m=g[y++];)m(p)}},Token:s};function s(h,p,g,m){this.type=h,this.content=p,this.alias=g,this.length=0|(m||"").length}function o(h,p,g,m){h.lastIndex=p;var y=h.exec(g);if(y&&m&&y[1]){var b=y[1].length;y.index+=b,y[0]=y[0].slice(b)}return y}function a(){var h={value:null,prev:null,next:null},p={value:null,prev:h,next:null};h.next=p,this.head=h,this.tail=p,this.length=0}function u(h,p,g){var m=p.next,y={value:g,prev:p,next:m};return p.next=y,m.prev=y,h.length++,y}function l(h,p,g){for(var m=p.next,y=0;y"+y.content+""},!e.document)return e.addEventListener&&(r.disableWorkerMessageHandler||e.addEventListener("message",function(h){var p=JSON.parse(h.data),g=p.language,m=p.code,y=p.immediateClose;e.postMessage(r.highlight(m,r.languages[g],g)),y&&e.close()},!1)),r;var c=r.util.currentScript();function f(){r.manual||r.highlightAll()}if(c&&(r.filename=c.src,c.hasAttribute("data-manual")&&(r.manual=!0)),!r.manual){var d=document.readyState;d==="loading"||d==="interactive"&&c&&c.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return r}(Uz);typeof module<"u"&&module.exports&&(module.exports=Br),typeof global<"u"&&(global.Prism=Br),Br.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Br.languages.log={string:{pattern:/"(?:[^"\\\r\n]|\\.)*"|'(?![st] | \w)(?:[^'\\\r\n]|\\.)*'/,greedy:!0},exception:{pattern:/(^|[^\w.])[a-z][\w.]*(?:Error|Exception):.*(?:(?:\r\n?|\n)[ \t]*(?:at[ \t].+|\.{3}.*|Caused by:.*))+(?:(?:\r\n?|\n)[ \t]*\.\.\. .*)?/,lookbehind:!0,greedy:!0,alias:["javastacktrace","language-javastacktrace"],inside:Br.languages.javastacktrace||{keyword:/\bat\b/,function:/[a-z_][\w$]*(?=\()/,punctuation:/[.:()]/}},level:[{pattern:/\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE)\b/,alias:["error","important"]},{pattern:/\b(?:WARN|WARNING|WRN)\b/,alias:["warning","important"]},{pattern:/\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/,alias:["info","keyword"]},{pattern:/\b(?:DBG|DEBUG|FINE)\b/,alias:["debug","keyword"]},{pattern:/\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/,alias:["trace","comment"]}],property:{pattern:/((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im,lookbehind:!0},separator:{pattern:/(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m,lookbehind:!0,alias:"comment"},url:/\b(?:file|ftp|https?):\/\/[^\s|,;'"]*[^\s|,;'">.]/,email:{pattern:/(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/,lookbehind:!0,alias:"url"},"ip-address":{pattern:/\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/,alias:"constant"},"mac-address":{pattern:/\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i,alias:"constant"},domain:{pattern:/(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/,lookbehind:!0,alias:"constant"},uuid:{pattern:/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,alias:"constant"},hash:{pattern:/\b(?:[a-f0-9]{32}){1,2}\b/i,alias:"constant"},"file-path":{pattern:/\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i,lookbehind:!0,greedy:!0,alias:"string"},date:{pattern:RegExp("\\b\\d{4}[-/]\\d{2}[-/]\\d{2}(?:T(?=\\d{1,2}:)|(?=\\s\\d{1,2}:))|\\b\\d{1,4}[-/ ](?:\\d{1,2}|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)[-/ ]\\d{2,4}T?\\b|\\b(?:(?:Fri|Mon|Sat|Sun|Thu|Tue|Wed)(?:\\s{1,2}(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep))?|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)\\s{1,2}\\d{1,2}\\b","i"),alias:"number"},time:{pattern:/\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/,alias:"number"},boolean:/\b(?:false|null|true)\b/i,number:{pattern:/(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i,lookbehind:!0},operator:/[;:?<=>~/@!$%&+\-|^(){}*#]/,punctuation:/[\[\].,]/},Br.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Br.languages.python["string-interpolation"].inside.interpolation.inside.rest=Br.languages.python,Br.languages.py=Br.languages.python;const el=[];function $5(e,t=ee){let n;const i=new Set;function r(a){if(ye(e,a)&&(e=a,n)){const u=!el.length;for(const l of i)l[1](),el.push(l,e);if(u){for(let l=0;l{i.delete(l),i.size===0&&n&&(n(),n=null)}}return{set:r,update:s,subscribe:o}}const wa=$5(void 0);window.metaflow_card_update=e=>(wa==null||wa.update(t=>{const n={...t};return Object.values(e).forEach(i=>(n==null?void 0:n.components)&&S5(n.components,i)),n}),!0);const jz=(e,t)=>{e.data&&(e.data=JSON.parse(JSON.stringify(t.data))),JSON.stringify(t.spec)===JSON.stringify(e.spec)||(e.spec=JSON.parse(JSON.stringify(t.spec)))},S5=(e,t)=>{const n=e.findIndex(i=>t.id===(i==null?void 0:i.id));n>-1?e[n].type=="vegaChart"?jz(e[n],t):Object.assign(e[n],t):e.forEach(i=>{var r;(i.type==="section"||i.type==="page")&&((r=i==null?void 0:i.contents)!=null&&r.length)&&S5(i.contents,t)})},qz=e=>{try{const t=JSON.parse(atob(window.__MF_DATA__[e]));wa.set(t)}catch{fetch("/card-example.json").then(n=>n.json()).then(n=>{wa.set(n)}).catch(console.error)}},Hc=$5(void 0),F5=e=>{const t={};if(!e)return t;function n(i,r=[]){var s;if(i.type==="page"){const o=[];t[i.title]=o,(s=i==null?void 0:i.contents)==null||s.forEach(a=>n(a,o))}i.type==="section"&&i.title&&r.push(i.title)}return e==null||e.forEach(i=>n(i)),t},mo=(e,t)=>e/16,Wz=e=>{const t=e.split("/");return{flowname:t[0],runid:t[1],stepname:t==null?void 0:t[2],taskid:t==null?void 0:t[3]}},Hz=(e,t)=>{var n;if(!(!e||!t))return(n=Wz(e))==null?void 0:n[t]},Gz=e=>e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth;function Vz(e){let t,n,i,r,s,o,a,u;return{c(){t=Pi("svg"),n=Pi("title"),i=Be("metaflow_logo_horizontal"),r=Pi("g"),s=Pi("g"),o=Pi("g"),a=Pi("path"),u=Pi("path"),M(a,"d","M223.990273,66.33 C223.515273,61.851 222.686273,57.512 221.505273,53.33 C220.325273,49.148 218.795273,45.122 216.916273,41.271 C212.845273,32.921 207.254273,25.587 200.268273,19.422 C199.270273,18.541 198.243273,17.684 197.189273,16.851 C191.255273,12.166 184.481273,8.355 177.253273,5.55 C174.156273,4.347 170.975273,3.33 167.741273,2.508 C161.273273,0.863 154.593273,0 147.943273,0 C141.755273,0 135.332273,0.576 128.687273,1.722 C127.025273,2.01 125.350273,2.332 123.661273,2.69 C120.283273,3.406 116.851273,4.265 113.365273,5.267 C104.650273,7.769 95.6022727,11.161 86.2442727,15.433 C78.7592727,18.851 71.0762727,22.832 63.2072727,27.373 C47.9762727,36.162 35.7372727,44.969 29.3592727,49.791 C29.0692727,50.01 28.7922727,50.221 28.5262727,50.423 C26.1382727,52.244 24.7522727,53.367 24.5662727,53.519 L0.549272727,73.065 C0.191272727,73.356 0.00727272727,73.773 0,74.194 C-0.00372727273,74.403 0.0362727273,74.614 0.120272727,74.811 C0.205272727,75.008 0.334272727,75.189 0.508272727,75.341 L11.7612727,85.195 C12.1692727,85.552 12.7252727,85.651 13.2162727,85.487 C13.3792727,85.432 13.5362727,85.348 13.6762727,85.234 L35.8492727,67.382 C36.0422727,67.224 37.6152727,65.949 40.3252727,63.903 C44.1192727,61.036 50.1422727,56.656 57.7292727,51.711 C62.0642727,48.884 66.9102727,45.873 72.1412727,42.854 C100.864273,26.278 126.367273,17.874 147.943273,17.874 C148.366273,17.874 148.790273,17.892 149.213273,17.902 C149.655273,17.911 150.096273,17.911 150.538273,17.93 C153.769273,18.068 156.995273,18.463 160.170273,19.097 C164.931273,20.049 169.577273,21.542 173.953273,23.524 C178.328273,25.505 182.433273,27.975 186.112273,30.88 C186.771273,31.4 187.406273,31.94 188.035273,32.485 C188.913273,33.245 189.771273,34.023 190.591273,34.83 C191.998273,36.217 193.317273,37.673 194.548273,39.195 C196.395273,41.479 198.042273,43.912 199.480273,46.485 C199.960273,47.342 200.417273,48.216 200.850273,49.105 C201.112273,49.642 201.343273,50.196 201.587273,50.743 C202.231273,52.185 202.834273,53.649 203.354273,55.158 C203.712273,56.198 204.041273,57.255 204.340273,58.326 C205.836273,63.683 206.590273,69.417 206.590273,75.469 C206.590273,81.221 205.892273,86.677 204.541273,91.804 C203.617273,95.308 202.397273,98.662 200.850273,101.833 C200.417273,102.722 199.960273,103.595 199.480273,104.453 C197.562273,107.884 195.275273,111.066 192.636273,113.976 C190.657273,116.159 188.480273,118.189 186.113273,120.058 C184.553273,121.29 182.909273,122.432 181.208273,123.503 C180.313273,124.067 179.400273,124.609 178.470273,125.126 C177.462273,125.688 176.442273,126.232 175.398273,126.737 C166.961273,130.823 157.423273,133.064 147.943273,133.064 C126.367273,133.064 100.864273,124.659 72.1412727,108.084 C70.5382727,107.159 68.4382727,105.886 66.3072727,104.575 C65.0292727,103.788 63.7402727,102.986 62.5412727,102.237 C59.3442727,100.238 56.7882727,98.61 56.7882727,98.61 C61.8362727,93.901 69.3232727,87.465 78.6472727,81.047 C80.0092727,80.11 81.4192727,79.174 82.8572727,78.243 C84.1052727,77.436 85.3712727,76.63 86.6732727,75.835 C88.2042727,74.9 89.7802727,73.981 91.3822727,73.074 C93.0482727,72.131 94.7512727,71.207 96.4902727,70.307 C111.473273,62.55 129.094273,56.602 147.943273,56.602 C151.750273,56.602 157.745273,57.825 162.114273,61.276 C162.300273,61.422 162.489273,61.578 162.677273,61.74 C163.337273,62.305 164.006273,62.966 164.634273,63.78 C164.957273,64.198 165.269273,64.657 165.564273,65.162 C166.006273,65.92 166.409273,66.782 166.750273,67.775 C166.891273,68.185 167.016273,68.627 167.134273,69.083 C167.586273,70.833 167.863273,72.924 167.863273,75.469 C167.863273,78.552 167.460273,80.974 166.824273,82.92 C166.578273,83.674 166.300273,84.363 165.992273,84.983 C165.855273,85.259 165.711273,85.524 165.564273,85.776 C165.376273,86.099 165.178273,86.396 164.977273,86.682 C164.631273,87.175 164.269273,87.618 163.900273,88.018 C163.730273,88.202 163.559273,88.379 163.387273,88.546 C162.962273,88.96 162.534273,89.331 162.114273,89.662 C157.745273,93.112 151.750273,94.337 147.943273,94.337 C144.485273,94.337 140.682273,93.926 136.589273,93.121 C133.860273,92.584 131.003273,91.871 128.033273,90.987 C123.579273,89.662 118.873273,87.952 113.970273,85.872 C113.768273,85.786 113.552273,85.747 113.336273,85.753 C113.122273,85.76 112.908273,85.813 112.713273,85.912 C106.990273,88.816 101.641273,91.995 96.7462727,95.223 C96.6232727,95.304 96.5182727,95.397 96.4302727,95.5 C95.8122727,96.22 96.0172727,97.397 96.9492727,97.822 L102.445273,100.328 C104.606273,101.314 106.737273,102.238 108.835273,103.102 C110.934273,103.966 113.001273,104.77 115.035273,105.511 C118.086273,106.624 121.064273,107.599 123.965273,108.436 C127.834273,109.551 131.567273,110.421 135.157273,111.043 C139.646273,111.82 143.912273,112.211 147.943273,112.211 C148.367273,112.211 148.923273,112.201 149.591273,112.169 C149.925273,112.153 150.287273,112.131 150.674273,112.102 C155.712273,111.724 165.055273,110.114 173.190273,103.691 C173.547273,103.41 173.869273,103.105 174.210273,102.813 C175.324273,101.86 176.381273,100.866 177.333273,99.8 C177.470273,99.648 177.590273,99.485 177.724273,99.331 C181.300273,95.167 183.699273,90.185 184.875273,84.406 C185.444273,81.609 185.737273,78.631 185.737273,75.469 C185.737273,63.315 181.516273,53.82 173.190273,47.247 C167.050273,42.399 160.228273,40.299 155.083273,39.395 C153.892273,39.186 152.790273,39.037 151.809273,38.938 C150.116273,38.766 148.774273,38.727 147.943273,38.727 C133.456273,38.727 118.519273,41.679 103.545273,47.5 C99.1222727,49.22 94.6912727,51.191 90.2702727,53.403 C88.7972727,54.141 87.3242727,54.905 85.8542727,55.696 C83.5092727,56.957 81.1722727,58.303 78.8382727,59.697 C77.3922727,60.562 75.9492727,61.451 74.5082727,62.366 C72.4422727,63.678 70.3802727,65.023 68.3302727,66.437 C63.8372727,69.535 59.7422727,72.63 56.0902727,75.567 C54.8732727,76.547 53.7052727,77.508 52.5882727,78.446 C48.1222727,82.2 44.4752727,85.581 41.7602727,88.226 C38.3032727,91.593 36.3592727,93.766 36.1632727,93.986 L35.8282727,94.362 L32.0332727,98.61 L30.6432727,100.164 C30.4962727,100.329 30.3932727,100.517 30.3312727,100.715 C30.1482727,101.307 30.3472727,101.981 30.8882727,102.368 L37.2812727,106.938 L37.4862727,107.083 L37.6922727,107.228 C39.8732727,108.766 42.0702727,110.277 44.2792727,111.758 C45.8422727,112.807 47.4102727,113.84 48.9832727,114.858 C51.5302727,116.508 54.0902727,118.103 56.6542727,119.665 C57.8412727,120.388 59.0282727,121.101 60.2162727,121.804 C61.2142727,122.394 62.2102727,122.989 63.2072727,123.565 C76.9772727,131.512 90.1802727,137.744 102.748273,142.242 C104.544273,142.884 106.326273,143.491 108.096273,144.063 C111.635273,145.206 115.121273,146.207 118.553273,147.067 C121.986273,147.925 125.364273,148.642 128.687273,149.215 C135.332273,150.362 141.755273,150.938 147.943273,150.938 C154.593273,150.938 161.273273,150.074 167.741273,148.43 C174.209273,146.786 180.465273,144.361 186.265273,141.238 C190.133273,139.156 193.798273,136.764 197.189273,134.087 C200.352273,131.589 203.264273,128.872 205.911273,125.949 C207.677273,124 209.325273,121.96 210.854273,119.831 C211.618273,118.766 212.353273,117.68 213.057273,116.571 C214.466273,114.356 215.753273,112.053 216.916273,109.667 C220.701273,101.906 223.073273,93.439 224.008273,84.406 C224.310273,81.485 224.465273,78.505 224.465273,75.469 C224.465273,72.364 224.306273,69.316 223.990273,66.33"),M(a,"id","Fill-1"),M(a,"fill","#146EE6"),M(u,"d","M758.389273,75.346 C752.632273,111.56 742.681273,122.23 712.102273,122.23 C710.847273,122.23 709.640273,122.207 708.464273,122.17 C708.321273,122.191 708.191273,122.23 708.028273,122.23 L637.994273,122.23 C636.795273,122.23 636.315273,121.632 636.435273,120.311 L650.585273,31.22 C650.704273,30.016 651.424273,29.417 652.623273,29.417 L667.852273,29.417 C669.050273,29.417 669.530273,30.016 669.410273,31.22 L657.659273,105.802 L714.249273,105.802 L714.249273,105.787 C714.410273,105.794 714.568273,105.802 714.741273,105.802 C718.878273,105.802 722.250273,105.351 725.040273,104.313 C726.434273,103.794 727.684273,103.129 728.810273,102.298 C729.373273,101.884 729.905273,101.426 730.410273,100.927 C734.951273,96.431 737.231273,88.43 739.322273,75.346 C739.328273,75.312 739.331273,75.282 739.337273,75.25 C739.642273,73.311 739.896273,71.474 740.130273,69.679 C740.203273,69.116 740.272273,68.557 740.338273,68.008 C740.412273,67.392 740.461273,66.821 740.525273,66.222 C742.136273,49.927 738.622273,44.525 724.454273,44.525 C723.419273,44.525 722.433273,44.554 721.490273,44.613 C708.297273,45.444 703.831273,52.303 700.461273,71.126 C700.220273,72.472 699.984273,73.877 699.752273,75.346 C699.483273,77.027 699.255273,78.6 699.052273,80.115 C698.993273,80.545 698.948273,80.946 698.895273,81.361 C698.757273,82.465 698.638273,83.528 698.540273,84.544 C698.502273,84.943 698.466273,85.334 698.434273,85.72 C698.344273,86.815 698.281273,87.856 698.246273,88.847 C698.238273,89.049 698.224273,89.269 698.219273,89.469 C698.161273,91.88 698.289273,93.972 698.621273,95.782 C698.649273,95.941 698.686273,96.089 698.717273,96.246 C698.874273,96.992 699.067273,97.689 699.301273,98.337 C699.346273,98.464 699.390273,98.594 699.439273,98.718 C700.039273,100.231 700.864273,101.478 701.963273,102.469 C702.263273,102.738 702.586273,102.987 702.925273,103.22 L679.436273,103.22 C679.393273,102.969 679.343273,102.727 679.305273,102.471 L679.304273,102.471 C679.304273,102.467 679.304273,102.462 679.303273,102.459 C679.259273,102.17 679.236273,101.854 679.198273,101.558 C679.083273,100.634 678.995273,99.671 678.934273,98.674 C678.908273,98.258 678.879273,97.845 678.862273,97.419 C678.816273,96.174 678.804273,94.876 678.832273,93.518 C678.840273,93.114 678.861273,92.69 678.876273,92.276 C678.920273,91.042 678.991273,89.765 679.092273,88.441 C679.117273,88.109 679.134273,87.79 679.162273,87.452 C679.299273,85.836 679.483273,84.137 679.698273,82.382 C679.750273,81.957 679.807273,81.518 679.863273,81.084 C680.104273,79.238 680.369273,77.344 680.687273,75.346 C681.046273,73.067 681.423273,70.889 681.819273,68.808 C687.040273,41.397 695.809273,30.748 717.267273,28.554 C720.250273,28.25 723.472273,28.103 726.971273,28.103 C726.972273,28.103 726.972273,28.103 726.972273,28.103 C747.994273,28.103 757.680273,33.202 759.811273,48.236 C760.779273,55.067 760.187273,63.953 758.389273,75.346 Z M894.023273,31.336 L866.923273,108.56 C863.472273,118.182 861.113273,121.41 854.499273,122.41 C852.379273,122.733 849.831273,122.828 846.659273,122.828 C831.670273,122.828 830.350273,121.267 829.392273,108.56 L825.794273,63.232 L825.794273,63.231 L807.928273,108.56 C804.255273,117.613 802.201273,120.996 795.961273,122.202 C793.442273,122.687 790.260273,122.829 785.985273,122.829 C772.914273,122.829 770.756273,121.267 770.396273,108.56 L767.638273,31.337 C767.638273,29.899 768.238273,29.417 769.557273,29.417 L785.385273,29.417 C786.464273,29.417 786.704273,29.899 786.824273,31.337 L788.895273,100.572 L788.895273,100.571 C789.054273,103.091 789.563273,103.641 791.021273,103.641 C792.939273,103.641 793.419273,103.042 794.618273,100.043 L820.758273,34.576 C821.358273,33.132 822.437273,32.657 823.516273,32.657 L837.665273,32.657 C838.519273,32.657 839.279273,32.977 839.626273,33.817 C839.718273,34.038 839.799273,34.274 839.824273,34.576 L845.220273,100.043 C845.460273,103.042 845.819273,103.641 847.738273,103.641 C849.297273,103.641 849.896273,103.042 850.976273,100.043 L874.838273,31.336 C875.317273,29.898 875.677273,29.417 876.756273,29.417 L892.584273,29.417 C893.903273,29.417 894.383273,29.898 894.023273,31.336 Z M362.708273,31.219 L357.192273,120.311 C357.192273,121.632 356.353273,122.23 355.154273,122.23 L339.926273,122.23 C338.726273,122.23 338.366273,121.632 338.366273,120.311 L342.324273,62.756 L311.986273,117.551 C311.386273,118.749 310.428273,119.348 309.229273,119.348 L297.837273,119.348 C296.758273,119.348 296.038273,118.749 295.560273,117.551 L282.851273,62.767 L282.848273,62.755 L268.339273,120.31 C268.212273,121.009 267.974273,121.492 267.612273,121.807 C267.288273,122.085 266.865273,122.23 266.301273,122.23 L251.073273,122.23 C249.874273,122.23 249.273273,121.632 249.514273,120.31 L272.296273,31.336 C272.537273,30.138 272.897273,29.417 274.095273,29.417 L288.605273,29.417 C291.236273,29.417 292.726273,29.895 293.682273,31.379 C294.120273,32.059 294.457273,32.928 294.720273,34.095 L307.790273,92.489 L339.326273,34.095 C341.485273,30.256 343.043273,29.299 346.880273,29.299 L361.389273,29.299 C362.376273,29.299 362.682273,30.684 362.682273,30.684 C362.682273,30.684 362.708273,31.029 362.708273,31.219 Z M501.706273,31.219 L499.667273,44.049 C499.547273,45.246 498.708273,45.845 497.509273,45.845 L472.448273,45.845 L460.696273,120.31 C460.457273,121.632 459.738273,122.23 458.538273,122.23 L443.309273,122.23 C442.111273,122.23 441.631273,121.632 441.870273,120.31 L453.622273,45.845 L394.820273,45.845 L391.224273,68.507 L391.224273,68.508 L430.555273,68.508 C431.754273,68.508 432.353273,69.106 432.234273,70.31 L430.196273,82.542 C430.076273,83.738 429.236273,84.338 428.038273,84.338 L388.706273,84.338 L385.349273,105.801 L428.397273,105.801 C429.596273,105.801 430.076273,106.4 429.955273,107.597 L427.797273,120.428 C427.676273,121.632 426.958273,122.23 425.759273,122.23 L365.683273,122.23 C364.484273,122.23 364.004273,121.632 364.124273,120.31 L378.273273,31.219 C378.393273,30.015 379.112273,29.417 380.313273,29.417 L500.147273,29.417 C501.346273,29.417 501.826273,30.015 501.706273,31.219 Z M629.471273,70.426 L627.433273,82.659 C627.313273,83.856 626.473273,84.454 625.275273,84.454 L588.223273,84.454 L582.466273,120.311 C582.347273,121.632 581.627273,122.23 580.428273,122.23 L565.200273,122.23 C564.001273,122.23 563.522273,121.632 563.640273,120.311 L577.790273,31.219 C577.910273,30.016 578.629273,29.417 579.828273,29.417 L643.004273,29.417 C644.202273,29.417 644.802273,30.016 644.682273,31.219 L642.644273,44.05 C642.403273,45.247 641.685273,45.846 640.486273,45.846 L594.337273,45.846 L590.741273,68.631 L627.793273,68.631 C628.991273,68.631 629.592273,69.23 629.471273,70.426 Z M388.706273,84.338 L388.712273,84.338 L388.309273,86.876 L388.706273,84.338 Z M510.726273,79.783 L524.396273,48.006 C525.036273,46.466 525.443273,45.589 525.990273,45.096 C526.465273,44.667 527.044273,44.525 527.993273,44.525 C530.391273,44.525 530.391273,45.124 530.751273,48.006 L534.348273,79.783 L510.726273,79.783 Z M542.334273,29.886 C539.756273,28.905 536.043273,28.702 530.511273,28.702 C516.601273,28.702 513.963273,30.016 508.208273,43.087 L474.633273,120.311 C474.154273,121.749 474.513273,122.23 475.832273,122.23 L491.060273,122.23 C492.259273,122.23 492.500273,121.749 493.099273,120.311 L504.011273,95.372 L536.026273,95.372 L539.024273,120.311 C539.144273,121.749 539.144273,122.23 540.344273,122.23 L555.572273,122.23 C556.891273,122.23 557.490273,121.749 557.490273,120.311 L548.617273,43.087 C547.658273,35.042 546.460273,31.458 542.334273,29.886 L542.334273,29.886 Z"),M(u,"id","Fill-2"),M(u,"fill","#333333"),M(o,"id","metaflow_logo_horizontal"),M(o,"transform","translate(92.930727, 93.190000)"),M(s,"id","Metaflow_Logo_Horizontal_TwoColor_Dark_RGB"),M(s,"transform","translate(-92.000000, -93.000000)"),M(r,"id","Page-1"),M(r,"stroke","none"),M(r,"stroke-width","1"),M(r,"fill","none"),M(r,"fill-rule","evenodd"),M(t,"xmlns","http://www.w3.org/2000/svg"),M(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),M(t,"width","896px"),M(t,"height","152px"),M(t,"viewBox","0 0 896 152"),M(t,"version","1.1")},m(l,c){I(l,t,c),V(t,n),V(n,i),V(t,r),V(r,s),V(s,o),V(o,a),V(o,u)},d(l){l&&L(t)}}}function Yz(e){let t,n,i;return{c(){t=Pi("svg"),n=Pi("path"),i=Pi("path"),M(n,"fill-rule","evenodd"),M(n,"clip-rule","evenodd"),M(n,"d","M223.991 66.33C223.516 61.851 222.687 57.512 221.506 53.33C220.326 49.148 218.796 45.122 216.917 41.271C212.846 32.921 207.255 25.587 200.269 19.422C199.271 18.541 198.244 17.684 197.19 16.851C191.256 12.166 184.482 8.355 177.254 5.55C174.157 4.347 170.976 3.33 167.742 2.508C161.274 0.863 154.594 0 147.944 0C141.756 0 135.333 0.576 128.688 1.722C127.026 2.01 125.351 2.332 123.662 2.69C120.284 3.406 116.852 4.265 113.366 5.267C104.651 7.769 95.6025 11.161 86.2445 15.433C78.7595 18.851 71.0765 22.832 63.2075 27.373C47.9765 36.162 35.7375 44.969 29.3595 49.791C29.0695 50.01 28.7925 50.221 28.5265 50.423C26.1385 52.244 24.7525 53.367 24.5665 53.519L0.549511 73.065C0.191511 73.356 0.00751099 73.773 0.000238261 74.194C-0.00348901 74.403 0.036511 74.614 0.120511 74.811C0.205511 75.008 0.334511 75.189 0.508511 75.341L11.7615 85.195C12.1695 85.552 12.7255 85.651 13.2165 85.487C13.3795 85.432 13.5365 85.348 13.6765 85.234L35.8495 67.382C36.0425 67.224 37.6155 65.949 40.3255 63.903C44.1195 61.036 50.1425 56.656 57.7295 51.711C62.0645 48.884 66.9105 45.873 72.1415 42.854C100.865 26.278 126.368 17.874 147.944 17.874C148.367 17.874 148.791 17.892 149.214 17.902C149.656 17.911 150.097 17.911 150.539 17.93C153.77 18.068 156.996 18.463 160.171 19.097C164.932 20.049 169.578 21.542 173.954 23.524C178.329 25.505 182.434 27.975 186.113 30.88C186.772 31.4 187.407 31.94 188.036 32.485C188.914 33.245 189.772 34.023 190.592 34.83C191.999 36.217 193.318 37.673 194.549 39.195C196.396 41.479 198.043 43.912 199.481 46.485C199.961 47.342 200.418 48.216 200.851 49.105C201.113 49.642 201.344 50.196 201.588 50.743C202.232 52.185 202.835 53.649 203.355 55.158C203.713 56.198 204.042 57.255 204.341 58.326C205.837 63.683 206.591 69.417 206.591 75.469C206.591 81.221 205.893 86.677 204.542 91.804C203.618 95.308 202.398 98.662 200.851 101.833C200.418 102.722 199.961 103.595 199.481 104.453C197.563 107.884 195.276 111.066 192.637 113.976C190.658 116.159 188.481 118.189 186.114 120.058C184.554 121.29 182.91 122.432 181.209 123.503C180.314 124.067 179.401 124.609 178.471 125.126C177.463 125.688 176.443 126.232 175.399 126.737C166.962 130.823 157.424 133.064 147.944 133.064C126.368 133.064 100.865 124.659 72.1415 108.084C70.5385 107.159 68.4385 105.886 66.3075 104.575C65.0295 103.788 63.7405 102.986 62.5415 102.237C59.3445 100.238 56.7885 98.61 56.7885 98.61C61.8365 93.901 69.3235 87.465 78.6475 81.047C80.0095 80.11 81.4195 79.174 82.8575 78.243C84.1055 77.436 85.3715 76.63 86.6735 75.835C88.2045 74.9 89.7805 73.981 91.3825 73.074C93.0485 72.131 94.7515 71.207 96.4905 70.307C111.474 62.55 129.095 56.602 147.944 56.602C151.751 56.602 157.746 57.825 162.115 61.276C162.301 61.422 162.49 61.578 162.678 61.74C163.338 62.305 164.007 62.966 164.635 63.78C164.958 64.198 165.27 64.657 165.565 65.162C166.007 65.92 166.41 66.782 166.751 67.775C166.892 68.185 167.017 68.627 167.135 69.083C167.587 70.833 167.864 72.924 167.864 75.469C167.864 78.552 167.461 80.974 166.825 82.92C166.579 83.674 166.301 84.363 165.993 84.983C165.856 85.259 165.712 85.524 165.565 85.776C165.377 86.099 165.179 86.396 164.978 86.682C164.632 87.175 164.27 87.618 163.901 88.018C163.731 88.202 163.56 88.379 163.388 88.546C162.963 88.96 162.535 89.331 162.115 89.662C157.746 93.112 151.751 94.337 147.944 94.337C144.486 94.337 140.683 93.926 136.59 93.121C133.861 92.584 131.004 91.871 128.034 90.987C123.58 89.662 118.874 87.952 113.971 85.872C113.769 85.786 113.553 85.747 113.337 85.753C113.123 85.76 112.909 85.813 112.714 85.912C106.991 88.816 101.642 91.995 96.7465 95.223C96.6235 95.304 96.5185 95.397 96.4305 95.5C95.8125 96.22 96.0175 97.397 96.9495 97.822L102.446 100.328C104.607 101.314 106.738 102.238 108.836 103.102C110.935 103.966 113.002 104.77 115.036 105.511C118.087 106.624 121.065 107.599 123.966 108.436C127.835 109.551 131.568 110.421 135.158 111.043C139.647 111.82 143.913 112.211 147.944 112.211C148.368 112.211 148.924 112.201 149.592 112.169C149.926 112.153 150.288 112.131 150.675 112.102C155.713 111.724 165.056 110.114 173.191 103.691C173.548 103.41 173.87 103.105 174.211 102.813C175.325 101.86 176.382 100.866 177.334 99.8C177.471 99.648 177.591 99.485 177.725 99.331C181.301 95.167 183.7 90.185 184.876 84.406C185.445 81.609 185.738 78.631 185.738 75.469C185.738 63.315 181.517 53.82 173.191 47.247C167.051 42.399 160.229 40.299 155.084 39.395C153.893 39.186 152.791 39.037 151.81 38.938C150.117 38.766 148.775 38.727 147.944 38.727C133.457 38.727 118.52 41.679 103.546 47.5C99.1225 49.22 94.6915 51.191 90.2705 53.403C88.7975 54.141 87.3245 54.905 85.8545 55.696C83.5095 56.957 81.1725 58.303 78.8385 59.697C77.3925 60.562 75.9495 61.451 74.5085 62.366C72.4425 63.678 70.3805 65.023 68.3305 66.437C63.8375 69.535 59.7425 72.63 56.0905 75.567C54.8735 76.547 53.7055 77.508 52.5885 78.446C48.1225 82.2 44.4755 85.581 41.7605 88.226C38.3035 91.593 36.3595 93.766 36.1635 93.986L35.8285 94.362L32.0335 98.61L30.6435 100.164C30.4965 100.329 30.3935 100.517 30.3315 100.715C30.1485 101.307 30.3475 101.981 30.8885 102.368L37.2815 106.938L37.4865 107.083L37.6925 107.228C39.8735 108.766 42.0705 110.277 44.2795 111.758C45.8425 112.807 47.4105 113.84 48.9835 114.858C51.5305 116.508 54.0905 118.103 56.6545 119.665C57.8415 120.388 59.0285 121.101 60.2165 121.804C61.2145 122.394 62.2105 122.989 63.2075 123.565C76.9775 131.512 90.1805 137.744 102.749 142.242C104.545 142.884 106.327 143.491 108.097 144.063C111.636 145.206 115.122 146.207 118.554 147.067C121.987 147.925 125.365 148.642 128.688 149.215C135.333 150.362 141.756 150.938 147.944 150.938C154.594 150.938 161.274 150.074 167.742 148.43C174.21 146.786 180.466 144.361 186.266 141.238C190.134 139.156 193.799 136.764 197.19 134.087C200.353 131.589 203.265 128.872 205.912 125.949C207.678 124 209.326 121.96 210.855 119.831C211.619 118.766 212.354 117.68 213.058 116.571C214.467 114.356 215.754 112.053 216.917 109.667C220.702 101.906 223.074 93.439 224.009 84.406C224.311 81.485 224.466 78.505 224.466 75.469C224.466 72.364 224.307 69.316 223.991 66.33Z"),M(n,"fill","#146EE6"),M(i,"fill-rule","evenodd"),M(i,"clip-rule","evenodd"),M(i,"d","M758.39 75.346C752.633 111.56 742.682 122.23 712.103 122.23C710.848 122.23 709.641 122.207 708.465 122.17C708.322 122.191 708.192 122.23 708.029 122.23H637.995C636.796 122.23 636.316 121.632 636.436 120.311L650.586 31.22C650.705 30.016 651.425 29.417 652.624 29.417H667.853C669.051 29.417 669.531 30.016 669.411 31.22L657.66 105.802H714.25V105.787C714.411 105.794 714.569 105.802 714.742 105.802C718.879 105.802 722.251 105.351 725.041 104.313C726.435 103.794 727.685 103.129 728.811 102.298C729.374 101.884 729.906 101.426 730.411 100.927C734.952 96.431 737.232 88.43 739.323 75.346C739.329 75.312 739.332 75.282 739.338 75.25C739.643 73.311 739.896 71.474 740.13 69.679C740.203 69.116 740.273 68.557 740.339 68.008C740.413 67.392 740.462 66.821 740.526 66.222C742.137 49.927 738.623 44.525 724.455 44.525C723.42 44.525 722.434 44.554 721.491 44.613C708.298 45.444 703.831 52.303 700.461 71.126C700.22 72.472 699.985 73.877 699.753 75.346C699.484 77.027 699.255 78.6 699.052 80.115C698.993 80.545 698.949 80.946 698.896 81.361C698.758 82.465 698.639 83.528 698.541 84.544C698.503 84.943 698.467 85.334 698.435 85.72C698.345 86.815 698.282 87.856 698.247 88.847C698.239 89.049 698.225 89.269 698.22 89.469C698.162 91.88 698.29 93.972 698.622 95.782C698.65 95.941 698.687 96.089 698.718 96.246C698.875 96.992 699.068 97.689 699.302 98.337C699.347 98.464 699.391 98.594 699.44 98.718C700.04 100.231 700.865 101.478 701.964 102.469C702.264 102.738 702.587 102.987 702.926 103.22H679.437C679.394 102.969 679.344 102.727 679.306 102.471H679.305C679.305 102.467 679.305 102.462 679.304 102.459C679.26 102.17 679.237 101.854 679.199 101.558C679.084 100.634 678.996 99.671 678.935 98.674C678.909 98.258 678.879 97.845 678.862 97.419C678.816 96.174 678.805 94.876 678.833 93.518C678.841 93.114 678.862 92.69 678.877 92.276C678.921 91.042 678.992 89.765 679.093 88.441C679.118 88.109 679.135 87.79 679.163 87.452C679.3 85.836 679.484 84.137 679.699 82.382C679.751 81.957 679.808 81.518 679.864 81.084C680.105 79.238 680.37 77.344 680.688 75.346C681.046 73.067 681.424 70.889 681.82 68.808C687.041 41.397 695.81 30.748 717.268 28.554C720.251 28.25 723.472 28.103 726.971 28.103C726.972 28.103 726.973 28.103 726.973 28.103C747.995 28.103 757.681 33.202 759.812 48.236C760.78 55.067 760.188 63.953 758.39 75.346ZM894.023 31.336L866.924 108.56C863.473 118.182 861.114 121.41 854.5 122.41C852.38 122.733 849.832 122.828 846.66 122.828C831.671 122.828 830.351 121.267 829.393 108.56L825.794 63.232V63.231L807.929 108.56C804.256 117.613 802.201 120.996 795.961 122.202C793.442 122.687 790.261 122.829 785.986 122.829C772.915 122.829 770.757 121.267 770.397 108.56L767.638 31.337C767.638 29.899 768.238 29.417 769.557 29.417H785.385C786.464 29.417 786.705 29.899 786.825 31.337L788.896 100.572V100.571C789.055 103.091 789.564 103.641 791.022 103.641C792.94 103.641 793.42 103.042 794.619 100.043L820.759 34.576C821.359 33.132 822.438 32.657 823.517 32.657H837.666C838.52 32.657 839.28 32.977 839.627 33.817C839.719 34.038 839.8 34.274 839.825 34.576L845.221 100.043C845.461 103.042 845.82 103.641 847.739 103.641C849.298 103.641 849.897 103.042 850.977 100.043L874.839 31.336C875.318 29.898 875.678 29.417 876.757 29.417H892.585C893.904 29.417 894.383 29.898 894.023 31.336ZM362.709 31.219L357.193 120.311C357.193 121.632 356.354 122.23 355.155 122.23H339.927C338.727 122.23 338.367 121.632 338.367 120.311L342.325 62.756L311.987 117.551C311.387 118.749 310.429 119.348 309.23 119.348H297.838C296.759 119.348 296.039 118.749 295.561 117.551L282.852 62.767L282.849 62.755L268.34 120.31C268.213 121.009 267.975 121.492 267.613 121.807C267.289 122.085 266.866 122.23 266.302 122.23H251.074C249.875 122.23 249.274 121.632 249.515 120.31L272.297 31.336C272.538 30.138 272.898 29.417 274.096 29.417H288.606C291.237 29.417 292.727 29.895 293.683 31.379C294.121 32.059 294.458 32.928 294.721 34.095L307.791 92.489L339.327 34.095C341.486 30.256 343.044 29.299 346.881 29.299H361.39C362.377 29.299 362.683 30.684 362.683 30.684C362.683 30.684 362.709 31.029 362.709 31.219ZM501.707 31.219L499.668 44.049C499.548 45.246 498.709 45.845 497.51 45.845H472.449L460.697 120.31C460.458 121.632 459.739 122.23 458.539 122.23H443.31C442.112 122.23 441.632 121.632 441.871 120.31L453.623 45.845H394.821L391.225 68.507V68.508H430.556C431.755 68.508 432.354 69.106 432.235 70.31L430.197 82.542C430.077 83.738 429.237 84.338 428.039 84.338H388.707L385.35 105.801H428.398C429.597 105.801 430.077 106.4 429.956 107.597L427.798 120.428C427.677 121.632 426.959 122.23 425.76 122.23H365.684C364.485 122.23 364.005 121.632 364.125 120.31L378.274 31.219C378.394 30.015 379.113 29.417 380.314 29.417H500.148C501.347 29.417 501.827 30.015 501.707 31.219ZM629.471 70.426L627.434 82.659C627.314 83.856 626.474 84.454 625.276 84.454H588.224L582.466 120.311C582.347 121.632 581.628 122.23 580.429 122.23H565.201C564.002 122.23 563.523 121.632 563.641 120.311L577.791 31.219C577.911 30.016 578.629 29.417 579.828 29.417H643.005C644.203 29.417 644.802 30.016 644.682 31.219L642.645 44.05C642.404 45.247 641.686 45.846 640.487 45.846H594.338L590.742 68.631H627.794C628.992 68.631 629.592 69.23 629.471 70.426ZM388.707 84.338H388.713L388.31 86.876L388.707 84.338ZM510.727 79.783L524.397 48.006C525.037 46.466 525.444 45.589 525.991 45.096C526.466 44.667 527.045 44.525 527.994 44.525C530.392 44.525 530.392 45.124 530.752 48.006L534.349 79.783H510.727ZM542.335 29.886C539.757 28.905 536.044 28.702 530.512 28.702C516.602 28.702 513.964 30.016 508.209 43.087L474.634 120.311C474.155 121.749 474.514 122.23 475.833 122.23H491.061C492.26 122.23 492.501 121.749 493.1 120.311L504.012 95.372H536.026L539.025 120.311C539.145 121.749 539.145 122.23 540.345 122.23H555.573C556.892 122.23 557.491 121.749 557.491 120.311L548.617 43.087C547.658 35.042 546.461 31.458 542.335 29.886Z"),M(i,"fill","white"),M(t,"width","895"),M(t,"height","151"),M(t,"viewBox","0 0 895 151"),M(t,"fill","none"),M(t,"xmlns","http://www.w3.org/2000/svg")},m(r,s){I(r,t,s),V(t,n),V(t,i)},d(r){r&&L(t)}}}function Xz(e){let t;function n(s,o){return s[0]?Yz:Vz}let i=n(e),r=i(e);return{c(){r.c(),t=Me()},m(s,o){r.m(s,o),I(s,t,o)},p(s,[o]){i!==(i=n(s))&&(r.d(1),r=i(s),r&&(r.c(),r.m(t.parentNode,t)))},i:ee,o:ee,d(s){s&&L(t),r.d(s)}}}function Kz(e,t,n){let{light:i=!1}=t;return e.$$set=r=>{"light"in r&&n(0,i=r.light)},[i]}class Zz extends xe{constructor(t){super(),ve(this,t,Kz,Xz,ye,{light:0})}}function Jz(e){let t,n,i,r,s,o;r=new Zz({});const a=e[1].default,u=mt(a,e,e[0],null);return{c(){t=H("aside"),n=H("div"),i=H("div"),de(r.$$.fragment),s=We(),u&&u.c(),M(i,"class","logoContainer"),M(t,"class","svelte-1okdv0e")},m(l,c){I(l,t,c),V(t,n),V(n,i),ce(r,i,null),V(n,s),u&&u.m(n,null),o=!0},p(l,[c]){u&&u.p&&(!o||c&1)&&bt(u,a,l,l[0],o?yt(a,l[0],c,null):vt(l[0]),null)},i(l){o||(F(r.$$.fragment,l),F(u,l),o=!0)},o(l){N(r.$$.fragment,l),N(u,l),o=!1},d(l){l&&L(t),fe(r),u&&u.d(l)}}}function Qz(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class eB extends xe{constructor(t){super(),ve(this,t,Qz,Jz,ye,{})}}function D5(e){let t,n;return{c(){t=H("td"),n=Be(e[0]),M(t,"class","idCell svelte-pt8vzv"),M(t,"data-component","artifact-row")},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&1&&ft(n,i[0])},d(i){i&&L(t)}}}function tB(e){let t,n,i,r,s=e[1].data+"",o,a,u=e[0]!==null&&D5(e);return{c(){t=H("tr"),u&&u.c(),n=We(),i=H("td"),r=H("code"),o=Be(s),M(r,"class","mono"),M(i,"class","codeCell svelte-pt8vzv"),M(i,"colspan",a=e[0]===null?2:1),M(i,"data-component","artifact-row")},m(l,c){I(l,t,c),u&&u.m(t,null),V(t,n),V(t,i),V(i,r),V(r,o),e[3](r)},p(l,[c]){l[0]!==null?u?u.p(l,c):(u=D5(l),u.c(),u.m(t,n)):u&&(u.d(1),u=null),c&2&&s!==(s=l[1].data+"")&&ft(o,s),c&1&&a!==(a=l[0]===null?2:1)&&M(i,"colspan",a)},i:ee,o:ee,d(l){l&&L(t),u&&u.d(),e[3](null)}}}function nB(e,t,n){let{id:i}=t,{artifact:r}=t,s;function o(){var u;s&&!s.classList.contains("language-python")&&typeof window<"u"&&((u=window==null?void 0:window.Prism)==null||u.highlightElement(s))}function a(u){zi[u?"unshift":"push"](()=>{s=u,n(2,s)})}return e.$$set=u=>{"id"in u&&n(0,i=u.id),"artifact"in u&&n(1,r=u.artifact)},e.$$.update=()=>{e.$$.dirty&4&&s&&o()},[i,r,s,a]}class iB extends xe{constructor(t){super(),ve(this,t,nB,tB,ye,{id:0,artifact:1})}}function T5(e,t,n){const i=e.slice();return i[2]=t[n],i}function M5(e){let t,n;return t=new iB({props:{id:e[2].name,artifact:e[2]}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p:ee,i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function rB(e){let t,n,i,r=Ue(e[0]),s=[];for(let a=0;aN(s[a],1,1,()=>{s[a]=null});return{c(){t=H("div"),n=H("table");for(let a=0;a{if(s.name&&o.name){if(s.name>o.name)return 1;if(s.name{"componentData"in s&&n(1,i=s.componentData)},[r,i]}class N5 extends xe{constructor(t){super(),ve(this,t,sB,rB,ye,{componentData:1})}}function oB(e){let t,n,i;return{c(){t=H("div"),n=We(),i=H("div"),M(t,"class","path topLeft svelte-19jpdwh"),M(i,"class","path bottomRight svelte-19jpdwh")},m(r,s){I(r,t,s),I(r,n,s),I(r,i,s)},d(r){r&&(L(t),L(n),L(i))}}}function aB(e){let t;return{c(){t=H("div"),M(t,"class","path straightLine svelte-19jpdwh")},m(n,i){I(n,t,i)},d(n){n&&L(t)}}}function uB(e){let t;return{c(){t=H("div"),M(t,"class","path loop svelte-19jpdwh")},m(n,i){I(n,t,i)},d(n){n&&L(t)}}}function lB(e){let t;function n(s,o){return s[6]?uB:s[5]?aB:oB}let i=n(e),r=i(e);return{c(){t=H("div"),r.c(),M(t,"class","connectorwrapper svelte-19jpdwh"),_i(t,"top",e[1]+"rem"),_i(t,"left",e[0]+"rem"),_i(t,"width",e[3]+"rem"),_i(t,"height",e[4]+"rem"),ni(t,"flip",e[2])},m(s,o){I(s,t,o),r.m(t,null)},p(s,[o]){i!==(i=n(s))&&(r.d(1),r=i(s),r&&(r.c(),r.m(t,null))),o&2&&_i(t,"top",s[1]+"rem"),o&1&&_i(t,"left",s[0]+"rem"),o&8&&_i(t,"width",s[3]+"rem"),o&16&&_i(t,"height",s[4]+"rem"),o&4&&ni(t,"flip",s[2])},i:ee,o:ee,d(s){s&&L(t),r.d()}}}const Ea=.5;function cB(e,t,n){let{top:i=0}=t,{left:r=0}=t,{bottom:s=0}=t,{right:o=0}=t,a,u,l,c=!1,f=!1;return e.$$set=d=>{"top"in d&&n(1,i=d.top),"left"in d&&n(0,r=d.left),"bottom"in d&&n(8,s=d.bottom),"right"in d&&n(7,o=d.right)},e.$$.update=()=>{e.$$.dirty&415&&(n(2,a=o-r<0),n(3,u=Math.abs(o-r)),u<=Ea?(n(3,u=Ea),n(5,c=!0),n(0,r-=Ea/2)):(a?(n(0,r+=Ea/2),n(7,o-=Ea/2)):(n(0,r-=Ea/2),n(7,o+=Ea/2)),n(3,u=Math.abs(o-r))),n(4,l=s-i),l<0&&(n(6,f=!0),n(4,l=5.5),n(3,u=10.25)))},[r,i,a,u,l,c,f,o,s]}class fB extends xe{constructor(t){super(),ve(this,t,cB,lB,ye,{top:1,left:0,bottom:8,right:7})}}function R5(e,t,n){const i=e.slice();return i[3]=t[n],i}function O5(e){let t,n;return t=new fB({props:{top:mo(e[3].top),left:mo(e[3].left),bottom:mo(e[3].bottom),right:mo(e[3].right)}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.top=mo(i[3].top)),r&1&&(s.left=mo(i[3].left)),r&1&&(s.bottom=mo(i[3].bottom)),r&1&&(s.right=mo(i[3].right)),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function dB(e){let t,n,i=Ue(e[0]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{"dagStructure"in o&&n(1,i=o.dagStructure),"container"in o&&n(2,r=o.container)},e.$$.update=()=>{if(e.$$.dirty&7&&(n(0,s=[]),r)){const o=r.getBoundingClientRect(),a=o.top,u=o.left;Object.values(i).forEach(l=>{var f;const c=l.node.getBoundingClientRect();(f=l.connections)==null||f.forEach(d=>{const h=i[d];if(!h){console.warn("Connection node not found:",d);return}const p=h.node.getBoundingClientRect(),g={top:c.bottom-a,left:c.left-u+c.width/2,bottom:p.top-a,right:p.left-u+p.width/2};n(0,s=[...s,g])})})}},[s,i,r]}class pB extends xe{constructor(t){super(),ve(this,t,hB,dB,ye,{dagStructure:1,container:2})}}const L5="currentStep";function I5(e,t,n){const i=e.slice();return i[16]=t[n],i[18]=n,i}function P5(e){let t,n,i;return{c(){t=H("div"),n=Be("x"),i=Be(e[6]),M(t,"class","levelstoshow svelte-117ceti")},m(r,s){I(r,t,s),V(t,n),V(t,i)},p(r,s){s&64&&ft(i,r[6])},d(r){r&&L(t)}}}function z5(e){let t,n;return{c(){t=H("div"),M(t,"class",n="level rectangle "+e[16]+" svelte-117ceti"),_i(t,"z-index",(e[18]+1)*-1),_i(t,"top",(e[18]+1)*B5+"px"),_i(t,"left",(e[18]+1)*B5+"px")},m(i,r){I(i,t,r)},p(i,r){r&128&&n!==(n="level rectangle "+i[16]+" svelte-117ceti")&&M(t,"class",n)},d(i){i&&L(t)}}}function gB(e){let t,n,i,r,s,o,a,u,l=e[2].doc+"",c,f,d,h=e[6]&&P5(e),p=Ue(e[7]),g=[];for(let m=0;m1&&(c=new Intl.NumberFormat().format(r.num_possible_tasks)),s=r.num_possible_tasks-1,Object.keys(f).forEach(v=>{const x=Number.parseInt(v);r.num_possible_tasks&&r.num_possible_tasks>x&&n(11,s=f[x])})):s*=mB,s>0&&(d=new Array(s).fill("")),d=d.map((v,x)=>{if(r.num_possible_tasks){const _=r.num_failed??0,E=r.successful_tasks??0;return(_-1)/r.num_possible_tasks>=(x+1)/d.length?"error":(_+E)/r.num_possible_tasks>=(x+1)/d.length?"success":"running"}return""});const h=C5(L5),p=i===h;r.failed||r.num_failed?u=!0:(r.num_possible_tasks??0)>(r.successful_tasks??0)?l=!0:r.num_possible_tasks&&r.num_possible_tasks===r.successful_tasks&&(a=!0);let g,m=!1;Wc(()=>{n(9,m=Gz(g))});function y(v){zi[v?"unshift":"push"](()=>{g=v,n(8,g)})}function b(v){zi[v?"unshift":"push"](()=>{o=v,n(0,o)})}return e.$$set=v=>{"name"in v&&n(1,i=v.name),"step"in v&&n(2,r=v.step),"numLevels"in v&&n(11,s=v.numLevels),"el"in v&&n(0,o=v.el)},[o,i,r,a,u,l,c,d,g,m,p,s,y,b]}let bB=class extends xe{constructor(t){super(),ve(this,t,yB,gB,ye,{name:1,step:2,numLevels:11,el:0})}};function U5(e,t,n){const i=e.slice();return i[13]=t[n],i}function vB(e){let t,n,i,r,s,o,a;function u(h){e[11](h)}let l={name:e[2],numLevels:e[3],step:e[7]};e[5]!==void 0&&(l.el=e[5]),n=new bB({props:l}),zi.push(()=>g2(n,"el",u));let c=e[8]&&xB(e),f=e[7].box_ends&&CB(e),d=e[2]==="start"&&q5(e);return{c(){t=H("div"),de(n.$$.fragment),r=We(),c&&c.c(),s=We(),f&&f.c(),o=We(),d&&d.c(),M(t,"class","stepwrapper svelte-18aex7a")},m(h,p){I(h,t,p),ce(n,t,null),V(t,r),c&&c.m(t,null),V(t,s),f&&f.m(t,null),V(t,o),d&&d.m(t,null),a=!0},p(h,p){const g={};p&4&&(g.name=h[2]),p&8&&(g.numLevels=h[3]),!i&&p&32&&(i=!0,g.el=h[5],h2(()=>i=!1)),n.$set(g),h[8]&&c.p(h,p),h[7].box_ends&&f.p(h,p),h[2]==="start"?d?(d.p(h,p),p&4&&F(d,1)):(d=q5(h),d.c(),F(d,1),d.m(t,null)):d&&($e(),N(d,1,1,()=>{d=null}),Se())},i(h){a||(F(n.$$.fragment,h),F(c),F(f),F(d),a=!0)},o(h){N(n.$$.fragment,h),N(c),N(f),N(d),a=!1},d(h){h&&L(t),fe(n),c&&c.d(),f&&f.d(),d&&d.d()}}}function xB(e){let t,n,i,r,s=Ue(e[7].next),o=[];for(let u=0;uN(o[u],1,1,()=>{o[u]=null});return{c(){t=H("div"),n=We(),i=H("div");for(let u=0;u{o[c]=null}),Se(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i))},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),o[t].d(u)}}}function CB(e){let t,n,i,r;return i=new Uh({props:{steps:e[1],stepName:e[7].box_ends,levels:e[3],dagStructure:e[0],pathToStep:e[6],joins:e[4]}}),{c(){t=H("div"),n=We(),de(i.$$.fragment),M(t,"class","gap svelte-18aex7a")},m(s,o){I(s,t,o),I(s,n,o),ce(i,s,o),r=!0},p(s,o){const a={};o&2&&(a.steps=s[1]),o&8&&(a.levels=s[3]),o&1&&(a.dagStructure=s[0]),o&16&&(a.joins=s[4]),i.$set(a)},i(s){r||(F(i.$$.fragment,s),r=!0)},o(s){N(i.$$.fragment,s),r=!1},d(s){s&&(L(t),L(n)),fe(i,s)}}}function q5(e){let t,n,i,r;return i=new Uh({props:{steps:e[1],stepName:"end",levels:e[3],dagStructure:e[0]}}),{c(){t=H("div"),n=We(),de(i.$$.fragment),M(t,"class","gap svelte-18aex7a")},m(s,o){I(s,t,o),I(s,n,o),ce(i,s,o),r=!0},p(s,o){const a={};o&2&&(a.steps=s[1]),o&8&&(a.levels=s[3]),o&1&&(a.dagStructure=s[0]),i.$set(a)},i(s){r||(F(i.$$.fragment,s),r=!0)},o(s){N(i.$$.fragment,s),r=!1},d(s){s&&(L(t),L(n)),fe(i,s)}}}function kB(e){let t,n,i=e[7]&&vB(e);return{c(){i&&i.c(),t=Me()},m(r,s){i&&i.m(r,s),I(r,t,s),n=!0},p(r,[s]){r[7]&&i.p(r,s)},i(r){n||(F(i),n=!0)},o(r){N(i),n=!1},d(r){r&&L(t),i&&i.d(r)}}}function AB(e,t,n){var m;let{steps:i}=t,{stepName:r}=t,{levels:s=0}=t,{joins:o=[]}=t,{pathToStep:a=""}=t,{dagStructure:u={}}=t,l=null;const c=a?`${a}/${r}`:r,f=i[r];Wc(()=>{if(u[c]){console.log("Node already registered:",c);return}if(!l){console.warn("Step element not found:",c);return}const y=[];for(const b of f.next){const v=i[b];if((v==null?void 0:v.type)==="join"){const x=o.find(_=>_.endsWith("/"+b));x&&y.push(x)}else b==="end"?y.push("end"):b===r?y.push(c):y.push(c+"/"+b)}n(0,u[c]={stepName:r,pathToStep:a,connections:y,node:l},u)});let h=(m=f==null?void 0:f.next)==null?void 0:m.find(y=>{var b;return((b=i[y])==null?void 0:b.type)!=="join"&&y!=="end"});const p=(f==null?void 0:f.type)==="foreach"?s+1:(f==null?void 0:f.type)==="join"?s-1:s;function g(y){l=y,n(5,l)}return e.$$set=y=>{"steps"in y&&n(1,i=y.steps),"stepName"in y&&n(2,r=y.stepName),"levels"in y&&n(3,s=y.levels),"joins"in y&&n(4,o=y.joins),"pathToStep"in y&&n(10,a=y.pathToStep),"dagStructure"in y&&n(0,u=y.dagStructure)},[u,i,r,s,o,l,c,f,h,p,a,g]}class Uh extends xe{constructor(t){super(),ve(this,t,AB,kB,ye,{steps:1,stepName:2,levels:3,joins:4,pathToStep:10,dagStructure:0})}}function $B(e){let t;return{c(){t=H("p"),t.textContent="No start step"},m(n,i){I(n,t,i)},p:ee,i:ee,o:ee,d(n){n&&L(t)}}}function SB(e){let t,n,i;function r(o){e[6](o)}let s={steps:e[3],stepName:"start"};return e[1]!==void 0&&(s.dagStructure=e[1]),t=new Uh({props:s}),zi.push(()=>g2(t,"dagStructure",r)),{c(){de(t.$$.fragment)},m(o,a){ce(t,o,a),i=!0},p(o,a){const u={};!n&&a&2&&(n=!0,u.dagStructure=o[1],h2(()=>n=!1)),t.$set(u)},i(o){i||(F(t.$$.fragment,o),i=!0)},o(o){N(t.$$.fragment,o),i=!1},d(o){fe(t,o)}}}function W5(e){let t,n;return t=new pB({props:{dagStructure:e[1],container:e[0]}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.dagStructure=i[1]),r&1&&(s.container=i[0]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function FB(e){let t,n,i,r,s,o,a;const u=[SB,$B],l=[];function c(d,h){var p;return(p=d[3])!=null&&p.start?0:1}n=c(e),i=l[n]=u[n](e);let f=!e[2]&&W5(e);return{c(){t=H("div"),i.c(),r=We(),f&&f.c(),_i(t,"position","relative"),_i(t,"line-height","1"),M(t,"data-component","dag")},m(d,h){I(d,t,h),l[n].m(t,null),V(t,r),f&&f.m(t,null),e[7](t),s=!0,o||(a=Ku(window,"resize",e[4]),o=!0)},p(d,[h]){i.p(d,h),d[2]?f&&($e(),N(f,1,1,()=>{f=null}),Se()):f?(f.p(d,h),h&4&&F(f,1)):(f=W5(d),f.c(),F(f,1),f.m(t,null))},i(d){s||(F(i),F(f),s=!0)},o(d){N(i),N(f),s=!1},d(d){d&&L(t),l[n].d(),f&&f.d(),e[7](null),o=!1,a()}}}const DB=100;function TB(e,t,n){var h;let i;zh(e,wa,p=>n(9,i=p));let{componentData:r}=t;const{data:s}=r;let o,a={};E5(L5,Hz((h=i==null?void 0:i.metadata)==null?void 0:h.pathspec,"stepname"));let u,l=!1;const c=()=>{n(2,l=!0),clearTimeout(u),u=setTimeout(()=>{n(2,l=!1)},DB)};function f(p){a=p,n(1,a)}function d(p){zi[p?"unshift":"push"](()=>{o=p,n(0,o)})}return e.$$set=p=>{"componentData"in p&&n(5,r=p.componentData)},[o,a,l,s,c,r,f,d]}class H5 extends xe{constructor(t){super(),ve(this,t,TB,FB,ye,{componentData:5})}}function MB(e){var r;let t,n=(((r=e[0])==null?void 0:r.text)||"")+"",i;return{c(){t=H("h2"),i=Be(n),M(t,"class","title svelte-117s0ws"),M(t,"data-component","title")},m(s,o){I(s,t,o),V(t,i)},p(s,[o]){var a;o&1&&n!==(n=(((a=s[0])==null?void 0:a.text)||"")+"")&&ft(i,n)},i:ee,o:ee,d(s){s&&L(t)}}}function NB(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class G5 extends xe{constructor(t){super(),ve(this,t,NB,MB,ye,{componentData:0})}}function RB(e){var r;let t,n=(((r=e[0])==null?void 0:r.text)||"")+"",i;return{c(){t=H("p"),i=Be(n),M(t,"class","subtitle svelte-lu9pnn"),M(t,"data-component","subtitle")},m(s,o){I(s,t,o),V(t,i)},p(s,[o]){var a;o&1&&n!==(n=(((a=s[0])==null?void 0:a.text)||"")+"")&&ft(i,n)},i:ee,o:ee,d(s){s&&L(t)}}}function OB(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class V5 extends xe{constructor(t){super(),ve(this,t,OB,RB,ye,{componentData:0})}}function Y5(e){let t,n;return t=new G5({props:{componentData:{type:"title",text:e[1]}}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.componentData={type:"title",text:i[1]}),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function X5(e){let t,n;return t=new V5({props:{componentData:{type:"subtitle",text:e[0]}}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.componentData={type:"subtitle",text:i[0]}),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function LB(e){let t,n,i,r=e[1]&&Y5(e),s=e[0]&&X5(e);return{c(){t=H("header"),r&&r.c(),n=We(),s&&s.c(),M(t,"class","container svelte-1ugmt5d"),M(t,"data-component","heading")},m(o,a){I(o,t,a),r&&r.m(t,null),V(t,n),s&&s.m(t,null),i=!0},p(o,[a]){o[1]?r?(r.p(o,a),a&2&&F(r,1)):(r=Y5(o),r.c(),F(r,1),r.m(t,n)):r&&($e(),N(r,1,1,()=>{r=null}),Se()),o[0]?s?(s.p(o,a),a&1&&F(s,1)):(s=X5(o),s.c(),F(s,1),s.m(t,null)):s&&($e(),N(s,1,1,()=>{s=null}),Se())},i(o){i||(F(r),F(s),i=!0)},o(o){N(r),N(s),i=!1},d(o){o&&L(t),r&&r.d(),s&&s.d()}}}function IB(e,t,n){let i,r,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(2,s=o.componentData)},e.$$.update=()=>{e.$$.dirty&4&&n(1,{title:i,subtitle:r}=s,i,(n(0,r),n(2,s)))},[r,i,s]}let K5=class extends xe{constructor(t){super(),ve(this,t,IB,LB,ye,{componentData:2})}};function Z5(e){let t,n;return{c(){t=H("div"),n=Be(e[2]),M(t,"class","label svelte-1x96yvr")},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&4&&ft(n,i[2])},d(i){i&&L(t)}}}function J5(e){let t,n;return{c(){t=H("figcaption"),n=Be(e[1]),M(t,"class","description svelte-1x96yvr")},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&2&&ft(n,i[1])},d(i){i&&L(t)}}}function PB(e){let t,n,i,r,s,o,a,u,l,c=e[2]&&Z5(e),f=e[1]&&J5(e);return{c(){t=H("figure"),n=H("div"),i=H("img"),o=We(),c&&c.c(),a=We(),f&&f.c(),Ph(i.src,r=e[3])||M(i,"src",r),M(i,"alt",s=e[2]||"image"),M(i,"class","svelte-1x96yvr"),M(n,"class","imageContainer"),M(t,"data-component","image"),M(t,"class","svelte-1x96yvr")},m(d,h){I(d,t,h),V(t,n),V(n,i),V(t,o),c&&c.m(t,null),V(t,a),f&&f.m(t,null),u||(l=Ku(t,"click",e[4]),u=!0)},p(d,[h]){h&8&&!Ph(i.src,r=d[3])&&M(i,"src",r),h&4&&s!==(s=d[2]||"image")&&M(i,"alt",s),d[2]?c?c.p(d,h):(c=Z5(d),c.c(),c.m(t,a)):c&&(c.d(1),c=null),d[1]?f?f.p(d,h):(f=J5(d),f.c(),f.m(t,null)):f&&(f.d(1),f=null)},i:ee,o:ee,d(d){d&&L(t),c&&c.d(),f&&f.d(),u=!1,l()}}}function zB(e,t,n){let i,r,s,{componentData:o}=t;const a=()=>Hc.set(o);return e.$$set=u=>{"componentData"in u&&n(0,o=u.componentData)},e.$$.update=()=>{e.$$.dirty&1&&n(3,{src:i,label:r,description:s}=o,i,(n(2,r),n(0,o)),(n(1,s),n(0,o)))},[o,s,r,i,a]}let Q5=class extends xe{constructor(t){super(),ve(this,t,zB,PB,ye,{componentData:0})}};function BB(e){let t,n,i,r,s=e[0].data+"",o,a,u;return{c(){t=H("pre"),n=Be(` - `),i=H("code"),r=Be(` - `),o=Be(s),a=Be(` - `),u=Be(` -`),M(i,"class","mono language-log"),M(t,"class","log svelte-1jhmsu"),M(t,"data-component","log")},m(l,c){I(l,t,c),V(t,n),V(t,i),V(i,r),V(i,o),V(i,a),e[2](i),V(t,u)},p(l,[c]){c&1&&s!==(s=l[0].data+"")&&ft(o,s)},i:ee,o:ee,d(l){l&&L(t),e[2](null)}}}function UB(e,t,n){let{componentData:i}=t,r;function s(){var a;r&&((a=window==null?void 0:window.Prism)==null||a.highlightElement(r))}function o(a){zi[a?"unshift":"push"](()=>{r=a,n(1,r)})}return e.$$set=a=>{"componentData"in a&&n(0,i=a.componentData)},e.$$.update=()=>{e.$$.dirty&2&&r&&s()},[i,r,o]}let e4=class extends xe{constructor(t){super(),ve(this,t,UB,BB,ye,{componentData:0})}};function jB(){const e=console.warn;console.warn=t=>{t.includes("unknown prop")||t.includes("unexpected slot")||e(t)},Wc(()=>{console.warn=e})}function t4(e,t,n){const i=e.slice();return i[18]=t[n],i}function n4(e,t,n){const i=e.slice();return i[18]=t[n],i}function i4(e,t,n){const i=e.slice();return i[10]=t[n],i}function r4(e,t,n){const i=e.slice();return i[13]=t[n],i[15]=n,i}function s4(e,t,n){const i=e.slice();return i[16]=t[n],i[15]=n,i}function o4(e,t,n){const i=e.slice();return i[7]=t[n],i}function qB(e){let t,n,i,r;const s=[VB,GB,HB],o=[];function a(u,l){return u[0]==="table"?0:u[0]==="list"?1:2}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Me()},m(u,l){o[t].m(u,l),I(u,i,l),r=!0},p(u,l){let c=t;t=a(u),t===c?o[t].p(u,l):($e(),N(o[c],1,1,()=>{o[c]=null}),Se(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i))},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),o[t].d(u)}}}function WB(e){let t,n,i=Ue(e[1]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{fe(l,1)}),Se()}s?(t=Ke(s,o(a,u)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(s){const l=u&64?wi(r,[ar(a[6])]):{};u&8388706&&(l.$$scope={dirty:u,ctx:a}),t.$set(l)}},i(a){i||(t&&F(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&L(n),t&&fe(t,a)}}}function GB(e){let t,n,i,r;const s=[JB,ZB],o=[];function a(u,l){return u[4]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Me()},m(u,l){o[t].m(u,l),I(u,i,l),r=!0},p(u,l){let c=t;t=a(u),t===c?o[t].p(u,l):($e(),N(o[c],1,1,()=>{o[c]=null}),Se(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i))},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),o[t].d(u)}}}function VB(e){let t,n,i;var r=e[5].table;function s(o,a){return{props:{$$slots:{default:[lU]},$$scope:{ctx:o}}}}return r&&(t=Ke(r,s(e))),{c(){t&&de(t.$$.fragment),n=Me()},m(o,a){t&&ce(t,o,a),I(o,n,a),i=!0},p(o,a){if(a&32&&r!==(r=o[5].table)){if(t){$e();const u=t;N(u.$$.fragment,1,0,()=>{fe(u,1)}),Se()}r?(t=Ke(r,s(o)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(r){const u={};a&8388716&&(u.$$scope={dirty:a,ctx:o}),t.$set(u)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&fe(t,o)}}}function YB(e){let t=e[6].raw+"",n;return{c(){n=Be(t)},m(i,r){I(i,n,r)},p(i,r){r&64&&t!==(t=i[6].raw+"")&&ft(n,t)},i:ee,o:ee,d(i){i&&L(n)}}}function XB(e){let t,n;return t=new Ca({props:{tokens:e[1],renderers:e[5]}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.tokens=i[1]),r&32&&(s.renderers=i[5]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function KB(e){let t,n,i,r;const s=[XB,YB],o=[];function a(u,l){return u[1]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Me()},m(u,l){o[t].m(u,l),I(u,i,l),r=!0},p(u,l){let c=t;t=a(u),t===c?o[t].p(u,l):($e(),N(o[c],1,1,()=>{o[c]=null}),Se(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i))},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),o[t].d(u)}}}function ZB(e){let t,n,i;const r=[{ordered:e[4]},e[6]];var s=e[5].list;function o(a,u){let l={$$slots:{default:[eU]},$$scope:{ctx:a}};for(let c=0;c{fe(l,1)}),Se()}s?(t=Ke(s,o(a,u)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(s){const l=u&80?wi(r,[u&16&&{ordered:a[4]},u&64&&ar(a[6])]):{};u&8388704&&(l.$$scope={dirty:u,ctx:a}),t.$set(l)}},i(a){i||(t&&F(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&L(n),t&&fe(t,a)}}}function JB(e){let t,n,i;const r=[{ordered:e[4]},e[6]];var s=e[5].list;function o(a,u){let l={$$slots:{default:[nU]},$$scope:{ctx:a}};for(let c=0;c{fe(l,1)}),Se()}s?(t=Ke(s,o(a,u)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(s){const l=u&80?wi(r,[u&16&&{ordered:a[4]},u&64&&ar(a[6])]):{};u&8388704&&(l.$$scope={dirty:u,ctx:a}),t.$set(l)}},i(a){i||(t&&F(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&L(n),t&&fe(t,a)}}}function QB(e){let t,n,i;return t=new Ca({props:{tokens:e[18].tokens,renderers:e[5]}}),{c(){de(t.$$.fragment),n=We()},m(r,s){ce(t,r,s),I(r,n,s),i=!0},p(r,s){const o={};s&64&&(o.tokens=r[18].tokens),s&32&&(o.renderers=r[5]),t.$set(o)},i(r){i||(F(t.$$.fragment,r),i=!0)},o(r){N(t.$$.fragment,r),i=!1},d(r){r&&L(n),fe(t,r)}}}function a4(e){let t,n,i;const r=[e[18]];var s=e[5].unorderedlistitem||e[5].listitem;function o(a,u){let l={$$slots:{default:[QB]},$$scope:{ctx:a}};for(let c=0;c{fe(l,1)}),Se()}s?(t=Ke(s,o(a,u)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(s){const l=u&64?wi(r,[ar(a[18])]):{};u&8388704&&(l.$$scope={dirty:u,ctx:a}),t.$set(l)}},i(a){i||(t&&F(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&L(n),t&&fe(t,a)}}}function eU(e){let t,n,i=Ue(e[6].items),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{fe(l,1)}),Se()}s?(t=Ke(s,o(a,u)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(s){const l=u&64?wi(r,[ar(a[18])]):{};u&8388704&&(l.$$scope={dirty:u,ctx:a}),t.$set(l)}},i(a){i||(t&&F(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&L(n),t&&fe(t,a)}}}function nU(e){let t,n,i=Ue(e[6].items),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{fe(u,1)}),Se()}r?(t=Ke(r,s(o)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(r){const u={};a&64&&(u.align=o[6].align[o[15]]||"center"),a&8388644&&(u.$$scope={dirty:a,ctx:o}),t.$set(u)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&fe(t,o)}}}function rU(e){let t,n,i=Ue(e[2]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{fe(u,1)}),Se()}r?(t=Ke(r,s(o)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(r){const u={};a&8388708&&(u.$$scope={dirty:a,ctx:o}),t.$set(u)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&fe(t,o)}}}function oU(e){let t,n;return t=new Ca({props:{tokens:e[13].tokens,renderers:e[5]}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,r){const s={};r&8&&(s.tokens=i[13].tokens),r&32&&(s.renderers=i[5]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function c4(e){let t,n,i;var r=e[5].tablecell;function s(o,a){return{props:{header:!1,align:o[6].align[o[15]]||"center",$$slots:{default:[oU]},$$scope:{ctx:o}}}}return r&&(t=Ke(r,s(e))),{c(){t&&de(t.$$.fragment),n=Me()},m(o,a){t&&ce(t,o,a),I(o,n,a),i=!0},p(o,a){if(a&32&&r!==(r=o[5].tablecell)){if(t){$e();const u=t;N(u.$$.fragment,1,0,()=>{fe(u,1)}),Se()}r?(t=Ke(r,s(o)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(r){const u={};a&64&&(u.align=o[6].align[o[15]]||"center"),a&8388648&&(u.$$scope={dirty:a,ctx:o}),t.$set(u)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&fe(t,o)}}}function aU(e){let t,n,i=Ue(e[10]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{fe(u,1)}),Se()}r?(t=Ke(r,s(o)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(r){const u={};a&8388712&&(u.$$scope={dirty:a,ctx:o}),t.$set(u)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&fe(t,o)}}}function uU(e){let t,n,i=Ue(e[3]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{fe(d,1)}),Se()}o?(t=Ke(o,a(c)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(o){const d={};f&8388708&&(d.$$scope={dirty:f,ctx:c}),t.$set(d)}if(f&32&&u!==(u=c[5].tablebody)){if(i){$e();const d=i;N(d.$$.fragment,1,0,()=>{fe(d,1)}),Se()}u?(i=Ke(u,l(c)),de(i.$$.fragment),F(i.$$.fragment,1),ce(i,r.parentNode,r)):i=null}else if(u){const d={};f&8388712&&(d.$$scope={dirty:f,ctx:c}),i.$set(d)}},i(c){s||(t&&F(t.$$.fragment,c),i&&F(i.$$.fragment,c),s=!0)},o(c){t&&N(t.$$.fragment,c),i&&N(i.$$.fragment,c),s=!1},d(c){c&&(L(n),L(r)),t&&fe(t,c),i&&fe(i,c)}}}function d4(e){let t,n;const i=[e[7],{renderers:e[5]}];let r={};for(let s=0;s{o[c]=null}),Se()),~t?(n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i)):n=null)},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),~t&&o[t].d(u)}}}function fU(e,t,n){const i=["type","tokens","header","rows","ordered","renderers"];let r=v5(t,i),{type:s=void 0}=t,{tokens:o=void 0}=t,{header:a=void 0}=t,{rows:u=void 0}=t,{ordered:l=!1}=t,{renderers:c}=t;return jB(),e.$$set=f=>{t=Pe(Pe({},t),u2(f)),n(6,r=v5(t,i)),"type"in f&&n(0,s=f.type),"tokens"in f&&n(1,o=f.tokens),"header"in f&&n(2,a=f.header),"rows"in f&&n(3,u=f.rows),"ordered"in f&&n(4,l=f.ordered),"renderers"in f&&n(5,c=f.renderers)},[s,o,a,u,l,c,r]}let Ca=class extends xe{constructor(t){super(),ve(this,t,fU,cU,ye,{type:0,tokens:1,header:2,rows:3,ordered:4,renderers:5})}};function m2(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let yo=m2();function h4(e){yo=e}const p4=/[&<>"']/,dU=new RegExp(p4.source,"g"),g4=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,hU=new RegExp(g4.source,"g"),pU={"&":"&","<":"<",">":">",'"':""","'":"'"},m4=e=>pU[e];function _n(e,t){if(t){if(p4.test(e))return e.replace(dU,m4)}else if(g4.test(e))return e.replace(hU,m4);return e}const gU=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function y4(e){return e.replace(gU,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const mU=/(^|[^\[])\^/g;function it(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(i,r)=>(r=r.source||r,r=r.replace(mU,"$1"),e=e.replace(i,r),n),getRegex:()=>new RegExp(e,t)};return n}const yU=/[^\w:]/g,bU=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function b4(e,t,n){if(e){let i;try{i=decodeURIComponent(y4(n)).replace(yU,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}t&&!bU.test(n)&&(n=wU(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const jh={},vU=/^[^:]+:\/*[^/]*$/,xU=/^([^:]+:)[\s\S]*$/,_U=/^([^:]+:\/*[^/]*)[\s\S]*$/;function wU(e,t){jh[" "+e]||(vU.test(e)?jh[" "+e]=e+"/":jh[" "+e]=Wh(e,"/",!0)),e=jh[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(xU,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(_U,"$1")+t:e+t}const qh={exec:function(){}};function v4(e,t){const n=e.replace(/\|/g,(s,o,a)=>{let u=!1,l=o;for(;--l>=0&&a[l]==="\\";)u=!u;return u?"|":" |"}),i=n.split(/ \|/);let r=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length{throw TypeError(ee)};var yxe=(ee,Be,xi)=>Be in ee?mxe(ee,Be,{enumerable:!0,configurable:!0,writable:!0,value:xi}):ee[Be]=xi;var Lt=(ee,Be,xi)=>yxe(ee,typeof Be!="symbol"?Be+"":Be,xi),bxe=(ee,Be,xi)=>Be.has(ee)||Fz("Cannot "+xi);var Dz=(ee,Be,xi)=>Be.has(ee)?Fz("Cannot add the same private member more than once"):Be instanceof WeakSet?Be.add(ee):Be.set(ee,xi);var a2=(ee,Be,xi)=>(bxe(ee,Be,"access private method"),xi);var Yu,g6,Tz,$z,Sz;function ee(){}function Be(e,t){for(const n in t)e[n]=t[n];return e}function xi(e){return e()}function m6(){return Object.create(null)}function Xu(e){e.forEach(xi)}function y6(e){return typeof e=="function"}function ye(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Ih;function Ph(e,t){return e===t?!0:(Ih||(Ih=document.createElement("a")),Ih.href=t,e===Ih.href)}function Mz(e){return Object.keys(e).length===0}function Nz(e,...t){if(e==null){for(const i of t)i(void 0);return ee}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function zh(e,t,n){e.$$.on_destroy.push(Nz(t,n))}function mt(e,t,n,i){if(e){const r=b6(e,t,n,i);return e[0](r)}}function b6(e,t,n,i){return e[1]&&i?Be(n.ctx.slice(),e[1](i(t))):n.ctx}function yt(e,t,n,i){return e[2],t.dirty}function bt(e,t,n,i,r,s){if(r){const o=b6(t,n,i,s);e.p(o,r)}}function vt(e){if(e.ctx.length>32){const t=[],n=e.ctx.length/32;for(let i=0;ie.removeEventListener(t,n,i)}function T(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}const Oz=["width","height"];function x6(e,t){const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const i in t)t[i]==null?e.removeAttribute(i):i==="style"?e.style.cssText=t[i]:i==="__value"?e.value=e[i]=t[i]:n[i]&&n[i].set&&Oz.indexOf(i)===-1?e[i]=t[i]:T(e,i,t[i])}function _6(e,t){for(const n in t)T(e,n,t[n])}function Lz(e){return Array.from(e.childNodes)}function Ke(e,t){t=""+t,e.data!==t&&(e.data=t)}function _i(e,t,n,i){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,"")}function ni(e,t,n){e.classList.toggle(t,!!n)}function Iz(e,t,{bubbles:n=!1,cancelable:i=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:i})}class Pz{constructor(t=!1){Lt(this,"is_svg",!1);Lt(this,"e");Lt(this,"n");Lt(this,"t");Lt(this,"a");this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,i=null){this.e||(this.is_svg?this.e=Pi(n.nodeName):this.e=H(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(t)),this.i(i)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(t){for(let n=0;n{const r=e.$$.callbacks[t];if(r){const s=Iz(t,n,{cancelable:i});return r.slice().forEach(o=>{o.call(e,s)}),!s.defaultPrevented}return!0}}function E6(e,t){return qc().$$.context.set(e,t),t}function C6(e){return qc().$$.context.get(e)}function k6(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(i=>i.call(this,t))}const Zu=[],zi=[];let Ju=[];const c2=[],zz=Promise.resolve();let f2=!1;function Bz(){f2||(f2=!0,zz.then(A6))}function d2(e){Ju.push(e)}function h2(e){c2.push(e)}const p2=new Set;let Qu=0;function A6(){if(Qu!==0)return;const e=Uc;do{try{for(;Que.indexOf(i)===-1?t.push(i):n.push(i)),n.forEach(i=>i()),Ju=t}const Bh=new Set;let _a;function $e(){_a={r:0,c:[],p:_a}}function Se(){_a.r||Xu(_a.c),_a=_a.p}function F(e,t){e&&e.i&&(Bh.delete(e),e.i(t))}function N(e,t,n,i){if(e&&e.o){if(Bh.has(e))return;Bh.add(e),_a.c.push(()=>{Bh.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function je(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function wi(e,t){const n={},i={},r={$$scope:1};let s=e.length;for(;s--;){const o=e[s],a=t[s];if(a){for(const u in o)u in a||(i[u]=1);for(const u in a)r[u]||(n[u]=a[u],r[u]=1);e[s]=a}else for(const u in o)r[u]=1}for(const o in i)o in n||(n[o]=void 0);return n}function ar(e){return typeof e=="object"&&e!==null?e:{}}function g2(e,t,n){const i=e.$$.props[t];i!==void 0&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function de(e){e&&e.c()}function ce(e,t,n){const{fragment:i,after_update:r}=e.$$;i&&i.m(t,n),d2(()=>{const s=e.$$.on_mount.map(xi).filter(y6);e.$$.on_destroy?e.$$.on_destroy.push(...s):Xu(s),e.$$.on_mount=[]}),r.forEach(d2)}function fe(e,t){const n=e.$$;n.fragment!==null&&(jz(n.after_update),Xu(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function qz(e,t){e.$$.dirty[0]===-1&&(Zu.push(e),Bz(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const p=h.length?h[0]:d;return l.ctx&&r(l.ctx[f],l.ctx[f]=p)&&(!l.skip_bound&&l.bound[f]&&l.bound[f](p),c&&qz(e,f)),d}):[],l.update(),c=!0,Xu(l.before_update),l.fragment=i?i(l.ctx):!1,t.target){if(t.hydrate){const f=Lz(t.target);l.fragment&&l.fragment.l(f),f.forEach(L)}else l.fragment&&l.fragment.c();t.intro&&F(e.$$.fragment),ce(e,t.target,t.anchor),A6()}jc(u)}class ve{constructor(){Lt(this,"$$");Lt(this,"$$set")}$destroy(){fe(this,1),this.$destroy=ee}$on(t,n){if(!y6(n))return ee;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(t){this.$$set&&!Mz(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Wz="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Wz);var Hz=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},Br=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,i={},r={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function h(p){return p instanceof s?new s(p.type,h(p.content),p.alias):Array.isArray(p)?p.map(h):p.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(m){var h=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(m.stack)||[])[1];if(h){var p=document.getElementsByTagName("script");for(var g in p)if(p[g].src==h)return p[g]}return null}},isActive:function(h,p,g){for(var m="no-"+p;h;){var y=h.classList;if(y.contains(p))return!0;if(y.contains(m))return!1;h=h.parentElement}return!!g}},languages:{plain:i,plaintext:i,text:i,txt:i,extend:function(h,p){var g=r.util.clone(r.languages[h]);for(var m in p)g[m]=p[m];return g},insertBefore:function(h,p,g,m){var y=(m=m||r.languages)[h],b={};for(var v in y)if(y.hasOwnProperty(v)){if(v==p)for(var x in g)g.hasOwnProperty(x)&&(b[x]=g[x]);g.hasOwnProperty(v)||(b[v]=y[v])}var _=m[h];return m[h]=b,r.languages.DFS(r.languages,function(E,w){w===_&&E!=h&&(this[E]=b)}),b},DFS:function h(p,g,m,y){y=y||{};var b=r.util.objId;for(var v in p)if(p.hasOwnProperty(v)){g.call(p,v,p[v],m||v);var x=p[v],_=r.util.type(x);_!=="Object"||y[b(x)]?_!=="Array"||y[b(x)]||(y[b(x)]=!0,h(x,g,v,y)):(y[b(x)]=!0,h(x,g,null,y))}}},plugins:{},highlightAll:function(h,p){r.highlightAllUnder(document,h,p)},highlightAllUnder:function(h,p,g){var m={callback:g,container:h,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",m),m.elements=Array.prototype.slice.apply(m.container.querySelectorAll(m.selector)),r.hooks.run("before-all-elements-highlight",m);for(var y,b=0;y=m.elements[b++];)r.highlightElement(y,p===!0,m.callback)},highlightElement:function(h,p,g){var m=r.util.getLanguage(h),y=r.languages[m];r.util.setLanguage(h,m);var b=h.parentElement;b&&b.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(b,m);var v={element:h,language:m,grammar:y,code:h.textContent};function x(E){v.highlightedCode=E,r.hooks.run("before-insert",v),v.element.innerHTML=v.highlightedCode,r.hooks.run("after-highlight",v),r.hooks.run("complete",v),g&&g.call(v.element)}if(r.hooks.run("before-sanity-check",v),(b=v.element.parentElement)&&b.nodeName.toLowerCase()==="pre"&&!b.hasAttribute("tabindex")&&b.setAttribute("tabindex","0"),!v.code)return r.hooks.run("complete",v),void(g&&g.call(v.element));if(r.hooks.run("before-highlight",v),v.grammar)if(p&&e.Worker){var _=new Worker(r.filename);_.onmessage=function(E){x(E.data)},_.postMessage(JSON.stringify({language:v.language,code:v.code,immediateClose:!0}))}else x(r.highlight(v.code,v.grammar,v.language));else x(r.util.encode(v.code))},highlight:function(h,p,g){var m={code:h,grammar:p,language:g};return r.hooks.run("before-tokenize",m),m.tokens=r.tokenize(m.code,m.grammar),r.hooks.run("after-tokenize",m),s.stringify(r.util.encode(m.tokens),m.language)},tokenize:function(h,p){var g=p.rest;if(g){for(var m in g)p[m]=g[m];delete p.rest}var y=new a;return u(y,y.head,h),function b(v,x,_,E,w,C){for(var k in _)if(_.hasOwnProperty(k)&&_[k]){var S=_[k];S=Array.isArray(S)?S:[S];for(var $=0;$=C.reach);ie+=z.value.length,z=z.next){var xe=z.value;if(x.length>v.length)return;if(!(xe instanceof s)){var he,Te=1;if(A){if(!(he=o(G,ie,v,D))||he.index>=v.length)break;var or=he.index,ft=he.index+he[0].length,Fe=ie;for(Fe+=z.value.length;Fe<=or;)z=z.next,Fe+=z.value.length;if(Fe-=z.value.length,ie=Fe,z.value instanceof s)continue;for(var Ot=z;Ot!==x.tail&&(FeC.reach&&(C.reach=Pe);var K=z.prev;le&&(K=u(x,K,le),ie+=le.length),l(x,K,Te);var Kt=new s(k,R?r.tokenize(Ii,R):Ii,M,Ii);if(z=u(x,K,Kt),Re&&u(x,z,Re),1C.reach&&(C.reach=Xe.reach)}}}}}}(h,y,p,y.head,0),function(b){for(var v=[],x=b.head.next;x!==b.tail;)v.push(x.value),x=x.next;return v}(y)},hooks:{all:{},add:function(h,p){var g=r.hooks.all;g[h]=g[h]||[],g[h].push(p)},run:function(h,p){var g=r.hooks.all[h];if(g&&g.length)for(var m,y=0;m=g[y++];)m(p)}},Token:s};function s(h,p,g,m){this.type=h,this.content=p,this.alias=g,this.length=0|(m||"").length}function o(h,p,g,m){h.lastIndex=p;var y=h.exec(g);if(y&&m&&y[1]){var b=y[1].length;y.index+=b,y[0]=y[0].slice(b)}return y}function a(){var h={value:null,prev:null,next:null},p={value:null,prev:h,next:null};h.next=p,this.head=h,this.tail=p,this.length=0}function u(h,p,g){var m=p.next,y={value:g,prev:p,next:m};return p.next=y,m.prev=y,h.length++,y}function l(h,p,g){for(var m=p.next,y=0;y"+y.content+""},!e.document)return e.addEventListener&&(r.disableWorkerMessageHandler||e.addEventListener("message",function(h){var p=JSON.parse(h.data),g=p.language,m=p.code,y=p.immediateClose;e.postMessage(r.highlight(m,r.languages[g],g)),y&&e.close()},!1)),r;var c=r.util.currentScript();function f(){r.manual||r.highlightAll()}if(c&&(r.filename=c.src,c.hasAttribute("data-manual")&&(r.manual=!0)),!r.manual){var d=document.readyState;d==="loading"||d==="interactive"&&c&&c.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return r}(Hz);typeof module<"u"&&module.exports&&(module.exports=Br),typeof global<"u"&&(global.Prism=Br),Br.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Br.languages.log={string:{pattern:/"(?:[^"\\\r\n]|\\.)*"|'(?![st] | \w)(?:[^'\\\r\n]|\\.)*'/,greedy:!0},exception:{pattern:/(^|[^\w.])[a-z][\w.]*(?:Error|Exception):.*(?:(?:\r\n?|\n)[ \t]*(?:at[ \t].+|\.{3}.*|Caused by:.*))+(?:(?:\r\n?|\n)[ \t]*\.\.\. .*)?/,lookbehind:!0,greedy:!0,alias:["javastacktrace","language-javastacktrace"],inside:Br.languages.javastacktrace||{keyword:/\bat\b/,function:/[a-z_][\w$]*(?=\()/,punctuation:/[.:()]/}},level:[{pattern:/\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE)\b/,alias:["error","important"]},{pattern:/\b(?:WARN|WARNING|WRN)\b/,alias:["warning","important"]},{pattern:/\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/,alias:["info","keyword"]},{pattern:/\b(?:DBG|DEBUG|FINE)\b/,alias:["debug","keyword"]},{pattern:/\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/,alias:["trace","comment"]}],property:{pattern:/((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im,lookbehind:!0},separator:{pattern:/(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m,lookbehind:!0,alias:"comment"},url:/\b(?:file|ftp|https?):\/\/[^\s|,;'"]*[^\s|,;'">.]/,email:{pattern:/(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/,lookbehind:!0,alias:"url"},"ip-address":{pattern:/\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/,alias:"constant"},"mac-address":{pattern:/\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i,alias:"constant"},domain:{pattern:/(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/,lookbehind:!0,alias:"constant"},uuid:{pattern:/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,alias:"constant"},hash:{pattern:/\b(?:[a-f0-9]{32}){1,2}\b/i,alias:"constant"},"file-path":{pattern:/\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i,lookbehind:!0,greedy:!0,alias:"string"},date:{pattern:RegExp("\\b\\d{4}[-/]\\d{2}[-/]\\d{2}(?:T(?=\\d{1,2}:)|(?=\\s\\d{1,2}:))|\\b\\d{1,4}[-/ ](?:\\d{1,2}|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)[-/ ]\\d{2,4}T?\\b|\\b(?:(?:Fri|Mon|Sat|Sun|Thu|Tue|Wed)(?:\\s{1,2}(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep))?|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)\\s{1,2}\\d{1,2}\\b","i"),alias:"number"},time:{pattern:/\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/,alias:"number"},boolean:/\b(?:false|null|true)\b/i,number:{pattern:/(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i,lookbehind:!0},operator:/[;:?<=>~/@!$%&+\-|^(){}*#]/,punctuation:/[\[\].,]/},Br.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Br.languages.python["string-interpolation"].inside.interpolation.inside.rest=Br.languages.python,Br.languages.py=Br.languages.python;const el=[];function $6(e,t=ee){let n;const i=new Set;function r(a){if(ye(e,a)&&(e=a,n)){const u=!el.length;for(const l of i)l[1](),el.push(l,e);if(u){for(let l=0;l{i.delete(l),i.size===0&&n&&(n(),n=null)}}return{set:r,update:s,subscribe:o}}const wa=$6(void 0);window.metaflow_card_update=e=>(wa==null||wa.update(t=>{const n={...t};return Object.values(e).forEach(i=>(n==null?void 0:n.components)&&S6(n.components,i)),n}),!0);const Gz=(e,t)=>{e.data&&(e.data=JSON.parse(JSON.stringify(t.data))),JSON.stringify(t.spec)===JSON.stringify(e.spec)||(e.spec=JSON.parse(JSON.stringify(t.spec)))},S6=(e,t)=>{const n=e.findIndex(i=>t.id===(i==null?void 0:i.id));n>-1?e[n].type=="vegaChart"?Gz(e[n],t):Object.assign(e[n],t):e.forEach(i=>{var r;(i.type==="section"||i.type==="page")&&((r=i==null?void 0:i.contents)!=null&&r.length)&&S6(i.contents,t)})},Vz=e=>{try{const t=JSON.parse(atob(window.__MF_DATA__[e]));wa.set(t)}catch{fetch("/card-example.json").then(n=>n.json()).then(n=>{wa.set(n)}).catch(console.error)}},Hc=$6(void 0),F6=e=>{const t={};if(!e)return t;function n(i,r=[]){var s;if(i.type==="page"){const o=[];t[i.title]=o,(s=i==null?void 0:i.contents)==null||s.forEach(a=>n(a,o))}i.type==="section"&&i.title&&r.push(i.title)}return e==null||e.forEach(i=>n(i)),t},mo=(e,t)=>e/16,Yz=e=>{const t=e.split("/");return{flowname:t[0],runid:t[1],stepname:t==null?void 0:t[2],taskid:t==null?void 0:t[3]}},Xz=(e,t)=>{var n;if(!(!e||!t))return(n=Yz(e))==null?void 0:n[t]},Kz=e=>e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth;function Zz(e){let t,n,i,r,s,o,a,u;return{c(){t=Pi("svg"),n=Pi("title"),i=Oe("metaflow_logo_horizontal"),r=Pi("g"),s=Pi("g"),o=Pi("g"),a=Pi("path"),u=Pi("path"),T(a,"d","M223.990273,66.33 C223.515273,61.851 222.686273,57.512 221.505273,53.33 C220.325273,49.148 218.795273,45.122 216.916273,41.271 C212.845273,32.921 207.254273,25.587 200.268273,19.422 C199.270273,18.541 198.243273,17.684 197.189273,16.851 C191.255273,12.166 184.481273,8.355 177.253273,5.55 C174.156273,4.347 170.975273,3.33 167.741273,2.508 C161.273273,0.863 154.593273,0 147.943273,0 C141.755273,0 135.332273,0.576 128.687273,1.722 C127.025273,2.01 125.350273,2.332 123.661273,2.69 C120.283273,3.406 116.851273,4.265 113.365273,5.267 C104.650273,7.769 95.6022727,11.161 86.2442727,15.433 C78.7592727,18.851 71.0762727,22.832 63.2072727,27.373 C47.9762727,36.162 35.7372727,44.969 29.3592727,49.791 C29.0692727,50.01 28.7922727,50.221 28.5262727,50.423 C26.1382727,52.244 24.7522727,53.367 24.5662727,53.519 L0.549272727,73.065 C0.191272727,73.356 0.00727272727,73.773 0,74.194 C-0.00372727273,74.403 0.0362727273,74.614 0.120272727,74.811 C0.205272727,75.008 0.334272727,75.189 0.508272727,75.341 L11.7612727,85.195 C12.1692727,85.552 12.7252727,85.651 13.2162727,85.487 C13.3792727,85.432 13.5362727,85.348 13.6762727,85.234 L35.8492727,67.382 C36.0422727,67.224 37.6152727,65.949 40.3252727,63.903 C44.1192727,61.036 50.1422727,56.656 57.7292727,51.711 C62.0642727,48.884 66.9102727,45.873 72.1412727,42.854 C100.864273,26.278 126.367273,17.874 147.943273,17.874 C148.366273,17.874 148.790273,17.892 149.213273,17.902 C149.655273,17.911 150.096273,17.911 150.538273,17.93 C153.769273,18.068 156.995273,18.463 160.170273,19.097 C164.931273,20.049 169.577273,21.542 173.953273,23.524 C178.328273,25.505 182.433273,27.975 186.112273,30.88 C186.771273,31.4 187.406273,31.94 188.035273,32.485 C188.913273,33.245 189.771273,34.023 190.591273,34.83 C191.998273,36.217 193.317273,37.673 194.548273,39.195 C196.395273,41.479 198.042273,43.912 199.480273,46.485 C199.960273,47.342 200.417273,48.216 200.850273,49.105 C201.112273,49.642 201.343273,50.196 201.587273,50.743 C202.231273,52.185 202.834273,53.649 203.354273,55.158 C203.712273,56.198 204.041273,57.255 204.340273,58.326 C205.836273,63.683 206.590273,69.417 206.590273,75.469 C206.590273,81.221 205.892273,86.677 204.541273,91.804 C203.617273,95.308 202.397273,98.662 200.850273,101.833 C200.417273,102.722 199.960273,103.595 199.480273,104.453 C197.562273,107.884 195.275273,111.066 192.636273,113.976 C190.657273,116.159 188.480273,118.189 186.113273,120.058 C184.553273,121.29 182.909273,122.432 181.208273,123.503 C180.313273,124.067 179.400273,124.609 178.470273,125.126 C177.462273,125.688 176.442273,126.232 175.398273,126.737 C166.961273,130.823 157.423273,133.064 147.943273,133.064 C126.367273,133.064 100.864273,124.659 72.1412727,108.084 C70.5382727,107.159 68.4382727,105.886 66.3072727,104.575 C65.0292727,103.788 63.7402727,102.986 62.5412727,102.237 C59.3442727,100.238 56.7882727,98.61 56.7882727,98.61 C61.8362727,93.901 69.3232727,87.465 78.6472727,81.047 C80.0092727,80.11 81.4192727,79.174 82.8572727,78.243 C84.1052727,77.436 85.3712727,76.63 86.6732727,75.835 C88.2042727,74.9 89.7802727,73.981 91.3822727,73.074 C93.0482727,72.131 94.7512727,71.207 96.4902727,70.307 C111.473273,62.55 129.094273,56.602 147.943273,56.602 C151.750273,56.602 157.745273,57.825 162.114273,61.276 C162.300273,61.422 162.489273,61.578 162.677273,61.74 C163.337273,62.305 164.006273,62.966 164.634273,63.78 C164.957273,64.198 165.269273,64.657 165.564273,65.162 C166.006273,65.92 166.409273,66.782 166.750273,67.775 C166.891273,68.185 167.016273,68.627 167.134273,69.083 C167.586273,70.833 167.863273,72.924 167.863273,75.469 C167.863273,78.552 167.460273,80.974 166.824273,82.92 C166.578273,83.674 166.300273,84.363 165.992273,84.983 C165.855273,85.259 165.711273,85.524 165.564273,85.776 C165.376273,86.099 165.178273,86.396 164.977273,86.682 C164.631273,87.175 164.269273,87.618 163.900273,88.018 C163.730273,88.202 163.559273,88.379 163.387273,88.546 C162.962273,88.96 162.534273,89.331 162.114273,89.662 C157.745273,93.112 151.750273,94.337 147.943273,94.337 C144.485273,94.337 140.682273,93.926 136.589273,93.121 C133.860273,92.584 131.003273,91.871 128.033273,90.987 C123.579273,89.662 118.873273,87.952 113.970273,85.872 C113.768273,85.786 113.552273,85.747 113.336273,85.753 C113.122273,85.76 112.908273,85.813 112.713273,85.912 C106.990273,88.816 101.641273,91.995 96.7462727,95.223 C96.6232727,95.304 96.5182727,95.397 96.4302727,95.5 C95.8122727,96.22 96.0172727,97.397 96.9492727,97.822 L102.445273,100.328 C104.606273,101.314 106.737273,102.238 108.835273,103.102 C110.934273,103.966 113.001273,104.77 115.035273,105.511 C118.086273,106.624 121.064273,107.599 123.965273,108.436 C127.834273,109.551 131.567273,110.421 135.157273,111.043 C139.646273,111.82 143.912273,112.211 147.943273,112.211 C148.367273,112.211 148.923273,112.201 149.591273,112.169 C149.925273,112.153 150.287273,112.131 150.674273,112.102 C155.712273,111.724 165.055273,110.114 173.190273,103.691 C173.547273,103.41 173.869273,103.105 174.210273,102.813 C175.324273,101.86 176.381273,100.866 177.333273,99.8 C177.470273,99.648 177.590273,99.485 177.724273,99.331 C181.300273,95.167 183.699273,90.185 184.875273,84.406 C185.444273,81.609 185.737273,78.631 185.737273,75.469 C185.737273,63.315 181.516273,53.82 173.190273,47.247 C167.050273,42.399 160.228273,40.299 155.083273,39.395 C153.892273,39.186 152.790273,39.037 151.809273,38.938 C150.116273,38.766 148.774273,38.727 147.943273,38.727 C133.456273,38.727 118.519273,41.679 103.545273,47.5 C99.1222727,49.22 94.6912727,51.191 90.2702727,53.403 C88.7972727,54.141 87.3242727,54.905 85.8542727,55.696 C83.5092727,56.957 81.1722727,58.303 78.8382727,59.697 C77.3922727,60.562 75.9492727,61.451 74.5082727,62.366 C72.4422727,63.678 70.3802727,65.023 68.3302727,66.437 C63.8372727,69.535 59.7422727,72.63 56.0902727,75.567 C54.8732727,76.547 53.7052727,77.508 52.5882727,78.446 C48.1222727,82.2 44.4752727,85.581 41.7602727,88.226 C38.3032727,91.593 36.3592727,93.766 36.1632727,93.986 L35.8282727,94.362 L32.0332727,98.61 L30.6432727,100.164 C30.4962727,100.329 30.3932727,100.517 30.3312727,100.715 C30.1482727,101.307 30.3472727,101.981 30.8882727,102.368 L37.2812727,106.938 L37.4862727,107.083 L37.6922727,107.228 C39.8732727,108.766 42.0702727,110.277 44.2792727,111.758 C45.8422727,112.807 47.4102727,113.84 48.9832727,114.858 C51.5302727,116.508 54.0902727,118.103 56.6542727,119.665 C57.8412727,120.388 59.0282727,121.101 60.2162727,121.804 C61.2142727,122.394 62.2102727,122.989 63.2072727,123.565 C76.9772727,131.512 90.1802727,137.744 102.748273,142.242 C104.544273,142.884 106.326273,143.491 108.096273,144.063 C111.635273,145.206 115.121273,146.207 118.553273,147.067 C121.986273,147.925 125.364273,148.642 128.687273,149.215 C135.332273,150.362 141.755273,150.938 147.943273,150.938 C154.593273,150.938 161.273273,150.074 167.741273,148.43 C174.209273,146.786 180.465273,144.361 186.265273,141.238 C190.133273,139.156 193.798273,136.764 197.189273,134.087 C200.352273,131.589 203.264273,128.872 205.911273,125.949 C207.677273,124 209.325273,121.96 210.854273,119.831 C211.618273,118.766 212.353273,117.68 213.057273,116.571 C214.466273,114.356 215.753273,112.053 216.916273,109.667 C220.701273,101.906 223.073273,93.439 224.008273,84.406 C224.310273,81.485 224.465273,78.505 224.465273,75.469 C224.465273,72.364 224.306273,69.316 223.990273,66.33"),T(a,"id","Fill-1"),T(a,"fill","#146EE6"),T(u,"d","M758.389273,75.346 C752.632273,111.56 742.681273,122.23 712.102273,122.23 C710.847273,122.23 709.640273,122.207 708.464273,122.17 C708.321273,122.191 708.191273,122.23 708.028273,122.23 L637.994273,122.23 C636.795273,122.23 636.315273,121.632 636.435273,120.311 L650.585273,31.22 C650.704273,30.016 651.424273,29.417 652.623273,29.417 L667.852273,29.417 C669.050273,29.417 669.530273,30.016 669.410273,31.22 L657.659273,105.802 L714.249273,105.802 L714.249273,105.787 C714.410273,105.794 714.568273,105.802 714.741273,105.802 C718.878273,105.802 722.250273,105.351 725.040273,104.313 C726.434273,103.794 727.684273,103.129 728.810273,102.298 C729.373273,101.884 729.905273,101.426 730.410273,100.927 C734.951273,96.431 737.231273,88.43 739.322273,75.346 C739.328273,75.312 739.331273,75.282 739.337273,75.25 C739.642273,73.311 739.896273,71.474 740.130273,69.679 C740.203273,69.116 740.272273,68.557 740.338273,68.008 C740.412273,67.392 740.461273,66.821 740.525273,66.222 C742.136273,49.927 738.622273,44.525 724.454273,44.525 C723.419273,44.525 722.433273,44.554 721.490273,44.613 C708.297273,45.444 703.831273,52.303 700.461273,71.126 C700.220273,72.472 699.984273,73.877 699.752273,75.346 C699.483273,77.027 699.255273,78.6 699.052273,80.115 C698.993273,80.545 698.948273,80.946 698.895273,81.361 C698.757273,82.465 698.638273,83.528 698.540273,84.544 C698.502273,84.943 698.466273,85.334 698.434273,85.72 C698.344273,86.815 698.281273,87.856 698.246273,88.847 C698.238273,89.049 698.224273,89.269 698.219273,89.469 C698.161273,91.88 698.289273,93.972 698.621273,95.782 C698.649273,95.941 698.686273,96.089 698.717273,96.246 C698.874273,96.992 699.067273,97.689 699.301273,98.337 C699.346273,98.464 699.390273,98.594 699.439273,98.718 C700.039273,100.231 700.864273,101.478 701.963273,102.469 C702.263273,102.738 702.586273,102.987 702.925273,103.22 L679.436273,103.22 C679.393273,102.969 679.343273,102.727 679.305273,102.471 L679.304273,102.471 C679.304273,102.467 679.304273,102.462 679.303273,102.459 C679.259273,102.17 679.236273,101.854 679.198273,101.558 C679.083273,100.634 678.995273,99.671 678.934273,98.674 C678.908273,98.258 678.879273,97.845 678.862273,97.419 C678.816273,96.174 678.804273,94.876 678.832273,93.518 C678.840273,93.114 678.861273,92.69 678.876273,92.276 C678.920273,91.042 678.991273,89.765 679.092273,88.441 C679.117273,88.109 679.134273,87.79 679.162273,87.452 C679.299273,85.836 679.483273,84.137 679.698273,82.382 C679.750273,81.957 679.807273,81.518 679.863273,81.084 C680.104273,79.238 680.369273,77.344 680.687273,75.346 C681.046273,73.067 681.423273,70.889 681.819273,68.808 C687.040273,41.397 695.809273,30.748 717.267273,28.554 C720.250273,28.25 723.472273,28.103 726.971273,28.103 C726.972273,28.103 726.972273,28.103 726.972273,28.103 C747.994273,28.103 757.680273,33.202 759.811273,48.236 C760.779273,55.067 760.187273,63.953 758.389273,75.346 Z M894.023273,31.336 L866.923273,108.56 C863.472273,118.182 861.113273,121.41 854.499273,122.41 C852.379273,122.733 849.831273,122.828 846.659273,122.828 C831.670273,122.828 830.350273,121.267 829.392273,108.56 L825.794273,63.232 L825.794273,63.231 L807.928273,108.56 C804.255273,117.613 802.201273,120.996 795.961273,122.202 C793.442273,122.687 790.260273,122.829 785.985273,122.829 C772.914273,122.829 770.756273,121.267 770.396273,108.56 L767.638273,31.337 C767.638273,29.899 768.238273,29.417 769.557273,29.417 L785.385273,29.417 C786.464273,29.417 786.704273,29.899 786.824273,31.337 L788.895273,100.572 L788.895273,100.571 C789.054273,103.091 789.563273,103.641 791.021273,103.641 C792.939273,103.641 793.419273,103.042 794.618273,100.043 L820.758273,34.576 C821.358273,33.132 822.437273,32.657 823.516273,32.657 L837.665273,32.657 C838.519273,32.657 839.279273,32.977 839.626273,33.817 C839.718273,34.038 839.799273,34.274 839.824273,34.576 L845.220273,100.043 C845.460273,103.042 845.819273,103.641 847.738273,103.641 C849.297273,103.641 849.896273,103.042 850.976273,100.043 L874.838273,31.336 C875.317273,29.898 875.677273,29.417 876.756273,29.417 L892.584273,29.417 C893.903273,29.417 894.383273,29.898 894.023273,31.336 Z M362.708273,31.219 L357.192273,120.311 C357.192273,121.632 356.353273,122.23 355.154273,122.23 L339.926273,122.23 C338.726273,122.23 338.366273,121.632 338.366273,120.311 L342.324273,62.756 L311.986273,117.551 C311.386273,118.749 310.428273,119.348 309.229273,119.348 L297.837273,119.348 C296.758273,119.348 296.038273,118.749 295.560273,117.551 L282.851273,62.767 L282.848273,62.755 L268.339273,120.31 C268.212273,121.009 267.974273,121.492 267.612273,121.807 C267.288273,122.085 266.865273,122.23 266.301273,122.23 L251.073273,122.23 C249.874273,122.23 249.273273,121.632 249.514273,120.31 L272.296273,31.336 C272.537273,30.138 272.897273,29.417 274.095273,29.417 L288.605273,29.417 C291.236273,29.417 292.726273,29.895 293.682273,31.379 C294.120273,32.059 294.457273,32.928 294.720273,34.095 L307.790273,92.489 L339.326273,34.095 C341.485273,30.256 343.043273,29.299 346.880273,29.299 L361.389273,29.299 C362.376273,29.299 362.682273,30.684 362.682273,30.684 C362.682273,30.684 362.708273,31.029 362.708273,31.219 Z M501.706273,31.219 L499.667273,44.049 C499.547273,45.246 498.708273,45.845 497.509273,45.845 L472.448273,45.845 L460.696273,120.31 C460.457273,121.632 459.738273,122.23 458.538273,122.23 L443.309273,122.23 C442.111273,122.23 441.631273,121.632 441.870273,120.31 L453.622273,45.845 L394.820273,45.845 L391.224273,68.507 L391.224273,68.508 L430.555273,68.508 C431.754273,68.508 432.353273,69.106 432.234273,70.31 L430.196273,82.542 C430.076273,83.738 429.236273,84.338 428.038273,84.338 L388.706273,84.338 L385.349273,105.801 L428.397273,105.801 C429.596273,105.801 430.076273,106.4 429.955273,107.597 L427.797273,120.428 C427.676273,121.632 426.958273,122.23 425.759273,122.23 L365.683273,122.23 C364.484273,122.23 364.004273,121.632 364.124273,120.31 L378.273273,31.219 C378.393273,30.015 379.112273,29.417 380.313273,29.417 L500.147273,29.417 C501.346273,29.417 501.826273,30.015 501.706273,31.219 Z M629.471273,70.426 L627.433273,82.659 C627.313273,83.856 626.473273,84.454 625.275273,84.454 L588.223273,84.454 L582.466273,120.311 C582.347273,121.632 581.627273,122.23 580.428273,122.23 L565.200273,122.23 C564.001273,122.23 563.522273,121.632 563.640273,120.311 L577.790273,31.219 C577.910273,30.016 578.629273,29.417 579.828273,29.417 L643.004273,29.417 C644.202273,29.417 644.802273,30.016 644.682273,31.219 L642.644273,44.05 C642.403273,45.247 641.685273,45.846 640.486273,45.846 L594.337273,45.846 L590.741273,68.631 L627.793273,68.631 C628.991273,68.631 629.592273,69.23 629.471273,70.426 Z M388.706273,84.338 L388.712273,84.338 L388.309273,86.876 L388.706273,84.338 Z M510.726273,79.783 L524.396273,48.006 C525.036273,46.466 525.443273,45.589 525.990273,45.096 C526.465273,44.667 527.044273,44.525 527.993273,44.525 C530.391273,44.525 530.391273,45.124 530.751273,48.006 L534.348273,79.783 L510.726273,79.783 Z M542.334273,29.886 C539.756273,28.905 536.043273,28.702 530.511273,28.702 C516.601273,28.702 513.963273,30.016 508.208273,43.087 L474.633273,120.311 C474.154273,121.749 474.513273,122.23 475.832273,122.23 L491.060273,122.23 C492.259273,122.23 492.500273,121.749 493.099273,120.311 L504.011273,95.372 L536.026273,95.372 L539.024273,120.311 C539.144273,121.749 539.144273,122.23 540.344273,122.23 L555.572273,122.23 C556.891273,122.23 557.490273,121.749 557.490273,120.311 L548.617273,43.087 C547.658273,35.042 546.460273,31.458 542.334273,29.886 L542.334273,29.886 Z"),T(u,"id","Fill-2"),T(u,"fill","#333333"),T(o,"id","metaflow_logo_horizontal"),T(o,"transform","translate(92.930727, 93.190000)"),T(s,"id","Metaflow_Logo_Horizontal_TwoColor_Dark_RGB"),T(s,"transform","translate(-92.000000, -93.000000)"),T(r,"id","Page-1"),T(r,"stroke","none"),T(r,"stroke-width","1"),T(r,"fill","none"),T(r,"fill-rule","evenodd"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),T(t,"width","896px"),T(t,"height","152px"),T(t,"viewBox","0 0 896 152"),T(t,"version","1.1")},m(l,c){I(l,t,c),V(t,n),V(n,i),V(t,r),V(r,s),V(s,o),V(o,a),V(o,u)},d(l){l&&L(t)}}}function Jz(e){let t,n,i;return{c(){t=Pi("svg"),n=Pi("path"),i=Pi("path"),T(n,"fill-rule","evenodd"),T(n,"clip-rule","evenodd"),T(n,"d","M223.991 66.33C223.516 61.851 222.687 57.512 221.506 53.33C220.326 49.148 218.796 45.122 216.917 41.271C212.846 32.921 207.255 25.587 200.269 19.422C199.271 18.541 198.244 17.684 197.19 16.851C191.256 12.166 184.482 8.355 177.254 5.55C174.157 4.347 170.976 3.33 167.742 2.508C161.274 0.863 154.594 0 147.944 0C141.756 0 135.333 0.576 128.688 1.722C127.026 2.01 125.351 2.332 123.662 2.69C120.284 3.406 116.852 4.265 113.366 5.267C104.651 7.769 95.6025 11.161 86.2445 15.433C78.7595 18.851 71.0765 22.832 63.2075 27.373C47.9765 36.162 35.7375 44.969 29.3595 49.791C29.0695 50.01 28.7925 50.221 28.5265 50.423C26.1385 52.244 24.7525 53.367 24.5665 53.519L0.549511 73.065C0.191511 73.356 0.00751099 73.773 0.000238261 74.194C-0.00348901 74.403 0.036511 74.614 0.120511 74.811C0.205511 75.008 0.334511 75.189 0.508511 75.341L11.7615 85.195C12.1695 85.552 12.7255 85.651 13.2165 85.487C13.3795 85.432 13.5365 85.348 13.6765 85.234L35.8495 67.382C36.0425 67.224 37.6155 65.949 40.3255 63.903C44.1195 61.036 50.1425 56.656 57.7295 51.711C62.0645 48.884 66.9105 45.873 72.1415 42.854C100.865 26.278 126.368 17.874 147.944 17.874C148.367 17.874 148.791 17.892 149.214 17.902C149.656 17.911 150.097 17.911 150.539 17.93C153.77 18.068 156.996 18.463 160.171 19.097C164.932 20.049 169.578 21.542 173.954 23.524C178.329 25.505 182.434 27.975 186.113 30.88C186.772 31.4 187.407 31.94 188.036 32.485C188.914 33.245 189.772 34.023 190.592 34.83C191.999 36.217 193.318 37.673 194.549 39.195C196.396 41.479 198.043 43.912 199.481 46.485C199.961 47.342 200.418 48.216 200.851 49.105C201.113 49.642 201.344 50.196 201.588 50.743C202.232 52.185 202.835 53.649 203.355 55.158C203.713 56.198 204.042 57.255 204.341 58.326C205.837 63.683 206.591 69.417 206.591 75.469C206.591 81.221 205.893 86.677 204.542 91.804C203.618 95.308 202.398 98.662 200.851 101.833C200.418 102.722 199.961 103.595 199.481 104.453C197.563 107.884 195.276 111.066 192.637 113.976C190.658 116.159 188.481 118.189 186.114 120.058C184.554 121.29 182.91 122.432 181.209 123.503C180.314 124.067 179.401 124.609 178.471 125.126C177.463 125.688 176.443 126.232 175.399 126.737C166.962 130.823 157.424 133.064 147.944 133.064C126.368 133.064 100.865 124.659 72.1415 108.084C70.5385 107.159 68.4385 105.886 66.3075 104.575C65.0295 103.788 63.7405 102.986 62.5415 102.237C59.3445 100.238 56.7885 98.61 56.7885 98.61C61.8365 93.901 69.3235 87.465 78.6475 81.047C80.0095 80.11 81.4195 79.174 82.8575 78.243C84.1055 77.436 85.3715 76.63 86.6735 75.835C88.2045 74.9 89.7805 73.981 91.3825 73.074C93.0485 72.131 94.7515 71.207 96.4905 70.307C111.474 62.55 129.095 56.602 147.944 56.602C151.751 56.602 157.746 57.825 162.115 61.276C162.301 61.422 162.49 61.578 162.678 61.74C163.338 62.305 164.007 62.966 164.635 63.78C164.958 64.198 165.27 64.657 165.565 65.162C166.007 65.92 166.41 66.782 166.751 67.775C166.892 68.185 167.017 68.627 167.135 69.083C167.587 70.833 167.864 72.924 167.864 75.469C167.864 78.552 167.461 80.974 166.825 82.92C166.579 83.674 166.301 84.363 165.993 84.983C165.856 85.259 165.712 85.524 165.565 85.776C165.377 86.099 165.179 86.396 164.978 86.682C164.632 87.175 164.27 87.618 163.901 88.018C163.731 88.202 163.56 88.379 163.388 88.546C162.963 88.96 162.535 89.331 162.115 89.662C157.746 93.112 151.751 94.337 147.944 94.337C144.486 94.337 140.683 93.926 136.59 93.121C133.861 92.584 131.004 91.871 128.034 90.987C123.58 89.662 118.874 87.952 113.971 85.872C113.769 85.786 113.553 85.747 113.337 85.753C113.123 85.76 112.909 85.813 112.714 85.912C106.991 88.816 101.642 91.995 96.7465 95.223C96.6235 95.304 96.5185 95.397 96.4305 95.5C95.8125 96.22 96.0175 97.397 96.9495 97.822L102.446 100.328C104.607 101.314 106.738 102.238 108.836 103.102C110.935 103.966 113.002 104.77 115.036 105.511C118.087 106.624 121.065 107.599 123.966 108.436C127.835 109.551 131.568 110.421 135.158 111.043C139.647 111.82 143.913 112.211 147.944 112.211C148.368 112.211 148.924 112.201 149.592 112.169C149.926 112.153 150.288 112.131 150.675 112.102C155.713 111.724 165.056 110.114 173.191 103.691C173.548 103.41 173.87 103.105 174.211 102.813C175.325 101.86 176.382 100.866 177.334 99.8C177.471 99.648 177.591 99.485 177.725 99.331C181.301 95.167 183.7 90.185 184.876 84.406C185.445 81.609 185.738 78.631 185.738 75.469C185.738 63.315 181.517 53.82 173.191 47.247C167.051 42.399 160.229 40.299 155.084 39.395C153.893 39.186 152.791 39.037 151.81 38.938C150.117 38.766 148.775 38.727 147.944 38.727C133.457 38.727 118.52 41.679 103.546 47.5C99.1225 49.22 94.6915 51.191 90.2705 53.403C88.7975 54.141 87.3245 54.905 85.8545 55.696C83.5095 56.957 81.1725 58.303 78.8385 59.697C77.3925 60.562 75.9495 61.451 74.5085 62.366C72.4425 63.678 70.3805 65.023 68.3305 66.437C63.8375 69.535 59.7425 72.63 56.0905 75.567C54.8735 76.547 53.7055 77.508 52.5885 78.446C48.1225 82.2 44.4755 85.581 41.7605 88.226C38.3035 91.593 36.3595 93.766 36.1635 93.986L35.8285 94.362L32.0335 98.61L30.6435 100.164C30.4965 100.329 30.3935 100.517 30.3315 100.715C30.1485 101.307 30.3475 101.981 30.8885 102.368L37.2815 106.938L37.4865 107.083L37.6925 107.228C39.8735 108.766 42.0705 110.277 44.2795 111.758C45.8425 112.807 47.4105 113.84 48.9835 114.858C51.5305 116.508 54.0905 118.103 56.6545 119.665C57.8415 120.388 59.0285 121.101 60.2165 121.804C61.2145 122.394 62.2105 122.989 63.2075 123.565C76.9775 131.512 90.1805 137.744 102.749 142.242C104.545 142.884 106.327 143.491 108.097 144.063C111.636 145.206 115.122 146.207 118.554 147.067C121.987 147.925 125.365 148.642 128.688 149.215C135.333 150.362 141.756 150.938 147.944 150.938C154.594 150.938 161.274 150.074 167.742 148.43C174.21 146.786 180.466 144.361 186.266 141.238C190.134 139.156 193.799 136.764 197.19 134.087C200.353 131.589 203.265 128.872 205.912 125.949C207.678 124 209.326 121.96 210.855 119.831C211.619 118.766 212.354 117.68 213.058 116.571C214.467 114.356 215.754 112.053 216.917 109.667C220.702 101.906 223.074 93.439 224.009 84.406C224.311 81.485 224.466 78.505 224.466 75.469C224.466 72.364 224.307 69.316 223.991 66.33Z"),T(n,"fill","#146EE6"),T(i,"fill-rule","evenodd"),T(i,"clip-rule","evenodd"),T(i,"d","M758.39 75.346C752.633 111.56 742.682 122.23 712.103 122.23C710.848 122.23 709.641 122.207 708.465 122.17C708.322 122.191 708.192 122.23 708.029 122.23H637.995C636.796 122.23 636.316 121.632 636.436 120.311L650.586 31.22C650.705 30.016 651.425 29.417 652.624 29.417H667.853C669.051 29.417 669.531 30.016 669.411 31.22L657.66 105.802H714.25V105.787C714.411 105.794 714.569 105.802 714.742 105.802C718.879 105.802 722.251 105.351 725.041 104.313C726.435 103.794 727.685 103.129 728.811 102.298C729.374 101.884 729.906 101.426 730.411 100.927C734.952 96.431 737.232 88.43 739.323 75.346C739.329 75.312 739.332 75.282 739.338 75.25C739.643 73.311 739.896 71.474 740.13 69.679C740.203 69.116 740.273 68.557 740.339 68.008C740.413 67.392 740.462 66.821 740.526 66.222C742.137 49.927 738.623 44.525 724.455 44.525C723.42 44.525 722.434 44.554 721.491 44.613C708.298 45.444 703.831 52.303 700.461 71.126C700.22 72.472 699.985 73.877 699.753 75.346C699.484 77.027 699.255 78.6 699.052 80.115C698.993 80.545 698.949 80.946 698.896 81.361C698.758 82.465 698.639 83.528 698.541 84.544C698.503 84.943 698.467 85.334 698.435 85.72C698.345 86.815 698.282 87.856 698.247 88.847C698.239 89.049 698.225 89.269 698.22 89.469C698.162 91.88 698.29 93.972 698.622 95.782C698.65 95.941 698.687 96.089 698.718 96.246C698.875 96.992 699.068 97.689 699.302 98.337C699.347 98.464 699.391 98.594 699.44 98.718C700.04 100.231 700.865 101.478 701.964 102.469C702.264 102.738 702.587 102.987 702.926 103.22H679.437C679.394 102.969 679.344 102.727 679.306 102.471H679.305C679.305 102.467 679.305 102.462 679.304 102.459C679.26 102.17 679.237 101.854 679.199 101.558C679.084 100.634 678.996 99.671 678.935 98.674C678.909 98.258 678.879 97.845 678.862 97.419C678.816 96.174 678.805 94.876 678.833 93.518C678.841 93.114 678.862 92.69 678.877 92.276C678.921 91.042 678.992 89.765 679.093 88.441C679.118 88.109 679.135 87.79 679.163 87.452C679.3 85.836 679.484 84.137 679.699 82.382C679.751 81.957 679.808 81.518 679.864 81.084C680.105 79.238 680.37 77.344 680.688 75.346C681.046 73.067 681.424 70.889 681.82 68.808C687.041 41.397 695.81 30.748 717.268 28.554C720.251 28.25 723.472 28.103 726.971 28.103C726.972 28.103 726.973 28.103 726.973 28.103C747.995 28.103 757.681 33.202 759.812 48.236C760.78 55.067 760.188 63.953 758.39 75.346ZM894.023 31.336L866.924 108.56C863.473 118.182 861.114 121.41 854.5 122.41C852.38 122.733 849.832 122.828 846.66 122.828C831.671 122.828 830.351 121.267 829.393 108.56L825.794 63.232V63.231L807.929 108.56C804.256 117.613 802.201 120.996 795.961 122.202C793.442 122.687 790.261 122.829 785.986 122.829C772.915 122.829 770.757 121.267 770.397 108.56L767.638 31.337C767.638 29.899 768.238 29.417 769.557 29.417H785.385C786.464 29.417 786.705 29.899 786.825 31.337L788.896 100.572V100.571C789.055 103.091 789.564 103.641 791.022 103.641C792.94 103.641 793.42 103.042 794.619 100.043L820.759 34.576C821.359 33.132 822.438 32.657 823.517 32.657H837.666C838.52 32.657 839.28 32.977 839.627 33.817C839.719 34.038 839.8 34.274 839.825 34.576L845.221 100.043C845.461 103.042 845.82 103.641 847.739 103.641C849.298 103.641 849.897 103.042 850.977 100.043L874.839 31.336C875.318 29.898 875.678 29.417 876.757 29.417H892.585C893.904 29.417 894.383 29.898 894.023 31.336ZM362.709 31.219L357.193 120.311C357.193 121.632 356.354 122.23 355.155 122.23H339.927C338.727 122.23 338.367 121.632 338.367 120.311L342.325 62.756L311.987 117.551C311.387 118.749 310.429 119.348 309.23 119.348H297.838C296.759 119.348 296.039 118.749 295.561 117.551L282.852 62.767L282.849 62.755L268.34 120.31C268.213 121.009 267.975 121.492 267.613 121.807C267.289 122.085 266.866 122.23 266.302 122.23H251.074C249.875 122.23 249.274 121.632 249.515 120.31L272.297 31.336C272.538 30.138 272.898 29.417 274.096 29.417H288.606C291.237 29.417 292.727 29.895 293.683 31.379C294.121 32.059 294.458 32.928 294.721 34.095L307.791 92.489L339.327 34.095C341.486 30.256 343.044 29.299 346.881 29.299H361.39C362.377 29.299 362.683 30.684 362.683 30.684C362.683 30.684 362.709 31.029 362.709 31.219ZM501.707 31.219L499.668 44.049C499.548 45.246 498.709 45.845 497.51 45.845H472.449L460.697 120.31C460.458 121.632 459.739 122.23 458.539 122.23H443.31C442.112 122.23 441.632 121.632 441.871 120.31L453.623 45.845H394.821L391.225 68.507V68.508H430.556C431.755 68.508 432.354 69.106 432.235 70.31L430.197 82.542C430.077 83.738 429.237 84.338 428.039 84.338H388.707L385.35 105.801H428.398C429.597 105.801 430.077 106.4 429.956 107.597L427.798 120.428C427.677 121.632 426.959 122.23 425.76 122.23H365.684C364.485 122.23 364.005 121.632 364.125 120.31L378.274 31.219C378.394 30.015 379.113 29.417 380.314 29.417H500.148C501.347 29.417 501.827 30.015 501.707 31.219ZM629.471 70.426L627.434 82.659C627.314 83.856 626.474 84.454 625.276 84.454H588.224L582.466 120.311C582.347 121.632 581.628 122.23 580.429 122.23H565.201C564.002 122.23 563.523 121.632 563.641 120.311L577.791 31.219C577.911 30.016 578.629 29.417 579.828 29.417H643.005C644.203 29.417 644.802 30.016 644.682 31.219L642.645 44.05C642.404 45.247 641.686 45.846 640.487 45.846H594.338L590.742 68.631H627.794C628.992 68.631 629.592 69.23 629.471 70.426ZM388.707 84.338H388.713L388.31 86.876L388.707 84.338ZM510.727 79.783L524.397 48.006C525.037 46.466 525.444 45.589 525.991 45.096C526.466 44.667 527.045 44.525 527.994 44.525C530.392 44.525 530.392 45.124 530.752 48.006L534.349 79.783H510.727ZM542.335 29.886C539.757 28.905 536.044 28.702 530.512 28.702C516.602 28.702 513.964 30.016 508.209 43.087L474.634 120.311C474.155 121.749 474.514 122.23 475.833 122.23H491.061C492.26 122.23 492.501 121.749 493.1 120.311L504.012 95.372H536.026L539.025 120.311C539.145 121.749 539.145 122.23 540.345 122.23H555.573C556.892 122.23 557.491 121.749 557.491 120.311L548.617 43.087C547.658 35.042 546.461 31.458 542.335 29.886Z"),T(i,"fill","white"),T(t,"width","895"),T(t,"height","151"),T(t,"viewBox","0 0 895 151"),T(t,"fill","none"),T(t,"xmlns","http://www.w3.org/2000/svg")},m(r,s){I(r,t,s),V(t,n),V(t,i)},d(r){r&&L(t)}}}function Qz(e){let t;function n(s,o){return s[0]?Jz:Zz}let i=n(e),r=i(e);return{c(){r.c(),t=Me()},m(s,o){r.m(s,o),I(s,t,o)},p(s,[o]){i!==(i=n(s))&&(r.d(1),r=i(s),r&&(r.c(),r.m(t.parentNode,t)))},i:ee,o:ee,d(s){s&&L(t),r.d(s)}}}function eB(e,t,n){let{light:i=!1}=t;return e.$$set=r=>{"light"in r&&n(0,i=r.light)},[i]}class tB extends ve{constructor(t){super(),be(this,t,eB,Qz,ye,{light:0})}}function nB(e){let t,n,i,r,s,o;r=new tB({});const a=e[1].default,u=mt(a,e,e[0],null);return{c(){t=H("aside"),n=H("div"),i=H("div"),de(r.$$.fragment),s=ze(),u&&u.c(),T(i,"class","logoContainer"),T(t,"class","svelte-1okdv0e")},m(l,c){I(l,t,c),V(t,n),V(n,i),ce(r,i,null),V(n,s),u&&u.m(n,null),o=!0},p(l,[c]){u&&u.p&&(!o||c&1)&&bt(u,a,l,l[0],o?yt(a,l[0],c,null):vt(l[0]),null)},i(l){o||(F(r.$$.fragment,l),F(u,l),o=!0)},o(l){N(r.$$.fragment,l),N(u,l),o=!1},d(l){l&&L(t),fe(r),u&&u.d(l)}}}function iB(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class rB extends ve{constructor(t){super(),be(this,t,iB,nB,ye,{})}}function D6(e){let t,n;return{c(){t=H("td"),n=Oe(e[0]),T(t,"class","idCell svelte-pt8vzv"),T(t,"data-component","artifact-row")},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&1&&Ke(n,i[0])},d(i){i&&L(t)}}}function sB(e){let t,n,i,r,s=e[1].data+"",o,a,u=e[0]!==null&&D6(e);return{c(){t=H("tr"),u&&u.c(),n=ze(),i=H("td"),r=H("code"),o=Oe(s),T(r,"class","mono"),T(i,"class","codeCell svelte-pt8vzv"),T(i,"colspan",a=e[0]===null?2:1),T(i,"data-component","artifact-row")},m(l,c){I(l,t,c),u&&u.m(t,null),V(t,n),V(t,i),V(i,r),V(r,o),e[3](r)},p(l,[c]){l[0]!==null?u?u.p(l,c):(u=D6(l),u.c(),u.m(t,n)):u&&(u.d(1),u=null),c&2&&s!==(s=l[1].data+"")&&Ke(o,s),c&1&&a!==(a=l[0]===null?2:1)&&T(i,"colspan",a)},i:ee,o:ee,d(l){l&&L(t),u&&u.d(),e[3](null)}}}function oB(e,t,n){let{id:i}=t,{artifact:r}=t,s;function o(){var u;s&&!s.classList.contains("language-python")&&typeof window<"u"&&((u=window==null?void 0:window.Prism)==null||u.highlightElement(s))}function a(u){zi[u?"unshift":"push"](()=>{s=u,n(2,s)})}return e.$$set=u=>{"id"in u&&n(0,i=u.id),"artifact"in u&&n(1,r=u.artifact)},e.$$.update=()=>{e.$$.dirty&4&&s&&o()},[i,r,s,a]}class aB extends ve{constructor(t){super(),be(this,t,oB,sB,ye,{id:0,artifact:1})}}function T6(e,t,n){const i=e.slice();return i[2]=t[n],i}function M6(e){let t,n;return t=new aB({props:{id:e[2].name,artifact:e[2]}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p:ee,i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function uB(e){let t,n,i,r=je(e[0]),s=[];for(let a=0;aN(s[a],1,1,()=>{s[a]=null});return{c(){t=H("div"),n=H("table");for(let a=0;a{if(s.name&&o.name){if(s.name>o.name)return 1;if(s.name{"componentData"in s&&n(1,i=s.componentData)},[r,i]}class N6 extends ve{constructor(t){super(),be(this,t,lB,uB,ye,{componentData:1})}}function cB(e){let t,n,i;return{c(){t=H("div"),n=ze(),i=H("div"),T(t,"class","path topLeft svelte-19jpdwh"),T(i,"class","path bottomRight svelte-19jpdwh")},m(r,s){I(r,t,s),I(r,n,s),I(r,i,s)},d(r){r&&(L(t),L(n),L(i))}}}function fB(e){let t;return{c(){t=H("div"),T(t,"class","path straightLine svelte-19jpdwh")},m(n,i){I(n,t,i)},d(n){n&&L(t)}}}function dB(e){let t;return{c(){t=H("div"),T(t,"class","path loop svelte-19jpdwh")},m(n,i){I(n,t,i)},d(n){n&&L(t)}}}function hB(e){let t;function n(s,o){return s[6]?dB:s[5]?fB:cB}let i=n(e),r=i(e);return{c(){t=H("div"),r.c(),T(t,"class","connectorwrapper svelte-19jpdwh"),_i(t,"top",e[1]+"rem"),_i(t,"left",e[0]+"rem"),_i(t,"width",e[3]+"rem"),_i(t,"height",e[4]+"rem"),ni(t,"flip",e[2])},m(s,o){I(s,t,o),r.m(t,null)},p(s,[o]){i!==(i=n(s))&&(r.d(1),r=i(s),r&&(r.c(),r.m(t,null))),o&2&&_i(t,"top",s[1]+"rem"),o&1&&_i(t,"left",s[0]+"rem"),o&8&&_i(t,"width",s[3]+"rem"),o&16&&_i(t,"height",s[4]+"rem"),o&4&&ni(t,"flip",s[2])},i:ee,o:ee,d(s){s&&L(t),r.d()}}}const Ea=.5;function pB(e,t,n){let{top:i=0}=t,{left:r=0}=t,{bottom:s=0}=t,{right:o=0}=t,a,u,l,c=!1,f=!1;return e.$$set=d=>{"top"in d&&n(1,i=d.top),"left"in d&&n(0,r=d.left),"bottom"in d&&n(8,s=d.bottom),"right"in d&&n(7,o=d.right)},e.$$.update=()=>{e.$$.dirty&415&&(n(2,a=o-r<0),n(3,u=Math.abs(o-r)),u<=Ea?(n(3,u=Ea),n(5,c=!0),n(0,r-=Ea/2)):(a?(n(0,r+=Ea/2),n(7,o-=Ea/2)):(n(0,r-=Ea/2),n(7,o+=Ea/2)),n(3,u=Math.abs(o-r))),n(4,l=s-i),l<0&&(n(6,f=!0),n(4,l=5.5),n(3,u=10.25)))},[r,i,a,u,l,c,f,o,s]}class gB extends ve{constructor(t){super(),be(this,t,pB,hB,ye,{top:1,left:0,bottom:8,right:7})}}function R6(e,t,n){const i=e.slice();return i[3]=t[n],i}function O6(e){let t,n;return t=new gB({props:{top:mo(e[3].top),left:mo(e[3].left),bottom:mo(e[3].bottom),right:mo(e[3].right)}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.top=mo(i[3].top)),r&1&&(s.left=mo(i[3].left)),r&1&&(s.bottom=mo(i[3].bottom)),r&1&&(s.right=mo(i[3].right)),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function mB(e){let t,n,i=je(e[0]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{"dagStructure"in o&&n(1,i=o.dagStructure),"container"in o&&n(2,r=o.container)},e.$$.update=()=>{if(e.$$.dirty&7&&(n(0,s=[]),r)){const o=r.getBoundingClientRect(),a=o.top,u=o.left;Object.values(i).forEach(l=>{var f;const c=l.node.getBoundingClientRect();(f=l.connections)==null||f.forEach(d=>{const h=i[d];if(!h){console.warn("Connection node not found:",d);return}const p=h.node.getBoundingClientRect(),g={top:c.bottom-a,left:c.left-u+c.width/2,bottom:p.top-a,right:p.left-u+p.width/2};n(0,s=[...s,g])})})}},[s,i,r]}class bB extends ve{constructor(t){super(),be(this,t,yB,mB,ye,{dagStructure:1,container:2})}}const L6="currentStep";function I6(e,t,n){const i=e.slice();return i[16]=t[n],i[18]=n,i}function P6(e){let t,n,i;return{c(){t=H("div"),n=Oe("x"),i=Oe(e[6]),T(t,"class","levelstoshow svelte-117ceti")},m(r,s){I(r,t,s),V(t,n),V(t,i)},p(r,s){s&64&&Ke(i,r[6])},d(r){r&&L(t)}}}function z6(e){let t,n;return{c(){t=H("div"),T(t,"class",n="level rectangle "+e[16]+" svelte-117ceti"),_i(t,"z-index",(e[18]+1)*-1),_i(t,"top",(e[18]+1)*B6+"px"),_i(t,"left",(e[18]+1)*B6+"px")},m(i,r){I(i,t,r)},p(i,r){r&128&&n!==(n="level rectangle "+i[16]+" svelte-117ceti")&&T(t,"class",n)},d(i){i&&L(t)}}}function vB(e){let t,n,i,r,s,o,a,u,l=e[2].doc+"",c,f,d,h=e[6]&&P6(e),p=je(e[7]),g=[];for(let m=0;m1&&(c=new Intl.NumberFormat().format(r.num_possible_tasks)),s=r.num_possible_tasks-1,Object.keys(f).forEach(v=>{const x=Number.parseInt(v);r.num_possible_tasks&&r.num_possible_tasks>x&&n(11,s=f[x])})):s*=xB,s>0&&(d=new Array(s).fill("")),d=d.map((v,x)=>{if(r.num_possible_tasks){const _=r.num_failed??0,E=r.successful_tasks??0;return(_-1)/r.num_possible_tasks>=(x+1)/d.length?"error":(_+E)/r.num_possible_tasks>=(x+1)/d.length?"success":"running"}return""});const h=C6(L6),p=i===h;r.failed||r.num_failed?u=!0:(r.num_possible_tasks??0)>(r.successful_tasks??0)?l=!0:r.num_possible_tasks&&r.num_possible_tasks===r.successful_tasks&&(a=!0);let g,m=!1;Wc(()=>{n(9,m=Kz(g))});function y(v){zi[v?"unshift":"push"](()=>{g=v,n(8,g)})}function b(v){zi[v?"unshift":"push"](()=>{o=v,n(0,o)})}return e.$$set=v=>{"name"in v&&n(1,i=v.name),"step"in v&&n(2,r=v.step),"numLevels"in v&&n(11,s=v.numLevels),"el"in v&&n(0,o=v.el)},[o,i,r,a,u,l,c,d,g,m,p,s,y,b]}let wB=class extends ve{constructor(t){super(),be(this,t,_B,vB,ye,{name:1,step:2,numLevels:11,el:0})}};function U6(e,t,n){const i=e.slice();return i[13]=t[n],i}function EB(e){let t,n,i,r,s,o,a;function u(h){e[11](h)}let l={name:e[2],numLevels:e[3],step:e[7]};e[5]!==void 0&&(l.el=e[5]),n=new wB({props:l}),zi.push(()=>g2(n,"el",u));let c=e[8]&&CB(e),f=e[7].box_ends&&SB(e),d=e[2]==="start"&&q6(e);return{c(){t=H("div"),de(n.$$.fragment),r=ze(),c&&c.c(),s=ze(),f&&f.c(),o=ze(),d&&d.c(),T(t,"class","stepwrapper svelte-18aex7a")},m(h,p){I(h,t,p),ce(n,t,null),V(t,r),c&&c.m(t,null),V(t,s),f&&f.m(t,null),V(t,o),d&&d.m(t,null),a=!0},p(h,p){const g={};p&4&&(g.name=h[2]),p&8&&(g.numLevels=h[3]),!i&&p&32&&(i=!0,g.el=h[5],h2(()=>i=!1)),n.$set(g),h[8]&&c.p(h,p),h[7].box_ends&&f.p(h,p),h[2]==="start"?d?(d.p(h,p),p&4&&F(d,1)):(d=q6(h),d.c(),F(d,1),d.m(t,null)):d&&($e(),N(d,1,1,()=>{d=null}),Se())},i(h){a||(F(n.$$.fragment,h),F(c),F(f),F(d),a=!0)},o(h){N(n.$$.fragment,h),N(c),N(f),N(d),a=!1},d(h){h&&L(t),fe(n),c&&c.d(),f&&f.d(),d&&d.d()}}}function CB(e){let t,n,i,r,s=je(e[7].next),o=[];for(let u=0;uN(o[u],1,1,()=>{o[u]=null});return{c(){t=H("div"),n=ze(),i=H("div");for(let u=0;u{o[c]=null}),Se(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i))},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),o[t].d(u)}}}function SB(e){let t,n,i,r;return i=new Uh({props:{steps:e[1],stepName:e[7].box_ends,levels:e[3],dagStructure:e[0],pathToStep:e[6],joins:e[4]}}),{c(){t=H("div"),n=ze(),de(i.$$.fragment),T(t,"class","gap svelte-18aex7a")},m(s,o){I(s,t,o),I(s,n,o),ce(i,s,o),r=!0},p(s,o){const a={};o&2&&(a.steps=s[1]),o&8&&(a.levels=s[3]),o&1&&(a.dagStructure=s[0]),o&16&&(a.joins=s[4]),i.$set(a)},i(s){r||(F(i.$$.fragment,s),r=!0)},o(s){N(i.$$.fragment,s),r=!1},d(s){s&&(L(t),L(n)),fe(i,s)}}}function q6(e){let t,n,i,r;return i=new Uh({props:{steps:e[1],stepName:"end",levels:e[3],dagStructure:e[0]}}),{c(){t=H("div"),n=ze(),de(i.$$.fragment),T(t,"class","gap svelte-18aex7a")},m(s,o){I(s,t,o),I(s,n,o),ce(i,s,o),r=!0},p(s,o){const a={};o&2&&(a.steps=s[1]),o&8&&(a.levels=s[3]),o&1&&(a.dagStructure=s[0]),i.$set(a)},i(s){r||(F(i.$$.fragment,s),r=!0)},o(s){N(i.$$.fragment,s),r=!1},d(s){s&&(L(t),L(n)),fe(i,s)}}}function FB(e){let t,n,i=e[7]&&EB(e);return{c(){i&&i.c(),t=Me()},m(r,s){i&&i.m(r,s),I(r,t,s),n=!0},p(r,[s]){r[7]&&i.p(r,s)},i(r){n||(F(i),n=!0)},o(r){N(i),n=!1},d(r){r&&L(t),i&&i.d(r)}}}function DB(e,t,n){var m;let{steps:i}=t,{stepName:r}=t,{levels:s=0}=t,{joins:o=[]}=t,{pathToStep:a=""}=t,{dagStructure:u={}}=t,l=null;const c=a?`${a}/${r}`:r,f=i[r];Wc(()=>{if(u[c]){console.log("Node already registered:",c);return}if(!l){console.warn("Step element not found:",c);return}const y=[];for(const b of f.next){const v=i[b];if((v==null?void 0:v.type)==="join"){const x=o.find(_=>_.endsWith("/"+b));x&&y.push(x)}else b==="end"?y.push("end"):b===r?y.push(c):y.push(c+"/"+b)}n(0,u[c]={stepName:r,pathToStep:a,connections:y,node:l},u)});let h=(m=f==null?void 0:f.next)==null?void 0:m.find(y=>{var b;return((b=i[y])==null?void 0:b.type)!=="join"&&y!=="end"});const p=(f==null?void 0:f.type)==="foreach"?s+1:(f==null?void 0:f.type)==="join"?s-1:s;function g(y){l=y,n(5,l)}return e.$$set=y=>{"steps"in y&&n(1,i=y.steps),"stepName"in y&&n(2,r=y.stepName),"levels"in y&&n(3,s=y.levels),"joins"in y&&n(4,o=y.joins),"pathToStep"in y&&n(10,a=y.pathToStep),"dagStructure"in y&&n(0,u=y.dagStructure)},[u,i,r,s,o,l,c,f,h,p,a,g]}class Uh extends ve{constructor(t){super(),be(this,t,DB,FB,ye,{steps:1,stepName:2,levels:3,joins:4,pathToStep:10,dagStructure:0})}}function TB(e){let t;return{c(){t=H("p"),t.textContent="No start step"},m(n,i){I(n,t,i)},p:ee,i:ee,o:ee,d(n){n&&L(t)}}}function MB(e){let t,n,i;function r(o){e[6](o)}let s={steps:e[3],stepName:"start"};return e[1]!==void 0&&(s.dagStructure=e[1]),t=new Uh({props:s}),zi.push(()=>g2(t,"dagStructure",r)),{c(){de(t.$$.fragment)},m(o,a){ce(t,o,a),i=!0},p(o,a){const u={};!n&&a&2&&(n=!0,u.dagStructure=o[1],h2(()=>n=!1)),t.$set(u)},i(o){i||(F(t.$$.fragment,o),i=!0)},o(o){N(t.$$.fragment,o),i=!1},d(o){fe(t,o)}}}function W6(e){let t,n;return t=new bB({props:{dagStructure:e[1],container:e[0]}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.dagStructure=i[1]),r&1&&(s.container=i[0]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function NB(e){let t,n,i,r,s,o,a;const u=[MB,TB],l=[];function c(d,h){var p;return(p=d[3])!=null&&p.start?0:1}n=c(e),i=l[n]=u[n](e);let f=!e[2]&&W6(e);return{c(){t=H("div"),i.c(),r=ze(),f&&f.c(),_i(t,"position","relative"),_i(t,"line-height","1"),T(t,"data-component","dag")},m(d,h){I(d,t,h),l[n].m(t,null),V(t,r),f&&f.m(t,null),e[7](t),s=!0,o||(a=Ku(window,"resize",e[4]),o=!0)},p(d,[h]){i.p(d,h),d[2]?f&&($e(),N(f,1,1,()=>{f=null}),Se()):f?(f.p(d,h),h&4&&F(f,1)):(f=W6(d),f.c(),F(f,1),f.m(t,null))},i(d){s||(F(i),F(f),s=!0)},o(d){N(i),N(f),s=!1},d(d){d&&L(t),l[n].d(),f&&f.d(),e[7](null),o=!1,a()}}}const RB=100;function OB(e,t,n){var h;let i;zh(e,wa,p=>n(9,i=p));let{componentData:r}=t;const{data:s}=r;let o,a={};E6(L6,Xz((h=i==null?void 0:i.metadata)==null?void 0:h.pathspec,"stepname"));let u,l=!1;const c=()=>{n(2,l=!0),clearTimeout(u),u=setTimeout(()=>{n(2,l=!1)},RB)};function f(p){a=p,n(1,a)}function d(p){zi[p?"unshift":"push"](()=>{o=p,n(0,o)})}return e.$$set=p=>{"componentData"in p&&n(5,r=p.componentData)},[o,a,l,s,c,r,f,d]}class H6 extends ve{constructor(t){super(),be(this,t,OB,NB,ye,{componentData:5})}}function LB(e){var r;let t,n=(((r=e[0])==null?void 0:r.text)||"")+"",i;return{c(){t=H("h2"),i=Oe(n),T(t,"class","title svelte-117s0ws"),T(t,"data-component","title")},m(s,o){I(s,t,o),V(t,i)},p(s,[o]){var a;o&1&&n!==(n=(((a=s[0])==null?void 0:a.text)||"")+"")&&Ke(i,n)},i:ee,o:ee,d(s){s&&L(t)}}}function IB(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class G6 extends ve{constructor(t){super(),be(this,t,IB,LB,ye,{componentData:0})}}function PB(e){var r;let t,n=(((r=e[0])==null?void 0:r.text)||"")+"",i;return{c(){t=H("p"),i=Oe(n),T(t,"class","subtitle svelte-lu9pnn"),T(t,"data-component","subtitle")},m(s,o){I(s,t,o),V(t,i)},p(s,[o]){var a;o&1&&n!==(n=(((a=s[0])==null?void 0:a.text)||"")+"")&&Ke(i,n)},i:ee,o:ee,d(s){s&&L(t)}}}function zB(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class V6 extends ve{constructor(t){super(),be(this,t,zB,PB,ye,{componentData:0})}}function Y6(e){let t,n;return t=new G6({props:{componentData:{type:"title",text:e[1]}}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.componentData={type:"title",text:i[1]}),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function X6(e){let t,n;return t=new V6({props:{componentData:{type:"subtitle",text:e[0]}}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.componentData={type:"subtitle",text:i[0]}),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function BB(e){let t,n,i,r=e[1]&&Y6(e),s=e[0]&&X6(e);return{c(){t=H("header"),r&&r.c(),n=ze(),s&&s.c(),T(t,"class","container svelte-1ugmt5d"),T(t,"data-component","heading")},m(o,a){I(o,t,a),r&&r.m(t,null),V(t,n),s&&s.m(t,null),i=!0},p(o,[a]){o[1]?r?(r.p(o,a),a&2&&F(r,1)):(r=Y6(o),r.c(),F(r,1),r.m(t,n)):r&&($e(),N(r,1,1,()=>{r=null}),Se()),o[0]?s?(s.p(o,a),a&1&&F(s,1)):(s=X6(o),s.c(),F(s,1),s.m(t,null)):s&&($e(),N(s,1,1,()=>{s=null}),Se())},i(o){i||(F(r),F(s),i=!0)},o(o){N(r),N(s),i=!1},d(o){o&&L(t),r&&r.d(),s&&s.d()}}}function UB(e,t,n){let i,r,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(2,s=o.componentData)},e.$$.update=()=>{e.$$.dirty&4&&n(1,{title:i,subtitle:r}=s,i,(n(0,r),n(2,s)))},[r,i,s]}let K6=class extends ve{constructor(t){super(),be(this,t,UB,BB,ye,{componentData:2})}};function Z6(e){let t,n;return{c(){t=H("div"),n=Oe(e[2]),T(t,"class","label svelte-1x96yvr")},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&4&&Ke(n,i[2])},d(i){i&&L(t)}}}function J6(e){let t,n;return{c(){t=H("figcaption"),n=Oe(e[1]),T(t,"class","description svelte-1x96yvr")},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&2&&Ke(n,i[1])},d(i){i&&L(t)}}}function jB(e){let t,n,i,r,s,o,a,u,l,c=e[2]&&Z6(e),f=e[1]&&J6(e);return{c(){t=H("figure"),n=H("div"),i=H("img"),o=ze(),c&&c.c(),a=ze(),f&&f.c(),Ph(i.src,r=e[3])||T(i,"src",r),T(i,"alt",s=e[2]||"image"),T(i,"class","svelte-1x96yvr"),T(n,"class","imageContainer"),T(t,"data-component","image"),T(t,"class","svelte-1x96yvr")},m(d,h){I(d,t,h),V(t,n),V(n,i),V(t,o),c&&c.m(t,null),V(t,a),f&&f.m(t,null),u||(l=Ku(t,"click",e[4]),u=!0)},p(d,[h]){h&8&&!Ph(i.src,r=d[3])&&T(i,"src",r),h&4&&s!==(s=d[2]||"image")&&T(i,"alt",s),d[2]?c?c.p(d,h):(c=Z6(d),c.c(),c.m(t,a)):c&&(c.d(1),c=null),d[1]?f?f.p(d,h):(f=J6(d),f.c(),f.m(t,null)):f&&(f.d(1),f=null)},i:ee,o:ee,d(d){d&&L(t),c&&c.d(),f&&f.d(),u=!1,l()}}}function qB(e,t,n){let i,r,s,{componentData:o}=t;const a=()=>Hc.set(o);return e.$$set=u=>{"componentData"in u&&n(0,o=u.componentData)},e.$$.update=()=>{e.$$.dirty&1&&n(3,{src:i,label:r,description:s}=o,i,(n(2,r),n(0,o)),(n(1,s),n(0,o)))},[o,s,r,i,a]}let Q6=class extends ve{constructor(t){super(),be(this,t,qB,jB,ye,{componentData:0})}};function WB(e){let t,n,i,r,s=e[0].data+"",o,a,u;return{c(){t=H("pre"),n=Oe(` + `),i=H("code"),r=Oe(` + `),o=Oe(s),a=Oe(` + `),u=Oe(` +`),T(i,"class","mono language-log"),T(t,"class","log svelte-1jhmsu"),T(t,"data-component","log")},m(l,c){I(l,t,c),V(t,n),V(t,i),V(i,r),V(i,o),V(i,a),e[2](i),V(t,u)},p(l,[c]){c&1&&s!==(s=l[0].data+"")&&Ke(o,s)},i:ee,o:ee,d(l){l&&L(t),e[2](null)}}}function HB(e,t,n){let{componentData:i}=t,r;function s(){var a;r&&((a=window==null?void 0:window.Prism)==null||a.highlightElement(r))}function o(a){zi[a?"unshift":"push"](()=>{r=a,n(1,r)})}return e.$$set=a=>{"componentData"in a&&n(0,i=a.componentData)},e.$$.update=()=>{e.$$.dirty&2&&r&&s()},[i,r,o]}let e4=class extends ve{constructor(t){super(),be(this,t,HB,WB,ye,{componentData:0})}};function GB(){const e=console.warn;console.warn=t=>{t.includes("unknown prop")||t.includes("unexpected slot")||e(t)},Wc(()=>{console.warn=e})}function t4(e,t,n){const i=e.slice();return i[18]=t[n],i}function n4(e,t,n){const i=e.slice();return i[18]=t[n],i}function i4(e,t,n){const i=e.slice();return i[10]=t[n],i}function r4(e,t,n){const i=e.slice();return i[13]=t[n],i[15]=n,i}function s4(e,t,n){const i=e.slice();return i[16]=t[n],i[15]=n,i}function o4(e,t,n){const i=e.slice();return i[7]=t[n],i}function VB(e){let t,n,i,r;const s=[ZB,KB,XB],o=[];function a(u,l){return u[0]==="table"?0:u[0]==="list"?1:2}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Me()},m(u,l){o[t].m(u,l),I(u,i,l),r=!0},p(u,l){let c=t;t=a(u),t===c?o[t].p(u,l):($e(),N(o[c],1,1,()=>{o[c]=null}),Se(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i))},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),o[t].d(u)}}}function YB(e){let t,n,i=je(e[1]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{fe(l,1)}),Se()}s?(t=Ze(s,o(a,u)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(s){const l=u&64?wi(r,[ar(a[6])]):{};u&8388706&&(l.$$scope={dirty:u,ctx:a}),t.$set(l)}},i(a){i||(t&&F(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&L(n),t&&fe(t,a)}}}function KB(e){let t,n,i,r;const s=[nU,tU],o=[];function a(u,l){return u[4]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Me()},m(u,l){o[t].m(u,l),I(u,i,l),r=!0},p(u,l){let c=t;t=a(u),t===c?o[t].p(u,l):($e(),N(o[c],1,1,()=>{o[c]=null}),Se(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i))},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),o[t].d(u)}}}function ZB(e){let t,n,i;var r=e[5].table;function s(o,a){return{props:{$$slots:{default:[hU]},$$scope:{ctx:o}}}}return r&&(t=Ze(r,s(e))),{c(){t&&de(t.$$.fragment),n=Me()},m(o,a){t&&ce(t,o,a),I(o,n,a),i=!0},p(o,a){if(a&32&&r!==(r=o[5].table)){if(t){$e();const u=t;N(u.$$.fragment,1,0,()=>{fe(u,1)}),Se()}r?(t=Ze(r,s(o)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(r){const u={};a&8388716&&(u.$$scope={dirty:a,ctx:o}),t.$set(u)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&fe(t,o)}}}function JB(e){let t=e[6].raw+"",n;return{c(){n=Oe(t)},m(i,r){I(i,n,r)},p(i,r){r&64&&t!==(t=i[6].raw+"")&&Ke(n,t)},i:ee,o:ee,d(i){i&&L(n)}}}function QB(e){let t,n;return t=new Ca({props:{tokens:e[1],renderers:e[5]}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.tokens=i[1]),r&32&&(s.renderers=i[5]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function eU(e){let t,n,i,r;const s=[QB,JB],o=[];function a(u,l){return u[1]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Me()},m(u,l){o[t].m(u,l),I(u,i,l),r=!0},p(u,l){let c=t;t=a(u),t===c?o[t].p(u,l):($e(),N(o[c],1,1,()=>{o[c]=null}),Se(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i))},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),o[t].d(u)}}}function tU(e){let t,n,i;const r=[{ordered:e[4]},e[6]];var s=e[5].list;function o(a,u){let l={$$slots:{default:[rU]},$$scope:{ctx:a}};for(let c=0;c{fe(l,1)}),Se()}s?(t=Ze(s,o(a,u)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(s){const l=u&80?wi(r,[u&16&&{ordered:a[4]},u&64&&ar(a[6])]):{};u&8388704&&(l.$$scope={dirty:u,ctx:a}),t.$set(l)}},i(a){i||(t&&F(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&L(n),t&&fe(t,a)}}}function nU(e){let t,n,i;const r=[{ordered:e[4]},e[6]];var s=e[5].list;function o(a,u){let l={$$slots:{default:[oU]},$$scope:{ctx:a}};for(let c=0;c{fe(l,1)}),Se()}s?(t=Ze(s,o(a,u)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(s){const l=u&80?wi(r,[u&16&&{ordered:a[4]},u&64&&ar(a[6])]):{};u&8388704&&(l.$$scope={dirty:u,ctx:a}),t.$set(l)}},i(a){i||(t&&F(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&L(n),t&&fe(t,a)}}}function iU(e){let t,n,i;return t=new Ca({props:{tokens:e[18].tokens,renderers:e[5]}}),{c(){de(t.$$.fragment),n=ze()},m(r,s){ce(t,r,s),I(r,n,s),i=!0},p(r,s){const o={};s&64&&(o.tokens=r[18].tokens),s&32&&(o.renderers=r[5]),t.$set(o)},i(r){i||(F(t.$$.fragment,r),i=!0)},o(r){N(t.$$.fragment,r),i=!1},d(r){r&&L(n),fe(t,r)}}}function a4(e){let t,n,i;const r=[e[18]];var s=e[5].unorderedlistitem||e[5].listitem;function o(a,u){let l={$$slots:{default:[iU]},$$scope:{ctx:a}};for(let c=0;c{fe(l,1)}),Se()}s?(t=Ze(s,o(a,u)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(s){const l=u&64?wi(r,[ar(a[18])]):{};u&8388704&&(l.$$scope={dirty:u,ctx:a}),t.$set(l)}},i(a){i||(t&&F(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&L(n),t&&fe(t,a)}}}function rU(e){let t,n,i=je(e[6].items),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{fe(l,1)}),Se()}s?(t=Ze(s,o(a,u)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(s){const l=u&64?wi(r,[ar(a[18])]):{};u&8388704&&(l.$$scope={dirty:u,ctx:a}),t.$set(l)}},i(a){i||(t&&F(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&L(n),t&&fe(t,a)}}}function oU(e){let t,n,i=je(e[6].items),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{fe(u,1)}),Se()}r?(t=Ze(r,s(o)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(r){const u={};a&64&&(u.align=o[6].align[o[15]]||"center"),a&8388644&&(u.$$scope={dirty:a,ctx:o}),t.$set(u)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&fe(t,o)}}}function uU(e){let t,n,i=je(e[2]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{fe(u,1)}),Se()}r?(t=Ze(r,s(o)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(r){const u={};a&8388708&&(u.$$scope={dirty:a,ctx:o}),t.$set(u)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&fe(t,o)}}}function cU(e){let t,n;return t=new Ca({props:{tokens:e[13].tokens,renderers:e[5]}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,r){const s={};r&8&&(s.tokens=i[13].tokens),r&32&&(s.renderers=i[5]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function c4(e){let t,n,i;var r=e[5].tablecell;function s(o,a){return{props:{header:!1,align:o[6].align[o[15]]||"center",$$slots:{default:[cU]},$$scope:{ctx:o}}}}return r&&(t=Ze(r,s(e))),{c(){t&&de(t.$$.fragment),n=Me()},m(o,a){t&&ce(t,o,a),I(o,n,a),i=!0},p(o,a){if(a&32&&r!==(r=o[5].tablecell)){if(t){$e();const u=t;N(u.$$.fragment,1,0,()=>{fe(u,1)}),Se()}r?(t=Ze(r,s(o)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(r){const u={};a&64&&(u.align=o[6].align[o[15]]||"center"),a&8388648&&(u.$$scope={dirty:a,ctx:o}),t.$set(u)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&fe(t,o)}}}function fU(e){let t,n,i=je(e[10]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{fe(u,1)}),Se()}r?(t=Ze(r,s(o)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(r){const u={};a&8388712&&(u.$$scope={dirty:a,ctx:o}),t.$set(u)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&fe(t,o)}}}function dU(e){let t,n,i=je(e[3]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{fe(d,1)}),Se()}o?(t=Ze(o,a(c)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(o){const d={};f&8388708&&(d.$$scope={dirty:f,ctx:c}),t.$set(d)}if(f&32&&u!==(u=c[5].tablebody)){if(i){$e();const d=i;N(d.$$.fragment,1,0,()=>{fe(d,1)}),Se()}u?(i=Ze(u,l(c)),de(i.$$.fragment),F(i.$$.fragment,1),ce(i,r.parentNode,r)):i=null}else if(u){const d={};f&8388712&&(d.$$scope={dirty:f,ctx:c}),i.$set(d)}},i(c){s||(t&&F(t.$$.fragment,c),i&&F(i.$$.fragment,c),s=!0)},o(c){t&&N(t.$$.fragment,c),i&&N(i.$$.fragment,c),s=!1},d(c){c&&(L(n),L(r)),t&&fe(t,c),i&&fe(i,c)}}}function d4(e){let t,n;const i=[e[7],{renderers:e[5]}];let r={};for(let s=0;s{o[c]=null}),Se()),~t?(n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i)):n=null)},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),~t&&o[t].d(u)}}}function gU(e,t,n){const i=["type","tokens","header","rows","ordered","renderers"];let r=v6(t,i),{type:s=void 0}=t,{tokens:o=void 0}=t,{header:a=void 0}=t,{rows:u=void 0}=t,{ordered:l=!1}=t,{renderers:c}=t;return GB(),e.$$set=f=>{t=Be(Be({},t),u2(f)),n(6,r=v6(t,i)),"type"in f&&n(0,s=f.type),"tokens"in f&&n(1,o=f.tokens),"header"in f&&n(2,a=f.header),"rows"in f&&n(3,u=f.rows),"ordered"in f&&n(4,l=f.ordered),"renderers"in f&&n(5,c=f.renderers)},[s,o,a,u,l,c,r]}let Ca=class extends ve{constructor(t){super(),be(this,t,gU,pU,ye,{type:0,tokens:1,header:2,rows:3,ordered:4,renderers:5})}};function m2(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let yo=m2();function h4(e){yo=e}const p4=/[&<>"']/,mU=new RegExp(p4.source,"g"),g4=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,yU=new RegExp(g4.source,"g"),bU={"&":"&","<":"<",">":">",'"':""","'":"'"},m4=e=>bU[e];function _n(e,t){if(t){if(p4.test(e))return e.replace(mU,m4)}else if(g4.test(e))return e.replace(yU,m4);return e}const vU=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function y4(e){return e.replace(vU,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const xU=/(^|[^\[])\^/g;function rt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(i,r)=>(r=r.source||r,r=r.replace(xU,"$1"),e=e.replace(i,r),n),getRegex:()=>new RegExp(e,t)};return n}const _U=/[^\w:]/g,wU=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function b4(e,t,n){if(e){let i;try{i=decodeURIComponent(y4(n)).replace(_U,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}t&&!wU.test(n)&&(n=AU(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const jh={},EU=/^[^:]+:\/*[^/]*$/,CU=/^([^:]+:)[\s\S]*$/,kU=/^([^:]+:\/*[^/]*)[\s\S]*$/;function AU(e,t){jh[" "+e]||(EU.test(e)?jh[" "+e]=e+"/":jh[" "+e]=Wh(e,"/",!0)),e=jh[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(CU,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(kU,"$1")+t:e+t}const qh={exec:function(){}};function v4(e,t){const n=e.replace(/\|/g,(s,o,a)=>{let u=!1,l=o;for(;--l>=0&&a[l]==="\\";)u=!u;return u?"|":" |"}),i=n.split(/ \|/);let r=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length{const s=r.match(/^\s+/);if(s===null)return r;const[o]=s;return o.length>=i.length?r.slice(i.length):r}).join(` `)}class Hh{constructor(t){this.options=t||yo}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const i=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?i:Wh(i,` -`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const i=n[0],r=kU(i,n[3]||"");return{type:"code",raw:i,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:r}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let i=n[2].trim();if(/#$/.test(i)){const r=Wh(i,"#");(this.options.pedantic||!r||/ $/.test(r))&&(i=r.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const i=n[0].replace(/^ *>[ \t]?/gm,""),r=this.lexer.state.top;this.lexer.state.top=!0;const s=this.lexer.blockTokens(i);return this.lexer.state.top=r,{type:"blockquote",raw:n[0],tokens:s,text:i}}}list(t){let n=this.rules.block.list.exec(t);if(n){let i,r,s,o,a,u,l,c,f,d,h,p,g=n[1].trim();const m=g.length>1,y={type:"list",raw:"",ordered:m,start:m?+g.slice(0,-1):"",loose:!1,items:[]};g=m?`\\d{1,9}\\${g.slice(-1)}`:`\\${g}`,this.options.pedantic&&(g=m?g:"[*+-]");const b=new RegExp(`^( {0,3}${g})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(p=!1,!(!(n=b.exec(t))||this.rules.block.hr.test(t)));){if(i=n[0],t=t.substring(i.length),c=n[2].split(` +`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const i=n[0],r=FU(i,n[3]||"");return{type:"code",raw:i,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:r}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let i=n[2].trim();if(/#$/.test(i)){const r=Wh(i,"#");(this.options.pedantic||!r||/ $/.test(r))&&(i=r.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const i=n[0].replace(/^ *>[ \t]?/gm,""),r=this.lexer.state.top;this.lexer.state.top=!0;const s=this.lexer.blockTokens(i);return this.lexer.state.top=r,{type:"blockquote",raw:n[0],tokens:s,text:i}}}list(t){let n=this.rules.block.list.exec(t);if(n){let i,r,s,o,a,u,l,c,f,d,h,p,g=n[1].trim();const m=g.length>1,y={type:"list",raw:"",ordered:m,start:m?+g.slice(0,-1):"",loose:!1,items:[]};g=m?`\\d{1,9}\\${g.slice(-1)}`:`\\${g}`,this.options.pedantic&&(g=m?g:"[*+-]");const b=new RegExp(`^( {0,3}${g})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(p=!1,!(!(n=b.exec(t))||this.rules.block.hr.test(t)));){if(i=n[0],t=t.substring(i.length),c=n[2].split(` `,1)[0].replace(/^\t+/,x=>" ".repeat(3*x.length)),f=t.split(` `,1)[0],this.options.pedantic?(o=2,h=c.trimLeft()):(o=n[2].search(/[^ ]/),o=o>4?1:o,h=c.slice(o),o+=n[1].length),u=!1,!c&&/^ *$/.test(f)&&(i+=f+` `,t=t.substring(f.length+1),p=!0),!p){const x=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),_=new RegExp(`^ {0,${Math.min(3,o-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),E=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:\`\`\`|~~~)`),w=new RegExp(`^ {0,${Math.min(3,o-1)}}#`);for(;t&&(d=t.split(` @@ -14,8 +14,8 @@ `+f}!u&&!f.trim()&&(u=!0),i+=d+` `,t=t.substring(d.length+1),c=f.slice(o)}}y.loose||(l?y.loose=!0:/\n *\n *$/.test(i)&&(l=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(h),r&&(s=r[0]!=="[ ] ",h=h.replace(/^\[[ xX]\] +/,""))),y.items.push({type:"list_item",raw:i,task:!!r,checked:s,loose:!1,text:h}),y.raw+=i}y.items[y.items.length-1].raw=i.trimRight(),y.items[y.items.length-1].text=h.trimRight(),y.raw=y.raw.trimRight();const v=y.items.length;for(a=0;aE.type==="space"),_=x.length>0&&x.some(E=>/\n.*\n/.test(E.raw));y.loose=_}if(y.loose)for(a=0;a$/,"$1").replace(this.rules.inline._escapes,"$1"):"",s=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:i,raw:n[0],href:r,title:s}}}table(t){const n=this.rules.block.table.exec(t);if(n){const i={type:"table",header:v4(n[1]).map(r=>({text:r})),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(` `):[]};if(i.header.length===i.align.length){i.raw=n[0];let r=i.align.length,s,o,a,u;for(s=0;s({text:l}));for(r=i.header.length,o=0;o/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):_n(n[0]):n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const i=n[2].trim();if(!this.options.pedantic&&/^$/.test(i))return;const o=Wh(i.slice(0,-1),"\\");if((i.length-o.length)%2===0)return}else{const o=EU(n[2],"()");if(o>-1){const u=(n[0].indexOf("!")===0?5:4)+n[1].length+o;n[2]=n[2].substring(0,o),n[0]=n[0].substring(0,u).trim(),n[3]=""}}let r=n[2],s="";if(this.options.pedantic){const o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);o&&(r=o[1],s=o[3])}else s=n[3]?n[3].slice(1,-1):"";return r=r.trim(),/^$/.test(i)?r=r.slice(1):r=r.slice(1,-1)),x4(n,{href:r&&r.replace(this.rules.inline._escapes,"$1"),title:s&&s.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(t,n){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let r=(i[2]||i[1]).replace(/\s+/g," ");if(r=n[r.toLowerCase()],!r){const s=i[0].charAt(0);return{type:"text",raw:s,text:s}}return x4(i,r,i[0],this.lexer)}}emStrong(t,n,i=""){let r=this.rules.inline.emStrong.lDelim.exec(t);if(!r||r[3]&&i.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!i||this.rules.inline.punctuation.exec(i)){const o=r[0].length-1;let a,u,l=o,c=0;const f=r[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(f.lastIndex=0,n=n.slice(-1*t.length+o);(r=f.exec(n))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(u=a.length,r[3]||r[4]){l+=u;continue}else if((r[5]||r[6])&&o%3&&!((o+u)%3)){c+=u;continue}if(l-=u,l>0)continue;u=Math.min(u,u+l+c);const d=t.slice(0,o+r.index+u+1);if(Math.min(o,u)%2){const p=d.slice(1,-1);return{type:"em",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}const h=d.slice(2,-2);return{type:"strong",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let i=n[2].replace(/\n/g," ");const r=/[^ ]/.test(i),s=/^ /.test(i)&&/ $/.test(i);return r&&s&&(i=i.substring(1,i.length-1)),i=_n(i,!0),{type:"codespan",raw:n[0],text:i}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t,n){const i=this.rules.inline.autolink.exec(t);if(i){let r,s;return i[2]==="@"?(r=_n(this.options.mangle?n(i[1]):i[1]),s="mailto:"+r):(r=_n(i[1]),s=r),{type:"link",raw:i[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(t,n){let i;if(i=this.rules.inline.url.exec(t)){let r,s;if(i[2]==="@")r=_n(this.options.mangle?n(i[0]):i[0]),s="mailto:"+r;else{let o;do o=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0];while(o!==i[0]);r=_n(i[0]),i[1]==="www."?s="http://"+i[0]:s=i[0]}return{type:"link",raw:i[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t,n){const i=this.rules.inline.text.exec(t);if(i){let r;return this.lexer.state.inRawBlock?r=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):_n(i[0]):i[0]:r=_n(this.options.smartypants?n(i[0]):i[0]),{type:"text",raw:i[0],text:r}}}}const Ce={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:qh,lheading:/^((?:(?!^bull ).|\n(?!\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};Ce._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Ce._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Ce.def=it(Ce.def).replace("label",Ce._label).replace("title",Ce._title).getRegex(),Ce.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ce.listItemStart=it(/^( *)(bull) */).replace("bull",Ce.bullet).getRegex(),Ce.list=it(Ce.list).replace(/bull/g,Ce.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ce.def.source+")").getRegex(),Ce._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ce._comment=/|$)/,Ce.html=it(Ce.html,"i").replace("comment",Ce._comment).replace("tag",Ce._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ce.lheading=it(Ce.lheading).replace(/bull/g,Ce.bullet).getRegex(),Ce.paragraph=it(Ce._paragraph).replace("hr",Ce.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ce._tag).getRegex(),Ce.blockquote=it(Ce.blockquote).replace("paragraph",Ce.paragraph).getRegex(),Ce.normal={...Ce},Ce.gfm={...Ce.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},Ce.gfm.table=it(Ce.gfm.table).replace("hr",Ce.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ce._tag).getRegex(),Ce.gfm.paragraph=it(Ce._paragraph).replace("hr",Ce.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Ce.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ce._tag).getRegex(),Ce.pedantic={...Ce.normal,html:it(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ce._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:qh,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:it(Ce.normal._paragraph).replace("hr",Ce.hr).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",Ce.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const ae={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:qh,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:qh,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`^|~",ae.punctuation=it(ae.punctuation,"u").replace(/punctuation/g,ae._punctuation).getRegex(),ae.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,ae.anyPunctuation=/\\[punct]/g,ae._escapes=/\\([punct])/g,ae._comment=it(Ce._comment).replace("(?:-->|$)","-->").getRegex(),ae.emStrong.lDelim=it(ae.emStrong.lDelim,"u").replace(/punct/g,ae._punctuation).getRegex(),ae.emStrong.rDelimAst=it(ae.emStrong.rDelimAst,"gu").replace(/punct/g,ae._punctuation).getRegex(),ae.emStrong.rDelimUnd=it(ae.emStrong.rDelimUnd,"gu").replace(/punct/g,ae._punctuation).getRegex(),ae.anyPunctuation=it(ae.anyPunctuation,"gu").replace(/punct/g,ae._punctuation).getRegex(),ae._escapes=it(ae._escapes,"gu").replace(/punct/g,ae._punctuation).getRegex(),ae._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ae._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,ae.autolink=it(ae.autolink).replace("scheme",ae._scheme).replace("email",ae._email).getRegex(),ae._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ae.tag=it(ae.tag).replace("comment",ae._comment).replace("attribute",ae._attribute).getRegex(),ae._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ae._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,ae._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ae.link=it(ae.link).replace("label",ae._label).replace("href",ae._href).replace("title",ae._title).getRegex(),ae.reflink=it(ae.reflink).replace("label",ae._label).replace("ref",Ce._label).getRegex(),ae.nolink=it(ae.nolink).replace("ref",Ce._label).getRegex(),ae.reflinkSearch=it(ae.reflinkSearch,"g").replace("reflink",ae.reflink).replace("nolink",ae.nolink).getRegex(),ae.normal={...ae},ae.pedantic={...ae.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:it(/^!?\[(label)\]\((.*?)\)/).replace("label",ae._label).getRegex(),reflink:it(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ae._label).getRegex()},ae.gfm={...ae.normal,escape:it(ae.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),t+="&#"+i+";";return t}class ur{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||yo,this.options.tokenizer=this.options.tokenizer||new Hh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:Ce.normal,inline:ae.normal};this.options.pedantic?(n.block=Ce.pedantic,n.inline=ae.pedantic):this.options.gfm&&(n.block=Ce.gfm,this.options.breaks?n.inline=ae.breaks:n.inline=ae.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ce,inline:ae}}static lex(t,n){return new ur(n).lex(t)}static lexInline(t,n){return new ur(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,` +`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:i,tokens:this.lexer.inline(i)}}}text(t){const n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){const n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:_n(n[1])}}tag(t){const n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&/^/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):_n(n[0]):n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const i=n[2].trim();if(!this.options.pedantic&&/^$/.test(i))return;const o=Wh(i.slice(0,-1),"\\");if((i.length-o.length)%2===0)return}else{const o=$U(n[2],"()");if(o>-1){const u=(n[0].indexOf("!")===0?5:4)+n[1].length+o;n[2]=n[2].substring(0,o),n[0]=n[0].substring(0,u).trim(),n[3]=""}}let r=n[2],s="";if(this.options.pedantic){const o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);o&&(r=o[1],s=o[3])}else s=n[3]?n[3].slice(1,-1):"";return r=r.trim(),/^$/.test(i)?r=r.slice(1):r=r.slice(1,-1)),x4(n,{href:r&&r.replace(this.rules.inline._escapes,"$1"),title:s&&s.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(t,n){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let r=(i[2]||i[1]).replace(/\s+/g," ");if(r=n[r.toLowerCase()],!r){const s=i[0].charAt(0);return{type:"text",raw:s,text:s}}return x4(i,r,i[0],this.lexer)}}emStrong(t,n,i=""){let r=this.rules.inline.emStrong.lDelim.exec(t);if(!r||r[3]&&i.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!i||this.rules.inline.punctuation.exec(i)){const o=r[0].length-1;let a,u,l=o,c=0;const f=r[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(f.lastIndex=0,n=n.slice(-1*t.length+o);(r=f.exec(n))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(u=a.length,r[3]||r[4]){l+=u;continue}else if((r[5]||r[6])&&o%3&&!((o+u)%3)){c+=u;continue}if(l-=u,l>0)continue;u=Math.min(u,u+l+c);const d=t.slice(0,o+r.index+u+1);if(Math.min(o,u)%2){const p=d.slice(1,-1);return{type:"em",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}const h=d.slice(2,-2);return{type:"strong",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let i=n[2].replace(/\n/g," ");const r=/[^ ]/.test(i),s=/^ /.test(i)&&/ $/.test(i);return r&&s&&(i=i.substring(1,i.length-1)),i=_n(i,!0),{type:"codespan",raw:n[0],text:i}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t,n){const i=this.rules.inline.autolink.exec(t);if(i){let r,s;return i[2]==="@"?(r=_n(this.options.mangle?n(i[1]):i[1]),s="mailto:"+r):(r=_n(i[1]),s=r),{type:"link",raw:i[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(t,n){let i;if(i=this.rules.inline.url.exec(t)){let r,s;if(i[2]==="@")r=_n(this.options.mangle?n(i[0]):i[0]),s="mailto:"+r;else{let o;do o=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0];while(o!==i[0]);r=_n(i[0]),i[1]==="www."?s="http://"+i[0]:s=i[0]}return{type:"link",raw:i[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t,n){const i=this.rules.inline.text.exec(t);if(i){let r;return this.lexer.state.inRawBlock?r=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):_n(i[0]):i[0]:r=_n(this.options.smartypants?n(i[0]):i[0]),{type:"text",raw:i[0],text:r}}}}const Ce={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:qh,lheading:/^((?:(?!^bull ).|\n(?!\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};Ce._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Ce._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Ce.def=rt(Ce.def).replace("label",Ce._label).replace("title",Ce._title).getRegex(),Ce.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ce.listItemStart=rt(/^( *)(bull) */).replace("bull",Ce.bullet).getRegex(),Ce.list=rt(Ce.list).replace(/bull/g,Ce.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ce.def.source+")").getRegex(),Ce._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ce._comment=/|$)/,Ce.html=rt(Ce.html,"i").replace("comment",Ce._comment).replace("tag",Ce._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ce.lheading=rt(Ce.lheading).replace(/bull/g,Ce.bullet).getRegex(),Ce.paragraph=rt(Ce._paragraph).replace("hr",Ce.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ce._tag).getRegex(),Ce.blockquote=rt(Ce.blockquote).replace("paragraph",Ce.paragraph).getRegex(),Ce.normal={...Ce},Ce.gfm={...Ce.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},Ce.gfm.table=rt(Ce.gfm.table).replace("hr",Ce.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ce._tag).getRegex(),Ce.gfm.paragraph=rt(Ce._paragraph).replace("hr",Ce.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Ce.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ce._tag).getRegex(),Ce.pedantic={...Ce.normal,html:rt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ce._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:qh,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:rt(Ce.normal._paragraph).replace("hr",Ce.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",Ce.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const ae={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:qh,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:qh,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`^|~",ae.punctuation=rt(ae.punctuation,"u").replace(/punctuation/g,ae._punctuation).getRegex(),ae.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,ae.anyPunctuation=/\\[punct]/g,ae._escapes=/\\([punct])/g,ae._comment=rt(Ce._comment).replace("(?:-->|$)","-->").getRegex(),ae.emStrong.lDelim=rt(ae.emStrong.lDelim,"u").replace(/punct/g,ae._punctuation).getRegex(),ae.emStrong.rDelimAst=rt(ae.emStrong.rDelimAst,"gu").replace(/punct/g,ae._punctuation).getRegex(),ae.emStrong.rDelimUnd=rt(ae.emStrong.rDelimUnd,"gu").replace(/punct/g,ae._punctuation).getRegex(),ae.anyPunctuation=rt(ae.anyPunctuation,"gu").replace(/punct/g,ae._punctuation).getRegex(),ae._escapes=rt(ae._escapes,"gu").replace(/punct/g,ae._punctuation).getRegex(),ae._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ae._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,ae.autolink=rt(ae.autolink).replace("scheme",ae._scheme).replace("email",ae._email).getRegex(),ae._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ae.tag=rt(ae.tag).replace("comment",ae._comment).replace("attribute",ae._attribute).getRegex(),ae._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ae._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,ae._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ae.link=rt(ae.link).replace("label",ae._label).replace("href",ae._href).replace("title",ae._title).getRegex(),ae.reflink=rt(ae.reflink).replace("label",ae._label).replace("ref",Ce._label).getRegex(),ae.nolink=rt(ae.nolink).replace("ref",Ce._label).getRegex(),ae.reflinkSearch=rt(ae.reflinkSearch,"g").replace("reflink",ae.reflink).replace("nolink",ae.nolink).getRegex(),ae.normal={...ae},ae.pedantic={...ae.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:rt(/^!?\[(label)\]\((.*?)\)/).replace("label",ae._label).getRegex(),reflink:rt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ae._label).getRegex()},ae.gfm={...ae.normal,escape:rt(ae.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),t+="&#"+i+";";return t}class ur{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||yo,this.options.tokenizer=this.options.tokenizer||new Hh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:Ce.normal,inline:ae.normal};this.options.pedantic?(n.block=Ce.pedantic,n.inline=ae.pedantic):this.options.gfm&&(n.block=Ce.gfm,this.options.breaks?n.inline=ae.breaks:n.inline=ae.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ce,inline:ae}}static lex(t,n){return new ur(n).lex(t)}static lexInline(t,n){return new ur(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,` `),this.blockTokens(t,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(t,n=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(a,u,l)=>u+" ".repeat(l.length));let i,r,s,o;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(i=a.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))){if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length),i.raw.length===1&&n.length>0?n[n.length-1].raw+=` `:n.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length),r=n[n.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=` `+i.raw,r.text+=` @@ -25,7 +25,7 @@ `+i.raw,r.text+=` `+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(i),o=s.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length),r=n[n.length-1],r&&r.type==="text"?(r.raw+=` `+i.raw,r.text+=` -`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(i);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let i,r,s,o=t,a,u,l;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)c.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,a.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(u||(l=""),u=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(i=c.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))){if(i=this.tokenizer.escape(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.tag(t)){t=t.substring(i.raw.length),r=n[n.length-1],r&&i.type==="text"&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(i=this.tokenizer.link(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(i.raw.length),r=n[n.length-1],r&&i.type==="text"&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(i=this.tokenizer.emStrong(t,o,l)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.codespan(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.br(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.del(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.autolink(t,_4)){t=t.substring(i.raw.length),n.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(t,_4))){t=t.substring(i.raw.length),n.push(i);continue}if(s=t,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const f=t.slice(1);let d;this.options.extensions.startInline.forEach(function(h){d=h.call({lexer:this},f),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(s=t.substring(0,c+1))}if(i=this.tokenizer.inlineText(s,AU)){t=t.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(l=i.raw.slice(-1)),u=!0,r=n[n.length-1],r&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}}let Gh=class{constructor(t){this.options=t||yo}code(t,n,i){const r=(n||"").match(/\S*/)[0];if(this.options.highlight){const s=this.options.highlight(t,r);s!=null&&s!==t&&(i=!0,t=s)}return t=t.replace(/\n$/,"")+` +`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(i);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let i,r,s,o=t,a,u,l;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)c.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,a.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(u||(l=""),u=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(i=c.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))){if(i=this.tokenizer.escape(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.tag(t)){t=t.substring(i.raw.length),r=n[n.length-1],r&&i.type==="text"&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(i=this.tokenizer.link(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(i.raw.length),r=n[n.length-1],r&&i.type==="text"&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(i=this.tokenizer.emStrong(t,o,l)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.codespan(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.br(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.del(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.autolink(t,_4)){t=t.substring(i.raw.length),n.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(t,_4))){t=t.substring(i.raw.length),n.push(i);continue}if(s=t,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const f=t.slice(1);let d;this.options.extensions.startInline.forEach(function(h){d=h.call({lexer:this},f),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(s=t.substring(0,c+1))}if(i=this.tokenizer.inlineText(s,DU)){t=t.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(l=i.raw.slice(-1)),u=!0,r=n[n.length-1],r&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}}let Gh=class{constructor(t){this.options=t||yo}code(t,n,i){const r=(n||"").match(/\S*/)[0];if(this.options.highlight){const s=this.options.highlight(t,r);s!=null&&s!==t&&(i=!0,t=s)}return t=t.replace(/\n$/,"")+` `,r?'
'+(i?t:_n(t,!0))+`
`:"
"+(i?t:_n(t,!0))+`
`}blockquote(t){return`
@@ -46,24 +46,24 @@ ${t}
${t} `}tablecell(t,n){const i=n.header?"th":"td";return(n.align?`<${i} align="${n.align}">`:`<${i}>`)+t+` `}strong(t){return`${t}`}em(t){return`${t}`}codespan(t){return`${t}`}br(){return this.options.xhtml?"
":"
"}del(t){return`${t}`}link(t,n,i){if(t=b4(this.options.sanitize,this.options.baseUrl,t),t===null)return i;let r='
",r}image(t,n,i){if(t=b4(this.options.sanitize,this.options.baseUrl,t),t===null)return i;let r=`${i}":">",r}text(t){return t}};class y2{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,i){return""+i}image(t,n,i){return""+i}br(){return""}}class Vh{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,n){let i=t,r=0;if(this.seen.hasOwnProperty(i)){r=this.seen[t];do r++,i=t+"-"+r;while(this.seen.hasOwnProperty(i))}return n||(this.seen[t]=r,this.seen[i]=0),i}slug(t,n={}){const i=this.serialize(t);return this.getNextSafeSlug(i,n.dryrun)}}class Ur{constructor(t){this.options=t||yo,this.options.renderer=this.options.renderer||new Gh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new y2,this.slugger=new Vh}static parse(t,n){return new Ur(n).parse(t)}static parseInline(t,n){return new Ur(n).parseInline(t)}parse(t,n=!0){let i="",r,s,o,a,u,l,c,f,d,h,p,g,m,y,b,v,x,_,E;const w=t.length;for(r=0;r0&&b.tokens[0].type==="paragraph"?(b.tokens[0].text=_+" "+b.tokens[0].text,b.tokens[0].tokens&&b.tokens[0].tokens.length>0&&b.tokens[0].tokens[0].type==="text"&&(b.tokens[0].tokens[0].text=_+" "+b.tokens[0].tokens[0].text)):b.tokens.unshift({type:"text",text:_}):y+=_),y+=this.parse(b.tokens,m),d+=this.renderer.listitem(y,x,v);i+=this.renderer.list(d,p,g);continue}case"html":{i+=this.renderer.html(h.text,h.block);continue}case"paragraph":{i+=this.renderer.paragraph(this.parseInline(h.tokens));continue}case"text":{for(d=h.tokens?this.parseInline(h.tokens):h.text;r+1{i=i.concat(this.walkTokens(r[s],n))}):r.tokens&&(i=i.concat(this.walkTokens(r.tokens,n)))}return i}use(...t){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{const r={...i};if(r.async=this.defaults.async||r.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if(s.renderer){const o=n.renderers[s.name];o?n.renderers[s.name]=function(...a){let u=s.renderer.apply(this,a);return u===!1&&(u=o.apply(this,a)),u}:n.renderers[s.name]=s.renderer}if(s.tokenizer){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");n[s.level]?n[s.level].unshift(s.tokenizer):n[s.level]=[s.tokenizer],s.start&&(s.level==="block"?n.startBlock?n.startBlock.push(s.start):n.startBlock=[s.start]:s.level==="inline"&&(n.startInline?n.startInline.push(s.start):n.startInline=[s.start]))}s.childTokens&&(n.childTokens[s.name]=s.childTokens)}),r.extensions=n),i.renderer){const s=this.defaults.renderer||new Gh(this.defaults);for(const o in i.renderer){const a=s[o];s[o]=(...u)=>{let l=i.renderer[o].apply(s,u);return l===!1&&(l=a.apply(s,u)),l}}r.renderer=s}if(i.tokenizer){const s=this.defaults.tokenizer||new Hh(this.defaults);for(const o in i.tokenizer){const a=s[o];s[o]=(...u)=>{let l=i.tokenizer[o].apply(s,u);return l===!1&&(l=a.apply(s,u)),l}}r.tokenizer=s}if(i.hooks){const s=this.defaults.hooks||new Gc;for(const o in i.hooks){const a=s[o];Gc.passThroughHooks.has(o)?s[o]=u=>{if(this.defaults.async)return Promise.resolve(i.hooks[o].call(s,u)).then(c=>a.call(s,c));const l=i.hooks[o].call(s,u);return a.call(s,l)}:s[o]=(...u)=>{let l=i.hooks[o].apply(s,u);return l===!1&&(l=a.apply(s,u)),l}}r.hooks=s}if(i.walkTokens){const s=this.defaults.walkTokens;r.walkTokens=function(o){let a=[];return a.push(i.walkTokens.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}}Yu=new WeakSet,g5=function(t,n){return(i,r,s)=>{typeof r=="function"&&(s=r,r=null);const o={...r};r={...this.defaults,...o};const a=a2(this,Yu,$z).call(this,r.silent,r.async,s);if(typeof i>"u"||i===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if(CU(r,s),r.hooks&&(r.hooks.options=r),s){const u=r.highlight;let l;try{r.hooks&&(i=r.hooks.preprocess(i)),l=t(i,r)}catch(d){return a(d)}const c=d=>{let h;if(!d)try{r.walkTokens&&this.walkTokens(l,r.walkTokens),h=n(l,r),r.hooks&&(h=r.hooks.postprocess(h))}catch(p){d=p}return r.highlight=u,d?a(d):s(null,h)};if(!u||u.length<3||(delete r.highlight,!l.length))return c();let f=0;this.walkTokens(l,d=>{d.type==="code"&&(f++,setTimeout(()=>{u(d.text,d.lang,(h,p)=>{if(h)return c(h);p!=null&&p!==d.text&&(d.text=p,d.escaped=!0),f--,f===0&&c()})},0))}),f===0&&c();return}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(i):i).then(u=>t(u,r)).then(u=>r.walkTokens?Promise.all(this.walkTokens(u,r.walkTokens)).then(()=>u):u).then(u=>n(u,r)).then(u=>r.hooks?r.hooks.postprocess(u):u).catch(a);try{r.hooks&&(i=r.hooks.preprocess(i));const u=t(i,r);r.walkTokens&&this.walkTokens(u,r.walkTokens);let l=n(u,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(u){return a(u)}}},$z=function(t,n,i){return r=>{if(r.message+=` -Please report this to https://github.com/markedjs/marked.`,t){const s="

An error occurred:

"+_n(r.message+"",!0)+"
";if(n)return Promise.resolve(s);if(i){i(null,s);return}return s}if(n)return Promise.reject(r);if(i){i(r);return}throw r}};const ka=new $U(yo);function st(e,t,n){return ka.parse(e,t,n)}st.options=st.setOptions=function(e){return ka.setOptions(e),st.defaults=ka.defaults,h4(st.defaults),st},st.getDefaults=m2,st.defaults=yo,st.use=function(...e){return ka.use(...e),st.defaults=ka.defaults,h4(st.defaults),st},st.walkTokens=function(e,t){return ka.walkTokens(e,t)},st.parseInline=ka.parseInline,st.Parser=Ur,st.parser=Ur.parse,st.Renderer=Gh,st.TextRenderer=y2,st.Lexer=ur,st.lexer=ur.lex,st.Tokenizer=Hh,st.Slugger=Vh,st.Hooks=Gc,st.parse=st,st.options,st.setOptions,st.use,st.walkTokens,st.parseInline,Ur.parse,ur.lex;const w4={};function SU(e){let t;return{c(){t=Be(e[1])},m(n,i){I(n,t,i)},p(n,i){i&2&&ft(t,n[1])},i:ee,o:ee,d(n){n&&L(t)}}}function FU(e){let t,n;const i=e[5].default,r=mt(i,e,e[4],null);return{c(){t=H("h6"),r&&r.c(),M(t,"id",e[2])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&bt(r,i,s,s[4],n?yt(i,s[4],o,null):vt(s[4]),null),(!n||o&4)&&M(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function DU(e){let t,n;const i=e[5].default,r=mt(i,e,e[4],null);return{c(){t=H("h5"),r&&r.c(),M(t,"id",e[2])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&bt(r,i,s,s[4],n?yt(i,s[4],o,null):vt(s[4]),null),(!n||o&4)&&M(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function TU(e){let t,n;const i=e[5].default,r=mt(i,e,e[4],null);return{c(){t=H("h4"),r&&r.c(),M(t,"id",e[2])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&bt(r,i,s,s[4],n?yt(i,s[4],o,null):vt(s[4]),null),(!n||o&4)&&M(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function MU(e){let t,n;const i=e[5].default,r=mt(i,e,e[4],null);return{c(){t=H("h3"),r&&r.c(),M(t,"id",e[2])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&bt(r,i,s,s[4],n?yt(i,s[4],o,null):vt(s[4]),null),(!n||o&4)&&M(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function NU(e){let t,n;const i=e[5].default,r=mt(i,e,e[4],null);return{c(){t=H("h2"),r&&r.c(),M(t,"id",e[2])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&bt(r,i,s,s[4],n?yt(i,s[4],o,null):vt(s[4]),null),(!n||o&4)&&M(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function RU(e){let t,n;const i=e[5].default,r=mt(i,e,e[4],null);return{c(){t=H("h1"),r&&r.c(),M(t,"id",e[2])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&bt(r,i,s,s[4],n?yt(i,s[4],o,null):vt(s[4]),null),(!n||o&4)&&M(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function OU(e){let t,n,i,r;const s=[RU,NU,MU,TU,DU,FU,SU],o=[];function a(u,l){return u[0]===1?0:u[0]===2?1:u[0]===3?2:u[0]===4?3:u[0]===5?4:u[0]===6?5:6}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Me()},m(u,l){o[t].m(u,l),I(u,i,l),r=!0},p(u,[l]){let c=t;t=a(u),t===c?o[t].p(u,l):($e(),N(o[c],1,1,()=>{o[c]=null}),Se(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i))},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),o[t].d(u)}}}function LU(e,t,n){let i,{$$slots:r={},$$scope:s}=t,{depth:o}=t,{raw:a}=t,{text:u}=t;const{slug:l,getOptions:c}=C5(w4),f=c();return e.$$set=d=>{"depth"in d&&n(0,o=d.depth),"raw"in d&&n(1,a=d.raw),"text"in d&&n(3,u=d.text),"$$scope"in d&&n(4,s=d.$$scope)},e.$$.update=()=>{e.$$.dirty&8&&n(2,i=f.headerIds?f.headerPrefix+l(u):void 0)},[o,a,i,u,s,r]}class IU extends xe{constructor(t){super(),ve(this,t,LU,OU,ye,{depth:0,raw:1,text:3})}}function PU(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("p"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function zU(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class BU extends xe{constructor(t){super(),ve(this,t,zU,PU,ye,{})}}function UU(e){let t;const n=e[3].default,i=mt(n,e,e[2],null);return{c(){i&&i.c()},m(r,s){i&&i.m(r,s),t=!0},p(r,[s]){i&&i.p&&(!t||s&4)&&bt(i,n,r,r[2],t?yt(n,r[2],s,null):vt(r[2]),null)},i(r){t||(F(i,r),t=!0)},o(r){N(i,r),t=!1},d(r){i&&i.d(r)}}}function jU(e,t,n){let{$$slots:i={},$$scope:r}=t,{text:s}=t,{raw:o}=t;return e.$$set=a=>{"text"in a&&n(0,s=a.text),"raw"in a&&n(1,o=a.raw),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}let qU=class extends xe{constructor(t){super(),ve(this,t,jU,UU,ye,{text:0,raw:1})}};function WU(e){let t,n;return{c(){t=H("img"),Ph(t.src,n=e[0])||M(t,"src",n),M(t,"title",e[1]),M(t,"alt",e[2])},m(i,r){I(i,t,r)},p(i,[r]){r&1&&!Ph(t.src,n=i[0])&&M(t,"src",n),r&2&&M(t,"title",i[1]),r&4&&M(t,"alt",i[2])},i:ee,o:ee,d(i){i&&L(t)}}}function HU(e,t,n){let{href:i=""}=t,{title:r=void 0}=t,{text:s=""}=t;return e.$$set=o=>{"href"in o&&n(0,i=o.href),"title"in o&&n(1,r=o.title),"text"in o&&n(2,s=o.text)},[i,r,s]}let GU=class extends xe{constructor(t){super(),ve(this,t,HU,WU,ye,{href:0,title:1,text:2})}};function VU(e){let t,n;const i=e[3].default,r=mt(i,e,e[2],null);return{c(){t=H("a"),r&&r.c(),M(t,"href",e[0]),M(t,"title",e[1])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&4)&&bt(r,i,s,s[2],n?yt(i,s[2],o,null):vt(s[2]),null),(!n||o&1)&&M(t,"href",s[0]),(!n||o&2)&&M(t,"title",s[1])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function YU(e,t,n){let{$$slots:i={},$$scope:r}=t,{href:s=""}=t,{title:o=void 0}=t;return e.$$set=a=>{"href"in a&&n(0,s=a.href),"title"in a&&n(1,o=a.title),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}class XU extends xe{constructor(t){super(),ve(this,t,YU,VU,ye,{href:0,title:1})}}function KU(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("em"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function ZU(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class JU extends xe{constructor(t){super(),ve(this,t,ZU,KU,ye,{})}}function QU(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("del"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function ej(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class tj extends xe{constructor(t){super(),ve(this,t,ej,QU,ye,{})}}function nj(e){let t,n=e[0].replace(/`/g,"")+"",i;return{c(){t=H("code"),i=Be(n)},m(r,s){I(r,t,s),V(t,i)},p(r,[s]){s&1&&n!==(n=r[0].replace(/`/g,"")+"")&&ft(i,n)},i:ee,o:ee,d(r){r&&L(t)}}}function ij(e,t,n){let{raw:i}=t;return e.$$set=r=>{"raw"in r&&n(0,i=r.raw)},[i]}class rj extends xe{constructor(t){super(),ve(this,t,ij,nj,ye,{raw:0})}}function sj(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("strong"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function oj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class aj extends xe{constructor(t){super(),ve(this,t,oj,sj,ye,{})}}function uj(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("table"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function lj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}let cj=class extends xe{constructor(t){super(),ve(this,t,lj,uj,ye,{})}};function fj(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("thead"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function dj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class hj extends xe{constructor(t){super(),ve(this,t,dj,fj,ye,{})}}function pj(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("tbody"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function gj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class mj extends xe{constructor(t){super(),ve(this,t,gj,pj,ye,{})}}function yj(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("tr"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function bj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class vj extends xe{constructor(t){super(),ve(this,t,bj,yj,ye,{})}}function xj(e){let t,n;const i=e[3].default,r=mt(i,e,e[2],null);return{c(){t=H("td"),r&&r.c(),M(t,"align",e[1])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&&bt(r,i,s,s[2],n?yt(i,s[2],o,null):vt(s[2]),null),(!n||o&2)&&M(t,"align",s[1])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function _j(e){let t,n;const i=e[3].default,r=mt(i,e,e[2],null);return{c(){t=H("th"),r&&r.c(),M(t,"align",e[1])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&&bt(r,i,s,s[2],n?yt(i,s[2],o,null):vt(s[2]),null),(!n||o&2)&&M(t,"align",s[1])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function wj(e){let t,n,i,r;const s=[_j,xj],o=[];function a(u,l){return u[0]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Me()},m(u,l){o[t].m(u,l),I(u,i,l),r=!0},p(u,[l]){let c=t;t=a(u),t===c?o[t].p(u,l):($e(),N(o[c],1,1,()=>{o[c]=null}),Se(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i))},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),o[t].d(u)}}}function Ej(e,t,n){let{$$slots:i={},$$scope:r}=t,{header:s}=t,{align:o}=t;return e.$$set=a=>{"header"in a&&n(0,s=a.header),"align"in a&&n(1,o=a.align),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}class Cj extends xe{constructor(t){super(),ve(this,t,Ej,wj,ye,{header:0,align:1})}}function kj(e){let t,n;const i=e[3].default,r=mt(i,e,e[2],null);return{c(){t=H("ul"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&&bt(r,i,s,s[2],n?yt(i,s[2],o,null):vt(s[2]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function Aj(e){let t,n;const i=e[3].default,r=mt(i,e,e[2],null);return{c(){t=H("ol"),r&&r.c(),M(t,"start",e[1])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&&bt(r,i,s,s[2],n?yt(i,s[2],o,null):vt(s[2]),null),(!n||o&2)&&M(t,"start",s[1])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function $j(e){let t,n,i,r;const s=[Aj,kj],o=[];function a(u,l){return u[0]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Me()},m(u,l){o[t].m(u,l),I(u,i,l),r=!0},p(u,[l]){let c=t;t=a(u),t===c?o[t].p(u,l):($e(),N(o[c],1,1,()=>{o[c]=null}),Se(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i))},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),o[t].d(u)}}}function Sj(e,t,n){let{$$slots:i={},$$scope:r}=t,{ordered:s}=t,{start:o}=t;return e.$$set=a=>{"ordered"in a&&n(0,s=a.ordered),"start"in a&&n(1,o=a.start),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}class Fj extends xe{constructor(t){super(),ve(this,t,Sj,$j,ye,{ordered:0,start:1})}}function Dj(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("li"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function Tj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class Mj extends xe{constructor(t){super(),ve(this,t,Tj,Dj,ye,{})}}function Nj(e){let t;return{c(){t=H("hr")},m(n,i){I(n,t,i)},p:ee,i:ee,o:ee,d(n){n&&L(t)}}}class Rj extends xe{constructor(t){super(),ve(this,t,null,Nj,ye,{})}}function Oj(e){let t,n;return{c(){t=new Rz(!1),n=Me(),t.a=n},m(i,r){t.m(e[0],i,r),I(i,n,r)},p(i,[r]){r&1&&t.p(i[0])},i:ee,o:ee,d(i){i&&(L(n),t.d())}}}function Lj(e,t,n){let{text:i}=t;return e.$$set=r=>{"text"in r&&n(0,i=r.text)},[i]}class Ij extends xe{constructor(t){super(),ve(this,t,Lj,Oj,ye,{text:0})}}function Pj(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("blockquote"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function zj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class Bj extends xe{constructor(t){super(),ve(this,t,zj,Pj,ye,{})}}function Uj(e){let t,n,i;return{c(){t=H("pre"),n=H("code"),i=Be(e[1]),M(t,"class",e[0])},m(r,s){I(r,t,s),V(t,n),V(n,i)},p(r,[s]){s&2&&ft(i,r[1]),s&1&&M(t,"class",r[0])},i:ee,o:ee,d(r){r&&L(t)}}}function jj(e,t,n){let{lang:i}=t,{text:r}=t;return e.$$set=s=>{"lang"in s&&n(0,i=s.lang),"text"in s&&n(1,r=s.text)},[i,r]}class qj extends xe{constructor(t){super(),ve(this,t,jj,Uj,ye,{lang:0,text:1})}}function Wj(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("br"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(s,o),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function Hj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class Gj extends xe{constructor(t){super(),ve(this,t,Hj,Wj,ye,{})}}const Vj={heading:IU,paragraph:BU,text:qU,image:GU,link:XU,em:JU,strong:aj,codespan:rj,del:tj,table:cj,tablehead:hj,tablebody:mj,tablerow:vj,tablecell:Cj,list:Fj,orderedlistitem:null,unorderedlistitem:null,listitem:Mj,hr:Rj,html:Ij,blockquote:Bj,code:qj,br:Gj},Yj={baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,xhtml:!1};function Xj(e){let t,n;return t=new Ca({props:{tokens:e[0],renderers:e[1]}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,[r]){const s={};r&1&&(s.tokens=i[0]),r&2&&(s.renderers=i[1]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function Kj(e,t,n){let i,r,s,o,{source:a=[]}=t,{renderers:u={}}=t,{options:l={}}=t,{isInline:c=!1}=t;const f=l2();let d,h,p;return E5(w4,{slug:g=>r?r.slug(g):"",getOptions:()=>s}),Wc(()=>{n(7,p=!0)}),e.$$set=g=>{"source"in g&&n(2,a=g.source),"renderers"in g&&n(3,u=g.renderers),"options"in g&&n(4,l=g.options),"isInline"in g&&n(5,c=g.isInline)},e.$$.update=()=>{e.$$.dirty&4&&n(8,i=Array.isArray(a)),e.$$.dirty&4&&(r=a?new Vh:void 0),e.$$.dirty&16&&n(9,s={...Yj,...l}),e.$$.dirty&869&&(i?n(0,d=a):(n(6,h=new ur(s)),n(0,d=c?h.inlineTokens(a):h.lex(a)),f("parsed",{tokens:d}))),e.$$.dirty&8&&n(1,o={...Vj,...u}),e.$$.dirty&385&&p&&!i&&f("parsed",{tokens:d})},[d,o,a,u,l,c,h,p,i,s]}class Zj extends xe{constructor(t){super(),ve(this,t,Kj,Xj,ye,{source:2,renderers:3,options:4,isInline:5})}}function Jj(e){let t,n;return t=new Zj({props:{source:e[0].source}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,[r]){const s={};r&1&&(s.source=i[0].source),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function Qj(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class E4 extends xe{constructor(t){super(),ve(this,t,Qj,Jj,ye,{componentData:0})}}function eq(e){let t,n,i;const r=e[2].default,s=mt(r,e,e[1],null);return{c(){var o;t=H("div"),s&&s.c(),M(t,"id",n=`page-${((o=e[0])==null?void 0:o.title)||"No Title"}`),M(t,"class","page svelte-v7ihqd"),M(t,"data-component","page")},m(o,a){I(o,t,a),s&&s.m(t,null),i=!0},p(o,[a]){var u;s&&s.p&&(!i||a&2)&&bt(s,r,o,o[1],i?yt(r,o[1],a,null):vt(o[1]),null),(!i||a&1&&n!==(n=`page-${((u=o[0])==null?void 0:u.title)||"No Title"}`))&&M(t,"id",n)},i(o){i||(F(s,o),i=!0)},o(o){N(s,o),i=!1},d(o){o&&L(t),s&&s.d(o)}}}function tq(e,t,n){let{$$slots:i={},$$scope:r}=t,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(0,s=o.componentData),"$$scope"in o&&n(1,r=o.$$scope)},[s,r,i]}class nq extends xe{constructor(t){super(),ve(this,t,tq,eq,ye,{componentData:0})}}function C4(e){let t,n,i=e[5]&&k4(e),r=e[4]&&A4(e);return{c(){t=H("div"),i&&i.c(),n=We(),r&&r.c(),M(t,"class","info svelte-ljrmzp")},m(s,o){I(s,t,o),i&&i.m(t,null),V(t,n),r&&r.m(t,null)},p(s,o){s[5]?i?i.p(s,o):(i=k4(s),i.c(),i.m(t,n)):i&&(i.d(1),i=null),s[4]?r?r.p(s,o):(r=A4(s),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(s){s&&L(t),i&&i.d(),r&&r.d()}}}function k4(e){let t,n,i,r,s;return{c(){t=H("label"),n=Be(e[5]),i=We(),r=H("span"),s=Be(e[3]),M(r,"class","labelValue svelte-ljrmzp"),M(t,"for",e[6]),M(t,"class","svelte-ljrmzp")},m(o,a){I(o,t,a),V(t,n),V(t,i),V(t,r),V(r,s)},p(o,a){a&32&&ft(n,o[5]),a&8&&ft(s,o[3]),a&64&&M(t,"for",o[6])},d(o){o&&L(t)}}}function A4(e){let t,n;return{c(){t=H("span"),n=Be(e[4]),M(t,"title",e[4]),M(t,"class","details svelte-ljrmzp")},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&16&&ft(n,i[4]),r&16&&M(t,"title",i[4])},d(i){i&&L(t)}}}function iq(e){let t,n,i,r,s,o=(e[0]||"")+"",a,u=(e[5]||e[4])&&C4(e);return{c(){t=H("div"),n=H("div"),u&&u.c(),i=We(),r=H("progress"),s=Be(e[1]),a=Be(o),M(r,"id",e[6]),M(r,"max",e[2]),r.value=e[1],M(r,"style","color: red !important"),M(r,"class","svelte-ljrmzp"),M(n,"class","inner svelte-ljrmzp"),M(t,"class","container svelte-ljrmzp")},m(l,c){I(l,t,c),V(t,n),u&&u.m(n,null),V(n,i),V(n,r),V(r,s),V(r,a)},p(l,[c]){l[5]||l[4]?u?u.p(l,c):(u=C4(l),u.c(),u.m(n,i)):u&&(u.d(1),u=null),c&2&&ft(s,l[1]),c&1&&o!==(o=(l[0]||"")+"")&&ft(a,o),c&64&&M(r,"id",l[6]),c&4&&M(r,"max",l[2]),c&2&&(r.value=l[1])},i:ee,o:ee,d(l){l&&L(t),u&&u.d()}}}function rq(e,t,n){let i,r,s,o,a,u,{componentData:l}=t;s==null&&(s=0);let c=s.toString();return e.$$set=f=>{"componentData"in f&&n(7,l=f.componentData)},e.$$.update=()=>{e.$$.dirty&128&&n(2,{max:i,id:r,value:s,label:o,unit:a,details:u}=l,i,(n(6,r),n(7,l)),(n(1,s),n(7,l)),(n(5,o),n(7,l)),(n(0,a),n(7,l)),(n(4,u),n(7,l))),e.$$.dirty&7&&(i?n(3,c=`${s}/${i}`):a&&n(3,c=`${s} ${a}`))},[a,s,i,c,u,o,r,l]}class $4 extends xe{constructor(t){super(),ve(this,t,rq,iq,ye,{componentData:7})}}function S4(e){let t,n;return{c(){t=H("h3"),n=Be(e[3])},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&8&&ft(n,i[3])},d(i){i&&L(t)}}}function F4(e){let t,n;return{c(){t=H("p"),n=Be(e[2]),M(t,"class","description")},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&4&&ft(n,i[2])},d(i){i&&L(t)}}}function sq(e){let t,n,i,r,s,o,a,u,l=e[3]&&S4(e),c=e[2]&&F4(e);const f=e[6].default,d=mt(f,e,e[5],null);return{c(){t=H("section"),n=H("div"),l&&l.c(),i=We(),c&&c.c(),r=We(),s=H("div"),d&&d.c(),o=We(),a=H("hr"),M(n,"class","heading svelte-17n0qr8"),M(s,"class","sectionItems svelte-17n0qr8"),M(s,"style",e[0]),M(a,"class","svelte-17n0qr8"),M(t,"class","container svelte-17n0qr8"),M(t,"data-component","section"),M(t,"data-section-id",e[3]),ni(t,"columns",e[1])},m(h,p){I(h,t,p),V(t,n),l&&l.m(n,null),V(n,i),c&&c.m(n,null),V(t,r),V(t,s),d&&d.m(s,null),V(t,o),V(t,a),u=!0},p(h,[p]){h[3]?l?l.p(h,p):(l=S4(h),l.c(),l.m(n,i)):l&&(l.d(1),l=null),h[2]?c?c.p(h,p):(c=F4(h),c.c(),c.m(n,null)):c&&(c.d(1),c=null),d&&d.p&&(!u||p&32)&&bt(d,f,h,h[5],u?yt(f,h[5],p,null):vt(h[5]),null),(!u||p&1)&&M(s,"style",h[0]),(!u||p&8)&&M(t,"data-section-id",h[3]),(!u||p&2)&&ni(t,"columns",h[1])},i(h){u||(F(d,h),u=!0)},o(h){N(d,h),u=!1},d(h){h&&L(t),l&&l.d(),c&&c.d(),d&&d.d(h)}}}function oq(e,t,n){let i,r,s,{$$slots:o={},$$scope:a}=t,{componentData:u}=t,l;return s&&(l=`grid-template-columns: repeat(${s||1}, 1fr);`),e.$$set=c=>{"componentData"in c&&n(4,u=c.componentData),"$$scope"in c&&n(5,a=c.$$scope)},e.$$.update=()=>{e.$$.dirty&16&&n(3,{title:i,subtitle:r,columns:s}=u,i,(n(2,r),n(4,u)),(n(1,s),n(4,u)))},[l,s,r,i,u,a,o]}class aq extends xe{constructor(t){super(),ve(this,t,oq,sq,ye,{componentData:4})}}const uq=/("(?:[^\\"]|\\.)*")|[:,]/g;function b2(e,t={}){const n=JSON.stringify([1],void 0,t.indent===void 0?2:t.indent).slice(2,-3),i=n===""?1/0:t.maxLength===void 0?80:t.maxLength;let{replacer:r}=t;return function s(o,a,u){o&&typeof o.toJSON=="function"&&(o=o.toJSON());const l=JSON.stringify(o,r);if(l===void 0)return l;const c=i-a.length-u;if(l.length<=c){const f=l.replace(uq,(d,h)=>h||`${d} `);if(f.length<=c)return f}if(r!=null&&(o=JSON.parse(l),r=void 0),typeof o=="object"&&o!==null){const f=a+n,d=[];let h=0,p,g;if(Array.isArray(o)){p="[",g="]";const{length:m}=o;for(;h0)return[p,n+d.join(`, +`+(h.tokens?this.parseInline(h.tokens):h.text);i+=n?this.renderer.paragraph(d):d;continue}default:{const C='Token with "'+h.type+'" type was not found.';if(this.options.silent){console.error(C);return}else throw new Error(C)}}}return i}parseInline(t,n){n=n||this.renderer;let i="",r,s,o;const a=t.length;for(r=0;r{i=i.concat(this.walkTokens(r[s],n))}):r.tokens&&(i=i.concat(this.walkTokens(r.tokens,n)))}return i}use(...t){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{const r={...i};if(r.async=this.defaults.async||r.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if(s.renderer){const o=n.renderers[s.name];o?n.renderers[s.name]=function(...a){let u=s.renderer.apply(this,a);return u===!1&&(u=o.apply(this,a)),u}:n.renderers[s.name]=s.renderer}if(s.tokenizer){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");n[s.level]?n[s.level].unshift(s.tokenizer):n[s.level]=[s.tokenizer],s.start&&(s.level==="block"?n.startBlock?n.startBlock.push(s.start):n.startBlock=[s.start]:s.level==="inline"&&(n.startInline?n.startInline.push(s.start):n.startInline=[s.start]))}s.childTokens&&(n.childTokens[s.name]=s.childTokens)}),r.extensions=n),i.renderer){const s=this.defaults.renderer||new Gh(this.defaults);for(const o in i.renderer){const a=s[o];s[o]=(...u)=>{let l=i.renderer[o].apply(s,u);return l===!1&&(l=a.apply(s,u)),l}}r.renderer=s}if(i.tokenizer){const s=this.defaults.tokenizer||new Hh(this.defaults);for(const o in i.tokenizer){const a=s[o];s[o]=(...u)=>{let l=i.tokenizer[o].apply(s,u);return l===!1&&(l=a.apply(s,u)),l}}r.tokenizer=s}if(i.hooks){const s=this.defaults.hooks||new Gc;for(const o in i.hooks){const a=s[o];Gc.passThroughHooks.has(o)?s[o]=u=>{if(this.defaults.async)return Promise.resolve(i.hooks[o].call(s,u)).then(c=>a.call(s,c));const l=i.hooks[o].call(s,u);return a.call(s,l)}:s[o]=(...u)=>{let l=i.hooks[o].apply(s,u);return l===!1&&(l=a.apply(s,u)),l}}r.hooks=s}if(i.walkTokens){const s=this.defaults.walkTokens;r.walkTokens=function(o){let a=[];return a.push(i.walkTokens.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}}Yu=new WeakSet,g6=function(t,n){return(i,r,s)=>{typeof r=="function"&&(s=r,r=null);const o={...r};r={...this.defaults,...o};const a=a2(this,Yu,Tz).call(this,r.silent,r.async,s);if(typeof i>"u"||i===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if(SU(r,s),r.hooks&&(r.hooks.options=r),s){const u=r.highlight;let l;try{r.hooks&&(i=r.hooks.preprocess(i)),l=t(i,r)}catch(d){return a(d)}const c=d=>{let h;if(!d)try{r.walkTokens&&this.walkTokens(l,r.walkTokens),h=n(l,r),r.hooks&&(h=r.hooks.postprocess(h))}catch(p){d=p}return r.highlight=u,d?a(d):s(null,h)};if(!u||u.length<3||(delete r.highlight,!l.length))return c();let f=0;this.walkTokens(l,d=>{d.type==="code"&&(f++,setTimeout(()=>{u(d.text,d.lang,(h,p)=>{if(h)return c(h);p!=null&&p!==d.text&&(d.text=p,d.escaped=!0),f--,f===0&&c()})},0))}),f===0&&c();return}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(i):i).then(u=>t(u,r)).then(u=>r.walkTokens?Promise.all(this.walkTokens(u,r.walkTokens)).then(()=>u):u).then(u=>n(u,r)).then(u=>r.hooks?r.hooks.postprocess(u):u).catch(a);try{r.hooks&&(i=r.hooks.preprocess(i));const u=t(i,r);r.walkTokens&&this.walkTokens(u,r.walkTokens);let l=n(u,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(u){return a(u)}}},Tz=function(t,n,i){return r=>{if(r.message+=` +Please report this to https://github.com/markedjs/marked.`,t){const s="

An error occurred:

"+_n(r.message+"",!0)+"
";if(n)return Promise.resolve(s);if(i){i(null,s);return}return s}if(n)return Promise.reject(r);if(i){i(r);return}throw r}};const ka=new TU(yo);function ot(e,t,n){return ka.parse(e,t,n)}ot.options=ot.setOptions=function(e){return ka.setOptions(e),ot.defaults=ka.defaults,h4(ot.defaults),ot},ot.getDefaults=m2,ot.defaults=yo,ot.use=function(...e){return ka.use(...e),ot.defaults=ka.defaults,h4(ot.defaults),ot},ot.walkTokens=function(e,t){return ka.walkTokens(e,t)},ot.parseInline=ka.parseInline,ot.Parser=Ur,ot.parser=Ur.parse,ot.Renderer=Gh,ot.TextRenderer=y2,ot.Lexer=ur,ot.lexer=ur.lex,ot.Tokenizer=Hh,ot.Slugger=Vh,ot.Hooks=Gc,ot.parse=ot,ot.options,ot.setOptions,ot.use,ot.walkTokens,ot.parseInline,Ur.parse,ur.lex;const w4={};function MU(e){let t;return{c(){t=Oe(e[1])},m(n,i){I(n,t,i)},p(n,i){i&2&&Ke(t,n[1])},i:ee,o:ee,d(n){n&&L(t)}}}function NU(e){let t,n;const i=e[5].default,r=mt(i,e,e[4],null);return{c(){t=H("h6"),r&&r.c(),T(t,"id",e[2])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&bt(r,i,s,s[4],n?yt(i,s[4],o,null):vt(s[4]),null),(!n||o&4)&&T(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function RU(e){let t,n;const i=e[5].default,r=mt(i,e,e[4],null);return{c(){t=H("h5"),r&&r.c(),T(t,"id",e[2])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&bt(r,i,s,s[4],n?yt(i,s[4],o,null):vt(s[4]),null),(!n||o&4)&&T(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function OU(e){let t,n;const i=e[5].default,r=mt(i,e,e[4],null);return{c(){t=H("h4"),r&&r.c(),T(t,"id",e[2])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&bt(r,i,s,s[4],n?yt(i,s[4],o,null):vt(s[4]),null),(!n||o&4)&&T(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function LU(e){let t,n;const i=e[5].default,r=mt(i,e,e[4],null);return{c(){t=H("h3"),r&&r.c(),T(t,"id",e[2])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&bt(r,i,s,s[4],n?yt(i,s[4],o,null):vt(s[4]),null),(!n||o&4)&&T(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function IU(e){let t,n;const i=e[5].default,r=mt(i,e,e[4],null);return{c(){t=H("h2"),r&&r.c(),T(t,"id",e[2])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&bt(r,i,s,s[4],n?yt(i,s[4],o,null):vt(s[4]),null),(!n||o&4)&&T(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function PU(e){let t,n;const i=e[5].default,r=mt(i,e,e[4],null);return{c(){t=H("h1"),r&&r.c(),T(t,"id",e[2])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&bt(r,i,s,s[4],n?yt(i,s[4],o,null):vt(s[4]),null),(!n||o&4)&&T(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function zU(e){let t,n,i,r;const s=[PU,IU,LU,OU,RU,NU,MU],o=[];function a(u,l){return u[0]===1?0:u[0]===2?1:u[0]===3?2:u[0]===4?3:u[0]===5?4:u[0]===6?5:6}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Me()},m(u,l){o[t].m(u,l),I(u,i,l),r=!0},p(u,[l]){let c=t;t=a(u),t===c?o[t].p(u,l):($e(),N(o[c],1,1,()=>{o[c]=null}),Se(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i))},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),o[t].d(u)}}}function BU(e,t,n){let i,{$$slots:r={},$$scope:s}=t,{depth:o}=t,{raw:a}=t,{text:u}=t;const{slug:l,getOptions:c}=C6(w4),f=c();return e.$$set=d=>{"depth"in d&&n(0,o=d.depth),"raw"in d&&n(1,a=d.raw),"text"in d&&n(3,u=d.text),"$$scope"in d&&n(4,s=d.$$scope)},e.$$.update=()=>{e.$$.dirty&8&&n(2,i=f.headerIds?f.headerPrefix+l(u):void 0)},[o,a,i,u,s,r]}class UU extends ve{constructor(t){super(),be(this,t,BU,zU,ye,{depth:0,raw:1,text:3})}}function jU(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("p"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function qU(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class WU extends ve{constructor(t){super(),be(this,t,qU,jU,ye,{})}}function HU(e){let t;const n=e[3].default,i=mt(n,e,e[2],null);return{c(){i&&i.c()},m(r,s){i&&i.m(r,s),t=!0},p(r,[s]){i&&i.p&&(!t||s&4)&&bt(i,n,r,r[2],t?yt(n,r[2],s,null):vt(r[2]),null)},i(r){t||(F(i,r),t=!0)},o(r){N(i,r),t=!1},d(r){i&&i.d(r)}}}function GU(e,t,n){let{$$slots:i={},$$scope:r}=t,{text:s}=t,{raw:o}=t;return e.$$set=a=>{"text"in a&&n(0,s=a.text),"raw"in a&&n(1,o=a.raw),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}let VU=class extends ve{constructor(t){super(),be(this,t,GU,HU,ye,{text:0,raw:1})}};function YU(e){let t,n;return{c(){t=H("img"),Ph(t.src,n=e[0])||T(t,"src",n),T(t,"title",e[1]),T(t,"alt",e[2])},m(i,r){I(i,t,r)},p(i,[r]){r&1&&!Ph(t.src,n=i[0])&&T(t,"src",n),r&2&&T(t,"title",i[1]),r&4&&T(t,"alt",i[2])},i:ee,o:ee,d(i){i&&L(t)}}}function XU(e,t,n){let{href:i=""}=t,{title:r=void 0}=t,{text:s=""}=t;return e.$$set=o=>{"href"in o&&n(0,i=o.href),"title"in o&&n(1,r=o.title),"text"in o&&n(2,s=o.text)},[i,r,s]}let KU=class extends ve{constructor(t){super(),be(this,t,XU,YU,ye,{href:0,title:1,text:2})}};function ZU(e){let t,n;const i=e[3].default,r=mt(i,e,e[2],null);return{c(){t=H("a"),r&&r.c(),T(t,"href",e[0]),T(t,"title",e[1])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&4)&&bt(r,i,s,s[2],n?yt(i,s[2],o,null):vt(s[2]),null),(!n||o&1)&&T(t,"href",s[0]),(!n||o&2)&&T(t,"title",s[1])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function JU(e,t,n){let{$$slots:i={},$$scope:r}=t,{href:s=""}=t,{title:o=void 0}=t;return e.$$set=a=>{"href"in a&&n(0,s=a.href),"title"in a&&n(1,o=a.title),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}class QU extends ve{constructor(t){super(),be(this,t,JU,ZU,ye,{href:0,title:1})}}function ej(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("em"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function tj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class nj extends ve{constructor(t){super(),be(this,t,tj,ej,ye,{})}}function ij(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("del"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function rj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class sj extends ve{constructor(t){super(),be(this,t,rj,ij,ye,{})}}function oj(e){let t,n=e[0].replace(/`/g,"")+"",i;return{c(){t=H("code"),i=Oe(n)},m(r,s){I(r,t,s),V(t,i)},p(r,[s]){s&1&&n!==(n=r[0].replace(/`/g,"")+"")&&Ke(i,n)},i:ee,o:ee,d(r){r&&L(t)}}}function aj(e,t,n){let{raw:i}=t;return e.$$set=r=>{"raw"in r&&n(0,i=r.raw)},[i]}class uj extends ve{constructor(t){super(),be(this,t,aj,oj,ye,{raw:0})}}function lj(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("strong"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function cj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class fj extends ve{constructor(t){super(),be(this,t,cj,lj,ye,{})}}function dj(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("table"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function hj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}let pj=class extends ve{constructor(t){super(),be(this,t,hj,dj,ye,{})}};function gj(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("thead"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function mj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class yj extends ve{constructor(t){super(),be(this,t,mj,gj,ye,{})}}function bj(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("tbody"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function vj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class xj extends ve{constructor(t){super(),be(this,t,vj,bj,ye,{})}}function _j(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("tr"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function wj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class Ej extends ve{constructor(t){super(),be(this,t,wj,_j,ye,{})}}function Cj(e){let t,n;const i=e[3].default,r=mt(i,e,e[2],null);return{c(){t=H("td"),r&&r.c(),T(t,"align",e[1])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&&bt(r,i,s,s[2],n?yt(i,s[2],o,null):vt(s[2]),null),(!n||o&2)&&T(t,"align",s[1])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function kj(e){let t,n;const i=e[3].default,r=mt(i,e,e[2],null);return{c(){t=H("th"),r&&r.c(),T(t,"align",e[1])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&&bt(r,i,s,s[2],n?yt(i,s[2],o,null):vt(s[2]),null),(!n||o&2)&&T(t,"align",s[1])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function Aj(e){let t,n,i,r;const s=[kj,Cj],o=[];function a(u,l){return u[0]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Me()},m(u,l){o[t].m(u,l),I(u,i,l),r=!0},p(u,[l]){let c=t;t=a(u),t===c?o[t].p(u,l):($e(),N(o[c],1,1,()=>{o[c]=null}),Se(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i))},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),o[t].d(u)}}}function $j(e,t,n){let{$$slots:i={},$$scope:r}=t,{header:s}=t,{align:o}=t;return e.$$set=a=>{"header"in a&&n(0,s=a.header),"align"in a&&n(1,o=a.align),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}class Sj extends ve{constructor(t){super(),be(this,t,$j,Aj,ye,{header:0,align:1})}}function Fj(e){let t,n;const i=e[3].default,r=mt(i,e,e[2],null);return{c(){t=H("ul"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&&bt(r,i,s,s[2],n?yt(i,s[2],o,null):vt(s[2]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function Dj(e){let t,n;const i=e[3].default,r=mt(i,e,e[2],null);return{c(){t=H("ol"),r&&r.c(),T(t,"start",e[1])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&&bt(r,i,s,s[2],n?yt(i,s[2],o,null):vt(s[2]),null),(!n||o&2)&&T(t,"start",s[1])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function Tj(e){let t,n,i,r;const s=[Dj,Fj],o=[];function a(u,l){return u[0]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Me()},m(u,l){o[t].m(u,l),I(u,i,l),r=!0},p(u,[l]){let c=t;t=a(u),t===c?o[t].p(u,l):($e(),N(o[c],1,1,()=>{o[c]=null}),Se(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i))},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),o[t].d(u)}}}function Mj(e,t,n){let{$$slots:i={},$$scope:r}=t,{ordered:s}=t,{start:o}=t;return e.$$set=a=>{"ordered"in a&&n(0,s=a.ordered),"start"in a&&n(1,o=a.start),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}class Nj extends ve{constructor(t){super(),be(this,t,Mj,Tj,ye,{ordered:0,start:1})}}function Rj(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("li"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function Oj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class Lj extends ve{constructor(t){super(),be(this,t,Oj,Rj,ye,{})}}function Ij(e){let t;return{c(){t=H("hr")},m(n,i){I(n,t,i)},p:ee,i:ee,o:ee,d(n){n&&L(t)}}}class Pj extends ve{constructor(t){super(),be(this,t,null,Ij,ye,{})}}function zj(e){let t,n;return{c(){t=new Pz(!1),n=Me(),t.a=n},m(i,r){t.m(e[0],i,r),I(i,n,r)},p(i,[r]){r&1&&t.p(i[0])},i:ee,o:ee,d(i){i&&(L(n),t.d())}}}function Bj(e,t,n){let{text:i}=t;return e.$$set=r=>{"text"in r&&n(0,i=r.text)},[i]}class Uj extends ve{constructor(t){super(),be(this,t,Bj,zj,ye,{text:0})}}function jj(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("blockquote"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function qj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class Wj extends ve{constructor(t){super(),be(this,t,qj,jj,ye,{})}}function Hj(e){let t,n,i;return{c(){t=H("pre"),n=H("code"),i=Oe(e[1]),T(t,"class",e[0])},m(r,s){I(r,t,s),V(t,n),V(n,i)},p(r,[s]){s&2&&Ke(i,r[1]),s&1&&T(t,"class",r[0])},i:ee,o:ee,d(r){r&&L(t)}}}function Gj(e,t,n){let{lang:i}=t,{text:r}=t;return e.$$set=s=>{"lang"in s&&n(0,i=s.lang),"text"in s&&n(1,r=s.text)},[i,r]}class Vj extends ve{constructor(t){super(),be(this,t,Gj,Hj,ye,{lang:0,text:1})}}function Yj(e){let t,n;const i=e[1].default,r=mt(i,e,e[0],null);return{c(){t=H("br"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(s,o),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&bt(r,i,s,s[0],n?yt(i,s[0],o,null):vt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function Xj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class Kj extends ve{constructor(t){super(),be(this,t,Xj,Yj,ye,{})}}const Zj={heading:UU,paragraph:WU,text:VU,image:KU,link:QU,em:nj,strong:fj,codespan:uj,del:sj,table:pj,tablehead:yj,tablebody:xj,tablerow:Ej,tablecell:Sj,list:Nj,orderedlistitem:null,unorderedlistitem:null,listitem:Lj,hr:Pj,html:Uj,blockquote:Wj,code:Vj,br:Kj},Jj={baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,xhtml:!1};function Qj(e){let t,n;return t=new Ca({props:{tokens:e[0],renderers:e[1]}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,[r]){const s={};r&1&&(s.tokens=i[0]),r&2&&(s.renderers=i[1]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function eq(e,t,n){let i,r,s,o,{source:a=[]}=t,{renderers:u={}}=t,{options:l={}}=t,{isInline:c=!1}=t;const f=l2();let d,h,p;return E6(w4,{slug:g=>r?r.slug(g):"",getOptions:()=>s}),Wc(()=>{n(7,p=!0)}),e.$$set=g=>{"source"in g&&n(2,a=g.source),"renderers"in g&&n(3,u=g.renderers),"options"in g&&n(4,l=g.options),"isInline"in g&&n(5,c=g.isInline)},e.$$.update=()=>{e.$$.dirty&4&&n(8,i=Array.isArray(a)),e.$$.dirty&4&&(r=a?new Vh:void 0),e.$$.dirty&16&&n(9,s={...Jj,...l}),e.$$.dirty&869&&(i?n(0,d=a):(n(6,h=new ur(s)),n(0,d=c?h.inlineTokens(a):h.lex(a)),f("parsed",{tokens:d}))),e.$$.dirty&8&&n(1,o={...Zj,...u}),e.$$.dirty&385&&p&&!i&&f("parsed",{tokens:d})},[d,o,a,u,l,c,h,p,i,s]}class tq extends ve{constructor(t){super(),be(this,t,eq,Qj,ye,{source:2,renderers:3,options:4,isInline:5})}}function nq(e){let t,n;return t=new tq({props:{source:e[0].source}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,[r]){const s={};r&1&&(s.source=i[0].source),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function iq(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class E4 extends ve{constructor(t){super(),be(this,t,iq,nq,ye,{componentData:0})}}function rq(e){let t,n,i;const r=e[2].default,s=mt(r,e,e[1],null);return{c(){var o;t=H("div"),s&&s.c(),T(t,"id",n=`page-${((o=e[0])==null?void 0:o.title)||"No Title"}`),T(t,"class","page svelte-v7ihqd"),T(t,"data-component","page")},m(o,a){I(o,t,a),s&&s.m(t,null),i=!0},p(o,[a]){var u;s&&s.p&&(!i||a&2)&&bt(s,r,o,o[1],i?yt(r,o[1],a,null):vt(o[1]),null),(!i||a&1&&n!==(n=`page-${((u=o[0])==null?void 0:u.title)||"No Title"}`))&&T(t,"id",n)},i(o){i||(F(s,o),i=!0)},o(o){N(s,o),i=!1},d(o){o&&L(t),s&&s.d(o)}}}function sq(e,t,n){let{$$slots:i={},$$scope:r}=t,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(0,s=o.componentData),"$$scope"in o&&n(1,r=o.$$scope)},[s,r,i]}class oq extends ve{constructor(t){super(),be(this,t,sq,rq,ye,{componentData:0})}}function C4(e){let t,n,i=e[5]&&k4(e),r=e[4]&&A4(e);return{c(){t=H("div"),i&&i.c(),n=ze(),r&&r.c(),T(t,"class","info svelte-ljrmzp")},m(s,o){I(s,t,o),i&&i.m(t,null),V(t,n),r&&r.m(t,null)},p(s,o){s[5]?i?i.p(s,o):(i=k4(s),i.c(),i.m(t,n)):i&&(i.d(1),i=null),s[4]?r?r.p(s,o):(r=A4(s),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(s){s&&L(t),i&&i.d(),r&&r.d()}}}function k4(e){let t,n,i,r,s;return{c(){t=H("label"),n=Oe(e[5]),i=ze(),r=H("span"),s=Oe(e[3]),T(r,"class","labelValue svelte-ljrmzp"),T(t,"for",e[6]),T(t,"class","svelte-ljrmzp")},m(o,a){I(o,t,a),V(t,n),V(t,i),V(t,r),V(r,s)},p(o,a){a&32&&Ke(n,o[5]),a&8&&Ke(s,o[3]),a&64&&T(t,"for",o[6])},d(o){o&&L(t)}}}function A4(e){let t,n;return{c(){t=H("span"),n=Oe(e[4]),T(t,"title",e[4]),T(t,"class","details svelte-ljrmzp")},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&16&&Ke(n,i[4]),r&16&&T(t,"title",i[4])},d(i){i&&L(t)}}}function aq(e){let t,n,i,r,s,o=(e[0]||"")+"",a,u=(e[5]||e[4])&&C4(e);return{c(){t=H("div"),n=H("div"),u&&u.c(),i=ze(),r=H("progress"),s=Oe(e[1]),a=Oe(o),T(r,"id",e[6]),T(r,"max",e[2]),r.value=e[1],T(r,"style","color: red !important"),T(r,"class","svelte-ljrmzp"),T(n,"class","inner svelte-ljrmzp"),T(t,"class","container svelte-ljrmzp")},m(l,c){I(l,t,c),V(t,n),u&&u.m(n,null),V(n,i),V(n,r),V(r,s),V(r,a)},p(l,[c]){l[5]||l[4]?u?u.p(l,c):(u=C4(l),u.c(),u.m(n,i)):u&&(u.d(1),u=null),c&2&&Ke(s,l[1]),c&1&&o!==(o=(l[0]||"")+"")&&Ke(a,o),c&64&&T(r,"id",l[6]),c&4&&T(r,"max",l[2]),c&2&&(r.value=l[1])},i:ee,o:ee,d(l){l&&L(t),u&&u.d()}}}function uq(e,t,n){let i,r,s,o,a,u,{componentData:l}=t;s==null&&(s=0);let c=s.toString();return e.$$set=f=>{"componentData"in f&&n(7,l=f.componentData)},e.$$.update=()=>{e.$$.dirty&128&&n(2,{max:i,id:r,value:s,label:o,unit:a,details:u}=l,i,(n(6,r),n(7,l)),(n(1,s),n(7,l)),(n(5,o),n(7,l)),(n(0,a),n(7,l)),(n(4,u),n(7,l))),e.$$.dirty&7&&(i?n(3,c=`${s}/${i}`):a&&n(3,c=`${s} ${a}`))},[a,s,i,c,u,o,r,l]}class $4 extends ve{constructor(t){super(),be(this,t,uq,aq,ye,{componentData:7})}}function S4(e){let t,n;return{c(){t=H("h3"),n=Oe(e[3])},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&8&&Ke(n,i[3])},d(i){i&&L(t)}}}function F4(e){let t,n;return{c(){t=H("p"),n=Oe(e[2]),T(t,"class","description")},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&4&&Ke(n,i[2])},d(i){i&&L(t)}}}function lq(e){let t,n,i,r,s,o,a,u,l=e[3]&&S4(e),c=e[2]&&F4(e);const f=e[6].default,d=mt(f,e,e[5],null);return{c(){t=H("section"),n=H("div"),l&&l.c(),i=ze(),c&&c.c(),r=ze(),s=H("div"),d&&d.c(),o=ze(),a=H("hr"),T(n,"class","heading svelte-17n0qr8"),T(s,"class","sectionItems svelte-17n0qr8"),T(s,"style",e[0]),T(a,"class","svelte-17n0qr8"),T(t,"class","container svelte-17n0qr8"),T(t,"data-component","section"),T(t,"data-section-id",e[3]),ni(t,"columns",e[1])},m(h,p){I(h,t,p),V(t,n),l&&l.m(n,null),V(n,i),c&&c.m(n,null),V(t,r),V(t,s),d&&d.m(s,null),V(t,o),V(t,a),u=!0},p(h,[p]){h[3]?l?l.p(h,p):(l=S4(h),l.c(),l.m(n,i)):l&&(l.d(1),l=null),h[2]?c?c.p(h,p):(c=F4(h),c.c(),c.m(n,null)):c&&(c.d(1),c=null),d&&d.p&&(!u||p&32)&&bt(d,f,h,h[5],u?yt(f,h[5],p,null):vt(h[5]),null),(!u||p&1)&&T(s,"style",h[0]),(!u||p&8)&&T(t,"data-section-id",h[3]),(!u||p&2)&&ni(t,"columns",h[1])},i(h){u||(F(d,h),u=!0)},o(h){N(d,h),u=!1},d(h){h&&L(t),l&&l.d(),c&&c.d(),d&&d.d(h)}}}function cq(e,t,n){let i,r,s,{$$slots:o={},$$scope:a}=t,{componentData:u}=t,l;return s&&(l=`grid-template-columns: repeat(${s||1}, 1fr);`),e.$$set=c=>{"componentData"in c&&n(4,u=c.componentData),"$$scope"in c&&n(5,a=c.$$scope)},e.$$.update=()=>{e.$$.dirty&16&&n(3,{title:i,subtitle:r,columns:s}=u,i,(n(2,r),n(4,u)),(n(1,s),n(4,u)))},[l,s,r,i,u,a,o]}class fq extends ve{constructor(t){super(),be(this,t,cq,lq,ye,{componentData:4})}}const dq=/("(?:[^\\"]|\\.)*")|[:,]/g;function b2(e,t={}){const n=JSON.stringify([1],void 0,t.indent===void 0?2:t.indent).slice(2,-3),i=n===""?1/0:t.maxLength===void 0?80:t.maxLength;let{replacer:r}=t;return function s(o,a,u){o&&typeof o.toJSON=="function"&&(o=o.toJSON());const l=JSON.stringify(o,r);if(l===void 0)return l;const c=i-a.length-u;if(l.length<=c){const f=l.replace(dq,(d,h)=>h||`${d} `);if(f.length<=c)return f}if(r!=null&&(o=JSON.parse(l),r=void 0),typeof o=="object"&&o!==null){const f=a+n,d=[];let h=0,p,g;if(Array.isArray(o)){p="[",g="]";const{length:m}=o;for(;h0)return[p,n+d.join(`, ${f}`),g].join(` -${a}`)}return l}(e,"",0)}function ii(e,t,n){return e.fields=t||[],e.fname=n,e}function Tt(e){return e==null?null:e.fname}function wn(e){return e==null?null:e.fields}function D4(e){return e.length===1?lq(e[0]):cq(e)}const lq=e=>function(t){return t[e]},cq=e=>{const t=e.length;return function(n){for(let i=0;io?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||q("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&q("Access path missing closing bracket: "+e),i&&q("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function Bi(e,t,n){const i=jr(e);return e=i.length===1?i[0]:e,ii((n&&n.get||D4)(i),[e],t||e)}const Vc=Bi("id"),En=ii(e=>e,[],"identity"),bo=ii(()=>0,[],"zero"),tl=ii(()=>1,[],"one"),Ui=ii(()=>!0,[],"true"),vo=ii(()=>!1,[],"false");function fq(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const T4=0,v2=1,x2=2,M4=3,N4=4;function _2(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fq,i=e||T4;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=v2&&n(t||"error","ERROR",arguments),this},warn(){return i>=x2&&n(t||"warn","WARN",arguments),this},info(){return i>=M4&&n(t||"log","INFO",arguments),this},debug(){return i>=N4&&n(t||"log","DEBUG",arguments),this}}}var W=Array.isArray;function re(e){return e===Object(e)}const R4=e=>e!=="__proto__";function nl(){for(var e=arguments.length,t=new Array(e),n=0;n{for(const s in r)if(s==="signals")i.signals=dq(i.signals,r.signals);else{const o=s==="legend"?{layout:1}:s==="style"?!0:null;il(i,s,r[s],o)}return i},{})}function il(e,t,n,i){if(!R4(t))return;let r,s;if(re(n)&&!W(n)){s=re(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?il(s,r,n[r]):R4(r)&&(s[r]=n[r])}else e[t]=n}function dq(e,t){if(e==null)return t;const n={},i=[];function r(s){n[s.name]||(n[s.name]=1,i.push(s))}return t.forEach(r),e.forEach(r),i}function Ge(e){return e[e.length-1]}function Cn(e){return e==null||e===""?null:+e}const O4=e=>t=>e*Math.exp(t),L4=e=>t=>Math.log(e*t),I4=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),P4=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,Yh=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function Xh(e,t,n,i){const r=n(e[0]),s=n(Ge(e)),o=(s-r)*t;return[i(r-o),i(s-o)]}function z4(e,t){return Xh(e,t,Cn,En)}function B4(e,t){var n=Math.sign(e[0]);return Xh(e,t,L4(n),O4(n))}function U4(e,t,n){return Xh(e,t,Yh(n),Yh(1/n))}function j4(e,t,n){return Xh(e,t,I4(n),P4(n))}function Kh(e,t,n,i,r){const s=i(e[0]),o=i(Ge(e)),a=t!=null?i(t):(s+o)/2;return[r(a+(s-a)*n),r(a+(o-a)*n)]}function w2(e,t,n){return Kh(e,t,n,Cn,En)}function E2(e,t,n){const i=Math.sign(e[0]);return Kh(e,t,n,L4(i),O4(i))}function Zh(e,t,n,i){return Kh(e,t,n,Yh(i),Yh(1/i))}function C2(e,t,n,i){return Kh(e,t,n,I4(i),P4(i))}function q4(e){return 1+~~(new Date(e).getMonth()/3)}function W4(e){return 1+~~(new Date(e).getUTCMonth()/3)}function oe(e){return e!=null?W(e)?e:[e]:[]}function H4(e,t,n){let i=e[0],r=e[1],s;return r=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-s),i+s]}function Oe(e){return typeof e=="function"}const hq="descending";function k2(e,t,n){n=n||{},t=oe(t)||[];const i=[],r=[],s={},o=n.comparator||pq;return oe(e).forEach((a,u)=>{a!=null&&(i.push(t[u]===hq?-1:1),r.push(a=Oe(a)?a:Bi(a,null,n)),(wn(a)||[]).forEach(l=>s[l]=1))}),r.length===0?null:ii(o(r,i),Object.keys(s))}const rl=(e,t)=>(et||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),pq=(e,t)=>e.length===1?gq(e[0],t[0]):mq(e,t,e.length),gq=(e,t)=>function(n,i){return rl(e(n),e(i))*t},mq=(e,t,n)=>(t.push(0),function(i,r){let s,o=0,a=-1;for(;o===0&&++ae}function A2(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function Le(e){for(let t,n,i=1,r=arguments.length;io&&(o=r))}else{for(r=t(e[n]);no&&(o=r))}return[s,o]}function G4(e,t){const n=e.length;let i=-1,r,s,o,a,u;if(t==null){for(;++i=s){r=o=s;break}if(i===n)return[-1,-1];for(a=u=i;++is&&(r=s,a=i),o=s){r=o=s;break}if(i===n)return[-1,-1];for(a=u=i;++is&&(r=s,a=i),o{r.set(s,e[s])}),r}function V4(e,t,n,i,r,s){if(!n&&n!==0)return s;const o=+n;let a=e[0],u=Ge(e),l;us&&(o=r,r=s,s=o),n=n===void 0||n,i=i===void 0||i,(n?r<=e:ra.replace(/\\(.)/g,"$1")):oe(e));const i=e&&e.length,r=n&&n.get||D4,s=a=>r(t?[a]:jr(a));let o;if(!i)o=function(){return""};else if(i===1){const a=s(e[0]);o=function(u){return""+a(u)}}else{const a=e.map(s);o=function(u){let l=""+a[0](u),c=0;for(;++c{t={},n={},i=0},s=(o,a)=>(++i>e&&(n=t,t={},i=1),t[o]=a);return r(),{clear:r,has:o=>ue(t,o)||ue(n,o),get:o=>ue(t,o)?t[o]:ue(n,o)?s(o,n[o]):void 0,set:(o,a)=>ue(t,o)?t[o]=a:s(o,a)}}function Z4(e,t,n,i){const r=t.length,s=n.length;if(!s)return t;if(!r)return n;const o=i||new t.constructor(r+s);let a=0,u=0,l=0;for(;a0?n[u++]:t[a++];for(;a=0;)n+=e;return n}function J4(e,t,n,i){const r=n||" ",s=e+"",o=t-s.length;return o<=0?s:i==="left"?Yc(r,o)+s:i==="center"?Yc(r,~~(o/2))+s+Yc(r,Math.ceil(o/2)):s+Yc(r,o)}function Xc(e){return e&&Ge(e)-e[0]||0}function Q(e){return W(e)?"["+e.map(Q)+"]":re(e)||se(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function F2(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const bq=e=>Ze(e)||_o(e)?e:Date.parse(e);function D2(e,t){return t=t||bq,e==null||e===""?null:t(e)}function T2(e){return e==null||e===""?null:e+""}function lr(e){const t={},n=e.length;for(let i=0;i9999?"+"+ri(e,6):ri(e,4)}function _q(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":xq(e.getUTCFullYear())+"-"+ri(e.getUTCMonth()+1,2)+"-"+ri(e.getUTCDate(),2)+(r?"T"+ri(t,2)+":"+ri(n,2)+":"+ri(i,2)+"."+ri(r,3)+"Z":i?"T"+ri(t,2)+":"+ri(n,2)+":"+ri(i,2)+"Z":n||t?"T"+ri(t,2)+":"+ri(n,2)+"Z":"")}function wq(e){var t=new RegExp('["'+e+` -\r]`),n=e.charCodeAt(0);function i(f,d){var h,p,g=r(f,function(m,y){if(h)return h(m,y-1);p=m,h=d?vq(m,d):t8(m)});return g.columns=p||[],g}function r(f,d){var h=[],p=f.length,g=0,m=0,y,b=p<=0,v=!1;f.charCodeAt(p-1)===Kc&&--p,f.charCodeAt(p-1)===R2&&--p;function x(){if(b)return M2;if(v)return v=!1,e8;var E,w=g,C;if(f.charCodeAt(w)===N2){for(;g++=p?b=!0:(C=f.charCodeAt(g++))===Kc?v=!0:C===R2&&(v=!0,f.charCodeAt(g)===Kc&&++g),f.slice(w+1,E-1).replace(/""/g,'"')}for(;gfunction(t){return t[e]},pq=e=>{const t=e.length;return function(n){for(let i=0;io?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||q("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&q("Access path missing closing bracket: "+e),i&&q("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function Bi(e,t,n){const i=jr(e);return e=i.length===1?i[0]:e,ii((n&&n.get||D4)(i),[e],t||e)}const Vc=Bi("id"),En=ii(e=>e,[],"identity"),bo=ii(()=>0,[],"zero"),tl=ii(()=>1,[],"one"),Ui=ii(()=>!0,[],"true"),vo=ii(()=>!1,[],"false");function gq(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const T4=0,v2=1,x2=2,M4=3,N4=4;function _2(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:gq,i=e||T4;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=v2&&n(t||"error","ERROR",arguments),this},warn(){return i>=x2&&n(t||"warn","WARN",arguments),this},info(){return i>=M4&&n(t||"log","INFO",arguments),this},debug(){return i>=N4&&n(t||"log","DEBUG",arguments),this}}}var W=Array.isArray;function re(e){return e===Object(e)}const R4=e=>e!=="__proto__";function nl(){for(var e=arguments.length,t=new Array(e),n=0;n{for(const s in r)if(s==="signals")i.signals=mq(i.signals,r.signals);else{const o=s==="legend"?{layout:1}:s==="style"?!0:null;il(i,s,r[s],o)}return i},{})}function il(e,t,n,i){if(!R4(t))return;let r,s;if(re(n)&&!W(n)){s=re(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?il(s,r,n[r]):R4(r)&&(s[r]=n[r])}else e[t]=n}function mq(e,t){if(e==null)return t;const n={},i=[];function r(s){n[s.name]||(n[s.name]=1,i.push(s))}return t.forEach(r),e.forEach(r),i}function Ge(e){return e[e.length-1]}function Cn(e){return e==null||e===""?null:+e}const O4=e=>t=>e*Math.exp(t),L4=e=>t=>Math.log(e*t),I4=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),P4=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,Yh=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function Xh(e,t,n,i){const r=n(e[0]),s=n(Ge(e)),o=(s-r)*t;return[i(r-o),i(s-o)]}function z4(e,t){return Xh(e,t,Cn,En)}function B4(e,t){var n=Math.sign(e[0]);return Xh(e,t,L4(n),O4(n))}function U4(e,t,n){return Xh(e,t,Yh(n),Yh(1/n))}function j4(e,t,n){return Xh(e,t,I4(n),P4(n))}function Kh(e,t,n,i,r){const s=i(e[0]),o=i(Ge(e)),a=t!=null?i(t):(s+o)/2;return[r(a+(s-a)*n),r(a+(o-a)*n)]}function w2(e,t,n){return Kh(e,t,n,Cn,En)}function E2(e,t,n){const i=Math.sign(e[0]);return Kh(e,t,n,L4(i),O4(i))}function Zh(e,t,n,i){return Kh(e,t,n,Yh(i),Yh(1/i))}function C2(e,t,n,i){return Kh(e,t,n,I4(i),P4(i))}function q4(e){return 1+~~(new Date(e).getMonth()/3)}function W4(e){return 1+~~(new Date(e).getUTCMonth()/3)}function oe(e){return e!=null?W(e)?e:[e]:[]}function H4(e,t,n){let i=e[0],r=e[1],s;return r=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-s),i+s]}function Le(e){return typeof e=="function"}const yq="descending";function k2(e,t,n){n=n||{},t=oe(t)||[];const i=[],r=[],s={},o=n.comparator||bq;return oe(e).forEach((a,u)=>{a!=null&&(i.push(t[u]===yq?-1:1),r.push(a=Le(a)?a:Bi(a,null,n)),(wn(a)||[]).forEach(l=>s[l]=1))}),r.length===0?null:ii(o(r,i),Object.keys(s))}const rl=(e,t)=>(et||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),bq=(e,t)=>e.length===1?vq(e[0],t[0]):xq(e,t,e.length),vq=(e,t)=>function(n,i){return rl(e(n),e(i))*t},xq=(e,t,n)=>(t.push(0),function(i,r){let s,o=0,a=-1;for(;o===0&&++ae}function A2(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function Ie(e){for(let t,n,i=1,r=arguments.length;io&&(o=r))}else{for(r=t(e[n]);no&&(o=r))}return[s,o]}function G4(e,t){const n=e.length;let i=-1,r,s,o,a,u;if(t==null){for(;++i=s){r=o=s;break}if(i===n)return[-1,-1];for(a=u=i;++is&&(r=s,a=i),o=s){r=o=s;break}if(i===n)return[-1,-1];for(a=u=i;++is&&(r=s,a=i),o{r.set(s,e[s])}),r}function V4(e,t,n,i,r,s){if(!n&&n!==0)return s;const o=+n;let a=e[0],u=Ge(e),l;us&&(o=r,r=s,s=o),n=n===void 0||n,i=i===void 0||i,(n?r<=e:ra.replace(/\\(.)/g,"$1")):oe(e));const i=e&&e.length,r=n&&n.get||D4,s=a=>r(t?[a]:jr(a));let o;if(!i)o=function(){return""};else if(i===1){const a=s(e[0]);o=function(u){return""+a(u)}}else{const a=e.map(s);o=function(u){let l=""+a[0](u),c=0;for(;++c{t={},n={},i=0},s=(o,a)=>(++i>e&&(n=t,t={},i=1),t[o]=a);return r(),{clear:r,has:o=>ue(t,o)||ue(n,o),get:o=>ue(t,o)?t[o]:ue(n,o)?s(o,n[o]):void 0,set:(o,a)=>ue(t,o)?t[o]=a:s(o,a)}}function Z4(e,t,n,i){const r=t.length,s=n.length;if(!s)return t;if(!r)return n;const o=i||new t.constructor(r+s);let a=0,u=0,l=0;for(;a0?n[u++]:t[a++];for(;a=0;)n+=e;return n}function J4(e,t,n,i){const r=n||" ",s=e+"",o=t-s.length;return o<=0?s:i==="left"?Yc(r,o)+s:i==="center"?Yc(r,~~(o/2))+s+Yc(r,Math.ceil(o/2)):s+Yc(r,o)}function Xc(e){return e&&Ge(e)-e[0]||0}function Q(e){return W(e)?"["+e.map(Q)+"]":re(e)||se(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function F2(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const wq=e=>Je(e)||_o(e)?e:Date.parse(e);function D2(e,t){return t=t||wq,e==null||e===""?null:t(e)}function T2(e){return e==null||e===""?null:e+""}function lr(e){const t={},n=e.length;for(let i=0;i9999?"+"+ri(e,6):ri(e,4)}function kq(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":Cq(e.getUTCFullYear())+"-"+ri(e.getUTCMonth()+1,2)+"-"+ri(e.getUTCDate(),2)+(r?"T"+ri(t,2)+":"+ri(n,2)+":"+ri(i,2)+"."+ri(r,3)+"Z":i?"T"+ri(t,2)+":"+ri(n,2)+":"+ri(i,2)+"Z":n||t?"T"+ri(t,2)+":"+ri(n,2)+"Z":"")}function Aq(e){var t=new RegExp('["'+e+` +\r]`),n=e.charCodeAt(0);function i(f,d){var h,p,g=r(f,function(m,y){if(h)return h(m,y-1);p=m,h=d?Eq(m,d):t8(m)});return g.columns=p||[],g}function r(f,d){var h=[],p=f.length,g=0,m=0,y,b=p<=0,v=!1;f.charCodeAt(p-1)===Kc&&--p,f.charCodeAt(p-1)===R2&&--p;function x(){if(b)return M2;if(v)return v=!1,e8;var E,w=g,C;if(f.charCodeAt(w)===N2){for(;g++=p?b=!0:(C=f.charCodeAt(g++))===Kc?v=!0:C===R2&&(v=!0,f.charCodeAt(g)===Kc&&++g),f.slice(w+1,E-1).replace(/""/g,'"')}for(;g1)i=Dq(e,t,n);else for(r=0,i=new Array(s=e.arcs.length);rt?1:e>=t?0:NaN}function Tq(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function al(e){let t,n,i;e.length!==2?(t=Ds,n=(a,u)=>Ds(e(a),u),i=(a,u)=>e(a)-u):(t=e===Ds||e===Tq?e:Mq,n=e,i=e);function r(a,u,l=0,c=a.length){if(l>>1;n(a[f],u)<0?l=f+1:c=f}while(l>>1;n(a[f],u)<=0?l=f+1:c=f}while(ll&&i(a[f-1],u)>-i(a[f],u)?f-1:f}return{left:r,center:o,right:s}}function Mq(){return 0}function s8(e){return e===null?NaN:+e}function*Nq(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(i=+i)>=i&&(yield i)}}const o8=al(Ds),Eo=o8.right,Rq=o8.left;al(s8).center;function Oq(e,t){let n=0,i,r=0,s=0;if(t===void 0)for(let o of e)o!=null&&(o=+o)>=o&&(i=o-r,r+=i/++n,s+=i*(o-r));else{let o=-1;for(let a of e)(a=t(a,++o,e))!=null&&(a=+a)>=a&&(i=a-r,r+=i/++n,s+=i*(a-r))}if(n>1)return s/(n-1)}function Lq(e,t){const n=Oq(e,t);return n&&Math.sqrt(n)}class zn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let i=0;for(let r=0;r0){for(o=t[--n];n>0&&(i=o,r=t[--n],o=i+r,s=r-(o-i),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(r=s*2,i=o+r,r==i-o&&(o=i))}return o}}class a8 extends Map{constructor(t,n=c8){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[i,r]of t)this.set(i,r)}get(t){return super.get(O2(this,t))}has(t){return super.has(O2(this,t))}set(t,n){return super.set(u8(this,t),n)}delete(t){return super.delete(l8(this,t))}}class Qh extends Set{constructor(t,n=c8){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const i of t)this.add(i)}has(t){return super.has(O2(this,t))}add(t){return super.add(u8(this,t))}delete(t){return super.delete(l8(this,t))}}function O2({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function u8({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function l8({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function c8(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Iq(e,t){return Array.from(t,n=>e[n])}function Pq(e=Ds){if(e===Ds)return f8;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function f8(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const zq=Math.sqrt(50),Bq=Math.sqrt(10),Uq=Math.sqrt(2);function e0(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),s=i/Math.pow(10,r),o=s>=zq?10:s>=Bq?5:s>=Uq?2:1;let a,u,l;return r<0?(l=Math.pow(10,-r)/o,a=Math.round(e*l),u=Math.round(t*l),a/lt&&--u,l=-l):(l=Math.pow(10,r)*o,a=Math.round(e/l),u=Math.round(t/l),a*lt&&--u),u0))return[];if(e===t)return[e];const i=t=r))return[];const a=s-r+1,u=new Array(a);if(i)if(o<0)for(let l=0;l=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n=r)&&(n=r)}return n}function P2(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function d8(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?f8:Pq(r);i>n;){if(i-n>600){const u=i-n+1,l=t-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),h=Math.max(n,Math.floor(t-l*f/u+d)),p=Math.min(i,Math.floor(t+(u-l)*f/u+d));d8(e,t,h,p,r)}const s=e[t];let o=n,a=i;for(Zc(e,n,t),r(e[i],s)>0&&Zc(e,n,i);o0;)--a}r(e[n],s)===0?Zc(e,n,a):(++a,Zc(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}return e}function Zc(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function z2(e,t,n){if(e=Float64Array.from(Nq(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return P2(e);if(t>=1)return Aa(e);var i,r=(i-1)*t,s=Math.floor(r),o=Aa(d8(e,s).subarray(0,s+1)),a=P2(e.subarray(s+1));return o+(a-o)*(r-s)}}function h8(e,t,n=s8){if(!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,s=Math.floor(r),o=+n(e[s],s,e),a=+n(e[s+1],s+1,e);return o+(a-o)*(r-s)}}function jq(e,t){let n=0,i=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(++n,i+=r);else{let r=-1;for(let s of e)(s=t(s,++r,e))!=null&&(s=+s)>=s&&(++n,i+=s)}if(n)return i/n}function p8(e,t){return z2(e,.5,t)}function*qq(e){for(const t of e)yield*t}function g8(e){return Array.from(qq(e))}function Ei(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(r);++i=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function t0(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function ul(e){return e=t0(Math.abs(e)),e?e[1]:NaN}function Yq(e,t){return function(n,i){for(var r=n.length,s=[],o=0,a=e[0],u=0;r>0&&a>0&&(u+a+1>i&&(a=Math.max(1,i-u)),s.push(n.substring(r-=a,r+a)),!((u+=a+1)>i));)a=e[o=(o+1)%e.length];return s.reverse().join(t)}}function Xq(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Kq=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $a(e){if(!(t=Kq.exec(e)))throw new Error("invalid format: "+e);var t;return new B2({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}$a.prototype=B2.prototype;function B2(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}B2.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Zq(e){e:for(var t=e.length,n=1,i=-1,r;n0&&(i=0);break}return i>0?e.slice(0,i)+e.slice(r+1):e}var y8;function Jq(e,t){var n=t0(e,t);if(!n)return e+"";var i=n[0],r=n[1],s=r-(y8=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+t0(e,Math.max(0,t+s-1))[0]}function b8(e,t){var n=t0(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const v8={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Vq,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>b8(e*100,t),r:b8,s:Jq,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function x8(e){return e}var _8=Array.prototype.map,w8=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function E8(e){var t=e.grouping===void 0||e.thousands===void 0?x8:Yq(_8.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",i=e.currency===void 0?"":e.currency[1]+"",r=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?x8:Xq(_8.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function l(f){f=$a(f);var d=f.fill,h=f.align,p=f.sign,g=f.symbol,m=f.zero,y=f.width,b=f.comma,v=f.precision,x=f.trim,_=f.type;_==="n"?(b=!0,_="g"):v8[_]||(v===void 0&&(v=12),x=!0,_="g"),(m||d==="0"&&h==="=")&&(m=!0,d="0",h="=");var E=g==="$"?n:g==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",w=g==="$"?i:/[%p]/.test(_)?o:"",C=v8[_],k=/[defgprs%]/.test(_);v=v===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function S($){var O=E,R=w,D,A,T;if(_==="c")R=C($)+R,$="";else{$=+$;var B=$<0||1/$<0;if($=isNaN($)?u:C(Math.abs($),v),x&&($=Zq($)),B&&+$==0&&p!=="+"&&(B=!1),O=(B?p==="("?p:a:p==="-"||p==="("?"":p)+O,R=(_==="s"?w8[8+y8/3]:"")+R+(B&&p==="("?")":""),k){for(D=-1,A=$.length;++DT||T>57){R=(T===46?r+$.slice(D+1):$.slice(D))+R,$=$.slice(0,D);break}}}b&&!m&&($=t($,1/0));var G=O.length+$.length+R.length,z=G>1)+O+$+R+z.slice(G);break;default:$=z+O+$+R;break}return s($)}return S.toString=function(){return f+""},S}function c(f,d){var h=l((f=$a(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(ul(d)/3)))*3,g=Math.pow(10,-p),m=w8[8+p/3];return function(y){return h(g*y)+m}}return{format:l,formatPrefix:c}}var n0,i0,U2;Qq({thousands:",",grouping:[3],currency:["$",""]});function Qq(e){return n0=E8(e),i0=n0.format,U2=n0.formatPrefix,n0}function C8(e){return Math.max(0,-ul(Math.abs(e)))}function k8(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ul(t)/3)))*3-ul(Math.abs(e)))}function A8(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ul(t)-ul(e))+1}const j2=new Date,q2=new Date;function qt(e,t,n,i){function r(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return r.floor=s=>(e(s=new Date(+s)),s),r.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),r.round=s=>{const o=r(s),a=r.ceil(s);return s-o(t(s=new Date(+s),o==null?1:Math.floor(o)),s),r.range=(s,o,a)=>{const u=[];if(s=r.ceil(s),a=a==null?1:Math.floor(a),!(s0))return u;let l;do u.push(l=new Date(+s)),t(s,a),e(s);while(lqt(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,a)=>{if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!s(o););else for(;--a>=0;)for(;t(o,1),!s(o););}),n&&(r.count=(s,o)=>(j2.setTime(+s),q2.setTime(+o),e(j2),e(q2),Math.floor(n(j2,q2))),r.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?r.filter(i?o=>i(o)%s===0:o=>r.count(0,o)%s===0):r)),r}const ll=qt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ll.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?qt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ll),ll.range;const Ts=1e3,ji=Ts*60,Ms=ji*60,Ns=Ms*24,W2=Ns*7,$8=Ns*30,H2=Ns*365,Rs=qt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ts)},(e,t)=>(t-e)/Ts,e=>e.getUTCSeconds());Rs.range;const r0=qt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ts)},(e,t)=>{e.setTime(+e+t*ji)},(e,t)=>(t-e)/ji,e=>e.getMinutes());r0.range;const s0=qt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ji)},(e,t)=>(t-e)/ji,e=>e.getUTCMinutes());s0.range;const o0=qt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ts-e.getMinutes()*ji)},(e,t)=>{e.setTime(+e+t*Ms)},(e,t)=>(t-e)/Ms,e=>e.getHours());o0.range;const a0=qt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ms)},(e,t)=>(t-e)/Ms,e=>e.getUTCHours());a0.range;const Os=qt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ji)/Ns,e=>e.getDate()-1);Os.range;const ko=qt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ns,e=>e.getUTCDate()-1);ko.range;const S8=qt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ns,e=>Math.floor(e/Ns));S8.range;function Sa(e){return qt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*ji)/W2)}const cl=Sa(0),u0=Sa(1),eW=Sa(2),tW=Sa(3),fl=Sa(4),nW=Sa(5),iW=Sa(6);cl.range,u0.range,eW.range,tW.range,fl.range,nW.range,iW.range;function Fa(e){return qt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/W2)}const dl=Fa(0),l0=Fa(1),rW=Fa(2),sW=Fa(3),hl=Fa(4),oW=Fa(5),aW=Fa(6);dl.range,l0.range,rW.range,sW.range,hl.range,oW.range,aW.range;const Jc=qt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Jc.range;const Qc=qt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Qc.range;const Wr=qt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Wr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Wr.range;const Hr=qt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Hr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),Hr.range;function F8(e,t,n,i,r,s){const o=[[Rs,1,Ts],[Rs,5,5*Ts],[Rs,15,15*Ts],[Rs,30,30*Ts],[s,1,ji],[s,5,5*ji],[s,15,15*ji],[s,30,30*ji],[r,1,Ms],[r,3,3*Ms],[r,6,6*Ms],[r,12,12*Ms],[i,1,Ns],[i,2,2*Ns],[n,1,W2],[t,1,$8],[t,3,3*$8],[e,1,H2]];function a(l,c,f){const d=cm).right(o,d);if(h===o.length)return e.every(Co(l/H2,c/H2,f));if(h===0)return ll.every(Math.max(Co(l,c,f),1));const[p,g]=o[d/o[h-1][2](e[t]=1+n,e),{});function Y2(e){const t=oe(e).slice(),n={};return t.length||q("Missing time unit."),t.forEach(r=>{ue(V2,r)?n[r]=1:q(`Invalid time unit: ${r}.`)}),(n[Wt]||n[$n]?1:0)+(n[si]||n[An]||n[oi]?1:0)+(n[Gr]?1:0)>1&&q(`Incompatible time units: ${e}`),t.sort((r,s)=>V2[r]-V2[s]),t}const dW={[cn]:"%Y ",[si]:"Q%q ",[An]:"%b ",[oi]:"%d ",[Wt]:"W%U ",[$n]:"%a ",[Gr]:"%j ",[Ci]:"%H:00",[ki]:"00:%M",[qi]:":%S",[cr]:".%L",[`${cn}-${An}`]:"%Y-%m ",[`${cn}-${An}-${oi}`]:"%Y-%m-%d ",[`${Ci}-${ki}`]:"%H:%M"};function D8(e,t){const n=Le({},dW,t),i=Y2(e),r=i.length;let s="",o=0,a,u;for(o=0;oo;--a)if(u=i.slice(o,a).join("-"),n[u]!=null){s+=n[u],o=a;break}return s.trim()}const Da=new Date;function X2(e){return Da.setFullYear(e),Da.setMonth(0),Da.setDate(1),Da.setHours(0,0,0,0),Da}function T8(e){return N8(new Date(e))}function M8(e){return K2(new Date(e))}function N8(e){return Os.count(X2(e.getFullYear())-1,e)}function K2(e){return cl.count(X2(e.getFullYear())-1,e)}function Z2(e){return X2(e).getDay()}function hW(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(-1,t,n,i,r,s,o);return a.setFullYear(e),a}return new Date(e,t,n,i,r,s,o)}function R8(e){return L8(new Date(e))}function O8(e){return J2(new Date(e))}function L8(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return ko.count(t-1,e)}function J2(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return dl.count(t-1,e)}function Q2(e){return Da.setTime(Date.UTC(e,0,1)),Da.getUTCDay()}function pW(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(Date.UTC(-1,t,n,i,r,s,o));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(e,t,n,i,r,s,o))}function I8(e,t,n,i,r){const s=t||1,o=Ge(e),a=(y,b,v)=>(v=v||y,gW(n[v],i[v],y===o&&s,b)),u=new Date,l=lr(e),c=l[cn]?a(cn):kn(2012),f=l[An]?a(An):l[si]?a(si):bo,d=l[Wt]&&l[$n]?a($n,1,Wt+$n):l[Wt]?a(Wt,1):l[$n]?a($n,1):l[oi]?a(oi,1):l[Gr]?a(Gr,1):tl,h=l[Ci]?a(Ci):bo,p=l[ki]?a(ki):bo,g=l[qi]?a(qi):bo,m=l[cr]?a(cr):bo;return function(y){u.setTime(+y);const b=c(u);return r(b,f(u),d(u,b),h(u),p(u),g(u),m(u))}}function gW(e,t,n,i){const r=n<=1?e:i?(s,o)=>i+n*Math.floor((e(s,o)-i)/n):(s,o)=>n*Math.floor(e(s,o)/n);return t?(s,o)=>t(r(s,o),o):r}function pl(e,t,n){return t+e*7-(n+6)%7}const mW={[cn]:e=>e.getFullYear(),[si]:e=>Math.floor(e.getMonth()/3),[An]:e=>e.getMonth(),[oi]:e=>e.getDate(),[Ci]:e=>e.getHours(),[ki]:e=>e.getMinutes(),[qi]:e=>e.getSeconds(),[cr]:e=>e.getMilliseconds(),[Gr]:e=>N8(e),[Wt]:e=>K2(e),[Wt+$n]:(e,t)=>pl(K2(e),e.getDay(),Z2(t)),[$n]:(e,t)=>pl(1,e.getDay(),Z2(t))},yW={[si]:e=>3*e,[Wt]:(e,t)=>pl(e,0,Z2(t))};function P8(e,t){return I8(e,t||1,mW,yW,hW)}const bW={[cn]:e=>e.getUTCFullYear(),[si]:e=>Math.floor(e.getUTCMonth()/3),[An]:e=>e.getUTCMonth(),[oi]:e=>e.getUTCDate(),[Ci]:e=>e.getUTCHours(),[ki]:e=>e.getUTCMinutes(),[qi]:e=>e.getUTCSeconds(),[cr]:e=>e.getUTCMilliseconds(),[Gr]:e=>L8(e),[Wt]:e=>J2(e),[$n]:(e,t)=>pl(1,e.getUTCDay(),Q2(t)),[Wt+$n]:(e,t)=>pl(J2(e),e.getUTCDay(),Q2(t))},vW={[si]:e=>3*e,[Wt]:(e,t)=>pl(e,0,Q2(t))};function z8(e,t){return I8(e,t||1,bW,vW,pW)}const xW={[cn]:Wr,[si]:Jc.every(3),[An]:Jc,[Wt]:cl,[oi]:Os,[$n]:Os,[Gr]:Os,[Ci]:o0,[ki]:r0,[qi]:Rs,[cr]:ll},_W={[cn]:Hr,[si]:Qc.every(3),[An]:Qc,[Wt]:dl,[oi]:ko,[$n]:ko,[Gr]:ko,[Ci]:a0,[ki]:s0,[qi]:Rs,[cr]:ll};function gl(e){return xW[e]}function ml(e){return _W[e]}function B8(e,t,n){return e?e.offset(t,n):void 0}function U8(e,t,n){return B8(gl(e),t,n)}function j8(e,t,n){return B8(ml(e),t,n)}function q8(e,t,n,i){return e?e.range(t,n,i):void 0}function W8(e,t,n,i){return q8(gl(e),t,n,i)}function H8(e,t,n,i){return q8(ml(e),t,n,i)}const ef=1e3,tf=ef*60,nf=tf*60,c0=nf*24,wW=c0*7,G8=c0*30,ey=c0*365,V8=[cn,An,oi,Ci,ki,qi,cr],rf=V8.slice(0,-1),sf=rf.slice(0,-1),of=sf.slice(0,-1),EW=of.slice(0,-1),CW=[cn,Wt],Y8=[cn,An],X8=[cn],af=[[rf,1,ef],[rf,5,5*ef],[rf,15,15*ef],[rf,30,30*ef],[sf,1,tf],[sf,5,5*tf],[sf,15,15*tf],[sf,30,30*tf],[of,1,nf],[of,3,3*nf],[of,6,6*nf],[of,12,12*nf],[EW,1,c0],[CW,1,wW],[Y8,1,G8],[Y8,3,3*G8],[X8,1,ey]];function K8(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(Xc(t))/n;let r=al(a=>a[2]).right(af,i),s,o;return r===af.length?(s=X8,o=Co(t[0]/ey,t[1]/ey,n)):r?(r=af[i/af[r-1][2]53)return null;"w"in K||(K.w=1),"Z"in K?(Xe=ny(uf(K.y,0,1)),Pn=Xe.getUTCDay(),Xe=Pn>4||Pn===0?l0.ceil(Xe):l0(Xe),Xe=ko.offset(Xe,(K.V-1)*7),K.y=Xe.getUTCFullYear(),K.m=Xe.getUTCMonth(),K.d=Xe.getUTCDate()+(K.w+6)%7):(Xe=ty(uf(K.y,0,1)),Pn=Xe.getDay(),Xe=Pn>4||Pn===0?u0.ceil(Xe):u0(Xe),Xe=Os.offset(Xe,(K.V-1)*7),K.y=Xe.getFullYear(),K.m=Xe.getMonth(),K.d=Xe.getDate()+(K.w+6)%7)}else("W"in K||"U"in K)&&("w"in K||(K.w="u"in K?K.u%7:"W"in K?1:0),Pn="Z"in K?ny(uf(K.y,0,1)).getUTCDay():ty(uf(K.y,0,1)).getDay(),K.m=0,K.d="W"in K?(K.w+6)%7+K.W*7-(Pn+5)%7:K.w+K.U*7-(Pn+6)%7);return"Z"in K?(K.H+=K.Z/100|0,K.M+=K.Z%100,ny(K)):ty(K)}}function C(le,Re,Ie,K){for(var Kt=0,Xe=Re.length,Pn=Ie.length,ln,Fs;Kt=Pn)return-1;if(ln=Re.charCodeAt(Kt++),ln===37){if(ln=Re.charAt(Kt++),Fs=_[ln in J8?Re.charAt(Kt++):ln],!Fs||(K=Fs(le,Ie,K))<0)return-1}else if(ln!=Ie.charCodeAt(K++))return-1}return K}function k(le,Re,Ie){var K=l.exec(Re.slice(Ie));return K?(le.p=c.get(K[0].toLowerCase()),Ie+K[0].length):-1}function S(le,Re,Ie){var K=h.exec(Re.slice(Ie));return K?(le.w=p.get(K[0].toLowerCase()),Ie+K[0].length):-1}function $(le,Re,Ie){var K=f.exec(Re.slice(Ie));return K?(le.w=d.get(K[0].toLowerCase()),Ie+K[0].length):-1}function O(le,Re,Ie){var K=y.exec(Re.slice(Ie));return K?(le.m=b.get(K[0].toLowerCase()),Ie+K[0].length):-1}function R(le,Re,Ie){var K=g.exec(Re.slice(Ie));return K?(le.m=m.get(K[0].toLowerCase()),Ie+K[0].length):-1}function D(le,Re,Ie){return C(le,t,Re,Ie)}function A(le,Re,Ie){return C(le,n,Re,Ie)}function T(le,Re,Ie){return C(le,i,Re,Ie)}function B(le){return o[le.getDay()]}function G(le){return s[le.getDay()]}function z(le){return u[le.getMonth()]}function ie(le){return a[le.getMonth()]}function be(le){return r[+(le.getHours()>=12)]}function he(le){return 1+~~(le.getMonth()/3)}function Te(le){return o[le.getUTCDay()]}function ct(le){return s[le.getUTCDay()]}function Fe(le){return u[le.getUTCMonth()]}function Ot(le){return a[le.getUTCMonth()]}function or(le){return r[+(le.getUTCHours()>=12)]}function Ii(le){return 1+~~(le.getUTCMonth()/3)}return{format:function(le){var Re=E(le+="",v);return Re.toString=function(){return le},Re},parse:function(le){var Re=w(le+="",!1);return Re.toString=function(){return le},Re},utcFormat:function(le){var Re=E(le+="",x);return Re.toString=function(){return le},Re},utcParse:function(le){var Re=w(le+="",!0);return Re.toString=function(){return le},Re}}}var J8={"-":"",_:" ",0:"0"},Zt=/^\s*\d+/,kW=/^%/,AW=/[\\^$*+?|[\]().{}]/g;function Je(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",s=r.length;return i+(s[t.toLowerCase(),n]))}function SW(e,t,n){var i=Zt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function FW(e,t,n){var i=Zt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function DW(e,t,n){var i=Zt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function TW(e,t,n){var i=Zt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function MW(e,t,n){var i=Zt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function Q8(e,t,n){var i=Zt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function eE(e,t,n){var i=Zt.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function NW(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function RW(e,t,n){var i=Zt.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function OW(e,t,n){var i=Zt.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function tE(e,t,n){var i=Zt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function LW(e,t,n){var i=Zt.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function nE(e,t,n){var i=Zt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function IW(e,t,n){var i=Zt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function PW(e,t,n){var i=Zt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function zW(e,t,n){var i=Zt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function BW(e,t,n){var i=Zt.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function UW(e,t,n){var i=kW.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function jW(e,t,n){var i=Zt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function qW(e,t,n){var i=Zt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function iE(e,t){return Je(e.getDate(),t,2)}function WW(e,t){return Je(e.getHours(),t,2)}function HW(e,t){return Je(e.getHours()%12||12,t,2)}function GW(e,t){return Je(1+Os.count(Wr(e),e),t,3)}function rE(e,t){return Je(e.getMilliseconds(),t,3)}function VW(e,t){return rE(e,t)+"000"}function YW(e,t){return Je(e.getMonth()+1,t,2)}function XW(e,t){return Je(e.getMinutes(),t,2)}function KW(e,t){return Je(e.getSeconds(),t,2)}function ZW(e){var t=e.getDay();return t===0?7:t}function JW(e,t){return Je(cl.count(Wr(e)-1,e),t,2)}function sE(e){var t=e.getDay();return t>=4||t===0?fl(e):fl.ceil(e)}function QW(e,t){return e=sE(e),Je(fl.count(Wr(e),e)+(Wr(e).getDay()===4),t,2)}function eH(e){return e.getDay()}function tH(e,t){return Je(u0.count(Wr(e)-1,e),t,2)}function nH(e,t){return Je(e.getFullYear()%100,t,2)}function iH(e,t){return e=sE(e),Je(e.getFullYear()%100,t,2)}function rH(e,t){return Je(e.getFullYear()%1e4,t,4)}function sH(e,t){var n=e.getDay();return e=n>=4||n===0?fl(e):fl.ceil(e),Je(e.getFullYear()%1e4,t,4)}function oH(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Je(t/60|0,"0",2)+Je(t%60,"0",2)}function oE(e,t){return Je(e.getUTCDate(),t,2)}function aH(e,t){return Je(e.getUTCHours(),t,2)}function uH(e,t){return Je(e.getUTCHours()%12||12,t,2)}function lH(e,t){return Je(1+ko.count(Hr(e),e),t,3)}function aE(e,t){return Je(e.getUTCMilliseconds(),t,3)}function cH(e,t){return aE(e,t)+"000"}function fH(e,t){return Je(e.getUTCMonth()+1,t,2)}function dH(e,t){return Je(e.getUTCMinutes(),t,2)}function hH(e,t){return Je(e.getUTCSeconds(),t,2)}function pH(e){var t=e.getUTCDay();return t===0?7:t}function gH(e,t){return Je(dl.count(Hr(e)-1,e),t,2)}function uE(e){var t=e.getUTCDay();return t>=4||t===0?hl(e):hl.ceil(e)}function mH(e,t){return e=uE(e),Je(hl.count(Hr(e),e)+(Hr(e).getUTCDay()===4),t,2)}function yH(e){return e.getUTCDay()}function bH(e,t){return Je(l0.count(Hr(e)-1,e),t,2)}function vH(e,t){return Je(e.getUTCFullYear()%100,t,2)}function xH(e,t){return e=uE(e),Je(e.getUTCFullYear()%100,t,2)}function _H(e,t){return Je(e.getUTCFullYear()%1e4,t,4)}function wH(e,t){var n=e.getUTCDay();return e=n>=4||n===0?hl(e):hl.ceil(e),Je(e.getUTCFullYear()%1e4,t,4)}function EH(){return"+0000"}function lE(){return"%"}function cE(e){return+e}function fE(e){return Math.floor(+e/1e3)}var yl,iy,dE,ry,hE;CH({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function CH(e){return yl=Z8(e),iy=yl.format,dE=yl.parse,ry=yl.utcFormat,hE=yl.utcParse,yl}function ff(e){const t={};return n=>t[n]||(t[n]=e(n))}function kH(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let s=AH(i,r);const o=sr;)if(i[s]!=="0"){++s;break}return i.slice(0,s)+o}}function AH(e,t){let n=e.lastIndexOf("e"),i;if(n>0)return n;for(n=e.length;--n>t;)if(i=e.charCodeAt(n),i>=48&&i<=57)return n+1}function pE(e){const t=ff(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=$a(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return kH(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,s,o){o=$a(o??",f");const a=Co(i,r,s),u=Math.max(Math.abs(i),Math.abs(r));let l;if(o.precision==null)switch(o.type){case"s":return isNaN(l=k8(a,u))||(o.precision=l),n(o,u);case"":case"e":case"g":case"p":case"r":{isNaN(l=A8(a,u))||(o.precision=l-(o.type==="e"));break}case"f":case"%":{isNaN(l=C8(a))||(o.precision=l-(o.type==="%")*2);break}}return t(o)}}}let sy;gE();function gE(){return sy=pE({format:i0,formatPrefix:U2})}function mE(e){return pE(E8(e))}function f0(e){return arguments.length?sy=mE(e):sy}function yE(e,t,n){n=n||{},re(n)||q(`Invalid time multi-format specifier: ${n}`);const i=t(qi),r=t(ki),s=t(Ci),o=t(oi),a=t(Wt),u=t(An),l=t(si),c=t(cn),f=e(n[cr]||".%L"),d=e(n[qi]||":%S"),h=e(n[ki]||"%I:%M"),p=e(n[Ci]||"%I %p"),g=e(n[oi]||n[$n]||"%a %d"),m=e(n[Wt]||"%b %d"),y=e(n[An]||"%B"),b=e(n[si]||"%B"),v=e(n[cn]||"%Y");return x=>(i(x)se(i)?t(i):yE(t,gl,i),utcFormat:i=>se(i)?n(i):yE(n,ml,i),timeParse:ff(e.parse),utcParse:ff(e.utcParse)}}let oy;vE();function vE(){return oy=bE({format:iy,parse:dE,utcFormat:ry,utcParse:hE})}function xE(e){return bE(Z8(e))}function df(e){return arguments.length?oy=xE(e):oy}const ay=(e,t)=>Le({},e,t);function _E(e,t){const n=e?mE(e):f0(),i=t?xE(t):df();return ay(n,i)}function uy(e,t){const n=arguments.length;return n&&n!==2&&q("defaultLocale expects either zero or two arguments."),n?ay(f0(e),df(t)):ay(f0(),df())}function $H(){return gE(),vE(),uy()}const SH=/^(data:|([A-Za-z]+:)?\/\/)/,FH=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,DH=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,wE="file://";function TH(e,t){return n=>({options:n||{},sanitize:NH,load:MH,fileAccess:!1,file:RH(t),http:LH(e)})}async function MH(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function NH(e,t){t=Le({},this.options,t);const n=this.fileAccess,i={href:null};let r,s,o;const a=FH.test(e.replace(DH,""));(e==null||typeof e!="string"||!a)&&q("Sanitize failure, invalid URI: "+Q(e));const u=SH.test(e);return(o=t.baseURL)&&!u&&(!e.startsWith("/")&&!o.endsWith("/")&&(e="/"+e),e=o+e),s=(r=e.startsWith(wE))||t.mode==="file"||t.mode!=="http"&&!u&&n,r?e=e.slice(wE.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),s=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!s}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function RH(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(r,s)=>{r?i(r):n(s)})}):OH}async function OH(){q("No file system access.")}function LH(e){return e?async function(t,n){const i=Le({},this.options.http,n),r=n&&n.response,s=await e(t,i);return s.ok?Oe(s[r])?s[r]():s.text():q(s.status+""+s.statusText)}:IH}async function IH(){q("No HTTP fetch method available.")}const PH=e=>e!=null&&e===e,zH=e=>e==="true"||e==="false"||e===!0||e===!1,BH=e=>!Number.isNaN(Date.parse(e)),EE=e=>!Number.isNaN(+e)&&!(e instanceof Date),UH=e=>EE(e)&&Number.isInteger(+e),ly={boolean:F2,integer:Cn,number:Cn,date:D2,string:T2,unknown:En},d0=[zH,UH,EE,BH],jH=["boolean","integer","number","date"];function CE(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=d0.length,r=d0.map((s,o)=>o+1);for(let s=0,o=0,a,u;ss===0?o:s,0)-1]}function kE(e,t){return t.reduce((n,i)=>(n[i]=CE(e,i),n),{})}function AE(e){const t=function(n,i){const r={delimiter:e};return cy(n,i?Le(i,r):r)};return t.responseType="text",t}function cy(e,t){return t.header&&(e=t.header.map(Q).join(t.delimiter)+` -`+e),wq(t.delimiter).parse(e+"")}cy.responseType="text";function qH(e){return typeof Buffer=="function"&&Oe(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function fy(e,t){const n=t&&t.property?Bi(t.property):En;return re(e)&&!qH(e)?WH(n(e),t):n(JSON.parse(e))}fy.responseType="json";function WH(e,t){return!W(e)&&Y4(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const HH={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function $E(e,t){let n,i,r,s;return e=fy(e,t),t&&t.feature?(n=Aq,r=t.feature):t&&t.mesh?(n=Sq,r=t.mesh,s=HH[t.filter]):q("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,s):q("Invalid TopoJSON object: "+r),i&&i.features||[i]}$E.responseType="json";const h0={dsv:cy,csv:AE(","),tsv:AE(" "),json:fy,topojson:$E};function dy(e,t){return arguments.length>1?(h0[e]=t,this):ue(h0,e)?h0[e]:null}function SE(e){const t=dy(e);return t&&t.responseType||"text"}function FE(e,t,n,i){t=t||{};const r=dy(t.type||"json");return r||q("Unknown data format type: "+t.type),e=r(e,t),t.parse&&GH(e,t.parse,n,i),ue(e,"columns")&&delete e.columns,e}function GH(e,t,n,i){if(!e.length)return;const r=df();n=n||r.timeParse,i=i||r.utcParse;let s=e.columns||Object.keys(e[0]),o,a,u,l,c,f;t==="auto"&&(t=kE(e,s)),s=Object.keys(t);const d=s.map(h=>{const p=t[h];let g,m;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?i:n)(m);if(!ly[p])throw Error("Illegal format pattern: "+h+":"+p);return ly[p]});for(u=0,c=e.length,f=s.length;u{const s=t(r);return i[s]||(i[s]=1,n.push(r)),n},n.remove=r=>{const s=t(r);if(i[s]){i[s]=0;const o=n.indexOf(r);o>=0&&n.splice(o,1)}return n},n}async function m0(e,t){try{await t(e)}catch(n){e.error(n)}}const DE=Symbol("vega_id");let VH=1;function y0(e){return!!(e&&_e(e))}function _e(e){return e[DE]}function TE(e,t){return e[DE]=t,e}function nt(e){const t=e===Object(e)?e:{data:e};return _e(t)?t:TE(t,VH++)}function hy(e){return b0(e,nt({}))}function b0(e,t){for(const n in e)t[n]=e[n];return t}function ME(e,t){return TE(t,_e(e))}function Ta(e,t){return e?t?(n,i)=>e(n,i)||_e(t(n))-_e(t(i)):(n,i)=>e(n,i)||_e(n)-_e(i):null}function NE(e){return e&&e.constructor===Ao}function Ao(){const e=[],t=[],n=[],i=[],r=[];let s=null,o=!1;return{constructor:Ao,insert(a){const u=oe(a),l=u.length;for(let c=0;c{p(b)&&(l[_e(b)]=-1)});for(f=0,d=e.length;f0&&(y(g,p,h.value),a.modifies(p));for(f=0,d=r.length;f{p(b)&&l[_e(b)]>0&&y(b,h.field,h.value)}),a.modifies(h.field);if(o)a.mod=t.length||i.length?u.filter(b=>l[_e(b)]>0):u.slice();else for(m in c)a.mod.push(c[m]);return(s||s==null&&(t.length||i.length))&&a.clean(!0),a}}}const v0="_:mod:_";function x0(){Object.defineProperty(this,v0,{writable:!0,value:{}})}x0.prototype={set(e,t,n,i){const r=this,s=r[e],o=r[v0];return t!=null&&t>=0?(s[t]!==n||i)&&(s[t]=n,o[t+":"+e]=-1,o[e]=-1):(s!==n||i)&&(r[e]=n,o[e]=W(n)?1+n.length:-1),r},modified(e,t){const n=this[v0];if(arguments.length){if(W(e)){for(let i=0;i=0?t+1{h instanceof xt?(h!==this&&(t&&h.targets().add(this),s.push(h)),r.push({op:h,name:f,index:d})):i.set(f,d,h)};for(o in e)if(a=e[o],o===XH)oe(a).forEach(f=>{f instanceof xt?f!==this&&(f.targets().add(this),s.push(f)):q("Pulse parameters must be operator instances.")}),this.source=a;else if(W(a))for(i.set(o,-1,Array(u=a.length)),l=0;l{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=$o();return this.targets().add($o(null,null,A2(e,n=>{const i=n.dataflow;t.receive(n),i&&i.run&&i.run()}))),t},between(e,t){let n=!1;return e.targets().add($o(null,null,()=>n=!0)),t.targets().add($o(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Ui,this._targets=null}};function nG(e,t,n,i){const r=this,s=$o(n,i),o=function(l){l.dataflow=r;try{s.receive(l)}catch(c){r.error(c)}finally{r.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=oe(e);const u=a.length;for(let l=0;lt=i);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const uG={skip:!0};function lG(e,t,n,i,r){return(e instanceof xt?fG:cG)(this,e,t,n,i,r),this}function cG(e,t,n,i,r,s){const o=Le({},s,uG);let a,u;Oe(n)||(n=kn(n)),i===void 0?a=l=>e.touch(n(l)):Oe(i)?(u=new xt(null,i,r,!1),a=l=>{u.evaluate(l);const c=n(l),f=u.value;NE(f)?e.pulse(c,f,s):e.update(c,f,o)}):a=l=>e.update(n(l),i,o),t.apply(a)}function fG(e,t,n,i,r,s){if(i===void 0)t.targets().add(n);else{const o=s||{},a=new xt(null,dG(n,i),r,!1);a.modified(o.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}function dG(e,t){return t=Oe(t)?t:kn(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function hG(e){e.rank=++this._rank}function pG(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&q("Cycle detected in dataflow graph.")}const w0={},Vr=1,So=2,Ls=4,gG=Vr|So,OE=Vr|Ls,bl=Vr|So|Ls,LE=8,hf=16,IE=32,PE=64;function Fo(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function py(e,t){const n=[];return wo(e,t,i=>n.push(i)),n}function zE(e,t){const n={};return e.visit(t,i=>{n[_e(i)]=1}),i=>n[_e(i)]?null:i}function E0(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}Fo.prototype={StopPropagation:w0,ADD:Vr,REM:So,MOD:Ls,ADD_REM:gG,ADD_MOD:OE,ALL:bl,REFLOW:LE,SOURCE:hf,NO_SOURCE:IE,NO_FIELDS:PE,fork(e){return new Fo(this.dataflow).init(this,e)},clone(){const e=this.fork(bl);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(bl|hf)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new Fo(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,e.fields&&!(t&PE)&&(n.fields=e.fields),t&Vr?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&So?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&Ls?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&IE?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||bl;return t&Vr&&this.add.length||t&So&&this.rem.length||t&Ls&&this.mod.length},reflow(e){if(e)return this.fork(bl).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(Ls,zE(this,Vr))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return W(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return(t||this.mod.length)&&n?arguments.length?W(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&Vr&&(n.addF=E0(n.addF,t)),e&So&&(n.remF=E0(n.remF,t)),e&Ls&&(n.modF=E0(n.modF,t)),e&hf&&(n.srcF=E0(n.srcF,t)),n},materialize(e){e=e||bl;const t=this;return e&Vr&&t.addF&&(t.add=py(t.add,t.addF),t.addF=null),e&So&&t.remF&&(t.rem=py(t.rem,t.remF),t.remF=null),e&Ls&&t.modF&&(t.mod=py(t.mod,t.modF),t.modF=null),e&hf&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&hf)return wo(n.source,n.srcF,i),n;e&Vr&&wo(n.add,n.addF,i),e&So&&wo(n.rem,n.remF,i),e&Ls&&wo(n.mod,n.modF,i);const r=n.source;if(e&LE&&r){const s=n.add.length+n.mod.length;s===r.length||(s?wo(r,zE(n,OE),i):wo(r,n.srcF,i))}return n}};function gy(e,t,n,i){const r=this;let s=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const o of n)if(o.stamp===t){if(o.fields){const a=r.fields||(r.fields={});for(const u in o.fields)a[u]=1}o.changed(r.ADD)&&(s|=r.ADD),o.changed(r.REM)&&(s|=r.REM),o.changed(r.MOD)&&(s|=r.MOD)}this.changes=s}te(gy,Fo,{fork(e){const t=new Fo(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?W(e)?e.some(i=>n[i]):n[e]:0},filter(){q("MultiPulse does not support filtering.")},materialize(){q("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let s=0;if(e&n.SOURCE)for(;si._enqueue(c,!0)),i._touched=g0(Vc);let o=0,a,u,l;try{for(;i._heap.size()>0;){if(a=i._heap.pop(),a.rank!==a.qrank){i._enqueue(a,!0);continue}u=a.run(i._getPulse(a,e)),u.then?u=await u:u.async&&(r.push(u.async),u=w0),u!==w0&&a._targets&&a._targets.forEach(c=>i._enqueue(c)),++o}}catch(c){i._heap.clear(),l=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${s}: ${o} operators`),l&&(i._postrun=[],i.error(l)),i._postrun.length){const c=i._postrun.sort((f,d)=>d.priority-f.priority);i._postrun=[];for(let f=0;fi.runAsync(null,()=>{c.forEach(f=>{try{f(i)}catch(d){i.error(d)}})})),i}async function yG(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running}function bG(e,t,n){return this._pulse?BE(this):(this.evaluate(e,t,n),this)}function vG(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(i){this.error(i)}}function BE(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function xG(e,t){const n=e.stampr.pulse),t):this._input[e.id]||wG(this._pulse,n&&n.pulse)}function wG(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==w0&&(e.source=t.source),e)}const my={skip:!1,force:!1};function EG(e,t){const n=t||my;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function CG(e,t,n){const i=n||my;return(e.set(t)||i.force)&&this.touch(e,i),this}function kG(e,t,n){this.touch(e,n||my);const i=new Fo(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this}function AG(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),UE(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,$G(t,0,e)):i=n,i}}}function UE(e,t,n,i){let r,s;const o=e[n];for(;n>t;){if(s=n-1>>1,r=e[s],i(o,r)<0){e[n]=r,n=s;continue}break}return e[n]=o}function $G(e,t,n){const i=t,r=e.length,s=e[t];let o=(t<<1)+1,a;for(;o=0&&(o=a),e[t]=e[o],t=o,o=(t<<1)+1;return e[t]=s,UE(e,i,t,n)}function vl(){this.logger(_2()),this.logLevel(v2),this._clock=0,this._rank=0,this._locale=uy();try{this._loader=p0()}catch{}this._touched=g0(Vc),this._input={},this._pulse=null,this._heap=AG((e,t)=>e.qrank-t.qrank),this._postrun=[]}function pf(e){return function(){return this._log[e].apply(this,arguments)}}vl.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:pf("error"),warn:pf("warn"),info:pf("info"),debug:pf("debug"),logLevel:pf("level"),cleanThreshold:1e4,add:QH,connect:eG,rank:hG,rerank:pG,pulse:kG,touch:EG,update:CG,changeset:Ao,ingest:rG,parse:iG,preload:oG,request:sG,events:nG,on:lG,evaluate:mG,run:bG,runAsync:yG,runAfter:vG,_enqueue:xG,_getPulse:_G};function P(e,t){xt.call(this,e,null,t)}te(P,xt,{run(e){if(e.stampthis.pulse=n):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const xl={};function jE(e){const t=qE(e);return t&&t.Definition||null}function qE(e){return e=e&&e.toLowerCase(),ue(xl,e)?xl[e]:null}function*WE(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)i=t(i,++n,e),i!=null&&i!==""&&(i=+i)>=i&&(yield i)}}function yy(e,t,n){const i=Float64Array.from(WE(e,n));return i.sort(Ds),t.map(r=>h8(i,r))}function by(e,t){return yy(e,[.25,.5,.75],t)}function vy(e,t){const n=e.length,i=Lq(e,t),r=by(e,t),s=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,s)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function HE(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let s=e.extent[0],o=e.extent[1],a,u,l,c,f,d;const h=e.span||o-s||Math.abs(s)||1;if(e.step)a=e.step;else if(e.steps){for(c=h/t,f=0,d=e.steps.length;ft;)a*=n;for(f=0,d=r.length;f=l&&h/c<=t&&(a=c)}c=Math.log(a);const p=c>=0?0:~~(-c/i)+1,g=Math.pow(n,-p-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(s/a+g)*a,s=sd);const r=e.length,s=new Float64Array(r);let o=0,a=1,u=i(e[0]),l=u,c=u+t,f;for(;a=c){for(l=(u+l)/2;o>1);or;)e[o--]=e[i]}i=r,r=s}return e}function DG(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function TG(e,t){t==null&&(t=e,e=0);let n,i,r;const s={min(o){return arguments.length?(n=o||0,r=i-n,s):n},max(o){return arguments.length?(i=o||0,r=i-n,s):i},sample(){return n+Math.floor(r*Wi())},pdf(o){return o===Math.floor(o)&&o>=n&&o=i?1:(a-n+1)/r},icdf(o){return o>=0&&o<=1?n-1+Math.floor(o*r):NaN}};return s.min(e).max(t)}const YE=Math.sqrt(2*Math.PI),MG=Math.SQRT2;let gf=NaN;function C0(e,t){e=e||0,t=t??1;let n=0,i=0,r,s;if(gf===gf)n=gf,gf=NaN;else{do n=Wi()*2-1,i=Wi()*2-1,r=n*n+i*i;while(r===0||r>1);s=Math.sqrt(-2*Math.log(r)/r),n*=s,gf=i*s}return e+n*t}function xy(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*YE)}function k0(e,t,n){t=t||0,n=n??1;const i=(e-t)/n,r=Math.abs(i);let s;if(r>37)s=0;else{const o=Math.exp(-r*r/2);let a;r<7.07106781186547?(a=.0352624965998911*r+.700383064443688,a=a*r+6.37396220353165,a=a*r+33.912866078383,a=a*r+112.079291497871,a=a*r+221.213596169931,a=a*r+220.206867912376,s=o*a,a=.0883883476483184*r+1.75566716318264,a=a*r+16.064177579207,a=a*r+86.7807322029461,a=a*r+296.564248779674,a=a*r+637.333633378831,a=a*r+793.826512519948,a=a*r+440.413735824752,s=s/a):(a=r+.65,a=r+4/a,a=r+3/a,a=r+2/a,a=r+1/a,s=o/a/2.506628274631)}return i>0?1-s:s}function A0(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*MG*NG(2*e-1)}function NG(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=10512122733215323e-25+n*t,n=-4112633980346984e-24+n*t,n=-29070369957882005e-24+n*t,n=42347877827932404e-23+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*t,n=-27517406297064545e-23+n*t,n=18239629214389228e-24+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=15076572693500548e-25+n*t,n=-3789465440126737e-24+n*t,n=761570120807834e-23+n*t,n=-1496002662714924e-23+n*t,n=2914795345090108e-23+n*t,n=-6771199775845234e-23+n*t,n=22900482228026655e-23+n*t,n=-99298272942317e-20+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}function _y(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>C0(n,i),pdf:s=>xy(s,n,i),cdf:s=>k0(s,n,i),icdf:s=>A0(s,n,i)};return r.mean(e).stdev(t)}function wy(e,t){const n=_y();let i=0;const r={data(s){return arguments.length?(e=s,i=s?s.length:0,r.bandwidth(t)):e},bandwidth(s){return arguments.length?(t=s,!t&&e&&(t=vy(e)),r):t},sample(){return e[~~(Wi()*i)]+t*n.sample()},pdf(s){let o=0,a=0;for(;aEy(n,i),pdf:s=>Cy(s,n,i),cdf:s=>ky(s,n,i),icdf:s=>Ay(s,n,i)};return r.mean(e).stdev(t)}function KE(e,t){let n=0,i;function r(o){const a=[];let u=0,l;for(l=0;l=t&&e<=n?1/(n-t):0}function Fy(e,t,n){return n==null&&(n=t??1,t=0),en?1:(e-t)/(n-t)}function Dy(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function ZE(e,t){let n,i;const r={min(s){return arguments.length?(n=s||0,r):n},max(s){return arguments.length?(i=s??1,r):i},sample:()=>$y(n,i),pdf:s=>Sy(s,n,i),cdf:s=>Fy(s,n,i),icdf:s=>Dy(s,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function Ty(e,t,n){let i=0,r=0;for(const s of e){const o=n(s);t(s)==null||o==null||isNaN(o)||(i+=(o-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function mf(e,t,n,i){const r=i-e*e,s=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-s*e,s]}function $0(e,t,n,i){e=e.filter(h=>{let p=t(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),i&&e.sort((h,p)=>t(h)-t(p));const r=e.length,s=new Float64Array(r),o=new Float64Array(r);let a=0,u=0,l=0,c,f,d;for(d of e)s[a]=c=+t(d),o[a]=f=+n(d),++a,u+=(c-u)/a,l+=(f-l)/a;for(a=0;a=s&&o!=null&&(o=+o)>=o&&i(s,o,++r)}function _l(e,t,n,i,r){let s=0,o=0;return yf(e,t,n,(a,u)=>{const l=u-r(a),c=u-i;s+=l*l,o+=c*c}),1-s/o}function My(e,t,n){let i=0,r=0,s=0,o=0,a=0;yf(e,t,n,(c,f)=>{++a,i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const u=mf(i,r,s,o),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:_l(e,t,n,r,l)}}function JE(e,t,n){let i=0,r=0,s=0,o=0,a=0;yf(e,t,n,(c,f)=>{++a,c=Math.log(c),i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const u=mf(i,r,s,o),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:_l(e,t,n,r,l)}}function QE(e,t,n){const[i,r,s,o]=$0(e,t,n);let a=0,u=0,l=0,c=0,f=0,d,h,p;yf(e,t,n,(b,v)=>{d=i[f++],h=Math.log(v),p=d*v,a+=(v*h-a)/f,u+=(p-u)/f,l+=(p*h-l)/f,c+=(d*p-c)/f});const[g,m]=mf(u/o,a/o,l/o,c/o),y=b=>Math.exp(g+m*(b-s));return{coef:[Math.exp(g-m*s),m],predict:y,rSquared:_l(e,t,n,o,y)}}function e9(e,t,n){let i=0,r=0,s=0,o=0,a=0,u=0;yf(e,t,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++u,i+=(h-i)/u,r+=(p-r)/u,s+=(h*p-s)/u,o+=(h*h-o)/u,a+=(d-a)/u});const l=mf(i,r,s,o),c=f=>l[0]*Math.pow(f,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:_l(e,t,n,a,c)}}function Ny(e,t,n){const[i,r,s,o]=$0(e,t,n),a=i.length;let u=0,l=0,c=0,f=0,d=0,h,p,g,m;for(h=0;h(w=w-s,v*w*w+x*w+_+o);return{coef:[_-x*s+v*s*s+o,x-2*v*s,v],predict:E,rSquared:_l(e,t,n,o,E)}}function t9(e,t,n,i){if(i===0)return Ty(e,t,n);if(i===1)return My(e,t,n);if(i===2)return Ny(e,t,n);const[r,s,o,a]=$0(e,t,n),u=r.length,l=[],c=[],f=i+1;let d,h,p,g,m;for(d=0;d{v-=o;let x=a+y[0]+y[1]*v+y[2]*v*v;for(d=3;d=0;--s)for(a=t[s],u=1,r[s]+=a,o=1;o<=s;++o)u*=(s+1-o)/o,r[s-o]+=a*Math.pow(n,o)*u;return r[0]+=i,r}function OG(e){const t=e.length-1,n=[];let i,r,s,o,a;for(i=0;iMath.abs(e[i][o])&&(o=r);for(s=i;s=i;s--)e[s][r]-=e[s][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(a=0,s=r+1;sr[v]-y?b:v;let _=0,E=0,w=0,C=0,k=0;const S=1/Math.abs(r[x]-y||1);for(let R=b;R<=v;++R){const D=r[R],A=s[R],T=LG(Math.abs(y-D)*S)*d[R],B=D*T;_+=T,E+=B,w+=A*T,C+=A*B,k+=D*B}const[$,O]=mf(E/_,w/_,C/_,k/_);c[m]=$+O*y,f[m]=Math.abs(s[m]-c[m]),IG(r,m+1,p)}if(h===n9)break;const g=p8(f);if(Math.abs(g)=1?i9:(b=1-y*y)*b}return PG(r,c,o,a)}function LG(e){return(e=1-e*e*e)*e*e}function IG(e,t,n){const i=e[t];let r=n[0],s=n[1]+1;if(!(s>=e.length))for(;t>r&&e[s]-i<=i-e[r];)n[0]=++r,n[1]=s,++s}function PG(e,t,n,i){const r=e.length,s=[];let o=0,a=0,u=[],l;for(;o[g,e(g)],s=t[0],o=t[1],a=o-s,u=a/i,l=[r(s)],c=[];if(n===i){for(let g=1;g0;)c.push(r(s+g/n*a))}let f=l[0],d=c[c.length-1];const h=1/a,p=BG(f[1],c);for(;d;){const g=r((f[0]+d[0])/2);g[0]-f[0]>=u&&UG(f,g,d,h,p)>zG?c.push(g):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function BG(e,t){let n=e,i=e;const r=t.length;for(let s=0;si&&(i=o)}return 1/(i-n)}function UG(e,t,n,i,r){const s=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),o=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(s-o)}function jG(e){return t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i{},qG={init:Oy,add:Oy,rem:Oy,idx:0},bf={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},vf=Object.keys(bf).filter(e=>e!=="__count__");function WG(e,t){return(n,i)=>Le({name:e,aggregate_param:i,out:n||e},qG,t)}[...vf,"__count__"].forEach(e=>{bf[e]=WG(e,bf[e])});function o9(e,t,n){return bf[e](n,t)}function a9(e,t){return e.idx-t.idx}function HG(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=bf[r]())})};return e.forEach(n),Object.values(t).sort(a9)}function GG(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function VG(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function YG(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function XG(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function u9(e,t){const n=t||En,i=HG(e),r=e.slice().sort(a9);function s(o){this._ops=i,this._out=r,this.cell=o,this.init()}return s.prototype.init=GG,s.prototype.add=VG,s.prototype.rem=YG,s.prototype.set=XG,s.prototype.get=n,s.fields=e.map(o=>o.out),s}function Ly(e){this._key=e?Bi(e):_e,this.reset()}const fn=Ly.prototype;fn.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},fn.add=function(e){this._add.push(e)},fn.rem=function(e){this._rem.push(e)},fn.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,s=Array(i-r),o={};let a,u,l;for(a=0;a=0;)s=e(t[i])+"",ue(n,s)||(n[s]=1,++r);return r},fn.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=G4(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},fn.argmin=function(e){return this.extent(e)[0]||{}},fn.argmax=function(e){return this.extent(e)[1]||{}},fn.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0},fn.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0},fn.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=by(this.values(),e),this._get=e),this._q},fn.q1=function(e){return this.quartile(e)[0]},fn.q2=function(e){return this.quartile(e)[1]},fn.q3=function(e){return this.quartile(e)[2]},fn.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=GE(this.values(),1e3,.05,e),this._get=e),this._ci},fn.ci0=function(e){return this.ci(e)[0]},fn.ci1=function(e){return this.ci(e)[1]};function Do(e){P.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}Do.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:vf},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},te(Do,P,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,s=>n.add(s))):(n.value=n.value||n.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),i.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter(()=>this.clean()),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map(()=>({})),r=n.length;function s(a){let u,l,c,f;for(u in a)for(c=a[u].tuple,l=0;l{const v=Tt(b);return r(b),n.push(v),v}),this.cellkey=e.key?e.key:Ry(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const s=e.fields||[null],o=e.ops||["count"],a=e.aggregate_params||[null],u=e.as||[],l=s.length,c={};let f,d,h,p,g,m,y;for(l!==o.length&&q("Unmatched number of fields and aggregate ops."),y=0;yu9(b,b.field)),Object.create(null)},cellkey:Ry(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp{const f=i(c);c[a]=f,c[u]=f==null?null:r+s*(1+(f-r)/s)}:c=>c[a]=i(c)),t.modifies(n?o:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=HE(e),i=n.step;let r=n.start,s=r+Math.ceil((n.stop-r)/i)*i,o,a;(o=e.anchor)!=null&&(a=o-(r+i*Math.floor((o-r)/i)),r+=a,s+=a);const u=function(l){let c=Cn(t(l));return c==null?null:cs?1/0:(c=Math.max(r,Math.min(c,s-i)),r+i*Math.floor(KG+(c-r)/i))};return u.start=r,u.stop=n.stop,u.step=i,this.value=ii(u,wn(t),e.name||"bin_"+Tt(t))}});function l9(e,t,n){const i=e;let r=t||[],s=n||[],o={},a=0;return{add:u=>s.push(u),remove:u=>o[i(u)]=++a,size:()=>r.length,data:(u,l)=>(a&&(r=r.filter(c=>!o[i(c)]),o={},a=0),l&&u&&r.sort(u),s.length&&(r=u?Z4(u,r,s.sort(u)):r.concat(s),s=[]),r)}}function Py(e){P.call(this,[],e)}Py.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},te(Py,P,{transform(e,t){const n=t.fork(t.ALL),i=l9(_e,this.value,n.materialize(n.ADD).add),r=e.sort,s=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(s),this.value=n.source=i.data(Ta(r),s),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function c9(e){xt.call(this,null,ZG,e)}te(c9,xt);function ZG(e){return this.value&&!e.modified()?this.value:k2(e.fields,e.orders)}function zy(e){P.call(this,null,e)}zy.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function JG(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}te(zy,P,{transform(e,t){const n=f=>d=>{for(var h=JG(a(d),e.case,s)||[],p,g=0,m=h.length;gr[f]=1+(r[f]||0)),c=n(f=>r[f]-=1);return i?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_parameterCheck(e,t){let n=!1;return(e.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),(e.modified("pattern")||!this._match)&&(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,i=this._tuples||(this._tuples={}),r=t[0],s=t[1],o=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,u,l;for(a in n)u=i[a],l=n[a]||0,!u&&l?(i[a]=u=nt({}),u[r]=a,u[s]=l,o.add.push(u)):l===0?(u&&o.rem.push(u),n[a]=null,i[a]=null):u[s]!==l&&(u[s]=l,o.mod.push(u));return o.modifies(t)}});function By(e){P.call(this,null,e)}By.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},te(By,P,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],s=i[1],o=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return o?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=QG(a,r,s,e.filter||Ui)):n.mod=a,n.source=this.value,n.modifies(i)}});function QG(e,t,n,i){for(var r=[],s={},o=e.length,a=0,u,l;ah9(s,t))):typeof i[r]===d9&&i[r](e[r]);return i}function Uy(e){P.call(this,null,e)}const p9=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],nV={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:p9},{name:"weights",type:"number",array:!0}]};Uy.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:p9.concat(nV)},{name:"as",type:"string",array:!0,default:["value","density"]}]},te(Uy,P,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=h9(e.distribution,iV(t)),r=e.steps||e.minsteps||25,s=e.steps||e.maxsteps||200;let o=e.method||"pdf";o!=="pdf"&&o!=="cdf"&&q("Invalid density method: "+o),!e.extent&&!i.data&&q("Missing density extent parameter."),o=i[o];const a=e.as||["value","density"],u=e.extent||qr(i.data()),l=S0(o,u,r,s).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],nt(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function iV(e){return()=>e.materialize(e.SOURCE).source}function g9(e,t){return e?e.map((n,i)=>t[i]||Tt(n)):null}function jy(e,t,n){const i=[],r=f=>f(u);let s,o,a,u,l,c;if(t==null)i.push(e.map(n));else for(s={},o=0,a=e.length;oXc(qr(e,t))/30;te(qy,P,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=jy(t.source,e.groupby,En),r=e.smooth||!1,s=e.field,o=e.step||rV(n,s),a=Ta((p,g)=>s(p)-s(g)),u=e.as||m9,l=i.length;let c=1/0,f=-1/0,d=0,h;for(;df&&(f=g),p[++h][u]=g}return this.value={start:c,stop:f,step:o},t.reflow(!0).modifies(u)}});function y9(e){xt.call(this,null,sV,e),this.modified(!0)}te(y9,xt);function sV(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:ii(n=>t(n,e),wn(t),Tt(t))}function Wy(e){P.call(this,[void 0,void 0],e)}Wy.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},te(Wy,P,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let s=n[0],o=n[1];if((r||s==null)&&(s=1/0,o=-1/0),t.visit(r?t.SOURCE:t.ADD,a=>{const u=Cn(i(a));u!=null&&(uo&&(o=u))}),!Number.isFinite(s)||!Number.isFinite(o)){let a=Tt(i);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${s}, ${o}]`),s=o=void 0}this.value=[s,o]}});function Hy(e,t){xt.call(this,e),this.parent=t,this.count=0}te(Hy,xt,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}});function F0(e){P.call(this,{},e),this._keys=sl();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let i=0,r=t.active;ii&&i.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;rthis.subflow(u,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,u=>{const l=_e(u),c=s.get(l);c!==void 0&&(s.delete(l),a(c).rem(u))}),t.visit(t.ADD,u=>{const l=i(u);s.set(_e(u),l),a(l).add(u)}),o||t.modified(i.fields)?t.visit(t.MOD,u=>{const l=_e(u),c=s.get(l),f=i(u);c===f?a(f).mod(u):(s.set(l,f),a(c).rem(u),a(f).add(u))}):t.changed(t.MOD)&&t.visit(t.MOD,u=>{a(s.get(_e(u))).mod(u)}),o&&t.visit(t.REFLOW,u=>{const l=_e(u),c=s.get(l),f=i(u);c!==f&&(s.set(l,f),a(c).rem(u),a(f).add(u))}),t.clean()?n.runAfter(()=>{this.clean(),s.clean()}):s.empty>n.cleanThreshold&&n.runAfter(s.clean),t}});function b9(e){xt.call(this,null,oV,e)}te(b9,xt);function oV(e){return this.value&&!e.modified()?this.value:W(e.name)?oe(e.name).map(t=>Bi(t)):Bi(e.name,e.as)}function Gy(e){P.call(this,sl(),e)}Gy.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},te(Gy,P,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),s=r.add,o=r.rem,a=r.mod,u=e.expr;let l=!0;t.visit(t.REM,f=>{const d=_e(f);i.has(d)?i.delete(d):o.push(f)}),t.visit(t.ADD,f=>{u(f,e)?s.push(f):i.set(_e(f),1)});function c(f){const d=_e(f),h=u(f,e),p=i.get(d);h&&p?(i.delete(d),s.push(f)):!h&&!p?(i.set(d,1),o.push(f)):l&&h&&!p&&a.push(f)}return t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}});function Vy(e){P.call(this,[],e)}Vy.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},te(Vy,P,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=g9(i,e.as||[]),s=e.index||null,o=r.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const u=i.map(p=>p(a)),l=u.reduce((p,g)=>Math.max(p,g.length),0);let c=0,f,d,h;for(;c{for(let c=0,f;co[i]=n(o,e))}});function v9(e){P.call(this,[],e)}te(v9,P,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r=this.value,s=e.size-r.length,o,a,u;if(s>0){for(o=[];--s>=0;)o.push(u=nt(i(e))),r.push(u);n.add=n.add.length?n.materialize(n.ADD).add.concat(o):o}else a=r.slice(0,-s),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,r=r.slice(-s);return n.source=this.value=r,n}});const D0={value:"value",median:p8,mean:jq,min:P2,max:Aa},aV=[];function Ky(e){P.call(this,[],e)}Ky.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function uV(e){var t=e.method||D0.value,n;if(D0[t]==null)q("Unrecognized imputation method: "+t);else return t===D0.value?(n=e.value!==void 0?e.value:0,()=>n):D0[t]}function lV(e){const t=e.field;return n=>n?t(n):NaN}te(Ky,P,{transform(e,t){var n=t.fork(t.ALL),i=uV(e),r=lV(e),s=Tt(e.field),o=Tt(e.key),a=(e.groupby||[]).map(Tt),u=cV(t.source,e.groupby,e.key,e.keyvals),l=[],c=this.value,f=u.domain.length,d,h,p,g,m,y,b,v,x,_;for(m=0,v=u.length;my(m),s=[],o=i?i.slice():[],a={},u={},l,c,f,d,h,p,g,m;for(o.forEach((y,b)=>a[y]=b+1),d=0,g=e.length;dn.add(s))):(r=n.value=n.value||this.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),n.changes(),t.visit(t.SOURCE,s=>{Le(s,r[n.cellkey(s)].tuple)}),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n{const p=wy(h,o)[a],g=e.counts?h.length:1,m=c||qr(h);S0(p,m,f,d).forEach(y=>{const b={};for(let v=0;v(this._pending=oe(r.data),s=>s.touch(this)))}:n.request(e.url,e.format).then(i=>Qy(this,t,oe(i.data)))}});function dV(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function Qy(e,t,n){n.forEach(nt);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function eb(e){P.call(this,{},e)}eb.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},te(eb,P,{transform(e,t){const n=e.fields,i=e.index,r=e.values,s=e.default==null?null:e.default,o=e.modified(),a=n.length;let u=o?t.SOURCE:t.ADD,l=t,c=e.as,f,d,h;return r?(d=r.length,a>1&&!c&&q('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&q('The "as" parameter has too few output field names.'),c=c||r.map(Tt),f=function(p){for(var g=0,m=0,y,b;gt.modified(p.fields)),u|=h?t.MOD:0),t.visit(u,f),l.modifies(c)}});function w9(e){xt.call(this,null,hV,e)}te(w9,xt);function hV(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i=1/0,r=-1/0,s,o;for(s=0;sr&&(r=o[1]);return[i,r]}function E9(e){xt.call(this,null,pV,e)}te(E9,xt);function pV(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function C9(e){P.call(this,null,e)}te(C9,P,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function tb(e){Do.call(this,e)}tb.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:vf,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},te(tb,Do,{_transform:Do.prototype.transform,transform(e,t){return this._transform(gV(e,t),t)}});function gV(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",s=wn(n).concat(wn(i)),o=yV(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:o.map(()=>r),fields:o.map(a=>mV(a,n,i,s)),as:o.map(a=>a+""),modified:e.modified.bind(e)}}function mV(e,t,n,i){return ii(r=>t(r)===e?n(r):NaN,i,e+"")}function yV(e,t,n){const i={},r=[];return n.visit(n.SOURCE,s=>{const o=e(s);i[o]||(i[o]=1,r.push(o))}),r.sort(rl),t?r.slice(0,t):r}function k9(e){F0.call(this,e)}te(k9,F0,{transform(e,t){const n=e.subflow,i=e.field,r=s=>this.subflow(_e(s),n,t,s);return(e.modified("field")||i&&t.modified(wn(i)))&&q("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,s=>{const o=r(s);i(s).forEach(a=>o.mod(a))}),t.visit(t.ADD,s=>{const o=r(s);i(s).forEach(a=>o.add(nt(a)))}),t.visit(t.REM,s=>{const o=r(s);i(s).forEach(a=>o.rem(a))})):(t.visit(t.MOD,s=>r(s).mod(s)),t.visit(t.ADD,s=>r(s).add(s)),t.visit(t.REM,s=>r(s).rem(s))),t.clean()&&t.runAfter(()=>this.clean()),t}});function nb(e){P.call(this,null,e)}nb.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},te(nb,P,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=g9(e.fields,e.as||[]),s=i?(a,u)=>bV(a,u,i,r):b0;let o;return this.value?o=this.value:(t=t.addAll(),o=this.value={}),t.visit(t.REM,a=>{const u=_e(a);n.rem.push(o[u]),o[u]=null}),t.visit(t.ADD,a=>{const u=s(a,nt({}));o[_e(a)]=u,n.add.push(u)}),t.visit(t.MOD,a=>{n.mod.push(s(a,o[_e(a)]))}),n}});function bV(e,t,n,i){for(let r=0,s=n.length;r{const d=yy(f,l);for(let h=0;h{const s=_e(r);n.rem.push(i[s]),i[s]=null}),t.visit(t.ADD,r=>{const s=hy(r);i[_e(r)]=s,n.add.push(s)}),t.visit(t.MOD,r=>{const s=i[_e(r)];for(const o in r)s[o]=r[o],n.modifies(o);n.mod.push(s)})),n}});function rb(e){P.call(this,[],e),this.count=0}rb.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},te(rb,P,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,s=this.value.reduce((c,f)=>(c[_e(f)]=1,c),{});let o=this.value,a=this.count,u=0;function l(c){let f,d;o.length=u&&(f=o[d],s[_e(f)]&&n.rem.push(f),o[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=_e(c);s[f]&&(s[f]=-1,n.rem.push(c)),--a}),o=o.filter(c=>s[_e(c)]!==-1)),(t.rem.length||i)&&o.length{s[_e(c)]||l(c)}),u=-1),i&&o.length>r){const c=o.length-r;for(let f=0;f{s[_e(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=o.filter(c=>!s[_e(c)])),this.count=a,this.value=n.source=o,n}});function sb(e){P.call(this,null,e)}sb.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},te(sb,P,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Ei(e.start,e.stop,e.step||1).map(r=>{const s={};return s[i]=r,nt(s)}),n.add=t.add.concat(this.value),n}});function S9(e){P.call(this,null,e),this.modified(!0)}te(S9,P,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function ob(e){P.call(this,null,e)}const F9=["unit0","unit1"];ob.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:G2,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:F9}]},te(ob,P,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",s=this._floor(e,t),o=(r?ml:gl)(s.unit).offset,a=e.as||F9,u=a[0],l=a[1],c=s.step;let f=s.start||1/0,d=s.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(wn(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,p=>{const g=n(p);let m,y;g==null?(p[u]=null,i&&(p[l]=null)):(p[u]=m=y=s(g),i&&(p[l]=y=o(m,c)),md&&(d=y))}),s.start=f,s.stop=d,t.modifies(i?a:u)},_floor(e,t){const n=e.timezone==="utc",{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:K8({extent:e.extent||qr(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),s=Y2(i),o=this.value||{},a=(n?z8:P8)(s,r);return a.unit=Ge(s),a.units=s,a.step=r,a.start=o.start,a.stop=o.stop,this.value=a}});function D9(e){P.call(this,sl(),e)}te(D9,P,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,s=a=>r.set(i(a),a);let o=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,s)):t.changed()?(t.visit(t.REM,a=>r.delete(i(a))),t.visit(t.ADD,s)):o=!1,this.modified(o),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}});function T9(e){P.call(this,null,e)}te(T9,P,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(Ta(e.sort)):t.source).map(e.field))}});function xV(e,t,n,i){const r=xf[e](t,n);return{init:r.init||bo,update:function(s,o){o[i]=r.next(s)}}}const xf={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=xf.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e0||q("ntile num must be greater than zero.");const n=xf.cume_dist(),i=n.next;return{init:n.init,next:r=>Math.ceil(t*i(r))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return ie(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||q("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return it=null,next:n=>{const i=e(n.data[n.index]);return i!=null?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=_V(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function _V(e,t,n){for(let i=t.length;nu[g]=1)}h(e.sort),t.forEach((p,g)=>{const m=n[g],y=i[g],b=r[g]||null,v=Tt(m),x=s9(p,v,s[g]);if(h(m),o.push(x),ue(xf,p))a.push(xV(p,m,y,x));else{if(m==null&&p!=="count"&&q("Null aggregate field specified."),p==="count"){c.push(x);return}d=!1;let _=l[v];_||(_=l[v]=[],_.field=m,f.push(_)),_.push(o9(p,b,x))}}),(c.length||f.length)&&(this.cell=EV(f,c,d)),this.inputs=Object.keys(u)}const N9=M9.prototype;N9.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()},N9.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,s=i&&i.length;let o;if(n){for(o=e.p0;ou9(u,u.field));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,s=i.agg=Array(r),o=0;othis.group(r(a));let o=this.state;(!o||n)&&(o=this.state=new M9(e)),n||t.modified(o.inputs)?(this.value={},t.visit(t.SOURCE,a=>s(a).add(a))):(t.visit(t.REM,a=>s(a).remove(a)),t.visit(t.ADD,a=>s(a).add(a)));for(let a=0,u=this._mlen;a0&&!r(s[n],s[n-1])&&(e.i0=t.left(s,s[n])),i1?0:e<-1?wl:Math.acos(e)}function L9(e){return e>=1?T0:e<=-1?-T0:Math.asin(e)}const lb=Math.PI,cb=2*lb,Ra=1e-6,DV=cb-Ra;function I9(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return I9;const n=10**t;return function(i){this._+=i[0];for(let r=1,s=i.length;rRa)if(!(Math.abs(f*u-l*c)>Ra)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let h=i-o,p=r-a,g=u*u+l*l,m=h*h+p*p,y=Math.sqrt(g),b=Math.sqrt(d),v=s*Math.tan((lb-Math.acos((g+d-m)/(2*y*b)))/2),x=v/b,_=v/y;Math.abs(x-1)>Ra&&this._append`L${t+x*c},${n+x*f}`,this._append`A${s},${s},0,0,${+(f*h>c*p)},${this._x1=t+_*u},${this._y1=n+_*l}`}}arc(t,n,i,r,s,o){if(t=+t,n=+n,i=+i,o=!!o,i<0)throw new Error(`negative radius: ${i}`);let a=i*Math.cos(r),u=i*Math.sin(r),l=t+a,c=n+u,f=1^o,d=o?r-s:s-r;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Ra||Math.abs(this._y1-c)>Ra)&&this._append`L${l},${c}`,i&&(d<0&&(d=d%cb+cb),d>DV?this._append`A${i},${i},0,1,${f},${t-a},${n-u}A${i},${i},0,1,${f},${this._x1=l},${this._y1=c}`:d>Ra&&this._append`A${i},${i},0,${+(d>=lb)},${f},${this._x1=t+i*Math.cos(s)},${this._y1=n+i*Math.sin(s)}`)}rect(t,n,i,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}};function M0(){return new fb}M0.prototype=fb.prototype;function N0(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new fb(t)}function MV(e){return e.innerRadius}function NV(e){return e.outerRadius}function RV(e){return e.startAngle}function OV(e){return e.endAngle}function LV(e){return e&&e.padAngle}function IV(e,t,n,i,r,s,o,a){var u=n-e,l=i-t,c=o-r,f=a-s,d=f*u-c*l;if(!(d*dD*D+A*A&&(C=S,k=$),{cx:C,cy:k,x01:-c,y01:-f,x11:C*(r/_-1),y11:k*(r/_-1)}}function PV(){var e=MV,t=NV,n=rt(0),i=null,r=RV,s=OV,o=LV,a=null,u=N0(l);function l(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=r.apply(this,arguments)-T0,g=s.apply(this,arguments)-T0,m=R9(g-p),y=g>p;if(a||(a=c=u()),hFn))a.moveTo(0,0);else if(m>O9-Fn)a.moveTo(h*Ma(p),h*Yr(p)),a.arc(0,0,h,p,g,!y),d>Fn&&(a.moveTo(d*Ma(g),d*Yr(g)),a.arc(0,0,d,g,p,y));else{var b=p,v=g,x=p,_=g,E=m,w=m,C=o.apply(this,arguments)/2,k=C>Fn&&(i?+i.apply(this,arguments):Na(d*d+h*h)),S=ub(R9(h-d)/2,+n.apply(this,arguments)),$=S,O=S,R,D;if(k>Fn){var A=L9(k/d*Yr(C)),T=L9(k/h*Yr(C));(E-=A*2)>Fn?(A*=y?1:-1,x+=A,_-=A):(E=0,x=_=(p+g)/2),(w-=T*2)>Fn?(T*=y?1:-1,b+=T,v-=T):(w=0,b=v=(p+g)/2)}var B=h*Ma(b),G=h*Yr(b),z=d*Ma(_),ie=d*Yr(_);if(S>Fn){var be=h*Ma(v),he=h*Yr(v),Te=d*Ma(x),ct=d*Yr(x),Fe;if(mFn?O>Fn?(R=R0(Te,ct,B,G,h,O,y),D=R0(be,he,z,ie,h,O,y),a.moveTo(R.cx+R.x01,R.cy+R.y01),OFn)||!(E>Fn)?a.lineTo(z,ie):$>Fn?(R=R0(z,ie,be,he,d,-$,y),D=R0(B,G,Te,ct,d,-$,y),a.lineTo(R.cx+R.x01,R.cy+R.y01),$=h;--p)a.point(v[p],x[p]);a.lineEnd(),a.areaEnd()}y&&(v[d]=+e(m,d,f),x[d]=+t(m,d,f),a.point(i?+i(m,d,f):v[d],n?+n(m,d,f):x[d]))}if(b)return a=null,b+""||null}function c(){return j9().defined(r).curve(o).context(s)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:rt(+f),i=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:rt(+f),l):e},l.x1=function(f){return arguments.length?(i=f==null?null:typeof f=="function"?f:rt(+f),l):i},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:rt(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:rt(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:rt(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(i).y(t)},l.defined=function(f){return arguments.length?(r=typeof f=="function"?f:rt(!!f),l):r},l.curve=function(f){return arguments.length?(o=f,s!=null&&(a=o(s)),l):o},l.context=function(f){return arguments.length?(f==null?s=a=null:a=o(s=f),l):s},l}const zV={draw(e,t){const n=Na(t/wl);e.moveTo(n,0),e.arc(0,0,n,0,O9)}};function BV(e,t){let n=null,i=N0(r);e=typeof e=="function"?e:rt(e||zV),t=typeof t=="function"?t:rt(t===void 0?64:+t);function r(){let s;if(n||(n=s=i()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return r.type=function(s){return arguments.length?(e=typeof s=="function"?s:rt(s),r):e},r.size=function(s){return arguments.length?(t=typeof s=="function"?s:rt(+s),r):t},r.context=function(s){return arguments.length?(n=s??null,r):n},r}function To(){}function O0(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function L0(e){this._context=e}L0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:O0(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:O0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function UV(e){return new L0(e)}function W9(e){this._context=e}W9.prototype={areaStart:To,areaEnd:To,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:O0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function jV(e){return new W9(e)}function H9(e){this._context=e}H9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:O0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function qV(e){return new H9(e)}function G9(e,t){this._basis=new L0(e),this._beta=t}G9.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var i=e[0],r=t[0],s=e[n]-i,o=t[n]-r,a=-1,u;++a<=n;)u=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(i+u*s),this._beta*t[a]+(1-this._beta)*(r+u*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const WV=function e(t){function n(i){return t===1?new L0(i):new G9(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function I0(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function hb(e,t){this._context=e,this._k=(1-t)/6}hb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:I0(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:I0(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const HV=function e(t){function n(i){return new hb(i,t)}return n.tension=function(i){return e(+i)},n}(0);function pb(e,t){this._context=e,this._k=(1-t)/6}pb.prototype={areaStart:To,areaEnd:To,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:I0(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const GV=function e(t){function n(i){return new pb(i,t)}return n.tension=function(i){return e(+i)},n}(0);function gb(e,t){this._context=e,this._k=(1-t)/6}gb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:I0(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const VV=function e(t){function n(i){return new gb(i,t)}return n.tension=function(i){return e(+i)},n}(0);function mb(e,t,n){var i=e._x1,r=e._y1,s=e._x2,o=e._y2;if(e._l01_a>Fn){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>Fn){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*l+e._x1*e._l23_2a-t*e._l12_2a)/c,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(i,r,s,o,e._x2,e._y2)}function V9(e,t){this._context=e,this._alpha=t}V9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:mb(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const YV=function e(t){function n(i){return t?new V9(i,t):new hb(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function Y9(e,t){this._context=e,this._alpha=t}Y9.prototype={areaStart:To,areaEnd:To,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:mb(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const XV=function e(t){function n(i){return t?new Y9(i,t):new pb(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function X9(e,t){this._context=e,this._alpha=t}X9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:mb(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const KV=function e(t){function n(i){return t?new X9(i,t):new gb(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function K9(e){this._context=e}K9.prototype={areaStart:To,areaEnd:To,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function ZV(e){return new K9(e)}function Z9(e){return e<0?-1:1}function J9(e,t,n){var i=e._x1-e._x0,r=t-e._x1,s=(e._y1-e._y0)/(i||r<0&&-0),o=(n-e._y1)/(r||i<0&&-0),a=(s*r+o*i)/(i+r);return(Z9(s)+Z9(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function Q9(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function yb(e,t,n){var i=e._x0,r=e._y0,s=e._x1,o=e._y1,a=(s-i)/3;e._context.bezierCurveTo(i+a,r+a*t,s-a,o-a*n,s,o)}function P0(e){this._context=e}P0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:yb(this,this._t0,Q9(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,yb(this,Q9(this,n=J9(this,e,t)),n);break;default:yb(this,this._t0,n=J9(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function eC(e){this._context=new tC(e)}(eC.prototype=Object.create(P0.prototype)).point=function(e,t){P0.prototype.point.call(this,t,e)};function tC(e){this._context=e}tC.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,s){this._context.bezierCurveTo(t,e,i,n,s,r)}};function JV(e){return new P0(e)}function QV(e){return new eC(e)}function nC(e){this._context=e}nC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var i=iC(e),r=iC(t),s=0,o=1;o=0;--t)r[t]=(o[t]-r[t+1])/s[t];for(s[n-1]=(e[n]+r[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function tY(e){return new z0(e,.5)}function nY(e){return new z0(e,0)}function iY(e){return new z0(e,1)}function Mo(e,t){if(typeof document<"u"&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const rY=()=>typeof Image<"u"?Image:null;function Xr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function No(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const bb=Symbol("implicit");function vb(){var e=new a8,t=[],n=[],i=bb;function r(s){let o=e.get(s);if(o===void 0){if(i!==bb)return i;e.set(s,o=t.push(s)-1)}return n[o%n.length]}return r.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new a8;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return r},r.range=function(s){return arguments.length?(n=Array.from(s),r):n.slice()},r.unknown=function(s){return arguments.length?(i=s,r):i},r.copy=function(){return vb(t,n).unknown(i)},Xr.apply(r,arguments),r}function El(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _f(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Ro(){}var Oa=.7,Cl=1/Oa,kl="\\s*([+-]?\\d+)\\s*",wf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Kr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sY=/^#([0-9a-f]{3,8})$/,oY=new RegExp(`^rgb\\(${kl},${kl},${kl}\\)$`),aY=new RegExp(`^rgb\\(${Kr},${Kr},${Kr}\\)$`),uY=new RegExp(`^rgba\\(${kl},${kl},${kl},${wf}\\)$`),lY=new RegExp(`^rgba\\(${Kr},${Kr},${Kr},${wf}\\)$`),cY=new RegExp(`^hsl\\(${wf},${Kr},${Kr}\\)$`),fY=new RegExp(`^hsla\\(${wf},${Kr},${Kr},${wf}\\)$`),rC={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};El(Ro,Ef,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:sC,formatHex:sC,formatHex8:dY,formatHsl:hY,formatRgb:oC,toString:oC});function sC(){return this.rgb().formatHex()}function dY(){return this.rgb().formatHex8()}function hY(){return fC(this).formatHsl()}function oC(){return this.rgb().formatRgb()}function Ef(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=sY.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?aC(t):n===3?new Jt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?B0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?B0(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=oY.exec(e))?new Jt(t[1],t[2],t[3],1):(t=aY.exec(e))?new Jt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=uY.exec(e))?B0(t[1],t[2],t[3],t[4]):(t=lY.exec(e))?B0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cY.exec(e))?cC(t[1],t[2]/100,t[3]/100,1):(t=fY.exec(e))?cC(t[1],t[2]/100,t[3]/100,t[4]):rC.hasOwnProperty(e)?aC(rC[e]):e==="transparent"?new Jt(NaN,NaN,NaN,0):null}function aC(e){return new Jt(e>>16&255,e>>8&255,e&255,1)}function B0(e,t,n,i){return i<=0&&(e=t=n=NaN),new Jt(e,t,n,i)}function xb(e){return e instanceof Ro||(e=Ef(e)),e?(e=e.rgb(),new Jt(e.r,e.g,e.b,e.opacity)):new Jt}function Oo(e,t,n,i){return arguments.length===1?xb(e):new Jt(e,t,n,i??1)}function Jt(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}El(Jt,Oo,_f(Ro,{brighter(e){return e=e==null?Cl:Math.pow(Cl,e),new Jt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Oa:Math.pow(Oa,e),new Jt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Jt(La(this.r),La(this.g),La(this.b),U0(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:uC,formatHex:uC,formatHex8:pY,formatRgb:lC,toString:lC}));function uC(){return`#${Ia(this.r)}${Ia(this.g)}${Ia(this.b)}`}function pY(){return`#${Ia(this.r)}${Ia(this.g)}${Ia(this.b)}${Ia((isNaN(this.opacity)?1:this.opacity)*255)}`}function lC(){const e=U0(this.opacity);return`${e===1?"rgb(":"rgba("}${La(this.r)}, ${La(this.g)}, ${La(this.b)}${e===1?")":`, ${e})`}`}function U0(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function La(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ia(e){return e=La(e),(e<16?"0":"")+e.toString(16)}function cC(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fr(e,t,n,i)}function fC(e){if(e instanceof fr)return new fr(e.h,e.s,e.l,e.opacity);if(e instanceof Ro||(e=Ef(e)),!e)return new fr;if(e instanceof fr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),o=NaN,a=s-r,u=(s+r)/2;return a?(t===s?o=(n-i)/a+(n0&&u<1?0:o,new fr(o,a,u,e.opacity)}function j0(e,t,n,i){return arguments.length===1?fC(e):new fr(e,t,n,i??1)}function fr(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}El(fr,j0,_f(Ro,{brighter(e){return e=e==null?Cl:Math.pow(Cl,e),new fr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Oa:Math.pow(Oa,e),new fr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new Jt(_b(e>=240?e-240:e+120,r,i),_b(e,r,i),_b(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new fr(dC(this.h),q0(this.s),q0(this.l),U0(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=U0(this.opacity);return`${e===1?"hsl(":"hsla("}${dC(this.h)}, ${q0(this.s)*100}%, ${q0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function dC(e){return e=(e||0)%360,e<0?e+360:e}function q0(e){return Math.max(0,Math.min(1,e||0))}function _b(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const hC=Math.PI/180,pC=180/Math.PI,W0=18,gC=.96422,mC=1,yC=.82521,bC=4/29,Al=6/29,vC=3*Al*Al,gY=Al*Al*Al;function xC(e){if(e instanceof Zr)return new Zr(e.l,e.a,e.b,e.opacity);if(e instanceof Is)return _C(e);e instanceof Jt||(e=xb(e));var t=kb(e.r),n=kb(e.g),i=kb(e.b),r=wb((.2225045*t+.7168786*n+.0606169*i)/mC),s,o;return t===n&&n===i?s=o=r:(s=wb((.4360747*t+.3850649*n+.1430804*i)/gC),o=wb((.0139322*t+.0971045*n+.7141733*i)/yC)),new Zr(116*r-16,500*(s-r),200*(r-o),e.opacity)}function H0(e,t,n,i){return arguments.length===1?xC(e):new Zr(e,t,n,i??1)}function Zr(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}El(Zr,H0,_f(Ro,{brighter(e){return new Zr(this.l+W0*(e??1),this.a,this.b,this.opacity)},darker(e){return new Zr(this.l-W0*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=gC*Eb(t),e=mC*Eb(e),n=yC*Eb(n),new Jt(Cb(3.1338561*t-1.6168667*e-.4906146*n),Cb(-.9787684*t+1.9161415*e+.033454*n),Cb(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function wb(e){return e>gY?Math.pow(e,1/3):e/vC+bC}function Eb(e){return e>Al?e*e*e:vC*(e-bC)}function Cb(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function kb(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function mY(e){if(e instanceof Is)return new Is(e.h,e.c,e.l,e.opacity);if(e instanceof Zr||(e=xC(e)),e.a===0&&e.b===0)return new Is(NaN,0=1?(n=1,t-1):Math.floor(n*t),r=e[i],s=e[i+1],o=i>0?e[i-1]:2*r-s,a=i()=>e;function FC(e,t){return function(n){return e+n*t}}function bY(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function X0(e,t){var n=t-e;return n?FC(e,n>180||n<-180?n-360*Math.round(n/360):n):Y0(isNaN(e)?t:e)}function vY(e){return(e=+e)==1?Qt:function(t,n){return n-t?bY(t,n,e):Y0(isNaN(t)?n:t)}}function Qt(e,t){var n=t-e;return n?FC(e,n):Y0(isNaN(e)?t:e)}const Fb=function e(t){var n=vY(t);function i(r,s){var o=n((r=Oo(r)).r,(s=Oo(s)).r),a=n(r.g,s.g),u=n(r.b,s.b),l=Qt(r.opacity,s.opacity);return function(c){return r.r=o(c),r.g=a(c),r.b=u(c),r.opacity=l(c),r+""}}return i.gamma=e,i}(1);function DC(e){return function(t){var n=t.length,i=new Array(n),r=new Array(n),s=new Array(n),o,a;for(o=0;on&&(s=t.slice(n,s),a[o]?a[o]+=s:a[++o]=s),(i=i[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,u.push({i:o,x:dr(i,r)})),n=Mb.lastIndex;return n180?c+=360:c-l>180&&(l+=360),d.push({i:f.push(r(f)+"rotate(",null,i)-2,x:dr(l,c)})):c&&f.push(r(f)+"rotate("+c+i)}function a(l,c,f,d){l!==c?d.push({i:f.push(r(f)+"skewX(",null,i)-2,x:dr(l,c)}):c&&f.push(r(f)+"skewX("+c+i)}function u(l,c,f,d,h,p){if(l!==f||c!==d){var g=h.push(r(h)+"scale(",null,",",null,")");p.push({i:g-4,x:dr(l,f)},{i:g-2,x:dr(c,d)})}else(f!==1||d!==1)&&h.push(r(h)+"scale("+f+","+d+")")}return function(l,c){var f=[],d=[];return l=e(l),c=e(c),s(l.translateX,l.translateY,c.translateX,c.translateY,f,d),o(l.rotate,c.rotate,f,d),a(l.skewX,c.skewX,f,d),u(l.scaleX,l.scaleY,c.scaleX,c.scaleY,f,d),l=c=null,function(h){for(var p=-1,g=d.length,m;++pt&&(n=e,e=t,t=n),function(i){return Math.max(e,Math.min(t,i))}}function GY(e,t,n){var i=e[0],r=e[1],s=t[0],o=t[1];return r2?VY:GY,u=l=null,f}function f(d){return d==null||isNaN(d=+d)?s:(u||(u=a(e.map(i),t,n)))(i(o(d)))}return f.invert=function(d){return o(r((l||(l=a(t,e.map(i),dr)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,Ob),c()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=kf,c()},f.clamp=function(d){return arguments.length?(o=d?!0:ai,c()):o!==ai},f.interpolate=function(d){return arguments.length?(n=d,c()):n},f.unknown=function(d){return arguments.length?(s=d,f):s},function(d,h){return i=d,r=h,c()}}function WC(){return Z0()(ai,ai)}function HC(e,t,n,i){var r=Co(e,t,n),s;switch(i=$a(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return i.precision==null&&!isNaN(s=k8(r,o))&&(i.precision=s),U2(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(s=A8(r,Math.max(Math.abs(e),Math.abs(t))))&&(i.precision=s-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(s=C8(r))&&(i.precision=s-(i.type==="%")*2);break}}return i0(i)}function za(e){var t=e.domain;return e.ticks=function(n){var i=t();return L2(i[0],i[i.length-1],n??10)},e.tickFormat=function(n,i){var r=t();return HC(r[0],r[r.length-1],n??10,i)},e.nice=function(n){n==null&&(n=10);var i=t(),r=0,s=i.length-1,o=i[r],a=i[s],u,l,c=10;for(a0;){if(l=I2(o,a,n),l===u)return i[r]=o,i[s]=a,t(i);if(l>0)o=Math.floor(o/l)*l,a=Math.ceil(a/l)*l;else if(l<0)o=Math.ceil(o*l)/l,a=Math.floor(a*l)/l;else break;u=l}return e},e}function GC(){var e=WC();return e.copy=function(){return Af(e,GC())},Xr.apply(e,arguments),za(e)}function VC(e){var t;function n(i){return i==null||isNaN(i=+i)?t:i}return n.invert=n,n.domain=n.range=function(i){return arguments.length?(e=Array.from(i,Ob),n):e.slice()},n.unknown=function(i){return arguments.length?(t=i,n):t},n.copy=function(){return VC(e).unknown(t)},e=arguments.length?Array.from(e,Ob):[0,1],za(n)}function YC(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],s=e[i],o;return sMath.pow(e,t)}function JY(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function ZC(e){return(t,n)=>-e(-t,n)}function Ib(e){const t=e(XC,KC),n=t.domain;let i=10,r,s;function o(){return r=JY(i),s=ZY(i),n()[0]<0?(r=ZC(r),s=ZC(s),e(YY,XY)):e(XC,KC),t}return t.base=function(a){return arguments.length?(i=+a,o()):i},t.domain=function(a){return arguments.length?(n(a),o()):n()},t.ticks=a=>{const u=n();let l=u[0],c=u[u.length-1];const f=c0){for(;d<=h;++d)for(p=1;pc)break;y.push(g)}}else for(;d<=h;++d)for(p=i-1;p>=1;--p)if(g=d>0?p/s(-d):p*s(d),!(gc)break;y.push(g)}y.length*2{if(a==null&&(a=10),u==null&&(u=i===10?"s":","),typeof u!="function"&&(!(i%1)&&(u=$a(u)).precision==null&&(u.trim=!0),u=i0(u)),a===1/0)return u;const l=Math.max(1,i*a/t.ticks().length);return c=>{let f=c/s(Math.round(r(c)));return f*in(YC(n(),{floor:a=>s(Math.floor(r(a))),ceil:a=>s(Math.ceil(r(a)))})),t}function JC(){const e=Ib(Z0()).domain([1,10]);return e.copy=()=>Af(e,JC()).base(e.base()),Xr.apply(e,arguments),e}function QC(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function ek(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Pb(e){var t=1,n=e(QC(t),ek(t));return n.constant=function(i){return arguments.length?e(QC(t=+i),ek(t)):t},za(n)}function tk(){var e=Pb(Z0());return e.copy=function(){return Af(e,tk()).constant(e.constant())},Xr.apply(e,arguments)}function nk(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function QY(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function eX(e){return e<0?-e*e:e*e}function zb(e){var t=e(ai,ai),n=1;function i(){return n===1?e(ai,ai):n===.5?e(QY,eX):e(nk(n),nk(1/n))}return t.exponent=function(r){return arguments.length?(n=+r,i()):n},za(t)}function Bb(){var e=zb(Z0());return e.copy=function(){return Af(e,Bb()).exponent(e.exponent())},Xr.apply(e,arguments),e}function tX(){return Bb.apply(null,arguments).exponent(.5)}function ik(){var e=[],t=[],n=[],i;function r(){var o=0,a=Math.max(1,t.length);for(n=new Array(a-1);++o0?n[a-1]:e[0],a=n?[i[n-1],t]:[i[l-1],i[l]]},o.unknown=function(u){return arguments.length&&(s=u),o},o.thresholds=function(){return i.slice()},o.copy=function(){return rk().domain([e,t]).range(r).unknown(s)},Xr.apply(za(o),arguments)}function sk(){var e=[.5],t=[0,1],n,i=1;function r(s){return s!=null&&s<=s?t[Eo(e,s,0,i)]:n}return r.domain=function(s){return arguments.length?(e=Array.from(s),i=Math.min(e.length,t.length-1),r):e.slice()},r.range=function(s){return arguments.length?(t=Array.from(s),i=Math.min(e.length,t.length-1),r):t.slice()},r.invertExtent=function(s){var o=t.indexOf(s);return[e[o-1],e[o]]},r.unknown=function(s){return arguments.length?(n=s,r):n},r.copy=function(){return sk().domain(e).range(t).unknown(n)},Xr.apply(r,arguments)}function nX(e){return new Date(e)}function iX(e){return e instanceof Date?+e:+new Date(+e)}function Ub(e,t,n,i,r,s,o,a,u,l){var c=WC(),f=c.invert,d=c.domain,h=l(".%L"),p=l(":%S"),g=l("%I:%M"),m=l("%I %p"),y=l("%a %d"),b=l("%b %d"),v=l("%B"),x=l("%Y");function _(E){return(u(E)0?i:1:0}const bX="identity",$l="linear",Ps="log",$f="pow",Sf="sqrt",ep="symlog",Ba="time",Ua="utc",Qr="sequential",Sl="diverging",Fl="quantile",tp="quantize",np="threshold",Gb="ordinal",Vb="point",fk="band",Yb="bin-ordinal",Ht="continuous",Ff="discrete",Df="discretizing",Hi="interpolating",Xb="temporal";function vX(e){return function(t){let n=t[0],i=t[1],r;return i=i&&n[u]<=r&&(s<0&&(s=u),o=u);if(!(s<0))return i=e.invertExtent(n[s]),r=e.invertExtent(n[o]),[i[0]===void 0?i[1]:i[0],r[1]===void 0?r[0]:r[1]]}}function Kb(){const e=vb().unknown(void 0),t=e.domain,n=e.range;let i=[0,1],r,s,o=!1,a=0,u=0,l=.5;delete e.unknown;function c(){const f=t().length,d=i[1]g+r*y);return n(d?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),c()):t()},e.range=function(f){return arguments.length?(i=[+f[0],+f[1]],c()):i.slice()},e.rangeRound=function(f){return i=[+f[0],+f[1]],o=!0,c()},e.bandwidth=function(){return s},e.step=function(){return r},e.round=function(f){return arguments.length?(o=!!f,c()):o},e.padding=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),a=u,c()):a},e.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),c()):a},e.paddingOuter=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.align=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),c()):l},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=i[1]i[1-d])))return y=Math.max(0,Eo(h,g)-1),b=g===m?y:Eo(h,m)-1,g-h[y]>s+1e-10&&++y,d&&(v=y,y=p-b,b=p-v),y>b?void 0:t().slice(y,b+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return Kb().domain(t()).range(i).round(o).paddingInner(a).paddingOuter(u).align(l)},c()}function dk(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return dk(t())},e}function _X(){return dk(Kb().paddingInner(1))}var wX=Array.prototype.map;function EX(e){return wX.call(e,Cn)}const CX=Array.prototype.slice;function hk(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(Eo(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=EX(i),n):e.slice()},n.range=function(i){return arguments.length?(t=CX.call(i),n):t.slice()},n.tickFormat=function(i,r){return HC(e[0],Ge(e),i??10,r)},n.copy=function(){return hk().domain(n.domain()).range(n.range())},n}const ip=new Map,pk=Symbol("vega_scale");function gk(e){return e[pk]=!0,e}function mk(e){return e&&e[pk]===!0}function kX(e,t,n){const i=function(){const s=t();return s.invertRange||(s.invertRange=s.invert?vX(s):s.invertExtent?xX(s):void 0),s.type=e,gk(s)};return i.metadata=lr(oe(n)),i}function Qe(e,t,n){return arguments.length>1?(ip.set(e,kX(e,t,n)),this):yk(e)?ip.get(e):void 0}Qe(bX,VC),Qe($l,GC,Ht),Qe(Ps,JC,[Ht,Ps]),Qe($f,Bb,Ht),Qe(Sf,tX,Ht),Qe(ep,tk,Ht),Qe(Ba,rX,[Ht,Xb]),Qe(Ua,sX,[Ht,Xb]),Qe(Qr,jb,[Ht,Hi]),Qe(`${Qr}-${$l}`,jb,[Ht,Hi]),Qe(`${Qr}-${Ps}`,ok,[Ht,Hi,Ps]),Qe(`${Qr}-${$f}`,qb,[Ht,Hi]),Qe(`${Qr}-${Sf}`,oX,[Ht,Hi]),Qe(`${Qr}-${ep}`,ak,[Ht,Hi]),Qe(`${Sl}-${$l}`,uk,[Ht,Hi]),Qe(`${Sl}-${Ps}`,lk,[Ht,Hi,Ps]),Qe(`${Sl}-${$f}`,Wb,[Ht,Hi]),Qe(`${Sl}-${Sf}`,aX,[Ht,Hi]),Qe(`${Sl}-${ep}`,ck,[Ht,Hi]),Qe(Fl,ik,[Df,Fl]),Qe(tp,rk,Df),Qe(np,sk,Df),Qe(Yb,hk,[Ff,Df]),Qe(Gb,vb,Ff),Qe(fk,Kb,Ff),Qe(Vb,_X,Ff);function yk(e){return ip.has(e)}function ja(e,t){const n=ip.get(e);return n&&n.metadata[t]}function Zb(e){return ja(e,Ht)}function Dl(e){return ja(e,Ff)}function Jb(e){return ja(e,Df)}function bk(e){return ja(e,Ps)}function AX(e){return ja(e,Xb)}function vk(e){return ja(e,Hi)}function xk(e){return ja(e,Fl)}const $X=["clamp","base","constant","exponent"];function _k(e,t){const n=t[0],i=Ge(t)-n;return function(r){return e(n+r*i)}}function rp(e,t,n){return Rb(Qb(t||"rgb",n),e)}function wk(e,t){const n=new Array(t),i=t+1;for(let r=0;re[a]?o[a](e[a]()):0),o)}function Qb(e,t){const n=qY[SX(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function SX(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const FX={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},DX={accent:lX,category10:uX,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:cX,observable10:fX,paired:dX,pastel1:hX,pastel2:pX,set1:gX,set2:mX,set3:yX,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function Ck(e){if(W(e))return e;const t=e.length/6|0,n=new Array(t);for(let i=0;irp(Ck(e)));function e3(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(Ak[e]=t,this):Ak[e]}const sp="symbol",TX="discrete",MX="gradient",NX=e=>W(e)?e.map(t=>String(t)):String(e),RX=(e,t)=>e[1]-t[1],OX=(e,t)=>t[1]-e[1];function t3(e,t,n){let i;return Ze(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(Xc(e.domain())/n||1)+1))),re(t)&&(i=t.step,t=t.interval),se(t)&&(t=e.type===Ba?gl(t):e.type==Ua?ml(t):q("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function $k(e,t,n){let i=e.range(),r=i[0],s=Ge(i),o=RX;if(r>s&&(i=s,s=r,r=i,o=OX),r=Math.floor(r),s=Math.ceil(s),t=t.map(a=>[a,e(a)]).filter(a=>r<=a[1]&&a[1]<=s).sort(o).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],Ge(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=a)}return t}function n3(e,t){return e.bins?$k(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function Sk(e,t,n,i,r,s){const o=t.type;let a=NX;if(o===Ba||r===Ba)a=e.timeFormat(i);else if(o===Ua||r===Ua)a=e.utcFormat(i);else if(bk(o)){const u=e.formatFloat(i);if(s||t.bins)a=u;else{const l=Fk(t,n,!1);a=c=>l(c)?u(c):""}}else if(t.tickFormat){const u=t.domain();a=e.formatSpan(u[0],u[u.length-1],n,i)}else i&&(a=e.format(i));return a}function Fk(e,t,n){const i=n3(e,t),r=e.base(),s=Math.log(r),o=Math.max(1,r*t/i.length),a=u=>{let l=u/Math.pow(r,Math.round(Math.log(u)/s));return l*r1?i[1]-i[0]:i[0],o;for(o=1;oi3[e.type]||e.bins;function Mk(e,t,n,i,r,s,o){const a=Dk[t.type]&&s!==Ba&&s!==Ua?LX(e,t,r):Sk(e,t,n,r,s,o);return i===sp&&zX(t)?BX(a):i===TX?UX(a):jX(a)}const BX=e=>(t,n,i)=>{const r=Nk(i[n+1],Nk(i.max,1/0)),s=Rk(t,e),o=Rk(r,e);return s&&o?s+" – "+o:o?"< "+o:"≥ "+s},Nk=(e,t)=>e??t,UX=e=>(t,n)=>n?e(t):null,jX=e=>t=>e(t),Rk=(e,t)=>Number.isFinite(e)?t(e):null;function qX(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+Ge(t),s=r-i;if(e.type===np){const o=n?s/n:.1;i-=o,r+=o,s=r-i}return o=>(o-i)/s}function WX(e,t,n,i){const r=i||t.type;return se(n)&&AX(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===Ba?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===Ua?e.utcFormat("%A, %d %B %Y, %X UTC"):Mk(e,t,5,null,n,i,!0)}function Ok(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=WX(e,t,n.format,n.formatType);if(Jb(t.type)){const s=Tk(t).slice(1).map(r),o=s.length;return`${o} boundar${o===1?"y":"ies"}: ${s.join(", ")}`}else if(Dl(t.type)){const s=t.domain(),o=s.length,a=o>i?s.slice(0,i-2).map(r).join(", ")+", ending with "+s.slice(-1).map(r):s.map(r).join(", ");return`${o} value${o===1?"":"s"}: ${a}`}else{const s=t.domain();return`values from ${r(s[0])} to ${r(Ge(s))}`}}let Lk=0;function HX(){Lk=0}const op="p_";function r3(e){return e&&e.gradient}function Ik(e,t,n){const i=e.gradient;let r=e.id,s=i==="radial"?op:"";return r||(r=e.id="gradient_"+Lk++,i==="radial"?(e.x1=es(e.x1,.5),e.y1=es(e.y1,.5),e.r1=es(e.r1,0),e.x2=es(e.x2,.5),e.y2=es(e.y2,.5),e.r2=es(e.r2,.5),s=op):(e.x1=es(e.x1,0),e.y1=es(e.y1,0),e.x2=es(e.x2,1),e.y2=es(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+s+r+")"}function es(e,t){return e??t}function Pk(e,t){var n=[],i;return i={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(r,s){return n.push({offset:r,color:s}),i}}}const zk={basis:{curve:UV},"basis-closed":{curve:jV},"basis-open":{curve:qV},bundle:{curve:WV,tension:"beta",value:.85},cardinal:{curve:HV,tension:"tension",value:0},"cardinal-open":{curve:VV,tension:"tension",value:0},"cardinal-closed":{curve:GV,tension:"tension",value:0},"catmull-rom":{curve:YV,tension:"alpha",value:.5},"catmull-rom-closed":{curve:XV,tension:"alpha",value:.5},"catmull-rom-open":{curve:KV,tension:"alpha",value:.5},linear:{curve:db},"linear-closed":{curve:ZV},monotone:{horizontal:QV,vertical:JV},natural:{curve:eY},step:{curve:tY},"step-after":{curve:iY},"step-before":{curve:nY}};function s3(e,t,n){var i=ue(zk,e)&&zk[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const GX={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},VX=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,YX=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,XX=/^((\s+,?\s*)|(,\s*))/,KX=/^[01]/;function Tl(e){const t=[];return(e.match(VX)||[]).forEach(i=>{let r=i[0];const s=r.toLowerCase(),o=GX[s],a=ZX(s,o,i.slice(1).trim()),u=a.length;if(u1&&(g=Math.sqrt(g),n*=g,i*=g);const m=d/n,y=f/n,b=-f/i,v=d/i,x=m*a+y*u,_=b*a+v*u,E=m*e+y*t,w=b*e+v*t;let k=1/((E-x)*(E-x)+(w-_)*(w-_))-.25;k<0&&(k=0);let S=Math.sqrt(k);s==r&&(S=-S);const $=.5*(x+E)-S*(w-_),O=.5*(_+w)+S*(E-x),R=Math.atan2(_-O,x-$);let A=Math.atan2(w-O,E-$)-R;A<0&&s===1?A+=ts:A>0&&s===0&&(A-=ts);const T=Math.ceil(Math.abs(A/(qa+.001))),B=[];for(let G=0;G+e}function ap(e,t,n){return Math.max(t,Math.min(e,n))}function Hk(){var e=iK,t=rK,n=sK,i=oK,r=zs(0),s=r,o=r,a=r,u=null;function l(c,f,d){var h,p=f??+e.call(this,c),g=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,v=ap(+r.call(this,c),0,b),x=ap(+s.call(this,c),0,b),_=ap(+o.call(this,c),0,b),E=ap(+a.call(this,c),0,b);if(u||(u=h=M0()),v<=0&&x<=0&&_<=0&&E<=0)u.rect(p,g,m,y);else{var w=p+m,C=g+y;u.moveTo(p+v,g),u.lineTo(w-x,g),u.bezierCurveTo(w-zo*x,g,w,g+zo*x,w,g+x),u.lineTo(w,C-E),u.bezierCurveTo(w,C-zo*E,w-zo*E,C,w-E,C),u.lineTo(p+_,C),u.bezierCurveTo(p+zo*_,C,p,C-zo*_,p,C-_),u.lineTo(p,g+v),u.bezierCurveTo(p,g+zo*v,p+zo*v,g,p+v,g),u.closePath()}if(h)return u=null,h+""||null}return l.x=function(c){return arguments.length?(e=zs(c),l):e},l.y=function(c){return arguments.length?(t=zs(c),l):t},l.width=function(c){return arguments.length?(n=zs(c),l):n},l.height=function(c){return arguments.length?(i=zs(c),l):i},l.cornerRadius=function(c,f,d,h){return arguments.length?(r=zs(c),s=f!=null?zs(f):r,a=d!=null?zs(d):r,o=h!=null?zs(h):s,l):r},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function Gk(){var e,t,n,i,r=null,s,o,a,u;function l(f,d,h){const p=h/2;if(s){var g=a-d,m=f-o;if(g||m){var y=Math.hypot(g,m),b=(g/=y)*u,v=(m/=y)*u,x=Math.atan2(m,g);r.moveTo(o-b,a-v),r.lineTo(f-g*p,d-m*p),r.arc(f,d,p,x-Math.PI,x),r.lineTo(o+b,a+v),r.arc(o,a,u,x,x+Math.PI)}else r.arc(f,d,p,0,ts);r.closePath()}else s=1;o=f,a=d,u=p}function c(f){var d,h=f.length,p,g=!1,m;for(r==null&&(r=m=M0()),d=0;d<=h;++d)!(de.x||0,Rf=e=>e.y||0,aK=e=>e.width||0,uK=e=>e.height||0,lK=e=>(e.x||0)+(e.width||0),cK=e=>(e.y||0)+(e.height||0),fK=e=>e.startAngle||0,dK=e=>e.endAngle||0,hK=e=>e.padAngle||0,pK=e=>e.innerRadius||0,gK=e=>e.outerRadius||0,mK=e=>e.cornerRadius||0,yK=e=>Mf(e.cornerRadiusTopLeft,e.cornerRadius)||0,bK=e=>Mf(e.cornerRadiusTopRight,e.cornerRadius)||0,vK=e=>Mf(e.cornerRadiusBottomRight,e.cornerRadius)||0,xK=e=>Mf(e.cornerRadiusBottomLeft,e.cornerRadius)||0,_K=e=>Mf(e.size,64),wK=e=>e.size||1,up=e=>e.defined!==!1,EK=e=>Wk(e.shape||"circle"),CK=PV().startAngle(fK).endAngle(dK).padAngle(hK).innerRadius(pK).outerRadius(gK).cornerRadius(mK),kK=q9().x(Nf).y1(Rf).y0(cK).defined(up),AK=q9().y(Rf).x1(Nf).x0(lK).defined(up),$K=j9().x(Nf).y(Rf).defined(up),SK=Hk().x(Nf).y(Rf).width(aK).height(uK).cornerRadius(yK,bK,vK,xK),FK=BV().type(EK).size(_K),DK=Gk().x(Nf).y(Rf).defined(up).size(wK);function l3(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function TK(e,t){return CK.context(e)(t)}function MK(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?AK:kK).curve(s3(i,n.orient,n.tension)).context(e)(t)}function NK(e,t){const n=t[0],i=n.interpolate||"linear";return $K.curve(s3(i,n.orient,n.tension)).context(e)(t)}function Nl(e,t,n,i){return SK.context(e)(t,n,i)}function RK(e,t){return(t.mark.shape||t.shape).context(e)(t)}function OK(e,t){return FK.context(e)(t)}function LK(e,t){return DK.context(e)(t)}var Vk=1;function Yk(){Vk=1}function c3(e,t,n){var i=t.clip,r=e._defs,s=t.clip_id||(t.clip_id="clip"+Vk++),o=r.clipping[s]||(r.clipping[s]={id:s});return Oe(i)?o.path=i(null):l3(n)?o.path=Nl(null,n,0,0):(o.width=n.width||0,o.height=n.height||0),"url(#"+s+")"}function Ut(e){this.clear(),e&&this.union(e)}Ut.prototype={clone(){return new Ut(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,i){return nthis.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:s,y2:o}=this,a=Math.cos(e),u=Math.sin(e),l=t-t*a+n*u,c=n-t*u-n*a;return[a*i-u*r+l,u*i+a*r+c,a*i-u*o+l,u*i+a*o+c,a*s-u*r+l,u*s+a*r+c,a*s-u*o+l,u*s+a*o+c]},union(e){return e.x1this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function lp(e){this.mark=e,this.bounds=this.bounds||new Ut}function cp(e){lp.call(this,e),this.items=this.items||[]}te(cp,lp);class Xk{constructor(t){this._pending=0,this._loader=t||p0()}pending(){return this._pending}sanitizeURL(t){const n=this;return Kk(n),n._loader.sanitize(t,{context:"href"}).then(i=>(Of(n),i)).catch(()=>(Of(n),null))}loadImage(t){const n=this,i=rY();return Kk(n),n._loader.sanitize(t,{context:"image"}).then(r=>{const s=r.href;if(!s||!i)throw{url:s};const o=new i,a=ue(r,"crossOrigin")?r.crossOrigin:"anonymous";return a!=null&&(o.crossOrigin=a),o.onload=()=>Of(n),o.onerror=()=>Of(n),o.src=s,o}).catch(r=>(Of(n),{complete:!1,width:0,height:0,src:r&&r.url||""}))}ready(){const t=this;return new Promise(n=>{function i(r){t.pending()?setTimeout(()=>{i(!0)},10):n(r)}i(!1)})}}function Kk(e){e._pending+=1}function Of(e){e._pending-=1}function Bs(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?IK(t,i):0))}return e}function IK(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const PK=ts-1e-8;let fp,dp,hp,Wa,f3,pp,d3,h3;const Bo=(e,t)=>fp.add(e,t),gp=(e,t)=>Bo(dp=e,hp=t),Zk=e=>Bo(e,fp.y1),Jk=e=>Bo(fp.x1,e),Ha=(e,t)=>f3*e+d3*t,Ga=(e,t)=>pp*e+h3*t,p3=(e,t)=>Bo(Ha(e,t),Ga(e,t)),g3=(e,t)=>gp(Ha(e,t),Ga(e,t));function Lf(e,t){return fp=e,t?(Wa=t*Po,f3=h3=Math.cos(Wa),pp=Math.sin(Wa),d3=-pp):(f3=h3=1,Wa=pp=d3=0),zK}const zK={beginPath(){},closePath(){},moveTo:g3,lineTo:g3,rect(e,t,n,i){Wa?(p3(e+n,t),p3(e+n,t+i),p3(e,t+i),g3(e,t)):(Bo(e+n,t+i),gp(e,t))},quadraticCurveTo(e,t,n,i){const r=Ha(e,t),s=Ga(e,t),o=Ha(n,i),a=Ga(n,i);Qk(dp,r,o,Zk),Qk(hp,s,a,Jk),gp(o,a)},bezierCurveTo(e,t,n,i,r,s){const o=Ha(e,t),a=Ga(e,t),u=Ha(n,i),l=Ga(n,i),c=Ha(r,s),f=Ga(r,s);eA(dp,o,u,c,Zk),eA(hp,a,l,f,Jk),gp(c,f)},arc(e,t,n,i,r,s){if(i+=Wa,r+=Wa,dp=n*Math.cos(r)+e,hp=n*Math.sin(r)+t,Math.abs(r-i)>PK)Bo(e-n,t-n),Bo(e+n,t+n);else{const o=l=>Bo(n*Math.cos(l)+e,n*Math.sin(l)+t);let a,u;if(o(i),o(r),r!==i)if(i=i%ts,i<0&&(i+=ts),r=r%ts,r<0&&(r+=ts),rr;++u,a-=qa)o(a);else for(a=i-i%qa+qa,u=0;u<4&&aJX?(c=o*o+a*s,c>=0&&(c=Math.sqrt(c),u=(-o+c)/s,l=(-o-c)/s)):u=.5*a/o,0d)return!1;g>f&&(f=g)}else if(h>0){if(g0?(e.globalAlpha=n,e.fillStyle=sA(e,t,t.fill),!0):!1}var UK=[];function Ll(e,t,n){var i=(i=t.strokeWidth)!=null?i:1;return i<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=sA(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||UK),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function jK(e,t){return e.zindex-t.zindex||e.index-t.index}function v3(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],i,r,s;for(r=0,s=t.length;r=0;)if(i=t(n[r]))return i;if(n===s){for(n=e.items,r=n.length;--r>=0;)if(!n[r].zindex&&(i=t(n[r])))return i}return null}function x3(e){return function(t,n,i){pr(n,r=>{(!i||i.intersects(r.bounds))&&oA(e,t,r,r)})}}function qK(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&oA(e,t,n.items[0],n.items)}}function oA(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(Ol(t,n),n.fill&&mp(t,n,r)&&t.fill(),n.stroke&&Ll(t,n,r)&&t.stroke()))}function bp(e){return e=e||Ui,function(t,n,i,r,s,o){return i*=t.pixelRatio,r*=t.pixelRatio,yp(n,a=>{const u=a.bounds;if(!(u&&!u.contains(s,o)||!u)&&e(t,a,i,r,s,o))return a})}}function If(e,t){return function(n,i,r,s){var o=Array.isArray(i)?i[0]:i,a=t??o.fill,u=o.stroke&&n.isPointInStroke,l,c;return u&&(l=o.strokeWidth,c=o.strokeCap,n.lineWidth=l??1,n.lineCap=c??"butt"),e(n,i)?!1:a&&n.isPointInPath(r,s)||u&&n.isPointInStroke(r,s)}}function _3(e){return bp(If(e))}function Va(e,t){return"translate("+e+","+t+")"}function w3(e){return"rotate("+e+")"}function WK(e,t){return"scale("+e+","+t+")"}function aA(e){return Va(e.x||0,e.y||0)}function HK(e){return Va(e.x||0,e.y||0)+(e.angle?" "+w3(e.angle):"")}function GK(e){return Va(e.x||0,e.y||0)+(e.angle?" "+w3(e.angle):"")+(e.scaleX||e.scaleY?" "+WK(e.scaleX||1,e.scaleY||1):"")}function E3(e,t,n){function i(o,a){o("transform",HK(a)),o("d",t(null,a))}function r(o,a){return t(Lf(o,a.angle),a),Bs(o,a).translate(a.x||0,a.y||0)}function s(o,a){var u=a.x||0,l=a.y||0,c=a.angle||0;o.translate(u,l),c&&o.rotate(c*=Po),o.beginPath(),t(o,a),c&&o.rotate(-c),o.translate(-u,-l)}return{type:e,tag:"path",nested:!1,attr:i,bound:r,draw:x3(s),pick:_3(s),isect:n||y3(s)}}var VK=E3("arc",TK);function YK(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],i=e[0].orient==="horizontal"?"y":"x",r=e.length,s=1/0,o,a;--r>=0;)e[r].defined!==!1&&(a=Math.abs(e[r][i]-n),a=0;)if(e[i].defined!==!1&&(r=e[i].x-t[0],s=e[i].y-t[1],o=r*r+s*s,o=0;)if(e[n].defined!==!1&&(i=e[n].x-t[0],r=e[n].y-t[1],s=i*i+r*r,i=e[n].size||1,s.5&&t<1.5?.5-Math.abs(t-1):0}function QK(e,t){e("transform",aA(t))}function cA(e,t){const n=lA(t);e("d",Nl(null,t,n,n))}function eZ(e,t){e("class","background"),e("aria-hidden",!0),cA(e,t)}function tZ(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?cA(e,t):e("d","")}function nZ(e,t,n){const i=t.clip?c3(n,t,t):null;e("clip-path",i)}function iZ(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let r=0;r{const s=r.x||0,o=r.y||0,a=r.strokeForeground,u=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&u&&(Pf(e,r,s,o),Ol(e,r),r.fill&&mp(e,r,u)&&e.fill(),r.stroke&&!a&&Ll(e,r,u)&&e.stroke()),e.save(),e.translate(s,o),r.clip&&uA(e,r),n&&n.translate(-s,-o),pr(r,l=>{(l.marktype==="group"||i==null||i.includes(l.marktype))&&this.draw(e,l,n,i)}),n&&n.translate(s,o),e.restore(),a&&r.stroke&&u&&(Pf(e,r,s,o),Ol(e,r),Ll(e,r,u)&&e.stroke())})}function uZ(e,t,n,i,r,s){if(t.bounds&&!t.bounds.contains(r,s)||!t.items)return null;const o=n*e.pixelRatio,a=i*e.pixelRatio;return yp(t,u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(r,s))return;c=u.x||0,f=u.y||0;const h=c+(u.width||0),p=f+(u.height||0),g=u.clip;if(g&&(rh||sp))return;if(e.save(),e.translate(c,f),c=r-c,f=s-f,g&&l3(u)&&!oZ(e,u,o,a))return e.restore(),null;const m=u.strokeForeground,y=t.interactive!==!1;return y&&m&&u.stroke&&sZ(e,u,o,a)?(e.restore(),u):(l=yp(u,b=>lZ(b,c,f)?this.pick(b,n,i,c,f):null),!l&&y&&(u.fill||!m&&u.stroke)&&rZ(e,u,o,a)&&(l=u),e.restore(),l||null)})}function lZ(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var cZ={type:"group",tag:"g",nested:!1,attr:QK,bound:iZ,draw:aZ,pick:uZ,isect:nA,content:nZ,background:eZ,foreground:tZ},zf={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function k3(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(i=>{e.image=i,e.image.url=e.url})),n}function A3(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function $3(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function vp(e,t){return e==="center"?t/2:e==="right"?t:0}function xp(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function fZ(e,t,n){const i=k3(t,n),r=A3(t,i),s=$3(t,i),o=(t.x||0)-vp(t.align,r),a=(t.y||0)-xp(t.baseline,s),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,zf["xmlns:xlink"],"xlink:href"),e("transform",Va(o,a)),e("width",r),e("height",s),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function dZ(e,t){const n=t.image,i=A3(t,n),r=$3(t,n),s=(t.x||0)-vp(t.align,i),o=(t.y||0)-xp(t.baseline,r);return e.set(s,o,s+i,o+r)}function hZ(e,t,n){pr(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=k3(i,this);let s=A3(i,r),o=$3(i,r);if(s===0||o===0)return;let a=(i.x||0)-vp(i.align,s),u=(i.y||0)-xp(i.baseline,o),l,c,f,d;i.aspect!==!1&&(c=r.width/r.height,f=i.width/i.height,c===c&&f===f&&c!==f&&(f{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&dA(e,i,r)&&(Ol(e,i),e.stroke())}})}function kZ(e,t,n,i){return e.isPointInStroke?dA(e,t,1)&&e.isPointInStroke(n,i):!1}var AZ={type:"rule",tag:"line",nested:!1,attr:wZ,bound:EZ,draw:CZ,pick:bp(kZ),isect:iA},$Z=E3("shape",RK),SZ=E3("symbol",OK,b3);const hA=K4();var Ai={height:ns,measureWidth:S3,estimateWidth:wp,width:wp,canvas:pA};pA(!0);function pA(e){Ai.width=e&&Uo?S3:wp}function wp(e,t){return gA(qo(e,t),ns(e))}function gA(e,t){return~~(.8*e.length*t)}function S3(e,t){return ns(e)<=0||!(t=qo(e,t))?0:mA(t,Ep(e))}function mA(e,t){const n=`(${t}) ${e}`;let i=hA.get(n);return i===void 0&&(Uo.font=t,i=Uo.measureText(e).width,hA.set(n,i)),i}function ns(e){return e.fontSize!=null?+e.fontSize||0:11}function jo(e){return e.lineHeight!=null?e.lineHeight:ns(e)+2}function FZ(e){return W(e)?e.length>1?e:e[0]:e}function Bf(e){return FZ(e.lineBreak&&e.text&&!W(e.text)?e.text.split(e.lineBreak):e.text)}function F3(e){const t=Bf(e);return(W(t)?t.length-1:0)*jo(e)}function qo(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?TZ(e,n):n}function DZ(e){if(Ai.width===S3){const t=Ep(e);return n=>mA(n,t)}else if(Ai.width===wp){const t=ns(e);return n=>gA(n,t)}else return t=>Ai.width(e,t)}function TZ(e,t){var n=+e.limit,i=DZ(e);if(i(t)>>1,i(t.slice(u))>n?o=u+1:a=u;return r+t.slice(o)}else{for(;o>>1),i(t.slice(0,u))Math.max(d,Ai.width(t,h)),0)):f=Ai.width(t,c),r==="center"?u-=f/2:r==="right"&&(u-=f),e.set(u+=o,l+=a,u+f,l+i),t.angle&&!n)e.rotate(t.angle*Po,o,a);else if(n===2)return e.rotatedPoints(t.angle*Po,o,a);return e}function RZ(e,t,n){pr(t,i=>{var r=i.opacity==null?1:i.opacity,s,o,a,u,l,c,f;if(!(n&&!n.intersects(i.bounds)||r===0||i.fontSize<=0||i.text==null||i.text.length===0)){if(e.font=Ep(i),e.textAlign=i.align||"left",s=Cp(i),o=s.x1,a=s.y1,i.angle&&(e.save(),e.translate(o,a),e.rotate(i.angle*Po),o=a=0),o+=i.dx||0,a+=(i.dy||0)+D3(i),c=Bf(i),Ol(e,i),W(c))for(l=jo(i),u=0;ut;)e.removeChild(n[--i]);return e}function CA(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function kp(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function BZ(e,t,n,i){var r=e&&e.mark,s,o;if(r&&(s=$i[r.marktype]).tip){for(o=kp(t,n),o[0]-=i[0],o[1]-=i[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=s.tip(r.items,o)}return e}let R3=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||p0(),this._tooltip=n||UZ}initialize(t,n,i){return this._el=t,this._obj=i||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()}scene(t){return arguments.length?(this._scene=t,this):this._scene}on(){}off(){}_handlerIndex(t,n,i){for(let r=t?t.length:0;--r>=0;)if(t[r].type===n&&(!i||t[r].handler===i))return r;return-1}handlers(t){const n=this._handlers,i=[];if(t)i.push(...n[this.eventName(t)]);else for(const r in n)i.push(...n[r]);return i}eventName(t){const n=t.indexOf(".");return n<0?t:t.slice(0,n)}handleHref(t,n,i){this._loader.sanitize(i,{context:"href"}).then(r=>{const s=new MouseEvent(t.type,t),o=Wo(null,"a");for(const a in r)o.setAttribute(a,r[a]);o.dispatchEvent(s)}).catch(()=>{})}handleTooltip(t,n,i){if(n&&n.tooltip!=null){n=BZ(n,t,this.canvas(),this._origin);const r=i&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,t,n,r)}}getItemBoundingClientRect(t){const n=this.canvas();if(!n)return;const i=n.getBoundingClientRect(),r=this._origin,s=t.bounds,o=s.width(),a=s.height();let u=s.x1+r[0]+i.left,l=s.y1+r[1]+i.top;for(;t.mark&&(t=t.mark.group);)u+=t.x||0,l+=t.y||0;return{x:u,y:l,width:o,height:a,left:u,top:l,right:u+o,bottom:l+a}}};function UZ(e,t,n,i){e.element().setAttribute("title",i||"")}class qf{constructor(t){this._el=null,this._bgcolor=null,this._loader=new Xk(t)}initialize(t,n,i,r,s){return this._el=t,this.resize(n,i,r,s)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(t){return arguments.length===0?this._bgcolor:(this._bgcolor=t,this)}resize(t,n,i,r){return this._width=t,this._height=n,this._origin=i||[0,0],this._scale=r||1,this}dirty(){}render(t,n){const i=this;return i._call=function(){i._render(t,n)},i._call(),i._call=null,i}_render(){}renderAsync(t,n){const i=this.render(t,n);return this._ready?this._ready.then(()=>i):Promise.resolve(i)}_load(t,n){var i=this,r=i._loader[t](n);if(!i._ready){const s=i._call;i._ready=i._loader.ready().then(o=>{o&&s(),i._ready=null})}return r}sanitizeURL(t){return this._load("sanitizeURL",t)}loadImage(t){return this._load("loadImage",t)}}const jZ="keydown",qZ="keypress",WZ="keyup",kA="dragenter",Ap="dragleave",AA="dragover",O3="pointerdown",HZ="pointerup",$p="pointermove",Sp="pointerout",$A="pointerover",L3="mousedown",GZ="mouseup",SA="mousemove",Fp="mouseout",FA="mouseover",Dp="click",VZ="dblclick",YZ="wheel",DA="mousewheel",Tp="touchstart",Mp="touchmove",Np="touchend",XZ=[jZ,qZ,WZ,kA,Ap,AA,O3,HZ,$p,Sp,$A,L3,GZ,SA,Fp,FA,Dp,VZ,YZ,DA,Tp,Mp,Np],I3=$p,Wf=Fp,P3=Dp;class Hf extends R3{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=XZ,this.pointermove=MA([$p,SA],[$A,FA],[Sp,Fp]),this.dragover=MA([AA],[kA],[Ap]),this.pointerout=NA([Sp,Fp]),this.dragleave=NA([Ap])}initialize(t,n,i){return this._canvas=t&&N3(t,"canvas"),[Dp,L3,O3,$p,Sp,Ap].forEach(r=>TA(this,r)),super.initialize(t,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(DA,t)}pointerdown(t){this._down=this._active,this.fire(O3,t)}mousedown(t){this._down=this._active,this.fire(L3,t)}click(t){this._down===this._active&&(this.fire(Dp,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(Tp,t,!0)}touchmove(t){this.fire(Mp,t,!0)}touchend(t){this.fire(Np,t,!0),this._touch=null}fire(t,n,i){const r=i?this._touch:this._active,s=this._handlers[t];if(n.vegaType=t,t===P3&&r&&r.href?this.handleHref(n,r,r.href):(t===I3||t===Wf)&&this.handleTooltip(n,r,t!==Wf),s)for(let o=0,a=s.length;o=0&&r.splice(s,1),this}pickEvent(t){const n=kp(t,this._canvas),i=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-i[0],n[1]-i[1])}pick(t,n,i,r,s){const o=this.context();return $i[t.marktype].pick.call(this,o,t,n,i,r,s)}}const KZ=e=>e===Tp||e===Mp||e===Np?[Tp,Mp,Np]:[e];function TA(e,t){KZ(t).forEach(n=>ZZ(e,n))}function ZZ(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?i=>e[t](i):i=>e.fire(t,i)))}function Gf(e,t,n){t.forEach(i=>e.fire(i,n))}function MA(e,t,n){return function(i){const r=this._active,s=this.pickEvent(i);s===r?Gf(this,e,i):((!r||!r.exit)&&Gf(this,n,i),this._active=s,Gf(this,t,i),Gf(this,e,i))}}function NA(e){return function(t){Gf(this,e,t),this._active=null}}function JZ(){return typeof window<"u"&&window.devicePixelRatio||1}function QZ(e,t,n,i,r,s){const o=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),u=o?JZ():r;e.width=t*u,e.height=n*u;for(const l in s)a[l]=s[l];return o&&u!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=u,a.setTransform(u,0,0,u,u*i[0],u*i[1]),e}class Rp extends qf{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new Ut,this._tempb=new Ut}initialize(t,n,i,r,s,o){return this._options=o||{},this._canvas=this._options.externalContext?null:Mo(1,1,this._options.type),t&&this._canvas&&(Vi(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(t,n,i,r,s)}resize(t,n,i,r){if(super.resize(t,n,i,r),this._canvas)QZ(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const s=this._options.externalContext;s||q("CanvasRenderer is missing a valid canvas or context"),s.scale(this._scale,this._scale),s.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(t){const n=this._tempb.clear().union(t.bounds);let i=t.mark.group;for(;i;)n.translate(i.x||0,i.y||0),i=i.mark.group;this._dirty.union(n)}_render(t,n){const i=this.context(),r=this._origin,s=this._width,o=this._height,a=this._dirty,u=eJ(r,s,o);i.save();const l=this._redraw||a.empty()?(this._redraw=!1,u.expand(1)):tJ(i,u.intersect(a),r);return this.clear(-r[0],-r[1],s,o),this.draw(i,t,l,n),i.restore(),a.clear(),this}draw(t,n,i,r){if(n.marktype!=="group"&&r!=null&&!r.includes(n.marktype))return;const s=$i[n.marktype];n.clip&&JK(t,n),s.draw.call(this,t,n,i,r),n.clip&&t.restore()}clear(t,n,i,r){const s=this._options,o=this.context();s.type!=="pdf"&&!s.externalContext&&o.clearRect(t,n,i,r),this._bgcolor!=null&&(o.fillStyle=this._bgcolor,o.fillRect(t,n,i,r))}}const eJ=(e,t,n)=>new Ut().set(0,0,t,n).translate(-e[0],-e[1]);function tJ(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}class RA extends R3{constructor(t,n){super(t,n);const i=this;i._hrefHandler=z3(i,(r,s)=>{s&&s.href&&i.handleHref(r,s,s.href)}),i._tooltipHandler=z3(i,(r,s)=>{i.handleTooltip(r,s,r.type!==Wf)})}initialize(t,n,i){let r=this._svg;return r&&(r.removeEventListener(P3,this._hrefHandler),r.removeEventListener(I3,this._tooltipHandler),r.removeEventListener(Wf,this._tooltipHandler)),this._svg=r=t&&N3(t,"svg"),r&&(r.addEventListener(P3,this._hrefHandler),r.addEventListener(I3,this._tooltipHandler),r.addEventListener(Wf,this._tooltipHandler)),super.initialize(t,n,i)}canvas(){return this._svg}on(t,n){const i=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[i],t,n)<0){const o={type:t,handler:n,listener:z3(this,n)};(r[i]||(r[i]=[])).push(o),this._svg&&this._svg.addEventListener(i,o.listener)}return this}off(t,n){const i=this.eventName(t),r=this._handlers[i],s=this._handlerIndex(r,t,n);return s>=0&&(this._svg&&this._svg.removeEventListener(i,r[s].listener),r.splice(s,1)),this}}const z3=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)},OA="aria-hidden",B3="aria-label",U3="role",j3="aria-roledescription",LA="graphics-object",q3="graphics-symbol",IA=(e,t,n)=>({[U3]:e,[j3]:t,[B3]:n||void 0}),nJ=lr(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),PA={axis:{desc:"axis",caption:sJ},legend:{desc:"legend",caption:oJ},"title-text":{desc:"title",caption:e=>`Title text '${jA(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${jA(e)}'`}},zA={ariaRole:U3,ariaRoleDescription:j3,description:B3};function BA(e,t){const n=t.aria===!1;if(e(OA,n||void 0),n||t.description==null)for(const i in zA)e(zA[i],void 0);else{const i=t.mark.marktype;e(B3,t.description),e(U3,t.ariaRole||(i==="group"?LA:q3)),e(j3,t.ariaRoleDescription||`${i} mark`)}}function UA(e){return e.aria===!1?{[OA]:!0}:nJ[e.role]?null:PA[e.role]?rJ(e,PA[e.role]):iJ(e)}function iJ(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return IA(n?LA:q3,`${t} mark container`,e.description)}function rJ(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return IA(t.role||q3,t.desc,n.description||i(n))}catch{return null}}function jA(e){return oe(e.text).join(" ")}function sJ(e){const t=e.datum,n=e.orient,i=t.title?qA(e):null,r=e.context,s=r.scales[t.scale].value,o=r.dataflow.locale(),a=s.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(i?` titled '${i}'`:"")+` for a ${Dl(a)?"discrete":a} scale with ${Ok(o,s,e)}`}function oJ(e){const t=e.datum,n=t.title?qA(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,s=Object.keys(r),o=e.context,a=o.scales[r[s[0]]].value,u=o.dataflow.locale();return uJ(i)+(n?` titled '${n}'`:"")+` for ${aJ(s)} with ${Ok(u,a,e)}`}function qA(e){try{return oe(Ge(e.items).items[0].text).join(" ")}catch{return null}}function aJ(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+Ge(e)}function uJ(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const WA=e=>(e+"").replace(/&/g,"&").replace(//g,">"),lJ=e=>WA(e).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function W3(){let e="",t="",n="";const i=[],r=()=>t=n="",s=u=>{t&&(e+=`${t}>${n}`,r()),i.push(u)},o=(u,l)=>(l!=null&&(t+=` ${u}="${lJ(l)}"`),a),a={open(u){s(u),t="<"+u;for(var l=arguments.length,c=new Array(l>1?l-1:0),f=1;f${n}`:"/>"):e+=``,r(),a},attr:o,text:u=>(n+=WA(u),a),toString:()=>e};return a}const HA=e=>GA(W3(),e)+"";function GA(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let r=0;r{c.dirty=n})),!r.zdirty){if(i.exit){o.nested&&r.items.length?(l=r.items[0],l._svg&&this._update(o,l._svg,l)):i._svg&&(l=i._svg.parentNode,l&&l.removeChild(i._svg)),i._svg=null;continue}i=o.nested?r.items[0]:i,i._update!==n&&(!i._svg||!i._svg.ownerSVGElement?(this._dirtyAll=!1,XA(i,n)):this._update(o,i._svg,i),i._update=n)}return!this._dirtyAll}mark(t,n,i,r){if(!this.isDirty(n))return n._svg;const s=this._svg,o=n.marktype,a=$i[o],u=n.interactive===!1?"none":null,l=a.tag==="g",c=KA(n,t,i,"g",s);if(o!=="group"&&r!=null&&!r.includes(o))return Vi(c,0),n._svg;c.setAttribute("class",CA(n));const f=UA(n);for(const g in f)Bn(c,g,f[g]);l||Bn(c,"pointer-events",u),Bn(c,"clip-path",n.clip?c3(this,n,n.group):null);let d=null,h=0;const p=g=>{const m=this.isDirty(g),y=KA(g,c,d,a.tag,s);m&&(this._update(a,y,g),l&&dJ(this,y,g,r)),d=y,++h};return a.nested?n.items.length&&p(n.items[0]):pr(n,p),Vi(c,h),c}_update(t,n,i){Us=n,Dn=n.__values__,BA(Yf,i),t.attr(Yf,i,this);const r=pJ[t.type];r&&r.call(this,t,n,i),Us&&this.style(Us,i)}style(t,n){if(n!=null){for(const i in Op){let r=i==="font"?Uf(n):n[i];if(r===Dn[i])continue;const s=Op[i];r==null?t.removeAttribute(s):(r3(r)&&(r=Ik(r,this._defs.gradient,ZA())),t.setAttribute(s,r+"")),Dn[i]=r}for(const i in Lp)Ip(t,Lp[i],n[i])}}defs(){const t=this._svg,n=this._defs;let i=n.el,r=0;for(const s in n.gradient)i||(n.el=i=Gt(t,Vf+1,"defs",Vt)),r=cJ(i,n.gradient[s],r);for(const s in n.clipping)i||(n.el=i=Gt(t,Vf+1,"defs",Vt)),r=fJ(i,n.clipping[s],r);i&&(r===0?(t.removeChild(i),n.el=null):Vi(i,r))}_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}}function XA(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function cJ(e,t,n){let i,r,s;if(t.gradient==="radial"){let o=Gt(e,n++,"pattern",Vt);Ho(o,{id:op+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),o=Gt(o,0,"rect",Vt),Ho(o,{width:1,height:1,fill:`url(${ZA()}#${t.id})`}),e=Gt(e,n++,"radialGradient",Vt),Ho(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=Gt(e,n++,"linearGradient",Vt),Ho(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i{r=e.mark(t,o,r,i),++s}),Vi(t,1+s)}function KA(e,t,n,i,r){let s=e._svg,o;if(!s&&(o=t.ownerDocument,s=Wo(o,i,Vt),e._svg=s,e.mark&&(s.__data__=e,s.__values__={fill:"default"},i==="g"))){const a=Wo(o,"path",Vt);s.appendChild(a),a.__data__=e;const u=Wo(o,"g",Vt);s.appendChild(u),u.__data__=e;const l=Wo(o,"path",Vt);s.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(s.ownerSVGElement!==r||hJ(s,n))&&t.insertBefore(s,n?n.nextSibling:t.firstChild),s}function hJ(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Us=null,Dn=null;const pJ={group(e,t,n){const i=Us=t.childNodes[2];Dn=i.__values__,e.foreground(Yf,n,this),Dn=t.__values__,Us=t.childNodes[1],e.content(Yf,n,this);const r=Us=t.childNodes[0];e.background(Yf,n,this);const s=n.mark.interactive===!1?"none":null;if(s!==Dn.events&&(Bn(i,"pointer-events",s),Bn(r,"pointer-events",s),Dn.events=s),n.strokeForeground&&n.stroke){const o=n.fill;Bn(i,"display",null),this.style(r,n),Bn(r,"stroke",null),o&&(n.fill=null),Dn=i.__values__,this.style(i,n),o&&(n.fill=o),Us=null}else Bn(i,"display","none")},image(e,t,n){n.smooth===!1?(Ip(t,"image-rendering","optimizeSpeed"),Ip(t,"image-rendering","pixelated")):Ip(t,"image-rendering",null)},text(e,t,n){const i=Bf(n);let r,s,o,a;W(i)?(s=i.map(u=>qo(n,u)),r=s.join(` -`),r!==Dn.text&&(Vi(t,0),o=t.ownerDocument,a=jo(n),s.forEach((u,l)=>{const c=Wo(o,"tspan",Vt);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),Dn.text=r)):(s=qo(n,i),s!==Dn.text&&(t.textContent=s,Dn.text=s)),Bn(t,"font-family",Uf(n)),Bn(t,"font-size",ns(n)+"px"),Bn(t,"font-style",n.fontStyle),Bn(t,"font-variant",n.fontVariant),Bn(t,"font-weight",n.fontWeight)}};function Yf(e,t,n){t!==Dn[e]&&(n?gJ(Us,e,t,n):Bn(Us,e,t),Dn[e]=t)}function Ip(e,t,n){n!==Dn[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),Dn[t]=n)}function Ho(e,t){for(const n in t)Bn(e,n,t[n])}function Bn(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function gJ(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function ZA(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class JA extends qf{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=W3();n.open("svg",Le({},zf,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const i=this._bgcolor;return i&&i!=="transparent"&&i!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:i}).close(),n.open("g",VA,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const i=$i[n.marktype],r=i.tag,s=[BA,i.attr];t.open("g",{class:CA(n),"clip-path":n.clip?c3(this,n,n.group):null},UA(n),{"pointer-events":r!=="g"&&n.interactive===!1?"none":null});const o=a=>{const u=this.href(a);if(u&&t.open("a",u),t.open(r,this.attr(n,a,s,r!=="g"?r:null)),r==="text"){const l=Bf(a);if(W(l)){const c={x:0,dy:jo(a)};for(let f=0;fthis.mark(t,d)),t.close(),l&&f?(c&&(a.fill=null),a.stroke=f,t.open("path",this.attr(n,a,i.foreground,"bgrect")).close(),c&&(a.fill=c)):t.open("path",this.attr(n,a,i.foreground,"bgfore")).close()}t.close(),u&&t.close()};return i.nested?n.items&&n.items.length&&o(n.items[0]):pr(n,o),t.close()}href(t){const n=t.href;let i;if(n){if(i=this._hrefs&&this._hrefs[n])return i;this.sanitizeURL(n).then(r=>{r["xlink:href"]=r.href,r.href=null,(this._hrefs||(this._hrefs={}))[n]=r})}return null}attr(t,n,i,r){const s={},o=(a,u,l,c)=>{s[c||a]=u};return Array.isArray(i)?i.forEach(a=>a(o,n,this)):i(o,n,this),r&&mJ(s,n,t,r,this._defs),s}defs(t){const n=this._defs.gradient,i=this._defs.clipping;if(Object.keys(n).length+Object.keys(i).length!==0){t.open("defs");for(const s in n){const o=n[s],a=o.stops;o.gradient==="radial"?(t.open("pattern",{id:op+s,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+s+")"}).close(),t.close(),t.open("radialGradient",{id:s,fx:o.x1,fy:o.y1,fr:o.r1,cx:o.x2,cy:o.y2,r:o.r2})):t.open("linearGradient",{id:s,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2});for(let u=0;u!gr.svgMarkTypes.includes(s));this._svgRenderer.render(t,gr.svgMarkTypes),this._canvasRenderer.render(t,r)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svgRenderer.resize(t,n,i,r),this._canvasRenderer.resize(t,n,i,r),this}background(t){return gr.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class QA extends Hf{constructor(t,n){super(t,n)}initialize(t,n,i){const r=Gt(Gt(t,0,"div"),gr.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const e$="canvas",t$="hybrid",n$="png",i$="svg",r$="none",Go={Canvas:e$,PNG:n$,SVG:i$,Hybrid:t$,None:r$},Ya={};Ya[e$]=Ya[n$]={renderer:Rp,headless:Rp,handler:Hf},Ya[i$]={renderer:H3,headless:JA,handler:RA},Ya[t$]={renderer:G3,headless:G3,handler:QA},Ya[r$]={};function Pp(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(Ya[e]=t,this):Ya[e]}function s$(e,t,n){const i=[],r=new Ut().union(t),s=e.marktype;return s?o$(e,r,n,i):s==="group"?a$(e,r,n,i):q("Intersect scene must be mark node or group item.")}function o$(e,t,n,i){if(bJ(e,t,n)){const r=e.items,s=e.marktype,o=r.length;let a=0;if(s==="group")for(;a=0;s--)if(n[s]!=i[s])return!1;for(s=n.length-1;s>=0;s--)if(r=n[s],!Y3(e[r],t[r],r))return!1;return typeof e==typeof t}function _J(){Yk(),HX()}const Il="top",mr="left",yr="right",Vo="bottom",wJ="top-left",EJ="top-right",CJ="bottom-left",kJ="bottom-right",X3="start",K3="middle",Un="end",AJ="x",$J="y",zp="group",Z3="axis",J3="title",SJ="frame",FJ="scope",Q3="legend",f$="row-header",d$="row-footer",h$="row-title",p$="column-header",g$="column-footer",m$="column-title",DJ="padding",TJ="symbol",y$="fit",b$="fit-x",v$="fit-y",MJ="pad",ev="none",Bp="all",tv="each",nv="flush",Yo="column",Xo="row";function x$(e){P.call(this,null,e)}te(x$,P,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,s=$i[r],o=s.bound;let a=i.bounds,u;if(s.nested)i.items.length&&n.dirty(i.items[0]),a=Up(i,o),i.items.forEach(l=>{l.bounds.clear().union(a)});else if(r===zp||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),a.clear(),i.items.forEach(l=>a.union(Up(l,o))),i.role){case Z3:case Q3:case J3:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{a.union(Up(l,o))}),t.visit(t.MOD,l=>{u=u||a.alignsWith(l.bounds),n.dirty(l),a.union(Up(l,o))}),u&&(a.clear(),i.items.forEach(l=>a.union(l.bounds)));return l$(i),t.modifies("bounds")}});function Up(e,t,n){return t(e.bounds.clear(),e,n)}const _$=":vega_identifier:";function iv(e){P.call(this,0,e)}iv.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},te(iv,P,{transform(e,t){const n=NJ(t.dataflow),i=e.as;let r=n.value;return t.visit(t.ADD,s=>s[i]=s[i]||++r),n.set(this.value=r),t}});function NJ(e){return e._signals[_$]||(e._signals[_$]=e.add(0))}function w$(e){P.call(this,null,e)}te(w$,P,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,RJ(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const i=n.marktype===zp?cp:lp;return t.visit(t.ADD,r=>i.call(r,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function RJ(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function E$(e){P.call(this,null,e)}const C$={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!k$(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},k$=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),A$=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,s;n{const t=e.bounds;return t.width()>1&&t.height()>1},LJ=(e,t,n)=>{var i=e.range(),r=new Ut;return t===Il||t===Vo?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),s=>r.encloses(s.bounds)},$$=e=>(e.forEach(t=>t.opacity=1),e),S$=(e,t)=>e.reflow(t.modified()).modifies("opacity");te(E$,P,{transform(e,t){const n=C$[e.method]||C$.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,s,o;if(!r||!r.length)return;if(!e.method)return e.modified("method")&&($$(r),t=S$(t,e)),t;if(r=r.filter(OJ),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),s=$$(r),t=S$(t,e),s.length>=3&&A$(s,i)){do s=n(s,i);while(s.length>=3&&A$(s,i));s.length<3&&!Ge(r).opacity&&(s.length>1&&(Ge(s).opacity=0),Ge(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=LJ(e.boundScale,e.boundOrient,+e.boundTolerance),r.forEach(u=>{o(u)||(u.opacity=0)}));const a=s[0].mark.bounds.clear();return r.forEach(u=>{u.opacity&&a.union(u.bounds)}),t}});function F$(e){P.call(this,null,e)}te(F$,P,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,i=>n.dirty(i)),t.fields&&t.fields.zindex){const i=t.source&&t.source[0];i&&(i.mark.zdirty=!0)}}});const Tn=new Ut;function Pl(e,t,n){return e[t]===n?0:(e[t]=n,1)}function IJ(e){var t=e.items[0].orient;return t===mr||t===yr}function PJ(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function zJ(e,t,n,i){var r=t.items[0],s=r.datum,o=r.translate!=null?r.translate:.5,a=r.orient,u=PJ(s),l=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,p=s.title&&r.items[u[2]].items[0],g=r.titlePadding,m=r.bounds,y=p&&F3(p),b=0,v=0,x,_;switch(Tn.clear().union(m),m.clear(),(x=u[0])>-1&&m.union(r.items[x].bounds),(x=u[1])>-1&&m.union(r.items[x].bounds),a){case Il:b=f||0,v=-c,_=Math.max(d,Math.min(h,-m.y1)),m.add(0,-_).add(l,0),p&&jp(e,p,_,g,y,0,-1,m);break;case mr:b=-c,v=f||0,_=Math.max(d,Math.min(h,-m.x1)),m.add(-_,0).add(0,l),p&&jp(e,p,_,g,y,1,-1,m);break;case yr:b=n+c,v=f||0,_=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(_,l),p&&jp(e,p,_,g,y,1,1,m);break;case Vo:b=f||0,v=i+c,_=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(l,_),p&&jp(e,p,_,g,0,0,1,m);break;default:b=r.x,v=r.y}return Bs(m.translate(b,v),r),Pl(r,"x",b+o)|Pl(r,"y",v+o)&&(r.bounds=Tn,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function jp(e,t,n,i,r,s,o,a){const u=t.bounds;if(t.auto){const l=o*(n+r+i);let c=0,f=0;e.dirty(t),s?c=(t.x||0)-(t.x=l):f=(t.y||0)-(t.y=l),t.mark.bounds.clear().union(u.translate(-c,-f)),e.dirty(t)}a.union(u)}const D$=(e,t)=>Math.floor(Math.min(e,t)),T$=(e,t)=>Math.ceil(Math.max(e,t));function BJ(e){var t=e.items,n=t.length,i=0,r,s;const o={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i1)for(w=0;w0&&(v[w]+=D/2);if(a&&kt(n.center,Xo)&&c!==1)for(w=0;w0&&(x[w]+=A/2);for(w=0;wr&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),g+=s,b=0,x=t.length;b=0&&(w=n[v])==null;v-=d);a?(C=h==null?w.x:Math.round(w.bounds.x1+h*w.bounds.width()),k=g):(C=g,k=h==null?w.y:Math.round(w.bounds.y1+h*w.bounds.height())),_.union(E.bounds.translate(C-(E.x||0),k-(E.y||0))),E.x=C,E.y=k,e.dirty(E),m=o(m,_[l])}return m}function R$(e,t,n,i,r,s){if(t){e.dirty(t);var o=n,a=n;i?o=Math.round(r.x1+s*r.width()):a=Math.round(r.y1+s*r.height()),t.bounds.translate(o-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=o,t.y=a,e.dirty(t)}}function GJ(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function VJ(e,t){let n=-1/0;return e.forEach(i=>{i.offset!=null&&(n=Math.max(n,i.offset))}),n>-1/0?n:t}function YJ(e,t,n,i,r,s,o){const a=GJ(n,t),u=VJ(e,a("offset",0)),l=a("anchor",X3),c=l===Un?1:l===K3?.5:0,f={align:tv,bounds:a("bounds",nv),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case mr:f.anchor={x:Math.floor(i.x1)-u,column:Un,y:c*(o||i.height()+2*i.y1),row:l};break;case yr:f.anchor={x:Math.ceil(i.x2)+u,y:c*(o||i.height()+2*i.y1),row:l};break;case Il:f.anchor={y:Math.floor(r.y1)-u,row:Un,x:c*(s||r.width()+2*r.x1),column:l};break;case Vo:f.anchor={y:Math.ceil(r.y2)+u,x:c*(s||r.width()+2*r.x1),column:l};break;case wJ:f.anchor={x:u,y:u};break;case EJ:f.anchor={x:s-u,y:u,column:Un};break;case CJ:f.anchor={x:u,y:o-u,row:Un};break;case kJ:f.anchor={x:s-u,y:o-u,column:Un,row:Un};break}return f}function XJ(e,t){var n=t.items[0],i=n.datum,r=n.orient,s=n.bounds,o=n.x,a=n.y,u,l;return n._bounds?n._bounds.clear().union(s):n._bounds=s.clone(),s.clear(),ZJ(e,n,n.items[0].items[0]),s=KJ(n,s),u=2*n.padding,l=2*n.padding,s.empty()||(u=Math.ceil(s.width()+u),l=Math.ceil(s.height()+l)),i.type===TJ&&JJ(n.items[0].items[0].items[0].items),r!==ev&&(n.x=o=0,n.y=a=0),n.width=u,n.height=l,Bs(s.set(o,a,o+u,a+l),n),n.mark.bounds.clear().union(s),n}function KJ(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function ZJ(e,t,n){var i=t.padding,r=i-n.x,s=i-n.y;if(!t.datum.title)(r||s)&&Xf(e,n,r,s);else{var o=t.items[1].items[0],a=o.anchor,u=t.titlePadding||0,l=i-o.x,c=i-o.y;switch(o.orient){case mr:r+=Math.ceil(o.bounds.width())+u;break;case yr:case Vo:break;default:s+=o.bounds.height()+u}switch((r||s)&&Xf(e,n,r,s),o.orient){case mr:c+=zl(t,n,o,a,1,1);break;case yr:l+=zl(t,n,o,Un,0,0)+u,c+=zl(t,n,o,a,1,1);break;case Vo:l+=zl(t,n,o,a,0,0),c+=zl(t,n,o,Un,-1,0,1)+u;break;default:l+=zl(t,n,o,a,0,0)}(l||c)&&Xf(e,o,l,c),(l=Math.round(o.bounds.x1-i))<0&&(Xf(e,n,-l,0),Xf(e,o,-l,0))}}function zl(e,t,n,i,r,s,o){const a=e.datum.type!=="symbol",u=n.datum.vgrad,l=a&&(s||!u)&&!o?t.items[0]:t,c=l.bounds[r?"y2":"x2"]-e.padding,f=u&&s?c:0,d=u&&s?0:c,h=r<=0?0:F3(n);return Math.round(i===X3?f:i===Un?d-h:.5*(c-h))}function Xf(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function JJ(e){const t=e.reduce((n,i)=>(n[i.column]=Math.max(i.bounds.x2-i.x,n[i.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function QJ(e,t,n,i,r){var s=t.items[0],o=s.frame,a=s.orient,u=s.anchor,l=s.offset,c=s.padding,f=s.items[0].items[0],d=s.items[1]&&s.items[1].items[0],h=a===mr||a===yr?i:n,p=0,g=0,m=0,y=0,b=0,v;if(o!==zp?a===mr?(p=r.y2,h=r.y1):a===yr?(p=r.y1,h=r.y2):(p=r.x1,h=r.x2):a===mr&&(p=i,h=0),v=u===X3?p:u===Un?h:(p+h)/2,d&&d.text){switch(a){case Il:case Vo:b=f.bounds.height()+c;break;case mr:y=f.bounds.width()+c;break;case yr:y=-f.bounds.width()-c;break}Tn.clear().union(d.bounds),Tn.translate(y-(d.x||0),b-(d.y||0)),Pl(d,"x",y)|Pl(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(Tn),d.mark.bounds.clear().union(Tn),e.dirty(d)),Tn.clear().union(d.bounds)}else Tn.clear();switch(Tn.union(f.bounds),a){case Il:g=v,m=r.y1-Tn.height()-l;break;case mr:g=r.x1-Tn.width()-l,m=v;break;case yr:g=r.x2+Tn.width()+l,m=v;break;case Vo:g=v,m=r.y2+l;break;default:g=s.x,m=s.y}return Pl(s,"x",g)|Pl(s,"y",m)&&(Tn.translate(g,m),e.dirty(s),s.bounds.clear().union(Tn),t.bounds.clear().union(Tn),e.dirty(s)),s.bounds}function O$(e){P.call(this,null,e)}te(O$,P,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&qJ(n,i,e.layout),tQ(n,i,e)}),eQ(e.mark.group)?t.reflow():t}});function eQ(e){return e&&e.mark.role!=="legend-entry"}function tQ(e,t,n){var i=t.items,r=Math.max(0,t.width||0),s=Math.max(0,t.height||0),o=new Ut().set(0,0,r,s),a=o.clone(),u=o.clone(),l=[],c,f,d,h,p,g;for(p=0,g=i.length;p{d=y.orient||yr,d!==ev&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];N$(e,b,YJ(b,y,n.legends,a,u,r,s))}l.forEach(y=>{const b=y.bounds;if(b.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=b,e.dirty(y)),n.autosize&&(n.autosize.type===y$||n.autosize.type===b$||n.autosize.type===v$))switch(y.orient){case mr:case yr:o.add(b.x1,0).add(b.x2,0);break;case Il:case Vo:o.add(0,b.y1).add(0,b.y2)}else o.union(b)})}o.union(a).union(u),c&&o.union(QJ(e,c,r,s,o)),t.clip&&o.set(0,0,t.width||0,t.height||0),nQ(e,t,o,n)}function nQ(e,t,n,i){const r=i.autosize||{},s=r.type;if(e._autosize<1||!s)return;let o=e._width,a=e._height,u=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===DJ){const p=e.padding();o-=p.left+p.right,a-=p.top+p.bottom}s===ev?(l=0,f=0,u=o,c=a):s===y$?(u=Math.max(0,o-l-d),c=Math.max(0,a-f-h)):s===b$?(u=Math.max(0,o-l-d),a=c+f+h):s===v$?(o=u+l+d,c=Math.max(0,a-f-h)):s===MJ&&(o=u+l+d,a=c+f+h),e._resizeView(o,a,u,c,[l,f],r.resize)}const iQ=Object.freeze(Object.defineProperty({__proto__:null,bound:x$,identifier:iv,mark:w$,overlap:E$,render:F$,viewlayout:O$},Symbol.toStringTag,{value:"Module"}));function L$(e){P.call(this,null,e)}te(L$,P,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.scale,o=e.count==null?e.values?e.values.length:10:e.count,a=t3(s,o,e.minstep),u=e.format||Sk(n,s,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?$k(s,e.values,a):n3(s,a);return r&&(i.rem=r),r=l.map((c,f)=>nt({index:f/(l.length-1||1),value:c,label:u(c)})),e.extra&&r.length&&r.push(nt({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function I$(e){P.call(this,null,e)}function rQ(){return nt({})}function sQ(e){const t=sl().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}te(I$,P,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||rQ,s=e.key||_e,o=this.value;return W(i.encode)&&(i.encode=null),o&&(e.modified("key")||t.modified(s))&&q("DataJoin does not support modified key function or fields."),o||(t=t.addAll(),this.value=o=sQ(s)),t.visit(t.ADD,a=>{const u=s(a);let l=o.get(u);l?l.exit?(o.empty--,i.add.push(l)):i.mod.push(l):(l=r(a),o.set(u,l),i.add.push(l)),l.datum=a,l.exit=!1}),t.visit(t.MOD,a=>{const u=s(a),l=o.get(u);l&&(l.datum=a,i.mod.push(l))}),t.visit(t.REM,a=>{const u=s(a),l=o.get(u);a===l.datum&&!l.exit&&(i.rem.push(l),l.exit=!0,++o.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&o.empty>n.cleanThreshold)&&n.runAfter(o.clean),i}});function P$(e){P.call(this,null,e)}te(P$,P,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,s=t.encode;if(W(s))if(n.changed()||s.every(f=>r[f]))s=s[0],n.encode=null;else return t.StopPropagation;var o=s==="enter",a=r.update||vo,u=r.enter||vo,l=r.exit||vo,c=(s&&!o?r[s]:a)||vo;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{u(f,e),a(f,e)}),n.modifies(u.output),n.modifies(a.output),c!==vo&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==vo&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),o||c!==vo){const f=t.MOD|(e.modified()?t.REFLOW:0);o?(t.visit(f,d=>{const h=u(d,e)||i;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)):t.visit(f,d=>{(c(d,e)||i)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function z$(e){P.call(this,[],e)}te(z$,P,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.type||sp,o=e.scale,a=+e.limit,u=t3(o,e.count==null?5:e.count,e.minstep),l=!!e.values||s===sp,c=e.format||Mk(n,o,u,s,e.formatSpecifier,e.formatType,l),f=e.values||Tk(o,u),d,h,p,g,m;return r&&(i.rem=r),s===sp?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,a-1),m=!0):r=f,Oe(p=e.size)?(!e.values&&o(r[0])===0&&(r=r.slice(1)),g=r.reduce((y,b)=>Math.max(y,p(b,e)),0)):p=kn(g=p||8),r=r.map((y,b)=>nt({index:b,label:c(y,b,r),value:y,offset:g,size:p(y,e)})),m&&(m=f[r.length],r.push(nt({index:r.length,label:`…${f.length-r.length} entries`,value:m,offset:g,size:p(m,e)})))):s===MX?(d=o.domain(),h=Ek(o,d[0],Ge(d)),f.length<3&&!e.values&&d[0]!==Ge(d)&&(f=[d[0],Ge(d)]),r=f.map((y,b)=>nt({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(p=f.length-1,h=qX(o),r=f.map((y,b)=>nt({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===p?1:h(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const oQ=e=>e.source.x,aQ=e=>e.source.y,uQ=e=>e.target.x,lQ=e=>e.target.y;function rv(e){P.call(this,{},e)}rv.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},te(rv,P,{transform(e,t){var n=e.sourceX||oQ,i=e.sourceY||aQ,r=e.targetX||uQ,s=e.targetY||lQ,o=e.as||"path",a=e.orient||"vertical",u=e.shape||"line",l=q$.get(u+"-"+a)||q$.get(u);return l||q("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[o]=l(n(c),i(c),r(c),s(c))}),t.reflow(e.modified()).modifies(o)}});const B$=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,cQ=(e,t,n,i)=>B$(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),U$=(e,t,n,i)=>{var r=n-e,s=i-t,o=Math.hypot(r,s)/2,a=180*Math.atan2(s,r)/Math.PI;return"M"+e+","+t+"A"+o+","+o+" "+a+" 0 1 "+n+","+i},fQ=(e,t,n,i)=>U$(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),j$=(e,t,n,i)=>{const r=n-e,s=i-t,o=.2*(r+s),a=.2*(s-r);return"M"+e+","+t+"C"+(e+o)+","+(t+a)+" "+(n+a)+","+(i-o)+" "+n+","+i},q$=sl({line:B$,"line-radial":cQ,arc:U$,"arc-radial":fQ,curve:j$,"curve-radial":(e,t,n,i)=>j$(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),"orthogonal-horizontal":(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,"orthogonal-vertical":(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,"orthogonal-radial":(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),u=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*s+"A"+t+","+t+" 0 0,"+(u?1:0)+" "+t*o+","+t*a+"L"+i*o+","+i*a},"diagonal-horizontal":(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},"diagonal-vertical":(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},"diagonal-radial":(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),u=(t+i)/2;return"M"+t*r+","+t*s+"C"+u*r+","+u*s+" "+u*o+","+u*a+" "+i*o+","+i*a}});function sv(e){P.call(this,null,e)}sv.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},te(sv,P,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],s=e.field||tl,o=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,u=t.source,l=u.map(s),c=l.length,f=o,d=(a-o)/m8(l),h=Ei(c),p,g,m;for(e.sort&&h.sort((y,b)=>l[y]-l[b]),p=0;p-1)return i;var r=t.domain,s=e.type,o=t.zero||t.zero===void 0&&hQ(e),a,u;if(!r)return 0;if((o||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(r=r.slice()).length-1||1,o&&(r[0]>0&&(r[0]=0),r[a]<0&&(r[a]=0)),t.domainMin!=null&&(r[0]=t.domainMin),t.domainMax!=null&&(r[a]=t.domainMax),t.domainMid!=null)){u=t.domainMid;const l=u>r[a]?a+1:ur+(s<0?-1:s>0?1:0),0));i!==t.length&&n.warn("Log scale domain includes zero: "+Q(t))}return t}function xQ(e,t,n){let i=t.bins;if(i&&!W(i)){const r=e.domain(),s=r[0],o=Ge(r),a=i.step;let u=i.start==null?s:i.start,l=i.stop==null?o:i.stop;a||q("Scale bins parameter missing step property."),uo&&(l=a*Math.floor(o/a)),i=Ei(u,l+a/2,a)}return i?e.bins=i:e.bins&&delete e.bins,e.type===Yb&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function _Q(e,t,n){var i=e.type,r=t.round||!1,s=t.range;if(t.rangeStep!=null)s=wQ(i,t,n);else if(t.scheme&&(s=EQ(i,t,n),Oe(s))){if(e.interpolator)return e.interpolator(s);q(`Scale type ${i} does not support interpolating color schemes.`)}if(s&&vk(i))return e.interpolator(rp(ov(s,t.reverse),t.interpolate,t.interpolateGamma));s&&t.interpolate&&e.interpolate?e.interpolate(Qb(t.interpolate,t.interpolateGamma)):Oe(e.round)?e.round(r):Oe(e.rangeRound)&&e.interpolate(r?kf:Lo),s&&e.range(ov(s,t.reverse))}function wQ(e,t,n){e!==fk&&e!==Vb&&q("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===Vb?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Hb(n,r,i)]}function EQ(e,t,n){var i=t.schemeExtent,r,s;return W(t.scheme)?s=rp(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),s=e3(r),s||q(`Unrecognized scheme name: ${t.scheme}`)),n=e===np?n+1:e===Yb?n-1:e===Fl||e===tp?+t.schemeCount||dQ:n,vk(e)?V$(s,i,t.reverse):Oe(s)?wk(V$(s,i),n):e===Gb?s:s.slice(0,n)}function V$(e,t,n){return Oe(e)&&(t||n)?_k(e,ov(t||[0,1],n)):e}function ov(e,t){return t?e.slice().reverse():e}function Y$(e){P.call(this,null,e)}te(Y$,P,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(Ta(e.sort)),this.modified(n),t}});const X$="zero",K$="center",Z$="normalize",J$=["y0","y1"];function av(e){P.call(this,null,e)}av.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:X$,values:[X$,K$,Z$]},{name:"as",type:"string",array:!0,length:2,default:J$}]},te(av,P,{transform(e,t){var n=e.as||J$,i=n[0],r=n[1],s=Ta(e.sort),o=e.field||tl,a=e.offset===K$?CQ:e.offset===Z$?kQ:AQ,u,l,c,f;for(u=$Q(t.source,e.groupby,s,o),l=0,c=u.length,f=u.max;lg(c),o,a,u,l,c,f,d,h,p;if(t==null)r.push(e.slice());else for(o={},a=0,u=e.length;ap&&(p=h),n&&d.sort(n)}return r.max=p,r}const SQ=Object.freeze(Object.defineProperty({__proto__:null,axisticks:L$,datajoin:I$,encode:P$,legendentries:z$,linkpath:rv,pie:sv,scale:H$,sortitems:Y$,stack:av},Symbol.toStringTag,{value:"Module"}));var ke=1e-6,Wp=1e-12,je=Math.PI,Mt=je/2,Hp=je/4,jn=je*2,It=180/je,ze=je/180,Ve=Math.abs,Bl=Math.atan,Yi=Math.atan2,Ae=Math.cos,Gp=Math.ceil,Q$=Math.exp,uv=Math.hypot,Vp=Math.log,lv=Math.pow,we=Math.sin,Xi=Math.sign||function(e){return e>0?1:e<0?-1:0},qn=Math.sqrt,cv=Math.tan;function eS(e){return e>1?0:e<-1?je:Math.acos(e)}function ui(e){return e>1?Mt:e<-1?-Mt:Math.asin(e)}function dn(){}function Yp(e,t){e&&nS.hasOwnProperty(e.type)&&nS[e.type](e,t)}var tS={Feature:function(e,t){Yp(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i=0?1:-1,r=i*n,s=Ae(t),o=we(t),a=pv*o,u=hv*s+a*Ae(r),l=a*i*we(r);Xp.add(Yi(l,u)),dv=e,hv=s,pv=o}function MQ(e){return Kp=new zn,js(e,is),Kp*2}function Zp(e){return[Yi(e[1],e[0]),ui(e[2])]}function Xa(e){var t=e[0],n=e[1],i=Ae(n);return[i*Ae(t),i*we(t),we(n)]}function Jp(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ul(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function gv(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Qp(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function eg(e){var t=qn(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var St,li,Nt,Si,Ka,aS,uS,jl,Kf,Ko,qs,Ws={point:mv,lineStart:cS,lineEnd:fS,polygonStart:function(){Ws.point=dS,Ws.lineStart=NQ,Ws.lineEnd=RQ,Kf=new zn,is.polygonStart()},polygonEnd:function(){is.polygonEnd(),Ws.point=mv,Ws.lineStart=cS,Ws.lineEnd=fS,Xp<0?(St=-(Nt=180),li=-(Si=90)):Kf>ke?Si=90:Kf<-ke&&(li=-90),qs[0]=St,qs[1]=Nt},sphere:function(){St=-(Nt=180),li=-(Si=90)}};function mv(e,t){Ko.push(qs=[St=e,Nt=e]),tSi&&(Si=t)}function lS(e,t){var n=Xa([e*ze,t*ze]);if(jl){var i=Ul(jl,n),r=[i[1],-i[0],0],s=Ul(r,i);eg(s),s=Zp(s);var o=e-Ka,a=o>0?1:-1,u=s[0]*It*a,l,c=Ve(o)>180;c^(a*KaSi&&(Si=l)):(u=(u+360)%360-180,c^(a*KaSi&&(Si=t))),c?eFi(St,Nt)&&(Nt=e):Fi(e,Nt)>Fi(St,Nt)&&(St=e):Nt>=St?(eNt&&(Nt=e)):e>Ka?Fi(St,e)>Fi(St,Nt)&&(Nt=e):Fi(e,Nt)>Fi(St,Nt)&&(St=e)}else Ko.push(qs=[St=e,Nt=e]);tSi&&(Si=t),jl=n,Ka=e}function cS(){Ws.point=lS}function fS(){qs[0]=St,qs[1]=Nt,Ws.point=mv,jl=null}function dS(e,t){if(jl){var n=e-Ka;Kf.add(Ve(n)>180?n+(n>0?360:-360):n)}else aS=e,uS=t;is.point(e,t),lS(e,t)}function NQ(){is.lineStart()}function RQ(){dS(aS,uS),is.lineEnd(),Ve(Kf)>ke&&(St=-(Nt=180)),qs[0]=St,qs[1]=Nt,jl=null}function Fi(e,t){return(t-=e)<0?t+360:t}function OQ(e,t){return e[0]-t[0]}function hS(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tFi(i[0],i[1])&&(i[1]=r[1]),Fi(r[0],i[1])>Fi(i[0],i[1])&&(i[0]=r[0])):s.push(i=r);for(o=-1/0,n=s.length-1,t=0,i=s[n];t<=n;i=r,++t)r=s[t],(a=Fi(i[1],r[0]))>o&&(o=a,St=r[0],Nt=i[1])}return Ko=qs=null,St===1/0||li===1/0?[[NaN,NaN],[NaN,NaN]]:[[St,li],[Nt,Si]]}var Zf,tg,ng,ig,rg,sg,og,ag,yv,bv,vv,pS,gS,Wn,Hn,Gn,br={sphere:dn,point:xv,lineStart:mS,lineEnd:yS,polygonStart:function(){br.lineStart=zQ,br.lineEnd=BQ},polygonEnd:function(){br.lineStart=mS,br.lineEnd=yS}};function xv(e,t){e*=ze,t*=ze;var n=Ae(t);Jf(n*Ae(e),n*we(e),we(t))}function Jf(e,t,n){++Zf,ng+=(e-ng)/Zf,ig+=(t-ig)/Zf,rg+=(n-rg)/Zf}function mS(){br.point=IQ}function IQ(e,t){e*=ze,t*=ze;var n=Ae(t);Wn=n*Ae(e),Hn=n*we(e),Gn=we(t),br.point=PQ,Jf(Wn,Hn,Gn)}function PQ(e,t){e*=ze,t*=ze;var n=Ae(t),i=n*Ae(e),r=n*we(e),s=we(t),o=Yi(qn((o=Hn*s-Gn*r)*o+(o=Gn*i-Wn*s)*o+(o=Wn*r-Hn*i)*o),Wn*i+Hn*r+Gn*s);tg+=o,sg+=o*(Wn+(Wn=i)),og+=o*(Hn+(Hn=r)),ag+=o*(Gn+(Gn=s)),Jf(Wn,Hn,Gn)}function yS(){br.point=xv}function zQ(){br.point=UQ}function BQ(){bS(pS,gS),br.point=xv}function UQ(e,t){pS=e,gS=t,e*=ze,t*=ze,br.point=bS;var n=Ae(t);Wn=n*Ae(e),Hn=n*we(e),Gn=we(t),Jf(Wn,Hn,Gn)}function bS(e,t){e*=ze,t*=ze;var n=Ae(t),i=n*Ae(e),r=n*we(e),s=we(t),o=Hn*s-Gn*r,a=Gn*i-Wn*s,u=Wn*r-Hn*i,l=uv(o,a,u),c=ui(l),f=l&&-c/l;yv.add(f*o),bv.add(f*a),vv.add(f*u),tg+=c,sg+=c*(Wn+(Wn=i)),og+=c*(Hn+(Hn=r)),ag+=c*(Gn+(Gn=s)),Jf(Wn,Hn,Gn)}function jQ(e){Zf=tg=ng=ig=rg=sg=og=ag=0,yv=new zn,bv=new zn,vv=new zn,js(e,br);var t=+yv,n=+bv,i=+vv,r=uv(t,n,i);return rje&&(e-=Math.round(e/jn)*jn),[e,t]}wv.invert=wv;function vS(e,t,n){return(e%=jn)?t||n?_v(_S(e),wS(t,n)):_S(e):t||n?wS(t,n):wv}function xS(e){return function(t,n){return t+=e,Ve(t)>je&&(t-=Math.round(t/jn)*jn),[t,n]}}function _S(e){var t=xS(e);return t.invert=xS(-e),t}function wS(e,t){var n=Ae(e),i=we(e),r=Ae(t),s=we(t);function o(a,u){var l=Ae(u),c=Ae(a)*l,f=we(a)*l,d=we(u),h=d*n+c*i;return[Yi(f*r-h*s,c*n-d*i),ui(h*r+f*s)]}return o.invert=function(a,u){var l=Ae(u),c=Ae(a)*l,f=we(a)*l,d=we(u),h=d*r-f*s;return[Yi(f*r+d*s,c*n+h*i),ui(h*n-c*i)]},o}function qQ(e){e=vS(e[0]*ze,e[1]*ze,e.length>2?e[2]*ze:0);function t(n){return n=e(n[0]*ze,n[1]*ze),n[0]*=It,n[1]*=It,n}return t.invert=function(n){return n=e.invert(n[0]*ze,n[1]*ze),n[0]*=It,n[1]*=It,n},t}function WQ(e,t,n,i,r,s){if(n){var o=Ae(t),a=we(t),u=i*n;r==null?(r=t+i*jn,s=t-u/2):(r=ES(o,r),s=ES(o,s),(i>0?rs)&&(r+=i*jn));for(var l,c=r;i>0?c>s:c1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function ug(e,t){return Ve(e[0]-t[0])=0;--a)r.point((f=c[a])[0],f[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,c=d.z,h=!h}while(!d.v);r.lineEnd()}}}function AS(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n=0?1:-1,S=k*C,$=S>je,O=m*E;if(u.add(Yi(O*k*we(S),y*w+O*Ae(S))),o+=$?C+k*jn:C,$^p>=n^x>=n){var R=Ul(Xa(h),Xa(v));eg(R);var D=Ul(s,R);eg(D);var A=($^C>=0?-1:1)*ui(D[2]);(i>A||i===A&&(R[0]||R[1]))&&(a+=$^C>=0?1:-1)}}return(o<-ke||o0){for(u||(r.polygonStart(),u=!0),r.lineStart(),E=0;E1&&x&2&&_.push(_.pop().concat(_.shift())),c.push(_.filter(GQ))}}return d}}function GQ(e){return e.length>1}function VQ(e,t){return((e=e.x)[0]<0?e[1]-Mt-ke:Mt-e[1])-((t=t.x)[0]<0?t[1]-Mt-ke:Mt-t[1])}const SS=$S(function(){return!0},YQ,KQ,[-je,-Mt]);function YQ(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(s,o){var a=s>0?je:-je,u=Ve(s-t);Ve(u-je)0?Mt:-Mt),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(s,n),r=0):i!==a&&u>=je&&(Ve(t-i)ke?Bl((we(t)*(s=Ae(i))*we(n)-we(i)*(r=Ae(t))*we(e))/(r*s*o)):(t+i)/2}function KQ(e,t,n,i){var r;if(e==null)r=n*Mt,i.point(-je,r),i.point(0,r),i.point(je,r),i.point(je,0),i.point(je,-r),i.point(0,-r),i.point(-je,-r),i.point(-je,0),i.point(-je,r);else if(Ve(e[0]-t[0])>ke){var s=e[0]0,r=Ve(t)>ke;function s(c,f,d,h){WQ(h,e,n,d,c,f)}function o(c,f){return Ae(c)*Ae(f)>t}function a(c){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,y){var b=[m,y],v,x=o(m,y),_=i?x?0:l(m,y):x?l(m+(m<0?je:-je),y):0;if(!f&&(p=h=x)&&c.lineStart(),x!==h&&(v=u(f,b),(!v||ug(f,v)||ug(b,v))&&(b[2]=1)),x!==h)g=0,x?(c.lineStart(),v=u(b,f),c.point(v[0],v[1])):(v=u(f,b),c.point(v[0],v[1],2),c.lineEnd()),f=v;else if(r&&f&&i^x){var E;!(_&d)&&(E=u(b,f,!0))&&(g=0,i?(c.lineStart(),c.point(E[0][0],E[0][1]),c.point(E[1][0],E[1][1]),c.lineEnd()):(c.point(E[1][0],E[1][1]),c.lineEnd(),c.lineStart(),c.point(E[0][0],E[0][1],3)))}x&&(!f||!ug(f,b))&&c.point(b[0],b[1]),f=b,h=x,d=_},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function u(c,f,d){var h=Xa(c),p=Xa(f),g=[1,0,0],m=Ul(h,p),y=Jp(m,m),b=m[0],v=y-b*b;if(!v)return!d&&c;var x=t*y/v,_=-t*b/v,E=Ul(g,m),w=Qp(g,x),C=Qp(m,_);gv(w,C);var k=E,S=Jp(w,k),$=Jp(k,k),O=S*S-$*(Jp(w,w)-1);if(!(O<0)){var R=qn(O),D=Qp(k,(-S-R)/$);if(gv(D,w),D=Zp(D),!d)return D;var A=c[0],T=f[0],B=c[1],G=f[1],z;T0^D[1]<(Ve(D[0]-A)je^(A<=D[0]&&D[0]<=T)){var Te=Qp(k,(-S+R)/$);return gv(Te,w),[D,Zp(Te)]}}}function l(c,f){var d=i?e:je-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return $S(o,a,s,i?[0,-e]:[-je,e-je])}function JQ(e,t,n,i,r,s){var o=e[0],a=e[1],u=t[0],l=t[1],c=0,f=1,d=u-o,h=l-a,p;if(p=n-o,!(!d&&p>0)){if(p/=d,d<0){if(p0){if(p>f)return;p>c&&(c=p)}if(p=r-o,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>c&&(c=p)}else if(d>0){if(p0)){if(p/=h,h<0){if(p0){if(p>f)return;p>c&&(c=p)}if(p=s-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p0&&(e[0]=o+c*d,e[1]=a+c*h),f<1&&(t[0]=o+f*d,t[1]=a+f*h),!0}}}}}var Qf=1e9,cg=-Qf;function FS(e,t,n,i){function r(l,c){return e<=l&&l<=n&&t<=c&&c<=i}function s(l,c,f,d){var h=0,p=0;if(l==null||(h=o(l,f))!==(p=o(c,f))||u(l,c)<0^f>0)do d.point(h===0||h===3?e:n,h>1?i:t);while((h=(h+f+4)%4)!==p);else d.point(c[0],c[1])}function o(l,c){return Ve(l[0]-e)0?0:3:Ve(l[0]-n)0?2:1:Ve(l[1]-t)0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var f=o(l,1),d=o(c,1);return f!==d?f-d:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=CS(),d,h,p,g,m,y,b,v,x,_,E,w={point:C,lineStart:O,lineEnd:R,polygonStart:S,polygonEnd:$};function C(A,T){r(A,T)&&c.point(A,T)}function k(){for(var A=0,T=0,B=h.length;Ti&&(ct-he)*(i-Te)>(Fe-Te)*(e-he)&&++A:Fe<=i&&(ct-he)*(i-Te)<(Fe-Te)*(e-he)&&--A;return A}function S(){c=f,d=[],h=[],E=!0}function $(){var A=k(),T=E&&A,B=(d=g8(d)).length;(T||B)&&(l.polygonStart(),T&&(l.lineStart(),s(null,null,1,l),l.lineEnd()),B&&kS(d,a,A,s,l),l.polygonEnd()),c=l,d=h=p=null}function O(){w.point=D,h&&h.push(p=[]),_=!0,x=!1,b=v=NaN}function R(){d&&(D(g,m),y&&x&&f.rejoin(),d.push(f.result())),w.point=C,x&&c.lineEnd()}function D(A,T){var B=r(A,T);if(h&&p.push([A,T]),_)g=A,m=T,y=B,_=!1,B&&(c.lineStart(),c.point(A,T));else if(B&&x)c.point(A,T);else{var G=[b=Math.max(cg,Math.min(Qf,b)),v=Math.max(cg,Math.min(Qf,v))],z=[A=Math.max(cg,Math.min(Qf,A)),T=Math.max(cg,Math.min(Qf,T))];JQ(G,z,e,t,n,i)?(x||(c.lineStart(),c.point(G[0],G[1])),c.point(z[0],z[1]),B||c.lineEnd(),E=!1):B&&(c.lineStart(),c.point(A,T),E=!1)}b=A,v=T,x=B}return w}}function DS(e,t,n){var i=Ei(e,t-ke,n).concat(t);return function(r){return i.map(function(s){return[r,s]})}}function TS(e,t,n){var i=Ei(e,t-ke,n).concat(t);return function(r){return i.map(function(s){return[s,r]})}}function QQ(){var e,t,n,i,r,s,o,a,u=10,l=u,c=90,f=360,d,h,p,g,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return Ei(Gp(i/c)*c,n,c).map(p).concat(Ei(Gp(a/f)*f,o,f).map(g)).concat(Ei(Gp(t/u)*u,e,u).filter(function(v){return Ve(v%c)>ke}).map(d)).concat(Ei(Gp(s/l)*l,r,l).filter(function(v){return Ve(v%f)>ke}).map(h))}return y.lines=function(){return b().map(function(v){return{type:"LineString",coordinates:v}})},y.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(g(o).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},y.extent=function(v){return arguments.length?y.extentMajor(v).extentMinor(v):y.extentMinor()},y.extentMajor=function(v){return arguments.length?(i=+v[0][0],n=+v[1][0],a=+v[0][1],o=+v[1][1],i>n&&(v=i,i=n,n=v),a>o&&(v=a,a=o,o=v),y.precision(m)):[[i,a],[n,o]]},y.extentMinor=function(v){return arguments.length?(t=+v[0][0],e=+v[1][0],s=+v[0][1],r=+v[1][1],t>e&&(v=t,t=e,e=v),s>r&&(v=s,s=r,r=v),y.precision(m)):[[t,s],[e,r]]},y.step=function(v){return arguments.length?y.stepMajor(v).stepMinor(v):y.stepMinor()},y.stepMajor=function(v){return arguments.length?(c=+v[0],f=+v[1],y):[c,f]},y.stepMinor=function(v){return arguments.length?(u=+v[0],l=+v[1],y):[u,l]},y.precision=function(v){return arguments.length?(m=+v,d=DS(s,r,90),h=TS(t,e,m),p=DS(a,o,90),g=TS(i,n,m),y):m},y.extentMajor([[-180,-90+ke],[180,90-ke]]).extentMinor([[-180,-80-ke],[180,80+ke]])}const ed=e=>e;var Cv=new zn,kv=new zn,MS,NS,Av,$v,Hs={point:dn,lineStart:dn,lineEnd:dn,polygonStart:function(){Hs.lineStart=eee,Hs.lineEnd=nee},polygonEnd:function(){Hs.lineStart=Hs.lineEnd=Hs.point=dn,Cv.add(Ve(kv)),kv=new zn},result:function(){var e=Cv/2;return Cv=new zn,e}};function eee(){Hs.point=tee}function tee(e,t){Hs.point=RS,MS=Av=e,NS=$v=t}function RS(e,t){kv.add($v*e-Av*t),Av=e,$v=t}function nee(){RS(MS,NS)}var ql=1/0,fg=ql,td=-ql,dg=td,hg={point:iee,lineStart:dn,lineEnd:dn,polygonStart:dn,polygonEnd:dn,result:function(){var e=[[ql,fg],[td,dg]];return td=dg=-(fg=ql=1/0),e}};function iee(e,t){etd&&(td=e),tdg&&(dg=t)}var Sv=0,Fv=0,nd=0,pg=0,gg=0,Wl=0,Dv=0,Tv=0,id=0,OS,LS,rs,ss,Ki={point:Za,lineStart:IS,lineEnd:PS,polygonStart:function(){Ki.lineStart=oee,Ki.lineEnd=aee},polygonEnd:function(){Ki.point=Za,Ki.lineStart=IS,Ki.lineEnd=PS},result:function(){var e=id?[Dv/id,Tv/id]:Wl?[pg/Wl,gg/Wl]:nd?[Sv/nd,Fv/nd]:[NaN,NaN];return Sv=Fv=nd=pg=gg=Wl=Dv=Tv=id=0,e}};function Za(e,t){Sv+=e,Fv+=t,++nd}function IS(){Ki.point=ree}function ree(e,t){Ki.point=see,Za(rs=e,ss=t)}function see(e,t){var n=e-rs,i=t-ss,r=qn(n*n+i*i);pg+=r*(rs+e)/2,gg+=r*(ss+t)/2,Wl+=r,Za(rs=e,ss=t)}function PS(){Ki.point=Za}function oee(){Ki.point=uee}function aee(){zS(OS,LS)}function uee(e,t){Ki.point=zS,Za(OS=rs=e,LS=ss=t)}function zS(e,t){var n=e-rs,i=t-ss,r=qn(n*n+i*i);pg+=r*(rs+e)/2,gg+=r*(ss+t)/2,Wl+=r,r=ss*e-rs*t,Dv+=r*(rs+e),Tv+=r*(ss+t),id+=r*3,Za(rs=e,ss=t)}function BS(e){this._context=e}BS.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,jn);break}}},result:dn};var Mv=new zn,Nv,US,jS,rd,sd,od={point:dn,lineStart:function(){od.point=lee},lineEnd:function(){Nv&&qS(US,jS),od.point=dn},polygonStart:function(){Nv=!0},polygonEnd:function(){Nv=null},result:function(){var e=+Mv;return Mv=new zn,e}};function lee(e,t){od.point=qS,US=rd=e,jS=sd=t}function qS(e,t){rd-=e,sd-=t,Mv.add(qn(rd*rd+sd*sd)),rd=e,sd=t}let WS,mg,HS,GS;class VS{constructor(t){this._append=t==null?YS:cee(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==HS||this._append!==mg){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,HS=i,mg=this._append,GS=this._,this._=r}this._+=GS;break}}}result(){const t=this._;return this._="",t.length?t:null}}function YS(e){let t=1;this._+=e[0];for(const n=e.length;t=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return YS;if(t!==WS){const n=10**t;WS=t,mg=function(r){let s=1;this._+=r[0];for(const o=r.length;s=0))throw new RangeError(`invalid digits: ${a}`);n=u}return t===null&&(s=new VS(n)),o},o.projection(e).digits(n).context(t)}function yg(e){return function(t){var n=new Rv;for(var i in e)n[i]=e[i];return n.stream=t,n}}function Rv(){}Rv.prototype={constructor:Rv,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Ov(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),js(n,e.stream(hg)),t(hg.result()),i!=null&&e.clipExtent(i),e}function bg(e,t,n){return Ov(e,function(i){var r=t[1][0]-t[0][0],s=t[1][1]-t[0][1],o=Math.min(r/(i[1][0]-i[0][0]),s/(i[1][1]-i[0][1])),a=+t[0][0]+(r-o*(i[1][0]+i[0][0]))/2,u=+t[0][1]+(s-o*(i[1][1]+i[0][1]))/2;e.scale(150*o).translate([a,u])},n)}function Lv(e,t,n){return bg(e,[[0,0],t],n)}function Iv(e,t,n){return Ov(e,function(i){var r=+t,s=r/(i[1][0]-i[0][0]),o=(r-s*(i[1][0]+i[0][0]))/2,a=-s*i[0][1];e.scale(150*s).translate([o,a])},n)}function Pv(e,t,n){return Ov(e,function(i){var r=+t,s=r/(i[1][1]-i[0][1]),o=-s*i[0][0],a=(r-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([o,a])},n)}var KS=16,fee=Ae(30*ze);function ZS(e,t){return+t?hee(e,t):dee(e)}function dee(e){return yg({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function hee(e,t){function n(i,r,s,o,a,u,l,c,f,d,h,p,g,m){var y=l-i,b=c-r,v=y*y+b*b;if(v>4*t&&g--){var x=o+d,_=a+h,E=u+p,w=qn(x*x+_*_+E*E),C=ui(E/=w),k=Ve(Ve(E)-1)t||Ve((y*R+b*D)/v-.5)>.3||o*d+a*h+u*p2?A[2]%360*ze:0,R()):[a*It,u*It,l*It]},$.angle=function(A){return arguments.length?(f=A%360*ze,R()):f*It},$.reflectX=function(A){return arguments.length?(d=A?-1:1,R()):d<0},$.reflectY=function(A){return arguments.length?(h=A?-1:1,R()):h<0},$.precision=function(A){return arguments.length?(E=ZS(w,_=A*A),D()):qn(_)},$.fitExtent=function(A,T){return bg($,A,T)},$.fitSize=function(A,T){return Lv($,A,T)},$.fitWidth=function(A,T){return Iv($,A,T)},$.fitHeight=function(A,T){return Pv($,A,T)};function R(){var A=JS(n,0,0,d,h,f).apply(null,t(s,o)),T=JS(n,i-A[0],r-A[1],d,h,f);return c=vS(a,u,l),w=_v(t,T),C=_v(c,w),E=ZS(w,_),D()}function D(){return k=S=null,$}return function(){return t=e.apply(this,arguments),$.invert=t.invert&&O,R()}}function zv(e){var t=0,n=je/3,i=QS(e),r=i(t,n);return r.parallels=function(s){return arguments.length?i(t=s[0]*ze,n=s[1]*ze):[t*It,n*It]},r}function yee(e){var t=Ae(e);function n(i,r){return[i*t,we(r)/t]}return n.invert=function(i,r){return[i/t,ui(r*t)]},n}function bee(e,t){var n=we(e),i=(n+we(t))/2;if(Ve(i)=.12&&m<.234&&g>=-.425&&g<-.214?r:m>=.166&&m<.234&&g>=-.214&&g<-.115?o:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=vee([n.stream(t=d),r.stream(d),o.stream(d)])},c.precision=function(d){return arguments.length?(n.precision(d),r.precision(d),o.precision(d),f()):n.precision()},c.scale=function(d){return arguments.length?(n.scale(d),r.scale(d*.35),o.scale(d),c.translate(n.translate())):n.scale()},c.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return i=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(l),s=r.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+ke,g+.12*h+ke],[p-.214*h-ke,g+.234*h-ke]]).stream(l),a=o.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+ke,g+.166*h+ke],[p-.115*h-ke,g+.234*h-ke]]).stream(l),f()},c.fitExtent=function(d,h){return bg(c,d,h)},c.fitSize=function(d,h){return Lv(c,d,h)},c.fitWidth=function(d,h){return Iv(c,d,h)},c.fitHeight=function(d,h){return Pv(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function tF(e){return function(t,n){var i=Ae(t),r=Ae(n),s=e(i*r);return s===1/0?[2,0]:[s*r*we(t),s*we(n)]}}function ad(e){return function(t,n){var i=qn(t*t+n*n),r=e(i),s=we(r),o=Ae(r);return[Yi(t*s,i*o),ui(i&&n*s/i)]}}var nF=tF(function(e){return qn(2/(1+e))});nF.invert=ad(function(e){return 2*ui(e/2)});function _ee(){return os(nF).scale(124.75).clipAngle(180-.001)}var iF=tF(function(e){return(e=eS(e))&&e/we(e)});iF.invert=ad(function(e){return e});function wee(){return os(iF).scale(79.4188).clipAngle(180-.001)}function xg(e,t){return[e,Vp(cv((Mt+t)/2))]}xg.invert=function(e,t){return[e,2*Bl(Q$(t))-Mt]};function Eee(){return rF(xg).scale(961/jn)}function rF(e){var t=os(e),n=t.center,i=t.scale,r=t.translate,s=t.clipExtent,o=null,a,u,l;t.scale=function(f){return arguments.length?(i(f),c()):i()},t.translate=function(f){return arguments.length?(r(f),c()):r()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?o=a=u=l=null:(o=+f[0][0],a=+f[0][1],u=+f[1][0],l=+f[1][1]),c()):o==null?null:[[o,a],[u,l]]};function c(){var f=je*i(),d=t(qQ(t.rotate()).invert([0,0]));return s(o==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===xg?[[Math.max(d[0]-f,o),a],[Math.min(d[0]+f,u),l]]:[[o,Math.max(d[1]-f,a)],[u,Math.min(d[1]+f,l)]])}return c()}function _g(e){return cv((Mt+e)/2)}function Cee(e,t){var n=Ae(e),i=e===t?we(e):Vp(n/Ae(t))/Vp(_g(t)/_g(e)),r=n*lv(_g(e),i)/i;if(!i)return xg;function s(o,a){r>0?a<-Mt+ke&&(a=-Mt+ke):a>Mt-ke&&(a=Mt-ke);var u=r/lv(_g(a),i);return[u*we(i*o),r-u*Ae(i*o)]}return s.invert=function(o,a){var u=r-a,l=Xi(i)*qn(o*o+u*u),c=Yi(o,Ve(u))*Xi(u);return u*i<0&&(c-=je*Xi(o)*Xi(u)),[c/i,2*Bl(lv(r/l,1/i))-Mt]},s}function kee(){return zv(Cee).scale(109.5).parallels([30,30])}function wg(e,t){return[e,t]}wg.invert=wg;function Aee(){return os(wg).scale(152.63)}function $ee(e,t){var n=Ae(e),i=e===t?we(e):(n-Ae(t))/(t-e),r=n/i+e;if(Ve(i)ke&&--i>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function Nee(){return os(aF).scale(175.295)}function uF(e,t){return[Ae(t)*we(e),we(t)]}uF.invert=ad(ui);function Ree(){return os(uF).scale(249.5).clipAngle(90+ke)}function lF(e,t){var n=Ae(t),i=1+Ae(e)*n;return[n*we(e)/i,we(t)/i]}lF.invert=ad(function(e){return 2*Bl(e)});function Oee(){return os(lF).scale(250).clipAngle(142)}function cF(e,t){return[Vp(cv((Mt+t)/2)),-e]}cF.invert=function(e,t){return[-t,2*Bl(Q$(e))-Mt]};function Lee(){var e=rF(cF),t=e.center,n=e.rotate;return e.center=function(i){return arguments.length?t([-i[1],i[0]]):(i=t(),[i[1],-i[0]])},e.rotate=function(i){return arguments.length?n([i[0],i[1],i.length>2?i[2]+90:90]):(i=n(),[i[0],i[1],i[2]-90])},n([0,0,90]).scale(159.155)}var Iee=Math.abs,Bv=Math.cos,Cg=Math.sin,Pee=1e-6,fF=Math.PI,Uv=fF/2,dF=zee(2);function hF(e){return e>1?Uv:e<-1?-Uv:Math.asin(e)}function zee(e){return e>0?Math.sqrt(e):0}function Bee(e,t){var n=e*Cg(t),i=30,r;do t-=r=(t+Cg(t)-n)/(1+Bv(t));while(Iee(r)>Pee&&--i>0);return t/2}function Uee(e,t,n){function i(r,s){return[e*r*Bv(s=Bee(n,s)),t*Cg(s)]}return i.invert=function(r,s){return s=hF(s/t),[r/(e*Bv(s)),hF((2*s+Cg(2*s))/n)]},i}var jee=Uee(dF/Uv,dF,fF);function qee(){return os(jee).scale(169.529)}const Wee=XS(),jv=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function Hee(e,t){return function n(){const i=t();return i.type=e,i.path=XS().projection(i),i.copy=i.copy||function(){const r=n();return jv.forEach(s=>{i[s]&&r[s](i[s]())}),r.path.pointRadius(i.path.pointRadius()),r},gk(i)}}function qv(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(kg[e]=Hee(e,t),this):kg[e]||null}function pF(e){return e&&e.path||Wee}const kg={albers:eF,albersusa:xee,azimuthalequalarea:_ee,azimuthalequidistant:wee,conicconformal:kee,conicequalarea:vg,conicequidistant:See,equalEarth:Dee,equirectangular:Aee,gnomonic:Tee,identity:Mee,mercator:Eee,mollweide:qee,naturalEarth1:Nee,orthographic:Ree,stereographic:Oee,transversemercator:Lee};for(const e in kg)qv(e,kg[e]);function Gee(){}const Gs=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function gF(){var e=1,t=1,n=a;function i(u,l){return l.map(c=>r(u,c))}function r(u,l){var c=[],f=[];return s(u,l,d=>{n(d,u,l),Vee(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=c.length,g;h=l,Gs[m<<1].forEach(v);++h=l,Gs[g|m<<1].forEach(v);for(Gs[m<<0].forEach(v);++p=l,y=u[p*e]>=l,Gs[m<<1|y<<2].forEach(v);++h=l,b=y,y=u[p*e+h+1]>=l,Gs[g|m<<1|y<<2|b<<3].forEach(v);Gs[m|y<<3].forEach(v)}for(h=-1,y=u[p*e]>=l,Gs[y<<2].forEach(v);++h=l,Gs[y<<2|b<<3].forEach(v);Gs[y<<3].forEach(v);function v(x){var _=[x[0][0]+h,x[0][1]+p],E=[x[1][0]+h,x[1][1]+p],w=o(_),C=o(E),k,S;(k=d[w])?(S=f[C])?(delete d[k.end],delete f[S.start],k===S?(k.ring.push(E),c(k.ring)):f[k.start]=d[S.end]={start:k.start,end:S.end,ring:k.ring.concat(S.ring)}):(delete d[k.end],k.ring.push(E),d[k.end=C]=k):(k=f[C])?(S=d[w])?(delete f[k.start],delete d[S.end],k===S?(k.ring.push(E),c(k.ring)):f[S.start]=d[k.end]={start:S.start,end:k.end,ring:S.ring.concat(k.ring)}):(delete f[k.start],k.ring.unshift(_),f[k.start=w]=k):f[w]=d[C]={start:w,end:C,ring:[_,E]}}}function o(u){return u[0]*2+u[1]*(e+1)*4}function a(u,l,c){u.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,y=l[g*e+p];d>0&&d0&&h=0&&c>=0||q("invalid size"),e=l,t=c,i},i.smooth=function(u){return arguments.length?(n=u?a:Gee,i):n===a},i}function Vee(e){for(var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++ti!=h>i&&n<(d-l)*(i-c)/(h-c)+l&&(r=-r)}return r}function Kee(e,t,n){var i;return Zee(e,t,n)&&Jee(e[i=+(e[0]===t[0])],n[i],t[i])}function Zee(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function Jee(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function mF(e,t,n){return function(i){var r=qr(i),s=n?Math.min(r[0],0):r[0],o=r[1],a=o-s,u=t?Co(s,o,e):a/(e+1);return Ei(s+u,o,u)}}function Wv(e){P.call(this,null,e)}Wv.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},te(Wv,P,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||En,s=gF().smooth(e.smooth!==!1),o=e.thresholds||Qee(i,r,e),a=e.as===null?null:e.as||"contour",u=[];return i.forEach(l=>{const c=r(l),f=s.size([c.width,c.height])(c.values,W(o)?o:o(c.values));ete(f,c,l,e),f.forEach(d=>{u.push(b0(l,nt(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function Qee(e,t,n){const i=mF(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>Aa(t(r).values)))}function ete(e,t,n,i){let r=i.scale||t.scale,s=i.translate||t.translate;if(Oe(r)&&(r=r(n,i)),Oe(s)&&(s=s(n,i)),(r===1||r==null)&&!s)return;const o=(Ze(r)?r:r[0])||1,a=(Ze(r)?r:r[1])||1,u=s&&s[0]||0,l=s&&s[1]||0;e.forEach(yF(t,o,a,u,l))}function yF(e,t,n,i,r){const s=e.x1||0,o=e.y1||0,a=t*n<0;function u(f){f.forEach(l)}function l(f){a&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-s)*t+i,f[1]=(f[1]-o)*n+r}return function(f){return f.coordinates.forEach(u),f}}function bF(e,t,n){const i=e>=0?e:vy(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function Hv(e){return Oe(e)?e:kn(+e)}function vF(){var e=u=>u[0],t=u=>u[1],n=tl,i=[-1,-1],r=960,s=500,o=2;function a(u,l){const c=bF(i[0],u,e)>>o,f=bF(i[1],u,t)>>o,d=c?c+2:0,h=f?f+2:0,p=2*d+(r>>o),g=2*h+(s>>o),m=new Float32Array(p*g),y=new Float32Array(p*g);let b=m;u.forEach(x=>{const _=d+(+e(x)>>o),E=h+(+t(x)>>o);_>=0&&_=0&&E0&&f>0?(Hl(p,g,m,y,c),Gl(p,g,y,m,f),Hl(p,g,m,y,c),Gl(p,g,y,m,f),Hl(p,g,m,y,c),Gl(p,g,y,m,f)):c>0?(Hl(p,g,m,y,c),Hl(p,g,y,m,c),Hl(p,g,m,y,c),b=y):f>0&&(Gl(p,g,m,y,f),Gl(p,g,y,m,f),Gl(p,g,m,y,f),b=y);const v=l?Math.pow(2,-2*o):1/m8(b);for(let x=0,_=p*g;x<_;++x)b[x]*=v;return{values:b,scale:1<>o),y2:h+(s>>o)}}return a.x=function(u){return arguments.length?(e=Hv(u),a):e},a.y=function(u){return arguments.length?(t=Hv(u),a):t},a.weight=function(u){return arguments.length?(n=Hv(u),a):n},a.size=function(u){if(!arguments.length)return[r,s];var l=+u[0],c=+u[1];return l>=0&&c>=0||q("invalid size"),r=l,s=c,a},a.cellSize=function(u){return arguments.length?((u=+u)>=1||q("invalid cell size"),o=Math.floor(Math.log(u)/Math.LN2),a):1<=r&&(a>=s&&(u-=n[a-s+o*e]),i[a-r+o*e]=u/Math.min(a+1,e-1+s-a,s))}function Gl(e,t,n,i,r){const s=(r<<1)+1;for(let o=0;o=r&&(a>=s&&(u-=n[o+(a-s)*e]),i[o+(a-r)*e]=u/Math.min(a+1,t-1+s-a,s))}function Gv(e){P.call(this,null,e)}Gv.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const tte=["x","y","weight","size","cellSize","bandwidth"];function xF(e,t){return tte.forEach(n=>t[n]!=null?e[n](t[n]):0),e}te(Gv,P,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=nte(i,e.groupby),s=(e.groupby||[]).map(Tt),o=xF(vF(),e),a=e.as||"grid",u=[];function l(c,f){for(let d=0;dnt(l({[a]:o(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function nte(e,t){var n=[],i=c=>c(a),r,s,o,a,u,l;if(t==null)n.push(e);else for(r={},s=0,o=e.length;sn.push(a(c))),s&&o&&(t.visit(u,c=>{var f=s(c),d=o(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&i.push([f,d])}),n=n.concat({type:Yv,geometry:{type:ite,coordinates:i}})),this.value={type:Xv,features:n}}});function Zv(e){P.call(this,null,e)}Zv.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},te(Zv,P,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||En,s=e.as||"path",o=n.SOURCE;!i||e.modified()?(this.value=i=pF(e.projection),n.materialize().reflow()):o=r===En||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=rte(i,e.pointRadius);return n.visit(o,u=>u[s]=i(r(u))),i.pointRadius(a),n.modifies(s)}});function rte(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function Jv(e){P.call(this,null,e)}Jv.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},te(Jv,P,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],s=e.as||["x","y"],o=s[0],a=s[1],u;function l(c){const f=n([i(c),r(c)]);f?(c[o]=f[0],c[a]=f[1]):(c[o]=void 0,c[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(u=t.modified(i.fields)||t.modified(r.fields),t.visit(u?t.ADD_MOD:t.ADD,l)),t.modifies(s)}});function Qv(e){P.call(this,null,e)}Qv.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},te(Qv,P,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",s=n.ADD;return(!i||e.modified())&&(this.value=i=ste(pF(e.projection),e.field||Bi("datum"),e.pointRadius),n.materialize().reflow(),s=n.SOURCE),n.visit(s,o=>o[r]=i),n.modifies(r)}});function ste(e,t,n){const i=n==null?r=>e(t(r)):r=>{var s=e.pointRadius(),o=e.pointRadius(n)(t(r));return e.pointRadius(s),o};return i.context=r=>(e.context(r),i),i}function e7(e){P.call(this,[],e),this.generator=QQ()}e7.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},te(e7,P,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const s in e)Oe(i[s])&&i[s](e[s]);return r=i(),n.length?t.mod.push(ME(n[0],r)):t.add.push(nt(r)),n[0]=r,t}});function t7(e){P.call(this,null,e)}t7.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},te(t7,P,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||En,s=ate(e.opacity,e),o=ote(e.color,e),a=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?Aa(n.map(l=>Aa(r(l).values))):0};return n.forEach(l=>{const c=r(l),f=Le({},l,u);i||(f.$max=Aa(c.values||[])),l[a]=ute(c,f,o.dep?o:kn(o(f)),s.dep?s:kn(s(f)))}),t.reflow(!0).modifies(a)}});function ote(e,t){let n;return Oe(e)?(n=i=>Oo(e(i,t)),n.dep=_F(e)):n=kn(Oo(e||"#888")),n}function ate(e,t){let n;return Oe(e)?(n=i=>e(i,t),n.dep=_F(e)):e?n=kn(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function _F(e){if(!Oe(e))return!1;const t=lr(wn(e));return t.$x||t.$y||t.$value||t.$max}function ute(e,t,n,i){const r=e.width,s=e.height,o=e.x1||0,a=e.y1||0,u=e.x2||r,l=e.y2||s,c=e.values,f=c?m=>c[m]:bo,d=Mo(u-o,l-a),h=d.getContext("2d"),p=h.getImageData(0,0,u-o,l-a),g=p.data;for(let m=a,y=0;m{e[i]!=null&&EF(n,i,e[i])})):jv.forEach(i=>{e.modified(i)&&EF(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&<e(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function lte(e,t){const n=fte(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function cte(e){const t=qv((e||"mercator").toLowerCase());return t||q("Unrecognized projection type: "+e),t()}function EF(e,t,n){Oe(e[t])&&e[t](n)}function fte(e){return e=oe(e),e.length===1?e[0]:{type:Xv,features:e.reduce((t,n)=>t.concat(dte(n)),[])}}function dte(e){return e.type===Xv?e.features:oe(e).filter(t=>t!=null).map(t=>t.type===Yv?t:{type:Yv,geometry:t})}const hte=Object.freeze(Object.defineProperty({__proto__:null,contour:Vv,geojson:Kv,geopath:Zv,geopoint:Jv,geoshape:Qv,graticule:e7,heatmap:t7,isocontour:Wv,kde2d:Gv,projection:wF},Symbol.toStringTag,{value:"Module"}));function pte(e,t){var n,i=1;e==null&&(e=0),t==null&&(t=0);function r(){var s,o=n.length,a,u=0,l=0;for(s=0;s=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d,r=s,!(s=s[y=m<<1|g]))return r[y]=o,e;if(h=+e._x.call(null,s.data),p=+e._y.call(null,s.data),t===h&&n===p)return o.next=s,r?r[y]=o:e._root=o,e;do r=r?r[y]=new Array(4):e._root=new Array(4),(g=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d;while((y=m<<1|g)===(b=(p>=d)<<1|h>=f));return r[b]=s,r[y]=o,e}function mte(e){var t,n,i=e.length,r,s,o=new Array(i),a=new Array(i),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;nc&&(c=r),sf&&(f=s));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;ne||e>=r||i>t||t>=s;)switch(l=(tc||(a=p.y0)>f||(u=p.x1)=y)<<1|e>=m)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var b=e-+this._x.call(null,h.data),v=t-+this._y.call(null,h.data),x=b*b+v*v;if(x=(d=(o+u)/2))?o=d:u=d,(g=f>=(h=(a+l)/2))?a=h:l=h,t=n,!(n=n[m=g<<1|p]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(i=t,y=m)}for(;n.data!==e;)if(r=n,!(n=n.next))return this;return(s=n.next)&&delete n.next,r?(s?r.next=s:delete r.next,this):t?(s?t[m]=s:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(i?i[y]=n:this._root=n),this):(this._root=s,this)}function wte(e){for(var t=0,n=e.length;td.index){var $=h-C.x-C.vx,O=p-C.y-C.vy,R=$*$+O*O;Rh+S||Ep+S||wl.r&&(l.r=l[c].r)}function u(){if(t){var l,c=t.length,f;for(n=new Array(c),l=0;l[t(_,E,o),_])),x;for(m=0,a=new Array(y);m{}};function $F(){for(var e=0,t=arguments.length,n={},i;e=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Ag.prototype=$F.prototype={constructor:Ag,on:function(e,t){var n=this._,i=Ite(e+"",n),r,s=-1,o=i.length;if(arguments.length<2){for(;++s0)for(var n=new Array(r),i=0,r,s;i=0&&e._call.call(void 0,t),e=e._next;--Vl}function MF(){Ja=(Sg=gd.now())+Fg,Vl=dd=0;try{Bte()}finally{Vl=0,jte(),Ja=0}}function Ute(){var e=gd.now(),t=e-Sg;t>FF&&(Fg-=t,Sg=e)}function jte(){for(var e,t=$g,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:$g=n);pd=e,s7(i)}function s7(e){if(!Vl){dd&&(dd=clearTimeout(dd));var t=e-Ja;t>24?(e<1/0&&(dd=setTimeout(MF,e-gd.now()-Fg)),hd&&(hd=clearInterval(hd))):(hd||(Sg=gd.now(),hd=setInterval(Ute,FF)),Vl=1,DF(MF))}}function qte(e,t,n){var i=new Dg,r=t;return t==null?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(s,o,a){o=+o,a=a==null?r7():+a,i._restart(function u(l){l+=r,i._restart(u,r+=o,a),s(l)},o,a)},i.restart(e,t,n),i)}const Wte=1664525,Hte=1013904223,NF=4294967296;function Gte(){let e=1;return()=>(e=(Wte*e+Hte)%NF)/NF}function Vte(e){return e.x}function Yte(e){return e.y}var Xte=10,Kte=Math.PI*(3-Math.sqrt(5));function Zte(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),s=0,o=.6,a=new Map,u=TF(f),l=$F("tick","end"),c=Gte();e==null&&(e=[]);function f(){d(),l.call("tick",t),n1?(m==null?a.delete(g):a.set(g,p(m)),t):a.get(g)},find:function(g,m,y){var b=0,v=e.length,x,_,E,w,C;for(y==null?y=1/0:y*=y,b=0;b1?(l.on(g,m),t):l.on(g)}}}function Jte(){var e,t,n,i,r=Xn(-30),s,o=1,a=1/0,u=.81;function l(h){var p,g=e.length,m=n7(e,Vte,Yte).visitAfter(f);for(i=h,p=0;p=a)return;(h.data!==t||h.next)&&(y===0&&(y=Zo(n),x+=y*y),b===0&&(b=Zo(n),x+=b*b),x=0;)n.tick();else if(n.stopped()&&n.restart(),!i)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,u=0,l=a.length,c;ue.touch(t).run()}function ine(e,t){const n=Zte(e),i=n.stop,r=n.restart;let s=!1;return n.stopped=()=>s,n.restart=()=>(s=!1,r()),n.stop=()=>(s=!0,i()),LF(n,t,!0).on("end",()=>s=!0)}function LF(e,t,n,i){var r=oe(t.forces),s,o,a,u;for(s=0,o=o7.length;st(i,n):t)}const ane=Object.freeze(Object.defineProperty({__proto__:null,force:a7},Symbol.toStringTag,{value:"Module"}));function une(e,t){return e.parent===t.parent?1:2}function lne(e){return e.reduce(cne,0)/e.length}function cne(e,t){return e+t.x}function fne(e){return 1+e.reduce(dne,0)}function dne(e,t){return Math.max(e,t.y)}function hne(e){for(var t;t=e.children;)e=t[0];return e}function pne(e){for(var t;t=e.children;)e=t[t.length-1];return e}function gne(){var e=une,t=1,n=1,i=!1;function r(s){var o,a=0;s.eachAfter(function(d){var h=d.children;h?(d.x=lne(h),d.y=fne(h)):(d.x=o?a+=e(d,o):0,d.y=0,o=d)});var u=hne(s),l=pne(s),c=u.x-e(u,l)/2,f=l.x+e(l,u)/2;return s.eachAfter(i?function(d){d.x=(d.x-s.x)*t,d.y=(s.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(s.y?d.y/s.y:1))*n})}return r.separation=function(s){return arguments.length?(e=s,r):e},r.size=function(s){return arguments.length?(i=!1,t=+s[0],n=+s[1],r):i?null:[t,n]},r.nodeSize=function(s){return arguments.length?(i=!0,t=+s[0],n=+s[1],r):i?[t,n]:null},r}function mne(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function yne(){return this.eachAfter(mne)}function bne(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function vne(e,t){for(var n=this,i=[n],r,s,o=-1;n=i.pop();)if(e.call(t,n,++o,this),r=n.children)for(s=r.length-1;s>=0;--s)i.push(r[s]);return this}function xne(e,t){for(var n=this,i=[n],r=[],s,o,a,u=-1;n=i.pop();)if(r.push(n),s=n.children)for(o=0,a=s.length;o=0;)n+=i[r].value;t.value=n})}function Ene(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Cne(e){for(var t=this,n=kne(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function kne(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function Ane(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function $ne(){return Array.from(this)}function Sne(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Fne(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Dne(){var e=this,t,n=[e],i,r,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,s=i.length;r=0;--a)r.push(s=o[a]=new Yl(o[a])),s.parent=i,s.depth=i.depth+1;return n.eachBefore(IF)}function Tne(){return u7(this).eachBefore(Rne)}function Mne(e){return e.children}function Nne(e){return Array.isArray(e)?e[1]:null}function Rne(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function IF(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Yl(e){this.data=e,this.depth=this.height=0,this.parent=null}Yl.prototype=u7.prototype={constructor:Yl,count:yne,each:bne,eachAfter:xne,eachBefore:vne,find:_ne,sum:wne,sort:Ene,path:Cne,ancestors:Ane,descendants:$ne,leaves:Sne,links:Fne,copy:Tne,[Symbol.iterator]:Dne};function Tg(e){return e==null?null:PF(e)}function PF(e){if(typeof e!="function")throw new Error;return e}function Qa(){return 0}function Xl(e){return function(){return e}}const One=1664525,Lne=1013904223,zF=4294967296;function Ine(){let e=1;return()=>(e=(One*e+Lne)%zF)/zF}function Pne(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function zne(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function Bne(e,t){for(var n=0,i=(e=zne(Array.from(e),t)).length,r=[],s,o;n0&&n*n>i*i+r*r}function l7(e,t){for(var n=0;n1e-6?($+Math.sqrt($*$-4*S*O))/(2*S):O/$);return{x:i+E+w*R,y:r+C+k*R,r:R}}function jF(e,t,n){var i=e.x-t.x,r,s,o=e.y-t.y,a,u,l=i*i+o*o;l?(s=t.r+n.r,s*=s,u=e.r+n.r,u*=u,s>u?(r=(l+u-s)/(2*l),a=Math.sqrt(Math.max(0,u/l-r*r)),n.x=e.x-r*i-a*o,n.y=e.y-r*o+a*i):(r=(l+s-u)/(2*l),a=Math.sqrt(Math.max(0,s/l-r*r)),n.x=t.x+r*i-a*o,n.y=t.y+r*o+a*i)):(n.x=t.x+n.r,n.y=t.y)}function qF(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function WF(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,s=(t.y*n.r+n.y*t.r)/i;return r*r+s*s}function Ng(e){this._=e,this.next=null,this.previous=null}function Wne(e,t){if(!(s=(e=Pne(e)).length))return 0;var n,i,r,s,o,a,u,l,c,f,d;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(s>2))return n.r+i.r;jF(i,n,r=e[2]),n=new Ng(n),i=new Ng(i),r=new Ng(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(u=3;uZne(n(x,_,r))),b=y.map(KF),v=new Set(y).add("");for(const x of b)v.has(x)||(v.add(x),y.push(x),b.push(KF(x)),s.push(f7));o=(x,_)=>y[_],a=(x,_)=>b[_]}for(c=0,u=s.length;c=0&&(h=s[y],h.data===f7);--y)h.data=null}if(f.parent=Yne,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(IF),f.parent=null,u>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(e=Tg(r),i):e},i.parentId=function(r){return arguments.length?(t=Tg(r),i):t},i.path=function(r){return arguments.length?(n=Tg(r),i):n},i}function Zne(e){e=`${e}`;let t=e.length;return d7(e,t-1)&&!d7(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function KF(e){let t=e.length;if(t<2)return"";for(;--t>1&&!d7(e,t););return e.slice(0,t)}function d7(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function Jne(e,t){return e.parent===t.parent?1:2}function h7(e){var t=e.children;return t?t[0]:e.t}function p7(e){var t=e.children;return t?t[t.length-1]:e.t}function Qne(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function eie(e){for(var t=0,n=0,i=e.children,r=i.length,s;--r>=0;)s=i[r],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function tie(e,t,n){return e.a.parent===t.parent?e.a:n}function Rg(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Rg.prototype=Object.create(Yl.prototype);function nie(e){for(var t=new Rg(e,0),n,i=[t],r,s,o,a;n=i.pop();)if(s=n._.children)for(n.children=new Array(a=s.length),o=a-1;o>=0;--o)i.push(r=n.children[o]=new Rg(s[o],o)),r.parent=n;return(t.parent=new Rg(null,0)).children=[t],t}function iie(){var e=Jne,t=1,n=1,i=null;function r(l){var c=nie(l);if(c.eachAfter(s),c.parent.m=-c.z,c.eachBefore(o),i)l.eachBefore(u);else{var f=l,d=l,h=l;l.eachBefore(function(b){b.xd.x&&(d=b),b.depth>h.depth&&(h=b)});var p=f===d?1:e(f,d)/2,g=p-f.x,m=t/(d.x+p+g),y=n/(h.depth||1);l.eachBefore(function(b){b.x=(b.x+g)*m,b.y=b.depth*y})}return l}function s(l){var c=l.children,f=l.parent.children,d=l.i?f[l.i-1]:null;if(c){eie(l);var h=(c[0].z+c[c.length-1].z)/2;d?(l.z=d.z+e(l._,d._),l.m=l.z-h):l.z=h}else d&&(l.z=d.z+e(l._,d._));l.parent.A=a(l,d,l.parent.A||f[0])}function o(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function a(l,c,f){if(c){for(var d=l,h=l,p=c,g=d.parent.children[0],m=d.m,y=h.m,b=p.m,v=g.m,x;p=p7(p),d=h7(d),p&&d;)g=h7(g),h=p7(h),h.a=l,x=p.z+b-d.z-m+e(p._,d._),x>0&&(Qne(tie(p,l,f),l,x),m+=x,y+=x),b+=p.m,m+=d.m,v+=g.m,y+=h.m;p&&!p7(h)&&(h.t=p,h.m+=b-y),d&&!h7(g)&&(g.t=d,g.m+=m-v,f=l)}return f}function u(l){l.x*=t,l.y=l.depth*n}return r.separation=function(l){return arguments.length?(e=l,r):e},r.size=function(l){return arguments.length?(i=!1,t=+l[0],n=+l[1],r):i?null:[t,n]},r.nodeSize=function(l){return arguments.length?(i=!0,t=+l[0],n=+l[1],r):i?[t,n]:null},r}function Og(e,t,n,i,r){for(var s=e.children,o,a=-1,u=s.length,l=e.value&&(r-n)/e.value;++ab&&(b=l),E=m*m*_,v=Math.max(b/E,E/y),v>x){m-=l;break}x=v}o.push(u={value:m,dice:h1?i:1)},n}(ZF);function rie(){var e=QF,t=!1,n=1,i=1,r=[0],s=Qa,o=Qa,a=Qa,u=Qa,l=Qa;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(f),r=[0],t&&d.eachBefore(VF),d}function f(d){var h=r[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,y=d.y1-h;m=d-1){var b=s[f];b.x0=p,b.y0=g,b.x1=m,b.y1=y;return}for(var v=l[f],x=h/2+v,_=f+1,E=d-1;_>>1;l[w]y-g){var S=h?(p*k+m*C)/h:m;c(f,_,C,p,g,S,y),c(_,d,k,S,g,m,y)}else{var $=h?(g*k+y*C)/h:y;c(f,_,C,p,g,m,$),c(_,d,k,p,$,m,y)}}}function oie(e,t,n,i,r){(e.depth&1?Og:bd)(e,t,n,i,r)}const aie=function e(t){function n(i,r,s,o,a){if((u=i._squarify)&&u.ratio===t)for(var u,l,c,f,d=-1,h,p=u.length,g=i.value;++d1?i:1)},n}(ZF);function g7(e,t,n){const i={};return e.each(r=>{const s=r.data;n(s)&&(i[t(s)]=r)}),e.lookup=i,e}function m7(e){P.call(this,null,e)}m7.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const uie=e=>e.values;te(m7,P,{transform(e,t){t.source||q("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),s=this.value;return(!s||i||t.changed())&&(s&&s.each(o=>{o.children&&y0(o.data)&&r.rem.push(o.data)}),this.value=s=u7({values:oe(e.keys).reduce((o,a)=>(o.key(a),o),lie()).entries(r.source)},uie),n&&s.each(o=>{o.children&&(o=nt(o.data),r.add.push(o),r.source.push(o))}),g7(s,_e,_e)),r.source.root=s,r}});function lie(){const e=[],t={entries:r=>i(n(r,0),0),key:r=>(e.push(r),t)};function n(r,s){if(s>=e.length)return r;const o=r.length,a=e[s++],u={},l={};let c=-1,f,d,h;for(;++ce.length)return r;const o=[];for(const a in r)o.push({key:a,values:i(r[a],s)});return o}return t}function Vs(e){P.call(this,null,e)}const cie=(e,t)=>e.parent===t.parent?1:2;te(Vs,P,{transform(e,t){(!t.source||!t.source.root)&&q(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,s=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(Ta(e.sort,o=>o.data)),fie(n,this.params,e),n.separation&&n.separation(e.separation!==!1?cie:tl);try{this.value=n(r)}catch(o){q(o)}return r.each(o=>die(o,i,s)),t.reflow(e.modified()).modifies(s).modifies("leaf")}});function fie(e,t,n){for(let i,r=0,s=t.length;rs[_e(o)]=1),i.each(o=>{const a=o.data,u=o.parent&&o.parent.data;u&&s[_e(a)]&&s[_e(u)]&&r.add.push(nt({source:u,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,o=>s[_e(o)]=1),n.forEach(o=>{(s[_e(o.source)]||s[_e(o.target)])&&r.mod.push(o)})),r}});const tD={binary:sie,dice:bd,slice:Og,slicedice:oie,squarify:QF,resquarify:aie},k7=["x0","y0","x1","y1","depth","children"];function A7(e){Vs.call(this,e)}A7.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:k7.length,default:k7}]},te(A7,Vs,{layout(){const e=rie();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{ue(tD,t)?e.tile(tD[t]):q("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:k7});const hie=Object.freeze(Object.defineProperty({__proto__:null,nest:m7,pack:b7,partition:x7,stratify:_7,tree:E7,treelinks:C7,treemap:A7},Symbol.toStringTag,{value:"Module"})),$7=4278190080;function pie(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function gie(e,t,n,i,r){const s=e.width,o=e.height,a=i||r,u=Mo(s,o).getContext("2d"),l=Mo(s,o).getContext("2d"),c=a&&Mo(s,o).getContext("2d");n.forEach(C=>Lg(u,C,!1)),Lg(l,t,!1),a&&Lg(c,t,!0);const f=S7(u,s,o),d=S7(l,s,o),h=a&&S7(c,s,o),p=e.bitmap(),g=a&&e.bitmap();let m,y,b,v,x,_,E,w;for(y=0;y{r.items.forEach(s=>Lg(e,s.items,n))}):$i[i].draw(e,{items:n?t.map(mie):t})}function mie(e){const t=b0(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const Ys=5,Kn=31,vd=32,Jo=new Uint32Array(vd+1),vr=new Uint32Array(vd+1);vr[0]=0,Jo[0]=~vr[0];for(let e=1;e<=vd;++e)vr[e]=vr[e-1]<<1|1,Jo[e]=~vr[e];function yie(e,t){const n=new Uint32Array(~~((e*t+vd)/vd));function i(s,o){n[s]|=o}function r(s,o){n[s]&=o}return{array:n,get:(s,o)=>{const a=o*e+s;return n[a>>>Ys]&1<<(a&Kn)},set:(s,o)=>{const a=o*e+s;i(a>>>Ys,1<<(a&Kn))},clear:(s,o)=>{const a=o*e+s;r(a>>>Ys,~(1<<(a&Kn)))},getRange:(s,o,a,u)=>{let l=u,c,f,d,h;for(;l>=o;--l)if(c=l*e+s,f=l*e+a,d=c>>>Ys,h=f>>>Ys,d===h){if(n[d]&Jo[c&Kn]&vr[(f&Kn)+1])return!0}else{if(n[d]&Jo[c&Kn]||n[h]&vr[(f&Kn)+1])return!0;for(let p=d+1;p{let l,c,f,d,h;for(;o<=u;++o)if(l=o*e+s,c=o*e+a,f=l>>>Ys,d=c>>>Ys,f===d)i(f,Jo[l&Kn]&vr[(c&Kn)+1]);else for(i(f,Jo[l&Kn]),i(d,vr[(c&Kn)+1]),h=f+1;h{let l,c,f,d,h;for(;o<=u;++o)if(l=o*e+s,c=o*e+a,f=l>>>Ys,d=c>>>Ys,f===d)r(f,vr[l&Kn]|Jo[(c&Kn)+1]);else for(r(f,vr[l&Kn]),r(d,Jo[(c&Kn)+1]),h=f+1;hs<0||o<0||u>=t||a>=e}}function bie(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),s=~~((t+2*n+i)/i),o=a=>~~((a+n)/i);return o.invert=a=>a*i-n,o.bitmap=()=>yie(r,s),o.ratio=i,o.padding=n,o.width=e,o.height=t,o}function vie(e,t,n,i){const r=e.width,s=e.height;return function(o){const a=o.datum.datum.items[i].items,u=a.length,l=o.datum.fontSize,c=Ai.width(o.datum,o.datum.text);let f=0,d,h,p,g,m,y,b;for(let v=0;v=f&&(f=b,o.x=m,o.y=y);return m=c/2,y=l/2,d=o.x-m,h=o.x+m,p=o.y-y,g=o.y+y,o.align="center",d<0&&h<=r?o.align="left":0<=d&&rr||t-(o=i/2)<0||t+o>s}function Qo(e,t,n,i,r,s,o,a){const u=r*s/(i*2),l=e(t-u),c=e(t+u),f=e(n-(s=s/2)),d=e(n+s);return o.outOfBounds(l,f,c,d)||o.getRange(l,f,c,d)||a&&a.getRange(l,f,c,d)}function xie(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1];function u(l,c,f,d,h){const p=e.invert(l),g=e.invert(c);let m=f,y=s,b;if(!Ig(p,g,d,h,r,s)&&!Qo(e,p,g,h,d,m,o,a)&&!Qo(e,p,g,h,d,h,o,null)){for(;y-m>=1;)b=(m+y)/2,Qo(e,p,g,h,d,b,o,a)?y=b:m=b;if(m>f)return[p,g,m,!0]}}return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Ai.width(l.datum,l.datum.text);let p=n?d:0,g=!1,m=!1,y=0,b,v,x,_,E,w,C,k,S,$,O,R,D,A,T,B,G;for(let z=0;zv&&(G=b,b=v,v=G),x>_&&(G=x,x=_,_=G),S=e(b),O=e(v),$=~~((S+O)/2),R=e(x),A=e(_),D=~~((R+A)/2),C=$;C>=S;--C)for(k=D;k>=R;--k)B=u(C,k,p,h,d),B&&([l.x,l.y,p,g]=B);for(C=$;C<=O;++C)for(k=D;k<=A;++k)B=u(C,k,p,h,d),B&&([l.x,l.y,p,g]=B);!g&&!n&&(T=Math.abs(v-b+_-x),E=(b+v)/2,w=(x+_)/2,T>=y&&!Ig(E,w,h,d,r,s)&&!Qo(e,E,w,d,h,d,o,null)&&(y=T,l.x=E,l.y=w,m=!0))}return g||m?(E=h/2,w=d/2,o.setRange(e(l.x-E),e(l.y-w),e(l.x+E),e(l.y+w)),l.align="center",l.baseline="middle",!0):!1}}const _ie=[-1,-1,1,1],wie=[-1,1,-1,1];function Eie(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],u=e.bitmap();return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Ai.width(l.datum,l.datum.text),p=[];let g=n?d:0,m=!1,y=!1,b=0,v,x,_,E,w,C,k,S,$,O,R,D;for(let A=0;A=1;)R=($+O)/2,Qo(e,w,C,d,h,R,o,a)?O=R:$=R;$>g&&(l.x=w,l.y=C,g=$,m=!0)}}!m&&!n&&(D=Math.abs(x-v+E-_),w=(v+x)/2,C=(_+E)/2,D>=b&&!Ig(w,C,h,d,r,s)&&!Qo(e,w,C,d,h,d,o,null)&&(b=D,l.x=w,l.y=C,y=!0))}return m||y?(w=h/2,C=d/2,o.setRange(e(l.x-w),e(l.y-C),e(l.x+w),e(l.y+C)),l.align="center",l.baseline="middle",!0):!1}}const Cie=["right","center","left"],kie=["bottom","middle","top"];function Aie(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],u=i.length;return function(l){const c=l.boundary,f=l.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>s)return!1;let d=l.textWidth??0,h,p,g,m,y,b,v,x,_,E,w,C,k,S,$;for(let O=0;O>>2&3)-1,g=h===0&&p===0||i[O]<0,m=h&&p?Math.SQRT1_2:1,y=i[O]<0?-1:1,b=c[1+h]+i[O]*h*m,w=c[4+p]+y*f*p/2+i[O]*p*m,x=w-f/2,_=w+f/2,C=e(b),S=e(x),$=e(_),!d)if(nD(C,C,S,$,o,a,b,b,x,_,c,g))d=Ai.width(l.datum,l.datum.text);else continue;if(E=b+y*d*h/2,b=E-d/2,v=E+d/2,C=e(b),k=e(v),nD(C,k,S,$,o,a,b,v,x,_,c,g))return l.x=h?h*y<0?v:b:E,l.y=p?p*y<0?_:x:w,l.align=Cie[h*y+1],l.baseline=kie[p*y+1],o.setRange(C,S,k,$),!0}return!1}}function nD(e,t,n,i,r,s,o,a,u,l,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&s||r).getRange(e,n,t,i))}const F7=0,D7=4,T7=8,M7=0,N7=1,R7=2,$ie={"top-left":F7+M7,top:F7+N7,"top-right":F7+R7,left:D7+M7,middle:D7+N7,right:D7+R7,"bottom-left":T7+M7,bottom:T7+N7,"bottom-right":T7+R7},Sie={naive:vie,"reduced-search":xie,floodfill:Eie};function Fie(e,t,n,i,r,s,o,a,u,l,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=Die(i,f),h=Tie(r,f),p=Mie(e[0].datum),g=p==="group"&&e[0].datum.items[u].marktype,m=g==="area",y=Nie(p,g,a,u),b=l===null||l===1/0,v=m&&c==="naive";let x=-1,_=-1;const E=e.map(S=>{const $=b?Ai.width(S,S.text):void 0;return x=Math.max(x,$),_=Math.max(_,S.fontSize),{datum:S,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(S),textWidth:$}});l=l===null||l===1/0?Math.max(x,_)+Math.max(...i):l;const w=bie(t[0],t[1],l);let C;if(!v){n&&E.sort((O,R)=>n(O.datum,R.datum));let S=!1;for(let O=0;OO.datum);C=s.length||$?gie(w,$||[],s,S,m):pie(w,o&&E)}const k=m?Sie[c](w,C,o,u):Aie(w,C,h,d);return E.forEach(S=>S.opacity=+k(S)),E}function Die(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r[s.x,s.x,s.x,s.y,s.y,s.y];return e?e==="line"||e==="area"?s=>r(s.datum):t==="line"?s=>{const o=s.datum.items[i].items;return r(o.length?o[n==="start"?0:o.length-1]:{x:NaN,y:NaN})}:s=>{const o=s.datum.bounds;return[o.x1,(o.x1+o.x2)/2,o.x2,o.y1,(o.y1+o.y2)/2,o.y2]}:r}const O7=["x","y","opacity","align","baseline"],iD=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function L7(e){P.call(this,null,e)}L7.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:iD},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:O7.length,default:O7}]},te(L7,P,{transform(e,t){function n(s){const o=e[s];return Oe(o)&&t.modified(o.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&q("Size parameter should be specified as a [width, height] array.");const r=e.as||O7;return Fie(t.materialize(t.SOURCE).source||[],e.size,e.sort,oe(e.offset==null?1:e.offset),oe(e.anchor||iD),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(s=>{const o=s.datum;o[r[0]]=s.x,o[r[1]]=s.y,o[r[2]]=s.opacity,o[r[3]]=s.align,o[r[4]]=s.baseline}),t.reflow(i).modifies(r)}});const Rie=Object.freeze(Object.defineProperty({__proto__:null,label:L7},Symbol.toStringTag,{value:"Module"}));function rD(e,t){var n=[],i=function(c){return c(a)},r,s,o,a,u,l;if(t==null)n.push(e);else for(r={},s=0,o=e.length;s{r9(l,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;de==="poly"?t:e==="quad"?2:1;function z7(e){P.call(this,null,e)}z7.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(P7)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]},te(z7,P,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=rD(i,e.groupby),s=(e.groupby||[]).map(Tt),o=e.method||"linear",a=e.order==null?3:e.order,u=Oie(o,a),l=e.as||[Tt(e.x),Tt(e.y)],c=P7[o],f=[];let d=e.extent;ue(P7,o)||q("Invalid regression method: "+o),d!=null&&o==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),r.forEach(h=>{if(h.length<=u){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=c(h,e.x,e.y,a);if(e.params){f.push(nt({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||qr(h,e.x),y=b=>{const v={};for(let x=0;xy([b,g.predict(b)])):S0(g.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const Lie=Object.freeze(Object.defineProperty({__proto__:null,loess:I7,regression:z7},Symbol.toStringTag,{value:"Module"})),Xs=11102230246251565e-32,Mn=134217729,Iie=(3+8*Xs)*Xs;function B7(e,t,n,i,r){let s,o,a,u,l=t[0],c=i[0],f=0,d=0;c>l==c>-l?(s=l,l=t[++f]):(s=c,c=i[++d]);let h=0;if(fl==c>-l?(o=l+s,a=s-(o-l),l=t[++f]):(o=c+s,a=s-(o-c),c=i[++d]),s=o,a!==0&&(r[h++]=a);fl==c>-l?(o=s+l,u=o-s,a=s-(o-u)+(l-u),l=t[++f]):(o=s+c,u=o-s,a=s-(o-u)+(c-u),c=i[++d]),s=o,a!==0&&(r[h++]=a);for(;f=D||-R>=D||(f=e-k,a=e-(k+f)+(f-r),f=n-S,l=n-(S+f)+(f-r),f=t-$,u=t-($+f)+(f-s),f=i-O,c=i-(O+f)+(f-s),a===0&&u===0&&l===0&&c===0)||(D=Uie*o+Iie*Math.abs(R),R+=k*c+O*a-($*l+S*u),R>=D||-R>=D))return R;x=a*O,d=Mn*a,h=d-(d-a),p=a-h,d=Mn*O,g=d-(d-O),m=O-g,_=p*m-(x-h*g-p*g-h*m),E=u*S,d=Mn*u,h=d-(d-u),p=u-h,d=Mn*S,g=d-(d-S),m=S-g,w=p*m-(E-h*g-p*g-h*m),y=_-w,f=_-y,Zn[0]=_-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-E,f=v-y,Zn[1]=v-(y+f)+(f-E),C=b+y,f=C-b,Zn[2]=b-(C-f)+(y-f),Zn[3]=C;const A=B7(4,Kl,4,Zn,sD);x=k*c,d=Mn*k,h=d-(d-k),p=k-h,d=Mn*c,g=d-(d-c),m=c-g,_=p*m-(x-h*g-p*g-h*m),E=$*l,d=Mn*$,h=d-(d-$),p=$-h,d=Mn*l,g=d-(d-l),m=l-g,w=p*m-(E-h*g-p*g-h*m),y=_-w,f=_-y,Zn[0]=_-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-E,f=v-y,Zn[1]=v-(y+f)+(f-E),C=b+y,f=C-b,Zn[2]=b-(C-f)+(y-f),Zn[3]=C;const T=B7(A,sD,4,Zn,oD);x=a*c,d=Mn*a,h=d-(d-a),p=a-h,d=Mn*c,g=d-(d-c),m=c-g,_=p*m-(x-h*g-p*g-h*m),E=u*l,d=Mn*u,h=d-(d-u),p=u-h,d=Mn*l,g=d-(d-l),m=l-g,w=p*m-(E-h*g-p*g-h*m),y=_-w,f=_-y,Zn[0]=_-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-E,f=v-y,Zn[1]=v-(y+f)+(f-E),C=b+y,f=C-b,Zn[2]=b-(C-f)+(y-f),Zn[3]=C;const B=B7(T,oD,4,Zn,aD);return aD[B-1]}function Pg(e,t,n,i,r,s){const o=(t-s)*(n-r),a=(e-r)*(i-s),u=o-a,l=Math.abs(o+a);return Math.abs(u)>=zie*l?u:-jie(e,t,n,i,r,s,l)}const uD=Math.pow(2,-52),zg=new Uint32Array(512);class Bg{static from(t,n=Vie,i=Yie){const r=t.length,s=new Float64Array(r*2);for(let o=0;o>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const i=Math.max(2*n-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:i,_hullTri:r,_hullHash:s}=this,o=t.length>>1;let a=1/0,u=1/0,l=-1/0,c=-1/0;for(let k=0;kl&&(l=S),$>c&&(c=$),this._ids[k]=k}const f=(a+l)/2,d=(u+c)/2;let h,p,g;for(let k=0,S=1/0;k0&&(p=k,S=$)}let b=t[2*p],v=t[2*p+1],x=1/0;for(let k=0;kO&&(k[S++]=R,O=D)}this.hull=k.subarray(0,S),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Pg(m,y,b,v,_,E)<0){const k=p,S=b,$=v;p=g,b=_,v=E,g=k,_=S,E=$}const w=Gie(m,y,b,v,_,E);this._cx=w.x,this._cy=w.y;for(let k=0;k0&&Math.abs(R-S)<=uD&&Math.abs(D-$)<=uD||(S=R,$=D,O===h||O===p||O===g))continue;let A=0;for(let ie=0,be=this._hashKey(R,D);ie=0;)if(T=B,T===A){T=-1;break}if(T===-1)continue;let G=this._addTriangle(T,O,i[T],-1,-1,r[T]);r[O]=this._legalize(G+2),r[T]=G,C++;let z=i[T];for(;B=i[z],Pg(R,D,t[2*z],t[2*z+1],t[2*B],t[2*B+1])<0;)G=this._addTriangle(z,O,B,r[O],-1,r[z]),r[O]=this._legalize(G+2),i[z]=z,C--,z=B;if(T===A)for(;B=n[T],Pg(R,D,t[2*B],t[2*B+1],t[2*T],t[2*T+1])<0;)G=this._addTriangle(B,O,T,-1,r[T],r[B]),this._legalize(G+2),r[B]=G,i[T]=T,C--,T=B;this._hullStart=n[O]=T,i[T]=n[z]=O,i[O]=z,s[this._hashKey(R,D)]=O,s[this._hashKey(t[2*T],t[2*T+1])]=T}this.hull=new Uint32Array(C);for(let k=0,S=this._hullStart;k0?3-n:1+n)/4}function U7(e,t,n,i){const r=e-n,s=t-i;return r*r+s*s}function Wie(e,t,n,i,r,s,o,a){const u=e-o,l=t-a,c=n-o,f=i-a,d=r-o,h=s-a,p=u*u+l*l,g=c*c+f*f,m=d*d+h*h;return u*(f*m-g*h)-l*(c*m-g*d)+p*(c*h-f*d)<0}function Hie(e,t,n,i,r,s){const o=n-e,a=i-t,u=r-e,l=s-t,c=o*o+a*a,f=u*u+l*l,d=.5/(o*l-a*u),h=(l*c-a*f)*d,p=(o*f-u*c)*d;return h*h+p*p}function Gie(e,t,n,i,r,s){const o=n-e,a=i-t,u=r-e,l=s-t,c=o*o+a*a,f=u*u+l*l,d=.5/(o*l-a*u),h=e+(l*c-a*f)*d,p=t+(o*f-u*c)*d;return{x:h,y:p}}function Zl(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const s=e[r],o=t[s];let a=r-1;for(;a>=n&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=s}else{const r=n+i>>1;let s=n+1,o=i;_d(e,r,s),t[e[n]]>t[e[i]]&&_d(e,n,i),t[e[s]]>t[e[i]]&&_d(e,s,i),t[e[n]]>t[e[s]]&&_d(e,n,s);const a=e[s],u=t[a];for(;;){do s++;while(t[e[s]]u);if(o=o-n?(Zl(e,t,s,i),Zl(e,t,n,o-1)):(Zl(e,t,n,o-1),Zl(e,t,s,i))}}function _d(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function Vie(e){return e[0]}function Yie(e){return e[1]}const lD=1e-6;class eu{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,i){t=+t,n=+n,i=+i;const r=t+i,s=n;if(i<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${s}`:(Math.abs(this._x1-r)>lD||Math.abs(this._y1-s)>lD)&&(this._+="L"+r+","+s),i&&(this._+=`A${i},${i},0,1,1,${t-i},${n}A${i},${i},0,1,1,${this._x1=r},${this._y1=s}`)}rect(t,n,i,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+i}v${+r}h${-i}Z`}value(){return this._||null}}class j7{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}let Xie=class{constructor(t,[n,i,r,s]=[0,0,960,500]){if(!((r=+r)>=(n=+n))||!((s=+s)>=(i=+i)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=r,this.xmin=n,this.ymax=s,this.ymin=i,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:i},vectors:r}=this;let s,o;const a=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let g=0,m=0,y=i.length,b,v;g1;)s-=2;for(let o=2;o0){if(n>=this.ymax)return null;(o=(this.ymax-n)/r)0){if(t>=this.xmax)return null;(o=(this.xmax-t)/i)this.xmax?2:0)|(nthis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n1e-10)return!1}return!0}function ere(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class q7{static from(t,n=Zie,i=Jie,r){return new q7("length"in t?tre(t,n,i,r):Float64Array.from(nre(t,n,i,r)))}constructor(t){this._delaunator=new Bg(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&Qie(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,r.length===2&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new Xie(this,t)}*neighbors(t){const{inedges:n,hull:i,_hullIndex:r,halfedges:s,triangles:o,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f=0&&s!==i&&s!==r;)i=s;return s}_step(t,n,i){const{inedges:r,hull:s,_hullIndex:o,halfedges:a,triangles:u,points:l}=this;if(r[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,f=Jl(n-l[t*2],2)+Jl(i-l[t*2+1],2);const d=r[t];let h=d;do{let p=u[h];const g=Jl(n-l[p*2],2)+Jl(i-l[p*2+1],2);if(g>5)*e[1]),m=null,y=l.length,b=-1,v=[],x=l.map(E=>({text:t(E),font:n(E),style:r(E),weight:s(E),rotate:o(E),size:~~(i(E)+1e-14),padding:a(E),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:E})).sort((E,w)=>w.size-E.size);++b>1,_.y=e[1]*(c()+.5)>>1,ure(p,_,x,b),_.hasText&&h(g,_,m)&&(v.push(_),m?cre(m,_):m=[{x:_.x+_.x0,y:_.y+_.y0},{x:_.x+_.x1,y:_.y+_.y1}],_.x-=e[0]>>1,_.y-=e[1]>>1)}return v};function d(p){p.width=p.height=1;var g=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(wd<<5)/g,p.height=Ug/g;var m=p.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function h(p,g,m){for(var y=g.x,b=g.y,v=Math.hypot(e[0],e[1]),x=u(e),_=c()<.5?1:-1,E=-_,w,C,k;(w=x(E+=_))&&(C=~~w[0],k=~~w[1],!(Math.min(Math.abs(C),Math.abs(k))>=v));)if(g.x=y+C,g.y=b+k,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!m||!lre(g,p,e[0]))&&(!m||fre(g,m))){for(var S=g.sprite,$=g.width>>5,O=e[0]>>5,R=g.x-($<<4),D=R&127,A=32-D,T=g.y1-g.y0,B=(g.y+g.y0)*O+(R>>5),G,z=0;z>>D:0);B+=O}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(l=p,f):l},f.size=function(p){return arguments.length?(e=[+p[0],+p[1]],f):e},f.font=function(p){return arguments.length?(n=tu(p),f):n},f.fontStyle=function(p){return arguments.length?(r=tu(p),f):r},f.fontWeight=function(p){return arguments.length?(s=tu(p),f):s},f.rotate=function(p){return arguments.length?(o=tu(p),f):o},f.text=function(p){return arguments.length?(t=tu(p),f):t},f.spiral=function(p){return arguments.length?(u=pre[p]||p,f):u},f.fontSize=function(p){return arguments.length?(i=tu(p),f):i},f.padding=function(p){return arguments.length?(a=tu(p),f):a},f.random=function(p){return arguments.length?(c=p,f):c},f}function ure(e,t,n,i){if(!t.sprite){var r=e.context,s=e.ratio;r.clearRect(0,0,(wd<<5)/s,Ug/s);var o=0,a=0,u=0,l=n.length,c,f,d,h,p;for(--i;++i>5<<5,d=~~Math.max(Math.abs(b+v),Math.abs(b-v))}else c=c+31>>5<<5;if(d>u&&(u=d),o+c>=wd<<5&&(o=0,a+=u,u=0),a+d>=Ug)break;r.translate((o+(c>>1))/s,(a+(d>>1))/s),t.rotate&&r.rotate(t.rotate*H7),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=c,t.height=d,t.xoff=o,t.yoff=a,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,o+=c}for(var _=r.getImageData(0,0,(wd<<5)/s,Ug/s).data,E=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h>5),S=_[(a+p)*(wd<<5)+(o+h)<<2]?1<<31-h%32:0;E[k]|=S,w|=S}w?C=p:(t.y0++,d--,p--,a++)}t.y1=t.y0+C,t.sprite=E.slice(0,(t.y1-t.y0)*f)}}}function lre(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,s=e.x-(r<<4),o=s&127,a=32-o,u=e.y1-e.y0,l=(e.y+e.y0)*n+(s>>5),c,f=0;f>>o:0))&t[l+d])return!0;l+=n}return!1}function cre(e,t){var n=e[0],i=e[1];t.x+t.x0i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function fre(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0g(p(m))}r.forEach(p=>{p[o[0]]=NaN,p[o[1]]=NaN,p[o[3]]=0});const l=s.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(Wi).layout(),c=s.size(),f=c[0]>>1,d=c[1]>>1,h=l.length;for(let p=0,g,m;pnew Uint8Array(e),bre=e=>new Uint16Array(e),Ed=e=>new Uint32Array(e);function vre(){let e=8,t=[],n=Ed(0),i=jg(0,e),r=jg(0,e);return{data:()=>t,seen:()=>n=xre(n,t.length),add(s){for(let o=0,a=t.length,u=s.length,l;ot.length,curr:()=>i,prev:()=>r,reset:s=>r[s]=i[s],all:()=>e<257?255:e<65537?65535:4294967295,set(s,o){i[s]|=o},clear(s,o){i[s]&=~o},resize(s,o){const a=i.length;(s>a||o>e)&&(e=Math.max(o,e),i=jg(s,e,i),r=jg(s,e))}}}function xre(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function jg(e,t,n){const i=(t<257?yre:t<65537?bre:Ed)(e);return n&&i.set(n),i}function dD(e,t,n){const i=1<0)for(m=0;me,size:()=>n}}function _re(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],s=e[i];return rs?1:0}),Iq(e,t)}function wre(e,t,n,i,r,s,o,a,u){let l=0,c=0,f;for(f=0;lt.modified(i.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},s=this._dims=[],o=i.length;let a=0,u,l;for(;a{const s=r.remove(t,n);for(const o in i)i[o].reindex(s)})},update(e,t,n){const i=this._dims,r=e.query,s=t.stamp,o=i.length;let a=0,u,l;for(n.filters=0,l=0;lh)for(m=h,y=Math.min(f,p);mp)for(m=Math.max(f,p),y=d;mf)for(p=f,g=Math.min(l,d);pd)for(p=Math.max(l,d),g=c;pa[c]&n?null:o[c];return s.filter(s.MOD,l),r&r-1?(s.filter(s.ADD,c=>{const f=a[c]&n;return!f&&f^u[c]&n?o[c]:null}),s.filter(s.REM,c=>{const f=a[c]&n;return f&&!(f^(f^u[c]&n))?o[c]:null})):(s.filter(s.ADD,l),s.filter(s.REM,c=>(a[c]&n)===r?o[c]:null)),s.filter(s.SOURCE,c=>l(c._index))}});const Ere=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:V7,resolvefilter:Y7},Symbol.toStringTag,{value:"Module"})),Cre="RawCode",nu="Literal",kre="Property",Are="Identifier",$re="ArrayExpression",Sre="BinaryExpression",pD="CallExpression",Fre="ConditionalExpression",Dre="LogicalExpression",Tre="MemberExpression",Mre="ObjectExpression",Nre="UnaryExpression";function xr(e){this.type=e}xr.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=Rre(this),n=0,i=t.length;n",as[iu]="Identifier",as[ea]="Keyword",as[Wg]="Null",as[ru]="Numeric",as[ci]="Punctuator",as[kd]="String",as[Ore]="RegularExpression";var Lre="ArrayExpression",Ire="BinaryExpression",Pre="CallExpression",zre="ConditionalExpression",gD="Identifier",Bre="Literal",Ure="LogicalExpression",jre="MemberExpression",qre="ObjectExpression",Wre="Property",Hre="UnaryExpression",en="Unexpected token %0",Gre="Unexpected number",Vre="Unexpected string",Yre="Unexpected identifier",Xre="Unexpected reserved word",Kre="Unexpected end of input",X7="Invalid regular expression",K7="Invalid regular expression: missing /",mD="Octal literals are not allowed in strict mode.",Zre="Duplicate data property in object literal not allowed in strict mode",hn="ILLEGAL",Ad="Disabled.",Jre=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),Qre=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function Hg(e,t){if(!e)throw new Error("ASSERT: "+t)}function Ks(e){return e>=48&&e<=57}function Z7(e){return"0123456789abcdefABCDEF".includes(e)}function $d(e){return"01234567".includes(e)}function ese(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function Sd(e){return e===10||e===13||e===8232||e===8233}function Fd(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&Jre.test(String.fromCharCode(e))}function Gg(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&Qre.test(String.fromCharCode(e))}const tse={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function yD(){for(;U1114111||e!=="}")&&et({},en,hn),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function bD(){var e,t;for(e=pe.charCodeAt(U++),t=String.fromCharCode(e),e===92&&(pe.charCodeAt(U)!==117&&et({},en,hn),++U,e=J7("u"),(!e||e==="\\"||!Fd(e.charCodeAt(0)))&&et({},en,hn),t=e);U>>=")return U+=4,{type:ci,value:o,start:e,end:U};if(s=o.substr(0,3),s===">>>"||s==="<<="||s===">>=")return U+=3,{type:ci,value:s,start:e,end:U};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return U+=2,{type:ci,value:r,start:e,end:U};if(r==="//"&&et({},en,hn),"<>=!+-*%&|^/".includes(i))return++U,{type:ci,value:i,start:e,end:U};et({},en,hn)}function sse(e){let t="";for(;U1)i=Rq(e,t,n);else for(r=0,i=new Array(s=e.arcs.length);rt?1:e>=t?0:NaN}function Oq(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function al(e){let t,n,i;e.length!==2?(t=Ds,n=(a,u)=>Ds(e(a),u),i=(a,u)=>e(a)-u):(t=e===Ds||e===Oq?e:Lq,n=e,i=e);function r(a,u,l=0,c=a.length){if(l>>1;n(a[f],u)<0?l=f+1:c=f}while(l>>1;n(a[f],u)<=0?l=f+1:c=f}while(ll&&i(a[f-1],u)>-i(a[f],u)?f-1:f}return{left:r,center:o,right:s}}function Lq(){return 0}function s8(e){return e===null?NaN:+e}function*Iq(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(i=+i)>=i&&(yield i)}}const o8=al(Ds),Eo=o8.right,Pq=o8.left;al(s8).center;function zq(e,t){let n=0,i,r=0,s=0;if(t===void 0)for(let o of e)o!=null&&(o=+o)>=o&&(i=o-r,r+=i/++n,s+=i*(o-r));else{let o=-1;for(let a of e)(a=t(a,++o,e))!=null&&(a=+a)>=a&&(i=a-r,r+=i/++n,s+=i*(a-r))}if(n>1)return s/(n-1)}function Bq(e,t){const n=zq(e,t);return n&&Math.sqrt(n)}class zn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let i=0;for(let r=0;r0){for(o=t[--n];n>0&&(i=o,r=t[--n],o=i+r,s=r-(o-i),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(r=s*2,i=o+r,r==i-o&&(o=i))}return o}}class a8 extends Map{constructor(t,n=c8){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[i,r]of t)this.set(i,r)}get(t){return super.get(O2(this,t))}has(t){return super.has(O2(this,t))}set(t,n){return super.set(u8(this,t),n)}delete(t){return super.delete(l8(this,t))}}class Qh extends Set{constructor(t,n=c8){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const i of t)this.add(i)}has(t){return super.has(O2(this,t))}add(t){return super.add(u8(this,t))}delete(t){return super.delete(l8(this,t))}}function O2({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function u8({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function l8({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function c8(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Uq(e,t){return Array.from(t,n=>e[n])}function jq(e=Ds){if(e===Ds)return f8;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function f8(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const qq=Math.sqrt(50),Wq=Math.sqrt(10),Hq=Math.sqrt(2);function e0(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),s=i/Math.pow(10,r),o=s>=qq?10:s>=Wq?5:s>=Hq?2:1;let a,u,l;return r<0?(l=Math.pow(10,-r)/o,a=Math.round(e*l),u=Math.round(t*l),a/lt&&--u,l=-l):(l=Math.pow(10,r)*o,a=Math.round(e/l),u=Math.round(t/l),a*lt&&--u),u0))return[];if(e===t)return[e];const i=t=r))return[];const a=s-r+1,u=new Array(a);if(i)if(o<0)for(let l=0;l=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n=r)&&(n=r)}return n}function P2(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function d8(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?f8:jq(r);i>n;){if(i-n>600){const u=i-n+1,l=t-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),h=Math.max(n,Math.floor(t-l*f/u+d)),p=Math.min(i,Math.floor(t+(u-l)*f/u+d));d8(e,t,h,p,r)}const s=e[t];let o=n,a=i;for(Zc(e,n,t),r(e[i],s)>0&&Zc(e,n,i);o0;)--a}r(e[n],s)===0?Zc(e,n,a):(++a,Zc(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}return e}function Zc(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function z2(e,t,n){if(e=Float64Array.from(Iq(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return P2(e);if(t>=1)return Aa(e);var i,r=(i-1)*t,s=Math.floor(r),o=Aa(d8(e,s).subarray(0,s+1)),a=P2(e.subarray(s+1));return o+(a-o)*(r-s)}}function h8(e,t,n=s8){if(!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,s=Math.floor(r),o=+n(e[s],s,e),a=+n(e[s+1],s+1,e);return o+(a-o)*(r-s)}}function Gq(e,t){let n=0,i=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(++n,i+=r);else{let r=-1;for(let s of e)(s=t(s,++r,e))!=null&&(s=+s)>=s&&(++n,i+=s)}if(n)return i/n}function p8(e,t){return z2(e,.5,t)}function*Vq(e){for(const t of e)yield*t}function g8(e){return Array.from(Vq(e))}function Ei(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(r);++i=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function t0(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function ul(e){return e=t0(Math.abs(e)),e?e[1]:NaN}function Jq(e,t){return function(n,i){for(var r=n.length,s=[],o=0,a=e[0],u=0;r>0&&a>0&&(u+a+1>i&&(a=Math.max(1,i-u)),s.push(n.substring(r-=a,r+a)),!((u+=a+1)>i));)a=e[o=(o+1)%e.length];return s.reverse().join(t)}}function Qq(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var eW=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $a(e){if(!(t=eW.exec(e)))throw new Error("invalid format: "+e);var t;return new B2({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}$a.prototype=B2.prototype;function B2(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}B2.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function tW(e){e:for(var t=e.length,n=1,i=-1,r;n0&&(i=0);break}return i>0?e.slice(0,i)+e.slice(r+1):e}var y8;function nW(e,t){var n=t0(e,t);if(!n)return e+"";var i=n[0],r=n[1],s=r-(y8=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+t0(e,Math.max(0,t+s-1))[0]}function b8(e,t){var n=t0(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const v8={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Zq,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>b8(e*100,t),r:b8,s:nW,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function x8(e){return e}var _8=Array.prototype.map,w8=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function E8(e){var t=e.grouping===void 0||e.thousands===void 0?x8:Jq(_8.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",i=e.currency===void 0?"":e.currency[1]+"",r=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?x8:Qq(_8.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function l(f){f=$a(f);var d=f.fill,h=f.align,p=f.sign,g=f.symbol,m=f.zero,y=f.width,b=f.comma,v=f.precision,x=f.trim,_=f.type;_==="n"?(b=!0,_="g"):v8[_]||(v===void 0&&(v=12),x=!0,_="g"),(m||d==="0"&&h==="=")&&(m=!0,d="0",h="=");var E=g==="$"?n:g==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",w=g==="$"?i:/[%p]/.test(_)?o:"",C=v8[_],k=/[defgprs%]/.test(_);v=v===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function S($){var O=E,R=w,D,A,M;if(_==="c")R=C($)+R,$="";else{$=+$;var B=$<0||1/$<0;if($=isNaN($)?u:C(Math.abs($),v),x&&($=tW($)),B&&+$==0&&p!=="+"&&(B=!1),O=(B?p==="("?p:a:p==="-"||p==="("?"":p)+O,R=(_==="s"?w8[8+y8/3]:"")+R+(B&&p==="("?")":""),k){for(D=-1,A=$.length;++DM||M>57){R=(M===46?r+$.slice(D+1):$.slice(D))+R,$=$.slice(0,D);break}}}b&&!m&&($=t($,1/0));var G=O.length+$.length+R.length,z=G>1)+O+$+R+z.slice(G);break;default:$=z+O+$+R;break}return s($)}return S.toString=function(){return f+""},S}function c(f,d){var h=l((f=$a(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(ul(d)/3)))*3,g=Math.pow(10,-p),m=w8[8+p/3];return function(y){return h(g*y)+m}}return{format:l,formatPrefix:c}}var n0,i0,U2;iW({thousands:",",grouping:[3],currency:["$",""]});function iW(e){return n0=E8(e),i0=n0.format,U2=n0.formatPrefix,n0}function C8(e){return Math.max(0,-ul(Math.abs(e)))}function k8(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ul(t)/3)))*3-ul(Math.abs(e)))}function A8(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ul(t)-ul(e))+1}const j2=new Date,q2=new Date;function qt(e,t,n,i){function r(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return r.floor=s=>(e(s=new Date(+s)),s),r.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),r.round=s=>{const o=r(s),a=r.ceil(s);return s-o(t(s=new Date(+s),o==null?1:Math.floor(o)),s),r.range=(s,o,a)=>{const u=[];if(s=r.ceil(s),a=a==null?1:Math.floor(a),!(s0))return u;let l;do u.push(l=new Date(+s)),t(s,a),e(s);while(lqt(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,a)=>{if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!s(o););else for(;--a>=0;)for(;t(o,1),!s(o););}),n&&(r.count=(s,o)=>(j2.setTime(+s),q2.setTime(+o),e(j2),e(q2),Math.floor(n(j2,q2))),r.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?r.filter(i?o=>i(o)%s===0:o=>r.count(0,o)%s===0):r)),r}const ll=qt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ll.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?qt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ll),ll.range;const Ts=1e3,ji=Ts*60,Ms=ji*60,Ns=Ms*24,W2=Ns*7,$8=Ns*30,H2=Ns*365,Rs=qt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ts)},(e,t)=>(t-e)/Ts,e=>e.getUTCSeconds());Rs.range;const r0=qt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ts)},(e,t)=>{e.setTime(+e+t*ji)},(e,t)=>(t-e)/ji,e=>e.getMinutes());r0.range;const s0=qt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ji)},(e,t)=>(t-e)/ji,e=>e.getUTCMinutes());s0.range;const o0=qt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ts-e.getMinutes()*ji)},(e,t)=>{e.setTime(+e+t*Ms)},(e,t)=>(t-e)/Ms,e=>e.getHours());o0.range;const a0=qt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ms)},(e,t)=>(t-e)/Ms,e=>e.getUTCHours());a0.range;const Os=qt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ji)/Ns,e=>e.getDate()-1);Os.range;const ko=qt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ns,e=>e.getUTCDate()-1);ko.range;const S8=qt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ns,e=>Math.floor(e/Ns));S8.range;function Sa(e){return qt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*ji)/W2)}const cl=Sa(0),u0=Sa(1),rW=Sa(2),sW=Sa(3),fl=Sa(4),oW=Sa(5),aW=Sa(6);cl.range,u0.range,rW.range,sW.range,fl.range,oW.range,aW.range;function Fa(e){return qt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/W2)}const dl=Fa(0),l0=Fa(1),uW=Fa(2),lW=Fa(3),hl=Fa(4),cW=Fa(5),fW=Fa(6);dl.range,l0.range,uW.range,lW.range,hl.range,cW.range,fW.range;const Jc=qt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Jc.range;const Qc=qt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Qc.range;const Wr=qt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Wr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Wr.range;const Hr=qt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Hr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),Hr.range;function F8(e,t,n,i,r,s){const o=[[Rs,1,Ts],[Rs,5,5*Ts],[Rs,15,15*Ts],[Rs,30,30*Ts],[s,1,ji],[s,5,5*ji],[s,15,15*ji],[s,30,30*ji],[r,1,Ms],[r,3,3*Ms],[r,6,6*Ms],[r,12,12*Ms],[i,1,Ns],[i,2,2*Ns],[n,1,W2],[t,1,$8],[t,3,3*$8],[e,1,H2]];function a(l,c,f){const d=cm).right(o,d);if(h===o.length)return e.every(Co(l/H2,c/H2,f));if(h===0)return ll.every(Math.max(Co(l,c,f),1));const[p,g]=o[d/o[h-1][2](e[t]=1+n,e),{});function Y2(e){const t=oe(e).slice(),n={};return t.length||q("Missing time unit."),t.forEach(r=>{ue(V2,r)?n[r]=1:q(`Invalid time unit: ${r}.`)}),(n[Wt]||n[$n]?1:0)+(n[si]||n[An]||n[oi]?1:0)+(n[Gr]?1:0)>1&&q(`Incompatible time units: ${e}`),t.sort((r,s)=>V2[r]-V2[s]),t}const mW={[cn]:"%Y ",[si]:"Q%q ",[An]:"%b ",[oi]:"%d ",[Wt]:"W%U ",[$n]:"%a ",[Gr]:"%j ",[Ci]:"%H:00",[ki]:"00:%M",[qi]:":%S",[cr]:".%L",[`${cn}-${An}`]:"%Y-%m ",[`${cn}-${An}-${oi}`]:"%Y-%m-%d ",[`${Ci}-${ki}`]:"%H:%M"};function D8(e,t){const n=Ie({},mW,t),i=Y2(e),r=i.length;let s="",o=0,a,u;for(o=0;oo;--a)if(u=i.slice(o,a).join("-"),n[u]!=null){s+=n[u],o=a;break}return s.trim()}const Da=new Date;function X2(e){return Da.setFullYear(e),Da.setMonth(0),Da.setDate(1),Da.setHours(0,0,0,0),Da}function T8(e){return N8(new Date(e))}function M8(e){return K2(new Date(e))}function N8(e){return Os.count(X2(e.getFullYear())-1,e)}function K2(e){return cl.count(X2(e.getFullYear())-1,e)}function Z2(e){return X2(e).getDay()}function yW(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(-1,t,n,i,r,s,o);return a.setFullYear(e),a}return new Date(e,t,n,i,r,s,o)}function R8(e){return L8(new Date(e))}function O8(e){return J2(new Date(e))}function L8(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return ko.count(t-1,e)}function J2(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return dl.count(t-1,e)}function Q2(e){return Da.setTime(Date.UTC(e,0,1)),Da.getUTCDay()}function bW(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(Date.UTC(-1,t,n,i,r,s,o));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(e,t,n,i,r,s,o))}function I8(e,t,n,i,r){const s=t||1,o=Ge(e),a=(y,b,v)=>(v=v||y,vW(n[v],i[v],y===o&&s,b)),u=new Date,l=lr(e),c=l[cn]?a(cn):kn(2012),f=l[An]?a(An):l[si]?a(si):bo,d=l[Wt]&&l[$n]?a($n,1,Wt+$n):l[Wt]?a(Wt,1):l[$n]?a($n,1):l[oi]?a(oi,1):l[Gr]?a(Gr,1):tl,h=l[Ci]?a(Ci):bo,p=l[ki]?a(ki):bo,g=l[qi]?a(qi):bo,m=l[cr]?a(cr):bo;return function(y){u.setTime(+y);const b=c(u);return r(b,f(u),d(u,b),h(u),p(u),g(u),m(u))}}function vW(e,t,n,i){const r=n<=1?e:i?(s,o)=>i+n*Math.floor((e(s,o)-i)/n):(s,o)=>n*Math.floor(e(s,o)/n);return t?(s,o)=>t(r(s,o),o):r}function pl(e,t,n){return t+e*7-(n+6)%7}const xW={[cn]:e=>e.getFullYear(),[si]:e=>Math.floor(e.getMonth()/3),[An]:e=>e.getMonth(),[oi]:e=>e.getDate(),[Ci]:e=>e.getHours(),[ki]:e=>e.getMinutes(),[qi]:e=>e.getSeconds(),[cr]:e=>e.getMilliseconds(),[Gr]:e=>N8(e),[Wt]:e=>K2(e),[Wt+$n]:(e,t)=>pl(K2(e),e.getDay(),Z2(t)),[$n]:(e,t)=>pl(1,e.getDay(),Z2(t))},_W={[si]:e=>3*e,[Wt]:(e,t)=>pl(e,0,Z2(t))};function P8(e,t){return I8(e,t||1,xW,_W,yW)}const wW={[cn]:e=>e.getUTCFullYear(),[si]:e=>Math.floor(e.getUTCMonth()/3),[An]:e=>e.getUTCMonth(),[oi]:e=>e.getUTCDate(),[Ci]:e=>e.getUTCHours(),[ki]:e=>e.getUTCMinutes(),[qi]:e=>e.getUTCSeconds(),[cr]:e=>e.getUTCMilliseconds(),[Gr]:e=>L8(e),[Wt]:e=>J2(e),[$n]:(e,t)=>pl(1,e.getUTCDay(),Q2(t)),[Wt+$n]:(e,t)=>pl(J2(e),e.getUTCDay(),Q2(t))},EW={[si]:e=>3*e,[Wt]:(e,t)=>pl(e,0,Q2(t))};function z8(e,t){return I8(e,t||1,wW,EW,bW)}const CW={[cn]:Wr,[si]:Jc.every(3),[An]:Jc,[Wt]:cl,[oi]:Os,[$n]:Os,[Gr]:Os,[Ci]:o0,[ki]:r0,[qi]:Rs,[cr]:ll},kW={[cn]:Hr,[si]:Qc.every(3),[An]:Qc,[Wt]:dl,[oi]:ko,[$n]:ko,[Gr]:ko,[Ci]:a0,[ki]:s0,[qi]:Rs,[cr]:ll};function gl(e){return CW[e]}function ml(e){return kW[e]}function B8(e,t,n){return e?e.offset(t,n):void 0}function U8(e,t,n){return B8(gl(e),t,n)}function j8(e,t,n){return B8(ml(e),t,n)}function q8(e,t,n,i){return e?e.range(t,n,i):void 0}function W8(e,t,n,i){return q8(gl(e),t,n,i)}function H8(e,t,n,i){return q8(ml(e),t,n,i)}const ef=1e3,tf=ef*60,nf=tf*60,c0=nf*24,AW=c0*7,G8=c0*30,ey=c0*365,V8=[cn,An,oi,Ci,ki,qi,cr],rf=V8.slice(0,-1),sf=rf.slice(0,-1),of=sf.slice(0,-1),$W=of.slice(0,-1),SW=[cn,Wt],Y8=[cn,An],X8=[cn],af=[[rf,1,ef],[rf,5,5*ef],[rf,15,15*ef],[rf,30,30*ef],[sf,1,tf],[sf,5,5*tf],[sf,15,15*tf],[sf,30,30*tf],[of,1,nf],[of,3,3*nf],[of,6,6*nf],[of,12,12*nf],[$W,1,c0],[SW,1,AW],[Y8,1,G8],[Y8,3,3*G8],[X8,1,ey]];function K8(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(Xc(t))/n;let r=al(a=>a[2]).right(af,i),s,o;return r===af.length?(s=X8,o=Co(t[0]/ey,t[1]/ey,n)):r?(r=af[i/af[r-1][2]53)return null;"w"in K||(K.w=1),"Z"in K?(Xe=ny(uf(K.y,0,1)),Pn=Xe.getUTCDay(),Xe=Pn>4||Pn===0?l0.ceil(Xe):l0(Xe),Xe=ko.offset(Xe,(K.V-1)*7),K.y=Xe.getUTCFullYear(),K.m=Xe.getUTCMonth(),K.d=Xe.getUTCDate()+(K.w+6)%7):(Xe=ty(uf(K.y,0,1)),Pn=Xe.getDay(),Xe=Pn>4||Pn===0?u0.ceil(Xe):u0(Xe),Xe=Os.offset(Xe,(K.V-1)*7),K.y=Xe.getFullYear(),K.m=Xe.getMonth(),K.d=Xe.getDate()+(K.w+6)%7)}else("W"in K||"U"in K)&&("w"in K||(K.w="u"in K?K.u%7:"W"in K?1:0),Pn="Z"in K?ny(uf(K.y,0,1)).getUTCDay():ty(uf(K.y,0,1)).getDay(),K.m=0,K.d="W"in K?(K.w+6)%7+K.W*7-(Pn+5)%7:K.w+K.U*7-(Pn+6)%7);return"Z"in K?(K.H+=K.Z/100|0,K.M+=K.Z%100,ny(K)):ty(K)}}function C(le,Re,Pe,K){for(var Kt=0,Xe=Re.length,Pn=Pe.length,ln,Fs;Kt=Pn)return-1;if(ln=Re.charCodeAt(Kt++),ln===37){if(ln=Re.charAt(Kt++),Fs=_[ln in J8?Re.charAt(Kt++):ln],!Fs||(K=Fs(le,Pe,K))<0)return-1}else if(ln!=Pe.charCodeAt(K++))return-1}return K}function k(le,Re,Pe){var K=l.exec(Re.slice(Pe));return K?(le.p=c.get(K[0].toLowerCase()),Pe+K[0].length):-1}function S(le,Re,Pe){var K=h.exec(Re.slice(Pe));return K?(le.w=p.get(K[0].toLowerCase()),Pe+K[0].length):-1}function $(le,Re,Pe){var K=f.exec(Re.slice(Pe));return K?(le.w=d.get(K[0].toLowerCase()),Pe+K[0].length):-1}function O(le,Re,Pe){var K=y.exec(Re.slice(Pe));return K?(le.m=b.get(K[0].toLowerCase()),Pe+K[0].length):-1}function R(le,Re,Pe){var K=g.exec(Re.slice(Pe));return K?(le.m=m.get(K[0].toLowerCase()),Pe+K[0].length):-1}function D(le,Re,Pe){return C(le,t,Re,Pe)}function A(le,Re,Pe){return C(le,n,Re,Pe)}function M(le,Re,Pe){return C(le,i,Re,Pe)}function B(le){return o[le.getDay()]}function G(le){return s[le.getDay()]}function z(le){return u[le.getMonth()]}function ie(le){return a[le.getMonth()]}function xe(le){return r[+(le.getHours()>=12)]}function he(le){return 1+~~(le.getMonth()/3)}function Te(le){return o[le.getUTCDay()]}function ft(le){return s[le.getUTCDay()]}function Fe(le){return u[le.getUTCMonth()]}function Ot(le){return a[le.getUTCMonth()]}function or(le){return r[+(le.getUTCHours()>=12)]}function Ii(le){return 1+~~(le.getUTCMonth()/3)}return{format:function(le){var Re=E(le+="",v);return Re.toString=function(){return le},Re},parse:function(le){var Re=w(le+="",!1);return Re.toString=function(){return le},Re},utcFormat:function(le){var Re=E(le+="",x);return Re.toString=function(){return le},Re},utcParse:function(le){var Re=w(le+="",!0);return Re.toString=function(){return le},Re}}}var J8={"-":"",_:" ",0:"0"},Zt=/^\s*\d+/,FW=/^%/,DW=/[\\^$*+?|[\]().{}]/g;function Qe(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",s=r.length;return i+(s[t.toLowerCase(),n]))}function MW(e,t,n){var i=Zt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function NW(e,t,n){var i=Zt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function RW(e,t,n){var i=Zt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function OW(e,t,n){var i=Zt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function LW(e,t,n){var i=Zt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function Q8(e,t,n){var i=Zt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function eE(e,t,n){var i=Zt.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function IW(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function PW(e,t,n){var i=Zt.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function zW(e,t,n){var i=Zt.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function tE(e,t,n){var i=Zt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function BW(e,t,n){var i=Zt.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function nE(e,t,n){var i=Zt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function UW(e,t,n){var i=Zt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function jW(e,t,n){var i=Zt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function qW(e,t,n){var i=Zt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function WW(e,t,n){var i=Zt.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function HW(e,t,n){var i=FW.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function GW(e,t,n){var i=Zt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function VW(e,t,n){var i=Zt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function iE(e,t){return Qe(e.getDate(),t,2)}function YW(e,t){return Qe(e.getHours(),t,2)}function XW(e,t){return Qe(e.getHours()%12||12,t,2)}function KW(e,t){return Qe(1+Os.count(Wr(e),e),t,3)}function rE(e,t){return Qe(e.getMilliseconds(),t,3)}function ZW(e,t){return rE(e,t)+"000"}function JW(e,t){return Qe(e.getMonth()+1,t,2)}function QW(e,t){return Qe(e.getMinutes(),t,2)}function eH(e,t){return Qe(e.getSeconds(),t,2)}function tH(e){var t=e.getDay();return t===0?7:t}function nH(e,t){return Qe(cl.count(Wr(e)-1,e),t,2)}function sE(e){var t=e.getDay();return t>=4||t===0?fl(e):fl.ceil(e)}function iH(e,t){return e=sE(e),Qe(fl.count(Wr(e),e)+(Wr(e).getDay()===4),t,2)}function rH(e){return e.getDay()}function sH(e,t){return Qe(u0.count(Wr(e)-1,e),t,2)}function oH(e,t){return Qe(e.getFullYear()%100,t,2)}function aH(e,t){return e=sE(e),Qe(e.getFullYear()%100,t,2)}function uH(e,t){return Qe(e.getFullYear()%1e4,t,4)}function lH(e,t){var n=e.getDay();return e=n>=4||n===0?fl(e):fl.ceil(e),Qe(e.getFullYear()%1e4,t,4)}function cH(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Qe(t/60|0,"0",2)+Qe(t%60,"0",2)}function oE(e,t){return Qe(e.getUTCDate(),t,2)}function fH(e,t){return Qe(e.getUTCHours(),t,2)}function dH(e,t){return Qe(e.getUTCHours()%12||12,t,2)}function hH(e,t){return Qe(1+ko.count(Hr(e),e),t,3)}function aE(e,t){return Qe(e.getUTCMilliseconds(),t,3)}function pH(e,t){return aE(e,t)+"000"}function gH(e,t){return Qe(e.getUTCMonth()+1,t,2)}function mH(e,t){return Qe(e.getUTCMinutes(),t,2)}function yH(e,t){return Qe(e.getUTCSeconds(),t,2)}function bH(e){var t=e.getUTCDay();return t===0?7:t}function vH(e,t){return Qe(dl.count(Hr(e)-1,e),t,2)}function uE(e){var t=e.getUTCDay();return t>=4||t===0?hl(e):hl.ceil(e)}function xH(e,t){return e=uE(e),Qe(hl.count(Hr(e),e)+(Hr(e).getUTCDay()===4),t,2)}function _H(e){return e.getUTCDay()}function wH(e,t){return Qe(l0.count(Hr(e)-1,e),t,2)}function EH(e,t){return Qe(e.getUTCFullYear()%100,t,2)}function CH(e,t){return e=uE(e),Qe(e.getUTCFullYear()%100,t,2)}function kH(e,t){return Qe(e.getUTCFullYear()%1e4,t,4)}function AH(e,t){var n=e.getUTCDay();return e=n>=4||n===0?hl(e):hl.ceil(e),Qe(e.getUTCFullYear()%1e4,t,4)}function $H(){return"+0000"}function lE(){return"%"}function cE(e){return+e}function fE(e){return Math.floor(+e/1e3)}var yl,iy,dE,ry,hE;SH({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function SH(e){return yl=Z8(e),iy=yl.format,dE=yl.parse,ry=yl.utcFormat,hE=yl.utcParse,yl}function ff(e){const t={};return n=>t[n]||(t[n]=e(n))}function FH(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let s=DH(i,r);const o=sr;)if(i[s]!=="0"){++s;break}return i.slice(0,s)+o}}function DH(e,t){let n=e.lastIndexOf("e"),i;if(n>0)return n;for(n=e.length;--n>t;)if(i=e.charCodeAt(n),i>=48&&i<=57)return n+1}function pE(e){const t=ff(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=$a(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return FH(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,s,o){o=$a(o??",f");const a=Co(i,r,s),u=Math.max(Math.abs(i),Math.abs(r));let l;if(o.precision==null)switch(o.type){case"s":return isNaN(l=k8(a,u))||(o.precision=l),n(o,u);case"":case"e":case"g":case"p":case"r":{isNaN(l=A8(a,u))||(o.precision=l-(o.type==="e"));break}case"f":case"%":{isNaN(l=C8(a))||(o.precision=l-(o.type==="%")*2);break}}return t(o)}}}let sy;gE();function gE(){return sy=pE({format:i0,formatPrefix:U2})}function mE(e){return pE(E8(e))}function f0(e){return arguments.length?sy=mE(e):sy}function yE(e,t,n){n=n||{},re(n)||q(`Invalid time multi-format specifier: ${n}`);const i=t(qi),r=t(ki),s=t(Ci),o=t(oi),a=t(Wt),u=t(An),l=t(si),c=t(cn),f=e(n[cr]||".%L"),d=e(n[qi]||":%S"),h=e(n[ki]||"%I:%M"),p=e(n[Ci]||"%I %p"),g=e(n[oi]||n[$n]||"%a %d"),m=e(n[Wt]||"%b %d"),y=e(n[An]||"%B"),b=e(n[si]||"%B"),v=e(n[cn]||"%Y");return x=>(i(x)se(i)?t(i):yE(t,gl,i),utcFormat:i=>se(i)?n(i):yE(n,ml,i),timeParse:ff(e.parse),utcParse:ff(e.utcParse)}}let oy;vE();function vE(){return oy=bE({format:iy,parse:dE,utcFormat:ry,utcParse:hE})}function xE(e){return bE(Z8(e))}function df(e){return arguments.length?oy=xE(e):oy}const ay=(e,t)=>Ie({},e,t);function _E(e,t){const n=e?mE(e):f0(),i=t?xE(t):df();return ay(n,i)}function uy(e,t){const n=arguments.length;return n&&n!==2&&q("defaultLocale expects either zero or two arguments."),n?ay(f0(e),df(t)):ay(f0(),df())}function TH(){return gE(),vE(),uy()}const MH=/^(data:|([A-Za-z]+:)?\/\/)/,NH=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,RH=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,wE="file://";function OH(e,t){return n=>({options:n||{},sanitize:IH,load:LH,fileAccess:!1,file:PH(t),http:BH(e)})}async function LH(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function IH(e,t){t=Ie({},this.options,t);const n=this.fileAccess,i={href:null};let r,s,o;const a=NH.test(e.replace(RH,""));(e==null||typeof e!="string"||!a)&&q("Sanitize failure, invalid URI: "+Q(e));const u=MH.test(e);return(o=t.baseURL)&&!u&&(!e.startsWith("/")&&!o.endsWith("/")&&(e="/"+e),e=o+e),s=(r=e.startsWith(wE))||t.mode==="file"||t.mode!=="http"&&!u&&n,r?e=e.slice(wE.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),s=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!s}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function PH(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(r,s)=>{r?i(r):n(s)})}):zH}async function zH(){q("No file system access.")}function BH(e){return e?async function(t,n){const i=Ie({},this.options.http,n),r=n&&n.response,s=await e(t,i);return s.ok?Le(s[r])?s[r]():s.text():q(s.status+""+s.statusText)}:UH}async function UH(){q("No HTTP fetch method available.")}const jH=e=>e!=null&&e===e,qH=e=>e==="true"||e==="false"||e===!0||e===!1,WH=e=>!Number.isNaN(Date.parse(e)),EE=e=>!Number.isNaN(+e)&&!(e instanceof Date),HH=e=>EE(e)&&Number.isInteger(+e),ly={boolean:F2,integer:Cn,number:Cn,date:D2,string:T2,unknown:En},d0=[qH,HH,EE,WH],GH=["boolean","integer","number","date"];function CE(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=d0.length,r=d0.map((s,o)=>o+1);for(let s=0,o=0,a,u;ss===0?o:s,0)-1]}function kE(e,t){return t.reduce((n,i)=>(n[i]=CE(e,i),n),{})}function AE(e){const t=function(n,i){const r={delimiter:e};return cy(n,i?Ie(i,r):r)};return t.responseType="text",t}function cy(e,t){return t.header&&(e=t.header.map(Q).join(t.delimiter)+` +`+e),Aq(t.delimiter).parse(e+"")}cy.responseType="text";function VH(e){return typeof Buffer=="function"&&Le(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function fy(e,t){const n=t&&t.property?Bi(t.property):En;return re(e)&&!VH(e)?YH(n(e),t):n(JSON.parse(e))}fy.responseType="json";function YH(e,t){return!W(e)&&Y4(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const XH={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function $E(e,t){let n,i,r,s;return e=fy(e,t),t&&t.feature?(n=Dq,r=t.feature):t&&t.mesh?(n=Mq,r=t.mesh,s=XH[t.filter]):q("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,s):q("Invalid TopoJSON object: "+r),i&&i.features||[i]}$E.responseType="json";const h0={dsv:cy,csv:AE(","),tsv:AE(" "),json:fy,topojson:$E};function dy(e,t){return arguments.length>1?(h0[e]=t,this):ue(h0,e)?h0[e]:null}function SE(e){const t=dy(e);return t&&t.responseType||"text"}function FE(e,t,n,i){t=t||{};const r=dy(t.type||"json");return r||q("Unknown data format type: "+t.type),e=r(e,t),t.parse&&KH(e,t.parse,n,i),ue(e,"columns")&&delete e.columns,e}function KH(e,t,n,i){if(!e.length)return;const r=df();n=n||r.timeParse,i=i||r.utcParse;let s=e.columns||Object.keys(e[0]),o,a,u,l,c,f;t==="auto"&&(t=kE(e,s)),s=Object.keys(t);const d=s.map(h=>{const p=t[h];let g,m;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?i:n)(m);if(!ly[p])throw Error("Illegal format pattern: "+h+":"+p);return ly[p]});for(u=0,c=e.length,f=s.length;u{const s=t(r);return i[s]||(i[s]=1,n.push(r)),n},n.remove=r=>{const s=t(r);if(i[s]){i[s]=0;const o=n.indexOf(r);o>=0&&n.splice(o,1)}return n},n}async function m0(e,t){try{await t(e)}catch(n){e.error(n)}}const DE=Symbol("vega_id");let ZH=1;function y0(e){return!!(e&&_e(e))}function _e(e){return e[DE]}function TE(e,t){return e[DE]=t,e}function it(e){const t=e===Object(e)?e:{data:e};return _e(t)?t:TE(t,ZH++)}function hy(e){return b0(e,it({}))}function b0(e,t){for(const n in e)t[n]=e[n];return t}function ME(e,t){return TE(t,_e(e))}function Ta(e,t){return e?t?(n,i)=>e(n,i)||_e(t(n))-_e(t(i)):(n,i)=>e(n,i)||_e(n)-_e(i):null}function NE(e){return e&&e.constructor===Ao}function Ao(){const e=[],t=[],n=[],i=[],r=[];let s=null,o=!1;return{constructor:Ao,insert(a){const u=oe(a),l=u.length;for(let c=0;c{p(b)&&(l[_e(b)]=-1)});for(f=0,d=e.length;f0&&(y(g,p,h.value),a.modifies(p));for(f=0,d=r.length;f{p(b)&&l[_e(b)]>0&&y(b,h.field,h.value)}),a.modifies(h.field);if(o)a.mod=t.length||i.length?u.filter(b=>l[_e(b)]>0):u.slice();else for(m in c)a.mod.push(c[m]);return(s||s==null&&(t.length||i.length))&&a.clean(!0),a}}}const v0="_:mod:_";function x0(){Object.defineProperty(this,v0,{writable:!0,value:{}})}x0.prototype={set(e,t,n,i){const r=this,s=r[e],o=r[v0];return t!=null&&t>=0?(s[t]!==n||i)&&(s[t]=n,o[t+":"+e]=-1,o[e]=-1):(s!==n||i)&&(r[e]=n,o[e]=W(n)?1+n.length:-1),r},modified(e,t){const n=this[v0];if(arguments.length){if(W(e)){for(let i=0;i=0?t+1{h instanceof xt?(h!==this&&(t&&h.targets().add(this),s.push(h)),r.push({op:h,name:f,index:d})):i.set(f,d,h)};for(o in e)if(a=e[o],o===QH)oe(a).forEach(f=>{f instanceof xt?f!==this&&(f.targets().add(this),s.push(f)):q("Pulse parameters must be operator instances.")}),this.source=a;else if(W(a))for(i.set(o,-1,Array(u=a.length)),l=0;l{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=$o();return this.targets().add($o(null,null,A2(e,n=>{const i=n.dataflow;t.receive(n),i&&i.run&&i.run()}))),t},between(e,t){let n=!1;return e.targets().add($o(null,null,()=>n=!0)),t.targets().add($o(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Ui,this._targets=null}};function oG(e,t,n,i){const r=this,s=$o(n,i),o=function(l){l.dataflow=r;try{s.receive(l)}catch(c){r.error(c)}finally{r.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=oe(e);const u=a.length;for(let l=0;lt=i);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const dG={skip:!0};function hG(e,t,n,i,r){return(e instanceof xt?gG:pG)(this,e,t,n,i,r),this}function pG(e,t,n,i,r,s){const o=Ie({},s,dG);let a,u;Le(n)||(n=kn(n)),i===void 0?a=l=>e.touch(n(l)):Le(i)?(u=new xt(null,i,r,!1),a=l=>{u.evaluate(l);const c=n(l),f=u.value;NE(f)?e.pulse(c,f,s):e.update(c,f,o)}):a=l=>e.update(n(l),i,o),t.apply(a)}function gG(e,t,n,i,r,s){if(i===void 0)t.targets().add(n);else{const o=s||{},a=new xt(null,mG(n,i),r,!1);a.modified(o.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}function mG(e,t){return t=Le(t)?t:kn(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function yG(e){e.rank=++this._rank}function bG(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&q("Cycle detected in dataflow graph.")}const w0={},Vr=1,So=2,Ls=4,vG=Vr|So,OE=Vr|Ls,bl=Vr|So|Ls,LE=8,hf=16,IE=32,PE=64;function Fo(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function py(e,t){const n=[];return wo(e,t,i=>n.push(i)),n}function zE(e,t){const n={};return e.visit(t,i=>{n[_e(i)]=1}),i=>n[_e(i)]?null:i}function E0(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}Fo.prototype={StopPropagation:w0,ADD:Vr,REM:So,MOD:Ls,ADD_REM:vG,ADD_MOD:OE,ALL:bl,REFLOW:LE,SOURCE:hf,NO_SOURCE:IE,NO_FIELDS:PE,fork(e){return new Fo(this.dataflow).init(this,e)},clone(){const e=this.fork(bl);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(bl|hf)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new Fo(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,e.fields&&!(t&PE)&&(n.fields=e.fields),t&Vr?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&So?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&Ls?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&IE?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||bl;return t&Vr&&this.add.length||t&So&&this.rem.length||t&Ls&&this.mod.length},reflow(e){if(e)return this.fork(bl).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(Ls,zE(this,Vr))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return W(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return(t||this.mod.length)&&n?arguments.length?W(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&Vr&&(n.addF=E0(n.addF,t)),e&So&&(n.remF=E0(n.remF,t)),e&Ls&&(n.modF=E0(n.modF,t)),e&hf&&(n.srcF=E0(n.srcF,t)),n},materialize(e){e=e||bl;const t=this;return e&Vr&&t.addF&&(t.add=py(t.add,t.addF),t.addF=null),e&So&&t.remF&&(t.rem=py(t.rem,t.remF),t.remF=null),e&Ls&&t.modF&&(t.mod=py(t.mod,t.modF),t.modF=null),e&hf&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&hf)return wo(n.source,n.srcF,i),n;e&Vr&&wo(n.add,n.addF,i),e&So&&wo(n.rem,n.remF,i),e&Ls&&wo(n.mod,n.modF,i);const r=n.source;if(e&LE&&r){const s=n.add.length+n.mod.length;s===r.length||(s?wo(r,zE(n,OE),i):wo(r,n.srcF,i))}return n}};function gy(e,t,n,i){const r=this;let s=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const o of n)if(o.stamp===t){if(o.fields){const a=r.fields||(r.fields={});for(const u in o.fields)a[u]=1}o.changed(r.ADD)&&(s|=r.ADD),o.changed(r.REM)&&(s|=r.REM),o.changed(r.MOD)&&(s|=r.MOD)}this.changes=s}te(gy,Fo,{fork(e){const t=new Fo(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?W(e)?e.some(i=>n[i]):n[e]:0},filter(){q("MultiPulse does not support filtering.")},materialize(){q("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let s=0;if(e&n.SOURCE)for(;si._enqueue(c,!0)),i._touched=g0(Vc);let o=0,a,u,l;try{for(;i._heap.size()>0;){if(a=i._heap.pop(),a.rank!==a.qrank){i._enqueue(a,!0);continue}u=a.run(i._getPulse(a,e)),u.then?u=await u:u.async&&(r.push(u.async),u=w0),u!==w0&&a._targets&&a._targets.forEach(c=>i._enqueue(c)),++o}}catch(c){i._heap.clear(),l=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${s}: ${o} operators`),l&&(i._postrun=[],i.error(l)),i._postrun.length){const c=i._postrun.sort((f,d)=>d.priority-f.priority);i._postrun=[];for(let f=0;fi.runAsync(null,()=>{c.forEach(f=>{try{f(i)}catch(d){i.error(d)}})})),i}async function _G(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running}function wG(e,t,n){return this._pulse?BE(this):(this.evaluate(e,t,n),this)}function EG(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(i){this.error(i)}}function BE(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function CG(e,t){const n=e.stampr.pulse),t):this._input[e.id]||AG(this._pulse,n&&n.pulse)}function AG(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==w0&&(e.source=t.source),e)}const my={skip:!1,force:!1};function $G(e,t){const n=t||my;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function SG(e,t,n){const i=n||my;return(e.set(t)||i.force)&&this.touch(e,i),this}function FG(e,t,n){this.touch(e,n||my);const i=new Fo(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this}function DG(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),UE(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,TG(t,0,e)):i=n,i}}}function UE(e,t,n,i){let r,s;const o=e[n];for(;n>t;){if(s=n-1>>1,r=e[s],i(o,r)<0){e[n]=r,n=s;continue}break}return e[n]=o}function TG(e,t,n){const i=t,r=e.length,s=e[t];let o=(t<<1)+1,a;for(;o=0&&(o=a),e[t]=e[o],t=o,o=(t<<1)+1;return e[t]=s,UE(e,i,t,n)}function vl(){this.logger(_2()),this.logLevel(v2),this._clock=0,this._rank=0,this._locale=uy();try{this._loader=p0()}catch{}this._touched=g0(Vc),this._input={},this._pulse=null,this._heap=DG((e,t)=>e.qrank-t.qrank),this._postrun=[]}function pf(e){return function(){return this._log[e].apply(this,arguments)}}vl.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:pf("error"),warn:pf("warn"),info:pf("info"),debug:pf("debug"),logLevel:pf("level"),cleanThreshold:1e4,add:iG,connect:rG,rank:yG,rerank:bG,pulse:FG,touch:$G,update:SG,changeset:Ao,ingest:uG,parse:aG,preload:cG,request:lG,events:oG,on:hG,evaluate:xG,run:wG,runAsync:_G,runAfter:EG,_enqueue:CG,_getPulse:kG};function P(e,t){xt.call(this,e,null,t)}te(P,xt,{run(e){if(e.stampthis.pulse=n):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const xl={};function jE(e){const t=qE(e);return t&&t.Definition||null}function qE(e){return e=e&&e.toLowerCase(),ue(xl,e)?xl[e]:null}function*WE(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)i=t(i,++n,e),i!=null&&i!==""&&(i=+i)>=i&&(yield i)}}function yy(e,t,n){const i=Float64Array.from(WE(e,n));return i.sort(Ds),t.map(r=>h8(i,r))}function by(e,t){return yy(e,[.25,.5,.75],t)}function vy(e,t){const n=e.length,i=Bq(e,t),r=by(e,t),s=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,s)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function HE(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let s=e.extent[0],o=e.extent[1],a,u,l,c,f,d;const h=e.span||o-s||Math.abs(s)||1;if(e.step)a=e.step;else if(e.steps){for(c=h/t,f=0,d=e.steps.length;ft;)a*=n;for(f=0,d=r.length;f=l&&h/c<=t&&(a=c)}c=Math.log(a);const p=c>=0?0:~~(-c/i)+1,g=Math.pow(n,-p-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(s/a+g)*a,s=sd);const r=e.length,s=new Float64Array(r);let o=0,a=1,u=i(e[0]),l=u,c=u+t,f;for(;a=c){for(l=(u+l)/2;o>1);or;)e[o--]=e[i]}i=r,r=s}return e}function RG(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function OG(e,t){t==null&&(t=e,e=0);let n,i,r;const s={min(o){return arguments.length?(n=o||0,r=i-n,s):n},max(o){return arguments.length?(i=o||0,r=i-n,s):i},sample(){return n+Math.floor(r*Wi())},pdf(o){return o===Math.floor(o)&&o>=n&&o=i?1:(a-n+1)/r},icdf(o){return o>=0&&o<=1?n-1+Math.floor(o*r):NaN}};return s.min(e).max(t)}const YE=Math.sqrt(2*Math.PI),LG=Math.SQRT2;let gf=NaN;function C0(e,t){e=e||0,t=t??1;let n=0,i=0,r,s;if(gf===gf)n=gf,gf=NaN;else{do n=Wi()*2-1,i=Wi()*2-1,r=n*n+i*i;while(r===0||r>1);s=Math.sqrt(-2*Math.log(r)/r),n*=s,gf=i*s}return e+n*t}function xy(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*YE)}function k0(e,t,n){t=t||0,n=n??1;const i=(e-t)/n,r=Math.abs(i);let s;if(r>37)s=0;else{const o=Math.exp(-r*r/2);let a;r<7.07106781186547?(a=.0352624965998911*r+.700383064443688,a=a*r+6.37396220353165,a=a*r+33.912866078383,a=a*r+112.079291497871,a=a*r+221.213596169931,a=a*r+220.206867912376,s=o*a,a=.0883883476483184*r+1.75566716318264,a=a*r+16.064177579207,a=a*r+86.7807322029461,a=a*r+296.564248779674,a=a*r+637.333633378831,a=a*r+793.826512519948,a=a*r+440.413735824752,s=s/a):(a=r+.65,a=r+4/a,a=r+3/a,a=r+2/a,a=r+1/a,s=o/a/2.506628274631)}return i>0?1-s:s}function A0(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*LG*IG(2*e-1)}function IG(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=10512122733215323e-25+n*t,n=-4112633980346984e-24+n*t,n=-29070369957882005e-24+n*t,n=42347877827932404e-23+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*t,n=-27517406297064545e-23+n*t,n=18239629214389228e-24+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=15076572693500548e-25+n*t,n=-3789465440126737e-24+n*t,n=761570120807834e-23+n*t,n=-1496002662714924e-23+n*t,n=2914795345090108e-23+n*t,n=-6771199775845234e-23+n*t,n=22900482228026655e-23+n*t,n=-99298272942317e-20+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}function _y(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>C0(n,i),pdf:s=>xy(s,n,i),cdf:s=>k0(s,n,i),icdf:s=>A0(s,n,i)};return r.mean(e).stdev(t)}function wy(e,t){const n=_y();let i=0;const r={data(s){return arguments.length?(e=s,i=s?s.length:0,r.bandwidth(t)):e},bandwidth(s){return arguments.length?(t=s,!t&&e&&(t=vy(e)),r):t},sample(){return e[~~(Wi()*i)]+t*n.sample()},pdf(s){let o=0,a=0;for(;aEy(n,i),pdf:s=>Cy(s,n,i),cdf:s=>ky(s,n,i),icdf:s=>Ay(s,n,i)};return r.mean(e).stdev(t)}function KE(e,t){let n=0,i;function r(o){const a=[];let u=0,l;for(l=0;l=t&&e<=n?1/(n-t):0}function Fy(e,t,n){return n==null&&(n=t??1,t=0),en?1:(e-t)/(n-t)}function Dy(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function ZE(e,t){let n,i;const r={min(s){return arguments.length?(n=s||0,r):n},max(s){return arguments.length?(i=s??1,r):i},sample:()=>$y(n,i),pdf:s=>Sy(s,n,i),cdf:s=>Fy(s,n,i),icdf:s=>Dy(s,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function Ty(e,t,n){let i=0,r=0;for(const s of e){const o=n(s);t(s)==null||o==null||isNaN(o)||(i+=(o-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function mf(e,t,n,i){const r=i-e*e,s=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-s*e,s]}function $0(e,t,n,i){e=e.filter(h=>{let p=t(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),i&&e.sort((h,p)=>t(h)-t(p));const r=e.length,s=new Float64Array(r),o=new Float64Array(r);let a=0,u=0,l=0,c,f,d;for(d of e)s[a]=c=+t(d),o[a]=f=+n(d),++a,u+=(c-u)/a,l+=(f-l)/a;for(a=0;a=s&&o!=null&&(o=+o)>=o&&i(s,o,++r)}function _l(e,t,n,i,r){let s=0,o=0;return yf(e,t,n,(a,u)=>{const l=u-r(a),c=u-i;s+=l*l,o+=c*c}),1-s/o}function My(e,t,n){let i=0,r=0,s=0,o=0,a=0;yf(e,t,n,(c,f)=>{++a,i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const u=mf(i,r,s,o),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:_l(e,t,n,r,l)}}function JE(e,t,n){let i=0,r=0,s=0,o=0,a=0;yf(e,t,n,(c,f)=>{++a,c=Math.log(c),i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const u=mf(i,r,s,o),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:_l(e,t,n,r,l)}}function QE(e,t,n){const[i,r,s,o]=$0(e,t,n);let a=0,u=0,l=0,c=0,f=0,d,h,p;yf(e,t,n,(b,v)=>{d=i[f++],h=Math.log(v),p=d*v,a+=(v*h-a)/f,u+=(p-u)/f,l+=(p*h-l)/f,c+=(d*p-c)/f});const[g,m]=mf(u/o,a/o,l/o,c/o),y=b=>Math.exp(g+m*(b-s));return{coef:[Math.exp(g-m*s),m],predict:y,rSquared:_l(e,t,n,o,y)}}function e9(e,t,n){let i=0,r=0,s=0,o=0,a=0,u=0;yf(e,t,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++u,i+=(h-i)/u,r+=(p-r)/u,s+=(h*p-s)/u,o+=(h*h-o)/u,a+=(d-a)/u});const l=mf(i,r,s,o),c=f=>l[0]*Math.pow(f,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:_l(e,t,n,a,c)}}function Ny(e,t,n){const[i,r,s,o]=$0(e,t,n),a=i.length;let u=0,l=0,c=0,f=0,d=0,h,p,g,m;for(h=0;h(w=w-s,v*w*w+x*w+_+o);return{coef:[_-x*s+v*s*s+o,x-2*v*s,v],predict:E,rSquared:_l(e,t,n,o,E)}}function t9(e,t,n,i){if(i===0)return Ty(e,t,n);if(i===1)return My(e,t,n);if(i===2)return Ny(e,t,n);const[r,s,o,a]=$0(e,t,n),u=r.length,l=[],c=[],f=i+1;let d,h,p,g,m;for(d=0;d{v-=o;let x=a+y[0]+y[1]*v+y[2]*v*v;for(d=3;d=0;--s)for(a=t[s],u=1,r[s]+=a,o=1;o<=s;++o)u*=(s+1-o)/o,r[s-o]+=a*Math.pow(n,o)*u;return r[0]+=i,r}function zG(e){const t=e.length-1,n=[];let i,r,s,o,a;for(i=0;iMath.abs(e[i][o])&&(o=r);for(s=i;s=i;s--)e[s][r]-=e[s][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(a=0,s=r+1;sr[v]-y?b:v;let _=0,E=0,w=0,C=0,k=0;const S=1/Math.abs(r[x]-y||1);for(let R=b;R<=v;++R){const D=r[R],A=s[R],M=BG(Math.abs(y-D)*S)*d[R],B=D*M;_+=M,E+=B,w+=A*M,C+=A*B,k+=D*B}const[$,O]=mf(E/_,w/_,C/_,k/_);c[m]=$+O*y,f[m]=Math.abs(s[m]-c[m]),UG(r,m+1,p)}if(h===n9)break;const g=p8(f);if(Math.abs(g)=1?i9:(b=1-y*y)*b}return jG(r,c,o,a)}function BG(e){return(e=1-e*e*e)*e*e}function UG(e,t,n){const i=e[t];let r=n[0],s=n[1]+1;if(!(s>=e.length))for(;t>r&&e[s]-i<=i-e[r];)n[0]=++r,n[1]=s,++s}function jG(e,t,n,i){const r=e.length,s=[];let o=0,a=0,u=[],l;for(;o[g,e(g)],s=t[0],o=t[1],a=o-s,u=a/i,l=[r(s)],c=[];if(n===i){for(let g=1;g0;)c.push(r(s+g/n*a))}let f=l[0],d=c[c.length-1];const h=1/a,p=WG(f[1],c);for(;d;){const g=r((f[0]+d[0])/2);g[0]-f[0]>=u&&HG(f,g,d,h,p)>qG?c.push(g):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function WG(e,t){let n=e,i=e;const r=t.length;for(let s=0;si&&(i=o)}return 1/(i-n)}function HG(e,t,n,i,r){const s=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),o=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(s-o)}function GG(e){return t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i{},VG={init:Oy,add:Oy,rem:Oy,idx:0},bf={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},vf=Object.keys(bf).filter(e=>e!=="__count__");function YG(e,t){return(n,i)=>Ie({name:e,aggregate_param:i,out:n||e},VG,t)}[...vf,"__count__"].forEach(e=>{bf[e]=YG(e,bf[e])});function o9(e,t,n){return bf[e](n,t)}function a9(e,t){return e.idx-t.idx}function XG(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=bf[r]())})};return e.forEach(n),Object.values(t).sort(a9)}function KG(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function ZG(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function JG(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function QG(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function u9(e,t){const n=t||En,i=XG(e),r=e.slice().sort(a9);function s(o){this._ops=i,this._out=r,this.cell=o,this.init()}return s.prototype.init=KG,s.prototype.add=ZG,s.prototype.rem=JG,s.prototype.set=QG,s.prototype.get=n,s.fields=e.map(o=>o.out),s}function Ly(e){this._key=e?Bi(e):_e,this.reset()}const fn=Ly.prototype;fn.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},fn.add=function(e){this._add.push(e)},fn.rem=function(e){this._rem.push(e)},fn.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,s=Array(i-r),o={};let a,u,l;for(a=0;a=0;)s=e(t[i])+"",ue(n,s)||(n[s]=1,++r);return r},fn.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=G4(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},fn.argmin=function(e){return this.extent(e)[0]||{}},fn.argmax=function(e){return this.extent(e)[1]||{}},fn.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0},fn.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0},fn.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=by(this.values(),e),this._get=e),this._q},fn.q1=function(e){return this.quartile(e)[0]},fn.q2=function(e){return this.quartile(e)[1]},fn.q3=function(e){return this.quartile(e)[2]},fn.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=GE(this.values(),1e3,.05,e),this._get=e),this._ci},fn.ci0=function(e){return this.ci(e)[0]},fn.ci1=function(e){return this.ci(e)[1]};function Do(e){P.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}Do.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:vf},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},te(Do,P,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,s=>n.add(s))):(n.value=n.value||n.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),i.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter(()=>this.clean()),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map(()=>({})),r=n.length;function s(a){let u,l,c,f;for(u in a)for(c=a[u].tuple,l=0;l{const v=Tt(b);return r(b),n.push(v),v}),this.cellkey=e.key?e.key:Ry(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const s=e.fields||[null],o=e.ops||["count"],a=e.aggregate_params||[null],u=e.as||[],l=s.length,c={};let f,d,h,p,g,m,y;for(l!==o.length&&q("Unmatched number of fields and aggregate ops."),y=0;yu9(b,b.field)),Object.create(null)},cellkey:Ry(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp{const f=i(c);c[a]=f,c[u]=f==null?null:r+s*(1+(f-r)/s)}:c=>c[a]=i(c)),t.modifies(n?o:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=HE(e),i=n.step;let r=n.start,s=r+Math.ceil((n.stop-r)/i)*i,o,a;(o=e.anchor)!=null&&(a=o-(r+i*Math.floor((o-r)/i)),r+=a,s+=a);const u=function(l){let c=Cn(t(l));return c==null?null:cs?1/0:(c=Math.max(r,Math.min(c,s-i)),r+i*Math.floor(eV+(c-r)/i))};return u.start=r,u.stop=n.stop,u.step=i,this.value=ii(u,wn(t),e.name||"bin_"+Tt(t))}});function l9(e,t,n){const i=e;let r=t||[],s=n||[],o={},a=0;return{add:u=>s.push(u),remove:u=>o[i(u)]=++a,size:()=>r.length,data:(u,l)=>(a&&(r=r.filter(c=>!o[i(c)]),o={},a=0),l&&u&&r.sort(u),s.length&&(r=u?Z4(u,r,s.sort(u)):r.concat(s),s=[]),r)}}function Py(e){P.call(this,[],e)}Py.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},te(Py,P,{transform(e,t){const n=t.fork(t.ALL),i=l9(_e,this.value,n.materialize(n.ADD).add),r=e.sort,s=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(s),this.value=n.source=i.data(Ta(r),s),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function c9(e){xt.call(this,null,tV,e)}te(c9,xt);function tV(e){return this.value&&!e.modified()?this.value:k2(e.fields,e.orders)}function zy(e){P.call(this,null,e)}zy.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function nV(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}te(zy,P,{transform(e,t){const n=f=>d=>{for(var h=nV(a(d),e.case,s)||[],p,g=0,m=h.length;gr[f]=1+(r[f]||0)),c=n(f=>r[f]-=1);return i?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_parameterCheck(e,t){let n=!1;return(e.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),(e.modified("pattern")||!this._match)&&(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,i=this._tuples||(this._tuples={}),r=t[0],s=t[1],o=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,u,l;for(a in n)u=i[a],l=n[a]||0,!u&&l?(i[a]=u=it({}),u[r]=a,u[s]=l,o.add.push(u)):l===0?(u&&o.rem.push(u),n[a]=null,i[a]=null):u[s]!==l&&(u[s]=l,o.mod.push(u));return o.modifies(t)}});function By(e){P.call(this,null,e)}By.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},te(By,P,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],s=i[1],o=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return o?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=iV(a,r,s,e.filter||Ui)):n.mod=a,n.source=this.value,n.modifies(i)}});function iV(e,t,n,i){for(var r=[],s={},o=e.length,a=0,u,l;ah9(s,t))):typeof i[r]===d9&&i[r](e[r]);return i}function Uy(e){P.call(this,null,e)}const p9=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],oV={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:p9},{name:"weights",type:"number",array:!0}]};Uy.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:p9.concat(oV)},{name:"as",type:"string",array:!0,default:["value","density"]}]},te(Uy,P,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=h9(e.distribution,aV(t)),r=e.steps||e.minsteps||25,s=e.steps||e.maxsteps||200;let o=e.method||"pdf";o!=="pdf"&&o!=="cdf"&&q("Invalid density method: "+o),!e.extent&&!i.data&&q("Missing density extent parameter."),o=i[o];const a=e.as||["value","density"],u=e.extent||qr(i.data()),l=S0(o,u,r,s).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],it(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function aV(e){return()=>e.materialize(e.SOURCE).source}function g9(e,t){return e?e.map((n,i)=>t[i]||Tt(n)):null}function jy(e,t,n){const i=[],r=f=>f(u);let s,o,a,u,l,c;if(t==null)i.push(e.map(n));else for(s={},o=0,a=e.length;oXc(qr(e,t))/30;te(qy,P,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=jy(t.source,e.groupby,En),r=e.smooth||!1,s=e.field,o=e.step||uV(n,s),a=Ta((p,g)=>s(p)-s(g)),u=e.as||m9,l=i.length;let c=1/0,f=-1/0,d=0,h;for(;df&&(f=g),p[++h][u]=g}return this.value={start:c,stop:f,step:o},t.reflow(!0).modifies(u)}});function y9(e){xt.call(this,null,lV,e),this.modified(!0)}te(y9,xt);function lV(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:ii(n=>t(n,e),wn(t),Tt(t))}function Wy(e){P.call(this,[void 0,void 0],e)}Wy.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},te(Wy,P,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let s=n[0],o=n[1];if((r||s==null)&&(s=1/0,o=-1/0),t.visit(r?t.SOURCE:t.ADD,a=>{const u=Cn(i(a));u!=null&&(uo&&(o=u))}),!Number.isFinite(s)||!Number.isFinite(o)){let a=Tt(i);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${s}, ${o}]`),s=o=void 0}this.value=[s,o]}});function Hy(e,t){xt.call(this,e),this.parent=t,this.count=0}te(Hy,xt,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}});function F0(e){P.call(this,{},e),this._keys=sl();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let i=0,r=t.active;ii&&i.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;rthis.subflow(u,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,u=>{const l=_e(u),c=s.get(l);c!==void 0&&(s.delete(l),a(c).rem(u))}),t.visit(t.ADD,u=>{const l=i(u);s.set(_e(u),l),a(l).add(u)}),o||t.modified(i.fields)?t.visit(t.MOD,u=>{const l=_e(u),c=s.get(l),f=i(u);c===f?a(f).mod(u):(s.set(l,f),a(c).rem(u),a(f).add(u))}):t.changed(t.MOD)&&t.visit(t.MOD,u=>{a(s.get(_e(u))).mod(u)}),o&&t.visit(t.REFLOW,u=>{const l=_e(u),c=s.get(l),f=i(u);c!==f&&(s.set(l,f),a(c).rem(u),a(f).add(u))}),t.clean()?n.runAfter(()=>{this.clean(),s.clean()}):s.empty>n.cleanThreshold&&n.runAfter(s.clean),t}});function b9(e){xt.call(this,null,cV,e)}te(b9,xt);function cV(e){return this.value&&!e.modified()?this.value:W(e.name)?oe(e.name).map(t=>Bi(t)):Bi(e.name,e.as)}function Gy(e){P.call(this,sl(),e)}Gy.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},te(Gy,P,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),s=r.add,o=r.rem,a=r.mod,u=e.expr;let l=!0;t.visit(t.REM,f=>{const d=_e(f);i.has(d)?i.delete(d):o.push(f)}),t.visit(t.ADD,f=>{u(f,e)?s.push(f):i.set(_e(f),1)});function c(f){const d=_e(f),h=u(f,e),p=i.get(d);h&&p?(i.delete(d),s.push(f)):!h&&!p?(i.set(d,1),o.push(f)):l&&h&&!p&&a.push(f)}return t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}});function Vy(e){P.call(this,[],e)}Vy.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},te(Vy,P,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=g9(i,e.as||[]),s=e.index||null,o=r.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const u=i.map(p=>p(a)),l=u.reduce((p,g)=>Math.max(p,g.length),0);let c=0,f,d,h;for(;c{for(let c=0,f;co[i]=n(o,e))}});function v9(e){P.call(this,[],e)}te(v9,P,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r=this.value,s=e.size-r.length,o,a,u;if(s>0){for(o=[];--s>=0;)o.push(u=it(i(e))),r.push(u);n.add=n.add.length?n.materialize(n.ADD).add.concat(o):o}else a=r.slice(0,-s),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,r=r.slice(-s);return n.source=this.value=r,n}});const D0={value:"value",median:p8,mean:Gq,min:P2,max:Aa},fV=[];function Ky(e){P.call(this,[],e)}Ky.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function dV(e){var t=e.method||D0.value,n;if(D0[t]==null)q("Unrecognized imputation method: "+t);else return t===D0.value?(n=e.value!==void 0?e.value:0,()=>n):D0[t]}function hV(e){const t=e.field;return n=>n?t(n):NaN}te(Ky,P,{transform(e,t){var n=t.fork(t.ALL),i=dV(e),r=hV(e),s=Tt(e.field),o=Tt(e.key),a=(e.groupby||[]).map(Tt),u=pV(t.source,e.groupby,e.key,e.keyvals),l=[],c=this.value,f=u.domain.length,d,h,p,g,m,y,b,v,x,_;for(m=0,v=u.length;my(m),s=[],o=i?i.slice():[],a={},u={},l,c,f,d,h,p,g,m;for(o.forEach((y,b)=>a[y]=b+1),d=0,g=e.length;dn.add(s))):(r=n.value=n.value||this.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),n.changes(),t.visit(t.SOURCE,s=>{Ie(s,r[n.cellkey(s)].tuple)}),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n{const p=wy(h,o)[a],g=e.counts?h.length:1,m=c||qr(h);S0(p,m,f,d).forEach(y=>{const b={};for(let v=0;v(this._pending=oe(r.data),s=>s.touch(this)))}:n.request(e.url,e.format).then(i=>Qy(this,t,oe(i.data)))}});function mV(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function Qy(e,t,n){n.forEach(it);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function eb(e){P.call(this,{},e)}eb.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},te(eb,P,{transform(e,t){const n=e.fields,i=e.index,r=e.values,s=e.default==null?null:e.default,o=e.modified(),a=n.length;let u=o?t.SOURCE:t.ADD,l=t,c=e.as,f,d,h;return r?(d=r.length,a>1&&!c&&q('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&q('The "as" parameter has too few output field names.'),c=c||r.map(Tt),f=function(p){for(var g=0,m=0,y,b;gt.modified(p.fields)),u|=h?t.MOD:0),t.visit(u,f),l.modifies(c)}});function w9(e){xt.call(this,null,yV,e)}te(w9,xt);function yV(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i=1/0,r=-1/0,s,o;for(s=0;sr&&(r=o[1]);return[i,r]}function E9(e){xt.call(this,null,bV,e)}te(E9,xt);function bV(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function C9(e){P.call(this,null,e)}te(C9,P,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function tb(e){Do.call(this,e)}tb.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:vf,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},te(tb,Do,{_transform:Do.prototype.transform,transform(e,t){return this._transform(vV(e,t),t)}});function vV(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",s=wn(n).concat(wn(i)),o=_V(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:o.map(()=>r),fields:o.map(a=>xV(a,n,i,s)),as:o.map(a=>a+""),modified:e.modified.bind(e)}}function xV(e,t,n,i){return ii(r=>t(r)===e?n(r):NaN,i,e+"")}function _V(e,t,n){const i={},r=[];return n.visit(n.SOURCE,s=>{const o=e(s);i[o]||(i[o]=1,r.push(o))}),r.sort(rl),t?r.slice(0,t):r}function k9(e){F0.call(this,e)}te(k9,F0,{transform(e,t){const n=e.subflow,i=e.field,r=s=>this.subflow(_e(s),n,t,s);return(e.modified("field")||i&&t.modified(wn(i)))&&q("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,s=>{const o=r(s);i(s).forEach(a=>o.mod(a))}),t.visit(t.ADD,s=>{const o=r(s);i(s).forEach(a=>o.add(it(a)))}),t.visit(t.REM,s=>{const o=r(s);i(s).forEach(a=>o.rem(a))})):(t.visit(t.MOD,s=>r(s).mod(s)),t.visit(t.ADD,s=>r(s).add(s)),t.visit(t.REM,s=>r(s).rem(s))),t.clean()&&t.runAfter(()=>this.clean()),t}});function nb(e){P.call(this,null,e)}nb.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},te(nb,P,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=g9(e.fields,e.as||[]),s=i?(a,u)=>wV(a,u,i,r):b0;let o;return this.value?o=this.value:(t=t.addAll(),o=this.value={}),t.visit(t.REM,a=>{const u=_e(a);n.rem.push(o[u]),o[u]=null}),t.visit(t.ADD,a=>{const u=s(a,it({}));o[_e(a)]=u,n.add.push(u)}),t.visit(t.MOD,a=>{n.mod.push(s(a,o[_e(a)]))}),n}});function wV(e,t,n,i){for(let r=0,s=n.length;r{const d=yy(f,l);for(let h=0;h{const s=_e(r);n.rem.push(i[s]),i[s]=null}),t.visit(t.ADD,r=>{const s=hy(r);i[_e(r)]=s,n.add.push(s)}),t.visit(t.MOD,r=>{const s=i[_e(r)];for(const o in r)s[o]=r[o],n.modifies(o);n.mod.push(s)})),n}});function rb(e){P.call(this,[],e),this.count=0}rb.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},te(rb,P,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,s=this.value.reduce((c,f)=>(c[_e(f)]=1,c),{});let o=this.value,a=this.count,u=0;function l(c){let f,d;o.length=u&&(f=o[d],s[_e(f)]&&n.rem.push(f),o[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=_e(c);s[f]&&(s[f]=-1,n.rem.push(c)),--a}),o=o.filter(c=>s[_e(c)]!==-1)),(t.rem.length||i)&&o.length{s[_e(c)]||l(c)}),u=-1),i&&o.length>r){const c=o.length-r;for(let f=0;f{s[_e(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=o.filter(c=>!s[_e(c)])),this.count=a,this.value=n.source=o,n}});function sb(e){P.call(this,null,e)}sb.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},te(sb,P,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Ei(e.start,e.stop,e.step||1).map(r=>{const s={};return s[i]=r,it(s)}),n.add=t.add.concat(this.value),n}});function S9(e){P.call(this,null,e),this.modified(!0)}te(S9,P,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function ob(e){P.call(this,null,e)}const F9=["unit0","unit1"];ob.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:G2,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:F9}]},te(ob,P,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",s=this._floor(e,t),o=(r?ml:gl)(s.unit).offset,a=e.as||F9,u=a[0],l=a[1],c=s.step;let f=s.start||1/0,d=s.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(wn(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,p=>{const g=n(p);let m,y;g==null?(p[u]=null,i&&(p[l]=null)):(p[u]=m=y=s(g),i&&(p[l]=y=o(m,c)),md&&(d=y))}),s.start=f,s.stop=d,t.modifies(i?a:u)},_floor(e,t){const n=e.timezone==="utc",{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:K8({extent:e.extent||qr(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),s=Y2(i),o=this.value||{},a=(n?z8:P8)(s,r);return a.unit=Ge(s),a.units=s,a.step=r,a.start=o.start,a.stop=o.stop,this.value=a}});function D9(e){P.call(this,sl(),e)}te(D9,P,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,s=a=>r.set(i(a),a);let o=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,s)):t.changed()?(t.visit(t.REM,a=>r.delete(i(a))),t.visit(t.ADD,s)):o=!1,this.modified(o),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}});function T9(e){P.call(this,null,e)}te(T9,P,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(Ta(e.sort)):t.source).map(e.field))}});function CV(e,t,n,i){const r=xf[e](t,n);return{init:r.init||bo,update:function(s,o){o[i]=r.next(s)}}}const xf={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=xf.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e0||q("ntile num must be greater than zero.");const n=xf.cume_dist(),i=n.next;return{init:n.init,next:r=>Math.ceil(t*i(r))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return ie(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||q("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return it=null,next:n=>{const i=e(n.data[n.index]);return i!=null?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=kV(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function kV(e,t,n){for(let i=t.length;nu[g]=1)}h(e.sort),t.forEach((p,g)=>{const m=n[g],y=i[g],b=r[g]||null,v=Tt(m),x=s9(p,v,s[g]);if(h(m),o.push(x),ue(xf,p))a.push(CV(p,m,y,x));else{if(m==null&&p!=="count"&&q("Null aggregate field specified."),p==="count"){c.push(x);return}d=!1;let _=l[v];_||(_=l[v]=[],_.field=m,f.push(_)),_.push(o9(p,b,x))}}),(c.length||f.length)&&(this.cell=$V(f,c,d)),this.inputs=Object.keys(u)}const N9=M9.prototype;N9.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()},N9.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,s=i&&i.length;let o;if(n){for(o=e.p0;ou9(u,u.field));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,s=i.agg=Array(r),o=0;othis.group(r(a));let o=this.state;(!o||n)&&(o=this.state=new M9(e)),n||t.modified(o.inputs)?(this.value={},t.visit(t.SOURCE,a=>s(a).add(a))):(t.visit(t.REM,a=>s(a).remove(a)),t.visit(t.ADD,a=>s(a).add(a)));for(let a=0,u=this._mlen;a0&&!r(s[n],s[n-1])&&(e.i0=t.left(s,s[n])),i1?0:e<-1?wl:Math.acos(e)}function L9(e){return e>=1?T0:e<=-1?-T0:Math.asin(e)}const lb=Math.PI,cb=2*lb,Ra=1e-6,RV=cb-Ra;function I9(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return I9;const n=10**t;return function(i){this._+=i[0];for(let r=1,s=i.length;rRa)if(!(Math.abs(f*u-l*c)>Ra)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let h=i-o,p=r-a,g=u*u+l*l,m=h*h+p*p,y=Math.sqrt(g),b=Math.sqrt(d),v=s*Math.tan((lb-Math.acos((g+d-m)/(2*y*b)))/2),x=v/b,_=v/y;Math.abs(x-1)>Ra&&this._append`L${t+x*c},${n+x*f}`,this._append`A${s},${s},0,0,${+(f*h>c*p)},${this._x1=t+_*u},${this._y1=n+_*l}`}}arc(t,n,i,r,s,o){if(t=+t,n=+n,i=+i,o=!!o,i<0)throw new Error(`negative radius: ${i}`);let a=i*Math.cos(r),u=i*Math.sin(r),l=t+a,c=n+u,f=1^o,d=o?r-s:s-r;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Ra||Math.abs(this._y1-c)>Ra)&&this._append`L${l},${c}`,i&&(d<0&&(d=d%cb+cb),d>RV?this._append`A${i},${i},0,1,${f},${t-a},${n-u}A${i},${i},0,1,${f},${this._x1=l},${this._y1=c}`:d>Ra&&this._append`A${i},${i},0,${+(d>=lb)},${f},${this._x1=t+i*Math.cos(s)},${this._y1=n+i*Math.sin(s)}`)}rect(t,n,i,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}};function M0(){return new fb}M0.prototype=fb.prototype;function N0(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new fb(t)}function LV(e){return e.innerRadius}function IV(e){return e.outerRadius}function PV(e){return e.startAngle}function zV(e){return e.endAngle}function BV(e){return e&&e.padAngle}function UV(e,t,n,i,r,s,o,a){var u=n-e,l=i-t,c=o-r,f=a-s,d=f*u-c*l;if(!(d*dD*D+A*A&&(C=S,k=$),{cx:C,cy:k,x01:-c,y01:-f,x11:C*(r/_-1),y11:k*(r/_-1)}}function jV(){var e=LV,t=IV,n=st(0),i=null,r=PV,s=zV,o=BV,a=null,u=N0(l);function l(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=r.apply(this,arguments)-T0,g=s.apply(this,arguments)-T0,m=R9(g-p),y=g>p;if(a||(a=c=u()),hFn))a.moveTo(0,0);else if(m>O9-Fn)a.moveTo(h*Ma(p),h*Yr(p)),a.arc(0,0,h,p,g,!y),d>Fn&&(a.moveTo(d*Ma(g),d*Yr(g)),a.arc(0,0,d,g,p,y));else{var b=p,v=g,x=p,_=g,E=m,w=m,C=o.apply(this,arguments)/2,k=C>Fn&&(i?+i.apply(this,arguments):Na(d*d+h*h)),S=ub(R9(h-d)/2,+n.apply(this,arguments)),$=S,O=S,R,D;if(k>Fn){var A=L9(k/d*Yr(C)),M=L9(k/h*Yr(C));(E-=A*2)>Fn?(A*=y?1:-1,x+=A,_-=A):(E=0,x=_=(p+g)/2),(w-=M*2)>Fn?(M*=y?1:-1,b+=M,v-=M):(w=0,b=v=(p+g)/2)}var B=h*Ma(b),G=h*Yr(b),z=d*Ma(_),ie=d*Yr(_);if(S>Fn){var xe=h*Ma(v),he=h*Yr(v),Te=d*Ma(x),ft=d*Yr(x),Fe;if(mFn?O>Fn?(R=R0(Te,ft,B,G,h,O,y),D=R0(xe,he,z,ie,h,O,y),a.moveTo(R.cx+R.x01,R.cy+R.y01),OFn)||!(E>Fn)?a.lineTo(z,ie):$>Fn?(R=R0(z,ie,xe,he,d,-$,y),D=R0(B,G,Te,ft,d,-$,y),a.lineTo(R.cx+R.x01,R.cy+R.y01),$=h;--p)a.point(v[p],x[p]);a.lineEnd(),a.areaEnd()}y&&(v[d]=+e(m,d,f),x[d]=+t(m,d,f),a.point(i?+i(m,d,f):v[d],n?+n(m,d,f):x[d]))}if(b)return a=null,b+""||null}function c(){return j9().defined(r).curve(o).context(s)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:st(+f),i=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:st(+f),l):e},l.x1=function(f){return arguments.length?(i=f==null?null:typeof f=="function"?f:st(+f),l):i},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:st(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:st(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:st(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(i).y(t)},l.defined=function(f){return arguments.length?(r=typeof f=="function"?f:st(!!f),l):r},l.curve=function(f){return arguments.length?(o=f,s!=null&&(a=o(s)),l):o},l.context=function(f){return arguments.length?(f==null?s=a=null:a=o(s=f),l):s},l}const qV={draw(e,t){const n=Na(t/wl);e.moveTo(n,0),e.arc(0,0,n,0,O9)}};function WV(e,t){let n=null,i=N0(r);e=typeof e=="function"?e:st(e||qV),t=typeof t=="function"?t:st(t===void 0?64:+t);function r(){let s;if(n||(n=s=i()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return r.type=function(s){return arguments.length?(e=typeof s=="function"?s:st(s),r):e},r.size=function(s){return arguments.length?(t=typeof s=="function"?s:st(+s),r):t},r.context=function(s){return arguments.length?(n=s??null,r):n},r}function To(){}function O0(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function L0(e){this._context=e}L0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:O0(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:O0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function HV(e){return new L0(e)}function W9(e){this._context=e}W9.prototype={areaStart:To,areaEnd:To,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:O0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function GV(e){return new W9(e)}function H9(e){this._context=e}H9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:O0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function VV(e){return new H9(e)}function G9(e,t){this._basis=new L0(e),this._beta=t}G9.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var i=e[0],r=t[0],s=e[n]-i,o=t[n]-r,a=-1,u;++a<=n;)u=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(i+u*s),this._beta*t[a]+(1-this._beta)*(r+u*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const YV=function e(t){function n(i){return t===1?new L0(i):new G9(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function I0(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function hb(e,t){this._context=e,this._k=(1-t)/6}hb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:I0(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:I0(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const XV=function e(t){function n(i){return new hb(i,t)}return n.tension=function(i){return e(+i)},n}(0);function pb(e,t){this._context=e,this._k=(1-t)/6}pb.prototype={areaStart:To,areaEnd:To,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:I0(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const KV=function e(t){function n(i){return new pb(i,t)}return n.tension=function(i){return e(+i)},n}(0);function gb(e,t){this._context=e,this._k=(1-t)/6}gb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:I0(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const ZV=function e(t){function n(i){return new gb(i,t)}return n.tension=function(i){return e(+i)},n}(0);function mb(e,t,n){var i=e._x1,r=e._y1,s=e._x2,o=e._y2;if(e._l01_a>Fn){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>Fn){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*l+e._x1*e._l23_2a-t*e._l12_2a)/c,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(i,r,s,o,e._x2,e._y2)}function V9(e,t){this._context=e,this._alpha=t}V9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:mb(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const JV=function e(t){function n(i){return t?new V9(i,t):new hb(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function Y9(e,t){this._context=e,this._alpha=t}Y9.prototype={areaStart:To,areaEnd:To,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:mb(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const QV=function e(t){function n(i){return t?new Y9(i,t):new pb(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function X9(e,t){this._context=e,this._alpha=t}X9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:mb(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const eY=function e(t){function n(i){return t?new X9(i,t):new gb(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function K9(e){this._context=e}K9.prototype={areaStart:To,areaEnd:To,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function tY(e){return new K9(e)}function Z9(e){return e<0?-1:1}function J9(e,t,n){var i=e._x1-e._x0,r=t-e._x1,s=(e._y1-e._y0)/(i||r<0&&-0),o=(n-e._y1)/(r||i<0&&-0),a=(s*r+o*i)/(i+r);return(Z9(s)+Z9(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function Q9(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function yb(e,t,n){var i=e._x0,r=e._y0,s=e._x1,o=e._y1,a=(s-i)/3;e._context.bezierCurveTo(i+a,r+a*t,s-a,o-a*n,s,o)}function P0(e){this._context=e}P0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:yb(this,this._t0,Q9(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,yb(this,Q9(this,n=J9(this,e,t)),n);break;default:yb(this,this._t0,n=J9(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function eC(e){this._context=new tC(e)}(eC.prototype=Object.create(P0.prototype)).point=function(e,t){P0.prototype.point.call(this,t,e)};function tC(e){this._context=e}tC.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,s){this._context.bezierCurveTo(t,e,i,n,s,r)}};function nY(e){return new P0(e)}function iY(e){return new eC(e)}function nC(e){this._context=e}nC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var i=iC(e),r=iC(t),s=0,o=1;o=0;--t)r[t]=(o[t]-r[t+1])/s[t];for(s[n-1]=(e[n]+r[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function sY(e){return new z0(e,.5)}function oY(e){return new z0(e,0)}function aY(e){return new z0(e,1)}function Mo(e,t){if(typeof document<"u"&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const uY=()=>typeof Image<"u"?Image:null;function Xr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function No(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const bb=Symbol("implicit");function vb(){var e=new a8,t=[],n=[],i=bb;function r(s){let o=e.get(s);if(o===void 0){if(i!==bb)return i;e.set(s,o=t.push(s)-1)}return n[o%n.length]}return r.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new a8;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return r},r.range=function(s){return arguments.length?(n=Array.from(s),r):n.slice()},r.unknown=function(s){return arguments.length?(i=s,r):i},r.copy=function(){return vb(t,n).unknown(i)},Xr.apply(r,arguments),r}function El(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _f(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Ro(){}var Oa=.7,Cl=1/Oa,kl="\\s*([+-]?\\d+)\\s*",wf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Kr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",lY=/^#([0-9a-f]{3,8})$/,cY=new RegExp(`^rgb\\(${kl},${kl},${kl}\\)$`),fY=new RegExp(`^rgb\\(${Kr},${Kr},${Kr}\\)$`),dY=new RegExp(`^rgba\\(${kl},${kl},${kl},${wf}\\)$`),hY=new RegExp(`^rgba\\(${Kr},${Kr},${Kr},${wf}\\)$`),pY=new RegExp(`^hsl\\(${wf},${Kr},${Kr}\\)$`),gY=new RegExp(`^hsla\\(${wf},${Kr},${Kr},${wf}\\)$`),rC={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};El(Ro,Ef,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:sC,formatHex:sC,formatHex8:mY,formatHsl:yY,formatRgb:oC,toString:oC});function sC(){return this.rgb().formatHex()}function mY(){return this.rgb().formatHex8()}function yY(){return fC(this).formatHsl()}function oC(){return this.rgb().formatRgb()}function Ef(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=lY.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?aC(t):n===3?new Jt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?B0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?B0(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=cY.exec(e))?new Jt(t[1],t[2],t[3],1):(t=fY.exec(e))?new Jt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=dY.exec(e))?B0(t[1],t[2],t[3],t[4]):(t=hY.exec(e))?B0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=pY.exec(e))?cC(t[1],t[2]/100,t[3]/100,1):(t=gY.exec(e))?cC(t[1],t[2]/100,t[3]/100,t[4]):rC.hasOwnProperty(e)?aC(rC[e]):e==="transparent"?new Jt(NaN,NaN,NaN,0):null}function aC(e){return new Jt(e>>16&255,e>>8&255,e&255,1)}function B0(e,t,n,i){return i<=0&&(e=t=n=NaN),new Jt(e,t,n,i)}function xb(e){return e instanceof Ro||(e=Ef(e)),e?(e=e.rgb(),new Jt(e.r,e.g,e.b,e.opacity)):new Jt}function Oo(e,t,n,i){return arguments.length===1?xb(e):new Jt(e,t,n,i??1)}function Jt(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}El(Jt,Oo,_f(Ro,{brighter(e){return e=e==null?Cl:Math.pow(Cl,e),new Jt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Oa:Math.pow(Oa,e),new Jt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Jt(La(this.r),La(this.g),La(this.b),U0(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:uC,formatHex:uC,formatHex8:bY,formatRgb:lC,toString:lC}));function uC(){return`#${Ia(this.r)}${Ia(this.g)}${Ia(this.b)}`}function bY(){return`#${Ia(this.r)}${Ia(this.g)}${Ia(this.b)}${Ia((isNaN(this.opacity)?1:this.opacity)*255)}`}function lC(){const e=U0(this.opacity);return`${e===1?"rgb(":"rgba("}${La(this.r)}, ${La(this.g)}, ${La(this.b)}${e===1?")":`, ${e})`}`}function U0(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function La(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ia(e){return e=La(e),(e<16?"0":"")+e.toString(16)}function cC(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fr(e,t,n,i)}function fC(e){if(e instanceof fr)return new fr(e.h,e.s,e.l,e.opacity);if(e instanceof Ro||(e=Ef(e)),!e)return new fr;if(e instanceof fr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),o=NaN,a=s-r,u=(s+r)/2;return a?(t===s?o=(n-i)/a+(n0&&u<1?0:o,new fr(o,a,u,e.opacity)}function j0(e,t,n,i){return arguments.length===1?fC(e):new fr(e,t,n,i??1)}function fr(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}El(fr,j0,_f(Ro,{brighter(e){return e=e==null?Cl:Math.pow(Cl,e),new fr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Oa:Math.pow(Oa,e),new fr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new Jt(_b(e>=240?e-240:e+120,r,i),_b(e,r,i),_b(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new fr(dC(this.h),q0(this.s),q0(this.l),U0(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=U0(this.opacity);return`${e===1?"hsl(":"hsla("}${dC(this.h)}, ${q0(this.s)*100}%, ${q0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function dC(e){return e=(e||0)%360,e<0?e+360:e}function q0(e){return Math.max(0,Math.min(1,e||0))}function _b(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const hC=Math.PI/180,pC=180/Math.PI,W0=18,gC=.96422,mC=1,yC=.82521,bC=4/29,Al=6/29,vC=3*Al*Al,vY=Al*Al*Al;function xC(e){if(e instanceof Zr)return new Zr(e.l,e.a,e.b,e.opacity);if(e instanceof Is)return _C(e);e instanceof Jt||(e=xb(e));var t=kb(e.r),n=kb(e.g),i=kb(e.b),r=wb((.2225045*t+.7168786*n+.0606169*i)/mC),s,o;return t===n&&n===i?s=o=r:(s=wb((.4360747*t+.3850649*n+.1430804*i)/gC),o=wb((.0139322*t+.0971045*n+.7141733*i)/yC)),new Zr(116*r-16,500*(s-r),200*(r-o),e.opacity)}function H0(e,t,n,i){return arguments.length===1?xC(e):new Zr(e,t,n,i??1)}function Zr(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}El(Zr,H0,_f(Ro,{brighter(e){return new Zr(this.l+W0*(e??1),this.a,this.b,this.opacity)},darker(e){return new Zr(this.l-W0*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=gC*Eb(t),e=mC*Eb(e),n=yC*Eb(n),new Jt(Cb(3.1338561*t-1.6168667*e-.4906146*n),Cb(-.9787684*t+1.9161415*e+.033454*n),Cb(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function wb(e){return e>vY?Math.pow(e,1/3):e/vC+bC}function Eb(e){return e>Al?e*e*e:vC*(e-bC)}function Cb(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function kb(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function xY(e){if(e instanceof Is)return new Is(e.h,e.c,e.l,e.opacity);if(e instanceof Zr||(e=xC(e)),e.a===0&&e.b===0)return new Is(NaN,0=1?(n=1,t-1):Math.floor(n*t),r=e[i],s=e[i+1],o=i>0?e[i-1]:2*r-s,a=i()=>e;function FC(e,t){return function(n){return e+n*t}}function wY(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function X0(e,t){var n=t-e;return n?FC(e,n>180||n<-180?n-360*Math.round(n/360):n):Y0(isNaN(e)?t:e)}function EY(e){return(e=+e)==1?Qt:function(t,n){return n-t?wY(t,n,e):Y0(isNaN(t)?n:t)}}function Qt(e,t){var n=t-e;return n?FC(e,n):Y0(isNaN(e)?t:e)}const Fb=function e(t){var n=EY(t);function i(r,s){var o=n((r=Oo(r)).r,(s=Oo(s)).r),a=n(r.g,s.g),u=n(r.b,s.b),l=Qt(r.opacity,s.opacity);return function(c){return r.r=o(c),r.g=a(c),r.b=u(c),r.opacity=l(c),r+""}}return i.gamma=e,i}(1);function DC(e){return function(t){var n=t.length,i=new Array(n),r=new Array(n),s=new Array(n),o,a;for(o=0;on&&(s=t.slice(n,s),a[o]?a[o]+=s:a[++o]=s),(i=i[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,u.push({i:o,x:dr(i,r)})),n=Mb.lastIndex;return n180?c+=360:c-l>180&&(l+=360),d.push({i:f.push(r(f)+"rotate(",null,i)-2,x:dr(l,c)})):c&&f.push(r(f)+"rotate("+c+i)}function a(l,c,f,d){l!==c?d.push({i:f.push(r(f)+"skewX(",null,i)-2,x:dr(l,c)}):c&&f.push(r(f)+"skewX("+c+i)}function u(l,c,f,d,h,p){if(l!==f||c!==d){var g=h.push(r(h)+"scale(",null,",",null,")");p.push({i:g-4,x:dr(l,f)},{i:g-2,x:dr(c,d)})}else(f!==1||d!==1)&&h.push(r(h)+"scale("+f+","+d+")")}return function(l,c){var f=[],d=[];return l=e(l),c=e(c),s(l.translateX,l.translateY,c.translateX,c.translateY,f,d),o(l.rotate,c.rotate,f,d),a(l.skewX,c.skewX,f,d),u(l.scaleX,l.scaleY,c.scaleX,c.scaleY,f,d),l=c=null,function(h){for(var p=-1,g=d.length,m;++pt&&(n=e,e=t,t=n),function(i){return Math.max(e,Math.min(t,i))}}function KY(e,t,n){var i=e[0],r=e[1],s=t[0],o=t[1];return r2?ZY:KY,u=l=null,f}function f(d){return d==null||isNaN(d=+d)?s:(u||(u=a(e.map(i),t,n)))(i(o(d)))}return f.invert=function(d){return o(r((l||(l=a(t,e.map(i),dr)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,Ob),c()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=kf,c()},f.clamp=function(d){return arguments.length?(o=d?!0:ai,c()):o!==ai},f.interpolate=function(d){return arguments.length?(n=d,c()):n},f.unknown=function(d){return arguments.length?(s=d,f):s},function(d,h){return i=d,r=h,c()}}function WC(){return Z0()(ai,ai)}function HC(e,t,n,i){var r=Co(e,t,n),s;switch(i=$a(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return i.precision==null&&!isNaN(s=k8(r,o))&&(i.precision=s),U2(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(s=A8(r,Math.max(Math.abs(e),Math.abs(t))))&&(i.precision=s-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(s=C8(r))&&(i.precision=s-(i.type==="%")*2);break}}return i0(i)}function za(e){var t=e.domain;return e.ticks=function(n){var i=t();return L2(i[0],i[i.length-1],n??10)},e.tickFormat=function(n,i){var r=t();return HC(r[0],r[r.length-1],n??10,i)},e.nice=function(n){n==null&&(n=10);var i=t(),r=0,s=i.length-1,o=i[r],a=i[s],u,l,c=10;for(a0;){if(l=I2(o,a,n),l===u)return i[r]=o,i[s]=a,t(i);if(l>0)o=Math.floor(o/l)*l,a=Math.ceil(a/l)*l;else if(l<0)o=Math.ceil(o*l)/l,a=Math.floor(a*l)/l;else break;u=l}return e},e}function GC(){var e=WC();return e.copy=function(){return Af(e,GC())},Xr.apply(e,arguments),za(e)}function VC(e){var t;function n(i){return i==null||isNaN(i=+i)?t:i}return n.invert=n,n.domain=n.range=function(i){return arguments.length?(e=Array.from(i,Ob),n):e.slice()},n.unknown=function(i){return arguments.length?(t=i,n):t},n.copy=function(){return VC(e).unknown(t)},e=arguments.length?Array.from(e,Ob):[0,1],za(n)}function YC(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],s=e[i],o;return sMath.pow(e,t)}function nX(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function ZC(e){return(t,n)=>-e(-t,n)}function Ib(e){const t=e(XC,KC),n=t.domain;let i=10,r,s;function o(){return r=nX(i),s=tX(i),n()[0]<0?(r=ZC(r),s=ZC(s),e(JY,QY)):e(XC,KC),t}return t.base=function(a){return arguments.length?(i=+a,o()):i},t.domain=function(a){return arguments.length?(n(a),o()):n()},t.ticks=a=>{const u=n();let l=u[0],c=u[u.length-1];const f=c0){for(;d<=h;++d)for(p=1;pc)break;y.push(g)}}else for(;d<=h;++d)for(p=i-1;p>=1;--p)if(g=d>0?p/s(-d):p*s(d),!(gc)break;y.push(g)}y.length*2{if(a==null&&(a=10),u==null&&(u=i===10?"s":","),typeof u!="function"&&(!(i%1)&&(u=$a(u)).precision==null&&(u.trim=!0),u=i0(u)),a===1/0)return u;const l=Math.max(1,i*a/t.ticks().length);return c=>{let f=c/s(Math.round(r(c)));return f*in(YC(n(),{floor:a=>s(Math.floor(r(a))),ceil:a=>s(Math.ceil(r(a)))})),t}function JC(){const e=Ib(Z0()).domain([1,10]);return e.copy=()=>Af(e,JC()).base(e.base()),Xr.apply(e,arguments),e}function QC(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function ek(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Pb(e){var t=1,n=e(QC(t),ek(t));return n.constant=function(i){return arguments.length?e(QC(t=+i),ek(t)):t},za(n)}function tk(){var e=Pb(Z0());return e.copy=function(){return Af(e,tk()).constant(e.constant())},Xr.apply(e,arguments)}function nk(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function iX(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function rX(e){return e<0?-e*e:e*e}function zb(e){var t=e(ai,ai),n=1;function i(){return n===1?e(ai,ai):n===.5?e(iX,rX):e(nk(n),nk(1/n))}return t.exponent=function(r){return arguments.length?(n=+r,i()):n},za(t)}function Bb(){var e=zb(Z0());return e.copy=function(){return Af(e,Bb()).exponent(e.exponent())},Xr.apply(e,arguments),e}function sX(){return Bb.apply(null,arguments).exponent(.5)}function ik(){var e=[],t=[],n=[],i;function r(){var o=0,a=Math.max(1,t.length);for(n=new Array(a-1);++o0?n[a-1]:e[0],a=n?[i[n-1],t]:[i[l-1],i[l]]},o.unknown=function(u){return arguments.length&&(s=u),o},o.thresholds=function(){return i.slice()},o.copy=function(){return rk().domain([e,t]).range(r).unknown(s)},Xr.apply(za(o),arguments)}function sk(){var e=[.5],t=[0,1],n,i=1;function r(s){return s!=null&&s<=s?t[Eo(e,s,0,i)]:n}return r.domain=function(s){return arguments.length?(e=Array.from(s),i=Math.min(e.length,t.length-1),r):e.slice()},r.range=function(s){return arguments.length?(t=Array.from(s),i=Math.min(e.length,t.length-1),r):t.slice()},r.invertExtent=function(s){var o=t.indexOf(s);return[e[o-1],e[o]]},r.unknown=function(s){return arguments.length?(n=s,r):n},r.copy=function(){return sk().domain(e).range(t).unknown(n)},Xr.apply(r,arguments)}function oX(e){return new Date(e)}function aX(e){return e instanceof Date?+e:+new Date(+e)}function Ub(e,t,n,i,r,s,o,a,u,l){var c=WC(),f=c.invert,d=c.domain,h=l(".%L"),p=l(":%S"),g=l("%I:%M"),m=l("%I %p"),y=l("%a %d"),b=l("%b %d"),v=l("%B"),x=l("%Y");function _(E){return(u(E)0?i:1:0}const wX="identity",$l="linear",Ps="log",$f="pow",Sf="sqrt",ep="symlog",Ba="time",Ua="utc",Qr="sequential",Sl="diverging",Fl="quantile",tp="quantize",np="threshold",Gb="ordinal",Vb="point",fk="band",Yb="bin-ordinal",Ht="continuous",Ff="discrete",Df="discretizing",Hi="interpolating",Xb="temporal";function EX(e){return function(t){let n=t[0],i=t[1],r;return i=i&&n[u]<=r&&(s<0&&(s=u),o=u);if(!(s<0))return i=e.invertExtent(n[s]),r=e.invertExtent(n[o]),[i[0]===void 0?i[1]:i[0],r[1]===void 0?r[0]:r[1]]}}function Kb(){const e=vb().unknown(void 0),t=e.domain,n=e.range;let i=[0,1],r,s,o=!1,a=0,u=0,l=.5;delete e.unknown;function c(){const f=t().length,d=i[1]g+r*y);return n(d?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),c()):t()},e.range=function(f){return arguments.length?(i=[+f[0],+f[1]],c()):i.slice()},e.rangeRound=function(f){return i=[+f[0],+f[1]],o=!0,c()},e.bandwidth=function(){return s},e.step=function(){return r},e.round=function(f){return arguments.length?(o=!!f,c()):o},e.padding=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),a=u,c()):a},e.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),c()):a},e.paddingOuter=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.align=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),c()):l},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=i[1]i[1-d])))return y=Math.max(0,Eo(h,g)-1),b=g===m?y:Eo(h,m)-1,g-h[y]>s+1e-10&&++y,d&&(v=y,y=p-b,b=p-v),y>b?void 0:t().slice(y,b+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return Kb().domain(t()).range(i).round(o).paddingInner(a).paddingOuter(u).align(l)},c()}function dk(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return dk(t())},e}function kX(){return dk(Kb().paddingInner(1))}var AX=Array.prototype.map;function $X(e){return AX.call(e,Cn)}const SX=Array.prototype.slice;function hk(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(Eo(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=$X(i),n):e.slice()},n.range=function(i){return arguments.length?(t=SX.call(i),n):t.slice()},n.tickFormat=function(i,r){return HC(e[0],Ge(e),i??10,r)},n.copy=function(){return hk().domain(n.domain()).range(n.range())},n}const ip=new Map,pk=Symbol("vega_scale");function gk(e){return e[pk]=!0,e}function mk(e){return e&&e[pk]===!0}function FX(e,t,n){const i=function(){const s=t();return s.invertRange||(s.invertRange=s.invert?EX(s):s.invertExtent?CX(s):void 0),s.type=e,gk(s)};return i.metadata=lr(oe(n)),i}function et(e,t,n){return arguments.length>1?(ip.set(e,FX(e,t,n)),this):yk(e)?ip.get(e):void 0}et(wX,VC),et($l,GC,Ht),et(Ps,JC,[Ht,Ps]),et($f,Bb,Ht),et(Sf,sX,Ht),et(ep,tk,Ht),et(Ba,uX,[Ht,Xb]),et(Ua,lX,[Ht,Xb]),et(Qr,jb,[Ht,Hi]),et(`${Qr}-${$l}`,jb,[Ht,Hi]),et(`${Qr}-${Ps}`,ok,[Ht,Hi,Ps]),et(`${Qr}-${$f}`,qb,[Ht,Hi]),et(`${Qr}-${Sf}`,cX,[Ht,Hi]),et(`${Qr}-${ep}`,ak,[Ht,Hi]),et(`${Sl}-${$l}`,uk,[Ht,Hi]),et(`${Sl}-${Ps}`,lk,[Ht,Hi,Ps]),et(`${Sl}-${$f}`,Wb,[Ht,Hi]),et(`${Sl}-${Sf}`,fX,[Ht,Hi]),et(`${Sl}-${ep}`,ck,[Ht,Hi]),et(Fl,ik,[Df,Fl]),et(tp,rk,Df),et(np,sk,Df),et(Yb,hk,[Ff,Df]),et(Gb,vb,Ff),et(fk,Kb,Ff),et(Vb,kX,Ff);function yk(e){return ip.has(e)}function ja(e,t){const n=ip.get(e);return n&&n.metadata[t]}function Zb(e){return ja(e,Ht)}function Dl(e){return ja(e,Ff)}function Jb(e){return ja(e,Df)}function bk(e){return ja(e,Ps)}function DX(e){return ja(e,Xb)}function vk(e){return ja(e,Hi)}function xk(e){return ja(e,Fl)}const TX=["clamp","base","constant","exponent"];function _k(e,t){const n=t[0],i=Ge(t)-n;return function(r){return e(n+r*i)}}function rp(e,t,n){return Rb(Qb(t||"rgb",n),e)}function wk(e,t){const n=new Array(t),i=t+1;for(let r=0;re[a]?o[a](e[a]()):0),o)}function Qb(e,t){const n=VY[MX(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function MX(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const NX={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},RX={accent:hX,category10:dX,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:pX,observable10:gX,paired:mX,pastel1:yX,pastel2:bX,set1:vX,set2:xX,set3:_X,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function Ck(e){if(W(e))return e;const t=e.length/6|0,n=new Array(t);for(let i=0;irp(Ck(e)));function e3(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(Ak[e]=t,this):Ak[e]}const sp="symbol",OX="discrete",LX="gradient",IX=e=>W(e)?e.map(t=>String(t)):String(e),PX=(e,t)=>e[1]-t[1],zX=(e,t)=>t[1]-e[1];function t3(e,t,n){let i;return Je(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(Xc(e.domain())/n||1)+1))),re(t)&&(i=t.step,t=t.interval),se(t)&&(t=e.type===Ba?gl(t):e.type==Ua?ml(t):q("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function $k(e,t,n){let i=e.range(),r=i[0],s=Ge(i),o=PX;if(r>s&&(i=s,s=r,r=i,o=zX),r=Math.floor(r),s=Math.ceil(s),t=t.map(a=>[a,e(a)]).filter(a=>r<=a[1]&&a[1]<=s).sort(o).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],Ge(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=a)}return t}function n3(e,t){return e.bins?$k(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function Sk(e,t,n,i,r,s){const o=t.type;let a=IX;if(o===Ba||r===Ba)a=e.timeFormat(i);else if(o===Ua||r===Ua)a=e.utcFormat(i);else if(bk(o)){const u=e.formatFloat(i);if(s||t.bins)a=u;else{const l=Fk(t,n,!1);a=c=>l(c)?u(c):""}}else if(t.tickFormat){const u=t.domain();a=e.formatSpan(u[0],u[u.length-1],n,i)}else i&&(a=e.format(i));return a}function Fk(e,t,n){const i=n3(e,t),r=e.base(),s=Math.log(r),o=Math.max(1,r*t/i.length),a=u=>{let l=u/Math.pow(r,Math.round(Math.log(u)/s));return l*r1?i[1]-i[0]:i[0],o;for(o=1;oi3[e.type]||e.bins;function Mk(e,t,n,i,r,s,o){const a=Dk[t.type]&&s!==Ba&&s!==Ua?BX(e,t,r):Sk(e,t,n,r,s,o);return i===sp&&qX(t)?WX(a):i===OX?HX(a):GX(a)}const WX=e=>(t,n,i)=>{const r=Nk(i[n+1],Nk(i.max,1/0)),s=Rk(t,e),o=Rk(r,e);return s&&o?s+" – "+o:o?"< "+o:"≥ "+s},Nk=(e,t)=>e??t,HX=e=>(t,n)=>n?e(t):null,GX=e=>t=>e(t),Rk=(e,t)=>Number.isFinite(e)?t(e):null;function VX(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+Ge(t),s=r-i;if(e.type===np){const o=n?s/n:.1;i-=o,r+=o,s=r-i}return o=>(o-i)/s}function YX(e,t,n,i){const r=i||t.type;return se(n)&&DX(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===Ba?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===Ua?e.utcFormat("%A, %d %B %Y, %X UTC"):Mk(e,t,5,null,n,i,!0)}function Ok(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=YX(e,t,n.format,n.formatType);if(Jb(t.type)){const s=Tk(t).slice(1).map(r),o=s.length;return`${o} boundar${o===1?"y":"ies"}: ${s.join(", ")}`}else if(Dl(t.type)){const s=t.domain(),o=s.length,a=o>i?s.slice(0,i-2).map(r).join(", ")+", ending with "+s.slice(-1).map(r):s.map(r).join(", ");return`${o} value${o===1?"":"s"}: ${a}`}else{const s=t.domain();return`values from ${r(s[0])} to ${r(Ge(s))}`}}let Lk=0;function XX(){Lk=0}const op="p_";function r3(e){return e&&e.gradient}function Ik(e,t,n){const i=e.gradient;let r=e.id,s=i==="radial"?op:"";return r||(r=e.id="gradient_"+Lk++,i==="radial"?(e.x1=es(e.x1,.5),e.y1=es(e.y1,.5),e.r1=es(e.r1,0),e.x2=es(e.x2,.5),e.y2=es(e.y2,.5),e.r2=es(e.r2,.5),s=op):(e.x1=es(e.x1,0),e.y1=es(e.y1,0),e.x2=es(e.x2,1),e.y2=es(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+s+r+")"}function es(e,t){return e??t}function Pk(e,t){var n=[],i;return i={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(r,s){return n.push({offset:r,color:s}),i}}}const zk={basis:{curve:HV},"basis-closed":{curve:GV},"basis-open":{curve:VV},bundle:{curve:YV,tension:"beta",value:.85},cardinal:{curve:XV,tension:"tension",value:0},"cardinal-open":{curve:ZV,tension:"tension",value:0},"cardinal-closed":{curve:KV,tension:"tension",value:0},"catmull-rom":{curve:JV,tension:"alpha",value:.5},"catmull-rom-closed":{curve:QV,tension:"alpha",value:.5},"catmull-rom-open":{curve:eY,tension:"alpha",value:.5},linear:{curve:db},"linear-closed":{curve:tY},monotone:{horizontal:iY,vertical:nY},natural:{curve:rY},step:{curve:sY},"step-after":{curve:aY},"step-before":{curve:oY}};function s3(e,t,n){var i=ue(zk,e)&&zk[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const KX={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},ZX=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,JX=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,QX=/^((\s+,?\s*)|(,\s*))/,eK=/^[01]/;function Tl(e){const t=[];return(e.match(ZX)||[]).forEach(i=>{let r=i[0];const s=r.toLowerCase(),o=KX[s],a=tK(s,o,i.slice(1).trim()),u=a.length;if(u1&&(g=Math.sqrt(g),n*=g,i*=g);const m=d/n,y=f/n,b=-f/i,v=d/i,x=m*a+y*u,_=b*a+v*u,E=m*e+y*t,w=b*e+v*t;let k=1/((E-x)*(E-x)+(w-_)*(w-_))-.25;k<0&&(k=0);let S=Math.sqrt(k);s==r&&(S=-S);const $=.5*(x+E)-S*(w-_),O=.5*(_+w)+S*(E-x),R=Math.atan2(_-O,x-$);let A=Math.atan2(w-O,E-$)-R;A<0&&s===1?A+=ts:A>0&&s===0&&(A-=ts);const M=Math.ceil(Math.abs(A/(qa+.001))),B=[];for(let G=0;G+e}function ap(e,t,n){return Math.max(t,Math.min(e,n))}function Hk(){var e=aK,t=uK,n=lK,i=cK,r=zs(0),s=r,o=r,a=r,u=null;function l(c,f,d){var h,p=f??+e.call(this,c),g=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,v=ap(+r.call(this,c),0,b),x=ap(+s.call(this,c),0,b),_=ap(+o.call(this,c),0,b),E=ap(+a.call(this,c),0,b);if(u||(u=h=M0()),v<=0&&x<=0&&_<=0&&E<=0)u.rect(p,g,m,y);else{var w=p+m,C=g+y;u.moveTo(p+v,g),u.lineTo(w-x,g),u.bezierCurveTo(w-zo*x,g,w,g+zo*x,w,g+x),u.lineTo(w,C-E),u.bezierCurveTo(w,C-zo*E,w-zo*E,C,w-E,C),u.lineTo(p+_,C),u.bezierCurveTo(p+zo*_,C,p,C-zo*_,p,C-_),u.lineTo(p,g+v),u.bezierCurveTo(p,g+zo*v,p+zo*v,g,p+v,g),u.closePath()}if(h)return u=null,h+""||null}return l.x=function(c){return arguments.length?(e=zs(c),l):e},l.y=function(c){return arguments.length?(t=zs(c),l):t},l.width=function(c){return arguments.length?(n=zs(c),l):n},l.height=function(c){return arguments.length?(i=zs(c),l):i},l.cornerRadius=function(c,f,d,h){return arguments.length?(r=zs(c),s=f!=null?zs(f):r,a=d!=null?zs(d):r,o=h!=null?zs(h):s,l):r},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function Gk(){var e,t,n,i,r=null,s,o,a,u;function l(f,d,h){const p=h/2;if(s){var g=a-d,m=f-o;if(g||m){var y=Math.hypot(g,m),b=(g/=y)*u,v=(m/=y)*u,x=Math.atan2(m,g);r.moveTo(o-b,a-v),r.lineTo(f-g*p,d-m*p),r.arc(f,d,p,x-Math.PI,x),r.lineTo(o+b,a+v),r.arc(o,a,u,x,x+Math.PI)}else r.arc(f,d,p,0,ts);r.closePath()}else s=1;o=f,a=d,u=p}function c(f){var d,h=f.length,p,g=!1,m;for(r==null&&(r=m=M0()),d=0;d<=h;++d)!(de.x||0,Rf=e=>e.y||0,fK=e=>e.width||0,dK=e=>e.height||0,hK=e=>(e.x||0)+(e.width||0),pK=e=>(e.y||0)+(e.height||0),gK=e=>e.startAngle||0,mK=e=>e.endAngle||0,yK=e=>e.padAngle||0,bK=e=>e.innerRadius||0,vK=e=>e.outerRadius||0,xK=e=>e.cornerRadius||0,_K=e=>Mf(e.cornerRadiusTopLeft,e.cornerRadius)||0,wK=e=>Mf(e.cornerRadiusTopRight,e.cornerRadius)||0,EK=e=>Mf(e.cornerRadiusBottomRight,e.cornerRadius)||0,CK=e=>Mf(e.cornerRadiusBottomLeft,e.cornerRadius)||0,kK=e=>Mf(e.size,64),AK=e=>e.size||1,up=e=>e.defined!==!1,$K=e=>Wk(e.shape||"circle"),SK=jV().startAngle(gK).endAngle(mK).padAngle(yK).innerRadius(bK).outerRadius(vK).cornerRadius(xK),FK=q9().x(Nf).y1(Rf).y0(pK).defined(up),DK=q9().y(Rf).x1(Nf).x0(hK).defined(up),TK=j9().x(Nf).y(Rf).defined(up),MK=Hk().x(Nf).y(Rf).width(fK).height(dK).cornerRadius(_K,wK,EK,CK),NK=WV().type($K).size(kK),RK=Gk().x(Nf).y(Rf).defined(up).size(AK);function l3(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function OK(e,t){return SK.context(e)(t)}function LK(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?DK:FK).curve(s3(i,n.orient,n.tension)).context(e)(t)}function IK(e,t){const n=t[0],i=n.interpolate||"linear";return TK.curve(s3(i,n.orient,n.tension)).context(e)(t)}function Nl(e,t,n,i){return MK.context(e)(t,n,i)}function PK(e,t){return(t.mark.shape||t.shape).context(e)(t)}function zK(e,t){return NK.context(e)(t)}function BK(e,t){return RK.context(e)(t)}var Vk=1;function Yk(){Vk=1}function c3(e,t,n){var i=t.clip,r=e._defs,s=t.clip_id||(t.clip_id="clip"+Vk++),o=r.clipping[s]||(r.clipping[s]={id:s});return Le(i)?o.path=i(null):l3(n)?o.path=Nl(null,n,0,0):(o.width=n.width||0,o.height=n.height||0),"url(#"+s+")"}function Ut(e){this.clear(),e&&this.union(e)}Ut.prototype={clone(){return new Ut(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,i){return nthis.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:s,y2:o}=this,a=Math.cos(e),u=Math.sin(e),l=t-t*a+n*u,c=n-t*u-n*a;return[a*i-u*r+l,u*i+a*r+c,a*i-u*o+l,u*i+a*o+c,a*s-u*r+l,u*s+a*r+c,a*s-u*o+l,u*s+a*o+c]},union(e){return e.x1this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function lp(e){this.mark=e,this.bounds=this.bounds||new Ut}function cp(e){lp.call(this,e),this.items=this.items||[]}te(cp,lp);class Xk{constructor(t){this._pending=0,this._loader=t||p0()}pending(){return this._pending}sanitizeURL(t){const n=this;return Kk(n),n._loader.sanitize(t,{context:"href"}).then(i=>(Of(n),i)).catch(()=>(Of(n),null))}loadImage(t){const n=this,i=uY();return Kk(n),n._loader.sanitize(t,{context:"image"}).then(r=>{const s=r.href;if(!s||!i)throw{url:s};const o=new i,a=ue(r,"crossOrigin")?r.crossOrigin:"anonymous";return a!=null&&(o.crossOrigin=a),o.onload=()=>Of(n),o.onerror=()=>Of(n),o.src=s,o}).catch(r=>(Of(n),{complete:!1,width:0,height:0,src:r&&r.url||""}))}ready(){const t=this;return new Promise(n=>{function i(r){t.pending()?setTimeout(()=>{i(!0)},10):n(r)}i(!1)})}}function Kk(e){e._pending+=1}function Of(e){e._pending-=1}function Bs(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?UK(t,i):0))}return e}function UK(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const jK=ts-1e-8;let fp,dp,hp,Wa,f3,pp,d3,h3;const Bo=(e,t)=>fp.add(e,t),gp=(e,t)=>Bo(dp=e,hp=t),Zk=e=>Bo(e,fp.y1),Jk=e=>Bo(fp.x1,e),Ha=(e,t)=>f3*e+d3*t,Ga=(e,t)=>pp*e+h3*t,p3=(e,t)=>Bo(Ha(e,t),Ga(e,t)),g3=(e,t)=>gp(Ha(e,t),Ga(e,t));function Lf(e,t){return fp=e,t?(Wa=t*Po,f3=h3=Math.cos(Wa),pp=Math.sin(Wa),d3=-pp):(f3=h3=1,Wa=pp=d3=0),qK}const qK={beginPath(){},closePath(){},moveTo:g3,lineTo:g3,rect(e,t,n,i){Wa?(p3(e+n,t),p3(e+n,t+i),p3(e,t+i),g3(e,t)):(Bo(e+n,t+i),gp(e,t))},quadraticCurveTo(e,t,n,i){const r=Ha(e,t),s=Ga(e,t),o=Ha(n,i),a=Ga(n,i);Qk(dp,r,o,Zk),Qk(hp,s,a,Jk),gp(o,a)},bezierCurveTo(e,t,n,i,r,s){const o=Ha(e,t),a=Ga(e,t),u=Ha(n,i),l=Ga(n,i),c=Ha(r,s),f=Ga(r,s);eA(dp,o,u,c,Zk),eA(hp,a,l,f,Jk),gp(c,f)},arc(e,t,n,i,r,s){if(i+=Wa,r+=Wa,dp=n*Math.cos(r)+e,hp=n*Math.sin(r)+t,Math.abs(r-i)>jK)Bo(e-n,t-n),Bo(e+n,t+n);else{const o=l=>Bo(n*Math.cos(l)+e,n*Math.sin(l)+t);let a,u;if(o(i),o(r),r!==i)if(i=i%ts,i<0&&(i+=ts),r=r%ts,r<0&&(r+=ts),rr;++u,a-=qa)o(a);else for(a=i-i%qa+qa,u=0;u<4&&anK?(c=o*o+a*s,c>=0&&(c=Math.sqrt(c),u=(-o+c)/s,l=(-o-c)/s)):u=.5*a/o,0d)return!1;g>f&&(f=g)}else if(h>0){if(g0?(e.globalAlpha=n,e.fillStyle=sA(e,t,t.fill),!0):!1}var HK=[];function Ll(e,t,n){var i=(i=t.strokeWidth)!=null?i:1;return i<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=sA(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||HK),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function GK(e,t){return e.zindex-t.zindex||e.index-t.index}function v3(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],i,r,s;for(r=0,s=t.length;r=0;)if(i=t(n[r]))return i;if(n===s){for(n=e.items,r=n.length;--r>=0;)if(!n[r].zindex&&(i=t(n[r])))return i}return null}function x3(e){return function(t,n,i){pr(n,r=>{(!i||i.intersects(r.bounds))&&oA(e,t,r,r)})}}function VK(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&oA(e,t,n.items[0],n.items)}}function oA(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(Ol(t,n),n.fill&&mp(t,n,r)&&t.fill(),n.stroke&&Ll(t,n,r)&&t.stroke()))}function bp(e){return e=e||Ui,function(t,n,i,r,s,o){return i*=t.pixelRatio,r*=t.pixelRatio,yp(n,a=>{const u=a.bounds;if(!(u&&!u.contains(s,o)||!u)&&e(t,a,i,r,s,o))return a})}}function If(e,t){return function(n,i,r,s){var o=Array.isArray(i)?i[0]:i,a=t??o.fill,u=o.stroke&&n.isPointInStroke,l,c;return u&&(l=o.strokeWidth,c=o.strokeCap,n.lineWidth=l??1,n.lineCap=c??"butt"),e(n,i)?!1:a&&n.isPointInPath(r,s)||u&&n.isPointInStroke(r,s)}}function _3(e){return bp(If(e))}function Va(e,t){return"translate("+e+","+t+")"}function w3(e){return"rotate("+e+")"}function YK(e,t){return"scale("+e+","+t+")"}function aA(e){return Va(e.x||0,e.y||0)}function XK(e){return Va(e.x||0,e.y||0)+(e.angle?" "+w3(e.angle):"")}function KK(e){return Va(e.x||0,e.y||0)+(e.angle?" "+w3(e.angle):"")+(e.scaleX||e.scaleY?" "+YK(e.scaleX||1,e.scaleY||1):"")}function E3(e,t,n){function i(o,a){o("transform",XK(a)),o("d",t(null,a))}function r(o,a){return t(Lf(o,a.angle),a),Bs(o,a).translate(a.x||0,a.y||0)}function s(o,a){var u=a.x||0,l=a.y||0,c=a.angle||0;o.translate(u,l),c&&o.rotate(c*=Po),o.beginPath(),t(o,a),c&&o.rotate(-c),o.translate(-u,-l)}return{type:e,tag:"path",nested:!1,attr:i,bound:r,draw:x3(s),pick:_3(s),isect:n||y3(s)}}var ZK=E3("arc",OK);function JK(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],i=e[0].orient==="horizontal"?"y":"x",r=e.length,s=1/0,o,a;--r>=0;)e[r].defined!==!1&&(a=Math.abs(e[r][i]-n),a=0;)if(e[i].defined!==!1&&(r=e[i].x-t[0],s=e[i].y-t[1],o=r*r+s*s,o=0;)if(e[n].defined!==!1&&(i=e[n].x-t[0],r=e[n].y-t[1],s=i*i+r*r,i=e[n].size||1,s.5&&t<1.5?.5-Math.abs(t-1):0}function iZ(e,t){e("transform",aA(t))}function cA(e,t){const n=lA(t);e("d",Nl(null,t,n,n))}function rZ(e,t){e("class","background"),e("aria-hidden",!0),cA(e,t)}function sZ(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?cA(e,t):e("d","")}function oZ(e,t,n){const i=t.clip?c3(n,t,t):null;e("clip-path",i)}function aZ(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let r=0;r{const s=r.x||0,o=r.y||0,a=r.strokeForeground,u=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&u&&(Pf(e,r,s,o),Ol(e,r),r.fill&&mp(e,r,u)&&e.fill(),r.stroke&&!a&&Ll(e,r,u)&&e.stroke()),e.save(),e.translate(s,o),r.clip&&uA(e,r),n&&n.translate(-s,-o),pr(r,l=>{(l.marktype==="group"||i==null||i.includes(l.marktype))&&this.draw(e,l,n,i)}),n&&n.translate(s,o),e.restore(),a&&r.stroke&&u&&(Pf(e,r,s,o),Ol(e,r),Ll(e,r,u)&&e.stroke())})}function dZ(e,t,n,i,r,s){if(t.bounds&&!t.bounds.contains(r,s)||!t.items)return null;const o=n*e.pixelRatio,a=i*e.pixelRatio;return yp(t,u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(r,s))return;c=u.x||0,f=u.y||0;const h=c+(u.width||0),p=f+(u.height||0),g=u.clip;if(g&&(rh||sp))return;if(e.save(),e.translate(c,f),c=r-c,f=s-f,g&&l3(u)&&!cZ(e,u,o,a))return e.restore(),null;const m=u.strokeForeground,y=t.interactive!==!1;return y&&m&&u.stroke&&lZ(e,u,o,a)?(e.restore(),u):(l=yp(u,b=>hZ(b,c,f)?this.pick(b,n,i,c,f):null),!l&&y&&(u.fill||!m&&u.stroke)&&uZ(e,u,o,a)&&(l=u),e.restore(),l||null)})}function hZ(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var pZ={type:"group",tag:"g",nested:!1,attr:iZ,bound:aZ,draw:fZ,pick:dZ,isect:nA,content:oZ,background:rZ,foreground:sZ},zf={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function k3(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(i=>{e.image=i,e.image.url=e.url})),n}function A3(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function $3(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function vp(e,t){return e==="center"?t/2:e==="right"?t:0}function xp(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function gZ(e,t,n){const i=k3(t,n),r=A3(t,i),s=$3(t,i),o=(t.x||0)-vp(t.align,r),a=(t.y||0)-xp(t.baseline,s),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,zf["xmlns:xlink"],"xlink:href"),e("transform",Va(o,a)),e("width",r),e("height",s),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function mZ(e,t){const n=t.image,i=A3(t,n),r=$3(t,n),s=(t.x||0)-vp(t.align,i),o=(t.y||0)-xp(t.baseline,r);return e.set(s,o,s+i,o+r)}function yZ(e,t,n){pr(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=k3(i,this);let s=A3(i,r),o=$3(i,r);if(s===0||o===0)return;let a=(i.x||0)-vp(i.align,s),u=(i.y||0)-xp(i.baseline,o),l,c,f,d;i.aspect!==!1&&(c=r.width/r.height,f=i.width/i.height,c===c&&f===f&&c!==f&&(f{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&dA(e,i,r)&&(Ol(e,i),e.stroke())}})}function FZ(e,t,n,i){return e.isPointInStroke?dA(e,t,1)&&e.isPointInStroke(n,i):!1}var DZ={type:"rule",tag:"line",nested:!1,attr:AZ,bound:$Z,draw:SZ,pick:bp(FZ),isect:iA},TZ=E3("shape",PK),MZ=E3("symbol",zK,b3);const hA=K4();var Ai={height:ns,measureWidth:S3,estimateWidth:wp,width:wp,canvas:pA};pA(!0);function pA(e){Ai.width=e&&Uo?S3:wp}function wp(e,t){return gA(qo(e,t),ns(e))}function gA(e,t){return~~(.8*e.length*t)}function S3(e,t){return ns(e)<=0||!(t=qo(e,t))?0:mA(t,Ep(e))}function mA(e,t){const n=`(${t}) ${e}`;let i=hA.get(n);return i===void 0&&(Uo.font=t,i=Uo.measureText(e).width,hA.set(n,i)),i}function ns(e){return e.fontSize!=null?+e.fontSize||0:11}function jo(e){return e.lineHeight!=null?e.lineHeight:ns(e)+2}function NZ(e){return W(e)?e.length>1?e:e[0]:e}function Bf(e){return NZ(e.lineBreak&&e.text&&!W(e.text)?e.text.split(e.lineBreak):e.text)}function F3(e){const t=Bf(e);return(W(t)?t.length-1:0)*jo(e)}function qo(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?OZ(e,n):n}function RZ(e){if(Ai.width===S3){const t=Ep(e);return n=>mA(n,t)}else if(Ai.width===wp){const t=ns(e);return n=>gA(n,t)}else return t=>Ai.width(e,t)}function OZ(e,t){var n=+e.limit,i=RZ(e);if(i(t)>>1,i(t.slice(u))>n?o=u+1:a=u;return r+t.slice(o)}else{for(;o>>1),i(t.slice(0,u))Math.max(d,Ai.width(t,h)),0)):f=Ai.width(t,c),r==="center"?u-=f/2:r==="right"&&(u-=f),e.set(u+=o,l+=a,u+f,l+i),t.angle&&!n)e.rotate(t.angle*Po,o,a);else if(n===2)return e.rotatedPoints(t.angle*Po,o,a);return e}function PZ(e,t,n){pr(t,i=>{var r=i.opacity==null?1:i.opacity,s,o,a,u,l,c,f;if(!(n&&!n.intersects(i.bounds)||r===0||i.fontSize<=0||i.text==null||i.text.length===0)){if(e.font=Ep(i),e.textAlign=i.align||"left",s=Cp(i),o=s.x1,a=s.y1,i.angle&&(e.save(),e.translate(o,a),e.rotate(i.angle*Po),o=a=0),o+=i.dx||0,a+=(i.dy||0)+D3(i),c=Bf(i),Ol(e,i),W(c))for(l=jo(i),u=0;ut;)e.removeChild(n[--i]);return e}function CA(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function kp(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function WZ(e,t,n,i){var r=e&&e.mark,s,o;if(r&&(s=$i[r.marktype]).tip){for(o=kp(t,n),o[0]-=i[0],o[1]-=i[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=s.tip(r.items,o)}return e}let R3=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||p0(),this._tooltip=n||HZ}initialize(t,n,i){return this._el=t,this._obj=i||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()}scene(t){return arguments.length?(this._scene=t,this):this._scene}on(){}off(){}_handlerIndex(t,n,i){for(let r=t?t.length:0;--r>=0;)if(t[r].type===n&&(!i||t[r].handler===i))return r;return-1}handlers(t){const n=this._handlers,i=[];if(t)i.push(...n[this.eventName(t)]);else for(const r in n)i.push(...n[r]);return i}eventName(t){const n=t.indexOf(".");return n<0?t:t.slice(0,n)}handleHref(t,n,i){this._loader.sanitize(i,{context:"href"}).then(r=>{const s=new MouseEvent(t.type,t),o=Wo(null,"a");for(const a in r)o.setAttribute(a,r[a]);o.dispatchEvent(s)}).catch(()=>{})}handleTooltip(t,n,i){if(n&&n.tooltip!=null){n=WZ(n,t,this.canvas(),this._origin);const r=i&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,t,n,r)}}getItemBoundingClientRect(t){const n=this.canvas();if(!n)return;const i=n.getBoundingClientRect(),r=this._origin,s=t.bounds,o=s.width(),a=s.height();let u=s.x1+r[0]+i.left,l=s.y1+r[1]+i.top;for(;t.mark&&(t=t.mark.group);)u+=t.x||0,l+=t.y||0;return{x:u,y:l,width:o,height:a,left:u,top:l,right:u+o,bottom:l+a}}};function HZ(e,t,n,i){e.element().setAttribute("title",i||"")}class qf{constructor(t){this._el=null,this._bgcolor=null,this._loader=new Xk(t)}initialize(t,n,i,r,s){return this._el=t,this.resize(n,i,r,s)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(t){return arguments.length===0?this._bgcolor:(this._bgcolor=t,this)}resize(t,n,i,r){return this._width=t,this._height=n,this._origin=i||[0,0],this._scale=r||1,this}dirty(){}render(t,n){const i=this;return i._call=function(){i._render(t,n)},i._call(),i._call=null,i}_render(){}renderAsync(t,n){const i=this.render(t,n);return this._ready?this._ready.then(()=>i):Promise.resolve(i)}_load(t,n){var i=this,r=i._loader[t](n);if(!i._ready){const s=i._call;i._ready=i._loader.ready().then(o=>{o&&s(),i._ready=null})}return r}sanitizeURL(t){return this._load("sanitizeURL",t)}loadImage(t){return this._load("loadImage",t)}}const GZ="keydown",VZ="keypress",YZ="keyup",kA="dragenter",Ap="dragleave",AA="dragover",O3="pointerdown",XZ="pointerup",$p="pointermove",Sp="pointerout",$A="pointerover",L3="mousedown",KZ="mouseup",SA="mousemove",Fp="mouseout",FA="mouseover",Dp="click",ZZ="dblclick",JZ="wheel",DA="mousewheel",Tp="touchstart",Mp="touchmove",Np="touchend",QZ=[GZ,VZ,YZ,kA,Ap,AA,O3,XZ,$p,Sp,$A,L3,KZ,SA,Fp,FA,Dp,ZZ,JZ,DA,Tp,Mp,Np],I3=$p,Wf=Fp,P3=Dp;class Hf extends R3{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=QZ,this.pointermove=MA([$p,SA],[$A,FA],[Sp,Fp]),this.dragover=MA([AA],[kA],[Ap]),this.pointerout=NA([Sp,Fp]),this.dragleave=NA([Ap])}initialize(t,n,i){return this._canvas=t&&N3(t,"canvas"),[Dp,L3,O3,$p,Sp,Ap].forEach(r=>TA(this,r)),super.initialize(t,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(DA,t)}pointerdown(t){this._down=this._active,this.fire(O3,t)}mousedown(t){this._down=this._active,this.fire(L3,t)}click(t){this._down===this._active&&(this.fire(Dp,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(Tp,t,!0)}touchmove(t){this.fire(Mp,t,!0)}touchend(t){this.fire(Np,t,!0),this._touch=null}fire(t,n,i){const r=i?this._touch:this._active,s=this._handlers[t];if(n.vegaType=t,t===P3&&r&&r.href?this.handleHref(n,r,r.href):(t===I3||t===Wf)&&this.handleTooltip(n,r,t!==Wf),s)for(let o=0,a=s.length;o=0&&r.splice(s,1),this}pickEvent(t){const n=kp(t,this._canvas),i=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-i[0],n[1]-i[1])}pick(t,n,i,r,s){const o=this.context();return $i[t.marktype].pick.call(this,o,t,n,i,r,s)}}const eJ=e=>e===Tp||e===Mp||e===Np?[Tp,Mp,Np]:[e];function TA(e,t){eJ(t).forEach(n=>tJ(e,n))}function tJ(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?i=>e[t](i):i=>e.fire(t,i)))}function Gf(e,t,n){t.forEach(i=>e.fire(i,n))}function MA(e,t,n){return function(i){const r=this._active,s=this.pickEvent(i);s===r?Gf(this,e,i):((!r||!r.exit)&&Gf(this,n,i),this._active=s,Gf(this,t,i),Gf(this,e,i))}}function NA(e){return function(t){Gf(this,e,t),this._active=null}}function nJ(){return typeof window<"u"&&window.devicePixelRatio||1}function iJ(e,t,n,i,r,s){const o=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),u=o?nJ():r;e.width=t*u,e.height=n*u;for(const l in s)a[l]=s[l];return o&&u!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=u,a.setTransform(u,0,0,u,u*i[0],u*i[1]),e}class Rp extends qf{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new Ut,this._tempb=new Ut}initialize(t,n,i,r,s,o){return this._options=o||{},this._canvas=this._options.externalContext?null:Mo(1,1,this._options.type),t&&this._canvas&&(Vi(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(t,n,i,r,s)}resize(t,n,i,r){if(super.resize(t,n,i,r),this._canvas)iJ(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const s=this._options.externalContext;s||q("CanvasRenderer is missing a valid canvas or context"),s.scale(this._scale,this._scale),s.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(t){const n=this._tempb.clear().union(t.bounds);let i=t.mark.group;for(;i;)n.translate(i.x||0,i.y||0),i=i.mark.group;this._dirty.union(n)}_render(t,n){const i=this.context(),r=this._origin,s=this._width,o=this._height,a=this._dirty,u=rJ(r,s,o);i.save();const l=this._redraw||a.empty()?(this._redraw=!1,u.expand(1)):sJ(i,u.intersect(a),r);return this.clear(-r[0],-r[1],s,o),this.draw(i,t,l,n),i.restore(),a.clear(),this}draw(t,n,i,r){if(n.marktype!=="group"&&r!=null&&!r.includes(n.marktype))return;const s=$i[n.marktype];n.clip&&nZ(t,n),s.draw.call(this,t,n,i,r),n.clip&&t.restore()}clear(t,n,i,r){const s=this._options,o=this.context();s.type!=="pdf"&&!s.externalContext&&o.clearRect(t,n,i,r),this._bgcolor!=null&&(o.fillStyle=this._bgcolor,o.fillRect(t,n,i,r))}}const rJ=(e,t,n)=>new Ut().set(0,0,t,n).translate(-e[0],-e[1]);function sJ(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}class RA extends R3{constructor(t,n){super(t,n);const i=this;i._hrefHandler=z3(i,(r,s)=>{s&&s.href&&i.handleHref(r,s,s.href)}),i._tooltipHandler=z3(i,(r,s)=>{i.handleTooltip(r,s,r.type!==Wf)})}initialize(t,n,i){let r=this._svg;return r&&(r.removeEventListener(P3,this._hrefHandler),r.removeEventListener(I3,this._tooltipHandler),r.removeEventListener(Wf,this._tooltipHandler)),this._svg=r=t&&N3(t,"svg"),r&&(r.addEventListener(P3,this._hrefHandler),r.addEventListener(I3,this._tooltipHandler),r.addEventListener(Wf,this._tooltipHandler)),super.initialize(t,n,i)}canvas(){return this._svg}on(t,n){const i=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[i],t,n)<0){const o={type:t,handler:n,listener:z3(this,n)};(r[i]||(r[i]=[])).push(o),this._svg&&this._svg.addEventListener(i,o.listener)}return this}off(t,n){const i=this.eventName(t),r=this._handlers[i],s=this._handlerIndex(r,t,n);return s>=0&&(this._svg&&this._svg.removeEventListener(i,r[s].listener),r.splice(s,1)),this}}const z3=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)},OA="aria-hidden",B3="aria-label",U3="role",j3="aria-roledescription",LA="graphics-object",q3="graphics-symbol",IA=(e,t,n)=>({[U3]:e,[j3]:t,[B3]:n||void 0}),oJ=lr(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),PA={axis:{desc:"axis",caption:lJ},legend:{desc:"legend",caption:cJ},"title-text":{desc:"title",caption:e=>`Title text '${jA(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${jA(e)}'`}},zA={ariaRole:U3,ariaRoleDescription:j3,description:B3};function BA(e,t){const n=t.aria===!1;if(e(OA,n||void 0),n||t.description==null)for(const i in zA)e(zA[i],void 0);else{const i=t.mark.marktype;e(B3,t.description),e(U3,t.ariaRole||(i==="group"?LA:q3)),e(j3,t.ariaRoleDescription||`${i} mark`)}}function UA(e){return e.aria===!1?{[OA]:!0}:oJ[e.role]?null:PA[e.role]?uJ(e,PA[e.role]):aJ(e)}function aJ(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return IA(n?LA:q3,`${t} mark container`,e.description)}function uJ(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return IA(t.role||q3,t.desc,n.description||i(n))}catch{return null}}function jA(e){return oe(e.text).join(" ")}function lJ(e){const t=e.datum,n=e.orient,i=t.title?qA(e):null,r=e.context,s=r.scales[t.scale].value,o=r.dataflow.locale(),a=s.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(i?` titled '${i}'`:"")+` for a ${Dl(a)?"discrete":a} scale with ${Ok(o,s,e)}`}function cJ(e){const t=e.datum,n=t.title?qA(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,s=Object.keys(r),o=e.context,a=o.scales[r[s[0]]].value,u=o.dataflow.locale();return dJ(i)+(n?` titled '${n}'`:"")+` for ${fJ(s)} with ${Ok(u,a,e)}`}function qA(e){try{return oe(Ge(e.items).items[0].text).join(" ")}catch{return null}}function fJ(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+Ge(e)}function dJ(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const WA=e=>(e+"").replace(/&/g,"&").replace(//g,">"),hJ=e=>WA(e).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function W3(){let e="",t="",n="";const i=[],r=()=>t=n="",s=u=>{t&&(e+=`${t}>${n}`,r()),i.push(u)},o=(u,l)=>(l!=null&&(t+=` ${u}="${hJ(l)}"`),a),a={open(u){s(u),t="<"+u;for(var l=arguments.length,c=new Array(l>1?l-1:0),f=1;f${n}`:"/>"):e+=``,r(),a},attr:o,text:u=>(n+=WA(u),a),toString:()=>e};return a}const HA=e=>GA(W3(),e)+"";function GA(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let r=0;r{c.dirty=n})),!r.zdirty){if(i.exit){o.nested&&r.items.length?(l=r.items[0],l._svg&&this._update(o,l._svg,l)):i._svg&&(l=i._svg.parentNode,l&&l.removeChild(i._svg)),i._svg=null;continue}i=o.nested?r.items[0]:i,i._update!==n&&(!i._svg||!i._svg.ownerSVGElement?(this._dirtyAll=!1,XA(i,n)):this._update(o,i._svg,i),i._update=n)}return!this._dirtyAll}mark(t,n,i,r){if(!this.isDirty(n))return n._svg;const s=this._svg,o=n.marktype,a=$i[o],u=n.interactive===!1?"none":null,l=a.tag==="g",c=KA(n,t,i,"g",s);if(o!=="group"&&r!=null&&!r.includes(o))return Vi(c,0),n._svg;c.setAttribute("class",CA(n));const f=UA(n);for(const g in f)Bn(c,g,f[g]);l||Bn(c,"pointer-events",u),Bn(c,"clip-path",n.clip?c3(this,n,n.group):null);let d=null,h=0;const p=g=>{const m=this.isDirty(g),y=KA(g,c,d,a.tag,s);m&&(this._update(a,y,g),l&&mJ(this,y,g,r)),d=y,++h};return a.nested?n.items.length&&p(n.items[0]):pr(n,p),Vi(c,h),c}_update(t,n,i){Us=n,Dn=n.__values__,BA(Yf,i),t.attr(Yf,i,this);const r=bJ[t.type];r&&r.call(this,t,n,i),Us&&this.style(Us,i)}style(t,n){if(n!=null){for(const i in Op){let r=i==="font"?Uf(n):n[i];if(r===Dn[i])continue;const s=Op[i];r==null?t.removeAttribute(s):(r3(r)&&(r=Ik(r,this._defs.gradient,ZA())),t.setAttribute(s,r+"")),Dn[i]=r}for(const i in Lp)Ip(t,Lp[i],n[i])}}defs(){const t=this._svg,n=this._defs;let i=n.el,r=0;for(const s in n.gradient)i||(n.el=i=Gt(t,Vf+1,"defs",Vt)),r=pJ(i,n.gradient[s],r);for(const s in n.clipping)i||(n.el=i=Gt(t,Vf+1,"defs",Vt)),r=gJ(i,n.clipping[s],r);i&&(r===0?(t.removeChild(i),n.el=null):Vi(i,r))}_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}}function XA(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function pJ(e,t,n){let i,r,s;if(t.gradient==="radial"){let o=Gt(e,n++,"pattern",Vt);Ho(o,{id:op+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),o=Gt(o,0,"rect",Vt),Ho(o,{width:1,height:1,fill:`url(${ZA()}#${t.id})`}),e=Gt(e,n++,"radialGradient",Vt),Ho(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=Gt(e,n++,"linearGradient",Vt),Ho(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i{r=e.mark(t,o,r,i),++s}),Vi(t,1+s)}function KA(e,t,n,i,r){let s=e._svg,o;if(!s&&(o=t.ownerDocument,s=Wo(o,i,Vt),e._svg=s,e.mark&&(s.__data__=e,s.__values__={fill:"default"},i==="g"))){const a=Wo(o,"path",Vt);s.appendChild(a),a.__data__=e;const u=Wo(o,"g",Vt);s.appendChild(u),u.__data__=e;const l=Wo(o,"path",Vt);s.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(s.ownerSVGElement!==r||yJ(s,n))&&t.insertBefore(s,n?n.nextSibling:t.firstChild),s}function yJ(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Us=null,Dn=null;const bJ={group(e,t,n){const i=Us=t.childNodes[2];Dn=i.__values__,e.foreground(Yf,n,this),Dn=t.__values__,Us=t.childNodes[1],e.content(Yf,n,this);const r=Us=t.childNodes[0];e.background(Yf,n,this);const s=n.mark.interactive===!1?"none":null;if(s!==Dn.events&&(Bn(i,"pointer-events",s),Bn(r,"pointer-events",s),Dn.events=s),n.strokeForeground&&n.stroke){const o=n.fill;Bn(i,"display",null),this.style(r,n),Bn(r,"stroke",null),o&&(n.fill=null),Dn=i.__values__,this.style(i,n),o&&(n.fill=o),Us=null}else Bn(i,"display","none")},image(e,t,n){n.smooth===!1?(Ip(t,"image-rendering","optimizeSpeed"),Ip(t,"image-rendering","pixelated")):Ip(t,"image-rendering",null)},text(e,t,n){const i=Bf(n);let r,s,o,a;W(i)?(s=i.map(u=>qo(n,u)),r=s.join(` +`),r!==Dn.text&&(Vi(t,0),o=t.ownerDocument,a=jo(n),s.forEach((u,l)=>{const c=Wo(o,"tspan",Vt);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),Dn.text=r)):(s=qo(n,i),s!==Dn.text&&(t.textContent=s,Dn.text=s)),Bn(t,"font-family",Uf(n)),Bn(t,"font-size",ns(n)+"px"),Bn(t,"font-style",n.fontStyle),Bn(t,"font-variant",n.fontVariant),Bn(t,"font-weight",n.fontWeight)}};function Yf(e,t,n){t!==Dn[e]&&(n?vJ(Us,e,t,n):Bn(Us,e,t),Dn[e]=t)}function Ip(e,t,n){n!==Dn[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),Dn[t]=n)}function Ho(e,t){for(const n in t)Bn(e,n,t[n])}function Bn(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function vJ(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function ZA(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class JA extends qf{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=W3();n.open("svg",Ie({},zf,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const i=this._bgcolor;return i&&i!=="transparent"&&i!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:i}).close(),n.open("g",VA,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const i=$i[n.marktype],r=i.tag,s=[BA,i.attr];t.open("g",{class:CA(n),"clip-path":n.clip?c3(this,n,n.group):null},UA(n),{"pointer-events":r!=="g"&&n.interactive===!1?"none":null});const o=a=>{const u=this.href(a);if(u&&t.open("a",u),t.open(r,this.attr(n,a,s,r!=="g"?r:null)),r==="text"){const l=Bf(a);if(W(l)){const c={x:0,dy:jo(a)};for(let f=0;fthis.mark(t,d)),t.close(),l&&f?(c&&(a.fill=null),a.stroke=f,t.open("path",this.attr(n,a,i.foreground,"bgrect")).close(),c&&(a.fill=c)):t.open("path",this.attr(n,a,i.foreground,"bgfore")).close()}t.close(),u&&t.close()};return i.nested?n.items&&n.items.length&&o(n.items[0]):pr(n,o),t.close()}href(t){const n=t.href;let i;if(n){if(i=this._hrefs&&this._hrefs[n])return i;this.sanitizeURL(n).then(r=>{r["xlink:href"]=r.href,r.href=null,(this._hrefs||(this._hrefs={}))[n]=r})}return null}attr(t,n,i,r){const s={},o=(a,u,l,c)=>{s[c||a]=u};return Array.isArray(i)?i.forEach(a=>a(o,n,this)):i(o,n,this),r&&xJ(s,n,t,r,this._defs),s}defs(t){const n=this._defs.gradient,i=this._defs.clipping;if(Object.keys(n).length+Object.keys(i).length!==0){t.open("defs");for(const s in n){const o=n[s],a=o.stops;o.gradient==="radial"?(t.open("pattern",{id:op+s,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+s+")"}).close(),t.close(),t.open("radialGradient",{id:s,fx:o.x1,fy:o.y1,fr:o.r1,cx:o.x2,cy:o.y2,r:o.r2})):t.open("linearGradient",{id:s,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2});for(let u=0;u!gr.svgMarkTypes.includes(s));this._svgRenderer.render(t,gr.svgMarkTypes),this._canvasRenderer.render(t,r)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svgRenderer.resize(t,n,i,r),this._canvasRenderer.resize(t,n,i,r),this}background(t){return gr.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class QA extends Hf{constructor(t,n){super(t,n)}initialize(t,n,i){const r=Gt(Gt(t,0,"div"),gr.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const e$="canvas",t$="hybrid",n$="png",i$="svg",r$="none",Go={Canvas:e$,PNG:n$,SVG:i$,Hybrid:t$,None:r$},Ya={};Ya[e$]=Ya[n$]={renderer:Rp,headless:Rp,handler:Hf},Ya[i$]={renderer:H3,headless:JA,handler:RA},Ya[t$]={renderer:G3,headless:G3,handler:QA},Ya[r$]={};function Pp(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(Ya[e]=t,this):Ya[e]}function s$(e,t,n){const i=[],r=new Ut().union(t),s=e.marktype;return s?o$(e,r,n,i):s==="group"?a$(e,r,n,i):q("Intersect scene must be mark node or group item.")}function o$(e,t,n,i){if(wJ(e,t,n)){const r=e.items,s=e.marktype,o=r.length;let a=0;if(s==="group")for(;a=0;s--)if(n[s]!=i[s])return!1;for(s=n.length-1;s>=0;s--)if(r=n[s],!Y3(e[r],t[r],r))return!1;return typeof e==typeof t}function kJ(){Yk(),XX()}const Il="top",mr="left",yr="right",Vo="bottom",AJ="top-left",$J="top-right",SJ="bottom-left",FJ="bottom-right",X3="start",K3="middle",Un="end",DJ="x",TJ="y",zp="group",Z3="axis",J3="title",MJ="frame",NJ="scope",Q3="legend",f$="row-header",d$="row-footer",h$="row-title",p$="column-header",g$="column-footer",m$="column-title",RJ="padding",OJ="symbol",y$="fit",b$="fit-x",v$="fit-y",LJ="pad",ev="none",Bp="all",tv="each",nv="flush",Yo="column",Xo="row";function x$(e){P.call(this,null,e)}te(x$,P,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,s=$i[r],o=s.bound;let a=i.bounds,u;if(s.nested)i.items.length&&n.dirty(i.items[0]),a=Up(i,o),i.items.forEach(l=>{l.bounds.clear().union(a)});else if(r===zp||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),a.clear(),i.items.forEach(l=>a.union(Up(l,o))),i.role){case Z3:case Q3:case J3:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{a.union(Up(l,o))}),t.visit(t.MOD,l=>{u=u||a.alignsWith(l.bounds),n.dirty(l),a.union(Up(l,o))}),u&&(a.clear(),i.items.forEach(l=>a.union(l.bounds)));return l$(i),t.modifies("bounds")}});function Up(e,t,n){return t(e.bounds.clear(),e,n)}const _$=":vega_identifier:";function iv(e){P.call(this,0,e)}iv.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},te(iv,P,{transform(e,t){const n=IJ(t.dataflow),i=e.as;let r=n.value;return t.visit(t.ADD,s=>s[i]=s[i]||++r),n.set(this.value=r),t}});function IJ(e){return e._signals[_$]||(e._signals[_$]=e.add(0))}function w$(e){P.call(this,null,e)}te(w$,P,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,PJ(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const i=n.marktype===zp?cp:lp;return t.visit(t.ADD,r=>i.call(r,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function PJ(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function E$(e){P.call(this,null,e)}const C$={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!k$(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},k$=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),A$=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,s;n{const t=e.bounds;return t.width()>1&&t.height()>1},BJ=(e,t,n)=>{var i=e.range(),r=new Ut;return t===Il||t===Vo?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),s=>r.encloses(s.bounds)},$$=e=>(e.forEach(t=>t.opacity=1),e),S$=(e,t)=>e.reflow(t.modified()).modifies("opacity");te(E$,P,{transform(e,t){const n=C$[e.method]||C$.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,s,o;if(!r||!r.length)return;if(!e.method)return e.modified("method")&&($$(r),t=S$(t,e)),t;if(r=r.filter(zJ),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),s=$$(r),t=S$(t,e),s.length>=3&&A$(s,i)){do s=n(s,i);while(s.length>=3&&A$(s,i));s.length<3&&!Ge(r).opacity&&(s.length>1&&(Ge(s).opacity=0),Ge(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=BJ(e.boundScale,e.boundOrient,+e.boundTolerance),r.forEach(u=>{o(u)||(u.opacity=0)}));const a=s[0].mark.bounds.clear();return r.forEach(u=>{u.opacity&&a.union(u.bounds)}),t}});function F$(e){P.call(this,null,e)}te(F$,P,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,i=>n.dirty(i)),t.fields&&t.fields.zindex){const i=t.source&&t.source[0];i&&(i.mark.zdirty=!0)}}});const Tn=new Ut;function Pl(e,t,n){return e[t]===n?0:(e[t]=n,1)}function UJ(e){var t=e.items[0].orient;return t===mr||t===yr}function jJ(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function qJ(e,t,n,i){var r=t.items[0],s=r.datum,o=r.translate!=null?r.translate:.5,a=r.orient,u=jJ(s),l=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,p=s.title&&r.items[u[2]].items[0],g=r.titlePadding,m=r.bounds,y=p&&F3(p),b=0,v=0,x,_;switch(Tn.clear().union(m),m.clear(),(x=u[0])>-1&&m.union(r.items[x].bounds),(x=u[1])>-1&&m.union(r.items[x].bounds),a){case Il:b=f||0,v=-c,_=Math.max(d,Math.min(h,-m.y1)),m.add(0,-_).add(l,0),p&&jp(e,p,_,g,y,0,-1,m);break;case mr:b=-c,v=f||0,_=Math.max(d,Math.min(h,-m.x1)),m.add(-_,0).add(0,l),p&&jp(e,p,_,g,y,1,-1,m);break;case yr:b=n+c,v=f||0,_=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(_,l),p&&jp(e,p,_,g,y,1,1,m);break;case Vo:b=f||0,v=i+c,_=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(l,_),p&&jp(e,p,_,g,0,0,1,m);break;default:b=r.x,v=r.y}return Bs(m.translate(b,v),r),Pl(r,"x",b+o)|Pl(r,"y",v+o)&&(r.bounds=Tn,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function jp(e,t,n,i,r,s,o,a){const u=t.bounds;if(t.auto){const l=o*(n+r+i);let c=0,f=0;e.dirty(t),s?c=(t.x||0)-(t.x=l):f=(t.y||0)-(t.y=l),t.mark.bounds.clear().union(u.translate(-c,-f)),e.dirty(t)}a.union(u)}const D$=(e,t)=>Math.floor(Math.min(e,t)),T$=(e,t)=>Math.ceil(Math.max(e,t));function WJ(e){var t=e.items,n=t.length,i=0,r,s;const o={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i1)for(w=0;w0&&(v[w]+=D/2);if(a&&kt(n.center,Xo)&&c!==1)for(w=0;w0&&(x[w]+=A/2);for(w=0;wr&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),g+=s,b=0,x=t.length;b=0&&(w=n[v])==null;v-=d);a?(C=h==null?w.x:Math.round(w.bounds.x1+h*w.bounds.width()),k=g):(C=g,k=h==null?w.y:Math.round(w.bounds.y1+h*w.bounds.height())),_.union(E.bounds.translate(C-(E.x||0),k-(E.y||0))),E.x=C,E.y=k,e.dirty(E),m=o(m,_[l])}return m}function R$(e,t,n,i,r,s){if(t){e.dirty(t);var o=n,a=n;i?o=Math.round(r.x1+s*r.width()):a=Math.round(r.y1+s*r.height()),t.bounds.translate(o-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=o,t.y=a,e.dirty(t)}}function KJ(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function ZJ(e,t){let n=-1/0;return e.forEach(i=>{i.offset!=null&&(n=Math.max(n,i.offset))}),n>-1/0?n:t}function JJ(e,t,n,i,r,s,o){const a=KJ(n,t),u=ZJ(e,a("offset",0)),l=a("anchor",X3),c=l===Un?1:l===K3?.5:0,f={align:tv,bounds:a("bounds",nv),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case mr:f.anchor={x:Math.floor(i.x1)-u,column:Un,y:c*(o||i.height()+2*i.y1),row:l};break;case yr:f.anchor={x:Math.ceil(i.x2)+u,y:c*(o||i.height()+2*i.y1),row:l};break;case Il:f.anchor={y:Math.floor(r.y1)-u,row:Un,x:c*(s||r.width()+2*r.x1),column:l};break;case Vo:f.anchor={y:Math.ceil(r.y2)+u,x:c*(s||r.width()+2*r.x1),column:l};break;case AJ:f.anchor={x:u,y:u};break;case $J:f.anchor={x:s-u,y:u,column:Un};break;case SJ:f.anchor={x:u,y:o-u,row:Un};break;case FJ:f.anchor={x:s-u,y:o-u,column:Un,row:Un};break}return f}function QJ(e,t){var n=t.items[0],i=n.datum,r=n.orient,s=n.bounds,o=n.x,a=n.y,u,l;return n._bounds?n._bounds.clear().union(s):n._bounds=s.clone(),s.clear(),tQ(e,n,n.items[0].items[0]),s=eQ(n,s),u=2*n.padding,l=2*n.padding,s.empty()||(u=Math.ceil(s.width()+u),l=Math.ceil(s.height()+l)),i.type===OJ&&nQ(n.items[0].items[0].items[0].items),r!==ev&&(n.x=o=0,n.y=a=0),n.width=u,n.height=l,Bs(s.set(o,a,o+u,a+l),n),n.mark.bounds.clear().union(s),n}function eQ(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function tQ(e,t,n){var i=t.padding,r=i-n.x,s=i-n.y;if(!t.datum.title)(r||s)&&Xf(e,n,r,s);else{var o=t.items[1].items[0],a=o.anchor,u=t.titlePadding||0,l=i-o.x,c=i-o.y;switch(o.orient){case mr:r+=Math.ceil(o.bounds.width())+u;break;case yr:case Vo:break;default:s+=o.bounds.height()+u}switch((r||s)&&Xf(e,n,r,s),o.orient){case mr:c+=zl(t,n,o,a,1,1);break;case yr:l+=zl(t,n,o,Un,0,0)+u,c+=zl(t,n,o,a,1,1);break;case Vo:l+=zl(t,n,o,a,0,0),c+=zl(t,n,o,Un,-1,0,1)+u;break;default:l+=zl(t,n,o,a,0,0)}(l||c)&&Xf(e,o,l,c),(l=Math.round(o.bounds.x1-i))<0&&(Xf(e,n,-l,0),Xf(e,o,-l,0))}}function zl(e,t,n,i,r,s,o){const a=e.datum.type!=="symbol",u=n.datum.vgrad,l=a&&(s||!u)&&!o?t.items[0]:t,c=l.bounds[r?"y2":"x2"]-e.padding,f=u&&s?c:0,d=u&&s?0:c,h=r<=0?0:F3(n);return Math.round(i===X3?f:i===Un?d-h:.5*(c-h))}function Xf(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function nQ(e){const t=e.reduce((n,i)=>(n[i.column]=Math.max(i.bounds.x2-i.x,n[i.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function iQ(e,t,n,i,r){var s=t.items[0],o=s.frame,a=s.orient,u=s.anchor,l=s.offset,c=s.padding,f=s.items[0].items[0],d=s.items[1]&&s.items[1].items[0],h=a===mr||a===yr?i:n,p=0,g=0,m=0,y=0,b=0,v;if(o!==zp?a===mr?(p=r.y2,h=r.y1):a===yr?(p=r.y1,h=r.y2):(p=r.x1,h=r.x2):a===mr&&(p=i,h=0),v=u===X3?p:u===Un?h:(p+h)/2,d&&d.text){switch(a){case Il:case Vo:b=f.bounds.height()+c;break;case mr:y=f.bounds.width()+c;break;case yr:y=-f.bounds.width()-c;break}Tn.clear().union(d.bounds),Tn.translate(y-(d.x||0),b-(d.y||0)),Pl(d,"x",y)|Pl(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(Tn),d.mark.bounds.clear().union(Tn),e.dirty(d)),Tn.clear().union(d.bounds)}else Tn.clear();switch(Tn.union(f.bounds),a){case Il:g=v,m=r.y1-Tn.height()-l;break;case mr:g=r.x1-Tn.width()-l,m=v;break;case yr:g=r.x2+Tn.width()+l,m=v;break;case Vo:g=v,m=r.y2+l;break;default:g=s.x,m=s.y}return Pl(s,"x",g)|Pl(s,"y",m)&&(Tn.translate(g,m),e.dirty(s),s.bounds.clear().union(Tn),t.bounds.clear().union(Tn),e.dirty(s)),s.bounds}function O$(e){P.call(this,null,e)}te(O$,P,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&VJ(n,i,e.layout),sQ(n,i,e)}),rQ(e.mark.group)?t.reflow():t}});function rQ(e){return e&&e.mark.role!=="legend-entry"}function sQ(e,t,n){var i=t.items,r=Math.max(0,t.width||0),s=Math.max(0,t.height||0),o=new Ut().set(0,0,r,s),a=o.clone(),u=o.clone(),l=[],c,f,d,h,p,g;for(p=0,g=i.length;p{d=y.orient||yr,d!==ev&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];N$(e,b,JJ(b,y,n.legends,a,u,r,s))}l.forEach(y=>{const b=y.bounds;if(b.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=b,e.dirty(y)),n.autosize&&(n.autosize.type===y$||n.autosize.type===b$||n.autosize.type===v$))switch(y.orient){case mr:case yr:o.add(b.x1,0).add(b.x2,0);break;case Il:case Vo:o.add(0,b.y1).add(0,b.y2)}else o.union(b)})}o.union(a).union(u),c&&o.union(iQ(e,c,r,s,o)),t.clip&&o.set(0,0,t.width||0,t.height||0),oQ(e,t,o,n)}function oQ(e,t,n,i){const r=i.autosize||{},s=r.type;if(e._autosize<1||!s)return;let o=e._width,a=e._height,u=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===RJ){const p=e.padding();o-=p.left+p.right,a-=p.top+p.bottom}s===ev?(l=0,f=0,u=o,c=a):s===y$?(u=Math.max(0,o-l-d),c=Math.max(0,a-f-h)):s===b$?(u=Math.max(0,o-l-d),a=c+f+h):s===v$?(o=u+l+d,c=Math.max(0,a-f-h)):s===LJ&&(o=u+l+d,a=c+f+h),e._resizeView(o,a,u,c,[l,f],r.resize)}const aQ=Object.freeze(Object.defineProperty({__proto__:null,bound:x$,identifier:iv,mark:w$,overlap:E$,render:F$,viewlayout:O$},Symbol.toStringTag,{value:"Module"}));function L$(e){P.call(this,null,e)}te(L$,P,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.scale,o=e.count==null?e.values?e.values.length:10:e.count,a=t3(s,o,e.minstep),u=e.format||Sk(n,s,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?$k(s,e.values,a):n3(s,a);return r&&(i.rem=r),r=l.map((c,f)=>it({index:f/(l.length-1||1),value:c,label:u(c)})),e.extra&&r.length&&r.push(it({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function I$(e){P.call(this,null,e)}function uQ(){return it({})}function lQ(e){const t=sl().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}te(I$,P,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||uQ,s=e.key||_e,o=this.value;return W(i.encode)&&(i.encode=null),o&&(e.modified("key")||t.modified(s))&&q("DataJoin does not support modified key function or fields."),o||(t=t.addAll(),this.value=o=lQ(s)),t.visit(t.ADD,a=>{const u=s(a);let l=o.get(u);l?l.exit?(o.empty--,i.add.push(l)):i.mod.push(l):(l=r(a),o.set(u,l),i.add.push(l)),l.datum=a,l.exit=!1}),t.visit(t.MOD,a=>{const u=s(a),l=o.get(u);l&&(l.datum=a,i.mod.push(l))}),t.visit(t.REM,a=>{const u=s(a),l=o.get(u);a===l.datum&&!l.exit&&(i.rem.push(l),l.exit=!0,++o.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&o.empty>n.cleanThreshold)&&n.runAfter(o.clean),i}});function P$(e){P.call(this,null,e)}te(P$,P,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,s=t.encode;if(W(s))if(n.changed()||s.every(f=>r[f]))s=s[0],n.encode=null;else return t.StopPropagation;var o=s==="enter",a=r.update||vo,u=r.enter||vo,l=r.exit||vo,c=(s&&!o?r[s]:a)||vo;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{u(f,e),a(f,e)}),n.modifies(u.output),n.modifies(a.output),c!==vo&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==vo&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),o||c!==vo){const f=t.MOD|(e.modified()?t.REFLOW:0);o?(t.visit(f,d=>{const h=u(d,e)||i;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)):t.visit(f,d=>{(c(d,e)||i)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function z$(e){P.call(this,[],e)}te(z$,P,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.type||sp,o=e.scale,a=+e.limit,u=t3(o,e.count==null?5:e.count,e.minstep),l=!!e.values||s===sp,c=e.format||Mk(n,o,u,s,e.formatSpecifier,e.formatType,l),f=e.values||Tk(o,u),d,h,p,g,m;return r&&(i.rem=r),s===sp?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,a-1),m=!0):r=f,Le(p=e.size)?(!e.values&&o(r[0])===0&&(r=r.slice(1)),g=r.reduce((y,b)=>Math.max(y,p(b,e)),0)):p=kn(g=p||8),r=r.map((y,b)=>it({index:b,label:c(y,b,r),value:y,offset:g,size:p(y,e)})),m&&(m=f[r.length],r.push(it({index:r.length,label:`…${f.length-r.length} entries`,value:m,offset:g,size:p(m,e)})))):s===LX?(d=o.domain(),h=Ek(o,d[0],Ge(d)),f.length<3&&!e.values&&d[0]!==Ge(d)&&(f=[d[0],Ge(d)]),r=f.map((y,b)=>it({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(p=f.length-1,h=VX(o),r=f.map((y,b)=>it({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===p?1:h(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const cQ=e=>e.source.x,fQ=e=>e.source.y,dQ=e=>e.target.x,hQ=e=>e.target.y;function rv(e){P.call(this,{},e)}rv.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},te(rv,P,{transform(e,t){var n=e.sourceX||cQ,i=e.sourceY||fQ,r=e.targetX||dQ,s=e.targetY||hQ,o=e.as||"path",a=e.orient||"vertical",u=e.shape||"line",l=q$.get(u+"-"+a)||q$.get(u);return l||q("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[o]=l(n(c),i(c),r(c),s(c))}),t.reflow(e.modified()).modifies(o)}});const B$=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,pQ=(e,t,n,i)=>B$(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),U$=(e,t,n,i)=>{var r=n-e,s=i-t,o=Math.hypot(r,s)/2,a=180*Math.atan2(s,r)/Math.PI;return"M"+e+","+t+"A"+o+","+o+" "+a+" 0 1 "+n+","+i},gQ=(e,t,n,i)=>U$(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),j$=(e,t,n,i)=>{const r=n-e,s=i-t,o=.2*(r+s),a=.2*(s-r);return"M"+e+","+t+"C"+(e+o)+","+(t+a)+" "+(n+a)+","+(i-o)+" "+n+","+i},q$=sl({line:B$,"line-radial":pQ,arc:U$,"arc-radial":gQ,curve:j$,"curve-radial":(e,t,n,i)=>j$(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),"orthogonal-horizontal":(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,"orthogonal-vertical":(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,"orthogonal-radial":(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),u=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*s+"A"+t+","+t+" 0 0,"+(u?1:0)+" "+t*o+","+t*a+"L"+i*o+","+i*a},"diagonal-horizontal":(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},"diagonal-vertical":(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},"diagonal-radial":(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),u=(t+i)/2;return"M"+t*r+","+t*s+"C"+u*r+","+u*s+" "+u*o+","+u*a+" "+i*o+","+i*a}});function sv(e){P.call(this,null,e)}sv.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},te(sv,P,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],s=e.field||tl,o=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,u=t.source,l=u.map(s),c=l.length,f=o,d=(a-o)/m8(l),h=Ei(c),p,g,m;for(e.sort&&h.sort((y,b)=>l[y]-l[b]),p=0;p-1)return i;var r=t.domain,s=e.type,o=t.zero||t.zero===void 0&&yQ(e),a,u;if(!r)return 0;if((o||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(r=r.slice()).length-1||1,o&&(r[0]>0&&(r[0]=0),r[a]<0&&(r[a]=0)),t.domainMin!=null&&(r[0]=t.domainMin),t.domainMax!=null&&(r[a]=t.domainMax),t.domainMid!=null)){u=t.domainMid;const l=u>r[a]?a+1:ur+(s<0?-1:s>0?1:0),0));i!==t.length&&n.warn("Log scale domain includes zero: "+Q(t))}return t}function CQ(e,t,n){let i=t.bins;if(i&&!W(i)){const r=e.domain(),s=r[0],o=Ge(r),a=i.step;let u=i.start==null?s:i.start,l=i.stop==null?o:i.stop;a||q("Scale bins parameter missing step property."),uo&&(l=a*Math.floor(o/a)),i=Ei(u,l+a/2,a)}return i?e.bins=i:e.bins&&delete e.bins,e.type===Yb&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function kQ(e,t,n){var i=e.type,r=t.round||!1,s=t.range;if(t.rangeStep!=null)s=AQ(i,t,n);else if(t.scheme&&(s=$Q(i,t,n),Le(s))){if(e.interpolator)return e.interpolator(s);q(`Scale type ${i} does not support interpolating color schemes.`)}if(s&&vk(i))return e.interpolator(rp(ov(s,t.reverse),t.interpolate,t.interpolateGamma));s&&t.interpolate&&e.interpolate?e.interpolate(Qb(t.interpolate,t.interpolateGamma)):Le(e.round)?e.round(r):Le(e.rangeRound)&&e.interpolate(r?kf:Lo),s&&e.range(ov(s,t.reverse))}function AQ(e,t,n){e!==fk&&e!==Vb&&q("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===Vb?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Hb(n,r,i)]}function $Q(e,t,n){var i=t.schemeExtent,r,s;return W(t.scheme)?s=rp(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),s=e3(r),s||q(`Unrecognized scheme name: ${t.scheme}`)),n=e===np?n+1:e===Yb?n-1:e===Fl||e===tp?+t.schemeCount||mQ:n,vk(e)?V$(s,i,t.reverse):Le(s)?wk(V$(s,i),n):e===Gb?s:s.slice(0,n)}function V$(e,t,n){return Le(e)&&(t||n)?_k(e,ov(t||[0,1],n)):e}function ov(e,t){return t?e.slice().reverse():e}function Y$(e){P.call(this,null,e)}te(Y$,P,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(Ta(e.sort)),this.modified(n),t}});const X$="zero",K$="center",Z$="normalize",J$=["y0","y1"];function av(e){P.call(this,null,e)}av.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:X$,values:[X$,K$,Z$]},{name:"as",type:"string",array:!0,length:2,default:J$}]},te(av,P,{transform(e,t){var n=e.as||J$,i=n[0],r=n[1],s=Ta(e.sort),o=e.field||tl,a=e.offset===K$?SQ:e.offset===Z$?FQ:DQ,u,l,c,f;for(u=TQ(t.source,e.groupby,s,o),l=0,c=u.length,f=u.max;lg(c),o,a,u,l,c,f,d,h,p;if(t==null)r.push(e.slice());else for(o={},a=0,u=e.length;ap&&(p=h),n&&d.sort(n)}return r.max=p,r}const MQ=Object.freeze(Object.defineProperty({__proto__:null,axisticks:L$,datajoin:I$,encode:P$,legendentries:z$,linkpath:rv,pie:sv,scale:H$,sortitems:Y$,stack:av},Symbol.toStringTag,{value:"Module"}));var ke=1e-6,Wp=1e-12,qe=Math.PI,Mt=qe/2,Hp=qe/4,jn=qe*2,It=180/qe,Ue=qe/180,Ve=Math.abs,Bl=Math.atan,Yi=Math.atan2,Ae=Math.cos,Gp=Math.ceil,Q$=Math.exp,uv=Math.hypot,Vp=Math.log,lv=Math.pow,we=Math.sin,Xi=Math.sign||function(e){return e>0?1:e<0?-1:0},qn=Math.sqrt,cv=Math.tan;function eS(e){return e>1?0:e<-1?qe:Math.acos(e)}function ui(e){return e>1?Mt:e<-1?-Mt:Math.asin(e)}function dn(){}function Yp(e,t){e&&nS.hasOwnProperty(e.type)&&nS[e.type](e,t)}var tS={Feature:function(e,t){Yp(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i=0?1:-1,r=i*n,s=Ae(t),o=we(t),a=pv*o,u=hv*s+a*Ae(r),l=a*i*we(r);Xp.add(Yi(l,u)),dv=e,hv=s,pv=o}function LQ(e){return Kp=new zn,js(e,is),Kp*2}function Zp(e){return[Yi(e[1],e[0]),ui(e[2])]}function Xa(e){var t=e[0],n=e[1],i=Ae(n);return[i*Ae(t),i*we(t),we(n)]}function Jp(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ul(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function gv(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Qp(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function eg(e){var t=qn(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var St,li,Nt,Si,Ka,aS,uS,jl,Kf,Ko,qs,Ws={point:mv,lineStart:cS,lineEnd:fS,polygonStart:function(){Ws.point=dS,Ws.lineStart=IQ,Ws.lineEnd=PQ,Kf=new zn,is.polygonStart()},polygonEnd:function(){is.polygonEnd(),Ws.point=mv,Ws.lineStart=cS,Ws.lineEnd=fS,Xp<0?(St=-(Nt=180),li=-(Si=90)):Kf>ke?Si=90:Kf<-ke&&(li=-90),qs[0]=St,qs[1]=Nt},sphere:function(){St=-(Nt=180),li=-(Si=90)}};function mv(e,t){Ko.push(qs=[St=e,Nt=e]),tSi&&(Si=t)}function lS(e,t){var n=Xa([e*Ue,t*Ue]);if(jl){var i=Ul(jl,n),r=[i[1],-i[0],0],s=Ul(r,i);eg(s),s=Zp(s);var o=e-Ka,a=o>0?1:-1,u=s[0]*It*a,l,c=Ve(o)>180;c^(a*KaSi&&(Si=l)):(u=(u+360)%360-180,c^(a*KaSi&&(Si=t))),c?eFi(St,Nt)&&(Nt=e):Fi(e,Nt)>Fi(St,Nt)&&(St=e):Nt>=St?(eNt&&(Nt=e)):e>Ka?Fi(St,e)>Fi(St,Nt)&&(Nt=e):Fi(e,Nt)>Fi(St,Nt)&&(St=e)}else Ko.push(qs=[St=e,Nt=e]);tSi&&(Si=t),jl=n,Ka=e}function cS(){Ws.point=lS}function fS(){qs[0]=St,qs[1]=Nt,Ws.point=mv,jl=null}function dS(e,t){if(jl){var n=e-Ka;Kf.add(Ve(n)>180?n+(n>0?360:-360):n)}else aS=e,uS=t;is.point(e,t),lS(e,t)}function IQ(){is.lineStart()}function PQ(){dS(aS,uS),is.lineEnd(),Ve(Kf)>ke&&(St=-(Nt=180)),qs[0]=St,qs[1]=Nt,jl=null}function Fi(e,t){return(t-=e)<0?t+360:t}function zQ(e,t){return e[0]-t[0]}function hS(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tFi(i[0],i[1])&&(i[1]=r[1]),Fi(r[0],i[1])>Fi(i[0],i[1])&&(i[0]=r[0])):s.push(i=r);for(o=-1/0,n=s.length-1,t=0,i=s[n];t<=n;i=r,++t)r=s[t],(a=Fi(i[1],r[0]))>o&&(o=a,St=r[0],Nt=i[1])}return Ko=qs=null,St===1/0||li===1/0?[[NaN,NaN],[NaN,NaN]]:[[St,li],[Nt,Si]]}var Zf,tg,ng,ig,rg,sg,og,ag,yv,bv,vv,pS,gS,Wn,Hn,Gn,br={sphere:dn,point:xv,lineStart:mS,lineEnd:yS,polygonStart:function(){br.lineStart=qQ,br.lineEnd=WQ},polygonEnd:function(){br.lineStart=mS,br.lineEnd=yS}};function xv(e,t){e*=Ue,t*=Ue;var n=Ae(t);Jf(n*Ae(e),n*we(e),we(t))}function Jf(e,t,n){++Zf,ng+=(e-ng)/Zf,ig+=(t-ig)/Zf,rg+=(n-rg)/Zf}function mS(){br.point=UQ}function UQ(e,t){e*=Ue,t*=Ue;var n=Ae(t);Wn=n*Ae(e),Hn=n*we(e),Gn=we(t),br.point=jQ,Jf(Wn,Hn,Gn)}function jQ(e,t){e*=Ue,t*=Ue;var n=Ae(t),i=n*Ae(e),r=n*we(e),s=we(t),o=Yi(qn((o=Hn*s-Gn*r)*o+(o=Gn*i-Wn*s)*o+(o=Wn*r-Hn*i)*o),Wn*i+Hn*r+Gn*s);tg+=o,sg+=o*(Wn+(Wn=i)),og+=o*(Hn+(Hn=r)),ag+=o*(Gn+(Gn=s)),Jf(Wn,Hn,Gn)}function yS(){br.point=xv}function qQ(){br.point=HQ}function WQ(){bS(pS,gS),br.point=xv}function HQ(e,t){pS=e,gS=t,e*=Ue,t*=Ue,br.point=bS;var n=Ae(t);Wn=n*Ae(e),Hn=n*we(e),Gn=we(t),Jf(Wn,Hn,Gn)}function bS(e,t){e*=Ue,t*=Ue;var n=Ae(t),i=n*Ae(e),r=n*we(e),s=we(t),o=Hn*s-Gn*r,a=Gn*i-Wn*s,u=Wn*r-Hn*i,l=uv(o,a,u),c=ui(l),f=l&&-c/l;yv.add(f*o),bv.add(f*a),vv.add(f*u),tg+=c,sg+=c*(Wn+(Wn=i)),og+=c*(Hn+(Hn=r)),ag+=c*(Gn+(Gn=s)),Jf(Wn,Hn,Gn)}function GQ(e){Zf=tg=ng=ig=rg=sg=og=ag=0,yv=new zn,bv=new zn,vv=new zn,js(e,br);var t=+yv,n=+bv,i=+vv,r=uv(t,n,i);return rqe&&(e-=Math.round(e/jn)*jn),[e,t]}wv.invert=wv;function vS(e,t,n){return(e%=jn)?t||n?_v(_S(e),wS(t,n)):_S(e):t||n?wS(t,n):wv}function xS(e){return function(t,n){return t+=e,Ve(t)>qe&&(t-=Math.round(t/jn)*jn),[t,n]}}function _S(e){var t=xS(e);return t.invert=xS(-e),t}function wS(e,t){var n=Ae(e),i=we(e),r=Ae(t),s=we(t);function o(a,u){var l=Ae(u),c=Ae(a)*l,f=we(a)*l,d=we(u),h=d*n+c*i;return[Yi(f*r-h*s,c*n-d*i),ui(h*r+f*s)]}return o.invert=function(a,u){var l=Ae(u),c=Ae(a)*l,f=we(a)*l,d=we(u),h=d*r-f*s;return[Yi(f*r+d*s,c*n+h*i),ui(h*n-c*i)]},o}function VQ(e){e=vS(e[0]*Ue,e[1]*Ue,e.length>2?e[2]*Ue:0);function t(n){return n=e(n[0]*Ue,n[1]*Ue),n[0]*=It,n[1]*=It,n}return t.invert=function(n){return n=e.invert(n[0]*Ue,n[1]*Ue),n[0]*=It,n[1]*=It,n},t}function YQ(e,t,n,i,r,s){if(n){var o=Ae(t),a=we(t),u=i*n;r==null?(r=t+i*jn,s=t-u/2):(r=ES(o,r),s=ES(o,s),(i>0?rs)&&(r+=i*jn));for(var l,c=r;i>0?c>s:c1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function ug(e,t){return Ve(e[0]-t[0])=0;--a)r.point((f=c[a])[0],f[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,c=d.z,h=!h}while(!d.v);r.lineEnd()}}}function AS(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n=0?1:-1,S=k*C,$=S>qe,O=m*E;if(u.add(Yi(O*k*we(S),y*w+O*Ae(S))),o+=$?C+k*jn:C,$^p>=n^x>=n){var R=Ul(Xa(h),Xa(v));eg(R);var D=Ul(s,R);eg(D);var A=($^C>=0?-1:1)*ui(D[2]);(i>A||i===A&&(R[0]||R[1]))&&(a+=$^C>=0?1:-1)}}return(o<-ke||o0){for(u||(r.polygonStart(),u=!0),r.lineStart(),E=0;E1&&x&2&&_.push(_.pop().concat(_.shift())),c.push(_.filter(KQ))}}return d}}function KQ(e){return e.length>1}function ZQ(e,t){return((e=e.x)[0]<0?e[1]-Mt-ke:Mt-e[1])-((t=t.x)[0]<0?t[1]-Mt-ke:Mt-t[1])}const SS=$S(function(){return!0},JQ,eee,[-qe,-Mt]);function JQ(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(s,o){var a=s>0?qe:-qe,u=Ve(s-t);Ve(u-qe)0?Mt:-Mt),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(s,n),r=0):i!==a&&u>=qe&&(Ve(t-i)ke?Bl((we(t)*(s=Ae(i))*we(n)-we(i)*(r=Ae(t))*we(e))/(r*s*o)):(t+i)/2}function eee(e,t,n,i){var r;if(e==null)r=n*Mt,i.point(-qe,r),i.point(0,r),i.point(qe,r),i.point(qe,0),i.point(qe,-r),i.point(0,-r),i.point(-qe,-r),i.point(-qe,0),i.point(-qe,r);else if(Ve(e[0]-t[0])>ke){var s=e[0]0,r=Ve(t)>ke;function s(c,f,d,h){YQ(h,e,n,d,c,f)}function o(c,f){return Ae(c)*Ae(f)>t}function a(c){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,y){var b=[m,y],v,x=o(m,y),_=i?x?0:l(m,y):x?l(m+(m<0?qe:-qe),y):0;if(!f&&(p=h=x)&&c.lineStart(),x!==h&&(v=u(f,b),(!v||ug(f,v)||ug(b,v))&&(b[2]=1)),x!==h)g=0,x?(c.lineStart(),v=u(b,f),c.point(v[0],v[1])):(v=u(f,b),c.point(v[0],v[1],2),c.lineEnd()),f=v;else if(r&&f&&i^x){var E;!(_&d)&&(E=u(b,f,!0))&&(g=0,i?(c.lineStart(),c.point(E[0][0],E[0][1]),c.point(E[1][0],E[1][1]),c.lineEnd()):(c.point(E[1][0],E[1][1]),c.lineEnd(),c.lineStart(),c.point(E[0][0],E[0][1],3)))}x&&(!f||!ug(f,b))&&c.point(b[0],b[1]),f=b,h=x,d=_},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function u(c,f,d){var h=Xa(c),p=Xa(f),g=[1,0,0],m=Ul(h,p),y=Jp(m,m),b=m[0],v=y-b*b;if(!v)return!d&&c;var x=t*y/v,_=-t*b/v,E=Ul(g,m),w=Qp(g,x),C=Qp(m,_);gv(w,C);var k=E,S=Jp(w,k),$=Jp(k,k),O=S*S-$*(Jp(w,w)-1);if(!(O<0)){var R=qn(O),D=Qp(k,(-S-R)/$);if(gv(D,w),D=Zp(D),!d)return D;var A=c[0],M=f[0],B=c[1],G=f[1],z;M0^D[1]<(Ve(D[0]-A)qe^(A<=D[0]&&D[0]<=M)){var Te=Qp(k,(-S+R)/$);return gv(Te,w),[D,Zp(Te)]}}}function l(c,f){var d=i?e:qe-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return $S(o,a,s,i?[0,-e]:[-qe,e-qe])}function nee(e,t,n,i,r,s){var o=e[0],a=e[1],u=t[0],l=t[1],c=0,f=1,d=u-o,h=l-a,p;if(p=n-o,!(!d&&p>0)){if(p/=d,d<0){if(p0){if(p>f)return;p>c&&(c=p)}if(p=r-o,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>c&&(c=p)}else if(d>0){if(p0)){if(p/=h,h<0){if(p0){if(p>f)return;p>c&&(c=p)}if(p=s-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p0&&(e[0]=o+c*d,e[1]=a+c*h),f<1&&(t[0]=o+f*d,t[1]=a+f*h),!0}}}}}var Qf=1e9,cg=-Qf;function FS(e,t,n,i){function r(l,c){return e<=l&&l<=n&&t<=c&&c<=i}function s(l,c,f,d){var h=0,p=0;if(l==null||(h=o(l,f))!==(p=o(c,f))||u(l,c)<0^f>0)do d.point(h===0||h===3?e:n,h>1?i:t);while((h=(h+f+4)%4)!==p);else d.point(c[0],c[1])}function o(l,c){return Ve(l[0]-e)0?0:3:Ve(l[0]-n)0?2:1:Ve(l[1]-t)0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var f=o(l,1),d=o(c,1);return f!==d?f-d:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=CS(),d,h,p,g,m,y,b,v,x,_,E,w={point:C,lineStart:O,lineEnd:R,polygonStart:S,polygonEnd:$};function C(A,M){r(A,M)&&c.point(A,M)}function k(){for(var A=0,M=0,B=h.length;Mi&&(ft-he)*(i-Te)>(Fe-Te)*(e-he)&&++A:Fe<=i&&(ft-he)*(i-Te)<(Fe-Te)*(e-he)&&--A;return A}function S(){c=f,d=[],h=[],E=!0}function $(){var A=k(),M=E&&A,B=(d=g8(d)).length;(M||B)&&(l.polygonStart(),M&&(l.lineStart(),s(null,null,1,l),l.lineEnd()),B&&kS(d,a,A,s,l),l.polygonEnd()),c=l,d=h=p=null}function O(){w.point=D,h&&h.push(p=[]),_=!0,x=!1,b=v=NaN}function R(){d&&(D(g,m),y&&x&&f.rejoin(),d.push(f.result())),w.point=C,x&&c.lineEnd()}function D(A,M){var B=r(A,M);if(h&&p.push([A,M]),_)g=A,m=M,y=B,_=!1,B&&(c.lineStart(),c.point(A,M));else if(B&&x)c.point(A,M);else{var G=[b=Math.max(cg,Math.min(Qf,b)),v=Math.max(cg,Math.min(Qf,v))],z=[A=Math.max(cg,Math.min(Qf,A)),M=Math.max(cg,Math.min(Qf,M))];nee(G,z,e,t,n,i)?(x||(c.lineStart(),c.point(G[0],G[1])),c.point(z[0],z[1]),B||c.lineEnd(),E=!1):B&&(c.lineStart(),c.point(A,M),E=!1)}b=A,v=M,x=B}return w}}function DS(e,t,n){var i=Ei(e,t-ke,n).concat(t);return function(r){return i.map(function(s){return[r,s]})}}function TS(e,t,n){var i=Ei(e,t-ke,n).concat(t);return function(r){return i.map(function(s){return[s,r]})}}function iee(){var e,t,n,i,r,s,o,a,u=10,l=u,c=90,f=360,d,h,p,g,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return Ei(Gp(i/c)*c,n,c).map(p).concat(Ei(Gp(a/f)*f,o,f).map(g)).concat(Ei(Gp(t/u)*u,e,u).filter(function(v){return Ve(v%c)>ke}).map(d)).concat(Ei(Gp(s/l)*l,r,l).filter(function(v){return Ve(v%f)>ke}).map(h))}return y.lines=function(){return b().map(function(v){return{type:"LineString",coordinates:v}})},y.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(g(o).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},y.extent=function(v){return arguments.length?y.extentMajor(v).extentMinor(v):y.extentMinor()},y.extentMajor=function(v){return arguments.length?(i=+v[0][0],n=+v[1][0],a=+v[0][1],o=+v[1][1],i>n&&(v=i,i=n,n=v),a>o&&(v=a,a=o,o=v),y.precision(m)):[[i,a],[n,o]]},y.extentMinor=function(v){return arguments.length?(t=+v[0][0],e=+v[1][0],s=+v[0][1],r=+v[1][1],t>e&&(v=t,t=e,e=v),s>r&&(v=s,s=r,r=v),y.precision(m)):[[t,s],[e,r]]},y.step=function(v){return arguments.length?y.stepMajor(v).stepMinor(v):y.stepMinor()},y.stepMajor=function(v){return arguments.length?(c=+v[0],f=+v[1],y):[c,f]},y.stepMinor=function(v){return arguments.length?(u=+v[0],l=+v[1],y):[u,l]},y.precision=function(v){return arguments.length?(m=+v,d=DS(s,r,90),h=TS(t,e,m),p=DS(a,o,90),g=TS(i,n,m),y):m},y.extentMajor([[-180,-90+ke],[180,90-ke]]).extentMinor([[-180,-80-ke],[180,80+ke]])}const ed=e=>e;var Cv=new zn,kv=new zn,MS,NS,Av,$v,Hs={point:dn,lineStart:dn,lineEnd:dn,polygonStart:function(){Hs.lineStart=ree,Hs.lineEnd=oee},polygonEnd:function(){Hs.lineStart=Hs.lineEnd=Hs.point=dn,Cv.add(Ve(kv)),kv=new zn},result:function(){var e=Cv/2;return Cv=new zn,e}};function ree(){Hs.point=see}function see(e,t){Hs.point=RS,MS=Av=e,NS=$v=t}function RS(e,t){kv.add($v*e-Av*t),Av=e,$v=t}function oee(){RS(MS,NS)}var ql=1/0,fg=ql,td=-ql,dg=td,hg={point:aee,lineStart:dn,lineEnd:dn,polygonStart:dn,polygonEnd:dn,result:function(){var e=[[ql,fg],[td,dg]];return td=dg=-(fg=ql=1/0),e}};function aee(e,t){etd&&(td=e),tdg&&(dg=t)}var Sv=0,Fv=0,nd=0,pg=0,gg=0,Wl=0,Dv=0,Tv=0,id=0,OS,LS,rs,ss,Ki={point:Za,lineStart:IS,lineEnd:PS,polygonStart:function(){Ki.lineStart=cee,Ki.lineEnd=fee},polygonEnd:function(){Ki.point=Za,Ki.lineStart=IS,Ki.lineEnd=PS},result:function(){var e=id?[Dv/id,Tv/id]:Wl?[pg/Wl,gg/Wl]:nd?[Sv/nd,Fv/nd]:[NaN,NaN];return Sv=Fv=nd=pg=gg=Wl=Dv=Tv=id=0,e}};function Za(e,t){Sv+=e,Fv+=t,++nd}function IS(){Ki.point=uee}function uee(e,t){Ki.point=lee,Za(rs=e,ss=t)}function lee(e,t){var n=e-rs,i=t-ss,r=qn(n*n+i*i);pg+=r*(rs+e)/2,gg+=r*(ss+t)/2,Wl+=r,Za(rs=e,ss=t)}function PS(){Ki.point=Za}function cee(){Ki.point=dee}function fee(){zS(OS,LS)}function dee(e,t){Ki.point=zS,Za(OS=rs=e,LS=ss=t)}function zS(e,t){var n=e-rs,i=t-ss,r=qn(n*n+i*i);pg+=r*(rs+e)/2,gg+=r*(ss+t)/2,Wl+=r,r=ss*e-rs*t,Dv+=r*(rs+e),Tv+=r*(ss+t),id+=r*3,Za(rs=e,ss=t)}function BS(e){this._context=e}BS.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,jn);break}}},result:dn};var Mv=new zn,Nv,US,jS,rd,sd,od={point:dn,lineStart:function(){od.point=hee},lineEnd:function(){Nv&&qS(US,jS),od.point=dn},polygonStart:function(){Nv=!0},polygonEnd:function(){Nv=null},result:function(){var e=+Mv;return Mv=new zn,e}};function hee(e,t){od.point=qS,US=rd=e,jS=sd=t}function qS(e,t){rd-=e,sd-=t,Mv.add(qn(rd*rd+sd*sd)),rd=e,sd=t}let WS,mg,HS,GS;class VS{constructor(t){this._append=t==null?YS:pee(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==HS||this._append!==mg){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,HS=i,mg=this._append,GS=this._,this._=r}this._+=GS;break}}}result(){const t=this._;return this._="",t.length?t:null}}function YS(e){let t=1;this._+=e[0];for(const n=e.length;t=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return YS;if(t!==WS){const n=10**t;WS=t,mg=function(r){let s=1;this._+=r[0];for(const o=r.length;s=0))throw new RangeError(`invalid digits: ${a}`);n=u}return t===null&&(s=new VS(n)),o},o.projection(e).digits(n).context(t)}function yg(e){return function(t){var n=new Rv;for(var i in e)n[i]=e[i];return n.stream=t,n}}function Rv(){}Rv.prototype={constructor:Rv,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Ov(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),js(n,e.stream(hg)),t(hg.result()),i!=null&&e.clipExtent(i),e}function bg(e,t,n){return Ov(e,function(i){var r=t[1][0]-t[0][0],s=t[1][1]-t[0][1],o=Math.min(r/(i[1][0]-i[0][0]),s/(i[1][1]-i[0][1])),a=+t[0][0]+(r-o*(i[1][0]+i[0][0]))/2,u=+t[0][1]+(s-o*(i[1][1]+i[0][1]))/2;e.scale(150*o).translate([a,u])},n)}function Lv(e,t,n){return bg(e,[[0,0],t],n)}function Iv(e,t,n){return Ov(e,function(i){var r=+t,s=r/(i[1][0]-i[0][0]),o=(r-s*(i[1][0]+i[0][0]))/2,a=-s*i[0][1];e.scale(150*s).translate([o,a])},n)}function Pv(e,t,n){return Ov(e,function(i){var r=+t,s=r/(i[1][1]-i[0][1]),o=-s*i[0][0],a=(r-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([o,a])},n)}var KS=16,gee=Ae(30*Ue);function ZS(e,t){return+t?yee(e,t):mee(e)}function mee(e){return yg({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function yee(e,t){function n(i,r,s,o,a,u,l,c,f,d,h,p,g,m){var y=l-i,b=c-r,v=y*y+b*b;if(v>4*t&&g--){var x=o+d,_=a+h,E=u+p,w=qn(x*x+_*_+E*E),C=ui(E/=w),k=Ve(Ve(E)-1)t||Ve((y*R+b*D)/v-.5)>.3||o*d+a*h+u*p2?A[2]%360*Ue:0,R()):[a*It,u*It,l*It]},$.angle=function(A){return arguments.length?(f=A%360*Ue,R()):f*It},$.reflectX=function(A){return arguments.length?(d=A?-1:1,R()):d<0},$.reflectY=function(A){return arguments.length?(h=A?-1:1,R()):h<0},$.precision=function(A){return arguments.length?(E=ZS(w,_=A*A),D()):qn(_)},$.fitExtent=function(A,M){return bg($,A,M)},$.fitSize=function(A,M){return Lv($,A,M)},$.fitWidth=function(A,M){return Iv($,A,M)},$.fitHeight=function(A,M){return Pv($,A,M)};function R(){var A=JS(n,0,0,d,h,f).apply(null,t(s,o)),M=JS(n,i-A[0],r-A[1],d,h,f);return c=vS(a,u,l),w=_v(t,M),C=_v(c,w),E=ZS(w,_),D()}function D(){return k=S=null,$}return function(){return t=e.apply(this,arguments),$.invert=t.invert&&O,R()}}function zv(e){var t=0,n=qe/3,i=QS(e),r=i(t,n);return r.parallels=function(s){return arguments.length?i(t=s[0]*Ue,n=s[1]*Ue):[t*It,n*It]},r}function _ee(e){var t=Ae(e);function n(i,r){return[i*t,we(r)/t]}return n.invert=function(i,r){return[i/t,ui(r*t)]},n}function wee(e,t){var n=we(e),i=(n+we(t))/2;if(Ve(i)=.12&&m<.234&&g>=-.425&&g<-.214?r:m>=.166&&m<.234&&g>=-.214&&g<-.115?o:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=Eee([n.stream(t=d),r.stream(d),o.stream(d)])},c.precision=function(d){return arguments.length?(n.precision(d),r.precision(d),o.precision(d),f()):n.precision()},c.scale=function(d){return arguments.length?(n.scale(d),r.scale(d*.35),o.scale(d),c.translate(n.translate())):n.scale()},c.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return i=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(l),s=r.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+ke,g+.12*h+ke],[p-.214*h-ke,g+.234*h-ke]]).stream(l),a=o.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+ke,g+.166*h+ke],[p-.115*h-ke,g+.234*h-ke]]).stream(l),f()},c.fitExtent=function(d,h){return bg(c,d,h)},c.fitSize=function(d,h){return Lv(c,d,h)},c.fitWidth=function(d,h){return Iv(c,d,h)},c.fitHeight=function(d,h){return Pv(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function tF(e){return function(t,n){var i=Ae(t),r=Ae(n),s=e(i*r);return s===1/0?[2,0]:[s*r*we(t),s*we(n)]}}function ad(e){return function(t,n){var i=qn(t*t+n*n),r=e(i),s=we(r),o=Ae(r);return[Yi(t*s,i*o),ui(i&&n*s/i)]}}var nF=tF(function(e){return qn(2/(1+e))});nF.invert=ad(function(e){return 2*ui(e/2)});function kee(){return os(nF).scale(124.75).clipAngle(180-.001)}var iF=tF(function(e){return(e=eS(e))&&e/we(e)});iF.invert=ad(function(e){return e});function Aee(){return os(iF).scale(79.4188).clipAngle(180-.001)}function xg(e,t){return[e,Vp(cv((Mt+t)/2))]}xg.invert=function(e,t){return[e,2*Bl(Q$(t))-Mt]};function $ee(){return rF(xg).scale(961/jn)}function rF(e){var t=os(e),n=t.center,i=t.scale,r=t.translate,s=t.clipExtent,o=null,a,u,l;t.scale=function(f){return arguments.length?(i(f),c()):i()},t.translate=function(f){return arguments.length?(r(f),c()):r()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?o=a=u=l=null:(o=+f[0][0],a=+f[0][1],u=+f[1][0],l=+f[1][1]),c()):o==null?null:[[o,a],[u,l]]};function c(){var f=qe*i(),d=t(VQ(t.rotate()).invert([0,0]));return s(o==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===xg?[[Math.max(d[0]-f,o),a],[Math.min(d[0]+f,u),l]]:[[o,Math.max(d[1]-f,a)],[u,Math.min(d[1]+f,l)]])}return c()}function _g(e){return cv((Mt+e)/2)}function See(e,t){var n=Ae(e),i=e===t?we(e):Vp(n/Ae(t))/Vp(_g(t)/_g(e)),r=n*lv(_g(e),i)/i;if(!i)return xg;function s(o,a){r>0?a<-Mt+ke&&(a=-Mt+ke):a>Mt-ke&&(a=Mt-ke);var u=r/lv(_g(a),i);return[u*we(i*o),r-u*Ae(i*o)]}return s.invert=function(o,a){var u=r-a,l=Xi(i)*qn(o*o+u*u),c=Yi(o,Ve(u))*Xi(u);return u*i<0&&(c-=qe*Xi(o)*Xi(u)),[c/i,2*Bl(lv(r/l,1/i))-Mt]},s}function Fee(){return zv(See).scale(109.5).parallels([30,30])}function wg(e,t){return[e,t]}wg.invert=wg;function Dee(){return os(wg).scale(152.63)}function Tee(e,t){var n=Ae(e),i=e===t?we(e):(n-Ae(t))/(t-e),r=n/i+e;if(Ve(i)ke&&--i>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function Iee(){return os(aF).scale(175.295)}function uF(e,t){return[Ae(t)*we(e),we(t)]}uF.invert=ad(ui);function Pee(){return os(uF).scale(249.5).clipAngle(90+ke)}function lF(e,t){var n=Ae(t),i=1+Ae(e)*n;return[n*we(e)/i,we(t)/i]}lF.invert=ad(function(e){return 2*Bl(e)});function zee(){return os(lF).scale(250).clipAngle(142)}function cF(e,t){return[Vp(cv((Mt+t)/2)),-e]}cF.invert=function(e,t){return[-t,2*Bl(Q$(e))-Mt]};function Bee(){var e=rF(cF),t=e.center,n=e.rotate;return e.center=function(i){return arguments.length?t([-i[1],i[0]]):(i=t(),[i[1],-i[0]])},e.rotate=function(i){return arguments.length?n([i[0],i[1],i.length>2?i[2]+90:90]):(i=n(),[i[0],i[1],i[2]-90])},n([0,0,90]).scale(159.155)}var Uee=Math.abs,Bv=Math.cos,Cg=Math.sin,jee=1e-6,fF=Math.PI,Uv=fF/2,dF=qee(2);function hF(e){return e>1?Uv:e<-1?-Uv:Math.asin(e)}function qee(e){return e>0?Math.sqrt(e):0}function Wee(e,t){var n=e*Cg(t),i=30,r;do t-=r=(t+Cg(t)-n)/(1+Bv(t));while(Uee(r)>jee&&--i>0);return t/2}function Hee(e,t,n){function i(r,s){return[e*r*Bv(s=Wee(n,s)),t*Cg(s)]}return i.invert=function(r,s){return s=hF(s/t),[r/(e*Bv(s)),hF((2*s+Cg(2*s))/n)]},i}var Gee=Hee(dF/Uv,dF,fF);function Vee(){return os(Gee).scale(169.529)}const Yee=XS(),jv=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function Xee(e,t){return function n(){const i=t();return i.type=e,i.path=XS().projection(i),i.copy=i.copy||function(){const r=n();return jv.forEach(s=>{i[s]&&r[s](i[s]())}),r.path.pointRadius(i.path.pointRadius()),r},gk(i)}}function qv(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(kg[e]=Xee(e,t),this):kg[e]||null}function pF(e){return e&&e.path||Yee}const kg={albers:eF,albersusa:Cee,azimuthalequalarea:kee,azimuthalequidistant:Aee,conicconformal:Fee,conicequalarea:vg,conicequidistant:Mee,equalEarth:Ree,equirectangular:Dee,gnomonic:Oee,identity:Lee,mercator:$ee,mollweide:Vee,naturalEarth1:Iee,orthographic:Pee,stereographic:zee,transversemercator:Bee};for(const e in kg)qv(e,kg[e]);function Kee(){}const Gs=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function gF(){var e=1,t=1,n=a;function i(u,l){return l.map(c=>r(u,c))}function r(u,l){var c=[],f=[];return s(u,l,d=>{n(d,u,l),Zee(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=c.length,g;h=l,Gs[m<<1].forEach(v);++h=l,Gs[g|m<<1].forEach(v);for(Gs[m<<0].forEach(v);++p=l,y=u[p*e]>=l,Gs[m<<1|y<<2].forEach(v);++h=l,b=y,y=u[p*e+h+1]>=l,Gs[g|m<<1|y<<2|b<<3].forEach(v);Gs[m|y<<3].forEach(v)}for(h=-1,y=u[p*e]>=l,Gs[y<<2].forEach(v);++h=l,Gs[y<<2|b<<3].forEach(v);Gs[y<<3].forEach(v);function v(x){var _=[x[0][0]+h,x[0][1]+p],E=[x[1][0]+h,x[1][1]+p],w=o(_),C=o(E),k,S;(k=d[w])?(S=f[C])?(delete d[k.end],delete f[S.start],k===S?(k.ring.push(E),c(k.ring)):f[k.start]=d[S.end]={start:k.start,end:S.end,ring:k.ring.concat(S.ring)}):(delete d[k.end],k.ring.push(E),d[k.end=C]=k):(k=f[C])?(S=d[w])?(delete f[k.start],delete d[S.end],k===S?(k.ring.push(E),c(k.ring)):f[S.start]=d[k.end]={start:S.start,end:k.end,ring:S.ring.concat(k.ring)}):(delete f[k.start],k.ring.unshift(_),f[k.start=w]=k):f[w]=d[C]={start:w,end:C,ring:[_,E]}}}function o(u){return u[0]*2+u[1]*(e+1)*4}function a(u,l,c){u.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,y=l[g*e+p];d>0&&d0&&h=0&&c>=0||q("invalid size"),e=l,t=c,i},i.smooth=function(u){return arguments.length?(n=u?a:Kee,i):n===a},i}function Zee(e){for(var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++ti!=h>i&&n<(d-l)*(i-c)/(h-c)+l&&(r=-r)}return r}function ete(e,t,n){var i;return tte(e,t,n)&&nte(e[i=+(e[0]===t[0])],n[i],t[i])}function tte(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function nte(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function mF(e,t,n){return function(i){var r=qr(i),s=n?Math.min(r[0],0):r[0],o=r[1],a=o-s,u=t?Co(s,o,e):a/(e+1);return Ei(s+u,o,u)}}function Wv(e){P.call(this,null,e)}Wv.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},te(Wv,P,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||En,s=gF().smooth(e.smooth!==!1),o=e.thresholds||ite(i,r,e),a=e.as===null?null:e.as||"contour",u=[];return i.forEach(l=>{const c=r(l),f=s.size([c.width,c.height])(c.values,W(o)?o:o(c.values));rte(f,c,l,e),f.forEach(d=>{u.push(b0(l,it(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function ite(e,t,n){const i=mF(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>Aa(t(r).values)))}function rte(e,t,n,i){let r=i.scale||t.scale,s=i.translate||t.translate;if(Le(r)&&(r=r(n,i)),Le(s)&&(s=s(n,i)),(r===1||r==null)&&!s)return;const o=(Je(r)?r:r[0])||1,a=(Je(r)?r:r[1])||1,u=s&&s[0]||0,l=s&&s[1]||0;e.forEach(yF(t,o,a,u,l))}function yF(e,t,n,i,r){const s=e.x1||0,o=e.y1||0,a=t*n<0;function u(f){f.forEach(l)}function l(f){a&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-s)*t+i,f[1]=(f[1]-o)*n+r}return function(f){return f.coordinates.forEach(u),f}}function bF(e,t,n){const i=e>=0?e:vy(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function Hv(e){return Le(e)?e:kn(+e)}function vF(){var e=u=>u[0],t=u=>u[1],n=tl,i=[-1,-1],r=960,s=500,o=2;function a(u,l){const c=bF(i[0],u,e)>>o,f=bF(i[1],u,t)>>o,d=c?c+2:0,h=f?f+2:0,p=2*d+(r>>o),g=2*h+(s>>o),m=new Float32Array(p*g),y=new Float32Array(p*g);let b=m;u.forEach(x=>{const _=d+(+e(x)>>o),E=h+(+t(x)>>o);_>=0&&_=0&&E0&&f>0?(Hl(p,g,m,y,c),Gl(p,g,y,m,f),Hl(p,g,m,y,c),Gl(p,g,y,m,f),Hl(p,g,m,y,c),Gl(p,g,y,m,f)):c>0?(Hl(p,g,m,y,c),Hl(p,g,y,m,c),Hl(p,g,m,y,c),b=y):f>0&&(Gl(p,g,m,y,f),Gl(p,g,y,m,f),Gl(p,g,m,y,f),b=y);const v=l?Math.pow(2,-2*o):1/m8(b);for(let x=0,_=p*g;x<_;++x)b[x]*=v;return{values:b,scale:1<>o),y2:h+(s>>o)}}return a.x=function(u){return arguments.length?(e=Hv(u),a):e},a.y=function(u){return arguments.length?(t=Hv(u),a):t},a.weight=function(u){return arguments.length?(n=Hv(u),a):n},a.size=function(u){if(!arguments.length)return[r,s];var l=+u[0],c=+u[1];return l>=0&&c>=0||q("invalid size"),r=l,s=c,a},a.cellSize=function(u){return arguments.length?((u=+u)>=1||q("invalid cell size"),o=Math.floor(Math.log(u)/Math.LN2),a):1<=r&&(a>=s&&(u-=n[a-s+o*e]),i[a-r+o*e]=u/Math.min(a+1,e-1+s-a,s))}function Gl(e,t,n,i,r){const s=(r<<1)+1;for(let o=0;o=r&&(a>=s&&(u-=n[o+(a-s)*e]),i[o+(a-r)*e]=u/Math.min(a+1,t-1+s-a,s))}function Gv(e){P.call(this,null,e)}Gv.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const ste=["x","y","weight","size","cellSize","bandwidth"];function xF(e,t){return ste.forEach(n=>t[n]!=null?e[n](t[n]):0),e}te(Gv,P,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=ote(i,e.groupby),s=(e.groupby||[]).map(Tt),o=xF(vF(),e),a=e.as||"grid",u=[];function l(c,f){for(let d=0;dit(l({[a]:o(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function ote(e,t){var n=[],i=c=>c(a),r,s,o,a,u,l;if(t==null)n.push(e);else for(r={},s=0,o=e.length;sn.push(a(c))),s&&o&&(t.visit(u,c=>{var f=s(c),d=o(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&i.push([f,d])}),n=n.concat({type:Yv,geometry:{type:ate,coordinates:i}})),this.value={type:Xv,features:n}}});function Zv(e){P.call(this,null,e)}Zv.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},te(Zv,P,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||En,s=e.as||"path",o=n.SOURCE;!i||e.modified()?(this.value=i=pF(e.projection),n.materialize().reflow()):o=r===En||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=ute(i,e.pointRadius);return n.visit(o,u=>u[s]=i(r(u))),i.pointRadius(a),n.modifies(s)}});function ute(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function Jv(e){P.call(this,null,e)}Jv.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},te(Jv,P,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],s=e.as||["x","y"],o=s[0],a=s[1],u;function l(c){const f=n([i(c),r(c)]);f?(c[o]=f[0],c[a]=f[1]):(c[o]=void 0,c[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(u=t.modified(i.fields)||t.modified(r.fields),t.visit(u?t.ADD_MOD:t.ADD,l)),t.modifies(s)}});function Qv(e){P.call(this,null,e)}Qv.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},te(Qv,P,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",s=n.ADD;return(!i||e.modified())&&(this.value=i=lte(pF(e.projection),e.field||Bi("datum"),e.pointRadius),n.materialize().reflow(),s=n.SOURCE),n.visit(s,o=>o[r]=i),n.modifies(r)}});function lte(e,t,n){const i=n==null?r=>e(t(r)):r=>{var s=e.pointRadius(),o=e.pointRadius(n)(t(r));return e.pointRadius(s),o};return i.context=r=>(e.context(r),i),i}function e7(e){P.call(this,[],e),this.generator=iee()}e7.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},te(e7,P,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const s in e)Le(i[s])&&i[s](e[s]);return r=i(),n.length?t.mod.push(ME(n[0],r)):t.add.push(it(r)),n[0]=r,t}});function t7(e){P.call(this,null,e)}t7.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},te(t7,P,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||En,s=fte(e.opacity,e),o=cte(e.color,e),a=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?Aa(n.map(l=>Aa(r(l).values))):0};return n.forEach(l=>{const c=r(l),f=Ie({},l,u);i||(f.$max=Aa(c.values||[])),l[a]=dte(c,f,o.dep?o:kn(o(f)),s.dep?s:kn(s(f)))}),t.reflow(!0).modifies(a)}});function cte(e,t){let n;return Le(e)?(n=i=>Oo(e(i,t)),n.dep=_F(e)):n=kn(Oo(e||"#888")),n}function fte(e,t){let n;return Le(e)?(n=i=>e(i,t),n.dep=_F(e)):e?n=kn(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function _F(e){if(!Le(e))return!1;const t=lr(wn(e));return t.$x||t.$y||t.$value||t.$max}function dte(e,t,n,i){const r=e.width,s=e.height,o=e.x1||0,a=e.y1||0,u=e.x2||r,l=e.y2||s,c=e.values,f=c?m=>c[m]:bo,d=Mo(u-o,l-a),h=d.getContext("2d"),p=h.getImageData(0,0,u-o,l-a),g=p.data;for(let m=a,y=0;m{e[i]!=null&&EF(n,i,e[i])})):jv.forEach(i=>{e.modified(i)&&EF(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&hte(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function hte(e,t){const n=gte(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function pte(e){const t=qv((e||"mercator").toLowerCase());return t||q("Unrecognized projection type: "+e),t()}function EF(e,t,n){Le(e[t])&&e[t](n)}function gte(e){return e=oe(e),e.length===1?e[0]:{type:Xv,features:e.reduce((t,n)=>t.concat(mte(n)),[])}}function mte(e){return e.type===Xv?e.features:oe(e).filter(t=>t!=null).map(t=>t.type===Yv?t:{type:Yv,geometry:t})}const yte=Object.freeze(Object.defineProperty({__proto__:null,contour:Vv,geojson:Kv,geopath:Zv,geopoint:Jv,geoshape:Qv,graticule:e7,heatmap:t7,isocontour:Wv,kde2d:Gv,projection:wF},Symbol.toStringTag,{value:"Module"}));function bte(e,t){var n,i=1;e==null&&(e=0),t==null&&(t=0);function r(){var s,o=n.length,a,u=0,l=0;for(s=0;s=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d,r=s,!(s=s[y=m<<1|g]))return r[y]=o,e;if(h=+e._x.call(null,s.data),p=+e._y.call(null,s.data),t===h&&n===p)return o.next=s,r?r[y]=o:e._root=o,e;do r=r?r[y]=new Array(4):e._root=new Array(4),(g=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d;while((y=m<<1|g)===(b=(p>=d)<<1|h>=f));return r[b]=s,r[y]=o,e}function xte(e){var t,n,i=e.length,r,s,o=new Array(i),a=new Array(i),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;nc&&(c=r),sf&&(f=s));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;ne||e>=r||i>t||t>=s;)switch(l=(tc||(a=p.y0)>f||(u=p.x1)=y)<<1|e>=m)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var b=e-+this._x.call(null,h.data),v=t-+this._y.call(null,h.data),x=b*b+v*v;if(x=(d=(o+u)/2))?o=d:u=d,(g=f>=(h=(a+l)/2))?a=h:l=h,t=n,!(n=n[m=g<<1|p]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(i=t,y=m)}for(;n.data!==e;)if(r=n,!(n=n.next))return this;return(s=n.next)&&delete n.next,r?(s?r.next=s:delete r.next,this):t?(s?t[m]=s:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(i?i[y]=n:this._root=n),this):(this._root=s,this)}function Ate(e){for(var t=0,n=e.length;td.index){var $=h-C.x-C.vx,O=p-C.y-C.vy,R=$*$+O*O;Rh+S||Ep+S||wl.r&&(l.r=l[c].r)}function u(){if(t){var l,c=t.length,f;for(n=new Array(c),l=0;l[t(_,E,o),_])),x;for(m=0,a=new Array(y);m{}};function $F(){for(var e=0,t=arguments.length,n={},i;e=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Ag.prototype=$F.prototype={constructor:Ag,on:function(e,t){var n=this._,i=Ute(e+"",n),r,s=-1,o=i.length;if(arguments.length<2){for(;++s0)for(var n=new Array(r),i=0,r,s;i=0&&e._call.call(void 0,t),e=e._next;--Vl}function MF(){Ja=(Sg=gd.now())+Fg,Vl=dd=0;try{Wte()}finally{Vl=0,Gte(),Ja=0}}function Hte(){var e=gd.now(),t=e-Sg;t>FF&&(Fg-=t,Sg=e)}function Gte(){for(var e,t=$g,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:$g=n);pd=e,s7(i)}function s7(e){if(!Vl){dd&&(dd=clearTimeout(dd));var t=e-Ja;t>24?(e<1/0&&(dd=setTimeout(MF,e-gd.now()-Fg)),hd&&(hd=clearInterval(hd))):(hd||(Sg=gd.now(),hd=setInterval(Hte,FF)),Vl=1,DF(MF))}}function Vte(e,t,n){var i=new Dg,r=t;return t==null?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(s,o,a){o=+o,a=a==null?r7():+a,i._restart(function u(l){l+=r,i._restart(u,r+=o,a),s(l)},o,a)},i.restart(e,t,n),i)}const Yte=1664525,Xte=1013904223,NF=4294967296;function Kte(){let e=1;return()=>(e=(Yte*e+Xte)%NF)/NF}function Zte(e){return e.x}function Jte(e){return e.y}var Qte=10,ene=Math.PI*(3-Math.sqrt(5));function tne(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),s=0,o=.6,a=new Map,u=TF(f),l=$F("tick","end"),c=Kte();e==null&&(e=[]);function f(){d(),l.call("tick",t),n1?(m==null?a.delete(g):a.set(g,p(m)),t):a.get(g)},find:function(g,m,y){var b=0,v=e.length,x,_,E,w,C;for(y==null?y=1/0:y*=y,b=0;b1?(l.on(g,m),t):l.on(g)}}}function nne(){var e,t,n,i,r=Xn(-30),s,o=1,a=1/0,u=.81;function l(h){var p,g=e.length,m=n7(e,Zte,Jte).visitAfter(f);for(i=h,p=0;p=a)return;(h.data!==t||h.next)&&(y===0&&(y=Zo(n),x+=y*y),b===0&&(b=Zo(n),x+=b*b),x=0;)n.tick();else if(n.stopped()&&n.restart(),!i)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,u=0,l=a.length,c;ue.touch(t).run()}function ane(e,t){const n=tne(e),i=n.stop,r=n.restart;let s=!1;return n.stopped=()=>s,n.restart=()=>(s=!1,r()),n.stop=()=>(s=!0,i()),LF(n,t,!0).on("end",()=>s=!0)}function LF(e,t,n,i){var r=oe(t.forces),s,o,a,u;for(s=0,o=o7.length;st(i,n):t)}const fne=Object.freeze(Object.defineProperty({__proto__:null,force:a7},Symbol.toStringTag,{value:"Module"}));function dne(e,t){return e.parent===t.parent?1:2}function hne(e){return e.reduce(pne,0)/e.length}function pne(e,t){return e+t.x}function gne(e){return 1+e.reduce(mne,0)}function mne(e,t){return Math.max(e,t.y)}function yne(e){for(var t;t=e.children;)e=t[0];return e}function bne(e){for(var t;t=e.children;)e=t[t.length-1];return e}function vne(){var e=dne,t=1,n=1,i=!1;function r(s){var o,a=0;s.eachAfter(function(d){var h=d.children;h?(d.x=hne(h),d.y=gne(h)):(d.x=o?a+=e(d,o):0,d.y=0,o=d)});var u=yne(s),l=bne(s),c=u.x-e(u,l)/2,f=l.x+e(l,u)/2;return s.eachAfter(i?function(d){d.x=(d.x-s.x)*t,d.y=(s.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(s.y?d.y/s.y:1))*n})}return r.separation=function(s){return arguments.length?(e=s,r):e},r.size=function(s){return arguments.length?(i=!1,t=+s[0],n=+s[1],r):i?null:[t,n]},r.nodeSize=function(s){return arguments.length?(i=!0,t=+s[0],n=+s[1],r):i?[t,n]:null},r}function xne(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function _ne(){return this.eachAfter(xne)}function wne(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function Ene(e,t){for(var n=this,i=[n],r,s,o=-1;n=i.pop();)if(e.call(t,n,++o,this),r=n.children)for(s=r.length-1;s>=0;--s)i.push(r[s]);return this}function Cne(e,t){for(var n=this,i=[n],r=[],s,o,a,u=-1;n=i.pop();)if(r.push(n),s=n.children)for(o=0,a=s.length;o=0;)n+=i[r].value;t.value=n})}function $ne(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Sne(e){for(var t=this,n=Fne(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function Fne(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function Dne(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Tne(){return Array.from(this)}function Mne(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Nne(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Rne(){var e=this,t,n=[e],i,r,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,s=i.length;r=0;--a)r.push(s=o[a]=new Yl(o[a])),s.parent=i,s.depth=i.depth+1;return n.eachBefore(IF)}function One(){return u7(this).eachBefore(Pne)}function Lne(e){return e.children}function Ine(e){return Array.isArray(e)?e[1]:null}function Pne(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function IF(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Yl(e){this.data=e,this.depth=this.height=0,this.parent=null}Yl.prototype=u7.prototype={constructor:Yl,count:_ne,each:wne,eachAfter:Cne,eachBefore:Ene,find:kne,sum:Ane,sort:$ne,path:Sne,ancestors:Dne,descendants:Tne,leaves:Mne,links:Nne,copy:One,[Symbol.iterator]:Rne};function Tg(e){return e==null?null:PF(e)}function PF(e){if(typeof e!="function")throw new Error;return e}function Qa(){return 0}function Xl(e){return function(){return e}}const zne=1664525,Bne=1013904223,zF=4294967296;function Une(){let e=1;return()=>(e=(zne*e+Bne)%zF)/zF}function jne(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function qne(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function Wne(e,t){for(var n=0,i=(e=qne(Array.from(e),t)).length,r=[],s,o;n0&&n*n>i*i+r*r}function l7(e,t){for(var n=0;n1e-6?($+Math.sqrt($*$-4*S*O))/(2*S):O/$);return{x:i+E+w*R,y:r+C+k*R,r:R}}function jF(e,t,n){var i=e.x-t.x,r,s,o=e.y-t.y,a,u,l=i*i+o*o;l?(s=t.r+n.r,s*=s,u=e.r+n.r,u*=u,s>u?(r=(l+u-s)/(2*l),a=Math.sqrt(Math.max(0,u/l-r*r)),n.x=e.x-r*i-a*o,n.y=e.y-r*o+a*i):(r=(l+s-u)/(2*l),a=Math.sqrt(Math.max(0,s/l-r*r)),n.x=t.x+r*i-a*o,n.y=t.y+r*o+a*i)):(n.x=t.x+n.r,n.y=t.y)}function qF(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function WF(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,s=(t.y*n.r+n.y*t.r)/i;return r*r+s*s}function Ng(e){this._=e,this.next=null,this.previous=null}function Yne(e,t){if(!(s=(e=jne(e)).length))return 0;var n,i,r,s,o,a,u,l,c,f,d;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(s>2))return n.r+i.r;jF(i,n,r=e[2]),n=new Ng(n),i=new Ng(i),r=new Ng(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(u=3;utie(n(x,_,r))),b=y.map(KF),v=new Set(y).add("");for(const x of b)v.has(x)||(v.add(x),y.push(x),b.push(KF(x)),s.push(f7));o=(x,_)=>y[_],a=(x,_)=>b[_]}for(c=0,u=s.length;c=0&&(h=s[y],h.data===f7);--y)h.data=null}if(f.parent=Jne,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(IF),f.parent=null,u>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(e=Tg(r),i):e},i.parentId=function(r){return arguments.length?(t=Tg(r),i):t},i.path=function(r){return arguments.length?(n=Tg(r),i):n},i}function tie(e){e=`${e}`;let t=e.length;return d7(e,t-1)&&!d7(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function KF(e){let t=e.length;if(t<2)return"";for(;--t>1&&!d7(e,t););return e.slice(0,t)}function d7(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function nie(e,t){return e.parent===t.parent?1:2}function h7(e){var t=e.children;return t?t[0]:e.t}function p7(e){var t=e.children;return t?t[t.length-1]:e.t}function iie(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function rie(e){for(var t=0,n=0,i=e.children,r=i.length,s;--r>=0;)s=i[r],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function sie(e,t,n){return e.a.parent===t.parent?e.a:n}function Rg(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Rg.prototype=Object.create(Yl.prototype);function oie(e){for(var t=new Rg(e,0),n,i=[t],r,s,o,a;n=i.pop();)if(s=n._.children)for(n.children=new Array(a=s.length),o=a-1;o>=0;--o)i.push(r=n.children[o]=new Rg(s[o],o)),r.parent=n;return(t.parent=new Rg(null,0)).children=[t],t}function aie(){var e=nie,t=1,n=1,i=null;function r(l){var c=oie(l);if(c.eachAfter(s),c.parent.m=-c.z,c.eachBefore(o),i)l.eachBefore(u);else{var f=l,d=l,h=l;l.eachBefore(function(b){b.xd.x&&(d=b),b.depth>h.depth&&(h=b)});var p=f===d?1:e(f,d)/2,g=p-f.x,m=t/(d.x+p+g),y=n/(h.depth||1);l.eachBefore(function(b){b.x=(b.x+g)*m,b.y=b.depth*y})}return l}function s(l){var c=l.children,f=l.parent.children,d=l.i?f[l.i-1]:null;if(c){rie(l);var h=(c[0].z+c[c.length-1].z)/2;d?(l.z=d.z+e(l._,d._),l.m=l.z-h):l.z=h}else d&&(l.z=d.z+e(l._,d._));l.parent.A=a(l,d,l.parent.A||f[0])}function o(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function a(l,c,f){if(c){for(var d=l,h=l,p=c,g=d.parent.children[0],m=d.m,y=h.m,b=p.m,v=g.m,x;p=p7(p),d=h7(d),p&&d;)g=h7(g),h=p7(h),h.a=l,x=p.z+b-d.z-m+e(p._,d._),x>0&&(iie(sie(p,l,f),l,x),m+=x,y+=x),b+=p.m,m+=d.m,v+=g.m,y+=h.m;p&&!p7(h)&&(h.t=p,h.m+=b-y),d&&!h7(g)&&(g.t=d,g.m+=m-v,f=l)}return f}function u(l){l.x*=t,l.y=l.depth*n}return r.separation=function(l){return arguments.length?(e=l,r):e},r.size=function(l){return arguments.length?(i=!1,t=+l[0],n=+l[1],r):i?null:[t,n]},r.nodeSize=function(l){return arguments.length?(i=!0,t=+l[0],n=+l[1],r):i?[t,n]:null},r}function Og(e,t,n,i,r){for(var s=e.children,o,a=-1,u=s.length,l=e.value&&(r-n)/e.value;++ab&&(b=l),E=m*m*_,v=Math.max(b/E,E/y),v>x){m-=l;break}x=v}o.push(u={value:m,dice:h1?i:1)},n}(ZF);function uie(){var e=QF,t=!1,n=1,i=1,r=[0],s=Qa,o=Qa,a=Qa,u=Qa,l=Qa;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(f),r=[0],t&&d.eachBefore(VF),d}function f(d){var h=r[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,y=d.y1-h;m=d-1){var b=s[f];b.x0=p,b.y0=g,b.x1=m,b.y1=y;return}for(var v=l[f],x=h/2+v,_=f+1,E=d-1;_>>1;l[w]y-g){var S=h?(p*k+m*C)/h:m;c(f,_,C,p,g,S,y),c(_,d,k,S,g,m,y)}else{var $=h?(g*k+y*C)/h:y;c(f,_,C,p,g,m,$),c(_,d,k,p,$,m,y)}}}function cie(e,t,n,i,r){(e.depth&1?Og:bd)(e,t,n,i,r)}const fie=function e(t){function n(i,r,s,o,a){if((u=i._squarify)&&u.ratio===t)for(var u,l,c,f,d=-1,h,p=u.length,g=i.value;++d1?i:1)},n}(ZF);function g7(e,t,n){const i={};return e.each(r=>{const s=r.data;n(s)&&(i[t(s)]=r)}),e.lookup=i,e}function m7(e){P.call(this,null,e)}m7.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const die=e=>e.values;te(m7,P,{transform(e,t){t.source||q("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),s=this.value;return(!s||i||t.changed())&&(s&&s.each(o=>{o.children&&y0(o.data)&&r.rem.push(o.data)}),this.value=s=u7({values:oe(e.keys).reduce((o,a)=>(o.key(a),o),hie()).entries(r.source)},die),n&&s.each(o=>{o.children&&(o=it(o.data),r.add.push(o),r.source.push(o))}),g7(s,_e,_e)),r.source.root=s,r}});function hie(){const e=[],t={entries:r=>i(n(r,0),0),key:r=>(e.push(r),t)};function n(r,s){if(s>=e.length)return r;const o=r.length,a=e[s++],u={},l={};let c=-1,f,d,h;for(;++ce.length)return r;const o=[];for(const a in r)o.push({key:a,values:i(r[a],s)});return o}return t}function Vs(e){P.call(this,null,e)}const pie=(e,t)=>e.parent===t.parent?1:2;te(Vs,P,{transform(e,t){(!t.source||!t.source.root)&&q(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,s=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(Ta(e.sort,o=>o.data)),gie(n,this.params,e),n.separation&&n.separation(e.separation!==!1?pie:tl);try{this.value=n(r)}catch(o){q(o)}return r.each(o=>mie(o,i,s)),t.reflow(e.modified()).modifies(s).modifies("leaf")}});function gie(e,t,n){for(let i,r=0,s=t.length;rs[_e(o)]=1),i.each(o=>{const a=o.data,u=o.parent&&o.parent.data;u&&s[_e(a)]&&s[_e(u)]&&r.add.push(it({source:u,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,o=>s[_e(o)]=1),n.forEach(o=>{(s[_e(o.source)]||s[_e(o.target)])&&r.mod.push(o)})),r}});const tD={binary:lie,dice:bd,slice:Og,slicedice:cie,squarify:QF,resquarify:fie},k7=["x0","y0","x1","y1","depth","children"];function A7(e){Vs.call(this,e)}A7.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:k7.length,default:k7}]},te(A7,Vs,{layout(){const e=uie();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{ue(tD,t)?e.tile(tD[t]):q("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:k7});const yie=Object.freeze(Object.defineProperty({__proto__:null,nest:m7,pack:b7,partition:x7,stratify:_7,tree:E7,treelinks:C7,treemap:A7},Symbol.toStringTag,{value:"Module"})),$7=4278190080;function bie(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function vie(e,t,n,i,r){const s=e.width,o=e.height,a=i||r,u=Mo(s,o).getContext("2d"),l=Mo(s,o).getContext("2d"),c=a&&Mo(s,o).getContext("2d");n.forEach(C=>Lg(u,C,!1)),Lg(l,t,!1),a&&Lg(c,t,!0);const f=S7(u,s,o),d=S7(l,s,o),h=a&&S7(c,s,o),p=e.bitmap(),g=a&&e.bitmap();let m,y,b,v,x,_,E,w;for(y=0;y{r.items.forEach(s=>Lg(e,s.items,n))}):$i[i].draw(e,{items:n?t.map(xie):t})}function xie(e){const t=b0(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const Ys=5,Kn=31,vd=32,Jo=new Uint32Array(vd+1),vr=new Uint32Array(vd+1);vr[0]=0,Jo[0]=~vr[0];for(let e=1;e<=vd;++e)vr[e]=vr[e-1]<<1|1,Jo[e]=~vr[e];function _ie(e,t){const n=new Uint32Array(~~((e*t+vd)/vd));function i(s,o){n[s]|=o}function r(s,o){n[s]&=o}return{array:n,get:(s,o)=>{const a=o*e+s;return n[a>>>Ys]&1<<(a&Kn)},set:(s,o)=>{const a=o*e+s;i(a>>>Ys,1<<(a&Kn))},clear:(s,o)=>{const a=o*e+s;r(a>>>Ys,~(1<<(a&Kn)))},getRange:(s,o,a,u)=>{let l=u,c,f,d,h;for(;l>=o;--l)if(c=l*e+s,f=l*e+a,d=c>>>Ys,h=f>>>Ys,d===h){if(n[d]&Jo[c&Kn]&vr[(f&Kn)+1])return!0}else{if(n[d]&Jo[c&Kn]||n[h]&vr[(f&Kn)+1])return!0;for(let p=d+1;p{let l,c,f,d,h;for(;o<=u;++o)if(l=o*e+s,c=o*e+a,f=l>>>Ys,d=c>>>Ys,f===d)i(f,Jo[l&Kn]&vr[(c&Kn)+1]);else for(i(f,Jo[l&Kn]),i(d,vr[(c&Kn)+1]),h=f+1;h{let l,c,f,d,h;for(;o<=u;++o)if(l=o*e+s,c=o*e+a,f=l>>>Ys,d=c>>>Ys,f===d)r(f,vr[l&Kn]|Jo[(c&Kn)+1]);else for(r(f,vr[l&Kn]),r(d,Jo[(c&Kn)+1]),h=f+1;hs<0||o<0||u>=t||a>=e}}function wie(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),s=~~((t+2*n+i)/i),o=a=>~~((a+n)/i);return o.invert=a=>a*i-n,o.bitmap=()=>_ie(r,s),o.ratio=i,o.padding=n,o.width=e,o.height=t,o}function Eie(e,t,n,i){const r=e.width,s=e.height;return function(o){const a=o.datum.datum.items[i].items,u=a.length,l=o.datum.fontSize,c=Ai.width(o.datum,o.datum.text);let f=0,d,h,p,g,m,y,b;for(let v=0;v=f&&(f=b,o.x=m,o.y=y);return m=c/2,y=l/2,d=o.x-m,h=o.x+m,p=o.y-y,g=o.y+y,o.align="center",d<0&&h<=r?o.align="left":0<=d&&rr||t-(o=i/2)<0||t+o>s}function Qo(e,t,n,i,r,s,o,a){const u=r*s/(i*2),l=e(t-u),c=e(t+u),f=e(n-(s=s/2)),d=e(n+s);return o.outOfBounds(l,f,c,d)||o.getRange(l,f,c,d)||a&&a.getRange(l,f,c,d)}function Cie(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1];function u(l,c,f,d,h){const p=e.invert(l),g=e.invert(c);let m=f,y=s,b;if(!Ig(p,g,d,h,r,s)&&!Qo(e,p,g,h,d,m,o,a)&&!Qo(e,p,g,h,d,h,o,null)){for(;y-m>=1;)b=(m+y)/2,Qo(e,p,g,h,d,b,o,a)?y=b:m=b;if(m>f)return[p,g,m,!0]}}return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Ai.width(l.datum,l.datum.text);let p=n?d:0,g=!1,m=!1,y=0,b,v,x,_,E,w,C,k,S,$,O,R,D,A,M,B,G;for(let z=0;zv&&(G=b,b=v,v=G),x>_&&(G=x,x=_,_=G),S=e(b),O=e(v),$=~~((S+O)/2),R=e(x),A=e(_),D=~~((R+A)/2),C=$;C>=S;--C)for(k=D;k>=R;--k)B=u(C,k,p,h,d),B&&([l.x,l.y,p,g]=B);for(C=$;C<=O;++C)for(k=D;k<=A;++k)B=u(C,k,p,h,d),B&&([l.x,l.y,p,g]=B);!g&&!n&&(M=Math.abs(v-b+_-x),E=(b+v)/2,w=(x+_)/2,M>=y&&!Ig(E,w,h,d,r,s)&&!Qo(e,E,w,d,h,d,o,null)&&(y=M,l.x=E,l.y=w,m=!0))}return g||m?(E=h/2,w=d/2,o.setRange(e(l.x-E),e(l.y-w),e(l.x+E),e(l.y+w)),l.align="center",l.baseline="middle",!0):!1}}const kie=[-1,-1,1,1],Aie=[-1,1,-1,1];function $ie(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],u=e.bitmap();return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Ai.width(l.datum,l.datum.text),p=[];let g=n?d:0,m=!1,y=!1,b=0,v,x,_,E,w,C,k,S,$,O,R,D;for(let A=0;A=1;)R=($+O)/2,Qo(e,w,C,d,h,R,o,a)?O=R:$=R;$>g&&(l.x=w,l.y=C,g=$,m=!0)}}!m&&!n&&(D=Math.abs(x-v+E-_),w=(v+x)/2,C=(_+E)/2,D>=b&&!Ig(w,C,h,d,r,s)&&!Qo(e,w,C,d,h,d,o,null)&&(b=D,l.x=w,l.y=C,y=!0))}return m||y?(w=h/2,C=d/2,o.setRange(e(l.x-w),e(l.y-C),e(l.x+w),e(l.y+C)),l.align="center",l.baseline="middle",!0):!1}}const Sie=["right","center","left"],Fie=["bottom","middle","top"];function Die(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],u=i.length;return function(l){const c=l.boundary,f=l.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>s)return!1;let d=l.textWidth??0,h,p,g,m,y,b,v,x,_,E,w,C,k,S,$;for(let O=0;O>>2&3)-1,g=h===0&&p===0||i[O]<0,m=h&&p?Math.SQRT1_2:1,y=i[O]<0?-1:1,b=c[1+h]+i[O]*h*m,w=c[4+p]+y*f*p/2+i[O]*p*m,x=w-f/2,_=w+f/2,C=e(b),S=e(x),$=e(_),!d)if(nD(C,C,S,$,o,a,b,b,x,_,c,g))d=Ai.width(l.datum,l.datum.text);else continue;if(E=b+y*d*h/2,b=E-d/2,v=E+d/2,C=e(b),k=e(v),nD(C,k,S,$,o,a,b,v,x,_,c,g))return l.x=h?h*y<0?v:b:E,l.y=p?p*y<0?_:x:w,l.align=Sie[h*y+1],l.baseline=Fie[p*y+1],o.setRange(C,S,k,$),!0}return!1}}function nD(e,t,n,i,r,s,o,a,u,l,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&s||r).getRange(e,n,t,i))}const F7=0,D7=4,T7=8,M7=0,N7=1,R7=2,Tie={"top-left":F7+M7,top:F7+N7,"top-right":F7+R7,left:D7+M7,middle:D7+N7,right:D7+R7,"bottom-left":T7+M7,bottom:T7+N7,"bottom-right":T7+R7},Mie={naive:Eie,"reduced-search":Cie,floodfill:$ie};function Nie(e,t,n,i,r,s,o,a,u,l,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=Rie(i,f),h=Oie(r,f),p=Lie(e[0].datum),g=p==="group"&&e[0].datum.items[u].marktype,m=g==="area",y=Iie(p,g,a,u),b=l===null||l===1/0,v=m&&c==="naive";let x=-1,_=-1;const E=e.map(S=>{const $=b?Ai.width(S,S.text):void 0;return x=Math.max(x,$),_=Math.max(_,S.fontSize),{datum:S,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(S),textWidth:$}});l=l===null||l===1/0?Math.max(x,_)+Math.max(...i):l;const w=wie(t[0],t[1],l);let C;if(!v){n&&E.sort((O,R)=>n(O.datum,R.datum));let S=!1;for(let O=0;OO.datum);C=s.length||$?vie(w,$||[],s,S,m):bie(w,o&&E)}const k=m?Mie[c](w,C,o,u):Die(w,C,h,d);return E.forEach(S=>S.opacity=+k(S)),E}function Rie(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r[s.x,s.x,s.x,s.y,s.y,s.y];return e?e==="line"||e==="area"?s=>r(s.datum):t==="line"?s=>{const o=s.datum.items[i].items;return r(o.length?o[n==="start"?0:o.length-1]:{x:NaN,y:NaN})}:s=>{const o=s.datum.bounds;return[o.x1,(o.x1+o.x2)/2,o.x2,o.y1,(o.y1+o.y2)/2,o.y2]}:r}const O7=["x","y","opacity","align","baseline"],iD=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function L7(e){P.call(this,null,e)}L7.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:iD},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:O7.length,default:O7}]},te(L7,P,{transform(e,t){function n(s){const o=e[s];return Le(o)&&t.modified(o.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&q("Size parameter should be specified as a [width, height] array.");const r=e.as||O7;return Nie(t.materialize(t.SOURCE).source||[],e.size,e.sort,oe(e.offset==null?1:e.offset),oe(e.anchor||iD),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(s=>{const o=s.datum;o[r[0]]=s.x,o[r[1]]=s.y,o[r[2]]=s.opacity,o[r[3]]=s.align,o[r[4]]=s.baseline}),t.reflow(i).modifies(r)}});const Pie=Object.freeze(Object.defineProperty({__proto__:null,label:L7},Symbol.toStringTag,{value:"Module"}));function rD(e,t){var n=[],i=function(c){return c(a)},r,s,o,a,u,l;if(t==null)n.push(e);else for(r={},s=0,o=e.length;s{r9(l,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;de==="poly"?t:e==="quad"?2:1;function z7(e){P.call(this,null,e)}z7.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(P7)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]},te(z7,P,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=rD(i,e.groupby),s=(e.groupby||[]).map(Tt),o=e.method||"linear",a=e.order==null?3:e.order,u=zie(o,a),l=e.as||[Tt(e.x),Tt(e.y)],c=P7[o],f=[];let d=e.extent;ue(P7,o)||q("Invalid regression method: "+o),d!=null&&o==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),r.forEach(h=>{if(h.length<=u){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=c(h,e.x,e.y,a);if(e.params){f.push(it({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||qr(h,e.x),y=b=>{const v={};for(let x=0;xy([b,g.predict(b)])):S0(g.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const Bie=Object.freeze(Object.defineProperty({__proto__:null,loess:I7,regression:z7},Symbol.toStringTag,{value:"Module"})),Xs=11102230246251565e-32,Mn=134217729,Uie=(3+8*Xs)*Xs;function B7(e,t,n,i,r){let s,o,a,u,l=t[0],c=i[0],f=0,d=0;c>l==c>-l?(s=l,l=t[++f]):(s=c,c=i[++d]);let h=0;if(fl==c>-l?(o=l+s,a=s-(o-l),l=t[++f]):(o=c+s,a=s-(o-c),c=i[++d]),s=o,a!==0&&(r[h++]=a);fl==c>-l?(o=s+l,u=o-s,a=s-(o-u)+(l-u),l=t[++f]):(o=s+c,u=o-s,a=s-(o-u)+(c-u),c=i[++d]),s=o,a!==0&&(r[h++]=a);for(;f=D||-R>=D||(f=e-k,a=e-(k+f)+(f-r),f=n-S,l=n-(S+f)+(f-r),f=t-$,u=t-($+f)+(f-s),f=i-O,c=i-(O+f)+(f-s),a===0&&u===0&&l===0&&c===0)||(D=Hie*o+Uie*Math.abs(R),R+=k*c+O*a-($*l+S*u),R>=D||-R>=D))return R;x=a*O,d=Mn*a,h=d-(d-a),p=a-h,d=Mn*O,g=d-(d-O),m=O-g,_=p*m-(x-h*g-p*g-h*m),E=u*S,d=Mn*u,h=d-(d-u),p=u-h,d=Mn*S,g=d-(d-S),m=S-g,w=p*m-(E-h*g-p*g-h*m),y=_-w,f=_-y,Zn[0]=_-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-E,f=v-y,Zn[1]=v-(y+f)+(f-E),C=b+y,f=C-b,Zn[2]=b-(C-f)+(y-f),Zn[3]=C;const A=B7(4,Kl,4,Zn,sD);x=k*c,d=Mn*k,h=d-(d-k),p=k-h,d=Mn*c,g=d-(d-c),m=c-g,_=p*m-(x-h*g-p*g-h*m),E=$*l,d=Mn*$,h=d-(d-$),p=$-h,d=Mn*l,g=d-(d-l),m=l-g,w=p*m-(E-h*g-p*g-h*m),y=_-w,f=_-y,Zn[0]=_-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-E,f=v-y,Zn[1]=v-(y+f)+(f-E),C=b+y,f=C-b,Zn[2]=b-(C-f)+(y-f),Zn[3]=C;const M=B7(A,sD,4,Zn,oD);x=a*c,d=Mn*a,h=d-(d-a),p=a-h,d=Mn*c,g=d-(d-c),m=c-g,_=p*m-(x-h*g-p*g-h*m),E=u*l,d=Mn*u,h=d-(d-u),p=u-h,d=Mn*l,g=d-(d-l),m=l-g,w=p*m-(E-h*g-p*g-h*m),y=_-w,f=_-y,Zn[0]=_-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-E,f=v-y,Zn[1]=v-(y+f)+(f-E),C=b+y,f=C-b,Zn[2]=b-(C-f)+(y-f),Zn[3]=C;const B=B7(M,oD,4,Zn,aD);return aD[B-1]}function Pg(e,t,n,i,r,s){const o=(t-s)*(n-r),a=(e-r)*(i-s),u=o-a,l=Math.abs(o+a);return Math.abs(u)>=qie*l?u:-Gie(e,t,n,i,r,s,l)}const uD=Math.pow(2,-52),zg=new Uint32Array(512);class Bg{static from(t,n=Zie,i=Jie){const r=t.length,s=new Float64Array(r*2);for(let o=0;o>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const i=Math.max(2*n-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:i,_hullTri:r,_hullHash:s}=this,o=t.length>>1;let a=1/0,u=1/0,l=-1/0,c=-1/0;for(let k=0;kl&&(l=S),$>c&&(c=$),this._ids[k]=k}const f=(a+l)/2,d=(u+c)/2;let h,p,g;for(let k=0,S=1/0;k0&&(p=k,S=$)}let b=t[2*p],v=t[2*p+1],x=1/0;for(let k=0;kO&&(k[S++]=R,O=D)}this.hull=k.subarray(0,S),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Pg(m,y,b,v,_,E)<0){const k=p,S=b,$=v;p=g,b=_,v=E,g=k,_=S,E=$}const w=Kie(m,y,b,v,_,E);this._cx=w.x,this._cy=w.y;for(let k=0;k0&&Math.abs(R-S)<=uD&&Math.abs(D-$)<=uD||(S=R,$=D,O===h||O===p||O===g))continue;let A=0;for(let ie=0,xe=this._hashKey(R,D);ie=0;)if(M=B,M===A){M=-1;break}if(M===-1)continue;let G=this._addTriangle(M,O,i[M],-1,-1,r[M]);r[O]=this._legalize(G+2),r[M]=G,C++;let z=i[M];for(;B=i[z],Pg(R,D,t[2*z],t[2*z+1],t[2*B],t[2*B+1])<0;)G=this._addTriangle(z,O,B,r[O],-1,r[z]),r[O]=this._legalize(G+2),i[z]=z,C--,z=B;if(M===A)for(;B=n[M],Pg(R,D,t[2*B],t[2*B+1],t[2*M],t[2*M+1])<0;)G=this._addTriangle(B,O,M,-1,r[M],r[B]),this._legalize(G+2),r[B]=G,i[M]=M,C--,M=B;this._hullStart=n[O]=M,i[M]=n[z]=O,i[O]=z,s[this._hashKey(R,D)]=O,s[this._hashKey(t[2*M],t[2*M+1])]=M}this.hull=new Uint32Array(C);for(let k=0,S=this._hullStart;k0?3-n:1+n)/4}function U7(e,t,n,i){const r=e-n,s=t-i;return r*r+s*s}function Yie(e,t,n,i,r,s,o,a){const u=e-o,l=t-a,c=n-o,f=i-a,d=r-o,h=s-a,p=u*u+l*l,g=c*c+f*f,m=d*d+h*h;return u*(f*m-g*h)-l*(c*m-g*d)+p*(c*h-f*d)<0}function Xie(e,t,n,i,r,s){const o=n-e,a=i-t,u=r-e,l=s-t,c=o*o+a*a,f=u*u+l*l,d=.5/(o*l-a*u),h=(l*c-a*f)*d,p=(o*f-u*c)*d;return h*h+p*p}function Kie(e,t,n,i,r,s){const o=n-e,a=i-t,u=r-e,l=s-t,c=o*o+a*a,f=u*u+l*l,d=.5/(o*l-a*u),h=e+(l*c-a*f)*d,p=t+(o*f-u*c)*d;return{x:h,y:p}}function Zl(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const s=e[r],o=t[s];let a=r-1;for(;a>=n&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=s}else{const r=n+i>>1;let s=n+1,o=i;_d(e,r,s),t[e[n]]>t[e[i]]&&_d(e,n,i),t[e[s]]>t[e[i]]&&_d(e,s,i),t[e[n]]>t[e[s]]&&_d(e,n,s);const a=e[s],u=t[a];for(;;){do s++;while(t[e[s]]u);if(o=o-n?(Zl(e,t,s,i),Zl(e,t,n,o-1)):(Zl(e,t,n,o-1),Zl(e,t,s,i))}}function _d(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function Zie(e){return e[0]}function Jie(e){return e[1]}const lD=1e-6;class eu{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,i){t=+t,n=+n,i=+i;const r=t+i,s=n;if(i<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${s}`:(Math.abs(this._x1-r)>lD||Math.abs(this._y1-s)>lD)&&(this._+="L"+r+","+s),i&&(this._+=`A${i},${i},0,1,1,${t-i},${n}A${i},${i},0,1,1,${this._x1=r},${this._y1=s}`)}rect(t,n,i,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+i}v${+r}h${-i}Z`}value(){return this._||null}}class j7{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}let Qie=class{constructor(t,[n,i,r,s]=[0,0,960,500]){if(!((r=+r)>=(n=+n))||!((s=+s)>=(i=+i)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=r,this.xmin=n,this.ymax=s,this.ymin=i,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:i},vectors:r}=this;let s,o;const a=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let g=0,m=0,y=i.length,b,v;g1;)s-=2;for(let o=2;o0){if(n>=this.ymax)return null;(o=(this.ymax-n)/r)0){if(t>=this.xmax)return null;(o=(this.xmax-t)/i)this.xmax?2:0)|(nthis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n1e-10)return!1}return!0}function rre(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class q7{static from(t,n=tre,i=nre,r){return new q7("length"in t?sre(t,n,i,r):Float64Array.from(ore(t,n,i,r)))}constructor(t){this._delaunator=new Bg(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&ire(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,r.length===2&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new Qie(this,t)}*neighbors(t){const{inedges:n,hull:i,_hullIndex:r,halfedges:s,triangles:o,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f=0&&s!==i&&s!==r;)i=s;return s}_step(t,n,i){const{inedges:r,hull:s,_hullIndex:o,halfedges:a,triangles:u,points:l}=this;if(r[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,f=Jl(n-l[t*2],2)+Jl(i-l[t*2+1],2);const d=r[t];let h=d;do{let p=u[h];const g=Jl(n-l[p*2],2)+Jl(i-l[p*2+1],2);if(g>5)*e[1]),m=null,y=l.length,b=-1,v=[],x=l.map(E=>({text:t(E),font:n(E),style:r(E),weight:s(E),rotate:o(E),size:~~(i(E)+1e-14),padding:a(E),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:E})).sort((E,w)=>w.size-E.size);++b>1,_.y=e[1]*(c()+.5)>>1,dre(p,_,x,b),_.hasText&&h(g,_,m)&&(v.push(_),m?pre(m,_):m=[{x:_.x+_.x0,y:_.y+_.y0},{x:_.x+_.x1,y:_.y+_.y1}],_.x-=e[0]>>1,_.y-=e[1]>>1)}return v};function d(p){p.width=p.height=1;var g=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(wd<<5)/g,p.height=Ug/g;var m=p.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function h(p,g,m){for(var y=g.x,b=g.y,v=Math.hypot(e[0],e[1]),x=u(e),_=c()<.5?1:-1,E=-_,w,C,k;(w=x(E+=_))&&(C=~~w[0],k=~~w[1],!(Math.min(Math.abs(C),Math.abs(k))>=v));)if(g.x=y+C,g.y=b+k,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!m||!hre(g,p,e[0]))&&(!m||gre(g,m))){for(var S=g.sprite,$=g.width>>5,O=e[0]>>5,R=g.x-($<<4),D=R&127,A=32-D,M=g.y1-g.y0,B=(g.y+g.y0)*O+(R>>5),G,z=0;z>>D:0);B+=O}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(l=p,f):l},f.size=function(p){return arguments.length?(e=[+p[0],+p[1]],f):e},f.font=function(p){return arguments.length?(n=tu(p),f):n},f.fontStyle=function(p){return arguments.length?(r=tu(p),f):r},f.fontWeight=function(p){return arguments.length?(s=tu(p),f):s},f.rotate=function(p){return arguments.length?(o=tu(p),f):o},f.text=function(p){return arguments.length?(t=tu(p),f):t},f.spiral=function(p){return arguments.length?(u=bre[p]||p,f):u},f.fontSize=function(p){return arguments.length?(i=tu(p),f):i},f.padding=function(p){return arguments.length?(a=tu(p),f):a},f.random=function(p){return arguments.length?(c=p,f):c},f}function dre(e,t,n,i){if(!t.sprite){var r=e.context,s=e.ratio;r.clearRect(0,0,(wd<<5)/s,Ug/s);var o=0,a=0,u=0,l=n.length,c,f,d,h,p;for(--i;++i>5<<5,d=~~Math.max(Math.abs(b+v),Math.abs(b-v))}else c=c+31>>5<<5;if(d>u&&(u=d),o+c>=wd<<5&&(o=0,a+=u,u=0),a+d>=Ug)break;r.translate((o+(c>>1))/s,(a+(d>>1))/s),t.rotate&&r.rotate(t.rotate*H7),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=c,t.height=d,t.xoff=o,t.yoff=a,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,o+=c}for(var _=r.getImageData(0,0,(wd<<5)/s,Ug/s).data,E=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h>5),S=_[(a+p)*(wd<<5)+(o+h)<<2]?1<<31-h%32:0;E[k]|=S,w|=S}w?C=p:(t.y0++,d--,p--,a++)}t.y1=t.y0+C,t.sprite=E.slice(0,(t.y1-t.y0)*f)}}}function hre(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,s=e.x-(r<<4),o=s&127,a=32-o,u=e.y1-e.y0,l=(e.y+e.y0)*n+(s>>5),c,f=0;f>>o:0))&t[l+d])return!0;l+=n}return!1}function pre(e,t){var n=e[0],i=e[1];t.x+t.x0i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function gre(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0g(p(m))}r.forEach(p=>{p[o[0]]=NaN,p[o[1]]=NaN,p[o[3]]=0});const l=s.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(Wi).layout(),c=s.size(),f=c[0]>>1,d=c[1]>>1,h=l.length;for(let p=0,g,m;pnew Uint8Array(e),wre=e=>new Uint16Array(e),Ed=e=>new Uint32Array(e);function Ere(){let e=8,t=[],n=Ed(0),i=jg(0,e),r=jg(0,e);return{data:()=>t,seen:()=>n=Cre(n,t.length),add(s){for(let o=0,a=t.length,u=s.length,l;ot.length,curr:()=>i,prev:()=>r,reset:s=>r[s]=i[s],all:()=>e<257?255:e<65537?65535:4294967295,set(s,o){i[s]|=o},clear(s,o){i[s]&=~o},resize(s,o){const a=i.length;(s>a||o>e)&&(e=Math.max(o,e),i=jg(s,e,i),r=jg(s,e))}}}function Cre(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function jg(e,t,n){const i=(t<257?_re:t<65537?wre:Ed)(e);return n&&i.set(n),i}function dD(e,t,n){const i=1<0)for(m=0;me,size:()=>n}}function kre(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],s=e[i];return rs?1:0}),Uq(e,t)}function Are(e,t,n,i,r,s,o,a,u){let l=0,c=0,f;for(f=0;lt.modified(i.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},s=this._dims=[],o=i.length;let a=0,u,l;for(;a{const s=r.remove(t,n);for(const o in i)i[o].reindex(s)})},update(e,t,n){const i=this._dims,r=e.query,s=t.stamp,o=i.length;let a=0,u,l;for(n.filters=0,l=0;lh)for(m=h,y=Math.min(f,p);mp)for(m=Math.max(f,p),y=d;mf)for(p=f,g=Math.min(l,d);pd)for(p=Math.max(l,d),g=c;pa[c]&n?null:o[c];return s.filter(s.MOD,l),r&r-1?(s.filter(s.ADD,c=>{const f=a[c]&n;return!f&&f^u[c]&n?o[c]:null}),s.filter(s.REM,c=>{const f=a[c]&n;return f&&!(f^(f^u[c]&n))?o[c]:null})):(s.filter(s.ADD,l),s.filter(s.REM,c=>(a[c]&n)===r?o[c]:null)),s.filter(s.SOURCE,c=>l(c._index))}});const $re=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:V7,resolvefilter:Y7},Symbol.toStringTag,{value:"Module"})),Sre="RawCode",nu="Literal",Fre="Property",Dre="Identifier",Tre="ArrayExpression",Mre="BinaryExpression",pD="CallExpression",Nre="ConditionalExpression",Rre="LogicalExpression",Ore="MemberExpression",Lre="ObjectExpression",Ire="UnaryExpression";function xr(e){this.type=e}xr.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=Pre(this),n=0,i=t.length;n",as[iu]="Identifier",as[ea]="Keyword",as[Wg]="Null",as[ru]="Numeric",as[ci]="Punctuator",as[kd]="String",as[zre]="RegularExpression";var Bre="ArrayExpression",Ure="BinaryExpression",jre="CallExpression",qre="ConditionalExpression",gD="Identifier",Wre="Literal",Hre="LogicalExpression",Gre="MemberExpression",Vre="ObjectExpression",Yre="Property",Xre="UnaryExpression",en="Unexpected token %0",Kre="Unexpected number",Zre="Unexpected string",Jre="Unexpected identifier",Qre="Unexpected reserved word",ese="Unexpected end of input",X7="Invalid regular expression",K7="Invalid regular expression: missing /",mD="Octal literals are not allowed in strict mode.",tse="Duplicate data property in object literal not allowed in strict mode",hn="ILLEGAL",Ad="Disabled.",nse=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),ise=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function Hg(e,t){if(!e)throw new Error("ASSERT: "+t)}function Ks(e){return e>=48&&e<=57}function Z7(e){return"0123456789abcdefABCDEF".includes(e)}function $d(e){return"01234567".includes(e)}function rse(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function Sd(e){return e===10||e===13||e===8232||e===8233}function Fd(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&nse.test(String.fromCharCode(e))}function Gg(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&ise.test(String.fromCharCode(e))}const sse={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function yD(){for(;U1114111||e!=="}")&&tt({},en,hn),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function bD(){var e,t;for(e=pe.charCodeAt(U++),t=String.fromCharCode(e),e===92&&(pe.charCodeAt(U)!==117&&tt({},en,hn),++U,e=J7("u"),(!e||e==="\\"||!Fd(e.charCodeAt(0)))&&tt({},en,hn),t=e);U>>=")return U+=4,{type:ci,value:o,start:e,end:U};if(s=o.substr(0,3),s===">>>"||s==="<<="||s===">>=")return U+=3,{type:ci,value:s,start:e,end:U};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return U+=2,{type:ci,value:r,start:e,end:U};if(r==="//"&&tt({},en,hn),"<>=!+-*%&|^/".includes(i))return++U,{type:ci,value:i,start:e,end:U};tt({},en,hn)}function lse(e){let t="";for(;U{if(parseInt(r,16)<=1114111)return"x";et({},X7)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{et({},X7)}try{return new RegExp(e,t)}catch{return null}}function lse(){var e,t,n,i,r;for(e=pe[U],Hg(e==="/","Regular expression literal must start with a slash"),t=pe[U++],n=!1,i=!1;U=0&&et({},X7,n),{value:n,literal:t}}function fse(){var e,t,n,i;return ot=null,yD(),e=U,t=lse(),n=cse(),i=use(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:U}}function dse(e){return e.type===iu||e.type===ea||e.type===qg||e.type===Wg}function xD(){if(yD(),U>=Nn)return{type:Cd,start:U,end:U};const e=pe.charCodeAt(U);return Fd(e)?rse():e===40||e===41||e===59?Q7():e===39||e===34?ase():e===46?Ks(pe.charCodeAt(U+1))?vD():Q7():Ks(e)?vD():Q7()}function fi(){const e=ot;return U=e.end,ot=xD(),U=e.end,e}function _D(){const e=U;ot=xD(),U=e}function hse(e){const t=new xr(Lre);return t.elements=e,t}function wD(e,t,n){const i=new xr(e==="||"||e==="&&"?Ure:Ire);return i.operator=e,i.left=t,i.right=n,i}function pse(e,t){const n=new xr(Pre);return n.callee=e,n.arguments=t,n}function gse(e,t,n){const i=new xr(zre);return i.test=e,i.consequent=t,i.alternate=n,i}function ex(e){const t=new xr(gD);return t.name=e,t}function Dd(e){const t=new xr(Bre);return t.value=e.value,t.raw=pe.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function ED(e,t,n){const i=new xr(jre);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function mse(e){const t=new xr(qre);return t.properties=e,t}function CD(e,t,n){const i=new xr(Wre);return i.key=t,i.value=n,i.kind=e,i}function yse(e,t){const n=new xr(Hre);return n.operator=e,n.argument=t,n.prefix=!0,n}function et(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,o)=>(Hg(o":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function Fse(){var e,t,n,i,r,s,o,a,u,l;if(e=ot,u=Yg(),i=ot,r=$D(i),r===0)return u;for(i.prec=r,fi(),t=[e,ot],o=Yg(),s=[u,i,o];(r=$D(ot))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,u=s.pop(),t.pop(),n=wD(a,u,o),s.push(n);i=fi(),i.prec=r,s.push(i),t.push(ot),n=Yg(),s.push(n)}for(l=s.length-1,n=s[l],t.pop();l>1;)t.pop(),n=wD(s[l-1].value,s[l-2],n),l-=2;return n}function su(){var e,t,n;return e=Fse(),wt("?")&&(fi(),t=su(),Rn(":"),n=su(),e=gse(e,t,n)),e}function nx(){const e=su();if(wt(","))throw new Error(Ad);return e}function SD(e){pe=e,U=0,Nn=pe.length,ot=null,_D();const t=nx();if(ot.type!==Cd)throw new Error("Unexpect token after expression.");return t}var FD={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function DD(e){function t(o,a,u,l){let c=e(a[0]);return u&&(c=u+"("+c+")",u.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+o+(l<0?"":l===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(o,a,u){return l=>t(o,l,a,u)}const i="new Date",r="String",s="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(o){o.length<3&&q("Missing arguments to clamp function."),o.length>3&&q("Too many arguments to clamp function.");const a=o.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),trim:n("trim",r,0),btoa:"btoa",atob:"atob",regexp:s,test:n("test",s),if:function(o){o.length<3&&q("Missing arguments to if function."),o.length>3&&q("Too many arguments to if function.");const a=o.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function Dse(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function TD(e){e=e||{};const t=e.allowed?lr(e.allowed):{},n=e.forbidden?lr(e.forbidden):{},i=e.constants||FD,r=(e.functions||DD)(f),s=e.globalvar,o=e.fieldvar,a=Oe(s)?s:p=>`${s}["${p}"]`;let u={},l={},c=0;function f(p){if(se(p))return p;const g=d[p.type];return g==null&&q("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return c>0?g:ue(n,g)?q("Illegal identifier: "+g):ue(i,g)?i[g]:ue(t,g)?g:(u[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(c+=1);const y=f(p.property);return m===o&&(l[Dse(y)]=1),g&&(c-=1),m+(g?"."+y:"["+y+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&q("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,y=ue(r,g)&&r[g];return y||q("Unrecognized function: "+g),Oe(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>"{"+p.properties.map(f).join(",")+"}",Property:p=>{c+=1;const g=f(p.key);return c-=1,g+":"+f(p.value)}};function h(p){const g={code:f(p),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},g}return h.functions=r,h.constants=i,h}const MD=Symbol("vega_selection_getter");function ND(e){return(!e.getter||!e.getter[MD])&&(e.getter=Bi(e.field),e.getter[MD]=!0),e.getter}const ix="intersect",RD="union",Tse="vlMulti",Mse="vlPoint",OD="or",Nse="and",us="_vgsid_",Td=Bi(us),Rse="E",Ose="R",Lse="R-E",Ise="R-LE",Pse="R-RE",zse="E-LT",Bse="E-LTE",Use="E-GT",jse="E-GTE",qse="E-VALID",Wse="E-ONE",Xg="index:unit";function LD(e,t){for(var n=t.fields,i=t.values,r=n.length,s=0,o,a;s=i[s])return!1}else if(a.type===Bse){if(o>i[s])return!1}else if(a.type===Use){if(o<=i[s])return!1}else if(a.type===jse){if(oLe(t.fields?{values:t.fields.map(i=>ND(i)(n.datum))}:{[us]:Td(n.datum)},t))}function Kse(e,t,n,i){for(var r=this.context.data[e],s=r?r.values.value:[],o={},a={},u={},l,c,f,d,h,p,g,m,y,b,v=s.length,x=0,_,E;x(w[c[k].field]=C,w),{})))}else h=us,p=Td(l),g=o[h]||(o[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[us]:p}));if(t=t||RD,o[us]?o[us]=rx[`${us}_${t}`](...Object.values(o[us])):Object.keys(o).forEach(w=>{o[w]=Object.keys(o[w]).map(C=>o[w][C]).reduce((C,k)=>C===void 0?k:rx[`${u[w]}_${t}`](C,k))}),s=Object.keys(a),n&&s.length){const w=i?Mse:Tse;o[w]=t===RD?{[OD]:s.reduce((C,k)=>(C.push(...a[k]),C),[])}:{[Nse]:s.map(C=>({[OD]:a[C]}))}}return o}var rx={[`${us}_union`]:Gq,[`${us}_intersect`]:Wq,E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;nt.includes(n)):t},R_union:function(e,t){var n=Cn(t[0]),i=Cn(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]i&&(n=t[1],i=t[0]),e.length?ii&&(e[1]=i),e):[n,i]}};const Zse=":",Jse="@";function sx(e,t,n,i){t[0].type!==nu&&q("First argument to selection functions must be a string literal.");const r=t[0].value,s=t.length>=2&&Ge(t).value,o="unit",a=Jse+o,u=Zse+r;s===ix&&!ue(i,a)&&(i[a]=n.getData(r).indataRef(n,o)),ue(i,u)||(i[u]=n.getData(r).tuplesRef())}function PD(e){const t=this.context.data[e];return t?t.values.value:[]}function Qse(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function eoe(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(Ui).insert(t)),1}function toe(e,t,n){if(e){const i=this.context.dataflow,r=e.mark.source;i.pulse(r,i.changeset().encode(e,t))}return n!==void 0?n:e}const Md=e=>function(t,n){const i=this.context.dataflow.locale();return t===null?"null":i[e](n)(t)},noe=Md("format"),zD=Md("timeFormat"),ioe=Md("utcFormat"),roe=Md("timeParse"),soe=Md("utcParse"),Kg=new Date(2e3,0,1);function Zg(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(Kg.setYear(2e3),Kg.setMonth(e),Kg.setDate(t),zD.call(this,Kg,n))}function ooe(e){return Zg.call(this,e,1,"%B")}function aoe(e){return Zg.call(this,e,1,"%b")}function uoe(e){return Zg.call(this,0,2+e,"%A")}function loe(e){return Zg.call(this,0,2+e,"%a")}const coe=":",foe="@",ox="%",BD="$";function ax(e,t,n,i){t[0].type!==nu&&q("First argument to data functions must be a string literal.");const r=t[0].value,s=coe+r;if(!ue(s,i))try{i[s]=n.getData(r).tuplesRef()}catch{}}function doe(e,t,n,i){t[0].type!==nu&&q("First argument to indata must be a string literal."),t[1].type!==nu&&q("Second argument to indata must be a string literal.");const r=t[0].value,s=t[1].value,o=foe+s;ue(o,i)||(i[o]=n.getData(r).indataRef(n,s))}function Jn(e,t,n,i){if(t[0].type===nu)UD(n,i,t[0].value);else for(e in n.scales)UD(n,i,e)}function UD(e,t,n){const i=ox+n;if(!ue(t,i))try{t[i]=e.scaleRef(n)}catch{}}function ls(e,t){if(se(e)){const n=t.scales[e];return n&&mk(n.value)?n.value:void 0}else if(Oe(e))return mk(e)?e:void 0}function hoe(e,t,n){t.__bandwidth=r=>r&&r.bandwidth?r.bandwidth():0,n._bandwidth=Jn,n._range=Jn,n._scale=Jn;const i=r=>"_["+(r.type===nu?Q(ox+r.value):Q(ox)+"+"+e(r))+"]";return{_bandwidth:r=>`this.__bandwidth(${i(r[0])})`,_range:r=>`${i(r[0])}.range()`,_scale:r=>`${i(r[0])}(${e(r[1])})`}}function ux(e,t){return function(n,i,r){if(n){const s=ls(n,(r||this).context);return s&&s.path[e](i)}else return t(i)}}const poe=ux("area",MQ),goe=ux("bounds",LQ),moe=ux("centroid",jQ);function yoe(e,t){const n=ls(e,(t||this).context);return n&&n.scale()}function boe(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n}function lx(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function voe(){return lx(this.context.dataflow,"warn",arguments)}function xoe(){return lx(this.context.dataflow,"info",arguments)}function _oe(){return lx(this.context.dataflow,"debug",arguments)}function cx(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function fx(e){const t=Oo(e),n=cx(t.r),i=cx(t.g),r=cx(t.b);return .2126*n+.7152*i+.0722*r}function woe(e,t){const n=fx(e),i=fx(t),r=Math.max(n,i),s=Math.min(n,i);return(r+.05)/(s+.05)}function Eoe(){const e=[].slice.call(arguments);return e.unshift({}),Le(...e)}function jD(e,t){return e===t||e!==e&&t!==t?!0:W(e)?W(t)&&e.length===t.length?Coe(e,t):!1:re(e)&&re(t)?qD(e,t):!1}function Coe(e,t){for(let n=0,i=e.length;nqD(e,t)}function koe(e,t,n,i,r,s){const o=this.context.dataflow,a=this.context.data[e],u=a.input,l=o.stamp();let c=a.changes,f,d;if(o._trigger===!1||!(u.value.length||t||i))return 0;if((!c||c.stamp{a.modified=!0,o.pulse(u,c).run()},!0,1)),n&&(f=n===!0?Ui:W(n)||y0(n)?n:WD(n),c.remove(f)),t&&c.insert(t),i&&(f=WD(i),u.value.some(f)?c.remove(f):c.insert(i)),r)for(d in s)c.modify(r,d,s[d]);return 1}function Aoe(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.hypot(n,i)}function $oe(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const HD={};function Soe(e,t){const n=HD[t]||(HD[t]=Bi(t));return W(e)?e.map(n):n(e)}function Jg(e){return W(e)||ArrayBuffer.isView(e)?e:null}function dx(e){return Jg(e)||(se(e)?e:null)}function Foe(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i1?t-1:0),i=1;i1?t-1:0),i=1;is.stop(l(c),e(c))),s}function Woe(e,t,n){const i=ls(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function Hoe(e){let t=null;return function(n){return n?Tf(n,t=t||Tl(e)):e}}const GD=e=>e.data;function VD(e,t){const n=PD.call(t,e);return n.root&&n.root.lookup||{}}function Goe(e,t,n){const i=VD(e,this),r=i[t],s=i[n];return r&&s?r.path(s).map(GD):void 0}function Voe(e,t){const n=VD(e,this)[t];return n?n.ancestors().map(GD):void 0}const YD=()=>typeof window<"u"&&window||null;function Yoe(){const e=YD();return e?e.screen:{}}function Xoe(){const e=YD();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function Koe(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function XD(e,t,n){if(!e)return[];const[i,r]=e,s=new Ut().set(i[0],i[1],r[0],r[1]),o=n||this.context.dataflow.scenegraph().root;return s$(o,s,Zoe(t))}function Zoe(e){let t=null;if(e){const n=oe(e.marktype),i=oe(e.markname);t=r=>(!n.length||n.some(s=>r.marktype===s))&&(!i.length||i.some(s=>r.name===s))}return t}function Joe(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=oe(e);const r=e[e.length-1];return r===void 0||Math.hypot(r[0]-t,r[1]-n)>i?[...e,[t,n]]:e}function Qoe(e){return oe(e).reduce((t,n,i)=>{let[r,s]=n;return t+=i==0?`M ${r},${s} `:i===e.length-1?" Z":`L ${r},${s} `},"")}function eae(e,t,n){const{x:i,y:r,mark:s}=n,o=new Ut().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[u,l]of t)uo.x2&&(o.x2=u),lo.y2&&(o.y2=l);return o.translate(i,r),XD([[o.x1,o.y1],[o.x2,o.y2]],e,s).filter(u=>tae(u.x,u.y,t))}function tae(e,t,n){let i=0;for(let r=0,s=n.length-1;rt!=a>t&&e<(o-u)*(t-l)/(a-l)+u&&i++}return i&1}const Nd={random(){return Wi()},cumulativeNormal:k0,cumulativeLogNormal:ky,cumulativeUniform:Fy,densityNormal:xy,densityLogNormal:Cy,densityUniform:Sy,quantileNormal:A0,quantileLogNormal:Ay,quantileUniform:Dy,sampleNormal:C0,sampleLogNormal:Ey,sampleUniform:$y,isArray:W,isBoolean:xo,isDate:_o,isDefined(e){return e!==void 0},isNumber:Ze,isObject:re,isRegExp:$2,isString:se,isTuple:y0,isValid(e){return e!=null&&e===e},toBoolean:F2,toDate(e){return D2(e)},toNumber:Cn,toString:T2,indexof:Doe,join:Foe,lastindexof:Toe,replace:Noe,reverse:Roe,sort:Ooe,slice:Moe,flush:V4,lerp:X4,merge:Eoe,pad:J4,peek:Ge,pluck:Soe,span:Xc,inrange:ol,truncate:Q4,rgb:Oo,lab:H0,hcl:G0,hsl:j0,luminance:fx,contrast:woe,sequence:Ei,format:noe,utcFormat:ioe,utcParse:soe,utcOffset:j8,utcSequence:H8,timeFormat:zD,timeParse:roe,timeOffset:U8,timeSequence:W8,timeUnitSpecifier:D8,monthFormat:ooe,monthAbbrevFormat:aoe,dayFormat:uoe,dayAbbrevFormat:loe,quarter:q4,utcquarter:W4,week:M8,utcweek:O8,dayofyear:T8,utcdayofyear:R8,warn:voe,info:xoe,debug:_oe,extent(e){return qr(e)},inScope:boe,intersect:XD,clampRange:H4,pinchDistance:Aoe,pinchAngle:$oe,screen:Yoe,containerSize:Koe,windowSize:Xoe,bandspace:Loe,setdata:eoe,pathShape:Hoe,panLinear:z4,panLog:B4,panPow:U4,panSymlog:j4,zoomLinear:w2,zoomLog:E2,zoomPow:Zh,zoomSymlog:C2,encode:toe,modify:koe,lassoAppend:Joe,lassoPath:Qoe,intersectLasso:eae},nae=["view","item","group","xy","x","y"],iae="event.vega.",KD="this.",hx={},ZD={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${Q(BD+e)}]`,functions:rae,constants:FD,visitors:hx},px=TD(ZD);function rae(e){const t=DD(e);nae.forEach(n=>t[n]=iae+n);for(const n in Nd)t[n]=KD+n;return Le(t,hoe(e,Nd,hx)),t}function Pt(e,t,n){return arguments.length===1?Nd[e]:(Nd[e]=t,n&&(hx[e]=n),px&&(px.functions[e]=KD+e),this)}Pt("bandwidth",Ioe,Jn),Pt("copy",Poe,Jn),Pt("domain",zoe,Jn),Pt("range",Uoe,Jn),Pt("invert",Boe,Jn),Pt("scale",joe,Jn),Pt("gradient",qoe,Jn),Pt("geoArea",poe,Jn),Pt("geoBounds",goe,Jn),Pt("geoCentroid",moe,Jn),Pt("geoShape",Woe,Jn),Pt("geoScale",yoe,Jn),Pt("indata",Qse,doe),Pt("data",PD,ax),Pt("treePath",Goe,ax),Pt("treeAncestors",Voe,ax),Pt("vlSelectionTest",Hse,sx),Pt("vlSelectionIdTest",Yse,sx),Pt("vlSelectionResolve",Kse,sx),Pt("vlSelectionTuples",Xse);function cs(e,t){const n={};let i;try{e=se(e)?e:Q(e)+"",i=SD(e)}catch{q("Expression parse error: "+e)}i.visit(s=>{if(s.type!==pD)return;const o=s.callee.name,a=ZD.visitors[o];a&&a(o,s.arguments,t,n)});const r=px(i);return r.globals.forEach(s=>{const o=BD+s;!ue(n,o)&&t.getSignal(s)&&(n[o]=t.signalRef(s))}),{$expr:Le({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function sae(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(i=>t.parseOperator(i)),n.forEach(i=>t.parseOperatorParameters(i)),(e.streams||[]).forEach(i=>t.parseStream(i)),(e.updates||[]).forEach(i=>t.parseUpdate(i)),t.resolve()}const oae=lr(["rule"]),JD=lr(["group","image","rect"]);function aae(e,t){let n="";return oae[t]||(e.x2&&(e.x?(JD[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(JD[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function gx(e){return(e+"").toLowerCase()}function uae(e){return gx(e)==="operator"}function lae(e){return gx(e)==="collect"}function Rd(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function cae(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n} +`&&++U;else{if(Sd(i.charCodeAt(0)))break;e+=i}return t!==""&&tt({},en,hn),{type:kd,value:e,octal:s,start:n,end:U}}function dse(e,t){let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,r)=>{if(parseInt(r,16)<=1114111)return"x";tt({},X7)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{tt({},X7)}try{return new RegExp(e,t)}catch{return null}}function hse(){var e,t,n,i,r;for(e=pe[U],Hg(e==="/","Regular expression literal must start with a slash"),t=pe[U++],n=!1,i=!1;U=0&&tt({},X7,n),{value:n,literal:t}}function gse(){var e,t,n,i;return at=null,yD(),e=U,t=hse(),n=pse(),i=dse(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:U}}function mse(e){return e.type===iu||e.type===ea||e.type===qg||e.type===Wg}function xD(){if(yD(),U>=Nn)return{type:Cd,start:U,end:U};const e=pe.charCodeAt(U);return Fd(e)?use():e===40||e===41||e===59?Q7():e===39||e===34?fse():e===46?Ks(pe.charCodeAt(U+1))?vD():Q7():Ks(e)?vD():Q7()}function fi(){const e=at;return U=e.end,at=xD(),U=e.end,e}function _D(){const e=U;at=xD(),U=e}function yse(e){const t=new xr(Bre);return t.elements=e,t}function wD(e,t,n){const i=new xr(e==="||"||e==="&&"?Hre:Ure);return i.operator=e,i.left=t,i.right=n,i}function bse(e,t){const n=new xr(jre);return n.callee=e,n.arguments=t,n}function vse(e,t,n){const i=new xr(qre);return i.test=e,i.consequent=t,i.alternate=n,i}function ex(e){const t=new xr(gD);return t.name=e,t}function Dd(e){const t=new xr(Wre);return t.value=e.value,t.raw=pe.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function ED(e,t,n){const i=new xr(Gre);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function xse(e){const t=new xr(Vre);return t.properties=e,t}function CD(e,t,n){const i=new xr(Yre);return i.key=t,i.value=n,i.kind=e,i}function _se(e,t){const n=new xr(Xre);return n.operator=e,n.argument=t,n.prefix=!0,n}function tt(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,o)=>(Hg(o":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function Nse(){var e,t,n,i,r,s,o,a,u,l;if(e=at,u=Yg(),i=at,r=$D(i),r===0)return u;for(i.prec=r,fi(),t=[e,at],o=Yg(),s=[u,i,o];(r=$D(at))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,u=s.pop(),t.pop(),n=wD(a,u,o),s.push(n);i=fi(),i.prec=r,s.push(i),t.push(at),n=Yg(),s.push(n)}for(l=s.length-1,n=s[l],t.pop();l>1;)t.pop(),n=wD(s[l-1].value,s[l-2],n),l-=2;return n}function su(){var e,t,n;return e=Nse(),wt("?")&&(fi(),t=su(),Rn(":"),n=su(),e=vse(e,t,n)),e}function nx(){const e=su();if(wt(","))throw new Error(Ad);return e}function SD(e){pe=e,U=0,Nn=pe.length,at=null,_D();const t=nx();if(at.type!==Cd)throw new Error("Unexpect token after expression.");return t}var FD={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function DD(e){function t(o,a,u,l){let c=e(a[0]);return u&&(c=u+"("+c+")",u.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+o+(l<0?"":l===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(o,a,u){return l=>t(o,l,a,u)}const i="new Date",r="String",s="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(o){o.length<3&&q("Missing arguments to clamp function."),o.length>3&&q("Too many arguments to clamp function.");const a=o.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),trim:n("trim",r,0),btoa:"btoa",atob:"atob",regexp:s,test:n("test",s),if:function(o){o.length<3&&q("Missing arguments to if function."),o.length>3&&q("Too many arguments to if function.");const a=o.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function Rse(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function TD(e){e=e||{};const t=e.allowed?lr(e.allowed):{},n=e.forbidden?lr(e.forbidden):{},i=e.constants||FD,r=(e.functions||DD)(f),s=e.globalvar,o=e.fieldvar,a=Le(s)?s:p=>`${s}["${p}"]`;let u={},l={},c=0;function f(p){if(se(p))return p;const g=d[p.type];return g==null&&q("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return c>0?g:ue(n,g)?q("Illegal identifier: "+g):ue(i,g)?i[g]:ue(t,g)?g:(u[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(c+=1);const y=f(p.property);return m===o&&(l[Rse(y)]=1),g&&(c-=1),m+(g?"."+y:"["+y+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&q("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,y=ue(r,g)&&r[g];return y||q("Unrecognized function: "+g),Le(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>"{"+p.properties.map(f).join(",")+"}",Property:p=>{c+=1;const g=f(p.key);return c-=1,g+":"+f(p.value)}};function h(p){const g={code:f(p),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},g}return h.functions=r,h.constants=i,h}const MD=Symbol("vega_selection_getter");function ND(e){return(!e.getter||!e.getter[MD])&&(e.getter=Bi(e.field),e.getter[MD]=!0),e.getter}const ix="intersect",RD="union",Ose="vlMulti",Lse="vlPoint",OD="or",Ise="and",us="_vgsid_",Td=Bi(us),Pse="E",zse="R",Bse="R-E",Use="R-LE",jse="R-RE",qse="E-LT",Wse="E-LTE",Hse="E-GT",Gse="E-GTE",Vse="E-VALID",Yse="E-ONE",Xg="index:unit";function LD(e,t){for(var n=t.fields,i=t.values,r=n.length,s=0,o,a;s=i[s])return!1}else if(a.type===Wse){if(o>i[s])return!1}else if(a.type===Hse){if(o<=i[s])return!1}else if(a.type===Gse){if(oIe(t.fields?{values:t.fields.map(i=>ND(i)(n.datum))}:{[us]:Td(n.datum)},t))}function eoe(e,t,n,i){for(var r=this.context.data[e],s=r?r.values.value:[],o={},a={},u={},l,c,f,d,h,p,g,m,y,b,v=s.length,x=0,_,E;x(w[c[k].field]=C,w),{})))}else h=us,p=Td(l),g=o[h]||(o[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[us]:p}));if(t=t||RD,o[us]?o[us]=rx[`${us}_${t}`](...Object.values(o[us])):Object.keys(o).forEach(w=>{o[w]=Object.keys(o[w]).map(C=>o[w][C]).reduce((C,k)=>C===void 0?k:rx[`${u[w]}_${t}`](C,k))}),s=Object.keys(a),n&&s.length){const w=i?Lse:Ose;o[w]=t===RD?{[OD]:s.reduce((C,k)=>(C.push(...a[k]),C),[])}:{[Ise]:s.map(C=>({[OD]:a[C]}))}}return o}var rx={[`${us}_union`]:Kq,[`${us}_intersect`]:Yq,E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;nt.includes(n)):t},R_union:function(e,t){var n=Cn(t[0]),i=Cn(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]i&&(n=t[1],i=t[0]),e.length?ii&&(e[1]=i),e):[n,i]}};const toe=":",noe="@";function sx(e,t,n,i){t[0].type!==nu&&q("First argument to selection functions must be a string literal.");const r=t[0].value,s=t.length>=2&&Ge(t).value,o="unit",a=noe+o,u=toe+r;s===ix&&!ue(i,a)&&(i[a]=n.getData(r).indataRef(n,o)),ue(i,u)||(i[u]=n.getData(r).tuplesRef())}function PD(e){const t=this.context.data[e];return t?t.values.value:[]}function ioe(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function roe(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(Ui).insert(t)),1}function soe(e,t,n){if(e){const i=this.context.dataflow,r=e.mark.source;i.pulse(r,i.changeset().encode(e,t))}return n!==void 0?n:e}const Md=e=>function(t,n){const i=this.context.dataflow.locale();return t===null?"null":i[e](n)(t)},ooe=Md("format"),zD=Md("timeFormat"),aoe=Md("utcFormat"),uoe=Md("timeParse"),loe=Md("utcParse"),Kg=new Date(2e3,0,1);function Zg(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(Kg.setYear(2e3),Kg.setMonth(e),Kg.setDate(t),zD.call(this,Kg,n))}function coe(e){return Zg.call(this,e,1,"%B")}function foe(e){return Zg.call(this,e,1,"%b")}function doe(e){return Zg.call(this,0,2+e,"%A")}function hoe(e){return Zg.call(this,0,2+e,"%a")}const poe=":",goe="@",ox="%",BD="$";function ax(e,t,n,i){t[0].type!==nu&&q("First argument to data functions must be a string literal.");const r=t[0].value,s=poe+r;if(!ue(s,i))try{i[s]=n.getData(r).tuplesRef()}catch{}}function moe(e,t,n,i){t[0].type!==nu&&q("First argument to indata must be a string literal."),t[1].type!==nu&&q("Second argument to indata must be a string literal.");const r=t[0].value,s=t[1].value,o=goe+s;ue(o,i)||(i[o]=n.getData(r).indataRef(n,s))}function Jn(e,t,n,i){if(t[0].type===nu)UD(n,i,t[0].value);else for(e in n.scales)UD(n,i,e)}function UD(e,t,n){const i=ox+n;if(!ue(t,i))try{t[i]=e.scaleRef(n)}catch{}}function ls(e,t){if(se(e)){const n=t.scales[e];return n&&mk(n.value)?n.value:void 0}else if(Le(e))return mk(e)?e:void 0}function yoe(e,t,n){t.__bandwidth=r=>r&&r.bandwidth?r.bandwidth():0,n._bandwidth=Jn,n._range=Jn,n._scale=Jn;const i=r=>"_["+(r.type===nu?Q(ox+r.value):Q(ox)+"+"+e(r))+"]";return{_bandwidth:r=>`this.__bandwidth(${i(r[0])})`,_range:r=>`${i(r[0])}.range()`,_scale:r=>`${i(r[0])}(${e(r[1])})`}}function ux(e,t){return function(n,i,r){if(n){const s=ls(n,(r||this).context);return s&&s.path[e](i)}else return t(i)}}const boe=ux("area",LQ),voe=ux("bounds",BQ),xoe=ux("centroid",GQ);function _oe(e,t){const n=ls(e,(t||this).context);return n&&n.scale()}function woe(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n}function lx(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function Eoe(){return lx(this.context.dataflow,"warn",arguments)}function Coe(){return lx(this.context.dataflow,"info",arguments)}function koe(){return lx(this.context.dataflow,"debug",arguments)}function cx(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function fx(e){const t=Oo(e),n=cx(t.r),i=cx(t.g),r=cx(t.b);return .2126*n+.7152*i+.0722*r}function Aoe(e,t){const n=fx(e),i=fx(t),r=Math.max(n,i),s=Math.min(n,i);return(r+.05)/(s+.05)}function $oe(){const e=[].slice.call(arguments);return e.unshift({}),Ie(...e)}function jD(e,t){return e===t||e!==e&&t!==t?!0:W(e)?W(t)&&e.length===t.length?Soe(e,t):!1:re(e)&&re(t)?qD(e,t):!1}function Soe(e,t){for(let n=0,i=e.length;nqD(e,t)}function Foe(e,t,n,i,r,s){const o=this.context.dataflow,a=this.context.data[e],u=a.input,l=o.stamp();let c=a.changes,f,d;if(o._trigger===!1||!(u.value.length||t||i))return 0;if((!c||c.stamp{a.modified=!0,o.pulse(u,c).run()},!0,1)),n&&(f=n===!0?Ui:W(n)||y0(n)?n:WD(n),c.remove(f)),t&&c.insert(t),i&&(f=WD(i),u.value.some(f)?c.remove(f):c.insert(i)),r)for(d in s)c.modify(r,d,s[d]);return 1}function Doe(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.hypot(n,i)}function Toe(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const HD={};function Moe(e,t){const n=HD[t]||(HD[t]=Bi(t));return W(e)?e.map(n):n(e)}function Jg(e){return W(e)||ArrayBuffer.isView(e)?e:null}function dx(e){return Jg(e)||(se(e)?e:null)}function Noe(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i1?t-1:0),i=1;i1?t-1:0),i=1;is.stop(l(c),e(c))),s}function Yoe(e,t,n){const i=ls(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function Xoe(e){let t=null;return function(n){return n?Tf(n,t=t||Tl(e)):e}}const GD=e=>e.data;function VD(e,t){const n=PD.call(t,e);return n.root&&n.root.lookup||{}}function Koe(e,t,n){const i=VD(e,this),r=i[t],s=i[n];return r&&s?r.path(s).map(GD):void 0}function Zoe(e,t){const n=VD(e,this)[t];return n?n.ancestors().map(GD):void 0}const YD=()=>typeof window<"u"&&window||null;function Joe(){const e=YD();return e?e.screen:{}}function Qoe(){const e=YD();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function eae(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function XD(e,t,n){if(!e)return[];const[i,r]=e,s=new Ut().set(i[0],i[1],r[0],r[1]),o=n||this.context.dataflow.scenegraph().root;return s$(o,s,tae(t))}function tae(e){let t=null;if(e){const n=oe(e.marktype),i=oe(e.markname);t=r=>(!n.length||n.some(s=>r.marktype===s))&&(!i.length||i.some(s=>r.name===s))}return t}function nae(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=oe(e);const r=e[e.length-1];return r===void 0||Math.hypot(r[0]-t,r[1]-n)>i?[...e,[t,n]]:e}function iae(e){return oe(e).reduce((t,n,i)=>{let[r,s]=n;return t+=i==0?`M ${r},${s} `:i===e.length-1?" Z":`L ${r},${s} `},"")}function rae(e,t,n){const{x:i,y:r,mark:s}=n,o=new Ut().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[u,l]of t)uo.x2&&(o.x2=u),lo.y2&&(o.y2=l);return o.translate(i,r),XD([[o.x1,o.y1],[o.x2,o.y2]],e,s).filter(u=>sae(u.x,u.y,t))}function sae(e,t,n){let i=0;for(let r=0,s=n.length-1;rt!=a>t&&e<(o-u)*(t-l)/(a-l)+u&&i++}return i&1}const Nd={random(){return Wi()},cumulativeNormal:k0,cumulativeLogNormal:ky,cumulativeUniform:Fy,densityNormal:xy,densityLogNormal:Cy,densityUniform:Sy,quantileNormal:A0,quantileLogNormal:Ay,quantileUniform:Dy,sampleNormal:C0,sampleLogNormal:Ey,sampleUniform:$y,isArray:W,isBoolean:xo,isDate:_o,isDefined(e){return e!==void 0},isNumber:Je,isObject:re,isRegExp:$2,isString:se,isTuple:y0,isValid(e){return e!=null&&e===e},toBoolean:F2,toDate(e){return D2(e)},toNumber:Cn,toString:T2,indexof:Roe,join:Noe,lastindexof:Ooe,replace:Ioe,reverse:Poe,sort:zoe,slice:Loe,flush:V4,lerp:X4,merge:$oe,pad:J4,peek:Ge,pluck:Moe,span:Xc,inrange:ol,truncate:Q4,rgb:Oo,lab:H0,hcl:G0,hsl:j0,luminance:fx,contrast:Aoe,sequence:Ei,format:ooe,utcFormat:aoe,utcParse:loe,utcOffset:j8,utcSequence:H8,timeFormat:zD,timeParse:uoe,timeOffset:U8,timeSequence:W8,timeUnitSpecifier:D8,monthFormat:coe,monthAbbrevFormat:foe,dayFormat:doe,dayAbbrevFormat:hoe,quarter:q4,utcquarter:W4,week:M8,utcweek:O8,dayofyear:T8,utcdayofyear:R8,warn:Eoe,info:Coe,debug:koe,extent(e){return qr(e)},inScope:woe,intersect:XD,clampRange:H4,pinchDistance:Doe,pinchAngle:Toe,screen:Joe,containerSize:eae,windowSize:Qoe,bandspace:Boe,setdata:roe,pathShape:Xoe,panLinear:z4,panLog:B4,panPow:U4,panSymlog:j4,zoomLinear:w2,zoomLog:E2,zoomPow:Zh,zoomSymlog:C2,encode:soe,modify:Foe,lassoAppend:nae,lassoPath:iae,intersectLasso:rae},oae=["view","item","group","xy","x","y"],aae="event.vega.",KD="this.",hx={},ZD={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${Q(BD+e)}]`,functions:uae,constants:FD,visitors:hx},px=TD(ZD);function uae(e){const t=DD(e);oae.forEach(n=>t[n]=aae+n);for(const n in Nd)t[n]=KD+n;return Ie(t,yoe(e,Nd,hx)),t}function Pt(e,t,n){return arguments.length===1?Nd[e]:(Nd[e]=t,n&&(hx[e]=n),px&&(px.functions[e]=KD+e),this)}Pt("bandwidth",Uoe,Jn),Pt("copy",joe,Jn),Pt("domain",qoe,Jn),Pt("range",Hoe,Jn),Pt("invert",Woe,Jn),Pt("scale",Goe,Jn),Pt("gradient",Voe,Jn),Pt("geoArea",boe,Jn),Pt("geoBounds",voe,Jn),Pt("geoCentroid",xoe,Jn),Pt("geoShape",Yoe,Jn),Pt("geoScale",_oe,Jn),Pt("indata",ioe,moe),Pt("data",PD,ax),Pt("treePath",Koe,ax),Pt("treeAncestors",Zoe,ax),Pt("vlSelectionTest",Xse,sx),Pt("vlSelectionIdTest",Jse,sx),Pt("vlSelectionResolve",eoe,sx),Pt("vlSelectionTuples",Qse);function cs(e,t){const n={};let i;try{e=se(e)?e:Q(e)+"",i=SD(e)}catch{q("Expression parse error: "+e)}i.visit(s=>{if(s.type!==pD)return;const o=s.callee.name,a=ZD.visitors[o];a&&a(o,s.arguments,t,n)});const r=px(i);return r.globals.forEach(s=>{const o=BD+s;!ue(n,o)&&t.getSignal(s)&&(n[o]=t.signalRef(s))}),{$expr:Ie({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function lae(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(i=>t.parseOperator(i)),n.forEach(i=>t.parseOperatorParameters(i)),(e.streams||[]).forEach(i=>t.parseStream(i)),(e.updates||[]).forEach(i=>t.parseUpdate(i)),t.resolve()}const cae=lr(["rule"]),JD=lr(["group","image","rect"]);function fae(e,t){let n="";return cae[t]||(e.x2&&(e.x?(JD[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(JD[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function gx(e){return(e+"").toLowerCase()}function dae(e){return gx(e)==="operator"}function hae(e){return gx(e)==="collect"}function Rd(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function pae(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n} : (u > v || v == null) && u != null ? ${i} : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n} - : v !== v && u === u ? ${i} : `}var fae={operator:(e,t)=>Rd(e,["_"],t.code),parameter:(e,t)=>Rd(e,["datum","_"],t.code),event:(e,t)=>Rd(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return Rd(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:i}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const s in i){const o="o["+Q(s)+"]";r+=`$=${i[s].code};if(${o}!==$)${o}=$,m=1;`}return r+=aae(i,n),r+="return m;",Rd(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(Q).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const i=(s,o)=>{const a=t[o];let u,l;return s.path?(u=`a${s.path}`,l=`b${s.path}`):((n=n||{})["f"+o]=s,u=`this.f${o}(a)`,l=`this.f${o}(b)`),cae(u,l,-a,a)},r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function dae(e){const t=this;uae(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function hae(e){const t=this;if(e.params){const n=t.get(e.id);n||q("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function pae(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=W(r)?r.map(s=>QD(s,n,t)):QD(r,n,t)}return t}function QD(e,t,n){if(!e||!re(e))return e;for(let i=0,r=eT.length,s;ir&&r.$tupleid?_e:r);return t.fn[n]||(t.fn[n]=k2(i,e.$order,t.expr.codegen))}function xae(e,t){const n=e.$encode,i={};for(const r in n){const s=n[r];i[r]=ii(t.encodeExpression(s.$expr),s.$fields),i[r].output=s.$output}return i}function _ae(e,t){return t}function wae(e,t){const n=e.$subflow;return function(i,r,s){const o=t.fork().parse(n),a=o.get(n.operators[0].id),u=o.signals.parent;return u&&u.set(s),a.detachSubflow=()=>t.detach(o),a}}function Eae(){return _e}function Cae(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):void 0,i=e.stream!=null?t.get(e.stream):void 0,r;e.source?i=t.events(e.source,e.type,n):e.merge&&(r=e.merge.map(s=>t.get(s)),i=r[0].merge.apply(r[0],r.slice(1))),e.between&&(r=e.between.map(s=>t.get(s)),i=i.between(r[0],r[1])),e.filter&&(i=i.filter(n)),e.throttle!=null&&(i=i.throttle(+e.throttle)),e.debounce!=null&&(i=i.debounce(+e.debounce)),i==null&&q("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}function kae(e){var t=this,n=re(n=e.source)?n.$ref:n,i=t.get(n),r=null,s=e.update,o=void 0;i||q("Source not defined: "+e.source),r=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),s&&s.$expr&&(s.$params&&(o=t.parseParameters(s.$params)),s=t.handlerExpression(s.$expr)),t.update(e,i,r,s,o)}const Aae={skip:!0};function $ae(e){var t=this,n={};if(e.signals){var i=n.signals={};Object.keys(t.signals).forEach(s=>{const o=t.signals[s];e.signals(s,o)&&(i[s]=o.value)})}if(e.data){var r=n.data={};Object.keys(t.data).forEach(s=>{const o=t.data[s];e.data(s,o)&&(r[s]=o.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(s=>s.getState(e))),n}function Sae(e){var t=this,n=t.dataflow,i=e.data,r=e.signals;Object.keys(r||{}).forEach(s=>{n.update(t.signals[s],r[s],Aae)}),Object.keys(i||{}).forEach(s=>{n.pulse(t.data[s].input,n.changeset().remove(Ui).insert(i[s]))}),(e.subcontext||[]).forEach((s,o)=>{const a=t.subcontext[o];a&&a.setState(s)})}function tT(e,t,n,i){return new nT(e,t,n,i)}function nT(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||fae,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function iT(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}nT.prototype=iT.prototype={fork(){const e=new iT(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(n=>n!==e);const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,i=n.dataflow,r=e.value;if(n.set(e.id,t),lae(e.type)&&r&&(r.$ingest?i.ingest(t,r.$ingest,r.$format):r.$request?i.preload(t,r.$request,r.$format):i.pulse(t,i.changeset().insert(r))),e.root&&(n.root=t),e.parent){let s=n.get(e.parent.$ref);s?(i.connect(s,[t]),t.targets().add(s)):(n.unresolved=n.unresolved||[]).push(()=>{s=n.get(e.parent.$ref),i.connect(s,[t]),t.targets().add(s)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const s in e.data){const o=n.data[s]||(n.data[s]={});e.data[s].forEach(a=>o[a]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[gx(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,i,r){this.dataflow.on(t,n,i,r,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:sae,parseOperator:dae,parseOperatorParameters:hae,parseParameters:pae,parseStream:Cae,parseUpdate:kae,getState:$ae,setState:Sae};function Fae(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),rT(t,e.description()))}function rT(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function Dae(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const mx="default";function Tae(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:mx,item:null}));e.on(e.events("view","pointermove"),t,(n,i)=>{const r=t.value,s=r?se(r)?r:r.user:mx,o=i.item&&i.item.cursor||null;return r&&s===r.user&&o==r.item?r:{user:s,item:o}}),e.add(null,function(n){let i=n.cursor,r=this.value;return se(i)||(r=i.item,i=i.user),yx(e,i&&i!==mx?i:r||i),r},{cursor:t})}function yx(e,t){const n=e.globalCursor()?typeof document<"u"&&document.body:e.container();if(n)return t==null?n.style.removeProperty("cursor"):n.style.cursor=t}function Qg(e,t){var n=e._runtime.data;return ue(n,t)||q("Unrecognized data set: "+t),n[t]}function Mae(e,t){return arguments.length<2?Qg(this,e).values.value:e1.call(this,e,Ao().remove(Ui).insert(t))}function e1(e,t){NE(t)||q("Second argument to changes must be a changeset.");const n=Qg(this,e);return n.modified=!0,this.pulse(n.input,t)}function Nae(e,t){return e1.call(this,e,Ao().insert(t))}function Rae(e,t){return e1.call(this,e,Ao().remove(t))}function sT(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function oT(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function t1(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function Oae(e){var t=t1(e),n=sT(e),i=oT(e);e._renderer.background(e.background()),e._renderer.resize(n,i,t),e._handler.origin(t),e._resizeListeners.forEach(r=>{try{r(n,i)}catch(s){e.error(s)}})}function Lae(e,t,n){var i=e._renderer,r=i&&i.canvas(),s,o,a;return r&&(a=t1(e),o=t.changedTouches?t.changedTouches[0]:t,s=kp(o,r),s[0]-=a[0],s[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=Iae(e,n,s),t}function Iae(e,t,n){const i=t?t.mark.marktype==="group"?t:t.mark.group:null;function r(o){var a=i,u;if(o){for(u=t;u;u=u.mark.group)if(u.mark.name===o){a=u;break}}return a&&a.mark&&a.mark.interactive?a:{}}function s(o){if(!o)return n;se(o)&&(o=r(o));const a=n.slice();for(;o;)a[0]-=o.x||0,a[1]-=o.y||0,o=o.mark&&o.mark.group;return a}return{view:kn(e),item:kn(t||{}),group:r,xy:s,x:o=>s(o)[0],y:o=>s(o)[1]}}const aT="view",Pae="timer",zae="window",Bae={trap:!1};function Uae(e){const t=Le({defaults:{}},e),n=(i,r)=>{r.forEach(s=>{W(i[s])&&(i[s]=lr(i[s]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function uT(e,t,n,i){e._eventListeners.push({type:n,sources:oe(t),handler:i})}function jae(e,t){var n=e._eventConfig.defaults,i=n.prevent,r=n.allow;return i===!1||r===!0?!1:i===!0||r===!1?!0:i?i[t]:r?!r[t]:e.preventDefault()}function n1(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return i===!1||re(i)&&!i[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function qae(e,t,n){var i=this,r=new _0(n),s=function(l,c){i.runAsync(null,()=>{e===aT&&jae(i,t)&&l.preventDefault(),r.receive(Lae(i,l,c))})},o;if(e===Pae)n1(i,"timer",t)&&i.timer(s,t);else if(e===aT)n1(i,"view",t)&&i.addEventListener(t,s,Bae);else if(e===zae?n1(i,"window",t)&&typeof window<"u"&&(o=[window]):typeof document<"u"&&n1(i,"selector",t)&&(o=Array.from(document.querySelectorAll(e))),!o)i.warn("Can not resolve event source: "+e);else{for(var a=0,u=o.length;a=0;)t[r].stop();for(r=i.length;--r>=0;)for(o=i[r],s=o.sources.length;--s>=0;)o.sources[s].removeEventListener(o.type,o.handler);for(e&&e.call(this,this._handler,null,null,null),r=n.length;--r>=0;)u=n[r].type,a=n[r].handler,this._handler.off(u,a);return this}function Di(e,t,n){const i=document.createElement(e);for(const r in t)i.setAttribute(r,t[r]);return n!=null&&(i.textContent=n),i}const Gae="vega-bind",Vae="vega-bind-name",Yae="vega-bind-radio";function Xae(e,t,n){if(!t)return;const i=n.param;let r=n.state;return r||(r=n.state={elements:null,active:!1,set:null,update:o=>{o!=e.signal(i.signal)&&e.runAsync(null,()=>{r.source=!0,e.signal(i.signal,o)})}},i.debounce&&(r.update=A2(i.debounce,r.update))),(i.input==null&&i.element?Kae:Jae)(r,t,i,e),r.active||(e.on(e._signals[i.signal],null,()=>{r.source?r.source=!1:r.set(e.signal(i.signal))}),r.active=!0),r}function Kae(e,t,n,i){const r=n.event||"input",s=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,s),uT(i,t,r,s),e.set=o=>{t.value=o,t.dispatchEvent(Zae(r))}}function Zae(e){return typeof Event<"u"?new Event(e):{type:e}}function Jae(e,t,n,i){const r=i.signal(n.signal),s=Di("div",{class:Gae}),o=n.input==="radio"?s:s.appendChild(Di("label"));o.appendChild(Di("span",{class:Vae},n.name||n.signal)),t.appendChild(s);let a=Qae;switch(n.input){case"checkbox":a=eue;break;case"select":a=tue;break;case"radio":a=nue;break;case"range":a=iue;break}a(e,o,n,r)}function Qae(e,t,n,i){const r=Di("input");for(const s in n)s!=="signal"&&s!=="element"&&r.setAttribute(s==="input"?"type":s,n[s]);r.setAttribute("name",n.signal),r.value=i,t.appendChild(r),r.addEventListener("input",()=>e.update(r.value)),e.elements=[r],e.set=s=>r.value=s}function eue(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const s=Di("input",r);t.appendChild(s),s.addEventListener("change",()=>e.update(s.checked)),e.elements=[s],e.set=o=>s.checked=!!o||null}function tue(e,t,n,i){const r=Di("select",{name:n.signal}),s=n.labels||[];n.options.forEach((o,a)=>{const u={value:o};i1(o,i)&&(u.selected=!0),r.appendChild(Di("option",u,(s[a]||o)+""))}),t.appendChild(r),r.addEventListener("change",()=>{e.update(n.options[r.selectedIndex])}),e.elements=[r],e.set=o=>{for(let a=0,u=n.options.length;a{const u={type:"radio",name:n.signal,value:o};i1(o,i)&&(u.checked=!0);const l=Di("input",u);l.addEventListener("change",()=>e.update(o));const c=Di("label",{},(s[a]||o)+"");return c.prepend(l),r.appendChild(c),l}),e.set=o=>{const a=e.elements,u=a.length;for(let l=0;l{u.textContent=a.value,e.update(+a.value)};a.addEventListener("input",l),a.addEventListener("change",l),e.elements=[a],e.set=c=>{a.value=c,u.textContent=c}}function i1(e,t){return e===t||e+""==t+""}function dT(e,t,n,i,r,s){return t=t||new i(e.loader()),t.initialize(n,sT(e),oT(e),t1(e),r,s).background(e.background())}function bx(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function rue(e,t,n,i){const r=new i(e.loader(),bx(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,t1(e),e);return t&&t.handlers().forEach(s=>{r.on(s.type,s.handler)}),r}function sue(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,s=Pp(i);e=n._el=e?vx(n,e,!0):null,Fae(n),s||n.error("Unrecognized renderer type: "+i);const o=s.handler||Hf,a=e?s.renderer:s.headless;return n._renderer=a?dT(n,n._renderer,e,a):null,n._handler=rue(n,n._handler,e,o),n._redraw=!0,e&&r!=="none"&&(t=t?n._elBind=vx(n,t,!0):e.appendChild(Di("form",{class:"vega-bindings"})),n._bind.forEach(u=>{u.param.element&&r!=="container"&&(u.element=vx(n,u.param.element,!!u.param.input))}),n._bind.forEach(u=>{Xae(n,u.element||t,u)})),n}function vx(e,t,n){if(typeof t=="string")if(typeof document<"u"){if(t=document.querySelector(t),!t)return e.error("Signal bind element not found: "+t),null}else return e.error("DOM document instance not found."),null;if(t&&n)try{t.textContent=""}catch(i){t=null,e.error(i)}return t}const Od=e=>+e||0,oue=e=>({top:e,bottom:e,left:e,right:e});function hT(e){return re(e)?{top:Od(e.top),bottom:Od(e.bottom),left:Od(e.left),right:Od(e.right)}:oue(Od(e))}async function xx(e,t,n,i){const r=Pp(t),s=r&&r.headless;return s||q("Unrecognized renderer type: "+t),await e.runAsync(),dT(e,null,null,s,n,i).renderAsync(e._scenegraph.root)}async function aue(e,t){e!==Go.Canvas&&e!==Go.SVG&&e!==Go.PNG&&q("Unrecognized image type: "+e);const n=await xx(this,e,t);return e===Go.SVG?uue(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function uue(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function lue(e,t){return(await xx(this,Go.Canvas,e,t)).canvas()}async function cue(e){return(await xx(this,Go.SVG,e)).svg()}function fue(e,t,n){return tT(e,xl,Nd,n).parse(t)}function due(e){var t=this._runtime.scales;return ue(t,e)||q("Unrecognized scale or projection: "+e),t[e].value}var pT="width",gT="height",_x="padding",mT={skip:!0};function yT(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===_x?i.left+i.right:0)}function bT(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===_x?i.top+i.bottom:0)}function hue(e){var t=e._signals,n=t[pT],i=t[gT],r=t[_x];function s(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=yT(e,a.size),s()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=bT(e,a.size),s()},{size:i});const o=e.add(null,s,{pad:r});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=i.rank+1,o.rank=r.rank+1}function pue(e,t,n,i,r,s){this.runAfter(o=>{let a=0;o._autosize=0,o.width()!==n&&(a=1,o.signal(pT,n,mT),o._resizeWidth.skip(!0)),o.height()!==i&&(a=1,o.signal(gT,i,mT),o._resizeHeight.skip(!0)),o._viewWidth!==e&&(o._resize=1,o._viewWidth=e),o._viewHeight!==t&&(o._resize=1,o._viewHeight=t),(o._origin[0]!==r[0]||o._origin[1]!==r[1])&&(o._resize=1,o._origin=r),a&&o.run("enter"),s&&o.runAfter(u=>u.resize())},!1,1)}function gue(e){return this._runtime.getState(e||{data:mue,signals:yue,recurse:!0})}function mue(e,t){return t.modified&&W(t.input.value)&&!e.startsWith("_:vega:_")}function yue(e,t){return!(e==="parent"||t instanceof xl.proxy)}function bue(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function vue(e,t){function n(i){e({timestamp:Date.now(),elapsed:i})}this._timers.push(qte(n,t))}function xue(e,t,n,i){const r=e.element();r&&r.setAttribute("title",_ue(i))}function _ue(e){return e==null?"":W(e)?vT(e):re(e)&&!_o(e)?wue(e):e+""}function wue(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(W(n)?vT(n):xT(n))}).join(` -`)}function vT(e){return"["+e.map(xT).join(", ")+"]"}function xT(e){return W(e)?"[…]":re(e)&&!_o(e)?"{…}":e}function Eue(){if(this.renderer()==="canvas"&&this._renderer._canvas){let e=null;const t=()=>{e!=null&&e();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",t),e=()=>{n.removeEventListener("change",t)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}function _T(e,t){const n=this;if(t=t||{},vl.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){const s=Le({},e.locale,t.locale);n.locale(_E(s.number,s.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||Go.Canvas,n._scenegraph=new wA;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||xue,n._redraw=!0,n._handler=new Hf().scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=Uae(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=fue(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map(s=>({state:null,param:Le({},s)})),r.root&&r.root.set(i),i.source=r.data.root.input,n.pulse(r.data.root.input,n.changeset().insert(i.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=yT(n,n._width),n._viewHeight=bT(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,hue(n),Dae(n),Tae(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function r1(e,t){return ue(e._signals,t)?e._signals[t]:q("Unrecognized signal name: "+Q(t))}function wT(e,t){const n=(e._targets||[]).filter(i=>i._update&&i._update.handler===t);return n.length?n[0]:null}function ET(e,t,n,i){let r=wT(n,i);return r||(r=bx(e,()=>i(t,n.value)),r.handler=i,e.on(n,null,r)),e}function CT(e,t,n){const i=wT(t,n);return i&&t._targets.remove(i),e}te(_T,vl,{async evaluate(e,t,n){if(await vl.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,Oae(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&m0(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=e!=null?e+"":null;return t!==this._desc&&rT(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const i=r1(this,e);return arguments.length===1?i.value:this.update(i,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",hT(e)):hT(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(Pp(e)||q("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(vl.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(r1(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:pue,addEventListener(e,t,n){let i=t;return n&&n.trap===!1||(i=bx(this,t),i.raw=t),this._handler.on(e,i),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),i=n.length,r,s;--i>=0;)if(s=n[i].type,r=n[i].handler,e===s&&(t===r||t===r.raw)){this._handler.off(s,r);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.includes(e)||t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return ET(this,e,r1(this,e),t)},removeSignalListener(e,t){return CT(this,r1(this,e),t)},addDataListener(e,t){return ET(this,e,Qg(this,e).values,t)},removeDataListener(e,t){return CT(this,Qg(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=yx(this,null);this._globalCursor=!!e,t&&yx(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:vue,events:qae,finalize:Hae,hover:Wae,data:Mae,change:e1,insert:Nae,remove:Rae,scale:due,initialize:sue,toImageURL:aue,toCanvas:lue,toSVG:cue,getState:gue,setState:bue,_watchPixelRatio:Eue});const Cue="view",s1="[",o1="]",kT="{",AT="}",kue=":",$T=",",Aue="@",$ue=">",Sue=/[[\]{}]/,Fue={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let ST,FT;function ta(e,t,n){return ST=t||Cue,FT=n||Fue,DT(e.trim()).map(wx)}function Due(e){return FT[e]}function Ld(e,t,n,i,r){const s=e.length;let o=0,a;for(;t=0?--o:i&&i.indexOf(a)>=0&&++o}return t}function DT(e){const t=[],n=e.length;let i=0,r=0;for(;r' after between selector: "+e;i=i.map(wx);const r=wx(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function Mue(e){const t={source:ST},n=[];let i=[0,0],r=0,s=0,o=e.length,a=0,u,l;if(e[o-1]===AT){if(a=e.lastIndexOf(kT),a>=0){try{i=Nue(e.substring(a+1,o-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),o=e.length}else throw"Unmatched right brace: "+e;a=0}if(!o)throw e;if(e[0]===Aue&&(r=++a),u=Ld(e,a,kue),u1?(t.type=n[1],r?t.markname=n[0].slice(1):Due(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),l!=null&&(t.filter=l),i[0]&&(t.throttle=i[0]),i[1]&&(t.debounce=i[1]),t}function Nue(e){const t=e.split($T);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}function Rue(e){return re(e)?e:{type:e||"pad"}}const Id=e=>+e||0,Oue=e=>({top:e,bottom:e,left:e,right:e});function Lue(e){return re(e)?e.signal?e:{top:Id(e.top),bottom:Id(e.bottom),left:Id(e.left),right:Id(e.right)}:Oue(Id(e))}const tn=e=>re(e)&&!W(e)?Le({},e):{value:e};function TT(e,t,n,i){return n!=null?(re(n)&&!W(n)||W(n)&&n.length&&re(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1):0}function pn(e,t,n){for(const i in t)TT(e,i,t[i]);for(const i in n)TT(e,i,n[i],"update")}function Ql(e,t,n){for(const i in t)n&&ue(n,i)||(e[i]=Le(e[i]||{},t[i]));return e}function ec(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const Ex="mark",Cx="frame",kx="scope",Iue="axis",Pue="axis-domain",zue="axis-grid",Bue="axis-label",Uue="axis-tick",jue="axis-title",que="legend",Wue="legend-band",Hue="legend-entry",Gue="legend-gradient",MT="legend-label",Vue="legend-symbol",Yue="legend-title",Xue="title",Kue="title-text",Zue="title-subtitle";function Jue(e,t,n,i,r){const s={},o={};let a,u,l,c;u="lineBreak",t==="text"&&r[u]!=null&&!ec(u,e)&&Ax(s,u,r[u]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===Cx?r.group:n===Ex?Le({},r.mark,r[t]):null;for(u in c)l=ec(u,e)||(u==="fill"||u==="stroke")&&(ec("fill",e)||ec("stroke",e)),l||Ax(s,u,c[u]);oe(i).forEach(f=>{const d=r.style&&r.style[f];for(const h in d)ec(h,e)||Ax(s,h,d[h])}),e=Le({},e);for(u in s)c=s[u],c.signal?(a=a||{})[u]=c:o[u]=c;return e.enter=Le(o,e.enter),a&&(e.update=Le(a,e.update)),e}function Ax(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const NT=e=>se(e)?Q(e):e.signal?`(${e.signal})`:RT(e);function a1(e){if(e.gradient!=null)return ele(e);let t=e.signal?`(${e.signal})`:e.color?Que(e.color):e.field!=null?RT(e.field):e.value!==void 0?Q(e.value):void 0;return e.scale!=null&&(t=tle(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${l1(e.exponent)})`),e.mult!=null&&(t+=`*${l1(e.mult)}`),e.offset!=null&&(t+=`+${l1(e.offset)}`),e.round&&(t=`round(${t})`),t}const u1=(e,t,n,i)=>`(${e}(${[t,n,i].map(a1).join(",")})+'')`;function Que(e){return e.c?u1("hcl",e.h,e.c,e.l):e.h||e.s?u1("hsl",e.h,e.s,e.l):e.l||e.a?u1("lab",e.l,e.a,e.b):e.r||e.g||e.b?u1("rgb",e.r,e.g,e.b):null}function ele(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:Q(n));for(;t.length&&Ge(t)==null;)t.pop();return t.unshift(NT(e.gradient)),`gradient(${t.join(",")})`}function l1(e){return re(e)?"("+a1(e)+")":e}function RT(e){return OT(re(e)?e:{datum:e})}function OT(e){let t,n,i;if(e.signal)t="datum",i=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(i=e.parent,t+=".datum"):i=e.group}else e.datum?(t="datum",i=e.datum):q("Invalid field reference: "+Q(e));return e.signal||(i=se(i)?jr(i).map(Q).join("]["):OT(i)),t+"["+i+"]"}function tle(e,t){const n=NT(e.scale);return e.range!=null?t=`lerp(_range(${n}), ${+e.range})`:(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(+e.band==1?"":"*"+l1(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function nle(e){let t="";return e.forEach(n=>{const i=a1(n);t+=n.test?`(${n.test})?${i}:`:i}),Ge(t)===":"&&(t+="null"),t}function LT(e,t,n,i,r,s){const o={};s=s||{},s.encoders={$encode:o},e=Jue(e,t,n,i,r.config);for(const a in e)o[a]=ile(e[a],t,s,r);return s}function ile(e,t,n,i){const r={},s={};for(const o in e)e[o]!=null&&(r[o]=sle(rle(e[o]),i,n,s));return{$expr:{marktype:t,channels:r},$fields:Object.keys(s),$output:Object.keys(e)}}function rle(e){return W(e)?nle(e):a1(e)}function sle(e,t,n,i){const r=cs(e,t);return r.$fields.forEach(s=>i[s]=1),Le(n,r.$params),r.$expr}const ole="outer",ale=["value","update","init","react","bind"];function IT(e,t){q(e+' for "outer" push: '+Q(t))}function PT(e,t){const n=e.name;if(e.push===ole)t.signals[n]||IT("No prior signal definition",n),ale.forEach(i=>{e[i]!==void 0&&IT("Invalid property ",i)});else{const i=t.addSignal(n,e.value);e.react===!1&&(i.react=!1),e.bind&&t.addBinding(n,e.bind)}}function $x(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function c1(e,t,n,i){return new $x(e,t,n,i)}function f1(e,t){return c1("operator",e,t)}function Ee(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function Pd(e,t){return t?{$field:e,$name:t}:{$field:e}}const Sx=Pd("key");function zT(e,t){return{$compare:e,$order:t}}function ule(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const lle="ascending",cle="descending";function fle(e){return re(e)?(e.order===cle?"-":"+")+d1(e.op,e.field):""}function d1(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const Fx="scope",Dx="view";function Yt(e){return e&&e.signal}function dle(e){return e&&e.expr}function h1(e){if(Yt(e))return!0;if(re(e)){for(const t in e)if(h1(e[t]))return!0}return!1}function _r(e,t){return e??t}function ou(e){return e&&e.signal||e}const BT="timer";function zd(e,t){return(e.merge?ple:e.stream?gle:e.type?mle:q("Invalid stream specification: "+Q(e)))(e,t)}function hle(e){return e===Fx?Dx:e||Dx}function ple(e,t){const n=e.merge.map(r=>zd(r,t)),i=Tx({merge:n},e,t);return t.addStream(i).id}function gle(e,t){const n=zd(e.stream,t),i=Tx({stream:n},e,t);return t.addStream(i).id}function mle(e,t){let n;e.type===BT?(n=t.event(BT,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(hle(e.source),e.type);const i=Tx({stream:n},e,t);return Object.keys(i).length===1?n:t.addStream(i).id}function Tx(e,t,n){let i=t.between;return i&&(i.length!==2&&q('Stream "between" parameter must have 2 entries: '+Q(t)),e.between=[zd(i[0],n),zd(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(yle(t.marktype,t.markname,t.markrole)),t.source===Fx&&i.push("inScope(event.item)"),i.length&&(e.filter=cs("("+i.join(")&&(")+")",n).$expr),(i=t.throttle)!=null&&(e.throttle=+i),(i=t.debounce)!=null&&(e.debounce=+i),t.consume&&(e.consume=!0),e}function yle(e,t,n){const i="event.item";return i+(e&&e!=="*"?"&&"+i+".mark.marktype==='"+e+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(t?"&&"+i+".mark.name==='"+t+"'":"")}const ble={code:"_.$value",ast:{type:"Identifier",value:"value"}};function vle(e,t,n){const i=e.encode,r={target:n};let s=e.events,o=e.update,a=[];s||q("Signal update missing events specification."),se(s)&&(s=ta(s,t.isSubscope()?Fx:Dx)),s=oe(s).filter(u=>u.signal||u.scale?(a.push(u),0):1),a.length>1&&(a=[_le(a)]),s.length&&a.push(s.length>1?{merge:s}:s[0]),i!=null&&(o&&q("Signal encode and update are mutually exclusive."),o="encode(item(),"+Q(i)+")"),r.update=se(o)?cs(o,t):o.expr!=null?cs(o.expr,t):o.value!=null?o.value:o.signal!=null?{$expr:ble,$params:{$value:t.signalRef(o.signal)}}:q("Invalid signal update specification."),e.force&&(r.options={force:!0}),a.forEach(u=>t.addUpdate(Le(xle(u,t),r)))}function xle(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):zd(e,t)}}function _le(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function wle(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?q("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=cs(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach(r=>vle(r,t,n.id))}const dt=e=>(t,n,i)=>c1(e,n,t||void 0,i),UT=dt("aggregate"),Ele=dt("axisticks"),jT=dt("bound"),wr=dt("collect"),qT=dt("compare"),Cle=dt("datajoin"),WT=dt("encode"),kle=dt("expression"),Ale=dt("facet"),$le=dt("field"),Sle=dt("key"),Fle=dt("legendentries"),Dle=dt("load"),Tle=dt("mark"),Mle=dt("multiextent"),Nle=dt("multivalues"),Rle=dt("overlap"),Ole=dt("params"),HT=dt("prefacet"),Lle=dt("projection"),Ile=dt("proxy"),Ple=dt("relay"),GT=dt("render"),zle=dt("scale"),au=dt("sieve"),Ble=dt("sortitems"),VT=dt("viewlayout"),Ule=dt("values");let jle=0;const YT={min:"min",max:"max",count:"sum"};function qle(e,t){const n=e.type||"linear";yk(n)||q("Unrecognized scale type: "+Q(n)),t.addScale(e.name,{type:n,domain:void 0})}function Wle(e,t){const n=t.getScale(e.name).params;let i;n.domain=XT(e.domain,e,t),e.range!=null&&(n.range=ZT(e,t,n)),e.interpolate!=null&&ece(e.interpolate,n),e.nice!=null&&(n.nice=Qle(e.nice,t)),e.bins!=null&&(n.bins=Jle(e.bins,t));for(i in e)ue(n,i)||i==="name"||(n[i]=Zi(e[i],t))}function Zi(e,t){return re(e)?e.signal?t.signalRef(e.signal):q("Unsupported object: "+Q(e)):e}function p1(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>Zi(n,t))}function g1(e){q("Can not find data set: "+Q(e))}function XT(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&q("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(W(e)?Hle:e.fields?Vle:Gle)(e,t,n)}function Hle(e,t,n){return e.map(i=>Zi(i,n))}function Gle(e,t,n){const i=n.getData(e.data);return i||g1(e.data),Dl(t.type)?i.valuesRef(n,e.field,KT(e.sort,!1)):xk(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function Vle(e,t,n){const i=e.data,r=e.fields.reduce((s,o)=>(o=se(o)?{data:i,field:o}:W(o)||o.signal?Yle(o,n):o,s.push(o),s),[]);return(Dl(t.type)?Xle:xk(t.type)?Kle:Zle)(e,n,r)}function Yle(e,t){const n="_:vega:_"+jle++,i=wr({});if(W(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+Q(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,au({})]),{data:n,field:"data"}}function Xle(e,t,n){const i=KT(e.sort,!0);let r,s;const o=n.map(l=>{const c=t.getData(l.data);return c||g1(l.data),c.countsRef(t,l.field,i)}),a={groupby:Sx,pulse:o};i&&(r=i.op||"count",s=i.field?d1(r,i.field):"count",a.ops=[YT[r]],a.fields=[t.fieldRef(s)],a.as=[s]),r=t.add(UT(a));const u=t.add(wr({pulse:Ee(r)}));return s=t.add(Ule({field:Sx,sort:t.sortRef(i),pulse:Ee(u)})),Ee(s)}function KT(e,t){return e&&(!e.field&&!e.op?re(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?q("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!YT[e.op]&&q("Multiple domain scales can not be sorted using "+e.op)),e}function Kle(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||g1(r.data),s.domainRef(t,r.field)});return Ee(t.add(Nle({values:i})))}function Zle(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||g1(r.data),s.extentRef(t,r.field)});return Ee(t.add(Mle({extents:i})))}function Jle(e,t){return e.signal||W(e)?p1(e,t):t.objectProperty(e)}function Qle(e,t){return e.signal?t.signalRef(e.signal):re(e)?{interval:Zi(e.interval),step:Zi(e.step)}:Zi(e)}function ece(e,t){t.interpolate=Zi(e.type||e),e.gamma!=null&&(t.interpolateGamma=Zi(e.gamma))}function ZT(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if(se(r)){if(i&&ue(i,r))return e=Le({},e,{range:i[r]}),ZT(e,t,n);r==="width"?r=[0,{signal:"width"}]:r==="height"?r=Dl(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:q("Unrecognized scale range value: "+Q(r))}else if(r.scheme){n.scheme=W(r.scheme)?p1(r.scheme,t):Zi(r.scheme,t),r.extent&&(n.schemeExtent=p1(r.extent,t)),r.count&&(n.schemeCount=Zi(r.count,t));return}else if(r.step){n.rangeStep=Zi(r.step,t);return}else{if(Dl(e.type)&&!W(r))return XT(r,e,t);W(r)||q("Unsupported range type: "+Q(r))}return r.map(s=>(W(s)?p1:Zi)(s,t))}function tce(e,t){const n=t.config.projection||{},i={};for(const r in e)r!=="name"&&(i[r]=Mx(e[r],r,t));for(const r in n)i[r]==null&&(i[r]=Mx(n[r],r,t));t.addProjection(e.name,i)}function Mx(e,t,n){return W(e)?e.map(i=>Mx(i,t,n)):re(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:q("Unsupported parameter object: "+Q(e)):e}const Er="top",tc="left",nc="right",na="bottom",JT="center",nce="vertical",ice="start",rce="middle",sce="end",Nx="index",Rx="label",oce="offset",ic="perc",ace="perc2",Ji="value",Bd="guide-label",Ox="guide-title",uce="group-title",lce="group-subtitle",QT="symbol",m1="gradient",Lx="discrete",Ix="size",Px=[Ix,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],Ud={name:1,style:1,interactive:1},Ye={value:0},Qi={value:1},y1="group",eM="rect",zx="rule",cce="symbol",uu="text";function jd(e){return e.type=y1,e.interactive=e.interactive||!1,e}function di(e,t){const n=(i,r)=>_r(e[i],_r(t[i],r));return n.isVertical=i=>nce===_r(e.direction,t.direction||(i?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>_r(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>_r(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>_r(e.columns,_r(t.columns,+n.isVertical(!0))),n}function tM(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function fce(e,t,n){const i=t.config.style[n];return i&&i[e]}function b1(e,t,n){return`item.anchor === '${ice}' ? ${e} : item.anchor === '${sce}' ? ${t} : ${n}`}const Bx=b1(Q(tc),Q(nc),Q(JT));function dce(e){const t=e("tickBand");let n=e("tickOffset"),i,r;return t?t.signal?(i={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},r={signal:`(${t.signal}) === 'extent'`},re(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t==="extent"?(i=1,r=!0,n=0):(i=.5,r=!1):(i=e("bandPosition"),r=e("tickExtra")),{extra:r,band:i,offset:n}}function nM(e,t){return t?e?re(e)?Object.assign({},e,{offset:nM(e.offset,t)}):{value:e,offset:t}:t:e}function Ti(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=Ql(e.encode,t,Ud)):e.interactive=!1,e}function hce(e,t,n,i){const r=di(e,n),s=r.isVertical(),o=r.gradientThickness(),a=r.gradientLength();let u,l,c,f,d;s?(l=[0,1],c=[0,0],f=o,d=a):(l=[0,0],c=[1,0],f=a,d=o);const h={enter:u={opacity:Ye,x:Ye,y:Ye,width:tn(f),height:tn(d)},update:Le({},u,{opacity:Qi,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:Ye}};return pn(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),Ti({type:eM,role:Gue,encode:h},i)}function pce(e,t,n,i,r){const s=di(e,n),o=s.isVertical(),a=s.gradientThickness(),u=s.gradientLength();let l,c,f,d,h="";o?(l="y",f="y2",c="x",d="width",h="1-"):(l="x",f="x2",c="y",d="height");const p={opacity:Ye,fill:{scale:t,field:Ji}};p[l]={signal:h+"datum."+ic,mult:u},p[c]=Ye,p[f]={signal:h+"datum."+ace,mult:u},p[d]=tn(a);const g={enter:p,update:Le({},p,{opacity:Qi}),exit:{opacity:Ye}};return pn(g,{stroke:s("gradientStrokeColor"),strokeWidth:s("gradientStrokeWidth")},{opacity:s("gradientOpacity")}),Ti({type:eM,role:Wue,key:Ji,from:r,encode:g},i)}const gce=`datum.${ic}<=0?"${tc}":datum.${ic}>=1?"${nc}":"${JT}"`,mce=`datum.${ic}<=0?"${na}":datum.${ic}>=1?"${Er}":"${rce}"`;function iM(e,t,n,i){const r=di(e,t),s=r.isVertical(),o=tn(r.gradientThickness()),a=r.gradientLength();let u=r("labelOverlap"),l,c,f,d,h="";const p={enter:l={opacity:Ye},update:c={opacity:Qi,text:{field:Rx}},exit:{opacity:Ye}};return pn(p,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:_r(e.labelLimit,t.gradientLabelLimit)}),s?(l.align={value:"left"},l.baseline=c.baseline={signal:mce},f="y",d="x",h="1-"):(l.align=c.align={signal:gce},l.baseline={value:"top"},f="x",d="y"),l[f]=c[f]={signal:h+"datum."+ic,mult:a},l[d]=c[d]=o,o.offset=_r(e.labelOffset,t.gradientLabelOffset)||0,u=u?{separation:r("labelSeparation"),method:u,order:"datum."+Nx}:void 0,Ti({type:uu,role:MT,style:Bd,key:Ji,from:i,encode:p,overlap:u},n)}function yce(e,t,n,i,r){const s=di(e,t),o=n.entries,a=!!(o&&o.interactive),u=o?o.name:void 0,l=s("clipHeight"),c=s("symbolOffset"),f={data:"value"},d=`(${r}) ? datum.${oce} : datum.${Ix}`,h=l?tn(l):{field:Ix},p=`datum.${Nx}`,g=`max(1, ${r})`;let m,y,b,v,x;h.mult=.5,m={enter:y={opacity:Ye,x:{signal:d,mult:.5,offset:c},y:h},update:b={opacity:Qi,x:y.x,y:y.y},exit:{opacity:Ye}};let _=null,E=null;e.fill||(_=t.symbolBaseFillColor,E=t.symbolBaseStrokeColor),pn(m,{fill:s("symbolFillColor",_),shape:s("symbolType"),size:s("symbolSize"),stroke:s("symbolStrokeColor",E),strokeDash:s("symbolDash"),strokeDashOffset:s("symbolDashOffset"),strokeWidth:s("symbolStrokeWidth")},{opacity:s("symbolOpacity")}),Px.forEach(S=>{e[S]&&(b[S]=y[S]={scale:e[S],field:Ji})});const w=Ti({type:cce,role:Vue,key:Ji,from:f,clip:l?!0:void 0,encode:m},n.symbols),C=tn(c);C.offset=s("labelOffset"),m={enter:y={opacity:Ye,x:{signal:d,offset:C},y:h},update:b={opacity:Qi,text:{field:Rx},x:y.x,y:y.y},exit:{opacity:Ye}},pn(m,{align:s("labelAlign"),baseline:s("labelBaseline"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontStyle:s("labelFontStyle"),fontWeight:s("labelFontWeight"),limit:s("labelLimit")});const k=Ti({type:uu,role:MT,style:Bd,key:Ji,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:Ye,height:l?tn(l):Ye,opacity:Ye},exit:{opacity:Ye},update:b={opacity:Qi,row:{signal:null},column:{signal:null}}},s.isVertical(!0)?(v=`ceil(item.mark.items.length / ${g})`,b.row.signal=`${p}%${v}`,b.column.signal=`floor(${p} / ${v})`,x={field:["row",p]}):(b.row.signal=`floor(${p} / ${g})`,b.column.signal=`${p} % ${g}`,x={field:p}),b.column.signal=`(${r})?${b.column.signal}:${p}`,i={facet:{data:i,name:"value",groupby:Nx}},jd({role:kx,from:i,encode:Ql(m,o,Ud),marks:[w,k],name:u,interactive:a,sort:x})}function bce(e,t){const n=di(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const Ux='item.orient === "left"',jx='item.orient === "right"',v1=`(${Ux} || ${jx})`,vce=`datum.vgrad && ${v1}`,xce=b1('"top"','"bottom"','"middle"'),_ce=b1('"right"','"left"','"center"'),wce=`datum.vgrad && ${jx} ? (${_ce}) : (${v1} && !(datum.vgrad && ${Ux})) ? "left" : ${Bx}`,Ece=`item._anchor || (${v1} ? "middle" : "start")`,Cce=`${vce} ? (${Ux} ? -90 : 90) : 0`,kce=`${v1} ? (datum.vgrad ? (${jx} ? "bottom" : "top") : ${xce}) : "top"`;function Ace(e,t,n,i){const r=di(e,t),s={enter:{opacity:Ye},update:{opacity:Qi,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:Ye}};return pn(s,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:Ece},angle:{signal:Cce},align:{signal:wce},baseline:{signal:kce},text:e.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),baseline:r("titleBaseline")}),Ti({type:uu,role:Yue,style:Ox,from:i,encode:s},n)}function $ce(e,t){let n;return re(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+rM(e.path)+")":e.sphere&&(n="geoShape("+rM(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function rM(e){return re(e)&&e.signal?e.signal:Q(e)}function sM(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===y1?kx:t||Ex}function Sce(e){return{marktype:e.type,name:e.name||void 0,role:e.role||sM(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function Fce(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function qx(e,t){const n=jE(e.type);n||q("Unrecognized transform type: "+Q(e.type));const i=c1(n.type.toLowerCase(),null,oM(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function oM(e,t,n){const i={},r=e.params.length;for(let s=0;saM(e,s,n)):aM(e,r,n)}function aM(e,t,n){const i=e.type;if(Yt(t))return lM(i)?q("Expression references can not be signals."):Wx(i)?n.fieldRef(t):cM(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||Wx(i);return r&&Nce(t)?n.exprRef(t.expr,t.as):r&&Rce(t)?Pd(t.field,t.as):lM(i)?cs(t,n):Oce(i)?Ee(n.getData(t).values):Wx(i)?Pd(t):cM(i)?n.compareRef(t):t}}function Tce(e,t,n){return se(t.from)||q('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function Mce(e,t,n){const i=t[e.name];return e.array?(W(i)||q("Expected an array of sub-parameters. Instead: "+Q(i)),i.map(r=>uM(e,r,n))):uM(e,i,n)}function uM(e,t,n){const i=e.params.length;let r;for(let o=0;oe&&e.expr,Rce=e=>e&&e.field,Oce=e=>e==="data",lM=e=>e==="expr",Wx=e=>e==="field",cM=e=>e==="compare";function Lce(e,t,n){let i,r,s,o,a;return e?(i=e.facet)&&(t||q("Only group marks can be faceted."),i.field!=null?o=a=x1(i,n):(e.data?a=Ee(n.getData(e.data).aggregate):(s=qx(Le({type:"aggregate",groupby:oe(i.groupby)},i.aggregate),n),s.params.key=n.keyRef(i.groupby),s.params.pulse=x1(i,n),o=a=Ee(n.add(s))),r=n.keyRef(i.groupby,!0))):o=Ee(n.add(wr(null,[{}]))),o||(o=x1(e,n)),{key:r,pulse:o,parent:a}}function x1(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:Ee(t.getData(e.data).output)}function lu(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}lu.fromEntries=function(e,t){const n=t.length,i=t[n-1],r=t[n-2];let s=t[0],o=null,a=1;for(s&&s.type==="load"&&(s=t[1]),e.add(t[0]);af??"null").join(",")+"),0)",c=cs(l,t);u.update=c.$expr,u.params=c.$params}function _1(e,t){const n=sM(e),i=e.type===y1,r=e.from&&e.from.facet,s=e.overlap;let o=e.layout||n===kx||n===Cx,a,u,l,c,f,d,h;const p=n===Ex||o||r,g=Lce(e.from,i,t);u=t.add(Cle({key:g.key||(e.key?Pd(e.key):void 0),pulse:g.pulse,clean:!i}));const m=Ee(u);u=l=t.add(wr({pulse:m})),u=t.add(Tle({markdef:Sce(e),interactive:Fce(e.interactive,t),clip:$ce(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:Ee(u)}));const y=Ee(u);u=c=t.add(WT(LT(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),u.params.parent=t.encode(),e.transform&&e.transform.forEach(E=>{const w=qx(E,t),C=w.metadata;(C.generates||C.changes)&&q("Mark transforms should not generate new data."),C.nomod||(c.params.mod=!0),w.params.pulse=Ee(u),t.add(u=w)}),e.sort&&(u=t.add(Ble({sort:t.compareRef(e.sort),pulse:Ee(u)})));const b=Ee(u);(r||o)&&(o=t.add(VT({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:b})),d=Ee(o));const v=t.add(jT({mark:y,pulse:d||b}));h=Ee(v),i&&(p&&(a=t.operators,a.pop(),o&&a.pop()),t.pushState(b,d||h,m),r?Ice(e,t,g):p?Pce(e,t,g):t.parse(e),t.popState(),p&&(o&&a.push(o),a.push(v))),s&&(h=zce(s,h,t));const x=t.add(GT({pulse:h})),_=t.add(au({pulse:Ee(x)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new lu(t,l,x,_)),e.on&&e.on.forEach(E=>{(E.insert||E.remove||E.toggle)&&q("Marks only support modify triggers."),hM(E,t,f)}))}function zce(e,t,n){const i=e.method,r=e.bound,s=e.separation,o={separation:Yt(s)?n.signalRef(s.signal):s,method:Yt(i)?n.signalRef(i.signal):i,pulse:t};if(e.order&&(o.sort=n.compareRef({field:e.order})),r){const a=r.tolerance;o.boundTolerance=Yt(a)?n.signalRef(a.signal):+a,o.boundScale=n.scaleRef(r.scale),o.boundOrient=r.orient}return Ee(n.add(Rle(o)))}function Bce(e,t){const n=t.config.legend,i=e.encode||{},r=di(e,n),s=i.legend||{},o=s.name||void 0,a=s.interactive,u=s.style,l={};let c=0,f,d,h;Px.forEach(v=>e[v]?(l[v]=e[v],c=c||e[v]):0),c||q("Missing valid scale for legend.");const p=Uce(e,t.scaleType(c)),g={title:e.title!=null,scales:l,type:p,vgrad:p!=="symbol"&&r.isVertical()},m=Ee(t.add(wr(null,[g]))),y={enter:{x:{value:0},y:{value:0}}},b=Ee(t.add(Fle(d={type:p,scale:t.scaleRef(c),count:t.objectProperty(r("tickCount")),limit:t.property(r("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===m1?(h=[hce(e,c,n,i.gradient),iM(e,n,i.labels,b)],d.count=d.count||t.signalRef(`max(2,2*floor((${ou(r.gradientLength())})/100))`)):p===Lx?h=[pce(e,c,n,i.gradient,b),iM(e,n,i.labels,b)]:(f=bce(e,n),h=[yce(e,n,i,b,ou(f.columns))],d.size=Wce(e,t,h[0].marks)),h=[jd({role:Hue,from:m,encode:y,marks:h,layout:f,interactive:a})],g.title&&h.push(Ace(e,n,i.title,m)),_1(jd({role:que,from:m,encode:Ql(qce(r,e,n),s,Ud),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:o,interactive:a,style:u}),t)}function Uce(e,t){let n=e.type||QT;return!e.type&&jce(e)===1&&(e.fill||e.stroke)&&(n=Zb(t)?m1:Jb(t)?Lx:QT),n!==m1?n:Jb(t)?Lx:m1}function jce(e){return Px.reduce((t,n)=>t+(e[n]?1:0),0)}function qce(e,t,n){const i={enter:{},update:{}};return pn(i,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),i}function Wce(e,t,n){const i=ou(pM("size",e,n)),r=ou(pM("strokeWidth",e,n)),s=ou(Hce(n[1].encode,t,Bd));return cs(`max(ceil(sqrt(${i})+${r}),${s})`,t)}function pM(e,t,n){return t[e]?`scale("${t[e]}",datum)`:tM(e,n[0].encode)}function Hce(e,t,n){return tM("fontSize",e)||fce("fontSize",t,n)}const Gce=`item.orient==="${tc}"?-90:item.orient==="${nc}"?90:0`;function Vce(e,t){e=se(e)?{text:e}:e;const n=di(e,t.config.title),i=e.encode||{},r=i.group||{},s=r.name||void 0,o=r.interactive,a=r.style,u=[],l={},c=Ee(t.add(wr(null,[l])));return u.push(Kce(e,n,Yce(e),c)),e.subtitle&&u.push(Zce(e,n,i.subtitle,c)),_1(jd({role:Xue,from:c,encode:Xce(n,r),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:s,interactive:o,style:a}),t)}function Yce(e){const t=e.encode;return t&&t.title||Le({name:e.name,interactive:e.interactive,style:e.style},t)}function Xce(e,t){const n={enter:{},update:{}};return pn(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:Bx},angle:{signal:Gce},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),Ql(n,t,Ud)}function Kce(e,t,n,i){const r={value:0},s=e.text,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return pn(o,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),Ti({type:uu,role:Kue,style:uce,from:i,encode:o},n)}function Zce(e,t,n,i){const r={value:0},s=e.subtitle,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return pn(o,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),Ti({type:uu,role:Zue,style:lce,from:i,encode:o},n)}function Jce(e,t){const n=[];e.transform&&e.transform.forEach(i=>{n.push(qx(i,t))}),e.on&&e.on.forEach(i=>{hM(i,t,e.name)}),t.addDataPipeline(e.name,Qce(e,t,n))}function Qce(e,t,n){const i=[];let r=null,s=!1,o=!1,a,u,l,c,f;for(e.values?Yt(e.values)||h1(e.format)?(i.push(gM(t,e)),i.push(r=cu())):i.push(r=cu({$ingest:e.values,$format:e.format})):e.url?h1(e.url)||h1(e.format)?(i.push(gM(t,e)),i.push(r=cu())):i.push(r=cu({$request:e.url,$format:e.format})):e.source&&(r=a=oe(e.source).map(d=>Ee(t.getData(d).output)),i.push(null)),u=0,l=n.length;ue===na||e===Er,w1=(e,t,n)=>Yt(e)?ife(e.signal,t,n):e===tc||e===Er?t:n,nn=(e,t,n)=>Yt(e)?tfe(e.signal,t,n):mM(e)?t:n,Cr=(e,t,n)=>Yt(e)?nfe(e.signal,t,n):mM(e)?n:t,yM=(e,t,n)=>Yt(e)?rfe(e.signal,t,n):e===Er?{value:t}:{value:n},efe=(e,t,n)=>Yt(e)?sfe(e.signal,t,n):e===nc?{value:t}:{value:n},tfe=(e,t,n)=>bM(`${e} === '${Er}' || ${e} === '${na}'`,t,n),nfe=(e,t,n)=>bM(`${e} !== '${Er}' && ${e} !== '${na}'`,t,n),ife=(e,t,n)=>Hx(`${e} === '${tc}' || ${e} === '${Er}'`,t,n),rfe=(e,t,n)=>Hx(`${e} === '${Er}'`,t,n),sfe=(e,t,n)=>Hx(`${e} === '${nc}'`,t,n),bM=(e,t,n)=>(t=t!=null?tn(t):t,n=n!=null?tn(n):n,vM(t)&&vM(n)?(t=t?t.signal||Q(t.value):null,n=n?n.signal||Q(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[Le({test:e},t)].concat(n||[])),vM=e=>e==null||Object.keys(e).length===1,Hx=(e,t,n)=>({signal:`${e} ? (${rc(t)}) : (${rc(n)})`}),ofe=(e,t,n,i,r)=>({signal:(i!=null?`${e} === '${tc}' ? (${rc(i)}) : `:"")+(n!=null?`${e} === '${na}' ? (${rc(n)}) : `:"")+(r!=null?`${e} === '${nc}' ? (${rc(r)}) : `:"")+(t!=null?`${e} === '${Er}' ? (${rc(t)}) : `:"")+"(null)"}),rc=e=>Yt(e)?e.signal:e==null?null:Q(e),afe=(e,t)=>t===0?0:Yt(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},sc=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function oc(e,t,n,i){let r;if(t&&ue(t,e))return t[e];if(ue(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=e[5].toLowerCase()+e.slice(6)}return i[Ox][r]}else if(e.startsWith("label")){switch(e){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=e[5].toLowerCase()+e.slice(6)}return i[Bd][r]}return null}function xM(e){const t={};for(const n of e)if(n)for(const i in n)t[i]=1;return Object.keys(t)}function ufe(e,t){var n=t.config,i=n.style,r=n.axis,s=t.scaleType(e.scale)==="band"&&n.axisBand,o=e.orient,a,u,l;if(Yt(o)){const f=xM([n.axisX,n.axisY]),d=xM([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(l of f)a[l]=nn(o,oc(l,n.axisX,r,i),oc(l,n.axisY,r,i));u={};for(l of d)u[l]=ofe(o.signal,oc(l,n.axisTop,r,i),oc(l,n.axisBottom,r,i),oc(l,n.axisLeft,r,i),oc(l,n.axisRight,r,i))}else a=o===Er||o===na?n.axisX:n.axisY,u=n["axis"+o[0].toUpperCase()+o.slice(1)];return a||u||s?Le({},r,a,u,s):r}function lfe(e,t,n,i){const r=di(e,t),s=e.orient;let o,a;const u={enter:o={opacity:Ye},update:a={opacity:Qi},exit:{opacity:Ye}};pn(u,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const l=_M(e,0),c=_M(e,1);return o.x=a.x=nn(s,l,Ye),o.x2=a.x2=nn(s,c),o.y=a.y=Cr(s,l,Ye),o.y2=a.y2=Cr(s,c),Ti({type:zx,role:Pue,from:i,encode:u},n)}function _M(e,t){return{scale:e.scale,range:t}}function cfe(e,t,n,i,r){const s=di(e,t),o=e.orient,a=e.gridScale,u=w1(o,1,-1),l=ffe(e.offset,u);let c,f,d;const h={enter:c={opacity:Ye},update:d={opacity:Qi},exit:f={opacity:Ye}};pn(h,{stroke:s("gridColor"),strokeCap:s("gridCap"),strokeDash:s("gridDash"),strokeDashOffset:s("gridDashOffset"),strokeOpacity:s("gridOpacity"),strokeWidth:s("gridWidth")});const p={scale:e.scale,field:Ji,band:r.band,extra:r.extra,offset:r.offset,round:s("tickRound")},g=nn(o,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:u,offset:l}:{value:0,offset:l},y=a?{scale:a,range:1,mult:u,offset:l}:Le(g,{mult:u,offset:l});return c.x=d.x=nn(o,p,m),c.y=d.y=Cr(o,p,m),c.x2=d.x2=Cr(o,y),c.y2=d.y2=nn(o,y),f.x=nn(o,p),f.y=Cr(o,p),Ti({type:zx,role:zue,key:Ji,from:i,encode:h},n)}function ffe(e,t){if(t!==1)if(!re(e))e=Yt(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=Le({},e);for(;n.mult!=null;)if(re(n.mult))n=n.mult=Le({},n.mult);else return n.mult=Yt(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function dfe(e,t,n,i,r,s){const o=di(e,t),a=e.orient,u=w1(a,-1,1);let l,c,f;const d={enter:l={opacity:Ye},update:f={opacity:Qi},exit:c={opacity:Ye}};pn(d,{stroke:o("tickColor"),strokeCap:o("tickCap"),strokeDash:o("tickDash"),strokeDashOffset:o("tickDashOffset"),strokeOpacity:o("tickOpacity"),strokeWidth:o("tickWidth")});const h=tn(r);h.mult=u;const p={scale:e.scale,field:Ji,band:s.band,extra:s.extra,offset:s.offset,round:o("tickRound")};return f.y=l.y=nn(a,Ye,p),f.y2=l.y2=nn(a,h),c.x=nn(a,p),f.x=l.x=Cr(a,Ye,p),f.x2=l.x2=Cr(a,h),c.y=Cr(a,p),Ti({type:zx,role:Uue,key:Ji,from:i,encode:d},n)}function Gx(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function hfe(e,t,n,i,r,s){const o=di(e,t),a=e.orient,u=e.scale,l=w1(a,-1,1),c=ou(o("labelFlush")),f=ou(o("labelFlushOffset")),d=o("labelAlign"),h=o("labelBaseline");let p=c===0||!!c,g;const m=tn(r);m.mult=l,m.offset=tn(o("labelPadding")||0),m.offset.mult=l;const y={scale:u,field:Ji,band:.5,offset:nM(s.offset,o("labelOffset"))},b=nn(a,p?Gx(u,c,'"left"','"right"','"center"'):{value:"center"},efe(a,"left","right")),v=nn(a,yM(a,"bottom","top"),p?Gx(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=Gx(u,c,`-(${f})`,f,0);p=p&&f;const _={opacity:Ye,x:nn(a,y,m),y:Cr(a,y,m)},E={enter:_,update:g={opacity:Qi,text:{field:Rx},x:_.x,y:_.y,align:b,baseline:v},exit:{opacity:Ye,x:_.x,y:_.y}};pn(E,{dx:!d&&p?nn(a,x):null,dy:!h&&p?Cr(a,x):null}),pn(E,{angle:o("labelAngle"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontWeight:o("labelFontWeight"),fontStyle:o("labelFontStyle"),limit:o("labelLimit"),lineHeight:o("labelLineHeight")},{align:d,baseline:h});const w=o("labelBound");let C=o("labelOverlap");return C=C||w?{separation:o("labelSeparation"),method:C,order:"datum.index",bound:w?{scale:u,orient:a,tolerance:w}:null}:void 0,g.align!==b&&(g.align=sc(g.align,b)),g.baseline!==v&&(g.baseline=sc(g.baseline,v)),Ti({type:uu,role:Bue,style:Bd,key:Ji,from:i,encode:E,overlap:C},n)}function pfe(e,t,n,i){const r=di(e,t),s=e.orient,o=w1(s,-1,1);let a,u;const l={enter:a={opacity:Ye,anchor:tn(r("titleAnchor",null)),align:{signal:Bx}},update:u=Le({},a,{opacity:Qi,text:tn(e.title)}),exit:{opacity:Ye}},c={signal:`lerp(range("${e.scale}"), ${b1(0,1,.5)})`};return u.x=nn(s,c),u.y=Cr(s,c),a.angle=nn(s,Ye,afe(o,90)),a.baseline=nn(s,yM(s,na,Er),{value:na}),u.angle=a.angle,u.baseline=a.baseline,pn(l,{fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),angle:r("titleAngle"),baseline:r("titleBaseline")}),gfe(r,s,l,n),l.update.align=sc(l.update.align,a.align),l.update.angle=sc(l.update.angle,a.angle),l.update.baseline=sc(l.update.baseline,a.baseline),Ti({type:uu,role:jue,style:Ox,from:i,encode:l},n)}function gfe(e,t,n,i){const r=(a,u)=>a!=null?(n.update[u]=sc(tn(a),n.update[u]),!1):!ec(u,i),s=r(e("titleX"),"x"),o=r(e("titleY"),"y");n.enter.auto=o===s?tn(o):nn(t,tn(o),tn(s))}function mfe(e,t){const n=ufe(e,t),i=e.encode||{},r=i.axis||{},s=r.name||void 0,o=r.interactive,a=r.style,u=di(e,n),l=dce(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:e.title!=null},f=Ee(t.add(wr({},[c]))),d=Ee(t.add(Ele({scale:t.scaleRef(e.scale),extra:t.property(l.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return c.grid&&h.push(cfe(e,n,i.grid,d,l)),c.ticks&&(p=u("tickSize"),h.push(dfe(e,n,i.ticks,d,p,l))),c.labels&&(p=c.ticks?p:0,h.push(hfe(e,n,i.labels,d,p,l))),c.domain&&h.push(lfe(e,n,i.domain,f)),c.title&&h.push(pfe(e,n,i.title,f)),_1(jd({role:Iue,from:f,encode:Ql(yfe(u,e),r,Ud),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:s,interactive:o,style:a}),t)}function yfe(e,t){const n={enter:{},update:{}};return pn(n,{orient:e("orient"),offset:e("offset")||0,position:_r(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function wM(e,t,n){const i=oe(e.signals),r=oe(e.scales);return n||i.forEach(s=>PT(s,t)),oe(e.projections).forEach(s=>tce(s,t)),r.forEach(s=>qle(s,t)),oe(e.data).forEach(s=>Jce(s,t)),r.forEach(s=>Wle(s,t)),(n||i).forEach(s=>wle(s,t)),oe(e.axes).forEach(s=>mfe(s,t)),oe(e.marks).forEach(s=>_1(s,t)),oe(e.legends).forEach(s=>Bce(s,t)),e.title&&Vce(e.title,t),t.parseLambdas(),t}const bfe=e=>Ql({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function vfe(e,t){const n=t.config,i=Ee(t.root=t.add(f1())),r=xfe(e,n);r.forEach(l=>PT(l,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const s=t.add(wr()),o=t.add(WT(LT(bfe(e.encode),y1,Cx,e.style,t,{pulse:Ee(s)}))),a=t.add(VT({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:Ee(o)}));t.operators.pop(),t.pushState(Ee(o),Ee(a),null),wM(e,t,r),t.operators.push(a);let u=t.add(jT({mark:i,pulse:Ee(a)}));return u=t.add(GT({pulse:Ee(u)})),u=t.add(au({pulse:Ee(u)})),t.addData("root",new lu(t,s,s,u)),t}function Wd(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function xfe(e,t){const n=o=>_r(e[o],t[o]),i=[Wd("background",n("background")),Wd("autosize",Rue(n("autosize"))),Wd("padding",Lue(n("padding"))),Wd("width",n("width")||0),Wd("height",n("height")||0)],r=i.reduce((o,a)=>(o[a.name]=a,o),{}),s={};return oe(e.signals).forEach(o=>{ue(r,o.name)?o=Le(r[o.name],o):i.push(o),s[o.name]=o}),oe(t.signals).forEach(o=>{!ue(s,o.name)&&!ue(r,o.name)&&i.push(o)}),i}function EM(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function CM(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}EM.prototype=CM.prototype={parse(e){return wM(e,this)},fork(){return new CM(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach(t=>{t.$ref=e.id}),e.refs=null),e},proxy(e){const t=e instanceof $x?Ee(e):e;return this.add(Ile({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;this.root&&(this.root.root=!0);for(e in this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(i,r,s){let o,a;i&&(o=i.data||(i.data={}),a=o[r]||(o[r]=[]),a.push(s))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const i in t.index)n(t.index[i],e,"index:"+i)}return this},pushState(e,t,n){this._encode.push(Ee(this.add(au({pulse:e})))),this._parent.push(t),this._lookup.push(n?Ee(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return Ge(this._parent)},encode(){return Ge(this._encode)},lookup(){return Ge(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(se(e))return Pd(e,t);e.signal||q("Unsupported field reference: "+Q(e));const n=e.signal;let i=this.field[n];if(!i){const r={name:this.signalRef(n)};t&&(r.as=t),this.field[n]=i=Ee(this.add($le(r)))}return i},compareRef(e){let t=!1;const n=s=>Yt(s)?(t=!0,this.signalRef(s.signal)):dle(s)?(t=!0,this.exprRef(s.expr)):s,i=oe(e.field).map(n),r=oe(e.order).map(n);return t?Ee(this.add(qT({fields:i,orders:r}))):zT(i,r)},keyRef(e,t){let n=!1;const i=s=>Yt(s)?(n=!0,Ee(r[s.signal])):s,r=this.signals;return e=oe(e).map(i),n?Ee(this.add(Sle({fields:e,flat:t}))):ule(e,t)},sortRef(e){if(!e)return e;const t=d1(e.op,e.field),n=e.order||lle;return n.signal?Ee(this.add(qT({fields:t,orders:this.signalRef(n.signal)}))):zT(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:e,type:t}),this.events[n]=i}return this.events[n]},hasOwnSignal(e){return ue(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&q("Duplicate signal name: "+Q(e));const n=t instanceof $x?t:this.add(f1(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||q("Unrecognized signal name: "+Q(e)),this.signals[e]},signalRef(e){return this.signals[e]?Ee(this.signals[e]):(ue(this.lambdas,e)||(this.lambdas[e]=this.add(f1(null))),Ee(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t0?",":"")+(re(r)?r.signal||Vx(r):Q(r))}return n+"]"}function wfe(e){let t="{",n=0,i,r;for(i in e)r=e[i],t+=(++n>1?",":"")+Q(i)+":"+(re(r)?r.signal||Vx(r):Q(r));return t+"}"}function Efe(){const e="sans-serif",i="#4c78a8",r="#000",s="#888",o="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:i},area:{fill:i},image:null,line:{stroke:i,strokeWidth:2},path:{stroke:i},rect:{fill:i},rule:{stroke:r},shape:{stroke:i},symbol:{fill:i,size:64},text:{fill:r,font:e,fontSize:11},trail:{fill:i,size:2},style:{"guide-label":{fill:r,font:e,fontSize:10},"guide-title":{fill:r,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:r,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:r,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:o},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:s,grid:!1,gridWidth:1,gridColor:o,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:s,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:o,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:s,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function Cfe(e,t,n){return re(e)||q("Input Vega specification must be an object."),t=nl(Efe(),t,e.config),vfe(e,new EM(t,n)).toRuntime()}var kfe="5.33.0";Le(xl,$V,iQ,SQ,hte,ane,Rie,hie,Lie,ore,mre,Ere);const Afe=Object.freeze(Object.defineProperty({__proto__:null,Bounds:Ut,CanvasHandler:Hf,CanvasRenderer:Rp,DATE:oi,DAY:$n,DAYOFYEAR:Gr,Dataflow:vl,Debug:N4,Error:v2,EventStream:_0,Gradient:Pk,GroupItem:cp,HOURS:Ci,Handler:R3,HybridHandler:QA,HybridRenderer:G3,Info:M4,Item:lp,MILLISECONDS:cr,MINUTES:ki,MONTH:An,Marks:$i,MultiPulse:gy,None:T4,Operator:xt,Parameters:x0,Pulse:Fo,QUARTER:si,RenderType:Go,Renderer:qf,ResourceLoader:Xk,SECONDS:qi,SVGHandler:RA,SVGRenderer:H3,SVGStringRenderer:JA,Scenegraph:wA,TIME_UNITS:G2,Transform:P,View:_T,WEEK:Wt,Warn:x2,YEAR:cn,accessor:ii,accessorFields:wn,accessorName:Tt,array:oe,ascending:rl,bandwidthNRD:vy,bin:HE,bootstrapCI:GE,boundClip:l$,boundContext:Lf,boundItem:M3,boundMark:bA,boundStroke:Bs,changeset:Ao,clampRange:H4,codegenExpression:TD,compare:k2,constant:kn,cumulativeLogNormal:ky,cumulativeNormal:k0,cumulativeUniform:Fy,dayofyear:T8,debounce:A2,defaultLocale:uy,definition:jE,densityLogNormal:Cy,densityNormal:xy,densityUniform:Sy,domChild:Gt,domClear:Vi,domCreate:Wo,domFind:N3,dotbin:VE,error:q,expressionFunction:Pt,extend:Le,extent:qr,extentIndex:G4,falsy:vo,fastmap:sl,field:Bi,flush:V4,font:Ep,fontFamily:Uf,fontSize:ns,format:h0,formatLocale:f0,formats:dy,hasOwnProperty:ue,id:Vc,identity:En,inferType:CE,inferTypes:kE,ingest:nt,inherits:te,inrange:ol,interpolate:Qb,interpolateColors:rp,interpolateRange:_k,intersect:s$,intersectBoxLine:Rl,intersectPath:y3,intersectPoint:b3,intersectRule:iA,isArray:W,isBoolean:xo,isDate:_o,isFunction:Oe,isIterable:Y4,isNumber:Ze,isObject:re,isRegExp:$2,isString:se,isTuple:y0,key:S2,lerp:X4,lineHeight:jo,loader:p0,locale:_E,logger:_2,lruCache:K4,markup:W3,merge:Z4,mergeConfig:nl,multiLineOffset:F3,one:tl,pad:J4,panLinear:z4,panLog:B4,panPow:U4,panSymlog:j4,parse:Cfe,parseExpression:SD,parseSelector:ta,path:M0,pathCurves:s3,pathEqual:c$,pathParse:Tl,pathRectangle:Hk,pathRender:Tf,pathSymbols:Wk,pathTrail:Gk,peek:Ge,point:kp,projection:qv,quantileLogNormal:Ay,quantileNormal:A0,quantileUniform:Dy,quantiles:yy,quantizeInterpolator:wk,quarter:q4,quartiles:by,get random(){return Wi},randomInteger:TG,randomKDE:wy,randomLCG:DG,randomLogNormal:XE,randomMixture:KE,randomNormal:_y,randomUniform:ZE,read:FE,regressionConstant:Ty,regressionExp:QE,regressionLinear:My,regressionLoess:r9,regressionLog:JE,regressionPoly:t9,regressionPow:e9,regressionQuad:Ny,renderModule:Pp,repeat:Yc,resetDefaultLocale:$H,resetSVGClipId:Yk,resetSVGDefIds:_J,responseType:SE,runtimeContext:tT,sampleCurve:S0,sampleLogNormal:Ey,sampleNormal:C0,sampleUniform:$y,scale:Qe,sceneEqual:Y3,sceneFromJSON:xA,scenePickVisit:yp,sceneToJSON:vA,sceneVisit:pr,sceneZOrder:v3,scheme:e3,serializeXML:HA,setHybridRendererOptions:yJ,setRandom:SG,span:Xc,splitAccessPath:jr,stringValue:Q,textMetrics:Ai,timeBin:K8,timeFloor:P8,timeFormatLocale:df,timeInterval:gl,timeOffset:U8,timeSequence:W8,timeUnitSpecifier:D8,timeUnits:Y2,toBoolean:F2,toDate:D2,toNumber:Cn,toSet:lr,toString:T2,transform:qE,transforms:xl,truncate:Q4,truthy:Ui,tupleid:_e,typeParsers:ly,utcFloor:z8,utcInterval:ml,utcOffset:j8,utcSequence:H8,utcdayofyear:R8,utcquarter:W4,utcweek:O8,version:kfe,visitArray:wo,week:M8,writeConfig:il,zero:bo,zoomLinear:w2,zoomLog:E2,zoomPow:Zh,zoomSymlog:C2},Symbol.toStringTag,{value:"Module"}));function $fe(e,t,n){let i;t.x2&&(t.x?(n&&e.x>e.x2&&(i=e.x,e.x=e.x2,e.x2=i),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(i=e.y,e.y=e.y2,e.y2=i),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var Sfe={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},Ffe={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>ee<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},Dfe={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const Tfe=Array.prototype.slice,fu=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,Tfe.call(t,1))},Mfe=(e,t,n,i,r,s,o)=>new Date(e,t||0,n??1,i||0,r||0,s||0,o||0);var Nfe={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:Mfe,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return fu("join",arguments)},indexof:function(){return fu("indexOf",arguments)},lastindexof:function(){return fu("lastIndexOf",arguments)},slice:function(){return fu("slice",arguments)},reverse:e=>e.slice().reverse(),sort:e=>e.slice().sort(rl),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return fu("substring",arguments,String)},split:function(){return fu("split",arguments,String)},replace:function(){return fu("replace",arguments,String)},trim:e=>String(e).trim(),btoa:e=>btoa(e),atob:e=>atob(e),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const Rfe=["view","item","group","xy","x","y"],Yx=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&Yx.add(setImmediate);const Ofe={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:n==="datum"?e.datum:n==="event"?e.event:n==="item"?e.item:Sfe[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,i=e(t.object);n&&(e.memberDepth+=1);const r=e(t.property);if(n&&(e.memberDepth-=1),Yx.has(i[r])){console.error(`Prevented interpretation of member "${r}" which could lead to insecure code execution`);return}return i[r]},CallExpression:(e,t)=>{const n=t.arguments;let i=t.callee.name;return i.startsWith("_")&&(i=i.slice(1)),i==="if"?e(n[0])?e(n[1]):e(n[2]):(e.fn[i]||Nfe[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>Ffe[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>Dfe[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator==="&&"?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((n,i)=>{e.memberDepth+=1;const r=e(i.key);return e.memberDepth-=1,Yx.has(e(i.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):n[r]=e(i.value),n},{})};function Hd(e,t,n,i,r,s){const o=a=>Ofe[a.type](o,a);return o.memberDepth=0,o.fn=Object.create(t),o.params=n,o.datum=i,o.event=r,o.item=s,Rfe.forEach(a=>o.fn[a]=function(){return r.vega[a](...arguments)}),o(e)}var Lfe={operator(e,t){const n=t.ast,i=e.functions;return r=>Hd(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,s)=>Hd(n,i,s,r)},event(e,t){const n=t.ast,i=e.functions;return r=>Hd(n,i,void 0,void 0,r)},handler(e,t){const n=t.ast,i=e.functions;return(r,s)=>{const o=s.item&&s.item.datum;return Hd(n,i,r,o,s)}},encode(e,t){const{marktype:n,channels:i}=t,r=e.functions,s=n==="group"||n==="image"||n==="rect";return(o,a)=>{const u=o.datum;let l=0,c;for(const f in i)c=Hd(i[f].ast,r,a,u,void 0,o),o[f]!==c&&(o[f]=c,l=1);return n!=="rule"&&$fe(o,i,s),l}}};const Ife={version:"5.23.0"};function Xx(e){return X(e,"or")}function Kx(e){return X(e,"and")}function Zx(e){return X(e,"not")}function E1(e,t){if(Zx(e))E1(e.not,t);else if(Kx(e))for(const n of e.and)E1(n,t);else if(Xx(e))for(const n of e.or)E1(n,t);else t(e)}function ac(e,t){return Zx(e)?{not:ac(e.not,t)}:Kx(e)?{and:e.and.map(n=>ac(n,t))}:Xx(e)?{or:e.or.map(n=>ac(n,t))}:t(e)}const De=structuredClone;function kM(e){throw new Error(e)}function uc(e,t){const n={};for(const i of t)ue(e,i)&&(n[i]=e[i]);return n}function hi(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>pt(e)).join(",")})`};function He(e){if(Ze(e))return e;const t=se(e)?e:pt(e);if(t.length<250)return t;let n=0;for(let i=0;ia===0?o:`[${o}]`),s=r.map((o,a)=>r.slice(0,a+1).join(""));for(const o of s)t.add(o)}return t}function n_(e,t){return e===void 0||t===void 0?!0:e_(t_(e),t_(t))}function ht(e){return Y(e).length===0}const Y=Object.keys,gn=Object.values,ia=Object.entries;function Gd(e){return e===!0||e===!1}function At(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Vd(e,t){return Zx(e)?`!(${Vd(e.not,t)})`:Kx(e)?`(${e.and.map(n=>Vd(n,t)).join(") && (")})`:Xx(e)?`(${e.or.map(n=>Vd(n,t)).join(") || (")})`:t(e)}function C1(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&C1(e[n],t)&&delete e[n],ht(e)}function Yd(e){return e.charAt(0).toUpperCase()+e.substr(1)}function i_(e,t="datum"){const n=jr(e),i=[];for(let r=1;r<=n.length;r++){const s=`[${n.slice(0,r).map(Q).join("][")}]`;i.push(`${t}${s}`)}return i.join(" && ")}function SM(e,t="datum"){return`${t}[${Q(jr(e).join("."))}]`}function at(e){return`datum['${e.replaceAll("'","\\'")}']`}function Bfe(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function er(e){return`${jr(e).map(Bfe).join("\\.")}`}function du(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function cc(e){return`${jr(e).join(".")}`}function fc(e){return e?jr(e).length:0}function zt(...e){return e.find(t=>t!==void 0)}let FM=42;function DM(e){const t=++FM;return e?String(e)+t:t}function Ufe(){FM=42}function TM(e){return MM(e)?e:`__${e}`}function MM(e){return e.startsWith("__")}function Xd(e){if(e!==void 0)return(e%360+360)%360}function k1(e){return Ze(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const NM=Object.getPrototypeOf(structuredClone({}));function Mi(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor.name!==t.constructor.name)return!1;let n,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!Mi(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const s of e.entries())if(!t.has(s[0]))return!1;for(const s of e.entries())if(!Mi(s[1],t.get(s[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e.entries())if(!t.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(e[i]!==t[i])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==NM.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==NM.toString)return e.toString()===t.toString();const r=Object.keys(e);if(n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!Mi(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function pt(e){const t=[];return function n(i){if(i&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?""+i:"null";if(typeof i!="object")return JSON.stringify(i);let r,s;if(Array.isArray(i)){for(s="[",r=0;rN1(e[t])?At(`_${t}_${ia(e[t])}`):At(`_${t}_${e[t]}`)).join("")}function _t(e){return e===!0||mu(e)&&!e.binned}function mn(e){return e==="binned"||mu(e)&&e.binned===!0}function mu(e){return re(e)}function N1(e){return X(e,"param")}function VM(e){switch(e){case Zs:case Js:case to:case pi:case hs:case ps:case ua:case no:case oa:case aa:case gi:return 6;case la:return 4;default:return 10}}function Qd(e){return X(e,"expr")}function yn(e,{level:t}={level:0}){const n=Y(e||{}),i={};for(const r of n)i[r]=t===0?Ni(e[r]):yn(e[r],{level:t-1});return i}function YM(e){const{anchor:t,frame:n,offset:i,orient:r,angle:s,limit:o,color:a,subtitleColor:u,subtitleFont:l,subtitleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=e,m={...g,...a?{fill:a}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...s!==void 0?{angle:s}:{},...o!==void 0?{limit:o}:{}},b={...u?{subtitleColor:u}:{},...l?{subtitleFont:l}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},v=uc(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:v,nonMarkTitleProperties:y,subtitle:b}}function da(e){return se(e)||W(e)&&se(e[0])}function me(e){return X(e,"signal")}function yu(e){return X(e,"step")}function dde(e){return W(e)?!1:X(e,"fields")&&!X(e,"data")}function hde(e){return W(e)?!1:X(e,"fields")&&X(e,"data")}function so(e){return W(e)?!1:X(e,"field")&&X(e,"data")}const pde=Y({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1}),gde={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},g_=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function XM(e){const t=W(e.condition)?e.condition.map(KM):KM(e.condition);return{...Ni(e),condition:t}}function Ni(e){if(Qd(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function KM(e){if(Qd(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Et(e){if(Qd(e)){const{expr:t,...n}=e;return{signal:t,...n}}return me(e)?e:e!==void 0?{value:e}:void 0}function mde(e){return me(e)?e.signal:Q(e)}function ZM(e){return me(e)?e.signal:Q(e.value)}function Dr(e){return me(e)?e.signal:e==null?null:Q(e)}function yde(e,t,n){for(const i of n){const r=ys(i,t.markDef,t.config);r!==void 0&&(e[i]=Et(r))}return e}function JM(e){return[].concat(e.type,e.style??[])}function gt(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:s}=i;return r&&X(t,r)?t[r]:t[e]!==void 0?t[e]:s&&(!r||r===e)?void 0:ys(e,t,n,i)}function ys(e,t,n,{vgChannel:i}={}){const r=m_(e,t,n.style);return zt(i?r:void 0,r,i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function m_(e,t,n){return QM(e,JM(t),n)}function QM(e,t,n){t=oe(t);let i;for(const r of t){const s=n[r];X(s,e)&&(i=s[e])}return i}function eN(e,t){return oe(e).reduce((n,i)=>(n.field.push(ne(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function tN(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(Mi(r,i))return;n.push(i)}),n}function nN(e,t){return Mi(e,t)||!t?e:e?[...oe(e),...oe(t)].join(", "):t}function iN(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((da(n)||me(n))&&(da(i)||me(i)))return{explicit:e.explicit,value:nN(n,i)};if(da(n)||me(n))return{explicit:e.explicit,value:n};if(da(i)||me(i))return{explicit:e.explicit,value:i};if(!da(n)&&!me(n)&&!da(i)&&!me(i))return{explicit:e.explicit,value:tN(n,i)};throw new Error("It should never reach here")}function y_(e){return`Invalid specification ${pt(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const bde='Autosize "fit" only works for single views and layered views.';function rN(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function sN(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function oN(e){return e?`Dropping "fit-${e}" because spec has discrete ${mi(e)}.`:'Dropping "fit" because spec has discrete size.'}function b_(e){return`Unknown field for ${e}. Cannot calculate view size.`}function aN(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function vde(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function xde(e){return`The "nearest" transform is not supported for ${e} marks.`}function uN(e){return`Selection not supported for ${e} yet.`}function _de(e){return`Cannot find a selection named "${e}".`}const wde="Scale bindings are currently only supported for scales with unbinned, continuous domains.",Ede="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",Cde="Legend bindings are only supported for selections over an individual field or encoding channel.";function kde(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function Ade(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const $de="The same selection must be used to override scale domains in a layered view.",Sde='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function Fde(e){return`Unknown repeated value "${e}".`}function lN(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const Dde="Multiple timer selections in one unit spec are not supported. Ignoring all but the first.",v_="Animation involving facet, layer, or concat is currently unsupported.";function Tde(e){return`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${Q(e)}.`}function Mde(e,t,n,i){return(e.length?"Multiple ":"No ")+`matching ${Q(t)} encoding found for selection ${Q(n.param)}. Using "field": ${Q(i)}.`}const Nde="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function Rde(e){return`Unrecognized parse "${e}".`}function cN(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const Ode="Attempt to add the same child twice.";function Lde(e){return`Ignoring an invalid transform: ${pt(e)}.`}const Ide='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function fN(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function Pde(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${pt(t)} is overridden by a child projection ${pt(n)}.`}const zde="Arc marks uses theta channel rather than angle, replacing angle with theta.";function Bde(e){return`${e}Offset dropped because ${e} is continuous`}function Ude(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${pt(n)}}.`}function dN(e){return`Invalid field type "${e}".`}function jde(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function qde(e){return`Invalid aggregation operator "${e}".`}function hN(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function Wde(e){return`Position range does not support relative band size for ${e}.`}function x_(e,t){return`Dropping ${pt(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const Hde="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function R1(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function Gde(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function Vde(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function Yde(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function Xde(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function __(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function Kde(e){return`The ${e} for range marks cannot be an expression`}function Zde(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function Jde(e,t){return`Specified orient "${e}" overridden with "${t}".`}function Qde(e){return`Cannot use the scale property "${e}" with non-color channel.`}function ehe(e){return`Cannot use the relative band size with ${e} scale.`}function the(e){return`Using unaggregated domain with raw field has no effect (${pt(e)}).`}function nhe(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function ihe(e){return`Unaggregated domain is currently unsupported for log scale (${pt(e)}).`}function rhe(e){return`Cannot apply size to non-oriented mark "${e}".`}function she(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function ohe(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function pN(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function gN(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function ahe(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${pt(n)} and ${pt(i)}). Using ${pt(n)}.`}function uhe(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${pt(n)} and ${pt(i)}). Using the union of the two domains.`}function lhe(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function che(e){return`Dropping sort property ${pt(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const mN="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",fhe="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",dhe="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",hhe="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function phe(e){return`Cannot stack "${e}" if there is already "${e}2".`}function ghe(e){return`Stack is applied to a non-linear scale (${e}).`}function mhe(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function O1(e,t){return`Invalid ${e}: ${pt(t)}.`}function yhe(e){return`Dropping day from datetime ${pt(e)} as day cannot be combined with other units.`}function bhe(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function vhe(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function xhe(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function yN(e){return`1D error band does not support ${e}.`}function bN(e){return`Channel ${e} is required for "binned" bin.`}function _he(e){return`Channel ${e} should not be used with "binned" bin.`}function whe(e){return`Domain for ${e} is required for threshold scale.`}const vN=_2(x2);let bu=vN;function Ehe(e){return bu=e,bu}function Che(){return bu=vN,bu}function w_(...e){bu.error(...e)}function Z(...e){bu.warn(...e)}function khe(...e){bu.debug(...e)}function vu(e){if(e&&re(e)){for(const t of C_)if(X(e,t))return!0}return!1}const xN=["january","february","march","april","may","june","july","august","september","october","november","december"],Ahe=xN.map(e=>e.substr(0,3)),_N=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],$he=_N.map(e=>e.substr(0,3));function She(e){if(k1(e)&&(e=+e),Ze(e))return e>4&&Z(O1("quarter",e)),e-1;throw new Error(O1("quarter",e))}function Fhe(e){if(k1(e)&&(e=+e),Ze(e))return e-1;{const t=e.toLowerCase(),n=xN.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=Ahe.indexOf(i);if(r!==-1)return r;throw new Error(O1("month",e))}}function Dhe(e){if(k1(e)&&(e=+e),Ze(e))return e%7;{const t=e.toLowerCase(),n=_N.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=$he.indexOf(i);if(r!==-1)return r;throw new Error(O1("day",e))}}function E_(e,t){const n=[];if(t&&e.day!==void 0&&Y(e).length>1&&(Z(yhe(e)),e=De(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?Fhe(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?She(e.quarter):e.quarter;n.push(Ze(i)?i*3:`${i}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const i=t?Dhe(e.day):e.day;n.push(Ze(i)?i+1:`${i}+1`)}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const r=e[i];n.push(typeof r>"u"?0:r)}return n}function xu(e){const n=E_(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function The(e){const n=E_(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function Mhe(e){const t=E_(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const wN={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},C_=Y(wN);function Nhe(e){return ue(wN,e)}function _u(e){return re(e)?e.binned:EN(e)}function EN(e){return e&&e.startsWith("binned")}function k_(e){return e.startsWith("utc")}function Rhe(e){return e.substring(3)}const Ohe={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function L1(e){return C_.filter(t=>kN(e,t))}function CN(e){const t=L1(e);return t[t.length-1]}function kN(e,t){const n=e.indexOf(t);return!(n<0||n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o"||n>0&&t==="year"&&e.charAt(n-1)==="f")}function Lhe(e,t,{end:n}={end:!1}){const i=i_(t),r=k_(e)?"utc":"";function s(u){return u==="quarter"?`(${r}quarter(${i})-1)`:`${r}${u}(${i})`}let o;const a={};for(const u of C_)kN(e,u)&&(a[u]=s(u),o=u);return n&&(a[o]+="+1"),The(a)}function AN(e){if(!e)return;const t=L1(e);return`timeUnitSpecifier(${pt(t)}, ${pt(Ohe)})`}function Ihe(e,t,n){if(!e)return;const i=AN(e);return`${n||k_(e)?"utc":"time"}Format(${t}, ${i})`}function sn(e){if(!e)return;let t;return se(e)?EN(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:re(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),k_(t.unit)&&(t.utc=!0,t.unit=Rhe(t.unit)),t}function Phe(e){const{utc:t,...n}=sn(e);return n.unit?(t?"utc":"")+Y(n).map(i=>At(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):(t?"utc":"")+"timeunit"+Y(n).map(i=>At(`_${i}_${n[i]}`)).join("")}function $N(e,t=n=>n){const n=sn(e),i=CN(n.unit);if(i&&i!=="day"){const r={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:s,part:o}=SN(i,n.step),a={...r,[o]:+r[o]+s};return`${t(xu(a))} - ${t(xu(r))}`}}const zhe={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function Bhe(e){return ue(zhe,e)}function SN(e,t=1){if(Bhe(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function Uhe(e){return X(e,"param")}function A_(e){return!!(e!=null&&e.field)&&e.equal!==void 0}function $_(e){return!!(e!=null&&e.field)&&e.lt!==void 0}function S_(e){return!!(e!=null&&e.field)&&e.lte!==void 0}function F_(e){return!!(e!=null&&e.field)&&e.gt!==void 0}function D_(e){return!!(e!=null&&e.field)&&e.gte!==void 0}function T_(e){if(e!=null&&e.field){if(W(e.range)&&e.range.length===2)return!0;if(me(e.range))return!0}return!1}function M_(e){return!!(e!=null&&e.field)&&(W(e.oneOf)||W(e.in))}function jhe(e){return!!(e!=null&&e.field)&&e.valid!==void 0}function FN(e){return M_(e)||A_(e)||T_(e)||$_(e)||F_(e)||S_(e)||D_(e)}function bs(e,t){return J1(e,{timeUnit:t,wrapTime:!0})}function qhe(e,t){return e.map(n=>bs(n,t))}function DN(e,t=!0){const{field:n}=e,i=sn(e.timeUnit),{unit:r,binned:s}=i||{},o=ne(e,{expr:"datum"}),a=r?`time(${s?o:Lhe(r,n)})`:o;if(A_(e))return`${a}===${bs(e.equal,r)}`;if($_(e)){const u=e.lt;return`${a}<${bs(u,r)}`}else if(F_(e)){const u=e.gt;return`${a}>${bs(u,r)}`}else if(S_(e)){const u=e.lte;return`${a}<=${bs(u,r)}`}else if(D_(e)){const u=e.gte;return`${a}>=${bs(u,r)}`}else{if(M_(e))return`indexof([${qhe(e.oneOf,r).join(",")}], ${a}) !== -1`;if(jhe(e))return I1(a,e.valid);if(T_(e)){const{range:u}=yn(e),l=me(u)?{signal:`${u.signal}[0]`}:u[0],c=me(u)?{signal:`${u.signal}[1]`}:u[1];if(l!==null&&c!==null&&t)return"inrange("+a+", ["+bs(l,r)+", "+bs(c,r)+"])";const f=[];return l!==null&&f.push(`${a} >= ${bs(l,r)}`),c!==null&&f.push(`${a} <= ${bs(c,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${pt(e)}`)}function I1(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Whe(e){return FN(e)&&e.timeUnit?{...e,timeUnit:sn(e.timeUnit)}:e}const eh={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function Hhe(e){return e==="quantitative"||e==="temporal"}function TN(e){return e==="ordinal"||e==="nominal"}const wu=eh.quantitative,N_=eh.ordinal,gc=eh.temporal,R_=eh.nominal,mc=eh.geojson;function Ghe(e){if(e)switch(e=e.toLowerCase(),e){case"q":case wu:return"quantitative";case"t":case gc:return"temporal";case"o":case N_:return"ordinal";case"n":case R_:return"nominal";case mc:return"geojson"}}const bn={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",TIME:"time",UTC:"utc",POINT:"point",BAND:"band"},O_={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function Vhe(e,t){const n=O_[e],i=O_[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const Yhe={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function MN(e){return Yhe[e]}const NN=new Set(["linear","log","pow","sqrt","symlog"]),RN=new Set([...NN,"time","utc"]);function ON(e){return NN.has(e)}const LN=new Set(["quantile","quantize","threshold"]),Xhe=new Set([...RN,...LN,"sequential","identity"]),Khe=new Set(["ordinal","bin-ordinal","point","band"]);function on(e){return Khe.has(e)}function Tr(e){return Xhe.has(e)}function vs(e){return RN.has(e)}function yc(e){return LN.has(e)}const Zhe={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0,framesPerSecond:2,animationDuration:5};function Jhe(e){return!se(e)&&X(e,"name")}function IN(e){return X(e,"param")}function Qhe(e){return X(e,"unionWith")}function e0e(e){return re(e)&&"field"in e}const t0e={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:i_e,domain:r_e,range:s_e,rangeMax:o_e,rangeMin:a_e,scheme:u_e,...n0e}=t0e,i0e=Y(n0e);function L_(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return vs(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return vs(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return vs(e);case"nice":return vs(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return Tr(e)&&!qe(["log","time","utc","threshold","quantile"],e)}}function PN(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return pc(e)?void 0:Qde(t);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function r0e(e,t){return qe([N_,R_],t)?e===void 0||on(e):t===gc?qe([bn.TIME,bn.UTC,void 0],e):t===wu?ON(e)||yc(e)||e===void 0:!0}function s0e(e,t,n=!1){if(!ms(e))return!1;switch(e){case $t:case rn:case ra:case dc:case tr:case Ar:return vs(t)||t==="band"?!0:t==="point"?!n:!1;case sa:return qe(["linear","band"],t);case to:case ua:case no:case oa:case aa:case hu:return vs(t)||yc(t)||qe(["band","point","ordinal"],t);case pi:case hs:case ps:return t!=="band";case la:case gi:return t==="ordinal"||yc(t)}}function o0e(e){return re(e)&&"value"in e}const Qn={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},zN=Qn.arc,P1=Qn.area,z1=Qn.bar,a0e=Qn.image,B1=Qn.line,U1=Qn.point,u0e=Qn.rect,j1=Qn.rule,BN=Qn.text,I_=Qn.tick,l0e=Qn.trail,P_=Qn.circle,z_=Qn.square,UN=Qn.geoshape;function ha(e){return["line","area","trail"].includes(e)}function th(e){return["rect","bar","image","arc","tick"].includes(e)}const c0e=new Set(Y(Qn));function xs(e){return X(e,"type")}const f0e=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],d0e=["fill","fillOpacity"],h0e=[...f0e,...d0e],jN=Y({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1}),B_=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],p0e={area:["line","point"],bar:B_,rect:B_,line:["point"],tick:["bandSize","thickness",...B_]},g0e={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},qN=Y({mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1});function Eu(e){return X(e,"band")}const m0e={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},U_={binSpacing:0,continuousBandSize:5,minBandSize:.25,timeUnitBandPosition:.5},y0e={...U_,binSpacing:1},b0e={...U_,thickness:1};function v0e(e){return xs(e)?e.type:e}function WN(e,{isPath:t}){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function j_({markDef:e,config:t,scaleChannel:n,scaleType:i,isCountAggregate:r}){var a,u;if(!i||!Tr(i)||r)return"always-valid";const s=WN(gt("invalid",e,t),{isPath:ha(e.type)});return((u=(a=t.scale)==null?void 0:a.invalid)==null?void 0:u[n])!==void 0?"show":s}function x0e(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function HN({scaleName:e,scale:t,mode:n}){const i=`domain('${e}')`;if(!t||!e)return;const r=`${i}[0]`,s=`peek(${i})`,o=t.domainHasZero();return o==="definitely"?{scale:e,value:0}:o==="maybe"?{signal:`scale('${e}', inrange(0, ${i}) ? 0 : ${n==="zeroOrMin"?r:s})`}:{signal:`scale('${e}', ${n==="zeroOrMin"?r:s})`}}function GN({scaleChannel:e,channelDef:t,scale:n,scaleName:i,markDef:r,config:s}){var c;const o=n==null?void 0:n.get("type"),a=Rr(t),u=M1(a==null?void 0:a.aggregate),l=j_({scaleChannel:e,markDef:r,config:s,scaleType:o,isCountAggregate:u});if(a&&l==="show"){const f=((c=s.scale.invalid)==null?void 0:c[e])??"zero-or-min";return{test:I1(ne(a,{expr:"datum"}),!1),..._0e(f,n,i)}}}function _0e(e,t,n){if(o0e(e)){const{value:i}=e;return me(i)?{signal:i.signal}:{value:i}}return HN({scale:t,scaleName:n,mode:"zeroOrMin"})}function q_(e){const{channel:t,channelDef:n,markDef:i,scale:r,scaleName:s,config:o}=e,a=gu(t),u=W_(e),l=GN({scaleChannel:a,channelDef:n,scale:r,scaleName:s,markDef:i,config:o});return l!==void 0?[l,u]:u}function w0e(e){const{datum:t}=e;return vu(t)?xu(t):`${pt(t)}`}function Cu(e,t,n,i){const r={};if(t&&(r.scale=t),_s(e)){const{datum:s}=e;vu(s)?r.signal=xu(s):me(s)?r.signal=s.signal:Qd(s)?r.signal=s.expr:r.value=s}else r.field=ne(e,n);if(i){const{offset:s,band:o}=i;s&&(r.offset=s),o&&(r.band=o)}return r}function q1({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:s="end",bandPosition:o=.5}){const a=!me(o)&&0{switch(t.fieldTitle){case"plain":return e.field;case"functional":return I0e(e);default:return L0e(e,t)}};let lR=uR;function cR(e){lR=e}function P0e(){cR(uR)}function xc(e,t,{allowDisabling:n,includeDefault:i=!0}){var a;const r=(a=X_(e))==null?void 0:a.title;if(!J(e))return r??e.title;const s=e,o=i?K_(s,t):void 0;return n?zt(r,s.title,o):r??s.title??o}function X_(e){if(vc(e)&&e.axis)return e.axis;if(oR(e)&&e.legend)return e.legend;if(V_(e)&&e.header)return e.header}function K_(e,t){return lR(e,t)}function X1(e){if(aR(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=X_(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function z0e(e,t){var s;switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Y_(e)&&W(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!fa(n)&&!ro(n))return"quantitative";if(Au(e)&&((s=e.scale)!=null&&s.type))switch(O_[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function Rr(e){if(J(e))return e;if(G1(e))return e.condition}function Xt(e){if(Ne(e))return e;if(oh(e))return e.condition}function fR(e,t,n,i={}){if(se(e)||Ze(e)||xo(e)){const r=se(e)?"string":Ze(e)?"number":"boolean";return Z(Ude(t,r,e)),{value:e}}return Ne(e)?K1(e,t,n,i):oh(e)?{...e,condition:K1(e.condition,t,n,i)}:e}function K1(e,t,n,i){if(aR(e)){const{format:r,formatType:s,...o}=e;if(ku(s)&&!n.customFormatTypes)return Z(fN(t)),K1(o,t,n,i)}else{const r=vc(e)?"axis":oR(e)?"legend":V_(e)?"header":null;if(r&&e[r]){const{format:s,formatType:o,...a}=e[r];if(ku(o)&&!n.customFormatTypes)return Z(fN(t)),K1({...e,[r]:a},t,n,i)}}return J(e)?Z_(e,t,i):B0e(e)}function B0e(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=Ze(n)?"quantitative":se(n)?"nominal":vu(n)?"temporal":void 0,{...e,type:t}}function Z_(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:s,field:o}=e,a={...e};if(!n&&i&&!p_(i)&&!fa(i)&&!ro(i)&&(Z(qde(i)),delete a.aggregate),r&&(a.timeUnit=sn(r)),o&&(a.field=`${o}`),_t(s)&&(a.bin=Z1(s,t)),mn(s)&&!Bt(t)&&Z(_he(t)),ei(a)){const{type:u}=a,l=Ghe(u);u!==l&&(a.type=l),u!=="quantitative"&&M1(i)&&(Z(jde(u,i)),a.type="quantitative")}else if(!BM(t)){const u=z0e(a,t);a.type=u}if(ei(a)){const{compatible:u,warning:l}=U0e(a,t)||{};u===!1&&Z(l)}if(Y_(a)&&se(a.sort)){const{sort:u}=a;if(QN(u))return{...a,sort:{encoding:u}};const l=u.substring(1);if(u.charAt(0)==="-"&&QN(l))return{...a,sort:{encoding:l,order:"descending"}}}if(V_(a)){const{header:u}=a;if(u){const{orient:l,...c}=u;if(l)return{...a,header:{...c,labelOrient:u.labelOrient||l,titleOrient:u.titleOrient||l}}}}return a}function Z1(e,t){return xo(e)?{maxbins:VM(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:VM(t)}:e}const _c={compatible:!0};function U0e(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case Zs:case Js:case A1:return Y1(e)?_c:{compatible:!1,warning:Vde(t)};case $t:case rn:case ra:case dc:case pi:case hs:case ps:case Kd:case Zd:case $1:case pu:case S1:case F1:case hu:case tr:case Ar:case D1:return _c;case Sr:case nr:case $r:case Fr:return n!==wu?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:_c;case no:case oa:case aa:case ua:case to:case eo:case Qs:case kr:case ds:case sa:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:_c;case gi:case la:return!Y1(e)&&!R0e(e)?{compatible:!1,warning:Yde(t)}:_c;case hc:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:_c}}function wc(e){const{formatType:t}=X1(e);return t==="time"||!t&&j0e(e)}function j0e(e){return e&&(e.type==="temporal"||J(e)&&!!e.timeUnit)}function J1(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){var u;const s=t&&((u=sn(t))==null?void 0:u.unit);let o=s||n==="temporal",a;return Qd(e)?a=e.expr:me(e)?a=e.signal:vu(e)?(o=!0,a=xu(e)):(se(e)||Ze(e))&&o&&(a=`datetime(${pt(e)})`,Nhe(s)&&(Ze(e)&&e<1e4||se(e)&&isNaN(Date.parse(e)))&&(a=xu({[s]:e}))),a?i&&o?`time(${a})`:a:r?void 0:pt(e)}function dR(e,t){const{type:n}=e;return t.map(i=>{const r=J(e)&&!_u(e.timeUnit)?e.timeUnit:void 0,s=J1(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return s!==void 0?{signal:s}:i})}function ah(e,t){return _t(e.bin)?ms(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const hR={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function uh(e){return e==null?void 0:e.condition}const pR=["domain","grid","labels","ticks","title"],q0e={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},gR={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},W0e={...gR,style:1,labelExpr:1,encoding:1};function mR(e){return ue(W0e,e)}const yR=Y({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1});function ao(e){return X(e,"mark")}class Q1{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return ao(t)?v0e(t.mark)===this.name:!1}}function $u(e,t){const n=e&&e[t];return n?W(n)?lc(n,i=>!!i.field):J(n)||G1(n):!1}function bR(e,t){const n=e&&e[t];return n?W(n)?lc(n,i=>!!i.field):J(n)||_s(n)||oh(n):!1}function vR(e,t){if(Bt(t)){const n=e[t];if((J(n)||_s(n))&&(TN(n.type)||J(n)&&n.timeUnit)){const i=a_(t);return bR(e,i)}}return!1}function xR(e){return lc(Wfe,t=>{if($u(e,t)){const n=e[t];if(W(n))return lc(n,i=>!!i.aggregate);{const i=Rr(n);return i&&!!i.aggregate}}return!1})}function _R(e,t){const n=[],i=[],r=[],s=[],o={};return J_(e,(a,u)=>{if(J(a)){const{field:l,aggregate:c,bin:f,timeUnit:d,...h}=a;if(c||d||f){const p=X_(a),g=p==null?void 0:p.title;let m=ne(a,{forAs:!0});const y={...g?[]:{title:xc(a,t,{allowDisabling:!0})},...h,field:m};if(c){let b;if(fa(c)?(b="argmax",m=ne({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${l}`):ro(c)?(b="argmin",m=ne({op:"argmin",field:c.argmin},{forAs:!0}),y.field=`${m}.${l}`):c!=="boxplot"&&c!=="errorbar"&&c!=="errorband"&&(b=c),b){const v={op:b,as:m};l&&(v.field=l),s.push(v)}}else if(n.push(m),ei(a)&&_t(f)){if(i.push({bin:f,field:l,as:m}),n.push(ne(a,{binSuffix:"end"})),ah(a,u)&&n.push(ne(a,{binSuffix:"range"})),Bt(u)){const b={field:`${m}_end`};o[`${u}2`]=b}y.bin="binned",BM(u)||(y.type=wu)}else if(d&&!_u(d)){r.push({timeUnit:d,field:l,as:m});const b=ei(a)&&a.type!==gc&&"time";b&&(u===Kd||u===pu?y.formatType=b:tde(u)?y.legend={formatType:b,...y.legend}:Bt(u)&&(y.axis={formatType:b,...y.axis}))}o[u]=y}else n.push(l),o[u]=e[u]}else o[u]=e[u]}),{bins:i,timeUnits:r,aggregate:s,groupby:n,encoding:o}}function H0e(e,t,n){const i=ide(t,n);if(i){if(i==="binned"){const r=e[t===kr?$t:rn];return!!(J(r)&&J(e[t])&&mn(r.bin))}}else return!1;return!0}function G0e(e,t,n,i){const r={};for(const s of Y(e))zM(s)||Z(Gde(s));for(let s of Kfe){if(!e[s])continue;const o=e[s];if(Jd(s)){const a=Xfe(s),u=r[a];if(J(u)&&Hhe(u.type)&&J(o)&&!u.timeUnit){Z(Bde(a));continue}}if(s==="angle"&&t==="arc"&&!e.theta&&(Z(zde),s=tr),!H0e(e,s,t)){Z(R1(s,t));continue}if(s===to&&t==="line"){const a=Rr(e[s]);if(a!=null&&a.aggregate){Z(Hde);continue}}if(s===pi&&(n?"fill"in e:"stroke"in e)){Z(hN("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(s===Zd||s===hc&&!W(o)&&!Nr(o)||s===pu&&W(o)){if(o){if(s===hc){const a=e[s];if(rR(a)){r[s]=a;continue}}r[s]=oe(o).reduce((a,u)=>(J(u)?a.push(Z_(u,s)):Z(x_(u,s)),a),[])}}else{if(s===pu&&o===null)r[s]=null;else if(!J(o)&&!_s(o)&&!Nr(o)&&!sh(o)&&!me(o)){Z(x_(o,s));continue}r[s]=fR(o,s,i)}}return r}function em(e,t){const n={};for(const i of Y(e)){const r=fR(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function V0e(e){const t=[];for(const n of Y(e))if($u(e,n)){const i=e[n],r=oe(i);for(const s of r)J(s)?t.push(s):G1(s)&&t.push(s.condition)}return t}function J_(e,t,n){if(e)for(const i of Y(e)){const r=e[i];if(W(r))for(const s of r)t.call(n,s,i);else t.call(n,r,i)}}function Y0e(e,t,n,i){return e?Y(e).reduce((r,s)=>{const o=e[s];return W(o)?o.reduce((a,u)=>t.call(i,a,u,s),r):t.call(i,r,o,s)},n):n}function wR(e,t){return Y(t).reduce((n,i)=>{switch(i){case $t:case rn:case S1:case D1:case F1:case kr:case ds:case ra:case dc:case tr:case eo:case Ar:case Qs:case sa:case $r:case Sr:case Fr:case nr:case Kd:case gi:case hu:case pu:return n;case hc:if(e==="line"||e==="trail")return n;case Zd:case $1:{const r=t[i];if(W(r)||J(r))for(const s of oe(r))s.aggregate||n.push(ne(s,{}));return n}case to:if(e==="trail")return n;case pi:case hs:case ps:case no:case oa:case aa:case la:case ua:{const r=Rr(t[i]);return r&&!r.aggregate&&n.push(ne(r,{})),n}}},[])}function X0e(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(W(t)){for(const s of t)s.aggregate?(i||(i=[]),i.push(s)):(r||(r=[]),r.push(s));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return W(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function Q_(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};const r=e.map(({fieldPrefix:o,titlePrefix:a})=>{const u=i?` of ${ew(t)}`:"";return{field:o+t.field,type:t.type,title:me(a)?{signal:`${a}"${escape(u)}"`}:a+u}}),s=V0e(n).map(M0e);return{tooltip:[...r,...fs(s,He)]}}function ew(e){const{title:t,field:n}=e;return zt(t,n)}function tw(e,t,n,i,r){const{scale:s,axis:o}=n;return({partName:a,mark:u,positionPrefix:l,endPositionPrefix:c=void 0,extraEncoding:f={}})=>{const d=ew(n);return ER(e,a,r,{mark:u,encoding:{[t]:{field:`${l}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...s!==void 0?{scale:s}:{},...o!==void 0?{axis:o}:{}},...se(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...i,...f}})}}function ER(e,t,n,i){const{clip:r,color:s,opacity:o}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...s?{color:s}:{},...o?{opacity:o}:{},...xs(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(t)}`,...xo(e[t])?{}:e[t]}}]:[]}function CR(e,t,n){const{encoding:i}=e,r=t==="vertical"?"y":"x",s=i[r],o=i[`${r}2`],a=i[`${r}Error`],u=i[`${r}Error2`];return{continuousAxisChannelDef:tm(s,n),continuousAxisChannelDef2:tm(o,n),continuousAxisChannelDefError:tm(a,n),continuousAxisChannelDefError2:tm(u,n),continuousAxis:r}}function tm(e,t){if(e!=null&&e.aggregate){const{aggregate:n,...i}=e;return n!==t&&Z(xhe(n,t)),i}else return e}function kR(e,t){const{mark:n,encoding:i}=e,{x:r,y:s}=i;if(xs(n)&&n.orient)return n.orient;if(ga(r)){if(ga(s)){const o=J(r)&&r.aggregate,a=J(s)&&s.aggregate;if(!o&&a===t)return"vertical";if(!a&&o===t)return"horizontal";if(o===t&&a===t)throw new Error("Both x and y cannot have aggregate");return wc(s)&&!wc(r)?"horizontal":"vertical"}return"horizontal"}else{if(ga(s))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const nm="boxplot",K0e=["box","median","outliers","rule","ticks"],Z0e=new Q1(nm,$R);function AR(e){return Ze(e)?"tukey":e}function $R(e,{config:t}){e={...e,encoding:em(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:s,...o}=e,a=xs(n)?n:{type:n};r&&Z(uN("boxplot"));const u=a.extent??t.boxplot.extent,l=gt("size",a,t),c=a.invalid,f=AR(u),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:y,aggregate:b,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:_,customTooltipWithoutAggregatedField:E}=J0e(e,u,t),w=cc(g.field),{color:C,size:k,...S}=v,$=o2=>tw(a,m,g,o2,t.boxplot),O=$(S),R=$(v),D=(re(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",A=$({...S,...k?{size:k}:{},color:{condition:{test:`${at(`lower_box_${g.field}`)} >= ${at(`upper_box_${g.field}`)}`,...C||{value:D}}}}),T=Q_([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,v),B={type:"tick",color:"black",opacity:1,orient:x,invalid:c,aria:!1},G=f==="min-max"?T:Q_([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,v),z=[...O({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:G}),...O({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:G}),...O({partName:"ticks",mark:B,positionPrefix:"lower_whisker",extraEncoding:G}),...O({partName:"ticks",mark:B,positionPrefix:"upper_whisker",extraEncoding:G})],ie=[...f!=="tukey"?z:[],...R({partName:"box",mark:{type:"bar",...l?{size:l}:{},orient:_,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:T}),...A({partName:"median",mark:{type:"tick",invalid:c,...re(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...l?{size:l}:{},orient:x,aria:!1},positionPrefix:"mid_box",extraEncoding:T})];if(f==="min-max")return{...o,transform:(o.transform??[]).concat(p),layer:ie};const be=at(`lower_box_${g.field}`),he=at(`upper_box_${g.field}`),Te=`(${he} - ${be})`,ct=`${be} - ${u} * ${Te}`,Fe=`${he} + ${u} * ${Te}`,Ot=at(g.field),or={joinaggregate:SR(g.field),groupby:y},Ii={transform:[{filter:`(${ct} <= ${Ot}) && (${Ot} <= ${Fe})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${w}`},{op:"max",field:g.field,as:`upper_whisker_${w}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${w}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${w}`},...b],groupby:y}],layer:z},{tooltip:le,...Re}=S,{scale:Ie,axis:K}=g,Kt=ew(g),Xe=hi(K,["title"]),Pn=ER(a,"outliers",t.boxplot,{transform:[{filter:`(${Ot} < ${ct}) || (${Ot} > ${Fe})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...Kt!==void 0?{title:Kt}:{},...Ie!==void 0?{scale:Ie}:{},...ht(Xe)?{}:{axis:Xe}},...Re,...C?{color:C}:{},...E?{tooltip:E}:{}}})[0];let ln;const Fs=[...d,...h,or];return Pn?ln={transform:Fs,layer:[Pn,Ii]}:(ln=Ii,ln.transform.unshift(...Fs)),{...o,layer:[ln,{transform:p,layer:ie}]}}function SR(e){const t=cc(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function J0e(e,t,n){const i=kR(e,nm),{continuousAxisChannelDef:r,continuousAxis:s}=CR(e,i,nm),o=r.field,a=cc(o),u=AR(t),l=[...SR(o),{op:"median",field:o,as:`mid_box_${a}`},{op:"min",field:o,as:(u==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:o,as:(u==="min-max"?"upper_whisker_":"max_")+a}],c=u==="min-max"||u==="tukey"?[]:[{calculate:`${at(`upper_box_${a}`)} - ${at(`lower_box_${a}`)}`,as:`iqr_${a}`},{calculate:`min(${at(`upper_box_${a}`)} + ${at(`iqr_${a}`)} * ${t}, ${at(`max_${a}`)})`,as:`upper_whisker_${a}`},{calculate:`max(${at(`lower_box_${a}`)} - ${at(`iqr_${a}`)} * ${t}, ${at(`min_${a}`)})`,as:`lower_whisker_${a}`}],{[s]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=X0e(d),{bins:g,timeUnits:m,aggregate:y,groupby:b,encoding:v}=_R(p,n),x=i==="vertical"?"horizontal":"vertical",_=i,E=[...g,...m,{aggregate:[...y,...l],groupby:b},...c];return{bins:g,timeUnits:m,transform:E,groupby:b,aggregate:y,continuousAxisChannelDef:r,continuousAxis:s,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:_,customTooltipWithoutAggregatedField:h}}const nw="errorbar",Q0e=["ticks","rule"],epe=new Q1(nw,FR);function FR(e,{config:t}){e={...e,encoding:em(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,ticksOrient:o,markDef:a,outerSpec:u,tooltipEncoding:l}=DR(e,nw,t);delete s.size;const c=tw(a,r,i,s,t.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:o,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:l}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l})];return{...u,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function tpe(e,t){const{encoding:n}=e;if(npe(n))return{orient:kR(e,t),inputType:"raw"};const i=ipe(n),r=rpe(n),s=n.x,o=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,u=n.y2;if(Ne(a)&&Ne(u))throw new Error(`${t} cannot have both x2 and y2`);if(Ne(a)){if(ga(s))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(Ne(u)){if(ga(o))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{const a=n.xError,u=n.xError2,l=n.yError,c=n.yError2;if(Ne(u)&&!Ne(a))throw new Error(`${t} cannot have xError2 without xError`);if(Ne(c)&&!Ne(l))throw new Error(`${t} cannot have yError2 without yError`);if(Ne(a)&&Ne(l))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(Ne(a)){if(ga(s))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(Ne(l)){if(ga(o))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function npe(e){return(Ne(e.x)||Ne(e.y))&&!Ne(e.x2)&&!Ne(e.y2)&&!Ne(e.xError)&&!Ne(e.xError2)&&!Ne(e.yError)&&!Ne(e.yError2)}function ipe(e){return Ne(e.x2)||Ne(e.y2)}function rpe(e){return Ne(e.xError)||Ne(e.xError2)||Ne(e.yError)||Ne(e.yError2)}function DR(e,t,n){const{mark:i,encoding:r,params:s,projection:o,...a}=e,u=xs(i)?i:{type:i};s&&Z(uN(t));const{orient:l,inputType:c}=tpe(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=CR(e,l,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:v}=spe(u,f,d,h,p,c,t,n),{[g]:x,[g==="x"?"x2":"y2"]:_,[g==="x"?"xError":"yError"]:E,[g==="x"?"xError2":"yError2"]:w,...C}=r,{bins:k,timeUnits:S,aggregate:$,groupby:O,encoding:R}=_R(C,n),D=[...$,...m],A=c!=="raw"?[]:O,T=Q_(b,f,R,v);return{transform:[...a.transform??[],...k,...S,...D.length===0?[]:[{aggregate:D,groupby:A}],...y],groupby:A,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:R,ticksOrient:l==="vertical"?"horizontal":"vertical",markDef:u,outerSpec:a,tooltipEncoding:T}}function spe(e,t,n,i,r,s,o,a){let u=[],l=[];const c=t.field;let f,d=!1;if(s==="raw"){const h=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,p=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&Z(vhe(h,p,o)),p==="stderr"||p==="stdev")u=[{op:p,field:c,as:`extent_${c}`},{op:h,field:c,as:`center_${c}`}],l=[{calculate:`${at(`center_${c}`)} + ${at(`extent_${c}`)}`,as:`upper_${c}`},{calculate:`${at(`center_${c}`)} - ${at(`extent_${c}`)}`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:Yd(h)},{fieldPrefix:"upper_",titlePrefix:TR(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:TR(h,p,"-")}],d=!0;else{let g,m,y;p==="ci"?(g="mean",m="ci0",y="ci1"):(g="median",m="q1",y="q3"),u=[{op:m,field:c,as:`lower_${c}`},{op:y,field:c,as:`upper_${c}`},{op:g,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:xc({field:c,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:xc({field:c,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:xc({field:c,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&Z(bhe(e.center,e.extent)),s==="aggregated-upper-lower"?(f=[],l=[{calculate:at(n.field),as:`upper_${c}`},{calculate:at(c),as:`lower_${c}`}]):s==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`${at(c)} + ${at(i.field)}`,as:`upper_${c}`}],r?l.push({calculate:`${at(c)} + ${at(r.field)}`,as:`lower_${c}`}):l.push({calculate:`${at(c)} - ${at(i.field)}`,as:`lower_${c}`}));for(const h of l)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:du(du(h.calculate,"datum['",""),"']","")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}function TR(e,t,n){return`${Yd(e)} ${n} ${t}`}const iw="errorband",ope=["band","borders"],ape=new Q1(iw,MR);function MR(e,{config:t}){e={...e,encoding:em(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,markDef:o,outerSpec:a,tooltipEncoding:u}=DR(e,iw,t),l=o,c=tw(l,r,i,s,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...l.interpolate?{interpolate:l.interpolate}:{},...l.tension&&l.interpolate?{tension:l.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):l.interpolate?Z(yN("interpolate")):l.tension&&Z(yN("tension")),{...a,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]}}const NR={};function rw(e,t,n){const i=new Q1(e,t);NR[e]={normalizer:i,parts:n}}function upe(){return Y(NR)}rw(nm,$R,K0e),rw(nw,FR,Q0e),rw(iw,MR,ope);const lpe=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],RR={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},OR={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},cpe=Y(RR),fpe=Y(OR),LR=Y({header:1,headerRow:1,headerColumn:1,headerFacet:1}),IR=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],dpe={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},hpe={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},Or="_vgsid_",ppe={point:{on:"click",fields:[Or],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function sw(e){return e==="legend"||!!(e!=null&&e.legend)}function ow(e){return sw(e)&&re(e)}function aw(e){return!!(e!=null&&e.select)}function PR(e){const t=[];for(const n of e||[]){if(aw(n))continue;const{expr:i,bind:r,...s}=n;if(r&&i){const o={...s,bind:r,init:i};t.push(o)}else{const o={...s,...i?{update:i}:{},...r?{bind:r}:{}};t.push(o)}}return t}function gpe(e){return im(e)||lw(e)||uw(e)}function uw(e){return X(e,"concat")}function im(e){return X(e,"vconcat")}function lw(e){return X(e,"hconcat")}function zR({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function ws(e){return X(e,"step")}function BR(e){return X(e,"view")||X(e,"width")||X(e,"height")}const UR=20,mpe=Y({align:1,bounds:1,center:1,columns:1,spacing:1});function ype(e,t,n){const i=n[t],r={},{spacing:s,columns:o}=i;s!==void 0&&(r.spacing=s),o!==void 0&&(H1(e)&&!rh(e.facet)||uw(e))&&(r.columns=o),im(e)&&(r.columns=1);for(const a of mpe)if(e[a]!==void 0)if(a==="spacing"){const u=e[a];r[a]=Ze(u)?u:{row:u.row??s,column:u.column??s}}else r[a]=e[a];return r}function cw(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function fw(e,t){const n=rm(e,t);return ws(n)?n.step:jR}function rm(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return zt(n,{step:e.step})}const jR=20,bpe={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:jR},mark:g0e,arc:{},area:{},bar:y0e,circle:{},geoshape:{},image:{},line:{},point:{},rect:U_,rule:{color:"black"},square:{},text:{color:"black"},tick:b0e,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:Zhe,projection:{},legend:dpe,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:ppe,style:{},title:{},facet:{spacing:UR},concat:{spacing:UR},normalizedNumberFormat:".0%"},uo=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],qR={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},WR={blue:uo[0],orange:uo[1],red:uo[2],teal:uo[3],green:uo[4],yellow:uo[5],purple:uo[6],pink:uo[7],brown:uo[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function vpe(e={}){return{signals:[{name:"color",value:re(e)?{...WR,...e}:WR}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function xpe(e){return{signals:[{name:"fontSize",value:re(e)?{...qR,...e}:qR}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function _pe(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function HR(e){const t=Y(e||{}),n={};for(const i of t){const r=e[i];n[i]=uh(r)?XM(r):Ni(r)}return n}function wpe(e){const t=Y(e),n={};for(const i of t)n[i]=HR(e[i]);return n}const Epe=[...qN,...yR,...LR,"background","padding","legend","lineBreak","scale","style","title","view"];function GR(e={}){const{color:t,font:n,fontSize:i,selection:r,...s}=e,o=nl({},De(bpe),n?_pe(n):{},t?vpe(t):{},i?xpe(i):{},s||{});r&&il(o,"selection",r,!0);const a=hi(o,Epe);for(const u of["background","lineBreak","padding"])o[u]&&(a[u]=Ni(o[u]));for(const u of qN)o[u]&&(a[u]=yn(o[u]));for(const u of yR)o[u]&&(a[u]=HR(o[u]));for(const u of LR)o[u]&&(a[u]=yn(o[u]));if(o.legend&&(a.legend=yn(o.legend)),o.scale){const{invalid:u,...l}=o.scale,c=yn(u,{level:1});a.scale={...yn(l),...Y(c).length>0?{invalid:c}:{}}}return o.style&&(a.style=wpe(o.style)),o.title&&(a.title=yn(o.title)),o.view&&(a.view=yn(o.view)),a}const Cpe=new Set(["view",...c0e]),kpe=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],Ape={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...p0e};function $pe(e){e=De(e);for(const t of kpe)delete e[t];if(e.axis)for(const t in e.axis)uh(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of lpe)delete e.legend[t];if(e.mark){for(const t of jN)delete e.mark[t];e.mark.tooltip&&re(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(PR(e.params)),delete e.params);for(const t of Cpe){for(const i of jN)delete e[t][i];const n=Ape[t];if(n)for(const i of n)delete e[t][i];Fpe(e,t)}for(const t of upe())delete e[t];Spe(e);for(const t in e)re(e[t])&&ht(e[t])&&delete e[t];return ht(e)?void 0:e}function Spe(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=YM(e.title);ht(t)||(e.style["group-title"]={...e.style["group-title"],...t}),ht(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),ht(i)?delete e.title:e.title=i}function Fpe(e,t,n,i){const r=e[t];t==="view"&&(n="cell");const s={...r,...e.style[n??t]};ht(s)||(e.style[n??t]=s),delete e[t]}function sm(e){return X(e,"layer")}function Dpe(e){return X(e,"repeat")}function Tpe(e){return!W(e.repeat)&&X(e.repeat,"layer")}class dw{map(t,n){return H1(t)?this.mapFacet(t,n):Dpe(t)?this.mapRepeat(t,n):lw(t)?this.mapHConcat(t,n):im(t)?this.mapVConcat(t,n):uw(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(sm(t))return this.mapLayer(t,n);if(ao(t))return this.mapUnit(t,n);throw new Error(y_(t))}mapLayer(t,n){return{...t,layer:t.layer.map(i=>this.mapLayerOrUnit(i,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(i=>this.map(i,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(i=>this.map(i,n))}}mapConcat(t,n){const{concat:i,...r}=t;return{...r,concat:i.map(s=>this.map(s,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const Mpe={zero:1,center:1,normalize:1};function Npe(e){return ue(Mpe,e)}const Rpe=new Set([zN,z1,P1,j1,U1,P_,z_,B1,BN,I_]),Ope=new Set([z1,P1,zN]);function Ec(e){return J(e)&&bc(e)==="quantitative"&&!e.bin}function VR(e,t,{orient:n,type:i}){const r=t==="x"?"y":"radius",s=t==="x"&&["bar","area"].includes(i),o=e[t],a=e[r];if(J(o)&&J(a))if(Ec(o)&&Ec(a)){if(o.stack)return t;if(a.stack)return r;const u=J(o)&&!!o.aggregate,l=J(a)&&!!a.aggregate;if(u!==l)return u?t:r;if(s){if(n==="vertical")return r;if(n==="horizontal")return t}}else{if(Ec(o))return t;if(Ec(a))return r}else{if(Ec(o))return s&&n==="vertical"?void 0:t;if(Ec(a))return s&&n==="horizontal"?void 0:r}}function Lpe(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function YR(e,t){var g,m;const n=xs(e)?e:{type:e},i=n.type;if(!Rpe.has(i))return null;const r=VR(t,"x",n)||VR(t,"theta",n);if(!r)return null;const s=t[r],o=J(s)?ne(s,{}):void 0,a=Lpe(r),u=[],l=new Set;if(t[a]){const y=t[a],b=J(y)?ne(y,{}):void 0;b&&b!==o&&(u.push(a),l.add(b))}const c=a==="x"?"xOffset":"yOffset",f=t[c],d=J(f)?ne(f,{}):void 0;d&&d!==o&&(u.push(c),l.add(d));const h=Zfe.reduce((y,b)=>{if(b!=="tooltip"&&$u(t,b)){const v=t[b];for(const x of oe(v)){const _=Rr(x);if(_.aggregate)continue;const E=ne(_,{});(!E||!l.has(E))&&y.push({channel:b,fieldDef:_})}}return y},[]);let p;return s.stack!==void 0?xo(s.stack)?p=s.stack?"zero":null:p=s.stack:Ope.has(i)&&(p="zero"),!p||!Npe(p)||xR(t)&&h.length===0?null:((g=s==null?void 0:s.scale)!=null&&g.type&&((m=s==null?void 0:s.scale)==null?void 0:m.type)!==bn.LINEAR&&s!=null&&s.stack&&Z(ghe(s.scale.type)),Ne(t[gs(r)])?(s.stack!==void 0&&Z(phe(r)),null):(J(s)&&s.aggregate&&!cde.has(s.aggregate)&&Z(mhe(s.aggregate)),{groupbyChannels:u,groupbyFields:l,fieldChannel:r,impute:s.impute===null?!1:ha(i),stackBy:h,offset:p}))}function XR(e,t,n){const i=yn(e),r=gt("orient",i,n);if(i.orient=Bpe(i.type,t,r),r!==void 0&&r!==i.orient&&Z(Jde(i.orient,r)),i.type==="bar"&&i.orient){const u=gt("cornerRadiusEnd",i,n);if(u!==void 0){const l=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:m0e[i.orient];for(const c of l)i[c]=u;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}const s=gt("opacity",i,n),o=gt("fillOpacity",i,n);return s===void 0&&o===void 0&&(i.opacity=Ppe(i.type,t)),gt("cursor",i,n)===void 0&&(i.cursor=Ipe(i,t,n)),i}function Ipe(e,t,n){return t.href||e.href||gt("href",e,n)?"pointer":e.cursor}function Ppe(e,t){if(qe([U1,I_,P_,z_],e)&&!xR(t))return .7}function zpe(e,t,{graticule:n}){if(n)return!1;const i=ys("filled",e,t),r=e.type;return zt(i,r!==U1&&r!==B1&&r!==j1)}function Bpe(e,t,n){switch(e){case U1:case P_:case z_:case BN:case u0e:case a0e:return}const{x:i,y:r,x2:s,y2:o}=t;switch(e){case z1:if(J(i)&&(mn(i.bin)||J(r)&&r.aggregate&&!i.aggregate))return"vertical";if(J(r)&&(mn(r.bin)||J(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(o||s){if(n)return n;if(!s)return(J(i)&&i.type===wu&&!_t(i.bin)||V1(i))&&J(r)&&mn(r.bin)?"horizontal":"vertical";if(!o)return(J(r)&&r.type===wu&&!_t(r.bin)||V1(r))&&J(i)&&mn(i.bin)?"vertical":"horizontal"}case j1:if(s&&!(J(i)&&mn(i.bin))&&o&&!(J(r)&&mn(r.bin)))return;case P1:if(o)return J(r)&&mn(r.bin)?"horizontal":"vertical";if(s)return J(i)&&mn(i.bin)?"vertical":"horizontal";if(e===j1){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case B1:case I_:{const a=sR(i),u=sR(r);if(n)return n;if(a&&!u)return e!=="tick"?"horizontal":"vertical";if(!a&&u)return e!=="tick"?"vertical":"horizontal";if(a&&u)return"vertical";{const l=ei(i)&&i.type===gc,c=ei(r)&&r.type===gc;if(l&&!c)return"vertical";if(!l&&c)return"horizontal"}return}}return"vertical"}function Upe(e){const{point:t,line:n,...i}=e;return Y(i).length>1?i:i.type}function jpe(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:hi(e[t],["point","line"])});return e}function hw(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?re(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?re(t.point)?t.point:{}:void 0}function KR(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class qpe{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(ao(t)){const{mark:i,encoding:r}=t,s=xs(i)?i:{type:i};switch(s.type){case"line":case"rule":case"trail":return!!hw(s,n[s.type],r);case"area":return!!hw(s,n[s.type],r)||!!KR(s,n[s.type])}}return!1}run(t,n,i){const{config:r}=n,{params:s,projection:o,mark:a,name:u,encoding:l,...c}=t,f=em(l,r),d=xs(a)?a:{type:a},h=hw(d,r[d.type],f),p=d.type==="area"&&KR(d,r[d.type]),g=[{name:u,...s?{params:s}:{},mark:Upe({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:hi(f,["shape"])}],m=YR(XR(d,f,r),f);let y=f;if(m){const{fieldChannel:b,offset:v}=m;y={...f,[b]:{...f[b],...v?{stack:v}:{}}}}return y=hi(y,["y2","x2"]),p&&g.push({...o?{projection:o}:{},mark:{type:"line",...uc(d,["clip","interpolate","tension","tooltip"]),...p},encoding:y}),h&&g.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...uc(d,["clip","tooltip"]),...h},encoding:y}),i({...c,layer:g},{...n,config:jpe(r)})}}function Wpe(e,t){return t?rh(e)?eO(e,t):ZR(e,t):e}function pw(e,t){return t?eO(e,t):e}function gw(e,t,n){const i=t[e];if(D0e(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};Z(Fde(i.repeat));return}return t}function ZR(e,t){if(e=gw("field",e,t),e!==void 0){if(e===null)return null;if(Y_(e)&&oo(e.sort)){const n=gw("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function JR(e,t){if(J(e))return ZR(e,t);{const n=gw("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function QR(e,t){if(Ne(e)){const n=JR(e,t);if(n)return n;if(sh(e))return{condition:e.condition}}else{if(oh(e)){const n=JR(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}}function eO(e,t){const n={};for(const i in e)if(X(e,i)){const r=e[i];if(W(r))n[i]=r.map(s=>QR(s,t)).filter(s=>s);else{const s=QR(r,t);s!==void 0&&(n[i]=s)}}return n}class Hpe{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(ao(t)){const{encoding:n,mark:i}=t;if(i==="line"||xs(i)&&i.type==="line")for(const r of Yfe){const s=gu(r),o=n[s];if(n[r]&&(J(o)&&!mn(o.bin)||_s(o)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:s}=t;return Z(Zde(!!r.x2,!!r.y2)),i({...t,mark:re(s)?{...s,type:"rule"}:"rule"},n)}}class Gpe extends dw{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[Z0e,epe,ape,new qpe,new Hpe]}map(t,n){if(ao(t)){const i=$u(t.encoding,Zs),r=$u(t.encoding,Js),s=$u(t.encoding,A1);if(i||r||s)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:i,parentProjection:r}=n,s=pw(t.encoding,n.repeater),o={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(u=>u).join("_")}:{},...s?{encoding:s}:{}};if(i||r)return this.mapUnitWithParentEncodingOrProjection(o,n);const a=this.mapLayerOrUnit.bind(this);for(const u of this.nonFacetUnitNormalizers)if(u.hasMatchingType(o,n.config))return u.run(o,n,a);return o}mapRepeat(t,n){return Tpe(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:i,spec:r,...s}=t,{row:o,column:a,layer:u}=i,{repeater:l={},repeaterPrefix:c=""}=n;return o||a?this.mapRepeat({...t,repeat:{...o?{row:o}:{},...a?{column:a}:{}},spec:{repeat:{layer:u},spec:r}},n):{...s,layer:u.map(f=>{const d={...l,layer:f},h=`${(r.name?`${r.name}_`:"")+c}child__layer_${At(f)}`,p=this.mapLayerOrUnit(r,{...n,repeater:d,repeaterPrefix:h});return p.name=h,p})}}mapNonLayerRepeat(t,n){const{repeat:i,spec:r,data:s,...o}=t;!W(i)&&t.columns&&(t=hi(t,["columns"]),Z(lN("repeat")));const a=[],{repeater:u={},repeaterPrefix:l=""}=n,c=!W(i)&&i.row||[u?u.row:null],f=!W(i)&&i.column||[u?u.column:null],d=W(i)&&i||[u?u.repeat:null];for(const p of d)for(const g of c)for(const m of f){const y={repeat:p,row:g,column:m,layer:u.layer},b=(r.name?`${r.name}_`:"")+l+"child__"+(W(i)?`${At(p)}`:(i.row?`row_${At(g)}`:"")+(i.column?`column_${At(m)}`:"")),v=this.map(r,{...n,repeater:y,repeaterPrefix:b});v.name=b,a.push(hi(v,["data"]))}const h=W(i)?t.columns:i.column?i.column.length:1;return{data:r.data??s,align:"all",...o,columns:h,concat:a}}mapFacet(t,n){const{facet:i}=t;return rh(i)&&t.columns&&(t=hi(t,["columns"]),Z(lN("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:i,projection:r}=t,{parentEncoding:s,parentProjection:o,config:a}=n,u=nO({parentProjection:o,projection:r}),l=tO({parentEncoding:s,encoding:pw(i,n.repeater)});return this.mapUnit({...t,...u?{projection:u}:{},...l?{encoding:l}:{}},{config:a})}mapFacetedUnit(t,n){const{row:i,column:r,facet:s,...o}=t.encoding,{mark:a,width:u,projection:l,height:c,view:f,params:d,encoding:h,...p}=t,{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:i,column:r,facet:s},n),y=pw(o,n.repeater);return this.mapFacet({...p,...m,facet:g,spec:{...u?{width:u}:{},...c?{height:c}:{},...f?{view:f}:{},...l?{projection:l}:{},mark:a,encoding:y,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:i,column:r,facet:s}=t;if(i||r){s&&Z(Xde([...i?[Zs]:[],...r?[Js]:[]]));const o={},a={};for(const u of[Zs,Js]){const l=t[u];if(l){const{align:c,center:f,spacing:d,columns:h,...p}=l;o[u]=p;for(const g of["align","center","spacing"])l[g]!==void 0&&(a[g]??(a[g]={}),a[g][u]=l[g])}}return{facetMapping:o,layout:a}}else{const{align:o,center:a,spacing:u,columns:l,...c}=s;return{facetMapping:Wpe(c,n.repeater),layout:{...o?{align:o}:{},...a?{center:a}:{},...u?{spacing:u}:{},...l?{columns:l}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:i,...r}){const{encoding:s,projection:o,...a}=t,u={...r,parentEncoding:tO({parentEncoding:n,encoding:s,layer:!0}),parentProjection:nO({parentProjection:i,projection:o})};return super.mapLayer({...a,...t.name?{name:[u.repeaterPrefix,t.name].filter(l=>l).join("_")}:{}},u)}}function tO({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...Y(e),...Y(t)]);for(const s of r){const o=t[s],a=e[s];if(Ne(o)){const u={...a,...o};i[s]=u}else oh(o)?i[s]={...o,condition:{...a,...o.condition}}:o||o===null?i[s]=o:(n||Nr(a)||me(a)||Ne(a)||W(a))&&(i[s]=a)}}else i=t;return!i||ht(i)?void 0:i}function nO(e){const{parentProjection:t,projection:n}=e;return t&&n&&Z(Pde({parentProjection:t,projection:n})),n??t}function mw(e){return X(e,"filter")}function Vpe(e){return X(e,"stop")}function iO(e){return X(e,"lookup")}function Ype(e){return X(e,"data")}function Xpe(e){return X(e,"param")}function Kpe(e){return X(e,"pivot")}function Zpe(e){return X(e,"density")}function Jpe(e){return X(e,"quantile")}function Qpe(e){return X(e,"regression")}function ege(e){return X(e,"loess")}function tge(e){return X(e,"sample")}function nge(e){return X(e,"window")}function ige(e){return X(e,"joinaggregate")}function rge(e){return X(e,"flatten")}function sge(e){return X(e,"calculate")}function rO(e){return X(e,"bin")}function oge(e){return X(e,"impute")}function age(e){return X(e,"timeUnit")}function uge(e){return X(e,"aggregate")}function lge(e){return X(e,"stack")}function cge(e){return X(e,"fold")}function fge(e){return X(e,"extent")&&!X(e,"density")&&!X(e,"regression")}function dge(e){return e.map(t=>mw(t)?{filter:ac(t.filter,Whe)}:t)}class hge extends dw{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=sO(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=sO(t,n),t.encoding){const i={};for(const[r,s]of ia(t.encoding))i[r]=oO(s,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:ia(i).map(([s,o])=>{const{init:a,bind:u,empty:l,...c}=o;c.type==="single"?(c.type="point",c.toggle=!1):c.type==="multi"&&(c.type="point"),n.emptySelections[s]=l!=="none";for(const f of gn(n.selectionPredicates[s]??{}))f.empty=l!=="none";return{name:s,value:a,select:c,bind:u}})}:t}}function sO(e,t){const{transform:n,...i}=e;if(n){const r=n.map(s=>{if(mw(s))return{filter:yw(s,t)};if(rO(s)&&mu(s.bin))return{...s,bin:aO(s.bin)};if(iO(s)){const{selection:o,...a}=s.from;return o?{...s,from:{param:o,...a}}:s}return s});return{...i,transform:r}}return e}function oO(e,t){var i,r;const n=De(e);if(J(n)&&mu(n.bin)&&(n.bin=aO(n.bin)),Au(n)&&((r=(i=n.scale)==null?void 0:i.domain)!=null&&r.selection)){const{selection:s,...o}=n.scale.domain;n.scale.domain={...o,...s?{param:s}:{}}}if(sh(n))if(W(n.condition))n.condition=n.condition.map(s=>{const{selection:o,param:a,test:u,...l}=s;return a?s:{...l,test:yw(s,t)}});else{const{selection:s,param:o,test:a,...u}=oO(n.condition,t);n.condition=o?n.condition:{...u,test:yw(n.condition,t)}}return n}function aO(e){const t=e.extent;if(t!=null&&t.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function yw(e,t){const n=i=>ac(i,r=>{var s;const o=t.emptySelections[r]??!0,a={param:r,empty:o};return(s=t.selectionPredicates)[r]??(s[r]=[]),t.selectionPredicates[r].push(a),a});return e.selection?n(e.selection):ac(e.test||e.filter,i=>i.selection?n(i.selection):i)}class bw extends dw{map(t,n){const i=n.selections??[];if(t.params&&!ao(t)){const r=[];for(const s of t.params)aw(s)?i.push(s):r.push(s);t.params=r}return n.selections=i,super.map(t,n)}mapUnit(t,n){const i=n.selections;if(!i||!i.length)return t;const r=(n.path??[]).concat(t.name),s=[];for(const o of i)if(!o.views||!o.views.length)s.push(o);else for(const a of o.views)(se(a)&&(a===t.name||r.includes(a))||W(a)&&a.map(u=>r.indexOf(u)).every((u,l,c)=>u!==-1&&(l===0||u>c[l-1])))&&s.push(o);return s.length&&(t.params=s),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=bw.prototype[e];bw.prototype[e]=function(n,i){return t.call(this,n,pge(n,i))}}function pge(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function uO(e,t){t===void 0&&(t=GR(e.config));const n=bge(e,t),{width:i,height:r}=e,s=vge(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...s?{autosize:s}:{}}}const gge=new Gpe,mge=new hge,yge=new bw;function bge(e,t={}){const n={config:t};return yge.map(gge.map(mge.map(e,n),n),n)}function lO(e){return se(e)?{type:e}:e??{}}function vge(e,t,n){let{width:i,height:r}=t;const s=ao(e)||sm(e),o={};s?i=="container"&&r=="container"?(o.type="fit",o.contains="padding"):i=="container"?(o.type="fit-x",o.contains="padding"):r=="container"&&(o.type="fit-y",o.contains="padding"):(i=="container"&&(Z(rN("width")),i=void 0),r=="container"&&(Z(rN("height")),r=void 0));const a={type:"pad",...o,...n?lO(n.autosize):{},...lO(e.autosize)};if(a.type==="fit"&&!s&&(Z(bde),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&Z(sN("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&Z(sN("height")),!Mi(a,{type:"pad"}))return a}function xge(e){return["fit","fit-x","fit-y"].includes(e)}function _ge(e){return e?`fit-${T1(e)}`:"fit"}const wge=["background","padding"];function cO(e,t){const n={};for(const i of wge)e&&e[i]!==void 0&&(n[i]=Ni(e[i]));return t&&(n.params=e.params),n}class lo{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new lo(De(this.explicit),De(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return zt(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:i}){n!==void 0&&this.set(t,n,i)}set(t,n,i){return delete this[i?"implicit":"explicit"][t],this[i?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:i}){n[t]!==void 0?this.set(t,n[t],!0):i[t]!==void 0&&this.set(t,i[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of Y(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function Es(e){return{explicit:!0,value:e}}function Ri(e){return{explicit:!1,value:e}}function fO(e){return(t,n,i,r)=>{const s=e(t.value,n.value);return s>0?t:s<0?n:om(t,n,i,r)}}function om(e,t,n,i){return e.explicit&&t.explicit&&Z(ahe(n,i,e.value,t.value)),e}function ma(e,t,n,i,r=om){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:Mi(e.value,t.value)?e:r(e,t,n,i)}class Ege extends lo{constructor(t={},n={},i=!1){super(t,n),this.explicit=t,this.implicit=n,this.parseNothing=i}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function Cc(e){return X(e,"url")}function lh(e){return X(e,"values")}function dO(e){return X(e,"name")&&!Cc(e)&&!lh(e)&&!ya(e)}function ya(e){return e&&(hO(e)||pO(e)||vw(e))}function hO(e){return X(e,"sequence")}function pO(e){return X(e,"sphere")}function vw(e){return X(e,"graticule")}var Ft;(function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup",e[e.PreFilterInvalid=5]="PreFilterInvalid",e[e.PostFilterInvalid=6]="PostFilterInvalid"})(Ft||(Ft={}));function gO({invalid:e,isPath:t}){switch(WN(e,{isPath:t})){case"filter":return{marks:"exclude-invalid-values",scales:"exclude-invalid-values"};case"break-paths-show-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"include-invalid-values"};case"break-paths-filter-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"exclude-invalid-values"};case"show":return{marks:"include-invalid-values",scales:"include-invalid-values"}}}function Cge(e){const{marks:t,scales:n}=gO(e);return t===n?Ft.Main:n==="include-invalid-values"?Ft.PreFilterInvalid:Ft.PostFilterInvalid}class ut{constructor(t,n){this.debugName=n,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,n){if(this._children.includes(t)){Z(Ode);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const r of this._children)r.parent=t;this._children=[],t.removeChild(this);const i=t.parent.removeChild(t);this._parent=n,n.addChild(this,i),t.parent=this}}class yi extends ut{clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,n,i,r){super(t,n),this.type=i,this.refCounts=r,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${DM()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function xw(e){return e.as!==void 0}function mO(e){return`${e}_end`}class Cs extends ut{clone(){return new Cs(null,De(this.timeUnits))}constructor(t,n){super(t),this.timeUnits=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,o)=>{const{field:a,timeUnit:u}=s;if(u){let l;if(_u(u)){if(Dt(n)){const{mark:c,markDef:f,config:d}=n,h=pa({fieldDef:s,markDef:f,config:d});(th(c)||h)&&(l={timeUnit:sn(u),field:a})}}else l={as:ne(s,{forAs:!0}),field:a,timeUnit:u};if(Dt(n)){const{mark:c,markDef:f,config:d}=n,h=pa({fieldDef:s,markDef:f,config:d});th(c)&&Bt(o)&&h!==.5&&(l.rectBandPosition=h)}l&&(r[He(l)]=l)}return r},{});return ht(i)?null:new Cs(t,i)}static makeFromTransform(t,n){const{timeUnit:i,...r}={...n},s=sn(i),o={...r,timeUnit:s};return new Cs(t,{[He(o)]:o})}merge(t){this.timeUnits={...this.timeUnits};for(const n in t.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=t.timeUnits[n]);for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}removeFormulas(t){const n={};for(const[i,r]of ia(this.timeUnits)){const s=xw(r)?r.as:`${r.field}_end`;t.has(s)||(n[i]=r)}this.timeUnits=n}producedFields(){return new Set(gn(this.timeUnits).map(t=>xw(t)?t.as:mO(t.field)))}dependentFields(){return new Set(gn(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${He(this.timeUnits)}`}assemble(){const t=[];for(const n of gn(this.timeUnits)){const{rectBandPosition:i}=n,r=sn(n.timeUnit);if(xw(n)){const{field:s,as:o}=n,{unit:a,utc:u,...l}=r,c=[o,`${o}_end`];t.push({field:er(s),type:"timeunit",...a?{units:L1(a)}:{},...u?{timezone:"utc"}:{},...l,as:c}),t.push(...bO(c,i,r))}else if(n){const{field:s}=n,o=s.replaceAll("\\.","."),a=yO({timeUnit:r,field:o}),u=mO(o);t.push({type:"formula",expr:a,as:u}),t.push(...bO([o,u],i,r))}}return t}}const am="offsetted_rect_start",um="offsetted_rect_end";function yO({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,s=CN(i),{part:o,step:a}=SN(s,e.step);return`${r?"utcOffset":"timeOffset"}('${o}', ${at(t)}, ${n?-a:a})`}function bO([e,t],n,i){if(n!==void 0&&n!==.5){const r=at(e),s=at(t);return[{type:"formula",expr:vO([yO({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${am}`},{type:"formula",expr:vO([r,s],n+.5),as:`${e}_${um}`}]}return[]}function vO([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const ch="_tuple_fields";class kge{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const Age={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new kge),s={},o={},a=new Set,u=(p,g)=>{const m=g==="visual"?p.channel:p.field;let y=At(`${i}_${m}`);for(let b=1;a.has(y);b++)y=At(`${i}_${m}_${b}`);return a.add(y),{[g]:y}},l=t.type,c=e.config.selection[l],f=n.value!==void 0?oe(n.value):null;let{fields:d,encodings:h}=re(n.select)?n.select:{};if(!d&&!h&&f){for(const p of f)if(re(p))for(const g of Y(p))Vfe(g)?(h||(h=[])).push(g):l==="interval"?(Z(Sde),h=c.encodings):(d??(d=[])).push(g)}!d&&!h&&(h=c.encodings,"fields"in c&&(d=c.fields));for(const p of h??[]){const g=e.fieldDef(p);if(g){let m=g.field;if(g.aggregate){Z(vde(p,g.aggregate));continue}else if(!m){Z(aN(p));continue}if(g.timeUnit&&!_u(g.timeUnit)){m=e.vgField(p);const y={timeUnit:g.timeUnit,as:m,field:g.field};o[He(y)]=y}if(!s[m]){const y=l==="interval"&&ms(p)&&Tr(e.getScaleComponent(p).get("type"))?"R":g.bin?"R-RE":"E",b={field:m,channel:p,type:y,index:r.items.length};b.signals={...u(b,"data"),...u(b,"visual")},r.items.push(s[m]=b),r.hasField[m]=s[m],r.hasSelectionId=r.hasSelectionId||m===Or,IM(p)?(b.geoChannel=p,b.channel=LM(p),r.hasChannel[b.channel]=s[m]):r.hasChannel[p]=s[m]}}else Z(aN(p))}for(const p of d??[]){if(r.hasField[p])continue;const g={type:"E",field:p,index:r.items.length};g.signals={...u(g,"data")},r.items.push(g),r.hasField[p]=g,r.hasSelectionId=r.hasSelectionId||p===Or}f&&(t.init=f.map(p=>r.items.map(g=>re(p)?p[g.geoChannel||g.channel]!==void 0?p[g.geoChannel||g.channel]:p[g.field]:p))),ht(o)||(r.timeUnit=new Cs(null,o))},signals:(e,t,n)=>{const i=t.name+ch;return n.filter(s=>s.name===i).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(EO)})}},xO="_curr",lm="anim_value",kc="anim_clock",_w="eased_anim_clock",_O="min_extent",wO="max_range_extent",ww="last_tick_at",Ew="is_playing",$ge=1/60*1e3,Sge=(e,t)=>[{name:_w,update:kc},{name:`${e}_domain`,init:`domain('${t}')`},{name:_O,init:`extent(${e}_domain)[0]`},{name:wO,init:`extent(range('${t}'))[1]`},{name:lm,update:`invert('${t}', ${_w})`}],Fge={defined:e=>e.type==="point",topLevelSignals:(e,t,n)=>(ks(t)&&(n=n.concat([{name:kc,init:"0",on:[{events:{type:"timer",throttle:$ge},update:`${Ew} ? (${kc} + (now() - ${ww}) > ${wO} ? 0 : ${kc} + (now() - ${ww})) : ${kc}`}]},{name:ww,init:"now()",on:[{events:[{signal:kc},{signal:Ew}],update:"now()"}]},{name:Ew,init:"true"}])),n),signals:(e,t,n)=>{const i=t.name,r=i+ch,s=t.project,o="(item().isVoronoi ? datum.datum : datum)",a=gn(e.component.selection??{}).reduce((c,f)=>f.type==="interval"?c.concat(f.name+Ac):c,[]).map(c=>`indexof(item().mark.name, '${c}') < 0`).join(" && "),u=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let l=`unit: ${Du(e)}, `;if(t.project.hasSelectionId)l+=`${Or}: ${o}[${Q(Or)}]`;else if(ks(t))l+=`fields: ${r}, values: [${lm} ? ${lm} : ${_O}]`;else{const c=s.items.map(f=>{const d=e.fieldDef(f.channel);return d!=null&&d.bin?`[${o}[${Q(e.vgField(f.channel,{}))}], ${o}[${Q(e.vgField(f.channel,{binSuffix:"end"}))}]]`:`${o}[${Q(f.field)}]`}).join(", ");l+=`fields: ${r}, values: [${c}]`}if(ks(t))return n.concat(Sge(t.name,e.scaleName(sa)),[{name:i+ho,on:[{events:[{signal:_w},{signal:lm}],update:`{${l}}`,force:!0}]}]);{const c=t.events;return n.concat([{name:i+ho,on:c?[{events:c,update:`${u} ? {${l}} : null`,force:!0}]:[]}])}}};function EO(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=er(r.field),r}function Su(e,t=!0,n=En){if(W(e)){const i=e.map(r=>Su(r,t,n));return t?`[${i.join(", ")}]`:i}else if(vu(e))return n(t?xu(e):Mhe(e));return t?n(pt(e)):e}function Dge(e,t){for(const n of gn(e.component.selection??{})){const i=n.name;let r=`${i}${ho}, ${n.resolve==="global"?"true":`{unit: ${Du(e)}}`}`;for(const s of pm)s.defined(n)&&(s.signals&&(t=s.signals(e,n,t)),s.modifyExpr&&(r=s.modifyExpr(e,n,r)));t.push({name:i+i1e,on:[{events:{signal:n.name+ho},update:`modify(${Q(n.name+Fu)}, ${r})`}]})}return Cw(t)}function Tge(e,t){if(e.component.selection&&Y(e.component.selection).length){const n=Q(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:ta("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return Cw(t)}function Mge(e,t){let n=!1;for(const i of gn(e.component.selection??{})){const r=i.name,s=Q(r+Fu);if(t.filter(a=>a.name===r).length===0){const a=i.resolve==="global"?"union":i.resolve,u=i.type==="point"?", true, true)":")";t.push({name:i.name,update:`${YO}(${s}, ${Q(a)}${u}`})}n=!0;for(const a of pm)a.defined(i)&&a.topLevelSignals&&(t=a.topLevelSignals(e,i,t))}return n&&t.filter(r=>r.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),Cw(t)}function Nge(e,t){const n=[],i=[],r=Du(e,{escape:!1});for(const s of gn(e.component.selection??{})){const o={name:s.name+Fu};if(s.project.hasSelectionId&&(o.transform=[{type:"collect",sort:{field:Or}}]),s.init){const u=s.project.items.map(EO);o.values=s.project.hasSelectionId?s.init.map(l=>({unit:r,[Or]:Su(l,!1)[0]})):s.init.map(l=>({unit:r,fields:u,values:Su(l,!1)}))}if([...n,...t].filter(u=>u.name===s.name+Fu).length||n.push(o),ks(s)&&t.length){const u=e.lookupDataSource(e.getDataName(Ft.Main)),l=t.find(f=>f.name===u),c=l.transform.find(f=>f.type==="filter"&&f.expr.includes("vlSelectionTest"));if(c){l.transform=l.transform.filter(d=>d!==c);const f={name:l.name+xO,source:l.name,transform:[c]};i.push(f)}}}return n.concat(t,i)}function CO(e,t){for(const n of gn(e.component.selection??{}))for(const i of pm)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function Rge(e,t){for(const n of e.children)Dt(n)&&(t=CO(n,t));return t}function Oge(e,t,n,i){const r=dL(e,t.param,t);return{signal:Tr(n.get("type"))&&W(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function Cw(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}const co={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!ms(r))continue;const s=e.getScaleComponent(r),o=s?s.get("type"):void 0;if(o=="sequential"&&Z(Ede),!s||!Tr(o)){Z(wde);continue}s.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(o=>n.filter(a=>a.name===o.signals.data).length===0);if(!e.parent||Aw(e)||i.length===0)return n;const r=n.find(o=>o.name===t.name);let s=r.update;if(s.includes(YO))r.update=`{${i.map(o=>`${Q(er(o.field))}: ${o.signals.data}`).join(", ")}}`;else{for(const o of i){const a=`${Q(er(o.field))}: ${o.signals.data}`;s.includes(a)||(s=`${s.substring(0,s.length-1)}, ${a}}`)}r.update=s}return n.concat(i.map(o=>({name:o.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!Aw(e))for(const i of t.scales){const r=n.find(s=>s.name===i.signals.data);r.push="outer",delete r.value,delete r.update}return n}};function kw(e,t){return`domain(${Q(e.scaleName(t))})`}function Aw(e){return e.parent&&Lc(e.parent)&&(!e.parent.parent||Aw(e.parent.parent))}const Ac="_brush",kO="_scale_trigger",fh="geo_interval_init_tick",AO="_init",Lge="_center",Ige={defined:e=>e.type==="interval",parse:(e,t,n)=>{var i;if(e.hasProjection){const r={...re(n.select)?n.select:{}};r.fields=[Or],r.encodings||(r.encodings=n.value?Y(n.value):[Sr,$r]),n.select={type:"interval",...r}}if(t.translate&&!co.defined(t)){const r=`!event.item || event.item.mark.name !== ${Q(t.name+Ac)}`;for(const s of t.events){if(!s.between){Z(`${s} is not an ordered event stream for interval selections.`);continue}const o=oe((i=s.between[0]).filter??(i.filter=[]));o.includes(r)||o.push(r)}}},signals:(e,t,n)=>{const i=t.name,r=i+ho,s=gn(t.project.hasChannel).filter(a=>a.channel===$t||a.channel===rn),o=t.init?t.init[0]:null;if(n.push(...s.reduce((a,u)=>a.concat(Pge(e,t,u,o&&o[u.index])),[])),e.hasProjection){const a=Q(e.projectionName()),u=e.projectionName()+Lge,{x:l,y:c}=t.project.hasChannel,f=l&&l.signals.visual,d=c&&c.signals.visual,h=l?o&&o[l.index]:`${u}[0]`,p=c?o&&o[c.index]:`${u}[1]`,g=_=>e.getSizeSignalRef(_).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":g("width")}, ${d?d+"[1]":g("height")}]]`;o&&(n.unshift({name:i+AO,init:`[scale(${a}, [${l?h[0]:h}, ${c?p[0]:p}]), scale(${a}, [${l?h[1]:h}, ${c?p[1]:p}])]`}),(!l||!c)&&(n.find(E=>E.name===u)||n.unshift({name:u,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const y=`intersect(${m}, {markname: ${Q(e.getName("marks"))}}, unit.mark)`,b=`{unit: ${Du(e)}}`,v=`vlSelectionTuples(${y}, ${b})`,x=s.map(_=>_.signals.visual);return n.concat({name:r,on:[{events:[...x.length?[{signal:x.join(" || ")}]:[],...o?[{signal:fh}]:[]],update:v}]})}else{if(!co.defined(t)){const l=i+kO,c=s.map(f=>{const d=f.channel,{data:h,visual:p}=f.signals,g=Q(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=Tr(m)?"+":"";return`(!isArray(${h}) || (${y}invert(${g}, ${p})[0] === ${y}${h}[0] && ${y}invert(${g}, ${p})[1] === ${y}${h}[1]))`});c.length&&n.push({name:l,value:{},on:[{events:s.map(f=>({scale:e.scaleName(f.channel)})),update:c.join(" && ")+` ? ${l} : {}`}]})}const a=s.map(l=>l.signals.data),u=`unit: ${Du(e)}, fields: ${i+ch}, values`;return n.concat({name:r,...o?{init:`{${u}: ${Su(o)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${u}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(Dt(e)&&e.hasProjection&&t.init&&(n.filter(r=>r.name===fh).length||n.unshift({name:fh,value:null,on:[{events:"timer{1}",update:`${fh} === null ? {} : ${fh}`}]})),n),marks:(e,t,n)=>{const i=t.name,{x:r,y:s}=t.project.hasChannel,o=r==null?void 0:r.signals.visual,a=s==null?void 0:s.signals.visual,u=`data(${Q(t.name+Fu)})`;if(co.defined(t)||!r&&!s)return n;const l={x:r!==void 0?{signal:`${o}[0]`}:{value:0},y:s!==void 0?{signal:`${a}[0]`}:{value:0},x2:r!==void 0?{signal:`${o}[1]`}:{field:{group:"width"}},y2:s!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const m of Y(l))l[m]=[{test:`${u}.length && ${u}[0].unit === ${Du(e)}`,...l[m]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,p=Y(h).reduce((m,y)=>(m[y]=[{test:[r!==void 0&&`${o}[0] !== ${o}[1]`,s!==void 0&&`${a}[0] !== ${a}[1]`].filter(b=>b).join(" && "),value:h[y]},{value:null}],m),{}),g=d??(t.translate?"move":null);return[{name:`${i+Ac}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:l}},...n,{name:i+Ac,type:"rect",clip:!0,encode:{enter:{...g?{cursor:{value:g}}:{},fill:{value:"transparent"}},update:{...l,...p}}}]}};function Pge(e,t,n,i){const r=!e.hasProjection,s=n.channel,o=n.signals.visual,a=Q(r?e.scaleName(s):e.projectionName()),u=d=>`scale(${a}, ${d})`,l=e.getSizeSignalRef(s===$t?"width":"height").signal,c=`${s}(unit)`,f=t.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${c}, ${c}]`},{events:h,update:`[${o}[0], clamp(${c}, 0, ${l})]`}],[]);if(r){const d=n.signals.data,h=co.defined(t),p=e.getScaleComponent(s),g=p?p.get("type"):void 0,m=i?{init:Su(i,!0,u)}:{value:[]};return f.push({events:{signal:t.name+kO},update:Tr(g)?`[${u(`${d}[0]`)}, ${u(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:o,...m,on:f},{name:d,...i?{init:Su(i)}:{},on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${a}, ${o})`}]}]}else{const d=s===$t?0:1,h=t.name+AO,p=i?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:o,...p,on:f}]}}function $c({model:e,channelDef:t,vgChannel:n,invalidValueRef:i,mainRefFn:r}){const s=sh(t)&&t.condition;let o=[];s&&(o=oe(s).map(l=>{const c=r(l);if(F0e(l)){const{param:f,empty:d}=l;return{test:fL(e,{param:f,empty:d}),...c}}else return{test:_m(e,l.test),...c}})),i!==void 0&&o.push(i);const a=r(t);return a!==void 0&&o.push(a),o.length>1||o.length===1&&o[0].test?{[n]:o}:o.length===1?{[n]:o[0]}:{}}function $w(e,t="text"){const n=e.encoding[t];return $c({model:e,channelDef:n,vgChannel:t,mainRefFn:i=>cm(i,e.config),invalidValueRef:void 0})}function cm(e,t,n="datum"){if(e){if(Nr(e))return Et(e.value);if(Ne(e)){const{format:i,formatType:r}=X1(e);return H_({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function $O(e,t={}){const{encoding:n,markDef:i,config:r,stack:s}=e,o=n.tooltip;if(W(o))return{tooltip:FO({tooltip:o},s,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return $c({model:e,channelDef:o,vgChannel:"tooltip",mainRefFn:l=>{const c=cm(l,r,a);if(c)return c;if(l===null)return;let f=gt("tooltip",i,r);if(f===!0&&(f={content:"encoding"}),se(f))return{value:f};if(re(f))return me(f)?f:f.content==="encoding"?FO(n,s,r,t):{signal:a}},invalidValueRef:void 0})}}function SO(e,t,n,{reactiveGeom:i}={}){const r={...n,...n.tooltipFormat},s=new Set,o=i?"datum.datum":"datum",a=[];function u(c,f){const d=gu(f),h=ei(c)?c:{...c,type:e[d].type},p=h.title||K_(h,r),g=oe(p).join(", ").replaceAll(/"/g,'\\"');let m;if(Bt(f)){const y=f==="x"?"x2":"y2",b=Rr(e[y]);if(mn(h.bin)&&b){const v=ne(h,{expr:o}),x=ne(b,{expr:o}),{format:_,formatType:E}=X1(h);m=ih(v,x,_,E,r),s.add(y)}}if((Bt(f)||f===tr||f===Ar)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:b}=X1(h);m=H_({fieldOrDatumDef:h,format:y,formatType:b,expr:o,config:r,normalizeStack:!0}).signal}m??(m=cm(h,r,o).signal),a.push({channel:f,key:g,value:m})}J_(e,(c,f)=>{J(c)?u(c,f):G1(c)&&u(c.condition,f)});const l={};for(const{channel:c,key:f,value:d}of a)!s.has(c)&&!l[f]&&(l[f]=d);return l}function FO(e,t,n,{reactiveGeom:i}={}){const r=SO(e,t,n,{reactiveGeom:i}),s=ia(r).map(([o,a])=>`"${o}": ${a}`);return s.length>0?{signal:`{${s.join(", ")}}`}:void 0}function zge(e){const{markDef:t,config:n}=e,i=gt("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...Bge(e),...Uge(e)}}function Bge(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=gt("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:ue(gde,t)?{}:{ariaRoleDescription:{value:t}}}function Uge(e){const{encoding:t,markDef:n,config:i,stack:r}=e,s=t.description;if(s)return $c({model:e,channelDef:s,vgChannel:"description",mainRefFn:u=>cm(u,e.config),invalidValueRef:void 0});const o=gt("description",n,i);if(o!=null)return{description:Et(o)};if(i.aria===!1)return{};const a=SO(t,r,i);if(!ht(a))return{description:{signal:ia(a).map(([u,l],c)=>`"${c>0?"; ":""}${u}: " + (${l})`).join(" + ")}}}function vn(e,t,n={}){const{markDef:i,encoding:r,config:s}=t,{vgChannel:o}=n;let{defaultRef:a,defaultValue:u}=n;const l=r[e];a===void 0&&(u??(u=gt(e,i,s,{vgChannel:o,ignoreVgConfig:!sh(l)})),u!==void 0&&(a=Et(u)));const c={markDef:i,config:s,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=GN({...c,scaleChannel:e,channelDef:l});return $c({model:t,channelDef:l,vgChannel:o??e,invalidValueRef:f,mainRefFn:h=>W_({...c,channel:e,channelDef:h,stack:null,defaultRef:a})})}function DO(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:s}=n,o=t.filled??gt("filled",n,r),a=qe(["bar","point","circle","square","geoshape"],s)?"transparent":void 0,u=gt(o===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[o===!0&&"color"]??a,l=gt(o===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[o===!1&&"color"],c=o?"fill":"stroke",f={...u?{fill:Et(u)}:{},...l?{stroke:Et(l)}:{}};return n.color&&(o?n.fill:n.stroke)&&Z(hN("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...vn("color",e,{vgChannel:c,defaultValue:o?u:l}),...vn("fill",e,{defaultValue:i.fill?u:void 0}),...vn("stroke",e,{defaultValue:i.stroke?l:void 0})}}function jge(e){const{encoding:t,mark:n}=e,i=t.order;return!ha(n)&&Nr(i)?$c({model:e,channelDef:i,vgChannel:"zindex",mainRefFn:r=>Et(r.value),invalidValueRef:void 0}):{}}function Sc({channel:e,markDef:t,encoding:n={},model:i,bandPosition:r}){const s=`${e}Offset`,o=t[s],a=n[s];if((s==="xOffset"||s==="yOffset")&&a)return{offsetType:"encoding",offset:W_({channel:s,channelDef:a,markDef:t,config:i==null?void 0:i.config,scaleName:i.scaleName(s),scale:i.getScaleComponent(s),stack:null,defaultRef:Et(o),bandPosition:r})};const u=t[s];return u?{offsetType:"visual",offset:u}:{}}function ti(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:s,config:o,stack:a}=t,u=r[e],l=r[gs(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=Sc({channel:e,markDef:s,encoding:r,model:t,bandPosition:.5}),p=Sw({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),g=!u&&Bt(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:qge({channel:e,channelDef:u,channel2Def:l,markDef:s,config:o,scaleName:c,scale:f,stack:a,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return g?{[i||e]:g}:void 0}function qge(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:s,markDef:o}=e;if(Ne(n)&&r&&t===r.fieldChannel){if(J(n)){let a=n.bandPosition;if(a===void 0&&o.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return q1({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:s})}return Cu(n,i,{suffix:"end"},{offset:s})}return q_(e)}function Sw({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:s,config:o}=e;return()=>{const a=gu(n),u=ca(n),l=gt(n,s,o,{vgChannel:u});if(l!==void 0)return nh(n,l);switch(t){case"zeroOrMin":return TO({scaleName:i,scale:r,mode:"zeroOrMin",mainChannel:a,config:o});case"zeroOrMax":return TO({scaleName:i,scale:r,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:a,config:o});case"mid":return{...e[mi(n)],mult:.5}}}}function TO({mainChannel:e,config:t,...n}){const i=HN(n),{mode:r}=n;if(i)return i;switch(e){case"radius":{if(r==="zeroOrMin")return{value:0};const{widthSignal:s,heightSignal:o}=r.zeroOrMax;return{signal:`min(${s},${o})/2`}}case"theta":return r==="zeroOrMin"?{value:0}:{signal:"2*PI"};case"x":return r==="zeroOrMin"?{value:0}:{field:{group:"width"}};case"y":return r==="zeroOrMin"?{field:{group:"height"}}:{value:0}}}const Wge={left:"x",center:"xc",right:"x2"},Hge={top:"y",middle:"yc",bottom:"y2"};function MO(e,t,n,i="middle"){if(e==="radius"||e==="theta")return ca(e);const r=e==="x"?"align":"baseline",s=gt(r,t,n);let o;return me(s)?(Z(Kde(r)),o=void 0):o=s,e==="x"?Wge[o||(i==="top"?"left":"center")]:Hge[o||i]}function fm(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?NO(e,t,{defaultPos:n,defaultPos2:i}):ti(e,t,{defaultPos:n})}function NO(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:s}=t,o=gs(e),a=mi(e),u=Gge(t,i,o),l=u[a]?MO(e,r,s):ca(e);return{...ti(e,t,{defaultPos:n,vgChannel:l}),...u}}function Gge(e,t,n){const{encoding:i,mark:r,markDef:s,stack:o,config:a}=e,u=gu(n),l=mi(n),c=ca(n),f=i[u],d=e.scaleName(u),h=e.getScaleComponent(u),{offset:p}=n in i||n in s?Sc({channel:n,markDef:s,encoding:i,model:e}):Sc({channel:u,markDef:s,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=mi(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const g=Vge({channel:n,channelDef:f,channel2Def:i[n],markDef:s,config:a,scaleName:d,scale:h,stack:o,offset:p,defaultRef:void 0});return g!==void 0?{[c]:g}:dm(n,s)||dm(n,{[n]:m_(n,s,a.style),[l]:m_(l,s,a.style)})||dm(n,a[r])||dm(n,a.mark)||{[c]:Sw({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function Vge({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:u,defaultRef:l}){return Ne(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?Cu(t,s,{suffix:"start"},{offset:u}):q_({channel:e,channelDef:n,scaleName:s,scale:o,stack:a,markDef:i,config:r,offset:u,defaultRef:l})}function dm(e,t){const n=mi(e),i=ca(e);if(t[i]!==void 0)return{[i]:nh(e,t[i])};if(t[e]!==void 0)return{[i]:nh(e,t[e])};if(t[n]){const r=t[n];if(Eu(r))Z(Wde(n));else return{[n]:nh(e,r)}}}function fo(e,t){const{config:n,encoding:i,markDef:r}=e,s=r.type,o=gs(t),a=mi(t),u=i[t],l=i[o],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=r.orient,h=i[a]??i.size??gt("size",r,n,{vgChannel:a}),p=UM(t),g=s==="bar"&&(t==="x"?d==="vertical":d==="horizontal")||s==="tick"&&(t==="y"?d==="vertical":d==="horizontal");return J(u)&&(_t(u.bin)||mn(u.bin)||u.timeUnit&&!l)&&!(h&&!Eu(h))&&!i[p]&&!on(f)?Kge({fieldDef:u,fieldDef2:l,channel:t,model:e}):(Ne(u)&&on(f)||g)&&!l?Xge(u,t,e):NO(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function Yge(e,t,n,i,r,s,o){if(Eu(r))if(n){const u=n.get("type");if(u==="band"){let l=`bandwidth('${t}')`;r.band!==1&&(l=`${r.band} * ${l}`);const c=ys("minBandSize",{type:o},i);return{signal:c?`max(${Dr(c)}, ${l})`:l}}else r.band!==1&&(Z(ehe(u)),r=void 0)}else return{mult:r.band,field:{group:e}};else{if(me(r))return r;if(r)return{value:r}}if(n){const u=n.get("range");if(yu(u)&&Ze(u.step))return{value:u.step-2}}if(!s){const{bandPaddingInner:u,barBandPaddingInner:l,rectBandPaddingInner:c,tickBandPaddingInner:f}=i.scale,d=zt(u,o==="tick"?f:o==="bar"?l:c);if(me(d))return{signal:`(1 - (${d.signal})) * ${e}`};if(Ze(d))return{signal:`${1-d} * ${e}`}}return{value:fw(i.view,e)-2}}function Xge(e,t,n){var k,S;const{markDef:i,encoding:r,config:s,stack:o}=n,a=i.orient,u=n.scaleName(t),l=n.getScaleComponent(t),c=mi(t),f=gs(t),d=UM(t),h=n.scaleName(d),p=n.getScaleComponent(a_(t)),g=i.type==="tick"||a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(r.size||i.size)&&(g?m=vn("size",n,{vgChannel:c,defaultRef:Et(i.size)}):Z(rhe(i.type)));const y=!!m,b=nR({channel:t,fieldDef:e,markDef:i,config:s,scaleType:(k=l||p)==null?void 0:k.get("type"),useVlSizeChannel:g});m=m||{[c]:Yge(c,h||u,p||l,s,b,!!e,i.type)};const v=((S=l||p)==null?void 0:S.get("type"))==="band"&&Eu(b)&&!y?"top":"middle",x=MO(t,i,s,v),_=x==="xc"||x==="yc",{offset:E,offsetType:w}=Sc({channel:t,markDef:i,encoding:r,model:n,bandPosition:_?.5:0}),C=q_({channel:t,channelDef:e,markDef:i,config:s,scaleName:u,scale:l,stack:o,offset:E,defaultRef:Sw({model:n,defaultPos:"mid",channel:t,scaleName:u,scale:l}),bandPosition:_?w==="encoding"?0:.5:me(b)?{signal:`(1-${b})/2`}:Eu(b)?(1-b.band)/2:0});if(c)return{[x]:C,...m};{const $=ca(f),O=m[c],R=E?{...O,offset:E}:O;return{[x]:C,[$]:W(C)?[C[0],{...C[1],offset:R}]:{...C,offset:R}}}}function RO(e,t,n,i,r,s,o){if(OM(e))return 0;const a=e==="x"||e==="y2",u=a?-t/2:t/2;if(me(n)||me(r)||me(i)||s){const l=Dr(n),c=Dr(r),f=Dr(i),d=Dr(s),p=s?`(${o} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${o})) : ${u})`:u,g=f?`${f} + `:"",m=l?`(${l} ? -1 : 1) * `:"",y=c?`(${c} + ${p})`:p;return{signal:g+m+y}}else return r=r||0,i+(n?-r-u:+r+u)}function Kge({fieldDef:e,fieldDef2:t,channel:n,model:i}){var S;const{config:r,markDef:s,encoding:o}=i,a=i.getScaleComponent(n),u=i.scaleName(n),l=a?a.get("type"):void 0,c=a.get("reverse"),f=nR({channel:n,fieldDef:e,markDef:s,config:r,scaleType:l}),d=(S=i.component.axes[n])==null?void 0:S[0],h=(d==null?void 0:d.get("translate"))??.5,p=Bt(n)?gt("binSpacing",s,r)??0:0,g=gs(n),m=ca(n),y=ca(g),b=ys("minBandSize",s,r),{offset:v}=Sc({channel:n,markDef:s,encoding:o,model:i,bandPosition:0}),{offset:x}=Sc({channel:g,markDef:s,encoding:o,model:i,bandPosition:0}),_=E0e({fieldDef:e,scaleName:u}),E=RO(n,p,c,h,v,b,_),w=RO(g,p,c,h,x??v,b,_),C=me(f)?{signal:`(1-${f.signal})/2`}:Eu(f)?(1-f.band)/2:.5,k=pa({fieldDef:e,fieldDef2:t,markDef:s,config:r});if(_t(e.bin)||e.timeUnit){const $=e.timeUnit&&k!==.5;return{[y]:OO({fieldDef:e,scaleName:u,bandPosition:C,offset:w,useRectOffsetField:$}),[m]:OO({fieldDef:e,scaleName:u,bandPosition:me(C)?{signal:`1-${C.signal}`}:1-C,offset:E,useRectOffsetField:$})}}else if(mn(e.bin)){const $=Cu(e,u,{},{offset:w});if(J(t))return{[y]:$,[m]:Cu(t,u,{},{offset:E})};if(mu(e.bin)&&e.bin.step)return{[y]:$,[m]:{signal:`scale("${u}", ${ne(e,{expr:"datum"})} + ${e.bin.step})`,offset:E}}}Z(bN(g))}function OO({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return q1({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:am,endSuffix:um}:{}})}const Zge=new Set(["aria","width","height"]);function rr(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?DO(e):{};return{...Jge(e.markDef,t),...LO("fill",n),...LO("stroke",i),...vn("opacity",e),...vn("fillOpacity",e),...vn("strokeOpacity",e),...vn("strokeWidth",e),...vn("strokeDash",e),...jge(e),...$O(e),...$w(e,"href"),...zge(e)}}function LO(e,t){return t?{[e]:t}:{}}function Jge(e,t){return pde.reduce((n,i)=>(!Zge.has(i)&&X(e,i)&&t[i]!=="ignore"&&(n[i]=Et(e[i])),n),{})}function Fw(e){const{config:t,markDef:n}=e,i=new Set;if(e.forEachFieldDef((r,s)=>{var l;let o;if(!ms(s)||!(o=e.getScaleType(s)))return;const a=M1(r.aggregate),u=j_({scaleChannel:s,markDef:n,config:t,scaleType:o,isCountAggregate:a});if(x0e(u)){const c=e.vgField(s,{expr:"datum",binSuffix:(l=e.stack)!=null&&l.impute?"mid":void 0});c&&i.add(c)}}),i.size>0)return{defined:{signal:[...i].map(s=>I1(s,!0)).join(" && ")}}}function IO(e,t){if(t!==void 0)return{[e]:Et(t)}}const Dw="voronoi",PO={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(Dw)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,s=e.mark;if(ha(s))return Z(xde(s)),n;const o={name:e.getName(Dw),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...$O(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,u=!1;return n.forEach((l,c)=>{const f=l.name??"";f===e.component.mark[0].name?a=c:f.includes(Dw)&&(u=!0)}),u||n.splice(a+1,0,o),n}},zO={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!sw(e.bind),parse:(e,t,n)=>XO(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,s=t.bind,o=t.init&&t.init[0],a=PO.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((u,l)=>{const c=At(`${i}_${u.field}`);n.filter(d=>d.name===c).length||n.unshift({name:c,...o?{init:Su(o[l])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${Q(u.field)}] : null`}]:[],bind:s[u.field]??s[u.channel]??s})}),n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(l=>l.name===i+ho),o=i+ch,a=r.items.map(l=>At(`${i}_${l.field}`)),u=a.map(l=>`${l} !== null`).join(" && ");return a.length&&(s.update=`${u} ? {fields: ${o}, values: [${a.join(", ")}]} : null`),delete s.value,delete s.on,n}},hm="_toggle",BO={defined:e=>e.type==="point"&&!ks(e)&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+hm,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+ho,i=t.name+hm;return`${i} ? null : ${n}, `+(t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${Du(e)}}, `)+`${i} ? ${n} : null`}},Qge={defined:e=>e.clear!==void 0&&e.clear!==!1&&!ks(e),parse:(e,t)=>{t.clear&&(t.clear=se(t.clear)?ta(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(zO.defined(t))for(const i of t.project.items){const r=n.findIndex(s=>s.name===At(`${t.name}_${i.field}`));r!==-1&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(r,s){r!==-1&&n[r].on&&n[r].on.push({events:t.clear,update:s})}if(t.type==="interval")for(const r of t.project.items){const s=n.findIndex(o=>o.name===r.signals.visual);if(i(s,"[0, 0]"),s===-1){const o=n.findIndex(a=>a.name===r.signals.data);i(o,"null")}}else{let r=n.findIndex(s=>s.name===t.name+ho);i(r,"null"),BO.defined(t)&&(r=n.findIndex(s=>s.name===t.name+hm),i(r,"false"))}return n}},UO={defined:e=>{const t=e.resolve==="global"&&e.bind&&sw(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==Or;return t&&!n&&Z(Cde),t&&n},parse:(e,t,n)=>{const i=De(n);if(i.select=se(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},XO(t,i),re(n.select)&&(n.select.on||n.select.clear)){const o='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=oe(a.filter??[]),a.filter.includes(o)||a.filter.push(o)}const r=ow(t.bind)?t.bind.legend:"click",s=se(r)?ta(r,"view"):oe(r);t.bind={legend:{merge:s}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=ow(t.bind)&&t.bind.legend,s=o=>a=>{const u=De(a);return u.markname=o,u};for(const o of t.project.items){if(!o.hasLegend)continue;const a=`${At(o.field)}_legend`,u=`${i}_${a}`;if(n.filter(c=>c.name===u).length===0){const c=r.merge.map(s(`${a}_symbols`)).concat(r.merge.map(s(`${a}_labels`))).concat(r.merge.map(s(`${a}_entries`)));n.unshift({name:u,...t.init?{}:{value:null},on:[{events:c,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${u}`,force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(d=>d.name===i+ho),o=i+ch,a=r.items.filter(d=>d.hasLegend).map(d=>At(`${i}_${At(d.field)}_legend`)),l=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${o}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?s.on.push({events:a.map(d=>({signal:d})),update:l}):a.length>0&&(s.update=l,delete s.value,delete s.on);const c=n.find(d=>d.name===i+hm),f=ow(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function e1e(e,t,n){var r;const i=(r=e.fieldDef(t))==null?void 0:r.field;for(const s of gn(e.component.selection??{})){const o=s.project.hasField[i]??s.project.hasChannel[t];if(o&&UO.defined(s)){const a=n.get("selections")??[];a.push(s.name),n.set("selections",a,!1),o.hasLegend=!0}}}const jO="_translate_anchor",qO="_translate_delta",t1e={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=co.defined(t),s=i+jO,{x:o,y:a}=t.project.hasChannel;let u=ta(t.translate,"scope");return r||(u=u.map(l=>(l.between[0].markname=i+Ac,l))),n.push({name:s,value:{},on:[{events:u.map(l=>l.between[0]),update:"{x: x(unit), y: y(unit)"+(o!==void 0?`, extent_x: ${r?kw(e,$t):`slice(${o.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${r?kw(e,rn):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:i+qO,value:{},on:[{events:u,update:`{x: ${s}.x - x(unit), y: ${s}.y - y(unit)}`}]}),o!==void 0&&WO(e,t,o,"width",n),a!==void 0&&WO(e,t,a,"height",n),n}};function WO(e,t,n,i,r){const s=t.name,o=s+jO,a=s+qO,u=n.channel,l=co.defined(t),c=r.find(_=>_.name===n.signals[l?"data":"visual"]),f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(u),h=d&&d.get("type"),p=d&&d.get("reverse"),g=l?u===$t?p?"":"-":p?"-":"":"",m=`${o}.extent_${u}`,y=`${g}${a}.${u} / ${l?`${f}`:`span(${m})`}`,b=!l||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",v=l?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",x=`${b}(${m}, ${y}${v})`;c.on.push({events:{signal:a},update:l?x:`clampRange(${x}, 0, ${f})`})}const HO="_zoom_anchor",GO="_zoom_delta",n1e={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=co.defined(t),s=i+GO,{x:o,y:a}=t.project.hasChannel,u=Q(e.scaleName($t)),l=Q(e.scaleName(rn));let c=ta(t.zoom,"scope");return r||(c=c.map(f=>(f.markname=i+Ac,f))),n.push({name:i+HO,on:[{events:c,update:r?"{"+[u?`x: invert(${u}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter(f=>f).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:s,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),o!==void 0&&VO(e,t,o,"width",n),a!==void 0&&VO(e,t,a,"height",n),n}};function VO(e,t,n,i,r){const s=t.name,o=n.channel,a=co.defined(t),u=r.find(b=>b.name===n.signals[a?"data":"visual"]),l=e.getSizeSignalRef(i).signal,c=e.getScaleComponent(o),f=c&&c.get("type"),d=a?kw(e,o):u.name,h=s+GO,p=`${s}${HO}.${o}`,g=!a||!c?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${c.get("exponent")??1}`:f==="symlog"?`, ${c.get("constant")??1}`:"":"",y=`${g}(${d}, ${p}, ${h}${m})`;u.on.push({events:{signal:h},update:a?y:`clampRange(${y}, 0, ${l})`})}const Fu="_store",ho="_tuple",i1e="_modify",YO="vlSelectionResolve",pm=[Fge,Ige,Age,BO,zO,co,UO,Qge,t1e,n1e,PO];function r1e(e){let t=e.parent;for(;t&&!Oi(t);)t=t.parent;return t}function Du(e,{escape:t}={escape:!0}){let n=t?Q(e.name):e.name;const i=r1e(e);if(i){const{facet:r}=i;for(const s of ir)r[s]&&(n+=` + '__facet_${s}_' + (facet[${Q(i.vgField(s))}])`)}return n}function Tw(e){return gn(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function XO(e,t){(se(t.select)||!t.select.on)&&delete e.events,(se(t.select)||!t.select.clear)&&delete e.clear,(se(t.select)||!t.select.toggle)&&delete e.toggle}function ks(e){var t;return(t=e.events)==null?void 0:t.find(n=>"type"in n&&n.type==="timer")}const s1e="RawCode",o1e="Literal",a1e="Property",u1e="Identifier",l1e="ArrayExpression",c1e="BinaryExpression",f1e="CallExpression",d1e="ConditionalExpression",h1e="LogicalExpression",p1e="MemberExpression",g1e="ObjectExpression",m1e="UnaryExpression";function Lr(e){this.type=e}Lr.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=y1e(this),n=0,i=t.length;n",As[Tu]="Identifier",As[ba]="Keyword",As[mm]="Null",As[Mu]="Numeric",As[bi]="Punctuator",As[hh]="String",As[b1e]="RegularExpression";var v1e="ArrayExpression",x1e="BinaryExpression",_1e="CallExpression",w1e="ConditionalExpression",KO="Identifier",E1e="Literal",C1e="LogicalExpression",k1e="MemberExpression",A1e="ObjectExpression",$1e="Property",S1e="UnaryExpression",an="Unexpected token %0",F1e="Unexpected number",D1e="Unexpected string",T1e="Unexpected identifier",M1e="Unexpected reserved word",N1e="Unexpected end of input",Mw="Invalid regular expression",Nw="Invalid regular expression: missing /",ZO="Octal literals are not allowed in strict mode.",R1e="Duplicate data property in object literal not allowed in strict mode",xn="ILLEGAL",ph="Disabled.",O1e=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),L1e=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function ym(e,t){if(!e)throw new Error("ASSERT: "+t)}function po(e){return e>=48&&e<=57}function Rw(e){return"0123456789abcdefABCDEF".includes(e)}function gh(e){return"01234567".includes(e)}function I1e(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function mh(e){return e===10||e===13||e===8232||e===8233}function yh(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&O1e.test(String.fromCharCode(e))}function bm(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&L1e.test(String.fromCharCode(e))}const P1e={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function JO(){for(;j1114111||e!=="}")&&tt({},an,xn),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function QO(){var e,t;for(e=ge.charCodeAt(j++),t=String.fromCharCode(e),e===92&&(ge.charCodeAt(j)!==117&&tt({},an,xn),++j,e=Ow("u"),(!e||e==="\\"||!yh(e.charCodeAt(0)))&&tt({},an,xn),t=e);j>>=")return j+=4,{type:bi,value:o,start:e,end:j};if(s=o.substr(0,3),s===">>>"||s==="<<="||s===">>=")return j+=3,{type:bi,value:s,start:e,end:j};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return j+=2,{type:bi,value:r,start:e,end:j};if(r==="//"&&tt({},an,xn),"<>=!+-*%&|^/".includes(i))return++j,{type:bi,value:i,start:e,end:j};tt({},an,xn)}function j1e(e){let t="";for(;jRd(e,["_"],t.code),parameter:(e,t)=>Rd(e,["datum","_"],t.code),event:(e,t)=>Rd(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return Rd(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:i}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const s in i){const o="o["+Q(s)+"]";r+=`$=${i[s].code};if(${o}!==$)${o}=$,m=1;`}return r+=fae(i,n),r+="return m;",Rd(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(Q).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const i=(s,o)=>{const a=t[o];let u,l;return s.path?(u=`a${s.path}`,l=`b${s.path}`):((n=n||{})["f"+o]=s,u=`this.f${o}(a)`,l=`this.f${o}(b)`),pae(u,l,-a,a)},r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function mae(e){const t=this;dae(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function yae(e){const t=this;if(e.params){const n=t.get(e.id);n||q("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function bae(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=W(r)?r.map(s=>QD(s,n,t)):QD(r,n,t)}return t}function QD(e,t,n){if(!e||!re(e))return e;for(let i=0,r=eT.length,s;ir&&r.$tupleid?_e:r);return t.fn[n]||(t.fn[n]=k2(i,e.$order,t.expr.codegen))}function Cae(e,t){const n=e.$encode,i={};for(const r in n){const s=n[r];i[r]=ii(t.encodeExpression(s.$expr),s.$fields),i[r].output=s.$output}return i}function kae(e,t){return t}function Aae(e,t){const n=e.$subflow;return function(i,r,s){const o=t.fork().parse(n),a=o.get(n.operators[0].id),u=o.signals.parent;return u&&u.set(s),a.detachSubflow=()=>t.detach(o),a}}function $ae(){return _e}function Sae(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):void 0,i=e.stream!=null?t.get(e.stream):void 0,r;e.source?i=t.events(e.source,e.type,n):e.merge&&(r=e.merge.map(s=>t.get(s)),i=r[0].merge.apply(r[0],r.slice(1))),e.between&&(r=e.between.map(s=>t.get(s)),i=i.between(r[0],r[1])),e.filter&&(i=i.filter(n)),e.throttle!=null&&(i=i.throttle(+e.throttle)),e.debounce!=null&&(i=i.debounce(+e.debounce)),i==null&&q("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}function Fae(e){var t=this,n=re(n=e.source)?n.$ref:n,i=t.get(n),r=null,s=e.update,o=void 0;i||q("Source not defined: "+e.source),r=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),s&&s.$expr&&(s.$params&&(o=t.parseParameters(s.$params)),s=t.handlerExpression(s.$expr)),t.update(e,i,r,s,o)}const Dae={skip:!0};function Tae(e){var t=this,n={};if(e.signals){var i=n.signals={};Object.keys(t.signals).forEach(s=>{const o=t.signals[s];e.signals(s,o)&&(i[s]=o.value)})}if(e.data){var r=n.data={};Object.keys(t.data).forEach(s=>{const o=t.data[s];e.data(s,o)&&(r[s]=o.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(s=>s.getState(e))),n}function Mae(e){var t=this,n=t.dataflow,i=e.data,r=e.signals;Object.keys(r||{}).forEach(s=>{n.update(t.signals[s],r[s],Dae)}),Object.keys(i||{}).forEach(s=>{n.pulse(t.data[s].input,n.changeset().remove(Ui).insert(i[s]))}),(e.subcontext||[]).forEach((s,o)=>{const a=t.subcontext[o];a&&a.setState(s)})}function tT(e,t,n,i){return new nT(e,t,n,i)}function nT(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||gae,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function iT(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}nT.prototype=iT.prototype={fork(){const e=new iT(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(n=>n!==e);const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,i=n.dataflow,r=e.value;if(n.set(e.id,t),hae(e.type)&&r&&(r.$ingest?i.ingest(t,r.$ingest,r.$format):r.$request?i.preload(t,r.$request,r.$format):i.pulse(t,i.changeset().insert(r))),e.root&&(n.root=t),e.parent){let s=n.get(e.parent.$ref);s?(i.connect(s,[t]),t.targets().add(s)):(n.unresolved=n.unresolved||[]).push(()=>{s=n.get(e.parent.$ref),i.connect(s,[t]),t.targets().add(s)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const s in e.data){const o=n.data[s]||(n.data[s]={});e.data[s].forEach(a=>o[a]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[gx(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,i,r){this.dataflow.on(t,n,i,r,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:lae,parseOperator:mae,parseOperatorParameters:yae,parseParameters:bae,parseStream:Sae,parseUpdate:Fae,getState:Tae,setState:Mae};function Nae(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),rT(t,e.description()))}function rT(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function Rae(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const mx="default";function Oae(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:mx,item:null}));e.on(e.events("view","pointermove"),t,(n,i)=>{const r=t.value,s=r?se(r)?r:r.user:mx,o=i.item&&i.item.cursor||null;return r&&s===r.user&&o==r.item?r:{user:s,item:o}}),e.add(null,function(n){let i=n.cursor,r=this.value;return se(i)||(r=i.item,i=i.user),yx(e,i&&i!==mx?i:r||i),r},{cursor:t})}function yx(e,t){const n=e.globalCursor()?typeof document<"u"&&document.body:e.container();if(n)return t==null?n.style.removeProperty("cursor"):n.style.cursor=t}function Qg(e,t){var n=e._runtime.data;return ue(n,t)||q("Unrecognized data set: "+t),n[t]}function Lae(e,t){return arguments.length<2?Qg(this,e).values.value:e1.call(this,e,Ao().remove(Ui).insert(t))}function e1(e,t){NE(t)||q("Second argument to changes must be a changeset.");const n=Qg(this,e);return n.modified=!0,this.pulse(n.input,t)}function Iae(e,t){return e1.call(this,e,Ao().insert(t))}function Pae(e,t){return e1.call(this,e,Ao().remove(t))}function sT(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function oT(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function t1(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function zae(e){var t=t1(e),n=sT(e),i=oT(e);e._renderer.background(e.background()),e._renderer.resize(n,i,t),e._handler.origin(t),e._resizeListeners.forEach(r=>{try{r(n,i)}catch(s){e.error(s)}})}function Bae(e,t,n){var i=e._renderer,r=i&&i.canvas(),s,o,a;return r&&(a=t1(e),o=t.changedTouches?t.changedTouches[0]:t,s=kp(o,r),s[0]-=a[0],s[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=Uae(e,n,s),t}function Uae(e,t,n){const i=t?t.mark.marktype==="group"?t:t.mark.group:null;function r(o){var a=i,u;if(o){for(u=t;u;u=u.mark.group)if(u.mark.name===o){a=u;break}}return a&&a.mark&&a.mark.interactive?a:{}}function s(o){if(!o)return n;se(o)&&(o=r(o));const a=n.slice();for(;o;)a[0]-=o.x||0,a[1]-=o.y||0,o=o.mark&&o.mark.group;return a}return{view:kn(e),item:kn(t||{}),group:r,xy:s,x:o=>s(o)[0],y:o=>s(o)[1]}}const aT="view",jae="timer",qae="window",Wae={trap:!1};function Hae(e){const t=Ie({defaults:{}},e),n=(i,r)=>{r.forEach(s=>{W(i[s])&&(i[s]=lr(i[s]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function uT(e,t,n,i){e._eventListeners.push({type:n,sources:oe(t),handler:i})}function Gae(e,t){var n=e._eventConfig.defaults,i=n.prevent,r=n.allow;return i===!1||r===!0?!1:i===!0||r===!1?!0:i?i[t]:r?!r[t]:e.preventDefault()}function n1(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return i===!1||re(i)&&!i[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function Vae(e,t,n){var i=this,r=new _0(n),s=function(l,c){i.runAsync(null,()=>{e===aT&&Gae(i,t)&&l.preventDefault(),r.receive(Bae(i,l,c))})},o;if(e===jae)n1(i,"timer",t)&&i.timer(s,t);else if(e===aT)n1(i,"view",t)&&i.addEventListener(t,s,Wae);else if(e===qae?n1(i,"window",t)&&typeof window<"u"&&(o=[window]):typeof document<"u"&&n1(i,"selector",t)&&(o=Array.from(document.querySelectorAll(e))),!o)i.warn("Can not resolve event source: "+e);else{for(var a=0,u=o.length;a=0;)t[r].stop();for(r=i.length;--r>=0;)for(o=i[r],s=o.sources.length;--s>=0;)o.sources[s].removeEventListener(o.type,o.handler);for(e&&e.call(this,this._handler,null,null,null),r=n.length;--r>=0;)u=n[r].type,a=n[r].handler,this._handler.off(u,a);return this}function Di(e,t,n){const i=document.createElement(e);for(const r in t)i.setAttribute(r,t[r]);return n!=null&&(i.textContent=n),i}const Kae="vega-bind",Zae="vega-bind-name",Jae="vega-bind-radio";function Qae(e,t,n){if(!t)return;const i=n.param;let r=n.state;return r||(r=n.state={elements:null,active:!1,set:null,update:o=>{o!=e.signal(i.signal)&&e.runAsync(null,()=>{r.source=!0,e.signal(i.signal,o)})}},i.debounce&&(r.update=A2(i.debounce,r.update))),(i.input==null&&i.element?eue:nue)(r,t,i,e),r.active||(e.on(e._signals[i.signal],null,()=>{r.source?r.source=!1:r.set(e.signal(i.signal))}),r.active=!0),r}function eue(e,t,n,i){const r=n.event||"input",s=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,s),uT(i,t,r,s),e.set=o=>{t.value=o,t.dispatchEvent(tue(r))}}function tue(e){return typeof Event<"u"?new Event(e):{type:e}}function nue(e,t,n,i){const r=i.signal(n.signal),s=Di("div",{class:Kae}),o=n.input==="radio"?s:s.appendChild(Di("label"));o.appendChild(Di("span",{class:Zae},n.name||n.signal)),t.appendChild(s);let a=iue;switch(n.input){case"checkbox":a=rue;break;case"select":a=sue;break;case"radio":a=oue;break;case"range":a=aue;break}a(e,o,n,r)}function iue(e,t,n,i){const r=Di("input");for(const s in n)s!=="signal"&&s!=="element"&&r.setAttribute(s==="input"?"type":s,n[s]);r.setAttribute("name",n.signal),r.value=i,t.appendChild(r),r.addEventListener("input",()=>e.update(r.value)),e.elements=[r],e.set=s=>r.value=s}function rue(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const s=Di("input",r);t.appendChild(s),s.addEventListener("change",()=>e.update(s.checked)),e.elements=[s],e.set=o=>s.checked=!!o||null}function sue(e,t,n,i){const r=Di("select",{name:n.signal}),s=n.labels||[];n.options.forEach((o,a)=>{const u={value:o};i1(o,i)&&(u.selected=!0),r.appendChild(Di("option",u,(s[a]||o)+""))}),t.appendChild(r),r.addEventListener("change",()=>{e.update(n.options[r.selectedIndex])}),e.elements=[r],e.set=o=>{for(let a=0,u=n.options.length;a{const u={type:"radio",name:n.signal,value:o};i1(o,i)&&(u.checked=!0);const l=Di("input",u);l.addEventListener("change",()=>e.update(o));const c=Di("label",{},(s[a]||o)+"");return c.prepend(l),r.appendChild(c),l}),e.set=o=>{const a=e.elements,u=a.length;for(let l=0;l{u.textContent=a.value,e.update(+a.value)};a.addEventListener("input",l),a.addEventListener("change",l),e.elements=[a],e.set=c=>{a.value=c,u.textContent=c}}function i1(e,t){return e===t||e+""==t+""}function dT(e,t,n,i,r,s){return t=t||new i(e.loader()),t.initialize(n,sT(e),oT(e),t1(e),r,s).background(e.background())}function bx(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function uue(e,t,n,i){const r=new i(e.loader(),bx(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,t1(e),e);return t&&t.handlers().forEach(s=>{r.on(s.type,s.handler)}),r}function lue(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,s=Pp(i);e=n._el=e?vx(n,e,!0):null,Nae(n),s||n.error("Unrecognized renderer type: "+i);const o=s.handler||Hf,a=e?s.renderer:s.headless;return n._renderer=a?dT(n,n._renderer,e,a):null,n._handler=uue(n,n._handler,e,o),n._redraw=!0,e&&r!=="none"&&(t=t?n._elBind=vx(n,t,!0):e.appendChild(Di("form",{class:"vega-bindings"})),n._bind.forEach(u=>{u.param.element&&r!=="container"&&(u.element=vx(n,u.param.element,!!u.param.input))}),n._bind.forEach(u=>{Qae(n,u.element||t,u)})),n}function vx(e,t,n){if(typeof t=="string")if(typeof document<"u"){if(t=document.querySelector(t),!t)return e.error("Signal bind element not found: "+t),null}else return e.error("DOM document instance not found."),null;if(t&&n)try{t.textContent=""}catch(i){t=null,e.error(i)}return t}const Od=e=>+e||0,cue=e=>({top:e,bottom:e,left:e,right:e});function hT(e){return re(e)?{top:Od(e.top),bottom:Od(e.bottom),left:Od(e.left),right:Od(e.right)}:cue(Od(e))}async function xx(e,t,n,i){const r=Pp(t),s=r&&r.headless;return s||q("Unrecognized renderer type: "+t),await e.runAsync(),dT(e,null,null,s,n,i).renderAsync(e._scenegraph.root)}async function fue(e,t){e!==Go.Canvas&&e!==Go.SVG&&e!==Go.PNG&&q("Unrecognized image type: "+e);const n=await xx(this,e,t);return e===Go.SVG?due(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function due(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function hue(e,t){return(await xx(this,Go.Canvas,e,t)).canvas()}async function pue(e){return(await xx(this,Go.SVG,e)).svg()}function gue(e,t,n){return tT(e,xl,Nd,n).parse(t)}function mue(e){var t=this._runtime.scales;return ue(t,e)||q("Unrecognized scale or projection: "+e),t[e].value}var pT="width",gT="height",_x="padding",mT={skip:!0};function yT(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===_x?i.left+i.right:0)}function bT(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===_x?i.top+i.bottom:0)}function yue(e){var t=e._signals,n=t[pT],i=t[gT],r=t[_x];function s(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=yT(e,a.size),s()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=bT(e,a.size),s()},{size:i});const o=e.add(null,s,{pad:r});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=i.rank+1,o.rank=r.rank+1}function bue(e,t,n,i,r,s){this.runAfter(o=>{let a=0;o._autosize=0,o.width()!==n&&(a=1,o.signal(pT,n,mT),o._resizeWidth.skip(!0)),o.height()!==i&&(a=1,o.signal(gT,i,mT),o._resizeHeight.skip(!0)),o._viewWidth!==e&&(o._resize=1,o._viewWidth=e),o._viewHeight!==t&&(o._resize=1,o._viewHeight=t),(o._origin[0]!==r[0]||o._origin[1]!==r[1])&&(o._resize=1,o._origin=r),a&&o.run("enter"),s&&o.runAfter(u=>u.resize())},!1,1)}function vue(e){return this._runtime.getState(e||{data:xue,signals:_ue,recurse:!0})}function xue(e,t){return t.modified&&W(t.input.value)&&!e.startsWith("_:vega:_")}function _ue(e,t){return!(e==="parent"||t instanceof xl.proxy)}function wue(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function Eue(e,t){function n(i){e({timestamp:Date.now(),elapsed:i})}this._timers.push(Vte(n,t))}function Cue(e,t,n,i){const r=e.element();r&&r.setAttribute("title",kue(i))}function kue(e){return e==null?"":W(e)?vT(e):re(e)&&!_o(e)?Aue(e):e+""}function Aue(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(W(n)?vT(n):xT(n))}).join(` +`)}function vT(e){return"["+e.map(xT).join(", ")+"]"}function xT(e){return W(e)?"[…]":re(e)&&!_o(e)?"{…}":e}function $ue(){if(this.renderer()==="canvas"&&this._renderer._canvas){let e=null;const t=()=>{e!=null&&e();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",t),e=()=>{n.removeEventListener("change",t)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}function _T(e,t){const n=this;if(t=t||{},vl.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){const s=Ie({},e.locale,t.locale);n.locale(_E(s.number,s.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||Go.Canvas,n._scenegraph=new wA;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||Cue,n._redraw=!0,n._handler=new Hf().scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=Hae(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=gue(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map(s=>({state:null,param:Ie({},s)})),r.root&&r.root.set(i),i.source=r.data.root.input,n.pulse(r.data.root.input,n.changeset().insert(i.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=yT(n,n._width),n._viewHeight=bT(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,yue(n),Rae(n),Oae(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function r1(e,t){return ue(e._signals,t)?e._signals[t]:q("Unrecognized signal name: "+Q(t))}function wT(e,t){const n=(e._targets||[]).filter(i=>i._update&&i._update.handler===t);return n.length?n[0]:null}function ET(e,t,n,i){let r=wT(n,i);return r||(r=bx(e,()=>i(t,n.value)),r.handler=i,e.on(n,null,r)),e}function CT(e,t,n){const i=wT(t,n);return i&&t._targets.remove(i),e}te(_T,vl,{async evaluate(e,t,n){if(await vl.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,zae(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&m0(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=e!=null?e+"":null;return t!==this._desc&&rT(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const i=r1(this,e);return arguments.length===1?i.value:this.update(i,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",hT(e)):hT(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(Pp(e)||q("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(vl.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(r1(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:bue,addEventListener(e,t,n){let i=t;return n&&n.trap===!1||(i=bx(this,t),i.raw=t),this._handler.on(e,i),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),i=n.length,r,s;--i>=0;)if(s=n[i].type,r=n[i].handler,e===s&&(t===r||t===r.raw)){this._handler.off(s,r);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.includes(e)||t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return ET(this,e,r1(this,e),t)},removeSignalListener(e,t){return CT(this,r1(this,e),t)},addDataListener(e,t){return ET(this,e,Qg(this,e).values,t)},removeDataListener(e,t){return CT(this,Qg(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=yx(this,null);this._globalCursor=!!e,t&&yx(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:Eue,events:Vae,finalize:Xae,hover:Yae,data:Lae,change:e1,insert:Iae,remove:Pae,scale:mue,initialize:lue,toImageURL:fue,toCanvas:hue,toSVG:pue,getState:vue,setState:wue,_watchPixelRatio:$ue});const Sue="view",s1="[",o1="]",kT="{",AT="}",Fue=":",$T=",",Due="@",Tue=">",Mue=/[[\]{}]/,Nue={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let ST,FT;function ta(e,t,n){return ST=t||Sue,FT=n||Nue,DT(e.trim()).map(wx)}function Rue(e){return FT[e]}function Ld(e,t,n,i,r){const s=e.length;let o=0,a;for(;t=0?--o:i&&i.indexOf(a)>=0&&++o}return t}function DT(e){const t=[],n=e.length;let i=0,r=0;for(;r' after between selector: "+e;i=i.map(wx);const r=wx(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function Lue(e){const t={source:ST},n=[];let i=[0,0],r=0,s=0,o=e.length,a=0,u,l;if(e[o-1]===AT){if(a=e.lastIndexOf(kT),a>=0){try{i=Iue(e.substring(a+1,o-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),o=e.length}else throw"Unmatched right brace: "+e;a=0}if(!o)throw e;if(e[0]===Due&&(r=++a),u=Ld(e,a,Fue),u1?(t.type=n[1],r?t.markname=n[0].slice(1):Rue(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),l!=null&&(t.filter=l),i[0]&&(t.throttle=i[0]),i[1]&&(t.debounce=i[1]),t}function Iue(e){const t=e.split($T);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}function Pue(e){return re(e)?e:{type:e||"pad"}}const Id=e=>+e||0,zue=e=>({top:e,bottom:e,left:e,right:e});function Bue(e){return re(e)?e.signal?e:{top:Id(e.top),bottom:Id(e.bottom),left:Id(e.left),right:Id(e.right)}:zue(Id(e))}const tn=e=>re(e)&&!W(e)?Ie({},e):{value:e};function TT(e,t,n,i){return n!=null?(re(n)&&!W(n)||W(n)&&n.length&&re(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1):0}function pn(e,t,n){for(const i in t)TT(e,i,t[i]);for(const i in n)TT(e,i,n[i],"update")}function Ql(e,t,n){for(const i in t)n&&ue(n,i)||(e[i]=Ie(e[i]||{},t[i]));return e}function ec(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const Ex="mark",Cx="frame",kx="scope",Uue="axis",jue="axis-domain",que="axis-grid",Wue="axis-label",Hue="axis-tick",Gue="axis-title",Vue="legend",Yue="legend-band",Xue="legend-entry",Kue="legend-gradient",MT="legend-label",Zue="legend-symbol",Jue="legend-title",Que="title",ele="title-text",tle="title-subtitle";function nle(e,t,n,i,r){const s={},o={};let a,u,l,c;u="lineBreak",t==="text"&&r[u]!=null&&!ec(u,e)&&Ax(s,u,r[u]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===Cx?r.group:n===Ex?Ie({},r.mark,r[t]):null;for(u in c)l=ec(u,e)||(u==="fill"||u==="stroke")&&(ec("fill",e)||ec("stroke",e)),l||Ax(s,u,c[u]);oe(i).forEach(f=>{const d=r.style&&r.style[f];for(const h in d)ec(h,e)||Ax(s,h,d[h])}),e=Ie({},e);for(u in s)c=s[u],c.signal?(a=a||{})[u]=c:o[u]=c;return e.enter=Ie(o,e.enter),a&&(e.update=Ie(a,e.update)),e}function Ax(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const NT=e=>se(e)?Q(e):e.signal?`(${e.signal})`:RT(e);function a1(e){if(e.gradient!=null)return rle(e);let t=e.signal?`(${e.signal})`:e.color?ile(e.color):e.field!=null?RT(e.field):e.value!==void 0?Q(e.value):void 0;return e.scale!=null&&(t=sle(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${l1(e.exponent)})`),e.mult!=null&&(t+=`*${l1(e.mult)}`),e.offset!=null&&(t+=`+${l1(e.offset)}`),e.round&&(t=`round(${t})`),t}const u1=(e,t,n,i)=>`(${e}(${[t,n,i].map(a1).join(",")})+'')`;function ile(e){return e.c?u1("hcl",e.h,e.c,e.l):e.h||e.s?u1("hsl",e.h,e.s,e.l):e.l||e.a?u1("lab",e.l,e.a,e.b):e.r||e.g||e.b?u1("rgb",e.r,e.g,e.b):null}function rle(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:Q(n));for(;t.length&&Ge(t)==null;)t.pop();return t.unshift(NT(e.gradient)),`gradient(${t.join(",")})`}function l1(e){return re(e)?"("+a1(e)+")":e}function RT(e){return OT(re(e)?e:{datum:e})}function OT(e){let t,n,i;if(e.signal)t="datum",i=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(i=e.parent,t+=".datum"):i=e.group}else e.datum?(t="datum",i=e.datum):q("Invalid field reference: "+Q(e));return e.signal||(i=se(i)?jr(i).map(Q).join("]["):OT(i)),t+"["+i+"]"}function sle(e,t){const n=NT(e.scale);return e.range!=null?t=`lerp(_range(${n}), ${+e.range})`:(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(+e.band==1?"":"*"+l1(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function ole(e){let t="";return e.forEach(n=>{const i=a1(n);t+=n.test?`(${n.test})?${i}:`:i}),Ge(t)===":"&&(t+="null"),t}function LT(e,t,n,i,r,s){const o={};s=s||{},s.encoders={$encode:o},e=nle(e,t,n,i,r.config);for(const a in e)o[a]=ale(e[a],t,s,r);return s}function ale(e,t,n,i){const r={},s={};for(const o in e)e[o]!=null&&(r[o]=lle(ule(e[o]),i,n,s));return{$expr:{marktype:t,channels:r},$fields:Object.keys(s),$output:Object.keys(e)}}function ule(e){return W(e)?ole(e):a1(e)}function lle(e,t,n,i){const r=cs(e,t);return r.$fields.forEach(s=>i[s]=1),Ie(n,r.$params),r.$expr}const cle="outer",fle=["value","update","init","react","bind"];function IT(e,t){q(e+' for "outer" push: '+Q(t))}function PT(e,t){const n=e.name;if(e.push===cle)t.signals[n]||IT("No prior signal definition",n),fle.forEach(i=>{e[i]!==void 0&&IT("Invalid property ",i)});else{const i=t.addSignal(n,e.value);e.react===!1&&(i.react=!1),e.bind&&t.addBinding(n,e.bind)}}function $x(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function c1(e,t,n,i){return new $x(e,t,n,i)}function f1(e,t){return c1("operator",e,t)}function Ee(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function Pd(e,t){return t?{$field:e,$name:t}:{$field:e}}const Sx=Pd("key");function zT(e,t){return{$compare:e,$order:t}}function dle(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const hle="ascending",ple="descending";function gle(e){return re(e)?(e.order===ple?"-":"+")+d1(e.op,e.field):""}function d1(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const Fx="scope",Dx="view";function Yt(e){return e&&e.signal}function mle(e){return e&&e.expr}function h1(e){if(Yt(e))return!0;if(re(e)){for(const t in e)if(h1(e[t]))return!0}return!1}function _r(e,t){return e??t}function ou(e){return e&&e.signal||e}const BT="timer";function zd(e,t){return(e.merge?ble:e.stream?vle:e.type?xle:q("Invalid stream specification: "+Q(e)))(e,t)}function yle(e){return e===Fx?Dx:e||Dx}function ble(e,t){const n=e.merge.map(r=>zd(r,t)),i=Tx({merge:n},e,t);return t.addStream(i).id}function vle(e,t){const n=zd(e.stream,t),i=Tx({stream:n},e,t);return t.addStream(i).id}function xle(e,t){let n;e.type===BT?(n=t.event(BT,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(yle(e.source),e.type);const i=Tx({stream:n},e,t);return Object.keys(i).length===1?n:t.addStream(i).id}function Tx(e,t,n){let i=t.between;return i&&(i.length!==2&&q('Stream "between" parameter must have 2 entries: '+Q(t)),e.between=[zd(i[0],n),zd(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(_le(t.marktype,t.markname,t.markrole)),t.source===Fx&&i.push("inScope(event.item)"),i.length&&(e.filter=cs("("+i.join(")&&(")+")",n).$expr),(i=t.throttle)!=null&&(e.throttle=+i),(i=t.debounce)!=null&&(e.debounce=+i),t.consume&&(e.consume=!0),e}function _le(e,t,n){const i="event.item";return i+(e&&e!=="*"?"&&"+i+".mark.marktype==='"+e+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(t?"&&"+i+".mark.name==='"+t+"'":"")}const wle={code:"_.$value",ast:{type:"Identifier",value:"value"}};function Ele(e,t,n){const i=e.encode,r={target:n};let s=e.events,o=e.update,a=[];s||q("Signal update missing events specification."),se(s)&&(s=ta(s,t.isSubscope()?Fx:Dx)),s=oe(s).filter(u=>u.signal||u.scale?(a.push(u),0):1),a.length>1&&(a=[kle(a)]),s.length&&a.push(s.length>1?{merge:s}:s[0]),i!=null&&(o&&q("Signal encode and update are mutually exclusive."),o="encode(item(),"+Q(i)+")"),r.update=se(o)?cs(o,t):o.expr!=null?cs(o.expr,t):o.value!=null?o.value:o.signal!=null?{$expr:wle,$params:{$value:t.signalRef(o.signal)}}:q("Invalid signal update specification."),e.force&&(r.options={force:!0}),a.forEach(u=>t.addUpdate(Ie(Cle(u,t),r)))}function Cle(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):zd(e,t)}}function kle(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function Ale(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?q("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=cs(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach(r=>Ele(r,t,n.id))}const dt=e=>(t,n,i)=>c1(e,n,t||void 0,i),UT=dt("aggregate"),$le=dt("axisticks"),jT=dt("bound"),wr=dt("collect"),qT=dt("compare"),Sle=dt("datajoin"),WT=dt("encode"),Fle=dt("expression"),Dle=dt("facet"),Tle=dt("field"),Mle=dt("key"),Nle=dt("legendentries"),Rle=dt("load"),Ole=dt("mark"),Lle=dt("multiextent"),Ile=dt("multivalues"),Ple=dt("overlap"),zle=dt("params"),HT=dt("prefacet"),Ble=dt("projection"),Ule=dt("proxy"),jle=dt("relay"),GT=dt("render"),qle=dt("scale"),au=dt("sieve"),Wle=dt("sortitems"),VT=dt("viewlayout"),Hle=dt("values");let Gle=0;const YT={min:"min",max:"max",count:"sum"};function Vle(e,t){const n=e.type||"linear";yk(n)||q("Unrecognized scale type: "+Q(n)),t.addScale(e.name,{type:n,domain:void 0})}function Yle(e,t){const n=t.getScale(e.name).params;let i;n.domain=XT(e.domain,e,t),e.range!=null&&(n.range=ZT(e,t,n)),e.interpolate!=null&&rce(e.interpolate,n),e.nice!=null&&(n.nice=ice(e.nice,t)),e.bins!=null&&(n.bins=nce(e.bins,t));for(i in e)ue(n,i)||i==="name"||(n[i]=Zi(e[i],t))}function Zi(e,t){return re(e)?e.signal?t.signalRef(e.signal):q("Unsupported object: "+Q(e)):e}function p1(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>Zi(n,t))}function g1(e){q("Can not find data set: "+Q(e))}function XT(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&q("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(W(e)?Xle:e.fields?Zle:Kle)(e,t,n)}function Xle(e,t,n){return e.map(i=>Zi(i,n))}function Kle(e,t,n){const i=n.getData(e.data);return i||g1(e.data),Dl(t.type)?i.valuesRef(n,e.field,KT(e.sort,!1)):xk(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function Zle(e,t,n){const i=e.data,r=e.fields.reduce((s,o)=>(o=se(o)?{data:i,field:o}:W(o)||o.signal?Jle(o,n):o,s.push(o),s),[]);return(Dl(t.type)?Qle:xk(t.type)?ece:tce)(e,n,r)}function Jle(e,t){const n="_:vega:_"+Gle++,i=wr({});if(W(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+Q(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,au({})]),{data:n,field:"data"}}function Qle(e,t,n){const i=KT(e.sort,!0);let r,s;const o=n.map(l=>{const c=t.getData(l.data);return c||g1(l.data),c.countsRef(t,l.field,i)}),a={groupby:Sx,pulse:o};i&&(r=i.op||"count",s=i.field?d1(r,i.field):"count",a.ops=[YT[r]],a.fields=[t.fieldRef(s)],a.as=[s]),r=t.add(UT(a));const u=t.add(wr({pulse:Ee(r)}));return s=t.add(Hle({field:Sx,sort:t.sortRef(i),pulse:Ee(u)})),Ee(s)}function KT(e,t){return e&&(!e.field&&!e.op?re(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?q("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!YT[e.op]&&q("Multiple domain scales can not be sorted using "+e.op)),e}function ece(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||g1(r.data),s.domainRef(t,r.field)});return Ee(t.add(Ile({values:i})))}function tce(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||g1(r.data),s.extentRef(t,r.field)});return Ee(t.add(Lle({extents:i})))}function nce(e,t){return e.signal||W(e)?p1(e,t):t.objectProperty(e)}function ice(e,t){return e.signal?t.signalRef(e.signal):re(e)?{interval:Zi(e.interval),step:Zi(e.step)}:Zi(e)}function rce(e,t){t.interpolate=Zi(e.type||e),e.gamma!=null&&(t.interpolateGamma=Zi(e.gamma))}function ZT(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if(se(r)){if(i&&ue(i,r))return e=Ie({},e,{range:i[r]}),ZT(e,t,n);r==="width"?r=[0,{signal:"width"}]:r==="height"?r=Dl(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:q("Unrecognized scale range value: "+Q(r))}else if(r.scheme){n.scheme=W(r.scheme)?p1(r.scheme,t):Zi(r.scheme,t),r.extent&&(n.schemeExtent=p1(r.extent,t)),r.count&&(n.schemeCount=Zi(r.count,t));return}else if(r.step){n.rangeStep=Zi(r.step,t);return}else{if(Dl(e.type)&&!W(r))return XT(r,e,t);W(r)||q("Unsupported range type: "+Q(r))}return r.map(s=>(W(s)?p1:Zi)(s,t))}function sce(e,t){const n=t.config.projection||{},i={};for(const r in e)r!=="name"&&(i[r]=Mx(e[r],r,t));for(const r in n)i[r]==null&&(i[r]=Mx(n[r],r,t));t.addProjection(e.name,i)}function Mx(e,t,n){return W(e)?e.map(i=>Mx(i,t,n)):re(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:q("Unsupported parameter object: "+Q(e)):e}const Er="top",tc="left",nc="right",na="bottom",JT="center",oce="vertical",ace="start",uce="middle",lce="end",Nx="index",Rx="label",cce="offset",ic="perc",fce="perc2",Ji="value",Bd="guide-label",Ox="guide-title",dce="group-title",hce="group-subtitle",QT="symbol",m1="gradient",Lx="discrete",Ix="size",Px=[Ix,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],Ud={name:1,style:1,interactive:1},Ye={value:0},Qi={value:1},y1="group",eM="rect",zx="rule",pce="symbol",uu="text";function jd(e){return e.type=y1,e.interactive=e.interactive||!1,e}function di(e,t){const n=(i,r)=>_r(e[i],_r(t[i],r));return n.isVertical=i=>oce===_r(e.direction,t.direction||(i?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>_r(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>_r(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>_r(e.columns,_r(t.columns,+n.isVertical(!0))),n}function tM(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function gce(e,t,n){const i=t.config.style[n];return i&&i[e]}function b1(e,t,n){return`item.anchor === '${ace}' ? ${e} : item.anchor === '${lce}' ? ${t} : ${n}`}const Bx=b1(Q(tc),Q(nc),Q(JT));function mce(e){const t=e("tickBand");let n=e("tickOffset"),i,r;return t?t.signal?(i={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},r={signal:`(${t.signal}) === 'extent'`},re(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t==="extent"?(i=1,r=!0,n=0):(i=.5,r=!1):(i=e("bandPosition"),r=e("tickExtra")),{extra:r,band:i,offset:n}}function nM(e,t){return t?e?re(e)?Object.assign({},e,{offset:nM(e.offset,t)}):{value:e,offset:t}:t:e}function Ti(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=Ql(e.encode,t,Ud)):e.interactive=!1,e}function yce(e,t,n,i){const r=di(e,n),s=r.isVertical(),o=r.gradientThickness(),a=r.gradientLength();let u,l,c,f,d;s?(l=[0,1],c=[0,0],f=o,d=a):(l=[0,0],c=[1,0],f=a,d=o);const h={enter:u={opacity:Ye,x:Ye,y:Ye,width:tn(f),height:tn(d)},update:Ie({},u,{opacity:Qi,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:Ye}};return pn(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),Ti({type:eM,role:Kue,encode:h},i)}function bce(e,t,n,i,r){const s=di(e,n),o=s.isVertical(),a=s.gradientThickness(),u=s.gradientLength();let l,c,f,d,h="";o?(l="y",f="y2",c="x",d="width",h="1-"):(l="x",f="x2",c="y",d="height");const p={opacity:Ye,fill:{scale:t,field:Ji}};p[l]={signal:h+"datum."+ic,mult:u},p[c]=Ye,p[f]={signal:h+"datum."+fce,mult:u},p[d]=tn(a);const g={enter:p,update:Ie({},p,{opacity:Qi}),exit:{opacity:Ye}};return pn(g,{stroke:s("gradientStrokeColor"),strokeWidth:s("gradientStrokeWidth")},{opacity:s("gradientOpacity")}),Ti({type:eM,role:Yue,key:Ji,from:r,encode:g},i)}const vce=`datum.${ic}<=0?"${tc}":datum.${ic}>=1?"${nc}":"${JT}"`,xce=`datum.${ic}<=0?"${na}":datum.${ic}>=1?"${Er}":"${uce}"`;function iM(e,t,n,i){const r=di(e,t),s=r.isVertical(),o=tn(r.gradientThickness()),a=r.gradientLength();let u=r("labelOverlap"),l,c,f,d,h="";const p={enter:l={opacity:Ye},update:c={opacity:Qi,text:{field:Rx}},exit:{opacity:Ye}};return pn(p,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:_r(e.labelLimit,t.gradientLabelLimit)}),s?(l.align={value:"left"},l.baseline=c.baseline={signal:xce},f="y",d="x",h="1-"):(l.align=c.align={signal:vce},l.baseline={value:"top"},f="x",d="y"),l[f]=c[f]={signal:h+"datum."+ic,mult:a},l[d]=c[d]=o,o.offset=_r(e.labelOffset,t.gradientLabelOffset)||0,u=u?{separation:r("labelSeparation"),method:u,order:"datum."+Nx}:void 0,Ti({type:uu,role:MT,style:Bd,key:Ji,from:i,encode:p,overlap:u},n)}function _ce(e,t,n,i,r){const s=di(e,t),o=n.entries,a=!!(o&&o.interactive),u=o?o.name:void 0,l=s("clipHeight"),c=s("symbolOffset"),f={data:"value"},d=`(${r}) ? datum.${cce} : datum.${Ix}`,h=l?tn(l):{field:Ix},p=`datum.${Nx}`,g=`max(1, ${r})`;let m,y,b,v,x;h.mult=.5,m={enter:y={opacity:Ye,x:{signal:d,mult:.5,offset:c},y:h},update:b={opacity:Qi,x:y.x,y:y.y},exit:{opacity:Ye}};let _=null,E=null;e.fill||(_=t.symbolBaseFillColor,E=t.symbolBaseStrokeColor),pn(m,{fill:s("symbolFillColor",_),shape:s("symbolType"),size:s("symbolSize"),stroke:s("symbolStrokeColor",E),strokeDash:s("symbolDash"),strokeDashOffset:s("symbolDashOffset"),strokeWidth:s("symbolStrokeWidth")},{opacity:s("symbolOpacity")}),Px.forEach(S=>{e[S]&&(b[S]=y[S]={scale:e[S],field:Ji})});const w=Ti({type:pce,role:Zue,key:Ji,from:f,clip:l?!0:void 0,encode:m},n.symbols),C=tn(c);C.offset=s("labelOffset"),m={enter:y={opacity:Ye,x:{signal:d,offset:C},y:h},update:b={opacity:Qi,text:{field:Rx},x:y.x,y:y.y},exit:{opacity:Ye}},pn(m,{align:s("labelAlign"),baseline:s("labelBaseline"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontStyle:s("labelFontStyle"),fontWeight:s("labelFontWeight"),limit:s("labelLimit")});const k=Ti({type:uu,role:MT,style:Bd,key:Ji,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:Ye,height:l?tn(l):Ye,opacity:Ye},exit:{opacity:Ye},update:b={opacity:Qi,row:{signal:null},column:{signal:null}}},s.isVertical(!0)?(v=`ceil(item.mark.items.length / ${g})`,b.row.signal=`${p}%${v}`,b.column.signal=`floor(${p} / ${v})`,x={field:["row",p]}):(b.row.signal=`floor(${p} / ${g})`,b.column.signal=`${p} % ${g}`,x={field:p}),b.column.signal=`(${r})?${b.column.signal}:${p}`,i={facet:{data:i,name:"value",groupby:Nx}},jd({role:kx,from:i,encode:Ql(m,o,Ud),marks:[w,k],name:u,interactive:a,sort:x})}function wce(e,t){const n=di(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const Ux='item.orient === "left"',jx='item.orient === "right"',v1=`(${Ux} || ${jx})`,Ece=`datum.vgrad && ${v1}`,Cce=b1('"top"','"bottom"','"middle"'),kce=b1('"right"','"left"','"center"'),Ace=`datum.vgrad && ${jx} ? (${kce}) : (${v1} && !(datum.vgrad && ${Ux})) ? "left" : ${Bx}`,$ce=`item._anchor || (${v1} ? "middle" : "start")`,Sce=`${Ece} ? (${Ux} ? -90 : 90) : 0`,Fce=`${v1} ? (datum.vgrad ? (${jx} ? "bottom" : "top") : ${Cce}) : "top"`;function Dce(e,t,n,i){const r=di(e,t),s={enter:{opacity:Ye},update:{opacity:Qi,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:Ye}};return pn(s,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:$ce},angle:{signal:Sce},align:{signal:Ace},baseline:{signal:Fce},text:e.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),baseline:r("titleBaseline")}),Ti({type:uu,role:Jue,style:Ox,from:i,encode:s},n)}function Tce(e,t){let n;return re(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+rM(e.path)+")":e.sphere&&(n="geoShape("+rM(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function rM(e){return re(e)&&e.signal?e.signal:Q(e)}function sM(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===y1?kx:t||Ex}function Mce(e){return{marktype:e.type,name:e.name||void 0,role:e.role||sM(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function Nce(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function qx(e,t){const n=jE(e.type);n||q("Unrecognized transform type: "+Q(e.type));const i=c1(n.type.toLowerCase(),null,oM(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function oM(e,t,n){const i={},r=e.params.length;for(let s=0;saM(e,s,n)):aM(e,r,n)}function aM(e,t,n){const i=e.type;if(Yt(t))return lM(i)?q("Expression references can not be signals."):Wx(i)?n.fieldRef(t):cM(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||Wx(i);return r&&Ice(t)?n.exprRef(t.expr,t.as):r&&Pce(t)?Pd(t.field,t.as):lM(i)?cs(t,n):zce(i)?Ee(n.getData(t).values):Wx(i)?Pd(t):cM(i)?n.compareRef(t):t}}function Oce(e,t,n){return se(t.from)||q('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function Lce(e,t,n){const i=t[e.name];return e.array?(W(i)||q("Expected an array of sub-parameters. Instead: "+Q(i)),i.map(r=>uM(e,r,n))):uM(e,i,n)}function uM(e,t,n){const i=e.params.length;let r;for(let o=0;oe&&e.expr,Pce=e=>e&&e.field,zce=e=>e==="data",lM=e=>e==="expr",Wx=e=>e==="field",cM=e=>e==="compare";function Bce(e,t,n){let i,r,s,o,a;return e?(i=e.facet)&&(t||q("Only group marks can be faceted."),i.field!=null?o=a=x1(i,n):(e.data?a=Ee(n.getData(e.data).aggregate):(s=qx(Ie({type:"aggregate",groupby:oe(i.groupby)},i.aggregate),n),s.params.key=n.keyRef(i.groupby),s.params.pulse=x1(i,n),o=a=Ee(n.add(s))),r=n.keyRef(i.groupby,!0))):o=Ee(n.add(wr(null,[{}]))),o||(o=x1(e,n)),{key:r,pulse:o,parent:a}}function x1(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:Ee(t.getData(e.data).output)}function lu(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}lu.fromEntries=function(e,t){const n=t.length,i=t[n-1],r=t[n-2];let s=t[0],o=null,a=1;for(s&&s.type==="load"&&(s=t[1]),e.add(t[0]);af??"null").join(",")+"),0)",c=cs(l,t);u.update=c.$expr,u.params=c.$params}function _1(e,t){const n=sM(e),i=e.type===y1,r=e.from&&e.from.facet,s=e.overlap;let o=e.layout||n===kx||n===Cx,a,u,l,c,f,d,h;const p=n===Ex||o||r,g=Bce(e.from,i,t);u=t.add(Sle({key:g.key||(e.key?Pd(e.key):void 0),pulse:g.pulse,clean:!i}));const m=Ee(u);u=l=t.add(wr({pulse:m})),u=t.add(Ole({markdef:Mce(e),interactive:Nce(e.interactive,t),clip:Tce(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:Ee(u)}));const y=Ee(u);u=c=t.add(WT(LT(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),u.params.parent=t.encode(),e.transform&&e.transform.forEach(E=>{const w=qx(E,t),C=w.metadata;(C.generates||C.changes)&&q("Mark transforms should not generate new data."),C.nomod||(c.params.mod=!0),w.params.pulse=Ee(u),t.add(u=w)}),e.sort&&(u=t.add(Wle({sort:t.compareRef(e.sort),pulse:Ee(u)})));const b=Ee(u);(r||o)&&(o=t.add(VT({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:b})),d=Ee(o));const v=t.add(jT({mark:y,pulse:d||b}));h=Ee(v),i&&(p&&(a=t.operators,a.pop(),o&&a.pop()),t.pushState(b,d||h,m),r?Uce(e,t,g):p?jce(e,t,g):t.parse(e),t.popState(),p&&(o&&a.push(o),a.push(v))),s&&(h=qce(s,h,t));const x=t.add(GT({pulse:h})),_=t.add(au({pulse:Ee(x)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new lu(t,l,x,_)),e.on&&e.on.forEach(E=>{(E.insert||E.remove||E.toggle)&&q("Marks only support modify triggers."),hM(E,t,f)}))}function qce(e,t,n){const i=e.method,r=e.bound,s=e.separation,o={separation:Yt(s)?n.signalRef(s.signal):s,method:Yt(i)?n.signalRef(i.signal):i,pulse:t};if(e.order&&(o.sort=n.compareRef({field:e.order})),r){const a=r.tolerance;o.boundTolerance=Yt(a)?n.signalRef(a.signal):+a,o.boundScale=n.scaleRef(r.scale),o.boundOrient=r.orient}return Ee(n.add(Ple(o)))}function Wce(e,t){const n=t.config.legend,i=e.encode||{},r=di(e,n),s=i.legend||{},o=s.name||void 0,a=s.interactive,u=s.style,l={};let c=0,f,d,h;Px.forEach(v=>e[v]?(l[v]=e[v],c=c||e[v]):0),c||q("Missing valid scale for legend.");const p=Hce(e,t.scaleType(c)),g={title:e.title!=null,scales:l,type:p,vgrad:p!=="symbol"&&r.isVertical()},m=Ee(t.add(wr(null,[g]))),y={enter:{x:{value:0},y:{value:0}}},b=Ee(t.add(Nle(d={type:p,scale:t.scaleRef(c),count:t.objectProperty(r("tickCount")),limit:t.property(r("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===m1?(h=[yce(e,c,n,i.gradient),iM(e,n,i.labels,b)],d.count=d.count||t.signalRef(`max(2,2*floor((${ou(r.gradientLength())})/100))`)):p===Lx?h=[bce(e,c,n,i.gradient,b),iM(e,n,i.labels,b)]:(f=wce(e,n),h=[_ce(e,n,i,b,ou(f.columns))],d.size=Yce(e,t,h[0].marks)),h=[jd({role:Xue,from:m,encode:y,marks:h,layout:f,interactive:a})],g.title&&h.push(Dce(e,n,i.title,m)),_1(jd({role:Vue,from:m,encode:Ql(Vce(r,e,n),s,Ud),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:o,interactive:a,style:u}),t)}function Hce(e,t){let n=e.type||QT;return!e.type&&Gce(e)===1&&(e.fill||e.stroke)&&(n=Zb(t)?m1:Jb(t)?Lx:QT),n!==m1?n:Jb(t)?Lx:m1}function Gce(e){return Px.reduce((t,n)=>t+(e[n]?1:0),0)}function Vce(e,t,n){const i={enter:{},update:{}};return pn(i,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),i}function Yce(e,t,n){const i=ou(pM("size",e,n)),r=ou(pM("strokeWidth",e,n)),s=ou(Xce(n[1].encode,t,Bd));return cs(`max(ceil(sqrt(${i})+${r}),${s})`,t)}function pM(e,t,n){return t[e]?`scale("${t[e]}",datum)`:tM(e,n[0].encode)}function Xce(e,t,n){return tM("fontSize",e)||gce("fontSize",t,n)}const Kce=`item.orient==="${tc}"?-90:item.orient==="${nc}"?90:0`;function Zce(e,t){e=se(e)?{text:e}:e;const n=di(e,t.config.title),i=e.encode||{},r=i.group||{},s=r.name||void 0,o=r.interactive,a=r.style,u=[],l={},c=Ee(t.add(wr(null,[l])));return u.push(efe(e,n,Jce(e),c)),e.subtitle&&u.push(tfe(e,n,i.subtitle,c)),_1(jd({role:Que,from:c,encode:Qce(n,r),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:s,interactive:o,style:a}),t)}function Jce(e){const t=e.encode;return t&&t.title||Ie({name:e.name,interactive:e.interactive,style:e.style},t)}function Qce(e,t){const n={enter:{},update:{}};return pn(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:Bx},angle:{signal:Kce},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),Ql(n,t,Ud)}function efe(e,t,n,i){const r={value:0},s=e.text,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return pn(o,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),Ti({type:uu,role:ele,style:dce,from:i,encode:o},n)}function tfe(e,t,n,i){const r={value:0},s=e.subtitle,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return pn(o,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),Ti({type:uu,role:tle,style:hce,from:i,encode:o},n)}function nfe(e,t){const n=[];e.transform&&e.transform.forEach(i=>{n.push(qx(i,t))}),e.on&&e.on.forEach(i=>{hM(i,t,e.name)}),t.addDataPipeline(e.name,ife(e,t,n))}function ife(e,t,n){const i=[];let r=null,s=!1,o=!1,a,u,l,c,f;for(e.values?Yt(e.values)||h1(e.format)?(i.push(gM(t,e)),i.push(r=cu())):i.push(r=cu({$ingest:e.values,$format:e.format})):e.url?h1(e.url)||h1(e.format)?(i.push(gM(t,e)),i.push(r=cu())):i.push(r=cu({$request:e.url,$format:e.format})):e.source&&(r=a=oe(e.source).map(d=>Ee(t.getData(d).output)),i.push(null)),u=0,l=n.length;ue===na||e===Er,w1=(e,t,n)=>Yt(e)?afe(e.signal,t,n):e===tc||e===Er?t:n,nn=(e,t,n)=>Yt(e)?sfe(e.signal,t,n):mM(e)?t:n,Cr=(e,t,n)=>Yt(e)?ofe(e.signal,t,n):mM(e)?n:t,yM=(e,t,n)=>Yt(e)?ufe(e.signal,t,n):e===Er?{value:t}:{value:n},rfe=(e,t,n)=>Yt(e)?lfe(e.signal,t,n):e===nc?{value:t}:{value:n},sfe=(e,t,n)=>bM(`${e} === '${Er}' || ${e} === '${na}'`,t,n),ofe=(e,t,n)=>bM(`${e} !== '${Er}' && ${e} !== '${na}'`,t,n),afe=(e,t,n)=>Hx(`${e} === '${tc}' || ${e} === '${Er}'`,t,n),ufe=(e,t,n)=>Hx(`${e} === '${Er}'`,t,n),lfe=(e,t,n)=>Hx(`${e} === '${nc}'`,t,n),bM=(e,t,n)=>(t=t!=null?tn(t):t,n=n!=null?tn(n):n,vM(t)&&vM(n)?(t=t?t.signal||Q(t.value):null,n=n?n.signal||Q(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[Ie({test:e},t)].concat(n||[])),vM=e=>e==null||Object.keys(e).length===1,Hx=(e,t,n)=>({signal:`${e} ? (${rc(t)}) : (${rc(n)})`}),cfe=(e,t,n,i,r)=>({signal:(i!=null?`${e} === '${tc}' ? (${rc(i)}) : `:"")+(n!=null?`${e} === '${na}' ? (${rc(n)}) : `:"")+(r!=null?`${e} === '${nc}' ? (${rc(r)}) : `:"")+(t!=null?`${e} === '${Er}' ? (${rc(t)}) : `:"")+"(null)"}),rc=e=>Yt(e)?e.signal:e==null?null:Q(e),ffe=(e,t)=>t===0?0:Yt(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},sc=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function oc(e,t,n,i){let r;if(t&&ue(t,e))return t[e];if(ue(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=e[5].toLowerCase()+e.slice(6)}return i[Ox][r]}else if(e.startsWith("label")){switch(e){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=e[5].toLowerCase()+e.slice(6)}return i[Bd][r]}return null}function xM(e){const t={};for(const n of e)if(n)for(const i in n)t[i]=1;return Object.keys(t)}function dfe(e,t){var n=t.config,i=n.style,r=n.axis,s=t.scaleType(e.scale)==="band"&&n.axisBand,o=e.orient,a,u,l;if(Yt(o)){const f=xM([n.axisX,n.axisY]),d=xM([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(l of f)a[l]=nn(o,oc(l,n.axisX,r,i),oc(l,n.axisY,r,i));u={};for(l of d)u[l]=cfe(o.signal,oc(l,n.axisTop,r,i),oc(l,n.axisBottom,r,i),oc(l,n.axisLeft,r,i),oc(l,n.axisRight,r,i))}else a=o===Er||o===na?n.axisX:n.axisY,u=n["axis"+o[0].toUpperCase()+o.slice(1)];return a||u||s?Ie({},r,a,u,s):r}function hfe(e,t,n,i){const r=di(e,t),s=e.orient;let o,a;const u={enter:o={opacity:Ye},update:a={opacity:Qi},exit:{opacity:Ye}};pn(u,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const l=_M(e,0),c=_M(e,1);return o.x=a.x=nn(s,l,Ye),o.x2=a.x2=nn(s,c),o.y=a.y=Cr(s,l,Ye),o.y2=a.y2=Cr(s,c),Ti({type:zx,role:jue,from:i,encode:u},n)}function _M(e,t){return{scale:e.scale,range:t}}function pfe(e,t,n,i,r){const s=di(e,t),o=e.orient,a=e.gridScale,u=w1(o,1,-1),l=gfe(e.offset,u);let c,f,d;const h={enter:c={opacity:Ye},update:d={opacity:Qi},exit:f={opacity:Ye}};pn(h,{stroke:s("gridColor"),strokeCap:s("gridCap"),strokeDash:s("gridDash"),strokeDashOffset:s("gridDashOffset"),strokeOpacity:s("gridOpacity"),strokeWidth:s("gridWidth")});const p={scale:e.scale,field:Ji,band:r.band,extra:r.extra,offset:r.offset,round:s("tickRound")},g=nn(o,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:u,offset:l}:{value:0,offset:l},y=a?{scale:a,range:1,mult:u,offset:l}:Ie(g,{mult:u,offset:l});return c.x=d.x=nn(o,p,m),c.y=d.y=Cr(o,p,m),c.x2=d.x2=Cr(o,y),c.y2=d.y2=nn(o,y),f.x=nn(o,p),f.y=Cr(o,p),Ti({type:zx,role:que,key:Ji,from:i,encode:h},n)}function gfe(e,t){if(t!==1)if(!re(e))e=Yt(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=Ie({},e);for(;n.mult!=null;)if(re(n.mult))n=n.mult=Ie({},n.mult);else return n.mult=Yt(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function mfe(e,t,n,i,r,s){const o=di(e,t),a=e.orient,u=w1(a,-1,1);let l,c,f;const d={enter:l={opacity:Ye},update:f={opacity:Qi},exit:c={opacity:Ye}};pn(d,{stroke:o("tickColor"),strokeCap:o("tickCap"),strokeDash:o("tickDash"),strokeDashOffset:o("tickDashOffset"),strokeOpacity:o("tickOpacity"),strokeWidth:o("tickWidth")});const h=tn(r);h.mult=u;const p={scale:e.scale,field:Ji,band:s.band,extra:s.extra,offset:s.offset,round:o("tickRound")};return f.y=l.y=nn(a,Ye,p),f.y2=l.y2=nn(a,h),c.x=nn(a,p),f.x=l.x=Cr(a,Ye,p),f.x2=l.x2=Cr(a,h),c.y=Cr(a,p),Ti({type:zx,role:Hue,key:Ji,from:i,encode:d},n)}function Gx(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function yfe(e,t,n,i,r,s){const o=di(e,t),a=e.orient,u=e.scale,l=w1(a,-1,1),c=ou(o("labelFlush")),f=ou(o("labelFlushOffset")),d=o("labelAlign"),h=o("labelBaseline");let p=c===0||!!c,g;const m=tn(r);m.mult=l,m.offset=tn(o("labelPadding")||0),m.offset.mult=l;const y={scale:u,field:Ji,band:.5,offset:nM(s.offset,o("labelOffset"))},b=nn(a,p?Gx(u,c,'"left"','"right"','"center"'):{value:"center"},rfe(a,"left","right")),v=nn(a,yM(a,"bottom","top"),p?Gx(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=Gx(u,c,`-(${f})`,f,0);p=p&&f;const _={opacity:Ye,x:nn(a,y,m),y:Cr(a,y,m)},E={enter:_,update:g={opacity:Qi,text:{field:Rx},x:_.x,y:_.y,align:b,baseline:v},exit:{opacity:Ye,x:_.x,y:_.y}};pn(E,{dx:!d&&p?nn(a,x):null,dy:!h&&p?Cr(a,x):null}),pn(E,{angle:o("labelAngle"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontWeight:o("labelFontWeight"),fontStyle:o("labelFontStyle"),limit:o("labelLimit"),lineHeight:o("labelLineHeight")},{align:d,baseline:h});const w=o("labelBound");let C=o("labelOverlap");return C=C||w?{separation:o("labelSeparation"),method:C,order:"datum.index",bound:w?{scale:u,orient:a,tolerance:w}:null}:void 0,g.align!==b&&(g.align=sc(g.align,b)),g.baseline!==v&&(g.baseline=sc(g.baseline,v)),Ti({type:uu,role:Wue,style:Bd,key:Ji,from:i,encode:E,overlap:C},n)}function bfe(e,t,n,i){const r=di(e,t),s=e.orient,o=w1(s,-1,1);let a,u;const l={enter:a={opacity:Ye,anchor:tn(r("titleAnchor",null)),align:{signal:Bx}},update:u=Ie({},a,{opacity:Qi,text:tn(e.title)}),exit:{opacity:Ye}},c={signal:`lerp(range("${e.scale}"), ${b1(0,1,.5)})`};return u.x=nn(s,c),u.y=Cr(s,c),a.angle=nn(s,Ye,ffe(o,90)),a.baseline=nn(s,yM(s,na,Er),{value:na}),u.angle=a.angle,u.baseline=a.baseline,pn(l,{fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),angle:r("titleAngle"),baseline:r("titleBaseline")}),vfe(r,s,l,n),l.update.align=sc(l.update.align,a.align),l.update.angle=sc(l.update.angle,a.angle),l.update.baseline=sc(l.update.baseline,a.baseline),Ti({type:uu,role:Gue,style:Ox,from:i,encode:l},n)}function vfe(e,t,n,i){const r=(a,u)=>a!=null?(n.update[u]=sc(tn(a),n.update[u]),!1):!ec(u,i),s=r(e("titleX"),"x"),o=r(e("titleY"),"y");n.enter.auto=o===s?tn(o):nn(t,tn(o),tn(s))}function xfe(e,t){const n=dfe(e,t),i=e.encode||{},r=i.axis||{},s=r.name||void 0,o=r.interactive,a=r.style,u=di(e,n),l=mce(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:e.title!=null},f=Ee(t.add(wr({},[c]))),d=Ee(t.add($le({scale:t.scaleRef(e.scale),extra:t.property(l.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return c.grid&&h.push(pfe(e,n,i.grid,d,l)),c.ticks&&(p=u("tickSize"),h.push(mfe(e,n,i.ticks,d,p,l))),c.labels&&(p=c.ticks?p:0,h.push(yfe(e,n,i.labels,d,p,l))),c.domain&&h.push(hfe(e,n,i.domain,f)),c.title&&h.push(bfe(e,n,i.title,f)),_1(jd({role:Uue,from:f,encode:Ql(_fe(u,e),r,Ud),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:s,interactive:o,style:a}),t)}function _fe(e,t){const n={enter:{},update:{}};return pn(n,{orient:e("orient"),offset:e("offset")||0,position:_r(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function wM(e,t,n){const i=oe(e.signals),r=oe(e.scales);return n||i.forEach(s=>PT(s,t)),oe(e.projections).forEach(s=>sce(s,t)),r.forEach(s=>Vle(s,t)),oe(e.data).forEach(s=>nfe(s,t)),r.forEach(s=>Yle(s,t)),(n||i).forEach(s=>Ale(s,t)),oe(e.axes).forEach(s=>xfe(s,t)),oe(e.marks).forEach(s=>_1(s,t)),oe(e.legends).forEach(s=>Wce(s,t)),e.title&&Zce(e.title,t),t.parseLambdas(),t}const wfe=e=>Ql({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function Efe(e,t){const n=t.config,i=Ee(t.root=t.add(f1())),r=Cfe(e,n);r.forEach(l=>PT(l,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const s=t.add(wr()),o=t.add(WT(LT(wfe(e.encode),y1,Cx,e.style,t,{pulse:Ee(s)}))),a=t.add(VT({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:Ee(o)}));t.operators.pop(),t.pushState(Ee(o),Ee(a),null),wM(e,t,r),t.operators.push(a);let u=t.add(jT({mark:i,pulse:Ee(a)}));return u=t.add(GT({pulse:Ee(u)})),u=t.add(au({pulse:Ee(u)})),t.addData("root",new lu(t,s,s,u)),t}function Wd(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function Cfe(e,t){const n=o=>_r(e[o],t[o]),i=[Wd("background",n("background")),Wd("autosize",Pue(n("autosize"))),Wd("padding",Bue(n("padding"))),Wd("width",n("width")||0),Wd("height",n("height")||0)],r=i.reduce((o,a)=>(o[a.name]=a,o),{}),s={};return oe(e.signals).forEach(o=>{ue(r,o.name)?o=Ie(r[o.name],o):i.push(o),s[o.name]=o}),oe(t.signals).forEach(o=>{!ue(s,o.name)&&!ue(r,o.name)&&i.push(o)}),i}function EM(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function CM(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}EM.prototype=CM.prototype={parse(e){return wM(e,this)},fork(){return new CM(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach(t=>{t.$ref=e.id}),e.refs=null),e},proxy(e){const t=e instanceof $x?Ee(e):e;return this.add(Ule({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;this.root&&(this.root.root=!0);for(e in this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(i,r,s){let o,a;i&&(o=i.data||(i.data={}),a=o[r]||(o[r]=[]),a.push(s))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const i in t.index)n(t.index[i],e,"index:"+i)}return this},pushState(e,t,n){this._encode.push(Ee(this.add(au({pulse:e})))),this._parent.push(t),this._lookup.push(n?Ee(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return Ge(this._parent)},encode(){return Ge(this._encode)},lookup(){return Ge(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(se(e))return Pd(e,t);e.signal||q("Unsupported field reference: "+Q(e));const n=e.signal;let i=this.field[n];if(!i){const r={name:this.signalRef(n)};t&&(r.as=t),this.field[n]=i=Ee(this.add(Tle(r)))}return i},compareRef(e){let t=!1;const n=s=>Yt(s)?(t=!0,this.signalRef(s.signal)):mle(s)?(t=!0,this.exprRef(s.expr)):s,i=oe(e.field).map(n),r=oe(e.order).map(n);return t?Ee(this.add(qT({fields:i,orders:r}))):zT(i,r)},keyRef(e,t){let n=!1;const i=s=>Yt(s)?(n=!0,Ee(r[s.signal])):s,r=this.signals;return e=oe(e).map(i),n?Ee(this.add(Mle({fields:e,flat:t}))):dle(e,t)},sortRef(e){if(!e)return e;const t=d1(e.op,e.field),n=e.order||hle;return n.signal?Ee(this.add(qT({fields:t,orders:this.signalRef(n.signal)}))):zT(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:e,type:t}),this.events[n]=i}return this.events[n]},hasOwnSignal(e){return ue(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&q("Duplicate signal name: "+Q(e));const n=t instanceof $x?t:this.add(f1(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||q("Unrecognized signal name: "+Q(e)),this.signals[e]},signalRef(e){return this.signals[e]?Ee(this.signals[e]):(ue(this.lambdas,e)||(this.lambdas[e]=this.add(f1(null))),Ee(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t0?",":"")+(re(r)?r.signal||Vx(r):Q(r))}return n+"]"}function Afe(e){let t="{",n=0,i,r;for(i in e)r=e[i],t+=(++n>1?",":"")+Q(i)+":"+(re(r)?r.signal||Vx(r):Q(r));return t+"}"}function $fe(){const e="sans-serif",i="#4c78a8",r="#000",s="#888",o="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:i},area:{fill:i},image:null,line:{stroke:i,strokeWidth:2},path:{stroke:i},rect:{fill:i},rule:{stroke:r},shape:{stroke:i},symbol:{fill:i,size:64},text:{fill:r,font:e,fontSize:11},trail:{fill:i,size:2},style:{"guide-label":{fill:r,font:e,fontSize:10},"guide-title":{fill:r,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:r,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:r,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:o},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:s,grid:!1,gridWidth:1,gridColor:o,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:s,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:o,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:s,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function Sfe(e,t,n){return re(e)||q("Input Vega specification must be an object."),t=nl($fe(),t,e.config),Efe(e,new EM(t,n)).toRuntime()}var Ffe="5.33.0";Ie(xl,TV,aQ,MQ,yte,fne,Pie,yie,Bie,cre,xre,$re);const Dfe=Object.freeze(Object.defineProperty({__proto__:null,Bounds:Ut,CanvasHandler:Hf,CanvasRenderer:Rp,DATE:oi,DAY:$n,DAYOFYEAR:Gr,Dataflow:vl,Debug:N4,Error:v2,EventStream:_0,Gradient:Pk,GroupItem:cp,HOURS:Ci,Handler:R3,HybridHandler:QA,HybridRenderer:G3,Info:M4,Item:lp,MILLISECONDS:cr,MINUTES:ki,MONTH:An,Marks:$i,MultiPulse:gy,None:T4,Operator:xt,Parameters:x0,Pulse:Fo,QUARTER:si,RenderType:Go,Renderer:qf,ResourceLoader:Xk,SECONDS:qi,SVGHandler:RA,SVGRenderer:H3,SVGStringRenderer:JA,Scenegraph:wA,TIME_UNITS:G2,Transform:P,View:_T,WEEK:Wt,Warn:x2,YEAR:cn,accessor:ii,accessorFields:wn,accessorName:Tt,array:oe,ascending:rl,bandwidthNRD:vy,bin:HE,bootstrapCI:GE,boundClip:l$,boundContext:Lf,boundItem:M3,boundMark:bA,boundStroke:Bs,changeset:Ao,clampRange:H4,codegenExpression:TD,compare:k2,constant:kn,cumulativeLogNormal:ky,cumulativeNormal:k0,cumulativeUniform:Fy,dayofyear:T8,debounce:A2,defaultLocale:uy,definition:jE,densityLogNormal:Cy,densityNormal:xy,densityUniform:Sy,domChild:Gt,domClear:Vi,domCreate:Wo,domFind:N3,dotbin:VE,error:q,expressionFunction:Pt,extend:Ie,extent:qr,extentIndex:G4,falsy:vo,fastmap:sl,field:Bi,flush:V4,font:Ep,fontFamily:Uf,fontSize:ns,format:h0,formatLocale:f0,formats:dy,hasOwnProperty:ue,id:Vc,identity:En,inferType:CE,inferTypes:kE,ingest:it,inherits:te,inrange:ol,interpolate:Qb,interpolateColors:rp,interpolateRange:_k,intersect:s$,intersectBoxLine:Rl,intersectPath:y3,intersectPoint:b3,intersectRule:iA,isArray:W,isBoolean:xo,isDate:_o,isFunction:Le,isIterable:Y4,isNumber:Je,isObject:re,isRegExp:$2,isString:se,isTuple:y0,key:S2,lerp:X4,lineHeight:jo,loader:p0,locale:_E,logger:_2,lruCache:K4,markup:W3,merge:Z4,mergeConfig:nl,multiLineOffset:F3,one:tl,pad:J4,panLinear:z4,panLog:B4,panPow:U4,panSymlog:j4,parse:Sfe,parseExpression:SD,parseSelector:ta,path:M0,pathCurves:s3,pathEqual:c$,pathParse:Tl,pathRectangle:Hk,pathRender:Tf,pathSymbols:Wk,pathTrail:Gk,peek:Ge,point:kp,projection:qv,quantileLogNormal:Ay,quantileNormal:A0,quantileUniform:Dy,quantiles:yy,quantizeInterpolator:wk,quarter:q4,quartiles:by,get random(){return Wi},randomInteger:OG,randomKDE:wy,randomLCG:RG,randomLogNormal:XE,randomMixture:KE,randomNormal:_y,randomUniform:ZE,read:FE,regressionConstant:Ty,regressionExp:QE,regressionLinear:My,regressionLoess:r9,regressionLog:JE,regressionPoly:t9,regressionPow:e9,regressionQuad:Ny,renderModule:Pp,repeat:Yc,resetDefaultLocale:TH,resetSVGClipId:Yk,resetSVGDefIds:kJ,responseType:SE,runtimeContext:tT,sampleCurve:S0,sampleLogNormal:Ey,sampleNormal:C0,sampleUniform:$y,scale:et,sceneEqual:Y3,sceneFromJSON:xA,scenePickVisit:yp,sceneToJSON:vA,sceneVisit:pr,sceneZOrder:v3,scheme:e3,serializeXML:HA,setHybridRendererOptions:_J,setRandom:MG,span:Xc,splitAccessPath:jr,stringValue:Q,textMetrics:Ai,timeBin:K8,timeFloor:P8,timeFormatLocale:df,timeInterval:gl,timeOffset:U8,timeSequence:W8,timeUnitSpecifier:D8,timeUnits:Y2,toBoolean:F2,toDate:D2,toNumber:Cn,toSet:lr,toString:T2,transform:qE,transforms:xl,truncate:Q4,truthy:Ui,tupleid:_e,typeParsers:ly,utcFloor:z8,utcInterval:ml,utcOffset:j8,utcSequence:H8,utcdayofyear:R8,utcquarter:W4,utcweek:O8,version:Ffe,visitArray:wo,week:M8,writeConfig:il,zero:bo,zoomLinear:w2,zoomLog:E2,zoomPow:Zh,zoomSymlog:C2},Symbol.toStringTag,{value:"Module"}));function Tfe(e,t,n){let i;t.x2&&(t.x?(n&&e.x>e.x2&&(i=e.x,e.x=e.x2,e.x2=i),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(i=e.y,e.y=e.y2,e.y2=i),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var Mfe={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},Nfe={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>ee<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},Rfe={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const Ofe=Array.prototype.slice,fu=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,Ofe.call(t,1))},Lfe=(e,t,n,i,r,s,o)=>new Date(e,t||0,n??1,i||0,r||0,s||0,o||0);var Ife={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:Lfe,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return fu("join",arguments)},indexof:function(){return fu("indexOf",arguments)},lastindexof:function(){return fu("lastIndexOf",arguments)},slice:function(){return fu("slice",arguments)},reverse:e=>e.slice().reverse(),sort:e=>e.slice().sort(rl),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return fu("substring",arguments,String)},split:function(){return fu("split",arguments,String)},replace:function(){return fu("replace",arguments,String)},trim:e=>String(e).trim(),btoa:e=>btoa(e),atob:e=>atob(e),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const Pfe=["view","item","group","xy","x","y"],Yx=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&Yx.add(setImmediate);const zfe={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:n==="datum"?e.datum:n==="event"?e.event:n==="item"?e.item:Mfe[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,i=e(t.object);n&&(e.memberDepth+=1);const r=e(t.property);if(n&&(e.memberDepth-=1),Yx.has(i[r])){console.error(`Prevented interpretation of member "${r}" which could lead to insecure code execution`);return}return i[r]},CallExpression:(e,t)=>{const n=t.arguments;let i=t.callee.name;return i.startsWith("_")&&(i=i.slice(1)),i==="if"?e(n[0])?e(n[1]):e(n[2]):(e.fn[i]||Ife[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>Nfe[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>Rfe[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator==="&&"?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((n,i)=>{e.memberDepth+=1;const r=e(i.key);return e.memberDepth-=1,Yx.has(e(i.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):n[r]=e(i.value),n},{})};function Hd(e,t,n,i,r,s){const o=a=>zfe[a.type](o,a);return o.memberDepth=0,o.fn=Object.create(t),o.params=n,o.datum=i,o.event=r,o.item=s,Pfe.forEach(a=>o.fn[a]=function(){return r.vega[a](...arguments)}),o(e)}var Bfe={operator(e,t){const n=t.ast,i=e.functions;return r=>Hd(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,s)=>Hd(n,i,s,r)},event(e,t){const n=t.ast,i=e.functions;return r=>Hd(n,i,void 0,void 0,r)},handler(e,t){const n=t.ast,i=e.functions;return(r,s)=>{const o=s.item&&s.item.datum;return Hd(n,i,r,o,s)}},encode(e,t){const{marktype:n,channels:i}=t,r=e.functions,s=n==="group"||n==="image"||n==="rect";return(o,a)=>{const u=o.datum;let l=0,c;for(const f in i)c=Hd(i[f].ast,r,a,u,void 0,o),o[f]!==c&&(o[f]=c,l=1);return n!=="rule"&&Tfe(o,i,s),l}}};const Ufe={version:"5.23.0"};function Xx(e){return X(e,"or")}function Kx(e){return X(e,"and")}function Zx(e){return X(e,"not")}function E1(e,t){if(Zx(e))E1(e.not,t);else if(Kx(e))for(const n of e.and)E1(n,t);else if(Xx(e))for(const n of e.or)E1(n,t);else t(e)}function ac(e,t){return Zx(e)?{not:ac(e.not,t)}:Kx(e)?{and:e.and.map(n=>ac(n,t))}:Xx(e)?{or:e.or.map(n=>ac(n,t))}:t(e)}const De=structuredClone;function kM(e){throw new Error(e)}function uc(e,t){const n={};for(const i of t)ue(e,i)&&(n[i]=e[i]);return n}function hi(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>pt(e)).join(",")})`};function He(e){if(Je(e))return e;const t=se(e)?e:pt(e);if(t.length<250)return t;let n=0;for(let i=0;ia===0?o:`[${o}]`),s=r.map((o,a)=>r.slice(0,a+1).join(""));for(const o of s)t.add(o)}return t}function n_(e,t){return e===void 0||t===void 0?!0:e_(t_(e),t_(t))}function ht(e){return Y(e).length===0}const Y=Object.keys,gn=Object.values,ia=Object.entries;function Gd(e){return e===!0||e===!1}function At(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Vd(e,t){return Zx(e)?`!(${Vd(e.not,t)})`:Kx(e)?`(${e.and.map(n=>Vd(n,t)).join(") && (")})`:Xx(e)?`(${e.or.map(n=>Vd(n,t)).join(") || (")})`:t(e)}function C1(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&C1(e[n],t)&&delete e[n],ht(e)}function Yd(e){return e.charAt(0).toUpperCase()+e.substr(1)}function i_(e,t="datum"){const n=jr(e),i=[];for(let r=1;r<=n.length;r++){const s=`[${n.slice(0,r).map(Q).join("][")}]`;i.push(`${t}${s}`)}return i.join(" && ")}function SM(e,t="datum"){return`${t}[${Q(jr(e).join("."))}]`}function ut(e){return`datum['${e.replaceAll("'","\\'")}']`}function Wfe(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function er(e){return`${jr(e).map(Wfe).join("\\.")}`}function du(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function cc(e){return`${jr(e).join(".")}`}function fc(e){return e?jr(e).length:0}function zt(...e){return e.find(t=>t!==void 0)}let FM=42;function DM(e){const t=++FM;return e?String(e)+t:t}function Hfe(){FM=42}function TM(e){return MM(e)?e:`__${e}`}function MM(e){return e.startsWith("__")}function Xd(e){if(e!==void 0)return(e%360+360)%360}function k1(e){return Je(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const NM=Object.getPrototypeOf(structuredClone({}));function Mi(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor.name!==t.constructor.name)return!1;let n,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!Mi(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const s of e.entries())if(!t.has(s[0]))return!1;for(const s of e.entries())if(!Mi(s[1],t.get(s[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e.entries())if(!t.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(e[i]!==t[i])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==NM.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==NM.toString)return e.toString()===t.toString();const r=Object.keys(e);if(n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!Mi(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function pt(e){const t=[];return function n(i){if(i&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?""+i:"null";if(typeof i!="object")return JSON.stringify(i);let r,s;if(Array.isArray(i)){for(s="[",r=0;rN1(e[t])?At(`_${t}_${ia(e[t])}`):At(`_${t}_${e[t]}`)).join("")}function _t(e){return e===!0||mu(e)&&!e.binned}function mn(e){return e==="binned"||mu(e)&&e.binned===!0}function mu(e){return re(e)}function N1(e){return X(e,"param")}function VM(e){switch(e){case Zs:case Js:case to:case pi:case hs:case ps:case ua:case no:case oa:case aa:case gi:return 6;case la:return 4;default:return 10}}function Qd(e){return X(e,"expr")}function yn(e,{level:t}={level:0}){const n=Y(e||{}),i={};for(const r of n)i[r]=t===0?Ni(e[r]):yn(e[r],{level:t-1});return i}function YM(e){const{anchor:t,frame:n,offset:i,orient:r,angle:s,limit:o,color:a,subtitleColor:u,subtitleFont:l,subtitleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=e,m={...g,...a?{fill:a}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...s!==void 0?{angle:s}:{},...o!==void 0?{limit:o}:{}},b={...u?{subtitleColor:u}:{},...l?{subtitleFont:l}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},v=uc(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:v,nonMarkTitleProperties:y,subtitle:b}}function da(e){return se(e)||W(e)&&se(e[0])}function me(e){return X(e,"signal")}function yu(e){return X(e,"step")}function mde(e){return W(e)?!1:X(e,"fields")&&!X(e,"data")}function yde(e){return W(e)?!1:X(e,"fields")&&X(e,"data")}function so(e){return W(e)?!1:X(e,"field")&&X(e,"data")}const bde=Y({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1}),vde={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},g_=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function XM(e){const t=W(e.condition)?e.condition.map(KM):KM(e.condition);return{...Ni(e),condition:t}}function Ni(e){if(Qd(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function KM(e){if(Qd(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Et(e){if(Qd(e)){const{expr:t,...n}=e;return{signal:t,...n}}return me(e)?e:e!==void 0?{value:e}:void 0}function xde(e){return me(e)?e.signal:Q(e)}function ZM(e){return me(e)?e.signal:Q(e.value)}function Dr(e){return me(e)?e.signal:e==null?null:Q(e)}function _de(e,t,n){for(const i of n){const r=ys(i,t.markDef,t.config);r!==void 0&&(e[i]=Et(r))}return e}function JM(e){return[].concat(e.type,e.style??[])}function gt(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:s}=i;return r&&X(t,r)?t[r]:t[e]!==void 0?t[e]:s&&(!r||r===e)?void 0:ys(e,t,n,i)}function ys(e,t,n,{vgChannel:i}={}){const r=m_(e,t,n.style);return zt(i?r:void 0,r,i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function m_(e,t,n){return QM(e,JM(t),n)}function QM(e,t,n){t=oe(t);let i;for(const r of t){const s=n[r];X(s,e)&&(i=s[e])}return i}function eN(e,t){return oe(e).reduce((n,i)=>(n.field.push(ne(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function tN(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(Mi(r,i))return;n.push(i)}),n}function nN(e,t){return Mi(e,t)||!t?e:e?[...oe(e),...oe(t)].join(", "):t}function iN(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((da(n)||me(n))&&(da(i)||me(i)))return{explicit:e.explicit,value:nN(n,i)};if(da(n)||me(n))return{explicit:e.explicit,value:n};if(da(i)||me(i))return{explicit:e.explicit,value:i};if(!da(n)&&!me(n)&&!da(i)&&!me(i))return{explicit:e.explicit,value:tN(n,i)};throw new Error("It should never reach here")}function y_(e){return`Invalid specification ${pt(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const wde='Autosize "fit" only works for single views and layered views.';function rN(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function sN(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function oN(e){return e?`Dropping "fit-${e}" because spec has discrete ${mi(e)}.`:'Dropping "fit" because spec has discrete size.'}function b_(e){return`Unknown field for ${e}. Cannot calculate view size.`}function aN(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function Ede(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function Cde(e){return`The "nearest" transform is not supported for ${e} marks.`}function uN(e){return`Selection not supported for ${e} yet.`}function kde(e){return`Cannot find a selection named "${e}".`}const Ade="Scale bindings are currently only supported for scales with unbinned, continuous domains.",$de="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",Sde="Legend bindings are only supported for selections over an individual field or encoding channel.";function Fde(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function Dde(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const Tde="The same selection must be used to override scale domains in a layered view.",Mde='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function Nde(e){return`Unknown repeated value "${e}".`}function lN(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const Rde="Multiple timer selections in one unit spec are not supported. Ignoring all but the first.",v_="Animation involving facet, layer, or concat is currently unsupported.";function Ode(e){return`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${Q(e)}.`}function Lde(e,t,n,i){return(e.length?"Multiple ":"No ")+`matching ${Q(t)} encoding found for selection ${Q(n.param)}. Using "field": ${Q(i)}.`}const Ide="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function Pde(e){return`Unrecognized parse "${e}".`}function cN(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const zde="Attempt to add the same child twice.";function Bde(e){return`Ignoring an invalid transform: ${pt(e)}.`}const Ude='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function fN(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function jde(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${pt(t)} is overridden by a child projection ${pt(n)}.`}const qde="Arc marks uses theta channel rather than angle, replacing angle with theta.";function Wde(e){return`${e}Offset dropped because ${e} is continuous`}function Hde(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${pt(n)}}.`}function dN(e){return`Invalid field type "${e}".`}function Gde(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function Vde(e){return`Invalid aggregation operator "${e}".`}function hN(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function Yde(e){return`Position range does not support relative band size for ${e}.`}function x_(e,t){return`Dropping ${pt(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const Xde="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function R1(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function Kde(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function Zde(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function Jde(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function Qde(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function __(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function ehe(e){return`The ${e} for range marks cannot be an expression`}function the(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function nhe(e,t){return`Specified orient "${e}" overridden with "${t}".`}function ihe(e){return`Cannot use the scale property "${e}" with non-color channel.`}function rhe(e){return`Cannot use the relative band size with ${e} scale.`}function she(e){return`Using unaggregated domain with raw field has no effect (${pt(e)}).`}function ohe(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function ahe(e){return`Unaggregated domain is currently unsupported for log scale (${pt(e)}).`}function uhe(e){return`Cannot apply size to non-oriented mark "${e}".`}function lhe(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function che(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function pN(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function gN(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function fhe(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${pt(n)} and ${pt(i)}). Using ${pt(n)}.`}function dhe(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${pt(n)} and ${pt(i)}). Using the union of the two domains.`}function hhe(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function phe(e){return`Dropping sort property ${pt(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const mN="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",ghe="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",mhe="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",yhe="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function bhe(e){return`Cannot stack "${e}" if there is already "${e}2".`}function vhe(e){return`Stack is applied to a non-linear scale (${e}).`}function xhe(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function O1(e,t){return`Invalid ${e}: ${pt(t)}.`}function _he(e){return`Dropping day from datetime ${pt(e)} as day cannot be combined with other units.`}function whe(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function Ehe(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function Che(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function yN(e){return`1D error band does not support ${e}.`}function bN(e){return`Channel ${e} is required for "binned" bin.`}function khe(e){return`Channel ${e} should not be used with "binned" bin.`}function Ahe(e){return`Domain for ${e} is required for threshold scale.`}const vN=_2(x2);let bu=vN;function $he(e){return bu=e,bu}function She(){return bu=vN,bu}function w_(...e){bu.error(...e)}function Z(...e){bu.warn(...e)}function Fhe(...e){bu.debug(...e)}function vu(e){if(e&&re(e)){for(const t of C_)if(X(e,t))return!0}return!1}const xN=["january","february","march","april","may","june","july","august","september","october","november","december"],Dhe=xN.map(e=>e.substr(0,3)),_N=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],The=_N.map(e=>e.substr(0,3));function Mhe(e){if(k1(e)&&(e=+e),Je(e))return e>4&&Z(O1("quarter",e)),e-1;throw new Error(O1("quarter",e))}function Nhe(e){if(k1(e)&&(e=+e),Je(e))return e-1;{const t=e.toLowerCase(),n=xN.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=Dhe.indexOf(i);if(r!==-1)return r;throw new Error(O1("month",e))}}function Rhe(e){if(k1(e)&&(e=+e),Je(e))return e%7;{const t=e.toLowerCase(),n=_N.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=The.indexOf(i);if(r!==-1)return r;throw new Error(O1("day",e))}}function E_(e,t){const n=[];if(t&&e.day!==void 0&&Y(e).length>1&&(Z(_he(e)),e=De(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?Nhe(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?Mhe(e.quarter):e.quarter;n.push(Je(i)?i*3:`${i}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const i=t?Rhe(e.day):e.day;n.push(Je(i)?i+1:`${i}+1`)}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const r=e[i];n.push(typeof r>"u"?0:r)}return n}function xu(e){const n=E_(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function Ohe(e){const n=E_(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function Lhe(e){const t=E_(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const wN={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},C_=Y(wN);function Ihe(e){return ue(wN,e)}function _u(e){return re(e)?e.binned:EN(e)}function EN(e){return e&&e.startsWith("binned")}function k_(e){return e.startsWith("utc")}function Phe(e){return e.substring(3)}const zhe={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function L1(e){return C_.filter(t=>kN(e,t))}function CN(e){const t=L1(e);return t[t.length-1]}function kN(e,t){const n=e.indexOf(t);return!(n<0||n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o"||n>0&&t==="year"&&e.charAt(n-1)==="f")}function Bhe(e,t,{end:n}={end:!1}){const i=i_(t),r=k_(e)?"utc":"";function s(u){return u==="quarter"?`(${r}quarter(${i})-1)`:`${r}${u}(${i})`}let o;const a={};for(const u of C_)kN(e,u)&&(a[u]=s(u),o=u);return n&&(a[o]+="+1"),Ohe(a)}function AN(e){if(!e)return;const t=L1(e);return`timeUnitSpecifier(${pt(t)}, ${pt(zhe)})`}function Uhe(e,t,n){if(!e)return;const i=AN(e);return`${n||k_(e)?"utc":"time"}Format(${t}, ${i})`}function sn(e){if(!e)return;let t;return se(e)?EN(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:re(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),k_(t.unit)&&(t.utc=!0,t.unit=Phe(t.unit)),t}function jhe(e){const{utc:t,...n}=sn(e);return n.unit?(t?"utc":"")+Y(n).map(i=>At(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):(t?"utc":"")+"timeunit"+Y(n).map(i=>At(`_${i}_${n[i]}`)).join("")}function $N(e,t=n=>n){const n=sn(e),i=CN(n.unit);if(i&&i!=="day"){const r={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:s,part:o}=SN(i,n.step),a={...r,[o]:+r[o]+s};return`${t(xu(a))} - ${t(xu(r))}`}}const qhe={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function Whe(e){return ue(qhe,e)}function SN(e,t=1){if(Whe(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function Hhe(e){return X(e,"param")}function A_(e){return!!(e!=null&&e.field)&&e.equal!==void 0}function $_(e){return!!(e!=null&&e.field)&&e.lt!==void 0}function S_(e){return!!(e!=null&&e.field)&&e.lte!==void 0}function F_(e){return!!(e!=null&&e.field)&&e.gt!==void 0}function D_(e){return!!(e!=null&&e.field)&&e.gte!==void 0}function T_(e){if(e!=null&&e.field){if(W(e.range)&&e.range.length===2)return!0;if(me(e.range))return!0}return!1}function M_(e){return!!(e!=null&&e.field)&&(W(e.oneOf)||W(e.in))}function Ghe(e){return!!(e!=null&&e.field)&&e.valid!==void 0}function FN(e){return M_(e)||A_(e)||T_(e)||$_(e)||F_(e)||S_(e)||D_(e)}function bs(e,t){return J1(e,{timeUnit:t,wrapTime:!0})}function Vhe(e,t){return e.map(n=>bs(n,t))}function DN(e,t=!0){const{field:n}=e,i=sn(e.timeUnit),{unit:r,binned:s}=i||{},o=ne(e,{expr:"datum"}),a=r?`time(${s?o:Bhe(r,n)})`:o;if(A_(e))return`${a}===${bs(e.equal,r)}`;if($_(e)){const u=e.lt;return`${a}<${bs(u,r)}`}else if(F_(e)){const u=e.gt;return`${a}>${bs(u,r)}`}else if(S_(e)){const u=e.lte;return`${a}<=${bs(u,r)}`}else if(D_(e)){const u=e.gte;return`${a}>=${bs(u,r)}`}else{if(M_(e))return`indexof([${Vhe(e.oneOf,r).join(",")}], ${a}) !== -1`;if(Ghe(e))return I1(a,e.valid);if(T_(e)){const{range:u}=yn(e),l=me(u)?{signal:`${u.signal}[0]`}:u[0],c=me(u)?{signal:`${u.signal}[1]`}:u[1];if(l!==null&&c!==null&&t)return"inrange("+a+", ["+bs(l,r)+", "+bs(c,r)+"])";const f=[];return l!==null&&f.push(`${a} >= ${bs(l,r)}`),c!==null&&f.push(`${a} <= ${bs(c,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${pt(e)}`)}function I1(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Yhe(e){return FN(e)&&e.timeUnit?{...e,timeUnit:sn(e.timeUnit)}:e}const eh={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function Xhe(e){return e==="quantitative"||e==="temporal"}function TN(e){return e==="ordinal"||e==="nominal"}const wu=eh.quantitative,N_=eh.ordinal,gc=eh.temporal,R_=eh.nominal,mc=eh.geojson;function Khe(e){if(e)switch(e=e.toLowerCase(),e){case"q":case wu:return"quantitative";case"t":case gc:return"temporal";case"o":case N_:return"ordinal";case"n":case R_:return"nominal";case mc:return"geojson"}}const bn={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",TIME:"time",UTC:"utc",POINT:"point",BAND:"band"},O_={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function Zhe(e,t){const n=O_[e],i=O_[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const Jhe={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function MN(e){return Jhe[e]}const NN=new Set(["linear","log","pow","sqrt","symlog"]),RN=new Set([...NN,"time","utc"]);function ON(e){return NN.has(e)}const LN=new Set(["quantile","quantize","threshold"]),Qhe=new Set([...RN,...LN,"sequential","identity"]),e0e=new Set(["ordinal","bin-ordinal","point","band"]);function on(e){return e0e.has(e)}function Tr(e){return Qhe.has(e)}function vs(e){return RN.has(e)}function yc(e){return LN.has(e)}const t0e={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0,framesPerSecond:2,animationDuration:5};function n0e(e){return!se(e)&&X(e,"name")}function IN(e){return X(e,"param")}function i0e(e){return X(e,"unionWith")}function r0e(e){return re(e)&&"field"in e}const s0e={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:l_e,domain:c_e,range:f_e,rangeMax:d_e,rangeMin:h_e,scheme:p_e,...o0e}=s0e,a0e=Y(o0e);function L_(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return vs(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return vs(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return vs(e);case"nice":return vs(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return Tr(e)&&!We(["log","time","utc","threshold","quantile"],e)}}function PN(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return pc(e)?void 0:ihe(t);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function u0e(e,t){return We([N_,R_],t)?e===void 0||on(e):t===gc?We([bn.TIME,bn.UTC,void 0],e):t===wu?ON(e)||yc(e)||e===void 0:!0}function l0e(e,t,n=!1){if(!ms(e))return!1;switch(e){case $t:case rn:case ra:case dc:case tr:case Ar:return vs(t)||t==="band"?!0:t==="point"?!n:!1;case sa:return We(["linear","band"],t);case to:case ua:case no:case oa:case aa:case hu:return vs(t)||yc(t)||We(["band","point","ordinal"],t);case pi:case hs:case ps:return t!=="band";case la:case gi:return t==="ordinal"||yc(t)}}function c0e(e){return re(e)&&"value"in e}const Qn={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},zN=Qn.arc,P1=Qn.area,z1=Qn.bar,f0e=Qn.image,B1=Qn.line,U1=Qn.point,d0e=Qn.rect,j1=Qn.rule,BN=Qn.text,I_=Qn.tick,h0e=Qn.trail,P_=Qn.circle,z_=Qn.square,UN=Qn.geoshape;function ha(e){return["line","area","trail"].includes(e)}function th(e){return["rect","bar","image","arc","tick"].includes(e)}const p0e=new Set(Y(Qn));function xs(e){return X(e,"type")}const g0e=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],m0e=["fill","fillOpacity"],y0e=[...g0e,...m0e],jN=Y({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1}),B_=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],b0e={area:["line","point"],bar:B_,rect:B_,line:["point"],tick:["bandSize","thickness",...B_]},v0e={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},qN=Y({mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1});function Eu(e){return X(e,"band")}const x0e={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},U_={binSpacing:0,continuousBandSize:5,minBandSize:.25,timeUnitBandPosition:.5},_0e={...U_,binSpacing:1},w0e={...U_,thickness:1};function E0e(e){return xs(e)?e.type:e}function WN(e,{isPath:t}){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function j_({markDef:e,config:t,scaleChannel:n,scaleType:i,isCountAggregate:r}){var a,u;if(!i||!Tr(i)||r)return"always-valid";const s=WN(gt("invalid",e,t),{isPath:ha(e.type)});return((u=(a=t.scale)==null?void 0:a.invalid)==null?void 0:u[n])!==void 0?"show":s}function C0e(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function HN({scaleName:e,scale:t,mode:n}){const i=`domain('${e}')`;if(!t||!e)return;const r=`${i}[0]`,s=`peek(${i})`,o=t.domainHasZero();return o==="definitely"?{scale:e,value:0}:o==="maybe"?{signal:`scale('${e}', inrange(0, ${i}) ? 0 : ${n==="zeroOrMin"?r:s})`}:{signal:`scale('${e}', ${n==="zeroOrMin"?r:s})`}}function GN({scaleChannel:e,channelDef:t,scale:n,scaleName:i,markDef:r,config:s}){var c;const o=n==null?void 0:n.get("type"),a=Rr(t),u=M1(a==null?void 0:a.aggregate),l=j_({scaleChannel:e,markDef:r,config:s,scaleType:o,isCountAggregate:u});if(a&&l==="show"){const f=((c=s.scale.invalid)==null?void 0:c[e])??"zero-or-min";return{test:I1(ne(a,{expr:"datum"}),!1),...k0e(f,n,i)}}}function k0e(e,t,n){if(c0e(e)){const{value:i}=e;return me(i)?{signal:i.signal}:{value:i}}return HN({scale:t,scaleName:n,mode:"zeroOrMin"})}function q_(e){const{channel:t,channelDef:n,markDef:i,scale:r,scaleName:s,config:o}=e,a=gu(t),u=W_(e),l=GN({scaleChannel:a,channelDef:n,scale:r,scaleName:s,markDef:i,config:o});return l!==void 0?[l,u]:u}function A0e(e){const{datum:t}=e;return vu(t)?xu(t):`${pt(t)}`}function Cu(e,t,n,i){const r={};if(t&&(r.scale=t),_s(e)){const{datum:s}=e;vu(s)?r.signal=xu(s):me(s)?r.signal=s.signal:Qd(s)?r.signal=s.expr:r.value=s}else r.field=ne(e,n);if(i){const{offset:s,band:o}=i;s&&(r.offset=s),o&&(r.band=o)}return r}function q1({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:s="end",bandPosition:o=.5}){const a=!me(o)&&0{switch(t.fieldTitle){case"plain":return e.field;case"functional":return U0e(e);default:return B0e(e,t)}};let lR=uR;function cR(e){lR=e}function j0e(){cR(uR)}function xc(e,t,{allowDisabling:n,includeDefault:i=!0}){var a;const r=(a=X_(e))==null?void 0:a.title;if(!J(e))return r??e.title;const s=e,o=i?K_(s,t):void 0;return n?zt(r,s.title,o):r??s.title??o}function X_(e){if(vc(e)&&e.axis)return e.axis;if(oR(e)&&e.legend)return e.legend;if(V_(e)&&e.header)return e.header}function K_(e,t){return lR(e,t)}function X1(e){if(aR(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=X_(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function q0e(e,t){var s;switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Y_(e)&&W(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!fa(n)&&!ro(n))return"quantitative";if(Au(e)&&((s=e.scale)!=null&&s.type))switch(O_[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function Rr(e){if(J(e))return e;if(G1(e))return e.condition}function Xt(e){if(Ne(e))return e;if(oh(e))return e.condition}function fR(e,t,n,i={}){if(se(e)||Je(e)||xo(e)){const r=se(e)?"string":Je(e)?"number":"boolean";return Z(Hde(t,r,e)),{value:e}}return Ne(e)?K1(e,t,n,i):oh(e)?{...e,condition:K1(e.condition,t,n,i)}:e}function K1(e,t,n,i){if(aR(e)){const{format:r,formatType:s,...o}=e;if(ku(s)&&!n.customFormatTypes)return Z(fN(t)),K1(o,t,n,i)}else{const r=vc(e)?"axis":oR(e)?"legend":V_(e)?"header":null;if(r&&e[r]){const{format:s,formatType:o,...a}=e[r];if(ku(o)&&!n.customFormatTypes)return Z(fN(t)),K1({...e,[r]:a},t,n,i)}}return J(e)?Z_(e,t,i):W0e(e)}function W0e(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=Je(n)?"quantitative":se(n)?"nominal":vu(n)?"temporal":void 0,{...e,type:t}}function Z_(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:s,field:o}=e,a={...e};if(!n&&i&&!p_(i)&&!fa(i)&&!ro(i)&&(Z(Vde(i)),delete a.aggregate),r&&(a.timeUnit=sn(r)),o&&(a.field=`${o}`),_t(s)&&(a.bin=Z1(s,t)),mn(s)&&!Bt(t)&&Z(khe(t)),ei(a)){const{type:u}=a,l=Khe(u);u!==l&&(a.type=l),u!=="quantitative"&&M1(i)&&(Z(Gde(u,i)),a.type="quantitative")}else if(!BM(t)){const u=q0e(a,t);a.type=u}if(ei(a)){const{compatible:u,warning:l}=H0e(a,t)||{};u===!1&&Z(l)}if(Y_(a)&&se(a.sort)){const{sort:u}=a;if(QN(u))return{...a,sort:{encoding:u}};const l=u.substring(1);if(u.charAt(0)==="-"&&QN(l))return{...a,sort:{encoding:l,order:"descending"}}}if(V_(a)){const{header:u}=a;if(u){const{orient:l,...c}=u;if(l)return{...a,header:{...c,labelOrient:u.labelOrient||l,titleOrient:u.titleOrient||l}}}}return a}function Z1(e,t){return xo(e)?{maxbins:VM(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:VM(t)}:e}const _c={compatible:!0};function H0e(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case Zs:case Js:case A1:return Y1(e)?_c:{compatible:!1,warning:Zde(t)};case $t:case rn:case ra:case dc:case pi:case hs:case ps:case Kd:case Zd:case $1:case pu:case S1:case F1:case hu:case tr:case Ar:case D1:return _c;case Sr:case nr:case $r:case Fr:return n!==wu?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:_c;case no:case oa:case aa:case ua:case to:case eo:case Qs:case kr:case ds:case sa:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:_c;case gi:case la:return!Y1(e)&&!P0e(e)?{compatible:!1,warning:Jde(t)}:_c;case hc:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:_c}}function wc(e){const{formatType:t}=X1(e);return t==="time"||!t&&G0e(e)}function G0e(e){return e&&(e.type==="temporal"||J(e)&&!!e.timeUnit)}function J1(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){var u;const s=t&&((u=sn(t))==null?void 0:u.unit);let o=s||n==="temporal",a;return Qd(e)?a=e.expr:me(e)?a=e.signal:vu(e)?(o=!0,a=xu(e)):(se(e)||Je(e))&&o&&(a=`datetime(${pt(e)})`,Ihe(s)&&(Je(e)&&e<1e4||se(e)&&isNaN(Date.parse(e)))&&(a=xu({[s]:e}))),a?i&&o?`time(${a})`:a:r?void 0:pt(e)}function dR(e,t){const{type:n}=e;return t.map(i=>{const r=J(e)&&!_u(e.timeUnit)?e.timeUnit:void 0,s=J1(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return s!==void 0?{signal:s}:i})}function ah(e,t){return _t(e.bin)?ms(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const hR={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function uh(e){return e==null?void 0:e.condition}const pR=["domain","grid","labels","ticks","title"],V0e={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},gR={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},Y0e={...gR,style:1,labelExpr:1,encoding:1};function mR(e){return ue(Y0e,e)}const yR=Y({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1});function ao(e){return X(e,"mark")}class Q1{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return ao(t)?E0e(t.mark)===this.name:!1}}function $u(e,t){const n=e&&e[t];return n?W(n)?lc(n,i=>!!i.field):J(n)||G1(n):!1}function bR(e,t){const n=e&&e[t];return n?W(n)?lc(n,i=>!!i.field):J(n)||_s(n)||oh(n):!1}function vR(e,t){if(Bt(t)){const n=e[t];if((J(n)||_s(n))&&(TN(n.type)||J(n)&&n.timeUnit)){const i=a_(t);return bR(e,i)}}return!1}function xR(e){return lc(Yfe,t=>{if($u(e,t)){const n=e[t];if(W(n))return lc(n,i=>!!i.aggregate);{const i=Rr(n);return i&&!!i.aggregate}}return!1})}function _R(e,t){const n=[],i=[],r=[],s=[],o={};return J_(e,(a,u)=>{if(J(a)){const{field:l,aggregate:c,bin:f,timeUnit:d,...h}=a;if(c||d||f){const p=X_(a),g=p==null?void 0:p.title;let m=ne(a,{forAs:!0});const y={...g?[]:{title:xc(a,t,{allowDisabling:!0})},...h,field:m};if(c){let b;if(fa(c)?(b="argmax",m=ne({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${l}`):ro(c)?(b="argmin",m=ne({op:"argmin",field:c.argmin},{forAs:!0}),y.field=`${m}.${l}`):c!=="boxplot"&&c!=="errorbar"&&c!=="errorband"&&(b=c),b){const v={op:b,as:m};l&&(v.field=l),s.push(v)}}else if(n.push(m),ei(a)&&_t(f)){if(i.push({bin:f,field:l,as:m}),n.push(ne(a,{binSuffix:"end"})),ah(a,u)&&n.push(ne(a,{binSuffix:"range"})),Bt(u)){const b={field:`${m}_end`};o[`${u}2`]=b}y.bin="binned",BM(u)||(y.type=wu)}else if(d&&!_u(d)){r.push({timeUnit:d,field:l,as:m});const b=ei(a)&&a.type!==gc&&"time";b&&(u===Kd||u===pu?y.formatType=b:sde(u)?y.legend={formatType:b,...y.legend}:Bt(u)&&(y.axis={formatType:b,...y.axis}))}o[u]=y}else n.push(l),o[u]=e[u]}else o[u]=e[u]}),{bins:i,timeUnits:r,aggregate:s,groupby:n,encoding:o}}function X0e(e,t,n){const i=ade(t,n);if(i){if(i==="binned"){const r=e[t===kr?$t:rn];return!!(J(r)&&J(e[t])&&mn(r.bin))}}else return!1;return!0}function K0e(e,t,n,i){const r={};for(const s of Y(e))zM(s)||Z(Kde(s));for(let s of ede){if(!e[s])continue;const o=e[s];if(Jd(s)){const a=Qfe(s),u=r[a];if(J(u)&&Xhe(u.type)&&J(o)&&!u.timeUnit){Z(Wde(a));continue}}if(s==="angle"&&t==="arc"&&!e.theta&&(Z(qde),s=tr),!X0e(e,s,t)){Z(R1(s,t));continue}if(s===to&&t==="line"){const a=Rr(e[s]);if(a!=null&&a.aggregate){Z(Xde);continue}}if(s===pi&&(n?"fill"in e:"stroke"in e)){Z(hN("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(s===Zd||s===hc&&!W(o)&&!Nr(o)||s===pu&&W(o)){if(o){if(s===hc){const a=e[s];if(rR(a)){r[s]=a;continue}}r[s]=oe(o).reduce((a,u)=>(J(u)?a.push(Z_(u,s)):Z(x_(u,s)),a),[])}}else{if(s===pu&&o===null)r[s]=null;else if(!J(o)&&!_s(o)&&!Nr(o)&&!sh(o)&&!me(o)){Z(x_(o,s));continue}r[s]=fR(o,s,i)}}return r}function em(e,t){const n={};for(const i of Y(e)){const r=fR(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function Z0e(e){const t=[];for(const n of Y(e))if($u(e,n)){const i=e[n],r=oe(i);for(const s of r)J(s)?t.push(s):G1(s)&&t.push(s.condition)}return t}function J_(e,t,n){if(e)for(const i of Y(e)){const r=e[i];if(W(r))for(const s of r)t.call(n,s,i);else t.call(n,r,i)}}function J0e(e,t,n,i){return e?Y(e).reduce((r,s)=>{const o=e[s];return W(o)?o.reduce((a,u)=>t.call(i,a,u,s),r):t.call(i,r,o,s)},n):n}function wR(e,t){return Y(t).reduce((n,i)=>{switch(i){case $t:case rn:case S1:case D1:case F1:case kr:case ds:case ra:case dc:case tr:case eo:case Ar:case Qs:case sa:case $r:case Sr:case Fr:case nr:case Kd:case gi:case hu:case pu:return n;case hc:if(e==="line"||e==="trail")return n;case Zd:case $1:{const r=t[i];if(W(r)||J(r))for(const s of oe(r))s.aggregate||n.push(ne(s,{}));return n}case to:if(e==="trail")return n;case pi:case hs:case ps:case no:case oa:case aa:case la:case ua:{const r=Rr(t[i]);return r&&!r.aggregate&&n.push(ne(r,{})),n}}},[])}function Q0e(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(W(t)){for(const s of t)s.aggregate?(i||(i=[]),i.push(s)):(r||(r=[]),r.push(s));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return W(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function Q_(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};const r=e.map(({fieldPrefix:o,titlePrefix:a})=>{const u=i?` of ${ew(t)}`:"";return{field:o+t.field,type:t.type,title:me(a)?{signal:`${a}"${escape(u)}"`}:a+u}}),s=Z0e(n).map(L0e);return{tooltip:[...r,...fs(s,He)]}}function ew(e){const{title:t,field:n}=e;return zt(t,n)}function tw(e,t,n,i,r){const{scale:s,axis:o}=n;return({partName:a,mark:u,positionPrefix:l,endPositionPrefix:c=void 0,extraEncoding:f={}})=>{const d=ew(n);return ER(e,a,r,{mark:u,encoding:{[t]:{field:`${l}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...s!==void 0?{scale:s}:{},...o!==void 0?{axis:o}:{}},...se(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...i,...f}})}}function ER(e,t,n,i){const{clip:r,color:s,opacity:o}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...s?{color:s}:{},...o?{opacity:o}:{},...xs(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(t)}`,...xo(e[t])?{}:e[t]}}]:[]}function CR(e,t,n){const{encoding:i}=e,r=t==="vertical"?"y":"x",s=i[r],o=i[`${r}2`],a=i[`${r}Error`],u=i[`${r}Error2`];return{continuousAxisChannelDef:tm(s,n),continuousAxisChannelDef2:tm(o,n),continuousAxisChannelDefError:tm(a,n),continuousAxisChannelDefError2:tm(u,n),continuousAxis:r}}function tm(e,t){if(e!=null&&e.aggregate){const{aggregate:n,...i}=e;return n!==t&&Z(Che(n,t)),i}else return e}function kR(e,t){const{mark:n,encoding:i}=e,{x:r,y:s}=i;if(xs(n)&&n.orient)return n.orient;if(ga(r)){if(ga(s)){const o=J(r)&&r.aggregate,a=J(s)&&s.aggregate;if(!o&&a===t)return"vertical";if(!a&&o===t)return"horizontal";if(o===t&&a===t)throw new Error("Both x and y cannot have aggregate");return wc(s)&&!wc(r)?"horizontal":"vertical"}return"horizontal"}else{if(ga(s))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const nm="boxplot",epe=["box","median","outliers","rule","ticks"],tpe=new Q1(nm,$R);function AR(e){return Je(e)?"tukey":e}function $R(e,{config:t}){e={...e,encoding:em(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:s,...o}=e,a=xs(n)?n:{type:n};r&&Z(uN("boxplot"));const u=a.extent??t.boxplot.extent,l=gt("size",a,t),c=a.invalid,f=AR(u),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:y,aggregate:b,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:_,customTooltipWithoutAggregatedField:E}=npe(e,u,t),w=cc(g.field),{color:C,size:k,...S}=v,$=o2=>tw(a,m,g,o2,t.boxplot),O=$(S),R=$(v),D=(re(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",A=$({...S,...k?{size:k}:{},color:{condition:{test:`${ut(`lower_box_${g.field}`)} >= ${ut(`upper_box_${g.field}`)}`,...C||{value:D}}}}),M=Q_([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,v),B={type:"tick",color:"black",opacity:1,orient:x,invalid:c,aria:!1},G=f==="min-max"?M:Q_([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,v),z=[...O({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:G}),...O({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:G}),...O({partName:"ticks",mark:B,positionPrefix:"lower_whisker",extraEncoding:G}),...O({partName:"ticks",mark:B,positionPrefix:"upper_whisker",extraEncoding:G})],ie=[...f!=="tukey"?z:[],...R({partName:"box",mark:{type:"bar",...l?{size:l}:{},orient:_,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:M}),...A({partName:"median",mark:{type:"tick",invalid:c,...re(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...l?{size:l}:{},orient:x,aria:!1},positionPrefix:"mid_box",extraEncoding:M})];if(f==="min-max")return{...o,transform:(o.transform??[]).concat(p),layer:ie};const xe=ut(`lower_box_${g.field}`),he=ut(`upper_box_${g.field}`),Te=`(${he} - ${xe})`,ft=`${xe} - ${u} * ${Te}`,Fe=`${he} + ${u} * ${Te}`,Ot=ut(g.field),or={joinaggregate:SR(g.field),groupby:y},Ii={transform:[{filter:`(${ft} <= ${Ot}) && (${Ot} <= ${Fe})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${w}`},{op:"max",field:g.field,as:`upper_whisker_${w}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${w}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${w}`},...b],groupby:y}],layer:z},{tooltip:le,...Re}=S,{scale:Pe,axis:K}=g,Kt=ew(g),Xe=hi(K,["title"]),Pn=ER(a,"outliers",t.boxplot,{transform:[{filter:`(${Ot} < ${ft}) || (${Ot} > ${Fe})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...Kt!==void 0?{title:Kt}:{},...Pe!==void 0?{scale:Pe}:{},...ht(Xe)?{}:{axis:Xe}},...Re,...C?{color:C}:{},...E?{tooltip:E}:{}}})[0];let ln;const Fs=[...d,...h,or];return Pn?ln={transform:Fs,layer:[Pn,Ii]}:(ln=Ii,ln.transform.unshift(...Fs)),{...o,layer:[ln,{transform:p,layer:ie}]}}function SR(e){const t=cc(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function npe(e,t,n){const i=kR(e,nm),{continuousAxisChannelDef:r,continuousAxis:s}=CR(e,i,nm),o=r.field,a=cc(o),u=AR(t),l=[...SR(o),{op:"median",field:o,as:`mid_box_${a}`},{op:"min",field:o,as:(u==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:o,as:(u==="min-max"?"upper_whisker_":"max_")+a}],c=u==="min-max"||u==="tukey"?[]:[{calculate:`${ut(`upper_box_${a}`)} - ${ut(`lower_box_${a}`)}`,as:`iqr_${a}`},{calculate:`min(${ut(`upper_box_${a}`)} + ${ut(`iqr_${a}`)} * ${t}, ${ut(`max_${a}`)})`,as:`upper_whisker_${a}`},{calculate:`max(${ut(`lower_box_${a}`)} - ${ut(`iqr_${a}`)} * ${t}, ${ut(`min_${a}`)})`,as:`lower_whisker_${a}`}],{[s]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=Q0e(d),{bins:g,timeUnits:m,aggregate:y,groupby:b,encoding:v}=_R(p,n),x=i==="vertical"?"horizontal":"vertical",_=i,E=[...g,...m,{aggregate:[...y,...l],groupby:b},...c];return{bins:g,timeUnits:m,transform:E,groupby:b,aggregate:y,continuousAxisChannelDef:r,continuousAxis:s,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:_,customTooltipWithoutAggregatedField:h}}const nw="errorbar",ipe=["ticks","rule"],rpe=new Q1(nw,FR);function FR(e,{config:t}){e={...e,encoding:em(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,ticksOrient:o,markDef:a,outerSpec:u,tooltipEncoding:l}=DR(e,nw,t);delete s.size;const c=tw(a,r,i,s,t.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:o,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:l}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l})];return{...u,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function spe(e,t){const{encoding:n}=e;if(ope(n))return{orient:kR(e,t),inputType:"raw"};const i=ape(n),r=upe(n),s=n.x,o=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,u=n.y2;if(Ne(a)&&Ne(u))throw new Error(`${t} cannot have both x2 and y2`);if(Ne(a)){if(ga(s))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(Ne(u)){if(ga(o))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{const a=n.xError,u=n.xError2,l=n.yError,c=n.yError2;if(Ne(u)&&!Ne(a))throw new Error(`${t} cannot have xError2 without xError`);if(Ne(c)&&!Ne(l))throw new Error(`${t} cannot have yError2 without yError`);if(Ne(a)&&Ne(l))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(Ne(a)){if(ga(s))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(Ne(l)){if(ga(o))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function ope(e){return(Ne(e.x)||Ne(e.y))&&!Ne(e.x2)&&!Ne(e.y2)&&!Ne(e.xError)&&!Ne(e.xError2)&&!Ne(e.yError)&&!Ne(e.yError2)}function ape(e){return Ne(e.x2)||Ne(e.y2)}function upe(e){return Ne(e.xError)||Ne(e.xError2)||Ne(e.yError)||Ne(e.yError2)}function DR(e,t,n){const{mark:i,encoding:r,params:s,projection:o,...a}=e,u=xs(i)?i:{type:i};s&&Z(uN(t));const{orient:l,inputType:c}=spe(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=CR(e,l,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:v}=lpe(u,f,d,h,p,c,t,n),{[g]:x,[g==="x"?"x2":"y2"]:_,[g==="x"?"xError":"yError"]:E,[g==="x"?"xError2":"yError2"]:w,...C}=r,{bins:k,timeUnits:S,aggregate:$,groupby:O,encoding:R}=_R(C,n),D=[...$,...m],A=c!=="raw"?[]:O,M=Q_(b,f,R,v);return{transform:[...a.transform??[],...k,...S,...D.length===0?[]:[{aggregate:D,groupby:A}],...y],groupby:A,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:R,ticksOrient:l==="vertical"?"horizontal":"vertical",markDef:u,outerSpec:a,tooltipEncoding:M}}function lpe(e,t,n,i,r,s,o,a){let u=[],l=[];const c=t.field;let f,d=!1;if(s==="raw"){const h=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,p=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&Z(Ehe(h,p,o)),p==="stderr"||p==="stdev")u=[{op:p,field:c,as:`extent_${c}`},{op:h,field:c,as:`center_${c}`}],l=[{calculate:`${ut(`center_${c}`)} + ${ut(`extent_${c}`)}`,as:`upper_${c}`},{calculate:`${ut(`center_${c}`)} - ${ut(`extent_${c}`)}`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:Yd(h)},{fieldPrefix:"upper_",titlePrefix:TR(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:TR(h,p,"-")}],d=!0;else{let g,m,y;p==="ci"?(g="mean",m="ci0",y="ci1"):(g="median",m="q1",y="q3"),u=[{op:m,field:c,as:`lower_${c}`},{op:y,field:c,as:`upper_${c}`},{op:g,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:xc({field:c,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:xc({field:c,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:xc({field:c,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&Z(whe(e.center,e.extent)),s==="aggregated-upper-lower"?(f=[],l=[{calculate:ut(n.field),as:`upper_${c}`},{calculate:ut(c),as:`lower_${c}`}]):s==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`${ut(c)} + ${ut(i.field)}`,as:`upper_${c}`}],r?l.push({calculate:`${ut(c)} + ${ut(r.field)}`,as:`lower_${c}`}):l.push({calculate:`${ut(c)} - ${ut(i.field)}`,as:`lower_${c}`}));for(const h of l)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:du(du(h.calculate,"datum['",""),"']","")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}function TR(e,t,n){return`${Yd(e)} ${n} ${t}`}const iw="errorband",cpe=["band","borders"],fpe=new Q1(iw,MR);function MR(e,{config:t}){e={...e,encoding:em(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,markDef:o,outerSpec:a,tooltipEncoding:u}=DR(e,iw,t),l=o,c=tw(l,r,i,s,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...l.interpolate?{interpolate:l.interpolate}:{},...l.tension&&l.interpolate?{tension:l.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):l.interpolate?Z(yN("interpolate")):l.tension&&Z(yN("tension")),{...a,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]}}const NR={};function rw(e,t,n){const i=new Q1(e,t);NR[e]={normalizer:i,parts:n}}function dpe(){return Y(NR)}rw(nm,$R,epe),rw(nw,FR,ipe),rw(iw,MR,cpe);const hpe=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],RR={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},OR={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},ppe=Y(RR),gpe=Y(OR),LR=Y({header:1,headerRow:1,headerColumn:1,headerFacet:1}),IR=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],mpe={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},ype={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},Or="_vgsid_",bpe={point:{on:"click",fields:[Or],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function sw(e){return e==="legend"||!!(e!=null&&e.legend)}function ow(e){return sw(e)&&re(e)}function aw(e){return!!(e!=null&&e.select)}function PR(e){const t=[];for(const n of e||[]){if(aw(n))continue;const{expr:i,bind:r,...s}=n;if(r&&i){const o={...s,bind:r,init:i};t.push(o)}else{const o={...s,...i?{update:i}:{},...r?{bind:r}:{}};t.push(o)}}return t}function vpe(e){return im(e)||lw(e)||uw(e)}function uw(e){return X(e,"concat")}function im(e){return X(e,"vconcat")}function lw(e){return X(e,"hconcat")}function zR({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function ws(e){return X(e,"step")}function BR(e){return X(e,"view")||X(e,"width")||X(e,"height")}const UR=20,xpe=Y({align:1,bounds:1,center:1,columns:1,spacing:1});function _pe(e,t,n){const i=n[t],r={},{spacing:s,columns:o}=i;s!==void 0&&(r.spacing=s),o!==void 0&&(H1(e)&&!rh(e.facet)||uw(e))&&(r.columns=o),im(e)&&(r.columns=1);for(const a of xpe)if(e[a]!==void 0)if(a==="spacing"){const u=e[a];r[a]=Je(u)?u:{row:u.row??s,column:u.column??s}}else r[a]=e[a];return r}function cw(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function fw(e,t){const n=rm(e,t);return ws(n)?n.step:jR}function rm(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return zt(n,{step:e.step})}const jR=20,wpe={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:jR},mark:v0e,arc:{},area:{},bar:_0e,circle:{},geoshape:{},image:{},line:{},point:{},rect:U_,rule:{color:"black"},square:{},text:{color:"black"},tick:w0e,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:t0e,projection:{},legend:mpe,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:bpe,style:{},title:{},facet:{spacing:UR},concat:{spacing:UR},normalizedNumberFormat:".0%"},uo=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],qR={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},WR={blue:uo[0],orange:uo[1],red:uo[2],teal:uo[3],green:uo[4],yellow:uo[5],purple:uo[6],pink:uo[7],brown:uo[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function Epe(e={}){return{signals:[{name:"color",value:re(e)?{...WR,...e}:WR}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function Cpe(e){return{signals:[{name:"fontSize",value:re(e)?{...qR,...e}:qR}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function kpe(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function HR(e){const t=Y(e||{}),n={};for(const i of t){const r=e[i];n[i]=uh(r)?XM(r):Ni(r)}return n}function Ape(e){const t=Y(e),n={};for(const i of t)n[i]=HR(e[i]);return n}const $pe=[...qN,...yR,...LR,"background","padding","legend","lineBreak","scale","style","title","view"];function GR(e={}){const{color:t,font:n,fontSize:i,selection:r,...s}=e,o=nl({},De(wpe),n?kpe(n):{},t?Epe(t):{},i?Cpe(i):{},s||{});r&&il(o,"selection",r,!0);const a=hi(o,$pe);for(const u of["background","lineBreak","padding"])o[u]&&(a[u]=Ni(o[u]));for(const u of qN)o[u]&&(a[u]=yn(o[u]));for(const u of yR)o[u]&&(a[u]=HR(o[u]));for(const u of LR)o[u]&&(a[u]=yn(o[u]));if(o.legend&&(a.legend=yn(o.legend)),o.scale){const{invalid:u,...l}=o.scale,c=yn(u,{level:1});a.scale={...yn(l),...Y(c).length>0?{invalid:c}:{}}}return o.style&&(a.style=Ape(o.style)),o.title&&(a.title=yn(o.title)),o.view&&(a.view=yn(o.view)),a}const Spe=new Set(["view",...p0e]),Fpe=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],Dpe={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...b0e};function Tpe(e){e=De(e);for(const t of Fpe)delete e[t];if(e.axis)for(const t in e.axis)uh(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of hpe)delete e.legend[t];if(e.mark){for(const t of jN)delete e.mark[t];e.mark.tooltip&&re(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(PR(e.params)),delete e.params);for(const t of Spe){for(const i of jN)delete e[t][i];const n=Dpe[t];if(n)for(const i of n)delete e[t][i];Npe(e,t)}for(const t of dpe())delete e[t];Mpe(e);for(const t in e)re(e[t])&&ht(e[t])&&delete e[t];return ht(e)?void 0:e}function Mpe(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=YM(e.title);ht(t)||(e.style["group-title"]={...e.style["group-title"],...t}),ht(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),ht(i)?delete e.title:e.title=i}function Npe(e,t,n,i){const r=e[t];t==="view"&&(n="cell");const s={...r,...e.style[n??t]};ht(s)||(e.style[n??t]=s),delete e[t]}function sm(e){return X(e,"layer")}function Rpe(e){return X(e,"repeat")}function Ope(e){return!W(e.repeat)&&X(e.repeat,"layer")}class dw{map(t,n){return H1(t)?this.mapFacet(t,n):Rpe(t)?this.mapRepeat(t,n):lw(t)?this.mapHConcat(t,n):im(t)?this.mapVConcat(t,n):uw(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(sm(t))return this.mapLayer(t,n);if(ao(t))return this.mapUnit(t,n);throw new Error(y_(t))}mapLayer(t,n){return{...t,layer:t.layer.map(i=>this.mapLayerOrUnit(i,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(i=>this.map(i,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(i=>this.map(i,n))}}mapConcat(t,n){const{concat:i,...r}=t;return{...r,concat:i.map(s=>this.map(s,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const Lpe={zero:1,center:1,normalize:1};function Ipe(e){return ue(Lpe,e)}const Ppe=new Set([zN,z1,P1,j1,U1,P_,z_,B1,BN,I_]),zpe=new Set([z1,P1,zN]);function Ec(e){return J(e)&&bc(e)==="quantitative"&&!e.bin}function VR(e,t,{orient:n,type:i}){const r=t==="x"?"y":"radius",s=t==="x"&&["bar","area"].includes(i),o=e[t],a=e[r];if(J(o)&&J(a))if(Ec(o)&&Ec(a)){if(o.stack)return t;if(a.stack)return r;const u=J(o)&&!!o.aggregate,l=J(a)&&!!a.aggregate;if(u!==l)return u?t:r;if(s){if(n==="vertical")return r;if(n==="horizontal")return t}}else{if(Ec(o))return t;if(Ec(a))return r}else{if(Ec(o))return s&&n==="vertical"?void 0:t;if(Ec(a))return s&&n==="horizontal"?void 0:r}}function Bpe(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function YR(e,t){var g,m;const n=xs(e)?e:{type:e},i=n.type;if(!Ppe.has(i))return null;const r=VR(t,"x",n)||VR(t,"theta",n);if(!r)return null;const s=t[r],o=J(s)?ne(s,{}):void 0,a=Bpe(r),u=[],l=new Set;if(t[a]){const y=t[a],b=J(y)?ne(y,{}):void 0;b&&b!==o&&(u.push(a),l.add(b))}const c=a==="x"?"xOffset":"yOffset",f=t[c],d=J(f)?ne(f,{}):void 0;d&&d!==o&&(u.push(c),l.add(d));const h=tde.reduce((y,b)=>{if(b!=="tooltip"&&$u(t,b)){const v=t[b];for(const x of oe(v)){const _=Rr(x);if(_.aggregate)continue;const E=ne(_,{});(!E||!l.has(E))&&y.push({channel:b,fieldDef:_})}}return y},[]);let p;return s.stack!==void 0?xo(s.stack)?p=s.stack?"zero":null:p=s.stack:zpe.has(i)&&(p="zero"),!p||!Ipe(p)||xR(t)&&h.length===0?null:((g=s==null?void 0:s.scale)!=null&&g.type&&((m=s==null?void 0:s.scale)==null?void 0:m.type)!==bn.LINEAR&&s!=null&&s.stack&&Z(vhe(s.scale.type)),Ne(t[gs(r)])?(s.stack!==void 0&&Z(bhe(r)),null):(J(s)&&s.aggregate&&!pde.has(s.aggregate)&&Z(xhe(s.aggregate)),{groupbyChannels:u,groupbyFields:l,fieldChannel:r,impute:s.impute===null?!1:ha(i),stackBy:h,offset:p}))}function XR(e,t,n){const i=yn(e),r=gt("orient",i,n);if(i.orient=Wpe(i.type,t,r),r!==void 0&&r!==i.orient&&Z(nhe(i.orient,r)),i.type==="bar"&&i.orient){const u=gt("cornerRadiusEnd",i,n);if(u!==void 0){const l=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:x0e[i.orient];for(const c of l)i[c]=u;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}const s=gt("opacity",i,n),o=gt("fillOpacity",i,n);return s===void 0&&o===void 0&&(i.opacity=jpe(i.type,t)),gt("cursor",i,n)===void 0&&(i.cursor=Upe(i,t,n)),i}function Upe(e,t,n){return t.href||e.href||gt("href",e,n)?"pointer":e.cursor}function jpe(e,t){if(We([U1,I_,P_,z_],e)&&!xR(t))return .7}function qpe(e,t,{graticule:n}){if(n)return!1;const i=ys("filled",e,t),r=e.type;return zt(i,r!==U1&&r!==B1&&r!==j1)}function Wpe(e,t,n){switch(e){case U1:case P_:case z_:case BN:case d0e:case f0e:return}const{x:i,y:r,x2:s,y2:o}=t;switch(e){case z1:if(J(i)&&(mn(i.bin)||J(r)&&r.aggregate&&!i.aggregate))return"vertical";if(J(r)&&(mn(r.bin)||J(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(o||s){if(n)return n;if(!s)return(J(i)&&i.type===wu&&!_t(i.bin)||V1(i))&&J(r)&&mn(r.bin)?"horizontal":"vertical";if(!o)return(J(r)&&r.type===wu&&!_t(r.bin)||V1(r))&&J(i)&&mn(i.bin)?"vertical":"horizontal"}case j1:if(s&&!(J(i)&&mn(i.bin))&&o&&!(J(r)&&mn(r.bin)))return;case P1:if(o)return J(r)&&mn(r.bin)?"horizontal":"vertical";if(s)return J(i)&&mn(i.bin)?"vertical":"horizontal";if(e===j1){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case B1:case I_:{const a=sR(i),u=sR(r);if(n)return n;if(a&&!u)return e!=="tick"?"horizontal":"vertical";if(!a&&u)return e!=="tick"?"vertical":"horizontal";if(a&&u)return"vertical";{const l=ei(i)&&i.type===gc,c=ei(r)&&r.type===gc;if(l&&!c)return"vertical";if(!l&&c)return"horizontal"}return}}return"vertical"}function Hpe(e){const{point:t,line:n,...i}=e;return Y(i).length>1?i:i.type}function Gpe(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:hi(e[t],["point","line"])});return e}function hw(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?re(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?re(t.point)?t.point:{}:void 0}function KR(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class Vpe{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(ao(t)){const{mark:i,encoding:r}=t,s=xs(i)?i:{type:i};switch(s.type){case"line":case"rule":case"trail":return!!hw(s,n[s.type],r);case"area":return!!hw(s,n[s.type],r)||!!KR(s,n[s.type])}}return!1}run(t,n,i){const{config:r}=n,{params:s,projection:o,mark:a,name:u,encoding:l,...c}=t,f=em(l,r),d=xs(a)?a:{type:a},h=hw(d,r[d.type],f),p=d.type==="area"&&KR(d,r[d.type]),g=[{name:u,...s?{params:s}:{},mark:Hpe({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:hi(f,["shape"])}],m=YR(XR(d,f,r),f);let y=f;if(m){const{fieldChannel:b,offset:v}=m;y={...f,[b]:{...f[b],...v?{stack:v}:{}}}}return y=hi(y,["y2","x2"]),p&&g.push({...o?{projection:o}:{},mark:{type:"line",...uc(d,["clip","interpolate","tension","tooltip"]),...p},encoding:y}),h&&g.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...uc(d,["clip","tooltip"]),...h},encoding:y}),i({...c,layer:g},{...n,config:Gpe(r)})}}function Ype(e,t){return t?rh(e)?eO(e,t):ZR(e,t):e}function pw(e,t){return t?eO(e,t):e}function gw(e,t,n){const i=t[e];if(R0e(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};Z(Nde(i.repeat));return}return t}function ZR(e,t){if(e=gw("field",e,t),e!==void 0){if(e===null)return null;if(Y_(e)&&oo(e.sort)){const n=gw("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function JR(e,t){if(J(e))return ZR(e,t);{const n=gw("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function QR(e,t){if(Ne(e)){const n=JR(e,t);if(n)return n;if(sh(e))return{condition:e.condition}}else{if(oh(e)){const n=JR(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}}function eO(e,t){const n={};for(const i in e)if(X(e,i)){const r=e[i];if(W(r))n[i]=r.map(s=>QR(s,t)).filter(s=>s);else{const s=QR(r,t);s!==void 0&&(n[i]=s)}}return n}class Xpe{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(ao(t)){const{encoding:n,mark:i}=t;if(i==="line"||xs(i)&&i.type==="line")for(const r of Jfe){const s=gu(r),o=n[s];if(n[r]&&(J(o)&&!mn(o.bin)||_s(o)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:s}=t;return Z(the(!!r.x2,!!r.y2)),i({...t,mark:re(s)?{...s,type:"rule"}:"rule"},n)}}class Kpe extends dw{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[tpe,rpe,fpe,new Vpe,new Xpe]}map(t,n){if(ao(t)){const i=$u(t.encoding,Zs),r=$u(t.encoding,Js),s=$u(t.encoding,A1);if(i||r||s)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:i,parentProjection:r}=n,s=pw(t.encoding,n.repeater),o={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(u=>u).join("_")}:{},...s?{encoding:s}:{}};if(i||r)return this.mapUnitWithParentEncodingOrProjection(o,n);const a=this.mapLayerOrUnit.bind(this);for(const u of this.nonFacetUnitNormalizers)if(u.hasMatchingType(o,n.config))return u.run(o,n,a);return o}mapRepeat(t,n){return Ope(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:i,spec:r,...s}=t,{row:o,column:a,layer:u}=i,{repeater:l={},repeaterPrefix:c=""}=n;return o||a?this.mapRepeat({...t,repeat:{...o?{row:o}:{},...a?{column:a}:{}},spec:{repeat:{layer:u},spec:r}},n):{...s,layer:u.map(f=>{const d={...l,layer:f},h=`${(r.name?`${r.name}_`:"")+c}child__layer_${At(f)}`,p=this.mapLayerOrUnit(r,{...n,repeater:d,repeaterPrefix:h});return p.name=h,p})}}mapNonLayerRepeat(t,n){const{repeat:i,spec:r,data:s,...o}=t;!W(i)&&t.columns&&(t=hi(t,["columns"]),Z(lN("repeat")));const a=[],{repeater:u={},repeaterPrefix:l=""}=n,c=!W(i)&&i.row||[u?u.row:null],f=!W(i)&&i.column||[u?u.column:null],d=W(i)&&i||[u?u.repeat:null];for(const p of d)for(const g of c)for(const m of f){const y={repeat:p,row:g,column:m,layer:u.layer},b=(r.name?`${r.name}_`:"")+l+"child__"+(W(i)?`${At(p)}`:(i.row?`row_${At(g)}`:"")+(i.column?`column_${At(m)}`:"")),v=this.map(r,{...n,repeater:y,repeaterPrefix:b});v.name=b,a.push(hi(v,["data"]))}const h=W(i)?t.columns:i.column?i.column.length:1;return{data:r.data??s,align:"all",...o,columns:h,concat:a}}mapFacet(t,n){const{facet:i}=t;return rh(i)&&t.columns&&(t=hi(t,["columns"]),Z(lN("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:i,projection:r}=t,{parentEncoding:s,parentProjection:o,config:a}=n,u=nO({parentProjection:o,projection:r}),l=tO({parentEncoding:s,encoding:pw(i,n.repeater)});return this.mapUnit({...t,...u?{projection:u}:{},...l?{encoding:l}:{}},{config:a})}mapFacetedUnit(t,n){const{row:i,column:r,facet:s,...o}=t.encoding,{mark:a,width:u,projection:l,height:c,view:f,params:d,encoding:h,...p}=t,{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:i,column:r,facet:s},n),y=pw(o,n.repeater);return this.mapFacet({...p,...m,facet:g,spec:{...u?{width:u}:{},...c?{height:c}:{},...f?{view:f}:{},...l?{projection:l}:{},mark:a,encoding:y,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:i,column:r,facet:s}=t;if(i||r){s&&Z(Qde([...i?[Zs]:[],...r?[Js]:[]]));const o={},a={};for(const u of[Zs,Js]){const l=t[u];if(l){const{align:c,center:f,spacing:d,columns:h,...p}=l;o[u]=p;for(const g of["align","center","spacing"])l[g]!==void 0&&(a[g]??(a[g]={}),a[g][u]=l[g])}}return{facetMapping:o,layout:a}}else{const{align:o,center:a,spacing:u,columns:l,...c}=s;return{facetMapping:Ype(c,n.repeater),layout:{...o?{align:o}:{},...a?{center:a}:{},...u?{spacing:u}:{},...l?{columns:l}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:i,...r}){const{encoding:s,projection:o,...a}=t,u={...r,parentEncoding:tO({parentEncoding:n,encoding:s,layer:!0}),parentProjection:nO({parentProjection:i,projection:o})};return super.mapLayer({...a,...t.name?{name:[u.repeaterPrefix,t.name].filter(l=>l).join("_")}:{}},u)}}function tO({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...Y(e),...Y(t)]);for(const s of r){const o=t[s],a=e[s];if(Ne(o)){const u={...a,...o};i[s]=u}else oh(o)?i[s]={...o,condition:{...a,...o.condition}}:o||o===null?i[s]=o:(n||Nr(a)||me(a)||Ne(a)||W(a))&&(i[s]=a)}}else i=t;return!i||ht(i)?void 0:i}function nO(e){const{parentProjection:t,projection:n}=e;return t&&n&&Z(jde({parentProjection:t,projection:n})),n??t}function mw(e){return X(e,"filter")}function Zpe(e){return X(e,"stop")}function iO(e){return X(e,"lookup")}function Jpe(e){return X(e,"data")}function Qpe(e){return X(e,"param")}function ege(e){return X(e,"pivot")}function tge(e){return X(e,"density")}function nge(e){return X(e,"quantile")}function ige(e){return X(e,"regression")}function rge(e){return X(e,"loess")}function sge(e){return X(e,"sample")}function oge(e){return X(e,"window")}function age(e){return X(e,"joinaggregate")}function uge(e){return X(e,"flatten")}function lge(e){return X(e,"calculate")}function rO(e){return X(e,"bin")}function cge(e){return X(e,"impute")}function fge(e){return X(e,"timeUnit")}function dge(e){return X(e,"aggregate")}function hge(e){return X(e,"stack")}function pge(e){return X(e,"fold")}function gge(e){return X(e,"extent")&&!X(e,"density")&&!X(e,"regression")}function mge(e){return e.map(t=>mw(t)?{filter:ac(t.filter,Yhe)}:t)}class yge extends dw{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=sO(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=sO(t,n),t.encoding){const i={};for(const[r,s]of ia(t.encoding))i[r]=oO(s,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:ia(i).map(([s,o])=>{const{init:a,bind:u,empty:l,...c}=o;c.type==="single"?(c.type="point",c.toggle=!1):c.type==="multi"&&(c.type="point"),n.emptySelections[s]=l!=="none";for(const f of gn(n.selectionPredicates[s]??{}))f.empty=l!=="none";return{name:s,value:a,select:c,bind:u}})}:t}}function sO(e,t){const{transform:n,...i}=e;if(n){const r=n.map(s=>{if(mw(s))return{filter:yw(s,t)};if(rO(s)&&mu(s.bin))return{...s,bin:aO(s.bin)};if(iO(s)){const{selection:o,...a}=s.from;return o?{...s,from:{param:o,...a}}:s}return s});return{...i,transform:r}}return e}function oO(e,t){var i,r;const n=De(e);if(J(n)&&mu(n.bin)&&(n.bin=aO(n.bin)),Au(n)&&((r=(i=n.scale)==null?void 0:i.domain)!=null&&r.selection)){const{selection:s,...o}=n.scale.domain;n.scale.domain={...o,...s?{param:s}:{}}}if(sh(n))if(W(n.condition))n.condition=n.condition.map(s=>{const{selection:o,param:a,test:u,...l}=s;return a?s:{...l,test:yw(s,t)}});else{const{selection:s,param:o,test:a,...u}=oO(n.condition,t);n.condition=o?n.condition:{...u,test:yw(n.condition,t)}}return n}function aO(e){const t=e.extent;if(t!=null&&t.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function yw(e,t){const n=i=>ac(i,r=>{var s;const o=t.emptySelections[r]??!0,a={param:r,empty:o};return(s=t.selectionPredicates)[r]??(s[r]=[]),t.selectionPredicates[r].push(a),a});return e.selection?n(e.selection):ac(e.test||e.filter,i=>i.selection?n(i.selection):i)}class bw extends dw{map(t,n){const i=n.selections??[];if(t.params&&!ao(t)){const r=[];for(const s of t.params)aw(s)?i.push(s):r.push(s);t.params=r}return n.selections=i,super.map(t,n)}mapUnit(t,n){const i=n.selections;if(!i||!i.length)return t;const r=(n.path??[]).concat(t.name),s=[];for(const o of i)if(!o.views||!o.views.length)s.push(o);else for(const a of o.views)(se(a)&&(a===t.name||r.includes(a))||W(a)&&a.map(u=>r.indexOf(u)).every((u,l,c)=>u!==-1&&(l===0||u>c[l-1])))&&s.push(o);return s.length&&(t.params=s),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=bw.prototype[e];bw.prototype[e]=function(n,i){return t.call(this,n,bge(n,i))}}function bge(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function uO(e,t){t===void 0&&(t=GR(e.config));const n=wge(e,t),{width:i,height:r}=e,s=Ege(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...s?{autosize:s}:{}}}const vge=new Kpe,xge=new yge,_ge=new bw;function wge(e,t={}){const n={config:t};return _ge.map(vge.map(xge.map(e,n),n),n)}function lO(e){return se(e)?{type:e}:e??{}}function Ege(e,t,n){let{width:i,height:r}=t;const s=ao(e)||sm(e),o={};s?i=="container"&&r=="container"?(o.type="fit",o.contains="padding"):i=="container"?(o.type="fit-x",o.contains="padding"):r=="container"&&(o.type="fit-y",o.contains="padding"):(i=="container"&&(Z(rN("width")),i=void 0),r=="container"&&(Z(rN("height")),r=void 0));const a={type:"pad",...o,...n?lO(n.autosize):{},...lO(e.autosize)};if(a.type==="fit"&&!s&&(Z(wde),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&Z(sN("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&Z(sN("height")),!Mi(a,{type:"pad"}))return a}function Cge(e){return["fit","fit-x","fit-y"].includes(e)}function kge(e){return e?`fit-${T1(e)}`:"fit"}const Age=["background","padding"];function cO(e,t){const n={};for(const i of Age)e&&e[i]!==void 0&&(n[i]=Ni(e[i]));return t&&(n.params=e.params),n}class lo{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new lo(De(this.explicit),De(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return zt(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:i}){n!==void 0&&this.set(t,n,i)}set(t,n,i){return delete this[i?"implicit":"explicit"][t],this[i?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:i}){n[t]!==void 0?this.set(t,n[t],!0):i[t]!==void 0&&this.set(t,i[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of Y(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function Es(e){return{explicit:!0,value:e}}function Ri(e){return{explicit:!1,value:e}}function fO(e){return(t,n,i,r)=>{const s=e(t.value,n.value);return s>0?t:s<0?n:om(t,n,i,r)}}function om(e,t,n,i){return e.explicit&&t.explicit&&Z(fhe(n,i,e.value,t.value)),e}function ma(e,t,n,i,r=om){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:Mi(e.value,t.value)?e:r(e,t,n,i)}class $ge extends lo{constructor(t={},n={},i=!1){super(t,n),this.explicit=t,this.implicit=n,this.parseNothing=i}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function Cc(e){return X(e,"url")}function lh(e){return X(e,"values")}function dO(e){return X(e,"name")&&!Cc(e)&&!lh(e)&&!ya(e)}function ya(e){return e&&(hO(e)||pO(e)||vw(e))}function hO(e){return X(e,"sequence")}function pO(e){return X(e,"sphere")}function vw(e){return X(e,"graticule")}var Ft;(function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup",e[e.PreFilterInvalid=5]="PreFilterInvalid",e[e.PostFilterInvalid=6]="PostFilterInvalid"})(Ft||(Ft={}));function gO({invalid:e,isPath:t}){switch(WN(e,{isPath:t})){case"filter":return{marks:"exclude-invalid-values",scales:"exclude-invalid-values"};case"break-paths-show-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"include-invalid-values"};case"break-paths-filter-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"exclude-invalid-values"};case"show":return{marks:"include-invalid-values",scales:"include-invalid-values"}}}function Sge(e){const{marks:t,scales:n}=gO(e);return t===n?Ft.Main:n==="include-invalid-values"?Ft.PreFilterInvalid:Ft.PostFilterInvalid}class lt{constructor(t,n){this.debugName=n,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,n){if(this._children.includes(t)){Z(zde);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const r of this._children)r.parent=t;this._children=[],t.removeChild(this);const i=t.parent.removeChild(t);this._parent=n,n.addChild(this,i),t.parent=this}}class yi extends lt{clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,n,i,r){super(t,n),this.type=i,this.refCounts=r,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${DM()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function xw(e){return e.as!==void 0}function mO(e){return`${e}_end`}class Cs extends lt{clone(){return new Cs(null,De(this.timeUnits))}constructor(t,n){super(t),this.timeUnits=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,o)=>{const{field:a,timeUnit:u}=s;if(u){let l;if(_u(u)){if(Dt(n)){const{mark:c,markDef:f,config:d}=n,h=pa({fieldDef:s,markDef:f,config:d});(th(c)||h)&&(l={timeUnit:sn(u),field:a})}}else l={as:ne(s,{forAs:!0}),field:a,timeUnit:u};if(Dt(n)){const{mark:c,markDef:f,config:d}=n,h=pa({fieldDef:s,markDef:f,config:d});th(c)&&Bt(o)&&h!==.5&&(l.rectBandPosition=h)}l&&(r[He(l)]=l)}return r},{});return ht(i)?null:new Cs(t,i)}static makeFromTransform(t,n){const{timeUnit:i,...r}={...n},s=sn(i),o={...r,timeUnit:s};return new Cs(t,{[He(o)]:o})}merge(t){this.timeUnits={...this.timeUnits};for(const n in t.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=t.timeUnits[n]);for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}removeFormulas(t){const n={};for(const[i,r]of ia(this.timeUnits)){const s=xw(r)?r.as:`${r.field}_end`;t.has(s)||(n[i]=r)}this.timeUnits=n}producedFields(){return new Set(gn(this.timeUnits).map(t=>xw(t)?t.as:mO(t.field)))}dependentFields(){return new Set(gn(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${He(this.timeUnits)}`}assemble(){const t=[];for(const n of gn(this.timeUnits)){const{rectBandPosition:i}=n,r=sn(n.timeUnit);if(xw(n)){const{field:s,as:o}=n,{unit:a,utc:u,...l}=r,c=[o,`${o}_end`];t.push({field:er(s),type:"timeunit",...a?{units:L1(a)}:{},...u?{timezone:"utc"}:{},...l,as:c}),t.push(...bO(c,i,r))}else if(n){const{field:s}=n,o=s.replaceAll("\\.","."),a=yO({timeUnit:r,field:o}),u=mO(o);t.push({type:"formula",expr:a,as:u}),t.push(...bO([o,u],i,r))}}return t}}const am="offsetted_rect_start",um="offsetted_rect_end";function yO({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,s=CN(i),{part:o,step:a}=SN(s,e.step);return`${r?"utcOffset":"timeOffset"}('${o}', ${ut(t)}, ${n?-a:a})`}function bO([e,t],n,i){if(n!==void 0&&n!==.5){const r=ut(e),s=ut(t);return[{type:"formula",expr:vO([yO({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${am}`},{type:"formula",expr:vO([r,s],n+.5),as:`${e}_${um}`}]}return[]}function vO([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const ch="_tuple_fields";class Fge{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const Dge={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new Fge),s={},o={},a=new Set,u=(p,g)=>{const m=g==="visual"?p.channel:p.field;let y=At(`${i}_${m}`);for(let b=1;a.has(y);b++)y=At(`${i}_${m}_${b}`);return a.add(y),{[g]:y}},l=t.type,c=e.config.selection[l],f=n.value!==void 0?oe(n.value):null;let{fields:d,encodings:h}=re(n.select)?n.select:{};if(!d&&!h&&f){for(const p of f)if(re(p))for(const g of Y(p))Zfe(g)?(h||(h=[])).push(g):l==="interval"?(Z(Mde),h=c.encodings):(d??(d=[])).push(g)}!d&&!h&&(h=c.encodings,"fields"in c&&(d=c.fields));for(const p of h??[]){const g=e.fieldDef(p);if(g){let m=g.field;if(g.aggregate){Z(Ede(p,g.aggregate));continue}else if(!m){Z(aN(p));continue}if(g.timeUnit&&!_u(g.timeUnit)){m=e.vgField(p);const y={timeUnit:g.timeUnit,as:m,field:g.field};o[He(y)]=y}if(!s[m]){const y=l==="interval"&&ms(p)&&Tr(e.getScaleComponent(p).get("type"))?"R":g.bin?"R-RE":"E",b={field:m,channel:p,type:y,index:r.items.length};b.signals={...u(b,"data"),...u(b,"visual")},r.items.push(s[m]=b),r.hasField[m]=s[m],r.hasSelectionId=r.hasSelectionId||m===Or,IM(p)?(b.geoChannel=p,b.channel=LM(p),r.hasChannel[b.channel]=s[m]):r.hasChannel[p]=s[m]}}else Z(aN(p))}for(const p of d??[]){if(r.hasField[p])continue;const g={type:"E",field:p,index:r.items.length};g.signals={...u(g,"data")},r.items.push(g),r.hasField[p]=g,r.hasSelectionId=r.hasSelectionId||p===Or}f&&(t.init=f.map(p=>r.items.map(g=>re(p)?p[g.geoChannel||g.channel]!==void 0?p[g.geoChannel||g.channel]:p[g.field]:p))),ht(o)||(r.timeUnit=new Cs(null,o))},signals:(e,t,n)=>{const i=t.name+ch;return n.filter(s=>s.name===i).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(EO)})}},xO="_curr",lm="anim_value",kc="anim_clock",_w="eased_anim_clock",_O="min_extent",wO="max_range_extent",ww="last_tick_at",Ew="is_playing",Tge=1/60*1e3,Mge=(e,t)=>[{name:_w,update:kc},{name:`${e}_domain`,init:`domain('${t}')`},{name:_O,init:`extent(${e}_domain)[0]`},{name:wO,init:`extent(range('${t}'))[1]`},{name:lm,update:`invert('${t}', ${_w})`}],Nge={defined:e=>e.type==="point",topLevelSignals:(e,t,n)=>(ks(t)&&(n=n.concat([{name:kc,init:"0",on:[{events:{type:"timer",throttle:Tge},update:`${Ew} ? (${kc} + (now() - ${ww}) > ${wO} ? 0 : ${kc} + (now() - ${ww})) : ${kc}`}]},{name:ww,init:"now()",on:[{events:[{signal:kc},{signal:Ew}],update:"now()"}]},{name:Ew,init:"true"}])),n),signals:(e,t,n)=>{const i=t.name,r=i+ch,s=t.project,o="(item().isVoronoi ? datum.datum : datum)",a=gn(e.component.selection??{}).reduce((c,f)=>f.type==="interval"?c.concat(f.name+Ac):c,[]).map(c=>`indexof(item().mark.name, '${c}') < 0`).join(" && "),u=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let l=`unit: ${Du(e)}, `;if(t.project.hasSelectionId)l+=`${Or}: ${o}[${Q(Or)}]`;else if(ks(t))l+=`fields: ${r}, values: [${lm} ? ${lm} : ${_O}]`;else{const c=s.items.map(f=>{const d=e.fieldDef(f.channel);return d!=null&&d.bin?`[${o}[${Q(e.vgField(f.channel,{}))}], ${o}[${Q(e.vgField(f.channel,{binSuffix:"end"}))}]]`:`${o}[${Q(f.field)}]`}).join(", ");l+=`fields: ${r}, values: [${c}]`}if(ks(t))return n.concat(Mge(t.name,e.scaleName(sa)),[{name:i+ho,on:[{events:[{signal:_w},{signal:lm}],update:`{${l}}`,force:!0}]}]);{const c=t.events;return n.concat([{name:i+ho,on:c?[{events:c,update:`${u} ? {${l}} : null`,force:!0}]:[]}])}}};function EO(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=er(r.field),r}function Su(e,t=!0,n=En){if(W(e)){const i=e.map(r=>Su(r,t,n));return t?`[${i.join(", ")}]`:i}else if(vu(e))return n(t?xu(e):Lhe(e));return t?n(pt(e)):e}function Rge(e,t){for(const n of gn(e.component.selection??{})){const i=n.name;let r=`${i}${ho}, ${n.resolve==="global"?"true":`{unit: ${Du(e)}}`}`;for(const s of pm)s.defined(n)&&(s.signals&&(t=s.signals(e,n,t)),s.modifyExpr&&(r=s.modifyExpr(e,n,r)));t.push({name:i+a1e,on:[{events:{signal:n.name+ho},update:`modify(${Q(n.name+Fu)}, ${r})`}]})}return Cw(t)}function Oge(e,t){if(e.component.selection&&Y(e.component.selection).length){const n=Q(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:ta("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return Cw(t)}function Lge(e,t){let n=!1;for(const i of gn(e.component.selection??{})){const r=i.name,s=Q(r+Fu);if(t.filter(a=>a.name===r).length===0){const a=i.resolve==="global"?"union":i.resolve,u=i.type==="point"?", true, true)":")";t.push({name:i.name,update:`${YO}(${s}, ${Q(a)}${u}`})}n=!0;for(const a of pm)a.defined(i)&&a.topLevelSignals&&(t=a.topLevelSignals(e,i,t))}return n&&t.filter(r=>r.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),Cw(t)}function Ige(e,t){const n=[],i=[],r=Du(e,{escape:!1});for(const s of gn(e.component.selection??{})){const o={name:s.name+Fu};if(s.project.hasSelectionId&&(o.transform=[{type:"collect",sort:{field:Or}}]),s.init){const u=s.project.items.map(EO);o.values=s.project.hasSelectionId?s.init.map(l=>({unit:r,[Or]:Su(l,!1)[0]})):s.init.map(l=>({unit:r,fields:u,values:Su(l,!1)}))}if([...n,...t].filter(u=>u.name===s.name+Fu).length||n.push(o),ks(s)&&t.length){const u=e.lookupDataSource(e.getDataName(Ft.Main)),l=t.find(f=>f.name===u),c=l.transform.find(f=>f.type==="filter"&&f.expr.includes("vlSelectionTest"));if(c){l.transform=l.transform.filter(d=>d!==c);const f={name:l.name+xO,source:l.name,transform:[c]};i.push(f)}}}return n.concat(t,i)}function CO(e,t){for(const n of gn(e.component.selection??{}))for(const i of pm)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function Pge(e,t){for(const n of e.children)Dt(n)&&(t=CO(n,t));return t}function zge(e,t,n,i){const r=dL(e,t.param,t);return{signal:Tr(n.get("type"))&&W(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function Cw(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}const co={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!ms(r))continue;const s=e.getScaleComponent(r),o=s?s.get("type"):void 0;if(o=="sequential"&&Z($de),!s||!Tr(o)){Z(Ade);continue}s.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(o=>n.filter(a=>a.name===o.signals.data).length===0);if(!e.parent||Aw(e)||i.length===0)return n;const r=n.find(o=>o.name===t.name);let s=r.update;if(s.includes(YO))r.update=`{${i.map(o=>`${Q(er(o.field))}: ${o.signals.data}`).join(", ")}}`;else{for(const o of i){const a=`${Q(er(o.field))}: ${o.signals.data}`;s.includes(a)||(s=`${s.substring(0,s.length-1)}, ${a}}`)}r.update=s}return n.concat(i.map(o=>({name:o.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!Aw(e))for(const i of t.scales){const r=n.find(s=>s.name===i.signals.data);r.push="outer",delete r.value,delete r.update}return n}};function kw(e,t){return`domain(${Q(e.scaleName(t))})`}function Aw(e){return e.parent&&Lc(e.parent)&&(!e.parent.parent||Aw(e.parent.parent))}const Ac="_brush",kO="_scale_trigger",fh="geo_interval_init_tick",AO="_init",Bge="_center",Uge={defined:e=>e.type==="interval",parse:(e,t,n)=>{var i;if(e.hasProjection){const r={...re(n.select)?n.select:{}};r.fields=[Or],r.encodings||(r.encodings=n.value?Y(n.value):[Sr,$r]),n.select={type:"interval",...r}}if(t.translate&&!co.defined(t)){const r=`!event.item || event.item.mark.name !== ${Q(t.name+Ac)}`;for(const s of t.events){if(!s.between){Z(`${s} is not an ordered event stream for interval selections.`);continue}const o=oe((i=s.between[0]).filter??(i.filter=[]));o.includes(r)||o.push(r)}}},signals:(e,t,n)=>{const i=t.name,r=i+ho,s=gn(t.project.hasChannel).filter(a=>a.channel===$t||a.channel===rn),o=t.init?t.init[0]:null;if(n.push(...s.reduce((a,u)=>a.concat(jge(e,t,u,o&&o[u.index])),[])),e.hasProjection){const a=Q(e.projectionName()),u=e.projectionName()+Bge,{x:l,y:c}=t.project.hasChannel,f=l&&l.signals.visual,d=c&&c.signals.visual,h=l?o&&o[l.index]:`${u}[0]`,p=c?o&&o[c.index]:`${u}[1]`,g=_=>e.getSizeSignalRef(_).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":g("width")}, ${d?d+"[1]":g("height")}]]`;o&&(n.unshift({name:i+AO,init:`[scale(${a}, [${l?h[0]:h}, ${c?p[0]:p}]), scale(${a}, [${l?h[1]:h}, ${c?p[1]:p}])]`}),(!l||!c)&&(n.find(E=>E.name===u)||n.unshift({name:u,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const y=`intersect(${m}, {markname: ${Q(e.getName("marks"))}}, unit.mark)`,b=`{unit: ${Du(e)}}`,v=`vlSelectionTuples(${y}, ${b})`,x=s.map(_=>_.signals.visual);return n.concat({name:r,on:[{events:[...x.length?[{signal:x.join(" || ")}]:[],...o?[{signal:fh}]:[]],update:v}]})}else{if(!co.defined(t)){const l=i+kO,c=s.map(f=>{const d=f.channel,{data:h,visual:p}=f.signals,g=Q(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=Tr(m)?"+":"";return`(!isArray(${h}) || (${y}invert(${g}, ${p})[0] === ${y}${h}[0] && ${y}invert(${g}, ${p})[1] === ${y}${h}[1]))`});c.length&&n.push({name:l,value:{},on:[{events:s.map(f=>({scale:e.scaleName(f.channel)})),update:c.join(" && ")+` ? ${l} : {}`}]})}const a=s.map(l=>l.signals.data),u=`unit: ${Du(e)}, fields: ${i+ch}, values`;return n.concat({name:r,...o?{init:`{${u}: ${Su(o)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${u}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(Dt(e)&&e.hasProjection&&t.init&&(n.filter(r=>r.name===fh).length||n.unshift({name:fh,value:null,on:[{events:"timer{1}",update:`${fh} === null ? {} : ${fh}`}]})),n),marks:(e,t,n)=>{const i=t.name,{x:r,y:s}=t.project.hasChannel,o=r==null?void 0:r.signals.visual,a=s==null?void 0:s.signals.visual,u=`data(${Q(t.name+Fu)})`;if(co.defined(t)||!r&&!s)return n;const l={x:r!==void 0?{signal:`${o}[0]`}:{value:0},y:s!==void 0?{signal:`${a}[0]`}:{value:0},x2:r!==void 0?{signal:`${o}[1]`}:{field:{group:"width"}},y2:s!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const m of Y(l))l[m]=[{test:`${u}.length && ${u}[0].unit === ${Du(e)}`,...l[m]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,p=Y(h).reduce((m,y)=>(m[y]=[{test:[r!==void 0&&`${o}[0] !== ${o}[1]`,s!==void 0&&`${a}[0] !== ${a}[1]`].filter(b=>b).join(" && "),value:h[y]},{value:null}],m),{}),g=d??(t.translate?"move":null);return[{name:`${i+Ac}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:l}},...n,{name:i+Ac,type:"rect",clip:!0,encode:{enter:{...g?{cursor:{value:g}}:{},fill:{value:"transparent"}},update:{...l,...p}}}]}};function jge(e,t,n,i){const r=!e.hasProjection,s=n.channel,o=n.signals.visual,a=Q(r?e.scaleName(s):e.projectionName()),u=d=>`scale(${a}, ${d})`,l=e.getSizeSignalRef(s===$t?"width":"height").signal,c=`${s}(unit)`,f=t.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${c}, ${c}]`},{events:h,update:`[${o}[0], clamp(${c}, 0, ${l})]`}],[]);if(r){const d=n.signals.data,h=co.defined(t),p=e.getScaleComponent(s),g=p?p.get("type"):void 0,m=i?{init:Su(i,!0,u)}:{value:[]};return f.push({events:{signal:t.name+kO},update:Tr(g)?`[${u(`${d}[0]`)}, ${u(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:o,...m,on:f},{name:d,...i?{init:Su(i)}:{},on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${a}, ${o})`}]}]}else{const d=s===$t?0:1,h=t.name+AO,p=i?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:o,...p,on:f}]}}function $c({model:e,channelDef:t,vgChannel:n,invalidValueRef:i,mainRefFn:r}){const s=sh(t)&&t.condition;let o=[];s&&(o=oe(s).map(l=>{const c=r(l);if(N0e(l)){const{param:f,empty:d}=l;return{test:fL(e,{param:f,empty:d}),...c}}else return{test:_m(e,l.test),...c}})),i!==void 0&&o.push(i);const a=r(t);return a!==void 0&&o.push(a),o.length>1||o.length===1&&o[0].test?{[n]:o}:o.length===1?{[n]:o[0]}:{}}function $w(e,t="text"){const n=e.encoding[t];return $c({model:e,channelDef:n,vgChannel:t,mainRefFn:i=>cm(i,e.config),invalidValueRef:void 0})}function cm(e,t,n="datum"){if(e){if(Nr(e))return Et(e.value);if(Ne(e)){const{format:i,formatType:r}=X1(e);return H_({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function $O(e,t={}){const{encoding:n,markDef:i,config:r,stack:s}=e,o=n.tooltip;if(W(o))return{tooltip:FO({tooltip:o},s,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return $c({model:e,channelDef:o,vgChannel:"tooltip",mainRefFn:l=>{const c=cm(l,r,a);if(c)return c;if(l===null)return;let f=gt("tooltip",i,r);if(f===!0&&(f={content:"encoding"}),se(f))return{value:f};if(re(f))return me(f)?f:f.content==="encoding"?FO(n,s,r,t):{signal:a}},invalidValueRef:void 0})}}function SO(e,t,n,{reactiveGeom:i}={}){const r={...n,...n.tooltipFormat},s=new Set,o=i?"datum.datum":"datum",a=[];function u(c,f){const d=gu(f),h=ei(c)?c:{...c,type:e[d].type},p=h.title||K_(h,r),g=oe(p).join(", ").replaceAll(/"/g,'\\"');let m;if(Bt(f)){const y=f==="x"?"x2":"y2",b=Rr(e[y]);if(mn(h.bin)&&b){const v=ne(h,{expr:o}),x=ne(b,{expr:o}),{format:_,formatType:E}=X1(h);m=ih(v,x,_,E,r),s.add(y)}}if((Bt(f)||f===tr||f===Ar)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:b}=X1(h);m=H_({fieldOrDatumDef:h,format:y,formatType:b,expr:o,config:r,normalizeStack:!0}).signal}m??(m=cm(h,r,o).signal),a.push({channel:f,key:g,value:m})}J_(e,(c,f)=>{J(c)?u(c,f):G1(c)&&u(c.condition,f)});const l={};for(const{channel:c,key:f,value:d}of a)!s.has(c)&&!l[f]&&(l[f]=d);return l}function FO(e,t,n,{reactiveGeom:i}={}){const r=SO(e,t,n,{reactiveGeom:i}),s=ia(r).map(([o,a])=>`"${o}": ${a}`);return s.length>0?{signal:`{${s.join(", ")}}`}:void 0}function qge(e){const{markDef:t,config:n}=e,i=gt("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...Wge(e),...Hge(e)}}function Wge(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=gt("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:ue(vde,t)?{}:{ariaRoleDescription:{value:t}}}function Hge(e){const{encoding:t,markDef:n,config:i,stack:r}=e,s=t.description;if(s)return $c({model:e,channelDef:s,vgChannel:"description",mainRefFn:u=>cm(u,e.config),invalidValueRef:void 0});const o=gt("description",n,i);if(o!=null)return{description:Et(o)};if(i.aria===!1)return{};const a=SO(t,r,i);if(!ht(a))return{description:{signal:ia(a).map(([u,l],c)=>`"${c>0?"; ":""}${u}: " + (${l})`).join(" + ")}}}function vn(e,t,n={}){const{markDef:i,encoding:r,config:s}=t,{vgChannel:o}=n;let{defaultRef:a,defaultValue:u}=n;const l=r[e];a===void 0&&(u??(u=gt(e,i,s,{vgChannel:o,ignoreVgConfig:!sh(l)})),u!==void 0&&(a=Et(u)));const c={markDef:i,config:s,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=GN({...c,scaleChannel:e,channelDef:l});return $c({model:t,channelDef:l,vgChannel:o??e,invalidValueRef:f,mainRefFn:h=>W_({...c,channel:e,channelDef:h,stack:null,defaultRef:a})})}function DO(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:s}=n,o=t.filled??gt("filled",n,r),a=We(["bar","point","circle","square","geoshape"],s)?"transparent":void 0,u=gt(o===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[o===!0&&"color"]??a,l=gt(o===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[o===!1&&"color"],c=o?"fill":"stroke",f={...u?{fill:Et(u)}:{},...l?{stroke:Et(l)}:{}};return n.color&&(o?n.fill:n.stroke)&&Z(hN("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...vn("color",e,{vgChannel:c,defaultValue:o?u:l}),...vn("fill",e,{defaultValue:i.fill?u:void 0}),...vn("stroke",e,{defaultValue:i.stroke?l:void 0})}}function Gge(e){const{encoding:t,mark:n}=e,i=t.order;return!ha(n)&&Nr(i)?$c({model:e,channelDef:i,vgChannel:"zindex",mainRefFn:r=>Et(r.value),invalidValueRef:void 0}):{}}function Sc({channel:e,markDef:t,encoding:n={},model:i,bandPosition:r}){const s=`${e}Offset`,o=t[s],a=n[s];if((s==="xOffset"||s==="yOffset")&&a)return{offsetType:"encoding",offset:W_({channel:s,channelDef:a,markDef:t,config:i==null?void 0:i.config,scaleName:i.scaleName(s),scale:i.getScaleComponent(s),stack:null,defaultRef:Et(o),bandPosition:r})};const u=t[s];return u?{offsetType:"visual",offset:u}:{}}function ti(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:s,config:o,stack:a}=t,u=r[e],l=r[gs(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=Sc({channel:e,markDef:s,encoding:r,model:t,bandPosition:.5}),p=Sw({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),g=!u&&Bt(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:Vge({channel:e,channelDef:u,channel2Def:l,markDef:s,config:o,scaleName:c,scale:f,stack:a,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return g?{[i||e]:g}:void 0}function Vge(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:s,markDef:o}=e;if(Ne(n)&&r&&t===r.fieldChannel){if(J(n)){let a=n.bandPosition;if(a===void 0&&o.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return q1({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:s})}return Cu(n,i,{suffix:"end"},{offset:s})}return q_(e)}function Sw({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:s,config:o}=e;return()=>{const a=gu(n),u=ca(n),l=gt(n,s,o,{vgChannel:u});if(l!==void 0)return nh(n,l);switch(t){case"zeroOrMin":return TO({scaleName:i,scale:r,mode:"zeroOrMin",mainChannel:a,config:o});case"zeroOrMax":return TO({scaleName:i,scale:r,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:a,config:o});case"mid":return{...e[mi(n)],mult:.5}}}}function TO({mainChannel:e,config:t,...n}){const i=HN(n),{mode:r}=n;if(i)return i;switch(e){case"radius":{if(r==="zeroOrMin")return{value:0};const{widthSignal:s,heightSignal:o}=r.zeroOrMax;return{signal:`min(${s},${o})/2`}}case"theta":return r==="zeroOrMin"?{value:0}:{signal:"2*PI"};case"x":return r==="zeroOrMin"?{value:0}:{field:{group:"width"}};case"y":return r==="zeroOrMin"?{field:{group:"height"}}:{value:0}}}const Yge={left:"x",center:"xc",right:"x2"},Xge={top:"y",middle:"yc",bottom:"y2"};function MO(e,t,n,i="middle"){if(e==="radius"||e==="theta")return ca(e);const r=e==="x"?"align":"baseline",s=gt(r,t,n);let o;return me(s)?(Z(ehe(r)),o=void 0):o=s,e==="x"?Yge[o||(i==="top"?"left":"center")]:Xge[o||i]}function fm(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?NO(e,t,{defaultPos:n,defaultPos2:i}):ti(e,t,{defaultPos:n})}function NO(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:s}=t,o=gs(e),a=mi(e),u=Kge(t,i,o),l=u[a]?MO(e,r,s):ca(e);return{...ti(e,t,{defaultPos:n,vgChannel:l}),...u}}function Kge(e,t,n){const{encoding:i,mark:r,markDef:s,stack:o,config:a}=e,u=gu(n),l=mi(n),c=ca(n),f=i[u],d=e.scaleName(u),h=e.getScaleComponent(u),{offset:p}=n in i||n in s?Sc({channel:n,markDef:s,encoding:i,model:e}):Sc({channel:u,markDef:s,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=mi(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const g=Zge({channel:n,channelDef:f,channel2Def:i[n],markDef:s,config:a,scaleName:d,scale:h,stack:o,offset:p,defaultRef:void 0});return g!==void 0?{[c]:g}:dm(n,s)||dm(n,{[n]:m_(n,s,a.style),[l]:m_(l,s,a.style)})||dm(n,a[r])||dm(n,a.mark)||{[c]:Sw({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function Zge({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:u,defaultRef:l}){return Ne(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?Cu(t,s,{suffix:"start"},{offset:u}):q_({channel:e,channelDef:n,scaleName:s,scale:o,stack:a,markDef:i,config:r,offset:u,defaultRef:l})}function dm(e,t){const n=mi(e),i=ca(e);if(t[i]!==void 0)return{[i]:nh(e,t[i])};if(t[e]!==void 0)return{[i]:nh(e,t[e])};if(t[n]){const r=t[n];if(Eu(r))Z(Yde(n));else return{[n]:nh(e,r)}}}function fo(e,t){const{config:n,encoding:i,markDef:r}=e,s=r.type,o=gs(t),a=mi(t),u=i[t],l=i[o],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=r.orient,h=i[a]??i.size??gt("size",r,n,{vgChannel:a}),p=UM(t),g=s==="bar"&&(t==="x"?d==="vertical":d==="horizontal")||s==="tick"&&(t==="y"?d==="vertical":d==="horizontal");return J(u)&&(_t(u.bin)||mn(u.bin)||u.timeUnit&&!l)&&!(h&&!Eu(h))&&!i[p]&&!on(f)?e1e({fieldDef:u,fieldDef2:l,channel:t,model:e}):(Ne(u)&&on(f)||g)&&!l?Qge(u,t,e):NO(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function Jge(e,t,n,i,r,s,o){if(Eu(r))if(n){const u=n.get("type");if(u==="band"){let l=`bandwidth('${t}')`;r.band!==1&&(l=`${r.band} * ${l}`);const c=ys("minBandSize",{type:o},i);return{signal:c?`max(${Dr(c)}, ${l})`:l}}else r.band!==1&&(Z(rhe(u)),r=void 0)}else return{mult:r.band,field:{group:e}};else{if(me(r))return r;if(r)return{value:r}}if(n){const u=n.get("range");if(yu(u)&&Je(u.step))return{value:u.step-2}}if(!s){const{bandPaddingInner:u,barBandPaddingInner:l,rectBandPaddingInner:c,tickBandPaddingInner:f}=i.scale,d=zt(u,o==="tick"?f:o==="bar"?l:c);if(me(d))return{signal:`(1 - (${d.signal})) * ${e}`};if(Je(d))return{signal:`${1-d} * ${e}`}}return{value:fw(i.view,e)-2}}function Qge(e,t,n){var k,S;const{markDef:i,encoding:r,config:s,stack:o}=n,a=i.orient,u=n.scaleName(t),l=n.getScaleComponent(t),c=mi(t),f=gs(t),d=UM(t),h=n.scaleName(d),p=n.getScaleComponent(a_(t)),g=i.type==="tick"||a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(r.size||i.size)&&(g?m=vn("size",n,{vgChannel:c,defaultRef:Et(i.size)}):Z(uhe(i.type)));const y=!!m,b=nR({channel:t,fieldDef:e,markDef:i,config:s,scaleType:(k=l||p)==null?void 0:k.get("type"),useVlSizeChannel:g});m=m||{[c]:Jge(c,h||u,p||l,s,b,!!e,i.type)};const v=((S=l||p)==null?void 0:S.get("type"))==="band"&&Eu(b)&&!y?"top":"middle",x=MO(t,i,s,v),_=x==="xc"||x==="yc",{offset:E,offsetType:w}=Sc({channel:t,markDef:i,encoding:r,model:n,bandPosition:_?.5:0}),C=q_({channel:t,channelDef:e,markDef:i,config:s,scaleName:u,scale:l,stack:o,offset:E,defaultRef:Sw({model:n,defaultPos:"mid",channel:t,scaleName:u,scale:l}),bandPosition:_?w==="encoding"?0:.5:me(b)?{signal:`(1-${b})/2`}:Eu(b)?(1-b.band)/2:0});if(c)return{[x]:C,...m};{const $=ca(f),O=m[c],R=E?{...O,offset:E}:O;return{[x]:C,[$]:W(C)?[C[0],{...C[1],offset:R}]:{...C,offset:R}}}}function RO(e,t,n,i,r,s,o){if(OM(e))return 0;const a=e==="x"||e==="y2",u=a?-t/2:t/2;if(me(n)||me(r)||me(i)||s){const l=Dr(n),c=Dr(r),f=Dr(i),d=Dr(s),p=s?`(${o} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${o})) : ${u})`:u,g=f?`${f} + `:"",m=l?`(${l} ? -1 : 1) * `:"",y=c?`(${c} + ${p})`:p;return{signal:g+m+y}}else return r=r||0,i+(n?-r-u:+r+u)}function e1e({fieldDef:e,fieldDef2:t,channel:n,model:i}){var S;const{config:r,markDef:s,encoding:o}=i,a=i.getScaleComponent(n),u=i.scaleName(n),l=a?a.get("type"):void 0,c=a.get("reverse"),f=nR({channel:n,fieldDef:e,markDef:s,config:r,scaleType:l}),d=(S=i.component.axes[n])==null?void 0:S[0],h=(d==null?void 0:d.get("translate"))??.5,p=Bt(n)?gt("binSpacing",s,r)??0:0,g=gs(n),m=ca(n),y=ca(g),b=ys("minBandSize",s,r),{offset:v}=Sc({channel:n,markDef:s,encoding:o,model:i,bandPosition:0}),{offset:x}=Sc({channel:g,markDef:s,encoding:o,model:i,bandPosition:0}),_=$0e({fieldDef:e,scaleName:u}),E=RO(n,p,c,h,v,b,_),w=RO(g,p,c,h,x??v,b,_),C=me(f)?{signal:`(1-${f.signal})/2`}:Eu(f)?(1-f.band)/2:.5,k=pa({fieldDef:e,fieldDef2:t,markDef:s,config:r});if(_t(e.bin)||e.timeUnit){const $=e.timeUnit&&k!==.5;return{[y]:OO({fieldDef:e,scaleName:u,bandPosition:C,offset:w,useRectOffsetField:$}),[m]:OO({fieldDef:e,scaleName:u,bandPosition:me(C)?{signal:`1-${C.signal}`}:1-C,offset:E,useRectOffsetField:$})}}else if(mn(e.bin)){const $=Cu(e,u,{},{offset:w});if(J(t))return{[y]:$,[m]:Cu(t,u,{},{offset:E})};if(mu(e.bin)&&e.bin.step)return{[y]:$,[m]:{signal:`scale("${u}", ${ne(e,{expr:"datum"})} + ${e.bin.step})`,offset:E}}}Z(bN(g))}function OO({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return q1({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:am,endSuffix:um}:{}})}const t1e=new Set(["aria","width","height"]);function rr(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?DO(e):{};return{...n1e(e.markDef,t),...LO("fill",n),...LO("stroke",i),...vn("opacity",e),...vn("fillOpacity",e),...vn("strokeOpacity",e),...vn("strokeWidth",e),...vn("strokeDash",e),...Gge(e),...$O(e),...$w(e,"href"),...qge(e)}}function LO(e,t){return t?{[e]:t}:{}}function n1e(e,t){return bde.reduce((n,i)=>(!t1e.has(i)&&X(e,i)&&t[i]!=="ignore"&&(n[i]=Et(e[i])),n),{})}function Fw(e){const{config:t,markDef:n}=e,i=new Set;if(e.forEachFieldDef((r,s)=>{var l;let o;if(!ms(s)||!(o=e.getScaleType(s)))return;const a=M1(r.aggregate),u=j_({scaleChannel:s,markDef:n,config:t,scaleType:o,isCountAggregate:a});if(C0e(u)){const c=e.vgField(s,{expr:"datum",binSuffix:(l=e.stack)!=null&&l.impute?"mid":void 0});c&&i.add(c)}}),i.size>0)return{defined:{signal:[...i].map(s=>I1(s,!0)).join(" && ")}}}function IO(e,t){if(t!==void 0)return{[e]:Et(t)}}const Dw="voronoi",PO={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(Dw)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,s=e.mark;if(ha(s))return Z(Cde(s)),n;const o={name:e.getName(Dw),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...$O(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,u=!1;return n.forEach((l,c)=>{const f=l.name??"";f===e.component.mark[0].name?a=c:f.includes(Dw)&&(u=!0)}),u||n.splice(a+1,0,o),n}},zO={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!sw(e.bind),parse:(e,t,n)=>XO(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,s=t.bind,o=t.init&&t.init[0],a=PO.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((u,l)=>{const c=At(`${i}_${u.field}`);n.filter(d=>d.name===c).length||n.unshift({name:c,...o?{init:Su(o[l])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${Q(u.field)}] : null`}]:[],bind:s[u.field]??s[u.channel]??s})}),n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(l=>l.name===i+ho),o=i+ch,a=r.items.map(l=>At(`${i}_${l.field}`)),u=a.map(l=>`${l} !== null`).join(" && ");return a.length&&(s.update=`${u} ? {fields: ${o}, values: [${a.join(", ")}]} : null`),delete s.value,delete s.on,n}},hm="_toggle",BO={defined:e=>e.type==="point"&&!ks(e)&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+hm,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+ho,i=t.name+hm;return`${i} ? null : ${n}, `+(t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${Du(e)}}, `)+`${i} ? ${n} : null`}},i1e={defined:e=>e.clear!==void 0&&e.clear!==!1&&!ks(e),parse:(e,t)=>{t.clear&&(t.clear=se(t.clear)?ta(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(zO.defined(t))for(const i of t.project.items){const r=n.findIndex(s=>s.name===At(`${t.name}_${i.field}`));r!==-1&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(r,s){r!==-1&&n[r].on&&n[r].on.push({events:t.clear,update:s})}if(t.type==="interval")for(const r of t.project.items){const s=n.findIndex(o=>o.name===r.signals.visual);if(i(s,"[0, 0]"),s===-1){const o=n.findIndex(a=>a.name===r.signals.data);i(o,"null")}}else{let r=n.findIndex(s=>s.name===t.name+ho);i(r,"null"),BO.defined(t)&&(r=n.findIndex(s=>s.name===t.name+hm),i(r,"false"))}return n}},UO={defined:e=>{const t=e.resolve==="global"&&e.bind&&sw(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==Or;return t&&!n&&Z(Sde),t&&n},parse:(e,t,n)=>{const i=De(n);if(i.select=se(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},XO(t,i),re(n.select)&&(n.select.on||n.select.clear)){const o='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=oe(a.filter??[]),a.filter.includes(o)||a.filter.push(o)}const r=ow(t.bind)?t.bind.legend:"click",s=se(r)?ta(r,"view"):oe(r);t.bind={legend:{merge:s}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=ow(t.bind)&&t.bind.legend,s=o=>a=>{const u=De(a);return u.markname=o,u};for(const o of t.project.items){if(!o.hasLegend)continue;const a=`${At(o.field)}_legend`,u=`${i}_${a}`;if(n.filter(c=>c.name===u).length===0){const c=r.merge.map(s(`${a}_symbols`)).concat(r.merge.map(s(`${a}_labels`))).concat(r.merge.map(s(`${a}_entries`)));n.unshift({name:u,...t.init?{}:{value:null},on:[{events:c,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${u}`,force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(d=>d.name===i+ho),o=i+ch,a=r.items.filter(d=>d.hasLegend).map(d=>At(`${i}_${At(d.field)}_legend`)),l=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${o}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?s.on.push({events:a.map(d=>({signal:d})),update:l}):a.length>0&&(s.update=l,delete s.value,delete s.on);const c=n.find(d=>d.name===i+hm),f=ow(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function r1e(e,t,n){var r;const i=(r=e.fieldDef(t))==null?void 0:r.field;for(const s of gn(e.component.selection??{})){const o=s.project.hasField[i]??s.project.hasChannel[t];if(o&&UO.defined(s)){const a=n.get("selections")??[];a.push(s.name),n.set("selections",a,!1),o.hasLegend=!0}}}const jO="_translate_anchor",qO="_translate_delta",s1e={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=co.defined(t),s=i+jO,{x:o,y:a}=t.project.hasChannel;let u=ta(t.translate,"scope");return r||(u=u.map(l=>(l.between[0].markname=i+Ac,l))),n.push({name:s,value:{},on:[{events:u.map(l=>l.between[0]),update:"{x: x(unit), y: y(unit)"+(o!==void 0?`, extent_x: ${r?kw(e,$t):`slice(${o.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${r?kw(e,rn):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:i+qO,value:{},on:[{events:u,update:`{x: ${s}.x - x(unit), y: ${s}.y - y(unit)}`}]}),o!==void 0&&WO(e,t,o,"width",n),a!==void 0&&WO(e,t,a,"height",n),n}};function WO(e,t,n,i,r){const s=t.name,o=s+jO,a=s+qO,u=n.channel,l=co.defined(t),c=r.find(_=>_.name===n.signals[l?"data":"visual"]),f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(u),h=d&&d.get("type"),p=d&&d.get("reverse"),g=l?u===$t?p?"":"-":p?"-":"":"",m=`${o}.extent_${u}`,y=`${g}${a}.${u} / ${l?`${f}`:`span(${m})`}`,b=!l||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",v=l?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",x=`${b}(${m}, ${y}${v})`;c.on.push({events:{signal:a},update:l?x:`clampRange(${x}, 0, ${f})`})}const HO="_zoom_anchor",GO="_zoom_delta",o1e={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=co.defined(t),s=i+GO,{x:o,y:a}=t.project.hasChannel,u=Q(e.scaleName($t)),l=Q(e.scaleName(rn));let c=ta(t.zoom,"scope");return r||(c=c.map(f=>(f.markname=i+Ac,f))),n.push({name:i+HO,on:[{events:c,update:r?"{"+[u?`x: invert(${u}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter(f=>f).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:s,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),o!==void 0&&VO(e,t,o,"width",n),a!==void 0&&VO(e,t,a,"height",n),n}};function VO(e,t,n,i,r){const s=t.name,o=n.channel,a=co.defined(t),u=r.find(b=>b.name===n.signals[a?"data":"visual"]),l=e.getSizeSignalRef(i).signal,c=e.getScaleComponent(o),f=c&&c.get("type"),d=a?kw(e,o):u.name,h=s+GO,p=`${s}${HO}.${o}`,g=!a||!c?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${c.get("exponent")??1}`:f==="symlog"?`, ${c.get("constant")??1}`:"":"",y=`${g}(${d}, ${p}, ${h}${m})`;u.on.push({events:{signal:h},update:a?y:`clampRange(${y}, 0, ${l})`})}const Fu="_store",ho="_tuple",a1e="_modify",YO="vlSelectionResolve",pm=[Nge,Uge,Dge,BO,zO,co,UO,i1e,s1e,o1e,PO];function u1e(e){let t=e.parent;for(;t&&!Oi(t);)t=t.parent;return t}function Du(e,{escape:t}={escape:!0}){let n=t?Q(e.name):e.name;const i=u1e(e);if(i){const{facet:r}=i;for(const s of ir)r[s]&&(n+=` + '__facet_${s}_' + (facet[${Q(i.vgField(s))}])`)}return n}function Tw(e){return gn(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function XO(e,t){(se(t.select)||!t.select.on)&&delete e.events,(se(t.select)||!t.select.clear)&&delete e.clear,(se(t.select)||!t.select.toggle)&&delete e.toggle}function ks(e){var t;return(t=e.events)==null?void 0:t.find(n=>"type"in n&&n.type==="timer")}const l1e="RawCode",c1e="Literal",f1e="Property",d1e="Identifier",h1e="ArrayExpression",p1e="BinaryExpression",g1e="CallExpression",m1e="ConditionalExpression",y1e="LogicalExpression",b1e="MemberExpression",v1e="ObjectExpression",x1e="UnaryExpression";function Lr(e){this.type=e}Lr.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=_1e(this),n=0,i=t.length;n",As[Tu]="Identifier",As[ba]="Keyword",As[mm]="Null",As[Mu]="Numeric",As[bi]="Punctuator",As[hh]="String",As[w1e]="RegularExpression";var E1e="ArrayExpression",C1e="BinaryExpression",k1e="CallExpression",A1e="ConditionalExpression",KO="Identifier",$1e="Literal",S1e="LogicalExpression",F1e="MemberExpression",D1e="ObjectExpression",T1e="Property",M1e="UnaryExpression",an="Unexpected token %0",N1e="Unexpected number",R1e="Unexpected string",O1e="Unexpected identifier",L1e="Unexpected reserved word",I1e="Unexpected end of input",Mw="Invalid regular expression",Nw="Invalid regular expression: missing /",ZO="Octal literals are not allowed in strict mode.",P1e="Duplicate data property in object literal not allowed in strict mode",xn="ILLEGAL",ph="Disabled.",z1e=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),B1e=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function ym(e,t){if(!e)throw new Error("ASSERT: "+t)}function po(e){return e>=48&&e<=57}function Rw(e){return"0123456789abcdefABCDEF".includes(e)}function gh(e){return"01234567".includes(e)}function U1e(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function mh(e){return e===10||e===13||e===8232||e===8233}function yh(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&z1e.test(String.fromCharCode(e))}function bm(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&B1e.test(String.fromCharCode(e))}const j1e={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function JO(){for(;j1114111||e!=="}")&&nt({},an,xn),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function QO(){var e,t;for(e=ge.charCodeAt(j++),t=String.fromCharCode(e),e===92&&(ge.charCodeAt(j)!==117&&nt({},an,xn),++j,e=Ow("u"),(!e||e==="\\"||!yh(e.charCodeAt(0)))&&nt({},an,xn),t=e);j>>=")return j+=4,{type:bi,value:o,start:e,end:j};if(s=o.substr(0,3),s===">>>"||s==="<<="||s===">>=")return j+=3,{type:bi,value:s,start:e,end:j};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return j+=2,{type:bi,value:r,start:e,end:j};if(r==="//"&&nt({},an,xn),"<>=!+-*%&|^/".includes(i))return++j,{type:bi,value:i,start:e,end:j};nt({},an,xn)}function G1e(e){let t="";for(;j{if(parseInt(r,16)<=1114111)return"x";tt({},Mw)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{tt({},Mw)}try{return new RegExp(e,t)}catch{return null}}function G1e(){var e,t,n,i,r;for(e=ge[j],ym(e==="/","Regular expression literal must start with a slash"),t=ge[j++],n=!1,i=!1;j=0&&tt({},Mw,n),{value:n,literal:t}}function Y1e(){var e,t,n,i;return lt=null,JO(),e=j,t=G1e(),n=V1e(),i=H1e(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:j}}function X1e(e){return e.type===Tu||e.type===ba||e.type===gm||e.type===mm}function tL(){if(JO(),j>=On)return{type:dh,start:j,end:j};const e=ge.charCodeAt(j);return yh(e)?U1e():e===40||e===41||e===59?Lw():e===39||e===34?W1e():e===46?po(ge.charCodeAt(j+1))?eL():Lw():po(e)?eL():Lw()}function vi(){const e=lt;return j=e.end,lt=tL(),j=e.end,e}function nL(){const e=j;lt=tL(),j=e}function K1e(e){const t=new Lr(v1e);return t.elements=e,t}function iL(e,t,n){const i=new Lr(e==="||"||e==="&&"?C1e:x1e);return i.operator=e,i.left=t,i.right=n,i}function Z1e(e,t){const n=new Lr(_1e);return n.callee=e,n.arguments=t,n}function J1e(e,t,n){const i=new Lr(w1e);return i.test=e,i.consequent=t,i.alternate=n,i}function Iw(e){const t=new Lr(KO);return t.name=e,t}function bh(e){const t=new Lr(E1e);return t.value=e.value,t.raw=ge.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function rL(e,t,n){const i=new Lr(k1e);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function Q1e(e){const t=new Lr(A1e);return t.properties=e,t}function sL(e,t,n){const i=new Lr($1e);return i.key=t,i.value=n,i.kind=e,i}function eme(e,t){const n=new Lr(S1e);return n.operator=e,n.argument=t,n.prefix=!0,n}function tt(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,o)=>(ym(o":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function dme(){var e,t,n,i,r,s,o,a,u,l;if(e=lt,u=xm(),i=lt,r=uL(i),r===0)return u;for(i.prec=r,vi(),t=[e,lt],o=xm(),s=[u,i,o];(r=uL(lt))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,u=s.pop(),t.pop(),n=iL(a,u,o),s.push(n);i=vi(),i.prec=r,s.push(i),t.push(lt),n=xm(),s.push(n)}for(l=s.length-1,n=s[l],t.pop();l>1;)t.pop(),n=iL(s[l-1].value,s[l-2],n),l-=2;return n}function Nu(){var e,t,n;return e=dme(),Ct("?")&&(vi(),t=Nu(),Ln(":"),n=Nu(),e=J1e(e,t,n)),e}function zw(){const e=Nu();if(Ct(","))throw new Error(ph);return e}function hme(e){ge=e,j=0,On=ge.length,lt=null,nL();const t=zw();if(lt.type!==dh)throw new Error("Unexpect token after expression.");return t}function Bw(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...Bw(e.object)),t.push(...Bw(e.property))),t)}function lL(e){return e.object.type==="MemberExpression"?lL(e.object):e.object.name==="datum"}function cL(e){const t=hme(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&lL(i)&&n.add(Bw(i).slice(1).join("."))}),n}class Fc extends ut{clone(){return new Fc(null,this.model,De(this.filter))}constructor(t,n,i){super(t),this.model=n,this.filter=i,this.expr=_m(this.model,this.filter,this),this._dependentFields=cL(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function pme(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;let r=0;for(const s of t){const o=At(s.name),a=s.select,u=se(a)?a:a.type,l=re(a)?De(a):{type:u},c=i[u];for(const h in c)h==="fields"||h==="encodings"||(h==="mark"&&(l.mark={...c.mark,...l.mark}),(l[h]===void 0||l[h]===!0)&&(l[h]=De(c[h]??l[h])));const f=n[o]={...l,name:o,type:u,init:s.value,bind:s.bind,events:se(l.on)?ta(l.on,"scope"):oe(De(l.on))};if(ks(f)&&(r++,r>1)){delete n[o];continue}const d=De(s);for(const h of pm)h.defined(f)&&h.parse&&h.parse(e,f,d)}return r>1&&Z(Dde),n}function fL(e,t,n,i="datum"){const r=se(t)?t:t.param,s=At(r),o=Q(s+Fu);let a;try{a=e.getSelectionComponent(s,r)}catch{return`!!${s}`}if(a.project.timeUnit){const d=n??e.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const u=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",l=a.resolve==="global"?")":`, ${Q(a.resolve)})`,c=`${u}${o}, ${i}${l}`,f=`length(data(${o}))`;return t.empty===!1?`${f} && ${c}`:`!${f} || ${c}`}function dL(e,t,n){const i=At(t),r=n.encoding;let s=n.field,o;try{o=e.getSelectionComponent(i,t)}catch{return i}if(!r&&!s)s=o.project.items[0].field,o.project.items.length>1&&Z(Tde(s));else if(r&&!s){const a=o.project.items.filter(u=>u.channel===r);!a.length||a.length>1?(s=o.project.items[0].field,Z(Mde(a,r,n,s))):s=a[0].field}return`${o.name}[${Q(er(s))}]`}function gme(e,t){for(const[n,i]of ia(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new yi(new Fc(t,e,{param:n}),r,Ft.Lookup,e.component.data.outputNodeRefCounts)}}function _m(e,t,n){return Vd(t,i=>se(i)?i:Uhe(i)?fL(e,i,n):DN(i))}function mme(e,t){if(e)return W(e)&&!da(e)?e.map(n=>K_(n,t)).join(", "):e}function Uw(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function vh(e,t,n,i={header:!1}){var f,d;const{disable:r,orient:s,scale:o,labelExpr:a,title:u,zindex:l,...c}=e.combine();if(!r){for(const h in c){const p=h,g=q0e[p],m=c[p];if(g&&g!==t&&g!=="both")delete c[p];else if(uh(m)){const{condition:y,...b}=m,v=oe(y),x=hR[p];if(x){const{vgProp:_,part:E}=x,w=[...v.map(C=>{const{test:k,...S}=C;return{test:_m(null,k),...S}}),b];Uw(c,E,_,w),delete c[p]}else if(x===null){const _={signal:v.map(E=>{const{test:w,...C}=E;return`${_m(null,w)} ? ${ZM(C)} : `}).join("")+ZM(b)};c[p]=_}}else if(me(m)){const y=hR[p];if(y){const{vgProp:b,part:v}=y;Uw(c,v,b,m),delete c[p]}}qe(["labelAlign","labelBaseline"],p)&&c[p]===null&&delete c[p]}if(t==="grid"){if(!c.grid)return;if(c.encode){const{grid:h}=c.encode;c.encode={...h?{grid:h}:{}},ht(c.encode)&&delete c.encode}return{scale:o,orient:s,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:zt(l,0)}}else{if(!i.header&&e.mainExtracted)return;if(a!==void 0){let p=a;(d=(f=c.encode)==null?void 0:f.labels)!=null&&d.update&&me(c.encode.labels.update.text)&&(p=du(a,"datum.label",c.encode.labels.update.text.signal)),Uw(c,"labels","text",{signal:p})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(const p of pR)e.hasAxisPart(p)||delete c.encode[p];ht(c.encode)&&delete c.encode}const h=mme(u,n);return{scale:o,orient:s,grid:!1,...h?{title:h}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:zt(l,0)}}}}function hL(e){const{axes:t}=e.component,n=[];for(const i of io)if(t[i]){for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const s=i==="x"?"height":"width",o=e.getSizeSignalRef(s).signal;s!==o&&n.push({name:s,update:o})}}return n}function yme(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>vh(r,"grid",t)),...i.map(r=>vh(r,"grid",t)),...n.map(r=>vh(r,"main",t)),...i.map(r=>vh(r,"main",t))].filter(r=>r)}function pL(e,t,n,i){return Object.assign.apply(null,[{},...e.map(r=>{if(r==="axisOrient"){const s=n==="x"?"bottom":"left",o=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},u=new Set([...Y(o),...Y(a)]),l={};for(const c of u.values())l[c]={signal:`${i.signal} === "${s}" ? ${Dr(o[c])} : ${Dr(a[c])}`};return l}return t[r]})])}function bme(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:ON(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],s=e==="x"?"axisX":"axisY",o=me(n)?"axisOrient":`axis${Yd(n)}`,a=[...r,...r.map(l=>s+l.substr(4))],u=["axis",o,s];return{vlOnlyAxisConfig:pL(a,i,e,n),vgAxisConfig:pL(u,i,e,n),axisConfigStyle:vme([...u,...a],i)}}function vme(e,t){var i;const n=[{}];for(const r of e){let s=(i=t[r])==null?void 0:i.style;if(s){s=oe(s);for(const o of s)n.push(t.style[o])}}return Object.assign.apply(null,n)}function jw(e,t,n,i={}){var s;const r=QM(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const o of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((s=i[o])==null?void 0:s[e])!==void 0)return{configFrom:o,configValue:i[o][e]};return{}}const gL={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??xme(n,e),gridScale:({model:e,channel:t})=>_me(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||yL(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||mL(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??Eme(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??Cme(t.type,n,J(t)&&!!t.timeUnit,J(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{const s=e==="x"?"width":e==="y"?"height":void 0,o=s?t.getSizeSignalRef(s):void 0;return n.tickCount??Ame({fieldOrDatumDef:i,scaleType:r,size:o,values:n.values})},tickMinStep:$me,title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=bL(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),s=n==="x"?"x2":"y2",o=t.fieldDef(s);return tN(r?[tR(r)]:[],J(o)?[tR(o)]:[])},values:({axis:e,fieldOrDatumDef:t})=>Sme(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??Fme(n,t)};function xme(e,t){return!on(e)&&J(t)&&!_t(t==null?void 0:t.bin)&&!mn(t==null?void 0:t.bin)}function _me(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function wme(e,t,n,i,r){const s=t==null?void 0:t.labelAngle;if(s!==void 0)return me(s)?s:Xd(s);{const{configValue:o}=jw("labelAngle",i,t==null?void 0:t.style,r);return o!==void 0?Xd(o):n===$t&&qe([R_,N_],e.type)&&!(J(e)&&e.timeUnit)?270:void 0}}function qw(e){return`(((${e.signal} % 360) + 360) % 360)`}function mL(e,t,n,i){if(e!==void 0)if(n==="x"){if(me(e)){const r=qw(e),s=me(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${r} && ${r} < 135) || (225 < ${r} && ${r} < 315) ? "middle" :(${r} <= 45 || 315 <= ${r}) === ${s} ? "bottom" : "top"`}}if(45{if(Au(i)&&eR(i.sort)){const{field:s,timeUnit:o}=i,a=i.sort,u=a.map((l,c)=>`${DN({field:s,timeUnit:o,equal:l})} ? ${c} : `).join("")+a.length;t=new Dc(t,{calculate:u,as:Tc(i,r,{forAs:!0})})}}),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${He(this.transform)}`}}function Tc(e,t,n){return ne(e,{prefix:t,suffix:"sort_index",...n})}function wm(e,t){return qe(["top","bottom"],t)?"column":qe(["left","right"],t)||e==="row"?"row":"column"}function Mc(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return zt((t||{})[e],r[e],n.header[e])}function Em(e,t,n,i){const r={};for(const s of e){const o=Mc(s,t||{},n,i);o!==void 0&&(r[s]=o)}return r}const Ww=["row","column"],Hw=["header","footer"];function Dme(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:s,titleAngle:o,titleOrient:a}=Em(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),u=wm(t,a),l=Xd(o);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...xL(l,u),...vL(u,l,s),..._L(i,r,t,cpe,RR)}}}function vL(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=yL(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function xL(e,t){const n=mL(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function Tme(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of Hw)if(n[r])for(const s of n[r]){const o=Nme(e,t,r,n,s);o!=null&&i.push(o)}return i}function Mme(e,t){const{sort:n}=e;return oo(n)?{field:ne(n,{expr:"datum"}),order:n.order??"ascending"}:W(n)?{field:Tc(e,t,{expr:"datum"}),order:"ascending"}:{field:ne(e,{expr:"datum"}),order:n??"ascending"}}function Gw(e,t,n){const{format:i,formatType:r,labelAngle:s,labelAnchor:o,labelOrient:a,labelExpr:u}=Em(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=H_({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=wm(t,a);return{text:{signal:u?du(du(u,"datum.label",l),"datum.value",ne(e,{expr:"parent"})):l},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...xL(s,c),...vL(c,s,o),..._L(n,e,t,fpe,OR)}}function Nme(e,t,n,i,r){if(r){let s=null;const{facetFieldDef:o}=i,a=e.config?e.config:void 0;if(o&&r.labels){const{labelOrient:f}=Em(["labelOrient"],o.header,a,t);(t==="row"&&!qe(["top","bottom"],f)||t==="column"&&!qe(["left","right"],f))&&(s=Gw(o,t,a))}const u=Oi(e)&&!rh(e.facet),l=r.axes,c=(l==null?void 0:l.length)>0;if(s||c){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...i.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:Mme(o,t)}:{},...c&&u?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...s?{title:s}:{},...r.sizeSignal?{encode:{update:{[f]:r.sizeSignal}}}:{},...c?{axes:l}:{}}}}return null}const Rme={column:{start:0,end:1},row:{start:1,end:0}};function Ome(e,t){return Rme[t][e]}function Lme(e,t){const n={};for(const i of ir){const r=e[i];if(r!=null&&r.facetFieldDef){const{titleAnchor:s,titleOrient:o}=Em(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=wm(i,o),u=Ome(s,a);u!==void 0&&(n[a]=u)}}return ht(n)?void 0:n}function _L(e,t,n,i,r){const s={};for(const o of i){if(!r[o])continue;const a=Mc(o,t==null?void 0:t.header,e,n);a!==void 0&&(s[r[o]]=a)}return s}function Vw(e){return[...Cm(e,"width"),...Cm(e,"height"),...Cm(e,"childWidth"),...Cm(e,"childHeight")]}function Cm(e,t){const n=t==="width"?"x":"y",i=e.component.layoutSize.get(t);if(!i||i==="merged")return[];const r=e.getSizeSignalRef(t).signal;if(i==="step"){const s=e.getScaleComponent(n);if(s){const o=s.get("type"),a=s.get("range");if(on(o)&&yu(a)){const u=e.scaleName(n);return Oi(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[wL(u,a)]:[wL(u,a),{name:r,update:EL(u,s,`domain('${u}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const s=r.endsWith("width"),o=s?"containerSize()[0]":"containerSize()[1]",a=cw(e.config.view,s?"width":"height"),u=`isFinite(${o}) ? ${o} : ${a}`;return[{name:r,init:u,on:[{update:u,events:"window:resize"}]}]}else return[{name:r,value:i}]}function wL(e,t){const n=`${e}_step`;return me(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function EL(e,t,n){const i=t.get("type"),r=t.get("padding"),s=zt(t.get("paddingOuter"),r);let o=t.get("paddingInner");return o=i==="band"?o!==void 0?o:r:1,`bandspace(${n}, ${Dr(o)}, ${Dr(s)}) * ${e}_step`}function CL(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function kL(e,t){return Y(e).reduce((n,i)=>({...n,...$c({model:t,channelDef:e[i],vgChannel:i,mainRefFn:r=>Et(r.value),invalidValueRef:void 0})}),{})}function AL(e,t){if(Oi(t))return e==="theta"?"independent":"shared";if(Lc(t))return"shared";if(l6(t))return Bt(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function Yw(e,t){const n=e.scale[t],i=Bt(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&Z(lhe(t)),"independent"):e[i][t]||"shared"}const Ime={...hpe,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},$L=Y(Ime);class Pme extends lo{}const SL={symbols:zme,gradient:Bme,labels:Ume,entries:jme};function zme(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:s}){if(s!=="symbol")return;const{markDef:o,encoding:a,config:u,mark:l}=n,c=o.filled&&l!=="trail";let f={...yde({},n,h0e),...DO(n,{filled:c})};const d=r.get("symbolOpacity")??u.legend.symbolOpacity,h=r.get("symbolFillColor")??u.legend.symbolFillColor,p=r.get("symbolStrokeColor")??u.legend.symbolStrokeColor,g=d===void 0?FL(a.opacity)??o.opacity:void 0;if(f.fill){if(i==="fill"||c&&i===pi)delete f.fill;else if(X(f.fill,"field"))h?delete f.fill:(f.fill=Et(u.legend.symbolBaseFillColor??"black"),f.fillOpacity=Et(g??1));else if(W(f.fill)){const m=Xw(a.fill??a.color)??o.fill??(c&&o.color);m&&(f.fill=Et(m))}}if(f.stroke){if(i==="stroke"||!c&&i===pi)delete f.stroke;else if(X(f.stroke,"field")||p)delete f.stroke;else if(W(f.stroke)){const m=zt(Xw(a.stroke||a.color),o.stroke,c?o.color:void 0);m&&(f.stroke={value:m})}}if(i!==no){const m=J(t)&&TL(n,r,t);m?f.opacity=[{test:m,...Et(g??1)},Et(u.legend.unselectedOpacity)]:g&&(f.opacity=Et(g))}return f={...f,...e},ht(f)?void 0:f}function Bme(e,{model:t,legendType:n,legendCmpt:i}){if(n!=="gradient")return;const{config:r,markDef:s,encoding:o}=t;let a={};const l=(i.get("gradientOpacity")??r.legend.gradientOpacity)===void 0?FL(o.opacity)||s.opacity:void 0;return l&&(a.opacity=Et(l)),a={...a,...e},ht(a)?void 0:a}function Ume(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const s=n.legend(i)||{},o=n.config,a=J(t)?TL(n,r,t):void 0,u=a?[{test:a,value:1},{value:o.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=s;let f;ku(c)?f=Mr({fieldOrDatumDef:t,field:"datum.value",format:l,formatType:c,config:o}):l===void 0&&c===void 0&&o.customFormatTypes&&(t.type==="quantitative"&&o.numberFormatType?f=Mr({fieldOrDatumDef:t,field:"datum.value",format:o.numberFormat,formatType:o.numberFormatType,config:o}):t.type==="temporal"&&o.timeFormatType&&J(t)&&t.timeUnit===void 0&&(f=Mr({fieldOrDatumDef:t,field:"datum.value",format:o.timeFormat,formatType:o.timeFormatType,config:o})));const d={...u?{opacity:u}:{},...f?{text:f}:{},...e};return ht(d)?void 0:d}function jme(e,{legendCmpt:t}){const n=t.get("selections");return n!=null&&n.length?{...e,fill:{value:"transparent"}}:e}function FL(e){return DL(e,(t,n)=>Math.max(t,n.value))}function Xw(e){return DL(e,(t,n)=>zt(t,n.value))}function DL(e,t){if(T0e(e))return oe(e.condition).reduce(t,e.value);if(Nr(e))return e.value}function TL(e,t,n){const i=t.get("selections");if(!(i!=null&&i.length))return;const r=Q(n.field);return i.map(s=>`(!length(data(${Q(At(s)+Fu)})) || (${s}[${r}] && indexof(${s}[${r}], datum.value) >= 0))`).join(" || ")}const ML={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return XN(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return KN(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??Xme(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??Kme(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??Wme(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>xc(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(pc(n)&&vs(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>qme(t,e)};function qme(e,t){const n=e.values;if(W(n))return dR(t,n);if(me(n))return n}function Wme(e,t,n,i){if(t!=="shape"){const r=Xw(n)??i;if(r)return r}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function Hme(e){const{legend:t}=e;return zt(t.type,Gme(e))}function Gme({channel:e,timeUnit:t,scaleType:n}){if(pc(e)){if(qe(["quarter","month","day"],t))return"symbol";if(vs(n))return"gradient"}return"symbol"}function Vme({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??Yme(n,t)}function Yme(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function Xme({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:s,gradientHorizontalMinLength:o,gradientVerticalMaxLength:a,gradientVerticalMinLength:u}=e;if(vs(r))return n==="horizontal"?i==="top"||i==="bottom"?NL(t,"width",o,s):o:NL(t,"height",u,a)}function NL(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function Kme(e){if(qe(["quantile","threshold","log","symlog"],e))return"greedy"}function RL(e){const t=Dt(e)?Zme(e):t2e(e);return e.component.legends=t,t}function Zme(e){const{encoding:t}=e,n={};for(const i of[pi,...IR]){const r=Xt(t[i]);!r||!e.getScaleComponent(i)||i===gi&&J(r)&&r.type===mc||(n[i]=e2e(e,i))}return n}function Jme(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function Qme(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(t==="title"&&e===(i==null?void 0:i.title))return!0}return e===(n||{})[t]}function e2e(e,t){var x;let n=e.legend(t);const{markDef:i,encoding:r,config:s}=e,o=s.legend,a=new Pme({},Jme(e,t));e1e(e,t,a);const u=n!==void 0?!n:o.disable;if(a.set("disable",u,n!==void 0),u)return a;n=n||{};const l=e.getScaleComponent(t).get("type"),c=Xt(r[t]),f=J(c)?(x=sn(c.timeUnit))==null?void 0:x.unit:void 0,d=n.orient||s.legend.orient||"right",h=Hme({legend:n,channel:t,timeUnit:f,scaleType:l}),p=Vme({legend:n,legendType:h,orient:d,legendConfig:o}),g={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:c,legendConfig:o,config:s,scaleType:l,orient:d,legendType:h,direction:p};for(const _ of $L){if(h==="gradient"&&_.startsWith("symbol")||h==="symbol"&&_.startsWith("gradient"))continue;const E=_ in ML?ML[_](g):n[_];if(E!==void 0){const w=Qme(E,_,n,e.fieldDef(t));(w||s.legend[_]===void 0)&&a.set(_,E,w)}}const m=(n==null?void 0:n.encoding)??{},y=a.get("selections"),b={},v={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:a,legendType:h};for(const _ of["labels","legend","title","symbols","gradient","entries"]){const E=kL(m[_]??{},e),w=_ in SL?SL[_](E,v):E;w!==void 0&&!ht(w)&&(b[_]={...y!=null&&y.length&&J(c)?{name:`${At(c.field)}_legend_${_}`}:{},...y!=null&&y.length?{interactive:!!y}:{},update:w})}return ht(b)||a.set("encode",b,!!(n!=null&&n.encoding)),a}function t2e(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){RL(i);for(const r of Y(i.component.legends))n.legend[r]=Yw(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=OL(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of Y(t))for(const r of e.children)r.component.legends[i]&&n.legend[i]==="shared"&&delete r.component.legends[i];return t}function OL(e,t){var s,o,a,u;if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const l of $L){const c=ma(e.getWithExplicit(l),t.getWithExplicit(l),l,"legend",(f,d)=>{switch(l){case"symbolType":return n2e(f,d);case"title":return iN(f,d);case"type":return r=!0,Ri("symbol")}return om(f,d,l,"legend")});e.setWithExplicit(l,c)}return r&&((o=(s=e.implicit)==null?void 0:s.encode)!=null&&o.gradient&&C1(e.implicit,["encode","gradient"]),(u=(a=e.explicit)==null?void 0:a.encode)!=null&&u.gradient&&C1(e.explicit,["encode","gradient"])),e}function n2e(e,t){return t.value==="circle"?t:e}function i2e(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function LL(e){const t=e.component.legends,n={};for(const r of Y(t)){const s=e.getScaleComponent(r),o=pt(s.get("domains"));if(n[o])for(const a of n[o])OL(a,t[r])||n[o].push(t[r]);else n[o]=[t[r].clone()]}return gn(n).flat().map(r=>r2e(r,e.config)).filter(r=>r!==void 0)}function r2e(e,t){var o,a,u;const{disable:n,labelExpr:i,selections:r,...s}=e.combine();if(!n){if(t.aria===!1&&s.aria==null&&(s.aria=!1),(o=s.encode)!=null&&o.symbols){const l=s.encode.symbols.update;l.fill&&l.fill.value!=="transparent"&&!l.stroke&&!s.stroke&&(l.stroke={value:"transparent"});for(const c of IR)s[c]&&delete l[c]}if(s.title||delete s.title,i!==void 0){let l=i;(u=(a=s.encode)==null?void 0:a.labels)!=null&&u.update&&me(s.encode.labels.update.text)&&(l=du(i,"datum.label",s.encode.labels.update.text.signal)),i2e(s,"labels","text",{signal:l})}return s}}function s2e(e){return Lc(e)||l6(e)?o2e(e):IL(e)}function o2e(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),IL(e))}function IL(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const r={signal:`[${t.size.map(o=>o.signal).join(", ")}]`},s=t.data.reduce((o,a)=>{const u=me(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return qe(o,u)||o.push(u),o},[]);if(s.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:r,fit:{signal:s.length>1?`[${s.join(", ")}]`:s[0]},...n}]}else return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const a2e=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class PL extends lo{constructor(t,n,i,r){super({...n},{name:t}),this.specifiedProjection=n,this.size=i,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function zL(e){e.component.projection=Dt(e)?u2e(e):f2e(e)}function u2e(e){if(e.hasProjection){const t=yn(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?l2e(e):void 0,s=new PL(e.projectionName(!0),{...yn(e.config.projection),...t},i,r);return s.get("type")||s.set("type","equalEarth",!1),s}}function l2e(e){const t=[],{encoding:n}=e;for(const i of[[Sr,$r],[nr,Fr]])(Xt(n[i[0]])||Xt(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(gi)&&e.typedFieldDef(gi).type===mc&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(Ft.Main)),t}function c2e(e,t){const n=Qx(a2e,r=>!!(!ue(e.explicit,r)&&!ue(t.explicit,r)||ue(e.explicit,r)&&ue(t.explicit,r)&&Mi(e.get(r),t.get(r))));if(Mi(e.size,t.size)){if(n)return e;if(Mi(e.explicit,{}))return t;if(Mi(t.explicit,{}))return e}return null}function f2e(e){if(e.children.length===0)return;let t;for(const i of e.children)zL(i);const n=Qx(e.children,i=>{const r=i.component.projection;if(r)if(t){const s=c2e(t,r);return s&&(t=s),!!s}else return t=r,!0;else return!0});if(t&&n){const i=e.projectionName(!0),r=new PL(i,t.specifiedProjection,t.size,De(t.data));for(const s of e.children){const o=s.component.projection;o&&(o.isFit&&r.data.push(...s.component.projection.data),s.renameProjection(o.get("name"),i),o.merged=!0)}return r}}function d2e(e,t,n,i){if(ah(t,n)){const r=Dt(e)?e.axis(n)??e.legend(n)??{}:{},s=ne(t,{expr:"datum"}),o=ne(t,{expr:"datum",binSuffix:"end"});return{formulaAs:ne(t,{binSuffix:"range",forAs:!0}),formula:ih(s,o,r.format,r.formatType,i)}}return{}}function BL(e,t){return`${GM(e)}_${t}`}function h2e(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function Kw(e,t,n){const i=Z1(n,void 0)??{},r=BL(i,t);return e.getName(`${r}_bins`)}function p2e(e){return"as"in e}function UL(e,t,n){let i,r;p2e(e)?i=se(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[ne(e,{forAs:!0}),ne(e,{binSuffix:"end",forAs:!0})];const s={...Z1(t,void 0)},o=BL(s,e.field),{signal:a,extentSignal:u}=h2e(n,o);if(N1(s.extent)){const c=s.extent;r=dL(n,c.param,c),delete s.extent}const l={bin:s,field:e.field,as:[i],...a?{signal:a}:{},...u?{extentSignal:u}:{},...r?{span:r}:{}};return{key:o,binComponent:l}}class $s extends ut{clone(){return new $s(null,De(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,o)=>{if(ei(s)&&_t(s.bin)){const{key:a,binComponent:u}=UL(s,s.bin,n);r[a]={...u,...r[a],...d2e(n,s,o,n.config)}}return r},{});return ht(i)?null:new $s(t,i)}static makeFromTransform(t,n,i){const{key:r,binComponent:s}=UL(n,n.bin,i);return new $s(t,{[r]:s})}merge(t,n){for(const i of Y(t.bins))i in this.bins?(n(t.bins[i].signal,this.bins[i].signal),this.bins[i].as=fs([...this.bins[i].as,...t.bins[i].as],He)):this.bins[i]=t.bins[i];for(const i of t.children)t.removeChild(i),i.parent=this;t.remove()}producedFields(){return new Set(gn(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(gn(this.bins).map(t=>t.field))}hash(){return`Bin ${He(this.bins)}`}assemble(){return gn(this.bins).flatMap(t=>{const n=[],[i,...r]=t.as,{extent:s,...o}=t.bin,a={type:"bin",field:er(t.field),as:i,signal:t.signal,...N1(s)?{extent:null}:{extent:s},...t.span?{span:{signal:`span(${t.span})`}}:{},...o};!s&&t.extentSignal&&(n.push({type:"extent",field:er(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),n.push(a);for(const u of r)for(let l=0;l<2;l++)n.push({type:"formula",expr:ne({field:i[l]},{expr:"datum"}),as:u[l]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function g2e(e,t,n,i){var s;const r=Dt(i)?i.encoding[gs(t)]:void 0;if(ei(n)&&Dt(i)&&iR(n,r,i.markDef,i.config)){e.add(ne(n,{})),e.add(ne(n,{suffix:"end"}));const{mark:o,markDef:a,config:u}=i,l=pa({fieldDef:n,markDef:a,config:u});th(o)&&l!==.5&&Bt(t)&&(e.add(ne(n,{suffix:am})),e.add(ne(n,{suffix:um}))),n.bin&&ah(n,t)&&e.add(ne(n,{binSuffix:"range"}))}else if(IM(t)){const o=LM(t);e.add(i.getName(o))}else e.add(ne(n));return Au(n)&&e0e((s=n.scale)==null?void 0:s.range)&&e.add(n.scale.range.field),e}function m2e(e,t){for(const n of Y(t)){const i=t[n];for(const r of Y(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class Ir extends ut{clone(){return new Ir(null,new Set(this.dimensions),De(this.measures))}constructor(t,n,i){super(t),this.dimensions=n,this.measures=i}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let i=!1;n.forEachFieldDef(o=>{o.aggregate&&(i=!0)});const r={},s=new Set;return!i||(n.forEachFieldDef((o,a)=>{const{aggregate:u,field:l}=o;if(u)if(u==="count")r["*"]??(r["*"]={}),r["*"].count=new Set([ne(o,{forAs:!0})]);else{if(ro(u)||fa(u)){const c=ro(u)?"argmin":"argmax",f=u[c];r[f]??(r[f]={}),r[f][c]=new Set([ne({op:c,field:f},{forAs:!0})])}else r[l]??(r[l]={}),r[l][u]=new Set([ne(o,{forAs:!0})]);ms(a)&&n.scaleDomain(a)==="unaggregated"&&(r[l]??(r[l]={}),r[l].min=new Set([ne({field:l,aggregate:"min"},{forAs:!0})]),r[l].max=new Set([ne({field:l,aggregate:"max"},{forAs:!0})]))}else g2e(s,a,o,n)}),s.size+Y(r).length===0)?null:new Ir(t,s,r)}static makeFromTransform(t,n){var i;const r=new Set,s={};for(const o of n.aggregate){const{op:a,field:u,as:l}=o;a&&(a==="count"?(s["*"]??(s["*"]={}),s["*"].count=new Set([l||ne(o,{forAs:!0})])):(s[u]??(s[u]={}),(i=s[u])[a]??(i[a]=new Set),s[u][a].add(l||ne(o,{forAs:!0}))))}for(const o of n.groupby??[])r.add(o);return r.size+Y(s).length===0?null:new Ir(t,r,s)}merge(t){return $M(this.dimensions,t.dimensions)?(m2e(this.measures,t.measures),!0):(khe("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...Y(this.measures)])}producedFields(){const t=new Set;for(const n of Y(this.measures))for(const i of Y(this.measures[n])){const r=this.measures[n][i];r.size===0?t.add(`${i}_${n}`):r.forEach(t.add,t)}return t}hash(){return`Aggregate ${He({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],i=[];for(const s of Y(this.measures))for(const o of Y(this.measures[s]))for(const a of this.measures[s][o])i.push(a),t.push(o),n.push(s==="*"?null:er(s));return{type:"aggregate",groupby:[...this.dimensions].map(er),ops:t,fields:n,as:i}}}class Nc extends ut{constructor(t,n,i,r){super(t),this.model=n,this.name=i,this.data=r;for(const s of ir){const o=n.facet[s];if(o){const{bin:a,sort:u}=o;this[s]={name:n.getName(`${s}_domain`),fields:[ne(o),..._t(a)?[ne(o,{binSuffix:"end"})]:[]],...oo(u)?{sortField:u}:W(u)?{sortIndexField:Tc(o,s)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of ir)this[n]&&(t+=` ${n.charAt(0)}:${He(this[n])}`);return t}get fields(){var n;const t=[];for(const i of ir)(n=this[i])!=null&&n.fields&&t.push(...this[i].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of ir)this[n]&&(this[n].sortField&&t.add(this[n].sortField.field),this[n].sortIndexField&&t.add(this[n].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const n of io){const i=this.childModel.component.scales[n];if(i&&!i.merged){const r=i.get("type"),s=i.get("range");if(on(r)&&yu(s)){const o=Am(this.childModel,n),a=a6(o);a?t[n]=a:Z(b_(n))}}}return t}assembleRowColumnHeaderData(t,n,i){const r={row:"y",column:"x",facet:void 0}[t],s=[],o=[],a=[];r&&i&&i[r]&&(n?(s.push(`distinct_${i[r]}`),o.push("max")):(s.push(i[r]),o.push("distinct")),a.push(`distinct_${i[r]}`));const{sortField:u,sortIndexField:l}=this[t];if(u){const{op:c=W1,field:f}=u;s.push(f),o.push(c),a.push(ne(u,{forAs:!0}))}else l&&(s.push(l),o.push("max"),a.push(l));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...s.length?{fields:s,ops:o,as:a}:{}}]}}assembleFacetHeaderData(t){var u;const{columns:n}=this.model.layout,{layoutHeaders:i}=this.model.component,r=[],s={};for(const l of Ww){for(const c of Hw){const f=(i[l]&&i[l][c])??[];for(const d of f)if(((u=d.axes)==null?void 0:u.length)>0){s[l]=!0;break}}if(s[l]){const c=`length(data("${this.facet.name}"))`,f=l==="row"?n?{signal:`ceil(${c} / ${n})`}:1:n?{signal:`min(${c}, ${n})`}:{signal:c};r.push({name:`${this.facet.name}_${l}`,transform:[{type:"sequence",start:0,stop:f}]})}}const{row:o,column:a}=s;return(o||a)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,t)),r}assemble(){const t=[];let n=null;const i=this.getChildIndependentFieldsWithStep(),{column:r,row:s,facet:o}=this;if(r&&s&&(i.x||i.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(i.x??[],i.y??[]),u=a.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:u}]})}for(const a of[Js,Zs])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,i));if(o){const a=this.assembleFacetHeaderData(i);a&&t.push(...a)}return t}}function jL(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function y2e(e,t){const n=i_(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const i=jL(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=jL(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return Z(Rde(t)),null}function b2e(e){const t={};return E1(e.filter,n=>{if(FN(n)){let i=null;A_(n)?i=Ni(n.equal):S_(n)?i=Ni(n.lte):$_(n)?i=Ni(n.lt):F_(n)?i=Ni(n.gt):D_(n)?i=Ni(n.gte):T_(n)?i=n.range[0]:M_(n)&&(i=(n.oneOf??n.in)[0]),i&&(vu(i)?t[n.field]="date":Ze(i)?t[n.field]="number":se(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function v2e(e){const t={};function n(i){wc(i)?t[i.field]="date":i.type==="quantitative"&&lde(i.aggregate)?t[i.field]="number":fc(i.field)>1?i.field in t||(t[i.field]="flatten"):Au(i)&&oo(i.sort)&&fc(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((Dt(e)||Oi(e))&&e.forEachFieldDef((i,r)=>{if(ei(i))n(i);else{const s=gu(r),o=e.fieldDef(s);n({...i,type:o.type})}}),Dt(e)){const{mark:i,markDef:r,encoding:s}=e;if(ha(i)&&!e.encoding.order){const o=r.orient==="horizontal"?"y":"x",a=s[o];J(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function x2e(e){const t={};if(Dt(e)&&e.component.selection)for(const n of Y(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&fc(r.field)>1&&(t[r.field]="flatten")}return t}class In extends ut{clone(){return new In(null,De(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${He(this._parse)}`}static makeExplicit(t,n,i){var o;let r={};const s=n.data;return!ya(s)&&((o=s==null?void 0:s.format)!=null&&o.parse)&&(r=s.format.parse),this.makeWithAncestors(t,r,{},i)}static makeWithAncestors(t,n,i,r){for(const a of Y(i)){const u=r.getWithExplicit(a);u.value!==void 0&&(u.explicit||u.value===i[a]||u.value==="derived"||i[a]==="flatten"?delete i[a]:Z(cN(a,i[a],u.value)))}for(const a of Y(n)){const u=r.get(a);u!==void 0&&(u===n[a]?delete n[a]:Z(cN(a,n[a],u)))}const s=new lo(n,i);r.copyAll(s);const o={};for(const a of Y(s.combine())){const u=s.get(a);u!==null&&(o[a]=u)}return Y(o).length===0||r.parseNothing?null:new In(t,o)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of Y(this._parse)){const i=this._parse[n];fc(n)===1&&(t[n]=i)}return t}producedFields(){return new Set(Y(this._parse))}dependentFields(){return new Set(Y(this._parse))}assembleTransforms(t=!1){return Y(this._parse).filter(n=>t?fc(n)>1:!0).map(n=>{const i=y2e(n,this._parse[n]);return i?{type:"formula",expr:i,as:cc(n)}:null}).filter(n=>n!==null)}}class va extends ut{clone(){return new va(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([Or])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Or}}}class xh extends ut{clone(){return new xh(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${He(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class _h extends ut{clone(){return new _h(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${He(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class Ru extends ut{constructor(t){super(null),t??(t={name:"source"});let n;if(ya(t)||(n=t.format?{...hi(t.format,["parse"])}:{}),lh(t))this._data={values:t.values};else if(Cc(t)){if(this._data={url:t.url},!n.type){let i=/(?:\.([^.]+))?$/.exec(t.url)[1];qe(["json","csv","tsv","dsv","topojson"],i)||(i="json"),n.type=i}}else pO(t)?this._data={values:[{type:"Sphere"}]}:(dO(t)||ya(t))&&(this._data={});this._generator=ya(t),t.name&&(this._name=t.name),n&&!ht(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var qL=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},_2e=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},wh;function Zw(e){return e instanceof Ru||e instanceof xh||e instanceof _h}class Jw{constructor(){wh.set(this,void 0),qL(this,wh,!1,"f")}setModified(){qL(this,wh,!0,"f")}get modifiedFlag(){return _2e(this,wh,"f")}}wh=new WeakMap;class Ou extends Jw{getNodeDepths(t,n,i){i.set(t,n);for(const r of t.children)this.getNodeDepths(r,n+1,i);return i}optimize(t){const i=[...this.getNodeDepths(t,0,new Map).entries()].sort((r,s)=>s[1]-r[1]);for(const r of i)this.run(r[0]);return this.modifiedFlag}}class Qw extends Jw{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class w2e extends Qw{mergeNodes(t,n){const i=n.shift();for(const r of n)t.removeChild(r),r.parent=i,r.remove()}run(t){const n=t.children.map(r=>r.hash()),i={};for(let r=0;r1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class E2e extends Qw{constructor(t){super(),this.requiresSelectionId=t&&Tw(t)}run(t){t instanceof va&&(this.requiresSelectionId&&(Zw(t.parent)||t.parent instanceof Ir||t.parent instanceof In)||(this.setModified(),t.remove()))}}class C2e extends Jw{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof Cs&&(i=t.producedFields(),e_(i,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const r of t.children)this.run(r,new Set([...n,...i]))}}class k2e extends Qw{constructor(){super()}run(t){t instanceof yi&&!t.isRequired()&&(this.setModified(),t.remove())}}class A2e extends Ou{run(t){if(!Zw(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof In)if(t instanceof In)this.setModified(),t.merge(n);else{if(n_(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class $2e extends Ou{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof In);if(t.numChildren()>1&&i.length>=1){const r={},s=new Set;for(const o of i){const a=o.parse;for(const u of Y(a))u in r?r[u]!==a[u]&&s.add(u):r[u]=a[u]}for(const o of s)delete r[o];if(!ht(r)){this.setModified();const o=new In(t,r);for(const a of n){if(a instanceof In)for(const u of Y(r))delete a.parse[u];t.removeChild(a),a.parent=o,a instanceof In&&Y(a.parse).length===0&&a.remove()}}}}}class S2e extends Ou{run(t){t instanceof yi||t.numChildren()>0||t instanceof Nc||t instanceof Ru||(this.setModified(),t.remove())}}class F2e extends Ou{run(t){const n=t.children.filter(r=>r instanceof Cs),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class D2e extends Ou{run(t){const n=t.children.filter(r=>r instanceof Ir),i={};for(const r of n){const s=He(r.groupBy);s in i||(i[s]=[]),i[s].push(r)}for(const r of Y(i)){const s=i[r];if(s.length>1){const o=s.pop();for(const a of s)o.merge(a)&&(t.removeChild(a),a.parent=o,a.remove(),this.setModified())}}}}class T2e extends Ou{constructor(t){super(),this.model=t}run(t){const n=!(Zw(t)||t instanceof Fc||t instanceof In||t instanceof va),i=[],r=[];for(const s of t.children)s instanceof $s&&(n&&!n_(t.producedFields(),s.dependentFields())?i.push(s):r.push(s));if(i.length>0){const s=i.pop();for(const o of i)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof $s?t.merge(s,this.model.renameSignal.bind(this.model)):s.swapWithParent()}if(r.length>1){const s=r.pop();for(const o of r)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified()}}}class M2e extends Ou{run(t){const n=[...t.children];if(!lc(n,o=>o instanceof yi)||t.numChildren()<=1)return;const r=[];let s;for(const o of n)if(o instanceof yi){let a=o;for(;a.numChildren()===1;){const[u]=a.children;if(u instanceof yi)a=u;else break}r.push(...a.children),s?(t.removeChild(o),o.parent=s.parent,s.parent.removeChild(s),s.parent=a,this.setModified()):s=a}else r.push(o);if(r.length){this.setModified();for(const o of r)o.parent.removeChild(o),o.parent=s}}}class Lu extends ut{clone(){return new Lu(null,De(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=fs(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??ne(t)}hash(){return`JoinAggregateTransform ${He(this.transform)}`}assemble(){const t=[],n=[],i=[];for(const s of this.transform.joinaggregate)n.push(s.op),i.push(this.getDefaultName(s)),t.push(s.field===void 0?null:s.field);const r=this.transform.groupby;return{type:"joinaggregate",as:i,ops:n,fields:t,...r!==void 0?{groupby:r}:{}}}}class Rc extends ut{clone(){return new Rc(null,{...this.filter})}constructor(t,n){super(t),this.filter=n}static make(t,n,i){const{config:r,markDef:s}=n,{marks:o,scales:a}=i;if(o==="include-invalid-values"&&a==="include-invalid-values")return null;const u=n.reduceFieldDef((l,c,f)=>{const d=ms(f)&&n.getScaleComponent(f);if(d){const h=d.get("type"),{aggregate:p}=c,g=j_({scaleChannel:f,markDef:s,config:r,scaleType:h,isCountAggregate:M1(p)});g!=="show"&&g!=="always-valid"&&(l[c.field]=c)}return l},{});return Y(u).length?new Rc(t,u):null}dependentFields(){return new Set(Y(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${He(this.filter)}`}assemble(){const t=Y(this.filter).reduce((n,i)=>{const r=this.filter[i],s=ne(r,{expr:"datum"});return r!==null&&(r.type==="temporal"?n.push(`(isDate(${s}) || (${e6(s)}))`):r.type==="quantitative"&&n.push(e6(s))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}function e6(e){return`isValid(${e}) && isFinite(+${e})`}function N2e(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=ne(i);return r&&t.push(r),t},[])}function R2e(e){return W(e)&&e.every(t=>se(t))&&e.length>1}class go extends ut{clone(){return new go(null,De(this._stack))}constructor(t,n){super(t),this._stack=n}static makeFromTransform(t,n){const{stack:i,groupby:r,as:s,offset:o="zero"}=n,a=[],u=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),u.push(zt(f.order,"ascending"));const l={field:a,order:u};let c;return R2e(s)?c=s:se(s)?c=[s,`${s}_end`]:c=[`${n.stack}_start`,`${n.stack}_end`],new go(t,{dimensionFieldDefs:[],stackField:i,groupby:r,offset:o,sort:l,facetby:[],as:c})}static makeFromEncoding(t,n){const i=n.stack,{encoding:r}=n;if(!i)return null;const{groupbyChannels:s,fieldChannel:o,offset:a,impute:u}=i,l=s.map(h=>{const p=r[h];return Rr(p)}).filter(h=>!!h),c=N2e(n),f=n.encoding.order;let d;if(W(f)||J(f))d=eN(f);else{const h=rR(f)?f.sort:o==="y"?"descending":"ascending";d=c.reduce((p,g)=>(p.field.includes(g)||(p.field.push(g),p.order.push(h)),p),{field:[],order:[]})}return new go(t,{dimensionFieldDefs:l,stackField:n.vgField(o),facetby:[],stackby:c,sort:d,offset:a,impute:u,as:[n.vgField(o,{suffix:"start",forAs:!0}),n.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${He(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:i}=this._stack;return t.length>0?t.map(r=>r.bin?n?[ne(r,{binSuffix:"mid"})]:[ne(r,{}),ne(r,{binSuffix:"end"})]:[ne(r)]).flat():i??[]}assemble(){const t=[],{facetby:n,dimensionFieldDefs:i,stackField:r,stackby:s,sort:o,offset:a,impute:u,as:l}=this._stack;if(u)for(const c of i){const{bandPosition:f=.5,bin:d}=c;if(d){const h=ne(c,{expr:"datum"}),p=ne(c,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${e6(h)} ? ${f}*${h}+${1-f}*${p} : ${h}`,as:ne(c,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:r,groupby:[...s,...n],key:ne(c,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:r,sort:o,as:l,offset:a}),t}}class Oc extends ut{clone(){return new Oc(null,De(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=fs(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach(n=>t.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??ne(t)}hash(){return`WindowTransform ${He(this.transform)}`}assemble(){const t=[],n=[],i=[],r=[];for(const f of this.transform.window)n.push(f.op),i.push(this.getDefaultName(f)),r.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);const s=this.transform.frame,o=this.transform.groupby;if(s&&s[0]===null&&s[1]===null&&n.every(f=>p_(f)))return{type:"joinaggregate",as:i,ops:n,fields:t,...o!==void 0?{groupby:o}:{}};const a=[],u=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),u.push(f.order??"ascending");const l={field:a,order:u},c=this.transform.ignorePeers;return{type:"window",params:r,as:i,ops:n,fields:t,sort:l,...c!==void 0?{ignorePeers:c}:{},...o!==void 0?{groupby:o}:{},...s!==void 0?{frame:s}:{}}}}function O2e(e){function t(n){if(!(n instanceof Nc)){const i=n.clone();if(i instanceof yi){const r=n6+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof Ir||i instanceof go||i instanceof Oc||i instanceof Lu)&&i.addDimensions(e.fields);for(const r of n.children.flatMap(t))r.parent=i;return[i]}return n.children.flatMap(t)}return t}function t6(e){if(e instanceof Nc)if(e.numChildren()===1&&!(e.children[0]instanceof yi)){const t=e.children[0];(t instanceof Ir||t instanceof go||t instanceof Oc||t instanceof Lu)&&t.addDimensions(e.fields),t.swapWithParent(),t6(e)}else{const t=e.model.component.data.main;WL(t);const n=O2e(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(t6)}function WL(e){if(e instanceof yi&&e.type===Ft.Main&&e.numChildren()===1){const t=e.children[0];t instanceof Nc||(t.swapWithParent(),WL(e))}}const n6="scale_",km=5;function i6(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!i6(t.children))return!1}return!0}function Pr(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function HL(e,t,n){let i=e.sources,r=!1;return r=Pr(new k2e,i)||r,r=Pr(new E2e(t),i)||r,i=i.filter(s=>s.numChildren()>0),r=Pr(new S2e,i)||r,i=i.filter(s=>s.numChildren()>0),n||(r=Pr(new A2e,i)||r,r=Pr(new T2e(t),i)||r,r=Pr(new C2e,i)||r,r=Pr(new $2e,i)||r,r=Pr(new D2e,i)||r,r=Pr(new F2e,i)||r,r=Pr(new w2e,i)||r,r=Pr(new M2e,i)||r),e.sources=i,r}function L2e(e,t){i6(e.sources);let n=0,i=0;for(let r=0;rt(n))}}function GL(e){Dt(e)?I2e(e):P2e(e)}function I2e(e){const t=e.component.scales;for(const n of Y(t)){const i=B2e(e,n);if(t[n].setWithExplicit("domains",i),j2e(e,n),e.component.data.isFaceted){let s=e;for(;!Oi(s)&&s.parent;)s=s.parent;if(s.component.resolve.scale[n]==="shared")for(const a of i.value)so(a)&&(a.data=n6+a.data.replace(n6,""))}}}function P2e(e){for(const n of e.children)GL(n);const t=e.component.scales;for(const n of Y(t)){let i,r=null;for(const s of e.children){const o=s.component.scales[n];if(o){i===void 0?i=o.getWithExplicit("domains"):i=ma(i,o.getWithExplicit("domains"),"domains","scale",o6);const a=o.get("selectionExtent");r&&a&&r.param!==a.param&&Z($de),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function z2e(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:s}=VL(t,n);if(!r){Z(s);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=VL(t,n);if(r)return"unaggregated"}return e}function B2e(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=z2e(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:r}),t==="x"&&Xt(i.x2)?Xt(i.x)?ma(xa(n,r,e,"x"),xa(n,r,e,"x2"),"domain","scale",o6):xa(n,r,e,"x2"):t==="y"&&Xt(i.y2)?Xt(i.y)?ma(xa(n,r,e,"y"),xa(n,r,e,"y2"),"domain","scale",o6):xa(n,r,e,"y2"):xa(n,r,e,t)}function U2e(e,t,n){return e.map(i=>({signal:`{data: ${J1(i,{timeUnit:n,type:t})}}`}))}function r6(e,t,n){var r;const i=(r=sn(n))==null?void 0:r.unit;return t==="temporal"||i?U2e(e,t,i):[e]}function xa(e,t,n,i){const{encoding:r,markDef:s,mark:o,config:a,stack:u}=n,l=Xt(r[i]),{type:c}=l,f=l.timeUnit,d=Cge({invalid:ys("invalid",s,a),isPath:ha(o)});if(Qhe(t)){const g=xa(e,void 0,n,i),m=r6(t.unionWith,c,f);return Es([...m,...g.value])}else{if(me(t))return Es([t]);if(t&&t!=="unaggregated"&&!IN(t))return Es(r6(t,c,f))}if(u&&i===u.fieldChannel){if(u.offset==="normalize")return Ri([[0,1]]);const g=n.requestDataName(d);return Ri([{data:g,field:n.vgField(i,{suffix:"start"})},{data:g,field:n.vgField(i,{suffix:"end"})}])}const h=ms(i)&&J(l)?q2e(n,i,e):void 0;if(_s(l)){const g=r6([l.datum],c,f);return Ri(g)}const p=l;if(t==="unaggregated"){const{field:g}=l;return Ri([{data:n.requestDataName(d),field:ne({field:g,aggregate:"min"})},{data:n.requestDataName(d),field:ne({field:g,aggregate:"max"})}])}else if(_t(p.bin)){if(on(e))return Ri(e==="bin-ordinal"?[]:[{data:Gd(h)?n.requestDataName(d):n.requestDataName(Ft.Raw),field:n.vgField(i,ah(p,i)?{binSuffix:"range"}:{}),sort:h===!0||!re(h)?{field:n.vgField(i,{}),op:"min"}:h}]);{const{bin:g}=p;if(_t(g)){const m=Kw(n,p.field,g);return Ri([new un(()=>{const y=n.getSignalName(m);return`[${y}.start, ${y}.stop]`})])}else return Ri([{data:n.requestDataName(d),field:n.vgField(i,{})}])}}else if(p.timeUnit&&qe(["time","utc"],e)){const g=r[gs(i)];if(iR(p,g,s,a)){const m=n.requestDataName(d),y=pa({fieldDef:p,fieldDef2:g,markDef:s,config:a}),b=th(o)&&y!==.5&&Bt(i);return Ri([{data:m,field:n.vgField(i,b?{suffix:am}:{})},{data:m,field:n.vgField(i,{suffix:b?um:"end"})}])}}return Ri(h?[{data:Gd(h)?n.requestDataName(d):n.requestDataName(Ft.Raw),field:n.vgField(i),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(i)}])}function s6(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":W1),...i?{field:er(i)}:{},...r?{order:r}:{}}}function j2e(e,t){var a;const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=(a=e.fieldDef(t))==null?void 0:a.bin,s=IN(i)?i:void 0,o=mu(r)&&N1(r.extent)?r.extent:void 0;(s||o)&&n.set("selectionExtent",s??o,!0)}function q2e(e,t,n){if(!on(n))return;const i=e.fieldDef(t),r=i.sort;if(eR(r))return{op:"min",field:Tc(i,t),order:"ascending"};const{stack:s}=e,o=s?new Set([...s.groupbyFields,...s.stackBy.map(a=>a.fieldDef.field)]):void 0;if(oo(r)){const a=s&&!o.has(r.field);return s6(r,a)}else if(S0e(r)){const{encoding:a,order:u}=r,l=e.fieldDef(a),{aggregate:c,field:f}=l,d=s&&!o.has(f);if(ro(c)||fa(c))return s6({field:ne(l),order:u},d);if(p_(c)||!c)return s6({op:c,field:f,order:u},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(qe(["ascending",void 0],r))return!0}}function VL(e,t){const{aggregate:n,type:i}=e;return n?se(n)&&!fde.has(n)?{valid:!1,reason:nhe(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:ihe(e)}:{valid:!0}:{valid:!1,reason:the(e)}}function o6(e,t,n,i){return e.explicit&&t.explicit&&Z(uhe(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function W2e(e){const t=fs(e.map(o=>{if(so(o)){const{sort:a,...u}=o;return u}return o}),He),n=fs(e.map(o=>{if(so(o)){const a=o.sort;return a!==void 0&&!Gd(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(o=>o!==void 0),He);if(t.length===0)return;if(t.length===1){const o=e[0];if(so(o)&&n.length>0){let a=n[0];if(n.length>1){Z(mN);const u=n.filter(l=>re(l)&&"op"in l&&l.op!=="min");n.every(l=>re(l)&&"op"in l)&&u.length===1?a=u[0]:a=!0}else if(re(a)&&"field"in a){const u=a.field;o.field===u&&(a=a.order?{order:a.order}:!0)}return{...o,sort:a}}return o}const i=fs(n.map(o=>Gd(o)||!("op"in o)||se(o.op)&&ue(ade,o.op)?o:(Z(che(o)),!0)),He);let r;i.length===1?r=i[0]:i.length>1&&(Z(mN),r=!0);const s=fs(e.map(o=>so(o)?o.data:null),o=>o);return s.length===1&&s[0]!==null?{data:s[0],fields:t.map(a=>a.field),...r?{sort:r}:{}}:{fields:t,...r?{sort:r}:{}}}function a6(e){if(so(e)&&se(e.field))return e.field;if(dde(e)){let t;for(const n of e.fields)if(so(n)&&se(n.field)){if(!t)t=n.field;else if(t!==n.field)return Z(fhe),t}return Z(dhe),t}else if(hde(e)){Z(hhe);const t=e.fields[0];return se(t)?t:void 0}}function Am(e,t){const i=e.component.scales[t].get("domains").map(r=>(so(r)&&(r.data=e.lookupDataSource(r.data)),r));return W2e(i)}function YL(e){return Lc(e)||l6(e)?e.children.reduce((t,n)=>t.concat(YL(n)),XL(e)):XL(e)}function XL(e){return Y(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:s,type:o,selectionExtent:a,domains:u,range:l,reverse:c,...f}=r,d=H2e(r.range,s,n,e),h=Am(e,n),p=a?Oge(e,a,i,h):null;return t.push({name:s,type:o,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function H2e(e,t,n,i){if(Bt(n)){if(yu(e))return{step:{signal:`${t}_step`}}}else if(re(e)&&so(e))return{...e,data:i.lookupDataSource(e.data)};return e}class KL extends lo{constructor(t,n){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",n)}domainHasZero(){const t=this.get("type");if(qe([bn.LOG,bn.TIME,bn.UTC],t))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&qe([bn.LINEAR,bn.SQRT,bn.POW],t))return"definitely";const i=this.get("domains");if(i.length>0){let r=!1,s=!1,o=!1;for(const a of i){if(W(a)){const u=a[0],l=a[a.length-1];if(Ze(u)&&Ze(l))if(u<=0&&l>=0){r=!0;continue}else{s=!0;continue}}o=!0}if(r)return"definitely";if(s&&!o)return"definitely-not"}return"maybe"}}const G2e=["range","scheme"];function V2e(e){const t=e.component.scales;for(const n of d_){const i=t[n];if(!i)continue;const r=Y2e(n,e);i.setWithExplicit("range",r)}}function ZL(e,t){const n=e.fieldDef(t);if(n!=null&&n.bin){const{bin:i,field:r}=n,s=mi(t),o=e.getName(s);if(re(i)&&i.binned&&i.step!==void 0)return new un(()=>{const a=e.scaleName(t),u=`(domain("${a}")[1] - domain("${a}")[0]) / ${i.step}`;return`${e.getSignalName(o)} / (${u})`});if(_t(i)){const a=Kw(e,r,i);return new un(()=>{const u=e.getSignalName(a),l=`(${u}.stop - ${u}.start) / ${u}.step`;return`${e.getSignalName(o)} / (${l})`})}}}function Y2e(e,t){const n=t.specifiedScales[e],{size:i}=t,s=t.getScaleComponent(e).get("type");for(const f of G2e)if(n[f]!==void 0){const d=L_(s,f),h=PN(e,f);if(!d)Z(pN(s,f,e));else if(h)Z(h);else switch(f){case"range":{const p=n.range;if(W(p)){if(Bt(e))return Es(p.map(g=>{if(g==="width"||g==="height"){const m=t.getName(g),y=t.getSignalName.bind(t);return un.fromName(y,m)}return g}))}else if(re(p))return Es({data:t.requestDataName(Ft.Main),field:p.field,sort:{op:"min",field:t.vgField(e)}});return Es(p)}case"scheme":return Es(X2e(n[f]))}}const o=e===$t||e==="xOffset"?"width":"height",a=i[o];if(ws(a)){if(Bt(e))if(on(s)){const f=QL(a,t,e);if(f)return Es({step:f})}else Z(gN(o));else if(Jd(e)){const f=e===ra?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const p=eI(a,s);if(p)return Es(p)}}}const{rangeMin:u,rangeMax:l}=n,c=K2e(e,t);return(u!==void 0||l!==void 0)&&L_(s,"rangeMin")&&W(c)&&c.length===2?Es([u??c[0],l??c[1]]):Ri(c)}function X2e(e){return Jhe(e)?{scheme:e.name,...hi(e,["name"])}:{scheme:e}}function JL(e,t,n,{center:i}={}){const r=mi(e),s=t.getName(r),o=t.getSignalName.bind(t);return e===rn&&Tr(n)?i?[un.fromName(a=>`${o(a)}/2`,s),un.fromName(a=>`-${o(a)}/2`,s)]:[un.fromName(o,s),0]:i?[un.fromName(a=>`-${o(a)}/2`,s),un.fromName(a=>`${o(a)}/2`,s)]:[0,un.fromName(o,s)]}function K2e(e,t){const{size:n,config:i,mark:r,encoding:s}=t,{type:o}=Xt(s[e]),u=t.getScaleComponent(e).get("type"),{domain:l,domainMid:c}=t.specifiedScales[e];switch(e){case $t:case rn:{if(qe(["point","band"],u)){const f=tI(e,n,i.view);if(ws(f))return{step:QL(f,t,e)}}return JL(e,t,u)}case ra:case dc:return Z2e(e,t,u);case to:{const f=eye(r,i),d=tye(r,n,t,i);return yc(u)?Q2e(f,d,J2e(u,i,l,e)):[f,d]}case tr:return[0,Math.PI*2];case hu:return[0,360];case Ar:return[0,new un(()=>{const f=t.getSignalName(Oi(t.parent)?"child_width":"width"),d=t.getSignalName(Oi(t.parent)?"child_height":"height");return`min(${f},${d})/2`})];case sa:return{step:1e3/i.scale.framesPerSecond};case ua:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case la:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case gi:return"symbol";case pi:case hs:case ps:return u==="ordinal"?o==="nominal"?"category":"ordinal":c!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case no:case oa:case aa:return[i.scale.minOpacity,i.scale.maxOpacity]}}function QL(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),s=a_(n),o=i[s];if(zR({step:e,offsetIsDiscrete:Ne(o)&&TN(o.type)})==="offset"&&bR(i,s)){const u=t.getScaleComponent(s);let c=`domain('${t.scaleName(s)}').length`;if(u.get("type")==="band"){const d=u.get("paddingInner")??u.get("padding")??0,h=u.get("paddingOuter")??u.get("padding")??0;c=`bandspace(${c}, ${d}, ${h})`}const f=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${c} / (1-${mde(f)})`}}else return e.step}function eI(e,t){if(zR({step:e,offsetIsDiscrete:on(t)})==="offset")return{step:e.step}}function Z2e(e,t,n){const i=e===ra?"x":"y",r=t.getScaleComponent(i);if(!r)return JL(i,t,n,{center:!0});const s=r.get("type"),o=t.scaleName(i),{markDef:a,config:u}=t;if(s==="band"){const l=tI(i,t.size,t.config.view);if(ws(l)){const c=eI(l,n);if(c)return c}return[0,{signal:`bandwidth('${o}')`}]}else{const l=t.encoding[i];if(J(l)&&l.timeUnit){const c=$N(l.timeUnit,p=>`scale('${o}', ${p})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=pa({fieldDef:l,markDef:a,config:u})-.5,h=d!==0?` + ${d}`:"";if(f){const p=me(f)?`${f.signal}/2`+h:`${f/2+d}`,g=me(f)?`(1 - ${f.signal}/2)`+h:`${1-f/2+d}`;return[{signal:`${p} * (${c})`},{signal:`${g} * (${c})`}]}return[0,{signal:c}]}return kM(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function tI(e,t,n){const i=e===$t?"width":"height",r=t[i];return r||rm(n,i)}function J2e(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&W(n)?n.length+1:(Z(whe(i)),3)}}function Q2e(e,t,n){const i=()=>{const r=Dr(t),s=Dr(e),o=`(${r} - ${s}) / (${n} - 1)`;return`sequence(${s}, ${r} + ${o}, ${o})`};return me(t)?new un(i):{signal:i()}}function eye(e,t){switch(e){case"bar":case"tick":return t.scale.minBandSize;case"line":case"trail":case"rule":return t.scale.minStrokeWidth;case"text":return t.scale.minFontSize;case"point":case"square":case"circle":return t.scale.minSize}throw new Error(R1("size",e))}const nI=.95;function tye(e,t,n,i){const r={x:ZL(n,"x"),y:ZL(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const s=iI(t,r,i.view);return Ze(s)?s-1:new un(()=>`${s.signal} - 1`)}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const s=iI(t,r,i.view);return Ze(s)?Math.pow(nI*s,2):new un(()=>`pow(${nI} * ${s.signal}, 2)`)}}throw new Error(R1("size",e))}function iI(e,t,n){const i=ws(e.width)?e.width.step:fw(n,"width"),r=ws(e.height)?e.height.step:fw(n,"height");return t.x||t.y?new un(()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`):Math.min(i,r)}function rI(e,t){Dt(e)?nye(e,t):aI(e,t)}function nye(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:s,specifiedScales:o}=e;for(const a of Y(n)){const u=o[a],l=n[a],c=e.getScaleComponent(a),f=Xt(r[a]),d=u[t],h=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=L_(h,t),y=PN(a,t);if(d!==void 0&&(m?y&&Z(y):Z(pN(h,t,a))),m&&y===void 0)if(d!==void 0){const b=f.timeUnit,v=f.type;switch(t){case"domainMax":case"domainMin":vu(u[t])||v==="temporal"||b?l.set(t,{signal:J1(u[t],{type:v,timeUnit:b})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const b=X(sI,t)?sI[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:u.domain,domainMin:u.domainMin,domainMax:u.domainMax,markDef:s,config:i,hasNestedOffsetScale:vR(r,a),hasSecondaryRangeChannel:!!r[gs(a)]}):i.scale[t];b!==void 0&&l.set(t,b,!1)}}}const sI={bins:({model:e,fieldOrDatumDef:t})=>J(t)?iye(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>rye(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:s})=>sye(e,t,n,i,r,s),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>oye(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:s})=>aye(e,t,n.type,i,r.scale,s),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:s})=>uye(e,t,n,i,r.scale,s),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=J(e)?e.sort:void 0;return lye(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:s,hasSecondaryRangeChannel:o})=>cye(e,t,n,i,r,s.scale,o)};function oI(e){Dt(e)?V2e(e):aI(e,"range")}function aI(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?oI(i):rI(i,t);for(const i of Y(n)){let r;for(const s of e.children){const o=s.component.scales[i];if(o){const a=o.getWithExplicit(t);r=ma(r,a,t,"scale",fO((u,l)=>{switch(t){case"range":return u.step&&l.step?u.step-l.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function iye(e,t){const n=t.bin;if(_t(n)){const i=Kw(e,t.field,n);return new un(()=>e.getSignalName(i))}else if(mn(n)&&mu(n)&&n.step!==void 0)return{step:n.step}}function rye(e,t){if(qe([pi,hs,ps],e)&&t!=="nominal")return"hcl"}function sye(e,t,n,i,r,s){var o;if(!((o=Rr(s))!=null&&o.bin||W(n)||r!=null||i!=null||qe([bn.TIME,bn.UTC],e)))return Bt(t)?!0:void 0}function oye(e,t,n,i,r,s){if(Bt(e)){if(vs(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:o,orient:a}=r;if(o==="bar"&&!(J(i)&&(i.bin||i.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return s.continuousBandSize}if(t===bn.POINT)return n.pointPadding}}function aye(e,t,n,i,r,s=!1){if(e===void 0){if(Bt(t)){const{bandPaddingInner:o,barBandPaddingInner:a,rectBandPaddingInner:u,tickBandPaddingInner:l,bandWithNestedOffsetPaddingInner:c}=r;return s?c:zt(o,n==="bar"?a:n==="tick"?l:u)}else if(Jd(t)&&i===bn.BAND)return r.offsetBandPaddingInner}}function uye(e,t,n,i,r,s=!1){if(e===void 0){if(Bt(t)){const{bandPaddingOuter:o,bandWithNestedOffsetPaddingOuter:a}=r;if(s)return a;if(n===bn.BAND)return zt(o,me(i)?{signal:`${i.signal}/2`}:i/2)}else if(Jd(t)){if(n===bn.POINT)return .5;if(n===bn.BAND)return r.offsetBandPaddingOuter}}}function lye(e,t,n,i){if(n==="x"&&i.xReverse!==void 0)return Tr(e)&&t==="descending"?me(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(Tr(e)&&t==="descending")return!0}function cye(e,t,n,i,r,s,o){if(!!n&&n!=="unaggregated"&&Tr(r)){if(W(n)){const u=n[0],l=n[n.length-1];if(Ze(u)&&u<=0&&Ze(l)&&l>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!yc(r))return!0;if(!(J(t)&&t.bin)&&qe([...io,...Jfe],e)){const{orient:u,type:l}=i;return qe(["bar","area","line","trail"],l)&&(u==="horizontal"&&e==="y"||u==="vertical"&&e==="x")?!1:qe(["bar","area"],l)&&!o?!0:s==null?void 0:s.zero}return!1}function fye(e,t,n,i,r=!1){const s=dye(t,n,i,r),{type:o}=e;return ms(t)?o!==void 0?s0e(t,o)?J(n)&&!r0e(o,n.type)?(Z(ohe(o,s)),s):o:(Z(she(t,o,s)),s):s:null}function dye(e,t,n,i){var r;switch(t.type){case"nominal":case"ordinal":{if(pc(e)||h_(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&Z(__(e,"ordinal")),"ordinal";if(f_(e))return"band";if(Bt(e)||Jd(e)){if(qe(["rect","bar","image","rule","tick"],n.type)||i)return"band"}else if(n.type==="arc"&&e in c_)return"band";const s=n[mi(e)];return Eu(s)||vc(t)&&((r=t.axis)!=null&&r.tickBand)?"band":"point"}case"temporal":return pc(e)?"time":h_(e)==="discrete"?(Z(__(e,"temporal")),"ordinal"):J(t)&&t.timeUnit&&sn(t.timeUnit).utc?"utc":f_(e)?"band":"time";case"quantitative":return pc(e)?J(t)&&_t(t.bin)?"bin-ordinal":"linear":h_(e)==="discrete"?(Z(__(e,"quantitative")),"ordinal"):f_(e)?"band":"linear";case"geojson":return}throw new Error(dN(t.type))}function hye(e,{ignoreRange:t}={}){uI(e),GL(e);for(const n of i0e)rI(e,n);t||oI(e)}function uI(e){Dt(e)?e.component.scales=pye(e):e.component.scales=mye(e)}function pye(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const s of d_){const o=Xt(t[s]);if(o&&n===UN&&s===gi&&o.type===mc)continue;let a=o&&o.scale;if(o&&a!==null&&a!==!1){a??(a={});const u=vR(t,s),l=fye(a,s,o,i,u);r[s]=new KL(e.scaleName(`${s}`,!0),{value:l,explicit:a.type===l})}}return r}const gye=fO((e,t)=>MN(e)-MN(t));function mye(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const s of e.children){uI(s);for(const o of Y(s.component.scales))if((t=r.scale)[o]??(t[o]=AL(o,e)),r.scale[o]==="shared"){const a=i[o],u=s.component.scales[o].getWithExplicit("type");a?Vhe(a.value,u.value)?i[o]=ma(a,u,"type","scale",gye):(r.scale[o]="independent",delete i[o]):i[o]=u}}for(const s of Y(i)){const o=e.scaleName(s,!0),a=i[s];n[s]=new KL(o,a);for(const u of e.children){const l=u.component.scales[s];l&&(u.renameScale(l.get("name"),o),l.merged=!0)}}return n}class u6{constructor(){this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function Dt(e){return(e==null?void 0:e.type)==="unit"}function Oi(e){return(e==null?void 0:e.type)==="facet"}function l6(e){return(e==null?void 0:e.type)==="concat"}function Lc(e){return(e==null?void 0:e.type)==="layer"}class c6{constructor(t,n,i,r,s,o,a){this.type=n,this.parent=i,this.config=s,this.parent=i,this.config=s,this.view=yn(a),this.name=t.name??r,this.title=da(t.title)?{text:t.title}:t.title?yn(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new u6,this.projectionNameMap=i?i.projectionNameMap:new u6,this.signalNameMap=i?i.signalNameMap:new u6,this.data=t.data,this.description=t.description,this.transforms=dge(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:ype(t,n,s),this.component={data:{sources:i?i.component.data.sources:[],outputNodes:i?i.component.data.outputNodes:{},outputNodeRefCounts:i?i.component.data.outputNodeRefCounts:{},isFaceted:H1(t)||(i==null?void 0:i.component.data.isFaceted)&&t.data===void 0},layoutSize:new lo,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?De(o):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){hye(this)}parseProjection(){zL(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){RL(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const s of Y(i)){const o=i[s];o!==void 0&&(r[s]=Et(o))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=Et(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:ht(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,s=Lme(i.layoutHeaders,r);return{padding:t,...this.assembleDefaultLayout(),...n,...s?{titleBand:s}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const i of ir)t[i].title&&n.push(Dme(this,i));for(const i of Ww)n=n.concat(Tme(this,i));return n}assembleAxes(){return yme(this.component.axes,this.config)}assembleLegends(){return LL(this)}assembleProjections(){return s2e(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...YM(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(i.text)return qe(["unit","layer"],this.type)?qe(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),ht(i)?void 0:i}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const i=this.assembleLayout();i&&(n.layout=i),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||Oi(this.parent)?YL(this):[];r.length>0&&(n.scales=r);const s=this.assembleAxes();s.length>0&&(n.axes=s);const o=this.assembleLegends();return o.length>0&&(n.legends=o),n}getName(t){return At((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(Ft[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),i=this.component.data.outputNodeRefCounts;return i[n]=(i[n]||0)+1,n}getSizeSignalRef(t){if(Oi(this.parent)){const n=CL(t),i=T1(n),r=this.component.scales[i];if(r&&!r.merged){const s=r.get("type"),o=r.get("range");if(on(s)&&yu(o)){const a=r.get("name"),u=Am(this,i),l=a6(u);if(l){const c=ne({aggregate:"distinct",field:l},{expr:"datum"});return{signal:EL(a,r,c)}}else return Z(b_(i)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){if(n)return this.getName(t);if(zM(t)&&ms(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t)))return this.scaleNameMap.get(this.getName(t))}projectionName(t){if(t)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getScaleType(t){const n=this.getScaleComponent(t);return n?n.get("type"):void 0}getSelectionComponent(t,n){let i=this.component.selection[t];if(!i&&this.parent&&(i=this.parent.getSelectionComponent(t,n)),!i)throw new Error(_de(n));return i}hasAxisOrientSignalRef(){var t,n;return((t=this.component.axes.x)==null?void 0:t.some(i=>i.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(i=>i.hasOrientSignalRef()))}}class lI extends c6{vgField(t,n={}){const i=this.fieldDef(t);if(i)return ne(i,n)}reduceFieldDef(t,n){return Y0e(this.getMapping(),(i,r,s)=>{const o=Rr(r);return o?t(i,o,s):i},n)}forEachFieldDef(t,n){J_(this.getMapping(),(i,r)=>{const s=Rr(i);s&&t(s,r)},n)}}class $m extends ut{clone(){return new $m(null,De(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=De(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"value",i[1]??"density"];const r=this.transform.resolve??"shared";this.transform.resolve=r}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${He(this.transform)}`}assemble(){const{density:t,...n}=this.transform,i={type:"kde",field:t,...n};return i.resolve=this.transform.resolve,i}}class Sm extends ut{clone(){return new Sm(null,De(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=De(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${He(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class Fm extends ut{clone(){return new Fm(this.parent,De(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=De(n);const{flatten:i,as:r=[]}=this.transform;this.transform.as=i.map((s,o)=>r[o]??s)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${He(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class Dm extends ut{clone(){return new Dm(null,De(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=De(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"key",i[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${He(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class Ic extends ut{clone(){return new Ic(null,De(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let i=0;for(const r of[[Sr,$r],[nr,Fr]]){const s=r.map(o=>{const a=Xt(n.encoding[o]);return J(a)?a.field:_s(a)?{expr:`${a.datum}`}:Nr(a)?{expr:`${a.value}`}:void 0});(s[0]||s[1])&&(t=new Ic(t,s,null,n.getName(`geojson_${i++}`)))}if(n.channelHasField(gi)){const r=n.typedFieldDef(gi);r.type===mc&&(t=new Ic(t,null,r.field,n.getName(`geojson_${i++}`)))}return t}constructor(t,n,i,r){super(t),this.fields=n,this.geojson=i,this.signal=r}dependentFields(){const t=(this.fields??[]).filter(se);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${He(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class Eh extends ut{clone(){return new Eh(null,this.projection,De(this.fields),De(this.as))}constructor(t,n,i,r){super(t),this.projection=n,this.fields=i,this.as=r}static parseAll(t,n){if(!n.projectionName())return t;for(const i of[[Sr,$r],[nr,Fr]]){const r=i.map(o=>{const a=Xt(n.encoding[o]);return J(a)?a.field:_s(a)?{expr:`${a.datum}`}:Nr(a)?{expr:`${a.value}`}:void 0}),s=i[0]===nr?"2":"";(r[0]||r[1])&&(t=new Eh(t,n.projectionName(),r,[n.getName(`x${s}`),n.getName(`y${s}`)]))}return t}dependentFields(){return new Set(this.fields.filter(se))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${He(this.fields)} ${He(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Iu extends ut{clone(){return new Iu(null,De(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:n=0,stop:i,step:r}=t;return{signal:`sequence(${[n,i,...r?[r]:[]].join(",")})`}}static makeFromTransform(t,n){return new Iu(t,n)}static makeFromEncoding(t,n){const i=n.encoding,r=i.x,s=i.y;if(J(r)&&J(s)){const o=r.impute?r:s.impute?s:void 0;if(o===void 0)return;const a=r.impute?s:s.impute?r:void 0,{method:u,value:l,frame:c,keyvals:f}=o.impute,d=wR(n.mark,i);return new Iu(t,{impute:o.field,key:a.field,...u?{method:u}:{},...l!==void 0?{value:l}:{},...c?{frame:c}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${He(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:i,method:r,groupby:s,value:o,frame:a=[null,null]}=this.transform,u={type:"impute",field:t,key:n,...i?{keyvals:Vpe(i)?this.processSequence(i):i}:{},method:"value",...s?{groupby:s}:{},value:!r||r==="value"?o:null};if(r&&r!=="value"){const l={type:"window",as:[`imputed_${t}_value`],ops:[r],fields:[t],frame:a,ignorePeers:!1,...s?{groupby:s}:{}},c={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[u,l,c]}else return[u]}}class Tm extends ut{clone(){return new Tm(null,De(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=De(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${He(this.transform)}`}assemble(){const{loess:t,on:n,...i}=this.transform;return{type:"loess",x:n,y:t,...i}}}class Ch extends ut{clone(){return new Ch(null,De(this.transform),this.secondary)}constructor(t,n,i){super(t),this.transform=n,this.secondary=i}static make(t,n,i,r){const s=n.component.data.sources,{from:o}=i;let a=null;if(Ype(o)){let u=hI(o.data,s);u||(u=new Ru(o.data),s.push(u));const l=n.getName(`lookup_${r}`);a=new yi(u,l,Ft.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[l]=a}else if(Xpe(o)){const u=o.param;i={as:u,...i};let l;try{l=n.getSelectionComponent(At(u),u)}catch{throw new Error(kde(u))}if(a=l.materialized,!a)throw new Error(Ade(u))}return new Ch(t,i,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?oe(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${He({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:oe(this.transform.as)}:{}};else{let n=this.transform.as;se(n)||(Z(Ide),n="_lookup"),t={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class Mm extends ut{clone(){return new Mm(null,De(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=De(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"prob",i[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${He(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class Nm extends ut{clone(){return new Nm(null,De(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=De(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${He(this.transform)}`}assemble(){const{regression:t,on:n,...i}=this.transform;return{type:"regression",x:n,y:t,...i}}}class Rm extends ut{clone(){return new Rm(null,De(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=fs((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${He(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:i,limit:r,op:s}=this.transform;return{type:"pivot",field:t,value:n,...r!==void 0?{limit:r}:{},...s!==void 0?{op:s}:{},...i!==void 0?{groupby:i}:{}}}}class Om extends ut{clone(){return new Om(null,De(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${He(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function cI(e){let t=0;function n(i,r){if(i instanceof Ru&&!i.isGenerator&&!Cc(i.data)&&(e.push(r),r={name:null,source:r.name,transform:[]}),i instanceof In&&(i.parent instanceof Ru&&!r.source?(r.format={...r.format,parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof Nc){r.name||(r.name=`data_${t++}`),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source,e.push(...i.assemble());return}switch((i instanceof xh||i instanceof _h||i instanceof Rc||i instanceof Fc||i instanceof Dc||i instanceof Eh||i instanceof Ir||i instanceof Ch||i instanceof Oc||i instanceof Lu||i instanceof Dm||i instanceof Fm||i instanceof $m||i instanceof Tm||i instanceof Mm||i instanceof Nm||i instanceof va||i instanceof Om||i instanceof Rm||i instanceof Sm)&&r.transform.push(i.assemble()),(i instanceof $s||i instanceof Cs||i instanceof Iu||i instanceof go||i instanceof Ic)&&r.transform.push(...i.assemble()),i instanceof yi&&(r.source&&r.transform.length===0?i.setSource(r.source):i.parent instanceof yi?i.setSource(r.name):(r.name||(r.name=`data_${t++}`),i.setSource(r.name),i.numChildren()===1&&(e.push(r),r={name:null,source:r.name,transform:[]}))),i.numChildren()){case 0:i instanceof yi&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name=`data_${t++}`);let s=r.name;!r.source||r.transform.length>0?e.push(r):s=r.source;for(const o of i.children)n(o,{name:null,source:s,transform:[]});break}}}return n}function yye(e){const t=[],n=cI(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function bye(e,t){const n=[],i=cI(n);let r=0;for(const o of e.sources){o.hasName()||(o.dataName=`source_${r++}`);const a=o.assemble();i(o,a)}for(const o of n)o.transform.length===0&&delete o.transform;let s=0;for(const[o,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(s++,0,n.splice(o,1)[0]);for(const o of n)for(const a of o.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const o of n)o.name in t&&(o.values=t[o.name]);return n}function vye(e){return e==="top"||e==="left"||me(e)?"header":"footer"}function xye(e){for(const t of ir)_ye(e,t);dI(e,"x"),dI(e,"y")}function _ye(e,t){var o;const{facet:n,config:i,child:r,component:s}=e;if(e.channelHasField(t)){const a=n[t],u=Mc("title",null,i,t);let l=xc(a,i,{allowDisabling:!0,includeDefault:u===void 0||!!u});r.component.layoutHeaders[t].title&&(l=W(l)?l.join(", "):l,l+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const c=Mc("labelOrient",a.header,i,t),f=a.header!==null?zt((o=a.header)==null?void 0:o.labels,i.header.labels,!0):!1,d=qe(["bottom","right"],c)?"footer":"header";s.layoutHeaders[t]={title:a.header!==null?l:null,facetFieldDef:a,[d]:t==="facet"?[]:[fI(e,t,f)]}}}function fI(e,t,n){const i=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function dI(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=Yw(r,t),r.axis[t]==="shared"){const s=t==="x"?"column":"row",o=i[s];for(const a of n.component.axes[t]){const u=vye(a.get("orient"));o[u]??(o[u]=[fI(e,s,!1)]);const l=vh(a,"main",e.config,{header:!0});l&&o[u][0].axes.push(l),a.mainExtracted=!0}}}}function wye(e){f6(e),Lm(e,"width"),Lm(e,"height")}function Eye(e){f6(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";Lm(e,t),Lm(e,n)}function f6(e){for(const t of e.children)t.parseLayoutSize()}function Lm(e,t){const n=CL(t),i=T1(n),r=e.component.resolve,s=e.component.layoutSize;let o;for(const a of e.children){const u=a.component.layoutSize.getWithExplicit(n),l=r.scale[i]??AL(i,e);if(l==="independent"&&u.value==="step"){o=void 0;break}if(o){if(l==="independent"&&o.value!==u.value){o=void 0;break}o=ma(o,u,n,"")}else o=u}if(o){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);s.setWithExplicit(t,o)}else s.setWithExplicit(t,{explicit:!1,value:void 0})}function Cye(e){const{size:t,component:n}=e;for(const i of io){const r=mi(i);if(t[r]){const s=t[r];n.layoutSize.set(r,ws(s)?"step":s,!0)}else{const s=kye(e,r);n.layoutSize.set(r,s,!1)}}}function kye(e,t){const n=t==="width"?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const s=r.get("type"),o=r.get("range");if(on(s)){const a=rm(i.view,t);return yu(o)||ws(a)?"step":a}else return cw(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return cw(i.view,t);{const s=rm(i.view,t);return ws(s)?s.step:s}}}function d6(e,t,n){return ne(t,{suffix:`by_${ne(e)}`,...n})}class kh extends lI{constructor(t,n,i,r){super(t,"facet",n,i,r,t.resolve),this.child=y6(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!rh(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=Y(t),i={};for(const r of n){if(![Zs,Js].includes(r)){Z(R1(r,"facet"));break}const s=t[r];if(s.field===void 0){Z(x_(s,r));break}i[r]=this.initFacetFieldDef(s,r)}return i}initFacetFieldDef(t,n){const i=Z_(t,n);return i.header?i.header=yn(i.header):i.header===null&&(i.header=null),i}channelHasField(t){return X(this.facet,t)}fieldDef(t){return this.facet[t]}parseData(){this.component.data=Im(this),this.child.parseData()}parseLayoutSize(){f6(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection,Object.values(this.component.selection).some(t=>ks(t))&&w_(v_)}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),xye(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const n of ir)for(const i of Hw){const r=this.component.layoutHeaders[n],s=r[i],{facetFieldDef:o}=r;if(o){const a=Mc("titleOrient",o.header,this.config,n);if(["right","bottom"].includes(a)){const u=wm(n,a);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[u]="end"}}if(s!=null&&s[0]){const a=n==="row"?"height":"width",u=i==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(t[u]??(t[u]={}),t[u][n]=.5),r.title&&(t.offset??(t.offset={}),t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:n}=this.facet,i=t?this.columnDistinctSignal():n?1:void 0;let r="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(r="none"),{...this.getHeaderLayoutMixins(),...i?{columns:i}:{},bounds:"full",align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof kh))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof kh?{...this.channelHasField("column")?{encode:{update:{columns:{field:ne(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],i=[];if(this.child instanceof kh){if(this.child.channelHasField("column")){const r=ne(this.child.facet.column);t.push(r),n.push("distinct"),i.push(`distinct_${r}`)}}else for(const r of io){const s=this.child.component.scales[r];if(s&&!s.merged){const o=s.get("type"),a=s.get("range");if(on(o)&&yu(a)){const u=Am(this.child,r),l=a6(u);l?(t.push(l),n.push("distinct"),i.push(`distinct_${l}`)):Z(b_(r))}}}return{fields:t,ops:n,as:i}}assembleFacet(){const{name:t,data:n}=this.component.data.facetRoot,{row:i,column:r}=this.facet,{fields:s,ops:o,as:a}=this.getCardinalityAggregateForChild(),u=[];for(const c of ir){const f=this.facet[c];if(f){u.push(ne(f));const{bin:d,sort:h}=f;if(_t(d)&&u.push(ne(f,{binSuffix:"end"})),oo(h)){const{field:p,op:g=W1}=h,m=d6(f,h);i&&r?(s.push(m),o.push("max"),a.push(m)):(s.push(p),o.push(g),a.push(m))}else if(W(h)){const p=Tc(f,c);s.push(p),o.push("max"),a.push(p)}}}const l=!!i&&!!r;return{name:t,data:n,groupby:u,...l||s.length>0?{aggregate:{...l?{cross:l}:{},...s.length?{fields:s,ops:o,as:a}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,i=n[t];return i?oo(i.sort)?[d6(i,i.sort,{expr:"datum"})]:W(i.sort)?[Tc(i,t,{expr:"datum"})]:[ne(i,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,i=n[t];if(i){const{sort:r}=i;return[(oo(r)?r.order:!W(r)&&r)||"ascending"]}return[]}assembleLabelTitle(){var r;const{facet:t,config:n}=this;if(t.facet)return Gw(t.facet,"facet",n);const i={row:["top","bottom"],column:["left","right"]};for(const s of Ww)if(t[s]){const o=Mc("labelOrient",(r=t[s])==null?void 0:r.header,n,s);if(i[s].includes(o))return Gw(t[s],s,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,i=yye(n),r=t.assembleGroupEncodeEntry(!1),s=this.assembleLabelTitle()||t.assembleTitle(),o=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...s?{title:s}:{},...o?{style:o}:{},from:{facet:this.assembleFacet()},sort:{field:ir.map(u=>this.facetSortFields(u)).flat(),order:ir.map(u=>this.facetSortOrder(u)).flat()},...i.length>0?{data:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup(Tge(this,[]))}]}getMapping(){return this.facet}}function Aye(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const s of[n,i])if(oo(s.sort)){const{field:o,op:a=W1}=s.sort;e=r=new Lu(e,{joinaggregate:[{op:a,field:o,as:d6(s,s.sort,{forAs:!0})}],groupby:[ne(s)]})}return r}return null}function hI(e,t){var n,i,r,s;for(const o of t){const a=o.data;if(e.name&&o.hasName()&&e.name!==o.dataName)continue;const u=(n=e.format)==null?void 0:n.mesh,l=(i=a.format)==null?void 0:i.feature;if(u&&l)continue;const c=(r=e.format)==null?void 0:r.feature;if((c||l)&&c!==l)continue;const f=(s=a.format)==null?void 0:s.mesh;if(!((u||f)&&u!==f)){if(lh(e)&&lh(a)){if(Mi(e.values,a.values))return o}else if(Cc(e)&&Cc(a)){if(e.url===a.url)return o}else if(dO(e)&&e.name===o.dataName)return o}}return null}function $ye(e,t){if(e.data||!e.parent){if(e.data===null){const i=new Ru({values:[]});return t.push(i),i}const n=hI(e.data,t);if(n)return ya(e.data)||(n.data.format=AM({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new Ru(e.data);return t.push(i),i}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function Sye(e,t,n){let i=0;for(const r of t.transforms){let s,o;if(sge(r))o=e=new Dc(e,r),s="derived";else if(mw(r)){const a=b2e(r);o=e=In.makeWithAncestors(e,{},a,n)??e,e=new Fc(e,t,r.filter)}else if(rO(r))o=e=$s.makeFromTransform(e,r,t),s="number";else if(age(r))s="date",n.getWithExplicit(r.field).value===void 0&&(e=new In(e,{[r.field]:s}),n.set(r.field,s,!1)),o=e=Cs.makeFromTransform(e,r);else if(uge(r))o=e=Ir.makeFromTransform(e,r),s="number",Tw(t)&&(e=new va(e));else if(iO(r))o=e=Ch.make(e,t,r,i++),s="derived";else if(nge(r))o=e=new Oc(e,r),s="number";else if(ige(r))o=e=new Lu(e,r),s="number";else if(lge(r))o=e=go.makeFromTransform(e,r),s="derived";else if(cge(r))o=e=new Dm(e,r),s="derived";else if(fge(r))o=e=new Sm(e,r),s="derived";else if(rge(r))o=e=new Fm(e,r),s="derived";else if(Kpe(r))o=e=new Rm(e,r),s="derived";else if(tge(r))e=new Om(e,r);else if(oge(r))o=e=Iu.makeFromTransform(e,r),s="derived";else if(Zpe(r))o=e=new $m(e,r),s="derived";else if(Jpe(r))o=e=new Mm(e,r),s="derived";else if(Qpe(r))o=e=new Nm(e,r),s="derived";else if(ege(r))o=e=new Tm(e,r),s="derived";else{Z(Lde(r));continue}if(o&&s!==void 0)for(const a of o.producedFields()??[])n.set(a,s,!1)}return e}function Im(e){var m;let t=$ye(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,o=!(r&&(ya(r)||Cc(r)||lh(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new Ege;ya(r)?(hO(r)?t=new _h(t,r.sequence):vw(r)&&(t=new xh(t,r.graticule)),o.parseNothing=!0):((m=r==null?void 0:r.format)==null?void 0:m.parse)===null&&(o.parseNothing=!0),t=In.makeExplicit(t,e,o)??t,t=new va(t);const a=e.parent&&Lc(e.parent);(Dt(e)||Oi(e))&&a&&(t=$s.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=Sye(t,e,o));const u=x2e(e),l=v2e(e);t=In.makeWithAncestors(t,{},{...u,...l},o)??t,Dt(e)&&(t=Ic.parseAll(t,e),t=Eh.parseAll(t,e)),(Dt(e)||Oi(e))&&(a||(t=$s.makeFromEncoding(t,e)??t),t=Cs.makeFromEncoding(t,e)??t,t=Dc.parseAllForSortIndex(t,e));const c=t=Pm(Ft.Raw,e,t);if(Dt(e)){const y=Ir.makeFromEncoding(t,e);y&&(t=y,Tw(e)&&(t=new va(t))),t=Iu.makeFromEncoding(t,e)??t,t=go.makeFromEncoding(t,e)??t}let f,d;if(Dt(e)){const{markDef:y,mark:b,config:v}=e,x=gt("invalid",y,v),{marks:_,scales:E}=d=gO({invalid:x,isPath:ha(b)});_!==E&&E==="include-invalid-values"&&(f=t=Pm(Ft.PreFilterInvalid,e,t)),_==="exclude-invalid-values"&&(t=Rc.make(t,e,d)??t)}const h=t=Pm(Ft.Main,e,t);let p;if(Dt(e)&&d){const{marks:y,scales:b}=d;y==="include-invalid-values"&&b==="exclude-invalid-values"&&(t=Rc.make(t,e,d)??t,p=t=Pm(Ft.PostFilterInvalid,e,t))}Dt(e)&&gme(e,h);let g=null;if(Oi(e)){const y=e.getName("facet");t=Aye(t,e.facet)??t,g=new Nc(t,e,y,h.getSource()),n[y]=g}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:c,main:h,facetRoot:g,ancestorParse:o,preFilterInvalid:f,postFilterInvalid:p}}function Pm(e,t,n){const{outputNodes:i,outputNodeRefCounts:r}=t.component.data,s=t.getDataName(e),o=new yi(n,s,e,r);return i[s]=o,o}class Fye extends c6{constructor(t,n,i,r){var s,o,a,u;super(t,"concat",n,i,r,t.resolve),(((o=(s=t.resolve)==null?void 0:s.axis)==null?void 0:o.x)==="shared"||((u=(a=t.resolve)==null?void 0:a.axis)==null?void 0:u.y)==="shared")&&Z(Nde),this.children=this.getChildren(t).map((l,c)=>y6(l,this,this.getName(`concat_${c}`),void 0,r))}parseData(){this.component.data=Im(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of Y(t.component.selection))this.component.selection[n]=t.component.selection[n]}Object.values(this.component.selection).some(t=>ks(t))&&w_(v_)}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return im(t)?t.vconcat:lw(t)?t.hconcat:t.concat}parseLayoutSize(){Eye(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=Vw(this);for(const n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{const n=t.assembleTitle(),i=t.assembleGroupStyle(),r=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...i?{style:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}}function Dye(e){return e===!1||e===null}const Tye={disable:1,gridScale:1,scale:1,...gR,labelExpr:1,encode:1},pI=Y(Tye);class h6 extends lo{constructor(t={},n={},i=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=i}clone(){return new h6(De(this.explicit),De(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!Dye(this.get(t))}hasOrientSignalRef(){return me(this.explicit.orient)}}function Mye(e,t,n){const{encoding:i,config:r}=e,s=Xt(i[t])??Xt(i[gs(t)]),o=e.axis(t)||{},{format:a,formatType:u}=o;if(ku(u))return{text:Mr({fieldOrDatumDef:s,field:"datum.value",format:a,formatType:u,config:r}),...n};if(a===void 0&&u===void 0&&r.customFormatTypes){if(bc(s)==="quantitative"){if(vc(s)&&s.stack==="normalize"&&r.normalizedNumberFormatType)return{text:Mr({fieldOrDatumDef:s,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:Mr({fieldOrDatumDef:s,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(bc(s)==="temporal"&&r.timeFormatType&&J(s)&&!s.timeUnit)return{text:Mr({fieldOrDatumDef:s,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function Nye(e){return io.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[Bye(n,e)]),t),{})}const Rye={bottom:"top",top:"bottom",left:"right",right:"left"};function Oye(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const s of Y(r.component.axes))n.axis[s]=Yw(e.component.resolve,s),n.axis[s]==="shared"&&(t[s]=Lye(t[s],r.component.axes[s]),t[s]||(n.axis[s]="independent",delete t[s]))}for(const r of io){for(const s of e.children)if(s.component.axes[r]){if(n.axis[r]==="independent"){t[r]=(t[r]??[]).concat(s.component.axes[r]);for(const o of s.component.axes[r]){const{value:a,explicit:u}=o.getWithExplicit("orient");if(!me(a)){if(i[a]>0&&!u){const l=Rye[a];i[a]>i[l]&&o.set("orient",l,!1)}i[a]++}}}delete s.component.axes[r]}if(n.axis[r]==="independent"&&t[r]&&t[r].length>1)for(const[s,o]of(t[r]||[]).entries())s>0&&o.get("grid")&&!o.explicit.grid&&(o.implicit.grid=!1)}}function Lye(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let i=0;in.clone());return e}function Iye(e,t){for(const n of pI){const i=ma(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,s)=>{switch(n){case"title":return iN(r,s);case"gridScale":return{explicit:r.explicit,value:zt(r.value,s.value)}}return om(r,s,n,"axis")});e.setWithExplicit(n,i)}return e}function Pye(e,t,n,i,r){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(me(n.labelAngle)?n.labelAngle:Xd(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===bL(i,r))return!0}return e===n[t]}const zye=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function Bye(e,t){var y,b;let n=t.axis(e);const i=new h6,r=Xt(t.encoding[e]),{mark:s,config:o}=t,a=(n==null?void 0:n.orient)||((y=o[e==="x"?"axisX":"axisY"])==null?void 0:y.orient)||((b=o.axis)==null?void 0:b.orient)||kme(e),u=t.getScaleComponent(e).get("type"),l=bme(e,u,a,t.config),c=n!==void 0?!n:jw("disable",o.style,n==null?void 0:n.style,l).configValue;if(i.set("disable",c,n!==void 0),c)return i;n=n||{};const f=wme(r,n,e,o.style,l),d=KN(n.formatType,r,u),h=XN(r,r.type,n.format,n.formatType,o,!0),p={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:u,orient:a,labelAngle:f,format:h,formatType:d,mark:s,config:o};for(const v of pI){const x=v in gL?gL[v](p):mR(v)?n[v]:void 0,_=x!==void 0,E=Pye(x,v,n,t,e);if(_&&E)i.set(v,x,E);else{const{configValue:w=void 0,configFrom:C=void 0}=mR(v)&&v!=="values"?jw(v,o.style,n.style,l):{},k=w!==void 0;_&&!k?i.set(v,x,E):(C!=="vgAxisConfig"||zye.has(v)&&k||uh(w)||me(w))&&i.set(v,w,!1)}}const g=n.encoding??{},m=pR.reduce((v,x)=>{if(!i.hasAxisPart(x))return v;const _=kL(g[x]??{},t),E=x==="labels"?Mye(t,e,_):_;return E!==void 0&&!ht(E)&&(v[x]={update:E}),v},{});return ht(m)||i.set("encode",m,!!n.encoding||n.labelAngle!==void 0),i}function Uye({encoding:e,size:t}){for(const n of io){const i=mi(n);ws(t[i])&&ga(e[n])&&(delete t[i],Z(gN(i)))}return t}const jye={vgMark:"arc",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...ti("x",e,{defaultPos:"mid"}),...ti("y",e,{defaultPos:"mid"}),...fo(e,"radius"),...fo(e,"theta")})},qye={vgMark:"area",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...fm("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...fm("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...Fw(e)})},Wye={vgMark:"rect",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...fo(e,"x"),...fo(e,"y")})},Hye={vgMark:"shape",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&J(n)&&n.type===mc?{field:ne(n,{expr:"datum"})}:{}}]}},Gye={vgMark:"image",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...fo(e,"x"),...fo(e,"y"),...$w(e,"url")})},Vye={vgMark:"line",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...ti("x",e,{defaultPos:"mid"}),...ti("y",e,{defaultPos:"mid"}),...vn("size",e,{vgChannel:"strokeWidth"}),...Fw(e)})},Yye={vgMark:"trail",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...ti("x",e,{defaultPos:"mid"}),...ti("y",e,{defaultPos:"mid"}),...vn("size",e),...Fw(e)})};function p6(e,t){const{config:n}=e;return{...rr(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...ti("x",e,{defaultPos:"mid"}),...ti("y",e,{defaultPos:"mid"}),...vn("size",e),...vn("angle",e),...Xye(e,n,t)}}function Xye(e,t,n){return n?{shape:{value:n}}:vn("shape",e)}const Kye={vgMark:"symbol",encodeEntry:e=>p6(e)},Zye={vgMark:"symbol",encodeEntry:e=>p6(e,"circle")},Jye={vgMark:"symbol",encodeEntry:e=>p6(e,"square")},Qye={vgMark:"rect",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...fo(e,"x"),...fo(e,"y")})},ebe={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...rr(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...fm("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...fm("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...vn("size",e,{vgChannel:"strokeWidth"})}}},tbe={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...rr(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...ti("x",e,{defaultPos:"mid"}),...ti("y",e,{defaultPos:"mid"}),...$w(e),...vn("size",e,{vgChannel:"fontSize"}),...vn("angle",e),...IO("align",nbe(e.markDef,n,t)),...IO("baseline",ibe(e.markDef,n,t)),...ti("radius",e,{defaultPos:null}),...ti("theta",e,{defaultPos:null})}}};function nbe(e,t,n){if(gt("align",e,n)===void 0)return"center"}function ibe(e,t,n){if(gt("baseline",e,n)===void 0)return"middle"}const zm={arc:jye,area:qye,bar:Wye,circle:Zye,geoshape:Hye,image:Gye,line:Vye,point:Kye,rect:Qye,rule:ebe,square:Jye,text:tbe,tick:{vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r=i==="horizontal"?"x":"y",s=i==="horizontal"?"y":"x",o=i==="horizontal"?"height":"width";return{...rr(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...fo(e,r),...ti(s,e,{defaultPos:"mid",vgChannel:s==="y"?"yc":"xc"}),[o]:Et(gt("thickness",n,t))}}},trail:Yye};function rbe(e){if(qe([B1,P1,l0e],e.mark)){const t=wR(e.mark,e.encoding);if(t.length>0)return sbe(e,t)}else if(e.mark===z1){const t=g_.some(n=>gt(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return obe(e)}return g6(e)}const gI="faceted_path_";function sbe(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:gI+e.requestDataName(Ft.Main),data:e.requestDataName(Ft.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:g6(e,{fromPrefix:gI})}]}const mI="stack_group_";function obe(e){var l;const[t]=g6(e,{fromPrefix:mI}),n=e.scaleName(e.stack.fieldChannel),i=(c={})=>e.vgField(e.stack.fieldChannel,c),r=(c,f)=>{const d=[i({prefix:"min",suffix:"start",expr:f}),i({prefix:"max",suffix:"start",expr:f}),i({prefix:"min",suffix:"end",expr:f}),i({prefix:"max",suffix:"end",expr:f})];return`${c}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let s,o;e.stack.fieldChannel==="x"?(s={...uc(t.encode.update,["y","yc","y2","height",...g_]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},o={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...hi(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(s={...uc(t.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},o={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...hi(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const c of g_){const f=ys(c,e.markDef,e.config);t.encode.update[c]?(s[c]=t.encode.update[c],delete t.encode.update[c]):f&&(s[c]=Et(f)),f&&(t.encode.update[c]={value:0})}const a=[];if(((l=e.stack.groupbyChannels)==null?void 0:l.length)>0)for(const c of e.stack.groupbyChannels){const f=e.fieldDef(c),d=ne(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(ne(f,{binSuffix:"end"}))}return s=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((c,f)=>{if(t.encode.update[f])return{...c,[f]:t.encode.update[f]};{const d=ys(f,e.markDef,e.config);return d!==void 0?{...c,[f]:Et(d)}:c}},s),s.stroke&&(s.strokeForeground={value:!0},s.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Ft.Main),name:mI+e.requestDataName(Ft.Main),groupby:a,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:s},marks:[{type:"group",encode:{update:o},marks:[t]}]}]}function abe(e){const{encoding:t,stack:n,mark:i,markDef:r,config:s}=e,o=t.order;if(!(!W(o)&&Nr(o)&&Jx(o.value)||!o&&Jx(gt("order",r,s)))){if((W(o)||J(o))&&!n)return eN(o,{expr:"datum"});if(ha(i)){const a=r.orient==="horizontal"?"y":"x",u=t[a];if(J(u))return{field:a}}}}function g6(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:s}=e,o=zt(i.clip,ube(e),lbe(e)),a=JM(i),u=r.key,l=abe(e),c=cbe(e),f=gt("aria",i,s),d=zm[n].postEncodingTransform?zm[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:zm[n].vgMark,...o?{clip:o}:{},...a?{style:a}:{},...u?{key:u.field}:{},...l?{sort:l}:{},...c||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(Ft.Main)},encode:{update:zm[n].encodeEntry(e)},...d?{transform:d}:{}}]}function ube(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t!=null&&t.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function lbe(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function cbe(e){if(!e.component.selection)return null;const t=Y(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=Y(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class yI extends lI{constructor(t,n,i,r={},s){super(t,"unit",n,i,s,void 0,BR(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[],this.correctDataNames=l=>{var c,f,d;return(c=l.from)!=null&&c.data&&(l.from.data=this.lookupDataSource(l.from.data),"time"in this.encoding&&(l.from.data=l.from.data+xO)),(d=(f=l.from)==null?void 0:f.facet)!=null&&d.data&&(l.from.facet.data=this.lookupDataSource(l.from.facet.data)),l};const o=xs(t.mark)?{...t.mark}:{type:t.mark},a=o.type;o.filled===void 0&&(o.filled=zpe(o,s,{graticule:t.data&&vw(t.data)}));const u=this.encoding=G0e(t.encoding||{},a,o.filled,s);this.markDef=XR(o,u,s),this.size=Uye({encoding:u,size:BR(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=YR(this.markDef,u),this.specifiedScales=this.initScales(a,u),this.specifiedAxes=this.initAxes(u),this.specifiedLegends=this.initLegends(u),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(l=>aw(l))}get hasProjection(){const{encoding:t}=this,n=this.mark===UN,i=t&&qfe.some(r=>Ne(t[r]));return n||i}scaleDomain(t){const n=this.specifiedScales[t];return n?n.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,n){return d_.reduce((i,r)=>{const s=Xt(n[r]);return s&&(i[r]=this.initScale(s.scale??{})),i},{})}initScale(t){const{domain:n,range:i}=t,r=yn(t);return W(n)&&(r.domain=n.map(Ni)),W(i)&&(r.range=i.map(Ni)),r}initAxes(t){return io.reduce((n,i)=>{const r=t[i];if(Ne(r)||i===$t&&Ne(t.x2)||i===rn&&Ne(t.y2)){const s=Ne(r)?r.axis:void 0;n[i]=s&&this.initAxis({...s})}return n},{})}initAxis(t){const n=Y(t),i={};for(const r of n){const s=t[r];i[r]=uh(s)?XM(s):Ni(s)}return i}initLegends(t){return ede.reduce((n,i)=>{const r=Xt(t[i]);if(r&&nde(i)){const s=r.legend;n[i]=s&&yn(s)}return n},{})}parseData(){this.component.data=Im(this)}parseLayoutSize(){Cye(this)}parseSelections(){this.component.selection=pme(this,this.selection)}parseMarkGroup(){this.component.mark=rbe(this)}parseAxesAndHeaders(){this.component.axes=Nye(this)}assembleSelectionTopLevelSignals(t){return Mge(this,t)}assembleSignals(){return[...hL(this),...Dge(this,[])]}assembleSelectionData(t){return Nge(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return Vw(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!Lc(this.parent))&&(t=CO(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return t!==void 0?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return $u(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return Rr(n)}typedFieldDef(t){const n=this.fieldDef(t);return ei(n)?n:null}}class m6 extends c6{constructor(t,n,i,r,s){super(t,"layer",n,i,s,t.resolve,t.view);const o={...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((a,u)=>{if(sm(a))return new m6(a,this,this.getName(`layer_${u}`),o,s);if(ao(a))return new yI(a,this,this.getName(`layer_${u}`),o,s);throw new Error(y_(a))})}parseData(){this.component.data=Im(this);for(const t of this.children)t.parseData()}parseLayoutSize(){wye(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of Y(t.component.selection))this.component.selection[n]=t.component.selection[n]}Object.values(this.component.selection).some(t=>ks(t))&&w_(v_)}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){Oye(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),hL(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),Vw(this))}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleGroupStyle(){const t=new Set;for(const i of this.children)for(const r of oe(i.assembleGroupStyle()))t.add(r);const n=Array.from(t);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const n of this.children)if(t=n.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return Rge(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),LL(this))}}function y6(e,t,n,i,r){if(H1(e))return new kh(e,t,n,r);if(sm(e))return new m6(e,t,n,i,r);if(ao(e))return new yI(e,t,n,i,r);if(gpe(e))return new Fye(e,t,n,r);throw new Error(y_(e))}function fbe(e,t={}){t.logger&&Ehe(t.logger),t.fieldTitle&&cR(t.fieldTitle);try{const n=GR(nl(t.config,e.config)),i=uO(e,n),r=y6(i,null,"",void 0,n);return r.parse(),L2e(r.component.data,r),{spec:hbe(r,dbe(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&Che(),t.fieldTitle&&P0e()}}function dbe(e,t,n,i){const r=i.component.layoutSize.get("width"),s=i.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):se(t)&&(t={type:t}),r&&s&&xge(t.type)){if(r==="step"&&s==="step")Z(oN()),t.type="pad";else if(r==="step"||s==="step"){const o=r==="step"?"width":"height";Z(oN(T1(o)));const a=o==="width"?"height":"width";t.type=_ge(a)}}return{...Y(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...cO(n,!1),...cO(e,!0)}}function hbe(e,t,n={},i){const r=e.config?$pe(e.config):void 0,s=bye(e.component.data,n),o=e.assembleSelectionData(s),a=e.assembleProjections(),u=e.assembleTitle(),l=e.assembleGroupStyle(),c=e.assembleGroupEncodeEntry(!0);let f=e.assembleLayoutSignals();f=f.filter(p=>(p.name==="width"||p.name==="height")&&p.value!==void 0?(t[p.name]=+p.value,!1):!0);const{params:d,...h}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...h,...u?{title:u}:{},...l?{style:l}:{},...c?{encode:{update:c}}:{},data:o,...a.length>0?{projections:a}:{},...e.assembleGroup([...f,...e.assembleSelectionTopLevelSignals([]),...PR(d)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const pbe=Ife.version,gbe=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:fc,accessPathWithDatum:i_,accessWithDatumToUnescapedPath:at,compile:fbe,contains:qe,deepEqual:Mi,deleteNestedProperty:C1,duplicate:De,entries:ia,every:Qx,fieldIntersection:n_,flatAccessWithDatum:SM,getFirstDefined:zt,hasIntersection:e_,hasProperty:X,hash:He,internalField:TM,isBoolean:Gd,isEmpty:ht,isEqual:zfe,isInternalField:MM,isNullOrFalse:Jx,isNumeric:k1,keys:Y,logicalExpr:Vd,mergeDeep:AM,never:kM,normalize:uO,normalizeAngle:Xd,omit:hi,pick:uc,prefixGenerator:t_,removePathFromField:cc,replaceAll:du,replacePathInField:er,resetIdCounter:Ufe,setEqual:$M,some:lc,stringify:pt,titleCase:Yd,unique:fs,uniqueId:DM,vals:gn,varName:At,version:pbe},Symbol.toStringTag,{value:"Module"}));function bI(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var mbe="2.15.0",ybe={version:mbe};const Pc="#fff",vI="#888",bbe={background:"#333",view:{stroke:vI},title:{color:Pc,subtitleColor:Pc},style:{"guide-label":{fill:Pc},"guide-title":{fill:Pc}},axis:{domainColor:Pc,gridColor:vI,tickColor:Pc}},Pu="#4572a7",vbe={background:"#fff",arc:{fill:Pu},area:{fill:Pu},line:{stroke:Pu,strokeWidth:2},path:{stroke:Pu},rect:{fill:Pu},shape:{stroke:Pu},symbol:{fill:Pu,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},zu="#30a2da",b6="#cbcbcb",xbe="#999",_be="#333",xI="#f0f0f0",_I="#333",wbe={arc:{fill:zu},area:{fill:zu},axis:{domainColor:b6,grid:!0,gridColor:b6,gridWidth:1,labelColor:xbe,labelFontSize:10,titleColor:_be,tickColor:b6,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:xI,group:{fill:xI},legend:{labelColor:_I,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:_I,titleFontSize:14,titlePadding:10},line:{stroke:zu,strokeWidth:2},path:{stroke:zu,strokeWidth:.5},rect:{fill:zu},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:zu},bar:{binSpacing:2,fill:zu,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Bu="#000",Ebe={group:{fill:"#e5e5e5"},arc:{fill:Bu},area:{fill:Bu},line:{stroke:Bu},path:{stroke:Bu},rect:{fill:Bu},shape:{stroke:Bu},symbol:{fill:Bu,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},Cbe=22,kbe="normal",wI="Benton Gothic, sans-serif",EI=11.5,Abe="normal",Uu="#82c6df",v6="Benton Gothic Bold, sans-serif",CI="normal",kI=13,Ah={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"]},$be={background:"#ffffff",title:{anchor:"start",color:"#000000",font:v6,fontSize:Cbe,fontWeight:kbe},arc:{fill:Uu},area:{fill:Uu},line:{stroke:Uu,strokeWidth:2},path:{stroke:Uu},rect:{fill:Uu},shape:{stroke:Uu},symbol:{fill:Uu,size:30},axis:{labelFont:wI,labelFontSize:EI,labelFontWeight:Abe,titleFont:v6,titleFontSize:kI,titleFontWeight:CI},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:wI,labelFontSize:EI,symbolType:"square",titleFont:v6,titleFontSize:kI,titleFontWeight:CI},range:{category:Ah["category-6"],diverging:Ah["fireandice-6"],heatmap:Ah["fire-7"],ordinal:Ah["fire-7"],ramp:Ah["fire-7"]}},ju="#ab5787",Bm="#979797",Sbe={background:"#f9f9f9",arc:{fill:ju},area:{fill:ju},line:{stroke:ju},path:{stroke:ju},rect:{fill:ju},shape:{stroke:ju},symbol:{fill:ju,size:30},axis:{domainColor:Bm,domainWidth:.5,gridWidth:.2,labelColor:Bm,tickColor:Bm,tickWidth:.2,titleColor:Bm},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},qu="#3e5c69",Fbe={background:"#fff",arc:{fill:qu},area:{fill:qu},line:{stroke:qu},path:{stroke:qu},rect:{fill:qu},shape:{stroke:qu},symbol:{fill:qu},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},sr="#1696d2",AI="#000000",Dbe="#FFFFFF",Um="Lato",x6="Lato",Tbe="Lato",Mbe="#DEDDDD",Nbe=18,$h={"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},Rbe={background:Dbe,title:{anchor:"start",fontSize:Nbe,font:Um},axisX:{domain:!0,domainColor:AI,domainWidth:1,grid:!1,labelFontSize:12,labelFont:x6,labelAngle:0,tickColor:AI,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:Um},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:Mbe,gridWidth:1,labelFontSize:12,labelFont:x6,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:Um,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:x6,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:Um,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:$h["six-groups-cat-1"],diverging:$h["diverging-colors"],heatmap:$h["diverging-colors"],ordinal:$h["six-groups-seq"],ramp:$h["shades-blue"]},area:{fill:sr},rect:{fill:sr},line:{color:sr,stroke:sr,strokeWidth:5},trail:{color:sr,stroke:sr,strokeWidth:0,size:1},path:{stroke:sr,strokeWidth:.5},point:{filled:!0},text:{font:Tbe,color:sr,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:sr,stroke:null}},arc:{fill:sr},shape:{stroke:sr},symbol:{fill:sr,size:30}},Wu="#3366CC",$I="#ccc",jm="Arial, sans-serif",Obe={arc:{fill:Wu},area:{fill:Wu},path:{stroke:Wu},rect:{fill:Wu},shape:{stroke:Wu},symbol:{stroke:Wu},circle:{fill:Wu},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:jm,fontSize:12},"guide-title":{font:jm,fontSize:12},"group-title":{font:jm,fontSize:12}},title:{font:jm,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:$I,tickColor:$I,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},_6=e=>e*(1/3+1),SI=_6(9),FI=_6(10),DI=_6(12),Sh="Segoe UI",TI="wf_standard-font, helvetica, arial, sans-serif",MI="#252423",Fh="#605E5C",NI="transparent",Lbe="#C8C6C4",zr="#118DFF",Ibe="#12239E",Pbe="#E66C37",zbe="#6B007B",Bbe="#E044A7",Ube="#744EC2",jbe="#D9B300",qbe="#D64550",RI=zr,OI="#DEEFFF",LI=[OI,RI],Wbe={view:{stroke:NI},background:NI,font:Sh,header:{titleFont:TI,titleFontSize:DI,titleColor:MI,labelFont:Sh,labelFontSize:FI,labelColor:Fh},axis:{ticks:!1,grid:!1,domain:!1,labelColor:Fh,labelFontSize:SI,titleFont:TI,titleColor:MI,titleFontSize:DI,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:Lbe,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:zr},line:{stroke:zr,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:Sh,fontSize:SI,fill:Fh},arc:{fill:zr},area:{fill:zr,line:!0,opacity:.6},path:{stroke:zr},rect:{fill:zr},point:{fill:zr,filled:!0,size:75},shape:{stroke:zr},symbol:{fill:zr,strokeWidth:1.5,size:50},legend:{titleFont:Sh,titleFontWeight:"bold",titleColor:Fh,labelFont:Sh,labelFontSize:FI,labelColor:Fh,symbolType:"circle",symbolSize:75},range:{category:[zr,Ibe,Pbe,zbe,Bbe,Ube,jbe,qbe],diverging:LI,heatmap:LI,ordinal:[OI,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",RI]}},w6='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',Hbe='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',E6=400,qm={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},Gbe=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],Vbe=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function Wm({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",i=qm.gridBg[e],r=qm.textPrimary[e],s=qm.textSecondary[e],o=n==="dark"?Gbe:Vbe,a=n==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:a},area:{fill:a},path:{stroke:a},rect:{fill:a},shape:{stroke:a},symbol:{stroke:a},circle:{fill:a},view:{fill:i,stroke:i},group:{fill:i},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:w6,fontWeight:600},axis:{labelColor:s,labelFontSize:12,labelFont:Hbe,labelFontWeight:E6,titleColor:r,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:qm.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:w6,fill:s,fontWeight:E6},"guide-title":{font:w6,fill:s,fontWeight:E6}},range:{category:o,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const Ybe=Wm({theme:"white",background:"#ffffff"}),Xbe=Wm({theme:"g10",background:"#f4f4f4"}),Kbe=Wm({theme:"g90",background:"#262626"}),Zbe=Wm({theme:"g100",background:"#161616"}),Jbe=ybe.version,Qbe=Object.freeze(Object.defineProperty({__proto__:null,carbong10:Xbe,carbong100:Zbe,carbong90:Kbe,carbonwhite:Ybe,dark:bbe,excel:vbe,fivethirtyeight:wbe,ggplot2:Ebe,googlecharts:Obe,latimes:$be,powerbi:Wbe,quartz:Sbe,urbaninstitute:Rbe,version:Jbe,vox:Fbe},Symbol.toStringTag,{value:"Module"}));function e3e(e,t,n,i){if(W(e))return`[${e.map(r=>t(se(r)?r:II(r,n))).join(", ")}]`;if(re(e)){let r="";const{title:s,image:o,...a}=e;s&&(r+=`

${t(s)}

`),o&&(r+=``);const u=Object.keys(a);if(u.length>0){r+="";for(const l of u){let c=a[l];c!==void 0&&(re(c)&&(c=II(c,n)),r+=``)}r+="
${t(l)}${t(c)}
"}return r||"{}"}return t(e)}function t3e(e){const t=[];return function(n,i){if(typeof i!="object"||i===null)return i;const r=t.indexOf(this)+1;return t.length=r,t.length>e?"[Object]":t.indexOf(i)>=0?"[Circular]":(t.push(i),i)}}function II(e,t){return JSON.stringify(e,t3e(t))}var n3e=`#vg-tooltip-element { +`&&++j;else{if(mh(i.charCodeAt(0)))break;e+=i}return t!==""&&nt({},an,xn),{type:hh,value:e,octal:s,start:n,end:j}}function X1e(e,t){let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,r)=>{if(parseInt(r,16)<=1114111)return"x";nt({},Mw)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{nt({},Mw)}try{return new RegExp(e,t)}catch{return null}}function K1e(){var e,t,n,i,r;for(e=ge[j],ym(e==="/","Regular expression literal must start with a slash"),t=ge[j++],n=!1,i=!1;j=0&&nt({},Mw,n),{value:n,literal:t}}function J1e(){var e,t,n,i;return ct=null,JO(),e=j,t=K1e(),n=Z1e(),i=X1e(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:j}}function Q1e(e){return e.type===Tu||e.type===ba||e.type===gm||e.type===mm}function tL(){if(JO(),j>=On)return{type:dh,start:j,end:j};const e=ge.charCodeAt(j);return yh(e)?H1e():e===40||e===41||e===59?Lw():e===39||e===34?Y1e():e===46?po(ge.charCodeAt(j+1))?eL():Lw():po(e)?eL():Lw()}function vi(){const e=ct;return j=e.end,ct=tL(),j=e.end,e}function nL(){const e=j;ct=tL(),j=e}function eme(e){const t=new Lr(E1e);return t.elements=e,t}function iL(e,t,n){const i=new Lr(e==="||"||e==="&&"?S1e:C1e);return i.operator=e,i.left=t,i.right=n,i}function tme(e,t){const n=new Lr(k1e);return n.callee=e,n.arguments=t,n}function nme(e,t,n){const i=new Lr(A1e);return i.test=e,i.consequent=t,i.alternate=n,i}function Iw(e){const t=new Lr(KO);return t.name=e,t}function bh(e){const t=new Lr($1e);return t.value=e.value,t.raw=ge.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function rL(e,t,n){const i=new Lr(F1e);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function ime(e){const t=new Lr(D1e);return t.properties=e,t}function sL(e,t,n){const i=new Lr(T1e);return i.key=t,i.value=n,i.kind=e,i}function rme(e,t){const n=new Lr(M1e);return n.operator=e,n.argument=t,n.prefix=!0,n}function nt(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,o)=>(ym(o":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function mme(){var e,t,n,i,r,s,o,a,u,l;if(e=ct,u=xm(),i=ct,r=uL(i),r===0)return u;for(i.prec=r,vi(),t=[e,ct],o=xm(),s=[u,i,o];(r=uL(ct))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,u=s.pop(),t.pop(),n=iL(a,u,o),s.push(n);i=vi(),i.prec=r,s.push(i),t.push(ct),n=xm(),s.push(n)}for(l=s.length-1,n=s[l],t.pop();l>1;)t.pop(),n=iL(s[l-1].value,s[l-2],n),l-=2;return n}function Nu(){var e,t,n;return e=mme(),Ct("?")&&(vi(),t=Nu(),Ln(":"),n=Nu(),e=nme(e,t,n)),e}function zw(){const e=Nu();if(Ct(","))throw new Error(ph);return e}function yme(e){ge=e,j=0,On=ge.length,ct=null,nL();const t=zw();if(ct.type!==dh)throw new Error("Unexpect token after expression.");return t}function Bw(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...Bw(e.object)),t.push(...Bw(e.property))),t)}function lL(e){return e.object.type==="MemberExpression"?lL(e.object):e.object.name==="datum"}function cL(e){const t=yme(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&lL(i)&&n.add(Bw(i).slice(1).join("."))}),n}class Fc extends lt{clone(){return new Fc(null,this.model,De(this.filter))}constructor(t,n,i){super(t),this.model=n,this.filter=i,this.expr=_m(this.model,this.filter,this),this._dependentFields=cL(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function bme(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;let r=0;for(const s of t){const o=At(s.name),a=s.select,u=se(a)?a:a.type,l=re(a)?De(a):{type:u},c=i[u];for(const h in c)h==="fields"||h==="encodings"||(h==="mark"&&(l.mark={...c.mark,...l.mark}),(l[h]===void 0||l[h]===!0)&&(l[h]=De(c[h]??l[h])));const f=n[o]={...l,name:o,type:u,init:s.value,bind:s.bind,events:se(l.on)?ta(l.on,"scope"):oe(De(l.on))};if(ks(f)&&(r++,r>1)){delete n[o];continue}const d=De(s);for(const h of pm)h.defined(f)&&h.parse&&h.parse(e,f,d)}return r>1&&Z(Rde),n}function fL(e,t,n,i="datum"){const r=se(t)?t:t.param,s=At(r),o=Q(s+Fu);let a;try{a=e.getSelectionComponent(s,r)}catch{return`!!${s}`}if(a.project.timeUnit){const d=n??e.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const u=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",l=a.resolve==="global"?")":`, ${Q(a.resolve)})`,c=`${u}${o}, ${i}${l}`,f=`length(data(${o}))`;return t.empty===!1?`${f} && ${c}`:`!${f} || ${c}`}function dL(e,t,n){const i=At(t),r=n.encoding;let s=n.field,o;try{o=e.getSelectionComponent(i,t)}catch{return i}if(!r&&!s)s=o.project.items[0].field,o.project.items.length>1&&Z(Ode(s));else if(r&&!s){const a=o.project.items.filter(u=>u.channel===r);!a.length||a.length>1?(s=o.project.items[0].field,Z(Lde(a,r,n,s))):s=a[0].field}return`${o.name}[${Q(er(s))}]`}function vme(e,t){for(const[n,i]of ia(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new yi(new Fc(t,e,{param:n}),r,Ft.Lookup,e.component.data.outputNodeRefCounts)}}function _m(e,t,n){return Vd(t,i=>se(i)?i:Hhe(i)?fL(e,i,n):DN(i))}function xme(e,t){if(e)return W(e)&&!da(e)?e.map(n=>K_(n,t)).join(", "):e}function Uw(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function vh(e,t,n,i={header:!1}){var f,d;const{disable:r,orient:s,scale:o,labelExpr:a,title:u,zindex:l,...c}=e.combine();if(!r){for(const h in c){const p=h,g=V0e[p],m=c[p];if(g&&g!==t&&g!=="both")delete c[p];else if(uh(m)){const{condition:y,...b}=m,v=oe(y),x=hR[p];if(x){const{vgProp:_,part:E}=x,w=[...v.map(C=>{const{test:k,...S}=C;return{test:_m(null,k),...S}}),b];Uw(c,E,_,w),delete c[p]}else if(x===null){const _={signal:v.map(E=>{const{test:w,...C}=E;return`${_m(null,w)} ? ${ZM(C)} : `}).join("")+ZM(b)};c[p]=_}}else if(me(m)){const y=hR[p];if(y){const{vgProp:b,part:v}=y;Uw(c,v,b,m),delete c[p]}}We(["labelAlign","labelBaseline"],p)&&c[p]===null&&delete c[p]}if(t==="grid"){if(!c.grid)return;if(c.encode){const{grid:h}=c.encode;c.encode={...h?{grid:h}:{}},ht(c.encode)&&delete c.encode}return{scale:o,orient:s,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:zt(l,0)}}else{if(!i.header&&e.mainExtracted)return;if(a!==void 0){let p=a;(d=(f=c.encode)==null?void 0:f.labels)!=null&&d.update&&me(c.encode.labels.update.text)&&(p=du(a,"datum.label",c.encode.labels.update.text.signal)),Uw(c,"labels","text",{signal:p})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(const p of pR)e.hasAxisPart(p)||delete c.encode[p];ht(c.encode)&&delete c.encode}const h=xme(u,n);return{scale:o,orient:s,grid:!1,...h?{title:h}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:zt(l,0)}}}}function hL(e){const{axes:t}=e.component,n=[];for(const i of io)if(t[i]){for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const s=i==="x"?"height":"width",o=e.getSizeSignalRef(s).signal;s!==o&&n.push({name:s,update:o})}}return n}function _me(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>vh(r,"grid",t)),...i.map(r=>vh(r,"grid",t)),...n.map(r=>vh(r,"main",t)),...i.map(r=>vh(r,"main",t))].filter(r=>r)}function pL(e,t,n,i){return Object.assign.apply(null,[{},...e.map(r=>{if(r==="axisOrient"){const s=n==="x"?"bottom":"left",o=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},u=new Set([...Y(o),...Y(a)]),l={};for(const c of u.values())l[c]={signal:`${i.signal} === "${s}" ? ${Dr(o[c])} : ${Dr(a[c])}`};return l}return t[r]})])}function wme(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:ON(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],s=e==="x"?"axisX":"axisY",o=me(n)?"axisOrient":`axis${Yd(n)}`,a=[...r,...r.map(l=>s+l.substr(4))],u=["axis",o,s];return{vlOnlyAxisConfig:pL(a,i,e,n),vgAxisConfig:pL(u,i,e,n),axisConfigStyle:Eme([...u,...a],i)}}function Eme(e,t){var i;const n=[{}];for(const r of e){let s=(i=t[r])==null?void 0:i.style;if(s){s=oe(s);for(const o of s)n.push(t.style[o])}}return Object.assign.apply(null,n)}function jw(e,t,n,i={}){var s;const r=QM(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const o of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((s=i[o])==null?void 0:s[e])!==void 0)return{configFrom:o,configValue:i[o][e]};return{}}const gL={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??Cme(n,e),gridScale:({model:e,channel:t})=>kme(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||yL(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||mL(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??$me(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??Sme(t.type,n,J(t)&&!!t.timeUnit,J(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{const s=e==="x"?"width":e==="y"?"height":void 0,o=s?t.getSizeSignalRef(s):void 0;return n.tickCount??Dme({fieldOrDatumDef:i,scaleType:r,size:o,values:n.values})},tickMinStep:Tme,title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=bL(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),s=n==="x"?"x2":"y2",o=t.fieldDef(s);return tN(r?[tR(r)]:[],J(o)?[tR(o)]:[])},values:({axis:e,fieldOrDatumDef:t})=>Mme(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??Nme(n,t)};function Cme(e,t){return!on(e)&&J(t)&&!_t(t==null?void 0:t.bin)&&!mn(t==null?void 0:t.bin)}function kme(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function Ame(e,t,n,i,r){const s=t==null?void 0:t.labelAngle;if(s!==void 0)return me(s)?s:Xd(s);{const{configValue:o}=jw("labelAngle",i,t==null?void 0:t.style,r);return o!==void 0?Xd(o):n===$t&&We([R_,N_],e.type)&&!(J(e)&&e.timeUnit)?270:void 0}}function qw(e){return`(((${e.signal} % 360) + 360) % 360)`}function mL(e,t,n,i){if(e!==void 0)if(n==="x"){if(me(e)){const r=qw(e),s=me(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${r} && ${r} < 135) || (225 < ${r} && ${r} < 315) ? "middle" :(${r} <= 45 || 315 <= ${r}) === ${s} ? "bottom" : "top"`}}if(45{if(Au(i)&&eR(i.sort)){const{field:s,timeUnit:o}=i,a=i.sort,u=a.map((l,c)=>`${DN({field:s,timeUnit:o,equal:l})} ? ${c} : `).join("")+a.length;t=new Dc(t,{calculate:u,as:Tc(i,r,{forAs:!0})})}}),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${He(this.transform)}`}}function Tc(e,t,n){return ne(e,{prefix:t,suffix:"sort_index",...n})}function wm(e,t){return We(["top","bottom"],t)?"column":We(["left","right"],t)||e==="row"?"row":"column"}function Mc(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return zt((t||{})[e],r[e],n.header[e])}function Em(e,t,n,i){const r={};for(const s of e){const o=Mc(s,t||{},n,i);o!==void 0&&(r[s]=o)}return r}const Ww=["row","column"],Hw=["header","footer"];function Rme(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:s,titleAngle:o,titleOrient:a}=Em(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),u=wm(t,a),l=Xd(o);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...xL(l,u),...vL(u,l,s),..._L(i,r,t,ppe,RR)}}}function vL(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=yL(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function xL(e,t){const n=mL(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function Ome(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of Hw)if(n[r])for(const s of n[r]){const o=Ime(e,t,r,n,s);o!=null&&i.push(o)}return i}function Lme(e,t){const{sort:n}=e;return oo(n)?{field:ne(n,{expr:"datum"}),order:n.order??"ascending"}:W(n)?{field:Tc(e,t,{expr:"datum"}),order:"ascending"}:{field:ne(e,{expr:"datum"}),order:n??"ascending"}}function Gw(e,t,n){const{format:i,formatType:r,labelAngle:s,labelAnchor:o,labelOrient:a,labelExpr:u}=Em(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=H_({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=wm(t,a);return{text:{signal:u?du(du(u,"datum.label",l),"datum.value",ne(e,{expr:"parent"})):l},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...xL(s,c),...vL(c,s,o),..._L(n,e,t,gpe,OR)}}function Ime(e,t,n,i,r){if(r){let s=null;const{facetFieldDef:o}=i,a=e.config?e.config:void 0;if(o&&r.labels){const{labelOrient:f}=Em(["labelOrient"],o.header,a,t);(t==="row"&&!We(["top","bottom"],f)||t==="column"&&!We(["left","right"],f))&&(s=Gw(o,t,a))}const u=Oi(e)&&!rh(e.facet),l=r.axes,c=(l==null?void 0:l.length)>0;if(s||c){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...i.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:Lme(o,t)}:{},...c&&u?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...s?{title:s}:{},...r.sizeSignal?{encode:{update:{[f]:r.sizeSignal}}}:{},...c?{axes:l}:{}}}}return null}const Pme={column:{start:0,end:1},row:{start:1,end:0}};function zme(e,t){return Pme[t][e]}function Bme(e,t){const n={};for(const i of ir){const r=e[i];if(r!=null&&r.facetFieldDef){const{titleAnchor:s,titleOrient:o}=Em(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=wm(i,o),u=zme(s,a);u!==void 0&&(n[a]=u)}}return ht(n)?void 0:n}function _L(e,t,n,i,r){const s={};for(const o of i){if(!r[o])continue;const a=Mc(o,t==null?void 0:t.header,e,n);a!==void 0&&(s[r[o]]=a)}return s}function Vw(e){return[...Cm(e,"width"),...Cm(e,"height"),...Cm(e,"childWidth"),...Cm(e,"childHeight")]}function Cm(e,t){const n=t==="width"?"x":"y",i=e.component.layoutSize.get(t);if(!i||i==="merged")return[];const r=e.getSizeSignalRef(t).signal;if(i==="step"){const s=e.getScaleComponent(n);if(s){const o=s.get("type"),a=s.get("range");if(on(o)&&yu(a)){const u=e.scaleName(n);return Oi(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[wL(u,a)]:[wL(u,a),{name:r,update:EL(u,s,`domain('${u}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const s=r.endsWith("width"),o=s?"containerSize()[0]":"containerSize()[1]",a=cw(e.config.view,s?"width":"height"),u=`isFinite(${o}) ? ${o} : ${a}`;return[{name:r,init:u,on:[{update:u,events:"window:resize"}]}]}else return[{name:r,value:i}]}function wL(e,t){const n=`${e}_step`;return me(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function EL(e,t,n){const i=t.get("type"),r=t.get("padding"),s=zt(t.get("paddingOuter"),r);let o=t.get("paddingInner");return o=i==="band"?o!==void 0?o:r:1,`bandspace(${n}, ${Dr(o)}, ${Dr(s)}) * ${e}_step`}function CL(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function kL(e,t){return Y(e).reduce((n,i)=>({...n,...$c({model:t,channelDef:e[i],vgChannel:i,mainRefFn:r=>Et(r.value),invalidValueRef:void 0})}),{})}function AL(e,t){if(Oi(t))return e==="theta"?"independent":"shared";if(Lc(t))return"shared";if(l5(t))return Bt(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function Yw(e,t){const n=e.scale[t],i=Bt(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&Z(hhe(t)),"independent"):e[i][t]||"shared"}const Ume={...ype,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},$L=Y(Ume);class jme extends lo{}const SL={symbols:qme,gradient:Wme,labels:Hme,entries:Gme};function qme(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:s}){if(s!=="symbol")return;const{markDef:o,encoding:a,config:u,mark:l}=n,c=o.filled&&l!=="trail";let f={..._de({},n,y0e),...DO(n,{filled:c})};const d=r.get("symbolOpacity")??u.legend.symbolOpacity,h=r.get("symbolFillColor")??u.legend.symbolFillColor,p=r.get("symbolStrokeColor")??u.legend.symbolStrokeColor,g=d===void 0?FL(a.opacity)??o.opacity:void 0;if(f.fill){if(i==="fill"||c&&i===pi)delete f.fill;else if(X(f.fill,"field"))h?delete f.fill:(f.fill=Et(u.legend.symbolBaseFillColor??"black"),f.fillOpacity=Et(g??1));else if(W(f.fill)){const m=Xw(a.fill??a.color)??o.fill??(c&&o.color);m&&(f.fill=Et(m))}}if(f.stroke){if(i==="stroke"||!c&&i===pi)delete f.stroke;else if(X(f.stroke,"field")||p)delete f.stroke;else if(W(f.stroke)){const m=zt(Xw(a.stroke||a.color),o.stroke,c?o.color:void 0);m&&(f.stroke={value:m})}}if(i!==no){const m=J(t)&&TL(n,r,t);m?f.opacity=[{test:m,...Et(g??1)},Et(u.legend.unselectedOpacity)]:g&&(f.opacity=Et(g))}return f={...f,...e},ht(f)?void 0:f}function Wme(e,{model:t,legendType:n,legendCmpt:i}){if(n!=="gradient")return;const{config:r,markDef:s,encoding:o}=t;let a={};const l=(i.get("gradientOpacity")??r.legend.gradientOpacity)===void 0?FL(o.opacity)||s.opacity:void 0;return l&&(a.opacity=Et(l)),a={...a,...e},ht(a)?void 0:a}function Hme(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const s=n.legend(i)||{},o=n.config,a=J(t)?TL(n,r,t):void 0,u=a?[{test:a,value:1},{value:o.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=s;let f;ku(c)?f=Mr({fieldOrDatumDef:t,field:"datum.value",format:l,formatType:c,config:o}):l===void 0&&c===void 0&&o.customFormatTypes&&(t.type==="quantitative"&&o.numberFormatType?f=Mr({fieldOrDatumDef:t,field:"datum.value",format:o.numberFormat,formatType:o.numberFormatType,config:o}):t.type==="temporal"&&o.timeFormatType&&J(t)&&t.timeUnit===void 0&&(f=Mr({fieldOrDatumDef:t,field:"datum.value",format:o.timeFormat,formatType:o.timeFormatType,config:o})));const d={...u?{opacity:u}:{},...f?{text:f}:{},...e};return ht(d)?void 0:d}function Gme(e,{legendCmpt:t}){const n=t.get("selections");return n!=null&&n.length?{...e,fill:{value:"transparent"}}:e}function FL(e){return DL(e,(t,n)=>Math.max(t,n.value))}function Xw(e){return DL(e,(t,n)=>zt(t,n.value))}function DL(e,t){if(O0e(e))return oe(e.condition).reduce(t,e.value);if(Nr(e))return e.value}function TL(e,t,n){const i=t.get("selections");if(!(i!=null&&i.length))return;const r=Q(n.field);return i.map(s=>`(!length(data(${Q(At(s)+Fu)})) || (${s}[${r}] && indexof(${s}[${r}], datum.value) >= 0))`).join(" || ")}const ML={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return XN(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return KN(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??Qme(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??e2e(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??Yme(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>xc(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(pc(n)&&vs(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>Vme(t,e)};function Vme(e,t){const n=e.values;if(W(n))return dR(t,n);if(me(n))return n}function Yme(e,t,n,i){if(t!=="shape"){const r=Xw(n)??i;if(r)return r}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function Xme(e){const{legend:t}=e;return zt(t.type,Kme(e))}function Kme({channel:e,timeUnit:t,scaleType:n}){if(pc(e)){if(We(["quarter","month","day"],t))return"symbol";if(vs(n))return"gradient"}return"symbol"}function Zme({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??Jme(n,t)}function Jme(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function Qme({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:s,gradientHorizontalMinLength:o,gradientVerticalMaxLength:a,gradientVerticalMinLength:u}=e;if(vs(r))return n==="horizontal"?i==="top"||i==="bottom"?NL(t,"width",o,s):o:NL(t,"height",u,a)}function NL(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function e2e(e){if(We(["quantile","threshold","log","symlog"],e))return"greedy"}function RL(e){const t=Dt(e)?t2e(e):s2e(e);return e.component.legends=t,t}function t2e(e){const{encoding:t}=e,n={};for(const i of[pi,...IR]){const r=Xt(t[i]);!r||!e.getScaleComponent(i)||i===gi&&J(r)&&r.type===mc||(n[i]=r2e(e,i))}return n}function n2e(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function i2e(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(t==="title"&&e===(i==null?void 0:i.title))return!0}return e===(n||{})[t]}function r2e(e,t){var x;let n=e.legend(t);const{markDef:i,encoding:r,config:s}=e,o=s.legend,a=new jme({},n2e(e,t));r1e(e,t,a);const u=n!==void 0?!n:o.disable;if(a.set("disable",u,n!==void 0),u)return a;n=n||{};const l=e.getScaleComponent(t).get("type"),c=Xt(r[t]),f=J(c)?(x=sn(c.timeUnit))==null?void 0:x.unit:void 0,d=n.orient||s.legend.orient||"right",h=Xme({legend:n,channel:t,timeUnit:f,scaleType:l}),p=Zme({legend:n,legendType:h,orient:d,legendConfig:o}),g={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:c,legendConfig:o,config:s,scaleType:l,orient:d,legendType:h,direction:p};for(const _ of $L){if(h==="gradient"&&_.startsWith("symbol")||h==="symbol"&&_.startsWith("gradient"))continue;const E=_ in ML?ML[_](g):n[_];if(E!==void 0){const w=i2e(E,_,n,e.fieldDef(t));(w||s.legend[_]===void 0)&&a.set(_,E,w)}}const m=(n==null?void 0:n.encoding)??{},y=a.get("selections"),b={},v={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:a,legendType:h};for(const _ of["labels","legend","title","symbols","gradient","entries"]){const E=kL(m[_]??{},e),w=_ in SL?SL[_](E,v):E;w!==void 0&&!ht(w)&&(b[_]={...y!=null&&y.length&&J(c)?{name:`${At(c.field)}_legend_${_}`}:{},...y!=null&&y.length?{interactive:!!y}:{},update:w})}return ht(b)||a.set("encode",b,!!(n!=null&&n.encoding)),a}function s2e(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){RL(i);for(const r of Y(i.component.legends))n.legend[r]=Yw(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=OL(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of Y(t))for(const r of e.children)r.component.legends[i]&&n.legend[i]==="shared"&&delete r.component.legends[i];return t}function OL(e,t){var s,o,a,u;if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const l of $L){const c=ma(e.getWithExplicit(l),t.getWithExplicit(l),l,"legend",(f,d)=>{switch(l){case"symbolType":return o2e(f,d);case"title":return iN(f,d);case"type":return r=!0,Ri("symbol")}return om(f,d,l,"legend")});e.setWithExplicit(l,c)}return r&&((o=(s=e.implicit)==null?void 0:s.encode)!=null&&o.gradient&&C1(e.implicit,["encode","gradient"]),(u=(a=e.explicit)==null?void 0:a.encode)!=null&&u.gradient&&C1(e.explicit,["encode","gradient"])),e}function o2e(e,t){return t.value==="circle"?t:e}function a2e(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function LL(e){const t=e.component.legends,n={};for(const r of Y(t)){const s=e.getScaleComponent(r),o=pt(s.get("domains"));if(n[o])for(const a of n[o])OL(a,t[r])||n[o].push(t[r]);else n[o]=[t[r].clone()]}return gn(n).flat().map(r=>u2e(r,e.config)).filter(r=>r!==void 0)}function u2e(e,t){var o,a,u;const{disable:n,labelExpr:i,selections:r,...s}=e.combine();if(!n){if(t.aria===!1&&s.aria==null&&(s.aria=!1),(o=s.encode)!=null&&o.symbols){const l=s.encode.symbols.update;l.fill&&l.fill.value!=="transparent"&&!l.stroke&&!s.stroke&&(l.stroke={value:"transparent"});for(const c of IR)s[c]&&delete l[c]}if(s.title||delete s.title,i!==void 0){let l=i;(u=(a=s.encode)==null?void 0:a.labels)!=null&&u.update&&me(s.encode.labels.update.text)&&(l=du(i,"datum.label",s.encode.labels.update.text.signal)),a2e(s,"labels","text",{signal:l})}return s}}function l2e(e){return Lc(e)||l5(e)?c2e(e):IL(e)}function c2e(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),IL(e))}function IL(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const r={signal:`[${t.size.map(o=>o.signal).join(", ")}]`},s=t.data.reduce((o,a)=>{const u=me(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return We(o,u)||o.push(u),o},[]);if(s.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:r,fit:{signal:s.length>1?`[${s.join(", ")}]`:s[0]},...n}]}else return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const f2e=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class PL extends lo{constructor(t,n,i,r){super({...n},{name:t}),this.specifiedProjection=n,this.size=i,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function zL(e){e.component.projection=Dt(e)?d2e(e):g2e(e)}function d2e(e){if(e.hasProjection){const t=yn(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?h2e(e):void 0,s=new PL(e.projectionName(!0),{...yn(e.config.projection),...t},i,r);return s.get("type")||s.set("type","equalEarth",!1),s}}function h2e(e){const t=[],{encoding:n}=e;for(const i of[[Sr,$r],[nr,Fr]])(Xt(n[i[0]])||Xt(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(gi)&&e.typedFieldDef(gi).type===mc&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(Ft.Main)),t}function p2e(e,t){const n=Qx(f2e,r=>!!(!ue(e.explicit,r)&&!ue(t.explicit,r)||ue(e.explicit,r)&&ue(t.explicit,r)&&Mi(e.get(r),t.get(r))));if(Mi(e.size,t.size)){if(n)return e;if(Mi(e.explicit,{}))return t;if(Mi(t.explicit,{}))return e}return null}function g2e(e){if(e.children.length===0)return;let t;for(const i of e.children)zL(i);const n=Qx(e.children,i=>{const r=i.component.projection;if(r)if(t){const s=p2e(t,r);return s&&(t=s),!!s}else return t=r,!0;else return!0});if(t&&n){const i=e.projectionName(!0),r=new PL(i,t.specifiedProjection,t.size,De(t.data));for(const s of e.children){const o=s.component.projection;o&&(o.isFit&&r.data.push(...s.component.projection.data),s.renameProjection(o.get("name"),i),o.merged=!0)}return r}}function m2e(e,t,n,i){if(ah(t,n)){const r=Dt(e)?e.axis(n)??e.legend(n)??{}:{},s=ne(t,{expr:"datum"}),o=ne(t,{expr:"datum",binSuffix:"end"});return{formulaAs:ne(t,{binSuffix:"range",forAs:!0}),formula:ih(s,o,r.format,r.formatType,i)}}return{}}function BL(e,t){return`${GM(e)}_${t}`}function y2e(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function Kw(e,t,n){const i=Z1(n,void 0)??{},r=BL(i,t);return e.getName(`${r}_bins`)}function b2e(e){return"as"in e}function UL(e,t,n){let i,r;b2e(e)?i=se(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[ne(e,{forAs:!0}),ne(e,{binSuffix:"end",forAs:!0})];const s={...Z1(t,void 0)},o=BL(s,e.field),{signal:a,extentSignal:u}=y2e(n,o);if(N1(s.extent)){const c=s.extent;r=dL(n,c.param,c),delete s.extent}const l={bin:s,field:e.field,as:[i],...a?{signal:a}:{},...u?{extentSignal:u}:{},...r?{span:r}:{}};return{key:o,binComponent:l}}class $s extends lt{clone(){return new $s(null,De(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,o)=>{if(ei(s)&&_t(s.bin)){const{key:a,binComponent:u}=UL(s,s.bin,n);r[a]={...u,...r[a],...m2e(n,s,o,n.config)}}return r},{});return ht(i)?null:new $s(t,i)}static makeFromTransform(t,n,i){const{key:r,binComponent:s}=UL(n,n.bin,i);return new $s(t,{[r]:s})}merge(t,n){for(const i of Y(t.bins))i in this.bins?(n(t.bins[i].signal,this.bins[i].signal),this.bins[i].as=fs([...this.bins[i].as,...t.bins[i].as],He)):this.bins[i]=t.bins[i];for(const i of t.children)t.removeChild(i),i.parent=this;t.remove()}producedFields(){return new Set(gn(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(gn(this.bins).map(t=>t.field))}hash(){return`Bin ${He(this.bins)}`}assemble(){return gn(this.bins).flatMap(t=>{const n=[],[i,...r]=t.as,{extent:s,...o}=t.bin,a={type:"bin",field:er(t.field),as:i,signal:t.signal,...N1(s)?{extent:null}:{extent:s},...t.span?{span:{signal:`span(${t.span})`}}:{},...o};!s&&t.extentSignal&&(n.push({type:"extent",field:er(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),n.push(a);for(const u of r)for(let l=0;l<2;l++)n.push({type:"formula",expr:ne({field:i[l]},{expr:"datum"}),as:u[l]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function v2e(e,t,n,i){var s;const r=Dt(i)?i.encoding[gs(t)]:void 0;if(ei(n)&&Dt(i)&&iR(n,r,i.markDef,i.config)){e.add(ne(n,{})),e.add(ne(n,{suffix:"end"}));const{mark:o,markDef:a,config:u}=i,l=pa({fieldDef:n,markDef:a,config:u});th(o)&&l!==.5&&Bt(t)&&(e.add(ne(n,{suffix:am})),e.add(ne(n,{suffix:um}))),n.bin&&ah(n,t)&&e.add(ne(n,{binSuffix:"range"}))}else if(IM(t)){const o=LM(t);e.add(i.getName(o))}else e.add(ne(n));return Au(n)&&r0e((s=n.scale)==null?void 0:s.range)&&e.add(n.scale.range.field),e}function x2e(e,t){for(const n of Y(t)){const i=t[n];for(const r of Y(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class Ir extends lt{clone(){return new Ir(null,new Set(this.dimensions),De(this.measures))}constructor(t,n,i){super(t),this.dimensions=n,this.measures=i}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let i=!1;n.forEachFieldDef(o=>{o.aggregate&&(i=!0)});const r={},s=new Set;return!i||(n.forEachFieldDef((o,a)=>{const{aggregate:u,field:l}=o;if(u)if(u==="count")r["*"]??(r["*"]={}),r["*"].count=new Set([ne(o,{forAs:!0})]);else{if(ro(u)||fa(u)){const c=ro(u)?"argmin":"argmax",f=u[c];r[f]??(r[f]={}),r[f][c]=new Set([ne({op:c,field:f},{forAs:!0})])}else r[l]??(r[l]={}),r[l][u]=new Set([ne(o,{forAs:!0})]);ms(a)&&n.scaleDomain(a)==="unaggregated"&&(r[l]??(r[l]={}),r[l].min=new Set([ne({field:l,aggregate:"min"},{forAs:!0})]),r[l].max=new Set([ne({field:l,aggregate:"max"},{forAs:!0})]))}else v2e(s,a,o,n)}),s.size+Y(r).length===0)?null:new Ir(t,s,r)}static makeFromTransform(t,n){var i;const r=new Set,s={};for(const o of n.aggregate){const{op:a,field:u,as:l}=o;a&&(a==="count"?(s["*"]??(s["*"]={}),s["*"].count=new Set([l||ne(o,{forAs:!0})])):(s[u]??(s[u]={}),(i=s[u])[a]??(i[a]=new Set),s[u][a].add(l||ne(o,{forAs:!0}))))}for(const o of n.groupby??[])r.add(o);return r.size+Y(s).length===0?null:new Ir(t,r,s)}merge(t){return $M(this.dimensions,t.dimensions)?(x2e(this.measures,t.measures),!0):(Fhe("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...Y(this.measures)])}producedFields(){const t=new Set;for(const n of Y(this.measures))for(const i of Y(this.measures[n])){const r=this.measures[n][i];r.size===0?t.add(`${i}_${n}`):r.forEach(t.add,t)}return t}hash(){return`Aggregate ${He({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],i=[];for(const s of Y(this.measures))for(const o of Y(this.measures[s]))for(const a of this.measures[s][o])i.push(a),t.push(o),n.push(s==="*"?null:er(s));return{type:"aggregate",groupby:[...this.dimensions].map(er),ops:t,fields:n,as:i}}}class Nc extends lt{constructor(t,n,i,r){super(t),this.model=n,this.name=i,this.data=r;for(const s of ir){const o=n.facet[s];if(o){const{bin:a,sort:u}=o;this[s]={name:n.getName(`${s}_domain`),fields:[ne(o),..._t(a)?[ne(o,{binSuffix:"end"})]:[]],...oo(u)?{sortField:u}:W(u)?{sortIndexField:Tc(o,s)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of ir)this[n]&&(t+=` ${n.charAt(0)}:${He(this[n])}`);return t}get fields(){var n;const t=[];for(const i of ir)(n=this[i])!=null&&n.fields&&t.push(...this[i].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of ir)this[n]&&(this[n].sortField&&t.add(this[n].sortField.field),this[n].sortIndexField&&t.add(this[n].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const n of io){const i=this.childModel.component.scales[n];if(i&&!i.merged){const r=i.get("type"),s=i.get("range");if(on(r)&&yu(s)){const o=Am(this.childModel,n),a=a5(o);a?t[n]=a:Z(b_(n))}}}return t}assembleRowColumnHeaderData(t,n,i){const r={row:"y",column:"x",facet:void 0}[t],s=[],o=[],a=[];r&&i&&i[r]&&(n?(s.push(`distinct_${i[r]}`),o.push("max")):(s.push(i[r]),o.push("distinct")),a.push(`distinct_${i[r]}`));const{sortField:u,sortIndexField:l}=this[t];if(u){const{op:c=W1,field:f}=u;s.push(f),o.push(c),a.push(ne(u,{forAs:!0}))}else l&&(s.push(l),o.push("max"),a.push(l));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...s.length?{fields:s,ops:o,as:a}:{}}]}}assembleFacetHeaderData(t){var u;const{columns:n}=this.model.layout,{layoutHeaders:i}=this.model.component,r=[],s={};for(const l of Ww){for(const c of Hw){const f=(i[l]&&i[l][c])??[];for(const d of f)if(((u=d.axes)==null?void 0:u.length)>0){s[l]=!0;break}}if(s[l]){const c=`length(data("${this.facet.name}"))`,f=l==="row"?n?{signal:`ceil(${c} / ${n})`}:1:n?{signal:`min(${c}, ${n})`}:{signal:c};r.push({name:`${this.facet.name}_${l}`,transform:[{type:"sequence",start:0,stop:f}]})}}const{row:o,column:a}=s;return(o||a)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,t)),r}assemble(){const t=[];let n=null;const i=this.getChildIndependentFieldsWithStep(),{column:r,row:s,facet:o}=this;if(r&&s&&(i.x||i.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(i.x??[],i.y??[]),u=a.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:u}]})}for(const a of[Js,Zs])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,i));if(o){const a=this.assembleFacetHeaderData(i);a&&t.push(...a)}return t}}function jL(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function _2e(e,t){const n=i_(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const i=jL(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=jL(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return Z(Pde(t)),null}function w2e(e){const t={};return E1(e.filter,n=>{if(FN(n)){let i=null;A_(n)?i=Ni(n.equal):S_(n)?i=Ni(n.lte):$_(n)?i=Ni(n.lt):F_(n)?i=Ni(n.gt):D_(n)?i=Ni(n.gte):T_(n)?i=n.range[0]:M_(n)&&(i=(n.oneOf??n.in)[0]),i&&(vu(i)?t[n.field]="date":Je(i)?t[n.field]="number":se(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function E2e(e){const t={};function n(i){wc(i)?t[i.field]="date":i.type==="quantitative"&&hde(i.aggregate)?t[i.field]="number":fc(i.field)>1?i.field in t||(t[i.field]="flatten"):Au(i)&&oo(i.sort)&&fc(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((Dt(e)||Oi(e))&&e.forEachFieldDef((i,r)=>{if(ei(i))n(i);else{const s=gu(r),o=e.fieldDef(s);n({...i,type:o.type})}}),Dt(e)){const{mark:i,markDef:r,encoding:s}=e;if(ha(i)&&!e.encoding.order){const o=r.orient==="horizontal"?"y":"x",a=s[o];J(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function C2e(e){const t={};if(Dt(e)&&e.component.selection)for(const n of Y(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&fc(r.field)>1&&(t[r.field]="flatten")}return t}class In extends lt{clone(){return new In(null,De(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${He(this._parse)}`}static makeExplicit(t,n,i){var o;let r={};const s=n.data;return!ya(s)&&((o=s==null?void 0:s.format)!=null&&o.parse)&&(r=s.format.parse),this.makeWithAncestors(t,r,{},i)}static makeWithAncestors(t,n,i,r){for(const a of Y(i)){const u=r.getWithExplicit(a);u.value!==void 0&&(u.explicit||u.value===i[a]||u.value==="derived"||i[a]==="flatten"?delete i[a]:Z(cN(a,i[a],u.value)))}for(const a of Y(n)){const u=r.get(a);u!==void 0&&(u===n[a]?delete n[a]:Z(cN(a,n[a],u)))}const s=new lo(n,i);r.copyAll(s);const o={};for(const a of Y(s.combine())){const u=s.get(a);u!==null&&(o[a]=u)}return Y(o).length===0||r.parseNothing?null:new In(t,o)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of Y(this._parse)){const i=this._parse[n];fc(n)===1&&(t[n]=i)}return t}producedFields(){return new Set(Y(this._parse))}dependentFields(){return new Set(Y(this._parse))}assembleTransforms(t=!1){return Y(this._parse).filter(n=>t?fc(n)>1:!0).map(n=>{const i=_2e(n,this._parse[n]);return i?{type:"formula",expr:i,as:cc(n)}:null}).filter(n=>n!==null)}}class va extends lt{clone(){return new va(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([Or])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Or}}}class xh extends lt{clone(){return new xh(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${He(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class _h extends lt{clone(){return new _h(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${He(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class Ru extends lt{constructor(t){super(null),t??(t={name:"source"});let n;if(ya(t)||(n=t.format?{...hi(t.format,["parse"])}:{}),lh(t))this._data={values:t.values};else if(Cc(t)){if(this._data={url:t.url},!n.type){let i=/(?:\.([^.]+))?$/.exec(t.url)[1];We(["json","csv","tsv","dsv","topojson"],i)||(i="json"),n.type=i}}else pO(t)?this._data={values:[{type:"Sphere"}]}:(dO(t)||ya(t))&&(this._data={});this._generator=ya(t),t.name&&(this._name=t.name),n&&!ht(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var qL=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},k2e=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},wh;function Zw(e){return e instanceof Ru||e instanceof xh||e instanceof _h}class Jw{constructor(){wh.set(this,void 0),qL(this,wh,!1,"f")}setModified(){qL(this,wh,!0,"f")}get modifiedFlag(){return k2e(this,wh,"f")}}wh=new WeakMap;class Ou extends Jw{getNodeDepths(t,n,i){i.set(t,n);for(const r of t.children)this.getNodeDepths(r,n+1,i);return i}optimize(t){const i=[...this.getNodeDepths(t,0,new Map).entries()].sort((r,s)=>s[1]-r[1]);for(const r of i)this.run(r[0]);return this.modifiedFlag}}class Qw extends Jw{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class A2e extends Qw{mergeNodes(t,n){const i=n.shift();for(const r of n)t.removeChild(r),r.parent=i,r.remove()}run(t){const n=t.children.map(r=>r.hash()),i={};for(let r=0;r1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class $2e extends Qw{constructor(t){super(),this.requiresSelectionId=t&&Tw(t)}run(t){t instanceof va&&(this.requiresSelectionId&&(Zw(t.parent)||t.parent instanceof Ir||t.parent instanceof In)||(this.setModified(),t.remove()))}}class S2e extends Jw{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof Cs&&(i=t.producedFields(),e_(i,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const r of t.children)this.run(r,new Set([...n,...i]))}}class F2e extends Qw{constructor(){super()}run(t){t instanceof yi&&!t.isRequired()&&(this.setModified(),t.remove())}}class D2e extends Ou{run(t){if(!Zw(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof In)if(t instanceof In)this.setModified(),t.merge(n);else{if(n_(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class T2e extends Ou{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof In);if(t.numChildren()>1&&i.length>=1){const r={},s=new Set;for(const o of i){const a=o.parse;for(const u of Y(a))u in r?r[u]!==a[u]&&s.add(u):r[u]=a[u]}for(const o of s)delete r[o];if(!ht(r)){this.setModified();const o=new In(t,r);for(const a of n){if(a instanceof In)for(const u of Y(r))delete a.parse[u];t.removeChild(a),a.parent=o,a instanceof In&&Y(a.parse).length===0&&a.remove()}}}}}class M2e extends Ou{run(t){t instanceof yi||t.numChildren()>0||t instanceof Nc||t instanceof Ru||(this.setModified(),t.remove())}}class N2e extends Ou{run(t){const n=t.children.filter(r=>r instanceof Cs),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class R2e extends Ou{run(t){const n=t.children.filter(r=>r instanceof Ir),i={};for(const r of n){const s=He(r.groupBy);s in i||(i[s]=[]),i[s].push(r)}for(const r of Y(i)){const s=i[r];if(s.length>1){const o=s.pop();for(const a of s)o.merge(a)&&(t.removeChild(a),a.parent=o,a.remove(),this.setModified())}}}}class O2e extends Ou{constructor(t){super(),this.model=t}run(t){const n=!(Zw(t)||t instanceof Fc||t instanceof In||t instanceof va),i=[],r=[];for(const s of t.children)s instanceof $s&&(n&&!n_(t.producedFields(),s.dependentFields())?i.push(s):r.push(s));if(i.length>0){const s=i.pop();for(const o of i)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof $s?t.merge(s,this.model.renameSignal.bind(this.model)):s.swapWithParent()}if(r.length>1){const s=r.pop();for(const o of r)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified()}}}class L2e extends Ou{run(t){const n=[...t.children];if(!lc(n,o=>o instanceof yi)||t.numChildren()<=1)return;const r=[];let s;for(const o of n)if(o instanceof yi){let a=o;for(;a.numChildren()===1;){const[u]=a.children;if(u instanceof yi)a=u;else break}r.push(...a.children),s?(t.removeChild(o),o.parent=s.parent,s.parent.removeChild(s),s.parent=a,this.setModified()):s=a}else r.push(o);if(r.length){this.setModified();for(const o of r)o.parent.removeChild(o),o.parent=s}}}class Lu extends lt{clone(){return new Lu(null,De(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=fs(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??ne(t)}hash(){return`JoinAggregateTransform ${He(this.transform)}`}assemble(){const t=[],n=[],i=[];for(const s of this.transform.joinaggregate)n.push(s.op),i.push(this.getDefaultName(s)),t.push(s.field===void 0?null:s.field);const r=this.transform.groupby;return{type:"joinaggregate",as:i,ops:n,fields:t,...r!==void 0?{groupby:r}:{}}}}class Rc extends lt{clone(){return new Rc(null,{...this.filter})}constructor(t,n){super(t),this.filter=n}static make(t,n,i){const{config:r,markDef:s}=n,{marks:o,scales:a}=i;if(o==="include-invalid-values"&&a==="include-invalid-values")return null;const u=n.reduceFieldDef((l,c,f)=>{const d=ms(f)&&n.getScaleComponent(f);if(d){const h=d.get("type"),{aggregate:p}=c,g=j_({scaleChannel:f,markDef:s,config:r,scaleType:h,isCountAggregate:M1(p)});g!=="show"&&g!=="always-valid"&&(l[c.field]=c)}return l},{});return Y(u).length?new Rc(t,u):null}dependentFields(){return new Set(Y(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${He(this.filter)}`}assemble(){const t=Y(this.filter).reduce((n,i)=>{const r=this.filter[i],s=ne(r,{expr:"datum"});return r!==null&&(r.type==="temporal"?n.push(`(isDate(${s}) || (${e5(s)}))`):r.type==="quantitative"&&n.push(e5(s))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}function e5(e){return`isValid(${e}) && isFinite(+${e})`}function I2e(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=ne(i);return r&&t.push(r),t},[])}function P2e(e){return W(e)&&e.every(t=>se(t))&&e.length>1}class go extends lt{clone(){return new go(null,De(this._stack))}constructor(t,n){super(t),this._stack=n}static makeFromTransform(t,n){const{stack:i,groupby:r,as:s,offset:o="zero"}=n,a=[],u=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),u.push(zt(f.order,"ascending"));const l={field:a,order:u};let c;return P2e(s)?c=s:se(s)?c=[s,`${s}_end`]:c=[`${n.stack}_start`,`${n.stack}_end`],new go(t,{dimensionFieldDefs:[],stackField:i,groupby:r,offset:o,sort:l,facetby:[],as:c})}static makeFromEncoding(t,n){const i=n.stack,{encoding:r}=n;if(!i)return null;const{groupbyChannels:s,fieldChannel:o,offset:a,impute:u}=i,l=s.map(h=>{const p=r[h];return Rr(p)}).filter(h=>!!h),c=I2e(n),f=n.encoding.order;let d;if(W(f)||J(f))d=eN(f);else{const h=rR(f)?f.sort:o==="y"?"descending":"ascending";d=c.reduce((p,g)=>(p.field.includes(g)||(p.field.push(g),p.order.push(h)),p),{field:[],order:[]})}return new go(t,{dimensionFieldDefs:l,stackField:n.vgField(o),facetby:[],stackby:c,sort:d,offset:a,impute:u,as:[n.vgField(o,{suffix:"start",forAs:!0}),n.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${He(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:i}=this._stack;return t.length>0?t.map(r=>r.bin?n?[ne(r,{binSuffix:"mid"})]:[ne(r,{}),ne(r,{binSuffix:"end"})]:[ne(r)]).flat():i??[]}assemble(){const t=[],{facetby:n,dimensionFieldDefs:i,stackField:r,stackby:s,sort:o,offset:a,impute:u,as:l}=this._stack;if(u)for(const c of i){const{bandPosition:f=.5,bin:d}=c;if(d){const h=ne(c,{expr:"datum"}),p=ne(c,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${e5(h)} ? ${f}*${h}+${1-f}*${p} : ${h}`,as:ne(c,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:r,groupby:[...s,...n],key:ne(c,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:r,sort:o,as:l,offset:a}),t}}class Oc extends lt{clone(){return new Oc(null,De(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=fs(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach(n=>t.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??ne(t)}hash(){return`WindowTransform ${He(this.transform)}`}assemble(){const t=[],n=[],i=[],r=[];for(const f of this.transform.window)n.push(f.op),i.push(this.getDefaultName(f)),r.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);const s=this.transform.frame,o=this.transform.groupby;if(s&&s[0]===null&&s[1]===null&&n.every(f=>p_(f)))return{type:"joinaggregate",as:i,ops:n,fields:t,...o!==void 0?{groupby:o}:{}};const a=[],u=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),u.push(f.order??"ascending");const l={field:a,order:u},c=this.transform.ignorePeers;return{type:"window",params:r,as:i,ops:n,fields:t,sort:l,...c!==void 0?{ignorePeers:c}:{},...o!==void 0?{groupby:o}:{},...s!==void 0?{frame:s}:{}}}}function z2e(e){function t(n){if(!(n instanceof Nc)){const i=n.clone();if(i instanceof yi){const r=n5+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof Ir||i instanceof go||i instanceof Oc||i instanceof Lu)&&i.addDimensions(e.fields);for(const r of n.children.flatMap(t))r.parent=i;return[i]}return n.children.flatMap(t)}return t}function t5(e){if(e instanceof Nc)if(e.numChildren()===1&&!(e.children[0]instanceof yi)){const t=e.children[0];(t instanceof Ir||t instanceof go||t instanceof Oc||t instanceof Lu)&&t.addDimensions(e.fields),t.swapWithParent(),t5(e)}else{const t=e.model.component.data.main;WL(t);const n=z2e(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(t5)}function WL(e){if(e instanceof yi&&e.type===Ft.Main&&e.numChildren()===1){const t=e.children[0];t instanceof Nc||(t.swapWithParent(),WL(e))}}const n5="scale_",km=5;function i5(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!i5(t.children))return!1}return!0}function Pr(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function HL(e,t,n){let i=e.sources,r=!1;return r=Pr(new F2e,i)||r,r=Pr(new $2e(t),i)||r,i=i.filter(s=>s.numChildren()>0),r=Pr(new M2e,i)||r,i=i.filter(s=>s.numChildren()>0),n||(r=Pr(new D2e,i)||r,r=Pr(new O2e(t),i)||r,r=Pr(new S2e,i)||r,r=Pr(new T2e,i)||r,r=Pr(new R2e,i)||r,r=Pr(new N2e,i)||r,r=Pr(new A2e,i)||r,r=Pr(new L2e,i)||r),e.sources=i,r}function B2e(e,t){i5(e.sources);let n=0,i=0;for(let r=0;rt(n))}}function GL(e){Dt(e)?U2e(e):j2e(e)}function U2e(e){const t=e.component.scales;for(const n of Y(t)){const i=W2e(e,n);if(t[n].setWithExplicit("domains",i),G2e(e,n),e.component.data.isFaceted){let s=e;for(;!Oi(s)&&s.parent;)s=s.parent;if(s.component.resolve.scale[n]==="shared")for(const a of i.value)so(a)&&(a.data=n5+a.data.replace(n5,""))}}}function j2e(e){for(const n of e.children)GL(n);const t=e.component.scales;for(const n of Y(t)){let i,r=null;for(const s of e.children){const o=s.component.scales[n];if(o){i===void 0?i=o.getWithExplicit("domains"):i=ma(i,o.getWithExplicit("domains"),"domains","scale",o5);const a=o.get("selectionExtent");r&&a&&r.param!==a.param&&Z(Tde),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function q2e(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:s}=VL(t,n);if(!r){Z(s);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=VL(t,n);if(r)return"unaggregated"}return e}function W2e(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=q2e(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:r}),t==="x"&&Xt(i.x2)?Xt(i.x)?ma(xa(n,r,e,"x"),xa(n,r,e,"x2"),"domain","scale",o5):xa(n,r,e,"x2"):t==="y"&&Xt(i.y2)?Xt(i.y)?ma(xa(n,r,e,"y"),xa(n,r,e,"y2"),"domain","scale",o5):xa(n,r,e,"y2"):xa(n,r,e,t)}function H2e(e,t,n){return e.map(i=>({signal:`{data: ${J1(i,{timeUnit:n,type:t})}}`}))}function r5(e,t,n){var r;const i=(r=sn(n))==null?void 0:r.unit;return t==="temporal"||i?H2e(e,t,i):[e]}function xa(e,t,n,i){const{encoding:r,markDef:s,mark:o,config:a,stack:u}=n,l=Xt(r[i]),{type:c}=l,f=l.timeUnit,d=Sge({invalid:ys("invalid",s,a),isPath:ha(o)});if(i0e(t)){const g=xa(e,void 0,n,i),m=r5(t.unionWith,c,f);return Es([...m,...g.value])}else{if(me(t))return Es([t]);if(t&&t!=="unaggregated"&&!IN(t))return Es(r5(t,c,f))}if(u&&i===u.fieldChannel){if(u.offset==="normalize")return Ri([[0,1]]);const g=n.requestDataName(d);return Ri([{data:g,field:n.vgField(i,{suffix:"start"})},{data:g,field:n.vgField(i,{suffix:"end"})}])}const h=ms(i)&&J(l)?V2e(n,i,e):void 0;if(_s(l)){const g=r5([l.datum],c,f);return Ri(g)}const p=l;if(t==="unaggregated"){const{field:g}=l;return Ri([{data:n.requestDataName(d),field:ne({field:g,aggregate:"min"})},{data:n.requestDataName(d),field:ne({field:g,aggregate:"max"})}])}else if(_t(p.bin)){if(on(e))return Ri(e==="bin-ordinal"?[]:[{data:Gd(h)?n.requestDataName(d):n.requestDataName(Ft.Raw),field:n.vgField(i,ah(p,i)?{binSuffix:"range"}:{}),sort:h===!0||!re(h)?{field:n.vgField(i,{}),op:"min"}:h}]);{const{bin:g}=p;if(_t(g)){const m=Kw(n,p.field,g);return Ri([new un(()=>{const y=n.getSignalName(m);return`[${y}.start, ${y}.stop]`})])}else return Ri([{data:n.requestDataName(d),field:n.vgField(i,{})}])}}else if(p.timeUnit&&We(["time","utc"],e)){const g=r[gs(i)];if(iR(p,g,s,a)){const m=n.requestDataName(d),y=pa({fieldDef:p,fieldDef2:g,markDef:s,config:a}),b=th(o)&&y!==.5&&Bt(i);return Ri([{data:m,field:n.vgField(i,b?{suffix:am}:{})},{data:m,field:n.vgField(i,{suffix:b?um:"end"})}])}}return Ri(h?[{data:Gd(h)?n.requestDataName(d):n.requestDataName(Ft.Raw),field:n.vgField(i),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(i)}])}function s5(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":W1),...i?{field:er(i)}:{},...r?{order:r}:{}}}function G2e(e,t){var a;const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=(a=e.fieldDef(t))==null?void 0:a.bin,s=IN(i)?i:void 0,o=mu(r)&&N1(r.extent)?r.extent:void 0;(s||o)&&n.set("selectionExtent",s??o,!0)}function V2e(e,t,n){if(!on(n))return;const i=e.fieldDef(t),r=i.sort;if(eR(r))return{op:"min",field:Tc(i,t),order:"ascending"};const{stack:s}=e,o=s?new Set([...s.groupbyFields,...s.stackBy.map(a=>a.fieldDef.field)]):void 0;if(oo(r)){const a=s&&!o.has(r.field);return s5(r,a)}else if(M0e(r)){const{encoding:a,order:u}=r,l=e.fieldDef(a),{aggregate:c,field:f}=l,d=s&&!o.has(f);if(ro(c)||fa(c))return s5({field:ne(l),order:u},d);if(p_(c)||!c)return s5({op:c,field:f,order:u},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(We(["ascending",void 0],r))return!0}}function VL(e,t){const{aggregate:n,type:i}=e;return n?se(n)&&!gde.has(n)?{valid:!1,reason:ohe(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:ahe(e)}:{valid:!0}:{valid:!1,reason:she(e)}}function o5(e,t,n,i){return e.explicit&&t.explicit&&Z(dhe(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function Y2e(e){const t=fs(e.map(o=>{if(so(o)){const{sort:a,...u}=o;return u}return o}),He),n=fs(e.map(o=>{if(so(o)){const a=o.sort;return a!==void 0&&!Gd(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(o=>o!==void 0),He);if(t.length===0)return;if(t.length===1){const o=e[0];if(so(o)&&n.length>0){let a=n[0];if(n.length>1){Z(mN);const u=n.filter(l=>re(l)&&"op"in l&&l.op!=="min");n.every(l=>re(l)&&"op"in l)&&u.length===1?a=u[0]:a=!0}else if(re(a)&&"field"in a){const u=a.field;o.field===u&&(a=a.order?{order:a.order}:!0)}return{...o,sort:a}}return o}const i=fs(n.map(o=>Gd(o)||!("op"in o)||se(o.op)&&ue(fde,o.op)?o:(Z(phe(o)),!0)),He);let r;i.length===1?r=i[0]:i.length>1&&(Z(mN),r=!0);const s=fs(e.map(o=>so(o)?o.data:null),o=>o);return s.length===1&&s[0]!==null?{data:s[0],fields:t.map(a=>a.field),...r?{sort:r}:{}}:{fields:t,...r?{sort:r}:{}}}function a5(e){if(so(e)&&se(e.field))return e.field;if(mde(e)){let t;for(const n of e.fields)if(so(n)&&se(n.field)){if(!t)t=n.field;else if(t!==n.field)return Z(ghe),t}return Z(mhe),t}else if(yde(e)){Z(yhe);const t=e.fields[0];return se(t)?t:void 0}}function Am(e,t){const i=e.component.scales[t].get("domains").map(r=>(so(r)&&(r.data=e.lookupDataSource(r.data)),r));return Y2e(i)}function YL(e){return Lc(e)||l5(e)?e.children.reduce((t,n)=>t.concat(YL(n)),XL(e)):XL(e)}function XL(e){return Y(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:s,type:o,selectionExtent:a,domains:u,range:l,reverse:c,...f}=r,d=X2e(r.range,s,n,e),h=Am(e,n),p=a?zge(e,a,i,h):null;return t.push({name:s,type:o,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function X2e(e,t,n,i){if(Bt(n)){if(yu(e))return{step:{signal:`${t}_step`}}}else if(re(e)&&so(e))return{...e,data:i.lookupDataSource(e.data)};return e}class KL extends lo{constructor(t,n){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",n)}domainHasZero(){const t=this.get("type");if(We([bn.LOG,bn.TIME,bn.UTC],t))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&We([bn.LINEAR,bn.SQRT,bn.POW],t))return"definitely";const i=this.get("domains");if(i.length>0){let r=!1,s=!1,o=!1;for(const a of i){if(W(a)){const u=a[0],l=a[a.length-1];if(Je(u)&&Je(l))if(u<=0&&l>=0){r=!0;continue}else{s=!0;continue}}o=!0}if(r)return"definitely";if(s&&!o)return"definitely-not"}return"maybe"}}const K2e=["range","scheme"];function Z2e(e){const t=e.component.scales;for(const n of d_){const i=t[n];if(!i)continue;const r=J2e(n,e);i.setWithExplicit("range",r)}}function ZL(e,t){const n=e.fieldDef(t);if(n!=null&&n.bin){const{bin:i,field:r}=n,s=mi(t),o=e.getName(s);if(re(i)&&i.binned&&i.step!==void 0)return new un(()=>{const a=e.scaleName(t),u=`(domain("${a}")[1] - domain("${a}")[0]) / ${i.step}`;return`${e.getSignalName(o)} / (${u})`});if(_t(i)){const a=Kw(e,r,i);return new un(()=>{const u=e.getSignalName(a),l=`(${u}.stop - ${u}.start) / ${u}.step`;return`${e.getSignalName(o)} / (${l})`})}}}function J2e(e,t){const n=t.specifiedScales[e],{size:i}=t,s=t.getScaleComponent(e).get("type");for(const f of K2e)if(n[f]!==void 0){const d=L_(s,f),h=PN(e,f);if(!d)Z(pN(s,f,e));else if(h)Z(h);else switch(f){case"range":{const p=n.range;if(W(p)){if(Bt(e))return Es(p.map(g=>{if(g==="width"||g==="height"){const m=t.getName(g),y=t.getSignalName.bind(t);return un.fromName(y,m)}return g}))}else if(re(p))return Es({data:t.requestDataName(Ft.Main),field:p.field,sort:{op:"min",field:t.vgField(e)}});return Es(p)}case"scheme":return Es(Q2e(n[f]))}}const o=e===$t||e==="xOffset"?"width":"height",a=i[o];if(ws(a)){if(Bt(e))if(on(s)){const f=QL(a,t,e);if(f)return Es({step:f})}else Z(gN(o));else if(Jd(e)){const f=e===ra?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const p=eI(a,s);if(p)return Es(p)}}}const{rangeMin:u,rangeMax:l}=n,c=eye(e,t);return(u!==void 0||l!==void 0)&&L_(s,"rangeMin")&&W(c)&&c.length===2?Es([u??c[0],l??c[1]]):Ri(c)}function Q2e(e){return n0e(e)?{scheme:e.name,...hi(e,["name"])}:{scheme:e}}function JL(e,t,n,{center:i}={}){const r=mi(e),s=t.getName(r),o=t.getSignalName.bind(t);return e===rn&&Tr(n)?i?[un.fromName(a=>`${o(a)}/2`,s),un.fromName(a=>`-${o(a)}/2`,s)]:[un.fromName(o,s),0]:i?[un.fromName(a=>`-${o(a)}/2`,s),un.fromName(a=>`${o(a)}/2`,s)]:[0,un.fromName(o,s)]}function eye(e,t){const{size:n,config:i,mark:r,encoding:s}=t,{type:o}=Xt(s[e]),u=t.getScaleComponent(e).get("type"),{domain:l,domainMid:c}=t.specifiedScales[e];switch(e){case $t:case rn:{if(We(["point","band"],u)){const f=tI(e,n,i.view);if(ws(f))return{step:QL(f,t,e)}}return JL(e,t,u)}case ra:case dc:return tye(e,t,u);case to:{const f=rye(r,i),d=sye(r,n,t,i);return yc(u)?iye(f,d,nye(u,i,l,e)):[f,d]}case tr:return[0,Math.PI*2];case hu:return[0,360];case Ar:return[0,new un(()=>{const f=t.getSignalName(Oi(t.parent)?"child_width":"width"),d=t.getSignalName(Oi(t.parent)?"child_height":"height");return`min(${f},${d})/2`})];case sa:return{step:1e3/i.scale.framesPerSecond};case ua:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case la:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case gi:return"symbol";case pi:case hs:case ps:return u==="ordinal"?o==="nominal"?"category":"ordinal":c!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case no:case oa:case aa:return[i.scale.minOpacity,i.scale.maxOpacity]}}function QL(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),s=a_(n),o=i[s];if(zR({step:e,offsetIsDiscrete:Ne(o)&&TN(o.type)})==="offset"&&bR(i,s)){const u=t.getScaleComponent(s);let c=`domain('${t.scaleName(s)}').length`;if(u.get("type")==="band"){const d=u.get("paddingInner")??u.get("padding")??0,h=u.get("paddingOuter")??u.get("padding")??0;c=`bandspace(${c}, ${d}, ${h})`}const f=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${c} / (1-${xde(f)})`}}else return e.step}function eI(e,t){if(zR({step:e,offsetIsDiscrete:on(t)})==="offset")return{step:e.step}}function tye(e,t,n){const i=e===ra?"x":"y",r=t.getScaleComponent(i);if(!r)return JL(i,t,n,{center:!0});const s=r.get("type"),o=t.scaleName(i),{markDef:a,config:u}=t;if(s==="band"){const l=tI(i,t.size,t.config.view);if(ws(l)){const c=eI(l,n);if(c)return c}return[0,{signal:`bandwidth('${o}')`}]}else{const l=t.encoding[i];if(J(l)&&l.timeUnit){const c=$N(l.timeUnit,p=>`scale('${o}', ${p})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=pa({fieldDef:l,markDef:a,config:u})-.5,h=d!==0?` + ${d}`:"";if(f){const p=me(f)?`${f.signal}/2`+h:`${f/2+d}`,g=me(f)?`(1 - ${f.signal}/2)`+h:`${1-f/2+d}`;return[{signal:`${p} * (${c})`},{signal:`${g} * (${c})`}]}return[0,{signal:c}]}return kM(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function tI(e,t,n){const i=e===$t?"width":"height",r=t[i];return r||rm(n,i)}function nye(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&W(n)?n.length+1:(Z(Ahe(i)),3)}}function iye(e,t,n){const i=()=>{const r=Dr(t),s=Dr(e),o=`(${r} - ${s}) / (${n} - 1)`;return`sequence(${s}, ${r} + ${o}, ${o})`};return me(t)?new un(i):{signal:i()}}function rye(e,t){switch(e){case"bar":case"tick":return t.scale.minBandSize;case"line":case"trail":case"rule":return t.scale.minStrokeWidth;case"text":return t.scale.minFontSize;case"point":case"square":case"circle":return t.scale.minSize}throw new Error(R1("size",e))}const nI=.95;function sye(e,t,n,i){const r={x:ZL(n,"x"),y:ZL(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const s=iI(t,r,i.view);return Je(s)?s-1:new un(()=>`${s.signal} - 1`)}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const s=iI(t,r,i.view);return Je(s)?Math.pow(nI*s,2):new un(()=>`pow(${nI} * ${s.signal}, 2)`)}}throw new Error(R1("size",e))}function iI(e,t,n){const i=ws(e.width)?e.width.step:fw(n,"width"),r=ws(e.height)?e.height.step:fw(n,"height");return t.x||t.y?new un(()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`):Math.min(i,r)}function rI(e,t){Dt(e)?oye(e,t):aI(e,t)}function oye(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:s,specifiedScales:o}=e;for(const a of Y(n)){const u=o[a],l=n[a],c=e.getScaleComponent(a),f=Xt(r[a]),d=u[t],h=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=L_(h,t),y=PN(a,t);if(d!==void 0&&(m?y&&Z(y):Z(pN(h,t,a))),m&&y===void 0)if(d!==void 0){const b=f.timeUnit,v=f.type;switch(t){case"domainMax":case"domainMin":vu(u[t])||v==="temporal"||b?l.set(t,{signal:J1(u[t],{type:v,timeUnit:b})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const b=X(sI,t)?sI[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:u.domain,domainMin:u.domainMin,domainMax:u.domainMax,markDef:s,config:i,hasNestedOffsetScale:vR(r,a),hasSecondaryRangeChannel:!!r[gs(a)]}):i.scale[t];b!==void 0&&l.set(t,b,!1)}}}const sI={bins:({model:e,fieldOrDatumDef:t})=>J(t)?aye(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>uye(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:s})=>lye(e,t,n,i,r,s),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>cye(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:s})=>fye(e,t,n.type,i,r.scale,s),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:s})=>dye(e,t,n,i,r.scale,s),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=J(e)?e.sort:void 0;return hye(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:s,hasSecondaryRangeChannel:o})=>pye(e,t,n,i,r,s.scale,o)};function oI(e){Dt(e)?Z2e(e):aI(e,"range")}function aI(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?oI(i):rI(i,t);for(const i of Y(n)){let r;for(const s of e.children){const o=s.component.scales[i];if(o){const a=o.getWithExplicit(t);r=ma(r,a,t,"scale",fO((u,l)=>{switch(t){case"range":return u.step&&l.step?u.step-l.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function aye(e,t){const n=t.bin;if(_t(n)){const i=Kw(e,t.field,n);return new un(()=>e.getSignalName(i))}else if(mn(n)&&mu(n)&&n.step!==void 0)return{step:n.step}}function uye(e,t){if(We([pi,hs,ps],e)&&t!=="nominal")return"hcl"}function lye(e,t,n,i,r,s){var o;if(!((o=Rr(s))!=null&&o.bin||W(n)||r!=null||i!=null||We([bn.TIME,bn.UTC],e)))return Bt(t)?!0:void 0}function cye(e,t,n,i,r,s){if(Bt(e)){if(vs(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:o,orient:a}=r;if(o==="bar"&&!(J(i)&&(i.bin||i.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return s.continuousBandSize}if(t===bn.POINT)return n.pointPadding}}function fye(e,t,n,i,r,s=!1){if(e===void 0){if(Bt(t)){const{bandPaddingInner:o,barBandPaddingInner:a,rectBandPaddingInner:u,tickBandPaddingInner:l,bandWithNestedOffsetPaddingInner:c}=r;return s?c:zt(o,n==="bar"?a:n==="tick"?l:u)}else if(Jd(t)&&i===bn.BAND)return r.offsetBandPaddingInner}}function dye(e,t,n,i,r,s=!1){if(e===void 0){if(Bt(t)){const{bandPaddingOuter:o,bandWithNestedOffsetPaddingOuter:a}=r;if(s)return a;if(n===bn.BAND)return zt(o,me(i)?{signal:`${i.signal}/2`}:i/2)}else if(Jd(t)){if(n===bn.POINT)return .5;if(n===bn.BAND)return r.offsetBandPaddingOuter}}}function hye(e,t,n,i){if(n==="x"&&i.xReverse!==void 0)return Tr(e)&&t==="descending"?me(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(Tr(e)&&t==="descending")return!0}function pye(e,t,n,i,r,s,o){if(!!n&&n!=="unaggregated"&&Tr(r)){if(W(n)){const u=n[0],l=n[n.length-1];if(Je(u)&&u<=0&&Je(l)&&l>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!yc(r))return!0;if(!(J(t)&&t.bin)&&We([...io,...nde],e)){const{orient:u,type:l}=i;return We(["bar","area","line","trail"],l)&&(u==="horizontal"&&e==="y"||u==="vertical"&&e==="x")?!1:We(["bar","area"],l)&&!o?!0:s==null?void 0:s.zero}return!1}function gye(e,t,n,i,r=!1){const s=mye(t,n,i,r),{type:o}=e;return ms(t)?o!==void 0?l0e(t,o)?J(n)&&!u0e(o,n.type)?(Z(che(o,s)),s):o:(Z(lhe(t,o,s)),s):s:null}function mye(e,t,n,i){var r;switch(t.type){case"nominal":case"ordinal":{if(pc(e)||h_(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&Z(__(e,"ordinal")),"ordinal";if(f_(e))return"band";if(Bt(e)||Jd(e)){if(We(["rect","bar","image","rule","tick"],n.type)||i)return"band"}else if(n.type==="arc"&&e in c_)return"band";const s=n[mi(e)];return Eu(s)||vc(t)&&((r=t.axis)!=null&&r.tickBand)?"band":"point"}case"temporal":return pc(e)?"time":h_(e)==="discrete"?(Z(__(e,"temporal")),"ordinal"):J(t)&&t.timeUnit&&sn(t.timeUnit).utc?"utc":f_(e)?"band":"time";case"quantitative":return pc(e)?J(t)&&_t(t.bin)?"bin-ordinal":"linear":h_(e)==="discrete"?(Z(__(e,"quantitative")),"ordinal"):f_(e)?"band":"linear";case"geojson":return}throw new Error(dN(t.type))}function yye(e,{ignoreRange:t}={}){uI(e),GL(e);for(const n of a0e)rI(e,n);t||oI(e)}function uI(e){Dt(e)?e.component.scales=bye(e):e.component.scales=xye(e)}function bye(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const s of d_){const o=Xt(t[s]);if(o&&n===UN&&s===gi&&o.type===mc)continue;let a=o&&o.scale;if(o&&a!==null&&a!==!1){a??(a={});const u=vR(t,s),l=gye(a,s,o,i,u);r[s]=new KL(e.scaleName(`${s}`,!0),{value:l,explicit:a.type===l})}}return r}const vye=fO((e,t)=>MN(e)-MN(t));function xye(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const s of e.children){uI(s);for(const o of Y(s.component.scales))if((t=r.scale)[o]??(t[o]=AL(o,e)),r.scale[o]==="shared"){const a=i[o],u=s.component.scales[o].getWithExplicit("type");a?Zhe(a.value,u.value)?i[o]=ma(a,u,"type","scale",vye):(r.scale[o]="independent",delete i[o]):i[o]=u}}for(const s of Y(i)){const o=e.scaleName(s,!0),a=i[s];n[s]=new KL(o,a);for(const u of e.children){const l=u.component.scales[s];l&&(u.renameScale(l.get("name"),o),l.merged=!0)}}return n}class u5{constructor(){this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function Dt(e){return(e==null?void 0:e.type)==="unit"}function Oi(e){return(e==null?void 0:e.type)==="facet"}function l5(e){return(e==null?void 0:e.type)==="concat"}function Lc(e){return(e==null?void 0:e.type)==="layer"}class c5{constructor(t,n,i,r,s,o,a){this.type=n,this.parent=i,this.config=s,this.parent=i,this.config=s,this.view=yn(a),this.name=t.name??r,this.title=da(t.title)?{text:t.title}:t.title?yn(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new u5,this.projectionNameMap=i?i.projectionNameMap:new u5,this.signalNameMap=i?i.signalNameMap:new u5,this.data=t.data,this.description=t.description,this.transforms=mge(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:_pe(t,n,s),this.component={data:{sources:i?i.component.data.sources:[],outputNodes:i?i.component.data.outputNodes:{},outputNodeRefCounts:i?i.component.data.outputNodeRefCounts:{},isFaceted:H1(t)||(i==null?void 0:i.component.data.isFaceted)&&t.data===void 0},layoutSize:new lo,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?De(o):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){yye(this)}parseProjection(){zL(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){RL(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const s of Y(i)){const o=i[s];o!==void 0&&(r[s]=Et(o))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=Et(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:ht(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,s=Bme(i.layoutHeaders,r);return{padding:t,...this.assembleDefaultLayout(),...n,...s?{titleBand:s}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const i of ir)t[i].title&&n.push(Rme(this,i));for(const i of Ww)n=n.concat(Ome(this,i));return n}assembleAxes(){return _me(this.component.axes,this.config)}assembleLegends(){return LL(this)}assembleProjections(){return l2e(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...YM(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(i.text)return We(["unit","layer"],this.type)?We(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),ht(i)?void 0:i}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const i=this.assembleLayout();i&&(n.layout=i),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||Oi(this.parent)?YL(this):[];r.length>0&&(n.scales=r);const s=this.assembleAxes();s.length>0&&(n.axes=s);const o=this.assembleLegends();return o.length>0&&(n.legends=o),n}getName(t){return At((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(Ft[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),i=this.component.data.outputNodeRefCounts;return i[n]=(i[n]||0)+1,n}getSizeSignalRef(t){if(Oi(this.parent)){const n=CL(t),i=T1(n),r=this.component.scales[i];if(r&&!r.merged){const s=r.get("type"),o=r.get("range");if(on(s)&&yu(o)){const a=r.get("name"),u=Am(this,i),l=a5(u);if(l){const c=ne({aggregate:"distinct",field:l},{expr:"datum"});return{signal:EL(a,r,c)}}else return Z(b_(i)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){if(n)return this.getName(t);if(zM(t)&&ms(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t)))return this.scaleNameMap.get(this.getName(t))}projectionName(t){if(t)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getScaleType(t){const n=this.getScaleComponent(t);return n?n.get("type"):void 0}getSelectionComponent(t,n){let i=this.component.selection[t];if(!i&&this.parent&&(i=this.parent.getSelectionComponent(t,n)),!i)throw new Error(kde(n));return i}hasAxisOrientSignalRef(){var t,n;return((t=this.component.axes.x)==null?void 0:t.some(i=>i.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(i=>i.hasOrientSignalRef()))}}class lI extends c5{vgField(t,n={}){const i=this.fieldDef(t);if(i)return ne(i,n)}reduceFieldDef(t,n){return J0e(this.getMapping(),(i,r,s)=>{const o=Rr(r);return o?t(i,o,s):i},n)}forEachFieldDef(t,n){J_(this.getMapping(),(i,r)=>{const s=Rr(i);s&&t(s,r)},n)}}class $m extends lt{clone(){return new $m(null,De(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=De(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"value",i[1]??"density"];const r=this.transform.resolve??"shared";this.transform.resolve=r}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${He(this.transform)}`}assemble(){const{density:t,...n}=this.transform,i={type:"kde",field:t,...n};return i.resolve=this.transform.resolve,i}}class Sm extends lt{clone(){return new Sm(null,De(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=De(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${He(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class Fm extends lt{clone(){return new Fm(this.parent,De(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=De(n);const{flatten:i,as:r=[]}=this.transform;this.transform.as=i.map((s,o)=>r[o]??s)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${He(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class Dm extends lt{clone(){return new Dm(null,De(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=De(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"key",i[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${He(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class Ic extends lt{clone(){return new Ic(null,De(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let i=0;for(const r of[[Sr,$r],[nr,Fr]]){const s=r.map(o=>{const a=Xt(n.encoding[o]);return J(a)?a.field:_s(a)?{expr:`${a.datum}`}:Nr(a)?{expr:`${a.value}`}:void 0});(s[0]||s[1])&&(t=new Ic(t,s,null,n.getName(`geojson_${i++}`)))}if(n.channelHasField(gi)){const r=n.typedFieldDef(gi);r.type===mc&&(t=new Ic(t,null,r.field,n.getName(`geojson_${i++}`)))}return t}constructor(t,n,i,r){super(t),this.fields=n,this.geojson=i,this.signal=r}dependentFields(){const t=(this.fields??[]).filter(se);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${He(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class Eh extends lt{clone(){return new Eh(null,this.projection,De(this.fields),De(this.as))}constructor(t,n,i,r){super(t),this.projection=n,this.fields=i,this.as=r}static parseAll(t,n){if(!n.projectionName())return t;for(const i of[[Sr,$r],[nr,Fr]]){const r=i.map(o=>{const a=Xt(n.encoding[o]);return J(a)?a.field:_s(a)?{expr:`${a.datum}`}:Nr(a)?{expr:`${a.value}`}:void 0}),s=i[0]===nr?"2":"";(r[0]||r[1])&&(t=new Eh(t,n.projectionName(),r,[n.getName(`x${s}`),n.getName(`y${s}`)]))}return t}dependentFields(){return new Set(this.fields.filter(se))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${He(this.fields)} ${He(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Iu extends lt{clone(){return new Iu(null,De(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:n=0,stop:i,step:r}=t;return{signal:`sequence(${[n,i,...r?[r]:[]].join(",")})`}}static makeFromTransform(t,n){return new Iu(t,n)}static makeFromEncoding(t,n){const i=n.encoding,r=i.x,s=i.y;if(J(r)&&J(s)){const o=r.impute?r:s.impute?s:void 0;if(o===void 0)return;const a=r.impute?s:s.impute?r:void 0,{method:u,value:l,frame:c,keyvals:f}=o.impute,d=wR(n.mark,i);return new Iu(t,{impute:o.field,key:a.field,...u?{method:u}:{},...l!==void 0?{value:l}:{},...c?{frame:c}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${He(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:i,method:r,groupby:s,value:o,frame:a=[null,null]}=this.transform,u={type:"impute",field:t,key:n,...i?{keyvals:Zpe(i)?this.processSequence(i):i}:{},method:"value",...s?{groupby:s}:{},value:!r||r==="value"?o:null};if(r&&r!=="value"){const l={type:"window",as:[`imputed_${t}_value`],ops:[r],fields:[t],frame:a,ignorePeers:!1,...s?{groupby:s}:{}},c={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[u,l,c]}else return[u]}}class Tm extends lt{clone(){return new Tm(null,De(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=De(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${He(this.transform)}`}assemble(){const{loess:t,on:n,...i}=this.transform;return{type:"loess",x:n,y:t,...i}}}class Ch extends lt{clone(){return new Ch(null,De(this.transform),this.secondary)}constructor(t,n,i){super(t),this.transform=n,this.secondary=i}static make(t,n,i,r){const s=n.component.data.sources,{from:o}=i;let a=null;if(Jpe(o)){let u=hI(o.data,s);u||(u=new Ru(o.data),s.push(u));const l=n.getName(`lookup_${r}`);a=new yi(u,l,Ft.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[l]=a}else if(Qpe(o)){const u=o.param;i={as:u,...i};let l;try{l=n.getSelectionComponent(At(u),u)}catch{throw new Error(Fde(u))}if(a=l.materialized,!a)throw new Error(Dde(u))}return new Ch(t,i,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?oe(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${He({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:oe(this.transform.as)}:{}};else{let n=this.transform.as;se(n)||(Z(Ude),n="_lookup"),t={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class Mm extends lt{clone(){return new Mm(null,De(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=De(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"prob",i[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${He(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class Nm extends lt{clone(){return new Nm(null,De(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=De(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${He(this.transform)}`}assemble(){const{regression:t,on:n,...i}=this.transform;return{type:"regression",x:n,y:t,...i}}}class Rm extends lt{clone(){return new Rm(null,De(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=fs((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${He(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:i,limit:r,op:s}=this.transform;return{type:"pivot",field:t,value:n,...r!==void 0?{limit:r}:{},...s!==void 0?{op:s}:{},...i!==void 0?{groupby:i}:{}}}}class Om extends lt{clone(){return new Om(null,De(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${He(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function cI(e){let t=0;function n(i,r){if(i instanceof Ru&&!i.isGenerator&&!Cc(i.data)&&(e.push(r),r={name:null,source:r.name,transform:[]}),i instanceof In&&(i.parent instanceof Ru&&!r.source?(r.format={...r.format,parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof Nc){r.name||(r.name=`data_${t++}`),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source,e.push(...i.assemble());return}switch((i instanceof xh||i instanceof _h||i instanceof Rc||i instanceof Fc||i instanceof Dc||i instanceof Eh||i instanceof Ir||i instanceof Ch||i instanceof Oc||i instanceof Lu||i instanceof Dm||i instanceof Fm||i instanceof $m||i instanceof Tm||i instanceof Mm||i instanceof Nm||i instanceof va||i instanceof Om||i instanceof Rm||i instanceof Sm)&&r.transform.push(i.assemble()),(i instanceof $s||i instanceof Cs||i instanceof Iu||i instanceof go||i instanceof Ic)&&r.transform.push(...i.assemble()),i instanceof yi&&(r.source&&r.transform.length===0?i.setSource(r.source):i.parent instanceof yi?i.setSource(r.name):(r.name||(r.name=`data_${t++}`),i.setSource(r.name),i.numChildren()===1&&(e.push(r),r={name:null,source:r.name,transform:[]}))),i.numChildren()){case 0:i instanceof yi&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name=`data_${t++}`);let s=r.name;!r.source||r.transform.length>0?e.push(r):s=r.source;for(const o of i.children)n(o,{name:null,source:s,transform:[]});break}}}return n}function _ye(e){const t=[],n=cI(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function wye(e,t){const n=[],i=cI(n);let r=0;for(const o of e.sources){o.hasName()||(o.dataName=`source_${r++}`);const a=o.assemble();i(o,a)}for(const o of n)o.transform.length===0&&delete o.transform;let s=0;for(const[o,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(s++,0,n.splice(o,1)[0]);for(const o of n)for(const a of o.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const o of n)o.name in t&&(o.values=t[o.name]);return n}function Eye(e){return e==="top"||e==="left"||me(e)?"header":"footer"}function Cye(e){for(const t of ir)kye(e,t);dI(e,"x"),dI(e,"y")}function kye(e,t){var o;const{facet:n,config:i,child:r,component:s}=e;if(e.channelHasField(t)){const a=n[t],u=Mc("title",null,i,t);let l=xc(a,i,{allowDisabling:!0,includeDefault:u===void 0||!!u});r.component.layoutHeaders[t].title&&(l=W(l)?l.join(", "):l,l+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const c=Mc("labelOrient",a.header,i,t),f=a.header!==null?zt((o=a.header)==null?void 0:o.labels,i.header.labels,!0):!1,d=We(["bottom","right"],c)?"footer":"header";s.layoutHeaders[t]={title:a.header!==null?l:null,facetFieldDef:a,[d]:t==="facet"?[]:[fI(e,t,f)]}}}function fI(e,t,n){const i=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function dI(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=Yw(r,t),r.axis[t]==="shared"){const s=t==="x"?"column":"row",o=i[s];for(const a of n.component.axes[t]){const u=Eye(a.get("orient"));o[u]??(o[u]=[fI(e,s,!1)]);const l=vh(a,"main",e.config,{header:!0});l&&o[u][0].axes.push(l),a.mainExtracted=!0}}}}function Aye(e){f5(e),Lm(e,"width"),Lm(e,"height")}function $ye(e){f5(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";Lm(e,t),Lm(e,n)}function f5(e){for(const t of e.children)t.parseLayoutSize()}function Lm(e,t){const n=CL(t),i=T1(n),r=e.component.resolve,s=e.component.layoutSize;let o;for(const a of e.children){const u=a.component.layoutSize.getWithExplicit(n),l=r.scale[i]??AL(i,e);if(l==="independent"&&u.value==="step"){o=void 0;break}if(o){if(l==="independent"&&o.value!==u.value){o=void 0;break}o=ma(o,u,n,"")}else o=u}if(o){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);s.setWithExplicit(t,o)}else s.setWithExplicit(t,{explicit:!1,value:void 0})}function Sye(e){const{size:t,component:n}=e;for(const i of io){const r=mi(i);if(t[r]){const s=t[r];n.layoutSize.set(r,ws(s)?"step":s,!0)}else{const s=Fye(e,r);n.layoutSize.set(r,s,!1)}}}function Fye(e,t){const n=t==="width"?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const s=r.get("type"),o=r.get("range");if(on(s)){const a=rm(i.view,t);return yu(o)||ws(a)?"step":a}else return cw(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return cw(i.view,t);{const s=rm(i.view,t);return ws(s)?s.step:s}}}function d5(e,t,n){return ne(t,{suffix:`by_${ne(e)}`,...n})}class kh extends lI{constructor(t,n,i,r){super(t,"facet",n,i,r,t.resolve),this.child=y5(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!rh(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=Y(t),i={};for(const r of n){if(![Zs,Js].includes(r)){Z(R1(r,"facet"));break}const s=t[r];if(s.field===void 0){Z(x_(s,r));break}i[r]=this.initFacetFieldDef(s,r)}return i}initFacetFieldDef(t,n){const i=Z_(t,n);return i.header?i.header=yn(i.header):i.header===null&&(i.header=null),i}channelHasField(t){return X(this.facet,t)}fieldDef(t){return this.facet[t]}parseData(){this.component.data=Im(this),this.child.parseData()}parseLayoutSize(){f5(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection,Object.values(this.component.selection).some(t=>ks(t))&&w_(v_)}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),Cye(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const n of ir)for(const i of Hw){const r=this.component.layoutHeaders[n],s=r[i],{facetFieldDef:o}=r;if(o){const a=Mc("titleOrient",o.header,this.config,n);if(["right","bottom"].includes(a)){const u=wm(n,a);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[u]="end"}}if(s!=null&&s[0]){const a=n==="row"?"height":"width",u=i==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(t[u]??(t[u]={}),t[u][n]=.5),r.title&&(t.offset??(t.offset={}),t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:n}=this.facet,i=t?this.columnDistinctSignal():n?1:void 0;let r="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(r="none"),{...this.getHeaderLayoutMixins(),...i?{columns:i}:{},bounds:"full",align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof kh))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof kh?{...this.channelHasField("column")?{encode:{update:{columns:{field:ne(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],i=[];if(this.child instanceof kh){if(this.child.channelHasField("column")){const r=ne(this.child.facet.column);t.push(r),n.push("distinct"),i.push(`distinct_${r}`)}}else for(const r of io){const s=this.child.component.scales[r];if(s&&!s.merged){const o=s.get("type"),a=s.get("range");if(on(o)&&yu(a)){const u=Am(this.child,r),l=a5(u);l?(t.push(l),n.push("distinct"),i.push(`distinct_${l}`)):Z(b_(r))}}}return{fields:t,ops:n,as:i}}assembleFacet(){const{name:t,data:n}=this.component.data.facetRoot,{row:i,column:r}=this.facet,{fields:s,ops:o,as:a}=this.getCardinalityAggregateForChild(),u=[];for(const c of ir){const f=this.facet[c];if(f){u.push(ne(f));const{bin:d,sort:h}=f;if(_t(d)&&u.push(ne(f,{binSuffix:"end"})),oo(h)){const{field:p,op:g=W1}=h,m=d5(f,h);i&&r?(s.push(m),o.push("max"),a.push(m)):(s.push(p),o.push(g),a.push(m))}else if(W(h)){const p=Tc(f,c);s.push(p),o.push("max"),a.push(p)}}}const l=!!i&&!!r;return{name:t,data:n,groupby:u,...l||s.length>0?{aggregate:{...l?{cross:l}:{},...s.length?{fields:s,ops:o,as:a}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,i=n[t];return i?oo(i.sort)?[d5(i,i.sort,{expr:"datum"})]:W(i.sort)?[Tc(i,t,{expr:"datum"})]:[ne(i,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,i=n[t];if(i){const{sort:r}=i;return[(oo(r)?r.order:!W(r)&&r)||"ascending"]}return[]}assembleLabelTitle(){var r;const{facet:t,config:n}=this;if(t.facet)return Gw(t.facet,"facet",n);const i={row:["top","bottom"],column:["left","right"]};for(const s of Ww)if(t[s]){const o=Mc("labelOrient",(r=t[s])==null?void 0:r.header,n,s);if(i[s].includes(o))return Gw(t[s],s,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,i=_ye(n),r=t.assembleGroupEncodeEntry(!1),s=this.assembleLabelTitle()||t.assembleTitle(),o=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...s?{title:s}:{},...o?{style:o}:{},from:{facet:this.assembleFacet()},sort:{field:ir.map(u=>this.facetSortFields(u)).flat(),order:ir.map(u=>this.facetSortOrder(u)).flat()},...i.length>0?{data:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup(Oge(this,[]))}]}getMapping(){return this.facet}}function Dye(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const s of[n,i])if(oo(s.sort)){const{field:o,op:a=W1}=s.sort;e=r=new Lu(e,{joinaggregate:[{op:a,field:o,as:d5(s,s.sort,{forAs:!0})}],groupby:[ne(s)]})}return r}return null}function hI(e,t){var n,i,r,s;for(const o of t){const a=o.data;if(e.name&&o.hasName()&&e.name!==o.dataName)continue;const u=(n=e.format)==null?void 0:n.mesh,l=(i=a.format)==null?void 0:i.feature;if(u&&l)continue;const c=(r=e.format)==null?void 0:r.feature;if((c||l)&&c!==l)continue;const f=(s=a.format)==null?void 0:s.mesh;if(!((u||f)&&u!==f)){if(lh(e)&&lh(a)){if(Mi(e.values,a.values))return o}else if(Cc(e)&&Cc(a)){if(e.url===a.url)return o}else if(dO(e)&&e.name===o.dataName)return o}}return null}function Tye(e,t){if(e.data||!e.parent){if(e.data===null){const i=new Ru({values:[]});return t.push(i),i}const n=hI(e.data,t);if(n)return ya(e.data)||(n.data.format=AM({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new Ru(e.data);return t.push(i),i}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function Mye(e,t,n){let i=0;for(const r of t.transforms){let s,o;if(lge(r))o=e=new Dc(e,r),s="derived";else if(mw(r)){const a=w2e(r);o=e=In.makeWithAncestors(e,{},a,n)??e,e=new Fc(e,t,r.filter)}else if(rO(r))o=e=$s.makeFromTransform(e,r,t),s="number";else if(fge(r))s="date",n.getWithExplicit(r.field).value===void 0&&(e=new In(e,{[r.field]:s}),n.set(r.field,s,!1)),o=e=Cs.makeFromTransform(e,r);else if(dge(r))o=e=Ir.makeFromTransform(e,r),s="number",Tw(t)&&(e=new va(e));else if(iO(r))o=e=Ch.make(e,t,r,i++),s="derived";else if(oge(r))o=e=new Oc(e,r),s="number";else if(age(r))o=e=new Lu(e,r),s="number";else if(hge(r))o=e=go.makeFromTransform(e,r),s="derived";else if(pge(r))o=e=new Dm(e,r),s="derived";else if(gge(r))o=e=new Sm(e,r),s="derived";else if(uge(r))o=e=new Fm(e,r),s="derived";else if(ege(r))o=e=new Rm(e,r),s="derived";else if(sge(r))e=new Om(e,r);else if(cge(r))o=e=Iu.makeFromTransform(e,r),s="derived";else if(tge(r))o=e=new $m(e,r),s="derived";else if(nge(r))o=e=new Mm(e,r),s="derived";else if(ige(r))o=e=new Nm(e,r),s="derived";else if(rge(r))o=e=new Tm(e,r),s="derived";else{Z(Bde(r));continue}if(o&&s!==void 0)for(const a of o.producedFields()??[])n.set(a,s,!1)}return e}function Im(e){var m;let t=Tye(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,o=!(r&&(ya(r)||Cc(r)||lh(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new $ge;ya(r)?(hO(r)?t=new _h(t,r.sequence):vw(r)&&(t=new xh(t,r.graticule)),o.parseNothing=!0):((m=r==null?void 0:r.format)==null?void 0:m.parse)===null&&(o.parseNothing=!0),t=In.makeExplicit(t,e,o)??t,t=new va(t);const a=e.parent&&Lc(e.parent);(Dt(e)||Oi(e))&&a&&(t=$s.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=Mye(t,e,o));const u=C2e(e),l=E2e(e);t=In.makeWithAncestors(t,{},{...u,...l},o)??t,Dt(e)&&(t=Ic.parseAll(t,e),t=Eh.parseAll(t,e)),(Dt(e)||Oi(e))&&(a||(t=$s.makeFromEncoding(t,e)??t),t=Cs.makeFromEncoding(t,e)??t,t=Dc.parseAllForSortIndex(t,e));const c=t=Pm(Ft.Raw,e,t);if(Dt(e)){const y=Ir.makeFromEncoding(t,e);y&&(t=y,Tw(e)&&(t=new va(t))),t=Iu.makeFromEncoding(t,e)??t,t=go.makeFromEncoding(t,e)??t}let f,d;if(Dt(e)){const{markDef:y,mark:b,config:v}=e,x=gt("invalid",y,v),{marks:_,scales:E}=d=gO({invalid:x,isPath:ha(b)});_!==E&&E==="include-invalid-values"&&(f=t=Pm(Ft.PreFilterInvalid,e,t)),_==="exclude-invalid-values"&&(t=Rc.make(t,e,d)??t)}const h=t=Pm(Ft.Main,e,t);let p;if(Dt(e)&&d){const{marks:y,scales:b}=d;y==="include-invalid-values"&&b==="exclude-invalid-values"&&(t=Rc.make(t,e,d)??t,p=t=Pm(Ft.PostFilterInvalid,e,t))}Dt(e)&&vme(e,h);let g=null;if(Oi(e)){const y=e.getName("facet");t=Dye(t,e.facet)??t,g=new Nc(t,e,y,h.getSource()),n[y]=g}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:c,main:h,facetRoot:g,ancestorParse:o,preFilterInvalid:f,postFilterInvalid:p}}function Pm(e,t,n){const{outputNodes:i,outputNodeRefCounts:r}=t.component.data,s=t.getDataName(e),o=new yi(n,s,e,r);return i[s]=o,o}class Nye extends c5{constructor(t,n,i,r){var s,o,a,u;super(t,"concat",n,i,r,t.resolve),(((o=(s=t.resolve)==null?void 0:s.axis)==null?void 0:o.x)==="shared"||((u=(a=t.resolve)==null?void 0:a.axis)==null?void 0:u.y)==="shared")&&Z(Ide),this.children=this.getChildren(t).map((l,c)=>y5(l,this,this.getName(`concat_${c}`),void 0,r))}parseData(){this.component.data=Im(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of Y(t.component.selection))this.component.selection[n]=t.component.selection[n]}Object.values(this.component.selection).some(t=>ks(t))&&w_(v_)}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return im(t)?t.vconcat:lw(t)?t.hconcat:t.concat}parseLayoutSize(){$ye(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=Vw(this);for(const n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{const n=t.assembleTitle(),i=t.assembleGroupStyle(),r=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...i?{style:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}}function Rye(e){return e===!1||e===null}const Oye={disable:1,gridScale:1,scale:1,...gR,labelExpr:1,encode:1},pI=Y(Oye);class h5 extends lo{constructor(t={},n={},i=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=i}clone(){return new h5(De(this.explicit),De(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!Rye(this.get(t))}hasOrientSignalRef(){return me(this.explicit.orient)}}function Lye(e,t,n){const{encoding:i,config:r}=e,s=Xt(i[t])??Xt(i[gs(t)]),o=e.axis(t)||{},{format:a,formatType:u}=o;if(ku(u))return{text:Mr({fieldOrDatumDef:s,field:"datum.value",format:a,formatType:u,config:r}),...n};if(a===void 0&&u===void 0&&r.customFormatTypes){if(bc(s)==="quantitative"){if(vc(s)&&s.stack==="normalize"&&r.normalizedNumberFormatType)return{text:Mr({fieldOrDatumDef:s,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:Mr({fieldOrDatumDef:s,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(bc(s)==="temporal"&&r.timeFormatType&&J(s)&&!s.timeUnit)return{text:Mr({fieldOrDatumDef:s,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function Iye(e){return io.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[Wye(n,e)]),t),{})}const Pye={bottom:"top",top:"bottom",left:"right",right:"left"};function zye(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const s of Y(r.component.axes))n.axis[s]=Yw(e.component.resolve,s),n.axis[s]==="shared"&&(t[s]=Bye(t[s],r.component.axes[s]),t[s]||(n.axis[s]="independent",delete t[s]))}for(const r of io){for(const s of e.children)if(s.component.axes[r]){if(n.axis[r]==="independent"){t[r]=(t[r]??[]).concat(s.component.axes[r]);for(const o of s.component.axes[r]){const{value:a,explicit:u}=o.getWithExplicit("orient");if(!me(a)){if(i[a]>0&&!u){const l=Pye[a];i[a]>i[l]&&o.set("orient",l,!1)}i[a]++}}}delete s.component.axes[r]}if(n.axis[r]==="independent"&&t[r]&&t[r].length>1)for(const[s,o]of(t[r]||[]).entries())s>0&&o.get("grid")&&!o.explicit.grid&&(o.implicit.grid=!1)}}function Bye(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let i=0;in.clone());return e}function Uye(e,t){for(const n of pI){const i=ma(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,s)=>{switch(n){case"title":return iN(r,s);case"gridScale":return{explicit:r.explicit,value:zt(r.value,s.value)}}return om(r,s,n,"axis")});e.setWithExplicit(n,i)}return e}function jye(e,t,n,i,r){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(me(n.labelAngle)?n.labelAngle:Xd(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===bL(i,r))return!0}return e===n[t]}const qye=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function Wye(e,t){var y,b;let n=t.axis(e);const i=new h5,r=Xt(t.encoding[e]),{mark:s,config:o}=t,a=(n==null?void 0:n.orient)||((y=o[e==="x"?"axisX":"axisY"])==null?void 0:y.orient)||((b=o.axis)==null?void 0:b.orient)||Fme(e),u=t.getScaleComponent(e).get("type"),l=wme(e,u,a,t.config),c=n!==void 0?!n:jw("disable",o.style,n==null?void 0:n.style,l).configValue;if(i.set("disable",c,n!==void 0),c)return i;n=n||{};const f=Ame(r,n,e,o.style,l),d=KN(n.formatType,r,u),h=XN(r,r.type,n.format,n.formatType,o,!0),p={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:u,orient:a,labelAngle:f,format:h,formatType:d,mark:s,config:o};for(const v of pI){const x=v in gL?gL[v](p):mR(v)?n[v]:void 0,_=x!==void 0,E=jye(x,v,n,t,e);if(_&&E)i.set(v,x,E);else{const{configValue:w=void 0,configFrom:C=void 0}=mR(v)&&v!=="values"?jw(v,o.style,n.style,l):{},k=w!==void 0;_&&!k?i.set(v,x,E):(C!=="vgAxisConfig"||qye.has(v)&&k||uh(w)||me(w))&&i.set(v,w,!1)}}const g=n.encoding??{},m=pR.reduce((v,x)=>{if(!i.hasAxisPart(x))return v;const _=kL(g[x]??{},t),E=x==="labels"?Lye(t,e,_):_;return E!==void 0&&!ht(E)&&(v[x]={update:E}),v},{});return ht(m)||i.set("encode",m,!!n.encoding||n.labelAngle!==void 0),i}function Hye({encoding:e,size:t}){for(const n of io){const i=mi(n);ws(t[i])&&ga(e[n])&&(delete t[i],Z(gN(i)))}return t}const Gye={vgMark:"arc",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...ti("x",e,{defaultPos:"mid"}),...ti("y",e,{defaultPos:"mid"}),...fo(e,"radius"),...fo(e,"theta")})},Vye={vgMark:"area",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...fm("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...fm("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...Fw(e)})},Yye={vgMark:"rect",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...fo(e,"x"),...fo(e,"y")})},Xye={vgMark:"shape",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&J(n)&&n.type===mc?{field:ne(n,{expr:"datum"})}:{}}]}},Kye={vgMark:"image",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...fo(e,"x"),...fo(e,"y"),...$w(e,"url")})},Zye={vgMark:"line",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...ti("x",e,{defaultPos:"mid"}),...ti("y",e,{defaultPos:"mid"}),...vn("size",e,{vgChannel:"strokeWidth"}),...Fw(e)})},Jye={vgMark:"trail",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...ti("x",e,{defaultPos:"mid"}),...ti("y",e,{defaultPos:"mid"}),...vn("size",e),...Fw(e)})};function p5(e,t){const{config:n}=e;return{...rr(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...ti("x",e,{defaultPos:"mid"}),...ti("y",e,{defaultPos:"mid"}),...vn("size",e),...vn("angle",e),...Qye(e,n,t)}}function Qye(e,t,n){return n?{shape:{value:n}}:vn("shape",e)}const ebe={vgMark:"symbol",encodeEntry:e=>p5(e)},tbe={vgMark:"symbol",encodeEntry:e=>p5(e,"circle")},nbe={vgMark:"symbol",encodeEntry:e=>p5(e,"square")},ibe={vgMark:"rect",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...fo(e,"x"),...fo(e,"y")})},rbe={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...rr(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...fm("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...fm("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...vn("size",e,{vgChannel:"strokeWidth"})}}},sbe={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...rr(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...ti("x",e,{defaultPos:"mid"}),...ti("y",e,{defaultPos:"mid"}),...$w(e),...vn("size",e,{vgChannel:"fontSize"}),...vn("angle",e),...IO("align",obe(e.markDef,n,t)),...IO("baseline",abe(e.markDef,n,t)),...ti("radius",e,{defaultPos:null}),...ti("theta",e,{defaultPos:null})}}};function obe(e,t,n){if(gt("align",e,n)===void 0)return"center"}function abe(e,t,n){if(gt("baseline",e,n)===void 0)return"middle"}const zm={arc:Gye,area:Vye,bar:Yye,circle:tbe,geoshape:Xye,image:Kye,line:Zye,point:ebe,rect:ibe,rule:rbe,square:nbe,text:sbe,tick:{vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r=i==="horizontal"?"x":"y",s=i==="horizontal"?"y":"x",o=i==="horizontal"?"height":"width";return{...rr(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...fo(e,r),...ti(s,e,{defaultPos:"mid",vgChannel:s==="y"?"yc":"xc"}),[o]:Et(gt("thickness",n,t))}}},trail:Jye};function ube(e){if(We([B1,P1,h0e],e.mark)){const t=wR(e.mark,e.encoding);if(t.length>0)return lbe(e,t)}else if(e.mark===z1){const t=g_.some(n=>gt(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return cbe(e)}return g5(e)}const gI="faceted_path_";function lbe(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:gI+e.requestDataName(Ft.Main),data:e.requestDataName(Ft.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:g5(e,{fromPrefix:gI})}]}const mI="stack_group_";function cbe(e){var l;const[t]=g5(e,{fromPrefix:mI}),n=e.scaleName(e.stack.fieldChannel),i=(c={})=>e.vgField(e.stack.fieldChannel,c),r=(c,f)=>{const d=[i({prefix:"min",suffix:"start",expr:f}),i({prefix:"max",suffix:"start",expr:f}),i({prefix:"min",suffix:"end",expr:f}),i({prefix:"max",suffix:"end",expr:f})];return`${c}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let s,o;e.stack.fieldChannel==="x"?(s={...uc(t.encode.update,["y","yc","y2","height",...g_]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},o={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...hi(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(s={...uc(t.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},o={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...hi(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const c of g_){const f=ys(c,e.markDef,e.config);t.encode.update[c]?(s[c]=t.encode.update[c],delete t.encode.update[c]):f&&(s[c]=Et(f)),f&&(t.encode.update[c]={value:0})}const a=[];if(((l=e.stack.groupbyChannels)==null?void 0:l.length)>0)for(const c of e.stack.groupbyChannels){const f=e.fieldDef(c),d=ne(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(ne(f,{binSuffix:"end"}))}return s=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((c,f)=>{if(t.encode.update[f])return{...c,[f]:t.encode.update[f]};{const d=ys(f,e.markDef,e.config);return d!==void 0?{...c,[f]:Et(d)}:c}},s),s.stroke&&(s.strokeForeground={value:!0},s.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Ft.Main),name:mI+e.requestDataName(Ft.Main),groupby:a,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:s},marks:[{type:"group",encode:{update:o},marks:[t]}]}]}function fbe(e){const{encoding:t,stack:n,mark:i,markDef:r,config:s}=e,o=t.order;if(!(!W(o)&&Nr(o)&&Jx(o.value)||!o&&Jx(gt("order",r,s)))){if((W(o)||J(o))&&!n)return eN(o,{expr:"datum"});if(ha(i)){const a=r.orient==="horizontal"?"y":"x",u=t[a];if(J(u))return{field:a}}}}function g5(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:s}=e,o=zt(i.clip,dbe(e),hbe(e)),a=JM(i),u=r.key,l=fbe(e),c=pbe(e),f=gt("aria",i,s),d=zm[n].postEncodingTransform?zm[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:zm[n].vgMark,...o?{clip:o}:{},...a?{style:a}:{},...u?{key:u.field}:{},...l?{sort:l}:{},...c||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(Ft.Main)},encode:{update:zm[n].encodeEntry(e)},...d?{transform:d}:{}}]}function dbe(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t!=null&&t.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function hbe(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function pbe(e){if(!e.component.selection)return null;const t=Y(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=Y(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class yI extends lI{constructor(t,n,i,r={},s){super(t,"unit",n,i,s,void 0,BR(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[],this.correctDataNames=l=>{var c,f,d;return(c=l.from)!=null&&c.data&&(l.from.data=this.lookupDataSource(l.from.data),"time"in this.encoding&&(l.from.data=l.from.data+xO)),(d=(f=l.from)==null?void 0:f.facet)!=null&&d.data&&(l.from.facet.data=this.lookupDataSource(l.from.facet.data)),l};const o=xs(t.mark)?{...t.mark}:{type:t.mark},a=o.type;o.filled===void 0&&(o.filled=qpe(o,s,{graticule:t.data&&vw(t.data)}));const u=this.encoding=K0e(t.encoding||{},a,o.filled,s);this.markDef=XR(o,u,s),this.size=Hye({encoding:u,size:BR(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=YR(this.markDef,u),this.specifiedScales=this.initScales(a,u),this.specifiedAxes=this.initAxes(u),this.specifiedLegends=this.initLegends(u),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(l=>aw(l))}get hasProjection(){const{encoding:t}=this,n=this.mark===UN,i=t&&Vfe.some(r=>Ne(t[r]));return n||i}scaleDomain(t){const n=this.specifiedScales[t];return n?n.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,n){return d_.reduce((i,r)=>{const s=Xt(n[r]);return s&&(i[r]=this.initScale(s.scale??{})),i},{})}initScale(t){const{domain:n,range:i}=t,r=yn(t);return W(n)&&(r.domain=n.map(Ni)),W(i)&&(r.range=i.map(Ni)),r}initAxes(t){return io.reduce((n,i)=>{const r=t[i];if(Ne(r)||i===$t&&Ne(t.x2)||i===rn&&Ne(t.y2)){const s=Ne(r)?r.axis:void 0;n[i]=s&&this.initAxis({...s})}return n},{})}initAxis(t){const n=Y(t),i={};for(const r of n){const s=t[r];i[r]=uh(s)?XM(s):Ni(s)}return i}initLegends(t){return rde.reduce((n,i)=>{const r=Xt(t[i]);if(r&&ode(i)){const s=r.legend;n[i]=s&&yn(s)}return n},{})}parseData(){this.component.data=Im(this)}parseLayoutSize(){Sye(this)}parseSelections(){this.component.selection=bme(this,this.selection)}parseMarkGroup(){this.component.mark=ube(this)}parseAxesAndHeaders(){this.component.axes=Iye(this)}assembleSelectionTopLevelSignals(t){return Lge(this,t)}assembleSignals(){return[...hL(this),...Rge(this,[])]}assembleSelectionData(t){return Ige(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return Vw(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!Lc(this.parent))&&(t=CO(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return t!==void 0?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return $u(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return Rr(n)}typedFieldDef(t){const n=this.fieldDef(t);return ei(n)?n:null}}class m5 extends c5{constructor(t,n,i,r,s){super(t,"layer",n,i,s,t.resolve,t.view);const o={...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((a,u)=>{if(sm(a))return new m5(a,this,this.getName(`layer_${u}`),o,s);if(ao(a))return new yI(a,this,this.getName(`layer_${u}`),o,s);throw new Error(y_(a))})}parseData(){this.component.data=Im(this);for(const t of this.children)t.parseData()}parseLayoutSize(){Aye(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of Y(t.component.selection))this.component.selection[n]=t.component.selection[n]}Object.values(this.component.selection).some(t=>ks(t))&&w_(v_)}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){zye(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),hL(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),Vw(this))}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleGroupStyle(){const t=new Set;for(const i of this.children)for(const r of oe(i.assembleGroupStyle()))t.add(r);const n=Array.from(t);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const n of this.children)if(t=n.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return Pge(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),LL(this))}}function y5(e,t,n,i,r){if(H1(e))return new kh(e,t,n,r);if(sm(e))return new m5(e,t,n,i,r);if(ao(e))return new yI(e,t,n,i,r);if(vpe(e))return new Nye(e,t,n,r);throw new Error(y_(e))}function gbe(e,t={}){t.logger&&$he(t.logger),t.fieldTitle&&cR(t.fieldTitle);try{const n=GR(nl(t.config,e.config)),i=uO(e,n),r=y5(i,null,"",void 0,n);return r.parse(),B2e(r.component.data,r),{spec:ybe(r,mbe(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&She(),t.fieldTitle&&j0e()}}function mbe(e,t,n,i){const r=i.component.layoutSize.get("width"),s=i.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):se(t)&&(t={type:t}),r&&s&&Cge(t.type)){if(r==="step"&&s==="step")Z(oN()),t.type="pad";else if(r==="step"||s==="step"){const o=r==="step"?"width":"height";Z(oN(T1(o)));const a=o==="width"?"height":"width";t.type=kge(a)}}return{...Y(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...cO(n,!1),...cO(e,!0)}}function ybe(e,t,n={},i){const r=e.config?Tpe(e.config):void 0,s=wye(e.component.data,n),o=e.assembleSelectionData(s),a=e.assembleProjections(),u=e.assembleTitle(),l=e.assembleGroupStyle(),c=e.assembleGroupEncodeEntry(!0);let f=e.assembleLayoutSignals();f=f.filter(p=>(p.name==="width"||p.name==="height")&&p.value!==void 0?(t[p.name]=+p.value,!1):!0);const{params:d,...h}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...h,...u?{title:u}:{},...l?{style:l}:{},...c?{encode:{update:c}}:{},data:o,...a.length>0?{projections:a}:{},...e.assembleGroup([...f,...e.assembleSelectionTopLevelSignals([]),...PR(d)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const bbe=Ufe.version,vbe=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:fc,accessPathWithDatum:i_,accessWithDatumToUnescapedPath:ut,compile:gbe,contains:We,deepEqual:Mi,deleteNestedProperty:C1,duplicate:De,entries:ia,every:Qx,fieldIntersection:n_,flatAccessWithDatum:SM,getFirstDefined:zt,hasIntersection:e_,hasProperty:X,hash:He,internalField:TM,isBoolean:Gd,isEmpty:ht,isEqual:qfe,isInternalField:MM,isNullOrFalse:Jx,isNumeric:k1,keys:Y,logicalExpr:Vd,mergeDeep:AM,never:kM,normalize:uO,normalizeAngle:Xd,omit:hi,pick:uc,prefixGenerator:t_,removePathFromField:cc,replaceAll:du,replacePathInField:er,resetIdCounter:Hfe,setEqual:$M,some:lc,stringify:pt,titleCase:Yd,unique:fs,uniqueId:DM,vals:gn,varName:At,version:bbe},Symbol.toStringTag,{value:"Module"}));function bI(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var xbe="2.15.0",_be={version:xbe};const Pc="#fff",vI="#888",wbe={background:"#333",view:{stroke:vI},title:{color:Pc,subtitleColor:Pc},style:{"guide-label":{fill:Pc},"guide-title":{fill:Pc}},axis:{domainColor:Pc,gridColor:vI,tickColor:Pc}},Pu="#4572a7",Ebe={background:"#fff",arc:{fill:Pu},area:{fill:Pu},line:{stroke:Pu,strokeWidth:2},path:{stroke:Pu},rect:{fill:Pu},shape:{stroke:Pu},symbol:{fill:Pu,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},zu="#30a2da",b5="#cbcbcb",Cbe="#999",kbe="#333",xI="#f0f0f0",_I="#333",Abe={arc:{fill:zu},area:{fill:zu},axis:{domainColor:b5,grid:!0,gridColor:b5,gridWidth:1,labelColor:Cbe,labelFontSize:10,titleColor:kbe,tickColor:b5,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:xI,group:{fill:xI},legend:{labelColor:_I,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:_I,titleFontSize:14,titlePadding:10},line:{stroke:zu,strokeWidth:2},path:{stroke:zu,strokeWidth:.5},rect:{fill:zu},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:zu},bar:{binSpacing:2,fill:zu,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Bu="#000",$be={group:{fill:"#e5e5e5"},arc:{fill:Bu},area:{fill:Bu},line:{stroke:Bu},path:{stroke:Bu},rect:{fill:Bu},shape:{stroke:Bu},symbol:{fill:Bu,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},Sbe=22,Fbe="normal",wI="Benton Gothic, sans-serif",EI=11.5,Dbe="normal",Uu="#82c6df",v5="Benton Gothic Bold, sans-serif",CI="normal",kI=13,Ah={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"]},Tbe={background:"#ffffff",title:{anchor:"start",color:"#000000",font:v5,fontSize:Sbe,fontWeight:Fbe},arc:{fill:Uu},area:{fill:Uu},line:{stroke:Uu,strokeWidth:2},path:{stroke:Uu},rect:{fill:Uu},shape:{stroke:Uu},symbol:{fill:Uu,size:30},axis:{labelFont:wI,labelFontSize:EI,labelFontWeight:Dbe,titleFont:v5,titleFontSize:kI,titleFontWeight:CI},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:wI,labelFontSize:EI,symbolType:"square",titleFont:v5,titleFontSize:kI,titleFontWeight:CI},range:{category:Ah["category-6"],diverging:Ah["fireandice-6"],heatmap:Ah["fire-7"],ordinal:Ah["fire-7"],ramp:Ah["fire-7"]}},ju="#ab5787",Bm="#979797",Mbe={background:"#f9f9f9",arc:{fill:ju},area:{fill:ju},line:{stroke:ju},path:{stroke:ju},rect:{fill:ju},shape:{stroke:ju},symbol:{fill:ju,size:30},axis:{domainColor:Bm,domainWidth:.5,gridWidth:.2,labelColor:Bm,tickColor:Bm,tickWidth:.2,titleColor:Bm},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},qu="#3e5c69",Nbe={background:"#fff",arc:{fill:qu},area:{fill:qu},line:{stroke:qu},path:{stroke:qu},rect:{fill:qu},shape:{stroke:qu},symbol:{fill:qu},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},sr="#1696d2",AI="#000000",Rbe="#FFFFFF",Um="Lato",x5="Lato",Obe="Lato",Lbe="#DEDDDD",Ibe=18,$h={"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},Pbe={background:Rbe,title:{anchor:"start",fontSize:Ibe,font:Um},axisX:{domain:!0,domainColor:AI,domainWidth:1,grid:!1,labelFontSize:12,labelFont:x5,labelAngle:0,tickColor:AI,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:Um},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:Lbe,gridWidth:1,labelFontSize:12,labelFont:x5,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:Um,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:x5,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:Um,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:$h["six-groups-cat-1"],diverging:$h["diverging-colors"],heatmap:$h["diverging-colors"],ordinal:$h["six-groups-seq"],ramp:$h["shades-blue"]},area:{fill:sr},rect:{fill:sr},line:{color:sr,stroke:sr,strokeWidth:5},trail:{color:sr,stroke:sr,strokeWidth:0,size:1},path:{stroke:sr,strokeWidth:.5},point:{filled:!0},text:{font:Obe,color:sr,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:sr,stroke:null}},arc:{fill:sr},shape:{stroke:sr},symbol:{fill:sr,size:30}},Wu="#3366CC",$I="#ccc",jm="Arial, sans-serif",zbe={arc:{fill:Wu},area:{fill:Wu},path:{stroke:Wu},rect:{fill:Wu},shape:{stroke:Wu},symbol:{stroke:Wu},circle:{fill:Wu},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:jm,fontSize:12},"guide-title":{font:jm,fontSize:12},"group-title":{font:jm,fontSize:12}},title:{font:jm,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:$I,tickColor:$I,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},_5=e=>e*(1/3+1),SI=_5(9),FI=_5(10),DI=_5(12),Sh="Segoe UI",TI="wf_standard-font, helvetica, arial, sans-serif",MI="#252423",Fh="#605E5C",NI="transparent",Bbe="#C8C6C4",zr="#118DFF",Ube="#12239E",jbe="#E66C37",qbe="#6B007B",Wbe="#E044A7",Hbe="#744EC2",Gbe="#D9B300",Vbe="#D64550",RI=zr,OI="#DEEFFF",LI=[OI,RI],Ybe={view:{stroke:NI},background:NI,font:Sh,header:{titleFont:TI,titleFontSize:DI,titleColor:MI,labelFont:Sh,labelFontSize:FI,labelColor:Fh},axis:{ticks:!1,grid:!1,domain:!1,labelColor:Fh,labelFontSize:SI,titleFont:TI,titleColor:MI,titleFontSize:DI,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:Bbe,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:zr},line:{stroke:zr,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:Sh,fontSize:SI,fill:Fh},arc:{fill:zr},area:{fill:zr,line:!0,opacity:.6},path:{stroke:zr},rect:{fill:zr},point:{fill:zr,filled:!0,size:75},shape:{stroke:zr},symbol:{fill:zr,strokeWidth:1.5,size:50},legend:{titleFont:Sh,titleFontWeight:"bold",titleColor:Fh,labelFont:Sh,labelFontSize:FI,labelColor:Fh,symbolType:"circle",symbolSize:75},range:{category:[zr,Ube,jbe,qbe,Wbe,Hbe,Gbe,Vbe],diverging:LI,heatmap:LI,ordinal:[OI,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",RI]}},w5='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',Xbe='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',E5=400,qm={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},Kbe=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],Zbe=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function Wm({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",i=qm.gridBg[e],r=qm.textPrimary[e],s=qm.textSecondary[e],o=n==="dark"?Kbe:Zbe,a=n==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:a},area:{fill:a},path:{stroke:a},rect:{fill:a},shape:{stroke:a},symbol:{stroke:a},circle:{fill:a},view:{fill:i,stroke:i},group:{fill:i},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:w5,fontWeight:600},axis:{labelColor:s,labelFontSize:12,labelFont:Xbe,labelFontWeight:E5,titleColor:r,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:qm.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:w5,fill:s,fontWeight:E5},"guide-title":{font:w5,fill:s,fontWeight:E5}},range:{category:o,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const Jbe=Wm({theme:"white",background:"#ffffff"}),Qbe=Wm({theme:"g10",background:"#f4f4f4"}),e3e=Wm({theme:"g90",background:"#262626"}),t3e=Wm({theme:"g100",background:"#161616"}),n3e=_be.version,i3e=Object.freeze(Object.defineProperty({__proto__:null,carbong10:Qbe,carbong100:t3e,carbong90:e3e,carbonwhite:Jbe,dark:wbe,excel:Ebe,fivethirtyeight:Abe,ggplot2:$be,googlecharts:zbe,latimes:Tbe,powerbi:Ybe,quartz:Mbe,urbaninstitute:Pbe,version:n3e,vox:Nbe},Symbol.toStringTag,{value:"Module"}));function r3e(e,t,n,i){if(W(e))return`[${e.map(r=>t(se(r)?r:II(r,n))).join(", ")}]`;if(re(e)){let r="";const{title:s,image:o,...a}=e;s&&(r+=`

${t(s)}

`),o&&(r+=``);const u=Object.keys(a);if(u.length>0){r+="";for(const l of u){let c=a[l];c!==void 0&&(re(c)&&(c=II(c,n)),r+=``)}r+="
${t(l)}${t(c)}
"}return r||"{}"}return t(e)}function s3e(e){const t=[];return function(n,i){if(typeof i!="object"||i===null)return i;const r=t.indexOf(this)+1;return t.length=r,t.length>e?"[Object]":t.indexOf(i)>=0?"[Circular]":(t.push(i),i)}}function II(e,t){return JSON.stringify(e,s3e(t))}var o3e=`#vg-tooltip-element { visibility: hidden; padding: 8px; position: fixed; @@ -117,16 +117,16 @@ ${a}`)}return l}(e,"",0)}function ii(e,t,n){return e.fields=t||[],e.fname=n,e}fu #vg-tooltip-element.dark-theme td.key { color: #bfbfbf; } -`;const PI="vg-tooltip-element",i3e={offsetX:10,offsetY:10,id:PI,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:r3e,maxDepth:2,formatTooltip:e3e,baseURL:"",anchor:"cursor",position:["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]};function r3e(e){return String(e).replace(/&/g,"&").replace(/=0&&e.y>=0&&e.x+t.width<=window.innerWidth&&e.y+t.height<=window.innerHeight}function u3e(e,t,n){return e.clientX>=t.x&&e.clientX<=t.x+n.width&&e.clientY>=t.y&&e.clientY<=t.y+n.height}class l3e{constructor(t){this.options={...i3e,...t};const n=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const i=document.createElement("style");i.setAttribute("id",this.options.styleId),i.innerHTML=s3e(n);const r=document.head;r.childNodes.length>0?r.insertBefore(i,r.childNodes[0]):r.appendChild(i)}}tooltipHandler(t,n,i,r){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),r==null||r===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:s,y:o}=this.options.anchor==="mark"?o3e(t,n,i,this.el.getBoundingClientRect(),this.options):zI(n,this.el.getBoundingClientRect(),this.options);this.el.style.top=`${o}px`,this.el.style.left=`${s}px`}}/*! +`;const PI="vg-tooltip-element",a3e={offsetX:10,offsetY:10,id:PI,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:u3e,maxDepth:2,formatTooltip:r3e,baseURL:"",anchor:"cursor",position:["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]};function u3e(e){return String(e).replace(/&/g,"&").replace(/=0&&e.y>=0&&e.x+t.width<=window.innerWidth&&e.y+t.height<=window.innerHeight}function d3e(e,t,n){return e.clientX>=t.x&&e.clientX<=t.x+n.width&&e.clientY>=t.y&&e.clientY<=t.y+n.height}class h3e{constructor(t){this.options={...a3e,...t};const n=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const i=document.createElement("style");i.setAttribute("id",this.options.styleId),i.innerHTML=l3e(n);const r=document.head;r.childNodes.length>0?r.insertBefore(i,r.childNodes[0]):r.appendChild(i)}}tooltipHandler(t,n,i,r){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),r==null||r===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:s,y:o}=this.options.anchor==="mark"?c3e(t,n,i,this.el.getBoundingClientRect(),this.options):zI(n,this.el.getBoundingClientRect(),this.options);this.el.style.top=`${o}px`,this.el.style.left=`${s}px`}}/*! * https://github.com/Starcounter-Jack/JSON-Patch * (c) 2017-2022 Joachim Wester * MIT licensed - */var c3e=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)r.hasOwnProperty(s)&&(i[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),f3e=Object.prototype.hasOwnProperty;function C6(e,t){return f3e.call(e,t)}function k6(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n=48&&i<=57){t++;continue}return!1}return!0}function Hu(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function jI(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function $6(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t0&&u[c-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(l[h]===void 0?d=u.slice(0,c).join("/"):c==f-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),c++,Array.isArray(l)){if(h==="-")h=l.length;else{if(n&&!A6(h))throw new Rt("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,t,e);A6(h)&&(h=~~h)}if(c>=f){if(n&&t.op==="add"&&h>l.length)throw new Rt("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);var o=h3e[t.op].call(t,l,h,e);if(o.test===!1)throw new Rt("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}}else if(c>=f){var o=zc[t.op].call(t,l,h,e);if(o.test===!1)throw new Rt("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}if(l=l[h],n&&c0)throw new Rt('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new Rt("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new Rt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&$6(e.value))throw new Rt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var r=e.path.split("/").length,s=i.split("/").length;if(r!==s+1&&r!==s)throw new Rt("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==i)throw new Rt("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var o={op:"_get",path:e.from,value:void 0},a=HI([o],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new Rt("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new Rt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function HI(e,t,n){try{if(!Array.isArray(e))throw new Rt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Gm(Li(t),Li(e),n||!0);else{n=n||Vm;for(var i=0;i=48&&i<=57){t++;continue}return!1}return!0}function Hu(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function jI(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function $5(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t0&&u[c-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(l[h]===void 0?d=u.slice(0,c).join("/"):c==f-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),c++,Array.isArray(l)){if(h==="-")h=l.length;else{if(n&&!A5(h))throw new Rt("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,t,e);A5(h)&&(h=~~h)}if(c>=f){if(n&&t.op==="add"&&h>l.length)throw new Rt("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);var o=y3e[t.op].call(t,l,h,e);if(o.test===!1)throw new Rt("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}}else if(c>=f){var o=zc[t.op].call(t,l,h,e);if(o.test===!1)throw new Rt("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}if(l=l[h],n&&c0)throw new Rt('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new Rt("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new Rt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&$5(e.value))throw new Rt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var r=e.path.split("/").length,s=i.split("/").length;if(r!==s+1&&r!==s)throw new Rt("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==i)throw new Rt("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var o={op:"_get",path:e.from,value:void 0},a=HI([o],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new Rt("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new Rt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function HI(e,t,n){try{if(!Array.isArray(e))throw new Rt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Gm(Li(t),Li(e),n||!0);else{n=n||Vm;for(var i=0;i0&&(e.patches=[],e.callback&&e.callback(i)),i}function D6(e,t,n,i,r){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=k6(t),o=k6(e),a=!1,u=o.length-1;u>=0;u--){var l=o[u],c=e[l];if(C6(t,l)&&!(t[l]===void 0&&c!==void 0&&Array.isArray(t)===!1)){var f=t[l];typeof c=="object"&&c!=null&&typeof f=="object"&&f!=null&&Array.isArray(c)===Array.isArray(f)?D6(c,f,n,i+"/"+Hu(l),r):c!==f&&(r&&n.push({op:"test",path:i+"/"+Hu(l),value:Li(c)}),n.push({op:"replace",path:i+"/"+Hu(l),value:Li(f)}))}else Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+Hu(l),value:Li(c)}),n.push({op:"remove",path:i+"/"+Hu(l)}),a=!0):(r&&n.push({op:"test",path:i,value:e}),n.push({op:"replace",path:i,value:t}))}if(!(!a&&s.length==o.length))for(var u=0;u=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(n,i)}return this}}return T6=e,T6}var M6,VI;function N6(){if(VI)return M6;VI=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return M6=i=>i?typeof i!="object"?e:i:t,M6}var Ym={exports:{}},R6,YI;function O6(){if(YI)return R6;YI=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,r=t-6;return R6={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:r,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},R6}var L6,XI;function Xm(){return XI||(XI=1,L6=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),L6}var KI;function I6(){return KI||(KI=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=O6(),s=Xm();t=e.exports={};const o=t.re=[],a=t.safeRe=[],u=t.src=[],l=t.t={};let c=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",r],[f,i]],h=g=>{for(const[m,y]of d)g=g.split(`${m}*`).join(`${m}{0,${y}}`).split(`${m}+`).join(`${m}{1,${y}}`);return g},p=(g,m,y)=>{const b=h(m),v=c++;s(g,v,m),l[g]=v,u[v]=m,o[v]=new RegExp(m,y?"g":void 0),a[v]=new RegExp(b,y?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),p("FULL",`^${u[l.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),p("LOOSE",`^${u[l.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),p("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",u[l.COERCE],!0),p("COERCERTLFULL",u[l.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Ym,Ym.exports)),Ym.exports}var P6,ZI;function $3e(){if(ZI)return P6;ZI=1;const e=/^[0-9]+$/,t=(i,r)=>{const s=e.test(i),o=e.test(r);return s&&o&&(i=+i,r=+r),i===r?0:s&&!o?-1:o&&!s?1:it(r,i)},P6}var z6,JI;function B6(){if(JI)return z6;JI=1;const e=Xm(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=O6(),{safeRe:i,t:r}=I6(),s=N6(),{compareIdentifiers:o}=$3e();class a{constructor(l,c){if(c=s(c),l instanceof a){if(l.loose===!!c.loose&&l.includePrerelease===!!c.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",l,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const f=l.trim().match(c.loose?i[r.LOOSE]:i[r.FULL]);if(!f)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const h=+d;if(h>=0&&h=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(c===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(c){let h=[c,d];f===!1&&(h=[c]),o(this.prerelease[0],c)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return z6=a,z6}var U6,QI;function Bc(){if(QI)return U6;QI=1;const e=B6();return U6=(n,i,r)=>new e(n,r).compare(new e(i,r)),U6}var j6,eP;function S3e(){if(eP)return j6;eP=1;const e=Bc();return j6=(n,i,r)=>e(n,i,r)===0,j6}var q6,tP;function F3e(){if(tP)return q6;tP=1;const e=Bc();return q6=(n,i,r)=>e(n,i,r)!==0,q6}var W6,nP;function D3e(){if(nP)return W6;nP=1;const e=Bc();return W6=(n,i,r)=>e(n,i,r)>0,W6}var H6,iP;function T3e(){if(iP)return H6;iP=1;const e=Bc();return H6=(n,i,r)=>e(n,i,r)>=0,H6}var G6,rP;function M3e(){if(rP)return G6;rP=1;const e=Bc();return G6=(n,i,r)=>e(n,i,r)<0,G6}var V6,sP;function N3e(){if(sP)return V6;sP=1;const e=Bc();return V6=(n,i,r)=>e(n,i,r)<=0,V6}var Y6,oP;function R3e(){if(oP)return Y6;oP=1;const e=S3e(),t=F3e(),n=D3e(),i=T3e(),r=M3e(),s=N3e();return Y6=(a,u,l,c)=>{switch(u){case"===":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a===l;case"!==":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a!==l;case"":case"=":case"==":return e(a,l,c);case"!=":return t(a,l,c);case">":return n(a,l,c);case">=":return i(a,l,c);case"<":return r(a,l,c);case"<=":return s(a,l,c);default:throw new TypeError(`Invalid operator: ${u}`)}},Y6}var X6,aP;function O3e(){if(aP)return X6;aP=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,f){if(f=n(f),c instanceof t){if(c.loose===!!f.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),o("comparator",c,f),this.options=f,this.loose=!!f.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(c){const f=this.options.loose?i[r.COMPARATORLOOSE]:i[r.COMPARATOR],d=c.match(f);if(!d)throw new TypeError(`Invalid comparator: ${c}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(o("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return s(c,this.operator,this.semver,this.options)}intersects(c,f){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(c.value,f).test(this.value):c.operator===""?c.value===""?!0:new u(this.value,f).test(c.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||s(this.semver,"<",c.semver,f)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||s(this.semver,">",c.semver,f)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}X6=t;const n=N6(),{safeRe:i,t:r}=I6(),s=R3e(),o=Xm(),a=B6(),u=lP();return X6}var K6,uP;function lP(){if(uP)return K6;uP=1;const e=/\s+/g;class t{constructor(A,T){if(T=r(T),A instanceof t)return A.loose===!!T.loose&&A.includePrerelease===!!T.includePrerelease?A:new t(A.raw,T);if(A instanceof s)return this.raw=A.value,this.set=[[A]],this.formatted=void 0,this;if(this.options=T,this.loose=!!T.loose,this.includePrerelease=!!T.includePrerelease,this.raw=A.trim().replace(e," "),this.set=this.raw.split("||").map(B=>this.parseRange(B.trim())).filter(B=>B.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const B=this.set[0];if(this.set=this.set.filter(G=>!g(G[0])),this.set.length===0)this.set=[B];else if(this.set.length>1){for(const G of this.set)if(G.length===1&&m(G[0])){this.set=[G];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let A=0;A0&&(this.formatted+="||");const T=this.set[A];for(let B=0;B0&&(this.formatted+=" "),this.formatted+=T[B].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(A){const B=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+A,G=i.get(B);if(G)return G;const z=this.options.loose,ie=z?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];A=A.replace(ie,O(this.options.includePrerelease)),o("hyphen replace",A),A=A.replace(u[l.COMPARATORTRIM],c),o("comparator trim",A),A=A.replace(u[l.TILDETRIM],f),o("tilde trim",A),A=A.replace(u[l.CARETTRIM],d),o("caret trim",A);let be=A.split(" ").map(Fe=>b(Fe,this.options)).join(" ").split(/\s+/).map(Fe=>$(Fe,this.options));z&&(be=be.filter(Fe=>(o("loose invalid filter",Fe,this.options),!!Fe.match(u[l.COMPARATORLOOSE])))),o("range list",be);const he=new Map,Te=be.map(Fe=>new s(Fe,this.options));for(const Fe of Te){if(g(Fe))return[Fe];he.set(Fe.value,Fe)}he.size>1&&he.has("")&&he.delete("");const ct=[...he.values()];return i.set(B,ct),ct}intersects(A,T){if(!(A instanceof t))throw new TypeError("a Range is required");return this.set.some(B=>y(B,T)&&A.set.some(G=>y(G,T)&&B.every(z=>G.every(ie=>z.intersects(ie,T)))))}test(A){if(!A)return!1;if(typeof A=="string")try{A=new a(A,this.options)}catch{return!1}for(let T=0;TD.value==="<0.0.0-0",m=D=>D.value==="",y=(D,A)=>{let T=!0;const B=D.slice();let G=B.pop();for(;T&&B.length;)T=B.every(z=>G.intersects(z,A)),G=B.pop();return T},b=(D,A)=>(o("comp",D,A),D=E(D,A),o("caret",D),D=x(D,A),o("tildes",D),D=C(D,A),o("xrange",D),D=S(D,A),o("stars",D),D),v=D=>!D||D.toLowerCase()==="x"||D==="*",x=(D,A)=>D.trim().split(/\s+/).map(T=>_(T,A)).join(" "),_=(D,A)=>{const T=A.loose?u[l.TILDELOOSE]:u[l.TILDE];return D.replace(T,(B,G,z,ie,be)=>{o("tilde",D,B,G,z,ie,be);let he;return v(G)?he="":v(z)?he=`>=${G}.0.0 <${+G+1}.0.0-0`:v(ie)?he=`>=${G}.${z}.0 <${G}.${+z+1}.0-0`:be?(o("replaceTilde pr",be),he=`>=${G}.${z}.${ie}-${be} <${G}.${+z+1}.0-0`):he=`>=${G}.${z}.${ie} <${G}.${+z+1}.0-0`,o("tilde return",he),he})},E=(D,A)=>D.trim().split(/\s+/).map(T=>w(T,A)).join(" "),w=(D,A)=>{o("caret",D,A);const T=A.loose?u[l.CARETLOOSE]:u[l.CARET],B=A.includePrerelease?"-0":"";return D.replace(T,(G,z,ie,be,he)=>{o("caret",D,G,z,ie,be,he);let Te;return v(z)?Te="":v(ie)?Te=`>=${z}.0.0${B} <${+z+1}.0.0-0`:v(be)?z==="0"?Te=`>=${z}.${ie}.0${B} <${z}.${+ie+1}.0-0`:Te=`>=${z}.${ie}.0${B} <${+z+1}.0.0-0`:he?(o("replaceCaret pr",he),z==="0"?ie==="0"?Te=`>=${z}.${ie}.${be}-${he} <${z}.${ie}.${+be+1}-0`:Te=`>=${z}.${ie}.${be}-${he} <${z}.${+ie+1}.0-0`:Te=`>=${z}.${ie}.${be}-${he} <${+z+1}.0.0-0`):(o("no pr"),z==="0"?ie==="0"?Te=`>=${z}.${ie}.${be}${B} <${z}.${ie}.${+be+1}-0`:Te=`>=${z}.${ie}.${be}${B} <${z}.${+ie+1}.0-0`:Te=`>=${z}.${ie}.${be} <${+z+1}.0.0-0`),o("caret return",Te),Te})},C=(D,A)=>(o("replaceXRanges",D,A),D.split(/\s+/).map(T=>k(T,A)).join(" ")),k=(D,A)=>{D=D.trim();const T=A.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return D.replace(T,(B,G,z,ie,be,he)=>{o("xRange",D,B,G,z,ie,be,he);const Te=v(z),ct=Te||v(ie),Fe=ct||v(be),Ot=Fe;return G==="="&&Ot&&(G=""),he=A.includePrerelease?"-0":"",Te?G===">"||G==="<"?B="<0.0.0-0":B="*":G&&Ot?(ct&&(ie=0),be=0,G===">"?(G=">=",ct?(z=+z+1,ie=0,be=0):(ie=+ie+1,be=0)):G==="<="&&(G="<",ct?z=+z+1:ie=+ie+1),G==="<"&&(he="-0"),B=`${G+z}.${ie}.${be}${he}`):ct?B=`>=${z}.0.0${he} <${+z+1}.0.0-0`:Fe&&(B=`>=${z}.${ie}.0${he} <${z}.${+ie+1}.0-0`),o("xRange return",B),B})},S=(D,A)=>(o("replaceStars",D,A),D.trim().replace(u[l.STAR],"")),$=(D,A)=>(o("replaceGTE0",D,A),D.trim().replace(u[A.includePrerelease?l.GTE0PRE:l.GTE0],"")),O=D=>(A,T,B,G,z,ie,be,he,Te,ct,Fe,Ot)=>(v(B)?T="":v(G)?T=`>=${B}.0.0${D?"-0":""}`:v(z)?T=`>=${B}.${G}.0${D?"-0":""}`:ie?T=`>=${T}`:T=`>=${T}${D?"-0":""}`,v(Te)?he="":v(ct)?he=`<${+Te+1}.0.0-0`:v(Fe)?he=`<${Te}.${+ct+1}.0-0`:Ot?he=`<=${Te}.${ct}.${Fe}-${Ot}`:D?he=`<${Te}.${ct}.${+Fe+1}-0`:he=`<=${he}`,`${T} ${he}`.trim()),R=(D,A,T)=>{for(let B=0;B0){const G=D[B].semver;if(G.major===A.major&&G.minor===A.minor&&G.patch===A.patch)return!0}return!1}return!0};return K6}var Z6,cP;function L3e(){if(cP)return Z6;cP=1;const e=lP();return Z6=(n,i,r)=>{try{i=new e(i,r)}catch{return!1}return i.test(n)},Z6}var I3e=L3e(),fP=k3e(I3e);function P3e(e,t,n){const i=e.open(t),r=250,{origin:s}=new URL(t);let o=40;function a(l){l.source===i&&(o=0,e.removeEventListener("message",a,!1))}e.addEventListener("message",a,!1);function u(){o<=0||(i.postMessage(n,s),setTimeout(u,r),o-=1)}setTimeout(u,r)}var z3e=`.vega-embed { + */var S5=new WeakMap,x3e=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),_3e=function(){function e(t,n){this.callback=t,this.observer=n}return e}();function w3e(e){return S5.get(e)}function E3e(e,t){return e.observers.get(t)}function C3e(e,t){e.observers.delete(t.callback)}function k3e(e,t){t.unobserve()}function A3e(e,t){var n=[],i,r=w3e(e);if(!r)r=new x3e(e),S5.set(e,r);else{var s=E3e(r,t);i=s&&s.observer}if(i)return i;if(i={},r.value=Li(e),t){i.callback=t,i.next=null;var o=function(){F5(i)},a=function(){clearTimeout(i.next),i.next=setTimeout(o)};typeof window<"u"&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return i.patches=n,i.object=e,i.unobserve=function(){F5(i),clearTimeout(i.next),C3e(r,i),typeof window<"u"&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},r.observers.set(t,new _3e(t,i)),i}function F5(e,t){t===void 0&&(t=!1);var n=S5.get(e.object);D5(n.value,e.object,e.patches,"",t),e.patches.length&&Gm(n.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function D5(e,t,n,i,r){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=k5(t),o=k5(e),a=!1,u=o.length-1;u>=0;u--){var l=o[u],c=e[l];if(C5(t,l)&&!(t[l]===void 0&&c!==void 0&&Array.isArray(t)===!1)){var f=t[l];typeof c=="object"&&c!=null&&typeof f=="object"&&f!=null&&Array.isArray(c)===Array.isArray(f)?D5(c,f,n,i+"/"+Hu(l),r):c!==f&&(r&&n.push({op:"test",path:i+"/"+Hu(l),value:Li(c)}),n.push({op:"replace",path:i+"/"+Hu(l),value:Li(f)}))}else Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+Hu(l),value:Li(c)}),n.push({op:"remove",path:i+"/"+Hu(l)}),a=!0):(r&&n.push({op:"test",path:i,value:e}),n.push({op:"replace",path:i,value:t}))}if(!(!a&&s.length==o.length))for(var u=0;u=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(n,i)}return this}}return T5=e,T5}var M5,VI;function N5(){if(VI)return M5;VI=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return M5=i=>i?typeof i!="object"?e:i:t,M5}var Ym={exports:{}},R5,YI;function O5(){if(YI)return R5;YI=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,r=t-6;return R5={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:r,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},R5}var L5,XI;function Xm(){return XI||(XI=1,L5=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),L5}var KI;function I5(){return KI||(KI=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=O5(),s=Xm();t=e.exports={};const o=t.re=[],a=t.safeRe=[],u=t.src=[],l=t.t={};let c=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",r],[f,i]],h=g=>{for(const[m,y]of d)g=g.split(`${m}*`).join(`${m}{0,${y}}`).split(`${m}+`).join(`${m}{1,${y}}`);return g},p=(g,m,y)=>{const b=h(m),v=c++;s(g,v,m),l[g]=v,u[v]=m,o[v]=new RegExp(m,y?"g":void 0),a[v]=new RegExp(b,y?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),p("FULL",`^${u[l.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),p("LOOSE",`^${u[l.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),p("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",u[l.COERCE],!0),p("COERCERTLFULL",u[l.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Ym,Ym.exports)),Ym.exports}var P5,ZI;function T3e(){if(ZI)return P5;ZI=1;const e=/^[0-9]+$/,t=(i,r)=>{const s=e.test(i),o=e.test(r);return s&&o&&(i=+i,r=+r),i===r?0:s&&!o?-1:o&&!s?1:it(r,i)},P5}var z5,JI;function B5(){if(JI)return z5;JI=1;const e=Xm(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=O5(),{safeRe:i,t:r}=I5(),s=N5(),{compareIdentifiers:o}=T3e();class a{constructor(l,c){if(c=s(c),l instanceof a){if(l.loose===!!c.loose&&l.includePrerelease===!!c.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",l,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const f=l.trim().match(c.loose?i[r.LOOSE]:i[r.FULL]);if(!f)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const h=+d;if(h>=0&&h=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(c===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(c){let h=[c,d];f===!1&&(h=[c]),o(this.prerelease[0],c)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return z5=a,z5}var U5,QI;function Bc(){if(QI)return U5;QI=1;const e=B5();return U5=(n,i,r)=>new e(n,r).compare(new e(i,r)),U5}var j5,eP;function M3e(){if(eP)return j5;eP=1;const e=Bc();return j5=(n,i,r)=>e(n,i,r)===0,j5}var q5,tP;function N3e(){if(tP)return q5;tP=1;const e=Bc();return q5=(n,i,r)=>e(n,i,r)!==0,q5}var W5,nP;function R3e(){if(nP)return W5;nP=1;const e=Bc();return W5=(n,i,r)=>e(n,i,r)>0,W5}var H5,iP;function O3e(){if(iP)return H5;iP=1;const e=Bc();return H5=(n,i,r)=>e(n,i,r)>=0,H5}var G5,rP;function L3e(){if(rP)return G5;rP=1;const e=Bc();return G5=(n,i,r)=>e(n,i,r)<0,G5}var V5,sP;function I3e(){if(sP)return V5;sP=1;const e=Bc();return V5=(n,i,r)=>e(n,i,r)<=0,V5}var Y5,oP;function P3e(){if(oP)return Y5;oP=1;const e=M3e(),t=N3e(),n=R3e(),i=O3e(),r=L3e(),s=I3e();return Y5=(a,u,l,c)=>{switch(u){case"===":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a===l;case"!==":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a!==l;case"":case"=":case"==":return e(a,l,c);case"!=":return t(a,l,c);case">":return n(a,l,c);case">=":return i(a,l,c);case"<":return r(a,l,c);case"<=":return s(a,l,c);default:throw new TypeError(`Invalid operator: ${u}`)}},Y5}var X5,aP;function z3e(){if(aP)return X5;aP=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,f){if(f=n(f),c instanceof t){if(c.loose===!!f.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),o("comparator",c,f),this.options=f,this.loose=!!f.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(c){const f=this.options.loose?i[r.COMPARATORLOOSE]:i[r.COMPARATOR],d=c.match(f);if(!d)throw new TypeError(`Invalid comparator: ${c}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(o("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return s(c,this.operator,this.semver,this.options)}intersects(c,f){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(c.value,f).test(this.value):c.operator===""?c.value===""?!0:new u(this.value,f).test(c.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||s(this.semver,"<",c.semver,f)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||s(this.semver,">",c.semver,f)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}X5=t;const n=N5(),{safeRe:i,t:r}=I5(),s=P3e(),o=Xm(),a=B5(),u=lP();return X5}var K5,uP;function lP(){if(uP)return K5;uP=1;const e=/\s+/g;class t{constructor(A,M){if(M=r(M),A instanceof t)return A.loose===!!M.loose&&A.includePrerelease===!!M.includePrerelease?A:new t(A.raw,M);if(A instanceof s)return this.raw=A.value,this.set=[[A]],this.formatted=void 0,this;if(this.options=M,this.loose=!!M.loose,this.includePrerelease=!!M.includePrerelease,this.raw=A.trim().replace(e," "),this.set=this.raw.split("||").map(B=>this.parseRange(B.trim())).filter(B=>B.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const B=this.set[0];if(this.set=this.set.filter(G=>!g(G[0])),this.set.length===0)this.set=[B];else if(this.set.length>1){for(const G of this.set)if(G.length===1&&m(G[0])){this.set=[G];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let A=0;A0&&(this.formatted+="||");const M=this.set[A];for(let B=0;B0&&(this.formatted+=" "),this.formatted+=M[B].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(A){const B=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+A,G=i.get(B);if(G)return G;const z=this.options.loose,ie=z?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];A=A.replace(ie,O(this.options.includePrerelease)),o("hyphen replace",A),A=A.replace(u[l.COMPARATORTRIM],c),o("comparator trim",A),A=A.replace(u[l.TILDETRIM],f),o("tilde trim",A),A=A.replace(u[l.CARETTRIM],d),o("caret trim",A);let xe=A.split(" ").map(Fe=>b(Fe,this.options)).join(" ").split(/\s+/).map(Fe=>$(Fe,this.options));z&&(xe=xe.filter(Fe=>(o("loose invalid filter",Fe,this.options),!!Fe.match(u[l.COMPARATORLOOSE])))),o("range list",xe);const he=new Map,Te=xe.map(Fe=>new s(Fe,this.options));for(const Fe of Te){if(g(Fe))return[Fe];he.set(Fe.value,Fe)}he.size>1&&he.has("")&&he.delete("");const ft=[...he.values()];return i.set(B,ft),ft}intersects(A,M){if(!(A instanceof t))throw new TypeError("a Range is required");return this.set.some(B=>y(B,M)&&A.set.some(G=>y(G,M)&&B.every(z=>G.every(ie=>z.intersects(ie,M)))))}test(A){if(!A)return!1;if(typeof A=="string")try{A=new a(A,this.options)}catch{return!1}for(let M=0;MD.value==="<0.0.0-0",m=D=>D.value==="",y=(D,A)=>{let M=!0;const B=D.slice();let G=B.pop();for(;M&&B.length;)M=B.every(z=>G.intersects(z,A)),G=B.pop();return M},b=(D,A)=>(o("comp",D,A),D=E(D,A),o("caret",D),D=x(D,A),o("tildes",D),D=C(D,A),o("xrange",D),D=S(D,A),o("stars",D),D),v=D=>!D||D.toLowerCase()==="x"||D==="*",x=(D,A)=>D.trim().split(/\s+/).map(M=>_(M,A)).join(" "),_=(D,A)=>{const M=A.loose?u[l.TILDELOOSE]:u[l.TILDE];return D.replace(M,(B,G,z,ie,xe)=>{o("tilde",D,B,G,z,ie,xe);let he;return v(G)?he="":v(z)?he=`>=${G}.0.0 <${+G+1}.0.0-0`:v(ie)?he=`>=${G}.${z}.0 <${G}.${+z+1}.0-0`:xe?(o("replaceTilde pr",xe),he=`>=${G}.${z}.${ie}-${xe} <${G}.${+z+1}.0-0`):he=`>=${G}.${z}.${ie} <${G}.${+z+1}.0-0`,o("tilde return",he),he})},E=(D,A)=>D.trim().split(/\s+/).map(M=>w(M,A)).join(" "),w=(D,A)=>{o("caret",D,A);const M=A.loose?u[l.CARETLOOSE]:u[l.CARET],B=A.includePrerelease?"-0":"";return D.replace(M,(G,z,ie,xe,he)=>{o("caret",D,G,z,ie,xe,he);let Te;return v(z)?Te="":v(ie)?Te=`>=${z}.0.0${B} <${+z+1}.0.0-0`:v(xe)?z==="0"?Te=`>=${z}.${ie}.0${B} <${z}.${+ie+1}.0-0`:Te=`>=${z}.${ie}.0${B} <${+z+1}.0.0-0`:he?(o("replaceCaret pr",he),z==="0"?ie==="0"?Te=`>=${z}.${ie}.${xe}-${he} <${z}.${ie}.${+xe+1}-0`:Te=`>=${z}.${ie}.${xe}-${he} <${z}.${+ie+1}.0-0`:Te=`>=${z}.${ie}.${xe}-${he} <${+z+1}.0.0-0`):(o("no pr"),z==="0"?ie==="0"?Te=`>=${z}.${ie}.${xe}${B} <${z}.${ie}.${+xe+1}-0`:Te=`>=${z}.${ie}.${xe}${B} <${z}.${+ie+1}.0-0`:Te=`>=${z}.${ie}.${xe} <${+z+1}.0.0-0`),o("caret return",Te),Te})},C=(D,A)=>(o("replaceXRanges",D,A),D.split(/\s+/).map(M=>k(M,A)).join(" ")),k=(D,A)=>{D=D.trim();const M=A.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return D.replace(M,(B,G,z,ie,xe,he)=>{o("xRange",D,B,G,z,ie,xe,he);const Te=v(z),ft=Te||v(ie),Fe=ft||v(xe),Ot=Fe;return G==="="&&Ot&&(G=""),he=A.includePrerelease?"-0":"",Te?G===">"||G==="<"?B="<0.0.0-0":B="*":G&&Ot?(ft&&(ie=0),xe=0,G===">"?(G=">=",ft?(z=+z+1,ie=0,xe=0):(ie=+ie+1,xe=0)):G==="<="&&(G="<",ft?z=+z+1:ie=+ie+1),G==="<"&&(he="-0"),B=`${G+z}.${ie}.${xe}${he}`):ft?B=`>=${z}.0.0${he} <${+z+1}.0.0-0`:Fe&&(B=`>=${z}.${ie}.0${he} <${z}.${+ie+1}.0-0`),o("xRange return",B),B})},S=(D,A)=>(o("replaceStars",D,A),D.trim().replace(u[l.STAR],"")),$=(D,A)=>(o("replaceGTE0",D,A),D.trim().replace(u[A.includePrerelease?l.GTE0PRE:l.GTE0],"")),O=D=>(A,M,B,G,z,ie,xe,he,Te,ft,Fe,Ot)=>(v(B)?M="":v(G)?M=`>=${B}.0.0${D?"-0":""}`:v(z)?M=`>=${B}.${G}.0${D?"-0":""}`:ie?M=`>=${M}`:M=`>=${M}${D?"-0":""}`,v(Te)?he="":v(ft)?he=`<${+Te+1}.0.0-0`:v(Fe)?he=`<${Te}.${+ft+1}.0-0`:Ot?he=`<=${Te}.${ft}.${Fe}-${Ot}`:D?he=`<${Te}.${ft}.${+Fe+1}-0`:he=`<=${he}`,`${M} ${he}`.trim()),R=(D,A,M)=>{for(let B=0;B0){const G=D[B].semver;if(G.major===A.major&&G.minor===A.minor&&G.patch===A.patch)return!0}return!1}return!0};return K5}var Z5,cP;function B3e(){if(cP)return Z5;cP=1;const e=lP();return Z5=(n,i,r)=>{try{i=new e(i,r)}catch{return!1}return i.test(n)},Z5}var U3e=B3e(),fP=F3e(U3e);function j3e(e,t,n){const i=e.open(t),r=250,{origin:s}=new URL(t);let o=40;function a(l){l.source===i&&(o=0,e.removeEventListener("message",a,!1))}e.addEventListener("message",a,!1);function u(){o<=0||(i.postMessage(n,s),setTimeout(u,r),o-=1)}setTimeout(u,r)}var q3e=`.vega-embed { position: relative; display: inline-block; box-sizing: border-box; @@ -244,11 +244,11 @@ ${a}`)}return l}(e,"",0)}function ii(e,t,n){return e.fields=t||[],e.fname=n,e}fu transform: scale(1); } } -`;function dP(e,...t){for(const n of t)B3e(e,n);return e}function B3e(e,t){for(const n of Object.keys(t))il(e,n,t[n],!0)}const Ss=Afe;let Th=gbe;const Km=typeof window<"u"?window:void 0;Th===void 0&&((Ez=Km==null?void 0:Km.vl)!=null&&Ez.compile)&&(Th=Km.vl);const U3e={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},j3e={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},Mh={vega:"Vega","vega-lite":"Vega-Lite"},Zm={vega:Ss.version,"vega-lite":Th?Th.version:"not available"},q3e={vega:e=>e,"vega-lite":(e,t)=>Th.compile(e,{config:t}).spec},W3e=` +`;function dP(e,...t){for(const n of t)W3e(e,n);return e}function W3e(e,t){for(const n of Object.keys(t))il(e,n,t[n],!0)}const Ss=Dfe;let Th=vbe;const Km=typeof window<"u"?window:void 0;Th===void 0&&(($z=Km==null?void 0:Km.vl)!=null&&$z.compile)&&(Th=Km.vl);const H3e={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},G3e={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},Mh={vega:"Vega","vega-lite":"Vega-Lite"},Zm={vega:Ss.version,"vega-lite":Th?Th.version:"not available"},V3e={vega:e=>e,"vega-lite":(e,t)=>Th.compile(e,{config:t}).spec},Y3e=` -`,H3e="chart-wrapper";function G3e(e){return typeof e=="function"}function hP(e,t,n,i){const r=`${t}
`,s=`
${n}`,o=window.open("");o.document.write(r+e+s),o.document.title=`${Mh[i]} JSON Source`}function V3e(e,t){if(e.$schema){const n=bI(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${Mh[n.library]}, but mode argument sets ${Mh[t]??t}.`);const i=n.library;return fP(Zm[i],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${Mh[i]} ${n.version}, but the current version of ${Mh[i]} is v${Zm[i]}.`),i}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":t??"vega"}function pP(e){return!!(e&&"load"in e)}function gP(e){return pP(e)?e:Ss.loader(e)}function Y3e(e){var n;const t=((n=e.usermeta)==null?void 0:n.embedOptions)??{};return se(t.defaultStyle)&&(t.defaultStyle=!1),t}async function X3e(e,t,n={}){let i,r;se(t)?(r=gP(n.loader),i=JSON.parse(await r.load(t))):i=t;const s=Y3e(i),o=s.loader;(!r||o)&&(r=gP(n.loader??o));const a=await mP(s,r),u=await mP(n,r),l={...dP(u,a),config:nl(u.config??{},a.config??{})};return await Z3e(e,i,l,r)}async function mP(e,t){const n=se(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=se(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...i?{patch:i}:{},...n?{config:n}:{}}}function K3e(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}async function Z3e(e,t,n={},i){const r=n.theme?nl(Qbe[n.theme],n.config??{}):n.config,s=xo(n.actions)?n.actions:dP({},U3e,n.actions??{}),o={...j3e,...n.i18n},a=n.renderer??"canvas",u=n.logLevel??Ss.Warn,l=n.downloadFileName??"visualization",c=typeof e=="string"?document.querySelector(e):e;if(!c)throw new Error(`${e} does not exist`);if(n.defaultStyle!==!1){const _="vega-embed-style",{root:E,rootContainer:w}=K3e(c);if(!E.getElementById(_)){const C=document.createElement("style");C.id=_,C.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?z3e.toString():n.defaultStyle,w.appendChild(C)}}const f=V3e(t,n.mode);let d=q3e[f](t,r);if(f==="vega-lite"&&d.$schema){const _=bI(d.$schema);fP(Zm.vega,`^${_.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${_.version}, but current version is v${Zm.vega}.`)}c.classList.add("vega-embed"),s&&c.classList.add("has-actions"),c.innerHTML="";let h=c;if(s){const _=document.createElement("div");_.classList.add(H3e),c.appendChild(_),h=_}const p=n.patch;if(p&&(d=p instanceof Function?p(d):Gm(d,p,!0,!1).newDocument),n.formatLocale&&Ss.formatLocale(n.formatLocale),n.timeFormatLocale&&Ss.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const _ in n.expressionFunctions){const E=n.expressionFunctions[_];"fn"in E?Ss.expressionFunction(_,E.fn,E.visitor):E instanceof Function&&Ss.expressionFunction(_,E)}const{ast:g}=n,m=Ss.parse(d,f==="vega-lite"?{}:r,{ast:g}),y=new(n.viewClass||Ss.View)(m,{loader:i,logLevel:u,renderer:a,...g?{expr:Ss.expressionInterpreter??n.expr??Lfe}:{}});if(y.addSignalListener("autosize",(_,E)=>{const{type:w}=E;w=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):w=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):w=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const{loader:_,tooltip:E}=n,w=_&&!pP(_)?_==null?void 0:_.baseURL:void 0,C=G3e(E)?E:new l3e({baseURL:w,...E===!0?{}:E}).call;y.tooltip(C)}let{hover:b}=n;if(b===void 0&&(b=f==="vega"),b){const{hoverSet:_,updateSet:E}=typeof b=="boolean"?{}:b;y.hover(_,E)}n&&(n.width!=null&&y.width(n.width),n.height!=null&&y.height(n.height),n.padding!=null&&y.padding(n.padding)),await y.initialize(h,n.bind).runAsync();let v;if(s!==!1){let _=c;if(n.defaultStyle!==!1||n.forceActionsMenu){const w=document.createElement("details");w.title=o.CLICK_TO_VIEW_ACTIONS,c.append(w),_=w;const C=document.createElement("summary");C.innerHTML=W3e,w.append(C),v=k=>{w.contains(k.target)||w.removeAttribute("open")},document.addEventListener("click",v)}const E=document.createElement("div");if(_.append(E),E.classList.add("vega-actions"),s===!0||s.export!==!1){for(const w of["svg","png"])if(s===!0||s.export===!0||s.export[w]){const C=o[`${w.toUpperCase()}_ACTION`],k=document.createElement("a"),S=re(n.scaleFactor)?n.scaleFactor[w]:n.scaleFactor;k.text=C,k.href="#",k.target="_blank",k.download=`${l}.${w}`,k.addEventListener("mousedown",async function($){$.preventDefault();const O=await y.toImageURL(w,S);this.href=O}),E.append(k)}}if(s===!0||s.source!==!1){const w=document.createElement("a");w.text=o.SOURCE_ACTION,w.href="#",w.addEventListener("click",function(C){hP(b2(t),n.sourceHeader??"",n.sourceFooter??"",f),C.preventDefault()}),E.append(w)}if(f==="vega-lite"&&(s===!0||s.compiled!==!1)){const w=document.createElement("a");w.text=o.COMPILED_ACTION,w.href="#",w.addEventListener("click",function(C){hP(b2(d),n.sourceHeader??"",n.sourceFooter??"","vega"),C.preventDefault()}),E.append(w)}if(s===!0||s.editor!==!1){const w=n.editorUrl??"https://vega.github.io/editor/",C=document.createElement("a");C.text=o.EDITOR_ACTION,C.href="#",C.addEventListener("click",function(k){P3e(window,w,{config:r,mode:p?"vega":f,renderer:a,spec:b2(p?d:t)}),k.preventDefault()}),E.append(C)}}function x(){v&&document.removeEventListener("click",v),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:x,embedOptions:n}}const J3e=new Set(["width","height"]);function Q3e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var eve=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var i,r,s;if(Array.isArray(t)){if(i=t.length,i!=n.length)return!1;for(r=i;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),i=s.length,i!==Object.keys(n).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[r]))return!1;for(r=i;r--!==0;){var o=s[r];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n};const tve=Q3e(eve);function nve(e,t){for(const[n,i]of Object.entries(t))i&&(i&&{}.toString.call(i)==="[object Function]"?i(e.data(n)):e.change(n,Ao().remove(()=>!0).insert(i)))}function Jm(e={},t={},n=new Set){const i=Object.keys(e),r=Object.keys(t);return e===t||i.length===r.length&&i.filter(s=>!n.has(s)).every(s=>e[s]===t[s])}function yP(e,t){const n=Object.keys(t);for(const i of n)try{e.removeSignalListener(i,t[i])}catch(r){console.warn("Cannot remove invalid signal listener.",r)}return n.length>0}function J6(e,t){const n=Object.keys(t);for(const i of n)try{e.addSignalListener(i,t[i])}catch(r){console.warn("Cannot add invalid signal listener.",r)}return n.length>0}function ive(e){return new Set(e.flatMap(t=>Object.keys(t)))}function rve(e,t){if(e===t)return!1;const n={width:!1,height:!1,isExpensive:!1},i="width"in e||"width"in t,r="height"in e||"height"in t;return i&&(!("width"in e)||!("width"in t)||e.width!==t.width)&&("width"in e&&typeof e.width=="number"?n.width=e.width:n.isExpensive=!0),r&&(!("height"in e)||!("height"in t)||e.height!==t.height)&&("height"in e&&typeof e.height=="number"?n.height=e.height:n.isExpensive=!0),[...ive([e,t])].filter(o=>o!=="width"&&o!=="height").some(o=>!(o in e)||!(o in t)||!tve(e[o],t[o]))&&(n.isExpensive=!0),n.width!==!1||n.height!==!1||n.isExpensive?n:!1}function bP(e,t){const{width:n,height:i}=t;return typeof n<"u"&&typeof i<"u"?{...e,width:n,height:i}:typeof n<"u"?{...e,width:n}:typeof i<"u"?{...e,height:i}:e}function sve(e){let t;return{c(){t=H("div")},m(n,i){I(n,t,i),e[11](t)},p:ee,i:ee,o:ee,d(n){n&&L(t),e[11](null)}}}function ove(e,t,n){let{options:i}=t,{spec:r}=t,{view:s}=t,{signalListeners:o={}}=t,{data:a={}}=t;const u=l2();let l,c={},f={},d={},h={},p;w5(()=>{m()});async function g(){m();try{n(6,l=await X3e(p,r,i)),n(1,s=l.view),J6(s,o)&&s.runAsync(),b(s)}catch(_){y(_)}}function m(){l&&(l.finalize(),n(6,l=void 0),n(1,s=void 0))}function y(_){u("onError",{error:_}),console.warn(_)}function b(_){v(),u("onNewView",{view:_})}async function v(){a&&Object.keys(a).length>0&&l!==void 0&&(n(1,s=l.view),nve(s,a),await s.resize().runAsync())}function x(_){zi[_?"unshift":"push"](()=>{p=_,n(0,p)})}return e.$$set=_=>{"options"in _&&n(2,i=_.options),"spec"in _&&n(3,r=_.spec),"view"in _&&n(1,s=_.view),"signalListeners"in _&&n(4,o=_.signalListeners),"data"in _&&n(5,a=_.data)},e.$$.update=()=>{if(e.$$.dirty&1056&&(Jm(a,h)||v(),n(10,h=a)),e.$$.dirty&991&&p!==void 0){if(!Jm(i,c,J3e))g();else{const _=rve(bP(r,i),bP(d,c)),E=o,w=f;if(_){if(_.isExpensive)g();else if(l!==void 0){const C=!Jm(E,w);n(1,s=l.view),_.width!==!1&&s.width(_.width),_.height!==!1&&s.height(_.height),C&&(w&&yP(s,w),E&&J6(s,E)),s.runAsync()}}else!Jm(E,w)&&l!==void 0&&(n(1,s=l.view),w&&yP(s,w),E&&J6(s,E),s.runAsync())}n(7,c=i),n(8,f=o),n(9,d=r)}},[p,s,i,r,o,a,l,c,f,d,h,x]}class ave extends xe{constructor(t){super(),ve(this,t,ove,sve,ye,{options:2,spec:3,view:1,signalListeners:4,data:5})}}function uve(e){let t,n,i;function r(o){e[6](o)}let s={spec:e[1],data:e[2],signalListeners:e[3],options:e[4]};return e[0]!==void 0&&(s.view=e[0]),t=new ave({props:s}),zi.push(()=>g2(t,"view",r)),t.$on("onNewView",e[7]),t.$on("onError",e[8]),{c(){de(t.$$.fragment)},m(o,a){ce(t,o,a),i=!0},p(o,[a]){const u={};a&2&&(u.spec=o[1]),a&4&&(u.data=o[2]),a&8&&(u.signalListeners=o[3]),a&16&&(u.options=o[4]),!n&&a&1&&(n=!0,u.view=o[0],h2(()=>n=!1)),t.$set(u)},i(o){i||(F(t.$$.fragment,o),i=!0)},o(o){N(t.$$.fragment,o),i=!1},d(o){fe(t,o)}}}const lve="vega";function cve(e,t,n){let i,{spec:r}=t,{options:s={}}=t,{data:o={}}=t,{signalListeners:a={}}=t,{view:u=void 0}=t;function l(d){u=d,n(0,u)}function c(d){k5.call(this,e,d)}function f(d){k5.call(this,e,d)}return e.$$set=d=>{"spec"in d&&n(1,r=d.spec),"options"in d&&n(5,s=d.options),"data"in d&&n(2,o=d.data),"signalListeners"in d&&n(3,a=d.signalListeners),"view"in d&&n(0,u=d.view)},e.$$.update=()=>{e.$$.dirty&32&&n(4,i={...s,mode:lve})},[u,r,o,a,i,s,l,c,f]}class vP extends xe{constructor(t){super(),ve(this,t,cve,uve,ye,{spec:1,options:5,data:2,signalListeners:3,view:0})}}function fve(e){let t,n;return t=new vP({props:{spec:e[1],options:e[0]}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.spec=i[1]),r&1&&(s.options=i[0]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function dve(e){let t,n;return t=new vP({props:{data:e[2],spec:e[1],options:e[0]}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,r){const s={};r&4&&(s.data=i[2]),r&2&&(s.spec=i[1]),r&1&&(s.options=i[0]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function hve(e){let t,n,i,r;const s=[dve,fve],o=[];function a(u,l){return u[2]&&u[1]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Me()},m(u,l){o[t].m(u,l),I(u,i,l),r=!0},p(u,[l]){let c=t;t=a(u),t===c?o[t].p(u,l):($e(),N(o[c],1,1,()=>{o[c]=null}),Se(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i))},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),o[t].d(u)}}}function pve(e,t,n){let i,r,s,{componentData:o}=t;return e.$$set=a=>{"componentData"in a&&n(3,o=a.componentData)},e.$$.update=()=>{e.$$.dirty&8&&n(2,{data:i,spec:r,options:s}=o,i,(n(1,r),n(3,o)),(n(0,s),n(3,o)))},[s,r,i,o]}class xP extends xe{constructor(t){super(),ve(this,t,pve,hve,ye,{componentData:3})}}function gve(e){var r;let t,n=(((r=e[0])==null?void 0:r.text)||"")+"",i;return{c(){t=H("p"),i=Be(n),M(t,"data-component","text")},m(s,o){I(s,t,o),V(t,i)},p(s,[o]){var a;o&1&&n!==(n=(((a=s[0])==null?void 0:a.text)||"")+"")&&ft(i,n)},i:ee,o:ee,d(s){s&&L(t)}}}function mve(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class _P extends xe{constructor(t){super(),ve(this,t,mve,gve,ye,{componentData:0})}}function yve(e){let t,n,i=e[0].data+"",r,s,o;return{c(){t=H("pre"),n=H("code"),r=Be(i),s=Be(` - `),o=Be(` -`),M(n,"class","language-python"),M(t,"data-component","pythonCode")},m(a,u){I(a,t,u),V(t,n),V(n,r),V(n,s),e[2](n),V(t,o)},p(a,[u]){u&1&&i!==(i=a[0].data+"")&&ft(r,i)},i:ee,o:ee,d(a){a&&L(t),e[2](null)}}}function bve(e,t,n){let{componentData:i}=t,r;function s(){var a;r&&((a=window==null?void 0:window.Prism)==null||a.highlightElement(r))}function o(a){zi[a?"unshift":"push"](()=>{r=a,n(1,r)})}return e.$$set=a=>{"componentData"in a&&n(0,i=a.componentData)},e.$$.update=()=>{e.$$.dirty&2&&r&&s()},[i,r,o]}class wP extends xe{constructor(t){super(),ve(this,t,bve,yve,ye,{componentData:0})}}function vve(e){let t;return{c(){t=Be(e[0])},m(n,i){I(n,t,i)},p(n,i){i&1&&ft(t,n[0])},i:ee,o:ee,d(n){n&&L(t)}}}function xve(e){let t,n,i;var r=e[1];function s(o,a){return{props:{componentData:o[0]}}}return r&&(t=Ke(r,s(e))),{c(){t&&de(t.$$.fragment),n=Me()},m(o,a){t&&ce(t,o,a),I(o,n,a),i=!0},p(o,a){if(a&2&&r!==(r=o[1])){if(t){$e();const u=t;N(u.$$.fragment,1,0,()=>{fe(u,1)}),Se()}r?(t=Ke(r,s(o)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(r){const u={};a&1&&(u.componentData=o[0]),t.$set(u)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&fe(t,o)}}}function _ve(e){let t,n,i,r;const s=[xve,vve],o=[];function a(u,l){return u[1]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Me()},m(u,l){o[t].m(u,l),I(u,i,l),r=!0},p(u,[l]){let c=t;t=a(u),t===c?o[t].p(u,l):($e(),N(o[c],1,1,()=>{o[c]=null}),Se(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i))},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),o[t].d(u)}}}function wve(e,t,n){let{componentData:i}=t,r;const s={artifacts:N5,dag:H5,heading:K5,image:Q5,log:e4,markdown:E4,progressBar:$4,text:_P,vegaChart:xP,pythonCode:wP},o=i==null?void 0:i.type;return o&&(r=s==null?void 0:s[o],r||console.error("Unknown component type: ",o)),e.$$set=a=>{"componentData"in a&&n(0,i=a.componentData)},[i,r]}class EP extends xe{constructor(t){super(),ve(this,t,wve,_ve,ye,{componentData:0})}}function CP(e,t,n){const i=e.slice();return i[3]=t[n],i[5]=n,i}function kP(e,t,n){const i=e.slice();return i[6]=t[n],i}function AP(e){let t,n,i,r,s=Ue(e[1]),o=[];for(let u=0;uN(o[u],1,1,()=>{o[u]=null});return{c(){t=H("div"),n=H("table"),i=H("tbody");for(let u=0;uN(l[f],1,1,()=>{l[f]=null});return{c(){t=H("tr"),n=H("td"),r=Be(i),s=We();for(let f=0;f{i=null}),Se())},i(r){n||(F(i),n=!0)},o(r){N(i),n=!1},d(r){r&&L(t),i&&i.d(r)}}}function Cve(e,t,n){let i,r,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(2,s=o.componentData)},e.$$.update=()=>{e.$$.dirty&4&&n(1,{columns:i,data:r}=s,i,(n(0,r),n(2,s)))},[r,i,s]}class kve extends xe{constructor(t){super(),ve(this,t,Cve,Eve,ye,{componentData:2})}}function FP(e,t,n){const i=e.slice();return i[3]=t[n],i}function DP(e,t,n){const i=e.slice();return i[6]=t[n],i}function TP(e,t,n){const i=e.slice();return i[9]=t[n],i}function MP(e){let t,n,i,r,s,o,a,u=Ue(e[1]),l=[];for(let h=0;hN(f[h],1,1,()=>{f[h]=null});return{c(){t=H("div"),n=H("table"),i=H("thead"),r=H("tr");for(let h=0;hN(s[a],1,1,()=>{s[a]=null});return{c(){t=H("tr");for(let a=0;a{i=null}),Se())},i(r){n||(F(i),n=!0)},o(r){N(i),n=!1},d(r){r&&L(t),i&&i.d(r)}}}function $ve(e,t,n){let i,r,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(2,s=o.componentData)},e.$$.update=()=>{e.$$.dirty&4&&n(1,{columns:i,data:r}=s,i,(n(0,r),n(2,s)))},[r,i,s]}class Sve extends xe{constructor(t){super(),ve(this,t,$ve,Ave,ye,{componentData:2})}}function LP(e){let t,n,i;var r=e[3];function s(o,a){return{props:{componentData:o[0]}}}return r&&(t=Ke(r,s(e))),{c(){t&&de(t.$$.fragment),n=Me()},m(o,a){t&&ce(t,o,a),I(o,n,a),i=!0},p(o,a){if(r!==(r=o[3])){if(t){$e();const u=t;N(u.$$.fragment,1,0,()=>{fe(u,1)}),Se()}r?(t=Ke(r,s(o)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(r){const u={};a&1&&(u.componentData=o[0]),t.$set(u)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&fe(t,o)}}}function Fve(e){let t,n,i=e[2]&&e[1]&&LP(e);return{c(){i&&i.c(),t=Me()},m(r,s){i&&i.m(r,s),I(r,t,s),n=!0},p(r,[s]){r[2]&&r[1]?i?(i.p(r,s),s&6&&F(i,1)):(i=LP(r),i.c(),F(i,1),i.m(t.parentNode,t)):i&&($e(),N(i,1,1,()=>{i=null}),Se())},i(r){n||(F(i),n=!0)},o(r){N(i),n=!1},d(r){r&&L(t),i&&i.d(r)}}}function Dve(e,t,n){let i,r,s,{componentData:o}=t;const a=s?kve:Sve;return e.$$set=u=>{"componentData"in u&&n(0,o=u.componentData)},e.$$.update=()=>{e.$$.dirty&1&&n(2,{columns:i,data:r,vertical:s}=o,i,(n(1,r),n(0,o)))},[o,r,i,a]}class Tve extends xe{constructor(t){super(),ve(this,t,Dve,Fve,ye,{componentData:0})}}function IP(e,t,n){const i=e.slice();return i[3]=t[n],i}function Mve(e){let t,n,i,r;const s=[Rve,Nve],o=[];function a(u,l){var c;return(u[0].type==="page"||u[0].type==="section")&&((c=u[0])!=null&&c.contents)?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Me()},m(u,l){o[t].m(u,l),I(u,i,l),r=!0},p(u,l){let c=t;t=a(u),t===c?o[t].p(u,l):($e(),N(o[c],1,1,()=>{o[c]=null}),Se(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i))},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),o[t].d(u)}}}function Nve(e){let t,n,i;var r=e[1];function s(o,a){return{props:{componentData:o[0]}}}return r&&(t=Ke(r,s(e))),{c(){t&&de(t.$$.fragment),n=Me()},m(o,a){t&&ce(t,o,a),I(o,n,a),i=!0},p(o,a){if(r!==(r=o[1])){if(t){$e();const u=t;N(u.$$.fragment,1,0,()=>{fe(u,1)}),Se()}r?(t=Ke(r,s(o)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(r){const u={};a&1&&(u.componentData=o[0]),t.$set(u)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&fe(t,o)}}}function Rve(e){let t,n,i;var r=e[1];function s(o,a){return{props:{componentData:o[0],$$slots:{default:[Ove]},$$scope:{ctx:o}}}}return r&&(t=Ke(r,s(e))),{c(){t&&de(t.$$.fragment),n=Me()},m(o,a){t&&ce(t,o,a),I(o,n,a),i=!0},p(o,a){if(r!==(r=o[1])){if(t){$e();const u=t;N(u.$$.fragment,1,0,()=>{fe(u,1)}),Se()}r?(t=Ke(r,s(o)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(r){const u={};a&1&&(u.componentData=o[0]),a&65&&(u.$$scope={dirty:a,ctx:o}),t.$set(u)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&fe(t,o)}}}function PP(e){let t,n;return t=new Q6({props:{componentData:e[3]}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.componentData=i[3]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function Ove(e){let t,n,i=Ue(e[0].contents),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{"componentData"in o&&n(0,i=o.componentData)},[i,s]}class Q6 extends xe{constructor(t){super(),ve(this,t,Ive,Lve,ye,{componentData:0})}}function Pve(e){let t,n,i;const r=e[1].default,s=mt(r,e,e[0],null);return{c(){t=H("main"),n=H("div"),s&&s.c(),M(n,"class","mainContainer svelte-mqeomk"),M(t,"class","svelte-mqeomk")},m(o,a){I(o,t,a),V(t,n),s&&s.m(n,null),i=!0},p(o,[a]){s&&s.p&&(!i||a&1)&&bt(s,r,o,o[0],i?yt(r,o[0],a,null):vt(o[0]),null)},i(o){i||(F(s,o),i=!0)},o(o){N(s,o),i=!1},d(o){o&&L(t),s&&s.d(o)}}}function zve(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class Bve extends xe{constructor(t){super(),ve(this,t,zve,Pve,ye,{})}}const Nh=/^[a-z0-9]+(-[a-z0-9]+)*$/,Qm=(e,t,n,i="")=>{const r=e.split(":");if(e.slice(0,1)==="@"){if(r.length<2||r.length>3)return null;i=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const a=r.pop(),u=r.pop(),l={provider:r.length>0?r[0]:i,prefix:u,name:a};return t&&!e2(l)?null:l}const s=r[0],o=s.split("-");if(o.length>1){const a={provider:i,prefix:o.shift(),name:o.join("-")};return t&&!e2(a)?null:a}if(n&&i===""){const a={provider:i,prefix:"",name:s};return t&&!e2(a,n)?null:a}return null},e2=(e,t)=>e?!!((e.provider===""||e.provider.match(Nh))&&(t&&e.prefix===""||e.prefix.match(Nh))&&e.name.match(Nh)):!1,zP=Object.freeze({left:0,top:0,width:16,height:16}),t2=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),n2=Object.freeze({...zP,...t2}),e5=Object.freeze({...n2,body:"",hidden:!1});function Uve(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(n.rotate=i),n}function BP(e,t){const n=Uve(e,t);for(const i in e5)i in t2?i in e&&!(i in n)&&(n[i]=t2[i]):i in t?n[i]=t[i]:i in e&&(n[i]=e[i]);return n}function jve(e,t){const n=e.icons,i=e.aliases||Object.create(null),r=Object.create(null);function s(o){if(n[o])return r[o]=[];if(!(o in r)){r[o]=null;const a=i[o]&&i[o].parent,u=a&&s(a);u&&(r[o]=[a].concat(u))}return r[o]}return Object.keys(n).concat(Object.keys(i)).forEach(s),r}function qve(e,t,n){const i=e.icons,r=e.aliases||Object.create(null);let s={};function o(a){s=BP(i[a]||r[a],s)}return o(t),n.forEach(o),BP(e,s)}function UP(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(r=>{t(r,null),n.push(r)});const i=jve(e);for(const r in i){const s=i[r];s&&(t(r,qve(e,r,s)),n.push(r))}return n}const Wve={provider:"",aliases:{},not_found:{},...zP};function t5(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function jP(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!t5(e,Wve))return null;const n=t.icons;for(const r in n){const s=n[r];if(!r.match(Nh)||typeof s.body!="string"||!t5(s,e5))return null}const i=t.aliases||Object.create(null);for(const r in i){const s=i[r],o=s.parent;if(!r.match(Nh)||typeof o!="string"||!n[o]&&!i[o]||!t5(s,e5))return null}return t}const qP=Object.create(null);function Hve(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Vu(e,t){const n=qP[e]||(qP[e]=Object.create(null));return n[t]||(n[t]=Hve(e,t))}function n5(e,t){return jP(t)?UP(t,(n,i)=>{i?e.icons[n]=i:e.missing.add(n)}):[]}function Gve(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let Rh=!1;function WP(e){return typeof e=="boolean"&&(Rh=e),Rh}function Vve(e){const t=typeof e=="string"?Qm(e,!0,Rh):e;if(t){const n=Vu(t.provider,t.prefix),i=t.name;return n.icons[i]||(n.missing.has(i)?null:void 0)}}function Yve(e,t){const n=Qm(e,!0,Rh);if(!n)return!1;const i=Vu(n.provider,n.prefix);return Gve(i,n.name,t)}function Xve(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),Rh&&!t&&!e.prefix){let r=!1;return jP(e)&&(e.prefix="",UP(e,(s,o)=>{o&&Yve(s,o)&&(r=!0)})),r}const n=e.prefix;if(!e2({provider:t,prefix:n,name:"a"}))return!1;const i=Vu(t,n);return!!n5(i,e)}const HP=Object.freeze({width:null,height:null}),GP=Object.freeze({...HP,...t2}),Kve=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Zve=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function VP(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const i=e.split(Kve);if(i===null||!i.length)return e;const r=[];let s=i.shift(),o=Zve.test(s);for(;;){if(o){const a=parseFloat(s);isNaN(a)?r.push(s):r.push(Math.ceil(a*t*n)/n)}else r.push(s);if(s=i.shift(),s===void 0)return r.join("");o=!o}}function Jve(e,t="defs"){let n="";const i=e.indexOf("<"+t);for(;i>=0;){const r=e.indexOf(">",i),s=e.indexOf("",s);if(o===-1)break;n+=e.slice(r+1,s).trim(),e=e.slice(0,i).trim()+e.slice(o+1)}return{defs:n,content:e}}function Qve(e,t){return e?""+e+""+t:t}function e7e(e,t,n){const i=Jve(e);return Qve(i.defs,t+i.content+n)}const t7e=e=>e==="unset"||e==="undefined"||e==="none";function n7e(e,t){const n={...n2,...e},i={...GP,...t},r={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,i].forEach(g=>{const m=[],y=g.hFlip,b=g.vFlip;let v=g.rotate;y?b?v+=2:(m.push("translate("+(r.width+r.left).toString()+" "+(0-r.top).toString()+")"),m.push("scale(-1 1)"),r.top=r.left=0):b&&(m.push("translate("+(0-r.left).toString()+" "+(r.height+r.top).toString()+")"),m.push("scale(1 -1)"),r.top=r.left=0);let x;switch(v<0&&(v-=Math.floor(v/4)*4),v=v%4,v){case 1:x=r.height/2+r.top,m.unshift("rotate(90 "+x.toString()+" "+x.toString()+")");break;case 2:m.unshift("rotate(180 "+(r.width/2+r.left).toString()+" "+(r.height/2+r.top).toString()+")");break;case 3:x=r.width/2+r.left,m.unshift("rotate(-90 "+x.toString()+" "+x.toString()+")");break}v%2===1&&(r.left!==r.top&&(x=r.left,r.left=r.top,r.top=x),r.width!==r.height&&(x=r.width,r.width=r.height,r.height=x)),m.length&&(s=e7e(s,'',""))});const o=i.width,a=i.height,u=r.width,l=r.height;let c,f;o===null?(f=a===null?"1em":a==="auto"?l:a,c=VP(f,u/l)):(c=o==="auto"?u:o,f=a===null?VP(c,l/u):a==="auto"?l:a);const d={},h=(g,m)=>{t7e(m)||(d[g]=m.toString())};h("width",c),h("height",f);const p=[r.left,r.top,u,l];return d.viewBox=p.join(" "),{attributes:d,viewBox:p,body:s}}const i7e=/\sid="(\S+)"/g,r7e="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let s7e=0;function o7e(e,t=r7e){const n=[];let i;for(;i=i7e.exec(e);)n.push(i[1]);if(!n.length)return e;const r="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const o=typeof t=="function"?t(s):t+(s7e++).toString(),a=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+r+"$3")}),e=e.replace(new RegExp(r,"g"),""),e}const i5=Object.create(null);function a7e(e,t){i5[e]=t}function r5(e){return i5[e]||i5[""]}function s5(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const o5=Object.create(null),Oh=["https://api.simplesvg.com","https://api.unisvg.com"],i2=[];for(;Oh.length>0;)Oh.length===1||Math.random()>.5?i2.push(Oh.shift()):i2.push(Oh.pop());o5[""]=s5({resources:["https://api.iconify.design"].concat(i2)});function u7e(e,t){const n=s5(t);return n===null?!1:(o5[e]=n,!0)}function a5(e){return o5[e]}let YP=(()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}})();function l7e(e,t){const n=a5(e);if(!n)return 0;let i;if(!n.maxURL)i=0;else{let r=0;n.resources.forEach(o=>{r=Math.max(r,o.length)});const s=t+".json?icons=";i=n.maxURL-r-n.path.length-s.length}return i}function c7e(e){return e===404}const f7e=(e,t,n)=>{const i=[],r=l7e(e,t),s="icons";let o={type:s,provider:e,prefix:t,icons:[]},a=0;return n.forEach((u,l)=>{a+=u.length+1,a>=r&&l>0&&(i.push(o),o={type:s,provider:e,prefix:t,icons:[]},a=u.length),o.icons.push(u)}),i.push(o),i};function d7e(e){if(typeof e=="string"){const t=a5(e);if(t)return t.path}return"/"}const h7e={prepare:f7e,send:(e,t,n)=>{if(!YP){n("abort",424);return}let i=d7e(t.provider);switch(t.type){case"icons":{const s=t.prefix,a=t.icons.join(","),u=new URLSearchParams({icons:a});i+=s+".json?"+u.toString();break}case"custom":{const s=t.uri;i+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let r=503;YP(e+i).then(s=>{const o=s.status;if(o!==200){setTimeout(()=>{n(c7e(o)?"abort":"next",o)});return}return r=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",r)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",r)})}};function p7e(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((r,s)=>r.provider!==s.provider?r.provider.localeCompare(s.provider):r.prefix!==s.prefix?r.prefix.localeCompare(s.prefix):r.name.localeCompare(s.name));let i={provider:"",prefix:"",name:""};return e.forEach(r=>{if(i.name===r.name&&i.prefix===r.prefix&&i.provider===r.provider)return;i=r;const s=r.provider,o=r.prefix,a=r.name,u=n[s]||(n[s]=Object.create(null)),l=u[o]||(u[o]=Vu(s,o));let c;a in l.icons?c=t.loaded:o===""||l.missing.has(a)?c=t.missing:c=t.pending;const f={provider:s,prefix:o,name:a};c.push(f)}),t}function XP(e,t){e.forEach(n=>{const i=n.loaderCallbacks;i&&(n.loaderCallbacks=i.filter(r=>r.id!==t))})}function g7e(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const i=e.provider,r=e.prefix;t.forEach(s=>{const o=s.icons,a=o.pending.length;o.pending=o.pending.filter(u=>{if(u.prefix!==r)return!0;const l=u.name;if(e.icons[l])o.loaded.push({provider:i,prefix:r,name:l});else if(e.missing.has(l))o.missing.push({provider:i,prefix:r,name:l});else return n=!0,!0;return!1}),o.pending.length!==a&&(n||XP([e],s.id),s.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),s.abort))})}))}let m7e=0;function y7e(e,t,n){const i=m7e++,r=XP.bind(null,n,i);if(!t.pending.length)return r;const s={id:i,icons:t,callback:e,abort:r};return n.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(s)}),r}function b7e(e,t=!0,n=!1){const i=[];return e.forEach(r=>{const s=typeof r=="string"?Qm(r,t,n):r;s&&i.push(s)}),i}var v7e={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function x7e(e,t,n,i){const r=e.resources.length,s=e.random?Math.floor(Math.random()*r):e.index;let o;if(e.random){let E=e.resources.slice(0);for(o=[];E.length>1;){const w=Math.floor(Math.random()*E.length);o.push(E[w]),E=E.slice(0,w).concat(E.slice(w+1))}o=o.concat(E)}else o=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let u="pending",l=0,c,f=null,d=[],h=[];typeof i=="function"&&h.push(i);function p(){f&&(clearTimeout(f),f=null)}function g(){u==="pending"&&(u="aborted"),p(),d.forEach(E=>{E.status==="pending"&&(E.status="aborted")}),d=[]}function m(E,w){w&&(h=[]),typeof E=="function"&&h.push(E)}function y(){return{startTime:a,payload:t,status:u,queriesSent:l,queriesPending:d.length,subscribe:m,abort:g}}function b(){u="failed",h.forEach(E=>{E(void 0,c)})}function v(){d.forEach(E=>{E.status==="pending"&&(E.status="aborted")}),d=[]}function x(E,w,C){const k=w!=="success";switch(d=d.filter(S=>S!==E),u){case"pending":break;case"failed":if(k||!e.dataAfterTimeout)return;break;default:return}if(w==="abort"){c=C,b();return}if(k){c=C,d.length||(o.length?_():b());return}if(p(),v(),!e.random){const S=e.resources.indexOf(E.resource);S!==-1&&S!==e.index&&(e.index=S)}u="completed",h.forEach(S=>{S(C)})}function _(){if(u!=="pending")return;p();const E=o.shift();if(E===void 0){if(d.length){f=setTimeout(()=>{p(),u==="pending"&&(v(),b())},e.timeout);return}b();return}const w={status:"pending",resource:E,callback:(C,k)=>{x(w,C,k)}};d.push(w),l++,f=setTimeout(_,e.rotate),n(E,t,w.callback)}return setTimeout(_),y}function KP(e){const t={...v7e,...e};let n=[];function i(){n=n.filter(a=>a().status==="pending")}function r(a,u,l){const c=x7e(t,a,u,(f,d)=>{i(),l&&l(f,d)});return n.push(c),c}function s(a){return n.find(u=>a(u))||null}return{query:r,find:s,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:i}}function ZP(){}const u5=Object.create(null);function _7e(e){if(!u5[e]){const t=a5(e);if(!t)return;const n=KP(t),i={config:t,redundancy:n};u5[e]=i}return u5[e]}function w7e(e,t,n){let i,r;if(typeof e=="string"){const s=r5(e);if(!s)return n(void 0,424),ZP;r=s.send;const o=_7e(e);o&&(i=o.redundancy)}else{const s=s5(e);if(s){i=KP(s);const o=e.resources?e.resources[0]:"",a=r5(o);a&&(r=a.send)}}return!i||!r?(n(void 0,424),ZP):i.query(t,r,n)().abort}const JP="iconify2",Lh="iconify",QP=Lh+"-count",ez=Lh+"-version",tz=36e5,E7e=168,C7e=50;function l5(e,t){try{return e.getItem(t)}catch{}}function c5(e,t,n){try{return e.setItem(t,n),!0}catch{}}function nz(e,t){try{e.removeItem(t)}catch{}}function f5(e,t){return c5(e,QP,t.toString())}function d5(e){return parseInt(l5(e,QP))||0}const r2={local:!0,session:!0},iz={local:new Set,session:new Set};let h5=!1;function k7e(e){h5=e}let s2=typeof window>"u"?{}:window;function rz(e){const t=e+"Storage";try{if(s2&&s2[t]&&typeof s2[t].length=="number")return s2[t]}catch{}r2[e]=!1}function sz(e,t){const n=rz(e);if(!n)return;const i=l5(n,ez);if(i!==JP){if(i){const a=d5(n);for(let u=0;u{const u=Lh+a.toString(),l=l5(n,u);if(typeof l=="string"){try{const c=JSON.parse(l);if(typeof c=="object"&&typeof c.cached=="number"&&c.cached>r&&typeof c.provider=="string"&&typeof c.data=="object"&&typeof c.data.prefix=="string"&&t(c,a))return!0}catch{}nz(n,u)}};let o=d5(n);for(let a=o-1;a>=0;a--)s(a)||(a===o-1?(o--,f5(n,o)):iz[e].add(a))}function oz(){if(!h5){k7e(!0);for(const e in r2)sz(e,t=>{const n=t.data,i=t.provider,r=n.prefix,s=Vu(i,r);if(!n5(s,n).length)return!1;const o=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,o):o,!0})}}function A7e(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const i in r2)sz(i,r=>{const s=r.data;return r.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function $7e(e,t){h5||oz();function n(i){let r;if(!r2[i]||!(r=rz(i)))return;const s=iz[i];let o;if(s.size)s.delete(o=Array.from(s).shift());else if(o=d5(r),o>=C7e||!f5(r,o+1))return;const a={cached:Math.floor(Date.now()/tz),provider:e.provider,data:t};return c5(r,Lh+o.toString(),JSON.stringify(a))}t.lastModified&&!A7e(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function az(){}function S7e(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,g7e(e)}))}function F7e(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:i}=e,r=e.iconsToLoad;delete e.iconsToLoad;let s;if(!r||!(s=r5(n)))return;s.prepare(n,i,r).forEach(a=>{w7e(n,a,u=>{if(typeof u!="object")a.icons.forEach(l=>{e.missing.add(l)});else try{const l=n5(e,u);if(!l.length)return;const c=e.pendingIcons;c&&l.forEach(f=>{c.delete(f)}),$7e(e,u)}catch(l){console.error(l)}S7e(e)})})}))}const D7e=(e,t)=>{const n=b7e(e,!0,WP()),i=p7e(n);if(!i.pending.length){let u=!0;return t&&setTimeout(()=>{u&&t(i.loaded,i.missing,i.pending,az)}),()=>{u=!1}}const r=Object.create(null),s=[];let o,a;return i.pending.forEach(u=>{const{provider:l,prefix:c}=u;if(c===a&&l===o)return;o=l,a=c,s.push(Vu(l,c));const f=r[l]||(r[l]=Object.create(null));f[c]||(f[c]=[])}),i.pending.forEach(u=>{const{provider:l,prefix:c,name:f}=u,d=Vu(l,c),h=d.pendingIcons||(d.pendingIcons=new Set);h.has(f)||(h.add(f),r[l][c].push(f))}),s.forEach(u=>{const{provider:l,prefix:c}=u;r[l][c].length&&F7e(u,r[l][c])}),t?y7e(t,i,s):az};function T7e(e,t){const n={...e};for(const i in t){const r=t[i],s=typeof r;i in HP?(r===null||r&&(s==="string"||s==="number"))&&(n[i]=r):s===typeof n[i]&&(n[i]=i==="rotate"?r%4:r)}return n}const M7e=/[\s,]+/;function N7e(e,t){t.split(M7e).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function R7e(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function i(r){for(;r<0;)r+=4;return r%4}if(n===""){const r=parseInt(e);return isNaN(r)?0:i(r)}else if(n!==e){let r=0;switch(n){case"%":r=25;break;case"deg":r=90}if(r){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/r,s%1===0?i(s):0)}}return t}function O7e(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)n+=" "+i+'="'+t[i]+'"';return'"+e+""}function L7e(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function I7e(e){return"data:image/svg+xml,"+L7e(e)}function P7e(e){return'url("'+I7e(e)+'")'}const uz={...GP,inline:!1},z7e={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},B7e={display:"inline-block"},p5={"background-color":"currentColor"},lz={"background-color":"transparent"},cz={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},fz={"-webkit-mask":p5,mask:p5,background:lz};for(const e in fz){const t=fz[e];for(const n in cz)t[e+"-"+n]=cz[n]}function U7e(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}function j7e(e,t){const n=T7e(uz,t),i=t.mode||"svg",r=i==="svg"?{...z7e}:{};e.body.indexOf("xlink:")===-1&&delete r["xmlns:xlink"];let s=typeof t.style=="string"?t.style:"";for(let y in t){const b=t[y];if(b!==void 0)switch(y){case"icon":case"style":case"onLoad":case"mode":break;case"inline":case"hFlip":case"vFlip":n[y]=b===!0||b==="true"||b===1;break;case"flip":typeof b=="string"&&N7e(n,b);break;case"color":s=s+(s.length>0&&s.trim().slice(-1)!==";"?";":"")+"color: "+b+"; ";break;case"rotate":typeof b=="string"?n[y]=R7e(b):typeof b=="number"&&(n[y]=b);break;case"ariaHidden":case"aria-hidden":b!==!0&&b!=="true"&&delete r["aria-hidden"];break;default:if(y.slice(0,3)==="on:")break;uz[y]===void 0&&(r[y]=b)}}const o=n7e(e,n),a=o.attributes;if(n.inline&&(s="vertical-align: -0.125em; "+s),i==="svg"){Object.assign(r,a),s!==""&&(r.style=s);let y=0,b=t.id;return typeof b=="string"&&(b=b.replace(/-/g,"_")),{svg:!0,attributes:r,body:o7e(o.body,b?()=>b+"ID"+y++:"iconifySvelte")}}const{body:u,width:l,height:c}=e,f=i==="mask"||(i==="bg"?!1:u.indexOf("currentColor")!==-1),d=O7e(u,{...a,width:l+"",height:c+""}),p={"--svg":P7e(d)},g=y=>{const b=a[y];b&&(p[y]=U7e(b))};g("width"),g("height"),Object.assign(p,B7e,f?p5:lz);let m="";for(const y in p)m+=y+": "+p[y]+";";return r.style=m+s,{svg:!1,attributes:r}}if(WP(!0),a7e("",h7e),typeof document<"u"&&typeof window<"u"){oz();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!Xve(i))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const i="IconifyProviders["+n+"] is invalid.";try{const r=t[n];if(typeof r!="object"||!r||r.resources===void 0)continue;u7e(n,r)||console.error(i)}catch{console.error(i)}}}}function q7e(e,t,n,i,r){function s(){t.loading&&(t.loading.abort(),t.loading=null)}if(typeof e=="object"&&e!==null&&typeof e.body=="string")return t.name="",s(),{data:{...n2,...e}};let o;if(typeof e!="string"||(o=Qm(e,!1,!0))===null)return s(),null;const a=Vve(o);if(!a)return n&&(!t.loading||t.loading.name!==e)&&(s(),t.name="",t.loading={name:e,abort:D7e([o],i)}),null;s(),t.name!==e&&(t.name=e,r&&!t.destroyed&&r(e));const u=["iconify"];return o.prefix!==""&&u.push("iconify--"+o.prefix),o.provider!==""&&u.push("iconify--"+o.provider),{data:a,classes:u}}function W7e(e,t){return e?j7e({...n2,...e},t):null}function dz(e){let t;function n(s,o){return s[0].svg?G7e:H7e}let i=n(e),r=i(e);return{c(){r.c(),t=Me()},m(s,o){r.m(s,o),I(s,t,o)},p(s,o){i===(i=n(s))&&r?r.p(s,o):(r.d(1),r=i(s),r&&(r.c(),r.m(t.parentNode,t)))},d(s){s&&L(t),r.d(s)}}}function H7e(e){let t,n=[e[0].attributes],i={};for(let r=0;r{typeof t.onLoad=="function"&&t.onLoad(l),l2()("load",{icon:l})};function u(){n(3,s++,s)}return Wc(()=>{n(2,r=!0)}),w5(()=>{n(1,i.destroyed=!0,i),i.loading&&(i.loading.abort(),n(1,i.loading=null,i))}),e.$$set=l=>{n(6,t=Pe(Pe({},t),u2(l)))},e.$$.update=()=>{{const l=q7e(t.icon,i,r,u,a);n(0,o=l?W7e(l.data,t):null),o&&l.classes&&n(0,o.attributes.class=(typeof t.class=="string"?t.class+" ":"")+l.classes.join(" "),o)}},t=u2(t),[o,i,r,s]}class X7e extends xe{constructor(t){super(),ve(this,t,Y7e,V7e,ye,{})}}function hz(e){let t,n,i,r,s,o,a,u,l;return i=new X7e({props:{icon:"mdi:close"}}),o=new Q6({props:{componentData:e[1]}}),{c(){t=H("div"),n=H("span"),de(i.$$.fragment),r=We(),s=H("div"),de(o.$$.fragment),M(n,"class","cancelButton svelte-1hhf5ym"),M(s,"class","modalContainer"),M(t,"class","modal svelte-1hhf5ym"),M(t,"data-component","modal")},m(c,f){I(c,t,f),V(t,n),ce(i,n,null),V(t,r),V(t,s),ce(o,s,null),a=!0,u||(l=[Ku(s,"click",Z7e),Ku(t,"click",e[3])],u=!0)},p(c,f){const d={};f&2&&(d.componentData=c[1]),o.$set(d)},i(c){a||(F(i.$$.fragment,c),F(o.$$.fragment,c),a=!0)},o(c){N(i.$$.fragment,c),N(o.$$.fragment,c),a=!1},d(c){c&&L(t),fe(i),fe(o),u=!1,Xu(l)}}}function K7e(e){let t,n,i,r,s=e[0]&&e[1]&&hz(e);return{c(){s&&s.c(),t=Me()},m(o,a){s&&s.m(o,a),I(o,t,a),n=!0,i||(r=Ku(window,"keyup",e[2]),i=!0)},p(o,[a]){o[0]&&o[1]?s?(s.p(o,a),a&3&&F(s,1)):(s=hz(o),s.c(),F(s,1),s.m(t.parentNode,t)):s&&($e(),N(s,1,1,()=>{s=null}),Se())},i(o){n||(F(s),n=!0)},o(o){N(s),n=!1},d(o){o&&L(t),s&&s.d(o),i=!1,r()}}}const Z7e=e=>{e==null||e.stopImmediatePropagation()};function J7e(e,t,n){let i;zh(e,Hc,a=>n(1,i=a));let{componentData:r}=t;function s(a){a.code==="Escape"&&Hc.set(void 0)}function o(a){a.stopImmediatePropagation(),Hc.set(void 0)}return e.$$set=a=>{"componentData"in a&&n(0,r=a.componentData)},[r,i,s,o]}class Q7e extends xe{constructor(t){super(),ve(this,t,J7e,K7e,ye,{componentData:0})}}function pz(e,t,n){const i=e.slice();return i[2]=t[n][0],i[3]=t[n][1],i}function gz(e,t,n){const i=e.slice();return i[6]=t[n],i}function mz(e){let t,n=e[2]+"",i;return{c(){t=H("span"),i=Be(n),M(t,"class","pageId svelte-1kdpgko")},m(r,s){I(r,t,s),V(t,i)},p(r,s){s&1&&n!==(n=r[2]+"")&&ft(i,n)},d(r){r&&L(t)}}}function yz(e){let t,n,i=e[6]+"",r,s,o,a;function u(){return e[1](e[6])}return{c(){t=H("li"),n=H("button"),r=Be(i),s=We(),M(n,"class","textButton"),M(t,"class","sectionLink svelte-1kdpgko")},m(l,c){I(l,t,c),V(t,n),V(n,r),V(t,s),o||(a=Ku(n,"click",u),o=!0)},p(l,c){e=l,c&1&&i!==(i=e[6]+"")&&ft(r,i)},d(l){l&&L(t),o=!1,a()}}}function bz(e){let t,n,i,r,s=e[2]&&mz(e),o=Ue(e[3]||[]),a=[];for(let u=0;utxe(s);return e.$$set=s=>{"pageHierarchy"in s&&n(0,i=s.pageHierarchy)},[i,r]}class ixe extends xe{constructor(t){super(),ve(this,t,nxe,exe,ye,{pageHierarchy:0})}}const{Boolean:rxe}=Dz;function vz(e,t,n){const i=e.slice();return i[5]=t[n],i}function sxe(e){var i;let t,n;return t=new ixe({props:{pageHierarchy:F5((i=e[0])==null?void 0:i.components)}}),{c(){de(t.$$.fragment)},m(r,s){ce(t,r,s),n=!0},p(r,s){var a;const o={};s&1&&(o.pageHierarchy=F5((a=r[0])==null?void 0:a.components)),t.$set(o)},i(r){n||(F(t.$$.fragment,r),n=!0)},o(r){N(t.$$.fragment,r),n=!1},d(r){fe(t,r)}}}function xz(e){let t,n;return t=new Q6({props:{componentData:e[5]}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.componentData=i[5]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function oxe(e){var o;let t,n,i=Ue(((o=e[0])==null?void 0:o.components)||[]),r=[];for(let a=0;aN(r[a],1,1,()=>{r[a]=null});return{c(){for(let a=0;a{u=null}),Se())},i(l){a||(F(n.$$.fragment,l),F(r.$$.fragment,l),F(u),a=!0)},o(l){N(n.$$.fragment,l),N(r.$$.fragment,l),N(u),a=!1},d(l){l&&(L(t),L(s),L(o)),fe(n),fe(r),u&&u.d(l)}}}function uxe(e,t,n){let i,r;zh(e,wa,u=>n(0,i=u)),zh(e,Hc,u=>n(1,r=u));let{cardDataId:s}=t;qz(s);let a=!!new URLSearchParams(window==null?void 0:window.location.search).get("embed");return e.$$set=u=>{"cardDataId"in u&&n(3,s=u.cardDataId)},[i,r,a,s]}class lxe extends xe{constructor(t){super(),ve(this,t,uxe,axe,ye,{cardDataId:3})}}let wz;try{const e=window.mfCardDataId,t=window.mfContainerId,n=(Cz=document.querySelector(`[data-container="${t}"]`))==null?void 0:Cz.querySelector(".card_app");wz=new lxe({target:n??document.querySelector(".card_app"),props:{cardDataId:e}})}catch(e){throw new Error(e)}return wz}); +`,X3e="chart-wrapper";function K3e(e){return typeof e=="function"}function hP(e,t,n,i){const r=`${t}
`,s=`
${n}`,o=window.open("");o.document.write(r+e+s),o.document.title=`${Mh[i]} JSON Source`}function Z3e(e,t){if(e.$schema){const n=bI(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${Mh[n.library]}, but mode argument sets ${Mh[t]??t}.`);const i=n.library;return fP(Zm[i],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${Mh[i]} ${n.version}, but the current version of ${Mh[i]} is v${Zm[i]}.`),i}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":t??"vega"}function pP(e){return!!(e&&"load"in e)}function gP(e){return pP(e)?e:Ss.loader(e)}function J3e(e){var n;const t=((n=e.usermeta)==null?void 0:n.embedOptions)??{};return se(t.defaultStyle)&&(t.defaultStyle=!1),t}async function Q3e(e,t,n={}){let i,r;se(t)?(r=gP(n.loader),i=JSON.parse(await r.load(t))):i=t;const s=J3e(i),o=s.loader;(!r||o)&&(r=gP(n.loader??o));const a=await mP(s,r),u=await mP(n,r),l={...dP(u,a),config:nl(u.config??{},a.config??{})};return await tve(e,i,l,r)}async function mP(e,t){const n=se(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=se(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...i?{patch:i}:{},...n?{config:n}:{}}}function eve(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}async function tve(e,t,n={},i){const r=n.theme?nl(i3e[n.theme],n.config??{}):n.config,s=xo(n.actions)?n.actions:dP({},H3e,n.actions??{}),o={...G3e,...n.i18n},a=n.renderer??"canvas",u=n.logLevel??Ss.Warn,l=n.downloadFileName??"visualization",c=typeof e=="string"?document.querySelector(e):e;if(!c)throw new Error(`${e} does not exist`);if(n.defaultStyle!==!1){const _="vega-embed-style",{root:E,rootContainer:w}=eve(c);if(!E.getElementById(_)){const C=document.createElement("style");C.id=_,C.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?q3e.toString():n.defaultStyle,w.appendChild(C)}}const f=Z3e(t,n.mode);let d=V3e[f](t,r);if(f==="vega-lite"&&d.$schema){const _=bI(d.$schema);fP(Zm.vega,`^${_.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${_.version}, but current version is v${Zm.vega}.`)}c.classList.add("vega-embed"),s&&c.classList.add("has-actions"),c.innerHTML="";let h=c;if(s){const _=document.createElement("div");_.classList.add(X3e),c.appendChild(_),h=_}const p=n.patch;if(p&&(d=p instanceof Function?p(d):Gm(d,p,!0,!1).newDocument),n.formatLocale&&Ss.formatLocale(n.formatLocale),n.timeFormatLocale&&Ss.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const _ in n.expressionFunctions){const E=n.expressionFunctions[_];"fn"in E?Ss.expressionFunction(_,E.fn,E.visitor):E instanceof Function&&Ss.expressionFunction(_,E)}const{ast:g}=n,m=Ss.parse(d,f==="vega-lite"?{}:r,{ast:g}),y=new(n.viewClass||Ss.View)(m,{loader:i,logLevel:u,renderer:a,...g?{expr:Ss.expressionInterpreter??n.expr??Bfe}:{}});if(y.addSignalListener("autosize",(_,E)=>{const{type:w}=E;w=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):w=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):w=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const{loader:_,tooltip:E}=n,w=_&&!pP(_)?_==null?void 0:_.baseURL:void 0,C=K3e(E)?E:new h3e({baseURL:w,...E===!0?{}:E}).call;y.tooltip(C)}let{hover:b}=n;if(b===void 0&&(b=f==="vega"),b){const{hoverSet:_,updateSet:E}=typeof b=="boolean"?{}:b;y.hover(_,E)}n&&(n.width!=null&&y.width(n.width),n.height!=null&&y.height(n.height),n.padding!=null&&y.padding(n.padding)),await y.initialize(h,n.bind).runAsync();let v;if(s!==!1){let _=c;if(n.defaultStyle!==!1||n.forceActionsMenu){const w=document.createElement("details");w.title=o.CLICK_TO_VIEW_ACTIONS,c.append(w),_=w;const C=document.createElement("summary");C.innerHTML=Y3e,w.append(C),v=k=>{w.contains(k.target)||w.removeAttribute("open")},document.addEventListener("click",v)}const E=document.createElement("div");if(_.append(E),E.classList.add("vega-actions"),s===!0||s.export!==!1){for(const w of["svg","png"])if(s===!0||s.export===!0||s.export[w]){const C=o[`${w.toUpperCase()}_ACTION`],k=document.createElement("a"),S=re(n.scaleFactor)?n.scaleFactor[w]:n.scaleFactor;k.text=C,k.href="#",k.target="_blank",k.download=`${l}.${w}`,k.addEventListener("mousedown",async function($){$.preventDefault();const O=await y.toImageURL(w,S);this.href=O}),E.append(k)}}if(s===!0||s.source!==!1){const w=document.createElement("a");w.text=o.SOURCE_ACTION,w.href="#",w.addEventListener("click",function(C){hP(b2(t),n.sourceHeader??"",n.sourceFooter??"",f),C.preventDefault()}),E.append(w)}if(f==="vega-lite"&&(s===!0||s.compiled!==!1)){const w=document.createElement("a");w.text=o.COMPILED_ACTION,w.href="#",w.addEventListener("click",function(C){hP(b2(d),n.sourceHeader??"",n.sourceFooter??"","vega"),C.preventDefault()}),E.append(w)}if(s===!0||s.editor!==!1){const w=n.editorUrl??"https://vega.github.io/editor/",C=document.createElement("a");C.text=o.EDITOR_ACTION,C.href="#",C.addEventListener("click",function(k){j3e(window,w,{config:r,mode:p?"vega":f,renderer:a,spec:b2(p?d:t)}),k.preventDefault()}),E.append(C)}}function x(){v&&document.removeEventListener("click",v),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:x,embedOptions:n}}const nve=new Set(["width","height"]);function ive(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rve=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var i,r,s;if(Array.isArray(t)){if(i=t.length,i!=n.length)return!1;for(r=i;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),i=s.length,i!==Object.keys(n).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[r]))return!1;for(r=i;r--!==0;){var o=s[r];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n};const sve=ive(rve);function ove(e,t){for(const[n,i]of Object.entries(t))i&&(i&&{}.toString.call(i)==="[object Function]"?i(e.data(n)):e.change(n,Ao().remove(()=>!0).insert(i)))}function Jm(e={},t={},n=new Set){const i=Object.keys(e),r=Object.keys(t);return e===t||i.length===r.length&&i.filter(s=>!n.has(s)).every(s=>e[s]===t[s])}function yP(e,t){const n=Object.keys(t);for(const i of n)try{e.removeSignalListener(i,t[i])}catch(r){console.warn("Cannot remove invalid signal listener.",r)}return n.length>0}function J5(e,t){const n=Object.keys(t);for(const i of n)try{e.addSignalListener(i,t[i])}catch(r){console.warn("Cannot add invalid signal listener.",r)}return n.length>0}function ave(e){return new Set(e.flatMap(t=>Object.keys(t)))}function uve(e,t){if(e===t)return!1;const n={width:!1,height:!1,isExpensive:!1},i="width"in e||"width"in t,r="height"in e||"height"in t;return i&&(!("width"in e)||!("width"in t)||e.width!==t.width)&&("width"in e&&typeof e.width=="number"?n.width=e.width:n.isExpensive=!0),r&&(!("height"in e)||!("height"in t)||e.height!==t.height)&&("height"in e&&typeof e.height=="number"?n.height=e.height:n.isExpensive=!0),[...ave([e,t])].filter(o=>o!=="width"&&o!=="height").some(o=>!(o in e)||!(o in t)||!sve(e[o],t[o]))&&(n.isExpensive=!0),n.width!==!1||n.height!==!1||n.isExpensive?n:!1}function bP(e,t){const{width:n,height:i}=t;return typeof n<"u"&&typeof i<"u"?{...e,width:n,height:i}:typeof n<"u"?{...e,width:n}:typeof i<"u"?{...e,height:i}:e}function lve(e){let t;return{c(){t=H("div")},m(n,i){I(n,t,i),e[11](t)},p:ee,i:ee,o:ee,d(n){n&&L(t),e[11](null)}}}function cve(e,t,n){let{options:i}=t,{spec:r}=t,{view:s}=t,{signalListeners:o={}}=t,{data:a={}}=t;const u=l2();let l,c={},f={},d={},h={},p;w6(()=>{m()});async function g(){m();try{n(6,l=await Q3e(p,r,i)),n(1,s=l.view),J5(s,o)&&s.runAsync(),b(s)}catch(_){y(_)}}function m(){l&&(l.finalize(),n(6,l=void 0),n(1,s=void 0))}function y(_){u("onError",{error:_}),console.warn(_)}function b(_){v(),u("onNewView",{view:_})}async function v(){a&&Object.keys(a).length>0&&l!==void 0&&(n(1,s=l.view),ove(s,a),await s.resize().runAsync())}function x(_){zi[_?"unshift":"push"](()=>{p=_,n(0,p)})}return e.$$set=_=>{"options"in _&&n(2,i=_.options),"spec"in _&&n(3,r=_.spec),"view"in _&&n(1,s=_.view),"signalListeners"in _&&n(4,o=_.signalListeners),"data"in _&&n(5,a=_.data)},e.$$.update=()=>{if(e.$$.dirty&1056&&(Jm(a,h)||v(),n(10,h=a)),e.$$.dirty&991&&p!==void 0){if(!Jm(i,c,nve))g();else{const _=uve(bP(r,i),bP(d,c)),E=o,w=f;if(_){if(_.isExpensive)g();else if(l!==void 0){const C=!Jm(E,w);n(1,s=l.view),_.width!==!1&&s.width(_.width),_.height!==!1&&s.height(_.height),C&&(w&&yP(s,w),E&&J5(s,E)),s.runAsync()}}else!Jm(E,w)&&l!==void 0&&(n(1,s=l.view),w&&yP(s,w),E&&J5(s,E),s.runAsync())}n(7,c=i),n(8,f=o),n(9,d=r)}},[p,s,i,r,o,a,l,c,f,d,h,x]}class fve extends ve{constructor(t){super(),be(this,t,cve,lve,ye,{options:2,spec:3,view:1,signalListeners:4,data:5})}}function dve(e){let t,n,i;function r(o){e[6](o)}let s={spec:e[1],data:e[2],signalListeners:e[3],options:e[4]};return e[0]!==void 0&&(s.view=e[0]),t=new fve({props:s}),zi.push(()=>g2(t,"view",r)),t.$on("onNewView",e[7]),t.$on("onError",e[8]),{c(){de(t.$$.fragment)},m(o,a){ce(t,o,a),i=!0},p(o,[a]){const u={};a&2&&(u.spec=o[1]),a&4&&(u.data=o[2]),a&8&&(u.signalListeners=o[3]),a&16&&(u.options=o[4]),!n&&a&1&&(n=!0,u.view=o[0],h2(()=>n=!1)),t.$set(u)},i(o){i||(F(t.$$.fragment,o),i=!0)},o(o){N(t.$$.fragment,o),i=!1},d(o){fe(t,o)}}}const hve="vega";function pve(e,t,n){let i,{spec:r}=t,{options:s={}}=t,{data:o={}}=t,{signalListeners:a={}}=t,{view:u=void 0}=t;function l(d){u=d,n(0,u)}function c(d){k6.call(this,e,d)}function f(d){k6.call(this,e,d)}return e.$$set=d=>{"spec"in d&&n(1,r=d.spec),"options"in d&&n(5,s=d.options),"data"in d&&n(2,o=d.data),"signalListeners"in d&&n(3,a=d.signalListeners),"view"in d&&n(0,u=d.view)},e.$$.update=()=>{e.$$.dirty&32&&n(4,i={...s,mode:hve})},[u,r,o,a,i,s,l,c,f]}class vP extends ve{constructor(t){super(),be(this,t,pve,dve,ye,{spec:1,options:5,data:2,signalListeners:3,view:0})}}function gve(e){let t,n;return t=new vP({props:{spec:e[1],options:e[0]}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.spec=i[1]),r&1&&(s.options=i[0]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function mve(e){let t,n;return t=new vP({props:{data:e[2],spec:e[1],options:e[0]}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,r){const s={};r&4&&(s.data=i[2]),r&2&&(s.spec=i[1]),r&1&&(s.options=i[0]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function yve(e){let t,n,i,r;const s=[mve,gve],o=[];function a(u,l){return u[2]&&u[1]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Me()},m(u,l){o[t].m(u,l),I(u,i,l),r=!0},p(u,[l]){let c=t;t=a(u),t===c?o[t].p(u,l):($e(),N(o[c],1,1,()=>{o[c]=null}),Se(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i))},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),o[t].d(u)}}}function bve(e,t,n){let i,r,s,{componentData:o}=t;return e.$$set=a=>{"componentData"in a&&n(3,o=a.componentData)},e.$$.update=()=>{e.$$.dirty&8&&n(2,{data:i,spec:r,options:s}=o,i,(n(1,r),n(3,o)),(n(0,s),n(3,o)))},[s,r,i,o]}class xP extends ve{constructor(t){super(),be(this,t,bve,yve,ye,{componentData:3})}}function vve(e){var r;let t,n=(((r=e[0])==null?void 0:r.text)||"")+"",i;return{c(){t=H("p"),i=Oe(n),T(t,"data-component","text")},m(s,o){I(s,t,o),V(t,i)},p(s,[o]){var a;o&1&&n!==(n=(((a=s[0])==null?void 0:a.text)||"")+"")&&Ke(i,n)},i:ee,o:ee,d(s){s&&L(t)}}}function xve(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class _P extends ve{constructor(t){super(),be(this,t,xve,vve,ye,{componentData:0})}}function wP(e){let t,n;return{c(){t=H("h3"),n=Oe(e[4]),T(t,"class","value-box-title svelte-175x1n5")},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&16&&Ke(n,i[4])},d(i){i&&L(t)}}}function EP(e){let t,n;return{c(){t=H("p"),n=Oe(e[3]),T(t,"class","value-box-subtitle svelte-175x1n5")},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&8&&Ke(n,i[3])},d(i){i&&L(t)}}}function CP(e){let t,n;return{c(){t=H("div"),n=Oe(e[1]),T(t,"class","value-box-change svelte-175x1n5")},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&2&&Ke(n,i[1])},d(i){i&&L(t)}}}function _ve(e){let t,n,i,r,s,o,a,u,l=e[4]&&wP(e),c=e[3]&&EP(e),f=e[1]&&CP(e);return{c(){t=H("div"),n=H("div"),l&&l.c(),i=ze(),r=H("div"),s=Oe(e[0]),o=ze(),c&&c.c(),a=ze(),f&&f.c(),T(r,"class","value-box-value svelte-175x1n5"),T(n,"class","value-box-content svelte-175x1n5"),T(t,"class",u="value-box "+(e[2]||"default")+" svelte-175x1n5"),T(t,"id",e[5])},m(d,h){I(d,t,h),V(t,n),l&&l.m(n,null),V(n,i),V(n,r),V(r,s),V(n,o),c&&c.m(n,null),V(n,a),f&&f.m(n,null)},p(d,[h]){d[4]?l?l.p(d,h):(l=wP(d),l.c(),l.m(n,i)):l&&(l.d(1),l=null),h&1&&Ke(s,d[0]),d[3]?c?c.p(d,h):(c=EP(d),c.c(),c.m(n,a)):c&&(c.d(1),c=null),d[1]?f?f.p(d,h):(f=CP(d),f.c(),f.m(n,null)):f&&(f.d(1),f=null),h&4&&u!==(u="value-box "+(d[2]||"default")+" svelte-175x1n5")&&T(t,"class",u),h&32&&T(t,"id",d[5])},i:ee,o:ee,d(d){d&&L(t),l&&l.d(),c&&c.d(),f&&f.d()}}}function wve(e,t,n){let i,r,s,o,a,u,l,{componentData:c}=t;return e.$$set=f=>{"componentData"in f&&n(6,c=f.componentData)},e.$$.update=()=>{e.$$.dirty&64&&n(5,{id:i,title:r,value:s,subtitle:o,theme:a,change_indicator:u}=c,i,(n(4,r),n(6,c)),(n(7,s),n(6,c)),(n(3,o),n(6,c)),(n(2,a),n(6,c)),(n(1,u),n(6,c))),e.$$.dirty&128&&n(0,l=typeof s=="number"?s.toLocaleString():s)},[l,u,a,o,r,i,c,s]}class kP extends ve{constructor(t){super(),be(this,t,wve,_ve,ye,{componentData:6})}}function Eve(e){let t,n,i=e[0].data+"",r,s,o;return{c(){t=H("pre"),n=H("code"),r=Oe(i),s=Oe(` + `),o=Oe(` +`),T(n,"class","language-python"),T(t,"data-component","pythonCode")},m(a,u){I(a,t,u),V(t,n),V(n,r),V(n,s),e[2](n),V(t,o)},p(a,[u]){u&1&&i!==(i=a[0].data+"")&&Ke(r,i)},i:ee,o:ee,d(a){a&&L(t),e[2](null)}}}function Cve(e,t,n){let{componentData:i}=t,r;function s(){var a;r&&((a=window==null?void 0:window.Prism)==null||a.highlightElement(r))}function o(a){zi[a?"unshift":"push"](()=>{r=a,n(1,r)})}return e.$$set=a=>{"componentData"in a&&n(0,i=a.componentData)},e.$$.update=()=>{e.$$.dirty&2&&r&&s()},[i,r,o]}class AP extends ve{constructor(t){super(),be(this,t,Cve,Eve,ye,{componentData:0})}}function kve(e){let t;return{c(){t=Oe(e[0])},m(n,i){I(n,t,i)},p(n,i){i&1&&Ke(t,n[0])},i:ee,o:ee,d(n){n&&L(t)}}}function Ave(e){let t,n,i;var r=e[1];function s(o,a){return{props:{componentData:o[0]}}}return r&&(t=Ze(r,s(e))),{c(){t&&de(t.$$.fragment),n=Me()},m(o,a){t&&ce(t,o,a),I(o,n,a),i=!0},p(o,a){if(a&2&&r!==(r=o[1])){if(t){$e();const u=t;N(u.$$.fragment,1,0,()=>{fe(u,1)}),Se()}r?(t=Ze(r,s(o)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(r){const u={};a&1&&(u.componentData=o[0]),t.$set(u)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&fe(t,o)}}}function $ve(e){let t,n,i,r;const s=[Ave,kve],o=[];function a(u,l){return u[1]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Me()},m(u,l){o[t].m(u,l),I(u,i,l),r=!0},p(u,[l]){let c=t;t=a(u),t===c?o[t].p(u,l):($e(),N(o[c],1,1,()=>{o[c]=null}),Se(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i))},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),o[t].d(u)}}}function Sve(e,t,n){let{componentData:i}=t,r;const s={artifacts:N6,dag:H6,heading:K6,image:Q6,log:e4,markdown:E4,progressBar:$4,text:_P,valueBox:kP,vegaChart:xP,pythonCode:AP},o=i==null?void 0:i.type;return o&&(r=s==null?void 0:s[o],r||console.error("Unknown component type: ",o)),e.$$set=a=>{"componentData"in a&&n(0,i=a.componentData)},[i,r]}class $P extends ve{constructor(t){super(),be(this,t,Sve,$ve,ye,{componentData:0})}}function SP(e,t,n){const i=e.slice();return i[3]=t[n],i[5]=n,i}function FP(e,t,n){const i=e.slice();return i[6]=t[n],i}function DP(e){let t,n,i,r,s=je(e[1]),o=[];for(let u=0;uN(o[u],1,1,()=>{o[u]=null});return{c(){t=H("div"),n=H("table"),i=H("tbody");for(let u=0;uN(l[f],1,1,()=>{l[f]=null});return{c(){t=H("tr"),n=H("td"),r=Oe(i),s=ze();for(let f=0;f{i=null}),Se())},i(r){n||(F(i),n=!0)},o(r){N(i),n=!1},d(r){r&&L(t),i&&i.d(r)}}}function Dve(e,t,n){let i,r,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(2,s=o.componentData)},e.$$.update=()=>{e.$$.dirty&4&&n(1,{columns:i,data:r}=s,i,(n(0,r),n(2,s)))},[r,i,s]}class Tve extends ve{constructor(t){super(),be(this,t,Dve,Fve,ye,{componentData:2})}}function NP(e,t,n){const i=e.slice();return i[3]=t[n],i}function RP(e,t,n){const i=e.slice();return i[6]=t[n],i}function OP(e,t,n){const i=e.slice();return i[9]=t[n],i}function LP(e){let t,n,i,r,s,o,a,u=je(e[1]),l=[];for(let h=0;hN(f[h],1,1,()=>{f[h]=null});return{c(){t=H("div"),n=H("table"),i=H("thead"),r=H("tr");for(let h=0;hN(s[a],1,1,()=>{s[a]=null});return{c(){t=H("tr");for(let a=0;a{i=null}),Se())},i(r){n||(F(i),n=!0)},o(r){N(i),n=!1},d(r){r&&L(t),i&&i.d(r)}}}function Nve(e,t,n){let i,r,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(2,s=o.componentData)},e.$$.update=()=>{e.$$.dirty&4&&n(1,{columns:i,data:r}=s,i,(n(0,r),n(2,s)))},[r,i,s]}class Rve extends ve{constructor(t){super(),be(this,t,Nve,Mve,ye,{componentData:2})}}function BP(e){let t,n,i;var r=e[3];function s(o,a){return{props:{componentData:o[0]}}}return r&&(t=Ze(r,s(e))),{c(){t&&de(t.$$.fragment),n=Me()},m(o,a){t&&ce(t,o,a),I(o,n,a),i=!0},p(o,a){if(r!==(r=o[3])){if(t){$e();const u=t;N(u.$$.fragment,1,0,()=>{fe(u,1)}),Se()}r?(t=Ze(r,s(o)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(r){const u={};a&1&&(u.componentData=o[0]),t.$set(u)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&fe(t,o)}}}function Ove(e){let t,n,i=e[2]&&e[1]&&BP(e);return{c(){i&&i.c(),t=Me()},m(r,s){i&&i.m(r,s),I(r,t,s),n=!0},p(r,[s]){r[2]&&r[1]?i?(i.p(r,s),s&6&&F(i,1)):(i=BP(r),i.c(),F(i,1),i.m(t.parentNode,t)):i&&($e(),N(i,1,1,()=>{i=null}),Se())},i(r){n||(F(i),n=!0)},o(r){N(i),n=!1},d(r){r&&L(t),i&&i.d(r)}}}function Lve(e,t,n){let i,r,s,{componentData:o}=t;const a=s?Tve:Rve;return e.$$set=u=>{"componentData"in u&&n(0,o=u.componentData)},e.$$.update=()=>{e.$$.dirty&1&&n(2,{columns:i,data:r,vertical:s}=o,i,(n(1,r),n(0,o)))},[o,r,i,a]}class Ive extends ve{constructor(t){super(),be(this,t,Lve,Ove,ye,{componentData:0})}}function UP(e,t,n){const i=e.slice();return i[3]=t[n],i}function Pve(e){let t,n,i,r;const s=[Bve,zve],o=[];function a(u,l){var c;return(u[0].type==="page"||u[0].type==="section")&&((c=u[0])!=null&&c.contents)?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Me()},m(u,l){o[t].m(u,l),I(u,i,l),r=!0},p(u,l){let c=t;t=a(u),t===c?o[t].p(u,l):($e(),N(o[c],1,1,()=>{o[c]=null}),Se(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),F(n,1),n.m(i.parentNode,i))},i(u){r||(F(n),r=!0)},o(u){N(n),r=!1},d(u){u&&L(i),o[t].d(u)}}}function zve(e){let t,n,i;var r=e[1];function s(o,a){return{props:{componentData:o[0]}}}return r&&(t=Ze(r,s(e))),{c(){t&&de(t.$$.fragment),n=Me()},m(o,a){t&&ce(t,o,a),I(o,n,a),i=!0},p(o,a){if(r!==(r=o[1])){if(t){$e();const u=t;N(u.$$.fragment,1,0,()=>{fe(u,1)}),Se()}r?(t=Ze(r,s(o)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(r){const u={};a&1&&(u.componentData=o[0]),t.$set(u)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&fe(t,o)}}}function Bve(e){let t,n,i;var r=e[1];function s(o,a){return{props:{componentData:o[0],$$slots:{default:[Uve]},$$scope:{ctx:o}}}}return r&&(t=Ze(r,s(e))),{c(){t&&de(t.$$.fragment),n=Me()},m(o,a){t&&ce(t,o,a),I(o,n,a),i=!0},p(o,a){if(r!==(r=o[1])){if(t){$e();const u=t;N(u.$$.fragment,1,0,()=>{fe(u,1)}),Se()}r?(t=Ze(r,s(o)),de(t.$$.fragment),F(t.$$.fragment,1),ce(t,n.parentNode,n)):t=null}else if(r){const u={};a&1&&(u.componentData=o[0]),a&65&&(u.$$scope={dirty:a,ctx:o}),t.$set(u)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&fe(t,o)}}}function jP(e){let t,n;return t=new Q5({props:{componentData:e[3]}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.componentData=i[3]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function Uve(e){let t,n,i=je(e[0].contents),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{"componentData"in o&&n(0,i=o.componentData)},[i,s]}class Q5 extends ve{constructor(t){super(),be(this,t,qve,jve,ye,{componentData:0})}}function Wve(e){let t,n,i;const r=e[1].default,s=mt(r,e,e[0],null);return{c(){t=H("main"),n=H("div"),s&&s.c(),T(n,"class","mainContainer svelte-mqeomk"),T(t,"class","svelte-mqeomk")},m(o,a){I(o,t,a),V(t,n),s&&s.m(n,null),i=!0},p(o,[a]){s&&s.p&&(!i||a&1)&&bt(s,r,o,o[0],i?yt(r,o[0],a,null):vt(o[0]),null)},i(o){i||(F(s,o),i=!0)},o(o){N(s,o),i=!1},d(o){o&&L(t),s&&s.d(o)}}}function Hve(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class Gve extends ve{constructor(t){super(),be(this,t,Hve,Wve,ye,{})}}const Nh=/^[a-z0-9]+(-[a-z0-9]+)*$/,Qm=(e,t,n,i="")=>{const r=e.split(":");if(e.slice(0,1)==="@"){if(r.length<2||r.length>3)return null;i=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const a=r.pop(),u=r.pop(),l={provider:r.length>0?r[0]:i,prefix:u,name:a};return t&&!e2(l)?null:l}const s=r[0],o=s.split("-");if(o.length>1){const a={provider:i,prefix:o.shift(),name:o.join("-")};return t&&!e2(a)?null:a}if(n&&i===""){const a={provider:i,prefix:"",name:s};return t&&!e2(a,n)?null:a}return null},e2=(e,t)=>e?!!((e.provider===""||e.provider.match(Nh))&&(t&&e.prefix===""||e.prefix.match(Nh))&&e.name.match(Nh)):!1,qP=Object.freeze({left:0,top:0,width:16,height:16}),t2=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),n2=Object.freeze({...qP,...t2}),e6=Object.freeze({...n2,body:"",hidden:!1});function Vve(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(n.rotate=i),n}function WP(e,t){const n=Vve(e,t);for(const i in e6)i in t2?i in e&&!(i in n)&&(n[i]=t2[i]):i in t?n[i]=t[i]:i in e&&(n[i]=e[i]);return n}function Yve(e,t){const n=e.icons,i=e.aliases||Object.create(null),r=Object.create(null);function s(o){if(n[o])return r[o]=[];if(!(o in r)){r[o]=null;const a=i[o]&&i[o].parent,u=a&&s(a);u&&(r[o]=[a].concat(u))}return r[o]}return Object.keys(n).concat(Object.keys(i)).forEach(s),r}function Xve(e,t,n){const i=e.icons,r=e.aliases||Object.create(null);let s={};function o(a){s=WP(i[a]||r[a],s)}return o(t),n.forEach(o),WP(e,s)}function HP(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(r=>{t(r,null),n.push(r)});const i=Yve(e);for(const r in i){const s=i[r];s&&(t(r,Xve(e,r,s)),n.push(r))}return n}const Kve={provider:"",aliases:{},not_found:{},...qP};function t6(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function GP(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!t6(e,Kve))return null;const n=t.icons;for(const r in n){const s=n[r];if(!r.match(Nh)||typeof s.body!="string"||!t6(s,e6))return null}const i=t.aliases||Object.create(null);for(const r in i){const s=i[r],o=s.parent;if(!r.match(Nh)||typeof o!="string"||!n[o]&&!i[o]||!t6(s,e6))return null}return t}const VP=Object.create(null);function Zve(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Vu(e,t){const n=VP[e]||(VP[e]=Object.create(null));return n[t]||(n[t]=Zve(e,t))}function n6(e,t){return GP(t)?HP(t,(n,i)=>{i?e.icons[n]=i:e.missing.add(n)}):[]}function Jve(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let Rh=!1;function YP(e){return typeof e=="boolean"&&(Rh=e),Rh}function Qve(e){const t=typeof e=="string"?Qm(e,!0,Rh):e;if(t){const n=Vu(t.provider,t.prefix),i=t.name;return n.icons[i]||(n.missing.has(i)?null:void 0)}}function e7e(e,t){const n=Qm(e,!0,Rh);if(!n)return!1;const i=Vu(n.provider,n.prefix);return Jve(i,n.name,t)}function t7e(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),Rh&&!t&&!e.prefix){let r=!1;return GP(e)&&(e.prefix="",HP(e,(s,o)=>{o&&e7e(s,o)&&(r=!0)})),r}const n=e.prefix;if(!e2({provider:t,prefix:n,name:"a"}))return!1;const i=Vu(t,n);return!!n6(i,e)}const XP=Object.freeze({width:null,height:null}),KP=Object.freeze({...XP,...t2}),n7e=/(-?[0-9.]*[0-9]+[0-9.]*)/g,i7e=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ZP(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const i=e.split(n7e);if(i===null||!i.length)return e;const r=[];let s=i.shift(),o=i7e.test(s);for(;;){if(o){const a=parseFloat(s);isNaN(a)?r.push(s):r.push(Math.ceil(a*t*n)/n)}else r.push(s);if(s=i.shift(),s===void 0)return r.join("");o=!o}}function r7e(e,t="defs"){let n="";const i=e.indexOf("<"+t);for(;i>=0;){const r=e.indexOf(">",i),s=e.indexOf("",s);if(o===-1)break;n+=e.slice(r+1,s).trim(),e=e.slice(0,i).trim()+e.slice(o+1)}return{defs:n,content:e}}function s7e(e,t){return e?""+e+""+t:t}function o7e(e,t,n){const i=r7e(e);return s7e(i.defs,t+i.content+n)}const a7e=e=>e==="unset"||e==="undefined"||e==="none";function u7e(e,t){const n={...n2,...e},i={...KP,...t},r={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,i].forEach(g=>{const m=[],y=g.hFlip,b=g.vFlip;let v=g.rotate;y?b?v+=2:(m.push("translate("+(r.width+r.left).toString()+" "+(0-r.top).toString()+")"),m.push("scale(-1 1)"),r.top=r.left=0):b&&(m.push("translate("+(0-r.left).toString()+" "+(r.height+r.top).toString()+")"),m.push("scale(1 -1)"),r.top=r.left=0);let x;switch(v<0&&(v-=Math.floor(v/4)*4),v=v%4,v){case 1:x=r.height/2+r.top,m.unshift("rotate(90 "+x.toString()+" "+x.toString()+")");break;case 2:m.unshift("rotate(180 "+(r.width/2+r.left).toString()+" "+(r.height/2+r.top).toString()+")");break;case 3:x=r.width/2+r.left,m.unshift("rotate(-90 "+x.toString()+" "+x.toString()+")");break}v%2===1&&(r.left!==r.top&&(x=r.left,r.left=r.top,r.top=x),r.width!==r.height&&(x=r.width,r.width=r.height,r.height=x)),m.length&&(s=o7e(s,'',""))});const o=i.width,a=i.height,u=r.width,l=r.height;let c,f;o===null?(f=a===null?"1em":a==="auto"?l:a,c=ZP(f,u/l)):(c=o==="auto"?u:o,f=a===null?ZP(c,l/u):a==="auto"?l:a);const d={},h=(g,m)=>{a7e(m)||(d[g]=m.toString())};h("width",c),h("height",f);const p=[r.left,r.top,u,l];return d.viewBox=p.join(" "),{attributes:d,viewBox:p,body:s}}const l7e=/\sid="(\S+)"/g,c7e="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let f7e=0;function d7e(e,t=c7e){const n=[];let i;for(;i=l7e.exec(e);)n.push(i[1]);if(!n.length)return e;const r="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const o=typeof t=="function"?t(s):t+(f7e++).toString(),a=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+r+"$3")}),e=e.replace(new RegExp(r,"g"),""),e}const i6=Object.create(null);function h7e(e,t){i6[e]=t}function r6(e){return i6[e]||i6[""]}function s6(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const o6=Object.create(null),Oh=["https://api.simplesvg.com","https://api.unisvg.com"],i2=[];for(;Oh.length>0;)Oh.length===1||Math.random()>.5?i2.push(Oh.shift()):i2.push(Oh.pop());o6[""]=s6({resources:["https://api.iconify.design"].concat(i2)});function p7e(e,t){const n=s6(t);return n===null?!1:(o6[e]=n,!0)}function a6(e){return o6[e]}let JP=(()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}})();function g7e(e,t){const n=a6(e);if(!n)return 0;let i;if(!n.maxURL)i=0;else{let r=0;n.resources.forEach(o=>{r=Math.max(r,o.length)});const s=t+".json?icons=";i=n.maxURL-r-n.path.length-s.length}return i}function m7e(e){return e===404}const y7e=(e,t,n)=>{const i=[],r=g7e(e,t),s="icons";let o={type:s,provider:e,prefix:t,icons:[]},a=0;return n.forEach((u,l)=>{a+=u.length+1,a>=r&&l>0&&(i.push(o),o={type:s,provider:e,prefix:t,icons:[]},a=u.length),o.icons.push(u)}),i.push(o),i};function b7e(e){if(typeof e=="string"){const t=a6(e);if(t)return t.path}return"/"}const v7e={prepare:y7e,send:(e,t,n)=>{if(!JP){n("abort",424);return}let i=b7e(t.provider);switch(t.type){case"icons":{const s=t.prefix,a=t.icons.join(","),u=new URLSearchParams({icons:a});i+=s+".json?"+u.toString();break}case"custom":{const s=t.uri;i+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let r=503;JP(e+i).then(s=>{const o=s.status;if(o!==200){setTimeout(()=>{n(m7e(o)?"abort":"next",o)});return}return r=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",r)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",r)})}};function x7e(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((r,s)=>r.provider!==s.provider?r.provider.localeCompare(s.provider):r.prefix!==s.prefix?r.prefix.localeCompare(s.prefix):r.name.localeCompare(s.name));let i={provider:"",prefix:"",name:""};return e.forEach(r=>{if(i.name===r.name&&i.prefix===r.prefix&&i.provider===r.provider)return;i=r;const s=r.provider,o=r.prefix,a=r.name,u=n[s]||(n[s]=Object.create(null)),l=u[o]||(u[o]=Vu(s,o));let c;a in l.icons?c=t.loaded:o===""||l.missing.has(a)?c=t.missing:c=t.pending;const f={provider:s,prefix:o,name:a};c.push(f)}),t}function QP(e,t){e.forEach(n=>{const i=n.loaderCallbacks;i&&(n.loaderCallbacks=i.filter(r=>r.id!==t))})}function _7e(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const i=e.provider,r=e.prefix;t.forEach(s=>{const o=s.icons,a=o.pending.length;o.pending=o.pending.filter(u=>{if(u.prefix!==r)return!0;const l=u.name;if(e.icons[l])o.loaded.push({provider:i,prefix:r,name:l});else if(e.missing.has(l))o.missing.push({provider:i,prefix:r,name:l});else return n=!0,!0;return!1}),o.pending.length!==a&&(n||QP([e],s.id),s.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),s.abort))})}))}let w7e=0;function E7e(e,t,n){const i=w7e++,r=QP.bind(null,n,i);if(!t.pending.length)return r;const s={id:i,icons:t,callback:e,abort:r};return n.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(s)}),r}function C7e(e,t=!0,n=!1){const i=[];return e.forEach(r=>{const s=typeof r=="string"?Qm(r,t,n):r;s&&i.push(s)}),i}var k7e={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function A7e(e,t,n,i){const r=e.resources.length,s=e.random?Math.floor(Math.random()*r):e.index;let o;if(e.random){let E=e.resources.slice(0);for(o=[];E.length>1;){const w=Math.floor(Math.random()*E.length);o.push(E[w]),E=E.slice(0,w).concat(E.slice(w+1))}o=o.concat(E)}else o=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let u="pending",l=0,c,f=null,d=[],h=[];typeof i=="function"&&h.push(i);function p(){f&&(clearTimeout(f),f=null)}function g(){u==="pending"&&(u="aborted"),p(),d.forEach(E=>{E.status==="pending"&&(E.status="aborted")}),d=[]}function m(E,w){w&&(h=[]),typeof E=="function"&&h.push(E)}function y(){return{startTime:a,payload:t,status:u,queriesSent:l,queriesPending:d.length,subscribe:m,abort:g}}function b(){u="failed",h.forEach(E=>{E(void 0,c)})}function v(){d.forEach(E=>{E.status==="pending"&&(E.status="aborted")}),d=[]}function x(E,w,C){const k=w!=="success";switch(d=d.filter(S=>S!==E),u){case"pending":break;case"failed":if(k||!e.dataAfterTimeout)return;break;default:return}if(w==="abort"){c=C,b();return}if(k){c=C,d.length||(o.length?_():b());return}if(p(),v(),!e.random){const S=e.resources.indexOf(E.resource);S!==-1&&S!==e.index&&(e.index=S)}u="completed",h.forEach(S=>{S(C)})}function _(){if(u!=="pending")return;p();const E=o.shift();if(E===void 0){if(d.length){f=setTimeout(()=>{p(),u==="pending"&&(v(),b())},e.timeout);return}b();return}const w={status:"pending",resource:E,callback:(C,k)=>{x(w,C,k)}};d.push(w),l++,f=setTimeout(_,e.rotate),n(E,t,w.callback)}return setTimeout(_),y}function ez(e){const t={...k7e,...e};let n=[];function i(){n=n.filter(a=>a().status==="pending")}function r(a,u,l){const c=A7e(t,a,u,(f,d)=>{i(),l&&l(f,d)});return n.push(c),c}function s(a){return n.find(u=>a(u))||null}return{query:r,find:s,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:i}}function tz(){}const u6=Object.create(null);function $7e(e){if(!u6[e]){const t=a6(e);if(!t)return;const n=ez(t),i={config:t,redundancy:n};u6[e]=i}return u6[e]}function S7e(e,t,n){let i,r;if(typeof e=="string"){const s=r6(e);if(!s)return n(void 0,424),tz;r=s.send;const o=$7e(e);o&&(i=o.redundancy)}else{const s=s6(e);if(s){i=ez(s);const o=e.resources?e.resources[0]:"",a=r6(o);a&&(r=a.send)}}return!i||!r?(n(void 0,424),tz):i.query(t,r,n)().abort}const nz="iconify2",Lh="iconify",iz=Lh+"-count",rz=Lh+"-version",sz=36e5,F7e=168,D7e=50;function l6(e,t){try{return e.getItem(t)}catch{}}function c6(e,t,n){try{return e.setItem(t,n),!0}catch{}}function oz(e,t){try{e.removeItem(t)}catch{}}function f6(e,t){return c6(e,iz,t.toString())}function d6(e){return parseInt(l6(e,iz))||0}const r2={local:!0,session:!0},az={local:new Set,session:new Set};let h6=!1;function T7e(e){h6=e}let s2=typeof window>"u"?{}:window;function uz(e){const t=e+"Storage";try{if(s2&&s2[t]&&typeof s2[t].length=="number")return s2[t]}catch{}r2[e]=!1}function lz(e,t){const n=uz(e);if(!n)return;const i=l6(n,rz);if(i!==nz){if(i){const a=d6(n);for(let u=0;u{const u=Lh+a.toString(),l=l6(n,u);if(typeof l=="string"){try{const c=JSON.parse(l);if(typeof c=="object"&&typeof c.cached=="number"&&c.cached>r&&typeof c.provider=="string"&&typeof c.data=="object"&&typeof c.data.prefix=="string"&&t(c,a))return!0}catch{}oz(n,u)}};let o=d6(n);for(let a=o-1;a>=0;a--)s(a)||(a===o-1?(o--,f6(n,o)):az[e].add(a))}function cz(){if(!h6){T7e(!0);for(const e in r2)lz(e,t=>{const n=t.data,i=t.provider,r=n.prefix,s=Vu(i,r);if(!n6(s,n).length)return!1;const o=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,o):o,!0})}}function M7e(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const i in r2)lz(i,r=>{const s=r.data;return r.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function N7e(e,t){h6||cz();function n(i){let r;if(!r2[i]||!(r=uz(i)))return;const s=az[i];let o;if(s.size)s.delete(o=Array.from(s).shift());else if(o=d6(r),o>=D7e||!f6(r,o+1))return;const a={cached:Math.floor(Date.now()/sz),provider:e.provider,data:t};return c6(r,Lh+o.toString(),JSON.stringify(a))}t.lastModified&&!M7e(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function fz(){}function R7e(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,_7e(e)}))}function O7e(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:i}=e,r=e.iconsToLoad;delete e.iconsToLoad;let s;if(!r||!(s=r6(n)))return;s.prepare(n,i,r).forEach(a=>{S7e(n,a,u=>{if(typeof u!="object")a.icons.forEach(l=>{e.missing.add(l)});else try{const l=n6(e,u);if(!l.length)return;const c=e.pendingIcons;c&&l.forEach(f=>{c.delete(f)}),N7e(e,u)}catch(l){console.error(l)}R7e(e)})})}))}const L7e=(e,t)=>{const n=C7e(e,!0,YP()),i=x7e(n);if(!i.pending.length){let u=!0;return t&&setTimeout(()=>{u&&t(i.loaded,i.missing,i.pending,fz)}),()=>{u=!1}}const r=Object.create(null),s=[];let o,a;return i.pending.forEach(u=>{const{provider:l,prefix:c}=u;if(c===a&&l===o)return;o=l,a=c,s.push(Vu(l,c));const f=r[l]||(r[l]=Object.create(null));f[c]||(f[c]=[])}),i.pending.forEach(u=>{const{provider:l,prefix:c,name:f}=u,d=Vu(l,c),h=d.pendingIcons||(d.pendingIcons=new Set);h.has(f)||(h.add(f),r[l][c].push(f))}),s.forEach(u=>{const{provider:l,prefix:c}=u;r[l][c].length&&O7e(u,r[l][c])}),t?E7e(t,i,s):fz};function I7e(e,t){const n={...e};for(const i in t){const r=t[i],s=typeof r;i in XP?(r===null||r&&(s==="string"||s==="number"))&&(n[i]=r):s===typeof n[i]&&(n[i]=i==="rotate"?r%4:r)}return n}const P7e=/[\s,]+/;function z7e(e,t){t.split(P7e).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function B7e(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function i(r){for(;r<0;)r+=4;return r%4}if(n===""){const r=parseInt(e);return isNaN(r)?0:i(r)}else if(n!==e){let r=0;switch(n){case"%":r=25;break;case"deg":r=90}if(r){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/r,s%1===0?i(s):0)}}return t}function U7e(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)n+=" "+i+'="'+t[i]+'"';return'"+e+""}function j7e(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function q7e(e){return"data:image/svg+xml,"+j7e(e)}function W7e(e){return'url("'+q7e(e)+'")'}const dz={...KP,inline:!1},H7e={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},G7e={display:"inline-block"},p6={"background-color":"currentColor"},hz={"background-color":"transparent"},pz={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},gz={"-webkit-mask":p6,mask:p6,background:hz};for(const e in gz){const t=gz[e];for(const n in pz)t[e+"-"+n]=pz[n]}function V7e(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}function Y7e(e,t){const n=I7e(dz,t),i=t.mode||"svg",r=i==="svg"?{...H7e}:{};e.body.indexOf("xlink:")===-1&&delete r["xmlns:xlink"];let s=typeof t.style=="string"?t.style:"";for(let y in t){const b=t[y];if(b!==void 0)switch(y){case"icon":case"style":case"onLoad":case"mode":break;case"inline":case"hFlip":case"vFlip":n[y]=b===!0||b==="true"||b===1;break;case"flip":typeof b=="string"&&z7e(n,b);break;case"color":s=s+(s.length>0&&s.trim().slice(-1)!==";"?";":"")+"color: "+b+"; ";break;case"rotate":typeof b=="string"?n[y]=B7e(b):typeof b=="number"&&(n[y]=b);break;case"ariaHidden":case"aria-hidden":b!==!0&&b!=="true"&&delete r["aria-hidden"];break;default:if(y.slice(0,3)==="on:")break;dz[y]===void 0&&(r[y]=b)}}const o=u7e(e,n),a=o.attributes;if(n.inline&&(s="vertical-align: -0.125em; "+s),i==="svg"){Object.assign(r,a),s!==""&&(r.style=s);let y=0,b=t.id;return typeof b=="string"&&(b=b.replace(/-/g,"_")),{svg:!0,attributes:r,body:d7e(o.body,b?()=>b+"ID"+y++:"iconifySvelte")}}const{body:u,width:l,height:c}=e,f=i==="mask"||(i==="bg"?!1:u.indexOf("currentColor")!==-1),d=U7e(u,{...a,width:l+"",height:c+""}),p={"--svg":W7e(d)},g=y=>{const b=a[y];b&&(p[y]=V7e(b))};g("width"),g("height"),Object.assign(p,G7e,f?p6:hz);let m="";for(const y in p)m+=y+": "+p[y]+";";return r.style=m+s,{svg:!1,attributes:r}}if(YP(!0),h7e("",v7e),typeof document<"u"&&typeof window<"u"){cz();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!t7e(i))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const i="IconifyProviders["+n+"] is invalid.";try{const r=t[n];if(typeof r!="object"||!r||r.resources===void 0)continue;p7e(n,r)||console.error(i)}catch{console.error(i)}}}}function X7e(e,t,n,i,r){function s(){t.loading&&(t.loading.abort(),t.loading=null)}if(typeof e=="object"&&e!==null&&typeof e.body=="string")return t.name="",s(),{data:{...n2,...e}};let o;if(typeof e!="string"||(o=Qm(e,!1,!0))===null)return s(),null;const a=Qve(o);if(!a)return n&&(!t.loading||t.loading.name!==e)&&(s(),t.name="",t.loading={name:e,abort:L7e([o],i)}),null;s(),t.name!==e&&(t.name=e,r&&!t.destroyed&&r(e));const u=["iconify"];return o.prefix!==""&&u.push("iconify--"+o.prefix),o.provider!==""&&u.push("iconify--"+o.provider),{data:a,classes:u}}function K7e(e,t){return e?Y7e({...n2,...e},t):null}function mz(e){let t;function n(s,o){return s[0].svg?J7e:Z7e}let i=n(e),r=i(e);return{c(){r.c(),t=Me()},m(s,o){r.m(s,o),I(s,t,o)},p(s,o){i===(i=n(s))&&r?r.p(s,o):(r.d(1),r=i(s),r&&(r.c(),r.m(t.parentNode,t)))},d(s){s&&L(t),r.d(s)}}}function Z7e(e){let t,n=[e[0].attributes],i={};for(let r=0;r{typeof t.onLoad=="function"&&t.onLoad(l),l2()("load",{icon:l})};function u(){n(3,s++,s)}return Wc(()=>{n(2,r=!0)}),w6(()=>{n(1,i.destroyed=!0,i),i.loading&&(i.loading.abort(),n(1,i.loading=null,i))}),e.$$set=l=>{n(6,t=Be(Be({},t),u2(l)))},e.$$.update=()=>{{const l=X7e(t.icon,i,r,u,a);n(0,o=l?K7e(l.data,t):null),o&&l.classes&&n(0,o.attributes.class=(typeof t.class=="string"?t.class+" ":"")+l.classes.join(" "),o)}},t=u2(t),[o,i,r,s]}class txe extends ve{constructor(t){super(),be(this,t,exe,Q7e,ye,{})}}function yz(e){let t,n,i,r,s,o,a,u,l;return i=new txe({props:{icon:"mdi:close"}}),o=new Q5({props:{componentData:e[1]}}),{c(){t=H("div"),n=H("span"),de(i.$$.fragment),r=ze(),s=H("div"),de(o.$$.fragment),T(n,"class","cancelButton svelte-1hhf5ym"),T(s,"class","modalContainer"),T(t,"class","modal svelte-1hhf5ym"),T(t,"data-component","modal")},m(c,f){I(c,t,f),V(t,n),ce(i,n,null),V(t,r),V(t,s),ce(o,s,null),a=!0,u||(l=[Ku(s,"click",ixe),Ku(t,"click",e[3])],u=!0)},p(c,f){const d={};f&2&&(d.componentData=c[1]),o.$set(d)},i(c){a||(F(i.$$.fragment,c),F(o.$$.fragment,c),a=!0)},o(c){N(i.$$.fragment,c),N(o.$$.fragment,c),a=!1},d(c){c&&L(t),fe(i),fe(o),u=!1,Xu(l)}}}function nxe(e){let t,n,i,r,s=e[0]&&e[1]&&yz(e);return{c(){s&&s.c(),t=Me()},m(o,a){s&&s.m(o,a),I(o,t,a),n=!0,i||(r=Ku(window,"keyup",e[2]),i=!0)},p(o,[a]){o[0]&&o[1]?s?(s.p(o,a),a&3&&F(s,1)):(s=yz(o),s.c(),F(s,1),s.m(t.parentNode,t)):s&&($e(),N(s,1,1,()=>{s=null}),Se())},i(o){n||(F(s),n=!0)},o(o){N(s),n=!1},d(o){o&&L(t),s&&s.d(o),i=!1,r()}}}const ixe=e=>{e==null||e.stopImmediatePropagation()};function rxe(e,t,n){let i;zh(e,Hc,a=>n(1,i=a));let{componentData:r}=t;function s(a){a.code==="Escape"&&Hc.set(void 0)}function o(a){a.stopImmediatePropagation(),Hc.set(void 0)}return e.$$set=a=>{"componentData"in a&&n(0,r=a.componentData)},[r,i,s,o]}class sxe extends ve{constructor(t){super(),be(this,t,rxe,nxe,ye,{componentData:0})}}function bz(e,t,n){const i=e.slice();return i[2]=t[n][0],i[3]=t[n][1],i}function vz(e,t,n){const i=e.slice();return i[6]=t[n],i}function xz(e){let t,n=e[2]+"",i;return{c(){t=H("span"),i=Oe(n),T(t,"class","pageId svelte-1kdpgko")},m(r,s){I(r,t,s),V(t,i)},p(r,s){s&1&&n!==(n=r[2]+"")&&Ke(i,n)},d(r){r&&L(t)}}}function _z(e){let t,n,i=e[6]+"",r,s,o,a;function u(){return e[1](e[6])}return{c(){t=H("li"),n=H("button"),r=Oe(i),s=ze(),T(n,"class","textButton"),T(t,"class","sectionLink svelte-1kdpgko")},m(l,c){I(l,t,c),V(t,n),V(n,r),V(t,s),o||(a=Ku(n,"click",u),o=!0)},p(l,c){e=l,c&1&&i!==(i=e[6]+"")&&Ke(r,i)},d(l){l&&L(t),o=!1,a()}}}function wz(e){let t,n,i,r,s=e[2]&&xz(e),o=je(e[3]||[]),a=[];for(let u=0;uaxe(s);return e.$$set=s=>{"pageHierarchy"in s&&n(0,i=s.pageHierarchy)},[i,r]}class lxe extends ve{constructor(t){super(),be(this,t,uxe,oxe,ye,{pageHierarchy:0})}}const{Boolean:cxe}=Rz;function Ez(e,t,n){const i=e.slice();return i[5]=t[n],i}function fxe(e){var i;let t,n;return t=new lxe({props:{pageHierarchy:F6((i=e[0])==null?void 0:i.components)}}),{c(){de(t.$$.fragment)},m(r,s){ce(t,r,s),n=!0},p(r,s){var a;const o={};s&1&&(o.pageHierarchy=F6((a=r[0])==null?void 0:a.components)),t.$set(o)},i(r){n||(F(t.$$.fragment,r),n=!0)},o(r){N(t.$$.fragment,r),n=!1},d(r){fe(t,r)}}}function Cz(e){let t,n;return t=new Q5({props:{componentData:e[5]}}),{c(){de(t.$$.fragment)},m(i,r){ce(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.componentData=i[5]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){fe(t,i)}}}function dxe(e){var o;let t,n,i=je(((o=e[0])==null?void 0:o.components)||[]),r=[];for(let a=0;aN(r[a],1,1,()=>{r[a]=null});return{c(){for(let a=0;a{u=null}),Se())},i(l){a||(F(n.$$.fragment,l),F(r.$$.fragment,l),F(u),a=!0)},o(l){N(n.$$.fragment,l),N(r.$$.fragment,l),N(u),a=!1},d(l){l&&(L(t),L(s),L(o)),fe(n),fe(r),u&&u.d(l)}}}function pxe(e,t,n){let i,r;zh(e,wa,u=>n(0,i=u)),zh(e,Hc,u=>n(1,r=u));let{cardDataId:s}=t;Vz(s);let a=!!new URLSearchParams(window==null?void 0:window.location.search).get("embed");return e.$$set=u=>{"cardDataId"in u&&n(3,s=u.cardDataId)},[i,r,a,s]}class gxe extends ve{constructor(t){super(),be(this,t,pxe,hxe,ye,{cardDataId:3})}}let Az;try{const e=window.mfCardDataId,t=window.mfContainerId,n=(Sz=document.querySelector(`[data-container="${t}"]`))==null?void 0:Sz.querySelector(".card_app");Az=new gxe({target:n??document.querySelector(".card_app"),props:{cardDataId:e}})}catch(e){throw new Error(e)}return Az});