diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 8c27a07e1..7e7e5c91e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -8,7 +8,7 @@ body: Before filling a bug report it would be great to [upgrade](https://docs.victoriametrics.com/#how-to-upgrade) to [the latest available release](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/latest) and verify whether the bug is reproducible there. - It's also recommended to read the [troubleshooting docs](https://docs.victoriametrics.com/Troubleshooting.html) first. + It's also recommended to read the [troubleshooting docs](https://docs.victoriametrics.com/troubleshooting/) first. - type: textarea id: describe-the-bug attributes: @@ -65,7 +65,7 @@ body: See how to setup monitoring here: * [monitoring for single-node VictoriaMetrics](https://docs.victoriametrics.com/#monitoring) - * [monitoring for VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#monitoring) + * [monitoring for VictoriaMetrics cluster](https://docs.victoriametrics.com/cluster-victoriametrics/#monitoring) validations: required: false - type: textarea diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml index 51ea7b1c0..5fa598b0d 100644 --- a/.github/ISSUE_TEMPLATE/question.yml +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -24,9 +24,9 @@ body: label: Troubleshooting docs description: I am familiar with the following troubleshooting docs options: - - label: General - https://docs.victoriametrics.com/Troubleshooting.html + - label: General - https://docs.victoriametrics.com/troubleshooting/ required: false - - label: vmagent - https://docs.victoriametrics.com/vmagent.html#troubleshooting + - label: vmagent - https://docs.victoriametrics.com/vmagent/#troubleshooting + required: false + - label: vmalert - https://docs.victoriametrics.com/vmalert/#troubleshooting required: false - - label: vmalert - https://docs.victoriametrics.com/vmalert.html#troubleshooting - required: false \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md deleted file mode 100644 index 5ab4a79c4..000000000 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ /dev/null @@ -1,35 +0,0 @@ -### Describe Your Changes - -Please provide a brief description of the changes you made. Be as specific as possible to help others understand the purpose and impact of your modifications. - -### Checklist - -The following checks are mandatory: - -- [ ] I have read the [Contributing Guidelines](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/CONTRIBUTING.md) -- [ ] All commits are signed and include `Signed-off-by` line. Use `git commit -s` to include `Signed-off-by` your commits. See this [doc](https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work) about how to sign your commits. -- [ ] Tests are passing locally. Use `make test` to run all tests locally. -- [ ] Linting is passing locally. Use `make check-all` to run all linters locally. - -Further checks are optional for External Contributions: - -- [ ] Include a link to the GitHub issue in the commit message, if issue exists. -- [ ] Mention the change in the [Changelog](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/docs/CHANGELOG.md). Explain what has changed and why. If there is a related issue or documentation change - link them as well. - - Tips for writing a good changelog message:: - - * Write a human-readable changelog message that describes the problem and solution. - * Include a link to the issue or pull request in your changelog message. - * Use specific language identifying the fix, such as an error message, metric name, or flag name. - * Provide a link to the relevant documentation for any new features you add or modify. - -- [ ] After your pull request is merged, please add a message to the issue with instructions for how to test the fix or try the feature you added. Here is an [example](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4048#issuecomment-1546453726) -- [ ] Do not close the original issue before the change is released. Please note, in some cases Github can automatically close the issue once PR is merged. Re-open the issue in such case. -- [ ] If the change somehow affects public interfaces (a new flag was added or updated, or some behavior has changed) - add the corresponding change to documentation. - - -Examples of good changelog messages: - -1. FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): add support for [VictoriaMetrics remote write protocol](https://docs.victoriametrics.com/vmagent.html#victoriametrics-remote-write-protocol) when [sending / receiving data to / from Kafka](https://docs.victoriametrics.com/vmagent.html#kafka-integration). This protocol allows saving egress network bandwidth costs when sending data from `vmagent` to `Kafka` located in another datacenter or availability zone. See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1225). - -2. BUGFIX: [stream aggregation](https://docs.victoriametrics.com/stream-aggregation.html): suppress `series after dedup` error message in logs when `-remoteWrite.streamAggr.dedupInterval` command-line flag is set at [vmagent](https://docs.victoriametrics.com/vmgent.html) or when `-streamAggr.dedupInterval` command-line flag is set at [single-node VictoriaMetrics](https://docs.victoriametrics.com/). diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..e072298c8 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,9 @@ +### Describe Your Changes + +Please provide a brief description of the changes you made. Be as specific as possible to help others understand the purpose and impact of your modifications. + +### Checklist + +The following checks are **mandatory**: + +- [ ] My change adheres [VictoriaMetrics contributing guidelines](https://docs.victoriametrics.com/contributing/). diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 5fd8a2625..23cb840b5 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -6,9 +6,6 @@ on: paths: - 'docs/**' workflow_dispatch: {} -env: - PAGEFIND_VERSION: "1.0.4" - HUGO_VERSION: "latest" permissions: contents: read # This is required for actions/checkout and to commit back image update deployments: write @@ -27,16 +24,6 @@ jobs: repository: VictoriaMetrics/vmdocs token: ${{ secrets.VM_BOT_GH_TOKEN }} path: docs - - uses: peaceiris/actions-hugo@v2 - with: - hugo-version: ${{env.HUGO_VERSION}} - extended: true - - name: Install PageFind #install the static search engine for index build - uses: supplypike/setup-bin@v3 - with: - uri: "https://github.com/CloudCannon/pagefind/releases/download/v${{env.PAGEFIND_VERSION}}/pagefind-v${{env.PAGEFIND_VERSION}}-x86_64-unknown-linux-musl.tar.gz" - name: "pagefind" - version: ${{env.PAGEFIND_VERSION}} - name: Import GPG key uses: crazy-max/ghaction-import-gpg@v5 with: @@ -51,13 +38,11 @@ jobs: calculatedSha=$(git rev-parse --short ${{ github.sha }}) echo "short_sha=$calculatedSha" >> $GITHUB_OUTPUT working-directory: main - - name: update code and commit run: | rm -rf content cp -r ../main/docs content make clean-after-copy - make build-search-index git config --global user.name "${{ steps.import-gpg.outputs.email }}" git config --global user.email "${{ steps.import-gpg.outputs.email }}" git add . diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 342dda10d..efcebc815 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,21 +1 @@ -If you like VictoriaMetrics and want to contribute, then we need the following: - -- Filing issues and feature requests [here](https://github.com/VictoriaMetrics/VictoriaMetrics/issues). -- Spreading a word about VictoriaMetrics: conference talks, articles, comments, experience sharing with colleagues. -- Updating documentation. - -We are open to third-party pull requests provided they follow [KISS design principle](https://en.wikipedia.org/wiki/KISS_principle): - -- Prefer simple code and architecture. -- Avoid complex abstractions. -- Avoid magic code and fancy algorithms. -- Avoid [big external dependencies](https://medium.com/@valyala/stripping-dependency-bloat-in-victoriametrics-docker-image-983fb5912b0d). -- Minimize the number of moving parts in the distributed system. -- Avoid automated decisions, which may hurt cluster availability, consistency or performance. - -Adhering `KISS` principle simplifies the resulting code and architecture, so it can be reviewed, understood and verified by many people. - -Before sending a pull request please check the following: -- [ ] All commits are signed and include `Signed-off-by` line. Use `git commit -s` to include `Signed-off-by` your commits. See this [doc](https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work) about how to sign your commits. -- [ ] Tests are passing locally. Use `make test` to run all tests locally. -- [ ] Linting is passing locally. Use `make check-all` to run all linters locally. +The document has been moved [here](https://docs.victoriametrics.com/contributing/). diff --git a/README.md b/README.md index 48553ef8a..87d5ceb80 100644 --- a/README.md +++ b/README.md @@ -12,27 +12,27 @@ VictoriaMetrics logo VictoriaMetrics is a fast, cost-effective and scalable monitoring solution and time series database. -See [case studies for VictoriaMetrics](https://docs.victoriametrics.com/CaseStudies.html). +See [case studies for VictoriaMetrics](https://docs.victoriametrics.com/casestudies/). VictoriaMetrics is available in [binary releases](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/latest), [Docker images](https://hub.docker.com/r/victoriametrics/victoria-metrics/), [Snap packages](https://snapcraft.io/victoriametrics) and [source code](https://github.com/VictoriaMetrics/VictoriaMetrics). -Documentation for the cluster version of VictoriaMetrics is available [here](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html). +Documentation for the cluster version of VictoriaMetrics is available [here](https://docs.victoriametrics.com/cluster-victoriametrics/). -Learn more about [key concepts](https://docs.victoriametrics.com/keyConcepts.html) of VictoriaMetrics and follow the -[quick start guide](https://docs.victoriametrics.com/Quick-Start.html) for a better experience. +Learn more about [key concepts](https://docs.victoriametrics.com/keyconcepts/) of VictoriaMetrics and follow the +[quick start guide](https://docs.victoriametrics.com/quick-start/) for a better experience. If you have questions about VictoriaMetrics, then feel free asking them in the [VictoriaMetrics community Slack chat](https://victoriametrics.slack.com/), you can join it via [Slack Inviter](https://slack.victoriametrics.com/). [Contact us](mailto:info@victoriametrics.com) if you need enterprise support for VictoriaMetrics. -See [features available in enterprise package](https://docs.victoriametrics.com/enterprise.html). +See [features available in enterprise package](https://docs.victoriametrics.com/enterprise/). Enterprise binaries can be downloaded and evaluated for free from [the releases page](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/latest). You can also [request a free trial license](https://victoriametrics.com/products/enterprise/trial/). -VictoriaMetrics is developed at a fast pace, so it is recommended to check the [CHANGELOG](https://docs.victoriametrics.com/CHANGELOG.html) periodically, +VictoriaMetrics is developed at a fast pace, so it is recommended to check the [CHANGELOG](https://docs.victoriametrics.com/changelog/) periodically, and to perform [regular upgrades](#how-to-upgrade-victoriametrics). [VictoriaMetrics enterprise](https://docs.victoriametrics.com/enterprise/) provides long-term support lines of releases (LTS releases) - @@ -48,16 +48,16 @@ VictoriaMetrics has the following prominent features: * It can be used as long-term storage for Prometheus. See [these docs](#prometheus-setup) for details. * It can be used as a drop-in replacement for Prometheus in Grafana, because it supports the [Prometheus querying API](#prometheus-querying-api-usage). * It can be used as a drop-in replacement for Graphite in Grafana, because it supports the [Graphite API](#graphite-api-usage). - VictoriaMetrics allows reducing infrastructure costs by more than 10x comparing to Graphite - see [this case study](https://docs.victoriametrics.com/CaseStudies.html#grammarly). + VictoriaMetrics allows reducing infrastructure costs by more than 10x comparing to Graphite - see [this case study](https://docs.victoriametrics.com/casestudies/#grammarly). * It is easy to setup and operate: * VictoriaMetrics consists of a single [small executable](https://medium.com/@valyala/stripping-dependency-bloat-in-victoriametrics-docker-image-983fb5912b0d) without external dependencies. * All the configuration is done via explicit command-line flags with reasonable defaults. * All the data is stored in a single directory specified by the `-storageDataPath` command-line flag. * Easy and fast backups from [instant snapshots](https://medium.com/@valyala/how-victoriametrics-makes-instant-snapshots-for-multi-terabyte-time-series-data-e1f3fb0e0282) - can be done with [vmbackup](https://docs.victoriametrics.com/vmbackup.html) / [vmrestore](https://docs.victoriametrics.com/vmrestore.html) tools. + can be done with [vmbackup](https://docs.victoriametrics.com/vmbackup/) / [vmrestore](https://docs.victoriametrics.com/vmrestore/) tools. See [this article](https://medium.com/@valyala/speeding-up-backups-for-big-time-series-databases-533c1a927883) for more details. -* It implements a PromQL-like query language - [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html), which provides improved functionality on top of PromQL. +* It implements a PromQL-like query language - [MetricsQL](https://docs.victoriametrics.com/metricsql/), which provides improved functionality on top of PromQL. * It provides a global query view. Multiple Prometheus instances or any other data sources may ingest data into VictoriaMetrics. Later this data may be queried via a single query. * It provides high performance and good vertical and horizontal scalability for both [data ingestion](https://medium.com/@valyala/high-cardinality-tsdb-benchmarks-victoriametrics-vs-timescaledb-vs-influxdb-13e6ee64dd6b) @@ -65,8 +65,8 @@ VictoriaMetrics has the following prominent features: It [outperforms InfluxDB and TimescaleDB by up to 20x](https://medium.com/@valyala/measuring-vertical-scalability-for-time-series-databases-in-google-cloud-92550d78d8ae). * It [uses 10x less RAM than InfluxDB](https://medium.com/@valyala/insert-benchmarks-with-inch-influxdb-vs-victoriametrics-e31a41ae2893) and [up to 7x less RAM than Prometheus, Thanos or Cortex](https://valyala.medium.com/prometheus-vs-victoriametrics-benchmark-on-node-exporter-metrics-4ca29c75590f) - when dealing with millions of unique time series (aka [high cardinality](https://docs.victoriametrics.com/FAQ.html#what-is-high-cardinality)). -* It is optimized for time series with [high churn rate](https://docs.victoriametrics.com/FAQ.html#what-is-high-churn-rate). + when dealing with millions of unique time series (aka [high cardinality](https://docs.victoriametrics.com/faq/#what-is-high-cardinality)). +* It is optimized for time series with [high churn rate](https://docs.victoriametrics.com/faq/#what-is-high-churn-rate). * It provides high data compression: up to 70x more data points may be stored into limited storage compared with TimescaleDB according to [these benchmarks](https://medium.com/@valyala/when-size-matters-benchmarking-victoriametrics-vs-timescale-and-influxdb-6035811952d4), and up to 7x less storage space is required compared to Prometheus, Thanos or Cortex. @@ -94,17 +94,17 @@ VictoriaMetrics has the following prominent features: * [DataDog agent or DogStatsD](#how-to-send-data-from-datadog-agent). * [NewRelic infrastructure agent](#how-to-send-data-from-newrelic-agent). * [OpenTelemetry metrics format](#sending-data-via-opentelemetry). -* It supports powerful [stream aggregation](https://docs.victoriametrics.com/stream-aggregation.html), which can be used as a [statsd](https://github.com/statsd/statsd) alternative. +* It supports powerful [stream aggregation](https://docs.victoriametrics.com/stream-aggregation/), which can be used as a [statsd](https://github.com/statsd/statsd) alternative. * It supports metrics [relabeling](#relabeling). -* It can deal with [high cardinality issues](https://docs.victoriametrics.com/FAQ.html#what-is-high-cardinality) and - [high churn rate](https://docs.victoriametrics.com/FAQ.html#what-is-high-churn-rate) issues via [series limiter](#cardinality-limiter). +* It can deal with [high cardinality issues](https://docs.victoriametrics.com/faq/#what-is-high-cardinality) and + [high churn rate](https://docs.victoriametrics.com/faq/#what-is-high-churn-rate) issues via [series limiter](#cardinality-limiter). * It ideally works with big amounts of time series data from APM, Kubernetes, IoT sensors, connected cars, industrial telemetry, financial data - and various [Enterprise workloads](https://docs.victoriametrics.com/enterprise.html). + and various [Enterprise workloads](https://docs.victoriametrics.com/enterprise/). * It has an open source [cluster version](https://github.com/VictoriaMetrics/VictoriaMetrics/tree/cluster). * It can store data on [NFS-based storages](https://en.wikipedia.org/wiki/Network_File_System) such as [Amazon EFS](https://aws.amazon.com/efs/) and [Google Filestore](https://cloud.google.com/filestore). -See [case studies for VictoriaMetrics](https://docs.victoriametrics.com/CaseStudies.html) and [various Articles about VictoriaMetrics](https://docs.victoriametrics.com/Articles.html). +See [case studies for VictoriaMetrics](https://docs.victoriametrics.com/casestudies/) and [various Articles about VictoriaMetrics](https://docs.victoriametrics.com/articles/). ## Components @@ -116,11 +116,11 @@ VictoriaMetrics ecosystem contains the following components additionally to [sin - [vmalert](https://docs.victoriametrics.com/vmalert/) - a service for processing Prometheus-compatible alerting and recording rules. - [vmalert-tool](https://docs.victoriametrics.com/vmalert-tool/) - a tool for validating alerting and recording rules. - [vmauth](https://docs.victoriametrics.com/vmauth/) - authorization proxy and load balancer optimized for VictoriaMetrics products. -- [vmgateway](https://docs.victoriametrics.com/vmgateway/) - auhtorization proxy with per-[tenant](https://docs.victoriametrics.com/cluster-victoriametrics/#multitenancy) rate limiting cababilities. +- [vmgateway](https://docs.victoriametrics.com/vmgateway/) - authorization proxy with per-[tenant](https://docs.victoriametrics.com/cluster-victoriametrics/#multitenancy) rate limiting cababilities. - [vmctl](https://docs.victoriametrics.com/vmctl/) - a tool for migrating and copying data between different storage systems for metrics. - [vmbackup](https://docs.victoriametrics.com/vmbackup/), [vmrestore](https://docs.victoriametrics.com/vmrestore/) and [vmbackupmanager](https://docs.victoriametrics.com/vmbackupmanager/) - tools for creating backups and restoring from backups for VictoriaMetrics data. -- `vminsert`, `vmselect` and `vmstorage` - components of [VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html). +- `vminsert`, `vmselect` and `vmstorage` - components of [VictoriaMetrics cluster](https://docs.victoriametrics.com/cluster-victoriametrics/). - [VictoriaLogs](https://docs.victoriametrics.com/VictoriaLogs/) - user-friendly cost-efficient database for logs. ## Operation @@ -129,7 +129,7 @@ VictoriaMetrics ecosystem contains the following components additionally to [sin To quickly try VictoriaMetrics, just download the [VictoriaMetrics executable](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/latest) or [Docker image](https://hub.docker.com/r/victoriametrics/victoria-metrics/) and start it with the desired command-line flags. -See also [QuickStart guide](https://docs.victoriametrics.com/Quick-Start.html) for additional information. +See also [QuickStart guide](https://docs.victoriametrics.com/quick-start/) for additional information. VictoriaMetrics can also be installed via these installation methods: @@ -313,8 +313,8 @@ Read more about tuning remote write for Prometheus [here](https://prometheus.io/ It is recommended upgrading Prometheus to [v2.12.0](https://github.com/prometheus/prometheus/releases/latest) or newer, since previous versions may have issues with `remote_write`. -Take a look also at [vmagent](https://docs.victoriametrics.com/vmagent.html) -and [vmalert](https://docs.victoriametrics.com/vmalert.html), +Take a look also at [vmagent](https://docs.victoriametrics.com/vmagent/) +and [vmalert](https://docs.victoriametrics.com/vmalert/), which can be used as faster and less resource-hungry alternative to Prometheus. ## Grafana setup @@ -335,7 +335,7 @@ In the "Type and version" section it is recommended to set the type to "Promethe This allows Grafana to use a more efficient API to get label values. Then build graphs and dashboards for the created datasource using [PromQL](https://prometheus.io/docs/prometheus/latest/querying/basics/) -or [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html). +or [MetricsQL](https://docs.victoriametrics.com/metricsql/). Alternatively, use VictoriaMetrics [datasource plugin](https://github.com/VictoriaMetrics/grafana-datasource) with support of extra features. See more in [description](https://github.com/VictoriaMetrics/grafana-datasource#victoriametrics-data-source-for-grafana). @@ -347,7 +347,7 @@ Grafana playground is available for viewing at our [sandbox](https://play-grafan ## How to upgrade VictoriaMetrics -VictoriaMetrics is developed at a fast pace, so it is recommended periodically checking [the CHANGELOG page](https://docs.victoriametrics.com/CHANGELOG.html) and performing regular upgrades. +VictoriaMetrics is developed at a fast pace, so it is recommended periodically checking [the CHANGELOG page](https://docs.victoriametrics.com/changelog/) and performing regular upgrades. It is safe upgrading VictoriaMetrics to new versions unless [release notes](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/latest) say otherwise. It is safe skipping multiple versions during the upgrade unless [release notes](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/latest) say otherwise. @@ -361,7 +361,7 @@ The following steps must be performed during the upgrade / downgrade procedure: * Wait until the process stops. This can take a few seconds. * Start the upgraded VictoriaMetrics. -Prometheus doesn't drop data during VictoriaMetrics restart. See [this article](https://grafana.com/blog/2019/03/25/whats-new-in-prometheus-2.8-wal-based-remote-write/) for details. The same applies also to [vmagent](https://docs.victoriametrics.com/vmagent.html). +Prometheus doesn't drop data during VictoriaMetrics restart. See [this article](https://grafana.com/blog/2019/03/25/whats-new-in-prometheus-2.8-wal-based-remote-write/) for details. The same applies also to [vmagent](https://docs.victoriametrics.com/vmagent/). ## vmui @@ -380,10 +380,10 @@ The UI allows exploring query results via graphs and tables. It also provides th - [WITH expressions playground](https://play.victoriametrics.com/select/accounting/1/6a716b0f-38bc-4856-90ce-448fd713e3fe/prometheus/graph/#/expand-with-exprs) - test how WITH expressions work; - [Metric relabel debugger](https://play.victoriametrics.com/select/accounting/1/6a716b0f-38bc-4856-90ce-448fd713e3fe/prometheus/graph/#/relabeling) - playground for [relabeling](#relabeling) configs. -VMUI provides auto-completion for [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html) functions, metric names, label names and label values. The auto-completion can be enabled +VMUI provides auto-completion for [MetricsQL](https://docs.victoriametrics.com/metricsql/) functions, metric names, label names and label values. The auto-completion can be enabled by checking the `Autocomplete` toggle. When the auto-completion is disabled, it can still be triggered for the current cursor position by pressing `ctrl+space`. -VMUI automatically switches from graph view to heatmap view when the query returns [histogram](https://docs.victoriametrics.com/keyConcepts.html#histogram) buckets +VMUI automatically switches from graph view to heatmap view when the query returns [histogram](https://docs.victoriametrics.com/keyconcepts/#histogram) buckets (both [Prometheus histograms](https://prometheus.io/docs/concepts/metric_types/#histogram) and [VictoriaMetrics histograms](https://valyala.medium.com/improving-histogram-usability-for-prometheus-and-grafana-bc7e5df0e350) are supported). Try, for example, [this query](https://play.victoriametrics.com/select/accounting/1/6a716b0f-38bc-4856-90ce-448fd713e3fe/prometheus/graph/#/?g0.expr=sum%28rate%28vm_promscrape_scrape_duration_seconds_bucket%29%29+by+%28vmrange%29&g0.range_input=24h&g0.end_input=2023-04-10T17%3A46%3A12&g0.relative_time=last_24_hours&g0.step_input=31m). @@ -399,7 +399,7 @@ Query history can be navigated by holding `Ctrl` (or `Cmd` on MacOS) and pressin Multi-line queries can be entered by pressing `Shift-Enter` in query input field. When querying the [backfilled data](https://docs.victoriametrics.com/#backfilling) -or during [query troubleshooting](https://docs.victoriametrics.com/Troubleshooting.html#unexpected-query-results), +or during [query troubleshooting](https://docs.victoriametrics.com/troubleshooting/#unexpected-query-results), it may be useful disabling response cache by clicking `Disable cache` checkbox. VMUI automatically adjusts the interval between datapoints on the graph depending on the horizontal resolution and on the selected time range. @@ -433,7 +433,7 @@ This information is obtained from the `/api/v1/status/top_queries` HTTP endpoint [VMUI](#vmui) provides `active queries` tab, which shows currently execute queries. It provides the following information per each query: -- The query itself, together with the time range and step args passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyConcepts.html#range-query). +- The query itself, together with the time range and step args passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyconcepts/#range-query). - The duration of the query execution. - The client address, who initiated the query execution. @@ -460,7 +460,7 @@ VictoriaMetrics provides an ability to explore time series cardinality at `Explo - To identify values with the highest number of series for the selected label (aka `focusLabel`). - To identify label=name pairs with the highest number of series. - To identify labels with the highest number of unique values. - Note that [cluster version of VictoriaMetrics](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html) + Note that [cluster version of VictoriaMetrics](https://docs.victoriametrics.com/cluster-victoriametrics/) may show lower than expected number of unique label values for labels with small number of unique values. This is because of [implementation limits](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/5a6e617b5e41c9170e7c562aecd15ee0c901d489/app/vmselect/netstorage/netstorage.go#L1039-L1045). @@ -475,10 +475,10 @@ See the example of using the cardinality explorer [here](https://victoriametrics ## Cardinality explorer statistic inaccuracy -In [cluster version of VictoriaMetrics](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html) each vmstorage tracks the stored time series individually. +In [cluster version of VictoriaMetrics](https://docs.victoriametrics.com/cluster-victoriametrics/) each vmstorage tracks the stored time series individually. vmselect requests stats via [/api/v1/status/tsdb](#tsdb-stats) API from each vmstorage node and merges the results by summing per-series stats. This may lead to inflated values when samples for the same time series are spread across multiple vmstorage nodes -due to [replication](#replication) or [rerouting](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html?highlight=re-routes#cluster-availability). +due to [replication](#replication) or [rerouting](https://docs.victoriametrics.com/cluster-victoriametrics/?highlight=re-routes#cluster-availability). ## How to apply new config to VictoriaMetrics @@ -488,14 +488,14 @@ VictoriaMetrics is configured via command-line flags, so it must be restarted wh * Wait until the process stops. This can take a few seconds. * Start VictoriaMetrics with the new command-line flags. -Prometheus doesn't drop data during VictoriaMetrics restart. See [this article](https://grafana.com/blog/2019/03/25/whats-new-in-prometheus-2.8-wal-based-remote-write/) for details. The same applies also to [vmagent](https://docs.victoriametrics.com/vmagent.html). +Prometheus doesn't drop data during VictoriaMetrics restart. See [this article](https://grafana.com/blog/2019/03/25/whats-new-in-prometheus-2.8-wal-based-remote-write/) for details. The same applies also to [vmagent](https://docs.victoriametrics.com/vmagent/). ## How to scrape Prometheus exporters such as [node-exporter](https://github.com/prometheus/node_exporter) VictoriaMetrics can be used as drop-in replacement for Prometheus for scraping targets configured in `prometheus.yml` config file according to [the specification](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#configuration-file). Just set `-promscrape.config` command-line flag to the path to `prometheus.yml` config - and VictoriaMetrics should start scraping the configured targets. -If the provided configuration file contains [unsupported options](https://docs.victoriametrics.com/vmagent.html#unsupported-prometheus-config-sections), +If the provided configuration file contains [unsupported options](https://docs.victoriametrics.com/vmagent/#unsupported-prometheus-config-sections), then either delete them from the file or just pass `-promscrape.config.strictParse=false` command-line flag to VictoriaMetrics, so it will ignore unsupported options. The file pointed by `-promscrape.config` may contain `%{ENV_VAR}` placeholders, which are substituted by the corresponding `ENV_VAR` environment variable values. @@ -503,11 +503,11 @@ The file pointed by `-promscrape.config` may contain `%{ENV_VAR}` placeholders, See also: - [scrape config examples](https://docs.victoriametrics.com/scrape_config_examples/) -- [the list of supported service discovery types for Prometheus scrape targets](https://docs.victoriametrics.com/sd_configs.html) +- [the list of supported service discovery types for Prometheus scrape targets](https://docs.victoriametrics.com/sd_configs/) VictoriaMetrics also supports [importing data in Prometheus exposition format](#how-to-import-data-in-prometheus-exposition-format). -See also [vmagent](https://docs.victoriametrics.com/vmagent.html), which can be used as drop-in replacement for Prometheus. +See also [vmagent](https://docs.victoriametrics.com/vmagent/), which can be used as drop-in replacement for Prometheus. ## How to send data from DataDog agent @@ -530,7 +530,7 @@ DD_DD_URL=http://victoriametrics:8428/datadog ``` -_Choose correct URL for VictoriaMetrics [here](https://docs.victoriametrics.com/url-examples.html#datadog)._ +_Choose correct URL for VictoriaMetrics [here](https://docs.victoriametrics.com/url-examples/#datadog)._ To configure DataDog agent via [configuration file](https://github.com/DataDog/datadog-agent/blob/878600ef7a55c5ef0efb41ed0915f020cf7e3bd0/pkg/config/config_template.yaml#L33) add the following line: @@ -539,8 +539,8 @@ add the following line: dd_url: http://victoriametrics:8428/datadog ``` -[vmagent](https://docs.victoriametrics.com/vmagent.html) also can accept DataDog metrics format. Depending on where vmagent will forward data, -pick [single-node or cluster URL](https://docs.victoriametrics.com/url-examples.html#datadog) formats. +[vmagent](https://docs.victoriametrics.com/vmagent/) also can accept DataDog metrics format. Depending on where vmagent will forward data, +pick [single-node or cluster URL](https://docs.victoriametrics.com/url-examples/#datadog) formats. ### Sending metrics to DataDog and VictoriaMetrics @@ -555,7 +555,7 @@ Run DataDog using the following ENV variable with VictoriaMetrics as additional DD_ADDITIONAL_ENDPOINTS='{\"http://victoriametrics:8428/datadog\": [\"apikey\"]}' ``` -_Choose correct URL for VictoriaMetrics [here](https://docs.victoriametrics.com/url-examples.html#datadog)._ +_Choose correct URL for VictoriaMetrics [here](https://docs.victoriametrics.com/url-examples/#datadog)._ To configure DataDog Dual Shipping via [configuration file](https://docs.datadoghq.com/agent/guide/agent-configuration-files) @@ -583,9 +583,9 @@ provider: ### Send via cURL -See how to send data to VictoriaMetrics via DataDog "submit metrics" API [here](https://docs.victoriametrics.com/url-examples.html#datadogapiv2series). +See how to send data to VictoriaMetrics via DataDog "submit metrics" API [here](https://docs.victoriametrics.com/url-examples/#datadogapiv2series). -The imported data can be read via [export API](https://docs.victoriametrics.com/url-examples.html#apiv1export). +The imported data can be read via [export API](https://docs.victoriametrics.com/url-examples/#apiv1export). ### Additional details @@ -599,12 +599,12 @@ For example, `/datadog/api/v2/series?extra_label=foo=bar` would add `{foo="bar"} DataDog agent sends the [configured tags](https://docs.datadoghq.com/getting_started/tagging/) to undocumented endpoint - `/datadog/intake`. This endpoint isn't supported by VictoriaMetrics yet. This prevents from adding the configured tags to DataDog agent data sent into VictoriaMetrics. -The workaround is to run a sidecar [vmagent](https://docs.victoriametrics.com/vmagent.html) alongside every DataDog agent, +The workaround is to run a sidecar [vmagent](https://docs.victoriametrics.com/vmagent/) alongside every DataDog agent, which must run with `DD_DD_URL=http://localhost:8429/datadog` environment variable. The sidecar `vmagent` must be configured with the needed tags via `-remoteWrite.label` command-line flag and must forward incoming data with the added tags to a centralized VictoriaMetrics specified via `-remoteWrite.url` command-line flag. -See [these docs](https://docs.victoriametrics.com/vmagent.html#adding-labels-to-metrics) for details on how to add labels to metrics at `vmagent`. +See [these docs](https://docs.victoriametrics.com/vmagent/#adding-labels-to-metrics) for details on how to add labels to metrics at `vmagent`. ## How to send data from InfluxDB-compatible agents such as [Telegraf](https://www.influxdata.com/time-series-platform/telegraf/) @@ -622,9 +622,9 @@ and stream plain InfluxDB line protocol data to the configured TCP and/or UDP ad VictoriaMetrics performs the following transformations to the ingested InfluxDB data: * [db query arg](https://docs.influxdata.com/influxdb/v1.7/tools/api/#write-http-endpoint) is mapped into `db` - [label](https://docs.victoriametrics.com/keyConcepts.html#labels) value unless `db` tag exists in the InfluxDB line. + [label](https://docs.victoriametrics.com/keyconcepts/#labels) value unless `db` tag exists in the InfluxDB line. The `db` label name can be overridden via `-influxDBLabel` command-line flag. If more strict data isolation is required, - read more about multi-tenancy [here](https://docs.victoriametrics.com/keyConcepts.html#multi-tenancy). + read more about multi-tenancy [here](https://docs.victoriametrics.com/keyconcepts/#multi-tenancy). * Field names are mapped to time series names prefixed with `{measurement}{separator}` value, where `{separator}` equals to `_` by default. It can be changed with `-influxMeasurementFieldSeparator` command-line flag. See also `-influxSkipSingleField` command-line flag. If `{measurement}` is empty or if `-influxSkipMeasurement` command-line flag is set, then time series names correspond to field names. * Field values are mapped to time series values. * Tags are mapped to Prometheus labels as-is. @@ -735,7 +735,7 @@ The `/api/v1/export` endpoint should return the following response: {"metric":{"__name__":"foo.bar.baz","tag1":"value1","tag2":"value2"},"values":[123],"timestamps":[1560277406000]} ``` -[Graphite relabeling](https://docs.victoriametrics.com/vmagent.html#graphite-relabeling) can be used if the imported Graphite data is going to be queried via [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html). +[Graphite relabeling](https://docs.victoriametrics.com/vmagent/#graphite-relabeling) can be used if the imported Graphite data is going to be queried via [MetricsQL](https://docs.victoriametrics.com/metricsql/). ## Querying Graphite data @@ -747,7 +747,7 @@ Data sent to VictoriaMetrics via `Graphite plaintext protocol` may be read via t ## Selecting Graphite metrics -VictoriaMetrics supports `__graphite__` pseudo-label for selecting time series with Graphite-compatible filters in [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html). For example, `{__graphite__="foo.*.bar"}` is equivalent to `{__name__=~"foo[.][^.]*[.]bar"}`, but it works faster and it is easier to use when migrating from Graphite to VictoriaMetrics. See [docs for Graphite paths and wildcards](https://graphite.readthedocs.io/en/latest/render_api.html#paths-and-wildcards). VictoriaMetrics also supports [label_graphite_group](https://docs.victoriametrics.com/MetricsQL.html#label_graphite_group) function for extracting the given groups from Graphite metric name. +VictoriaMetrics supports `__graphite__` pseudo-label for selecting time series with Graphite-compatible filters in [MetricsQL](https://docs.victoriametrics.com/metricsql/). For example, `{__graphite__="foo.*.bar"}` is equivalent to `{__name__=~"foo[.][^.]*[.]bar"}`, but it works faster and it is easier to use when migrating from Graphite to VictoriaMetrics. See [docs for Graphite paths and wildcards](https://graphite.readthedocs.io/en/latest/render_api.html#paths-and-wildcards). VictoriaMetrics also supports [label_graphite_group](https://docs.victoriametrics.com/metricsql/#label_graphite_group) function for extracting the given groups from Graphite metric name. The `__graphite__` pseudo-label supports e.g. alternate regexp filters such as `(value1|...|valueN)`. They are transparently converted to `{value1,...,valueN}` syntax [used in Graphite](https://graphite.readthedocs.io/en/latest/render_api.html#paths-and-wildcards). This allows using [multi-value template variables in Grafana](https://grafana.com/docs/grafana/latest/variables/formatting-multi-value-variables/) inside `__graphite__` pseudo-label. For example, Grafana expands `{__graphite__=~"foo.($bar).baz"}` into `{__graphite__=~"foo.(x|y).baz"}` if `$bar` template variable contains `x` and `y` values. In this case the query is automatically converted into `{__graphite__=~"foo.{x,y}.baz"}` before execution. @@ -843,7 +843,7 @@ For example, `/api/put?extra_label=foo=bar` would add `{foo="bar"}` label to all VictoriaMetrics accepts data from [NewRelic infrastructure agent](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent) at `/newrelic/infra/v2/metrics/events/bulk` HTTP path. VictoriaMetrics receives [Events](https://docs.newrelic.com/docs/infrastructure/manage-your-data/data-instrumentation/default-infrastructure-monitoring-data/#infrastructure-events) -from NewRelic agent at the given path, transforms them to [raw samples](https://docs.victoriametrics.com/keyConcepts.html#raw-samples) +from NewRelic agent at the given path, transforms them to [raw samples](https://docs.victoriametrics.com/keyconcepts/#raw-samples) according to [these docs](#newrelic-agent-data-mapping) before storing the raw samples to the database. You need passing `COLLECTOR_URL` and `NRIA_LICENSE_KEY` environment variables to NewRelic infrastructure agent in order to send the collected metrics to VictoriaMetrics. @@ -858,11 +858,11 @@ COLLECTOR_URL="http://localhost:8428/newrelic" NRIA_LICENSE_KEY="NEWRELIC_LICENS ### NewRelic agent data mapping VictoriaMetrics maps [NewRelic Events](https://docs.newrelic.com/docs/infrastructure/manage-your-data/data-instrumentation/default-infrastructure-monitoring-data/#infrastructure-events) -to [raw samples](https://docs.victoriametrics.com/keyConcepts.html#raw-samples) in the following way: +to [raw samples](https://docs.victoriametrics.com/keyconcepts/#raw-samples) in the following way: 1. Every numeric field is converted into a raw sample with the corresponding name. -1. The `eventType` and all the other fields with `string` value type are attached to every raw sample as [metric labels](https://docs.victoriametrics.com/keyConcepts.html#labels). -1. The `timestamp` field is used as timestamp for the ingested [raw sample](https://docs.victoriametrics.com/keyConcepts.html#raw-samples). +1. The `eventType` and all the other fields with `string` value type are attached to every raw sample as [metric labels](https://docs.victoriametrics.com/keyconcepts/#labels). +1. The `timestamp` field is used as timestamp for the ingested [raw sample](https://docs.victoriametrics.com/keyconcepts/#raw-samples). The `timestamp` field may be specified either in seconds or in milliseconds since the [Unix Epoch](https://en.wikipedia.org/wiki/Unix_time). If the `timestamp` field is missing, then the raw sample is stored with the current timestamp. @@ -915,8 +915,8 @@ curl http://localhost:8428/api/v1/export -d 'match={eventType="SystemSample"}' VictoriaMetrics supports the following handlers from [Prometheus querying API](https://prometheus.io/docs/prometheus/latest/querying/api/): -* [/api/v1/query](https://docs.victoriametrics.com/keyConcepts.html#instant-query) -* [/api/v1/query_range](https://docs.victoriametrics.com/keyConcepts.html#range-query) +* [/api/v1/query](https://docs.victoriametrics.com/keyconcepts/#instant-query) +* [/api/v1/query_range](https://docs.victoriametrics.com/keyconcepts/#range-query) * [/api/v1/series](https://docs.victoriametrics.com/url-examples/#apiv1series) * [/api/v1/labels](https://docs.victoriametrics.com/url-examples/#apiv1labels) * [/api/v1/label/.../values](https://docs.victoriametrics.com/url-examples/#apiv1labelvalues) @@ -934,38 +934,38 @@ for enforcing additional label filters for queries. For example, `/api/v1/query_ would automatically add `{user_id="123",group_id="456"}` label filters to the given ``. This functionality can be used for limiting the scope of time series visible to the given tenant. It is expected that the `extra_label` query args are automatically set by auth proxy sitting in front of VictoriaMetrics. -See [vmauth](https://docs.victoriametrics.com/vmauth.html) and [vmgateway](https://docs.victoriametrics.com/vmgateway.html) as examples of such proxies. +See [vmauth](https://docs.victoriametrics.com/vmauth/) and [vmgateway](https://docs.victoriametrics.com/vmgateway/) as examples of such proxies. VictoriaMetrics accepts optional `extra_filters[]=series_selector` query arg, which can be used for enforcing arbitrary label filters for queries. For example, `/api/v1/query_range?extra_filters[]={env=~"prod|staging",user="xyz"}&query=` would automatically add `{env=~"prod|staging",user="xyz"}` label filters to the given ``. This functionality can be used for limiting the scope of time series visible to the given tenant. It is expected that the `extra_filters[]` query args are automatically set by auth proxy sitting in front of VictoriaMetrics. -See [vmauth](https://docs.victoriametrics.com/vmauth.html) and [vmgateway](https://docs.victoriametrics.com/vmgateway.html) as examples of such proxies. +See [vmauth](https://docs.victoriametrics.com/vmauth/) and [vmgateway](https://docs.victoriametrics.com/vmgateway/) as examples of such proxies. VictoriaMetrics accepts multiple formats for `time`, `start` and `end` query args - see [these docs](#timestamp-formats). -VictoriaMetrics accepts `round_digits` query arg for [/api/v1/query](https://docs.victoriametrics.com/keyConcepts.html#instant-query) -and [/api/v1/query_range](https://docs.victoriametrics.com/keyConcepts.html#range-query) handlers. It can be used for rounding response values +VictoriaMetrics accepts `round_digits` query arg for [/api/v1/query](https://docs.victoriametrics.com/keyconcepts/#instant-query) +and [/api/v1/query_range](https://docs.victoriametrics.com/keyconcepts/#range-query) handlers. It can be used for rounding response values to the given number of digits after the decimal point. For example, `/api/v1/query?query=avg_over_time(temperature[1h])&round_digits=2` would round response values to up to two digits after the decimal point. -VictoriaMetrics accepts `limit` query arg for [/api/v1/labels](https://docs.victoriametrics.com/url-examples.html#apiv1labels) -and [`/api/v1/label//values`](https://docs.victoriametrics.com/url-examples.html#apiv1labelvalues) handlers for limiting the number of returned entries. +VictoriaMetrics accepts `limit` query arg for [/api/v1/labels](https://docs.victoriametrics.com/url-examples/#apiv1labels) +and [`/api/v1/label//values`](https://docs.victoriametrics.com/url-examples/#apiv1labelvalues) handlers for limiting the number of returned entries. For example, the query to `/api/v1/labels?limit=5` returns a sample of up to 5 unique labels, while ignoring the rest of labels. If the provided `limit` value exceeds the corresponding `-search.maxTagKeys` / `-search.maxTagValues` command-line flag values, then limits specified in the command-line flags are used. By default, VictoriaMetrics returns time series for the last day starting at 00:00 UTC -from [/api/v1/series](https://docs.victoriametrics.com/url-examples.html#apiv1series), -[/api/v1/labels](https://docs.victoriametrics.com/url-examples.html#apiv1labels) and -[`/api/v1/label//values`](https://docs.victoriametrics.com/url-examples.html#apiv1labelvalues), +from [/api/v1/series](https://docs.victoriametrics.com/url-examples/#apiv1series), +[/api/v1/labels](https://docs.victoriametrics.com/url-examples/#apiv1labels) and +[`/api/v1/label//values`](https://docs.victoriametrics.com/url-examples/#apiv1labelvalues), while the Prometheus API defaults to all time. Explicitly set `start` and `end` to select the desired time range. VictoriaMetrics rounds the specified `start..end` time range to day granularity because of performance optimization concerns. If you need the exact set of label names and label values on the given time range, then send queries -to [/api/v1/query](https://docs.victoriametrics.com/keyConcepts.html#instant-query) or to [/api/v1/query_range](https://docs.victoriametrics.com/keyConcepts.html#range-query). +to [/api/v1/query](https://docs.victoriametrics.com/keyconcepts/#instant-query) or to [/api/v1/query_range](https://docs.victoriametrics.com/keyconcepts/#range-query). -VictoriaMetrics accepts `limit` query arg at [/api/v1/series](https://docs.victoriametrics.com/url-examples.html#apiv1series) +VictoriaMetrics accepts `limit` query arg at [/api/v1/series](https://docs.victoriametrics.com/url-examples/#apiv1series) for limiting the number of returned entries. For example, the query to `/api/v1/series?limit=5` returns a sample of up to 5 series, while ignoring the rest of series. If the provided `limit` value exceeds the corresponding `-search.maxSeries` command-line flag values, then limits specified in the command-line flags are used. @@ -1013,11 +1013,11 @@ VictoriaMetrics supports the following Graphite querying APIs, which are needed All the Graphite handlers can be pre-pended with `/graphite` prefix. For example, both `/graphite/metrics/find` and `/metrics/find` should work. -VictoriaMetrics accepts optional query args: `extra_label==` and `extra_filters[]=series_selector` query args for all the Graphite APIs. These args can be used for limiting the scope of time series visible to the given tenant. It is expected that the `extra_label` query arg is automatically set by auth proxy sitting in front of VictoriaMetrics. See [vmauth](https://docs.victoriametrics.com/vmauth.html) and [vmgateway](https://docs.victoriametrics.com/vmgateway.html) as examples of such proxies. +VictoriaMetrics accepts optional query args: `extra_label==` and `extra_filters[]=series_selector` query args for all the Graphite APIs. These args can be used for limiting the scope of time series visible to the given tenant. It is expected that the `extra_label` query arg is automatically set by auth proxy sitting in front of VictoriaMetrics. See [vmauth](https://docs.victoriametrics.com/vmauth/) and [vmgateway](https://docs.victoriametrics.com/vmgateway/) as examples of such proxies. [Contact us](mailto:sales@victoriametrics.com) if you need assistance with such a proxy. -VictoriaMetrics supports `__graphite__` pseudo-label for filtering time series with Graphite-compatible filters in [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html). See [these docs](#selecting-graphite-metrics). +VictoriaMetrics supports `__graphite__` pseudo-label for filtering time series with Graphite-compatible filters in [MetricsQL](https://docs.victoriametrics.com/metricsql/). See [these docs](#selecting-graphite-metrics). ### Graphite Render API usage @@ -1125,7 +1125,7 @@ Note that `production` builds are not supported via Podman becuase Podman does n ## Start with docker-compose [Docker-compose](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/deployment/docker/docker-compose.yml) -helps to spin up VictoriaMetrics, [vmagent](https://docs.victoriametrics.com/vmagent.html) and Grafana with one command. +helps to spin up VictoriaMetrics, [vmagent](https://docs.victoriametrics.com/vmagent/) and Grafana with one command. More details may be found [here](https://github.com/VictoriaMetrics/VictoriaMetrics/tree/master/deployment/docker#folder-contains-basic-images-and-tools-for-building-and-running-victoria-metrics-in-docker). ## Setting up service @@ -1145,7 +1145,7 @@ The page returns the following JSON response on successful creation of snapshot: Snapshots are created under `<-storageDataPath>/snapshots` directory, where `<-storageDataPath>` is the corresponding command-line flag value. Snapshots can be archived to backup storage at any time -with [vmbackup](https://docs.victoriametrics.com/vmbackup.html). +with [vmbackup](https://docs.victoriametrics.com/vmbackup/). Snapshots consist of a mix of hard-links and soft-links to various files and directories inside `-storageDataPath`. See [this article](https://medium.com/@valyala/how-victoriametrics-makes-instant-snapshots-for-multi-terabyte-time-series-data-e1f3fb0e0282) @@ -1154,7 +1154,7 @@ for more details. This adds some restrictions on what can be done with the conte - Do not delete subdirectories inside `<-storageDataPath>/snapshots` with `rm` or similar commands, since this will leave some snapshot data undeleted. Prefer using the `/snapshot/delete` API for deleting snapshot. See below for more details about this API. - Do not copy subdirectories inside `<-storageDataPath>/snapshot` with `cp`, `rsync` or similar commands, since there are high chances - that these commands won't copy some data stored in the snapshot. Prefer using [vmbackup](https://docs.victoriametrics.com/vmbackup.html) for making copies of snapshot data. + that these commands won't copy some data stored in the snapshot. Prefer using [vmbackup](https://docs.victoriametrics.com/vmbackup/) for making copies of snapshot data. See also [snapshot troubleshooting](#snapshot-troubleshooting). @@ -1168,7 +1168,7 @@ Navigate to `http://:8428/snapshot/delete_all` in order to ### How to restore from a snapshot 1. Stop VictoriaMetrics with `kill -INT`. -1. Restore snapshot contents from backup with [vmrestore](https://docs.victoriametrics.com/vmrestore.html) +1. Restore snapshot contents from backup with [vmrestore](https://docs.victoriametrics.com/vmrestore/) to the directory pointed by `-storageDataPath`. 1. Start VictoriaMetrics. @@ -1590,8 +1590,8 @@ Too long JSON lines may increase RAM usage at VictoriaMetrics side. [/api/v1/export](#how-to-export-data-in-json-line-format) handler accepts `max_rows_per_line` query arg, which allows limiting the number of samples per each exported line. -It is OK to split [raw samples](https://docs.victoriametrics.com/keyConcepts.html#raw-samples) -for the same [time series](https://docs.victoriametrics.com/keyConcepts.html#time-series) across multiple lines. +It is OK to split [raw samples](https://docs.victoriametrics.com/keyconcepts/#raw-samples) +for the same [time series](https://docs.victoriametrics.com/keyconcepts/#time-series) across multiple lines. The number of lines in the request to [/api/v1/import](#how-to-import-data-in-json-line-format) can be arbitrary - they are imported in streaming manner. @@ -1603,7 +1603,7 @@ The `-relabelConfig` also can point to http or https url. For example, `-relabel The following docs can be useful in understanding the relabeling: -* [Cookbook for common relabeling tasks](https://docs.victoriametrics.com/relabeling.html). +* [Cookbook for common relabeling tasks](https://docs.victoriametrics.com/relabeling/). * [Relabeling tips and tricks](https://valyala.medium.com/how-to-use-relabeling-in-prometheus-and-victoriametrics-8b90fc22c4b2). The `-relabelConfig` files can contain special placeholders in the form `%{ENV_VAR}`, which are replaced by the corresponding environment variable values. @@ -1622,11 +1622,11 @@ Example contents for `-relabelConfig` file: ``` VictoriaMetrics provides additional relabeling features such as Graphite-style relabeling. -See [these docs](https://docs.victoriametrics.com/vmagent.html#relabeling) for more details. +See [these docs](https://docs.victoriametrics.com/vmagent/#relabeling) for more details. The relabeling can be debugged at `http://victoriametrics:8428/metric-relabel-debug` page or at our [public playground](https://play.victoriametrics.com/select/accounting/1/6a716b0f-38bc-4856-90ce-448fd713e3fe/prometheus/graph/#/relabeling). -See [these docs](https://docs.victoriametrics.com/vmagent.html#relabel-debug) for more details. +See [these docs](https://docs.victoriametrics.com/vmagent/#relabel-debug) for more details. ## Federation @@ -1648,9 +1648,9 @@ with scrape intervals exceeding `5m`. ## Capacity planning -VictoriaMetrics uses lower amounts of CPU, RAM and storage space on production workloads compared to competing solutions (Prometheus, Thanos, Cortex, TimescaleDB, InfluxDB, QuestDB, M3DB) according to [our case studies](https://docs.victoriametrics.com/CaseStudies.html). +VictoriaMetrics uses lower amounts of CPU, RAM and storage space on production workloads compared to competing solutions (Prometheus, Thanos, Cortex, TimescaleDB, InfluxDB, QuestDB, M3DB) according to [our case studies](https://docs.victoriametrics.com/casestudies/). -VictoriaMetrics capacity scales linearly with the available resources. The needed amounts of CPU and RAM highly depends on the workload - the number of [active time series](https://docs.victoriametrics.com/FAQ.html#what-is-an-active-time-series), series [churn rate](https://docs.victoriametrics.com/FAQ.html#what-is-high-churn-rate), query types, query qps, etc. It is recommended setting up a test VictoriaMetrics for your production workload and iteratively scaling CPU and RAM resources until it becomes stable according to [troubleshooting docs](#troubleshooting). A single-node VictoriaMetrics works perfectly with the following production workload according to [our case studies](https://docs.victoriametrics.com/CaseStudies.html): +VictoriaMetrics capacity scales linearly with the available resources. The needed amounts of CPU and RAM highly depends on the workload - the number of [active time series](https://docs.victoriametrics.com/faq/#what-is-an-active-time-series), series [churn rate](https://docs.victoriametrics.com/faq/#what-is-high-churn-rate), query types, query qps, etc. It is recommended setting up a test VictoriaMetrics for your production workload and iteratively scaling CPU and RAM resources until it becomes stable according to [troubleshooting docs](#troubleshooting). A single-node VictoriaMetrics works perfectly with the following production workload according to [our case studies](https://docs.victoriametrics.com/casestudies/): * Ingestion rate: 1.5+ million samples per second * Active time series: 50+ million @@ -1697,37 +1697,37 @@ By default, VictoriaMetrics is tuned for an optimal resource usage under typical The downside is that the endpoints can return labels and series, which do not match the provided extra filters. - `-search.maxSamplesPerSeries` limits the number of raw samples the query can process per each time series. VictoriaMetrics sequentially processes raw samples per each found time series during the query. It unpacks raw samples on the selected time range per each time series into memory - and then applies the given [rollup function](https://docs.victoriametrics.com/MetricsQL.html#rollup-functions). The `-search.maxSamplesPerSeries` command-line flag + and then applies the given [rollup function](https://docs.victoriametrics.com/metricsql/#rollup-functions). The `-search.maxSamplesPerSeries` command-line flag allows limiting memory usage in the case when the query is executed on a time range, which contains hundreds of millions of raw samples per each located time series. - `-search.maxSamplesPerQuery` limits the number of raw samples a single query can process. This allows limiting CPU usage for heavy queries. -- `-search.maxResponseSeries` limits the number of time series a single query can return from [`/api/v1/query`](https://docs.victoriametrics.com/keyConcepts.html#instant-query) - and [`/api/v1/query_range`](https://docs.victoriametrics.com/keyConcepts.html#range-query). +- `-search.maxResponseSeries` limits the number of time series a single query can return from [`/api/v1/query`](https://docs.victoriametrics.com/keyconcepts/#instant-query) + and [`/api/v1/query_range`](https://docs.victoriametrics.com/keyconcepts/#range-query). - `-search.maxPointsPerTimeseries` limits the number of calculated points, which can be returned per each matching time series - from [range query](https://docs.victoriametrics.com/keyConcepts.html#range-query). + from [range query](https://docs.victoriametrics.com/keyconcepts/#range-query). - `-search.maxPointsSubqueryPerTimeseries` limits the number of calculated points, which can be generated per each matching time series - during [subquery](https://docs.victoriametrics.com/MetricsQL.html#subqueries) evaluation. -- `-search.maxSeriesPerAggrFunc` limits the number of time series, which can be generated by [MetricsQL aggregate functions](https://docs.victoriametrics.com/MetricsQL.html#aggregate-functions) + during [subquery](https://docs.victoriametrics.com/metricsql/#subqueries) evaluation. +- `-search.maxSeriesPerAggrFunc` limits the number of time series, which can be generated by [MetricsQL aggregate functions](https://docs.victoriametrics.com/metricsql/#aggregate-functions) in a single query. - `-search.maxSeries` limits the number of time series, which may be returned from [/api/v1/series](https://docs.victoriametrics.com/url-examples/#apiv1series). This endpoint is used mostly by Grafana for auto-completion of metric names, label names and label values. Queries to this endpoint may take big amounts - of CPU time and memory when the database contains big number of unique time series because of [high churn rate](https://docs.victoriametrics.com/FAQ.html#what-is-high-churn-rate). + of CPU time and memory when the database contains big number of unique time series because of [high churn rate](https://docs.victoriametrics.com/faq/#what-is-high-churn-rate). In this case it might be useful to set the `-search.maxSeries` to quite low value in order limit CPU and memory usage. See also `-search.maxLabelsAPIDuration` and `-search.maxLabelsAPISeries`. - `-search.maxTagKeys` limits the number of items, which may be returned from [/api/v1/labels](https://docs.victoriametrics.com/url-examples/#apiv1labels). This endpoint is used mostly by Grafana for auto-completion of label names. Queries to this endpoint may take big amounts of CPU time and memory - when the database contains big number of unique time series because of [high churn rate](https://docs.victoriametrics.com/FAQ.html#what-is-high-churn-rate). + when the database contains big number of unique time series because of [high churn rate](https://docs.victoriametrics.com/faq/#what-is-high-churn-rate). In this case it might be useful to set the `-search.maxTagKeys` to quite low value in order to limit CPU and memory usage. See also `-search.maxLabelsAPIDuration` and `-search.maxLabelsAPISeries`. - `-search.maxTagValues` limits the number of items, which may be returned from [/api/v1/label/.../values](https://docs.victoriametrics.com/url-examples/#apiv1labelvalues). This endpoint is used mostly by Grafana for auto-completion of label values. Queries to this endpoint may take big amounts of CPU time and memory - when the database contains big number of unique time series because of [high churn rate](https://docs.victoriametrics.com/FAQ.html#what-is-high-churn-rate). + when the database contains big number of unique time series because of [high churn rate](https://docs.victoriametrics.com/faq/#what-is-high-churn-rate). In this case it might be useful to set the `-search.maxTagValues` to quite low value in order to limit CPU and memory usage. See also `-search.maxLabelsAPIDuration` and `-search.maxLabelsAPISeries`. - `-search.maxLabelsAPISeries` limits the number of time series, which can be scanned when performing [/api/v1/labels](https://docs.victoriametrics.com/url-examples/#apiv1labels), [/api/v1/label/.../values](https://docs.victoriametrics.com/url-examples/#apiv1labelvalues) or [/api/v1/series](https://docs.victoriametrics.com/url-examples/#apiv1series) requests. These endpoints are used mostly by Grafana for auto-completion of label names and label values. Queries to these endpoints may take big amounts of CPU time and memory - when the database contains big number of unique time series because of [high churn rate](https://docs.victoriametrics.com/FAQ.html#what-is-high-churn-rate). + when the database contains big number of unique time series because of [high churn rate](https://docs.victoriametrics.com/faq/#what-is-high-churn-rate). In this case it might be useful to set the `-search.maxLabelsAPISeries` to quite low value in order to limit CPU and memory usage. See also `-search.maxLabelsAPIDuration` and `-search.ignoreExtraFiltersAtLabelsAPI`. - `-search.maxLabelsAPIDuration` limits the duration for requests to [/api/v1/labels](https://docs.victoriametrics.com/url-examples/#apiv1labels), @@ -1735,12 +1735,12 @@ By default, VictoriaMetrics is tuned for an optimal resource usage under typical or [/api/v1/series](https://docs.victoriametrics.com/url-examples/#apiv1series). The limit can be altered for each query by passing `timeout` GET parameter, but can't exceed the limit specified via cmd-line flag. These endpoints are used mostly by Grafana for auto-completion of label names and label values. Queries to these endpoints may take big amounts of CPU time and memory - when the database contains big number of unique time series because of [high churn rate](https://docs.victoriametrics.com/FAQ.html#what-is-high-churn-rate). + when the database contains big number of unique time series because of [high churn rate](https://docs.victoriametrics.com/faq/#what-is-high-churn-rate). In this case it might be useful to set the `-search.maxLabelsAPIDuration` to quite low value in order to limit CPU and memory usage. See also `-search.maxLabelsAPISeries` and `-search.ignoreExtraFiltersAtLabelsAPI`. - `-search.maxTagValueSuffixesPerSearch` limits the number of entries, which may be returned from `/metrics/find` endpoint. See [Graphite Metrics API usage docs](#graphite-metrics-api-usage). -See also [resource usage limits at VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#resource-usage-limits), +See also [resource usage limits at VictoriaMetrics cluster](https://docs.victoriametrics.com/cluster-victoriametrics/#resource-usage-limits), [cardinality limiter](#cardinality-limiter) and [capacity planning docs](#capacity-planning). @@ -1749,17 +1749,17 @@ See also [resource usage limits at VictoriaMetrics cluster](https://docs.victori The general approach for achieving high availability is the following: - To run two identically configured VictoriaMetrics instances in distinct datacenters (availability zones); -- To store the collected data simultaneously into these instances via [vmagent](https://docs.victoriametrics.com/vmagent.html) or Prometheus. +- To store the collected data simultaneously into these instances via [vmagent](https://docs.victoriametrics.com/vmagent/) or Prometheus. - To query the first VictoriaMetrics instance and to fail over to the second instance when the first instance becomes temporarily unavailable. - This can be done via [vmauth](https://docs.victoriametrics.com/vmauth.html) according to [these docs](https://docs.victoriametrics.com/vmauth.html#high-availability). + This can be done via [vmauth](https://docs.victoriametrics.com/vmauth/) according to [these docs](https://docs.victoriametrics.com/vmauth/#high-availability). Such a setup guarantees that the collected data isn't lost when one of VictoriaMetrics instance becomes unavailable. The collected data continues to be written to the available VictoriaMetrics instance, so it should be available for querying. -Both [vmagent](https://docs.victoriametrics.com/vmagent.html) and Prometheus buffer the collected data locally if they cannot send it +Both [vmagent](https://docs.victoriametrics.com/vmagent/) and Prometheus buffer the collected data locally if they cannot send it to the configured remote storage. So the collected data will be written to the temporarily unavailable VictoriaMetrics instance after it becomes available. -If you use [vmagent](https://docs.victoriametrics.com/vmagent.html) for storing the data into VictoriaMetrics, +If you use [vmagent](https://docs.victoriametrics.com/vmagent/) for storing the data into VictoriaMetrics, then it can be configured with multiple `-remoteWrite.url` command-line flags, where every flag points to the VictoriaMetrics instance in a particular availability zone, in order to replicate the collected data to all the VictoriaMetrics instances. For example, the following command instructs `vmagent` to replicate data to `vm-az1` and `vm-az2` instances of VictoriaMetrics: @@ -1780,16 +1780,16 @@ remote_write: - url: http://:8428/api/v1/write ``` -It is recommended to use [vmagent](https://docs.victoriametrics.com/vmagent.html) instead of Prometheus for highly loaded setups, +It is recommended to use [vmagent](https://docs.victoriametrics.com/vmagent/) instead of Prometheus for highly loaded setups, since it uses lower amounts of RAM, CPU and network bandwidth than Prometheus. -If you use identically configured [vmagent](https://docs.victoriametrics.com/vmagent.html) instances for collecting the same data +If you use identically configured [vmagent](https://docs.victoriametrics.com/vmagent/) instances for collecting the same data and sending it to VictoriaMetrics, then do not forget enabling [deduplication](#deduplication) at VictoriaMetrics side. ## Deduplication -VictoriaMetrics leaves a single [raw sample](https://docs.victoriametrics.com/keyConcepts.html#raw-samples) -with the biggest [timestamp](https://en.wikipedia.org/wiki/Unix_time) for each [time series](https://docs.victoriametrics.com/keyConcepts.html#time-series) +VictoriaMetrics leaves a single [raw sample](https://docs.victoriametrics.com/keyconcepts/#raw-samples) +with the biggest [timestamp](https://en.wikipedia.org/wiki/Unix_time) for each [time series](https://docs.victoriametrics.com/keyconcepts/#time-series) per each `-dedup.minScrapeInterval` discrete interval if `-dedup.minScrapeInterval` is set to positive duration. For example, `-dedup.minScrapeInterval=60s` would leave a single raw sample with the biggest timestamp per each discrete `60s` interval. @@ -1798,12 +1798,12 @@ This aligns with the [staleness rules in Prometheus](https://prometheus.io/docs/ If multiple raw samples have **the same timestamp** on the given `-dedup.minScrapeInterval` discrete interval, then the sample with **the biggest value** is kept. -[Prometheus staleness markers](https://docs.victoriametrics.com/vmagent.html#prometheus-staleness-markers) are processed as any other value during de-duplication. +[Prometheus staleness markers](https://docs.victoriametrics.com/vmagent/#prometheus-staleness-markers) are processed as any other value during de-duplication. If raw sample with the biggest timestamp on `-dedup.minScrapeInterval` contains a stale marker, then it is kept after the deduplication. This allows properly preserving staleness markers during the de-duplication. -Please note, [labels](https://docs.victoriametrics.com/keyConcepts.html#labels) of raw samples should be identical -in order to be deduplicated. For example, this is why [HA pair of vmagents](https://docs.victoriametrics.com/vmagent.html#high-availability) +Please note, [labels](https://docs.victoriametrics.com/keyconcepts/#labels) of raw samples should be identical +in order to be deduplicated. For example, this is why [HA pair of vmagents](https://docs.victoriametrics.com/vmagent/#high-availability) needs to be identically configured. The `-dedup.minScrapeInterval=D` is equivalent to `-downsampling.period=0s:D` if [downsampling](#downsampling) is enabled. @@ -1813,16 +1813,16 @@ The recommended value for `-dedup.minScrapeInterval` must equal to `scrape_inter It is recommended to have a single `scrape_interval` across all the scrape targets. See [this article](https://www.robustperception.io/keep-it-simple-scrape_interval-id) for details. -The de-duplication reduces disk space usage if multiple **identically configured** [vmagent](https://docs.victoriametrics.com/vmagent.html) +The de-duplication reduces disk space usage if multiple **identically configured** [vmagent](https://docs.victoriametrics.com/vmagent/) or Prometheus instances in HA pair write data to the same VictoriaMetrics instance. These vmagent or Prometheus instances must have **identical** `external_labels` section in their configs, so they write data to the same time series. -See also [how to set up multiple vmagent instances for scraping the same targets](https://docs.victoriametrics.com/vmagent.html#scraping-big-number-of-targets). +See also [how to set up multiple vmagent instances for scraping the same targets](https://docs.victoriametrics.com/vmagent/#scraping-big-number-of-targets). It is recommended passing different `-promscrape.cluster.name` values to each distinct HA pair of `vmagent` instances, so the de-duplication consistently leaves samples for one `vmagent` instance and removes duplicate samples from other `vmagent` instances. -See [these docs](https://docs.victoriametrics.com/vmagent.html#high-availability) for details. +See [these docs](https://docs.victoriametrics.com/vmagent/#high-availability) for details. VictoriaMetrics stores all the ingested samples to disk even if `-dedup.minScrapeInterval` command-line flag is set. The ingested samples are de-duplicated during [background merges](#storage) and during query execution. @@ -1839,19 +1839,19 @@ can be configured with the `-inmemoryDataFlushInterval` command-line flag (note In-memory parts are persisted to disk into `part` directories under the `<-storageDataPath>/data/small/YYYY_MM/` folder, where `YYYY_MM` is the month partition for the stored data. For example, `2022_11` is the partition for `parts` -with [raw samples](https://docs.victoriametrics.com/keyConcepts.html#raw-samples) from `November 2022`. +with [raw samples](https://docs.victoriametrics.com/keyconcepts/#raw-samples) from `November 2022`. Each partition directory contains `parts.json` file with the actual list of parts in the partition. Every `part` directory contains `metadata.json` file with the following fields: -- `RowsCount` - the number of [raw samples](https://docs.victoriametrics.com/keyConcepts.html#raw-samples) stored in the part +- `RowsCount` - the number of [raw samples](https://docs.victoriametrics.com/keyconcepts/#raw-samples) stored in the part - `BlocksCount` - the number of blocks stored in the part (see details about blocks below) - `MinTimestamp` and `MaxTimestamp` - minimum and maximum timestamps across raw samples stored in the part - `MinDedupInterval` - the [deduplication interval](#deduplication) applied to the given part. Each `part` consists of `blocks` sorted by internal time series id (aka `TSID`). -Each `block` contains up to 8K [raw samples](https://docs.victoriametrics.com/keyConcepts.html#raw-samples), -which belong to a single [time series](https://docs.victoriametrics.com/keyConcepts.html#time-series). +Each `block` contains up to 8K [raw samples](https://docs.victoriametrics.com/keyconcepts/#raw-samples), +which belong to a single [time series](https://docs.victoriametrics.com/keyconcepts/#time-series). Raw samples in each block are sorted by `timestamp`. Blocks for the same time series are sorted by the `timestamp` of the first sample. Timestamps and values for all the blocks are stored in [compressed form](https://faun.pub/victoriametrics-achieving-better-compression-for-time-series-data-than-gorilla-317bc1f95932) @@ -1880,7 +1880,7 @@ leaving the source `parts` untouched. However, due to hardware issues data on di VictoriaMetrics process. VictoriaMetrics can detect corruption during decompressing, decoding or sanity checking of the data blocks. But **it cannot fix the corrupted data**. Data parts that fail to load on startup need to be deleted or restored from backups. This is why it is recommended performing -[regular backups](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#backups). +[regular backups](https://docs.victoriametrics.com/cluster-victoriametrics/#backups). VictoriaMetrics doesn't use checksums for stored data blocks. See why [here](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3011). @@ -1925,7 +1925,7 @@ VictoriaMetrics does not support indefinite retention, but you can specify an ar ## Multiple retentions Distinct retentions for distinct time series can be configured via [retention filters](#retention-filters) -in [VictoriaMetrics enterprise](https://docs.victoriametrics.com/enterprise.html). +in [VictoriaMetrics enterprise](https://docs.victoriametrics.com/enterprise/). Community version of VictoriaMetrics supports only a single retention, which can be configured via [-retentionPeriod](#retention) command-line flag. If you need multiple retentions in community version of VictoriaMetrics, then you may start multiple VictoriaMetrics instances with distinct values for the following flags: @@ -1934,18 +1934,18 @@ If you need multiple retentions in community version of VictoriaMetrics, then yo * `-storageDataPath`, so the data for each retention period is saved in a separate directory * `-httpListenAddr`, so clients may reach VictoriaMetrics instance with proper retention -Then set up [vmauth](https://docs.victoriametrics.com/vmauth.html) in front of VictoriaMetrics instances, +Then set up [vmauth](https://docs.victoriametrics.com/vmauth/) in front of VictoriaMetrics instances, so it could route requests from particular user to VictoriaMetrics with the desired retention. -Similar scheme can be applied for multiple tenants in [VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html). +Similar scheme can be applied for multiple tenants in [VictoriaMetrics cluster](https://docs.victoriametrics.com/cluster-victoriametrics/). See [these docs](https://docs.victoriametrics.com/guides/guide-vmcluster-multiple-retention-setup.html) for multi-retention setup details. ## Retention filters -[Enterprise version of VictoriaMetrics](https://docs.victoriametrics.com/enterprise.html) supports e.g. `retention filters`, -which allow configuring multiple retentions for distinct sets of time series matching the configured [series filters](https://docs.victoriametrics.com/keyConcepts.html#filtering) +[Enterprise version of VictoriaMetrics](https://docs.victoriametrics.com/enterprise/) supports e.g. `retention filters`, +which allow configuring multiple retentions for distinct sets of time series matching the configured [series filters](https://docs.victoriametrics.com/keyconcepts/#filtering) via `-retentionFilter` command-line flag. This flag accepts `filter:duration` options, where `filter` must be -a valid [series filter](https://docs.victoriametrics.com/keyConcepts.html#filtering), while the `duration` +a valid [series filter](https://docs.victoriametrics.com/keyconcepts/#filtering), while the `duration` must contain valid [retention](#retention) for time series matching the given `filter`. The `duration` of the `-retentionFilter` must be lower or equal to [-retentionPeriod](#retention) flag value. If series doesn't match any configured `-retentionFilter`, then the retention configured via [-retentionPeriod](#retention) @@ -1962,13 +1962,13 @@ Important notes: - The data outside the configured retention isn't deleted instantly - it is deleted eventually during [background merges](https://docs.victoriametrics.com/#storage). - The `-retentionFilter` doesn't remove old data from `indexdb` (aka inverted index) until the configured [-retentionPeriod](#retention). - So the `indexdb` size can grow big under [high churn rate](https://docs.victoriametrics.com/FAQ.html#what-is-high-churn-rate) + So the `indexdb` size can grow big under [high churn rate](https://docs.victoriametrics.com/faq/#what-is-high-churn-rate) even for small retentions configured via `-retentionFilter`. It is safe updating `-retentionFilter` during VictoriaMetrics restarts - the updated retention filters are applied eventually to historical data. -See [how to configure multiple retentions in VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#retention-filters). +See [how to configure multiple retentions in VictoriaMetrics cluster](https://docs.victoriametrics.com/cluster-victoriametrics/#retention-filters). See also [downsampling](#downsampling). @@ -1977,10 +1977,10 @@ See how to request a free trial license [here](https://victoriametrics.com/produ ## Downsampling -[VictoriaMetrics Enterprise](https://docs.victoriametrics.com/enterprise.html) supports multi-level downsampling via `-downsampling.period=offset:interval` command-line flag. +[VictoriaMetrics Enterprise](https://docs.victoriametrics.com/enterprise/) supports multi-level downsampling via `-downsampling.period=offset:interval` command-line flag. This command-line flag instructs leaving the last sample per each `interval` for [time series](https://docs.victoriametrics.com/keyconcepts/#time-series) [samples](https://docs.victoriametrics.com/keyconcepts/#raw-samples) older than the `offset`. For example, `-downsampling.period=30d:5m` instructs leaving the last sample -per each 5-minute interval for samples older than 30 days, while the rest of samples aren't downsampled. +per each 5-minute interval for samples older than 30 days, while the rest of samples are dropped. The `-downsampling.period` command-line flag can be specified multiple times in order to apply different downsampling levels for different time ranges (aka multi-level downsampling). For example, `-downsampling.period=30d:5m,180d:1h` instructs leaving the last sample per each 5-minute interval for samples older than 30 days, @@ -1988,7 +1988,7 @@ while leaving the last sample per each 1-hour interval for samples older than 18 VictoriaMetrics supports configuring independent downsampling per different sets of [time series](https://docs.victoriametrics.com/keyconcepts/#time-series) via `-downsampling.period=filter:offset:interval` syntax. In this case the given `offset:interval` downsampling is applied only to time series matching the given `filter`. -The `filter` can contain arbitrary [series filter](https://docs.victoriametrics.com/keyConcepts.html#filtering). +The `filter` can contain arbitrary [series filter](https://docs.victoriametrics.com/keyconcepts/#filtering). For example, `-downsampling.period='{__name__=~"(node|process)_.*"}:1d:1m` instructs VictoriaMetrics to deduplicate samples older than one day with one minute interval only for [time series](https://docs.victoriametrics.com/keyconcepts/#time-series) with names starting with `node_` or `process_` prefixes. The de-duplication for other time series can be configured independently via additional `-downsampling.period` command-line flags. @@ -2001,27 +2001,27 @@ even if their names start with `node_` prefix. All the other time series with na If downsampling shouldn't be applied to some time series matching the given `filter`, then pass `-downsampling.period=filter:0s:0s` command-line flag to VictoriaMetrics. For example, if series with `env="prod"` label shouldn't be downsampled, then pass `-downsampling.period='{env="prod"}:0s:0s'` command-line flag in front of other `-downsampling.period` flags. -Downsampling is applied independently per each time series and leaves a single [raw sample](https://docs.victoriametrics.com/keyConcepts.html#raw-samples) +Downsampling is applied independently per each time series and leaves a single [raw sample](https://docs.victoriametrics.com/keyconcepts/#raw-samples) with the biggest [timestamp](https://en.wikipedia.org/wiki/Unix_time) on the configured interval, in the same way as [deduplication](#deduplication) does. -It works the best for [counters](https://docs.victoriametrics.com/keyConcepts.html#counter) and [histograms](https://docs.victoriametrics.com/keyConcepts.html#histogram), -as their values are always increasing. Downsampling [gauges](https://docs.victoriametrics.com/keyConcepts.html#gauge) -and [summaries](https://docs.victoriametrics.com/keyConcepts.html#summary) lose some changes within the downsampling interval, +It works the best for [counters](https://docs.victoriametrics.com/keyconcepts/#counter) and [histograms](https://docs.victoriametrics.com/keyconcepts/#histogram), +as their values are always increasing. Downsampling [gauges](https://docs.victoriametrics.com/keyconcepts/#gauge) +and [summaries](https://docs.victoriametrics.com/keyconcepts/#summary) lose some changes within the downsampling interval, since only the last sample on the given interval is left and the rest of samples are dropped. -You can use [recording rules](https://docs.victoriametrics.com/vmalert.html#rules) or [steaming aggregation](https://docs.victoriametrics.com/stream-aggregation.html) +You can use [recording rules](https://docs.victoriametrics.com/vmalert/#rules) or [steaming aggregation](https://docs.victoriametrics.com/stream-aggregation/) to apply custom aggregation functions, like min/max/avg etc., in order to make gauges more resilient to downsampling. Downsampling can reduce disk space usage and improve query performance if it is applied to time series with big number of samples per each series. The downsampling doesn't improve query performance and doesn't reduce disk space if the database contains big number of time series with small number of samples per each series, since downsampling doesn't reduce the number of time series. -So there is little sense in applying downsampling to time series with [high churn rate](https://docs.victoriametrics.com/FAQ.html#what-is-high-churn-rate). +So there is little sense in applying downsampling to time series with [high churn rate](https://docs.victoriametrics.com/faq/#what-is-high-churn-rate). In this case the majority of query time is spent on searching for the matching time series instead of processing the found samples. -It is possible to use [stream aggregation](https://docs.victoriametrics.com/stream-aggregation.html) in [vmagent](https://docs.victoriametrics.com/vmagent.html) -or [recording rules in vmalert](https://docs.victoriametrics.com/vmalert.html#rules) in order to -[reduce the number of time series](https://docs.victoriametrics.com/vmalert.html#downsampling-and-aggregation-via-vmalert). +It is possible to use [stream aggregation](https://docs.victoriametrics.com/stream-aggregation/) in [vmagent](https://docs.victoriametrics.com/vmagent/) +or [recording rules in vmalert](https://docs.victoriametrics.com/vmalert/#rules) in order to +[reduce the number of time series](https://docs.victoriametrics.com/vmalert/#downsampling-and-aggregation-via-vmalert). Downsampling is performed during [background merges](https://docs.victoriametrics.com/#storage). -It cannot be performed if there is not enough of free disk space or if vmstorage is in [read-only mode](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#readonly-mode). +It cannot be performed if there is not enough of free disk space or if vmstorage is in [read-only mode](https://docs.victoriametrics.com/cluster-victoriametrics/#readonly-mode). Please, note that intervals of `-downsampling.period` must be multiples of each other. In case [deduplication](https://docs.victoriametrics.com/#deduplication) is enabled, value of `-dedup.minScrapeInterval` command-line flag must also @@ -2030,16 +2030,16 @@ be multiple of `-downsampling.period` intervals. This is required to ensure cons It is safe updating `-downsampling.period` during VictoriaMetrics restarts - the updated downsampling configuration will be applied eventually to historical data during [background merges](https://docs.victoriametrics.com/#storage). -See [how to configure downsampling in VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#downsampling). +See [how to configure downsampling in VictoriaMetrics cluster](https://docs.victoriametrics.com/cluster-victoriametrics/#downsampling). See also [retention filters](#retention-filters). -The downsampling filters can be evaluated for free by downloading and using enterprise binaries from [the releases page](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/latest). +The downsampling can be evaluated for free by downloading and using enterprise binaries from [the releases page](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/latest). See [how to request a free trial license](https://victoriametrics.com/products/enterprise/trial/). ## Multi-tenancy -Single-node VictoriaMetrics doesn't support multi-tenancy. Use the [cluster version](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#multitenancy) instead. +Single-node VictoriaMetrics doesn't support multi-tenancy. Use the [cluster version](https://docs.victoriametrics.com/cluster-victoriametrics/#multitenancy) instead. ## Scalability and cluster version @@ -2053,7 +2053,7 @@ horizontally scalable long-term remote storage for really large Prometheus deplo ## Alerting -It is recommended using [vmalert](https://docs.victoriametrics.com/vmalert.html) for alerting. +It is recommended using [vmalert](https://docs.victoriametrics.com/vmalert/) for alerting. Additionally, alerting can be set up with the following tools: @@ -2064,7 +2064,7 @@ Additionally, alerting can be set up with the following tools: ## mTLS protection By default `VictoriaMetrics` accepts http requests at `8428` port (this port can be changed via `-httpListenAddr` command-line flags). -[Enterprise version of VictoriaMetrics](https://docs.victoriametrics.com/enterprise.html) supports the ability to accept [mTLS](https://en.wikipedia.org/wiki/Mutual_authentication) +[Enterprise version of VictoriaMetrics](https://docs.victoriametrics.com/enterprise/) supports the ability to accept [mTLS](https://en.wikipedia.org/wiki/Mutual_authentication) requests at this port, by specifying `-tls` and `-mtls` command-line flags. For example, the following command runs `VictoriaMetrics`, which accepts only mTLS requests at port `8428`: ``` @@ -2074,16 +2074,18 @@ requests at this port, by specifying `-tls` and `-mtls` command-line flags. For By default system-wide [TLS Root CA](https://en.wikipedia.org/wiki/Root_certificate) is used for verifying client certificates if `-mtls` command-line flag is specified. It is possible to specify custom TLS Root CA via `-mtlsCAFile` command-line flag. +See also [security docs](#security). + ## Security General security recommendations: - All the VictoriaMetrics components must run in protected private networks without direct access from untrusted networks such as Internet. - The exception is [vmauth](https://docs.victoriametrics.com/vmauth.html) and [vmgateway](https://docs.victoriametrics.com/vmgateway.html), + The exception is [vmauth](https://docs.victoriametrics.com/vmauth/) and [vmgateway](https://docs.victoriametrics.com/vmgateway/), which are indended for serving public requests and performing authorization with [TLS termination](https://en.wikipedia.org/wiki/TLS_termination_proxy). -- All the requests from untrusted networks to VictoriaMetrics components must go through auth proxy such as [vmauth](https://docs.victoriametrics.com/vmauth.html) - or [vmgateway](https://docs.victoriametrics.com/vmgateway.html). The proxy must be set up with proper authentication and authorization. -- Prefer using lists of allowed API endpoints, while disallowing access to other endpoints when configuring [vmauth](https://docs.victoriametrics.com/vmauth.html) +- All the requests from untrusted networks to VictoriaMetrics components must go through auth proxy such as [vmauth](https://docs.victoriametrics.com/vmauth/) + or [vmgateway](https://docs.victoriametrics.com/vmgateway/). The proxy must be set up with proper authentication and authorization. +- Prefer using lists of allowed API endpoints, while disallowing access to other endpoints when configuring [vmauth](https://docs.victoriametrics.com/vmauth/) in front of VictoriaMetrics components. - Set reasonable [`Strict-Transport-Security`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security) header value to all the components to mitigate [MitM attacks](https://en.wikipedia.org/wiki/Man-in-the-middle_attack), for example: `max-age=31536000; includeSubDomains`. See `-http.header.hsts` flag. - Set reasonable [`Content-Security-Policy`](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) header value to mitigate [XSS attacks](https://en.wikipedia.org/wiki/Cross-site_scripting). See `-http.header.csp` flag. @@ -2091,7 +2093,9 @@ General security recommendations: VictoriaMetrics provides the following security-related command-line flags: -* `-tls`, `-tlsCertFile` and `-tlsKeyFile` for switching from HTTP to HTTPS at `-httpListenAddr` (8428 by default). +* `-tls`, `-tlsCertFile` and `-tlsKeyFile` for switching from HTTP to HTTPS at `-httpListenAddr` (TCP port 8428 is listened by default). + [Enterprise version of VictoriaMetrics](https://docs.victoriametrics.com/enterprise/) supports automatic issuing of TLS certificates. + See [these docs](#automatic-issuing-of-tls-certificates). * `-mtls` and `-mtlsCAFile` for enabling [mTLS](https://en.wikipedia.org/wiki/Mutual_authentication) for requests to `-httpListenAddr`. See [these docs](#mtls-protection). * `-httpAuth.username` and `-httpAuth.password` for protecting all the HTTP endpoints with [HTTP Basic Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication). @@ -2111,9 +2115,22 @@ VictoriaMetrics provides the following security-related command-line flags: Explicitly set internal network interface for TCP and UDP ports for data ingestion with Graphite and OpenTSDB formats. For example, substitute `-graphiteListenAddr=:2003` with `-graphiteListenAddr=:2003`. This protects from unexpected requests from untrusted network interfaces. -See also [security recommendation for VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#security) +See also [security recommendation for VictoriaMetrics cluster](https://docs.victoriametrics.com/cluster-victoriametrics/#security) and [the general security page at VictoriaMetrics website](https://victoriametrics.com/security/). +## Automatic issuing of TLS certificates + +All the VictoriaMetrics [Enterprise](https://docs.victoriametrics.com/enterprise/) components support automatic issuing of TLS certificates for public HTTPS server running at `-httpListenAddr` +via [Let's Encrypt service](https://letsencrypt.org/). The following command-line flags must be set in order to enable automatic issuing of TLS certificates: + +- `-httpListenAddr` must be set for listening TCP port `443`. For example, `-httpListenAddr=:443`. This port must be accessible by the [Let's Encrypt service](https://letsencrypt.org/). +- `-tls` must be set in order to accept HTTPS requests at `-httpListenAddr`. +- `-tlsAutocertHosts` must be set to comma-separated list of hosts, which can be reached via `-httpListenAddr`. TLS certificates are automatically issued for these hosts. +- `-tlsAutocertEmail` must be set to contact email for the issued TLS certificates. +- `-tlsAutocertCacheDir` may be set to the directory path for persisting the issued TLS certificates between VictoriaMetrics restarts. If this flag isn't set, + then TLS certificates are re-issued on every restart. + +This functionality can be evaluated for free according to [these docs](https://docs.victoriametrics.com/enterprise/). ## Tuning @@ -2137,7 +2154,7 @@ mkfs.ext4 ... -O 64bit,huge_file,extent -T huge ## Monitoring VictoriaMetrics exports internal metrics in Prometheus exposition format at `/metrics` page. -These metrics can be scraped via [vmagent](https://docs.victoriametrics.com/vmagent.html) or any other Prometheus-compatible scraper. +These metrics can be scraped via [vmagent](https://docs.victoriametrics.com/vmagent/) or any other Prometheus-compatible scraper. If you use Google Cloud Managed Prometheus for scraping metrics from VictoriaMetrics components, then pass `-metrics.exposeMetadata` command-line to them, so they add `TYPE` and `HELP` comments per each exposed metric at `/metrics` page. @@ -2157,14 +2174,14 @@ created by community. Graphs on the dashboards contain useful hints - hover the `i` icon in the top left corner of each graph to read it. We recommend setting up [alerts](https://github.com/VictoriaMetrics/VictoriaMetrics/tree/master/deployment/docker#alerts) -via [vmalert](https://docs.victoriametrics.com/vmalert.html) or via Prometheus. +via [vmalert](https://docs.victoriametrics.com/vmalert/) or via Prometheus. VictoriaMetrics exposes currently running queries and their execution times at [`active queries` page](#active-queries). VictoriaMetrics exposes queries, which take the most time to execute, at [`top queries` page](#top-queries). See also [VictoriaMetrics Monitoring](https://victoriametrics.com/blog/victoriametrics-monitoring/) -and [troubleshooting docs](https://docs.victoriametrics.com/Troubleshooting.html). +and [troubleshooting docs](https://docs.victoriametrics.com/troubleshooting/). ## TSDB stats @@ -2176,10 +2193,10 @@ VictoriaMetrics returns TSDB stats at `/api/v1/status/tsdb` page in the way simi * `match[]=SELECTOR` where `SELECTOR` is an arbitrary [time series selector](https://prometheus.io/docs/prometheus/latest/querying/basics/#time-series-selectors) for series to take into account during stats calculation. By default all the series are taken into account. * `extra_label=LABEL=VALUE`. See [these docs](#prometheus-querying-api-enhancements) for more details. -In [cluster version of VictoriaMetrics](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html) each vmstorage tracks the stored time series individually. +In [cluster version of VictoriaMetrics](https://docs.victoriametrics.com/cluster-victoriametrics/) each vmstorage tracks the stored time series individually. vmselect requests stats via [/api/v1/status/tsdb](#tsdb-stats) API from each vmstorage node and merges the results by summing per-series stats. This may lead to inflated values when samples for the same time series are spread across multiple vmstorage nodes -due to [replication](#replication) or [rerouting](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html?highlight=re-routes#cluster-availability). +due to [replication](#replication) or [rerouting](https://docs.victoriametrics.com/cluster-victoriametrics/?highlight=re-routes#cluster-availability). VictoriaMetrics provides an UI on top of `/api/v1/status/tsdb` - see [cardinality explorer docs](#cardinality-explorer). @@ -2255,8 +2272,8 @@ Query tracing is allowed by default. It can be denied by passing `-denyQueryTrac By default VictoriaMetrics doesn't limit the number of stored time series. The limit can be enforced by setting the following command-line flags: -* `-storage.maxHourlySeries` - limits the number of time series that can be added during the last hour. Useful for limiting the number of [active time series](https://docs.victoriametrics.com/FAQ.html#what-is-an-active-time-series). -* `-storage.maxDailySeries` - limits the number of time series that can be added during the last day. Useful for limiting daily [churn rate](https://docs.victoriametrics.com/FAQ.html#what-is-high-churn-rate). +* `-storage.maxHourlySeries` - limits the number of time series that can be added during the last hour. Useful for limiting the number of [active time series](https://docs.victoriametrics.com/faq/#what-is-an-active-time-series). +* `-storage.maxDailySeries` - limits the number of time series that can be added during the last day. Useful for limiting daily [churn rate](https://docs.victoriametrics.com/faq/#what-is-high-churn-rate). Both limits can be set simultaneously. If any of these limits is reached, then incoming samples for new time series are dropped. A sample of dropped series is put in the log with `WARNING` level. @@ -2286,7 +2303,7 @@ The exceeded limits can be [monitored](#monitoring) with the following metrics: These limits are approximate, so VictoriaMetrics can underflow/overflow the limit by a small percentage (usually less than 1%). -See also more advanced [cardinality limiter in vmagent](https://docs.victoriametrics.com/vmagent.html#cardinality-limiter) +See also more advanced [cardinality limiter in vmagent](https://docs.victoriametrics.com/vmagent/#cardinality-limiter) and [cardinality explorer docs](#cardinality-explorer). ## Troubleshooting @@ -2309,8 +2326,8 @@ and [cardinality explorer docs](#cardinality-explorer). * If you run VictoriaMetrics on a host with 16 or more CPU cores, then it may be needed to tune the `-search.maxWorkersPerQuery` command-line flag in order to improve query performance. If VictoriaMetrics serves big number of concurrent `select` queries, then try reducing the value for this flag. - If VcitoriaMetrics serves heavy queries, which select `>10K` of [time series](https://docs.victoriametrics.com/keyConcepts.html#time-series) and/or process `>100M` - of [raw samples](https://docs.victoriametrics.com/keyConcepts.html#raw-samples) per query, then try setting the value for this flag to the number of available CPU cores. + If VcitoriaMetrics serves heavy queries, which select `>10K` of [time series](https://docs.victoriametrics.com/keyconcepts/#time-series) and/or process `>100M` + of [raw samples](https://docs.victoriametrics.com/keyconcepts/#raw-samples) per query, then try setting the value for this flag to the number of available CPU cores. * VictoriaMetrics buffers incoming data in memory for up to a few seconds before flushing it to persistent storage. This may lead to the following "issues": @@ -2321,7 +2338,7 @@ and [cardinality explorer docs](#cardinality-explorer). See [storage docs](#storage) and [this article](https://valyala.medium.com/wal-usage-looks-broken-in-modern-time-series-databases-b62a627ab704) for more details. * If VictoriaMetrics works slowly and eats more than a CPU core per 100K ingested data points per second, - then it is likely you have too many [active time series](https://docs.victoriametrics.com/FAQ.html#what-is-an-active-time-series) for the current amount of RAM. + then it is likely you have too many [active time series](https://docs.victoriametrics.com/faq/#what-is-an-active-time-series) for the current amount of RAM. VictoriaMetrics [exposes](#monitoring) `vm_slow_*` metrics such as `vm_slow_row_inserts_total` and `vm_slow_metric_name_loads_total`, which could be used as an indicator of low amounts of RAM. It is recommended increasing the amount of RAM on the node with VictoriaMetrics in order to improve ingestion and query performance in this case. @@ -2348,8 +2365,8 @@ and [cardinality explorer docs](#cardinality-explorer). This suppresses default gap filling algorithm used by VictoriaMetrics - by default it assumes each time series is continuous instead of discrete, so it fills gaps between real samples with regular intervals. -* Metrics and labels leading to [high cardinality](https://docs.victoriametrics.com/FAQ.html#what-is-high-cardinality) - or [high churn rate](https://docs.victoriametrics.com/FAQ.html#what-is-high-churn-rate) can be determined +* Metrics and labels leading to [high cardinality](https://docs.victoriametrics.com/faq/#what-is-high-cardinality) + or [high churn rate](https://docs.victoriametrics.com/faq/#what-is-high-churn-rate) can be determined via [cardinality explorer](#cardinality-explorer) and via [/api/v1/status/tsdb](#tsdb-stats) endpoint. * New time series can be logged if `-logNewSeries` command-line flag is passed to VictoriaMetrics. @@ -2367,13 +2384,13 @@ and [cardinality explorer docs](#cardinality-explorer). See also: - [Snapshot troubleshooting](#snapshot-troubleshooting). -- [General troubleshooting docs](https://docs.victoriametrics.com/Troubleshooting.html). +- [General troubleshooting docs](https://docs.victoriametrics.com/troubleshooting/). ## Push metrics All the VictoriaMetrics components support pushing their metrics exposed at `/metrics` page to remote storage in Prometheus text exposition format. This functionality may be used instead of [classic Prometheus-like metrics scraping](https://docs.victoriametrics.com/#how-to-scrape-prometheus-exporters-such-as-node-exporter) -if VictoriaMetrics components are located in isolated networks, so they cannot be scraped by local [vmagent](https://docs.victoriametrics.com/vmagent.html). +if VictoriaMetrics components are located in isolated networks, so they cannot be scraped by local [vmagent](https://docs.victoriametrics.com/vmagent/). The following command-line flags are related to pushing metrics from VictoriaMetrics components: @@ -2417,7 +2434,7 @@ It is also possible removing [rollup result cache](#rollup-result-cache) on star ## Rollup result cache -VictoriaMetrics caches query reponses by default. This allows increasing performance for repated queries +VictoriaMetrics caches query responses by default. This allows increasing performance for repated queries to [`/api/v1/query`](https://docs.victoriametrics.com/keyconcepts/#instant-query) and [`/api/v1/query_range`](https://docs.victoriametrics.com/keyconcepts/#range-query) with the increasing `time`, `start` and `end` query args. @@ -2473,30 +2490,30 @@ Things to consider when copying data: 1. Copying data folder means complete replacement of the previous data on destination VictoriaMetrics. For more complex scenarios like single-to-cluster, cluster-to-single, re-sharding or migrating only a fraction -of data - see [vmctl. Migrating data from VictoriaMetrics](https://docs.victoriametrics.com/vmctl.html#migrating-data-from-victoriametrics). +of data - see [vmctl. Migrating data from VictoriaMetrics](https://docs.victoriametrics.com/vmctl/#migrating-data-from-victoriametrics). ### From other systems -Use [vmctl](https://docs.victoriametrics.com/vmctl.html) for data migration. It supports the following data migration types: +Use [vmctl](https://docs.victoriametrics.com/vmctl/) for data migration. It supports the following data migration types: * From Prometheus to VictoriaMetrics * From InfluxDB to VictoriaMetrics * From VictoriaMetrics to VictoriaMetrics * From OpenTSDB to VictoriaMetrics -See [vmctl docs](https://docs.victoriametrics.com/vmctl.html) for more details. +See [vmctl docs](https://docs.victoriametrics.com/vmctl/) for more details. ## Backfilling VictoriaMetrics accepts historical data in arbitrary order of time via [any supported ingestion method](#how-to-import-time-series-data). -See [how to backfill data with recording rules in vmalert](https://docs.victoriametrics.com/vmalert.html#rules-backfilling). +See [how to backfill data with recording rules in vmalert](https://docs.victoriametrics.com/vmalert/#rules-backfilling). Make sure that configured `-retentionPeriod` covers timestamps for the backfilled data. It is recommended disabling [query cache](#rollup-result-cache) with `-search.disableCache` command-line flag when writing historical data with timestamps from the past, since the cache assumes that the data is written with the current timestamps. Query cache can be enabled after the backfilling is complete. -An alternative solution is to query [/internal/resetRollupResultCache](https://docs.victoriametrics.com/url-examples.html#internalresetrollupresultcache) +An alternative solution is to query [/internal/resetRollupResultCache](https://docs.victoriametrics.com/url-examples/#internalresetrollupresultcache) after the backfilling is complete. This will reset the [query cache](#rollup-result-cache), which could contain incomplete data cached during the backfilling. Yet another solution is to increase `-search.cacheTimestampOffset` flag value in order to disable caching @@ -2513,7 +2530,7 @@ should be used only for one-off updates. It shouldn't be used for frequent updat ## Replication Single-node VictoriaMetrics doesn't support application-level replication. Use cluster version instead. -See [these docs](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#replication-and-data-safety) for details. +See [these docs](https://docs.victoriametrics.com/cluster-victoriametrics/#replication-and-data-safety) for details. Storage-level replication may be offloaded to durable persistent storage such as [Google Cloud disks](https://cloud.google.com/compute/docs/disks#pdspecs). @@ -2521,15 +2538,15 @@ See also [high availability docs](#high-availability) and [backup docs](#backups ## Backups -VictoriaMetrics supports backups via [vmbackup](https://docs.victoriametrics.com/vmbackup.html) -and [vmrestore](https://docs.victoriametrics.com/vmrestore.html) tools. -We also provide [vmbackupmanager](https://docs.victoriametrics.com/vmbackupmanager.html) tool for enterprise subscribers. +VictoriaMetrics supports backups via [vmbackup](https://docs.victoriametrics.com/vmbackup/) +and [vmrestore](https://docs.victoriametrics.com/vmrestore/) tools. +We also provide [vmbackupmanager](https://docs.victoriametrics.com/vmbackupmanager/) tool for enterprise subscribers. Enterprise binaries can be downloaded and evaluated for free from [the releases page](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/latest). See how to request a free trial license [here](https://victoriametrics.com/products/enterprise/trial/). ## vmalert -A single-node VictoriaMetrics is capable of proxying requests to [vmalert](https://docs.victoriametrics.com/vmalert.html) +A single-node VictoriaMetrics is capable of proxying requests to [vmalert](https://docs.victoriametrics.com/vmalert/) when `-vmalert.proxyURL` flag is set. Use this feature for the following cases: * for proxying requests from [Grafana Alerting UI](https://grafana.com/docs/grafana/latest/alerting/); * for accessing vmalerts UI through single-node VictoriaMetrics Web interface. @@ -2544,7 +2561,7 @@ the best parts of their product, while highlighting the worst parts of competing So we encourage users and all independent third parties to conduct their benchmarks for various products they are evaluating in production and publish the results. -As a reference, please see [benchmarks](https://docs.victoriametrics.com/Articles.html#benchmarks) conducted by +As a reference, please see [benchmarks](https://docs.victoriametrics.com/articles/#benchmarks) conducted by VictoriaMetrics team. Please also see the [helm chart](https://github.com/VictoriaMetrics/benchmark) for running ingestion benchmarks based on node_exporter metrics. @@ -2579,7 +2596,7 @@ It is safe sharing the collected profiles from security point of view, since the See [this example](https://github.com/go-graphite/carbonapi/blob/main/cmd/carbonapi/carbonapi.example.victoriametrics.yaml). * [netdata](https://github.com/netdata/netdata) can push data into VictoriaMetrics via `Prometheus remote_write API`. See [these docs](https://github.com/netdata/netdata#integrations). -* [vmalert-cli](https://github.com/aorfanos/vmalert-cli) - a CLI application for managing [vmalert](https://docs.victoriametrics.com/vmalert.html). +* [vmalert-cli](https://github.com/aorfanos/vmalert-cli) - a CLI application for managing [vmalert](https://docs.victoriametrics.com/vmalert/). ## Third-party contributions @@ -2605,22 +2622,7 @@ Feel free asking any questions regarding VictoriaMetrics: * [Google groups](https://groups.google.com/forum/#!forum/victorametrics-users) * [Mastodon](https://mastodon.social/@victoriametrics/) -If you like VictoriaMetrics and want to contribute, then we need the following: - -* Filing issues and feature requests [here](https://github.com/VictoriaMetrics/VictoriaMetrics/issues). -* Spreading a word about VictoriaMetrics: conference talks, articles, comments, experience sharing with colleagues. -* Updating documentation. - -We are open to third-party pull requests provided they follow [KISS design principle](https://en.wikipedia.org/wiki/KISS_principle): - -* Prefer simple code and architecture. -* Avoid complex abstractions. -* Avoid magic code and fancy algorithms. -* Avoid [big external dependencies](https://medium.com/@valyala/stripping-dependency-bloat-in-victoriametrics-docker-image-983fb5912b0d). -* Minimize the number of moving parts in the distributed system. -* Avoid automated decisions, which may hurt cluster availability, consistency or performance. - -Adhering `KISS` principle simplifies the resulting code and architecture, so it can be reviewed, understood and verified by many people. +If you like VictoriaMetrics and want to contribute, then please [read these docs](https://docs.victoriametrics.com/contributing/). ## Reporting bugs @@ -2701,7 +2703,7 @@ Pass `-help` to VictoriaMetrics in order to see the list of supported command-li -denyQueryTracing Whether to disable the ability to trace queries. See https://docs.victoriametrics.com/#query-tracing -downsampling.period array - Comma-separated downsampling periods in the format 'offset:period'. For example, '30d:10m' instructs to leave a single sample per 10 minutes for samples older than 30 days. When setting multiple downsampling periods, it is necessary for the periods to be multiples of each other. See https://docs.victoriametrics.com/#downsampling for details. This flag is available only in VictoriaMetrics enterprise. See https://docs.victoriametrics.com/enterprise.html + Comma-separated downsampling periods in the format 'offset:period'. For example, '30d:10m' instructs to leave a single sample per 10 minutes for samples older than 30 days. When setting multiple downsampling periods, it is necessary for the periods to be multiples of each other. See https://docs.victoriametrics.com/#downsampling for details. This flag is available only in VictoriaMetrics enterprise. See https://docs.victoriametrics.com/enterprise/ Supports an array of values separated by comma or specified via multiple flags. Value can contain comma inside single-quoted or double-quoted string, {}, [] and () braces. -dryRun @@ -2713,7 +2715,7 @@ Pass `-help` to VictoriaMetrics in order to see the list of supported command-li -envflag.prefix string Prefix for environment variables if -envflag.enable is set -eula - Deprecated, please use -license or -licenseFile flags instead. By specifying this flag, you confirm that you have an enterprise license and accept the ESA https://victoriametrics.com/legal/esa/ . This flag is available only in Enterprise binaries. See https://docs.victoriametrics.com/enterprise.html + Deprecated, please use -license or -licenseFile flags instead. By specifying this flag, you confirm that you have an enterprise license and accept the ESA https://victoriametrics.com/legal/esa/ . This flag is available only in Enterprise binaries. See https://docs.victoriametrics.com/enterprise/ -filestream.disableFadvise Whether to disable fadvise() syscall when reading large data files. The fadvise() syscall prevents from eviction of recently accessed data from OS page cache during background merges and backups. In some rare cases it is better to disable the syscall if it uses too much CPU -finalMergeDelay duration @@ -2827,7 +2829,7 @@ Pass `-help` to VictoriaMetrics in order to see the list of supported command-li -loggerWarnsPerSecondLimit int Per-second limit on the number of WARN messages. If more than the given number of warns are emitted per second, then the remaining warns are suppressed. Zero values disable the rate limit -maxConcurrentInserts int - The maximum number of concurrent insert requests. Default value depends on the number of CPU cores and should work for most cases since it minimizes the memory usage. The default value can be increased when clients send data over slow networks. See also -insert.maxQueueDuration + The maximum number of concurrent insert requests. Set higher value when clients send data over slow networks. Default value depends on the number of available CPU cores. It should work fine in most cases since it minimizes resource usage. See also -insert.maxQueueDuration (default 32) -maxInsertRequestSize size The maximum size in bytes of a single Prometheus remote_write API request Supports the following optional suffixes for size values: KB, MB, GB, TB, KiB, MiB, GiB, TiB (default 33554432) @@ -2846,16 +2848,18 @@ Pass `-help` to VictoriaMetrics in order to see the list of supported command-li Auth key for /metrics endpoint. It must be passed via authKey query arg. It overrides httpAuth.* settings Flag value can be read from the given file when using -metricsAuthKey=file:///abs/path/to/file or -metricsAuthKey=file://./relative/path/to/file . Flag value can be read from the given http/https url when using -metricsAuthKey=http://host/path or -metricsAuthKey=https://host/path -mtls array - Whether to require valid client certificate for https requests to the corresponding -httpListenAddr . This flag works only if -tls flag is set. See also -mtlsCAFile . This flag is available only in Enterprise binaries. See https://docs.victoriametrics.com/enterprise.html + Whether to require valid client certificate for https requests to the corresponding -httpListenAddr . This flag works only if -tls flag is set. See also -mtlsCAFile . This flag is available only in Enterprise binaries. See https://docs.victoriametrics.com/enterprise/ Supports array of values separated by comma or specified via multiple flags. Empty values are set to false. -mtlsCAFile array - Optional path to TLS Root CA for verifying client certificates at the corresponding -httpListenAddr when -mtls is enabled. By default the host system TLS Root CA is used for client certificate verification. This flag is available only in Enterprise binaries. See https://docs.victoriametrics.com/enterprise.html + Optional path to TLS Root CA for verifying client certificates at the corresponding -httpListenAddr when -mtls is enabled. By default the host system TLS Root CA is used for client certificate verification. This flag is available only in Enterprise binaries. See https://docs.victoriametrics.com/enterprise/ Supports an array of values separated by comma or specified via multiple flags. Value can contain comma inside single-quoted or double-quoted string, {}, [] and () braces. -newrelic.maxInsertRequestSize size The maximum size in bytes of a single NewRelic request to /newrelic/infra/v2/metrics/events/bulk Supports the following optional suffixes for size values: KB, MB, GB, TB, KiB, MiB, GiB, TiB (default 67108864) + -opentelemetry.usePrometheusNaming + Whether to convert metric names and labels into Prometheus-compatible format for the metrics ingested via OpenTelemetry protocol; see https://docs.victoriametrics.com/#sending-data-via-opentelemetry -opentsdbHTTPListenAddr string TCP address to listen for OpenTSDB HTTP put requests. Usually :4242 must be set. Doesn't work if empty. See also -opentsdbHTTPListenAddr.useProxyProtocol -opentsdbHTTPListenAddr.useProxyProtocol @@ -2879,19 +2883,19 @@ Pass `-help` to VictoriaMetrics in order to see the list of supported command-li -prevCacheRemovalPercent float Items in the previous caches are removed when the percent of requests it serves becomes lower than this value. Higher values reduce memory usage at the cost of higher CPU usage. See also -cacheExpireDuration (default 0.1) -promscrape.azureSDCheckInterval duration - Interval for checking for changes in Azure. This works only if azure_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs.html#azure_sd_configs for details (default 1m0s) + Interval for checking for changes in Azure. This works only if azure_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs/#azure_sd_configs for details (default 1m0s) -promscrape.cluster.memberLabel string - If non-empty, then the label with this name and the -promscrape.cluster.memberNum value is added to all the scraped metrics. See https://docs.victoriametrics.com/vmagent.html#scraping-big-number-of-targets for more info + If non-empty, then the label with this name and the -promscrape.cluster.memberNum value is added to all the scraped metrics. See https://docs.victoriametrics.com/vmagent/#scraping-big-number-of-targets for more info -promscrape.cluster.memberNum string - The number of vmagent instance in the cluster of scrapers. It must be a unique value in the range 0 ... promscrape.cluster.membersCount-1 across scrapers in the cluster. Can be specified as pod name of Kubernetes StatefulSet - pod-name-Num, where Num is a numeric part of pod name. See also -promscrape.cluster.memberLabel . See https://docs.victoriametrics.com/vmagent.html#scraping-big-number-of-targets for more info (default "0") + The number of vmagent instance in the cluster of scrapers. It must be a unique value in the range 0 ... promscrape.cluster.membersCount-1 across scrapers in the cluster. Can be specified as pod name of Kubernetes StatefulSet - pod-name-Num, where Num is a numeric part of pod name. See also -promscrape.cluster.memberLabel . See https://docs.victoriametrics.com/vmagent/#scraping-big-number-of-targets for more info (default "0") -promscrape.cluster.memberURLTemplate string - An optional template for URL to access vmagent instance with the given -promscrape.cluster.memberNum value. Every %d occurrence in the template is substituted with -promscrape.cluster.memberNum at urls to vmagent instances responsible for scraping the given target at /service-discovery page. For example -promscrape.cluster.memberURLTemplate='http://vmagent-%d:8429/targets'. See https://docs.victoriametrics.com/vmagent.html#scraping-big-number-of-targets for more details + An optional template for URL to access vmagent instance with the given -promscrape.cluster.memberNum value. Every %d occurrence in the template is substituted with -promscrape.cluster.memberNum at urls to vmagent instances responsible for scraping the given target at /service-discovery page. For example -promscrape.cluster.memberURLTemplate='http://vmagent-%d:8429/targets'. See https://docs.victoriametrics.com/vmagent/#scraping-big-number-of-targets for more details -promscrape.cluster.membersCount int - The number of members in a cluster of scrapers. Each member must have a unique -promscrape.cluster.memberNum in the range 0 ... promscrape.cluster.membersCount-1 . Each member then scrapes roughly 1/N of all the targets. By default, cluster scraping is disabled, i.e. a single scraper scrapes all the targets. See https://docs.victoriametrics.com/vmagent.html#scraping-big-number-of-targets for more info (default 1) + The number of members in a cluster of scrapers. Each member must have a unique -promscrape.cluster.memberNum in the range 0 ... promscrape.cluster.membersCount-1 . Each member then scrapes roughly 1/N of all the targets. By default, cluster scraping is disabled, i.e. a single scraper scrapes all the targets. See https://docs.victoriametrics.com/vmagent/#scraping-big-number-of-targets for more info (default 1) -promscrape.cluster.name string - Optional name of the cluster. If multiple vmagent clusters scrape the same targets, then each cluster must have unique name in order to properly de-duplicate samples received from these clusters. See https://docs.victoriametrics.com/vmagent.html#scraping-big-number-of-targets for more info + Optional name of the cluster. If multiple vmagent clusters scrape the same targets, then each cluster must have unique name in order to properly de-duplicate samples received from these clusters. See https://docs.victoriametrics.com/vmagent/#scraping-big-number-of-targets for more info -promscrape.cluster.replicationFactor int - The number of members in the cluster, which scrape the same targets. If the replication factor is greater than 1, then the deduplication must be enabled at remote storage side. See https://docs.victoriametrics.com/vmagent.html#scraping-big-number-of-targets for more info (default 1) + The number of members in the cluster, which scrape the same targets. If the replication factor is greater than 1, then the deduplication must be enabled at remote storage side. See https://docs.victoriametrics.com/vmagent/#scraping-big-number-of-targets for more info (default 1) -promscrape.config string Optional path to Prometheus config file with 'scrape_configs' section containing targets to scrape. The path can point to local file and to http url. See https://docs.victoriametrics.com/#how-to-scrape-prometheus-exporters-such-as-node-exporter for details -promscrape.config.dryRun @@ -2899,15 +2903,15 @@ Pass `-help` to VictoriaMetrics in order to see the list of supported command-li -promscrape.config.strictParse Whether to deny unsupported fields in -promscrape.config . Set to false in order to silently skip unsupported fields (default true) -promscrape.configCheckInterval duration - Interval for checking for changes in -promscrape.config file. By default, the checking is disabled. See how to reload -promscrape.config file at https://docs.victoriametrics.com/vmagent.html#configuration-update + Interval for checking for changes in -promscrape.config file. By default, the checking is disabled. See how to reload -promscrape.config file at https://docs.victoriametrics.com/vmagent/#configuration-update -promscrape.consul.waitTime duration Wait time used by Consul service discovery. Default value is used if not set -promscrape.consulSDCheckInterval duration - Interval for checking for changes in Consul. This works only if consul_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs.html#consul_sd_configs for details (default 30s) + Interval for checking for changes in Consul. This works only if consul_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs/#consul_sd_configs for details (default 30s) -promscrape.consulagentSDCheckInterval duration - Interval for checking for changes in Consul Agent. This works only if consulagent_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs.html#consulagent_sd_configs for details (default 30s) + Interval for checking for changes in Consul Agent. This works only if consulagent_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs/#consulagent_sd_configs for details (default 30s) -promscrape.digitaloceanSDCheckInterval duration - Interval for checking for changes in digital ocean. This works only if digitalocean_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs.html#digitalocean_sd_configs for details (default 1m0s) + Interval for checking for changes in digital ocean. This works only if digitalocean_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs/#digitalocean_sd_configs for details (default 1m0s) -promscrape.disableCompression Whether to disable sending 'Accept-Encoding: gzip' request headers to all the scrape targets. This may reduce CPU usage on scrape targets at the cost of higher network bandwidth utilization. It is possible to set 'disable_compression: true' individually per each 'scrape_config' section in '-promscrape.config' for fine-grained control -promscrape.disableKeepAlive @@ -2917,33 +2921,33 @@ Pass `-help` to VictoriaMetrics in order to see the list of supported command-li -promscrape.discovery.concurrentWaitTime duration The maximum duration for waiting to perform API requests if more than -promscrape.discovery.concurrency requests are simultaneously performed (default 1m0s) -promscrape.dnsSDCheckInterval duration - Interval for checking for changes in dns. This works only if dns_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs.html#dns_sd_configs for details (default 30s) + Interval for checking for changes in dns. This works only if dns_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs/#dns_sd_configs for details (default 30s) -promscrape.dockerSDCheckInterval duration - Interval for checking for changes in docker. This works only if docker_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs.html#docker_sd_configs for details (default 30s) + Interval for checking for changes in docker. This works only if docker_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs/#docker_sd_configs for details (default 30s) -promscrape.dockerswarmSDCheckInterval duration - Interval for checking for changes in dockerswarm. This works only if dockerswarm_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs.html#dockerswarm_sd_configs for details (default 30s) + Interval for checking for changes in dockerswarm. This works only if dockerswarm_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs/#dockerswarm_sd_configs for details (default 30s) -promscrape.dropOriginalLabels Whether to drop original labels for scrape targets at /targets and /api/v1/targets pages. This may be needed for reducing memory usage when original labels for big number of scrape targets occupy big amounts of memory. Note that this reduces debuggability for improper per-target relabeling configs -promscrape.ec2SDCheckInterval duration - Interval for checking for changes in ec2. This works only if ec2_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs.html#ec2_sd_configs for details (default 1m0s) + Interval for checking for changes in ec2. This works only if ec2_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs/#ec2_sd_configs for details (default 1m0s) -promscrape.eurekaSDCheckInterval duration - Interval for checking for changes in eureka. This works only if eureka_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs.html#eureka_sd_configs for details (default 30s) + Interval for checking for changes in eureka. This works only if eureka_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs/#eureka_sd_configs for details (default 30s) -promscrape.fileSDCheckInterval duration - Interval for checking for changes in 'file_sd_config'. See https://docs.victoriametrics.com/sd_configs.html#file_sd_configs for details (default 1m0s) + Interval for checking for changes in 'file_sd_config'. See https://docs.victoriametrics.com/sd_configs/#file_sd_configs for details (default 1m0s) -promscrape.gceSDCheckInterval duration - Interval for checking for changes in gce. This works only if gce_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs.html#gce_sd_configs for details (default 1m0s) + Interval for checking for changes in gce. This works only if gce_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs/#gce_sd_configs for details (default 1m0s) -promscrape.hetznerSDCheckInterval duration - Interval for checking for changes in Hetzner API. This works only if hetzner_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs.html#hetzner_sd_configs for details (default 1m0s) + Interval for checking for changes in Hetzner API. This works only if hetzner_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs/#hetzner_sd_configs for details (default 1m0s) -promscrape.httpSDCheckInterval duration - Interval for checking for changes in http endpoint service discovery. This works only if http_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs.html#http_sd_configs for details (default 1m0s) + Interval for checking for changes in http endpoint service discovery. This works only if http_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs/#http_sd_configs for details (default 1m0s) -promscrape.kubernetes.apiServerTimeout duration How frequently to reload the full state from Kubernetes API server (default 30m0s) -promscrape.kubernetes.attachNodeMetadataAll - Whether to set attach_metadata.node=true for all the kubernetes_sd_configs at -promscrape.config . It is possible to set attach_metadata.node=false individually per each kubernetes_sd_configs . See https://docs.victoriametrics.com/sd_configs.html#kubernetes_sd_configs + Whether to set attach_metadata.node=true for all the kubernetes_sd_configs at -promscrape.config . It is possible to set attach_metadata.node=false individually per each kubernetes_sd_configs . See https://docs.victoriametrics.com/sd_configs/#kubernetes_sd_configs -promscrape.kubernetesSDCheckInterval duration - Interval for checking for changes in Kubernetes API server. This works only if kubernetes_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs.html#kubernetes_sd_configs for details (default 30s) + Interval for checking for changes in Kubernetes API server. This works only if kubernetes_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs/#kubernetes_sd_configs for details (default 30s) -promscrape.kumaSDCheckInterval duration - Interval for checking for changes in kuma service discovery. This works only if kuma_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs.html#kuma_sd_configs for details (default 30s) + Interval for checking for changes in kuma service discovery. This works only if kuma_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs/#kuma_sd_configs for details (default 30s) -promscrape.maxDroppedTargets int The maximum number of droppedTargets to show at /api/v1/targets page. Increase this value if your setup drops more scrape targets during relabeling and you need investigating labels for all the dropped targets. Note that the increased number of tracked dropped targets may result in increased memory usage (default 1000) -promscrape.maxResponseHeadersSize size @@ -2953,28 +2957,28 @@ Pass `-help` to VictoriaMetrics in order to see the list of supported command-li The maximum size of scrape response in bytes to process from Prometheus targets. Bigger responses are rejected Supports the following optional suffixes for size values: KB, MB, GB, TB, KiB, MiB, GiB, TiB (default 16777216) -promscrape.minResponseSizeForStreamParse size - The minimum target response size for automatic switching to stream parsing mode, which can reduce memory usage. See https://docs.victoriametrics.com/vmagent.html#stream-parsing-mode + The minimum target response size for automatic switching to stream parsing mode, which can reduce memory usage. See https://docs.victoriametrics.com/vmagent/#stream-parsing-mode Supports the following optional suffixes for size values: KB, MB, GB, TB, KiB, MiB, GiB, TiB (default 1000000) -promscrape.noStaleMarkers Whether to disable sending Prometheus stale markers for metrics when scrape target disappears. This option may reduce memory usage if stale markers aren't needed for your setup. This option also disables populating the scrape_series_added metric. See https://prometheus.io/docs/concepts/jobs_instances/#automatically-generated-labels-and-time-series -promscrape.nomad.waitTime duration Wait time used by Nomad service discovery. Default value is used if not set -promscrape.nomadSDCheckInterval duration - Interval for checking for changes in Nomad. This works only if nomad_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs.html#nomad_sd_configs for details (default 30s) + Interval for checking for changes in Nomad. This works only if nomad_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs/#nomad_sd_configs for details (default 30s) -promscrape.openstackSDCheckInterval duration - Interval for checking for changes in openstack API server. This works only if openstack_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs.html#openstack_sd_configs for details (default 30s) + Interval for checking for changes in openstack API server. This works only if openstack_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs/#openstack_sd_configs for details (default 30s) -promscrape.seriesLimitPerTarget int - Optional limit on the number of unique time series a single scrape target can expose. See https://docs.victoriametrics.com/vmagent.html#cardinality-limiter for more info + Optional limit on the number of unique time series a single scrape target can expose. See https://docs.victoriametrics.com/vmagent/#cardinality-limiter for more info -promscrape.streamParse Whether to enable stream parsing for metrics obtained from scrape targets. This may be useful for reducing memory usage when millions of metrics are exposed per each scrape target. It is possible to set 'stream_parse: true' individually per each 'scrape_config' section in '-promscrape.config' for fine-grained control -promscrape.suppressDuplicateScrapeTargetErrors - Whether to suppress 'duplicate scrape target' errors; see https://docs.victoriametrics.com/vmagent.html#troubleshooting for details + Whether to suppress 'duplicate scrape target' errors; see https://docs.victoriametrics.com/vmagent/#troubleshooting for details -promscrape.suppressScrapeErrors Whether to suppress scrape errors logging. The last error for each target is always available at '/targets' page even if scrape errors logging is suppressed. See also -promscrape.suppressScrapeErrorsDelay -promscrape.suppressScrapeErrorsDelay duration The delay for suppressing repeated scrape errors logging per each scrape targets. This may be used for reducing the number of log lines related to scrape errors. See also -promscrape.suppressScrapeErrors -promscrape.yandexcloudSDCheckInterval duration - Interval for checking for changes in Yandex Cloud API. This works only if yandexcloud_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs.html#yandexcloud_sd_configs for details (default 30s) + Interval for checking for changes in Yandex Cloud API. This works only if yandexcloud_sd_configs is configured in '-promscrape.config' file. See https://docs.victoriametrics.com/sd_configs/#yandexcloud_sd_configs for details (default 30s) -pushmetrics.disableCompression Whether to disable request body compression when pushing metrics to every -pushmetrics.url -pushmetrics.extraLabel array @@ -2997,7 +3001,7 @@ Pass `-help` to VictoriaMetrics in order to see the list of supported command-li Auth key for /-/reload http endpoint. It must be passed as authKey=... Flag value can be read from the given file when using -reloadAuthKey=file:///abs/path/to/file or -reloadAuthKey=file://./relative/path/to/file . Flag value can be read from the given http/https url when using -reloadAuthKey=http://host/path or -reloadAuthKey=https://host/path -retentionFilter array - Retention filter in the format 'filter:retention'. For example, '{env="dev"}:3d' configures the retention for time series with env="dev" label to 3 days. See https://docs.victoriametrics.com/#retention-filters for details. This flag is available only in VictoriaMetrics enterprise. See https://docs.victoriametrics.com/enterprise.html + Retention filter in the format 'filter:retention'. For example, '{env="dev"}:3d' configures the retention for time series with env="dev" label to 3 days. See https://docs.victoriametrics.com/#retention-filters for details. This flag is available only in VictoriaMetrics enterprise. See https://docs.victoriametrics.com/enterprise/ Supports an array of values separated by comma or specified via multiple flags. Value can contain comma inside single-quoted or double-quoted string, {}, [] and () braces. -retentionPeriod value @@ -3125,16 +3129,16 @@ Pass `-help` to VictoriaMetrics in order to see the list of supported command-li -sortLabels Whether to sort labels for incoming samples before writing them to storage. This may be needed for reducing memory usage at storage when the order of labels in incoming samples is random. For example, if m{k1="v1",k2="v2"} may be sent as m{k2="v2",k1="v1"}. Enabled sorting for labels can slow down ingestion performance a bit -storage.cacheSizeIndexDBDataBlocks size - Overrides max size for indexdb/dataBlocks cache. See https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#cache-tuning + Overrides max size for indexdb/dataBlocks cache. See https://docs.victoriametrics.com/single-server-victoriametrics/#cache-tuning Supports the following optional suffixes for size values: KB, MB, GB, TB, KiB, MiB, GiB, TiB (default 0) -storage.cacheSizeIndexDBIndexBlocks size - Overrides max size for indexdb/indexBlocks cache. See https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#cache-tuning + Overrides max size for indexdb/indexBlocks cache. See https://docs.victoriametrics.com/single-server-victoriametrics/#cache-tuning Supports the following optional suffixes for size values: KB, MB, GB, TB, KiB, MiB, GiB, TiB (default 0) -storage.cacheSizeIndexDBTagFilters size - Overrides max size for indexdb/tagFiltersToMetricIDs cache. See https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#cache-tuning + Overrides max size for indexdb/tagFiltersToMetricIDs cache. See https://docs.victoriametrics.com/single-server-victoriametrics/#cache-tuning Supports the following optional suffixes for size values: KB, MB, GB, TB, KiB, MiB, GiB, TiB (default 0) -storage.cacheSizeStorageTSID size - Overrides max size for storage/tsid cache. See https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#cache-tuning + Overrides max size for storage/tsid cache. See https://docs.victoriametrics.com/single-server-victoriametrics/#cache-tuning Supports the following optional suffixes for size values: KB, MB, GB, TB, KiB, MiB, GiB, TiB (default 0) -storage.maxDailySeries int The maximum number of unique series can be added to the storage during the last 24 hours. Excess series are logged and dropped. This can be useful for limiting series churn rate. See https://docs.victoriametrics.com/#cardinality-limiter . See also -storage.maxHourlySeries @@ -3146,25 +3150,35 @@ Pass `-help` to VictoriaMetrics in order to see the list of supported command-li -storageDataPath string Path to storage data (default "victoria-metrics-data") -streamAggr.config string - Optional path to file with stream aggregation config. See https://docs.victoriametrics.com/stream-aggregation.html . See also -streamAggr.keepInput, -streamAggr.dropInput and -streamAggr.dedupInterval + Optional path to file with stream aggregation config. See https://docs.victoriametrics.com/stream-aggregation/ . See also -streamAggr.keepInput, -streamAggr.dropInput and -streamAggr.dedupInterval -streamAggr.dedupInterval duration - Input samples are de-duplicated with this interval before optional aggregation with -streamAggr.config . See also -streamAggr.dropInputLabels and -dedup.minScrapeInterval and https://docs.victoriametrics.com/stream-aggregation.html#deduplication + Input samples are de-duplicated with this interval before optional aggregation with -streamAggr.config . See also -streamAggr.dropInputLabels and -dedup.minScrapeInterval and https://docs.victoriametrics.com/stream-aggregation/#deduplication -streamAggr.dropInput - Whether to drop all the input samples after the aggregation with -streamAggr.config. By default, only aggregated samples are dropped, while the remaining samples are stored in the database. See also -streamAggr.keepInput and https://docs.victoriametrics.com/stream-aggregation.html + Whether to drop all the input samples after the aggregation with -streamAggr.config. By default, only aggregated samples are dropped, while the remaining samples are stored in the database. See also -streamAggr.keepInput and https://docs.victoriametrics.com/stream-aggregation/ -streamAggr.dropInputLabels array - An optional list of labels to drop from samples before stream de-duplication and aggregation . See https://docs.victoriametrics.com/stream-aggregation.html#dropping-unneeded-labels + An optional list of labels to drop from samples before stream de-duplication and aggregation . See https://docs.victoriametrics.com/stream-aggregation/#dropping-unneeded-labels Supports an array of values separated by comma or specified via multiple flags. Value can contain comma inside single-quoted or double-quoted string, {}, [] and () braces. + -streamAggr.ignoreFirstIntervals int + Number of aggregation intervals to skip after the start. Increase this value if you observe incorrect aggregation results after restarts. It could be caused by receiving unordered delayed data from clients pushing data into the database. See https://docs.victoriametrics.com/stream-aggregation/#ignore-aggregation-intervals-on-start -streamAggr.ignoreOldSamples - Whether to ignore input samples with old timestamps outside the current aggregation interval. See https://docs.victoriametrics.com/stream-aggregation.html#ignoring-old-samples + Whether to ignore input samples with old timestamps outside the current aggregation interval. See https://docs.victoriametrics.com/stream-aggregation/#ignoring-old-samples -streamAggr.keepInput - Whether to keep all the input samples after the aggregation with -streamAggr.config. By default, only aggregated samples are dropped, while the remaining samples are stored in the database. See also -streamAggr.dropInput and https://docs.victoriametrics.com/stream-aggregation.html + Whether to keep all the input samples after the aggregation with -streamAggr.config. By default, only aggregated samples are dropped, while the remaining samples are stored in the database. See also -streamAggr.dropInput and https://docs.victoriametrics.com/stream-aggregation/ -tls array Whether to enable TLS for incoming HTTP requests at the given -httpListenAddr (aka https). -tlsCertFile and -tlsKeyFile must be set if -tls is set. See also -mtls Supports array of values separated by comma or specified via multiple flags. Empty values are set to false. + -tlsAutocertCacheDir string + Directory to store TLS certificates issued via Let's Encrypt. Certificates are lost on restarts if this flag isn't set. This flag is available only in Enterprise binaries. See https://docs.victoriametrics.com/enterprise/ + -tlsAutocertEmail string + Contact email for the issued Let's Encrypt TLS certificates. See also -tlsAutocertHosts and -tlsAutocertCacheDir .This flag is available only in Enterprise binaries. See https://docs.victoriametrics.com/enterprise/ + -tlsAutocertHosts array + Optional hostnames for automatic issuing of Let's Encrypt TLS certificates. These hostnames must be reachable at -httpListenAddr . The -httpListenAddr must listen tcp port 443 . The -tlsAutocertHosts overrides -tlsCertFile and -tlsKeyFile . See also -tlsAutocertEmail and -tlsAutocertCacheDir . This flag is available only in Enterprise binaries. See https://docs.victoriametrics.com/enterprise/ + Supports an array of values separated by comma or specified via multiple flags. + Value can contain comma inside single-quoted or double-quoted string, {}, [] and () braces. -tlsCertFile array - Path to file with TLS certificate for the corresponding -httpListenAddr if -tls is set. Prefer ECDSA certs instead of RSA certs as RSA certs are slower. The provided certificate file is automatically re-read every second, so it can be dynamically updated + Path to file with TLS certificate for the corresponding -httpListenAddr if -tls is set. Prefer ECDSA certs instead of RSA certs as RSA certs are slower. The provided certificate file is automatically re-read every second, so it can be dynamically updated. See also -tlsAutocertHosts Supports an array of values separated by comma or specified via multiple flags. Value can contain comma inside single-quoted or double-quoted string, {}, [] and () braces. -tlsCipherSuites array @@ -3172,7 +3186,7 @@ Pass `-help` to VictoriaMetrics in order to see the list of supported command-li Supports an array of values separated by comma or specified via multiple flags. Value can contain comma inside single-quoted or double-quoted string, {}, [] and () braces. -tlsKeyFile array - Path to file with TLS key for the corresponding -httpListenAddr if -tls is set. The provided key file is automatically re-read every second, so it can be dynamically updated + Path to file with TLS key for the corresponding -httpListenAddr if -tls is set. The provided key file is automatically re-read every second, so it can be dynamically updated. See also -tlsAutocertHosts Supports an array of values separated by comma or specified via multiple flags. Value can contain comma inside single-quoted or double-quoted string, {}, [] and () braces. -tlsMinVersion array diff --git a/SECURITY.md b/SECURITY.md index 472ed735f..d2163c329 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -6,7 +6,7 @@ The following versions of VictoriaMetrics receive regular security fixes: | Version | Supported | |---------|--------------------| -| [latest release](https://docs.victoriametrics.com/CHANGELOG.html) | :white_check_mark: | +| [latest release](https://docs.victoriametrics.com/changelog/) | :white_check_mark: | | v1.97.x [LTS line](https://docs.victoriametrics.com/lts-releases/) | :white_check_mark: | | v1.93.x [LTS line](https://docs.victoriametrics.com/lts-releases/) | :white_check_mark: | | other releases | :x: | diff --git a/app/victoria-logs/deployment/Dockerfile b/app/victoria-logs/deployment/Dockerfile index 865964d71..a768296b7 100644 --- a/app/victoria-logs/deployment/Dockerfile +++ b/app/victoria-logs/deployment/Dockerfile @@ -1,7 +1,7 @@ ARG base_image FROM $base_image -EXPOSE 8428 +EXPOSE 9428 ENTRYPOINT ["/victoria-logs-prod"] ARG src_binary diff --git a/app/victoria-logs/multiarch/Dockerfile b/app/victoria-logs/multiarch/Dockerfile index 220add3a4..17375a2ed 100644 --- a/app/victoria-logs/multiarch/Dockerfile +++ b/app/victoria-logs/multiarch/Dockerfile @@ -6,7 +6,7 @@ RUN apk update && apk upgrade && apk --update --no-cache add ca-certificates FROM $root_image COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt -EXPOSE 8428 +EXPOSE 9428 ENTRYPOINT ["/victoria-logs-prod"] ARG TARGETARCH COPY victoria-logs-linux-${TARGETARCH}-prod ./victoria-logs-prod diff --git a/app/vlselect/vmui/asset-manifest.json b/app/vlselect/vmui/asset-manifest.json index 1a7695c03..9f614ab63 100644 --- a/app/vlselect/vmui/asset-manifest.json +++ b/app/vlselect/vmui/asset-manifest.json @@ -1,13 +1,13 @@ { "files": { "main.css": "./static/css/main.bc07cc78.css", - "main.js": "./static/js/main.034044a7.js", + "main.js": "./static/js/main.8e7757ef.js", "static/js/685.bebe1265.chunk.js": "./static/js/685.bebe1265.chunk.js", - "static/media/MetricsQL.md": "./static/media/MetricsQL.10add6e7bdf0f1d98cf7.md", + "static/media/MetricsQL.md": "./static/media/MetricsQL.da86c2db4f0b05e286b0.md", "index.html": "./index.html" }, "entrypoints": [ "static/css/main.bc07cc78.css", - "static/js/main.034044a7.js" + "static/js/main.8e7757ef.js" ] } \ No newline at end of file diff --git a/app/vlselect/vmui/index.html b/app/vlselect/vmui/index.html index a72d8f239..edbebda02 100644 --- a/app/vlselect/vmui/index.html +++ b/app/vlselect/vmui/index.html @@ -1 +1 @@ -VM UI
\ No newline at end of file +VM UI
\ No newline at end of file diff --git a/app/vlselect/vmui/static/js/main.034044a7.js b/app/vlselect/vmui/static/js/main.034044a7.js deleted file mode 100644 index 0abbe89f9..000000000 --- a/app/vlselect/vmui/static/js/main.034044a7.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see main.034044a7.js.LICENSE.txt */ -(()=>{var e={61:(e,t,n)=>{"use strict";var r=n(375),o=n(629),i=o(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"===typeof n&&i(e,".prototype.")>-1?o(n):n}},629:(e,t,n)=>{"use strict";var r=n(989),o=n(375),i=n(259),a=n(277),l=o("%Function.prototype.apply%"),s=o("%Function.prototype.call%"),c=o("%Reflect.apply%",!0)||r.call(s,l),u=n(709),d=o("%Math.max%");e.exports=function(e){if("function"!==typeof e)throw new a("a function is required");var t=c(r,s,arguments);return i(t,1+d(0,e.length-(arguments.length-1)),!0)};var h=function(){return c(r,l,arguments)};u?u(e.exports,"apply",{value:h}):e.exports.apply=h},159:function(e){e.exports=function(){"use strict";var e=1e3,t=6e4,n=36e5,r="millisecond",o="second",i="minute",a="hour",l="day",s="week",c="month",u="quarter",d="year",h="date",f="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},g=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},y={s:g,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),o=n%60;return(t<=0?"+":"-")+g(r,2,"0")+":"+g(o,2,"0")},m:function e(t,n){if(t.date()1)return e(a[0])}else{var l=t.name;b[l]=t,o=l}return!r&&o&&(_=o),o||!r&&_},S=function(e,t){if(k(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new C(n)},A=y;A.l=x,A.i=k,A.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var C=function(){function v(e){this.$L=x(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[w]=!0}var g=v.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(A.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(p);if(r){var o=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return A},g.isValid=function(){return!(this.$d.toString()===f)},g.isSame=function(e,t){var n=S(e);return this.startOf(t)<=n&&n<=this.endOf(t)},g.isAfter=function(e,t){return S(e)=0&&(i[d]=parseInt(u,10))}var h=i[3],f=24===h?0:h,p=i[0]+"-"+i[1]+"-"+i[2]+" "+f+":"+i[4]+":"+i[5]+":000",m=+t;return(o.utc(p).valueOf()-(m-=m%1e3))/6e4},s=r.prototype;s.tz=function(e,t){void 0===e&&(e=i);var n=this.utcOffset(),r=this.toDate(),a=r.toLocaleString("en-US",{timeZone:e}),l=Math.round((r-new Date(a))/1e3/60),s=o(a,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(15*-Math.round(r.getTimezoneOffset()/15)-l,!0);if(t){var c=s.utcOffset();s=s.add(n-c,"minute")}return s.$x.$timezone=e,s},s.offsetName=function(e){var t=this.$x.$timezone||o.tz.guess(),n=a(this.valueOf(),t,{timeZoneName:e}).find((function(e){return"timezonename"===e.type.toLowerCase()}));return n&&n.value};var c=s.startOf;s.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return c.call(this,e,t);var n=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return c.call(n,e,t).tz(this.$x.$timezone,!0)},o.tz=function(e,t,n){var r=n&&t,a=n||t||i,s=l(+o(),a);if("string"!=typeof e)return o(e).tz(a);var c=function(e,t,n){var r=e-60*t*1e3,o=l(r,n);if(t===o)return[r,t];var i=l(r-=60*(o-t)*1e3,n);return o===i?[r,o]:[e-60*Math.min(o,i)*1e3,Math.max(o,i)]}(o.utc(e,r).valueOf(),s,a),u=c[0],d=c[1],h=o(u).utcOffset(d);return h.$x.$timezone=a,h},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(e){i=e}}}()},220:function(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,o,i){var a=o.prototype;i.utc=function(e){return new o({date:e,utc:!0,args:arguments})},a.utc=function(t){var n=i(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var l=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),l.call(this,e)};var s=a.init;a.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else s.call(this)};var c=a.utcOffset;a.utcOffset=function(r,o){var i=this.$utils().u;if(i(r))return this.$u?0:i(this.$offset)?c.call(this):this.$offset;if("string"==typeof r&&(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var o=(""+r[0]).match(n)||["-",0,0],i=o[0],a=60*+o[1]+ +o[2];return 0===a?0:"+"===i?a:-a}(r),null===r))return this;var a=Math.abs(r)<=16?60*r:r,l=this;if(o)return l.$offset=a,l.$u=0===r,l;if(0!==r){var s=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(l=this.local().add(a+s,e)).$offset=a,l.$x.$localOffset=s}else l=this.utc();return l};var u=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var d=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var h=a.diff;a.diff=function(e,t,n){if(e&&this.$u===e.$u)return h.call(this,e,t,n);var r=this.local(),o=i(e).local();return h.call(r,o,t,n)}}}()},411:(e,t,n)=>{"use strict";var r=n(709),o=n(430),i=n(277),a=n(553);e.exports=function(e,t,n){if(!e||"object"!==typeof e&&"function"!==typeof e)throw new i("`obj` must be an object or a function`");if("string"!==typeof t&&"symbol"!==typeof t)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!==typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!==typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!==typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!==typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],d=!!a&&a(e,t);if(r)r(e,t,{configurable:null===c&&d?d.configurable:!c,enumerable:null===l&&d?d.enumerable:!l,value:n,writable:null===s&&d?d.writable:!s});else{if(!u&&(l||s||c))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=n}}},709:(e,t,n)=>{"use strict";var r=n(375)("%Object.defineProperty%",!0)||!1;if(r)try{r({},"a",{value:1})}catch(o){r=!1}e.exports=r},123:e=>{"use strict";e.exports=EvalError},953:e=>{"use strict";e.exports=Error},780:e=>{"use strict";e.exports=RangeError},768:e=>{"use strict";e.exports=ReferenceError},430:e=>{"use strict";e.exports=SyntaxError},277:e=>{"use strict";e.exports=TypeError},619:e=>{"use strict";e.exports=URIError},307:e=>{"use strict";var t=Object.prototype.toString,n=Math.max,r=function(e,t){for(var n=[],r=0;r{"use strict";var r=n(307);e.exports=Function.prototype.bind||r},375:(e,t,n)=>{"use strict";var r,o=n(953),i=n(123),a=n(780),l=n(768),s=n(430),c=n(277),u=n(619),d=Function,h=function(e){try{return d('"use strict"; return ('+e+").constructor;")()}catch(t){}},f=Object.getOwnPropertyDescriptor;if(f)try{f({},"")}catch(z){f=null}var p=function(){throw new c},m=f?function(){try{return p}catch(e){try{return f(arguments,"callee").get}catch(t){return p}}}():p,v=n(757)(),g=n(442)(),y=Object.getPrototypeOf||(g?function(e){return e.__proto__}:null),_={},b="undefined"!==typeof Uint8Array&&y?y(Uint8Array):r,w={__proto__:null,"%AggregateError%":"undefined"===typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"===typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":v&&y?y([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":_,"%AsyncGenerator%":_,"%AsyncGeneratorFunction%":_,"%AsyncIteratorPrototype%":_,"%Atomics%":"undefined"===typeof Atomics?r:Atomics,"%BigInt%":"undefined"===typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"===typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"===typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"===typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"===typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"===typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"===typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":d,"%GeneratorFunction%":_,"%Int8Array%":"undefined"===typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"===typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"===typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":v&&y?y(y([][Symbol.iterator]())):r,"%JSON%":"object"===typeof JSON?JSON:r,"%Map%":"undefined"===typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!==typeof Map&&v&&y?y((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"===typeof Promise?r:Promise,"%Proxy%":"undefined"===typeof Proxy?r:Proxy,"%RangeError%":a,"%ReferenceError%":l,"%Reflect%":"undefined"===typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"===typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!==typeof Set&&v&&y?y((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"===typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":v&&y?y(""[Symbol.iterator]()):r,"%Symbol%":v?Symbol:r,"%SyntaxError%":s,"%ThrowTypeError%":m,"%TypedArray%":b,"%TypeError%":c,"%Uint8Array%":"undefined"===typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"===typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"===typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"===typeof Uint32Array?r:Uint32Array,"%URIError%":u,"%WeakMap%":"undefined"===typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"===typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"===typeof WeakSet?r:WeakSet};if(y)try{null.error}catch(z){var k=y(y(z));w["%Error.prototype%"]=k}var x=function e(t){var n;if("%AsyncFunction%"===t)n=h("async function () {}");else if("%GeneratorFunction%"===t)n=h("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=h("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&y&&(n=y(o.prototype))}return w[t]=n,n},S={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},A=n(989),C=n(155),E=A.call(Function.call,Array.prototype.concat),M=A.call(Function.apply,Array.prototype.splice),T=A.call(Function.call,String.prototype.replace),N=A.call(Function.call,String.prototype.slice),O=A.call(Function.call,RegExp.prototype.exec),P=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,L=/\\(\\)?/g,R=function(e,t){var n,r=e;if(C(S,r)&&(r="%"+(n=S[r])[0]+"%"),C(w,r)){var o=w[r];if(o===_&&(o=x(r)),"undefined"===typeof o&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new s("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!==typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!==typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===O(/^%?[^%]*%?$/,e))throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=N(e,0,1),n=N(e,-1);if("%"===t&&"%"!==n)throw new s("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new s("invalid intrinsic syntax, expected opening `%`");var r=[];return T(e,P,(function(e,t,n,o){r[r.length]=n?T(o,L,"$1"):t||e})),r}(e),r=n.length>0?n[0]:"",o=R("%"+r+"%",t),i=o.name,a=o.value,l=!1,u=o.alias;u&&(r=u[0],M(n,E([0,1],u)));for(var d=1,h=!0;d=n.length){var g=f(a,p);a=(h=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:a[p]}else h=C(a,p),a=a[p];h&&!l&&(w[i]=a)}}return a}},553:(e,t,n)=>{"use strict";var r=n(375)("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(o){r=null}e.exports=r},734:(e,t,n)=>{"use strict";var r=n(709),o=function(){return!!r};o.hasArrayLengthDefineBug=function(){if(!r)return null;try{return 1!==r([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},442:e=>{"use strict";var t={foo:{}},n=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof n)}},757:(e,t,n)=>{"use strict";var r="undefined"!==typeof Symbol&&Symbol,o=n(175);e.exports=function(){return"function"===typeof r&&("function"===typeof Symbol&&("symbol"===typeof r("foo")&&("symbol"===typeof Symbol("bar")&&o())))}},175:e=>{"use strict";e.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"===typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"===typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},155:(e,t,n)=>{"use strict";var r=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=n(989);e.exports=i.call(r,o)},267:(e,t,n)=>{var r=NaN,o="[object Symbol]",i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,s=/^0o[0-7]+$/i,c=parseInt,u="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,d="object"==typeof self&&self&&self.Object===Object&&self,h=u||d||Function("return this")(),f=Object.prototype.toString,p=Math.max,m=Math.min,v=function(){return h.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&f.call(e)==o}(e))return r;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=l.test(e);return n||s.test(e)?c(e.slice(2),n?2:8):a.test(e)?r:+e}e.exports=function(e,t,n){var r,o,i,a,l,s,c=0,u=!1,d=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function _(e){var n=e-s;return void 0===s||n>=t||n<0||d&&e-c>=i}function b(){var e=v();if(_(e))return w(e);l=setTimeout(b,function(e){var n=t-(e-s);return d?m(n,i-(e-c)):n}(e))}function w(e){return l=void 0,h&&r?f(e):(r=o=void 0,a)}function k(){var e=v(),n=_(e);if(r=arguments,o=this,s=e,n){if(void 0===l)return function(e){return c=e,l=setTimeout(b,t),u?f(e):a}(s);if(d)return l=setTimeout(b,t),f(s)}return void 0===l&&(l=setTimeout(b,t)),a}return t=y(t)||0,g(n)&&(u=!!n.leading,i=(d="maxWait"in n)?p(y(n.maxWait)||0,t):i,h="trailing"in n?!!n.trailing:h),k.cancel=function(){void 0!==l&&clearTimeout(l),c=0,r=s=o=l=void 0},k.flush=function(){return void 0===l?a:w(v())},k}},424:(e,t,n)=>{var r="__lodash_hash_undefined__",o=1/0,i="[object Function]",a="[object GeneratorFunction]",l="[object Symbol]",s=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c=/^\w*$/,u=/^\./,d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,f=/^\[object .+?Constructor\]$/,p="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,m="object"==typeof self&&self&&self.Object===Object&&self,v=p||m||Function("return this")();var g=Array.prototype,y=Function.prototype,_=Object.prototype,b=v["__core-js_shared__"],w=function(){var e=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),k=y.toString,x=_.hasOwnProperty,S=_.toString,A=RegExp("^"+k.call(x).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=v.Symbol,E=g.splice,M=F(v,"Map"),T=F(Object,"create"),N=C?C.prototype:void 0,O=N?N.toString:void 0;function P(e){var t=-1,n=e?e.length:0;for(this.clear();++t-1},L.prototype.set=function(e,t){var n=this.__data__,r=z(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},R.prototype.clear=function(){this.__data__={hash:new P,map:new(M||L),string:new P}},R.prototype.delete=function(e){return $(this,e).delete(e)},R.prototype.get=function(e){return $(this,e).get(e)},R.prototype.has=function(e){return $(this,e).has(e)},R.prototype.set=function(e,t){return $(this,e).set(e,t),this};var j=H((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(W(e))return O?O.call(e):"";var t=e+"";return"0"==t&&1/e==-o?"-0":t}(t);var n=[];return u.test(e)&&n.push(""),e.replace(d,(function(e,t,r,o){n.push(r?o.replace(h,"$1"):t||e)})),n}));function V(e){if("string"==typeof e||W(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}function H(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(H.Cache||R),n}H.Cache=R;var U=Array.isArray;function B(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function W(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&S.call(e)==l}e.exports=function(e,t,n){var r=null==e?void 0:D(e,t);return void 0===r?n:r}},141:(e,t,n)=>{var r="function"===typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=r&&o&&"function"===typeof o.get?o.get:null,a=r&&Map.prototype.forEach,l="function"===typeof Set&&Set.prototype,s=Object.getOwnPropertyDescriptor&&l?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=l&&s&&"function"===typeof s.get?s.get:null,u=l&&Set.prototype.forEach,d="function"===typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h="function"===typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"===typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,m=Object.prototype.toString,v=Function.prototype.toString,g=String.prototype.match,y=String.prototype.slice,_=String.prototype.replace,b=String.prototype.toUpperCase,w=String.prototype.toLowerCase,k=RegExp.prototype.test,x=Array.prototype.concat,S=Array.prototype.join,A=Array.prototype.slice,C=Math.floor,E="function"===typeof BigInt?BigInt.prototype.valueOf:null,M=Object.getOwnPropertySymbols,T="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?Symbol.prototype.toString:null,N="function"===typeof Symbol&&"object"===typeof Symbol.iterator,O="function"===typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===N||"symbol")?Symbol.toStringTag:null,P=Object.prototype.propertyIsEnumerable,L=("function"===typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function R(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||k.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"===typeof e){var r=e<0?-C(-e):C(e);if(r!==e){var o=String(r),i=y.call(t,o.length+1);return _.call(o,n,"$&_")+"."+_.call(_.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _.call(t,n,"$&_")}var z=n(634),D=z.custom,I=H(D)?D:null;function $(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function F(e){return _.call(String(e),/"/g,""")}function j(e){return"[object Array]"===W(e)&&(!O||!("object"===typeof e&&O in e))}function V(e){return"[object RegExp]"===W(e)&&(!O||!("object"===typeof e&&O in e))}function H(e){if(N)return e&&"object"===typeof e&&e instanceof Symbol;if("symbol"===typeof e)return!0;if(!e||"object"!==typeof e||!T)return!1;try{return T.call(e),!0}catch(t){}return!1}e.exports=function e(t,r,o,l){var s=r||{};if(B(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(B(s,"maxStringLength")&&("number"===typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var m=!B(s,"customInspect")||s.customInspect;if("boolean"!==typeof m&&"symbol"!==m)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(B(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(B(s,"numericSeparator")&&"boolean"!==typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var b=s.numericSeparator;if("undefined"===typeof t)return"undefined";if(null===t)return"null";if("boolean"===typeof t)return t?"true":"false";if("string"===typeof t)return Z(t,s);if("number"===typeof t){if(0===t)return 1/0/t>0?"0":"-0";var k=String(t);return b?R(t,k):k}if("bigint"===typeof t){var C=String(t)+"n";return b?R(t,C):C}var M="undefined"===typeof s.depth?5:s.depth;if("undefined"===typeof o&&(o=0),o>=M&&M>0&&"object"===typeof t)return j(t)?"[Array]":"[Object]";var D=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"===typeof e.indent&&e.indent>0))return null;n=S.call(Array(e.indent+1)," ")}return{base:n,prev:S.call(Array(t+1),n)}}(s,o);if("undefined"===typeof l)l=[];else if(Y(l,t)>=0)return"[Circular]";function U(t,n,r){if(n&&(l=A.call(l)).push(n),r){var i={depth:s.depth};return B(s,"quoteStyle")&&(i.quoteStyle=s.quoteStyle),e(t,i,o+1,l)}return e(t,s,o+1,l)}if("function"===typeof t&&!V(t)){var q=function(e){if(e.name)return e.name;var t=g.call(v.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),ee=X(t,U);return"[Function"+(q?": "+q:" (anonymous)")+"]"+(ee.length>0?" { "+S.call(ee,", ")+" }":"")}if(H(t)){var te=N?_.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):T.call(t);return"object"!==typeof t||N?te:K(te)}if(function(e){if(!e||"object"!==typeof e)return!1;if("undefined"!==typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"===typeof e.nodeName&&"function"===typeof e.getAttribute}(t)){for(var ne="<"+w.call(String(t.nodeName)),re=t.attributes||[],oe=0;oe"}if(j(t)){if(0===t.length)return"[]";var ie=X(t,U);return D&&!function(e){for(var t=0;t=0)return!1;return!0}(ie)?"["+J(ie,D)+"]":"[ "+S.call(ie,", ")+" ]"}if(function(e){return"[object Error]"===W(e)&&(!O||!("object"===typeof e&&O in e))}(t)){var ae=X(t,U);return"cause"in Error.prototype||!("cause"in t)||P.call(t,"cause")?0===ae.length?"["+String(t)+"]":"{ ["+String(t)+"] "+S.call(ae,", ")+" }":"{ ["+String(t)+"] "+S.call(x.call("[cause]: "+U(t.cause),ae),", ")+" }"}if("object"===typeof t&&m){if(I&&"function"===typeof t[I]&&z)return z(t,{depth:M-o});if("symbol"!==m&&"function"===typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!==typeof e)return!1;try{i.call(e);try{c.call(e)}catch(ne){return!0}return e instanceof Map}catch(t){}return!1}(t)){var le=[];return a&&a.call(t,(function(e,n){le.push(U(n,t,!0)+" => "+U(e,t))})),Q("Map",i.call(t),le,D)}if(function(e){if(!c||!e||"object"!==typeof e)return!1;try{c.call(e);try{i.call(e)}catch(t){return!0}return e instanceof Set}catch(n){}return!1}(t)){var se=[];return u&&u.call(t,(function(e){se.push(U(e,t))})),Q("Set",c.call(t),se,D)}if(function(e){if(!d||!e||"object"!==typeof e)return!1;try{d.call(e,d);try{h.call(e,h)}catch(ne){return!0}return e instanceof WeakMap}catch(t){}return!1}(t))return G("WeakMap");if(function(e){if(!h||!e||"object"!==typeof e)return!1;try{h.call(e,h);try{d.call(e,d)}catch(ne){return!0}return e instanceof WeakSet}catch(t){}return!1}(t))return G("WeakSet");if(function(e){if(!f||!e||"object"!==typeof e)return!1;try{return f.call(e),!0}catch(t){}return!1}(t))return G("WeakRef");if(function(e){return"[object Number]"===W(e)&&(!O||!("object"===typeof e&&O in e))}(t))return K(U(Number(t)));if(function(e){if(!e||"object"!==typeof e||!E)return!1;try{return E.call(e),!0}catch(t){}return!1}(t))return K(U(E.call(t)));if(function(e){return"[object Boolean]"===W(e)&&(!O||!("object"===typeof e&&O in e))}(t))return K(p.call(t));if(function(e){return"[object String]"===W(e)&&(!O||!("object"===typeof e&&O in e))}(t))return K(U(String(t)));if("undefined"!==typeof window&&t===window)return"{ [object Window] }";if(t===n.g)return"{ [object globalThis] }";if(!function(e){return"[object Date]"===W(e)&&(!O||!("object"===typeof e&&O in e))}(t)&&!V(t)){var ce=X(t,U),ue=L?L(t)===Object.prototype:t instanceof Object||t.constructor===Object,de=t instanceof Object?"":"null prototype",he=!ue&&O&&Object(t)===t&&O in t?y.call(W(t),8,-1):de?"Object":"",fe=(ue||"function"!==typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(he||de?"["+S.call(x.call([],he||[],de||[]),": ")+"] ":"");return 0===ce.length?fe+"{}":D?fe+"{"+J(ce,D)+"}":fe+"{ "+S.call(ce,", ")+" }"}return String(t)};var U=Object.prototype.hasOwnProperty||function(e){return e in this};function B(e,t){return U.call(e,t)}function W(e){return m.call(e)}function Y(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return Z(y.call(e,0,t.maxStringLength),t)+r}return $(_.call(_.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,q),"single",t)}function q(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+b.call(t.toString(16))}function K(e){return"Object("+e+")"}function G(e){return e+" { ? }"}function Q(e,t,n,r){return e+" ("+t+") {"+(r?J(n,r):S.call(n,", "))+"}"}function J(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+S.call(e,","+n)+"\n"+t.prev}function X(e,t){var n=j(e),r=[];if(n){r.length=e.length;for(var o=0;o{"use strict";n.r(t),n.d(t,{Children:()=>Y,Component:()=>l.uA,Fragment:()=>l.FK,PureComponent:()=>j,StrictMode:()=>Pe,Suspense:()=>Q,SuspenseList:()=>ee,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>ke,cloneElement:()=>Ee,createContext:()=>l.q6,createElement:()=>l.n,createFactory:()=>Se,createPortal:()=>oe,createRef:()=>l._3,default:()=>je,findDOMNode:()=>Te,flushSync:()=>Oe,forwardRef:()=>B,hydrate:()=>he,isElement:()=>Ie,isFragment:()=>Ce,isValidElement:()=>Ae,lazy:()=>X,memo:()=>V,render:()=>de,startTransition:()=>Le,unmountComponentAtNode:()=>Me,unstable_batchedUpdates:()=>Ne,useCallback:()=>C,useContext:()=>E,useDebugValue:()=>M,useDeferredValue:()=>Re,useEffect:()=>w,useErrorBoundary:()=>T,useId:()=>N,useImperativeHandle:()=>S,useInsertionEffect:()=>De,useLayoutEffect:()=>k,useMemo:()=>A,useReducer:()=>b,useRef:()=>x,useState:()=>_,useSyncExternalStore:()=>$e,useTransition:()=>ze,version:()=>xe});var r,o,i,a,l=n(746),s=0,c=[],u=[],d=l.fF,h=d.__b,f=d.__r,p=d.diffed,m=d.__c,v=d.unmount,g=d.__;function y(e,t){d.__h&&d.__h(o,e,s||t),s=0;var n=o.__H||(o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:u}),n.__[e]}function _(e){return s=1,b(I,e)}function b(e,t,n){var i=y(r++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):I(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=o,!o.u)){var a=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return!!e.__c}));if(r.every((function(e){return!e.__N})))return!l||l.call(this,e,t,n);var o=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),!(!o&&i.__c.props===e)&&(!l||l.call(this,e,t,n))};o.u=!0;var l=o.shouldComponentUpdate,s=o.componentWillUpdate;o.componentWillUpdate=function(e,t,n){if(this.__e){var r=l;l=void 0,a(e,t,n),l=r}s&&s.call(this,e,t,n)},o.shouldComponentUpdate=a}return i.__N||i.__}function w(e,t){var n=y(r++,3);!d.__s&&D(n.__H,t)&&(n.__=e,n.i=t,o.__H.__h.push(n))}function k(e,t){var n=y(r++,4);!d.__s&&D(n.__H,t)&&(n.__=e,n.i=t,o.__h.push(n))}function x(e){return s=5,A((function(){return{current:e}}),[])}function S(e,t,n){s=6,k((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function A(e,t){var n=y(r++,7);return D(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function C(e,t){return s=8,A((function(){return e}),t)}function E(e){var t=o.context[e.__c],n=y(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(o)),t.props.value):e.__}function M(e,t){d.useDebugValue&&d.useDebugValue(t?t(e):e)}function T(e){var t=y(r++,10),n=_();return t.__=e,o.componentDidCatch||(o.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function N(){var e=y(r++,11);if(!e.__){for(var t=o.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function O(){for(var e;e=c.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(R),e.__H.__h.forEach(z),e.__H.__h=[]}catch(r){e.__H.__h=[],d.__e(r,e.__v)}}d.__b=function(e){o=null,h&&h(e)},d.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),g&&g(e,t)},d.__r=function(e){f&&f(e),r=0;var t=(o=e.__c).__H;t&&(i===o?(t.__h=[],o.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=u,e.__N=e.i=void 0}))):(t.__h.forEach(R),t.__h.forEach(z),t.__h=[],r=0)),i=o},d.diffed=function(e){p&&p(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==c.push(t)&&a===d.requestAnimationFrame||((a=d.requestAnimationFrame)||L)(O)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==u&&(e.__=e.__V),e.i=void 0,e.__V=u}))),i=o=null},d.__c=function(e,t){t.some((function(e){try{e.__h.forEach(R),e.__h=e.__h.filter((function(e){return!e.__||z(e)}))}catch(o){t.some((function(e){e.__h&&(e.__h=[])})),t=[],d.__e(o,e.__v)}})),m&&m(e,t)},d.unmount=function(e){v&&v(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{R(e)}catch(e){t=e}})),n.__H=void 0,t&&d.__e(t,n.__v))};var P="function"==typeof requestAnimationFrame;function L(e){var t,n=function(){clearTimeout(r),P&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);P&&(t=requestAnimationFrame(n))}function R(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function z(e){var t=o;e.__c=e.__(),o=t}function D(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function I(e,t){return"function"==typeof t?t(e):t}function $(e,t){for(var n in t)e[n]=t[n];return e}function F(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function j(e,t){this.props=e,this.context=t}function V(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:F(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,l.n)(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(j.prototype=new l.uA).isPureReactComponent=!0,j.prototype.shouldComponentUpdate=function(e,t){return F(this.props,e)||F(this.state,t)};var H=l.fF.__b;l.fF.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),H&&H(e)};var U="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function B(e){function t(t){var n=$({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=U,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var W=function(e,t){return null==e?null:(0,l.v2)((0,l.v2)(e).map(t))},Y={map:W,forEach:W,count:function(e){return e?(0,l.v2)(e).length:0},only:function(e){var t=(0,l.v2)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:l.v2},Z=l.fF.__e;l.fF.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);Z(e,t,n,r)};var q=l.fF.unmount;function K(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=$({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return K(e,t,n)}))),e}function G(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return G(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Q(){this.__u=0,this.t=null,this.__b=null}function J(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function X(e){var t,n,r;function o(o){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return(0,l.n)(n,o)}return o.displayName="Lazy",o.__f=!0,o}function ee(){this.u=null,this.o=null}l.fF.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),q&&q(e)},(Q.prototype=new l.uA).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=J(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(l):l())};n.__R=a;var l=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=G(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},Q.prototype.componentWillUnmount=function(){this.t=[]},Q.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=K(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&(0,l.n)(l.FK,null,e.fallback);return o&&(o.__u&=-33),[(0,l.n)(l.FK,null,t.__a?null:e.children),o]};var te=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.i.removeChild(e)}}),(0,l.XX)((0,l.n)(ne,{context:t.context},e.__v),t.l)}function oe(e,t){var n=(0,l.n)(re,{__v:e,i:t});return n.containerInfo=t,n}(ee.prototype=new l.uA).__a=function(e){var t=this,n=J(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),te(t,e,r)):o()};n?n(i):i()}},ee.prototype.render=function(e){this.u=null,this.o=new Map;var t=(0,l.v2)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},ee.prototype.componentDidUpdate=ee.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){te(e,n,t)}))};var ie="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,ae=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,le=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,se=/[A-Z0-9]/g,ce="undefined"!=typeof document,ue=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function de(e,t,n){return null==t.__k&&(t.textContent=""),(0,l.XX)(e,t),"function"==typeof n&&n(),e?e.__c:null}function he(e,t,n){return(0,l.Qv)(e,t),"function"==typeof n&&n(),e?e.__c:null}l.uA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(l.uA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var fe=l.fF.event;function pe(){}function me(){return this.cancelBubble}function ve(){return this.defaultPrevented}l.fF.event=function(e){return fe&&(e=fe(e)),e.persist=pe,e.isPropagationStopped=me,e.isDefaultPrevented=ve,e.nativeEvent=e};var ge,ye={enumerable:!1,configurable:!0,get:function(){return this.class}},_e=l.fF.vnode;l.fF.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={};for(var o in t){var i=t[o];if(!("value"===o&&"defaultValue"in t&&null==i||ce&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var a=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===i?i="":"translate"===a&&"no"===i?i=!1:"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||ue(t.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":le.test(o)?o=a:-1===n.indexOf("-")&&ae.test(o)?o=o.replace(se,"-$&").toLowerCase():null===i&&(i=void 0):a=o="oninput","oninput"===a&&r[o=a]&&(o="oninputCapture"),r[o]=i}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=(0,l.v2)(t.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==n&&null!=r.defaultValue&&(r.value=(0,l.v2)(t.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",ye)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=ie,_e&&_e(e)};var be=l.fF.__r;l.fF.__r=function(e){be&&be(e),ge=e.__c};var we=l.fF.diffed;l.fF.diffed=function(e){we&&we(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),ge=null};var ke={ReactCurrentDispatcher:{current:{readContext:function(e){return ge.__n[e.__c].props.value}}}},xe="17.0.2";function Se(e){return l.n.bind(null,e)}function Ae(e){return!!e&&e.$$typeof===ie}function Ce(e){return Ae(e)&&e.type===l.FK}function Ee(e){return Ae(e)?l.Ob.apply(null,arguments):e}function Me(e){return!!e.__k&&((0,l.XX)(null,e),!0)}function Te(e){return e&&(e.base||1===e.nodeType&&e)||null}var Ne=function(e,t){return e(t)},Oe=function(e,t){return e(t)},Pe=l.FK;function Le(e){e()}function Re(e){return e}function ze(){return[!1,Le]}var De=k,Ie=Ae;function $e(e,t){var n=t(),r=_({h:{__:n,v:t}}),o=r[0].h,i=r[1];return k((function(){o.__=n,o.v=t,Fe(o)&&i({h:o})}),[e,n,t]),w((function(){return Fe(o)&&i({h:o}),e((function(){Fe(o)&&i({h:o})}))}),[e]),n}function Fe(e){var t,n,r=e.v,o=e.__;try{var i=r();return!((t=o)===(n=i)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}var je={useState:_,useId:N,useReducer:b,useEffect:w,useLayoutEffect:k,useInsertionEffect:De,useTransition:ze,useDeferredValue:Re,useSyncExternalStore:$e,startTransition:Le,useRef:x,useImperativeHandle:S,useMemo:A,useCallback:C,useContext:E,useDebugValue:M,version:"17.0.2",Children:Y,render:de,hydrate:he,unmountComponentAtNode:Me,createPortal:oe,createElement:l.n,createContext:l.q6,createFactory:Se,cloneElement:Ee,createRef:l._3,Fragment:l.FK,isValidElement:Ae,isElement:Ie,isFragment:Ce,findDOMNode:Te,Component:l.uA,PureComponent:j,memo:V,forwardRef:B,flushSync:Oe,unstable_batchedUpdates:Ne,StrictMode:Pe,Suspense:Q,SuspenseList:ee,lazy:X,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ke}},746:(e,t,n)=>{"use strict";n.d(t,{FK:()=>b,Ob:()=>B,Qv:()=>U,XX:()=>H,_3:()=>_,fF:()=>o,n:()=>g,q6:()=>W,uA:()=>w,v2:()=>N});var r,o,i,a,l,s,c,u,d={},h=[],f=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,p=Array.isArray;function m(e,t){for(var n in t)e[n]=t[n];return e}function v(e){var t=e.parentNode;t&&t.removeChild(e)}function g(e,t,n){var o,i,a,l={};for(a in t)"key"==a?o=t[a]:"ref"==a?i=t[a]:l[a]=t[a];if(arguments.length>2&&(l.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===l[a]&&(l[a]=e.defaultProps[a]);return y(e,l,o,i,null)}function y(e,t,n,r,a){var l={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++i:a,__i:-1,__u:0};return null==a&&null!=o.vnode&&o.vnode(l),l}function _(){return{current:null}}function b(e){return e.children}function w(e,t){this.props=e,this.context=t}function k(e,t){if(null==t)return e.__?k(e.__,e.__i+1):null;for(var n;tn?(I(r,t,i),i.length=r.length=0,t=void 0,a.sort(c)):t&&o.__c&&o.__c(t,h));t&&I(r,t,i),C.__r=0}function E(e,t,n,r,o,i,a,l,s,c,u){var f,p,m,v,g,y=r&&r.__k||h,_=t.length;for(n.__d=s,M(n,t,y),s=n.__d,f=0;f<_;f++)null!=(m=n.__k[f])&&"boolean"!=typeof m&&"function"!=typeof m&&(p=-1===m.__i?d:y[m.__i]||d,m.__i=f,D(e,m,p,o,i,a,l,s,c,u),v=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&F(p.ref,null,m),u.push(m.ref,m.__c||v,m)),null==g&&null!=v&&(g=v),65536&m.__u||p.__k===m.__k?s=T(m,s,e):"function"==typeof m.type&&void 0!==m.__d?s=m.__d:v&&(s=v.nextSibling),m.__d=void 0,m.__u&=-196609);n.__d=s,n.__e=g}function M(e,t,n){var r,o,i,a,l,s=t.length,c=n.length,u=c,d=0;for(e.__k=[],r=0;r0?y(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,l=O(o,n,a=r+d,u),o.__i=l,i=null,-1!==l&&(u--,(i=n[l])&&(i.__u|=131072)),null==i||null===i.__v?(-1==l&&d--,"function"!=typeof o.type&&(o.__u|=65536)):l!==a&&(l===a+1?d++:l>a?u>s-a?d+=l-a:d--:d=l(null!=s&&0==(131072&s.__u)?1:0))for(;a>=0||l=0){if((s=t[a])&&0==(131072&s.__u)&&o==s.key&&i===s.type)return a;a--}if(l2&&(s.children=arguments.length>3?r.call(arguments,2):n),y(e.type,s,o||e.key,i||e.ref,null)}function W(e,t){var n={__c:t="__cC"+u++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,A(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=h.slice,o={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},i=0,w.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=m({},this.state),"function"==typeof e&&(e=e(m({},n),this.props)),e&&m(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),A(this))},w.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),A(this))},w.prototype.render=b,a=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},C.__r=0,u=0},640:e=>{"use strict";var t=String.prototype.replace,n=/%20/g,r="RFC1738",o="RFC3986";e.exports={default:o,formatters:{RFC1738:function(e){return t.call(e,n,"+")},RFC3986:function(e){return String(e)}},RFC1738:r,RFC3986:o}},215:(e,t,n)=>{"use strict";var r=n(518),o=n(968),i=n(640);e.exports={formats:i,parse:o,stringify:r}},968:(e,t,n)=>{"use strict";var r=n(570),o=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},l=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},s=function(e,t){return e&&"string"===typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},c=function(e,t,n,r){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,l=n.depth>0&&/(\[[^[\]]*])/.exec(i),c=l?i.slice(0,l.index):i,u=[];if(c){if(!n.plainObjects&&o.call(Object.prototype,c)&&!n.allowPrototypes)return;u.push(c)}for(var d=0;n.depth>0&&null!==(l=a.exec(i))&&d=0;--i){var a,l=e[i];if("[]"===l&&n.parseArrays)a=[].concat(o);else{a=n.plainObjects?Object.create(null):{};var c="["===l.charAt(0)&&"]"===l.charAt(l.length-1)?l.slice(1,-1):l,u=parseInt(c,10);n.parseArrays||""!==c?!isNaN(u)&&l!==c&&String(u)===c&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(a=[])[u]=o:"__proto__"!==c&&(a[c]=o):a={0:o}}o=a}return o}(u,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!==typeof e.decoder)throw new TypeError("Decoder has to be a function.");if("undefined"!==typeof e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t="undefined"===typeof e.charset?a.charset:e.charset;return{allowDots:"undefined"===typeof e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"===typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"===typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:"number"===typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"===typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"===typeof e.comma?e.comma:a.comma,decoder:"function"===typeof e.decoder?e.decoder:a.decoder,delimiter:"string"===typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"===typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"===typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"===typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"===typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"===typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null===e||"undefined"===typeof e)return n.plainObjects?Object.create(null):{};for(var u="string"===typeof e?function(e,t){var n,c={__proto__:null},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,d=t.parameterLimit===1/0?void 0:t.parameterLimit,h=u.split(t.delimiter,d),f=-1,p=t.charset;if(t.charsetSentinel)for(n=0;n-1&&(v=i(v)?[v]:v),o.call(c,m)?c[m]=r.combine(c[m],v):c[m]=v}return c}(e,n):e,d=n.plainObjects?Object.create(null):{},h=Object.keys(u),f=0;f{"use strict";var r=n(670),o=n(570),i=n(640),a=Object.prototype.hasOwnProperty,l={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},s=Array.isArray,c=Array.prototype.push,u=function(e,t){c.apply(e,s(t)?t:[t])},d=Date.prototype.toISOString,h=i.default,f={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:o.encode,encodeValuesOnly:!1,format:h,formatter:i.formatters[h],indices:!1,serializeDate:function(e){return d.call(e)},skipNulls:!1,strictNullHandling:!1},p={},m=function e(t,n,i,a,l,c,d,h,m,v,g,y,_,b,w,k){for(var x,S=t,A=k,C=0,E=!1;void 0!==(A=A.get(p))&&!E;){var M=A.get(t);if(C+=1,"undefined"!==typeof M){if(M===C)throw new RangeError("Cyclic object value");E=!0}"undefined"===typeof A.get(p)&&(C=0)}if("function"===typeof h?S=h(n,S):S instanceof Date?S=g(S):"comma"===i&&s(S)&&(S=o.maybeMap(S,(function(e){return e instanceof Date?g(e):e}))),null===S){if(l)return d&&!b?d(n,f.encoder,w,"key",y):n;S=""}if("string"===typeof(x=S)||"number"===typeof x||"boolean"===typeof x||"symbol"===typeof x||"bigint"===typeof x||o.isBuffer(S))return d?[_(b?n:d(n,f.encoder,w,"key",y))+"="+_(d(S,f.encoder,w,"value",y))]:[_(n)+"="+_(String(S))];var T,N=[];if("undefined"===typeof S)return N;if("comma"===i&&s(S))b&&d&&(S=o.maybeMap(S,d)),T=[{value:S.length>0?S.join(",")||null:void 0}];else if(s(h))T=h;else{var O=Object.keys(S);T=m?O.sort(m):O}for(var P=a&&s(S)&&1===S.length?n+"[]":n,L=0;L0?w+b:""}},570:(e,t,n)=>{"use strict";var r=n(640),o=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),l=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],o=0;o=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===r.RFC1738&&(40===u||41===u)?s+=l.charAt(c):u<128?s+=a[u]:u<2048?s+=a[192|u>>6]+a[128|63&u]:u<55296||u>=57344?s+=a[224|u>>12]+a[128|u>>6&63]+a[128|63&u]:(c+=1,u=65536+((1023&u)<<10|1023&l.charCodeAt(c)),s+=a[240|u>>18]+a[128|u>>12&63]+a[128|u>>6&63]+a[128|63&u])}return s},isBuffer:function(e){return!(!e||"object"!==typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var n=[],r=0;r{e.exports=n(204)},204:(e,t,n)=>{"use strict";var r=function(e){return e&&"object"==typeof e&&"default"in e?e.default:e}(n(609)),o=n(609);function i(){return(i=Object.assign||function(e){for(var t=1;tr.length&&h(e,t.length-1);)t=t.slice(0,t.length-1);return t.length}for(var o=r.length,i=t.length;i>=r.length;i--){var a=t[i];if(!h(e,i)&&f(e,i,a)){o=i+1;break}}return o}function v(e,t){return m(e,t)===e.mask.length}function g(e,t){var n=e.maskChar,r=e.mask,o=e.prefix;if(!n){for((t=y(e,"",t,0)).lengtht.length&&(t+=o.slice(t.length,r)),l.every((function(n){for(;u=n,h(e,c=r)&&u!==o[c];){if(r>=t.length&&(t+=o[r]),l=n,i&&h(e,r)&&l===i)return!0;if(++r>=o.length)return!1}var l,c,u;return!f(e,r,n)&&n!==i||(ro.start?d=(u=function(e,t,n,r){var o=e.mask,i=e.maskChar,a=n.split(""),l=r;return a.every((function(t){for(;a=t,h(e,n=r)&&a!==o[n];)if(++r>=o.length)return!1;var n,a;return(f(e,r,t)||t===i)&&r++,r=i.length?p=i.length:p=a.length&&p{"use strict";var r=n(375),o=n(411),i=n(734)(),a=n(553),l=n(277),s=r("%Math.floor%");e.exports=function(e,t){if("function"!==typeof e)throw new l("`fn` is not a function");if("number"!==typeof t||t<0||t>4294967295||s(t)!==t)throw new l("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],r=!0,c=!0;if("length"in e&&a){var u=a(e,"length");u&&!u.configurable&&(r=!1),u&&!u.writable&&(c=!1)}return(r||c||!n)&&(i?o(e,"length",t,!0,!0):o(e,"length",t)),e}},670:(e,t,n)=>{"use strict";var r=n(375),o=n(61),i=n(141),a=n(277),l=r("%WeakMap%",!0),s=r("%Map%",!0),c=o("WeakMap.prototype.get",!0),u=o("WeakMap.prototype.set",!0),d=o("WeakMap.prototype.has",!0),h=o("Map.prototype.get",!0),f=o("Map.prototype.set",!0),p=o("Map.prototype.has",!0),m=function(e,t){for(var n,r=e;null!==(n=r.next);r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n};e.exports=function(){var e,t,n,r={assert:function(e){if(!r.has(e))throw new a("Side channel does not contain "+i(e))},get:function(r){if(l&&r&&("object"===typeof r||"function"===typeof r)){if(e)return c(e,r)}else if(s){if(t)return h(t,r)}else if(n)return function(e,t){var n=m(e,t);return n&&n.value}(n,r)},has:function(r){if(l&&r&&("object"===typeof r||"function"===typeof r)){if(e)return d(e,r)}else if(s){if(t)return p(t,r)}else if(n)return function(e,t){return!!m(e,t)}(n,r);return!1},set:function(r,o){l&&r&&("object"===typeof r||"function"===typeof r)?(e||(e=new l),u(e,r,o)):s?(t||(t=new s),f(t,r,o)):(n||(n={key:{},next:null}),function(e,t,n){var r=m(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(n,r,o))}};return r}},634:()=>{},738:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e="",t=0;t{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>"static/js/"+e+".bebe1265.chunk.js",n.miniCssF=e=>{},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="vmui:";n.l=(r,o,i,a)=>{if(e[r])e[r].push(o);else{var l,s;if(void 0!==i)for(var c=document.getElementsByTagName("script"),u=0;u{l.onerror=l.onload=null,clearTimeout(f);var o=e[r];if(delete e[r],l.parentNode&&l.parentNode.removeChild(l),o&&o.forEach((e=>e(n))),t)return t(n)},f=setTimeout(h.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=h.bind(null,l.onerror),l.onload=h.bind(null,l.onload),s&&document.head.appendChild(l)}}})(),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="./",(()=>{var e={792:0};n.f.j=(t,r)=>{var o=n.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var i=new Promise(((n,r)=>o=e[t]=[n,r]));r.push(o[2]=i);var a=n.p+n.u(t),l=new Error;n.l(a,(r=>{if(n.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;l.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",l.name="ChunkLoadError",l.type=i,l.request=a,o[1](l)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,i,a=r[0],l=r[1],s=r[2],c=0;if(a.some((t=>0!==e[t]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(s)s(n)}for(t&&t(r);c{"use strict";var e,t=n(609),r=n(159),o=n.n(r),i=n(7),a=n.n(i),l=n(648),s=n.n(l),c=n(220),u=n.n(c);function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function _(t,n,r,o){void 0===o&&(o={});let{window:i=document.defaultView,v5Compat:a=!1}=o,l=i.history,s=e.Pop,c=null,u=p();function p(){return(l.state||{idx:null}).idx}function y(){s=e.Pop;let t=p(),n=null==t?null:t-u;u=t,c&&c({action:s,location:b.location,delta:n})}function _(e){let t="null"!==i.location.origin?i.location.origin:i.location.href,n="string"===typeof e?e:g(e);return n=n.replace(/ $/,"%20"),f(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==u&&(u=0,l.replaceState(d({},l.state,{idx:u}),""));let b={get action(){return s},get location(){return t(i,l)},listen(e){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(h,y),c=e,()=>{i.removeEventListener(h,y),c=null}},createHref:e=>n(i,e),createURL:_,encodeLocation(e){let t=_(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(t,n){s=e.Push;let o=v(b.location,t,n);r&&r(o,t),u=p()+1;let d=m(o,u),h=b.createHref(o);try{l.pushState(d,"",h)}catch(f){if(f instanceof DOMException&&"DataCloneError"===f.name)throw f;i.location.assign(h)}a&&c&&c({action:s,location:b.location,delta:1})},replace:function(t,n){s=e.Replace;let o=v(b.location,t,n);r&&r(o,t),u=p();let i=m(o,u),d=b.createHref(o);l.replaceState(i,"",d),a&&c&&c({action:s,location:b.location,delta:0})},go:e=>l.go(e)};return b}var b;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(b||(b={}));new Set(["lazy","caseSensitive","path","id","index","children"]);function w(e,t,n){void 0===n&&(n="/");let r=z(("string"===typeof t?y(t):t).pathname||"/",n);if(null==r)return null;let o=k(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let i=null;for(let a=0;null==i&&a{let a={relativePath:void 0===i?e.path||"":i,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};a.relativePath.startsWith("/")&&(f(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),a.relativePath=a.relativePath.slice(r.length));let l=j([r,a.relativePath]),s=n.concat(a);e.children&&e.children.length>0&&(f(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),k(e.children,t,s,l)),(null!=e.path||e.index)&&t.push({path:l,score:O(l,e.index),routesMeta:s})};return e.forEach(((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let r of x(e.path))o(e,t,r);else o(e,t)})),t}function x(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===r.length)return o?[i,""]:[i];let a=x(r.join("/")),l=[];return l.push(...a.map((e=>""===e?i:[i,e].join("/")))),o&&l.push(...a),l.map((t=>e.startsWith("/")&&""===t?"/":t))}const S=/^:[\w-]+$/,A=3,C=2,E=1,M=10,T=-2,N=e=>"*"===e;function O(e,t){let n=e.split("/"),r=n.length;return n.some(N)&&(r+=T),t&&(r+=C),n.filter((e=>!N(e))).reduce(((e,t)=>e+(S.test(t)?A:""===t?E:M)),r)}function P(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let a=0;a(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(r.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let i=new RegExp(o,t?void 0:"i");return[i,r]}(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:r.reduce(((e,t,n)=>{let{paramName:r,isOptional:o}=t;if("*"===r){let e=l[n]||"";a=i.slice(0,i.length-e.length).replace(/(.)\/+$/,"$1")}const s=l[n];return e[r]=o&&!s?void 0:(s||"").replace(/%2F/g,"/"),e}),{}),pathname:i,pathnameBase:a,pattern:e}}function R(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return p(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function z(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function D(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function I(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function $(e,t){let n=I(e);return t?n.map(((t,n)=>n===e.length-1?t.pathname:t.pathnameBase)):n.map((e=>e.pathnameBase))}function F(e,t,n,r){let o;void 0===r&&(r=!1),"string"===typeof e?o=y(e):(o=d({},e),f(!o.pathname||!o.pathname.includes("?"),D("?","pathname","search",o)),f(!o.pathname||!o.pathname.includes("#"),D("#","pathname","hash",o)),f(!o.search||!o.search.includes("#"),D("#","search","hash",o)));let i,a=""===e||""===o.pathname,l=a?"/":o.pathname;if(null==l)i=n;else{let e=t.length-1;if(!r&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}i=e>=0?t[e]:"/"}let s=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:o=""}="string"===typeof e?y(e):e,i=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:i,search:H(r),hash:U(o)}}(o,i),c=l&&"/"!==l&&l.endsWith("/"),u=(a||"."===l)&&n.endsWith("/");return s.pathname.endsWith("/")||!c&&!u||(s.pathname+="/"),s}const j=e=>e.join("/").replace(/\/\/+/g,"/"),V=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),H=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",U=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;function B(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}const W=["post","put","patch","delete"],Y=(new Set(W),["get",...W]);new Set(Y),new Set([301,302,303,307,308]),new Set([307,308]);Symbol("deferred");function Z(){return Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t{r.current=!0}));let o=t.useCallback((function(t,o){void 0===o&&(o={}),r.current&&("number"===typeof t?e.navigate(t):e.navigate(t,Z({fromRouteId:n},o)))}),[e,n]);return o}():function(){ee()||f(!1);let e=t.useContext(q),{basename:n,future:r,navigator:o}=t.useContext(G),{matches:i}=t.useContext(J),{pathname:a}=te(),l=JSON.stringify($(i,r.v7_relativeSplatPath)),s=t.useRef(!1);ne((()=>{s.current=!0}));let c=t.useCallback((function(t,r){if(void 0===r&&(r={}),!s.current)return;if("number"===typeof t)return void o.go(t);let i=F(t,JSON.parse(l),a,"path"===r.relative);null==e&&"/"!==n&&(i.pathname="/"===i.pathname?n:j([n,i.pathname])),(r.replace?o.replace:o.push)(i,r.state,r)}),[n,o,l,a,e]);return c}()}const oe=t.createContext(null);function ie(e,n){let{relative:r}=void 0===n?{}:n,{future:o}=t.useContext(G),{matches:i}=t.useContext(J),{pathname:a}=te(),l=JSON.stringify($(i,o.v7_relativeSplatPath));return t.useMemo((()=>F(e,JSON.parse(l),a,"path"===r)),[e,l,a,r])}function ae(n,r,o,i){ee()||f(!1);let{navigator:a}=t.useContext(G),{matches:l}=t.useContext(J),s=l[l.length-1],c=s?s.params:{},u=(s&&s.pathname,s?s.pathnameBase:"/");s&&s.route;let d,h=te();if(r){var p;let e="string"===typeof r?y(r):r;"/"===u||(null==(p=e.pathname)?void 0:p.startsWith(u))||f(!1),d=e}else d=h;let m=d.pathname||"/",v=m;if("/"!==u){let e=u.replace(/^\//,"").split("/");v="/"+m.replace(/^\//,"").split("/").slice(e.length).join("/")}let g=w(n,{pathname:v});let _=de(g&&g.map((e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:j([u,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?u:j([u,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),l,o,i);return r&&_?t.createElement(Q.Provider,{value:{location:Z({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:e.Pop}},_):_}function le(){let e=function(){var e;let n=t.useContext(X),r=me(fe.UseRouteError),o=ve(fe.UseRouteError);if(void 0!==n)return n;return null==(e=r.errors)?void 0:e[o]}(),n=B(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:o};return t.createElement(t.Fragment,null,t.createElement("h2",null,"Unexpected Application Error!"),t.createElement("h3",{style:{fontStyle:"italic"}},n),r?t.createElement("pre",{style:i},r):null,null)}const se=t.createElement(le,null);class ce extends t.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?t.createElement(J.Provider,{value:this.props.routeContext},t.createElement(X.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ue(e){let{routeContext:n,match:r,children:o}=e,i=t.useContext(q);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),t.createElement(J.Provider,{value:n},o)}function de(e,n,r,o){var i;if(void 0===n&&(n=[]),void 0===r&&(r=null),void 0===o&&(o=null),null==e){var a;if(null==(a=r)||!a.errors)return null;e=r.matches}let l=e,s=null==(i=r)?void 0:i.errors;if(null!=s){let e=l.findIndex((e=>e.route.id&&(null==s?void 0:s[e.route.id])));e>=0||f(!1),l=l.slice(0,Math.min(l.length,e+1))}let c=!1,u=-1;if(r&&o&&o.v7_partialHydration)for(let t=0;t=0?l.slice(0,u+1):[l[0]];break}}}return l.reduceRight(((e,o,i)=>{let a,d=!1,h=null,f=null;var p;r&&(a=s&&o.route.id?s[o.route.id]:void 0,h=o.route.errorElement||se,c&&(u<0&&0===i?(p="route-fallback",!1||ge[p]||(ge[p]=!0),d=!0,f=null):u===i&&(d=!0,f=o.route.hydrateFallbackElement||null)));let m=n.concat(l.slice(0,i+1)),v=()=>{let n;return n=a?h:d?f:o.route.Component?t.createElement(o.route.Component,null):o.route.element?o.route.element:e,t.createElement(ue,{match:o,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:n})};return r&&(o.route.ErrorBoundary||o.route.errorElement||0===i)?t.createElement(ce,{location:r.location,revalidation:r.revalidation,component:h,error:a,children:v(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):v()}),null)}var he=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(he||{}),fe=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(fe||{});function pe(e){let n=t.useContext(q);return n||f(!1),n}function me(e){let n=t.useContext(K);return n||f(!1),n}function ve(e){let n=function(e){let n=t.useContext(J);return n||f(!1),n}(),r=n.matches[n.matches.length-1];return r.route.id||f(!1),r.route.id}const ge={};t.startTransition;function ye(e){return function(e){let n=t.useContext(J).outlet;return n?t.createElement(oe.Provider,{value:e},n):n}(e.context)}function _e(e){f(!1)}function be(n){let{basename:r="/",children:o=null,location:i,navigationType:a=e.Pop,navigator:l,static:s=!1,future:c}=n;ee()&&f(!1);let u=r.replace(/^\/*/,"/"),d=t.useMemo((()=>({basename:u,navigator:l,static:s,future:Z({v7_relativeSplatPath:!1},c)})),[u,c,l,s]);"string"===typeof i&&(i=y(i));let{pathname:h="/",search:p="",hash:m="",state:v=null,key:g="default"}=i,_=t.useMemo((()=>{let e=z(h,u);return null==e?null:{location:{pathname:e,search:p,hash:m,state:v,key:g},navigationType:a}}),[u,h,p,m,v,g,a]);return null==_?null:t.createElement(G.Provider,{value:d},t.createElement(Q.Provider,{children:o,value:_}))}function we(e){let{children:t,location:n}=e;return ae(ke(t),n)}new Promise((()=>{}));t.Component;function ke(e,n){void 0===n&&(n=[]);let r=[];return t.Children.forEach(e,((e,o)=>{if(!t.isValidElement(e))return;let i=[...n,o];if(e.type===t.Fragment)return void r.push.apply(r,ke(e.props.children,i));e.type!==_e&&f(!1),e.props.index&&e.props.children&&f(!1);let a={id:e.props.id||i.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=ke(e.props.children,i)),r.push(a)})),r}function xe(){return xe=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function Ae(e){return void 0===e&&(e=""),new URLSearchParams("string"===typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map((e=>[n,e])):[[n,r]])}),[]))}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const Ce=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Ee=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"];try{window.__reactRouterVersion="6"}catch(Au){}const Me=t.createContext({isTransitioning:!1});new Map;const Te=t.startTransition;t.flushSync,t.useId;function Ne(e){let{basename:n,children:r,future:o,window:i}=e,a=t.useRef();null==a.current&&(a.current=function(e){return void 0===e&&(e={}),_((function(e,t){let{pathname:n="/",search:r="",hash:o=""}=y(e.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),v("",{pathname:n,search:r,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"===typeof t?t:g(t))}),(function(e,t){p("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}({window:i,v5Compat:!0}));let l=a.current,[s,c]=t.useState({action:l.action,location:l.location}),{v7_startTransition:u}=o||{},d=t.useCallback((e=>{u&&Te?Te((()=>c(e))):c(e)}),[c,u]);return t.useLayoutEffect((()=>l.listen(d)),[l,d]),t.createElement(be,{basename:n,children:r,location:s.location,navigationType:s.action,navigator:l,future:o})}const Oe="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,Pe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Le=t.forwardRef((function(e,n){let r,{onClick:o,relative:i,reloadDocument:a,replace:l,state:s,target:c,to:u,preventScrollReset:d,unstable_viewTransition:h}=e,p=Se(e,Ce),{basename:m}=t.useContext(G),v=!1;if("string"===typeof u&&Pe.test(u)&&(r=u,Oe))try{let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),n=z(t.pathname,m);t.origin===e.origin&&null!=n?u=n+t.search+t.hash:v=!0}catch(Au){}let y=function(e,n){let{relative:r}=void 0===n?{}:n;ee()||f(!1);let{basename:o,navigator:i}=t.useContext(G),{hash:a,pathname:l,search:s}=ie(e,{relative:r}),c=l;return"/"!==o&&(c="/"===l?o:j([o,l])),i.createHref({pathname:c,search:s,hash:a})}(u,{relative:i}),_=function(e,n){let{target:r,replace:o,state:i,preventScrollReset:a,relative:l,unstable_viewTransition:s}=void 0===n?{}:n,c=re(),u=te(),d=ie(e,{relative:l});return t.useCallback((t=>{if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(t,r)){t.preventDefault();let n=void 0!==o?o:g(u)===g(d);c(e,{replace:n,state:i,preventScrollReset:a,relative:l,unstable_viewTransition:s})}}),[u,c,d,o,i,r,e,a,l,s])}(u,{replace:l,state:s,target:c,preventScrollReset:d,relative:i,unstable_viewTransition:h});return t.createElement("a",xe({},p,{href:r||y,onClick:v||a?o:function(e){o&&o(e),e.defaultPrevented||_(e)},ref:n,target:c}))}));const Re=t.forwardRef((function(e,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:a=!1,style:l,to:s,unstable_viewTransition:c,children:u}=e,d=Se(e,Ee),h=ie(s,{relative:d.relative}),p=te(),m=t.useContext(K),{navigator:v,basename:g}=t.useContext(G),y=null!=m&&function(e,n){void 0===n&&(n={});let r=t.useContext(Me);null==r&&f(!1);let{basename:o}=Ie(ze.useViewTransitionState),i=ie(e,{relative:n.relative});if(!r.isTransitioning)return!1;let a=z(r.currentLocation.pathname,o)||r.currentLocation.pathname,l=z(r.nextLocation.pathname,o)||r.nextLocation.pathname;return null!=L(i.pathname,l)||null!=L(i.pathname,a)}(h)&&!0===c,_=v.encodeLocation?v.encodeLocation(h).pathname:h.pathname,b=p.pathname,w=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;o||(b=b.toLowerCase(),w=w?w.toLowerCase():null,_=_.toLowerCase()),w&&g&&(w=z(w,g)||w);const k="/"!==_&&_.endsWith("/")?_.length-1:_.length;let x,S=b===_||!a&&b.startsWith(_)&&"/"===b.charAt(k),A=null!=w&&(w===_||!a&&w.startsWith(_)&&"/"===w.charAt(_.length)),C={isActive:S,isPending:A,isTransitioning:y},E=S?r:void 0;x="function"===typeof i?i(C):[i,S?"active":null,A?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let M="function"===typeof l?l(C):l;return t.createElement(Le,xe({},d,{"aria-current":E,className:x,ref:n,style:M,to:s,unstable_viewTransition:c}),"function"===typeof u?u(C):u)}));var ze,De;function Ie(e){let n=t.useContext(q);return n||f(!1),n}function $e(e){let n=t.useRef(Ae(e)),r=t.useRef(!1),o=te(),i=t.useMemo((()=>function(e,t){let n=Ae(e);return t&&t.forEach(((e,r)=>{n.has(r)||t.getAll(r).forEach((e=>{n.append(r,e)}))})),n}(o.search,r.current?null:n.current)),[o.search]),a=re(),l=t.useCallback(((e,t)=>{const n=Ae("function"===typeof e?e(i):e);r.current=!0,a("?"+n,t)}),[a,i]);return[i,l]}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ze||(ze={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(De||(De={}));const Fe=()=>{var e;const t=(null===(e=document.getElementById("root"))||void 0===e?void 0:e.dataset.params)||"{}";try{return JSON.parse(t)}catch(Au){return console.error(Au),{}}},je=()=>!!Object.keys(Fe()).length,Ve=/(\/select\/)(\d+|\d.+)(\/)(.+)/,He=e=>{var t;return(null===(t=e.match(Ve))||void 0===t?void 0:t[2])||""};let Ue=function(e){return e.logs="logs",e.anomaly="anomaly",e}({});const Be=(e,t)=>{t?window.localStorage.setItem(e,JSON.stringify({value:t})):Ye([e]),window.dispatchEvent(new Event("storage"))},We=e=>{const t=window.localStorage.getItem(e);if(null!==t)try{var n;return null===(n=JSON.parse(t))||void 0===n?void 0:n.value}catch(Au){return t}},Ye=e=>e.forEach((e=>window.localStorage.removeItem(e))),{REACT_APP_TYPE:Ze}={REACT_APP_TYPE:"logs"};var qe=n(215),Ke=n.n(qe),Ge=n(424),Qe=n.n(Ge);const Je={table:100,chart:20,code:1e3},Xe=(e,t)=>{const n=window.location.hash.split("?")[1],r=Ke().parse(n,{ignoreQueryPrefix:!0});return Qe()(r,e,t||"")};let et=function(e){return e.yhat="yhat",e.yhatUpper="yhat_upper",e.yhatLower="yhat_lower",e.anomaly="vmui_anomalies_points",e.training="vmui_training_data",e.actual="actual",e.anomalyScore="anomaly_score",e}({}),tt=function(e){return e.table="table",e.chart="chart",e.code="code",e}({}),nt=function(e){return e.emptyServer="Please enter Server URL",e.validServer="Please provide a valid Server URL",e.validQuery="Please enter a valid Query and execute it",e.traceNotFound="Not found the tracing information",e.emptyTitle="Please enter title",e.positiveNumber="Please enter positive number",e.validStep="Please enter a valid step",e.unknownType="Unknown server response format: must have 'errorType'",e}({}),rt=function(e){return e.system="system",e.light="light",e.dark="dark",e}({}),ot=function(e){return e.empty="empty",e.metricsql="metricsql",e.label="label",e.labelValue="labelValue",e}({});const it=e=>getComputedStyle(document.documentElement).getPropertyValue("--".concat(e)),at=(e,t)=>{document.documentElement.style.setProperty("--".concat(e),t)},lt=()=>window.matchMedia("(prefers-color-scheme: dark)").matches,st=e=>e.replace(/\/$/,""),ct=Xe("g0.tenantID",""),ut={serverUrl:st((e=>{const{serverURL:t}=Fe(),n=We("SERVER_URL"),r=window.location.href.replace(/\/(select\/)?(vmui)\/.*/,""),o=window.location.href.replace(/\/(?:prometheus\/)?(?:graph|vmui)\/.*/,"/prometheus"),i=t||n||o;return Ze===Ue.logs?r:e?((e,t)=>e.replace(Ve,"$1".concat(t,"/$4")))(i,e):i})(ct)),tenantId:ct,theme:We("THEME")||rt.system,isDarkTheme:null};function dt(e,t){switch(t.type){case"SET_SERVER":return{...e,serverUrl:st(t.payload)};case"SET_TENANT_ID":return{...e,tenantId:t.payload};case"SET_THEME":return Be("THEME",t.payload),{...e,theme:t.payload};case"SET_DARK_THEME":return{...e,isDarkTheme:(n=e.theme,n===rt.system&<()||n===rt.dark)};default:throw new Error}var n}var ht=n(746);var ft=0;Array.isArray;function pt(e,t,n,r,o,i){var a,l,s={};for(l in t)"ref"==l?a=t[l]:s[l]=t[l];var c={type:e,props:s,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--ft,__i:-1,__u:0,__source:o,__self:i};if("function"==typeof e&&(a=e.defaultProps))for(l in a)void 0===s[l]&&(s[l]=a[l]);return ht.fF.vnode&&ht.fF.vnode(c),c}const mt=(0,t.createContext)({}),vt=()=>(0,t.useContext)(mt).state,gt=()=>(0,t.useContext)(mt).dispatch,yt=Object.entries(ut).reduce(((e,t)=>{let[n,r]=t;return{...e,[n]:Xe(n)||r}}),{}),_t="YYYY-MM-DD HH:mm:ss",bt="YYYY-MM-DD[T]HH:mm:ss",wt=window.innerWidth/4,kt=window.innerWidth/40,xt=Intl.supportedValuesOf,St=xt?xt("timeZone"):["Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmera","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/La_Rioja","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Buenos_Aires","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Catamarca","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Coral_Harbour","America/Cordoba","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Fort_Nelson","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indianapolis","America/Inuvik","America/Iqaluit","America/Jamaica","America/Jujuy","America/Juneau","America/Kentucky/Monticello","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Louisville","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Mendoza","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montreal","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port-au-Prince","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Santa_Isabel","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Calcutta","Asia/Chita","Asia/Choibalsan","Asia/Colombo","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Hebron","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Katmandu","Asia/Khandyga","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Rangoon","Asia/Riyadh","Asia/Saigon","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ulaanbaatar","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faeroe","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/Perth","Australia/Sydney","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Johnston","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Ponape","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Truk","Pacific/Wake","Pacific/Wallis"],At=[{long:"years",short:"y",possible:"year"},{long:"weeks",short:"w",possible:"week"},{long:"days",short:"d",possible:"day"},{long:"hours",short:"h",possible:"hour"},{long:"minutes",short:"m",possible:"min"},{long:"seconds",short:"s",possible:"sec"},{long:"milliseconds",short:"ms",possible:"millisecond"}],Ct=At.map((e=>e.short)),Et=e=>{let t=(n=e,Math.round(1e3*n)/1e3);var n;const r=Math.round(e);e>=100&&(t=r-r%10),e<100&&e>=10&&(t=r-r%5),e<10&&e>=1&&(t=r),e<1&&e>.01&&(t=Math.round(40*e)/40);const i=(e=>Lt(o().duration(e,"seconds").asMilliseconds()))(t||.001);return i.replace(/\s/g,"")},Mt=e=>{const t=e.match(/\d+/g),n=e.match(/[a-zA-Z]+/g);if(n&&t&&Ct.includes(n[0]))return{[n[0]]:t[0]}},Tt=(e,t)=>Et(e/(t?kt:wt)),Nt=(e,t)=>{const n=(t||o()().toDate()).valueOf()/1e3,r=(e=>{const t=At.map((e=>e.short)).join("|"),n=new RegExp("\\d+[".concat(t,"]+"),"g"),r=(e.match(n)||[]).reduce(((e,t)=>{const n=Mt(t);return n?{...e,...n}:{...e}}),{});return o().duration(r).asSeconds()})(e);return{start:n-r,end:n,step:Tt(r),date:Ot(t||o()().toDate())}},Ot=e=>o().tz(e).utc().format(bt),Pt=e=>o().tz(e).format(bt),Lt=e=>{const t=Math.floor(e%1e3),n=Math.floor(e/1e3%60),r=Math.floor(e/1e3/60%60),o=Math.floor(e/1e3/3600%24),i=Math.floor(e/864e5),a=["d","h","m","s","ms"],l=[i,o,r,n,t].map(((e,t)=>e?"".concat(e).concat(a[t]):""));return l.filter((e=>e)).join("")},Rt=e=>{const t=o()(1e3*e);return t.isValid()?t.toDate():new Date},zt=[{title:"Last 5 minutes",duration:"5m"},{title:"Last 15 minutes",duration:"15m"},{title:"Last 30 minutes",duration:"30m",isDefault:!0},{title:"Last 1 hour",duration:"1h"},{title:"Last 3 hours",duration:"3h"},{title:"Last 6 hours",duration:"6h"},{title:"Last 12 hours",duration:"12h"},{title:"Last 24 hours",duration:"24h"},{title:"Last 2 days",duration:"2d"},{title:"Last 7 days",duration:"7d"},{title:"Last 30 days",duration:"30d"},{title:"Last 90 days",duration:"90d"},{title:"Last 180 days",duration:"180d"},{title:"Last 1 year",duration:"1y"},{title:"Yesterday",duration:"1d",until:()=>o()().tz().subtract(1,"day").endOf("day").toDate()},{title:"Today",duration:"1d",until:()=>o()().tz().endOf("day").toDate()}].map((e=>({id:e.title.replace(/\s/g,"_").toLocaleLowerCase(),until:e.until?e.until:()=>o()().tz().toDate(),...e}))),Dt=e=>{var t;let{relativeTimeId:n,defaultDuration:r,defaultEndInput:o}=e;const i=null===(t=zt.find((e=>e.isDefault)))||void 0===t?void 0:t.id,a=n||Xe("g0.relative_time",i),l=zt.find((e=>e.id===a));return{relativeTimeId:l?a:"none",duration:l?l.duration:r,endInput:l?l.until():o}},It=e=>{const t=o()().tz(e);return"UTC".concat(t.format("Z"))},$t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=new RegExp(e,"i");return St.reduce(((n,r)=>{const o=(r.match(/^(.*?)\//)||[])[1]||"unknown",i=It(r),a=i.replace(/UTC|0/,""),l=r.replace(/[/_]/g," "),s={region:r,utc:i,search:"".concat(r," ").concat(i," ").concat(l," ").concat(a)},c=!e||e&&t.test(s.search);return c&&n[o]?n[o].push(s):c&&(n[o]=[s]),n}),{})},Ft=e=>{o().tz.setDefault(e)},jt=()=>{const e=o().tz.guess(),t=(e=>{try{return o()().tz(e),!0}catch(Au){return!1}})(e);return{isValid:t,title:t?"Browser Time (".concat(e,")"):"Browser timezone (UTC)",region:t?e:"UTC"}},Vt=We("TIMEZONE")||jt().region;Ft(Vt);const Ht=Xe("g0.range_input"),{duration:Ut,endInput:Bt,relativeTimeId:Wt}=Dt({defaultDuration:Ht||"1h",defaultEndInput:(Yt=Xe("g0.end_input",o()().utc().format(bt)),o()(Yt).utcOffset(0,!0).toDate()),relativeTimeId:Ht?Xe("g0.relative_time","none"):void 0});var Yt;const Zt={duration:Ut,period:Nt(Ut,Bt),relativeTime:Wt,timezone:Vt};function qt(e,t){switch(t.type){case"SET_DURATION":return{...e,duration:t.payload,period:Nt(t.payload,Rt(e.period.end)),relativeTime:"none"};case"SET_RELATIVE_TIME":return{...e,duration:t.payload.duration,period:Nt(t.payload.duration,t.payload.until),relativeTime:t.payload.id};case"SET_PERIOD":const n=(e=>{const t=e.to.valueOf()-e.from.valueOf();return Lt(t)})(t.payload);return{...e,duration:n,period:Nt(n,t.payload.to),relativeTime:"none"};case"RUN_QUERY":const{duration:r,endInput:o}=Dt({relativeTimeId:e.relativeTime,defaultDuration:e.duration,defaultEndInput:Rt(e.period.end)});return{...e,period:Nt(r,o)};case"RUN_QUERY_TO_NOW":return{...e,period:Nt(e.duration)};case"SET_TIMEZONE":return Ft(t.payload),Be("TIMEZONE",t.payload),e.defaultTimezone&&Be("DISABLED_DEFAULT_TIMEZONE",t.payload!==e.defaultTimezone),{...e,timezone:t.payload};case"SET_DEFAULT_TIMEZONE":return{...e,defaultTimezone:t.payload};default:throw new Error}}const Kt=(0,t.createContext)({}),Gt=()=>(0,t.useContext)(Kt).state,Qt=()=>(0,t.useContext)(Kt).dispatch,Jt=e=>{const t=e.map((e=>e.values[e.index])),n=(e=>{const t=We(e);return t?JSON.parse(t):[]})("QUERY_HISTORY");n[0]||(n[0]=[]);const r=n[0];t.forEach((e=>{!r.includes(e)&&e&&r.unshift(e),r.length>100&&r.shift()})),Be("QUERY_HISTORY",JSON.stringify(n))},Xt=50,en=1e3,tn=1e3;const nn=(()=>{var e;const t=(null===(e=(window.location.hash.split("?")[1]||"").match(/g\d+\.expr/g))||void 0===e?void 0:e.length)||1;return new Array(t>4?4:t).fill(1).map(((e,t)=>Xe("g".concat(t,".expr"),"")))})(),rn={query:nn,queryHistory:nn.map((e=>({index:0,values:[e]}))),autocomplete:We("AUTOCOMPLETE")||!1,autocompleteQuick:!1,autocompleteCache:new class{constructor(){this.maxSize=void 0,this.map=void 0,this.maxSize=tn,this.map=new Map}get(e){for(const[t,n]of this.map){const r=JSON.parse(t),o=r.start===e.start&&r.end===e.end,i=r.type===e.type,a=e.value&&r.value&&e.value.includes(r.value),l=r.match===e.match||a,s=n.length=this.maxSize){const e=this.map.keys().next().value;this.map.delete(e)}this.map.set(JSON.stringify(e),t)}},metricsQLFunctions:[]};function on(e,t){switch(t.type){case"SET_QUERY":return{...e,query:t.payload.map((e=>e))};case"SET_QUERY_HISTORY":return Jt(t.payload),{...e,queryHistory:t.payload};case"SET_QUERY_HISTORY_BY_INDEX":return e.queryHistory.splice(t.payload.queryNumber,1,t.payload.value),{...e,queryHistory:e.queryHistory};case"TOGGLE_AUTOCOMPLETE":return Be("AUTOCOMPLETE",!e.autocomplete),{...e,autocomplete:!e.autocomplete};case"SET_AUTOCOMPLETE_QUICK":return{...e,autocompleteQuick:t.payload};case"SET_AUTOCOMPLETE_CACHE":return e.autocompleteCache.put(t.payload.key,t.payload.value),{...e};case"SET_METRICSQL_FUNCTIONS":return{...e,metricsQLFunctions:t.payload};default:throw new Error}}const an=(0,t.createContext)({}),ln=()=>(0,t.useContext)(an).state,sn=()=>(0,t.useContext)(an).dispatch,cn=()=>pt("svg",{viewBox:"0 0 74 24",fill:"currentColor",children:pt("path",{d:"M6.12 10.48c.36.28.8.43 1.26.43h.05c.48 0 .96-.19 1.25-.44 1.5-1.28 5.88-5.29 5.88-5.29C15.73 4.1 12.46 3.01 7.43 3h-.06C2.33 3-.93 4.1.24 5.18c0 0 4.37 4 5.88 5.3Zm2.56 2.16c-.36.28-.8.44-1.26.45h-.04c-.46 0-.9-.17-1.26-.45-1.04-.88-4.74-4.22-6.12-5.5v1.94c0 .21.08.5.22.63l.07.06c1.05.96 4.55 4.16 5.83 5.25.36.28.8.43 1.26.44h.04c.49-.02.96-.2 1.26-.44 1.3-1.11 4.94-4.45 5.88-5.31.15-.14.23-.42.23-.63V7.15a454.94 454.94 0 0 1-6.11 5.5Zm-1.26 4.99c.46 0 .9-.16 1.26-.44a454.4 454.4 0 0 0 6.1-5.5v1.94c0 .2-.07.48-.22.62-.94.87-4.57 4.2-5.88 5.3-.3.26-.77.44-1.26.45h-.04c-.46 0-.9-.16-1.26-.44-1.2-1.02-4.38-3.92-5.62-5.06l-.28-.25c-.14-.14-.22-.42-.22-.62v-1.94c1.38 1.26 5.08 4.6 6.12 5.5.36.28.8.43 1.26.44h.04ZM35 5l-5.84 14.46h-2.43L20.89 5h2.16a.9.9 0 0 1 .9.61l3.41 8.82a18.8 18.8 0 0 1 .62 2.02 19.44 19.44 0 0 1 .57-2.02l3.39-8.82c.05-.15.16-.3.31-.42a.9.9 0 0 1 .58-.19H35Zm17.18 0v14.46H49.8v-9.34c0-.37.02-.78.06-1.21l-4.37 8.21c-.21.4-.53.59-.95.59h-.38c-.43 0-.75-.2-.95-.59L38.8 8.88a22.96 22.96 0 0 1 .07 1.24v9.34H36.5V5h2.03l.3.01c.1 0 .17.02.24.05.07.03.13.07.19.13a1 1 0 0 1 .17.24l4.33 8.03a16.97 16.97 0 0 1 .6 1.36 14.34 14.34 0 0 1 .6-1.38l4.28-8.01c.05-.1.1-.18.17-.24.06-.06.12-.1.19-.13a.9.9 0 0 1 .24-.05l.3-.01h2.04Zm8.88 13.73a4.5 4.5 0 0 0 1.82-.35 3.96 3.96 0 0 0 2.22-2.47c.2-.57.3-1.19.3-1.85V5.31h1.02v8.75c0 .78-.12 1.51-.37 2.19a4.88 4.88 0 0 1-2.76 2.95c-.66.29-1.4.43-2.23.43-.82 0-1.57-.14-2.24-.43a5.01 5.01 0 0 1-2.75-2.95 6.37 6.37 0 0 1-.37-2.19V5.31h1.03v8.74c0 .66.1 1.28.3 1.85a3.98 3.98 0 0 0 2.21 2.47c.53.24 1.14.36 1.82.36Zm10.38.73h-1.03V5.31h1.03v14.15Z"})}),un=()=>pt("svg",{viewBox:"0 0 85 38",fill:"currentColor",children:[pt("path",{d:"M11.12 10.48c.36.28.8.43 1.26.43h.05c.48 0 .96-.19 1.25-.44 1.5-1.28 5.88-5.29 5.88-5.29 1.17-1.09-2.1-2.17-7.13-2.18h-.06c-5.04 0-8.3 1.1-7.13 2.18 0 0 4.37 4 5.88 5.3Zm2.56 2.16c-.36.28-.8.44-1.26.45h-.04c-.46 0-.9-.17-1.26-.45-1.04-.88-4.74-4.22-6.12-5.5v1.94c0 .21.08.5.22.63l.07.06c1.05.96 4.55 4.16 5.83 5.25.36.28.8.43 1.26.44h.04c.49-.02.96-.2 1.26-.44 1.3-1.11 4.94-4.45 5.88-5.31.15-.14.23-.42.23-.63V7.15a455.13 455.13 0 0 1-6.11 5.5Zm-1.26 4.99c.46 0 .9-.16 1.26-.44 2.05-1.82 4.09-3.65 6.1-5.5v1.94c0 .2-.07.48-.22.62-.94.87-4.57 4.2-5.88 5.3-.3.26-.77.44-1.26.45h-.04c-.46 0-.9-.16-1.26-.44-1.2-1.02-4.38-3.92-5.62-5.06l-.28-.25c-.14-.14-.22-.42-.22-.62v-1.94c1.38 1.26 5.08 4.6 6.12 5.5.36.28.8.43 1.26.44h.04ZM40 5l-5.84 14.46h-2.43L25.89 5h2.16a.9.9 0 0 1 .9.61l3.41 8.82a18.8 18.8 0 0 1 .62 2.02 19.44 19.44 0 0 1 .57-2.02l3.39-8.82c.05-.15.16-.3.31-.42a.9.9 0 0 1 .58-.19H40Zm17.18 0v14.46H54.8v-9.34c0-.37.02-.78.06-1.21l-4.37 8.21c-.21.4-.53.59-.95.59h-.38c-.43 0-.75-.2-.95-.59L43.8 8.88a22.96 22.96 0 0 1 .07 1.24v9.34H41.5V5h2.03l.3.01c.1 0 .17.02.24.05.07.03.13.07.19.13a1 1 0 0 1 .17.24l4.33 8.03a16.97 16.97 0 0 1 .6 1.36 14.34 14.34 0 0 1 .6-1.38l4.28-8.01c.05-.1.1-.18.17-.24.06-.06.12-.1.19-.13a.9.9 0 0 1 .24-.05l.3-.01h2.04Zm8.88 13.73a4.5 4.5 0 0 0 1.82-.35 3.96 3.96 0 0 0 2.22-2.47c.2-.57.3-1.19.3-1.85V5.31h1.02v8.75c0 .78-.12 1.51-.37 2.19a4.88 4.88 0 0 1-2.76 2.95c-.66.29-1.4.43-2.23.43-.82 0-1.57-.14-2.24-.43a5.01 5.01 0 0 1-2.75-2.95 6.37 6.37 0 0 1-.37-2.19V5.31h1.03v8.74c0 .66.1 1.28.3 1.85a3.98 3.98 0 0 0 2.21 2.47c.53.24 1.14.36 1.82.36Zm10.38.73h-1.03V5.31h1.03v14.15ZM1.73 36v-5.17l-.67-.07a.6.6 0 0 1-.21-.1.23.23 0 0 1-.08-.18v-.44h.96v-.59c0-.34.05-.65.14-.92a1.79 1.79 0 0 1 1.08-1.11 2.45 2.45 0 0 1 1.62-.02l-.03.53c0 .1-.06.15-.16.16H4c-.18 0-.35.03-.5.08a.95.95 0 0 0-.39.23c-.1.11-.19.25-.25.43-.05.18-.08.4-.08.65v.56h1.75v.78H2.8V36H1.73Zm6.17-6.17c.45 0 .85.07 1.2.22a2.57 2.57 0 0 1 1.5 1.62c.13.38.2.81.2 1.29s-.07.91-.2 1.3a2.57 2.57 0 0 1-1.49 1.61c-.36.14-.76.21-1.2.21-.45 0-.86-.07-1.22-.21a2.57 2.57 0 0 1-1.5-1.62c-.12-.38-.19-.81-.19-1.3 0-.47.07-.9.2-1.28a2.57 2.57 0 0 1 1.5-1.62c.35-.15.76-.22 1.2-.22Zm0 5.42c.6 0 1.05-.2 1.35-.6.3-.4.44-.97.44-1.69s-.15-1.28-.44-1.69c-.3-.4-.75-.6-1.35-.6-.3 0-.57.05-.8.15-.22.1-.4.26-.56.45-.15.2-.26.44-.33.73-.08.28-.11.6-.11.96 0 .72.15 1.29.44 1.69.3.4.76.6 1.36.6Zm5.26-4.11c.2-.42.43-.74.71-.97.28-.24.62-.36 1.03-.36.13 0 .25.02.36.05.12.02.23.07.32.13l-.08.8c-.02.1-.08.15-.18.15l-.24-.04a1.7 1.7 0 0 0-.88.05c-.15.05-.29.14-.4.25-.12.1-.23.24-.32.4-.1.17-.18.35-.26.56V36h-1.07v-6.08h.61c.12 0 .2.02.24.07.05.04.08.12.1.23l.06.92Zm13.73-3.82L23.39 36h-1.46l-3.5-8.68h1.29a.54.54 0 0 1 .54.37l2.04 5.3a11.31 11.31 0 0 1 .37 1.21 11.65 11.65 0 0 1 .35-1.22l2.03-5.29c.03-.1.1-.18.19-.25.1-.08.21-.12.35-.12h1.3Zm2.2 2.52V36H27.6v-6.16h1.49Zm.2-1.79c0 .13-.02.25-.08.36a1 1 0 0 1-.51.5.96.96 0 0 1-.73 0 1.02 1.02 0 0 1-.5-.5.96.96 0 0 1 0-.73.93.93 0 0 1 .86-.58.9.9 0 0 1 .37.08c.12.05.22.11.3.2a.94.94 0 0 1 .3.67Zm5.72 3.1a.68.68 0 0 1-.13.13c-.04.03-.1.05-.18.05a.42.42 0 0 1-.22-.07 3.95 3.95 0 0 0-.62-.31c-.14-.05-.3-.07-.51-.07-.26 0-.5.04-.69.14-.2.1-.36.23-.49.4-.13.18-.22.4-.29.64-.06.25-.1.53-.1.85 0 .33.04.62.1.88.08.25.18.47.32.64.13.18.29.3.48.4.18.09.4.13.63.13a1.6 1.6 0 0 0 .94-.27l.26-.2a.4.4 0 0 1 .25-.09.3.3 0 0 1 .27.14l.43.54a2.76 2.76 0 0 1-1.77.96c-.22.03-.43.05-.65.05a2.57 2.57 0 0 1-1.96-.83c-.25-.28-.45-.6-.6-1-.14-.4-.21-.85-.21-1.35 0-.45.06-.87.2-1.25a2.61 2.61 0 0 1 1.51-1.67c.37-.16.8-.24 1.28-.24.46 0 .86.07 1.2.22.35.15.66.36.94.64l-.4.54Zm3.43 4.95c-.54 0-.95-.15-1.24-.45-.28-.3-.42-.73-.42-1.26v-3.44h-.63a.29.29 0 0 1-.2-.07c-.06-.06-.09-.13-.09-.24v-.59l.99-.16.31-1.68a.33.33 0 0 1 .12-.18.34.34 0 0 1 .21-.07h.77v1.94h1.64v1.05h-1.64v3.34c0 .2.05.34.14.45.1.1.22.16.39.16a.73.73 0 0 0 .39-.1l.12-.07a.2.2 0 0 1 .11-.03c.05 0 .08.01.11.03l.09.1.44.72c-.21.18-.46.32-.74.4-.28.1-.57.15-.87.15Zm5.09-6.35c.46 0 .87.07 1.24.22a2.7 2.7 0 0 1 1.58 1.63c.14.39.22.83.22 1.31 0 .49-.08.93-.22 1.32-.14.4-.35.73-.62 1-.26.28-.58.49-.96.64-.37.15-.78.22-1.24.22a3.4 3.4 0 0 1-1.25-.22 2.71 2.71 0 0 1-1.59-1.64 3.8 3.8 0 0 1-.21-1.32c0-.48.07-.92.21-1.31a2.75 2.75 0 0 1 1.58-1.63c.38-.15.8-.22 1.26-.22Zm0 5.2c.51 0 .89-.17 1.13-.52.25-.34.38-.84.38-1.5a2.6 2.6 0 0 0-.38-1.53c-.24-.34-.62-.52-1.13-.52-.52 0-.9.18-1.16.53-.25.35-.37.85-.37 1.51s.12 1.17.37 1.51c.25.35.64.52 1.16.52Zm5.56-4.04c.2-.37.42-.65.69-.86.26-.21.57-.32.94-.32.28 0 .5.06.68.19l-.1 1.1a.3.3 0 0 1-.09.16.24.24 0 0 1-.15.04 1.8 1.8 0 0 1-.27-.03 2.01 2.01 0 0 0-.34-.03c-.16 0-.3.03-.44.08a1.1 1.1 0 0 0-.34.2c-.1.1-.2.2-.27.33-.08.13-.15.27-.22.44V36H47.7v-6.16h.87c.15 0 .26.03.31.09.06.05.1.15.13.29l.09.7Zm4.62-1.07V36h-1.49v-6.16h1.49Zm.2-1.79c0 .13-.02.25-.07.36a1 1 0 0 1-.51.5.96.96 0 0 1-.74 0 1.02 1.02 0 0 1-.5-.5.96.96 0 0 1 0-.73.93.93 0 0 1 .86-.58.9.9 0 0 1 .38.08c.11.05.21.11.3.2a.94.94 0 0 1 .28.67Zm4.56 5.32a7.8 7.8 0 0 0-1.08.12c-.29.05-.52.12-.7.2a.92.92 0 0 0-.38.3.64.64 0 0 0-.11.36c0 .26.07.45.23.56.15.11.35.17.6.17.3 0 .57-.06.79-.17.22-.1.44-.28.65-.5v-1.04Zm-3.4-2.67c.71-.65 1.57-.97 2.56-.97.36 0 .68.06.97.18a1.99 1.99 0 0 1 1.16 1.24c.1.3.16.61.16.96V36h-.67a.7.7 0 0 1-.33-.06c-.07-.04-.13-.13-.18-.26l-.13-.44c-.16.14-.3.26-.46.37a2.8 2.8 0 0 1-.97.43 2.77 2.77 0 0 1-1.32-.05 1.62 1.62 0 0 1-.57-.31 1.41 1.41 0 0 1-.38-.53 1.85 1.85 0 0 1-.05-1.18c.05-.16.14-.3.25-.45.12-.14.28-.27.46-.4a3 3 0 0 1 .7-.32 9.19 9.19 0 0 1 2.2-.33v-.36c0-.41-.09-.71-.26-.91-.18-.2-.43-.3-.76-.3a1.84 1.84 0 0 0-1.02.28l-.33.18c-.1.06-.2.09-.32.09-.1 0-.2-.03-.27-.08a.72.72 0 0 1-.17-.2l-.26-.47Zm11.49 4.32V36h-4.88v-8.6h1.16v7.62h3.72Zm3.16-5.2c.44 0 .84.08 1.2.23a2.57 2.57 0 0 1 1.49 1.62c.13.38.2.81.2 1.29s-.07.91-.2 1.3a2.57 2.57 0 0 1-1.49 1.61c-.36.14-.76.21-1.2.21-.45 0-.85-.07-1.21-.21a2.57 2.57 0 0 1-1.5-1.62c-.13-.38-.2-.81-.2-1.3 0-.47.07-.9.2-1.28.14-.39.33-.72.59-1 .25-.26.55-.47.9-.62.37-.15.77-.22 1.22-.22Zm0 5.43c.6 0 1.05-.2 1.34-.6.3-.4.45-.97.45-1.69s-.15-1.28-.45-1.69c-.3-.4-.74-.6-1.34-.6-.3 0-.57.05-.8.15-.22.1-.4.26-.56.45-.15.2-.26.44-.34.73-.07.28-.1.6-.1.96 0 .72.14 1.29.44 1.69.3.4.75.6 1.36.6Zm6.33-2.22c.22 0 .4-.03.57-.09.16-.06.3-.14.41-.25.12-.11.2-.24.26-.39.05-.15.08-.31.08-.5 0-.37-.11-.66-.34-.88-.23-.22-.55-.33-.98-.33-.43 0-.76.1-.99.33-.22.22-.34.51-.34.89 0 .18.03.34.09.5a1.1 1.1 0 0 0 .67.63c.16.06.35.09.57.09Zm1.93 3.3a.51.51 0 0 0-.13-.36.84.84 0 0 0-.34-.22 8.57 8.57 0 0 0-1.73-.2 7.5 7.5 0 0 1-.62-.05c-.23.1-.41.23-.56.4a.8.8 0 0 0-.1.92c.07.12.18.22.32.3.14.1.32.16.54.21a3.5 3.5 0 0 0 1.55 0c.23-.05.42-.12.57-.22.16-.1.29-.21.37-.34a.8.8 0 0 0 .13-.44Zm1.08-6.17v.4c0 .13-.08.21-.25.25l-.69.09c.14.26.2.56.2.88a1.86 1.86 0 0 1-1.36 1.82 3.07 3.07 0 0 1-1.72.04c-.12.08-.22.16-.29.25a.44.44 0 0 0-.1.27c0 .15.06.26.17.33.12.08.28.13.47.16a5 5 0 0 0 .66.06 16.56 16.56 0 0 1 1.5.13c.26.05.48.12.67.22.19.1.34.24.46.41.12.18.18.4.18.69 0 .26-.07.5-.2.75s-.31.46-.56.65c-.24.2-.54.34-.9.46a4.57 4.57 0 0 1-2.36.04c-.33-.09-.6-.2-.82-.36a1.56 1.56 0 0 1-.5-.51c-.1-.2-.16-.4-.16-.6 0-.3.1-.56.28-.77.19-.2.45-.37.77-.5a1.15 1.15 0 0 1-.43-.32.88.88 0 0 1-.15-.54c0-.09.01-.18.04-.27.04-.1.08-.2.15-.28a1.55 1.55 0 0 1 .58-.5c-.3-.16-.53-.39-.7-.66-.17-.28-.25-.6-.25-.97 0-.3.05-.57.16-.8.12-.25.28-.46.48-.63.2-.17.45-.3.73-.4a3 3 0 0 1 2.3.21h1.64Zm4.65.76a.24.24 0 0 1-.23.14.42.42 0 0 1-.2-.07 3.59 3.59 0 0 0-.67-.3 1.8 1.8 0 0 0-1.03 0c-.14.05-.27.11-.37.2a.87.87 0 0 0-.23.27.75.75 0 0 0-.08.35c0 .15.04.28.13.39.1.1.21.19.36.27.15.07.32.14.5.2a13.63 13.63 0 0 1 1.16.4c.2.08.36.18.5.3a1.33 1.33 0 0 1 .5 1.07 2 2 0 0 1-.15.78c-.1.24-.25.44-.45.62-.2.17-.43.3-.72.4a3.1 3.1 0 0 1-2.14-.05 2.97 2.97 0 0 1-.87-.53l.25-.41c.04-.05.07-.1.12-.12a.3.3 0 0 1 .17-.04.4.4 0 0 1 .22.08l.3.19a1.91 1.91 0 0 0 1.03.27c.2 0 .38-.03.54-.08.16-.06.29-.13.4-.22a.96.96 0 0 0 .3-.7c0-.17-.05-.31-.14-.42-.09-.11-.2-.2-.36-.28a2.6 2.6 0 0 0-.5-.2l-.59-.19c-.2-.06-.39-.14-.58-.22a2.14 2.14 0 0 1-.5-.3 1.45 1.45 0 0 1-.36-.46c-.1-.19-.14-.41-.14-.67a1.6 1.6 0 0 1 .57-1.23c.18-.16.4-.3.68-.39.26-.1.57-.14.91-.14a2.84 2.84 0 0 1 1.9.7l-.23.4Z"}),pt("defs",{children:pt("path",{d:"M0 0h85v38H0z"})})]}),dn=()=>pt("svg",{viewBox:"0 0 85 38",fill:"currentColor",children:pt("path",{d:"M11.118 10.476c.36.28.801.433 1.257.436h.052c.48-.007.961-.192 1.25-.444 1.509-1.279 5.88-5.287 5.88-5.287 1.168-1.087-2.093-2.174-7.13-2.181h-.06c-5.036.007-8.298 1.094-7.13 2.181 0 0 4.372 4.008 5.88 5.295zm2.559 2.166c-.359.283-.801.439-1.258.444h-.044a2.071 2.071 0 0 1-1.257-.444C10.082 11.755 6.384 8.42 5 7.148v1.93c0 .215.081.496.222.629l.07.064c1.045.955 4.546 4.154 5.825 5.245.358.283.8.438 1.257.444h.044c.489-.015.962-.2 1.258-.444 1.309-1.11 4.948-4.444 5.887-5.31.148-.132.222-.413.222-.628v-1.93a455.127 455.127 0 0 1-6.11 5.494zm-1.258 4.984a2.071 2.071 0 0 0 1.258-.436c2.053-1.815 4.09-3.65 6.11-5.502v1.938c0 .207-.075.488-.223.621-.94.873-4.578 4.2-5.887 5.31-.296.25-.77.436-1.258.443h-.044a2.071 2.071 0 0 1-1.257-.436c-1.204-1.027-4.376-3.928-5.616-5.062l-.28-.255c-.14-.133-.221-.414-.221-.621v-1.938c1.383 1.265 5.081 4.607 6.117 5.495.358.282.8.438 1.257.443h.044zM40 5l-5.84 14.46h-2.43L25.89 5h2.16c.233 0 .423.057.57.17.146.113.256.26.33.44l3.41 8.82c.113.287.22.603.32.95.106.34.206.697.3 1.07.08-.373.166-.73.26-1.07a8.84 8.84 0 0 1 .31-.95l3.39-8.82a.959.959 0 0 1 .31-.42.906.906 0 0 1 .58-.19H40zm17.176 0v14.46h-2.37v-9.34c0-.373.02-.777.06-1.21l-4.37 8.21c-.206.393-.523.59-.95.59h-.38c-.426 0-.743-.197-.95-.59l-4.42-8.24c.02.22.037.437.05.65.014.213.02.41.02.59v9.34h-2.37V5h2.03c.12 0 .224.003.31.01a.778.778 0 0 1 .23.05c.074.027.137.07.19.13.06.06.117.14.17.24l4.33 8.03c.114.213.217.433.31.66.1.227.197.46.29.7.094-.247.19-.483.29-.71.1-.233.207-.457.32-.67l4.27-8.01c.054-.1.11-.18.17-.24a.57.57 0 0 1 .19-.13.903.903 0 0 1 .24-.05c.087-.007.19-.01.31-.01h2.03zm8.887 13.73c.68 0 1.286-.117 1.82-.35.54-.24.996-.57 1.37-.99a4.28 4.28 0 0 0 .85-1.48c.2-.573.3-1.19.3-1.85V5.31h1.02v8.75c0 .78-.124 1.51-.37 2.19a5.248 5.248 0 0 1-1.07 1.77c-.46.5-1.024.893-1.69 1.18-.66.287-1.404.43-2.23.43-.827 0-1.574-.143-2.24-.43a5.012 5.012 0 0 1-1.69-1.18 5.33 5.33 0 0 1-1.06-1.77 6.373 6.373 0 0 1-.37-2.19V5.31h1.03v8.74c0 .66.096 1.277.29 1.85.2.567.483 1.06.85 1.48.373.42.826.75 1.36.99.54.24 1.15.36 1.83.36zm10.38.73h-1.03V5.31h1.03v14.15zM4.242 35v-5.166l-.672-.078a.595.595 0 0 1-.21-.09.23.23 0 0 1-.078-.186v-.438h.96v-.588c0-.348.048-.656.144-.924.1-.272.24-.5.42-.684a1.79 1.79 0 0 1 .66-.426c.256-.096.544-.144.864-.144.272 0 .522.04.75.12l-.024.534c-.008.096-.062.148-.162.156a4.947 4.947 0 0 1-.39.012c-.184 0-.352.024-.504.072a.949.949 0 0 0-.384.234c-.108.108-.192.25-.252.426a2.184 2.184 0 0 0-.084.654v.558h1.752v.774H5.316V35H4.242zM10.416 28.826a3.1 3.1 0 0 1 1.2.222c.356.148.66.358.912.63s.444.602.576.99c.136.384.204.814.204 1.29 0 .48-.068.912-.204 1.296a2.735 2.735 0 0 1-.576.984 2.572 2.572 0 0 1-.912.63 3.175 3.175 0 0 1-1.2.216c-.448 0-.852-.072-1.212-.216a2.572 2.572 0 0 1-.912-.63 2.805 2.805 0 0 1-.582-.984 3.972 3.972 0 0 1-.198-1.296c0-.476.066-.906.198-1.29.136-.388.33-.718.582-.99.252-.272.556-.482.912-.63.36-.148.764-.222 1.212-.222zm0 5.424c.6 0 1.048-.2 1.344-.6.296-.404.444-.966.444-1.686 0-.724-.148-1.288-.444-1.692-.296-.404-.744-.606-1.344-.606-.304 0-.57.052-.798.156a1.507 1.507 0 0 0-.564.45c-.148.196-.26.438-.336.726a3.941 3.941 0 0 0-.108.966c0 .72.148 1.282.444 1.686.3.4.754.6 1.362.6zM15.677 30.14c.192-.416.428-.74.708-.972.28-.236.622-.354 1.026-.354.128 0 .25.014.366.042.12.028.226.072.318.132l-.078.798c-.024.1-.084.15-.18.15-.056 0-.138-.012-.246-.036a1.694 1.694 0 0 0-.366-.036c-.192 0-.364.028-.516.084-.148.056-.282.14-.402.252a1.782 1.782 0 0 0-.318.408c-.092.16-.176.344-.252.552V35h-1.074v-6.078h.612c.116 0 .196.022.24.066.044.044.074.12.09.228l.072.924zM26.761 28.922 24.283 35h-.96l-2.478-6.078h.87a.33.33 0 0 1 .33.222l1.542 3.912c.048.148.09.292.126.432.036.14.07.28.102.42.032-.14.066-.28.102-.42.036-.14.08-.284.132-.432l1.56-3.912a.33.33 0 0 1 .12-.156.311.311 0 0 1 .198-.066h.834zM27.74 35v-6.078h.643c.152 0 .246.074.282.222l.078.624c.224-.276.476-.502.756-.678.28-.176.604-.264.972-.264.408 0 .738.114.99.342.256.228.44.536.552.924.088-.22.2-.41.336-.57a1.987 1.987 0 0 1 1.014-.624c.196-.048.394-.072.594-.072.32 0 .604.052.852.156.252.1.464.248.636.444.176.196.31.438.402.726.092.284.138.61.138.978V35H34.91v-3.87c0-.476-.104-.836-.312-1.08-.208-.248-.508-.372-.9-.372-.176 0-.344.032-.504.096-.156.06-.294.15-.414.27-.12.12-.216.272-.288.456-.068.18-.102.39-.102.63V35h-1.074v-3.87c0-.488-.098-.852-.294-1.092-.196-.24-.482-.36-.858-.36-.264 0-.508.072-.732.216a2.38 2.38 0 0 0-.618.576V35H27.74zM40.746 32.372c-.428.02-.788.058-1.08.114-.292.052-.526.12-.702.204a.923.923 0 0 0-.378.294.639.639 0 0 0-.114.366c0 .26.076.446.228.558.156.112.358.168.606.168.304 0 .566-.054.786-.162.224-.112.442-.28.654-.504v-1.038zm-3.396-2.67c.708-.648 1.56-.972 2.556-.972.36 0 .682.06.966.18.284.116.524.28.72.492.196.208.344.458.444.75.104.292.156.612.156.96V35h-.672a.708.708 0 0 1-.324-.06c-.076-.044-.136-.13-.18-.258l-.132-.444c-.156.14-.308.264-.456.372a2.804 2.804 0 0 1-.462.264c-.16.072-.332.126-.516.162-.18.04-.38.06-.6.06-.26 0-.5-.034-.72-.102a1.618 1.618 0 0 1-.57-.318 1.414 1.414 0 0 1-.372-.522 1.852 1.852 0 0 1-.132-.726 1.419 1.419 0 0 1 .33-.906c.12-.14.274-.272.462-.396s.418-.232.69-.324c.276-.092.596-.166.96-.222.364-.06.78-.096 1.248-.108v-.36c0-.412-.088-.716-.264-.912-.176-.2-.43-.3-.762-.3-.24 0-.44.028-.6.084-.156.056-.294.12-.414.192l-.33.186a.631.631 0 0 1-.324.084.439.439 0 0 1-.264-.078.716.716 0 0 1-.174-.192l-.264-.474zM44.974 29.6c.124-.124.254-.238.39-.342a2.395 2.395 0 0 1 .936-.444c.176-.044.368-.066.576-.066.336 0 .634.058.894.174.26.112.476.272.648.48.176.204.308.45.396.738.092.284.138.598.138.942V35H47.47v-3.918c0-.376-.086-.666-.258-.87-.172-.208-.434-.312-.786-.312-.256 0-.496.058-.72.174a2.58 2.58 0 0 0-.636.474V35h-1.482v-6.156h.906c.192 0 .318.09.378.27l.102.486zM53.085 28.748c.456 0 .87.074 1.242.222a2.692 2.692 0 0 1 1.578 1.626c.144.392.216.83.216 1.314 0 .488-.072.928-.216 1.32-.144.392-.35.726-.618 1.002a2.653 2.653 0 0 1-.96.636 3.333 3.333 0 0 1-1.242.222c-.46 0-.878-.074-1.254-.222a2.712 2.712 0 0 1-.966-.636 2.922 2.922 0 0 1-.618-1.002 3.807 3.807 0 0 1-.216-1.32c0-.484.072-.922.216-1.314.148-.392.354-.724.618-.996.268-.272.59-.482.966-.63a3.397 3.397 0 0 1 1.254-.222zm0 5.202c.512 0 .89-.172 1.134-.516.248-.344.372-.848.372-1.512s-.124-1.17-.372-1.518c-.244-.348-.622-.522-1.134-.522-.52 0-.906.176-1.158.528-.248.348-.372.852-.372 1.512s.124 1.164.372 1.512c.252.344.638.516 1.158.516zM57.252 35v-6.156h.906c.192 0 .318.09.378.27l.096.456c.108-.12.22-.23.336-.33a2.017 2.017 0 0 1 1.32-.492c.388 0 .706.106.954.318.252.208.44.486.564.834a1.93 1.93 0 0 1 .834-.882c.172-.092.354-.16.546-.204.196-.044.392-.066.588-.066.34 0 .642.052.906.156.264.104.486.256.666.456.18.2.316.444.408.732.096.288.144.618.144.99V35h-1.482v-3.918c0-.392-.086-.686-.258-.882-.172-.2-.424-.3-.756-.3-.152 0-.294.026-.426.078a1.026 1.026 0 0 0-.342.228 1.019 1.019 0 0 0-.228.366 1.435 1.435 0 0 0-.084.51V35h-1.488v-3.918c0-.412-.084-.712-.252-.9-.164-.188-.406-.282-.726-.282-.216 0-.418.054-.606.162a1.979 1.979 0 0 0-.516.432V35h-1.482zM70.558 32.372c-.428.02-.788.058-1.08.114-.292.052-.526.12-.702.204a.923.923 0 0 0-.378.294.639.639 0 0 0-.114.366c0 .26.076.446.228.558.156.112.358.168.606.168.304 0 .566-.054.786-.162.224-.112.442-.28.654-.504v-1.038zm-3.396-2.67c.708-.648 1.56-.972 2.556-.972.36 0 .682.06.966.18.284.116.524.28.72.492.196.208.344.458.444.75.104.292.156.612.156.96V35h-.672a.708.708 0 0 1-.324-.06c-.076-.044-.136-.13-.18-.258l-.132-.444c-.156.14-.308.264-.456.372a2.804 2.804 0 0 1-.462.264c-.16.072-.332.126-.516.162-.18.04-.38.06-.6.06-.26 0-.5-.034-.72-.102a1.618 1.618 0 0 1-.57-.318 1.414 1.414 0 0 1-.372-.522 1.852 1.852 0 0 1-.132-.726 1.419 1.419 0 0 1 .33-.906c.12-.14.274-.272.462-.396s.418-.232.69-.324c.276-.092.596-.166.96-.222.364-.06.78-.096 1.248-.108v-.36c0-.412-.088-.716-.264-.912-.176-.2-.43-.3-.762-.3-.24 0-.44.028-.6.084-.156.056-.294.12-.414.192l-.33.186a.631.631 0 0 1-.324.084.439.439 0 0 1-.264-.078.716.716 0 0 1-.174-.192l-.264-.474zM74.9 26.084V35h-1.482v-8.916H74.9zM81.969 28.844l-3.354 7.848a.538.538 0 0 1-.174.234c-.068.056-.174.084-.318.084h-1.104l1.152-2.472-2.49-5.694h1.302c.116 0 .206.028.27.084.068.056.118.12.15.192l1.308 3.192c.044.108.08.216.108.324.032.108.062.218.09.33a32.3 32.3 0 0 1 .108-.33c.036-.112.076-.222.12-.33l1.236-3.186a.437.437 0 0 1 .408-.276h1.188z"})}),hn=()=>pt("svg",{viewBox:"0 0 15 17",fill:"currentColor",children:pt("path",{d:"M6.11767 7.47586C6.47736 7.75563 6.91931 7.90898 7.37503 7.91213H7.42681C7.90756 7.90474 8.38832 7.71987 8.67677 7.46846C10.1856 6.18921 14.5568 2.18138 14.5568 2.18138C15.7254 1.09438 12.4637 0.00739 7.42681 0H7.36764C2.3308 0.00739 -0.930935 1.09438 0.237669 2.18138C0.237669 2.18138 4.60884 6.18921 6.11767 7.47586ZM8.67677 9.64243C8.31803 9.92483 7.87599 10.0808 7.41941 10.0861H7.37503C6.91845 10.0808 6.47641 9.92483 6.11767 9.64243C5.0822 8.75513 1.38409 5.42018 0.000989555 4.14832V6.07829C0.000989555 6.29273 0.0823481 6.57372 0.222877 6.70682L0.293316 6.7712L0.293344 6.77122C1.33784 7.72579 4.83903 10.9255 6.11767 12.0161C6.47641 12.2985 6.91845 12.4545 7.37503 12.4597H7.41941C7.90756 12.4449 8.38092 12.2601 8.67677 12.0161C9.9859 10.9069 13.6249 7.57198 14.5642 6.70682C14.7121 6.57372 14.7861 6.29273 14.7861 6.07829V4.14832C12.7662 5.99804 10.7297 7.82949 8.67677 9.64243ZM7.41941 14.6263C7.87513 14.6232 8.31708 14.4698 8.67677 14.19C10.7298 12.3746 12.7663 10.5407 14.7861 8.68853V10.6259C14.7861 10.8329 14.7121 11.1139 14.5642 11.247C13.6249 12.1196 9.9859 15.4471 8.67677 16.5563C8.38092 16.8077 7.90756 16.9926 7.41941 17H7.37503C6.91931 16.9968 6.47736 16.8435 6.11767 16.5637C4.91427 15.5373 1.74219 12.6364 0.502294 11.5025C0.393358 11.4029 0.299337 11.3169 0.222877 11.247C0.0823481 11.1139 0.000989555 10.8329 0.000989555 10.6259V8.68853C1.38409 9.95303 5.0822 13.2953 6.11767 14.1827C6.47641 14.4651 6.91845 14.6211 7.37503 14.6263H7.41941Z"})}),fn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"})}),pn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}),mn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8zm-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91z"})}),vn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),gn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),yn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),_n=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}),bn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z"})}),wn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})}),kn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"m7 10 5 5 5-5z"})}),xn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:[pt("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),pt("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),Sn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V8h16v13z"})}),An=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"m22 5.72-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM7.88 3.39 6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM12.5 8H11v6l4.75 2.85.75-1.23-4-2.37V8zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"})}),Cn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-9 3h2v2h-2V8zm0 3h2v2h-2v-2zM8 8h2v2H8V8zm0 3h2v2H8v-2zm-1 2H5v-2h2v2zm0-3H5V8h2v2zm9 7H8v-2h8v2zm0-4h-2v-2h2v2zm0-3h-2V8h2v2zm3 3h-2v-2h2v2zm0-3h-2V8h2v2z"})}),En=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M8 5v14l11-7z"})}),Mn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"m3.5 18.49 6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"})}),Tn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M10 10.02h5V21h-5zM17 21h3c1.1 0 2-.9 2-2v-9h-5v11zm3-18H5c-1.1 0-2 .9-2 2v3h19V5c0-1.1-.9-2-2-2zM3 19c0 1.1.9 2 2 2h3V10H3v9z"})}),Nn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"})}),On=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M8.9999 14.7854L18.8928 4.8925C19.0803 4.70497 19.3347 4.59961 19.5999 4.59961C19.8651 4.59961 20.1195 4.70497 20.307 4.8925L21.707 6.2925C22.0975 6.68303 22.0975 7.31619 21.707 7.70672L9.70701 19.7067C9.31648 20.0972 8.68332 20.0972 8.2928 19.7067L2.6928 14.1067C2.50526 13.9192 2.3999 13.6648 2.3999 13.3996C2.3999 13.1344 2.50526 12.88 2.6928 12.6925L4.0928 11.2925C4.48332 10.902 5.11648 10.902 5.50701 11.2925L8.9999 14.7854Z"})}),Pn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})}),Ln=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),Rn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M20 9H4v2h16V9zM4 15h16v-2H4v2z"})}),zn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:[pt("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21 5C19.89 4.65 18.67 4.5 17.5 4.5C15.55 4.5 13.45 4.9 12 6C10.55 4.9 8.45 4.5 6.5 4.5C5.33 4.5 4.11 4.65 3 5C2.25 5.25 1.6 5.55 1 6V20.6C1 20.85 1.25 21.1 1.5 21.1C1.6 21.1 1.65 21.1 1.75 21.05C3.15 20.3 4.85 20 6.5 20C8.2 20 10.65 20.65 12 21.5C13.35 20.65 15.8 20 17.5 20C19.15 20 20.85 20.3 22.25 21.05C22.35 21.1 22.4 21.1 22.5 21.1C22.75 21.1 23 20.85 23 20.6V6C22.4 5.55 21.75 5.25 21 5ZM21 18.5C19.9 18.15 18.7 18 17.5 18C15.8 18 13.35 18.65 12 19.5C10.65 18.65 8.2 18 6.5 18C5.3 18 4.1 18.15 3 18.5V7C4.1 6.65 5.3 6.5 6.5 6.5C8.2 6.5 10.65 7.15 12 8C13.35 7.15 15.8 6.5 17.5 6.5C18.7 6.5 19.9 6.65 21 7V18.5Z"}),pt("path",{d:"M17.5 10.5C18.38 10.5 19.23 10.59 20 10.76V9.24C19.21 9.09 18.36 9 17.5 9C15.8 9 14.26 9.29 13 9.83V11.49C14.13 10.85 15.7 10.5 17.5 10.5ZM13 12.49V14.15C14.13 13.51 15.7 13.16 17.5 13.16C18.38 13.16 19.23 13.25 20 13.42V11.9C19.21 11.75 18.36 11.66 17.5 11.66C15.8 11.66 14.26 11.96 13 12.49ZM17.5 14.33C15.8 14.33 14.26 14.62 13 15.16V16.82C14.13 16.18 15.7 15.83 17.5 15.83C18.38 15.83 19.23 15.92 20 16.09V14.57C19.21 14.41 18.36 14.33 17.5 14.33Z"}),pt("path",{d:"M6.5 10.5C5.62 10.5 4.77 10.59 4 10.76V9.24C4.79 9.09 5.64 9 6.5 9C8.2 9 9.74 9.29 11 9.83V11.49C9.87 10.85 8.3 10.5 6.5 10.5ZM11 12.49V14.15C9.87 13.51 8.3 13.16 6.5 13.16C5.62 13.16 4.77 13.25 4 13.42V11.9C4.79 11.75 5.64 11.66 6.5 11.66C8.2 11.66 9.74 11.96 11 12.49ZM6.5 14.33C8.2 14.33 9.74 14.62 11 15.16V16.82C9.87 16.18 8.3 15.83 6.5 15.83C5.62 15.83 4.77 15.92 4 16.09V14.57C4.79 14.41 5.64 14.33 6.5 14.33Z"})]}),Dn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3-8c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3 3 1.34 3 3z"})}),In=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M4 20h16c1.1 0 2-.9 2-2s-.9-2-2-2H4c-1.1 0-2 .9-2 2s.9 2 2 2zm0-3h2v2H4v-2zM2 6c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2s-.9-2-2-2H4c-1.1 0-2 .9-2 2zm4 1H4V5h2v2zm-2 7h16c1.1 0 2-.9 2-2s-.9-2-2-2H4c-1.1 0-2 .9-2 2s.9 2 2 2zm0-3h2v2H4v-2z"})}),$n=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),Fn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M7 20h4c0 1.1-.9 2-2 2s-2-.9-2-2zm-2-1h8v-2H5v2zm11.5-9.5c0 3.82-2.66 5.86-3.77 6.5H5.27c-1.11-.64-3.77-2.68-3.77-6.5C1.5 5.36 4.86 2 9 2s7.5 3.36 7.5 7.5zm4.87-2.13L20 8l1.37.63L22 10l.63-1.37L24 8l-1.37-.63L22 6l-.63 1.37zM19 6l.94-2.06L22 3l-2.06-.94L19 0l-.94 2.06L16 3l2.06.94L19 6z"})}),jn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M3 14h4v-4H3v4zm0 5h4v-4H3v4zM3 9h4V5H3v4zm5 5h13v-4H8v4zm0 5h13v-4H8v4zM8 5v4h13V5H8z"})}),Vn=()=>pt("svg",{viewBox:"0 0 16 16",fill:it("color-error"),children:pt("path",{d:"M13.5095 4L8.50952 1H7.50952L2.50952 4L2.01953 4.85999V10.86L2.50952 11.71L7.50952 14.71H8.50952L13.5095 11.71L13.9995 10.86V4.85999L13.5095 4ZM7.50952 13.5601L3.00952 10.86V5.69995L7.50952 8.15002V13.5601ZM3.26953 4.69995L8.00952 1.85999L12.7495 4.69995L8.00952 7.29004L3.26953 4.69995ZM13.0095 10.86L8.50952 13.5601V8.15002L13.0095 5.69995V10.86Z"})}),Hn=()=>pt("svg",{viewBox:"0 0 16 16",fill:it("color-primary"),children:pt("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5H4V4H1.5L1 4.5V12.5L1.5 13H4V12H2V5ZM14.5 4H12V5H14V12H12V13H14.5L15 12.5V4.5L14.5 4ZM11.76 6.56995L12 7V9.51001L11.7 9.95996L7.19995 11.96H6.73999L4.23999 10.46L4 10.03V7.53003L4.30005 7.06995L8.80005 5.06995H9.26001L11.76 6.56995ZM5 9.70996L6.5 10.61V9.28003L5 8.38V9.70996ZM5.57996 7.56006L7.03003 8.43005L10.42 6.93005L8.96997 6.06006L5.57996 7.56006ZM7.53003 10.73L11.03 9.17004V7.77002L7.53003 9.31995V10.73Z"})}),Un=()=>pt("svg",{viewBox:"0 0 16 16",fill:it("color-warning"),children:pt("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 2H8L7 3V6H8V3H14V8H10V9H14L15 8V3L14 2ZM9 6H13V7H9.41L9 6.59V6ZM7 7H2L1 8V13L2 14H8L9 13V8L8 7H7ZM8 13H2V8H8V9V13ZM3 9H7V10H3V9ZM3 11H7V12H3V11ZM9 4H13V5H9V4Z"})}),Bn=()=>pt("svg",{viewBox:"0 0 16 16",fill:it("color-primary"),children:pt("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 3L8 2H14L15 3V8L14 9H10V8H14V3H8V6H7V3ZM9 9V8L8 7H7H2L1 8V13L2 14H8L9 13V9ZM8 8V9V13H2V8H7H8ZM9.41421 7L9 6.58579V6H13V7H9.41421ZM9 4H13V5H9V4ZM7 10H3V11H7V10Z"})});var Wn=n(738),Yn=n.n(Wn);const Zn=e=>{let{to:t,isNavLink:n,children:r,...o}=e;return n?pt(Re,{to:t,...o,children:r}):pt("div",{...o,children:r})},qn=e=>{let{activeItem:t,item:n,color:r=it("color-primary"),activeNavRef:o,onChange:i,isNavLink:a}=e;return pt(Zn,{className:Yn()({"vm-tabs-item":!0,"vm-tabs-item_active":t===n.value,[n.className||""]:n.className}),isNavLink:a,to:n.value,style:{color:r},onClick:(l=n.value,()=>{i&&i(l)}),ref:t===n.value?o:void 0,children:[n.icon&&pt("div",{className:Yn()({"vm-tabs-item__icon":!0,"vm-tabs-item__icon_single":!n.label}),children:n.icon}),n.label]});var l},Kn="undefined"!==typeof window?t.useLayoutEffect:t.useEffect;const Gn=function(e,n,r,o){const i=(0,t.useRef)(n);Kn((()=>{i.current=n}),[n]),(0,t.useEffect)((()=>{var t;const n=null!==(t=null===r||void 0===r?void 0:r.current)&&void 0!==t?t:window;if(!n||!n.addEventListener)return;const a=e=>i.current(e);return n.addEventListener(e,a,o),()=>{n.removeEventListener(e,a,o)}}),[e,r,o])},Qn=()=>{const[e,n]=(0,t.useState)({width:0,height:0}),r=()=>{n({width:window.innerWidth,height:window.innerHeight})};return Gn("resize",r),Kn(r,[]),e},Jn=e=>{let{activeItem:n,items:r,color:o=it("color-primary"),onChange:i,indicatorPlacement:a="bottom",isNavLink:l}=e;const s=Qn(),c=(0,t.useRef)(null),[u,d]=(0,t.useState)({left:0,width:0,bottom:0});return(0,t.useEffect)((()=>{var e;if((null===(e=c.current)||void 0===e?void 0:e.base)instanceof HTMLElement){const{offsetLeft:e,offsetWidth:t,offsetHeight:n}=c.current.base;d({left:e,width:t,bottom:"top"===a?n-2:0})}}),[s,n,c,r]),pt("div",{className:"vm-tabs",children:[r.map((e=>pt(qn,{activeItem:n,item:e,onChange:i,color:o,activeNavRef:c,isNavLink:l},e.value))),pt("div",{className:"vm-tabs__indicator",style:{...u,borderColor:o}})]})},Xn=[{value:tt.chart,icon:pt(Mn,{}),label:"Graph",prometheusCode:0},{value:tt.code,icon:pt(Nn,{}),label:"JSON",prometheusCode:3},{value:tt.table,icon:pt(Tn,{}),label:"Table",prometheusCode:1}],er=Xe("g0.tab",0),tr=Xn.find((e=>e.prometheusCode===+er||e.value===er)),nr=We("SERIES_LIMITS"),rr={displayType:(null===tr||void 0===tr?void 0:tr.value)||tt.chart,nocache:!1,isTracingEnabled:!1,seriesLimits:nr?JSON.parse(nr):Je,tableCompact:We("TABLE_COMPACT")||!1};function or(e,t){switch(t.type){case"SET_DISPLAY_TYPE":return{...e,displayType:t.payload};case"SET_SERIES_LIMITS":return Be("SERIES_LIMITS",JSON.stringify(t.payload)),{...e,seriesLimits:t.payload};case"TOGGLE_QUERY_TRACING":return{...e,isTracingEnabled:!e.isTracingEnabled};case"TOGGLE_NO_CACHE":return{...e,nocache:!e.nocache};case"TOGGLE_TABLE_COMPACT":return Be("TABLE_COMPACT",!e.tableCompact),{...e,tableCompact:!e.tableCompact};default:throw new Error}}const ir=(0,t.createContext)({}),ar={customStep:Xe("g0.step_input",""),yaxis:{limits:{enable:!1,range:{1:[0,0]}}},isHistogram:!1,spanGaps:!1};function lr(e,t){switch(t.type){case"TOGGLE_ENABLE_YAXIS_LIMITS":return{...e,yaxis:{...e.yaxis,limits:{...e.yaxis.limits,enable:!e.yaxis.limits.enable}}};case"SET_CUSTOM_STEP":return{...e,customStep:t.payload};case"SET_YAXIS_LIMITS":return{...e,yaxis:{...e.yaxis,limits:{...e.yaxis.limits,range:t.payload}}};case"SET_IS_HISTOGRAM":return{...e,isHistogram:t.payload};case"SET_SPAN_GAPS":return{...e,spanGaps:t.payload};default:throw new Error}}const sr=(0,t.createContext)({}),cr={windows:"Windows",mac:"Mac OS",linux:"Linux"},ur=()=>(Object.values(cr).find((e=>navigator.userAgent.indexOf(e)>=0))||"unknown")===cr.mac;function dr(){const e=Qn(),n=()=>{const e=["Android","webOS","iPhone","iPad","iPod","BlackBerry","Windows Phone"].map((e=>navigator.userAgent.match(new RegExp(e,"i")))).some((e=>e)),t=window.innerWidth<500;return e||t},[r,o]=(0,t.useState)(n());return(0,t.useEffect)((()=>{o(n())}),[e]),{isMobile:r}}const hr={success:pt(_n,{}),error:pt(yn,{}),warning:pt(gn,{}),info:pt(vn,{})},fr=e=>{let{variant:t,children:n}=e;const{isDarkTheme:r}=vt(),{isMobile:o}=dr();return pt("div",{className:Yn()({"vm-alert":!0,["vm-alert_".concat(t)]:t,"vm-alert_dark":r,"vm-alert_mobile":o}),children:[pt("div",{className:"vm-alert__icon",children:hr[t||"info"]}),pt("div",{className:"vm-alert__content",children:n})]})},pr=(0,t.createContext)({showInfoMessage:()=>{}}),mr={dashboardsSettings:[],dashboardsLoading:!1,dashboardsError:""};function vr(e,t){switch(t.type){case"SET_DASHBOARDS_SETTINGS":return{...e,dashboardsSettings:t.payload};case"SET_DASHBOARDS_LOADING":return{...e,dashboardsLoading:t.payload};case"SET_DASHBOARDS_ERROR":return{...e,dashboardsError:t.payload};default:throw new Error}}const gr=(0,t.createContext)({}),yr=function(){for(var e=arguments.length,t=new Array(e),n=0;nn=>{let{children:r}=n;return pt(e,{children:pt(t,{children:r})})}),(e=>{let{children:t}=e;return pt(ht.FK,{children:t})}))}(...[e=>{let{children:n}=e;const[r,o]=(0,t.useReducer)(dt,yt),i=(0,t.useMemo)((()=>({state:r,dispatch:o})),[r,o]);return pt(mt.Provider,{value:i,children:n})},e=>{let{children:n}=e;const[r,o]=(0,t.useReducer)(qt,Zt),i=(0,t.useMemo)((()=>({state:r,dispatch:o})),[r,o]);return pt(Kt.Provider,{value:i,children:n})},e=>{let{children:n}=e;const[r,o]=(0,t.useReducer)(on,rn),i=(0,t.useMemo)((()=>({state:r,dispatch:o})),[r,o]);return pt(an.Provider,{value:i,children:n})},e=>{let{children:n}=e;const[r,o]=(0,t.useReducer)(or,rr),i=(0,t.useMemo)((()=>({state:r,dispatch:o})),[r,o]);return pt(ir.Provider,{value:i,children:n})},e=>{let{children:n}=e;const[r,o]=(0,t.useReducer)(lr,ar),i=(0,t.useMemo)((()=>({state:r,dispatch:o})),[r,o]);return pt(sr.Provider,{value:i,children:n})},e=>{let{children:n}=e;const{isMobile:r}=dr(),[o,i]=(0,t.useState)({}),[a,l]=(0,t.useState)(!1),[s,c]=(0,t.useState)(void 0);(0,t.useEffect)((()=>{if(!s)return;i({message:s.text,variant:s.type,key:Date.now()}),l(!0);const e=setTimeout(u,4e3);return()=>clearTimeout(e)}),[s]);const u=()=>{c(void 0),l(!1)};return pt(pr.Provider,{value:{showInfoMessage:c},children:[a&&pt("div",{className:Yn()({"vm-snackbar":!0,"vm-snackbar_mobile":r}),children:pt(fr,{variant:o.variant,children:pt("div",{className:"vm-snackbar-content",children:[pt("span",{children:o.message}),pt("div",{className:"vm-snackbar-content__close",onClick:u,children:pt(pn,{})})]})})}),n]})},e=>{let{children:n}=e;const[r,o]=(0,t.useReducer)(vr,mr),i=(0,t.useMemo)((()=>({state:r,dispatch:o})),[r,o]);return pt(gr.Provider,{value:i,children:n})}]),_r=(et.yhatUpper,et.yhatLower,et.yhat,et.anomaly,et.anomalyScore,et.actual,et.training,"rgba(".concat((e=>{if(7!=e.length)return"0, 0, 0";const t=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16);return"".concat(t,", ").concat(n,", ").concat(r)})("#203ea9"),", 0.2)"),{"color-primary":"#589DF6","color-secondary":"#316eca","color-error":"#e5534b","color-warning":"#c69026","color-info":"#539bf5","color-success":"#57ab5a","color-background-body":"#22272e","color-background-block":"#2d333b","color-background-tooltip":"rgba(22, 22, 22, 0.8)","color-text":"#cdd9e5","color-text-secondary":"#768390","color-text-disabled":"#636e7b","box-shadow":"rgba(0, 0, 0, 0.16) 1px 2px 6px","box-shadow-popper":"rgba(0, 0, 0, 0.2) 0px 2px 8px 0px","border-divider":"1px solid rgba(99, 110, 123, 0.5)","color-hover-black":"rgba(0, 0, 0, 0.12)"}),br={"color-primary":"#3F51B5","color-secondary":"#E91E63","color-error":"#FD080E","color-warning":"#FF8308","color-info":"#03A9F4","color-success":"#4CAF50","color-background-body":"#FEFEFF","color-background-block":"#FFFFFF","color-background-tooltip":"rgba(80,80,80,0.9)","color-text":"#110f0f","color-text-secondary":"#706F6F","color-text-disabled":"#A09F9F","box-shadow":"rgba(0, 0, 0, 0.08) 1px 2px 6px","box-shadow-popper":"rgba(0, 0, 0, 0.1) 0px 2px 8px 0px","border-divider":"1px solid rgba(0, 0, 0, 0.15)","color-hover-black":"rgba(0, 0, 0, 0.06)"},wr=()=>{const[e,n]=(0,t.useState)(lt()),r=e=>{n(e.matches)};return(0,t.useEffect)((()=>{const e=window.matchMedia("(prefers-color-scheme: dark)");return e.addEventListener("change",r),()=>e.removeEventListener("change",r)}),[]),e},kr=["primary","secondary","error","warning","info","success"],xr=e=>{let{onLoaded:n}=e;const r=je(),{palette:o={}}=Fe(),{theme:i}=vt(),a=wr(),l=gt(),s=Qn(),[c,u]=(0,t.useState)({[rt.dark]:_r,[rt.light]:br,[rt.system]:lt()?_r:br}),d=()=>{const{innerWidth:e,innerHeight:t}=window,{clientWidth:n,clientHeight:r}=document.documentElement;at("scrollbar-width","".concat(e-n,"px")),at("scrollbar-height","".concat(t-r,"px")),at("vh","".concat(.01*t,"px"))},h=()=>{kr.forEach(((e,t)=>{const r=(e=>{let t=e.replace("#","").trim();if(3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6!==t.length)throw new Error("Invalid HEX color.");return(299*parseInt(t.slice(0,2),16)+587*parseInt(t.slice(2,4),16)+114*parseInt(t.slice(4,6),16))/1e3>=128?"#000000":"#FFFFFF"})(it("color-".concat(e)));at("".concat(e,"-text"),r),t===kr.length-1&&(l({type:"SET_DARK_THEME"}),n(!0))}))},f=()=>{const e=We("THEME")||rt.system,t=c[e];Object.entries(t).forEach((e=>{let[t,n]=e;at(t,n)})),h(),r&&(kr.forEach((e=>{const t=o[e];t&&at("color-".concat(e),t)})),h())};return(0,t.useEffect)((()=>{d(),f()}),[c]),(0,t.useEffect)(d,[s]),(0,t.useEffect)((()=>{const e=lt()?_r:br;c[rt.system]!==e?u((t=>({...t,[rt.system]:e}))):f()}),[i,a]),(0,t.useEffect)((()=>{r&&l({type:"SET_THEME",payload:rt.light})}),[]),null},Sr=()=>{const{showInfoMessage:e}=(0,t.useContext)(pr);return async(t,n)=>{var r;if(null===(r=navigator)||void 0===r||!r.clipboard)return e({text:"Clipboard not supported",type:"error"}),console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(t),n&&e({text:n,type:"success"}),!0}catch(o){return o instanceof Error&&e({text:"".concat(o.name,": ").concat(o.message),type:"error"}),console.warn("Copy failed",o),!1}}},Ar=e=>{let{variant:t="contained",color:n="primary",size:r="medium",ariaLabel:o,children:i,endIcon:a,startIcon:l,fullWidth:s=!1,className:c,disabled:u,onClick:d,onMouseDown:h}=e;return pt("button",{className:Yn()({"vm-button":!0,["vm-button_".concat(t,"_").concat(n)]:!0,["vm-button_".concat(r)]:r,"vm-button_icon":(l||a)&&!i,"vm-button_full-width":s,"vm-button_with-icon":l||a,"vm-button_disabled":u,[c||""]:c}),disabled:u,"aria-label":o,onClick:d,onMouseDown:h,children:pt(ht.FK,{children:[l&&pt("span",{className:"vm-button__start-icon",children:l}),i&&pt("span",{children:i}),a&&pt("span",{className:"vm-button__end-icon",children:a})]})})},Cr=e=>{let{data:n}=e;const r=Sr(),o=(0,t.useMemo)((()=>JSON.stringify(n,null,2)),[n]);return pt("div",{className:"vm-json-view",children:[pt("div",{className:"vm-json-view__copy",children:pt(Ar,{variant:"outlined",onClick:async()=>{await r(o,"Formatted JSON has been copied")},children:"Copy JSON"})}),pt("pre",{className:"vm-json-view__code",children:pt("code",{children:o})})]})},Er=(e,n)=>{const[r]=$e(),o=r.get(n)?r.get(n):e,[i,a]=(0,t.useState)(o);return(0,t.useEffect)((()=>{o!==i&&a(o)}),[o]),[i,a]},Mr=()=>{const e=re(),[n,r]=$e();return{setSearchParamsFromKeys:(0,t.useCallback)((t=>{const o=!!Array.from(n.values()).length;let i=!1;Object.entries(t).forEach((e=>{let[t,r]=e;n.get(t)!=="".concat(r)&&(n.set(t,"".concat(r)),i=!0)})),i&&(o?r(n):e("?".concat(n.toString()),{replace:!0}))}),[n,e])}},Tr=(e,n,r)=>{const o=(0,t.useCallback)((t=>{const o=null===e||void 0===e?void 0:e.current,i=t.target,a=(null===r||void 0===r?void 0:r.current)&&r.current.contains(i);!o||o.contains((null===t||void 0===t?void 0:t.target)||null)||a||n(t)}),[e,n]);Gn("mousedown",o),Gn("touchstart",o)},Nr=e=>{let{children:n,buttonRef:r,placement:o="bottom-left",open:i=!1,onClose:a,offset:l={top:6,left:0},clickOutside:s=!0,fullWidth:c,title:u,disabledFullScreen:d,variant:h}=e;const{isMobile:f}=dr(),p=re(),m=te(),[v,g]=(0,t.useState)({width:0,height:0}),[y,_]=(0,t.useState)(!1),b=(0,t.useRef)(null);(0,t.useEffect)((()=>(_(i),!i&&a&&a(),i&&f&&!d&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow="auto"})),[i]),(0,t.useEffect)((()=>{var e,t;g({width:(null===b||void 0===b||null===(e=b.current)||void 0===e?void 0:e.clientWidth)||0,height:(null===b||void 0===b||null===(t=b.current)||void 0===t?void 0:t.clientHeight)||0}),_(!1)}),[b]);const w=(0,t.useMemo)((()=>{const e=r.current;if(!e||!y)return{};const t=e.getBoundingClientRect(),n={top:0,left:0,width:"auto"},i="bottom-right"===o||"top-right"===o,a=null===o||void 0===o?void 0:o.includes("top"),s=(null===l||void 0===l?void 0:l.top)||0,u=(null===l||void 0===l?void 0:l.left)||0;n.left=n.left=t.left+u,n.top=t.height+t.top+s,i&&(n.left=t.right-v.width),a&&(n.top=t.top-v.height-s);const{innerWidth:d,innerHeight:h}=window,f=n.top+v.height+20>h,p=n.top-20<0,m=n.left+v.width+20>d,g=n.left-20<0;return f&&(n.top=t.top-v.height-s),p&&(n.top=t.height+t.top+s),m&&(n.left=t.right-v.width-u),g&&(n.left=t.left+u),c&&(n.width="".concat(t.width,"px")),n.top<0&&(n.top=20),n.left<0&&(n.left=20),n}),[r,o,y,n,c]),k=()=>{_(!1),a()};(0,t.useEffect)((()=>{if(!b.current||!y||f&&!d)return;const{right:e,width:t}=b.current.getBoundingClientRect();if(e>window.innerWidth){const e=window.innerWidth-20-t;b.current.style.left=e{y&&f&&!d&&(p(m,{replace:!0}),a())}),[y,f,d,m,a]);return Gn("scroll",k),Gn("popstate",x),Tr(b,(()=>{s&&k()}),r),pt(ht.FK,{children:(y||!v.width)&&t.default.createPortal(pt("div",{className:Yn()({"vm-popper":!0,["vm-popper_".concat(h)]:h,"vm-popper_mobile":f&&!d,"vm-popper_open":(f||Object.keys(w).length)&&y}),ref:b,style:f&&!d?{}:w,children:[(u||f&&!d)&&pt("div",{className:"vm-popper-header",children:[pt("p",{className:"vm-popper-header__title",children:u}),pt(Ar,{variant:"text",color:"dark"===h?"white":"primary",size:"small",onClick:e=>{e.stopPropagation(),a()},ariaLabel:"close",children:pt(pn,{})})]}),n]}),document.body)})},Or=e=>{let{checked:t=!1,disabled:n=!1,label:r,color:o="secondary",onChange:i}=e;return pt("div",{className:Yn()({"vm-checkbox":!0,"vm-checkbox_disabled":n,"vm-checkbox_active":t,["vm-checkbox_".concat(o,"_active")]:t,["vm-checkbox_".concat(o)]:o}),onClick:()=>{n||i(!t)},children:[pt("div",{className:"vm-checkbox-track",children:pt("div",{className:"vm-checkbox-track__thumb",children:pt(On,{})})}),r&&pt("span",{className:"vm-checkbox__label",children:r})]})},Pr=e=>{let{children:n,title:r,open:o,placement:i="bottom-center",offset:a={top:6,left:0}}=e;const{isMobile:l}=dr(),[s,c]=(0,t.useState)(!1),[u,d]=(0,t.useState)({width:0,height:0}),h=(0,t.useRef)(null),f=(0,t.useRef)(null),p=()=>c(!1);(0,t.useEffect)((()=>{if(f.current&&s)return d({width:f.current.clientWidth,height:f.current.clientHeight}),window.addEventListener("scroll",p),()=>{window.removeEventListener("scroll",p)}}),[s,r]);const m=(0,t.useMemo)((()=>{var e;const t=null===h||void 0===h||null===(e=h.current)||void 0===e?void 0:e.base;if(!t||!s)return{};const n=t.getBoundingClientRect(),r={top:0,left:0},o="bottom-right"===i||"top-right"===i,l="bottom-left"===i||"top-left"===i,c=null===i||void 0===i?void 0:i.includes("top"),d=(null===a||void 0===a?void 0:a.top)||0,f=(null===a||void 0===a?void 0:a.left)||0;r.left=n.left-(u.width-n.width)/2+f,r.top=n.height+n.top+d,o&&(r.left=n.right-u.width),l&&(r.left=n.left+f),c&&(r.top=n.top-u.height-d);const{innerWidth:p,innerHeight:m}=window,v=r.top+u.height+20>m,g=r.top-20<0,y=r.left+u.width+20>p,_=r.left-20<0;return v&&(r.top=n.top-u.height-d),g&&(r.top=n.height+n.top+d),y&&(r.left=n.right-u.width-f),_&&(r.left=n.left+f),r.top<0&&(r.top=20),r.left<0&&(r.left=20),r}),[h,i,s,u]),v=()=>{"boolean"!==typeof o&&c(!0)},g=()=>{c(!1)};return(0,t.useEffect)((()=>{"boolean"===typeof o&&c(o)}),[o]),(0,t.useEffect)((()=>{var e;const t=null===h||void 0===h||null===(e=h.current)||void 0===e?void 0:e.base;if(t)return t.addEventListener("mouseenter",v),t.addEventListener("mouseleave",g),()=>{t.removeEventListener("mouseenter",v),t.removeEventListener("mouseleave",g)}}),[h]),pt(ht.FK,{children:[pt(t.Fragment,{ref:h,children:n}),!l&&s&&t.default.createPortal(pt("div",{className:"vm-tooltip",ref:f,style:m,children:r}),document.body)]})},Lr=e=>{let{value:t=!1,disabled:n=!1,label:r,color:o="secondary",fullWidth:i,onChange:a}=e;return pt("div",{className:Yn()({"vm-switch":!0,"vm-switch_full-width":i,"vm-switch_disabled":n,"vm-switch_active":t,["vm-switch_".concat(o,"_active")]:t,["vm-switch_".concat(o)]:o}),onClick:()=>{n||a(!t)},children:[pt("div",{className:"vm-switch-track",children:pt("div",{className:"vm-switch-track__thumb"})}),r&&pt("span",{className:"vm-switch__label",children:r})]})};const Rr=e=>{const[n,r]=(0,t.useState)(!!e),o=(0,t.useCallback)((()=>r(!0)),[]),i=(0,t.useCallback)((()=>r(!1)),[]),a=(0,t.useCallback)((()=>r((e=>!e))),[]);return{value:n,setValue:r,setTrue:o,setFalse:i,toggle:a}},zr="Table settings",Dr=e=>{let{columns:n,defaultColumns:r=[],tableCompact:o,onChangeColumns:i,toggleTableCompact:a}=e;const{isMobile:l}=dr(),s=(0,t.useRef)(null),{value:c,toggle:u,setFalse:d}=Rr(!1),h=(0,t.useMemo)((()=>!n.length),[n]),f=e=>()=>{(e=>{i(r.includes(e)?r.filter((t=>t!==e)):[...r,e])})(e)};return(0,t.useEffect)((()=>{((e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n])))(n,r)||i(n)}),[n]),pt("div",{className:"vm-table-settings",children:[pt(Pr,{title:zr,children:pt("div",{ref:s,children:pt(Ar,{variant:"text",startIcon:pt(fn,{}),onClick:u,disabled:h,ariaLabel:"table settings"})})}),pt(Nr,{open:c,onClose:d,placement:"bottom-right",buttonRef:s,title:zr,children:pt("div",{className:Yn()({"vm-table-settings-popper":!0,"vm-table-settings-popper_mobile":l}),children:[pt("div",{className:"vm-table-settings-popper-list vm-table-settings-popper-list_first",children:pt(Lr,{label:"Compact view",value:o,onChange:a})}),pt("div",{className:"vm-table-settings-popper-list",children:[pt("div",{className:"vm-table-settings-popper-list-header",children:[pt("h3",{className:"vm-table-settings-popper-list-header__title",children:"Display columns"}),pt(Pr,{title:"Reset to default",children:pt(Ar,{color:"primary",variant:"text",size:"small",onClick:()=>{d(),i(n)},startIcon:pt(mn,{}),ariaLabel:"reset columns"})})]}),n.map((e=>pt("div",{className:"vm-table-settings-popper-list__item",children:pt(Or,{checked:r.includes(e),onChange:f(e),label:e,disabled:o})},e)))]})]})})]})},Ir=["date","timestamp","time"];function $r(e,t,n){const r=e[n],i=t[n],a=Ir.includes("".concat(n))?o()("".concat(r)).unix():r,l=Ir.includes("".concat(n))?o()("".concat(i)).unix():i;return la?1:0}const Fr=e=>{let{rows:n,columns:r,defaultOrderBy:o,copyToClipboard:i,paginationOffset:a}=e;const[l,s]=(0,t.useState)(o),[c,u]=(0,t.useState)("desc"),[d,h]=(0,t.useState)(null),f=(0,t.useMemo)((()=>{const{startIndex:e,endIndex:t}=a;return function(e,t){const n=e.map(((e,t)=>[e,t]));return n.sort(((e,n)=>{const r=t(e[0],n[0]);return 0!==r?r:e[1]-n[1]})),n.map((e=>e[0]))}(n,function(e,t){return"desc"===e?(e,n)=>$r(e,n,t):(e,n)=>-$r(e,n,t)}(c,l)).slice(e,t)}),[n,l,c,a]),p=(e,t)=>async()=>{if(d!==t)try{await navigator.clipboard.writeText(String(e)),h(t)}catch(Au){console.error(Au)}};return(0,t.useEffect)((()=>{if(null===d)return;const e=setTimeout((()=>h(null)),2e3);return()=>clearTimeout(e)}),[d]),pt("table",{className:"vm-table",children:[pt("thead",{className:"vm-table-header",children:pt("tr",{className:"vm-table__row vm-table__row_header",children:[r.map((e=>{return pt("th",{className:"vm-table-cell vm-table-cell_header vm-table-cell_sort",onClick:(t=e.key,()=>{u((e=>"asc"===e&&l===t?"desc":"asc")),s(t)}),children:pt("div",{className:"vm-table-cell__content",children:[pt("div",{children:String(e.title||e.key)}),pt("div",{className:Yn()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":l===e.key,"vm-table__sort-icon_desc":"desc"===c&&l===e.key}),children:pt(kn,{})})]})},String(e.key));var t})),i&&pt("th",{className:"vm-table-cell vm-table-cell_header"})]})}),pt("tbody",{className:"vm-table-body",children:f.map(((e,t)=>pt("tr",{className:"vm-table__row",children:[r.map((t=>pt("td",{className:Yn()({"vm-table-cell":!0,["".concat(t.className)]:t.className}),children:e[t.key]||"-"},String(t.key)))),i&&pt("td",{className:"vm-table-cell vm-table-cell_right",children:e[i]&&pt("div",{className:"vm-table-cell__content",children:pt(Pr,{title:d===t?"Copied":"Copy row",children:pt(Ar,{variant:"text",color:d===t?"success":"gray",size:"small",startIcon:pt(d===t?On:Ln,{}),onClick:p(e[i],t),ariaLabel:"copy row"})})})})]},t)))})]})},jr=e=>{let{logs:n,displayColumns:r,tableCompact:o,columns:i}=e;const a=e=>{switch(e){case"time":return"vm-table-cell_logs-time";case"data":return"vm-table-cell_logs vm-table-cell_pre";default:return"vm-table-cell_logs"}},l=(0,t.useMemo)((()=>o?[{key:"data",title:"Data",className:a("data")}]:i.map((e=>({key:e,title:e,className:a(e)})))),[o,i]),s=(0,t.useMemo)((()=>null===r||void 0===r||!r.length||o?l:l.filter((e=>r.includes(e.key)))),[l,r,o]);return pt(ht.FK,{children:pt(Fr,{rows:n,columns:s,defaultOrderBy:"time",copyToClipboard:"data",paginationOffset:{startIndex:0,endIndex:1/0}})})},Vr=e=>{let{defaultExpanded:n=!1,onChange:r,title:o,children:i}=e;const[a,l]=(0,t.useState)(n);return(0,t.useEffect)((()=>{r&&r(a)}),[a]),pt(ht.FK,{children:[pt("header",{className:"vm-accordion-header ".concat(a&&"vm-accordion-header_open"),onClick:()=>{l((e=>!e))},children:[o,pt("div",{className:"vm-accordion-header__arrow ".concat(a&&"vm-accordion-header__arrow_open"),children:pt(wn,{})})]}),a&&pt("section",{className:"vm-accordion-section",children:i},"content")]})},Hr=e=>{let{logs:n,columns:r}=e;const o=(0,t.useMemo)((()=>{const e=["_msg","time","data","_time"],t=r.filter((t=>!e.includes(t)));return function(e,t){const n=e.reduce(((e,n)=>{const r=t.map((e=>"".concat(e,": ").concat(n[e]||"-"))).join("|");return(e[r]=e[r]||[]).push(n),e}),{});return Object.entries(n).map((e=>{let[t,n]=e;return{keys:t.split("|"),values:n}}))}(n,t)}),[n]);return pt("div",{className:"vm-explore-logs-body-content",children:o.map((e=>pt("div",{className:"vm-explore-logs-body-content-group",children:pt(Vr,{defaultExpanded:!0,title:pt("div",{className:"vm-explore-logs-body-content-group-keys",children:[pt("span",{className:"vm-explore-logs-body-content-group-keys__title",children:"Group by:"}),e.keys.map((e=>pt("div",{className:"vm-explore-logs-body-content-group-keys__key",children:e},e)))]}),children:pt("div",{className:"vm-explore-logs-body-content-group-rows",children:e.values.map((e=>pt("div",{className:"vm-explore-logs-body-content-group-rows-item",children:[pt("div",{className:"vm-explore-logs-body-content-group-rows-item__time",children:e.time}),pt("div",{className:"vm-explore-logs-body-content-group-rows-item__msg",children:e._msg})]},"".concat(e._msg).concat(e._time))))})})},e.keys.join(""))))})};var Ur=function(e){return e.group="group",e.table="table",e.json="json",e}(Ur||{});const Br=[{label:"Group",value:Ur.group,icon:pt(jn,{})},{label:"Table",value:Ur.table,icon:pt(Tn,{})},{label:"JSON",value:Ur.json,icon:pt(Nn,{})}],Wr=e=>{let{data:n,loaded:r}=e;const{isMobile:i}=dr(),{timezone:a}=Gt(),{setSearchParamsFromKeys:l}=Mr(),[s,c]=Er(Ur.group,"view"),[u,d]=(0,t.useState)([]),{value:h,toggle:f}=Rr(!1),p=(0,t.useMemo)((()=>n.map((e=>({time:o()(e._time).tz().format("MMM DD, YYYY \nHH:mm:ss.SSS"),data:JSON.stringify(e,null,2),...e})))),[n,a]),m=(0,t.useMemo)((()=>{if(null===p||void 0===p||!p.length)return[];const e=["data","_time"],t=new Set;for(const n of p)for(const e in n)t.add(e);return Array.from(t).filter((t=>!e.includes(t)))}),[p]);return pt("div",{className:Yn()({"vm-explore-logs-body":!0,"vm-block":!0,"vm-block_mobile":i}),children:[pt("div",{className:Yn()({"vm-explore-logs-body-header":!0,"vm-section-header":!0,"vm-explore-logs-body-header_mobile":i}),children:[pt("div",{className:"vm-section-header__tabs",children:pt(Jn,{activeItem:String(s),items:Br,onChange:e=>{c(e),l({view:e})}})}),s===Ur.table&&pt("div",{className:"vm-explore-logs-body-header__settings",children:pt(Dr,{columns:m,defaultColumns:u,onChangeColumns:d,tableCompact:h,toggleTableCompact:f})})]}),pt("div",{className:Yn()({"vm-explore-logs-body__table":!0,"vm-explore-logs-body__table_mobile":i}),children:[!n.length&&pt("div",{className:"vm-explore-logs-body__empty",children:r?"No logs found":"Run query to see logs"}),!!n.length&&pt(ht.FK,{children:[s===Ur.table&&pt(jr,{logs:p,displayColumns:u,tableCompact:h,columns:m}),s===Ur.group&&pt(Hr,{logs:p,columns:m}),s===Ur.json&&pt(Cr,{data:n})]})]})]})},Yr=e=>{let{containerStyles:t={},message:n}=e;const{isDarkTheme:r}=vt();return pt("div",{className:Yn()({"vm-spinner":!0,"vm-spinner_dark":r}),style:t&&{},children:[pt("div",{className:"half-circle-spinner",children:[pt("div",{className:"circle circle-1"}),pt("div",{className:"circle circle-2"})]}),n&&pt("div",{className:"vm-spinner__message",children:n})]})},Zr=e=>{let{error:n,warning:r,info:o}=e;const i=(0,t.useRef)(null),[a,l]=(0,t.useState)(!1),[s,c]=(0,t.useState)(!1),u=(0,t.useMemo)((()=>n?"ERROR: ":r?"WARNING: ":""),[n,r]),d="".concat(u).concat(n||r||o),h=()=>{const e=i.current;if(e){const{offsetWidth:t,scrollWidth:n,offsetHeight:r,scrollHeight:o}=e;l(t+1{c(!1),h()}),[i,d]),Gn("resize",h),n||r||o?pt("span",{className:Yn()({"vm-text-field__error":!0,"vm-text-field__warning":r&&!n,"vm-text-field__helper-text":!r&&!n,"vm-text-field__error_overflowed":a,"vm-text-field__error_full":s}),"data-show":!!d,ref:i,onClick:()=>{a&&(c(!0),l(!1))},children:d}):null},qr=e=>{let{label:n,value:r,type:o="text",error:i="",warning:a="",helperText:l="",placeholder:s,endIcon:c,startIcon:u,disabled:d=!1,autofocus:h=!1,inputmode:f="text",onChange:p,onEnter:m,onKeyDown:v,onFocus:g,onBlur:y,onChangeCaret:_}=e;const{isDarkTheme:b}=vt(),{isMobile:w}=dr(),k=(0,t.useRef)(null),x=(0,t.useRef)(null),S=(0,t.useMemo)((()=>"textarea"===o?x:k),[o]),A=Yn()({"vm-text-field__input":!0,"vm-text-field__input_error":i,"vm-text-field__input_warning":!i&&a,"vm-text-field__input_icon-start":u,"vm-text-field__input_disabled":d,"vm-text-field__input_textarea":"textarea"===o}),C=e=>{const{selectionStart:t,selectionEnd:n}=e;_&&_([t||0,n||0])},E=e=>{C(e.currentTarget)},M=e=>{v&&v(e);const{key:t,ctrlKey:n,metaKey:r}=e,i="Enter"===t;("textarea"!==o?i:i&&(r||n))&&m&&(e.preventDefault(),m())},T=e=>{C(e.currentTarget)},N=e=>{d||(p&&p(e.currentTarget.value),C(e.currentTarget))};(0,t.useEffect)((()=>{var e;h&&!w&&(null===S||void 0===S||null===(e=S.current)||void 0===e?void 0:e.focus)&&S.current.focus()}),[S,h]);const O=()=>{g&&g()},P=()=>{y&&y()};return pt("label",{className:Yn()({"vm-text-field":!0,"vm-text-field_textarea":"textarea"===o,"vm-text-field_dark":b}),"data-replicated-value":r,children:[u&&pt("div",{className:"vm-text-field__icon-start",children:u}),c&&pt("div",{className:"vm-text-field__icon-end",children:c}),"textarea"===o?pt("textarea",{className:A,disabled:d,ref:x,value:r,rows:1,inputMode:f,placeholder:s,autoCapitalize:"none",onInput:N,onKeyDown:M,onKeyUp:T,onFocus:O,onBlur:P,onMouseUp:E}):pt("input",{className:A,disabled:d,ref:k,value:r,type:o,placeholder:s,inputMode:f,autoCapitalize:"none",onInput:N,onKeyDown:M,onKeyUp:T,onFocus:O,onBlur:P,onMouseUp:E}),n&&pt("span",{className:"vm-text-field__label",children:n}),pt(Zr,{error:i,warning:a,info:l})]})};var Kr=function(e){return e[e.mouse=0]="mouse",e[e.keyboard=1]="keyboard",e}(Kr||{});const Gr=e=>{var n;let{value:r,options:o,anchor:i,disabled:a,minLength:l=2,fullWidth:s,selected:c,noOptionsText:u,label:d,disabledFullScreen:h,offset:f,maxDisplayResults:p,loading:m,onSelect:v,onOpenAutocomplete:g,onFoundOptions:y,onChangeWrapperRef:_}=e;const{isMobile:b}=dr(),w=(0,t.useRef)(null),[k,x]=(0,t.useState)({index:-1}),[S,A]=(0,t.useState)(""),[C,E]=(0,t.useState)(0),{value:M,setValue:T,setFalse:N}=Rr(!1),O=(0,t.useMemo)((()=>{if(!M)return[];try{const e=new RegExp(String(r.trim()),"i"),t=o.filter((t=>e.test(t.value))).sort(((t,n)=>{var o,i;return t.value.toLowerCase()===r.trim().toLowerCase()?-1:n.value.toLowerCase()===r.trim().toLowerCase()?1:((null===(o=t.value.match(e))||void 0===o?void 0:o.index)||0)-((null===(i=n.value.match(e))||void 0===i?void 0:i.index)||0)}));return E(t.length),A(t.length>Number(null===p||void 0===p?void 0:p.limit)&&(null===p||void 0===p?void 0:p.message)||""),null!==p&&void 0!==p&&p.limit?t.slice(0,p.limit):t}catch(Au){return[]}}),[M,o,r]),P=(0,t.useMemo)((()=>{var e;return 1===O.length&&(null===(e=O[0])||void 0===e?void 0:e.value)===r}),[O]),L=(0,t.useMemo)((()=>u&&!O.length),[u,O]),R=()=>{x({index:-1})},z=(0,t.useCallback)((e=>{const{key:t,ctrlKey:n,metaKey:r,shiftKey:o}=e,i=n||r||o,a=O.length;if("ArrowUp"===t&&!i&&a&&(e.preventDefault(),x((e=>{let{index:t}=e;return{index:t<=0?0:t-1,type:Kr.keyboard}}))),"ArrowDown"===t&&!i&&a){e.preventDefault();const t=O.length-1;x((e=>{let{index:n}=e;return{index:n>=t?t:n+1,type:Kr.keyboard}}))}if("Enter"===t){const e=O[k.index];e&&v(e.value),c||N()}"Escape"===t&&N()}),[k,O,N,v,c]);return(0,t.useEffect)((()=>{T(r.length>=l)}),[r,o]),Gn("keydown",z),(0,t.useEffect)((()=>{if(!w.current||k.type===Kr.mouse)return;const e=w.current.childNodes[k.index];null!==e&&void 0!==e&&e.scrollIntoView&&e.scrollIntoView({block:"center"})}),[k,O]),(0,t.useEffect)((()=>{x({index:-1})}),[O]),(0,t.useEffect)((()=>{g&&g(M)}),[M]),(0,t.useEffect)((()=>{y&&y(P?[]:O)}),[O,P]),(0,t.useEffect)((()=>{_&&_(w)}),[w]),pt(Nr,{open:M,buttonRef:i,placement:"bottom-left",onClose:N,fullWidth:s,title:b?d:void 0,disabledFullScreen:h,offset:f,children:[pt("div",{className:Yn()({"vm-autocomplete":!0,"vm-autocomplete_mobile":b&&!h}),ref:w,children:[m&&pt("div",{className:"vm-autocomplete__loader",children:[pt(bn,{}),pt("span",{children:"Loading..."})]}),L&&pt("div",{className:"vm-autocomplete__no-options",children:u}),!P&&O.map(((e,t)=>{return pt("div",{className:Yn()({"vm-list-item":!0,"vm-list-item_mobile":b,"vm-list-item_active":t===k.index,"vm-list-item_multiselect":c,"vm-list-item_multiselect_selected":null===c||void 0===c?void 0:c.includes(e.value),"vm-list-item_with-icon":e.icon}),id:"$autocomplete$".concat(e.value),onClick:(r=e.value,()=>{a||(v(r),c||N())}),onMouseEnter:(n=t,()=>{x({index:n,type:Kr.mouse})}),onMouseLeave:R,children:[(null===c||void 0===c?void 0:c.includes(e.value))&&pt(On,{}),pt(ht.FK,{children:e.icon}),pt("span",{children:e.value})]},"".concat(t).concat(e.value));var n,r}))]}),S&&pt("div",{className:"vm-autocomplete-message",children:["Shown ",null===p||void 0===p?void 0:p.limit," results out of ",C,". ",S]}),(null===(n=O[k.index])||void 0===n?void 0:n.description)&&pt("div",{className:"vm-autocomplete-info",children:[pt("div",{className:"vm-autocomplete-info__type",children:O[k.index].type}),pt("div",{className:"vm-autocomplete-info__description",dangerouslySetInnerHTML:{__html:O[k.index].description||""}})]})]})};var Qr=n(267),Jr=n.n(Qr);const Xr=e=>e.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&"),eo=e=>JSON.stringify(e).slice(1,-1);var to=function(e){return e.metric="metric",e.label="label",e.labelValue="labelValue",e}(to||{});const no={[to.metric]:pt(Vn,{}),[to.label]:pt(Un,{}),[to.labelValue]:pt(Bn,{})},ro="u-off",oo="u-label",io="width",ao="height",lo="top",so="bottom",co="left",uo="right",ho="#000",fo=ho+"0",po="mousemove",mo="mousedown",vo="mouseup",go="mouseenter",yo="mouseleave",_o="dblclick",bo="change",wo="dppxchange",ko="--",xo="undefined"!=typeof window,So=xo?document:null,Ao=xo?window:null,Co=xo?navigator:null;let Eo,Mo;function To(e,t){if(null!=t){let n=e.classList;!n.contains(t)&&n.add(t)}}function No(e,t){let n=e.classList;n.contains(t)&&n.remove(t)}function Oo(e,t,n){e.style[t]=n+"px"}function Po(e,t,n,r){let o=So.createElement(e);return null!=t&&To(o,t),null!=n&&n.insertBefore(o,r),o}function Lo(e,t){return Po("div",e,t)}const Ro=new WeakMap;function zo(e,t,n,r,o){let i="translate("+t+"px,"+n+"px)";i!=Ro.get(e)&&(e.style.transform=i,Ro.set(e,i),t<0||n<0||t>r||n>o?To(e,ro):No(e,ro))}const Do=new WeakMap;function Io(e,t,n){let r=t+n;r!=Do.get(e)&&(Do.set(e,r),e.style.background=t,e.style.borderColor=n)}const $o=new WeakMap;function Fo(e,t,n,r){let o=t+""+n;o!=$o.get(e)&&($o.set(e,o),e.style.height=n+"px",e.style.width=t+"px",e.style.marginLeft=r?-t/2+"px":0,e.style.marginTop=r?-n/2+"px":0)}const jo={passive:!0},Vo={...jo,capture:!0};function Ho(e,t,n,r){t.addEventListener(e,n,r?Vo:jo)}function Uo(e,t,n,r){t.removeEventListener(e,n,r?Vo:jo)}function Bo(e,t,n,r){let o;n=n||0;let i=(r=r||t.length-1)<=2147483647;for(;r-n>1;)o=i?n+r>>1:ai((n+r)/2),t[o]=t&&o<=n;o+=r)if(null!=e[o])return o;return-1}function Yo(e,t,n,r){let o=hi(e),i=hi(t);e==t&&(-1==o?(e*=n,t/=n):(e/=n,t*=n));let a=10==n?fi:pi,l=1==i?si:ai,s=(1==o?ai:si)(a(ii(e))),c=l(a(ii(t))),u=di(n,s),d=di(n,c);return 10==n&&(s<0&&(u=Ti(u,-s)),c<0&&(d=Ti(d,-c))),r||2==n?(e=u*o,t=d*i):(e=Mi(e,u),t=Ei(t,d)),[e,t]}function Zo(e,t,n,r){let o=Yo(e,t,n,r);return 0==e&&(o[0]=0),0==t&&(o[1]=0),o}xo&&function e(){let t=devicePixelRatio;Eo!=t&&(Eo=t,Mo&&Uo(bo,Mo,e),Mo=matchMedia("(min-resolution: ".concat(Eo-.001,"dppx) and (max-resolution: ").concat(Eo+.001,"dppx)")),Ho(bo,Mo,e),Ao.dispatchEvent(new CustomEvent(wo)))}();const qo=.1,Ko={mode:3,pad:qo},Go={pad:0,soft:null,mode:0},Qo={min:Go,max:Go};function Jo(e,t,n,r){return Fi(n)?ei(e,t,n):(Go.pad=n,Go.soft=r?0:null,Go.mode=r?3:0,ei(e,t,Qo))}function Xo(e,t){return null==e?t:e}function ei(e,t,n){let r=n.min,o=n.max,i=Xo(r.pad,0),a=Xo(o.pad,0),l=Xo(r.hard,-vi),s=Xo(o.hard,vi),c=Xo(r.soft,vi),u=Xo(o.soft,-vi),d=Xo(r.mode,0),h=Xo(o.mode,0),f=t-e,p=fi(f),m=ui(ii(e),ii(t)),v=fi(m),g=ii(v-p);(f<1e-9||g>10)&&(f=0,0!=e&&0!=t||(f=1e-9,2==d&&c!=vi&&(i=0),2==h&&u!=-vi&&(a=0)));let y=f||m||1e3,_=fi(y),b=di(10,ai(_)),w=Ti(Mi(e-y*(0==f?0==e?.1:1:i),b/10),9),k=e>=c&&(1==d||3==d&&w<=c||2==d&&w>=c)?c:vi,x=ui(l,w=k?k:ci(k,w)),S=Ti(Ei(t+y*(0==f?0==t?.1:1:a),b/10),9),A=t<=u&&(1==h||3==h&&S>=u||2==h&&S<=u)?u:-vi,C=ci(s,S>A&&t<=A?A:ui(A,S));return x==C&&0==x&&(C=100),[x,C]}const ti=new Intl.NumberFormat(xo?Co.language:"en-US"),ni=e=>ti.format(e),ri=Math,oi=ri.PI,ii=ri.abs,ai=ri.floor,li=ri.round,si=ri.ceil,ci=ri.min,ui=ri.max,di=ri.pow,hi=ri.sign,fi=ri.log10,pi=ri.log2,mi=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return ri.asinh(e/t)},vi=1/0;function gi(e){return 1+(0|fi((e^e>>31)-(e>>31)))}function yi(e,t,n){return ci(ui(e,t),n)}function _i(e){return"function"==typeof e?e:()=>e}const bi=e=>e,wi=(e,t)=>t,ki=e=>null,xi=e=>!0,Si=(e,t)=>e==t,Ai=e=>Ti(e,14);function Ci(e,t){return Ai(Ti(Ai(e/t))*t)}function Ei(e,t){return Ai(si(Ai(e/t))*t)}function Mi(e,t){return Ai(ai(Ai(e/t))*t)}function Ti(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(Ii(e))return e;let n=10**t,r=e*n*(1+Number.EPSILON);return li(r)/n}const Ni=new Map;function Oi(e){return((""+e).split(".")[1]||"").length}function Pi(e,t,n,r){let o=[],i=r.map(Oi);for(let a=t;a=0&&a>=0?0:t)+(a>=i[e]?0:i[e]),c=Ti(l,s);o.push(c),Ni.set(c,s)}}return o}const Li={},Ri=[],zi=[null,null],Di=Array.isArray,Ii=Number.isInteger;function $i(e){return"string"==typeof e}function Fi(e){let t=!1;if(null!=e){let n=e.constructor;t=null==n||n==Object}return t}function ji(e){return null!=e&&"object"==typeof e}const Vi=Object.getPrototypeOf(Uint8Array);function Hi(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fi;if(Di(e)){let r=e.find((e=>null!=e));if(Di(r)||n(r)){t=Array(e.length);for(let r=0;ri){for(r=a-1;r>=0&&null==e[r];)e[r--]=null;for(r=a+1;rPromise.resolve().then(e):queueMicrotask;const Yi=["January","February","March","April","May","June","July","August","September","October","November","December"],Zi=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function qi(e){return e.slice(0,3)}const Ki=Zi.map(qi),Gi=Yi.map(qi),Qi={MMMM:Yi,MMM:Gi,WWWW:Zi,WWW:Ki};function Ji(e){return(e<10?"0":"")+e}const Xi={YYYY:e=>e.getFullYear(),YY:e=>(e.getFullYear()+"").slice(2),MMMM:(e,t)=>t.MMMM[e.getMonth()],MMM:(e,t)=>t.MMM[e.getMonth()],MM:e=>Ji(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>Ji(e.getDate()),D:e=>e.getDate(),WWWW:(e,t)=>t.WWWW[e.getDay()],WWW:(e,t)=>t.WWW[e.getDay()],HH:e=>Ji(e.getHours()),H:e=>e.getHours(),h:e=>{let t=e.getHours();return 0==t?12:t>12?t-12:t},AA:e=>e.getHours()>=12?"PM":"AM",aa:e=>e.getHours()>=12?"pm":"am",a:e=>e.getHours()>=12?"p":"a",mm:e=>Ji(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>Ji(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>{return((t=e.getMilliseconds())<10?"00":t<100?"0":"")+t;var t}};function ea(e,t){t=t||Qi;let n,r=[],o=/\{([a-z]+)\}|[^{]+/gi;for(;n=o.exec(e);)r.push("{"==n[0][0]?Xi[n[1]]:n[0]);return e=>{let n="";for(let o=0;oe%1==0,ra=[1,2,2.5,5],oa=Pi(10,-16,0,ra),ia=Pi(10,0,16,ra),aa=ia.filter(na),la=oa.concat(ia),sa="{YYYY}",ca="\n"+sa,ua="{M}/{D}",da="\n"+ua,ha=da+"/{YY}",fa="{aa}",pa="{h}:{mm}"+fa,ma="\n"+pa,va=":{ss}",ga=null;function ya(e){let t=1e3*e,n=60*t,r=60*n,o=24*r,i=30*o,a=365*o;return[(1==e?Pi(10,0,3,ra).filter(na):Pi(10,-3,0,ra)).concat([t,5*t,10*t,15*t,30*t,n,5*n,10*n,15*n,30*n,r,2*r,3*r,4*r,6*r,8*r,12*r,o,2*o,3*o,4*o,5*o,6*o,7*o,8*o,9*o,10*o,15*o,i,2*i,3*i,4*i,6*i,a,2*a,5*a,10*a,25*a,50*a,100*a]),[[a,sa,ga,ga,ga,ga,ga,ga,1],[28*o,"{MMM}",ca,ga,ga,ga,ga,ga,1],[o,ua,ca,ga,ga,ga,ga,ga,1],[r,"{h}"+fa,ha,ga,da,ga,ga,ga,1],[n,pa,ha,ga,da,ga,ga,ga,1],[t,va,ha+" "+pa,ga,da+" "+pa,ga,ma,ga,1],[e,va+".{fff}",ha+" "+pa,ga,da+" "+pa,ga,ma,ga,1]],function(t){return(l,s,c,u,d,h)=>{let f=[],p=d>=a,m=d>=i&&d=o?o:d,a=_+(ai(c)-ai(g))+Ei(g-_,i);f.push(a);let p=t(a),m=p.getHours()+p.getMinutes()/n+p.getSeconds()/r,v=d/r,y=h/l.axes[s]._space;for(;a=Ti(a+d,1==e?0:3),!(a>u);)if(v>1){let e=ai(Ti(m+v,6))%24,n=t(a).getHours()-e;n>1&&(n=-1),a-=n*r,m=(m+v)%24,Ti((a-f[f.length-1])/d,3)*y>=.7&&f.push(a)}else f.push(a)}return f}}]}const[_a,ba,wa]=ya(1),[ka,xa,Sa]=ya(.001);function Aa(e,t){return e.map((e=>e.map(((n,r)=>0==r||8==r||null==n?n:t(1==r||0==e[8]?n:e[1]+n)))))}function Ca(e,t){return(n,r,o,i,a)=>{let l,s,c,u,d,h,f=t.find((e=>a>=e[0]))||t[t.length-1];return r.map((t=>{let n=e(t),r=n.getFullYear(),o=n.getMonth(),i=n.getDate(),a=n.getHours(),p=n.getMinutes(),m=n.getSeconds(),v=r!=l&&f[2]||o!=s&&f[3]||i!=c&&f[4]||a!=u&&f[5]||p!=d&&f[6]||m!=h&&f[7]||f[1];return l=r,s=o,c=i,u=a,d=p,h=m,v(n)}))}}function Ea(e,t,n){return new Date(e,t,n)}function Ma(e,t){return t(e)}Pi(2,-53,53,[1]);function Ta(e,t){return(n,r,o,i)=>null==i?ko:t(e(r))}const Na={show:!0,live:!0,isolate:!1,mount:()=>{},markers:{show:!0,width:2,stroke:function(e,t){let n=e.series[t];return n.width?n.stroke(e,t):n.points.width?n.points.stroke(e,t):null},fill:function(e,t){return e.series[t].fill(e,t)},dash:"solid"},idx:null,idxs:null,values:[]};const Oa=[0,0];function Pa(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return e=>{0==e.button&&(!r||e.target==t)&&n(e)}}function La(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return e=>{(!r||e.target==t)&&n(e)}}const Ra={show:!0,x:!0,y:!0,lock:!1,move:function(e,t,n){return Oa[0]=t,Oa[1]=n,Oa},points:{show:function(e,t){let n=e.cursor.points,r=Lo(),o=n.size(e,t);Oo(r,io,o),Oo(r,ao,o);let i=o/-2;Oo(r,"marginLeft",i),Oo(r,"marginTop",i);let a=n.width(e,t,o);return a&&Oo(r,"borderWidth",a),r},size:function(e,t){return e.series[t].points.size},width:0,stroke:function(e,t){let n=e.series[t].points;return n._stroke||n._fill},fill:function(e,t){let n=e.series[t].points;return n._fill||n._stroke}},bind:{mousedown:Pa,mouseup:Pa,click:Pa,dblclick:Pa,mousemove:La,mouseleave:La,mouseenter:La},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(e,t)=>{t.stopPropagation(),t.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(e,t,n,r,o)=>r-o,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},za={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},Da=Ui({},za,{filter:wi}),Ia=Ui({},Da,{size:10}),$a=Ui({},za,{show:!1}),Fa='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',ja="bold "+Fa,Va={show:!0,scale:"x",stroke:ho,space:50,gap:5,size:50,labelGap:0,labelSize:30,labelFont:ja,side:2,grid:Da,ticks:Ia,border:$a,font:Fa,lineGap:1.5,rotate:0},Ha={show:!0,scale:"x",auto:!1,sorted:1,min:vi,max:-vi,idxs:[]};function Ua(e,t,n,r,o){return t.map((e=>null==e?"":ni(e)))}function Ba(e,t,n,r,o,i,a){let l=[],s=Ni.get(o)||0;for(let c=n=a?n:Ti(Ei(n,o),s);c<=r;c=Ti(c+o,s))l.push(Object.is(c,-0)?0:c);return l}function Wa(e,t,n,r,o,i,a){const l=[],s=e.scales[e.axes[t].scale].log,c=ai((10==s?fi:pi)(n));o=di(s,c),10==s&&c<0&&(o=Ti(o,-c));let u=n;do{l.push(u),u+=o,10==s&&(u=Ti(u,Ni.get(o))),u>=o*s&&(o=u)}while(u<=r);return l}function Ya(e,t,n,r,o,i,a){let l=e.scales[e.axes[t].scale].asinh,s=r>l?Wa(e,t,ui(l,n),r,o):[l],c=r>=0&&n<=0?[0]:[];return(n<-l?Wa(e,t,ui(l,-r),-n,o):[l]).reverse().map((e=>-e)).concat(c,s)}const Za=/./,qa=/[12357]/,Ka=/[125]/,Ga=/1/,Qa=(e,t,n,r)=>e.map(((e,o)=>4==t&&0==e||o%r==0&&n.test(e.toExponential()[e<0?1:0])?e:null));function Ja(e,t,n,r,o){let i=e.axes[n],a=i.scale,l=e.scales[a],s=e.valToPos,c=i._space,u=s(10,a),d=s(9,a)-u>=c?Za:s(7,a)-u>=c?qa:s(5,a)-u>=c?Ka:Ga;if(d==Ga){let e=ii(s(1,a)-u);if(eo,ol={show:!0,auto:!0,sorted:0,gaps:rl,alpha:1,facets:[Ui({},nl,{scale:"x"}),Ui({},nl,{scale:"y"})]},il={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:rl,alpha:1,points:{show:function(e,t){let{scale:n,idxs:r}=e.series[0],o=e._data[0],i=e.valToPos(o[r[0]],n,!0),a=e.valToPos(o[r[1]],n,!0),l=ii(a-i)/(e.series[t].points.space*Eo);return r[1]-r[0]<=l},filter:null},values:null,min:vi,max:-vi,idxs:[],path:null,clip:null};function al(e,t,n,r,o){return n/10}const ll={time:!0,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},sl=Ui({},ll,{time:!1,ori:1}),cl={};function ul(e,t){let n=cl[e];return n||(n={key:e,plots:[],sub(e){n.plots.push(e)},unsub(e){n.plots=n.plots.filter((t=>t!=e))},pub(e,t,r,o,i,a,l){for(let s=0;s{let m=e.pxRound;const v=l.dir*(0==l.ori?1:-1),g=0==l.ori?kl:xl;let y,_;1==v?(y=n,_=r):(y=r,_=n);let b=m(c(t[y],l,f,d)),w=m(u(a[y],s,p,h)),k=m(c(t[_],l,f,d)),x=m(u(1==i?s.max:s.min,s,p,h)),S=new Path2D(o);return g(S,k,x),g(S,b,x),g(S,b,w),S}))}function vl(e,t,n,r,o,i){let a=null;if(e.length>0){a=new Path2D;const l=0==t?Sl:Al;let s=n;for(let t=0;tn[0]){let e=n[0]-s;e>0&&l(a,s,r,e,r+i),s=n[1]}}let c=n+o-s,u=10;c>0&&l(a,s,r-u/2,c,r+i+u)}return a}function gl(e,t,n,r,o,i,a){let l=[],s=e.length;for(let c=1==o?n:r;c>=n&&c<=r;c+=o){if(null===t[c]){let u=c,d=c;if(1==o)for(;++c<=r&&null===t[c];)d=c;else for(;--c>=n&&null===t[c];)d=c;let h=i(e[u]),f=d==u?h:i(e[d]),p=u-o;h=a<=0&&p>=0&&p=0&&m>=0&&m=h&&l.push([h,f])}}return l}function yl(e){return 0==e?bi:1==e?li:t=>Ci(t,e)}function _l(e){let t=0==e?bl:wl,n=0==e?(e,t,n,r,o,i)=>{e.arcTo(t,n,r,o,i)}:(e,t,n,r,o,i)=>{e.arcTo(n,t,o,r,i)},r=0==e?(e,t,n,r,o)=>{e.rect(t,n,r,o)}:(e,t,n,r,o)=>{e.rect(n,t,o,r)};return function(e,o,i,a,l){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;0==s&&0==c?r(e,o,i,a,l):(s=ci(s,a/2,l/2),c=ci(c,a/2,l/2),t(e,o+s,i),n(e,o+a,i,o+a,i+l,s),n(e,o+a,i+l,o,i+l,c),n(e,o,i+l,o,i,c),n(e,o,i,o+a,i,s),e.closePath())}}const bl=(e,t,n)=>{e.moveTo(t,n)},wl=(e,t,n)=>{e.moveTo(n,t)},kl=(e,t,n)=>{e.lineTo(t,n)},xl=(e,t,n)=>{e.lineTo(n,t)},Sl=_l(0),Al=_l(1),Cl=(e,t,n,r,o,i)=>{e.arc(t,n,r,o,i)},El=(e,t,n,r,o,i)=>{e.arc(n,t,r,o,i)},Ml=(e,t,n,r,o,i,a)=>{e.bezierCurveTo(t,n,r,o,i,a)},Tl=(e,t,n,r,o,i,a)=>{e.bezierCurveTo(n,t,o,r,a,i)};function Nl(e){return(e,t,n,r,o)=>hl(e,t,((t,i,a,l,s,c,u,d,h,f,p)=>{let m,v,{pxRound:g,points:y}=t;0==l.ori?(m=bl,v=Cl):(m=wl,v=El);const _=Ti(y.width*Eo,3);let b=(y.size-y.width)/2*Eo,w=Ti(2*b,3),k=new Path2D,x=new Path2D,{left:S,top:A,width:C,height:E}=e.bbox;Sl(x,S-w,A-w,C+2*w,E+2*w);const M=e=>{if(null!=a[e]){let t=g(c(i[e],l,f,d)),n=g(u(a[e],s,p,h));m(k,t+b,n),v(k,t,n,b,0,2*oi)}};if(o)o.forEach(M);else for(let e=n;e<=r;e++)M(e);return{stroke:_>0?k:null,fill:k,clip:x,flags:2|dl}}))}function Ol(e){return(t,n,r,o,i,a)=>{r!=o&&(i!=r&&a!=r&&e(t,n,r),i!=o&&a!=o&&e(t,n,o),e(t,n,a))}}const Pl=Ol(kl),Ll=Ol(xl);function Rl(e){const t=Xo(null===e||void 0===e?void 0:e.alignGaps,0);return(e,n,r,o)=>hl(e,n,((i,a,l,s,c,u,d,h,f,p,m)=>{let v,g,y=i.pxRound,_=e=>y(u(e,s,p,h)),b=e=>y(d(e,c,m,f));0==s.ori?(v=kl,g=Pl):(v=xl,g=Ll);const w=s.dir*(0==s.ori?1:-1),k={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:dl},x=k.stroke;let S,A,C,E=vi,M=-vi,T=_(a[1==w?r:o]),N=Wo(l,r,o,1*w),O=Wo(l,r,o,-1*w),P=_(a[N]),L=_(a[O]),R=!1;for(let e=1==w?r:o;e>=r&&e<=o;e+=w){let t=_(a[e]),n=l[e];t==T?null!=n?(A=b(n),E==vi&&(v(x,t,A),S=A),E=ci(A,E),M=ui(A,M)):null===n&&(R=!0):(E!=vi&&(g(x,T,E,M,S,A),C=T),null!=n?(A=b(n),v(x,t,A),E=M=S=A):(E=vi,M=-vi,null===n&&(R=!0)),T=t)}E!=vi&&E!=M&&C!=T&&g(x,T,E,M,S,A);let[z,D]=fl(e,n);if(null!=i.fill||0!=z){let t=k.fill=new Path2D(x),r=b(i.fillTo(e,n,i.min,i.max,z));v(t,L,r),v(t,P,r)}if(!i.spanGaps){let c=[];R&&c.push(...gl(a,l,r,o,w,_,t)),k.gaps=c=i.gaps(e,n,r,o,c),k.clip=vl(c,s.ori,h,f,p,m)}return 0!=D&&(k.band=2==D?[ml(e,n,r,o,x,-1),ml(e,n,r,o,x,1)]:ml(e,n,r,o,x,D)),k}))}function zl(e,t,n,r,o,i){let a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:vi;if(e.length>1){let l=null;for(let s=0,c=1/0;s0!==r[e]>0?n[e]=0:(n[e]=3*(s[e-1]+s[e])/((2*s[e]+s[e-1])/r[e-1]+(s[e]+2*s[e-1])/r[e]),isFinite(n[e])||(n[e]=0));n[a-1]=r[a-2];for(let c=0;c{Xl.pxRatio=Eo})));const Fl=Rl(),jl=Nl();function Vl(e,t,n,r){return(r?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map(((e,r)=>Hl(e,r,t,n)))}function Hl(e,t,n,r){return Ui({},0==t?n:r,e)}function Ul(e,t,n){return null==t?zi:[t,n]}const Bl=Ul;function Wl(e,t,n){return null==t?zi:Jo(t,n,qo,!0)}function Yl(e,t,n,r){return null==t?zi:Yo(t,n,e.scales[r].log,!1)}const Zl=Yl;function ql(e,t,n,r){return null==t?zi:Zo(t,n,e.scales[r].log,!1)}const Kl=ql;function Gl(e,t,n,r,o){let i=ui(gi(e),gi(t)),a=t-e,l=Bo(o/r*a,n);do{let e=n[l],t=r*e/a;if(t>=o&&i+(e<5?Ni.get(e):0)<=17)return[e,t]}while(++l(t=li((n=+r)*Eo))+"px")),t,n]}function Jl(e){e.show&&[e.font,e.labelFont].forEach((e=>{let t=Ti(e[2]*Eo,1);e[0]=e[0].replace(/[0-9.]+px/,t+"px"),e[1]=t}))}function Xl(e,t,n){const r={mode:Xo(e.mode,1)},o=r.mode;function i(e,t){return((3==t.distr?fi(e>0?e:t.clamp(r,e,t.min,t.max,t.key)):4==t.distr?mi(e,t.asinh):e)-t._min)/(t._max-t._min)}function a(e,t,n,r){let o=i(e,t);return r+n*(-1==t.dir?1-o:o)}function l(e,t,n,r){let o=i(e,t);return r+n*(-1==t.dir?o:1-o)}function s(e,t,n,r){return 0==t.ori?a(e,t,n,r):l(e,t,n,r)}r.valToPosH=a,r.valToPosV=l;let c=!1;r.status=0;const u=r.root=Lo("uplot");if(null!=e.id&&(u.id=e.id),To(u,e.class),e.title){Lo("u-title",u).textContent=e.title}const d=Po("canvas"),h=r.ctx=d.getContext("2d"),f=Lo("u-wrap",u);Ho("click",f,(e=>{if(e.target===m){(Tt!=At||Nt!=Ct)&&Ft.click(r,e)}}),!0);const p=r.under=Lo("u-under",f);f.appendChild(d);const m=r.over=Lo("u-over",f),v=+Xo((e=Hi(e)).pxAlign,1),g=yl(v);(e.plugins||[]).forEach((t=>{t.opts&&(e=t.opts(r,e)||e)}));const y=e.ms||.001,_=r.series=1==o?Vl(e.series||[],Ha,il,!1):(b=e.series||[null],w=ol,b.map(((e,t)=>0==t?null:Ui({},w,e))));var b,w;const k=r.axes=Vl(e.axes||[],Va,tl,!0),x=r.scales={},S=r.bands=e.bands||[];S.forEach((e=>{e.fill=_i(e.fill||null),e.dir=Xo(e.dir,-1)}));const A=2==o?_[1].facets[0].scale:_[0].scale,C={axes:function(){for(let e=0;ett[e])):y,b=2==f.distr?tt[y[1]]-tt[y[0]]:u,w=t.ticks,S=t.border,A=w.show?li(w.size*Eo):0,C=t._rotate*-oi/180,E=g(t._pos*Eo),M=E+(A+v)*c;o=0==a?M:0,n=1==a?M:0,at(t.font[0],l,1==t.align?co:2==t.align?uo:C>0?co:C<0?uo:0==a?"center":3==i?uo:co,C||1==a?"middle":2==i?lo:so);let T=t.font[1]*t.lineGap,N=y.map((e=>g(s(e,f,p,m)))),O=t._values;for(let e=0;e0&&(_.forEach(((e,n)=>{if(n>0&&e.show&&(ct(n,!1),ct(n,!0),null==e._paths)){et!=e.alpha&&(h.globalAlpha=et=e.alpha);let i=2==o?[0,t[n][0].length-1]:function(e){let t=yi(He-1,0,Ve-1),n=yi(Ue+1,0,Ve-1);for(;null==e[t]&&t>0;)t--;for(;null==e[n]&&n{if(t>0&&e.show){et!=e.alpha&&(h.globalAlpha=et=e.alpha),null!=e._paths&&ut(t,!1);{let n=null!=e._paths?e._paths.gaps:null,o=e.points.show(r,t,He,Ue,n),i=e.points.filter(r,t,o,n);(o||i)&&(e.points._paths=e.points.paths(r,t,He,Ue,i),ut(t,!0))}1!=et&&(h.globalAlpha=et=1),kn("drawSeries",t)}})))}},E=(e.drawOrder||["axes","series"]).map((e=>C[e]));function M(t){let n=x[t];if(null==n){let r=(e.scales||Li)[t]||Li;if(null!=r.from)M(r.from),x[t]=Ui({},x[r.from],r,{key:t});else{n=x[t]=Ui({},t==A?ll:sl,r),n.key=t;let e=n.time,i=n.range,a=Di(i);if((t!=A||2==o&&!e)&&(!a||null!=i[0]&&null!=i[1]||(i={min:null==i[0]?Ko:{mode:1,hard:i[0],soft:i[0]},max:null==i[1]?Ko:{mode:1,hard:i[1],soft:i[1]}},a=!1),!a&&Fi(i))){let e=i;i=(t,n,r)=>null==n?zi:Jo(n,r,e)}n.range=_i(i||(e?Bl:t==A?3==n.distr?Zl:4==n.distr?Kl:Ul:3==n.distr?Yl:4==n.distr?ql:Wl)),n.auto=_i(!a&&n.auto),n.clamp=_i(n.clamp||al),n._min=n._max=null}}}M("x"),M("y"),1==o&&_.forEach((e=>{M(e.scale)})),k.forEach((e=>{M(e.scale)}));for(let Tn in e.scales)M(Tn);const T=x[A],N=T.distr;let O,P;0==T.ori?(To(u,"u-hz"),O=a,P=l):(To(u,"u-vt"),O=l,P=a);const L={};for(let Tn in x){let e=x[Tn];null==e.min&&null==e.max||(L[Tn]={min:e.min,max:e.max},e.min=e.max=null)}const R=e.tzDate||(e=>new Date(li(e/y))),z=e.fmtDate||ea,D=1==y?wa(R):Sa(R),I=Ca(R,Aa(1==y?ba:xa,z)),$=Ta(R,Ma("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",z)),F=[],j=r.legend=Ui({},Na,e.legend),V=j.show,H=j.markers;let U,B,W;j.idxs=F,H.width=_i(H.width),H.dash=_i(H.dash),H.stroke=_i(H.stroke),H.fill=_i(H.fill);let Y,Z=[],q=[],K=!1,G={};if(j.live){const e=_[1]?_[1].values:null;K=null!=e,Y=K?e(r,1,0):{_:0};for(let t in Y)G[t]=ko}if(V)if(U=Po("table","u-legend",u),W=Po("tbody",null,U),j.mount(r,U),K){B=Po("thead",null,U,W);let e=Po("tr",null,B);for(var Q in Po("th",null,e),Y)Po("th",oo,e).textContent=Q}else To(U,"u-inline"),j.live&&To(U,"u-live");const J={show:!0},X={show:!1};const ee=new Map;function te(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const i=ee.get(t)||{},a=Ce.bind[e](r,t,n,o);a&&(Ho(e,t,i[e]=a),ee.set(t,i))}function ne(e,t,n){const r=ee.get(t)||{};for(let o in r)null!=e&&o!=e||(Uo(o,t,r[o]),delete r[o]);null==e&&ee.delete(t)}let re=0,oe=0,ie=0,ae=0,le=0,se=0,ce=le,ue=se,de=ie,he=ae,fe=0,pe=0,me=0,ve=0;r.bbox={};let ge=!1,ye=!1,_e=!1,be=!1,we=!1,ke=!1;function xe(e,t,n){(n||e!=r.width||t!=r.height)&&Se(e,t),yt(!1),_e=!0,ye=!0,zt()}function Se(e,t){r.width=re=ie=e,r.height=oe=ae=t,le=se=0,function(){let e=!1,t=!1,n=!1,r=!1;k.forEach(((o,i)=>{if(o.show&&o._show){let{side:i,_size:a}=o,l=i%2,s=a+(null!=o.label?o.labelSize:0);s>0&&(l?(ie-=s,3==i?(le+=s,r=!0):n=!0):(ae-=s,0==i?(se+=s,e=!0):t=!0))}})),Ie[0]=e,Ie[1]=n,Ie[2]=t,Ie[3]=r,ie-=je[1]+je[3],le+=je[3],ae-=je[2]+je[0],se+=je[0]}(),function(){let e=le+ie,t=se+ae,n=le,r=se;function o(o,i){switch(o){case 1:return e+=i,e-i;case 2:return t+=i,t-i;case 3:return n-=i,n+i;case 0:return r-=i,r+i}}k.forEach(((e,t)=>{if(e.show&&e._show){let t=e.side;e._pos=o(t,e._size),null!=e.label&&(e._lpos=o(t,e.labelSize))}}))}();let n=r.bbox;fe=n.left=Ci(le*Eo,.5),pe=n.top=Ci(se*Eo,.5),me=n.width=Ci(ie*Eo,.5),ve=n.height=Ci(ae*Eo,.5)}const Ae=3;r.setSize=function(e){let{width:t,height:n}=e;xe(t,n)};const Ce=r.cursor=Ui({},Ra,{drag:{y:2==o}},e.cursor);if(null==Ce.dataIdx){var Ee,Me;let e=Ce.hover,n=e.skip=new Set(null!==(Ee=e.skip)&&void 0!==Ee?Ee:[]);n.add(void 0);let r=e.prox=_i(e.prox),o=null!==(Me=e.bias)&&void 0!==Me?Me:e.bias=0;Ce.dataIdx=(e,i,a,l)=>{var s;if(0==i)return a;let c=a,u=null!==(s=r(e,i,a,l))&&void 0!==s?s:vi,d=u>=0&&u0;)n.has(m[e])||(t=e);if(0==o||1==o)for(e=a;null==r&&e++u&&(c=null)}return c}}const Te=e=>{Ce.event=e};Ce.idxs=F,Ce._lock=!1;let Ne=Ce.points;Ne.show=_i(Ne.show),Ne.size=_i(Ne.size),Ne.stroke=_i(Ne.stroke),Ne.width=_i(Ne.width),Ne.fill=_i(Ne.fill);const Oe=r.focus=Ui({},e.focus||{alpha:.3},Ce.focus),Pe=Oe.prox>=0;let Le=[null],Re=[null],ze=[null];function De(e,t){if(1==o||t>0){let t=1==o&&x[e.scale].time,n=e.value;e.value=t?$i(n)?Ta(R,Ma(n,z)):n||$:n||el,e.label=e.label||(t?"Time":"Value")}if(t>0){e.width=null==e.width?1:e.width,e.paths=e.paths||Fl||ki,e.fillTo=_i(e.fillTo||pl),e.pxAlign=+Xo(e.pxAlign,v),e.pxRound=yl(e.pxAlign),e.stroke=_i(e.stroke||null),e.fill=_i(e.fill||null),e._stroke=e._fill=e._paths=e._focus=null;let t=Ti((3+2*(ui(1,e.width)||1))*1,3),n=e.points=Ui({},{size:t,width:ui(1,.2*t),stroke:e.stroke,space:2*t,paths:jl,_stroke:null,_fill:null},e.points);n.show=_i(n.show),n.filter=_i(n.filter),n.fill=_i(n.fill),n.stroke=_i(n.stroke),n.paths=_i(n.paths),n.pxAlign=e.pxAlign}if(V){let n=function(e,t){if(0==t&&(K||!j.live||2==o))return zi;let n=[],i=Po("tr","u-series",W,W.childNodes[t]);To(i,e.class),e.show||To(i,ro);let a=Po("th",null,i);if(H.show){let e=Lo("u-marker",a);if(t>0){let n=H.width(r,t);n&&(e.style.border=n+"px "+H.dash(r,t)+" "+H.stroke(r,t)),e.style.background=H.fill(r,t)}}let l=Lo(oo,a);for(var s in l.textContent=e.label,t>0&&(H.show||(l.style.color=e.width>0?H.stroke(r,t):H.fill(r,t)),te("click",a,(t=>{if(Ce._lock)return;Te(t);let n=_.indexOf(e);if((t.ctrlKey||t.metaKey)!=j.isolate){let e=_.some(((e,t)=>t>0&&t!=n&&e.show));_.forEach(((t,r)=>{r>0&&Yt(r,e?r==n?J:X:J,!0,Sn.setSeries)}))}else Yt(n,{show:!e.show},!0,Sn.setSeries)}),!1),Pe&&te(go,a,(t=>{Ce._lock||(Te(t),Yt(_.indexOf(e),Gt,!0,Sn.setSeries))}),!1)),Y){let e=Po("td","u-value",i);e.textContent="--",n.push(e)}return[i,n]}(e,t);Z.splice(t,0,n[0]),q.splice(t,0,n[1]),j.values.push(null)}if(Ce.show){F.splice(t,0,null);let n=function(e,t){if(t>0){let n=Ce.points.show(r,t);if(n)return To(n,"u-cursor-pt"),To(n,e.class),zo(n,-10,-10,ie,ae),m.insertBefore(n,Le[t]),n}}(e,t);null!=n&&(Le.splice(t,0,n),Re.splice(t,0,0),ze.splice(t,0,0))}kn("addSeries",t)}r.addSeries=function(e,t){t=null==t?_.length:t,e=1==o?Hl(e,t,Ha,il):Hl(e,t,null,ol),_.splice(t,0,e),De(_[t],t)},r.delSeries=function(e){if(_.splice(e,1),V){j.values.splice(e,1),q.splice(e,1);let t=Z.splice(e,1)[0];ne(null,t.firstChild),t.remove()}Ce.show&&(F.splice(e,1),Le.length>1&&(Le.splice(e,1)[0].remove(),Re.splice(e,1),ze.splice(e,1))),kn("delSeries",e)};const Ie=[!1,!1,!1,!1];function $e(e,t,n,r){let[o,i,a,l]=n,s=t%2,c=0;return 0==s&&(l||i)&&(c=0==t&&!o||2==t&&!a?li(Va.size/3):0),1==s&&(o||a)&&(c=1==t&&!i||3==t&&!l?li(tl.size/2):0),c}const Fe=r.padding=(e.padding||[$e,$e,$e,$e]).map((e=>_i(Xo(e,$e)))),je=r._padding=Fe.map(((e,t)=>e(r,t,Ie,0)));let Ve,He=null,Ue=null;const Be=1==o?_[0].idxs:null;let We,Ye,Ze,qe,Ke,Ge,Qe,Je,Xe,et,tt=null,nt=!1;function rt(e,n){if(t=null==e?[]:e,r.data=r._data=t,2==o){Ve=0;for(let e=1;e<_.length;e++)Ve+=t[e][0].length}else{0==t.length&&(r.data=r._data=t=[[]]),tt=t[0],Ve=tt.length;let e=t;if(2==N){e=t.slice();let n=e[0]=Array(Ve);for(let e=0;e=0,ke=!0,zt()}}function ot(){let e,n;nt=!0,1==o&&(Ve>0?(He=Be[0]=0,Ue=Be[1]=Ve-1,e=t[0][He],n=t[0][Ue],2==N?(e=He,n=Ue):e==n&&(3==N?[e,n]=Yo(e,e,T.log,!1):4==N?[e,n]=Zo(e,e,T.log,!1):T.time?n=e+li(86400/y):[e,n]=Jo(e,n,qo,!0))):(He=Be[0]=e=null,Ue=Be[1]=n=null)),Wt(A,e,n)}function it(e,t,n,r,o,i){var a,l,s,c,u;null!==(a=e)&&void 0!==a||(e=fo),null!==(l=n)&&void 0!==l||(n=Ri),null!==(s=r)&&void 0!==s||(r="butt"),null!==(c=o)&&void 0!==c||(o=fo),null!==(u=i)&&void 0!==u||(i="round"),e!=We&&(h.strokeStyle=We=e),o!=Ye&&(h.fillStyle=Ye=o),t!=Ze&&(h.lineWidth=Ze=t),i!=Ke&&(h.lineJoin=Ke=i),r!=Ge&&(h.lineCap=Ge=r),n!=qe&&h.setLineDash(qe=n)}function at(e,t,n,r){t!=Ye&&(h.fillStyle=Ye=t),e!=Qe&&(h.font=Qe=e),n!=Je&&(h.textAlign=Je=n),r!=Xe&&(h.textBaseline=Xe=r)}function lt(e,t,n,o){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(o.length>0&&e.auto(r,nt)&&(null==t||null==t.min)){let t=Xo(He,0),r=Xo(Ue,o.length-1),a=null==n.min?3==e.distr?function(e,t,n){let r=vi,o=-vi;for(let i=t;i<=n;i++){let t=e[i];null!=t&&t>0&&(to&&(o=t))}return[r,o]}(o,t,r):function(e,t,n,r){let o=vi,i=-vi;if(1==r)o=e[t],i=e[n];else if(-1==r)o=e[n],i=e[t];else for(let a=t;a<=n;a++){let t=e[a];null!=t&&(ti&&(i=t))}return[o,i]}(o,t,r,i):[n.min,n.max];e.min=ci(e.min,n.min=a[0]),e.max=ui(e.max,n.max=a[1])}}r.setData=rt;const st={min:null,max:null};function ct(e,t){let n=t?_[e].points:_[e];n._stroke=n.stroke(r,e),n._fill=n.fill(r,e)}function ut(e,n){let o=n?_[e].points:_[e],{stroke:i,fill:a,clip:l,flags:s,_stroke:c=o._stroke,_fill:u=o._fill,_width:d=o.width}=o._paths;d=Ti(d*Eo,3);let f=null,p=d%2/2;n&&null==u&&(u=d>0?"#fff":c);let m=1==o.pxAlign&&p>0;if(m&&h.translate(p,p),!n){let e=fe-d/2,t=pe-d/2,n=me+d,r=ve+d;f=new Path2D,f.rect(e,t,n,r)}n?ht(c,d,o.dash,o.cap,u,i,a,s,l):function(e,n,o,i,a,l,s,c,u,d,h){let f=!1;0!=u&&S.forEach(((p,m)=>{if(p.series[0]==e){let e,v=_[p.series[1]],g=t[p.series[1]],y=(v._paths||Li).band;Di(y)&&(y=1==p.dir?y[0]:y[1]);let b=null;v.show&&y&&function(e,t,n){for(t=Xo(t,0),n=Xo(n,e.length-1);t<=n;){if(null!=e[t])return!0;t++}return!1}(g,He,Ue)?(b=p.fill(r,m)||l,e=v._paths.clip):y=null,ht(n,o,i,a,b,s,c,u,d,h,e,y),f=!0}})),f||ht(n,o,i,a,l,s,c,u,d,h)}(e,c,d,o.dash,o.cap,u,i,a,s,f,l),m&&h.translate(-p,-p)}const dt=2|dl;function ht(e,t,n,r,o,i,a,l,s,c,u,d){it(e,t,n,r,o),(s||c||d)&&(h.save(),s&&h.clip(s),c&&h.clip(c)),d?(l&dt)==dt?(h.clip(d),u&&h.clip(u),pt(o,a),ft(e,i,t)):2&l?(pt(o,a),h.clip(d),ft(e,i,t)):l&dl&&(h.save(),h.clip(d),u&&h.clip(u),pt(o,a),h.restore(),ft(e,i,t)):(pt(o,a),ft(e,i,t)),(s||c||d)&&h.restore()}function ft(e,t,n){n>0&&(t instanceof Map?t.forEach(((e,t)=>{h.strokeStyle=We=t,h.stroke(e)})):null!=t&&e&&h.stroke(t))}function pt(e,t){t instanceof Map?t.forEach(((e,t)=>{h.fillStyle=Ye=t,h.fill(e)})):null!=t&&e&&h.fill(t)}function mt(e,t,n,r,o,i,a,l,s,c){let u=a%2/2;1==v&&h.translate(u,u),it(l,a,s,c,l),h.beginPath();let d,f,p,m,g=o+(0==r||3==r?-i:i);0==n?(f=o,m=g):(d=o,p=g);for(let v=0;v{if(!n.show)return;let i=x[n.scale];if(null==i.min)return void(n._show&&(t=!1,n._show=!1,yt(!1)));n._show||(t=!1,n._show=!0,yt(!1));let a=n.side,l=a%2,{min:s,max:c}=i,[u,d]=function(e,t,n,o){let i,a=k[e];if(o<=0)i=[0,0];else{let l=a._space=a.space(r,e,t,n,o);i=Gl(t,n,a._incrs=a.incrs(r,e,t,n,o,l),o,l)}return a._found=i}(o,s,c,0==l?ie:ae);if(0==d)return;let h=2==i.distr,f=n._splits=n.splits(r,o,s,c,u,d,h),p=2==i.distr?f.map((e=>tt[e])):f,m=2==i.distr?tt[f[1]]-tt[f[0]]:u,v=n._values=n.values(r,n.filter(r,p,o,d,m),o,d,m);n._rotate=2==a?n.rotate(r,v,o,d):0;let g=n._size;n._size=si(n.size(r,v,o,e)),null!=g&&n._size!=g&&(t=!1)})),t}function gt(e){let t=!0;return Fe.forEach(((n,o)=>{let i=n(r,o,Ie,e);i!=je[o]&&(t=!1),je[o]=i})),t}function yt(e){_.forEach(((t,n)=>{n>0&&(t._paths=null,e&&(1==o?(t.min=null,t.max=null):t.facets.forEach((e=>{e.min=null,e.max=null}))))}))}let _t,bt,wt,kt,xt,St,At,Ct,Et,Mt,Tt,Nt,Ot=!1,Pt=!1,Lt=[];function Rt(){Pt=!1;for(let e=0;e0){_.forEach(((n,i)=>{if(1==o){let o=n.scale,a=L[o];if(null==a)return;let l=e[o];if(0==i){let e=l.range(r,l.min,l.max,o);l.min=e[0],l.max=e[1],He=Bo(l.min,t[0]),Ue=Bo(l.max,t[0]),Ue-He>1&&(t[0][He]l.max&&Ue--),n.min=tt[He],n.max=tt[Ue]}else n.show&&n.auto&<(l,a,n,t[i],n.sorted);n.idxs[0]=He,n.idxs[1]=Ue}else if(i>0&&n.show&&n.auto){let[r,o]=n.facets,a=r.scale,l=o.scale,[s,c]=t[i],u=e[a],d=e[l];null!=u&<(u,L[a],r,s,r.sorted),null!=d&<(d,L[l],o,c,o.sorted),n.min=o.min,n.max=o.max}}));for(let t in e){let n=e[t],o=L[t];if(null==n.from&&(null==o||null==o.min)){let e=n.range(r,n.min==vi?null:n.min,n.max==-vi?null:n.max,t);n.min=e[0],n.max=e[1]}}}for(let t in e){let n=e[t];if(null!=n.from){let o=e[n.from];if(null==o.min)n.min=n.max=null;else{let e=n.range(r,o.min,o.max,t);n.min=e[0],n.max=e[1]}}}let n={},i=!1;for(let t in e){let r=e[t],o=x[t];if(o.min!=r.min||o.max!=r.max){o.min=r.min,o.max=r.max;let e=o.distr;o._min=3==e?fi(o.min):4==e?mi(o.min,o.asinh):o.min,o._max=3==e?fi(o.max):4==e?mi(o.max,o.asinh):o.max,n[t]=i=!0}}if(i){_.forEach(((e,t)=>{2==o?t>0&&n.y&&(e._paths=null):n[e.scale]&&(e._paths=null)}));for(let e in n)_e=!0,kn("setScale",e);Ce.show&&Ce.left>=0&&(be=ke=!0)}for(let t in L)L[t]=null}(),ge=!1),_e&&(!function(){let e=!1,t=0;for(;!e;){t++;let n=vt(t),o=gt(t);e=t==Ae||n&&o,e||(Se(r.width,r.height),ye=!0)}}(),_e=!1),ye){if(Oo(p,co,le),Oo(p,lo,se),Oo(p,io,ie),Oo(p,ao,ae),Oo(m,co,le),Oo(m,lo,se),Oo(m,io,ie),Oo(m,ao,ae),Oo(f,io,re),Oo(f,ao,oe),d.width=li(re*Eo),d.height=li(oe*Eo),k.forEach((e=>{let{_el:t,_show:n,_size:r,_pos:o,side:i}=e;if(null!=t)if(n){let e=i%2==1;Oo(t,e?"left":"top",o-(3===i||0===i?r:0)),Oo(t,e?"width":"height",r),Oo(t,e?"top":"left",e?se:le),Oo(t,e?"height":"width",e?ae:ie),No(t,ro)}else To(t,ro)})),We=Ye=Ze=Ke=Ge=Qe=Je=Xe=qe=null,et=1,ln(!0),le!=ce||se!=ue||ie!=de||ae!=he){yt(!1);let e=ie/de,t=ae/he;if(Ce.show&&!be&&Ce.left>=0){Ce.left*=e,Ce.top*=t,wt&&zo(wt,li(Ce.left),0,ie,ae),kt&&zo(kt,0,li(Ce.top),ie,ae);for(let n=1;n=0&&Ht.width>0){Ht.left*=e,Ht.width*=e,Ht.top*=t,Ht.height*=t;for(let e in un)Oo(Ut,e,Ht[e])}ce=le,ue=se,de=ie,he=ae}kn("setSize"),ye=!1}re>0&&oe>0&&(h.clearRect(0,0,d.width,d.height),kn("drawClear"),E.forEach((e=>e())),kn("draw")),Ht.show&&we&&(Bt(Ht),we=!1),Ce.show&&be&&(on(null,!0,!1),be=!1),j.show&&j.live&&ke&&(nn(),ke=!1),c||(c=!0,r.status=1,kn("ready")),nt=!1,Ot=!1}function It(e,n){let o=x[e];if(null==o.from){if(0==Ve){let t=o.range(r,n.min,n.max,e);n.min=t[0],n.max=t[1]}if(n.min>n.max){let e=n.min;n.min=n.max,n.max=e}if(Ve>1&&null!=n.min&&null!=n.max&&n.max-n.min<1e-16)return;e==A&&2==o.distr&&Ve>0&&(n.min=Bo(n.min,t[0]),n.max=Bo(n.max,t[0]),n.min==n.max&&n.max++),L[e]=n,ge=!0,zt()}}r.batch=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Ot=!0,Pt=t,e(r),Dt(),t&&Lt.length>0&&queueMicrotask(Rt)},r.redraw=(e,t)=>{_e=t||!1,!1!==e?Wt(A,T.min,T.max):zt()},r.setScale=It;let $t=!1;const Ft=Ce.drag;let jt=Ft.x,Vt=Ft.y;Ce.show&&(Ce.x&&(_t=Lo("u-cursor-x",m)),Ce.y&&(bt=Lo("u-cursor-y",m)),0==T.ori?(wt=_t,kt=bt):(wt=bt,kt=_t),Tt=Ce.left,Nt=Ce.top);const Ht=r.select=Ui({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),Ut=Ht.show?Lo("u-select",Ht.over?m:p):null;function Bt(e,t){if(Ht.show){for(let t in e)Ht[t]=e[t],t in un&&Oo(Ut,t,e[t]);!1!==t&&kn("setSelect")}}function Wt(e,t,n){It(e,{min:t,max:n})}function Yt(e,t,n,i){null!=t.focus&&function(e){if(e!=Kt){let t=null==e,n=1!=Oe.alpha;_.forEach(((r,i)=>{if(1==o||i>0){let o=t||0==i||i==e;r._focus=t?null:o,n&&function(e,t){_[e].alpha=t,Ce.show&&Le[e]&&(Le[e].style.opacity=t);V&&Z[e]&&(Z[e].style.opacity=t)}(i,o?1:Oe.alpha)}})),Kt=e,n&&zt()}}(e),null!=t.show&&_.forEach(((n,r)=>{r>0&&(e==r||null==e)&&(n.show=t.show,function(e,t){let n=_[e],r=V?Z[e]:null;n.show?r&&No(r,ro):(r&&To(r,ro),Le.length>1&&zo(Le[e],-10,-10,ie,ae))}(r,t.show),2==o?(Wt(n.facets[0].scale,null,null),Wt(n.facets[1].scale,null,null)):Wt(n.scale,null,null),zt())})),!1!==n&&kn("setSeries",e,t),i&&En("setSeries",r,e,t)}let Zt,qt,Kt;r.setSelect=Bt,r.setSeries=Yt,r.addBand=function(e,t){e.fill=_i(e.fill||null),e.dir=Xo(e.dir,-1),t=null==t?S.length:t,S.splice(t,0,e)},r.setBand=function(e,t){Ui(S[e],t)},r.delBand=function(e){null==e?S.length=0:S.splice(e,1)};const Gt={focus:!0};function Qt(e,t,n){let r=x[t];n&&(e=e/Eo-(1==r.ori?se:le));let o=ie;1==r.ori&&(o=ae,e=o-e),-1==r.dir&&(e=o-e);let i=r._min,a=i+(r._max-i)*(e/o),l=r.distr;return 3==l?di(10,a):4==l?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return ri.sinh(e)*t}(a,r.asinh):a}function Jt(e,t){Oo(Ut,co,Ht.left=e),Oo(Ut,io,Ht.width=t)}function Xt(e,t){Oo(Ut,lo,Ht.top=e),Oo(Ut,ao,Ht.height=t)}V&&Pe&&te(yo,U,(e=>{Ce._lock||(Te(e),null!=Kt&&Yt(null,Gt,!0,Sn.setSeries))})),r.valToIdx=e=>Bo(e,t[0]),r.posToIdx=function(e,n){return Bo(Qt(e,A,n),t[0],He,Ue)},r.posToVal=Qt,r.valToPos=(e,t,n)=>0==x[t].ori?a(e,x[t],n?me:ie,n?fe:0):l(e,x[t],n?ve:ae,n?pe:0),r.setCursor=(e,t,n)=>{Tt=e.left,Nt=e.top,on(null,t,n)};let en=0==T.ori?Jt:Xt,tn=1==T.ori?Jt:Xt;function nn(e,t){null!=e&&(e.idxs?e.idxs.forEach(((e,t)=>{F[t]=e})):void 0!==e.idx&&F.fill(e.idx),j.idx=F[0]);for(let n=0;n<_.length;n++)(n>0||1==o&&!K)&&rn(n,F[n]);V&&j.live&&function(){if(V&&j.live)for(let e=2==o?1:0;e<_.length;e++){if(0==e&&K)continue;let t=j.values[e],n=0;for(let r in t)q[e][n++].firstChild.nodeValue=t[r]}}(),ke=!1,!1!==t&&kn("setLegend")}function rn(e,n){var o;let i,a=_[e],l=0==e&&2==N?tt:t[e];K?i=null!==(o=a.values(r,e,n))&&void 0!==o?o:G:(i=a.value(r,null==n?null:l[n],e,n),i=null==i?G:{_:i}),j.values[e]=i}function on(e,n,i){let a;Et=Tt,Mt=Nt,[Tt,Nt]=Ce.move(r,Tt,Nt),Ce.left=Tt,Ce.top=Nt,Ce.show&&(wt&&zo(wt,li(Tt),0,ie,ae),kt&&zo(kt,0,li(Nt),ie,ae));let l=He>Ue;Zt=vi;let s=0==T.ori?ie:ae,c=1==T.ori?ie:ae;if(Tt<0||0==Ve||l){a=Ce.idx=null;for(let e=0;e<_.length;e++)e>0&&Le.length>1&&zo(Le[e],-10,-10,ie,ae);Pe&&Yt(null,Gt,!0,null==e&&Sn.setSeries),j.live&&(F.fill(a),ke=!0)}else{let e,n,i;1==o&&(e=0==T.ori?Tt:Nt,n=Qt(e,A),a=Ce.idx=Bo(n,t[0],He,Ue),i=O(t[0][a],T,s,0));for(let l=2==o?1:0;l<_.length;l++){let e=_[l],u=F[l],d=null==u?null:1==o?t[l][u]:t[l][1][u],h=Ce.dataIdx(r,l,a,n),f=null==h?null:1==o?t[l][h]:t[l][1][h];ke=ke||f!=d||h!=u,F[l]=h;let p=h==a?i:O(1==o?t[0][h]:t[l][0][h],T,s,0);if(l>0&&e.show){let t,n,i=null==f?-10:P(f,1==o?x[e.scale]:x[e.facets[1].scale],c,0);if(Pe&&null!=f){let t=1==T.ori?Tt:Nt,n=ii(Oe.dist(r,l,h,i,t));if(n=0?1:-1;i==(f>=0?1:-1)&&(1==i?1==r?f>=o:f<=o:1==r?f<=o:f>=o)&&(Zt=n,qt=l)}else Zt=n,qt=l}}if(0==T.ori?(t=p,n=i):(t=i,n=p),ke&&Le.length>1){Io(Le[l],Ce.points.fill(r,l),Ce.points.stroke(r,l));let e,o,i,a,s=!0,c=Ce.points.bbox;if(null!=c){s=!1;let t=c(r,l);i=t.left,a=t.top,e=t.width,o=t.height}else i=t,a=n,e=o=Ce.points.size(r,l);Fo(Le[l],e,o,s),Re[l]=i,ze[l]=a,zo(Le[l],Ei(i,1),Ei(a,1),ie,ae)}}}}if(Ht.show&&$t)if(null!=e){let[t,n]=Sn.scales,[r,o]=Sn.match,[i,a]=e.cursor.sync.scales,l=e.cursor.drag;if(jt=l._x,Vt=l._y,jt||Vt){let l,u,d,h,f,{left:p,top:m,width:v,height:g}=e.select,y=e.scales[t].ori,_=e.posToVal,b=null!=t&&r(t,i),w=null!=n&&o(n,a);b&&jt?(0==y?(l=p,u=v):(l=m,u=g),d=x[t],h=O(_(l,i),d,s,0),f=O(_(l+u,i),d,s,0),en(ci(h,f),ii(f-h))):en(0,s),w&&Vt?(1==y?(l=p,u=v):(l=m,u=g),d=x[n],h=P(_(l,a),d,c,0),f=P(_(l+u,a),d,c,0),tn(ci(h,f),ii(f-h))):tn(0,c)}else dn()}else{let e=ii(Et-xt),t=ii(Mt-St);if(1==T.ori){let n=e;e=t,t=n}jt=Ft.x&&e>=Ft.dist,Vt=Ft.y&&t>=Ft.dist;let n,r,o=Ft.uni;null!=o?jt&&Vt&&(jt=e>=o,Vt=t>=o,jt||Vt||(t>e?Vt=!0:jt=!0)):Ft.x&&Ft.y&&(jt||Vt)&&(jt=Vt=!0),jt&&(0==T.ori?(n=At,r=Tt):(n=Ct,r=Nt),en(ci(n,r),ii(r-n)),Vt||tn(0,c)),Vt&&(1==T.ori?(n=At,r=Tt):(n=Ct,r=Nt),tn(ci(n,r),ii(r-n)),jt||en(0,s)),jt||Vt||(en(0,0),tn(0,0))}if(Ft._x=jt,Ft._y=Vt,null==e){if(i){if(null!=An){let[e,t]=Sn.scales;Sn.values[0]=null!=e?Qt(0==T.ori?Tt:Nt,e):null,Sn.values[1]=null!=t?Qt(1==T.ori?Tt:Nt,t):null}En(po,r,Tt,Nt,ie,ae,a)}if(Pe){let e=i&&Sn.setSeries,t=Oe.prox;null==Kt?Zt<=t&&Yt(qt,Gt,!0,e):Zt>t?Yt(null,Gt,!0,e):qt!=Kt&&Yt(qt,Gt,!0,e)}}ke&&(j.idx=a,nn()),!1!==n&&kn("setCursor")}r.setLegend=nn;let an=null;function ln(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]?an=null:(an=m.getBoundingClientRect(),kn("syncRect",an))}function sn(e,t,n,r,o,i,a){Ce._lock||$t&&null!=e&&0==e.movementX&&0==e.movementY||(cn(e,t,n,r,o,i,a,!1,null!=e),null!=e?on(null,!0,!0):on(t,!0,!1))}function cn(e,t,n,o,i,a,l,c,u){if(null==an&&ln(!1),Te(e),null!=e)n=e.clientX-an.left,o=e.clientY-an.top;else{if(n<0||o<0)return Tt=-10,void(Nt=-10);let[e,r]=Sn.scales,l=t.cursor.sync,[c,u]=l.values,[d,h]=l.scales,[f,p]=Sn.match,m=t.axes[0].side%2==1,v=0==T.ori?ie:ae,g=1==T.ori?ie:ae,y=m?a:i,_=m?i:a,b=m?o:n,w=m?n:o;if(n=null!=d?f(e,d)?s(c,x[e],v,0):-10:v*(b/y),o=null!=h?p(r,h)?s(u,x[r],g,0):-10:g*(w/_),1==T.ori){let e=n;n=o,o=e}}u&&((n<=1||n>=ie-1)&&(n=Ci(n,ie)),(o<=1||o>=ae-1)&&(o=Ci(o,ae))),c?(xt=n,St=o,[At,Ct]=Ce.move(r,n,o)):(Tt=n,Nt=o)}Object.defineProperty(r,"rect",{get:()=>(null==an&&ln(!1),an)});const un={width:0,height:0,left:0,top:0};function dn(){Bt(un,!1)}let hn,fn,pn,mn;function vn(e,t,n,o,i,a,l){$t=!0,jt=Vt=Ft._x=Ft._y=!1,cn(e,t,n,o,i,a,0,!0,!1),null!=e&&(te(vo,So,gn,!1),En(mo,r,At,Ct,ie,ae,null));let{left:s,top:c,width:u,height:d}=Ht;hn=s,fn=c,pn=u,mn=d,dn()}function gn(e,t,n,o,i,a,l){$t=Ft._x=Ft._y=!1,cn(e,t,n,o,i,a,0,!1,!0);let{left:s,top:c,width:u,height:d}=Ht,h=u>0||d>0,f=hn!=s||fn!=c||pn!=u||mn!=d;if(h&&f&&Bt(Ht),Ft.setScale&&h&&f){let e=s,t=u,n=c,r=d;if(1==T.ori&&(e=c,t=d,n=s,r=u),jt&&Wt(A,Qt(e,A),Qt(e+t,A)),Vt)for(let o in x){let e=x[o];o!=A&&null==e.from&&e.min!=vi&&Wt(o,Qt(n+r,o),Qt(n,o))}dn()}else Ce.lock&&(Ce._lock=!Ce._lock,Ce._lock||on(null,!0,!1));null!=e&&(ne(vo,So),En(vo,r,Tt,Nt,ie,ae,null))}function yn(e,t,n,o,i,a,l){Ce._lock||(Te(e),ot(),dn(),null!=e&&En(_o,r,Tt,Nt,ie,ae,null))}function _n(){k.forEach(Jl),xe(r.width,r.height,!0)}Ho(wo,Ao,_n);const bn={};bn.mousedown=vn,bn.mousemove=sn,bn.mouseup=gn,bn.dblclick=yn,bn.setSeries=(e,t,n,o)=>{-1!=(n=(0,Sn.match[2])(r,t,n))&&Yt(n,o,!0,!1)},Ce.show&&(te(mo,m,vn),te(po,m,sn),te(go,m,(e=>{Te(e),ln(!1)})),te(yo,m,(function(e,t,n,r,o,i,a){if(Ce._lock)return;Te(e);let l=$t;if($t){let e,t,n=!0,r=!0,o=10;0==T.ori?(e=jt,t=Vt):(e=Vt,t=jt),e&&t&&(n=Tt<=o||Tt>=ie-o,r=Nt<=o||Nt>=ae-o),e&&n&&(Tt=Tt{e.call(null,r,t,n)}))}(e.plugins||[]).forEach((e=>{for(let t in e.hooks)wn[t]=(wn[t]||[]).concat(e.hooks[t])}));const xn=(e,t,n)=>n,Sn=Ui({key:null,setSeries:!1,filters:{pub:xi,sub:xi},scales:[A,_[1]?_[1].scale:null],match:[Si,Si,xn],values:[null,null]},Ce.sync);2==Sn.match.length&&Sn.match.push(xn),Ce.sync=Sn;const An=Sn.key,Cn=ul(An);function En(e,t,n,r,o,i,a){Sn.filters.pub(e,t,n,r,o,i,a)&&Cn.pub(e,t,n,r,o,i,a)}function Mn(){kn("init",e,t),rt(t||e.data,!1),L[A]?It(A,L[A]):ot(),we=Ht.show&&(Ht.width>0||Ht.height>0),be=ke=!0,xe(e.width,e.height)}return Cn.sub(r),r.pub=function(e,t,n,r,o,i,a){Sn.filters.sub(e,t,n,r,o,i,a)&&bn[e](null,t,n,r,o,i,a)},r.destroy=function(){var e;Cn.unsub(r),Il.delete(r),ee.clear(),Uo(wo,Ao,_n),u.remove(),null===(e=U)||void 0===e||e.remove(),kn("destroy")},_.forEach(De),k.forEach((function(e,t){if(e._show=e.show,e.show){let n=e.side%2,o=x[e.scale];null==o&&(e.scale=n?_[1].scale:A,o=x[e.scale]);let i=o.time;e.size=_i(e.size),e.space=_i(e.space),e.rotate=_i(e.rotate),Di(e.incrs)&&e.incrs.forEach((e=>{!Ni.has(e)&&Ni.set(e,Oi(e))})),e.incrs=_i(e.incrs||(2==o.distr?aa:i?1==y?_a:ka:la)),e.splits=_i(e.splits||(i&&1==o.distr?D:3==o.distr?Wa:4==o.distr?Ya:Ba)),e.stroke=_i(e.stroke),e.grid.stroke=_i(e.grid.stroke),e.ticks.stroke=_i(e.ticks.stroke),e.border.stroke=_i(e.border.stroke);let a=e.values;e.values=Di(a)&&!Di(a[0])?_i(a):i?Di(a)?Ca(R,Aa(a,z)):$i(a)?function(e,t){let n=ea(t);return(t,r,o,i,a)=>r.map((t=>n(e(t))))}(R,a):a||I:a||Ua,e.filter=_i(e.filter||(o.distr>=3&&10==o.log?Ja:3==o.distr&&2==o.log?Xa:wi)),e.font=Ql(e.font),e.labelFont=Ql(e.labelFont),e._size=e.size(r,null,t,0),e._space=e._rotate=e._incrs=e._found=e._splits=e._values=null,e._size>0&&(Ie[t]=!0,e._el=Lo("u-axis",f))}})),n?n instanceof HTMLElement?(n.appendChild(u),Mn()):n(r,Mn):Mn(),r}Xl.assign=Ui,Xl.fmtNum=ni,Xl.rangeNum=Jo,Xl.rangeLog=Yo,Xl.rangeAsinh=Zo,Xl.orient=hl,Xl.pxRatio=Eo,Xl.join=function(e,t){if(function(e){let t=e[0][0],n=t.length;for(let r=1;r1&&void 0!==arguments[1]?arguments[1]:100;const n=e.length;if(n<=1)return!0;let r=0,o=n-1;for(;r<=o&&null==e[r];)r++;for(;o>=r&&null==e[o];)o--;if(o<=r)return!0;const i=ui(1,ai((o-r+1)/t));for(let a=e[r],l=r+i;l<=o;l+=i){const t=e[l];if(null!=t){if(t<=a)return!1;a=t}}return!0}(t[0])||(t=function(e){let t=e[0],n=t.length,r=Array(n);for(let i=0;it[e]-t[n]));let o=[];for(let i=0;ie-t))],o=r[0].length,i=new Map;for(let a=0;ahl(e,i,((s,c,u,d,h,f,p,m,v,g,y)=>{let _=s.pxRound,{left:b,width:w}=e.bbox,k=e=>_(f(e,d,g,m)),x=e=>_(p(e,h,y,v)),S=0==d.ori?kl:xl;const A={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:dl},C=A.stroke,E=d.dir*(0==d.ori?1:-1);a=Wo(u,a,l,1),l=Wo(u,a,l,-1);let M=x(u[1==E?a:l]),T=k(c[1==E?a:l]),N=T,O=T;o&&-1==t&&(O=b,S(C,O,M)),S(C,T,M);for(let e=1==E?a:l;e>=a&&e<=l;e+=E){let n=u[e];if(null==n)continue;let r=k(c[e]),o=x(n);1==t?S(C,r,M):S(C,N,o),S(C,r,o),M=o,N=r}let P=N;o&&1==t&&(P=b+w,S(C,P,M));let[L,R]=fl(e,i);if(null!=s.fill||0!=L){let t=A.fill=new Path2D(C),n=x(s.fillTo(e,i,s.min,s.max,L));S(t,P,n),S(t,O,n)}if(!s.spanGaps){let o=[];o.push(...gl(c,u,a,l,E,k,r));let h=s.width*Eo/2,f=n||1==t?h:-h,p=n||-1==t?-h:h;o.forEach((e=>{e[0]+=f,e[1]+=p})),A.gaps=o=s.gaps(e,i,a,l,o),A.clip=vl(o,d.ori,m,v,g,y)}return 0!=R&&(A.band=2==R?[ml(e,i,a,l,C,-1),ml(e,i,a,l,C,1)]:ml(e,i,a,l,C,R)),A}))},e.bars=function(e){const t=Xo((e=e||Li).size,[.6,vi,1]),n=e.align||0,r=e.gap||0;let o=e.radius;o=null==o?[0,0]:"number"==typeof o?[o,0]:o;const i=_i(o),a=1-t[0],l=Xo(t[1],vi),s=Xo(t[2],1),c=Xo(e.disp,Li),u=Xo(e.each,(e=>{})),{fill:d,stroke:h}=c;return(e,t,o,f)=>hl(e,t,((p,m,v,g,y,_,b,w,k,x,S)=>{let A,C,E=p.pxRound,M=n,T=r*Eo,N=l*Eo,O=s*Eo;0==g.ori?[A,C]=i(e,t):[C,A]=i(e,t);const P=g.dir*(0==g.ori?1:-1);let L,R,z,D=0==g.ori?Sl:Al,I=0==g.ori?u:(e,t,n,r,o,i,a)=>{u(e,t,n,o,r,a,i)},$=Xo(e.bands,Ri).find((e=>e.series[0]==t)),F=null!=$?$.dir:0,j=p.fillTo(e,t,p.min,p.max,F),V=E(b(j,y,S,k)),H=x,U=E(p.width*Eo),B=!1,W=null,Y=null,Z=null,q=null;null==d||0!=U&&null==h||(B=!0,W=d.values(e,t,o,f),Y=new Map,new Set(W).forEach((e=>{null!=e&&Y.set(e,new Path2D)})),U>0&&(Z=h.values(e,t,o,f),q=new Map,new Set(Z).forEach((e=>{null!=e&&q.set(e,new Path2D)}))));let{x0:K,size:G}=c;if(null!=K&&null!=G){M=1,m=K.values(e,t,o,f),2==K.unit&&(m=m.map((t=>e.posToVal(w+t*x,g.key,!0))));let n=G.values(e,t,o,f);R=2==G.unit?n[0]*x:_(n[0],g,x,w)-_(0,g,x,w),H=zl(m,v,_,g,x,w,H),z=H-R+T}else H=zl(m,v,_,g,x,w,H),z=H*a+T,R=H-z;z<1&&(z=0),U>=R/2&&(U=0),z<5&&(E=bi);let Q=z>0;R=E(yi(H-z-(Q?U:0),O,N)),L=(0==M?R/2:M==P?0:R)-M*P*((0==M?T/2:0)+(Q?U/2:0));const J={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},X=B?null:new Path2D;let ee=null;if(null!=$)ee=e.data[$.series[1]];else{let{y0:n,y1:r}=c;null!=n&&null!=r&&(v=r.values(e,t,o,f),ee=n.values(e,t,o,f))}let te=A*R,ne=C*R;for(let n=1==P?o:f;n>=o&&n<=f;n+=P){let r=v[n];if(null==r)continue;if(null!=ee){var re;let e=null!==(re=ee[n])&&void 0!==re?re:0;if(r-e==0)continue;V=b(e,y,S,k)}let o=_(2!=g.distr||null!=c?m[n]:n,g,x,w),i=b(Xo(r,j),y,S,k),a=E(o-L),l=E(ui(i,V)),s=E(ci(i,V)),u=l-s;if(null!=r){let o=r<0?ne:te,i=r<0?te:ne;B?(U>0&&null!=Z[n]&&D(q.get(Z[n]),a,s+ai(U/2),R,ui(0,u-U),o,i),null!=W[n]&&D(Y.get(W[n]),a,s+ai(U/2),R,ui(0,u-U),o,i)):D(X,a,s+ai(U/2),R,ui(0,u-U),o,i),I(e,t,n,a-U/2,s,R+U,u)}}if(U>0)J.stroke=B?q:X;else if(!B){var oe;J._fill=0==p.width?p._fill:null!==(oe=p._stroke)&&void 0!==oe?oe:p._fill,J.width=0}return J.fill=B?Y:X,J}))},e.spline=function(e){return function(e,t){const n=Xo(null===t||void 0===t?void 0:t.alignGaps,0);return(t,r,o,i)=>hl(t,r,((a,l,s,c,u,d,h,f,p,m,v)=>{let g,y,_,b=a.pxRound,w=e=>b(d(e,c,m,f)),k=e=>b(h(e,u,v,p));0==c.ori?(g=bl,_=kl,y=Ml):(g=wl,_=xl,y=Tl);const x=c.dir*(0==c.ori?1:-1);o=Wo(s,o,i,1),i=Wo(s,o,i,-1);let S=w(l[1==x?o:i]),A=S,C=[],E=[];for(let e=1==x?o:i;e>=o&&e<=i;e+=x)if(null!=s[e]){let t=w(l[e]);C.push(A=t),E.push(k(s[e]))}const M={stroke:e(C,E,g,_,y,b),fill:null,clip:null,band:null,gaps:null,flags:dl},T=M.stroke;let[N,O]=fl(t,r);if(null!=a.fill||0!=N){let e=M.fill=new Path2D(T),n=k(a.fillTo(t,r,a.min,a.max,N));_(e,A,n),_(e,S,n)}if(!a.spanGaps){let e=[];e.push(...gl(l,s,o,i,x,w,n)),M.gaps=e=a.gaps(t,r,o,i,e),M.clip=vl(e,c.ori,f,p,m,v)}return 0!=O&&(M.band=2==O?[ml(t,r,o,i,T,-1),ml(t,r,o,i,T,1)]:ml(t,r,o,i,T,O)),M}))}(Dl,e)}}((e,t,n)=>{const r=[];for(let o=0;oMath.round(e))).join(", "))}r.map((e=>"rgb(".concat(e,")")))})([246,226,219],[127,39,4],16);function es(e,t){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.add(e)}function ts(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function ns(e){return ns="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ns(e)}function rs(e){var t=function(e,t){if("object"!=ns(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ns(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ns(t)?t:String(t)}function os(e,t,n){return(t=rs(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function is(){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 as={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};function ls(e){as=e}const ss=/[&<>"']/,cs=new RegExp(ss.source,"g"),us=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ds=new RegExp(us.source,"g"),hs={"&":"&","<":"<",">":">",'"':""","'":"'"},fs=e=>hs[e];function ps(e,t){if(t){if(ss.test(e))return e.replace(cs,fs)}else if(us.test(e))return e.replace(ds,fs);return e}const ms=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function vs(e){return e.replace(ms,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const gs=/(^|[^\[])\^/g;function ys(e,t){e="string"===typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(gs,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const _s=/[^\w:]/g,bs=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ws(e,t,n){if(e){let e;try{e=decodeURIComponent(vs(n)).replace(_s,"").toLowerCase()}catch(Au){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!bs.test(n)&&(n=function(e,t){ks[" "+e]||(xs.test(e)?ks[" "+e]=e+"/":ks[" "+e]=Ms(e,"/",!0));e=ks[" "+e];const n=-1===e.indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(Ss,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(As,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(Au){return null}return n}const ks={},xs=/^[^:]+:\/*[^/]*$/,Ss=/^([^:]+:)[\s\S]*$/,As=/^([^:]+:\/*[^/]*)[\s\S]*$/;const Cs={exec:function(){}};function Es(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Ms(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=Ms(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,o,i,a,l,s,c,u,d,h,f,p=t[1].trim();const m=p.length>1,v={type:"list",raw:"",ordered:m,start:m?+p.slice(0,-1):"",loose:!1,items:[]};p=m?"\\d{1,9}\\".concat(p.slice(-1)):"\\".concat(p),this.options.pedantic&&(p=m?p:"[*+-]");const g=new RegExp("^( {0,3}".concat(p,")((?:[\t ][^\\n]*)?(?:\\n|$))"));for(;e&&(f=!1,t=g.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),c=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),u=e.split("\n",1)[0],this.options.pedantic?(i=2,h=c.trimLeft()):(i=t[2].search(/[^ ]/),i=i>4?1:i,h=c.slice(i),i+=t[1].length),l=!1,!c&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),f=!0),!f){const t=new RegExp("^ {0,".concat(Math.min(3,i-1),"}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))")),r=new RegExp("^ {0,".concat(Math.min(3,i-1),"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)")),o=new RegExp("^ {0,".concat(Math.min(3,i-1),"}(?:```|~~~)")),a=new RegExp("^ {0,".concat(Math.min(3,i-1),"}#"));for(;e&&(d=e.split("\n",1)[0],u=d,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!o.test(u))&&!a.test(u)&&!t.test(u)&&!r.test(e);){if(u.search(/[^ ]/)>=i||!u.trim())h+="\n"+u.slice(i);else{if(l)break;if(c.search(/[^ ]/)>=4)break;if(o.test(c))break;if(a.test(c))break;if(r.test(c))break;h+="\n"+u}l||u.trim()||(l=!0),n+=d+"\n",e=e.substring(d.length+1),c=u.slice(i)}}v.loose||(s?v.loose=!0:/\n *\n *$/.test(n)&&(s=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(h),r&&(o="[ ] "!==r[0],h=h.replace(/^\[[ xX]\] +/,""))),v.items.push({type:"list_item",raw:n,task:!!r,checked:o,loose:!1,text:h}),v.raw+=n}v.items[v.items.length-1].raw=n.trimRight(),v.items[v.items.length-1].text=h.trimRight(),v.raw=v.raw.trimRight();const y=v.items.length;for(a=0;a"space"===e.type)),t=e.length>0&&e.some((e=>/\n.*\n/.test(e.raw)));v.loose=t}if(v.loose)for(a=0;a$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:Es(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,o,i,a=e.align.length;for(n=0;n({text:e})));for(a=e.header.length,r=0;r/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):ps(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=Ms(e.slice(0,-1),"\\");if((e.length-t.length)%2===0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,o=0;for(;o-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),Ts(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return Ts(n,e,n[0],this.lexer)}}emStrong(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=r[0].length-1;let o,i,a=n,l=0;const s="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(s.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=s.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(i=o.length,r[3]||r[4]){a+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){l+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a+l);const t=e.slice(0,n+r.index+i+1);if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const s=t.slice(2,-2);return{type:"strong",raw:t,text:s,tokens:this.lexer.inlineTokens(s)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=ps(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=ps(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=ps(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=ps(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=ps(n[0]),r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):ps(n[0]):n[0]:ps(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const Os={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:Cs,lheading:/^((?:(?!^bull ).|\n(?!\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Os.def=ys(Os.def).replace("label",Os._label).replace("title",Os._title).getRegex(),Os.bullet=/(?:[*+-]|\d{1,9}[.)])/,Os.listItemStart=ys(/^( *)(bull) */).replace("bull",Os.bullet).getRegex(),Os.list=ys(Os.list).replace(/bull/g,Os.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Os.def.source+")").getRegex(),Os._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",Os._comment=/|$)/,Os.html=ys(Os.html,"i").replace("comment",Os._comment).replace("tag",Os._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Os.lheading=ys(Os.lheading).replace(/bull/g,Os.bullet).getRegex(),Os.paragraph=ys(Os._paragraph).replace("hr",Os.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",Os._tag).getRegex(),Os.blockquote=ys(Os.blockquote).replace("paragraph",Os.paragraph).getRegex(),Os.normal={...Os},Os.gfm={...Os.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},Os.gfm.table=ys(Os.gfm.table).replace("hr",Os.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",Os._tag).getRegex(),Os.gfm.paragraph=ys(Os._paragraph).replace("hr",Os.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Os.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",Os._tag).getRegex(),Os.pedantic={...Os.normal,html:ys("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Os._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:Cs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ys(Os.normal._paragraph).replace("hr",Os.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Os.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Ps={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Cs,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:Cs,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}Ps._punctuation="\\p{P}$+<=>`^|~",Ps.punctuation=ys(Ps.punctuation,"u").replace(/punctuation/g,Ps._punctuation).getRegex(),Ps.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,Ps.anyPunctuation=/\\[punct]/g,Ps._escapes=/\\([punct])/g,Ps._comment=ys(Os._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ps.emStrong.lDelim=ys(Ps.emStrong.lDelim,"u").replace(/punct/g,Ps._punctuation).getRegex(),Ps.emStrong.rDelimAst=ys(Ps.emStrong.rDelimAst,"gu").replace(/punct/g,Ps._punctuation).getRegex(),Ps.emStrong.rDelimUnd=ys(Ps.emStrong.rDelimUnd,"gu").replace(/punct/g,Ps._punctuation).getRegex(),Ps.anyPunctuation=ys(Ps.anyPunctuation,"gu").replace(/punct/g,Ps._punctuation).getRegex(),Ps._escapes=ys(Ps._escapes,"gu").replace(/punct/g,Ps._punctuation).getRegex(),Ps._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ps._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])?)+(?![-_])/,Ps.autolink=ys(Ps.autolink).replace("scheme",Ps._scheme).replace("email",Ps._email).getRegex(),Ps._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ps.tag=ys(Ps.tag).replace("comment",Ps._comment).replace("attribute",Ps._attribute).getRegex(),Ps._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ps._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ps._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ps.link=ys(Ps.link).replace("label",Ps._label).replace("href",Ps._href).replace("title",Ps._title).getRegex(),Ps.reflink=ys(Ps.reflink).replace("label",Ps._label).replace("ref",Os._label).getRegex(),Ps.nolink=ys(Ps.nolink).replace("ref",Os._label).getRegex(),Ps.reflinkSearch=ys(Ps.reflinkSearch,"g").replace("reflink",Ps.reflink).replace("nolink",Ps.nolink).getRegex(),Ps.normal={...Ps},Ps.pedantic={...Ps.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:ys(/^!?\[(label)\]\((.*?)\)/).replace("label",Ps._label).getRegex(),reflink:ys(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ps._label).getRegex()},Ps.gfm={...Ps.normal,escape:ys(Ps.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]*?(?:(?=[\\1&&void 0!==arguments[1]?arguments[1]:[];for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((n=>!!(t=n.call({lexer:this},e,i))&&(e=e.substring(t.raw.length),i.push(t),!0)))))if(t=this.tokenizer.space(e))e=e.substring(t.raw.length),1===t.raw.length&&i.length>0?i[i.length-1].raw+="\n":i.push(t);else if(t=this.tokenizer.code(e))e=e.substring(t.raw.length),n=i[i.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?i.push(t):(n.raw+="\n"+t.raw,n.text+="\n"+t.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(t=this.tokenizer.fences(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.heading(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.hr(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.blockquote(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.list(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.html(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.def(e))e=e.substring(t.raw.length),n=i[i.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title}):(n.raw+="\n"+t.raw,n.text+="\n"+t.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(t=this.tokenizer.table(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.lheading(e))e=e.substring(t.raw.length),i.push(t);else{if(r=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let o;this.options.extensions.startBlock.forEach((function(e){o=e.call({lexer:this},n),"number"===typeof o&&o>=0&&(t=Math.min(t,o))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(this.state.top&&(t=this.tokenizer.paragraph(r)))n=i[i.length-1],o&&"paragraph"===n.type?(n.raw+="\n"+t.raw,n.text+="\n"+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):i.push(t),o=r.length!==e.length,e=e.substring(t.raw.length);else if(t=this.tokenizer.text(e))e=e.substring(t.raw.length),n=i[i.length-1],n&&"text"===n.type?(n.raw+="\n"+t.raw,n.text+="\n"+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):i.push(t);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,i}inline(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e){let t,n,r,o,i,a,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(s));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(s));)s=s.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.anyPunctuation.exec(s));)s=s.slice(0,o.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(i||(a=""),i=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((n=>!!(t=n.call({lexer:this},e,l))&&(e=e.substring(t.raw.length),l.push(t),!0)))))if(t=this.tokenizer.escape(e))e=e.substring(t.raw.length),l.push(t);else if(t=this.tokenizer.tag(e))e=e.substring(t.raw.length),n=l[l.length-1],n&&"text"===t.type&&"text"===n.type?(n.raw+=t.raw,n.text+=t.text):l.push(t);else if(t=this.tokenizer.link(e))e=e.substring(t.raw.length),l.push(t);else if(t=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(t.raw.length),n=l[l.length-1],n&&"text"===t.type&&"text"===n.type?(n.raw+=t.raw,n.text+=t.text):l.push(t);else if(t=this.tokenizer.emStrong(e,s,a))e=e.substring(t.raw.length),l.push(t);else if(t=this.tokenizer.codespan(e))e=e.substring(t.raw.length),l.push(t);else if(t=this.tokenizer.br(e))e=e.substring(t.raw.length),l.push(t);else if(t=this.tokenizer.del(e))e=e.substring(t.raw.length),l.push(t);else if(t=this.tokenizer.autolink(e,Rs))e=e.substring(t.raw.length),l.push(t);else if(this.state.inLink||!(t=this.tokenizer.url(e,Rs))){if(r=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let o;this.options.extensions.startInline.forEach((function(e){o=e.call({lexer:this},n),"number"===typeof o&&o>=0&&(t=Math.min(t,o))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(t=this.tokenizer.inlineText(r,Ls))e=e.substring(t.raw.length),"_"!==t.raw.slice(-1)&&(a=t.raw.slice(-1)),i=!0,n=l[l.length-1],n&&"text"===n.type?(n.raw+=t.raw,n.text+=t.text):l.push(t);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(t.raw.length),l.push(t);return l}}class Ds{constructor(e){this.options=e||as}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'
'+(n?e:ps(e,!0))+"
\n":"
"+(n?e:ps(e,!0))+"
\n"}blockquote(e){return"
\n".concat(e,"
\n")}html(e,t){return e}heading(e,t,n,r){if(this.options.headerIds){const o=this.options.headerPrefix+r.slug(n);return"').concat(e,"\n")}return"").concat(e,"\n")}hr(){return this.options.xhtml?"
\n":"
\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e){return"
  • ".concat(e,"
  • \n")}checkbox(e){return" "}paragraph(e){return"

    ".concat(e,"

    \n")}table(e,t){return t&&(t="".concat(t,"")),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return"\n".concat(e,"\n")}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<".concat(n,' align="').concat(t.align,'">'):"<".concat(n,">"))+e+"\n")}strong(e){return"".concat(e,"")}em(e){return"".concat(e,"")}codespan(e){return"".concat(e,"")}br(){return this.options.xhtml?"
    ":"
    "}del(e){return"".concat(e,"")}link(e,t,n){if(null===(e=ws(this.options.sanitize,this.options.baseUrl,e)))return n;let r='",r}image(e,t,n){if(null===(e=ws(this.options.sanitize,this.options.baseUrl,e)))return n;let r='').concat(n,'":">",r}text(e){return e}}class Is{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class $s{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class Fs{constructor(e){this.options=e||as,this.options.renderer=this.options.renderer||new Ds,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Is,this.slugger=new $s}static parse(e,t){return new Fs(t).parse(e)}static parseInline(e,t){return new Fs(t).parseInline(e)}parse(e){let t,n,r,o,i,a,l,s,c,u,d,h,f,p,m,v,g,y,_,b=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],w="";const k=e.length;for(t=0;t0&&"paragraph"===m.tokens[0].type?(m.tokens[0].text=y+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&"text"===m.tokens[0].tokens[0].type&&(m.tokens[0].tokens[0].text=y+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:y}):p+=y),p+=this.parse(m.tokens,f),c+=this.renderer.listitem(p,g,v);w+=this.renderer.list(c,d,h);continue;case"html":w+=this.renderer.html(u.text,u.block);continue;case"paragraph":w+=this.renderer.paragraph(this.parseInline(u.tokens));continue;case"text":for(c=u.tokens?this.parseInline(u.tokens):u.text;t+1{"function"===typeof r&&(o=r,r=null);const i={...r};r={...this.defaults,...i};const a=ts(this,Hs,Bs).call(this,r.silent,r.async,o);if("undefined"===typeof n||null===n)return a(new Error("marked(): input parameter is undefined or null"));if("string"!==typeof n)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(function(e,t){e&&!e.silent&&(t&&console.warn("marked(): callback is deprecated since version 5.0.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/using_pro#async"),(e.sanitize||e.sanitizer)&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options"),(e.highlight||"language-"!==e.langPrefix)&&console.warn("marked(): highlight and langPrefix parameters are deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-highlight."),e.mangle&&console.warn("marked(): mangle parameter is enabled by default, but is deprecated since version 5.0.0, and will be removed in the future. To clear this warning, install https://www.npmjs.com/package/marked-mangle, or disable by setting `{mangle: false}`."),e.baseUrl&&console.warn("marked(): baseUrl parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-base-url."),e.smartypants&&console.warn("marked(): smartypants parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-smartypants."),e.xhtml&&console.warn("marked(): xhtml parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-xhtml."),(e.headerIds||e.headerPrefix)&&console.warn("marked(): headerIds and headerPrefix parameters enabled by default, but are deprecated since version 5.0.0, and will be removed in the future. To clear this warning, install https://www.npmjs.com/package/marked-gfm-heading-id, or disable by setting `{headerIds: false}`."))}(r,o),r.hooks&&(r.hooks.options=r),o){const i=r.highlight;let l;try{r.hooks&&(n=r.hooks.preprocess(n)),l=e(n,r)}catch(Au){return a(Au)}const s=e=>{let n;if(!e)try{r.walkTokens&&this.walkTokens(l,r.walkTokens),n=t(l,r),r.hooks&&(n=r.hooks.postprocess(n))}catch(Au){e=Au}return r.highlight=i,e?a(e):o(null,n)};if(!i||i.length<3)return s();if(delete r.highlight,!l.length)return s();let c=0;return this.walkTokens(l,(e=>{"code"===e.type&&(c++,setTimeout((()=>{i(e.text,e.lang,((t,n)=>{if(t)return s(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),c--,0===c&&s()}))}),0))})),void(0===c&&s())}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then((t=>e(t,r))).then((e=>r.walkTokens?Promise.all(this.walkTokens(e,r.walkTokens)).then((()=>e)):e)).then((e=>t(e,r))).then((e=>r.hooks?r.hooks.postprocess(e):e)).catch(a);try{r.hooks&&(n=r.hooks.preprocess(n));const o=e(n,r);r.walkTokens&&this.walkTokens(o,r.walkTokens);let i=t(o,r);return r.hooks&&(i=r.hooks.postprocess(i)),i}catch(Au){return a(Au)}}}function Bs(e,t,n){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+ps(r.message+"",!0)+"
    ";return t?Promise.resolve(e):n?void n(null,e):e}if(t)return Promise.reject(r);if(!n)throw r;n(r)}}const Ws=new class{constructor(){es(this,Hs),es(this,Vs),os(this,"defaults",{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}),os(this,"options",this.setOptions),os(this,"parse",ts(this,Vs,Us).call(this,zs.lex,Fs.parse)),os(this,"parseInline",ts(this,Vs,Us).call(this,zs.lexInline,Fs.parseInline)),os(this,"Parser",Fs),os(this,"parser",Fs.parse),os(this,"Renderer",Ds),os(this,"TextRenderer",Is),os(this,"Lexer",zs),os(this,"lexer",zs.lex),os(this,"Tokenizer",Ns),os(this,"Slugger",$s),os(this,"Hooks",js),this.use(...arguments)}walkTokens(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":for(const e of r.header)n=n.concat(this.walkTokens(e.tokens,t));for(const e of r.rows)for(const r of e)n=n.concat(this.walkTokens(r.tokens,t));break;case"list":n=n.concat(this.walkTokens(r.items,t));break;default:this.defaults.extensions&&this.defaults.extensions.childTokens&&this.defaults.extensions.childTokens[r.type]?this.defaults.extensions.childTokens[r.type].forEach((e=>{n=n.concat(this.walkTokens(r[e],t))})):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,t)))}return n}use(){const e=this.defaults.extensions||{renderers:{},childTokens:{}};for(var t=arguments.length,n=new Array(t),r=0;r{const n={...t};if(n.async=this.defaults.async||n.async||!1,t.extensions&&(t.extensions.forEach((t=>{if(!t.name)throw new Error("extension name required");if(t.renderer){const n=e.renderers[t.name];e.renderers[t.name]=n?function(){for(var e=arguments.length,r=new Array(e),o=0;o{if(this.defaults.async)return Promise.resolve(t.hooks[n].call(e,o)).then((t=>r.call(e,t)));const i=t.hooks[n].call(e,o);return r.call(e,i)}:e[n]=function(){for(var o=arguments.length,i=new Array(o),a=0;a{const t='$1 target="_blank" class="'.concat("vm-link vm-link_colored",'" $2').concat("https://docs.victoriametrics.com/MetricsQL.html","#");return e.replace(/({var n;const r="h3"===e.tagName.toLowerCase();return t=r?null!==(n=e.textContent)&&void 0!==n?n:"":t,r?null:((e,t)=>{var n;const r=null!==(n=t.textContent)&&void 0!==n?n:"",o=(e=>{const t=[];let n=e.nextElementSibling;for(;n&&"p"===n.tagName.toLowerCase();)n&&t.push(n),n=n.nextElementSibling;return t})(t).map((e=>{var t;return null!==(t=e.outerHTML)&&void 0!==t?t:""})).join("\n");return{type:e,value:r,description:qs(o),icon:pt(Hn,{})}})(t,e)})).filter(Boolean)},Gs=()=>{const{metricsQLFunctions:e}=ln(),n=sn();return(0,t.useEffect)((()=>{e.length||(async()=>{try{const e=await fetch(Zs),t=(e=>{const t=document.createElement("div");t.innerHTML=Ys(e);const n=t.querySelectorAll("".concat("h3",", ").concat("h4"));return Ks(n)})(await e.text());n({type:"SET_METRICSQL_FUNCTIONS",payload:t})}catch(Au){console.error("Error fetching or processing the MetricsQL.md file:",Au)}})()}),[]),e},Qs=e=>{let{value:n,anchorEl:r,caretPosition:i,onSelect:a,onFoundOptions:l}=e;const[s,c]=(0,t.useState)(0),u=Gs(),d=(0,t.useMemo)((()=>{const e=n.split("}");return e[e.length-1]}),[n]),h=(0,t.useMemo)((()=>{const e=d.match(/\b[^{}(),\s]+(?={|$)/g);return e?e[0]:""}),[d]),f=(0,t.useMemo)((()=>{const e=d.match(/[a-z_:-][\w\-.:/]*\b(?=\s*(=|!=|=~|!~))/g);return e?e[e.length-1]:""}),[d]),p=(0,t.useMemo)((()=>{if(!n||n.endsWith("}")||(e=>{const t=e.split(/\s+/),n=t.length,r=t[n-1],o=t[n-2],i=!r&&(e=>{const t=e.match(/"/g);return!!t&&t.length%2!==0})(e),a=(!r||t.length>1)&&!/([(),+\-*/^]|\b(?:or|and|unless|default|ifnot|if|group_left|group_right)\b)/.test(o);return i||a})(n))return ot.empty;const e=/\{[^}]*$/;switch(!0){case new RegExp("(".concat(Xr(h),")?{?.+").concat(Xr(f),'(=|!=|=~|!~)"?([^"]*)$'),"g").test(n):return ot.labelValue;case e.test(n):return ot.label;default:return ot.metricsql}}),[n,h,f]),m=(0,t.useMemo)((()=>{const e=n.match(/([\w_\-.:/]+(?![},]))$/);return e?e[0]:""}),[n]),{metrics:v,labels:g,labelValues:y,loading:_}=(e=>{let{valueByContext:n,metric:r,label:i,context:a}=e;const{serverUrl:l}=vt(),{period:{start:s,end:c}}=Gt(),{autocompleteCache:u}=ln(),d=sn(),[h,f]=(0,t.useState)(!1),[p,m]=(0,t.useState)(n),v=Jr()(m,500);(0,t.useEffect)((()=>(v(n),v.cancel)),[n,v]);const[g,y]=(0,t.useState)([]),[_,b]=(0,t.useState)([]),[w,k]=(0,t.useState)([]),x=(0,t.useRef)(new AbortController),S=(0,t.useCallback)((e=>{const t=o()(1e3*s).startOf("day").valueOf()/1e3,n=o()(1e3*c).endOf("day").valueOf()/1e3;return new URLSearchParams({...e||{},limit:"".concat(en),start:"".concat(t),end:"".concat(n)})}),[s,c]),A=(e,t)=>e.map((e=>({value:e,type:"".concat(t),icon:no[t]}))),C=async e=>{let{value:t,urlSuffix:n,setter:r,type:o,params:i}=e;if(!t&&o===to.metric)return;x.current.abort(),x.current=new AbortController;const{signal:a}=x.current,s={type:o,value:t,start:(null===i||void 0===i?void 0:i.get("start"))||"",end:(null===i||void 0===i?void 0:i.get("end"))||"",match:(null===i||void 0===i?void 0:i.get("match[]"))||""};f(!0);try{const e=u.get(s);if(e)return void r(A(e,o));const t=await fetch("".concat(l,"/api/v1/").concat(n,"?").concat(i),{signal:a});if(t.ok){const{data:e}=await t.json();r(A(e,o)),d({type:"SET_AUTOCOMPLETE_CACHE",payload:{key:s,value:e}})}}catch(Au){Au instanceof Error&&"AbortError"!==Au.name&&(d({type:"SET_AUTOCOMPLETE_CACHE",payload:{key:s,value:[]}}),console.error(Au))}finally{f(!1)}};return(0,t.useEffect)((()=>{const e=a!==ot.metricsql&&a!==ot.empty;if(!l||!r||e)return;y([]);const t=eo(Xr(r));return C({value:p,urlSuffix:"label/__name__/values",setter:y,type:to.metric,params:S({"match[]":'{__name__=~".*'.concat(t,'.*"}')})}),()=>{var e;return null===(e=x.current)||void 0===e?void 0:e.abort()}}),[l,p,a,r]),(0,t.useEffect)((()=>{if(!l||!r||a!==ot.label)return;b([]);const e=eo(r);return C({value:p,urlSuffix:"labels",setter:b,type:to.label,params:S({"match[]":'{__name__="'.concat(e,'"}')})}),()=>{var e;return null===(e=x.current)||void 0===e?void 0:e.abort()}}),[l,p,a,r]),(0,t.useEffect)((()=>{if(!l||!r||!i||a!==ot.labelValue)return;k([]);const e=eo(r),t=eo(Xr(p));return C({value:p,urlSuffix:"label/".concat(i,"/values"),setter:k,type:to.labelValue,params:S({"match[]":'{__name__="'.concat(e,'", ').concat(i,'=~".*').concat(t,'.*"}')})}),()=>{var e;return null===(e=x.current)||void 0===e?void 0:e.abort()}}),[l,p,a,r,i]),{metrics:g,labels:_,labelValues:w,loading:h}})({valueByContext:m,metric:h,label:f,context:p}),b=(0,t.useMemo)((()=>{switch(p){case ot.metricsql:return[...v,...u];case ot.label:return g;case ot.labelValue:return y;default:return[]}}),[p,v,g,y]);return(0,t.useEffect)((()=>{if(!r.current)return void c(0);const e=window.getComputedStyle(r.current),t="".concat(e.getPropertyValue("font-size")),o="".concat(e.getPropertyValue("font-family")),i=((e,t)=>{const n=document.createElement("span");n.innerText=e,n.style.cssText="position: absolute; z-index: -1; pointer-events: none; opacity: 0; font: ".concat(t),document.body.appendChild(n);const r=n.offsetWidth;return n.remove(),r})(n,"".concat(t," ").concat(o));c(i)}),[r,i]),pt(ht.FK,{children:pt(Gr,{loading:_,disabledFullScreen:!0,value:m,options:b,anchor:r,minLength:0,offset:{top:0,left:s},onSelect:e=>{const t=n.lastIndexOf(m,i[0]),r=t+m.length,o=n.substring(0,t),l=n.substring(r);if(p===ot.labelValue){const t='"',n=/(?:=|!=|=~|!~)$/.test(o);e="".concat(n?t:"").concat(e)}const s="".concat(o).concat(e).concat(l);a(s)},onFoundOptions:l,maxDisplayResults:{limit:Xt,message:"Please, specify the query more precisely."}})})},Js="No match! \nThis query hasn't selected any time series from database.\nEither the requested metrics are missing in the database,\nor there is a typo in series selector.",Xs="The shown results are marked as PARTIAL.\nThe result is marked as partial if one or more vmstorage nodes failed to respond to the query.",ec=e=>{let{value:n,onChange:r,onEnter:o,onArrowUp:i,onArrowDown:a,autocomplete:l,error:s,stats:c,label:u,disabled:d=!1}=e;const{autocompleteQuick:h}=ln(),{isMobile:f}=dr(),[p,m]=(0,t.useState)(!1),[v,g]=(0,t.useState)([0,0]),y=(0,t.useRef)(null),_=[{show:"0"===(null===c||void 0===c?void 0:c.seriesFetched)&&!c.resultLength,text:Js},{show:null===c||void 0===c?void 0:c.isPartial,text:Xs}].filter((e=>e.show)).map((e=>e.text)).join("");c&&(u="".concat(u," (").concat(c.executionTimeMsec||0,"ms)"));return(0,t.useEffect)((()=>{m(l)}),[h]),pt("div",{className:"vm-query-editor",ref:y,children:[pt(qr,{value:n,label:u,type:"textarea",autofocus:!f,error:s,warning:_,onKeyDown:e=>{const{key:t,ctrlKey:n,metaKey:r,shiftKey:l}=e,s=(e.target.value||"").split("\n").length>1,c=n||r,u="ArrowDown"===t,d="Enter"===t;"ArrowUp"===t&&c&&(e.preventDefault(),i()),u&&c&&(e.preventDefault(),a()),d&&p&&e.preventDefault(),!d||l||s&&!c||p||(e.preventDefault(),o())},onChange:r,onChangeCaret:e=>{g(e)},disabled:d,inputmode:"search"}),l&&pt(Qs,{value:n,anchorEl:y,caretPosition:v,onSelect:e=>{r(e)},onFoundOptions:e=>{m(!!e.length)}})]})},tc=e=>{let{query:n,limit:r,error:o,onChange:i,onChangeLimit:a,onRun:l}=e;const{isMobile:s}=dr(),[c,u]=(0,t.useState)(""),[d,h]=(0,t.useState)(r);return(0,t.useEffect)((()=>{h(r)}),[r]),pt("div",{className:Yn()({"vm-explore-logs-header":!0,"vm-block":!0,"vm-block_mobile":s}),children:[pt("div",{className:"vm-explore-logs-header-top",children:[pt(ec,{value:n,autocomplete:!1,onArrowUp:()=>null,onArrowDown:()=>null,onEnter:l,onChange:i,label:"Log query",error:o}),pt(qr,{label:"Limit entries",type:"number",value:d,error:c,onChange:e=>{const t=+e;h(t),isNaN(t)||t<0?u("Number must be bigger than zero"):(u(""),a(t))},onEnter:l})]}),pt("div",{className:"vm-explore-logs-header-bottom",children:[pt("div",{className:"vm-explore-logs-header-bottom-helpful",children:[pt("a",{className:"vm-link vm-link_with-icon",target:"_blank",href:"https://docs.victoriametrics.com/VictoriaLogs/LogsQL.html",rel:"help noreferrer",children:[pt(vn,{}),"Query language docs"]}),pt("a",{className:"vm-link vm-link_with-icon",target:"_blank",href:"https://docs.victoriametrics.com/VictoriaLogs/",rel:"help noreferrer",children:[pt(zn,{}),"Documentation"]})]}),pt("div",{className:"vm-explore-logs-header-bottom__execute",children:pt(Ar,{startIcon:pt(En,{}),onClick:l,fullWidth:!0,children:"Execute Query"})})]})]})},nc=Number(We("LOGS_LIMIT")),rc=isNaN(nc)?1e3:nc,oc=()=>{const{serverUrl:e}=vt(),{duration:n,relativeTime:r,period:i}=Gt(),{setSearchParamsFromKeys:a}=Mr(),[l,s]=Er(rc,"limit"),[c,u]=Er("","query"),{logs:d,isLoading:h,error:f,fetchLogs:p}=((e,n,r)=>{const{period:i}=Gt(),[a,l]=(0,t.useState)([]),[s,c]=(0,t.useState)(!1),[u,d]=(0,t.useState)(),h=(0,t.useMemo)((()=>(e=>"".concat(e,"/select/logsql/query"))(e)),[e]),f=(0,t.useMemo)((()=>{if(!/_time/.test(n)){const e=o()(1e3*i.start).tz().toISOString(),t=o()(1e3*i.end).tz().toISOString(),r="_time:[".concat(e,", ").concat(t,"]");return"".concat(r," AND (").concat(n,")")}return n}),[n,i]),p=(0,t.useMemo)((()=>({method:"POST",headers:{Accept:"application/stream+json"},body:new URLSearchParams({query:f.trim(),limit:"".concat(r)})})),[f,r]),m=e=>{try{return JSON.parse(e)}catch(Au){return null}},v=(0,t.useCallback)((async()=>{const e=Number(p.body.get("limit"))+1;c(!0),d(void 0);try{const t=await fetch(h,p);if(!t.ok||!t.body){const e=await t.text();return d(e),l([]),void c(!1)}const n=t.body.getReader(),r=new TextDecoder("utf-8"),o=[];for(;n;){const{done:t,value:i}=await n.read();if(t)break;const a=r.decode(i,{stream:!0}).split("\n");if(o.push(...a),o.length>e&&o.splice(0,o.length-e),o.length>=e){n.cancel();break}}const i=o.map(m).filter((e=>e));l(i)}catch(Au){console.error(Au),l([]),Au instanceof Error&&d("".concat(Au.name,": ").concat(Au.message))}c(!1)}),[h,p]);return{logs:a,isLoading:s,error:u,fetchLogs:v}})(e,c,l),[m,v]=(0,t.useState)(""),[g,y]=(0,t.useState)(!1),_=()=>{c?(p().then((()=>{y(!0)})),a({query:c,"g0.range_input":n,"g0.end_input":i.date,"g0.relative_time":r||"none"})):v(nt.validQuery)};return(0,t.useEffect)((()=>{c&&_()}),[i]),(0,t.useEffect)((()=>{v("")}),[c]),pt("div",{className:"vm-explore-logs",children:[pt(tc,{query:c,error:m,limit:l,onChange:u,onChangeLimit:e=>{s(e),a({limit:e}),Be("LOGS_LIMIT","".concat(e))},onRun:_}),h&&pt(Yr,{}),f&&pt(fr,{variant:"error",children:f}),pt(Wr,{data:d,loaded:g})]})},ic={home:"/",metrics:"/metrics",dashboards:"/dashboards",cardinality:"/cardinality",topQueries:"/top-queries",trace:"/trace",withTemplate:"/expand-with-exprs",relabel:"/relabeling",logs:"/logs",activeQueries:"/active-queries",queryAnalyzer:"/query-analyzer",icons:"/icons",anomaly:"/anomaly",query:"/query"},{REACT_APP_TYPE:ac}={REACT_APP_TYPE:"logs"},lc=ac===Ue.logs,sc={header:{tenant:!0,stepControl:!lc,timeSelector:!lc,executionControls:!lc}},cc={[ic.home]:{title:"Query",...sc},[ic.metrics]:{title:"Explore Prometheus metrics",header:{tenant:!0,stepControl:!0,timeSelector:!0}},[ic.cardinality]:{title:"Explore cardinality",header:{tenant:!0,cardinalityDatePicker:!0}},[ic.topQueries]:{title:"Top queries",header:{tenant:!0}},[ic.trace]:{title:"Trace analyzer",header:{}},[ic.queryAnalyzer]:{title:"Query analyzer",header:{}},[ic.dashboards]:{title:"Dashboards",...sc},[ic.withTemplate]:{title:"WITH templates",header:{}},[ic.relabel]:{title:"Metric relabel debug",header:{}},[ic.logs]:{title:"Logs Explorer",header:{}},[ic.activeQueries]:{title:"Active Queries",header:{}},[ic.icons]:{title:"Icons",header:{}},[ic.anomaly]:{title:"Anomaly exploration",...sc},[ic.query]:{title:"Query",...sc}},uc=ic,dc=e=>{let{activeMenu:t,label:n,value:r,color:o}=e;return pt(Re,{className:Yn()({"vm-header-nav-item":!0,"vm-header-nav-item_active":t===r}),style:{color:o},to:r,children:n})},hc=e=>{let{activeMenu:n,label:r,color:o,background:i,submenu:a,direction:l}=e;const{pathname:s}=te(),[c,u]=(0,t.useState)(null),d=(0,t.useRef)(null),{value:h,setFalse:f,setTrue:p}=Rr(!1),m=()=>{c&&clearTimeout(c);const e=setTimeout(f,300);u(e)};return(0,t.useEffect)((()=>{f()}),[s]),"column"===l?pt(ht.FK,{children:a.map((e=>pt(dc,{activeMenu:n,value:e.value||"",label:e.label||""},e.value)))}):pt("div",{className:Yn()({"vm-header-nav-item":!0,"vm-header-nav-item_sub":!0,"vm-header-nav-item_open":h,"vm-header-nav-item_active":a.find((e=>e.value===n))}),style:{color:o},onMouseEnter:()=>{p(),c&&clearTimeout(c)},onMouseLeave:m,ref:d,children:[r,pt(kn,{}),pt(Nr,{open:h,placement:"bottom-left",offset:{top:12,left:0},onClose:f,buttonRef:d,children:pt("div",{className:"vm-header-nav-item-submenu",style:{background:i},onMouseLeave:m,onMouseEnter:()=>{c&&clearTimeout(c)},children:a.map((e=>pt(dc,{activeMenu:n,value:e.value||"",label:e.label||"",color:o},e.value)))})})]})},fc={label:"Explore",submenu:[{label:cc[uc.metrics].title,value:uc.metrics},{label:cc[uc.cardinality].title,value:uc.cardinality},{label:cc[uc.topQueries].title,value:uc.topQueries},{label:cc[uc.activeQueries].title,value:uc.activeQueries}]},pc={label:"Tools",submenu:[{label:cc[uc.trace].title,value:uc.trace},{label:cc[uc.queryAnalyzer].title,value:uc.queryAnalyzer},{label:cc[uc.withTemplate].title,value:uc.withTemplate},{label:cc[uc.relabel].title,value:uc.relabel}]},mc=[{label:cc[uc.logs].title,value:uc.home}],vc=[{label:cc[uc.anomaly].title,value:uc.home},{label:cc[uc.home].title,value:uc.query}],gc=[{label:cc[uc.home].title,value:uc.home},fc,pc],yc=e=>{let{color:n,background:r,direction:o}=e;const i=je(),{dashboardsSettings:a}=(0,t.useContext)(gr).state,{pathname:l}=te(),[s,c]=(0,t.useState)(l),u=(0,t.useMemo)((()=>{switch("logs"){case Ue.logs:return mc;case Ue.anomaly:return vc;default:return[...gc,{label:cc[uc.dashboards].title,value:uc.dashboards,hide:i||!a.length}].filter((e=>!e.hide))}}),[i,a]);return(0,t.useEffect)((()=>{c(l)}),[l]),pt("nav",{className:Yn()({"vm-header-nav":!0,["vm-header-nav_".concat(o)]:o}),children:u.map((e=>e.submenu?pt(hc,{activeMenu:s,label:e.label||"",submenu:e.submenu,color:n,background:r,direction:o},e.label):pt(dc,{activeMenu:s,value:e.value||"",label:e.label||"",color:n},e.value)))})},_c=e=>{let{title:n,children:r,onClose:o,className:i,isOpen:a=!0}=e;const{isMobile:l}=dr(),s=re(),c=te(),u=(0,t.useCallback)((e=>{a&&"Escape"===e.key&&o()}),[a]),d=e=>{e.stopPropagation()},h=(0,t.useCallback)((()=>{a&&(s(c,{replace:!0}),o())}),[a,c,o]);return(0,t.useEffect)((()=>{if(a)return document.body.style.overflow="hidden",()=>{document.body.style.overflow="auto"}}),[a]),Gn("popstate",h),Gn("keyup",u),t.default.createPortal(pt("div",{className:Yn()({"vm-modal":!0,"vm-modal_mobile":l,["".concat(i)]:i}),onMouseDown:o,children:pt("div",{className:"vm-modal-content",children:[pt("div",{className:"vm-modal-content-header",onMouseDown:d,children:[n&&pt("div",{className:"vm-modal-content-header__title",children:n}),pt("div",{className:"vm-modal-header__close",children:pt(Ar,{variant:"text",size:"small",onClick:o,ariaLabel:"close",children:pt(pn,{})})})]}),pt("div",{className:"vm-modal-content-body",onMouseDown:d,children:r})]})}),document.body)},bc=pt("code",{children:ur()?"Cmd":"Ctrl"}),wc=[{title:"Zoom in",description:pt(ht.FK,{children:["To zoom in, hold down the ",bc," + ",pt("code",{children:"scroll up"}),", or press the ",pt("code",{children:"+"}),". Also, you can zoom in on a range on the graph by holding down your mouse button and selecting the range."]})},{title:"Zoom out",description:pt(ht.FK,{children:["To zoom out, hold down the ",bc," + ",pt("code",{children:"scroll down"}),", or press the ",pt("code",{children:"-"}),"."]})},{title:"Move horizontal axis",description:pt(ht.FK,{children:["To move the graph, hold down the ",bc," + ",pt("code",{children:"drag"})," the graph to the right or left."]})},{title:"Fixing a tooltip",description:pt(ht.FK,{children:["To fix the tooltip, ",pt("code",{children:"click"})," mouse when it's open. Then, you can drag the fixed tooltip by ",pt("code",{children:"clicking"})," and ",pt("code",{children:"dragging"})," on the ",pt(Rn,{})," icon."]})},{title:"Set a custom range for the vertical axis",description:pt(ht.FK,{children:["To set a custom range for the vertical axis, click on the ",pt(fn,{})," icon located in the upper right corner of the graph, activate the toggle, and set the values."]})}],kc=[{title:"Show/hide a legend item",description:pt(ht.FK,{children:[pt("code",{children:"click"})," on a legend item to isolate it on the graph.",bc," + ",pt("code",{children:"click"})," on a legend item to remove it from the graph. To revert to the previous state, click again."]})},{title:"Copy label key-value pairs",description:pt(ht.FK,{children:[pt("code",{children:"click"})," on a label key-value pair to save it to the clipboard."]})},{title:"Collapse/Expand the legend group",description:pt(ht.FK,{children:[pt("code",{children:"click"})," on the group name (e.g. ",pt("b",{children:'Query 1: {__name__!=""}'}),") to collapse or expand the legend."]})}],xc=wc.concat(kc),Sc=()=>{const{value:e,setFalse:t,setTrue:n}=Rr(!1);return pt(ht.FK,{children:[pt(Pr,{title:"Show tips on working with the graph",children:pt(Ar,{variant:"text",color:"gray",startIcon:pt(Fn,{}),onClick:n,ariaLabel:"open the tips"})}),e&&pt(_c,{title:"Tips on working with the graph and the legend",onClose:t,children:pt("div",{className:"fc-graph-tips",children:xc.map((e=>{let{title:t,description:n}=e;return pt("div",{className:"fc-graph-tips-item",children:[pt("h4",{className:"fc-graph-tips-item__action",children:t}),pt("p",{className:"fc-graph-tips-item__description",children:n})]},t)}))})})]})},Ac=pt("code",{children:ur()?"Cmd":"Ctrl"}),Cc=pt(ht.FK,{children:[pt("code",{children:ur()?"Option":"Ctrl"})," + ",pt("code",{children:"Space"})]}),Ec=[{title:"Query",list:[{keys:pt("code",{children:"Enter"}),description:"Run"},{keys:pt(ht.FK,{children:[pt("code",{children:"Shift"})," + ",pt("code",{children:"Enter"})]}),description:"Multi-line queries"},{keys:pt(ht.FK,{children:[Ac," + ",pt("code",{children:"Arrow Up"})]}),description:"Previous command from the Query history"},{keys:pt(ht.FK,{children:[Ac," + ",pt("code",{children:"Arrow Down"})]}),description:"Next command from the Query history"},{keys:pt(ht.FK,{children:[Ac," + ",pt("code",{children:"click"})," by ",pt(Pn,{})]}),description:"Toggle multiple queries"},{keys:Cc,description:"Show quick autocomplete tips"}]},{title:"Graph",readMore:pt(Sc,{}),list:[{keys:pt(ht.FK,{children:[Ac," + ",pt("code",{children:"scroll Up"})," or ",pt("code",{children:"+"})]}),description:"Zoom in"},{keys:pt(ht.FK,{children:[Ac," + ",pt("code",{children:"scroll Down"})," or ",pt("code",{children:"-"})]}),description:"Zoom out"},{keys:pt(ht.FK,{children:[Ac," + ",pt("code",{children:"drag"})]}),description:"Move the graph left/right"},{keys:pt(ht.FK,{children:pt("code",{children:"click"})}),description:"Select the series in the legend"},{keys:pt(ht.FK,{children:[Ac," + ",pt("code",{children:"click"})]}),description:"Toggle multiple series in the legend"}]}],Mc="Shortcut keys",Tc=ur(),Nc=Tc?"Cmd + /":"F1",Oc=e=>{let{showTitle:n}=e;const r=je(),{value:o,setTrue:i,setFalse:a}=Rr(!1),l=(0,t.useCallback)((e=>{const t=Tc&&"/"===e.key&&e.metaKey,n=!Tc&&"F1"===e.key&&!e.metaKey;(t||n)&&i()}),[i]);return Gn("keydown",l),pt(ht.FK,{children:[pt(Pr,{open:!0!==n&&void 0,title:"".concat(Mc," (").concat(Nc,")"),placement:"bottom-center",children:pt(Ar,{className:r?"":"vm-header-button",variant:"contained",color:"primary",startIcon:pt(Cn,{}),onClick:i,ariaLabel:Mc,children:n&&Mc})}),o&&pt(_c,{title:"Shortcut keys",onClose:a,children:pt("div",{className:"vm-shortcuts",children:Ec.map((e=>pt("div",{className:"vm-shortcuts-section",children:[e.readMore&&pt("div",{className:"vm-shortcuts-section__read-more",children:e.readMore}),pt("h3",{className:"vm-shortcuts-section__title",children:e.title}),pt("div",{className:"vm-shortcuts-section-list",children:e.list.map(((t,n)=>pt("div",{className:"vm-shortcuts-section-list-item",children:[pt("div",{className:"vm-shortcuts-section-list-item__key",children:t.keys}),pt("p",{className:"vm-shortcuts-section-list-item__description",children:t.description})]},"".concat(e.title,"_").concat(n))))})]},e.title)))})})]})},Pc=e=>{let{open:t}=e;return pt("button",{className:Yn()({"vm-menu-burger":!0,"vm-menu-burger_opened":t}),"aria-label":"menu",children:pt("span",{})})},{REACT_APP_TYPE:Lc}={REACT_APP_TYPE:"logs"},Rc=Lc===Ue.logs,zc=e=>{let{background:n,color:r}=e;const{pathname:o}=te(),{isMobile:i}=dr(),a=(0,t.useRef)(null),{value:l,toggle:s,setFalse:c}=Rr(!1);return(0,t.useEffect)(c,[o]),Tr(a,c),pt("div",{className:"vm-header-sidebar",ref:a,children:[pt("div",{className:Yn()({"vm-header-sidebar-button":!0,"vm-header-sidebar-button_open":l}),onClick:s,children:pt(Pc,{open:l})}),pt("div",{className:Yn()({"vm-header-sidebar-menu":!0,"vm-header-sidebar-menu_open":l}),children:[pt("div",{children:pt(yc,{color:r,background:n,direction:"column"})}),pt("div",{className:"vm-header-sidebar-menu-settings",children:!i&&!Rc&&pt(Oc,{showTitle:!0})})]})]})},Dc=e=>{let{controlsComponent:n,isMobile:r,...o}=e;const i=je(),{pathname:a}=te(),{accountIds:l}=(()=>{const{useTenantID:e}=Fe(),n=je(),{serverUrl:r}=vt(),[o,i]=(0,t.useState)(!1),[a,l]=(0,t.useState)(),[s,c]=(0,t.useState)([]),u=(0,t.useMemo)((()=>"".concat(r.replace(/^(.+)(\/select.+)/,"$1"),"/admin/tenants")),[r]),d=(0,t.useMemo)((()=>!!He(r)),[r]),h=n?!e:!d;return(0,t.useEffect)((()=>{h||(async()=>{i(!0);try{const e=await fetch(u),t=await e.json(),n=t.data||[];c(n.sort(((e,t)=>e.localeCompare(t)))),e.ok?l(void 0):l("".concat(t.errorType,"\r\n").concat(null===t||void 0===t?void 0:t.error))}catch(Au){Au instanceof Error&&l("".concat(Au.name,": ").concat(Au.message))}i(!1)})().catch(console.error)}),[u]),{accountIds:s,isLoading:o,error:a}})(),{value:s,toggle:c,setFalse:u}=Rr(!1),d=pt(n,{...o,isMobile:r,accountIds:l,headerSetup:(0,t.useMemo)((()=>(cc[a]||{}).header||{}),[a])});return r?pt(ht.FK,{children:[pt("div",{children:pt(Ar,{className:Yn()({"vm-header-button":!i}),startIcon:pt($n,{}),onClick:c,ariaLabel:"controls"})}),pt(_c,{title:"Controls",onClose:u,isOpen:s,className:Yn()({"vm-header-controls-modal":!0,"vm-header-controls-modal_open":s}),children:d})]}):d},{REACT_APP_TYPE:Ic}={REACT_APP_TYPE:"logs"},$c=Ic===Ue.logs||Ic===Ue.anomaly,Fc=()=>{switch(Ic){case Ue.logs:return pt(un,{});case Ue.anomaly:return pt(dn,{});default:return pt(cn,{})}},jc=e=>{let{controlsComponent:n}=e;const{isMobile:r}=dr(),o=Qn(),i=(0,t.useMemo)((()=>window.innerWidth<1e3),[o]),{isDarkTheme:a}=vt(),l=je(),s=(0,t.useMemo)((()=>it(a?"color-background-block":"color-primary")),[a]),{background:c,color:u}=(0,t.useMemo)((()=>{const{headerStyles:{background:e=(l?"#FFF":s),color:t=(l?s:"#FFF")}={}}=Fe();return{background:e,color:t}}),[s]),d=re(),h=()=>{d({pathname:uc.home}),window.location.reload()};return pt("header",{className:Yn()({"vm-header":!0,"vm-header_app":l,"vm-header_dark":a,"vm-header_sidebar":i,"vm-header_mobile":r}),style:{background:c,color:u},children:[i?pt(zc,{background:c,color:u}):pt(ht.FK,{children:[!l&&pt("div",{className:Yn()({"vm-header-logo":!0,"vm-header-logo_logs":$c}),onClick:h,style:{color:u},children:pt(Fc,{})}),pt(yc,{color:u,background:c})]}),i&&pt("div",{className:Yn()({"vm-header-logo":!0,"vm-header-logo_mobile":!0,"vm-header-logo_logs":$c}),onClick:h,style:{color:u},children:pt(Fc,{})}),pt(Dc,{controlsComponent:n,displaySidebar:i,isMobile:r})]})},Vc=(0,t.memo)((()=>{const e="2019-".concat((new Date).getFullYear());return pt("footer",{className:"vm-footer",children:[pt("a",{className:"vm-link vm-footer__website",target:"_blank",href:"https://victoriametrics.com/",rel:"me noreferrer",children:[pt(hn,{}),"victoriametrics.com"]}),pt("a",{className:"vm-link vm-footer__link",target:"_blank",href:"https://docs.victoriametrics.com/MetricsQL.html",rel:"help noreferrer",children:[pt(Nn,{}),"MetricsQL"]}),pt("a",{className:"vm-link vm-footer__link",target:"_blank",href:"https://docs.victoriametrics.com/#vmui",rel:"help noreferrer",children:[pt(zn,{}),"Documentation"]}),pt("a",{className:"vm-link vm-footer__link",target:"_blank",href:"https://github.com/VictoriaMetrics/VictoriaMetrics/issues/new/choose",rel:"noreferrer",children:[pt(Dn,{}),"Create an issue"]}),pt("div",{className:"vm-footer__copyright",children:["\xa9 ",e," VictoriaMetrics"]})]})})),Hc="Enable to save the modified server URL to local storage, preventing reset upon page refresh.",Uc="Disable to stop saving the server URL to local storage, reverting to the default URL on page refresh.",Bc=e=>{let{serverUrl:n,stateServerUrl:r,onChange:o,onEnter:i}=e;const{value:a,toggle:l}=Rr(!!We("SERVER_URL")),[s,c]=(0,t.useState)("");return(0,t.useEffect)((()=>{r||c(nt.emptyServer),(e=>{let t;try{t=new URL(e)}catch(n){return!1}return"http:"===t.protocol||"https:"===t.protocol})(r)||c(nt.validServer)}),[r]),(0,t.useEffect)((()=>{a?Be("SERVER_URL",n):Ye(["SERVER_URL"])}),[a]),(0,t.useEffect)((()=>{a&&Be("SERVER_URL",n)}),[n]),pt("div",{children:[pt("div",{className:"vm-server-configurator__title",children:"Server URL"}),pt("div",{className:"vm-server-configurator-url",children:[pt(qr,{autofocus:!0,value:n,error:s,onChange:e=>{o(e||""),c("")},onEnter:i,inputmode:"url"}),pt(Pr,{title:a?Uc:Hc,children:pt(Ar,{className:"vm-server-configurator-url__button",variant:"text",color:a?"primary":"gray",onClick:l,startIcon:pt(In,{})})})]})]})},Wc=[{label:"Graph",type:tt.chart},{label:"JSON",type:tt.code},{label:"Table",type:tt.table}],Yc=e=>{let{limits:n,onChange:r,onEnter:o}=e;const{isMobile:i}=dr(),[a,l]=(0,t.useState)({table:"",chart:"",code:""}),s=e=>t=>{((e,t)=>{const o=e||"";l((e=>({...e,[t]:+o<0?nt.positiveNumber:""}))),r({...n,[t]:o||1/0})})(t,e)};return pt("div",{className:"vm-limits-configurator",children:[pt("div",{className:"vm-server-configurator__title",children:["Series limits by tabs",pt(Pr,{title:"Set to 0 to disable the limit",children:pt(Ar,{variant:"text",color:"primary",size:"small",startIcon:pt(vn,{})})}),pt("div",{className:"vm-limits-configurator-title__reset",children:pt(Ar,{variant:"text",color:"primary",size:"small",startIcon:pt(mn,{}),onClick:()=>{r(Je)},children:"Reset limits"})})]}),pt("div",{className:Yn()({"vm-limits-configurator__inputs":!0,"vm-limits-configurator__inputs_mobile":i}),children:Wc.map((e=>pt("div",{children:pt(qr,{label:e.label,value:n[e.type],error:a[e.type],onChange:s(e.type),onEnter:o,type:"number"})},e.type)))})]})},Zc=()=>pt(Pr,{title:"Browser timezone is not recognized, supported, or could not be determined.",children:pt(gn,{})}),qc=jt(),Kc=e=>{let{timezoneState:n,defaultTimezone:r,onChange:o}=e;const{isMobile:i}=dr(),a=$t(),[l,s]=(0,t.useState)(""),c=(0,t.useRef)(null),{value:u,toggle:d,setFalse:h}=Rr(!1),f=(0,t.useMemo)((()=>[{title:"Default time (".concat(r,")"),region:r,utc:r?It(r):"UTC"},{title:qc.title,region:qc.region,utc:It(qc.region),isInvalid:!qc.isValid},{title:"UTC (Coordinated Universal Time)",region:"UTC",utc:"UTC"}].filter((e=>e.region))),[r]),p=(0,t.useMemo)((()=>{if(!l)return a;try{return $t(l)}catch(Au){return{}}}),[l,a]),m=(0,t.useMemo)((()=>Object.keys(p)),[p]),v=(0,t.useMemo)((()=>({region:n,utc:It(n)})),[n]),g=e=>()=>{(e=>{o(e.region),s(""),h()})(e)};return pt("div",{className:"vm-timezones",children:[pt("div",{className:"vm-server-configurator__title",children:"Time zone"}),pt("div",{className:"vm-timezones-item vm-timezones-item_selected",onClick:d,ref:c,children:[pt("div",{className:"vm-timezones-item__title",children:v.region}),pt("div",{className:"vm-timezones-item__utc",children:v.utc}),pt("div",{className:Yn()({"vm-timezones-item__icon":!0,"vm-timezones-item__icon_open":u}),children:pt(kn,{})})]}),pt(Nr,{open:u,buttonRef:c,placement:"bottom-left",onClose:h,fullWidth:!0,title:i?"Time zone":void 0,children:pt("div",{className:Yn()({"vm-timezones-list":!0,"vm-timezones-list_mobile":i}),children:[pt("div",{className:"vm-timezones-list-header",children:[pt("div",{className:"vm-timezones-list-header__search",children:pt(qr,{autofocus:!0,label:"Search",value:l,onChange:e=>{s(e)}})}),f.map(((e,t)=>e&&pt("div",{className:"vm-timezones-item vm-timezones-list-group-options__item",onClick:g(e),children:[pt("div",{className:"vm-timezones-item__title",children:[e.title,e.isInvalid&&pt(Zc,{})]}),pt("div",{className:"vm-timezones-item__utc",children:e.utc})]},"".concat(t,"_").concat(e.region))))]}),m.map((e=>pt("div",{className:"vm-timezones-list-group",children:pt(Vr,{defaultExpanded:!0,title:pt("div",{className:"vm-timezones-list-group__title",children:e}),children:pt("div",{className:"vm-timezones-list-group-options",children:p[e]&&p[e].map((e=>pt("div",{className:"vm-timezones-item vm-timezones-list-group-options__item",onClick:g(e),children:[pt("div",{className:"vm-timezones-item__title",children:e.region}),pt("div",{className:"vm-timezones-item__utc",children:e.utc})]},e.search)))})})},e)))]})})]})},Gc=e=>{let{options:n,value:r,label:o,onChange:i}=e;const a=(0,t.useRef)(null),[l,s]=(0,t.useState)({width:"0px",left:"0px",borderRadius:"0px"}),c=e=>()=>{i(e)};return(0,t.useEffect)((()=>{if(!a.current)return void s({width:"0px",left:"0px",borderRadius:"0px"});const e=n.findIndex((e=>e.value===r)),{width:t}=a.current.getBoundingClientRect();let o=t,i=e*o,l="0";0===e&&(l="16px 0 0 16px"),e===n.length-1&&(l="10px",i-=1,l="0 16px 16px 0"),0!==e&&e!==n.length-1&&(o+=1,i-=1),s({width:"".concat(o,"px"),left:"".concat(i,"px"),borderRadius:l})}),[a,r,n]),pt("div",{className:"vm-toggles",children:[o&&pt("label",{className:"vm-toggles__label",children:o}),pt("div",{className:"vm-toggles-group",style:{gridTemplateColumns:"repeat(".concat(n.length,", 1fr)")},children:[l.borderRadius&&pt("div",{className:"vm-toggles-group__highlight",style:l}),n.map(((e,t)=>pt("div",{className:Yn()({"vm-toggles-group-item":!0,"vm-toggles-group-item_first":0===t,"vm-toggles-group-item_active":e.value===r,"vm-toggles-group-item_icon":e.icon&&e.title}),onClick:c(e.value),ref:e.value===r?a:null,children:[e.icon,e.title]},e.value)))]})]})},Qc=Object.values(rt).map((e=>({title:e,value:e}))),Jc=e=>{let{theme:t,onChange:n}=e;const{isMobile:r}=dr();return pt("div",{className:Yn()({"vm-theme-control":!0,"vm-theme-control_mobile":r}),children:[pt("div",{className:"vm-server-configurator__title",children:"Theme preferences"}),pt("div",{className:"vm-theme-control__toggle",children:pt(Gc,{options:Qc,value:t,onChange:e=>{n(e)}})},"".concat(r))]})},Xc="Settings",{REACT_APP_TYPE:eu}={REACT_APP_TYPE:"logs"},tu=eu===Ue.logs,nu=()=>{const{isMobile:e}=dr(),n=je(),{serverUrl:r,theme:o}=vt(),{timezone:i,defaultTimezone:a}=Gt(),{seriesLimits:l}=(0,t.useContext)(ir).state,s=gt(),c=Qt(),u=(0,t.useContext)(ir).dispatch,[d,h]=(0,t.useState)(r),[f,p]=(0,t.useState)(l),[m,v]=(0,t.useState)(i),{value:g,setTrue:y,setFalse:_}=Rr(!1),b=()=>{_(),h(r),p(l),v(i)},w=()=>{const e=He(d);""!==e&&s({type:"SET_TENANT_ID",payload:e}),s({type:"SET_SERVER",payload:d}),c({type:"SET_TIMEZONE",payload:m}),u({type:"SET_SERIES_LIMITS",payload:f}),_()};(0,t.useEffect)((()=>{r!==d&&h(r)}),[r]),(0,t.useEffect)((()=>{v(i)}),[i]);const k=[{show:!n&&!tu,component:pt(Bc,{stateServerUrl:r,serverUrl:d,onChange:h,onEnter:w})},{show:!tu,component:pt(Yc,{limits:f,onChange:p,onEnter:w})},{show:!0,component:pt(Kc,{timezoneState:m,defaultTimezone:a,onChange:v})},{show:!n,component:pt(Jc,{theme:o,onChange:e=>{s({type:"SET_THEME",payload:e})}})}].filter((e=>e.show));return pt(ht.FK,{children:[e?pt("div",{className:"vm-mobile-option",onClick:y,children:[pt("span",{className:"vm-mobile-option__icon",children:pt(fn,{})}),pt("div",{className:"vm-mobile-option-text",children:pt("span",{className:"vm-mobile-option-text__label",children:Xc})}),pt("span",{className:"vm-mobile-option__arrow",children:pt(wn,{})})]}):pt(Pr,{title:Xc,children:pt(Ar,{className:Yn()({"vm-header-button":!n}),variant:"contained",color:"primary",startIcon:pt(fn,{}),onClick:y,ariaLabel:"settings"})}),g&&pt(_c,{title:Xc,onClose:b,children:pt("div",{className:Yn()({"vm-server-configurator":!0,"vm-server-configurator_mobile":e}),children:[k.map(((e,t)=>pt("div",{className:"vm-server-configurator__input",children:e.component},t))),pt("div",{className:"vm-server-configurator-footer",children:[pt(Ar,{color:"error",variant:"outlined",onClick:b,children:"Cancel"}),pt(Ar,{color:"primary",variant:"contained",onClick:w,children:"Apply"})]})]})})]})},ru=e=>{let{relativeTime:t,setDuration:n}=e;const{isMobile:r}=dr();return pt("div",{className:Yn()({"vm-time-duration":!0,"vm-time-duration_mobile":r}),children:zt.map((e=>{let{id:o,duration:i,until:a,title:l}=e;return pt("div",{className:Yn()({"vm-list-item":!0,"vm-list-item_mobile":r,"vm-list-item_active":o===t}),onClick:(s={duration:i,until:a(),id:o},()=>{n(s)}),children:l||i},o);var s}))})},ou=e=>{let{viewDate:t,showArrowNav:n,onChangeViewDate:r,toggleDisplayYears:o}=e;return pt("div",{className:"vm-calendar-header",children:[pt("div",{className:"vm-calendar-header-left",onClick:o,children:[pt("span",{className:"vm-calendar-header-left__date",children:t.format("MMMM YYYY")}),pt("div",{className:"vm-calendar-header-left__select-year",children:pt(kn,{})})]}),n&&pt("div",{className:"vm-calendar-header-right",children:[pt("div",{className:"vm-calendar-header-right__prev",onClick:()=>{r(t.subtract(1,"month"))},children:pt(wn,{})}),pt("div",{className:"vm-calendar-header-right__next",onClick:()=>{r(t.add(1,"month"))},children:pt(wn,{})})]})]})},iu=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],au=e=>{let{viewDate:n,selectDate:r,onChangeSelectDate:i}=e;const a="YYYY-MM-DD",l=o()().tz().startOf("day"),s=(0,t.useMemo)((()=>{const e=new Array(42).fill(null),t=n.startOf("month"),r=n.endOf("month").diff(t,"day")+1,o=new Array(r).fill(t).map(((e,t)=>e.add(t,"day"))),i=t.day();return e.splice(i,r,...o),e}),[n]),c=e=>()=>{e&&i(e)};return pt("div",{className:"vm-calendar-body",children:[iu.map((e=>pt("div",{className:"vm-calendar-body-cell vm-calendar-body-cell_weekday",children:e[0]},e))),s.map(((e,t)=>pt("div",{className:Yn()({"vm-calendar-body-cell":!0,"vm-calendar-body-cell_day":!0,"vm-calendar-body-cell_day_empty":!e,"vm-calendar-body-cell_day_active":(e&&e.format(a))===r.format(a),"vm-calendar-body-cell_day_today":(e&&e.format(a))===l.format(a)}),onClick:c(e),children:e&&e.format("D")},e?e.format(a):t)))]})},lu=e=>{let{viewDate:n,onChangeViewDate:r}=e;const i=o()().format("YYYY"),a=(0,t.useMemo)((()=>n.format("YYYY")),[n]),l=(0,t.useMemo)((()=>{const e=o()().subtract(9,"year");return new Array(18).fill(e).map(((e,t)=>e.add(t,"year")))}),[n]);(0,t.useEffect)((()=>{const e=document.getElementById("vm-calendar-year-".concat(a));e&&e.scrollIntoView({block:"center"})}),[]);return pt("div",{className:"vm-calendar-years",children:l.map((e=>{return pt("div",{className:Yn()({"vm-calendar-years__year":!0,"vm-calendar-years__year_selected":e.format("YYYY")===a,"vm-calendar-years__year_today":e.format("YYYY")===i}),id:"vm-calendar-year-".concat(e.format("YYYY")),onClick:(t=e,()=>{r(t)}),children:e.format("YYYY")},e.format("YYYY"));var t}))})},su=e=>{let{viewDate:n,selectDate:r,onChangeViewDate:i}=e;const a=o()().format("MM"),l=(0,t.useMemo)((()=>r.format("MM")),[r]),s=(0,t.useMemo)((()=>new Array(12).fill("").map(((e,t)=>o()(n).month(t)))),[n]);(0,t.useEffect)((()=>{const e=document.getElementById("vm-calendar-year-".concat(l));e&&e.scrollIntoView({block:"center"})}),[]);const c=e=>()=>{i(e)};return pt("div",{className:"vm-calendar-years",children:s.map((e=>pt("div",{className:Yn()({"vm-calendar-years__year":!0,"vm-calendar-years__year_selected":e.format("MM")===l,"vm-calendar-years__year_today":e.format("MM")===a}),id:"vm-calendar-year-".concat(e.format("MM")),onClick:c(e),children:e.format("MMMM")},e.format("MM"))))})};var cu=function(e){return e[e.days=0]="days",e[e.months=1]="months",e[e.years=2]="years",e}(cu||{});const uu=e=>{let{date:n,format:r=_t,onChange:i}=e;const[a,l]=(0,t.useState)(cu.days),[s,c]=(0,t.useState)(o().tz(n)),[u,d]=(0,t.useState)(o().tz(n)),h=o()().startOf("day").tz(),f=h.format()===s.format(),{isMobile:p}=dr(),m=e=>{c(e),l((e=>e===cu.years?cu.months:cu.days))};return(0,t.useEffect)((()=>{u.format()!==o().tz(n).format()&&i(u.format(r))}),[u]),(0,t.useEffect)((()=>{const e=o().tz(n);c(e),d(e)}),[n]),pt("div",{className:Yn()({"vm-calendar":!0,"vm-calendar_mobile":p}),children:[pt(ou,{viewDate:s,onChangeViewDate:m,toggleDisplayYears:()=>{l((e=>e===cu.years?cu.days:cu.years))},showArrowNav:a===cu.days}),a===cu.days&&pt(au,{viewDate:s,selectDate:u,onChangeSelectDate:e=>{d(e)}}),a===cu.years&&pt(lu,{viewDate:s,onChangeViewDate:m}),a===cu.months&&pt(su,{selectDate:u,viewDate:s,onChangeViewDate:m}),!f&&a===cu.days&&pt("div",{className:"vm-calendar-footer",children:pt(Ar,{variant:"text",size:"small",onClick:()=>{c(h)},children:"show today"})})]})},du=(0,t.forwardRef)(((e,n)=>{let{date:r,targetRef:i,format:a=_t,onChange:l,label:s}=e;const c=(0,t.useMemo)((()=>o()(r).isValid()?o().tz(r):o()().tz()),[r]),{isMobile:u}=dr(),{value:d,toggle:h,setFalse:f}=Rr(!1);return Gn("click",h,i),Gn("keyup",(e=>{"Escape"!==e.key&&"Enter"!==e.key||f()})),pt(ht.FK,{children:pt(Nr,{open:d,buttonRef:i,placement:"bottom-right",onClose:f,title:u?s:void 0,children:pt("div",{ref:n,children:pt(uu,{date:c,format:a,onChange:e=>{l(e),f()}})})})})})),hu=du;var fu=n(494),pu=n.n(fu);const mu=e=>o()(e).isValid()?o().tz(e).format(_t):e,vu=e=>{let{value:n="",label:r,pickerLabel:i,pickerRef:a,onChange:l,onEnter:s}=e;const c=(0,t.useRef)(null),[u,d]=(0,t.useState)(null),[h,f]=(0,t.useState)(mu(n)),[p,m]=(0,t.useState)(!1),[v,g]=(0,t.useState)(!1),y=o()(h).isValid()?"":"Invalid date format";return(0,t.useEffect)((()=>{const e=mu(n);e!==h&&f(e),v&&(s(),g(!1))}),[n]),(0,t.useEffect)((()=>{p&&u&&(u.focus(),u.setSelectionRange(11,11),m(!1))}),[p]),pt("div",{className:Yn()({"vm-date-time-input":!0,"vm-date-time-input_error":y}),children:[pt("label",{children:r}),pt(pu(),{tabIndex:1,inputRef:d,mask:"9999-99-99 99:99:99",placeholder:"YYYY-MM-DD HH:mm:ss",value:h,autoCapitalize:"none",inputMode:"numeric",maskChar:null,onChange:e=>{f(e.currentTarget.value)},onBlur:()=>{l(h)},onKeyUp:e=>{"Enter"===e.key&&(l(h),g(!0))}}),y&&pt("span",{className:"vm-date-time-input__error-text",children:y}),pt("div",{className:"vm-date-time-input__icon",ref:c,children:pt(Ar,{variant:"text",color:"gray",size:"small",startIcon:pt(Sn,{}),ariaLabel:"calendar"})}),pt(hu,{label:i,ref:a,date:h,onChange:e=>{f(e),m(!0)},targetRef:c})]})};const gu=function(e){const n=(0,t.useRef)();return(0,t.useEffect)((()=>{n.current=e}),[e]),n.current},yu=()=>{const{isMobile:e}=dr(),{isDarkTheme:n}=vt(),r=(0,t.useRef)(null),i=Qn(),a=(0,t.useMemo)((()=>i.width>1120),[i]),[l,s]=(0,t.useState)(),[c,u]=(0,t.useState)(),{period:{end:d,start:h},relativeTime:f,timezone:p,duration:m}=Gt(),v=Qt(),g=je(),y=gu(p),{value:_,toggle:b,setFalse:w}=Rr(!1),k=(0,t.useMemo)((()=>({region:p,utc:It(p)})),[p]);(0,t.useEffect)((()=>{s(Pt(Rt(d)))}),[p,d]),(0,t.useEffect)((()=>{u(Pt(Rt(h)))}),[p,h]);const x=e=>{let{duration:t,until:n,id:r}=e;v({type:"SET_RELATIVE_TIME",payload:{duration:t,until:n,id:r}}),w()},S=(0,t.useMemo)((()=>({start:o().tz(Rt(h)).format(_t),end:o().tz(Rt(d)).format(_t)})),[h,d,p]),A=(0,t.useMemo)((()=>f&&"none"!==f?f.replace(/_/g," "):"".concat(S.start," - ").concat(S.end)),[f,S]),C=(0,t.useRef)(null),E=(0,t.useRef)(null),M=(0,t.useRef)(null),T=()=>{c&&l&&v({type:"SET_PERIOD",payload:{from:o().tz(c).toDate(),to:o().tz(l).toDate()}}),w()};return(0,t.useEffect)((()=>{const e=Dt({relativeTimeId:f,defaultDuration:m,defaultEndInput:Rt(d)});y&&p!==y&&x({id:e.relativeTimeId,duration:e.duration,until:e.endInput})}),[p,y]),Tr(r,(t=>{var n,r;if(e)return;const o=t.target,i=(null===C||void 0===C?void 0:C.current)&&(null===C||void 0===C||null===(n=C.current)||void 0===n?void 0:n.contains(o)),a=(null===E||void 0===E?void 0:E.current)&&(null===E||void 0===E||null===(r=E.current)||void 0===r?void 0:r.contains(o));i||a||w()})),pt(ht.FK,{children:[pt("div",{ref:M,children:e?pt("div",{className:"vm-mobile-option",onClick:b,children:[pt("span",{className:"vm-mobile-option__icon",children:pt(xn,{})}),pt("div",{className:"vm-mobile-option-text",children:[pt("span",{className:"vm-mobile-option-text__label",children:"Time range"}),pt("span",{className:"vm-mobile-option-text__value",children:A})]}),pt("span",{className:"vm-mobile-option__arrow",children:pt(wn,{})})]}):pt(Pr,{title:a?"Time range controls":A,children:pt(Ar,{className:g?"":"vm-header-button",variant:"contained",color:"primary",startIcon:pt(xn,{}),onClick:b,ariaLabel:"time range controls",children:a&&pt("span",{children:A})})})}),pt(Nr,{open:_,buttonRef:M,placement:"bottom-right",onClose:w,clickOutside:!1,title:e?"Time range controls":"",children:pt("div",{className:Yn()({"vm-time-selector":!0,"vm-time-selector_mobile":e}),ref:r,children:[pt("div",{className:"vm-time-selector-left",children:[pt("div",{className:Yn()({"vm-time-selector-left-inputs":!0,"vm-time-selector-left-inputs_dark":n}),children:[pt(vu,{value:c,label:"From:",pickerLabel:"Date From",pickerRef:C,onChange:u,onEnter:T}),pt(vu,{value:l,label:"To:",pickerLabel:"Date To",pickerRef:E,onChange:s,onEnter:T})]}),pt("div",{className:"vm-time-selector-left-timezone",children:[pt("div",{className:"vm-time-selector-left-timezone__title",children:k.region}),pt("div",{className:"vm-time-selector-left-timezone__utc",children:k.utc})]}),pt(Ar,{variant:"text",startIcon:pt(An,{}),onClick:()=>v({type:"RUN_QUERY_TO_NOW"}),children:"switch to now"}),pt("div",{className:"vm-time-selector-left__controls",children:[pt(Ar,{color:"error",variant:"outlined",onClick:()=>{s(Pt(Rt(d))),u(Pt(Rt(h))),w()},children:"Cancel"}),pt(Ar,{color:"primary",onClick:T,children:"Apply"})]})]}),pt(ru,{relativeTime:f||"",setDuration:x})]})})]})},_u=e=>{let{isMobile:t}=e;return pt("div",{className:Yn()({"vm-header-controls":!0,"vm-header-controls_mobile":t}),children:[pt(yu,{}),pt(nu,{})]})},bu=(Boolean(We("DISABLED_DEFAULT_TIMEZONE")),()=>{const{serverUrl:e}=vt(),[n,r]=(Qt(),(0,t.useState)(!1)),[o,i]=(0,t.useState)(""),a=async()=>{};return(0,t.useEffect)((()=>{a()}),[e]),{isLoading:n,error:o}}),wu=()=>{const e=je(),{isMobile:n}=dr(),{pathname:r}=te();bu();return(0,t.useEffect)((()=>{var e;const t="vmui for VictoriaLogs",n=null===(e=cc[uc.logs])||void 0===e?void 0:e.title;document.title=n?"".concat(n," - ").concat(t):t}),[r]),pt("section",{className:"vm-container",children:[pt(jc,{controlsComponent:_u}),pt("div",{className:Yn()({"vm-container-body":!0,"vm-container-body_mobile":n,"vm-container-body_app":e}),children:pt(ye,{})}),!e&&pt(Vc,{})]})},ku=()=>{const[e,n]=(0,t.useState)(!1);return pt(ht.FK,{children:pt(Ne,{children:pt(yr,{children:pt(ht.FK,{children:[pt(xr,{onLoaded:n}),e&&pt(we,{children:pt(_e,{path:"/",element:pt(wu,{}),children:pt(_e,{path:"/",element:pt(oc,{})})})})]})})})})},xu=e=>{e&&n.e(685).then(n.bind(n,685)).then((t=>{let{getCLS:n,getFID:r,getFCP:o,getLCP:i,getTTFB:a}=t;n(e),r(e),o(e),i(e),a(e)}))},Su=document.getElementById("root");Su&&(0,t.render)(pt(ku,{}),Su),xu()})()})(); \ No newline at end of file diff --git a/app/vlselect/vmui/static/js/main.8e7757ef.js b/app/vlselect/vmui/static/js/main.8e7757ef.js new file mode 100644 index 000000000..df7e308c1 --- /dev/null +++ b/app/vlselect/vmui/static/js/main.8e7757ef.js @@ -0,0 +1,2 @@ +/*! For license information please see main.8e7757ef.js.LICENSE.txt */ +(()=>{var e={61:(e,t,n)=>{"use strict";var r=n(375),o=n(629),i=o(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"===typeof n&&i(e,".prototype.")>-1?o(n):n}},629:(e,t,n)=>{"use strict";var r=n(989),o=n(375),i=n(259),a=n(277),l=o("%Function.prototype.apply%"),s=o("%Function.prototype.call%"),c=o("%Reflect.apply%",!0)||r.call(s,l),u=n(709),d=o("%Math.max%");e.exports=function(e){if("function"!==typeof e)throw new a("a function is required");var t=c(r,s,arguments);return i(t,1+d(0,e.length-(arguments.length-1)),!0)};var h=function(){return c(r,l,arguments)};u?u(e.exports,"apply",{value:h}):e.exports.apply=h},159:function(e){e.exports=function(){"use strict";var e=1e3,t=6e4,n=36e5,r="millisecond",o="second",i="minute",a="hour",l="day",s="week",c="month",u="quarter",d="year",h="date",f="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},g=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},y={s:g,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),o=n%60;return(t<=0?"+":"-")+g(r,2,"0")+":"+g(o,2,"0")},m:function e(t,n){if(t.date()1)return e(a[0])}else{var l=t.name;b[l]=t,o=l}return!r&&o&&(_=o),o||!r&&_},S=function(e,t){if(k(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new C(n)},A=y;A.l=x,A.i=k,A.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var C=function(){function v(e){this.$L=x(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[w]=!0}var g=v.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(A.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(p);if(r){var o=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return A},g.isValid=function(){return!(this.$d.toString()===f)},g.isSame=function(e,t){var n=S(e);return this.startOf(t)<=n&&n<=this.endOf(t)},g.isAfter=function(e,t){return S(e)=0&&(i[d]=parseInt(u,10))}var h=i[3],f=24===h?0:h,p=i[0]+"-"+i[1]+"-"+i[2]+" "+f+":"+i[4]+":"+i[5]+":000",m=+t;return(o.utc(p).valueOf()-(m-=m%1e3))/6e4},s=r.prototype;s.tz=function(e,t){void 0===e&&(e=i);var n=this.utcOffset(),r=this.toDate(),a=r.toLocaleString("en-US",{timeZone:e}),l=Math.round((r-new Date(a))/1e3/60),s=o(a,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(15*-Math.round(r.getTimezoneOffset()/15)-l,!0);if(t){var c=s.utcOffset();s=s.add(n-c,"minute")}return s.$x.$timezone=e,s},s.offsetName=function(e){var t=this.$x.$timezone||o.tz.guess(),n=a(this.valueOf(),t,{timeZoneName:e}).find((function(e){return"timezonename"===e.type.toLowerCase()}));return n&&n.value};var c=s.startOf;s.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return c.call(this,e,t);var n=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return c.call(n,e,t).tz(this.$x.$timezone,!0)},o.tz=function(e,t,n){var r=n&&t,a=n||t||i,s=l(+o(),a);if("string"!=typeof e)return o(e).tz(a);var c=function(e,t,n){var r=e-60*t*1e3,o=l(r,n);if(t===o)return[r,t];var i=l(r-=60*(o-t)*1e3,n);return o===i?[r,o]:[e-60*Math.min(o,i)*1e3,Math.max(o,i)]}(o.utc(e,r).valueOf(),s,a),u=c[0],d=c[1],h=o(u).utcOffset(d);return h.$x.$timezone=a,h},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(e){i=e}}}()},220:function(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,o,i){var a=o.prototype;i.utc=function(e){return new o({date:e,utc:!0,args:arguments})},a.utc=function(t){var n=i(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var l=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),l.call(this,e)};var s=a.init;a.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else s.call(this)};var c=a.utcOffset;a.utcOffset=function(r,o){var i=this.$utils().u;if(i(r))return this.$u?0:i(this.$offset)?c.call(this):this.$offset;if("string"==typeof r&&(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var o=(""+r[0]).match(n)||["-",0,0],i=o[0],a=60*+o[1]+ +o[2];return 0===a?0:"+"===i?a:-a}(r),null===r))return this;var a=Math.abs(r)<=16?60*r:r,l=this;if(o)return l.$offset=a,l.$u=0===r,l;if(0!==r){var s=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(l=this.local().add(a+s,e)).$offset=a,l.$x.$localOffset=s}else l=this.utc();return l};var u=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var d=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var h=a.diff;a.diff=function(e,t,n){if(e&&this.$u===e.$u)return h.call(this,e,t,n);var r=this.local(),o=i(e).local();return h.call(r,o,t,n)}}}()},411:(e,t,n)=>{"use strict";var r=n(709),o=n(430),i=n(277),a=n(553);e.exports=function(e,t,n){if(!e||"object"!==typeof e&&"function"!==typeof e)throw new i("`obj` must be an object or a function`");if("string"!==typeof t&&"symbol"!==typeof t)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!==typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!==typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!==typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!==typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],d=!!a&&a(e,t);if(r)r(e,t,{configurable:null===c&&d?d.configurable:!c,enumerable:null===l&&d?d.enumerable:!l,value:n,writable:null===s&&d?d.writable:!s});else{if(!u&&(l||s||c))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=n}}},709:(e,t,n)=>{"use strict";var r=n(375)("%Object.defineProperty%",!0)||!1;if(r)try{r({},"a",{value:1})}catch(o){r=!1}e.exports=r},123:e=>{"use strict";e.exports=EvalError},953:e=>{"use strict";e.exports=Error},780:e=>{"use strict";e.exports=RangeError},768:e=>{"use strict";e.exports=ReferenceError},430:e=>{"use strict";e.exports=SyntaxError},277:e=>{"use strict";e.exports=TypeError},619:e=>{"use strict";e.exports=URIError},307:e=>{"use strict";var t=Object.prototype.toString,n=Math.max,r=function(e,t){for(var n=[],r=0;r{"use strict";var r=n(307);e.exports=Function.prototype.bind||r},375:(e,t,n)=>{"use strict";var r,o=n(953),i=n(123),a=n(780),l=n(768),s=n(430),c=n(277),u=n(619),d=Function,h=function(e){try{return d('"use strict"; return ('+e+").constructor;")()}catch(t){}},f=Object.getOwnPropertyDescriptor;if(f)try{f({},"")}catch(z){f=null}var p=function(){throw new c},m=f?function(){try{return p}catch(e){try{return f(arguments,"callee").get}catch(t){return p}}}():p,v=n(757)(),g=n(442)(),y=Object.getPrototypeOf||(g?function(e){return e.__proto__}:null),_={},b="undefined"!==typeof Uint8Array&&y?y(Uint8Array):r,w={__proto__:null,"%AggregateError%":"undefined"===typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"===typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":v&&y?y([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":_,"%AsyncGenerator%":_,"%AsyncGeneratorFunction%":_,"%AsyncIteratorPrototype%":_,"%Atomics%":"undefined"===typeof Atomics?r:Atomics,"%BigInt%":"undefined"===typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"===typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"===typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"===typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"===typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"===typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"===typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":d,"%GeneratorFunction%":_,"%Int8Array%":"undefined"===typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"===typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"===typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":v&&y?y(y([][Symbol.iterator]())):r,"%JSON%":"object"===typeof JSON?JSON:r,"%Map%":"undefined"===typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!==typeof Map&&v&&y?y((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"===typeof Promise?r:Promise,"%Proxy%":"undefined"===typeof Proxy?r:Proxy,"%RangeError%":a,"%ReferenceError%":l,"%Reflect%":"undefined"===typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"===typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!==typeof Set&&v&&y?y((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"===typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":v&&y?y(""[Symbol.iterator]()):r,"%Symbol%":v?Symbol:r,"%SyntaxError%":s,"%ThrowTypeError%":m,"%TypedArray%":b,"%TypeError%":c,"%Uint8Array%":"undefined"===typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"===typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"===typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"===typeof Uint32Array?r:Uint32Array,"%URIError%":u,"%WeakMap%":"undefined"===typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"===typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"===typeof WeakSet?r:WeakSet};if(y)try{null.error}catch(z){var k=y(y(z));w["%Error.prototype%"]=k}var x=function e(t){var n;if("%AsyncFunction%"===t)n=h("async function () {}");else if("%GeneratorFunction%"===t)n=h("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=h("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&y&&(n=y(o.prototype))}return w[t]=n,n},S={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},A=n(989),C=n(155),E=A.call(Function.call,Array.prototype.concat),M=A.call(Function.apply,Array.prototype.splice),T=A.call(Function.call,String.prototype.replace),N=A.call(Function.call,String.prototype.slice),O=A.call(Function.call,RegExp.prototype.exec),P=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,L=/\\(\\)?/g,R=function(e,t){var n,r=e;if(C(S,r)&&(r="%"+(n=S[r])[0]+"%"),C(w,r)){var o=w[r];if(o===_&&(o=x(r)),"undefined"===typeof o&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new s("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!==typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!==typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===O(/^%?[^%]*%?$/,e))throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=N(e,0,1),n=N(e,-1);if("%"===t&&"%"!==n)throw new s("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new s("invalid intrinsic syntax, expected opening `%`");var r=[];return T(e,P,(function(e,t,n,o){r[r.length]=n?T(o,L,"$1"):t||e})),r}(e),r=n.length>0?n[0]:"",o=R("%"+r+"%",t),i=o.name,a=o.value,l=!1,u=o.alias;u&&(r=u[0],M(n,E([0,1],u)));for(var d=1,h=!0;d=n.length){var g=f(a,p);a=(h=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:a[p]}else h=C(a,p),a=a[p];h&&!l&&(w[i]=a)}}return a}},553:(e,t,n)=>{"use strict";var r=n(375)("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(o){r=null}e.exports=r},734:(e,t,n)=>{"use strict";var r=n(709),o=function(){return!!r};o.hasArrayLengthDefineBug=function(){if(!r)return null;try{return 1!==r([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},442:e=>{"use strict";var t={foo:{}},n=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof n)}},757:(e,t,n)=>{"use strict";var r="undefined"!==typeof Symbol&&Symbol,o=n(175);e.exports=function(){return"function"===typeof r&&("function"===typeof Symbol&&("symbol"===typeof r("foo")&&("symbol"===typeof Symbol("bar")&&o())))}},175:e=>{"use strict";e.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"===typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"===typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},155:(e,t,n)=>{"use strict";var r=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=n(989);e.exports=i.call(r,o)},267:(e,t,n)=>{var r=NaN,o="[object Symbol]",i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,s=/^0o[0-7]+$/i,c=parseInt,u="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,d="object"==typeof self&&self&&self.Object===Object&&self,h=u||d||Function("return this")(),f=Object.prototype.toString,p=Math.max,m=Math.min,v=function(){return h.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&f.call(e)==o}(e))return r;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=l.test(e);return n||s.test(e)?c(e.slice(2),n?2:8):a.test(e)?r:+e}e.exports=function(e,t,n){var r,o,i,a,l,s,c=0,u=!1,d=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function _(e){var n=e-s;return void 0===s||n>=t||n<0||d&&e-c>=i}function b(){var e=v();if(_(e))return w(e);l=setTimeout(b,function(e){var n=t-(e-s);return d?m(n,i-(e-c)):n}(e))}function w(e){return l=void 0,h&&r?f(e):(r=o=void 0,a)}function k(){var e=v(),n=_(e);if(r=arguments,o=this,s=e,n){if(void 0===l)return function(e){return c=e,l=setTimeout(b,t),u?f(e):a}(s);if(d)return l=setTimeout(b,t),f(s)}return void 0===l&&(l=setTimeout(b,t)),a}return t=y(t)||0,g(n)&&(u=!!n.leading,i=(d="maxWait"in n)?p(y(n.maxWait)||0,t):i,h="trailing"in n?!!n.trailing:h),k.cancel=function(){void 0!==l&&clearTimeout(l),c=0,r=s=o=l=void 0},k.flush=function(){return void 0===l?a:w(v())},k}},424:(e,t,n)=>{var r="__lodash_hash_undefined__",o=1/0,i="[object Function]",a="[object GeneratorFunction]",l="[object Symbol]",s=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c=/^\w*$/,u=/^\./,d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,f=/^\[object .+?Constructor\]$/,p="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,m="object"==typeof self&&self&&self.Object===Object&&self,v=p||m||Function("return this")();var g=Array.prototype,y=Function.prototype,_=Object.prototype,b=v["__core-js_shared__"],w=function(){var e=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),k=y.toString,x=_.hasOwnProperty,S=_.toString,A=RegExp("^"+k.call(x).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=v.Symbol,E=g.splice,M=F(v,"Map"),T=F(Object,"create"),N=C?C.prototype:void 0,O=N?N.toString:void 0;function P(e){var t=-1,n=e?e.length:0;for(this.clear();++t-1},L.prototype.set=function(e,t){var n=this.__data__,r=z(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},R.prototype.clear=function(){this.__data__={hash:new P,map:new(M||L),string:new P}},R.prototype.delete=function(e){return $(this,e).delete(e)},R.prototype.get=function(e){return $(this,e).get(e)},R.prototype.has=function(e){return $(this,e).has(e)},R.prototype.set=function(e,t){return $(this,e).set(e,t),this};var j=H((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(W(e))return O?O.call(e):"";var t=e+"";return"0"==t&&1/e==-o?"-0":t}(t);var n=[];return u.test(e)&&n.push(""),e.replace(d,(function(e,t,r,o){n.push(r?o.replace(h,"$1"):t||e)})),n}));function V(e){if("string"==typeof e||W(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}function H(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(H.Cache||R),n}H.Cache=R;var U=Array.isArray;function B(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function W(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&S.call(e)==l}e.exports=function(e,t,n){var r=null==e?void 0:D(e,t);return void 0===r?n:r}},141:(e,t,n)=>{var r="function"===typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=r&&o&&"function"===typeof o.get?o.get:null,a=r&&Map.prototype.forEach,l="function"===typeof Set&&Set.prototype,s=Object.getOwnPropertyDescriptor&&l?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=l&&s&&"function"===typeof s.get?s.get:null,u=l&&Set.prototype.forEach,d="function"===typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h="function"===typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"===typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,m=Object.prototype.toString,v=Function.prototype.toString,g=String.prototype.match,y=String.prototype.slice,_=String.prototype.replace,b=String.prototype.toUpperCase,w=String.prototype.toLowerCase,k=RegExp.prototype.test,x=Array.prototype.concat,S=Array.prototype.join,A=Array.prototype.slice,C=Math.floor,E="function"===typeof BigInt?BigInt.prototype.valueOf:null,M=Object.getOwnPropertySymbols,T="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?Symbol.prototype.toString:null,N="function"===typeof Symbol&&"object"===typeof Symbol.iterator,O="function"===typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===N||"symbol")?Symbol.toStringTag:null,P=Object.prototype.propertyIsEnumerable,L=("function"===typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function R(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||k.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"===typeof e){var r=e<0?-C(-e):C(e);if(r!==e){var o=String(r),i=y.call(t,o.length+1);return _.call(o,n,"$&_")+"."+_.call(_.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _.call(t,n,"$&_")}var z=n(634),D=z.custom,I=H(D)?D:null;function $(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function F(e){return _.call(String(e),/"/g,""")}function j(e){return"[object Array]"===W(e)&&(!O||!("object"===typeof e&&O in e))}function V(e){return"[object RegExp]"===W(e)&&(!O||!("object"===typeof e&&O in e))}function H(e){if(N)return e&&"object"===typeof e&&e instanceof Symbol;if("symbol"===typeof e)return!0;if(!e||"object"!==typeof e||!T)return!1;try{return T.call(e),!0}catch(t){}return!1}e.exports=function e(t,r,o,l){var s=r||{};if(B(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(B(s,"maxStringLength")&&("number"===typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var m=!B(s,"customInspect")||s.customInspect;if("boolean"!==typeof m&&"symbol"!==m)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(B(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(B(s,"numericSeparator")&&"boolean"!==typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var b=s.numericSeparator;if("undefined"===typeof t)return"undefined";if(null===t)return"null";if("boolean"===typeof t)return t?"true":"false";if("string"===typeof t)return Z(t,s);if("number"===typeof t){if(0===t)return 1/0/t>0?"0":"-0";var k=String(t);return b?R(t,k):k}if("bigint"===typeof t){var C=String(t)+"n";return b?R(t,C):C}var M="undefined"===typeof s.depth?5:s.depth;if("undefined"===typeof o&&(o=0),o>=M&&M>0&&"object"===typeof t)return j(t)?"[Array]":"[Object]";var D=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"===typeof e.indent&&e.indent>0))return null;n=S.call(Array(e.indent+1)," ")}return{base:n,prev:S.call(Array(t+1),n)}}(s,o);if("undefined"===typeof l)l=[];else if(Y(l,t)>=0)return"[Circular]";function U(t,n,r){if(n&&(l=A.call(l)).push(n),r){var i={depth:s.depth};return B(s,"quoteStyle")&&(i.quoteStyle=s.quoteStyle),e(t,i,o+1,l)}return e(t,s,o+1,l)}if("function"===typeof t&&!V(t)){var q=function(e){if(e.name)return e.name;var t=g.call(v.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),ee=X(t,U);return"[Function"+(q?": "+q:" (anonymous)")+"]"+(ee.length>0?" { "+S.call(ee,", ")+" }":"")}if(H(t)){var te=N?_.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):T.call(t);return"object"!==typeof t||N?te:K(te)}if(function(e){if(!e||"object"!==typeof e)return!1;if("undefined"!==typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"===typeof e.nodeName&&"function"===typeof e.getAttribute}(t)){for(var ne="<"+w.call(String(t.nodeName)),re=t.attributes||[],oe=0;oe"}if(j(t)){if(0===t.length)return"[]";var ie=X(t,U);return D&&!function(e){for(var t=0;t=0)return!1;return!0}(ie)?"["+J(ie,D)+"]":"[ "+S.call(ie,", ")+" ]"}if(function(e){return"[object Error]"===W(e)&&(!O||!("object"===typeof e&&O in e))}(t)){var ae=X(t,U);return"cause"in Error.prototype||!("cause"in t)||P.call(t,"cause")?0===ae.length?"["+String(t)+"]":"{ ["+String(t)+"] "+S.call(ae,", ")+" }":"{ ["+String(t)+"] "+S.call(x.call("[cause]: "+U(t.cause),ae),", ")+" }"}if("object"===typeof t&&m){if(I&&"function"===typeof t[I]&&z)return z(t,{depth:M-o});if("symbol"!==m&&"function"===typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!==typeof e)return!1;try{i.call(e);try{c.call(e)}catch(ne){return!0}return e instanceof Map}catch(t){}return!1}(t)){var le=[];return a&&a.call(t,(function(e,n){le.push(U(n,t,!0)+" => "+U(e,t))})),Q("Map",i.call(t),le,D)}if(function(e){if(!c||!e||"object"!==typeof e)return!1;try{c.call(e);try{i.call(e)}catch(t){return!0}return e instanceof Set}catch(n){}return!1}(t)){var se=[];return u&&u.call(t,(function(e){se.push(U(e,t))})),Q("Set",c.call(t),se,D)}if(function(e){if(!d||!e||"object"!==typeof e)return!1;try{d.call(e,d);try{h.call(e,h)}catch(ne){return!0}return e instanceof WeakMap}catch(t){}return!1}(t))return G("WeakMap");if(function(e){if(!h||!e||"object"!==typeof e)return!1;try{h.call(e,h);try{d.call(e,d)}catch(ne){return!0}return e instanceof WeakSet}catch(t){}return!1}(t))return G("WeakSet");if(function(e){if(!f||!e||"object"!==typeof e)return!1;try{return f.call(e),!0}catch(t){}return!1}(t))return G("WeakRef");if(function(e){return"[object Number]"===W(e)&&(!O||!("object"===typeof e&&O in e))}(t))return K(U(Number(t)));if(function(e){if(!e||"object"!==typeof e||!E)return!1;try{return E.call(e),!0}catch(t){}return!1}(t))return K(U(E.call(t)));if(function(e){return"[object Boolean]"===W(e)&&(!O||!("object"===typeof e&&O in e))}(t))return K(p.call(t));if(function(e){return"[object String]"===W(e)&&(!O||!("object"===typeof e&&O in e))}(t))return K(U(String(t)));if("undefined"!==typeof window&&t===window)return"{ [object Window] }";if(t===n.g)return"{ [object globalThis] }";if(!function(e){return"[object Date]"===W(e)&&(!O||!("object"===typeof e&&O in e))}(t)&&!V(t)){var ce=X(t,U),ue=L?L(t)===Object.prototype:t instanceof Object||t.constructor===Object,de=t instanceof Object?"":"null prototype",he=!ue&&O&&Object(t)===t&&O in t?y.call(W(t),8,-1):de?"Object":"",fe=(ue||"function"!==typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(he||de?"["+S.call(x.call([],he||[],de||[]),": ")+"] ":"");return 0===ce.length?fe+"{}":D?fe+"{"+J(ce,D)+"}":fe+"{ "+S.call(ce,", ")+" }"}return String(t)};var U=Object.prototype.hasOwnProperty||function(e){return e in this};function B(e,t){return U.call(e,t)}function W(e){return m.call(e)}function Y(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return Z(y.call(e,0,t.maxStringLength),t)+r}return $(_.call(_.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,q),"single",t)}function q(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+b.call(t.toString(16))}function K(e){return"Object("+e+")"}function G(e){return e+" { ? }"}function Q(e,t,n,r){return e+" ("+t+") {"+(r?J(n,r):S.call(n,", "))+"}"}function J(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+S.call(e,","+n)+"\n"+t.prev}function X(e,t){var n=j(e),r=[];if(n){r.length=e.length;for(var o=0;o{"use strict";n.r(t),n.d(t,{Children:()=>Y,Component:()=>l.uA,Fragment:()=>l.FK,PureComponent:()=>j,StrictMode:()=>Pe,Suspense:()=>Q,SuspenseList:()=>ee,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>ke,cloneElement:()=>Ee,createContext:()=>l.q6,createElement:()=>l.n,createFactory:()=>Se,createPortal:()=>oe,createRef:()=>l._3,default:()=>je,findDOMNode:()=>Te,flushSync:()=>Oe,forwardRef:()=>B,hydrate:()=>he,isElement:()=>Ie,isFragment:()=>Ce,isValidElement:()=>Ae,lazy:()=>X,memo:()=>V,render:()=>de,startTransition:()=>Le,unmountComponentAtNode:()=>Me,unstable_batchedUpdates:()=>Ne,useCallback:()=>C,useContext:()=>E,useDebugValue:()=>M,useDeferredValue:()=>Re,useEffect:()=>w,useErrorBoundary:()=>T,useId:()=>N,useImperativeHandle:()=>S,useInsertionEffect:()=>De,useLayoutEffect:()=>k,useMemo:()=>A,useReducer:()=>b,useRef:()=>x,useState:()=>_,useSyncExternalStore:()=>$e,useTransition:()=>ze,version:()=>xe});var r,o,i,a,l=n(746),s=0,c=[],u=[],d=l.fF,h=d.__b,f=d.__r,p=d.diffed,m=d.__c,v=d.unmount,g=d.__;function y(e,t){d.__h&&d.__h(o,e,s||t),s=0;var n=o.__H||(o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:u}),n.__[e]}function _(e){return s=1,b(I,e)}function b(e,t,n){var i=y(r++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):I(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=o,!o.u)){var a=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return!!e.__c}));if(r.every((function(e){return!e.__N})))return!l||l.call(this,e,t,n);var o=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),!(!o&&i.__c.props===e)&&(!l||l.call(this,e,t,n))};o.u=!0;var l=o.shouldComponentUpdate,s=o.componentWillUpdate;o.componentWillUpdate=function(e,t,n){if(this.__e){var r=l;l=void 0,a(e,t,n),l=r}s&&s.call(this,e,t,n)},o.shouldComponentUpdate=a}return i.__N||i.__}function w(e,t){var n=y(r++,3);!d.__s&&D(n.__H,t)&&(n.__=e,n.i=t,o.__H.__h.push(n))}function k(e,t){var n=y(r++,4);!d.__s&&D(n.__H,t)&&(n.__=e,n.i=t,o.__h.push(n))}function x(e){return s=5,A((function(){return{current:e}}),[])}function S(e,t,n){s=6,k((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function A(e,t){var n=y(r++,7);return D(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function C(e,t){return s=8,A((function(){return e}),t)}function E(e){var t=o.context[e.__c],n=y(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(o)),t.props.value):e.__}function M(e,t){d.useDebugValue&&d.useDebugValue(t?t(e):e)}function T(e){var t=y(r++,10),n=_();return t.__=e,o.componentDidCatch||(o.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function N(){var e=y(r++,11);if(!e.__){for(var t=o.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function O(){for(var e;e=c.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(R),e.__H.__h.forEach(z),e.__H.__h=[]}catch(r){e.__H.__h=[],d.__e(r,e.__v)}}d.__b=function(e){o=null,h&&h(e)},d.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),g&&g(e,t)},d.__r=function(e){f&&f(e),r=0;var t=(o=e.__c).__H;t&&(i===o?(t.__h=[],o.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=u,e.__N=e.i=void 0}))):(t.__h.forEach(R),t.__h.forEach(z),t.__h=[],r=0)),i=o},d.diffed=function(e){p&&p(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==c.push(t)&&a===d.requestAnimationFrame||((a=d.requestAnimationFrame)||L)(O)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==u&&(e.__=e.__V),e.i=void 0,e.__V=u}))),i=o=null},d.__c=function(e,t){t.some((function(e){try{e.__h.forEach(R),e.__h=e.__h.filter((function(e){return!e.__||z(e)}))}catch(o){t.some((function(e){e.__h&&(e.__h=[])})),t=[],d.__e(o,e.__v)}})),m&&m(e,t)},d.unmount=function(e){v&&v(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{R(e)}catch(e){t=e}})),n.__H=void 0,t&&d.__e(t,n.__v))};var P="function"==typeof requestAnimationFrame;function L(e){var t,n=function(){clearTimeout(r),P&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);P&&(t=requestAnimationFrame(n))}function R(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function z(e){var t=o;e.__c=e.__(),o=t}function D(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function I(e,t){return"function"==typeof t?t(e):t}function $(e,t){for(var n in t)e[n]=t[n];return e}function F(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function j(e,t){this.props=e,this.context=t}function V(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:F(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,l.n)(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(j.prototype=new l.uA).isPureReactComponent=!0,j.prototype.shouldComponentUpdate=function(e,t){return F(this.props,e)||F(this.state,t)};var H=l.fF.__b;l.fF.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),H&&H(e)};var U="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function B(e){function t(t){var n=$({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=U,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var W=function(e,t){return null==e?null:(0,l.v2)((0,l.v2)(e).map(t))},Y={map:W,forEach:W,count:function(e){return e?(0,l.v2)(e).length:0},only:function(e){var t=(0,l.v2)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:l.v2},Z=l.fF.__e;l.fF.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);Z(e,t,n,r)};var q=l.fF.unmount;function K(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=$({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return K(e,t,n)}))),e}function G(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return G(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Q(){this.__u=0,this.t=null,this.__b=null}function J(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function X(e){var t,n,r;function o(o){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return(0,l.n)(n,o)}return o.displayName="Lazy",o.__f=!0,o}function ee(){this.u=null,this.o=null}l.fF.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),q&&q(e)},(Q.prototype=new l.uA).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=J(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(l):l())};n.__R=a;var l=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=G(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},Q.prototype.componentWillUnmount=function(){this.t=[]},Q.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=K(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&(0,l.n)(l.FK,null,e.fallback);return o&&(o.__u&=-33),[(0,l.n)(l.FK,null,t.__a?null:e.children),o]};var te=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.i.removeChild(e)}}),(0,l.XX)((0,l.n)(ne,{context:t.context},e.__v),t.l)}function oe(e,t){var n=(0,l.n)(re,{__v:e,i:t});return n.containerInfo=t,n}(ee.prototype=new l.uA).__a=function(e){var t=this,n=J(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),te(t,e,r)):o()};n?n(i):i()}},ee.prototype.render=function(e){this.u=null,this.o=new Map;var t=(0,l.v2)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},ee.prototype.componentDidUpdate=ee.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){te(e,n,t)}))};var ie="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,ae=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,le=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,se=/[A-Z0-9]/g,ce="undefined"!=typeof document,ue=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function de(e,t,n){return null==t.__k&&(t.textContent=""),(0,l.XX)(e,t),"function"==typeof n&&n(),e?e.__c:null}function he(e,t,n){return(0,l.Qv)(e,t),"function"==typeof n&&n(),e?e.__c:null}l.uA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(l.uA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var fe=l.fF.event;function pe(){}function me(){return this.cancelBubble}function ve(){return this.defaultPrevented}l.fF.event=function(e){return fe&&(e=fe(e)),e.persist=pe,e.isPropagationStopped=me,e.isDefaultPrevented=ve,e.nativeEvent=e};var ge,ye={enumerable:!1,configurable:!0,get:function(){return this.class}},_e=l.fF.vnode;l.fF.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={};for(var o in t){var i=t[o];if(!("value"===o&&"defaultValue"in t&&null==i||ce&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var a=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===i?i="":"translate"===a&&"no"===i?i=!1:"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||ue(t.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":le.test(o)?o=a:-1===n.indexOf("-")&&ae.test(o)?o=o.replace(se,"-$&").toLowerCase():null===i&&(i=void 0):a=o="oninput","oninput"===a&&r[o=a]&&(o="oninputCapture"),r[o]=i}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=(0,l.v2)(t.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==n&&null!=r.defaultValue&&(r.value=(0,l.v2)(t.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",ye)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=ie,_e&&_e(e)};var be=l.fF.__r;l.fF.__r=function(e){be&&be(e),ge=e.__c};var we=l.fF.diffed;l.fF.diffed=function(e){we&&we(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),ge=null};var ke={ReactCurrentDispatcher:{current:{readContext:function(e){return ge.__n[e.__c].props.value}}}},xe="17.0.2";function Se(e){return l.n.bind(null,e)}function Ae(e){return!!e&&e.$$typeof===ie}function Ce(e){return Ae(e)&&e.type===l.FK}function Ee(e){return Ae(e)?l.Ob.apply(null,arguments):e}function Me(e){return!!e.__k&&((0,l.XX)(null,e),!0)}function Te(e){return e&&(e.base||1===e.nodeType&&e)||null}var Ne=function(e,t){return e(t)},Oe=function(e,t){return e(t)},Pe=l.FK;function Le(e){e()}function Re(e){return e}function ze(){return[!1,Le]}var De=k,Ie=Ae;function $e(e,t){var n=t(),r=_({h:{__:n,v:t}}),o=r[0].h,i=r[1];return k((function(){o.__=n,o.v=t,Fe(o)&&i({h:o})}),[e,n,t]),w((function(){return Fe(o)&&i({h:o}),e((function(){Fe(o)&&i({h:o})}))}),[e]),n}function Fe(e){var t,n,r=e.v,o=e.__;try{var i=r();return!((t=o)===(n=i)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}var je={useState:_,useId:N,useReducer:b,useEffect:w,useLayoutEffect:k,useInsertionEffect:De,useTransition:ze,useDeferredValue:Re,useSyncExternalStore:$e,startTransition:Le,useRef:x,useImperativeHandle:S,useMemo:A,useCallback:C,useContext:E,useDebugValue:M,version:"17.0.2",Children:Y,render:de,hydrate:he,unmountComponentAtNode:Me,createPortal:oe,createElement:l.n,createContext:l.q6,createFactory:Se,cloneElement:Ee,createRef:l._3,Fragment:l.FK,isValidElement:Ae,isElement:Ie,isFragment:Ce,findDOMNode:Te,Component:l.uA,PureComponent:j,memo:V,forwardRef:B,flushSync:Oe,unstable_batchedUpdates:Ne,StrictMode:Pe,Suspense:Q,SuspenseList:ee,lazy:X,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ke}},746:(e,t,n)=>{"use strict";n.d(t,{FK:()=>b,Ob:()=>B,Qv:()=>U,XX:()=>H,_3:()=>_,fF:()=>o,n:()=>g,q6:()=>W,uA:()=>w,v2:()=>N});var r,o,i,a,l,s,c,u,d={},h=[],f=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,p=Array.isArray;function m(e,t){for(var n in t)e[n]=t[n];return e}function v(e){var t=e.parentNode;t&&t.removeChild(e)}function g(e,t,n){var o,i,a,l={};for(a in t)"key"==a?o=t[a]:"ref"==a?i=t[a]:l[a]=t[a];if(arguments.length>2&&(l.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===l[a]&&(l[a]=e.defaultProps[a]);return y(e,l,o,i,null)}function y(e,t,n,r,a){var l={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++i:a,__i:-1,__u:0};return null==a&&null!=o.vnode&&o.vnode(l),l}function _(){return{current:null}}function b(e){return e.children}function w(e,t){this.props=e,this.context=t}function k(e,t){if(null==t)return e.__?k(e.__,e.__i+1):null;for(var n;tn?(I(r,t,i),i.length=r.length=0,t=void 0,a.sort(c)):t&&o.__c&&o.__c(t,h));t&&I(r,t,i),C.__r=0}function E(e,t,n,r,o,i,a,l,s,c,u){var f,p,m,v,g,y=r&&r.__k||h,_=t.length;for(n.__d=s,M(n,t,y),s=n.__d,f=0;f<_;f++)null!=(m=n.__k[f])&&"boolean"!=typeof m&&"function"!=typeof m&&(p=-1===m.__i?d:y[m.__i]||d,m.__i=f,D(e,m,p,o,i,a,l,s,c,u),v=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&F(p.ref,null,m),u.push(m.ref,m.__c||v,m)),null==g&&null!=v&&(g=v),65536&m.__u||p.__k===m.__k?s=T(m,s,e):"function"==typeof m.type&&void 0!==m.__d?s=m.__d:v&&(s=v.nextSibling),m.__d=void 0,m.__u&=-196609);n.__d=s,n.__e=g}function M(e,t,n){var r,o,i,a,l,s=t.length,c=n.length,u=c,d=0;for(e.__k=[],r=0;r0?y(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,l=O(o,n,a=r+d,u),o.__i=l,i=null,-1!==l&&(u--,(i=n[l])&&(i.__u|=131072)),null==i||null===i.__v?(-1==l&&d--,"function"!=typeof o.type&&(o.__u|=65536)):l!==a&&(l===a+1?d++:l>a?u>s-a?d+=l-a:d--:d=l(null!=s&&0==(131072&s.__u)?1:0))for(;a>=0||l=0){if((s=t[a])&&0==(131072&s.__u)&&o==s.key&&i===s.type)return a;a--}if(l2&&(s.children=arguments.length>3?r.call(arguments,2):n),y(e.type,s,o||e.key,i||e.ref,null)}function W(e,t){var n={__c:t="__cC"+u++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,A(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=h.slice,o={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},i=0,w.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=m({},this.state),"function"==typeof e&&(e=e(m({},n),this.props)),e&&m(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),A(this))},w.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),A(this))},w.prototype.render=b,a=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},C.__r=0,u=0},640:e=>{"use strict";var t=String.prototype.replace,n=/%20/g,r="RFC1738",o="RFC3986";e.exports={default:o,formatters:{RFC1738:function(e){return t.call(e,n,"+")},RFC3986:function(e){return String(e)}},RFC1738:r,RFC3986:o}},215:(e,t,n)=>{"use strict";var r=n(518),o=n(968),i=n(640);e.exports={formats:i,parse:o,stringify:r}},968:(e,t,n)=>{"use strict";var r=n(570),o=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},l=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},s=function(e,t){return e&&"string"===typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},c=function(e,t,n,r){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,l=n.depth>0&&/(\[[^[\]]*])/.exec(i),c=l?i.slice(0,l.index):i,u=[];if(c){if(!n.plainObjects&&o.call(Object.prototype,c)&&!n.allowPrototypes)return;u.push(c)}for(var d=0;n.depth>0&&null!==(l=a.exec(i))&&d=0;--i){var a,l=e[i];if("[]"===l&&n.parseArrays)a=[].concat(o);else{a=n.plainObjects?Object.create(null):{};var c="["===l.charAt(0)&&"]"===l.charAt(l.length-1)?l.slice(1,-1):l,u=parseInt(c,10);n.parseArrays||""!==c?!isNaN(u)&&l!==c&&String(u)===c&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(a=[])[u]=o:"__proto__"!==c&&(a[c]=o):a={0:o}}o=a}return o}(u,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!==typeof e.decoder)throw new TypeError("Decoder has to be a function.");if("undefined"!==typeof e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t="undefined"===typeof e.charset?a.charset:e.charset;return{allowDots:"undefined"===typeof e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"===typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"===typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:"number"===typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"===typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"===typeof e.comma?e.comma:a.comma,decoder:"function"===typeof e.decoder?e.decoder:a.decoder,delimiter:"string"===typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"===typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"===typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"===typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"===typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"===typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null===e||"undefined"===typeof e)return n.plainObjects?Object.create(null):{};for(var u="string"===typeof e?function(e,t){var n,c={__proto__:null},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,d=t.parameterLimit===1/0?void 0:t.parameterLimit,h=u.split(t.delimiter,d),f=-1,p=t.charset;if(t.charsetSentinel)for(n=0;n-1&&(v=i(v)?[v]:v),o.call(c,m)?c[m]=r.combine(c[m],v):c[m]=v}return c}(e,n):e,d=n.plainObjects?Object.create(null):{},h=Object.keys(u),f=0;f{"use strict";var r=n(670),o=n(570),i=n(640),a=Object.prototype.hasOwnProperty,l={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},s=Array.isArray,c=Array.prototype.push,u=function(e,t){c.apply(e,s(t)?t:[t])},d=Date.prototype.toISOString,h=i.default,f={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:o.encode,encodeValuesOnly:!1,format:h,formatter:i.formatters[h],indices:!1,serializeDate:function(e){return d.call(e)},skipNulls:!1,strictNullHandling:!1},p={},m=function e(t,n,i,a,l,c,d,h,m,v,g,y,_,b,w,k){for(var x,S=t,A=k,C=0,E=!1;void 0!==(A=A.get(p))&&!E;){var M=A.get(t);if(C+=1,"undefined"!==typeof M){if(M===C)throw new RangeError("Cyclic object value");E=!0}"undefined"===typeof A.get(p)&&(C=0)}if("function"===typeof h?S=h(n,S):S instanceof Date?S=g(S):"comma"===i&&s(S)&&(S=o.maybeMap(S,(function(e){return e instanceof Date?g(e):e}))),null===S){if(l)return d&&!b?d(n,f.encoder,w,"key",y):n;S=""}if("string"===typeof(x=S)||"number"===typeof x||"boolean"===typeof x||"symbol"===typeof x||"bigint"===typeof x||o.isBuffer(S))return d?[_(b?n:d(n,f.encoder,w,"key",y))+"="+_(d(S,f.encoder,w,"value",y))]:[_(n)+"="+_(String(S))];var T,N=[];if("undefined"===typeof S)return N;if("comma"===i&&s(S))b&&d&&(S=o.maybeMap(S,d)),T=[{value:S.length>0?S.join(",")||null:void 0}];else if(s(h))T=h;else{var O=Object.keys(S);T=m?O.sort(m):O}for(var P=a&&s(S)&&1===S.length?n+"[]":n,L=0;L0?w+b:""}},570:(e,t,n)=>{"use strict";var r=n(640),o=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),l=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],o=0;o=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===r.RFC1738&&(40===u||41===u)?s+=l.charAt(c):u<128?s+=a[u]:u<2048?s+=a[192|u>>6]+a[128|63&u]:u<55296||u>=57344?s+=a[224|u>>12]+a[128|u>>6&63]+a[128|63&u]:(c+=1,u=65536+((1023&u)<<10|1023&l.charCodeAt(c)),s+=a[240|u>>18]+a[128|u>>12&63]+a[128|u>>6&63]+a[128|63&u])}return s},isBuffer:function(e){return!(!e||"object"!==typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var n=[],r=0;r{e.exports=n(204)},204:(e,t,n)=>{"use strict";var r=function(e){return e&&"object"==typeof e&&"default"in e?e.default:e}(n(609)),o=n(609);function i(){return(i=Object.assign||function(e){for(var t=1;tr.length&&h(e,t.length-1);)t=t.slice(0,t.length-1);return t.length}for(var o=r.length,i=t.length;i>=r.length;i--){var a=t[i];if(!h(e,i)&&f(e,i,a)){o=i+1;break}}return o}function v(e,t){return m(e,t)===e.mask.length}function g(e,t){var n=e.maskChar,r=e.mask,o=e.prefix;if(!n){for((t=y(e,"",t,0)).lengtht.length&&(t+=o.slice(t.length,r)),l.every((function(n){for(;u=n,h(e,c=r)&&u!==o[c];){if(r>=t.length&&(t+=o[r]),l=n,i&&h(e,r)&&l===i)return!0;if(++r>=o.length)return!1}var l,c,u;return!f(e,r,n)&&n!==i||(ro.start?d=(u=function(e,t,n,r){var o=e.mask,i=e.maskChar,a=n.split(""),l=r;return a.every((function(t){for(;a=t,h(e,n=r)&&a!==o[n];)if(++r>=o.length)return!1;var n,a;return(f(e,r,t)||t===i)&&r++,r=i.length?p=i.length:p=a.length&&p{"use strict";var r=n(375),o=n(411),i=n(734)(),a=n(553),l=n(277),s=r("%Math.floor%");e.exports=function(e,t){if("function"!==typeof e)throw new l("`fn` is not a function");if("number"!==typeof t||t<0||t>4294967295||s(t)!==t)throw new l("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],r=!0,c=!0;if("length"in e&&a){var u=a(e,"length");u&&!u.configurable&&(r=!1),u&&!u.writable&&(c=!1)}return(r||c||!n)&&(i?o(e,"length",t,!0,!0):o(e,"length",t)),e}},670:(e,t,n)=>{"use strict";var r=n(375),o=n(61),i=n(141),a=n(277),l=r("%WeakMap%",!0),s=r("%Map%",!0),c=o("WeakMap.prototype.get",!0),u=o("WeakMap.prototype.set",!0),d=o("WeakMap.prototype.has",!0),h=o("Map.prototype.get",!0),f=o("Map.prototype.set",!0),p=o("Map.prototype.has",!0),m=function(e,t){for(var n,r=e;null!==(n=r.next);r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n};e.exports=function(){var e,t,n,r={assert:function(e){if(!r.has(e))throw new a("Side channel does not contain "+i(e))},get:function(r){if(l&&r&&("object"===typeof r||"function"===typeof r)){if(e)return c(e,r)}else if(s){if(t)return h(t,r)}else if(n)return function(e,t){var n=m(e,t);return n&&n.value}(n,r)},has:function(r){if(l&&r&&("object"===typeof r||"function"===typeof r)){if(e)return d(e,r)}else if(s){if(t)return p(t,r)}else if(n)return function(e,t){return!!m(e,t)}(n,r);return!1},set:function(r,o){l&&r&&("object"===typeof r||"function"===typeof r)?(e||(e=new l),u(e,r,o)):s?(t||(t=new s),f(t,r,o)):(n||(n={key:{},next:null}),function(e,t,n){var r=m(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(n,r,o))}};return r}},634:()=>{},738:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e="",t=0;t{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>"static/js/"+e+".bebe1265.chunk.js",n.miniCssF=e=>{},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="vmui:";n.l=(r,o,i,a)=>{if(e[r])e[r].push(o);else{var l,s;if(void 0!==i)for(var c=document.getElementsByTagName("script"),u=0;u{l.onerror=l.onload=null,clearTimeout(f);var o=e[r];if(delete e[r],l.parentNode&&l.parentNode.removeChild(l),o&&o.forEach((e=>e(n))),t)return t(n)},f=setTimeout(h.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=h.bind(null,l.onerror),l.onload=h.bind(null,l.onload),s&&document.head.appendChild(l)}}})(),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="./",(()=>{var e={792:0};n.f.j=(t,r)=>{var o=n.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var i=new Promise(((n,r)=>o=e[t]=[n,r]));r.push(o[2]=i);var a=n.p+n.u(t),l=new Error;n.l(a,(r=>{if(n.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;l.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",l.name="ChunkLoadError",l.type=i,l.request=a,o[1](l)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,i,a=r[0],l=r[1],s=r[2],c=0;if(a.some((t=>0!==e[t]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(s)s(n)}for(t&&t(r);c{"use strict";var e,t=n(609),r=n(159),o=n.n(r),i=n(7),a=n.n(i),l=n(648),s=n.n(l),c=n(220),u=n.n(c);function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function _(t,n,r,o){void 0===o&&(o={});let{window:i=document.defaultView,v5Compat:a=!1}=o,l=i.history,s=e.Pop,c=null,u=p();function p(){return(l.state||{idx:null}).idx}function y(){s=e.Pop;let t=p(),n=null==t?null:t-u;u=t,c&&c({action:s,location:b.location,delta:n})}function _(e){let t="null"!==i.location.origin?i.location.origin:i.location.href,n="string"===typeof e?e:g(e);return n=n.replace(/ $/,"%20"),f(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==u&&(u=0,l.replaceState(d({},l.state,{idx:u}),""));let b={get action(){return s},get location(){return t(i,l)},listen(e){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(h,y),c=e,()=>{i.removeEventListener(h,y),c=null}},createHref:e=>n(i,e),createURL:_,encodeLocation(e){let t=_(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(t,n){s=e.Push;let o=v(b.location,t,n);r&&r(o,t),u=p()+1;let d=m(o,u),h=b.createHref(o);try{l.pushState(d,"",h)}catch(f){if(f instanceof DOMException&&"DataCloneError"===f.name)throw f;i.location.assign(h)}a&&c&&c({action:s,location:b.location,delta:1})},replace:function(t,n){s=e.Replace;let o=v(b.location,t,n);r&&r(o,t),u=p();let i=m(o,u),d=b.createHref(o);l.replaceState(i,"",d),a&&c&&c({action:s,location:b.location,delta:0})},go:e=>l.go(e)};return b}var b;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(b||(b={}));new Set(["lazy","caseSensitive","path","id","index","children"]);function w(e,t,n){void 0===n&&(n="/");let r=z(("string"===typeof t?y(t):t).pathname||"/",n);if(null==r)return null;let o=k(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let i=null;for(let a=0;null==i&&a{let a={relativePath:void 0===i?e.path||"":i,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};a.relativePath.startsWith("/")&&(f(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),a.relativePath=a.relativePath.slice(r.length));let l=j([r,a.relativePath]),s=n.concat(a);e.children&&e.children.length>0&&(f(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),k(e.children,t,s,l)),(null!=e.path||e.index)&&t.push({path:l,score:O(l,e.index),routesMeta:s})};return e.forEach(((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let r of x(e.path))o(e,t,r);else o(e,t)})),t}function x(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===r.length)return o?[i,""]:[i];let a=x(r.join("/")),l=[];return l.push(...a.map((e=>""===e?i:[i,e].join("/")))),o&&l.push(...a),l.map((t=>e.startsWith("/")&&""===t?"/":t))}const S=/^:[\w-]+$/,A=3,C=2,E=1,M=10,T=-2,N=e=>"*"===e;function O(e,t){let n=e.split("/"),r=n.length;return n.some(N)&&(r+=T),t&&(r+=C),n.filter((e=>!N(e))).reduce(((e,t)=>e+(S.test(t)?A:""===t?E:M)),r)}function P(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let a=0;a(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(r.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let i=new RegExp(o,t?void 0:"i");return[i,r]}(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:r.reduce(((e,t,n)=>{let{paramName:r,isOptional:o}=t;if("*"===r){let e=l[n]||"";a=i.slice(0,i.length-e.length).replace(/(.)\/+$/,"$1")}const s=l[n];return e[r]=o&&!s?void 0:(s||"").replace(/%2F/g,"/"),e}),{}),pathname:i,pathnameBase:a,pattern:e}}function R(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return p(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function z(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function D(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function I(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function $(e,t){let n=I(e);return t?n.map(((t,n)=>n===e.length-1?t.pathname:t.pathnameBase)):n.map((e=>e.pathnameBase))}function F(e,t,n,r){let o;void 0===r&&(r=!1),"string"===typeof e?o=y(e):(o=d({},e),f(!o.pathname||!o.pathname.includes("?"),D("?","pathname","search",o)),f(!o.pathname||!o.pathname.includes("#"),D("#","pathname","hash",o)),f(!o.search||!o.search.includes("#"),D("#","search","hash",o)));let i,a=""===e||""===o.pathname,l=a?"/":o.pathname;if(null==l)i=n;else{let e=t.length-1;if(!r&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}i=e>=0?t[e]:"/"}let s=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:o=""}="string"===typeof e?y(e):e,i=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:i,search:H(r),hash:U(o)}}(o,i),c=l&&"/"!==l&&l.endsWith("/"),u=(a||"."===l)&&n.endsWith("/");return s.pathname.endsWith("/")||!c&&!u||(s.pathname+="/"),s}const j=e=>e.join("/").replace(/\/\/+/g,"/"),V=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),H=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",U=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;function B(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}const W=["post","put","patch","delete"],Y=(new Set(W),["get",...W]);new Set(Y),new Set([301,302,303,307,308]),new Set([307,308]);Symbol("deferred");function Z(){return Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t{r.current=!0}));let o=t.useCallback((function(t,o){void 0===o&&(o={}),r.current&&("number"===typeof t?e.navigate(t):e.navigate(t,Z({fromRouteId:n},o)))}),[e,n]);return o}():function(){ee()||f(!1);let e=t.useContext(q),{basename:n,future:r,navigator:o}=t.useContext(G),{matches:i}=t.useContext(J),{pathname:a}=te(),l=JSON.stringify($(i,r.v7_relativeSplatPath)),s=t.useRef(!1);ne((()=>{s.current=!0}));let c=t.useCallback((function(t,r){if(void 0===r&&(r={}),!s.current)return;if("number"===typeof t)return void o.go(t);let i=F(t,JSON.parse(l),a,"path"===r.relative);null==e&&"/"!==n&&(i.pathname="/"===i.pathname?n:j([n,i.pathname])),(r.replace?o.replace:o.push)(i,r.state,r)}),[n,o,l,a,e]);return c}()}const oe=t.createContext(null);function ie(e,n){let{relative:r}=void 0===n?{}:n,{future:o}=t.useContext(G),{matches:i}=t.useContext(J),{pathname:a}=te(),l=JSON.stringify($(i,o.v7_relativeSplatPath));return t.useMemo((()=>F(e,JSON.parse(l),a,"path"===r)),[e,l,a,r])}function ae(n,r,o,i){ee()||f(!1);let{navigator:a}=t.useContext(G),{matches:l}=t.useContext(J),s=l[l.length-1],c=s?s.params:{},u=(s&&s.pathname,s?s.pathnameBase:"/");s&&s.route;let d,h=te();if(r){var p;let e="string"===typeof r?y(r):r;"/"===u||(null==(p=e.pathname)?void 0:p.startsWith(u))||f(!1),d=e}else d=h;let m=d.pathname||"/",v=m;if("/"!==u){let e=u.replace(/^\//,"").split("/");v="/"+m.replace(/^\//,"").split("/").slice(e.length).join("/")}let g=w(n,{pathname:v});let _=de(g&&g.map((e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:j([u,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?u:j([u,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),l,o,i);return r&&_?t.createElement(Q.Provider,{value:{location:Z({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:e.Pop}},_):_}function le(){let e=function(){var e;let n=t.useContext(X),r=me(fe.UseRouteError),o=ve(fe.UseRouteError);if(void 0!==n)return n;return null==(e=r.errors)?void 0:e[o]}(),n=B(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:o};return t.createElement(t.Fragment,null,t.createElement("h2",null,"Unexpected Application Error!"),t.createElement("h3",{style:{fontStyle:"italic"}},n),r?t.createElement("pre",{style:i},r):null,null)}const se=t.createElement(le,null);class ce extends t.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?t.createElement(J.Provider,{value:this.props.routeContext},t.createElement(X.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ue(e){let{routeContext:n,match:r,children:o}=e,i=t.useContext(q);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),t.createElement(J.Provider,{value:n},o)}function de(e,n,r,o){var i;if(void 0===n&&(n=[]),void 0===r&&(r=null),void 0===o&&(o=null),null==e){var a;if(null==(a=r)||!a.errors)return null;e=r.matches}let l=e,s=null==(i=r)?void 0:i.errors;if(null!=s){let e=l.findIndex((e=>e.route.id&&(null==s?void 0:s[e.route.id])));e>=0||f(!1),l=l.slice(0,Math.min(l.length,e+1))}let c=!1,u=-1;if(r&&o&&o.v7_partialHydration)for(let t=0;t=0?l.slice(0,u+1):[l[0]];break}}}return l.reduceRight(((e,o,i)=>{let a,d=!1,h=null,f=null;var p;r&&(a=s&&o.route.id?s[o.route.id]:void 0,h=o.route.errorElement||se,c&&(u<0&&0===i?(p="route-fallback",!1||ge[p]||(ge[p]=!0),d=!0,f=null):u===i&&(d=!0,f=o.route.hydrateFallbackElement||null)));let m=n.concat(l.slice(0,i+1)),v=()=>{let n;return n=a?h:d?f:o.route.Component?t.createElement(o.route.Component,null):o.route.element?o.route.element:e,t.createElement(ue,{match:o,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:n})};return r&&(o.route.ErrorBoundary||o.route.errorElement||0===i)?t.createElement(ce,{location:r.location,revalidation:r.revalidation,component:h,error:a,children:v(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):v()}),null)}var he=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(he||{}),fe=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(fe||{});function pe(e){let n=t.useContext(q);return n||f(!1),n}function me(e){let n=t.useContext(K);return n||f(!1),n}function ve(e){let n=function(e){let n=t.useContext(J);return n||f(!1),n}(),r=n.matches[n.matches.length-1];return r.route.id||f(!1),r.route.id}const ge={};t.startTransition;function ye(e){return function(e){let n=t.useContext(J).outlet;return n?t.createElement(oe.Provider,{value:e},n):n}(e.context)}function _e(e){f(!1)}function be(n){let{basename:r="/",children:o=null,location:i,navigationType:a=e.Pop,navigator:l,static:s=!1,future:c}=n;ee()&&f(!1);let u=r.replace(/^\/*/,"/"),d=t.useMemo((()=>({basename:u,navigator:l,static:s,future:Z({v7_relativeSplatPath:!1},c)})),[u,c,l,s]);"string"===typeof i&&(i=y(i));let{pathname:h="/",search:p="",hash:m="",state:v=null,key:g="default"}=i,_=t.useMemo((()=>{let e=z(h,u);return null==e?null:{location:{pathname:e,search:p,hash:m,state:v,key:g},navigationType:a}}),[u,h,p,m,v,g,a]);return null==_?null:t.createElement(G.Provider,{value:d},t.createElement(Q.Provider,{children:o,value:_}))}function we(e){let{children:t,location:n}=e;return ae(ke(t),n)}new Promise((()=>{}));t.Component;function ke(e,n){void 0===n&&(n=[]);let r=[];return t.Children.forEach(e,((e,o)=>{if(!t.isValidElement(e))return;let i=[...n,o];if(e.type===t.Fragment)return void r.push.apply(r,ke(e.props.children,i));e.type!==_e&&f(!1),e.props.index&&e.props.children&&f(!1);let a={id:e.props.id||i.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=ke(e.props.children,i)),r.push(a)})),r}function xe(){return xe=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function Ae(e){return void 0===e&&(e=""),new URLSearchParams("string"===typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map((e=>[n,e])):[[n,r]])}),[]))}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const Ce=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Ee=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"];try{window.__reactRouterVersion="6"}catch(Au){}const Me=t.createContext({isTransitioning:!1});new Map;const Te=t.startTransition;t.flushSync,t.useId;function Ne(e){let{basename:n,children:r,future:o,window:i}=e,a=t.useRef();null==a.current&&(a.current=function(e){return void 0===e&&(e={}),_((function(e,t){let{pathname:n="/",search:r="",hash:o=""}=y(e.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),v("",{pathname:n,search:r,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"===typeof t?t:g(t))}),(function(e,t){p("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}({window:i,v5Compat:!0}));let l=a.current,[s,c]=t.useState({action:l.action,location:l.location}),{v7_startTransition:u}=o||{},d=t.useCallback((e=>{u&&Te?Te((()=>c(e))):c(e)}),[c,u]);return t.useLayoutEffect((()=>l.listen(d)),[l,d]),t.createElement(be,{basename:n,children:r,location:s.location,navigationType:s.action,navigator:l,future:o})}const Oe="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,Pe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Le=t.forwardRef((function(e,n){let r,{onClick:o,relative:i,reloadDocument:a,replace:l,state:s,target:c,to:u,preventScrollReset:d,unstable_viewTransition:h}=e,p=Se(e,Ce),{basename:m}=t.useContext(G),v=!1;if("string"===typeof u&&Pe.test(u)&&(r=u,Oe))try{let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),n=z(t.pathname,m);t.origin===e.origin&&null!=n?u=n+t.search+t.hash:v=!0}catch(Au){}let y=function(e,n){let{relative:r}=void 0===n?{}:n;ee()||f(!1);let{basename:o,navigator:i}=t.useContext(G),{hash:a,pathname:l,search:s}=ie(e,{relative:r}),c=l;return"/"!==o&&(c="/"===l?o:j([o,l])),i.createHref({pathname:c,search:s,hash:a})}(u,{relative:i}),_=function(e,n){let{target:r,replace:o,state:i,preventScrollReset:a,relative:l,unstable_viewTransition:s}=void 0===n?{}:n,c=re(),u=te(),d=ie(e,{relative:l});return t.useCallback((t=>{if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(t,r)){t.preventDefault();let n=void 0!==o?o:g(u)===g(d);c(e,{replace:n,state:i,preventScrollReset:a,relative:l,unstable_viewTransition:s})}}),[u,c,d,o,i,r,e,a,l,s])}(u,{replace:l,state:s,target:c,preventScrollReset:d,relative:i,unstable_viewTransition:h});return t.createElement("a",xe({},p,{href:r||y,onClick:v||a?o:function(e){o&&o(e),e.defaultPrevented||_(e)},ref:n,target:c}))}));const Re=t.forwardRef((function(e,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:a=!1,style:l,to:s,unstable_viewTransition:c,children:u}=e,d=Se(e,Ee),h=ie(s,{relative:d.relative}),p=te(),m=t.useContext(K),{navigator:v,basename:g}=t.useContext(G),y=null!=m&&function(e,n){void 0===n&&(n={});let r=t.useContext(Me);null==r&&f(!1);let{basename:o}=Ie(ze.useViewTransitionState),i=ie(e,{relative:n.relative});if(!r.isTransitioning)return!1;let a=z(r.currentLocation.pathname,o)||r.currentLocation.pathname,l=z(r.nextLocation.pathname,o)||r.nextLocation.pathname;return null!=L(i.pathname,l)||null!=L(i.pathname,a)}(h)&&!0===c,_=v.encodeLocation?v.encodeLocation(h).pathname:h.pathname,b=p.pathname,w=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;o||(b=b.toLowerCase(),w=w?w.toLowerCase():null,_=_.toLowerCase()),w&&g&&(w=z(w,g)||w);const k="/"!==_&&_.endsWith("/")?_.length-1:_.length;let x,S=b===_||!a&&b.startsWith(_)&&"/"===b.charAt(k),A=null!=w&&(w===_||!a&&w.startsWith(_)&&"/"===w.charAt(_.length)),C={isActive:S,isPending:A,isTransitioning:y},E=S?r:void 0;x="function"===typeof i?i(C):[i,S?"active":null,A?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let M="function"===typeof l?l(C):l;return t.createElement(Le,xe({},d,{"aria-current":E,className:x,ref:n,style:M,to:s,unstable_viewTransition:c}),"function"===typeof u?u(C):u)}));var ze,De;function Ie(e){let n=t.useContext(q);return n||f(!1),n}function $e(e){let n=t.useRef(Ae(e)),r=t.useRef(!1),o=te(),i=t.useMemo((()=>function(e,t){let n=Ae(e);return t&&t.forEach(((e,r)=>{n.has(r)||t.getAll(r).forEach((e=>{n.append(r,e)}))})),n}(o.search,r.current?null:n.current)),[o.search]),a=re(),l=t.useCallback(((e,t)=>{const n=Ae("function"===typeof e?e(i):e);r.current=!0,a("?"+n,t)}),[a,i]);return[i,l]}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ze||(ze={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(De||(De={}));const Fe=()=>{var e;const t=(null===(e=document.getElementById("root"))||void 0===e?void 0:e.dataset.params)||"{}";try{return JSON.parse(t)}catch(Au){return console.error(Au),{}}},je=()=>!!Object.keys(Fe()).length,Ve=/(\/select\/)(\d+|\d.+)(\/)(.+)/,He=e=>{var t;return(null===(t=e.match(Ve))||void 0===t?void 0:t[2])||""};let Ue=function(e){return e.logs="logs",e.anomaly="anomaly",e}({});const Be=(e,t)=>{t?window.localStorage.setItem(e,JSON.stringify({value:t})):Ye([e]),window.dispatchEvent(new Event("storage"))},We=e=>{const t=window.localStorage.getItem(e);if(null!==t)try{var n;return null===(n=JSON.parse(t))||void 0===n?void 0:n.value}catch(Au){return t}},Ye=e=>e.forEach((e=>window.localStorage.removeItem(e))),{REACT_APP_TYPE:Ze}={REACT_APP_TYPE:"logs"};var qe=n(215),Ke=n.n(qe),Ge=n(424),Qe=n.n(Ge);const Je={table:100,chart:20,code:1e3},Xe=(e,t)=>{const n=window.location.hash.split("?")[1],r=Ke().parse(n,{ignoreQueryPrefix:!0});return Qe()(r,e,t||"")};let et=function(e){return e.yhat="yhat",e.yhatUpper="yhat_upper",e.yhatLower="yhat_lower",e.anomaly="vmui_anomalies_points",e.training="vmui_training_data",e.actual="actual",e.anomalyScore="anomaly_score",e}({}),tt=function(e){return e.table="table",e.chart="chart",e.code="code",e}({}),nt=function(e){return e.emptyServer="Please enter Server URL",e.validServer="Please provide a valid Server URL",e.validQuery="Please enter a valid Query and execute it",e.traceNotFound="Not found the tracing information",e.emptyTitle="Please enter title",e.positiveNumber="Please enter positive number",e.validStep="Please enter a valid step",e.unknownType="Unknown server response format: must have 'errorType'",e}({}),rt=function(e){return e.system="system",e.light="light",e.dark="dark",e}({}),ot=function(e){return e.empty="empty",e.metricsql="metricsql",e.label="label",e.labelValue="labelValue",e}({});const it=e=>getComputedStyle(document.documentElement).getPropertyValue("--".concat(e)),at=(e,t)=>{document.documentElement.style.setProperty("--".concat(e),t)},lt=()=>window.matchMedia("(prefers-color-scheme: dark)").matches,st=e=>e.replace(/\/$/,""),ct=Xe("g0.tenantID",""),ut={serverUrl:st((e=>{const{serverURL:t}=Fe(),n=We("SERVER_URL"),r=window.location.href.replace(/\/(select\/)?(vmui)\/.*/,""),o=window.location.href.replace(/(?:graph|vmui)\/.*/,""),i=window.location.href.replace(/\/(?:prometheus\/)?(?:graph|vmui)\/.*/,"/prometheus"),a=t||n||i;switch(Ze){case Ue.logs:return r;case Ue.anomaly:return t||n||o;default:return e?((e,t)=>e.replace(Ve,"$1".concat(t,"/$4")))(a,e):a}})(ct)),tenantId:ct,theme:We("THEME")||rt.system,isDarkTheme:null};function dt(e,t){switch(t.type){case"SET_SERVER":return{...e,serverUrl:st(t.payload)};case"SET_TENANT_ID":return{...e,tenantId:t.payload};case"SET_THEME":return Be("THEME",t.payload),{...e,theme:t.payload};case"SET_DARK_THEME":return{...e,isDarkTheme:(n=e.theme,n===rt.system&<()||n===rt.dark)};default:throw new Error}var n}var ht=n(746);var ft=0;Array.isArray;function pt(e,t,n,r,o,i){var a,l,s={};for(l in t)"ref"==l?a=t[l]:s[l]=t[l];var c={type:e,props:s,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--ft,__i:-1,__u:0,__source:o,__self:i};if("function"==typeof e&&(a=e.defaultProps))for(l in a)void 0===s[l]&&(s[l]=a[l]);return ht.fF.vnode&&ht.fF.vnode(c),c}const mt=(0,t.createContext)({}),vt=()=>(0,t.useContext)(mt).state,gt=()=>(0,t.useContext)(mt).dispatch,yt=Object.entries(ut).reduce(((e,t)=>{let[n,r]=t;return{...e,[n]:Xe(n)||r}}),{}),_t="YYYY-MM-DD HH:mm:ss",bt="YYYY-MM-DD[T]HH:mm:ss",wt=window.innerWidth/4,kt=window.innerWidth/40,xt=Intl.supportedValuesOf,St=xt?xt("timeZone"):["Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmera","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/La_Rioja","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Buenos_Aires","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Catamarca","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Coral_Harbour","America/Cordoba","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Fort_Nelson","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indianapolis","America/Inuvik","America/Iqaluit","America/Jamaica","America/Jujuy","America/Juneau","America/Kentucky/Monticello","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Louisville","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Mendoza","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montreal","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port-au-Prince","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Santa_Isabel","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Calcutta","Asia/Chita","Asia/Choibalsan","Asia/Colombo","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Hebron","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Katmandu","Asia/Khandyga","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Rangoon","Asia/Riyadh","Asia/Saigon","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ulaanbaatar","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faeroe","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/Perth","Australia/Sydney","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Johnston","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Ponape","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Truk","Pacific/Wake","Pacific/Wallis"],At=[{long:"years",short:"y",possible:"year"},{long:"weeks",short:"w",possible:"week"},{long:"days",short:"d",possible:"day"},{long:"hours",short:"h",possible:"hour"},{long:"minutes",short:"m",possible:"min"},{long:"seconds",short:"s",possible:"sec"},{long:"milliseconds",short:"ms",possible:"millisecond"}],Ct=At.map((e=>e.short)),Et=e=>{let t=(n=e,Math.round(1e3*n)/1e3);var n;const r=Math.round(e);e>=100&&(t=r-r%10),e<100&&e>=10&&(t=r-r%5),e<10&&e>=1&&(t=r),e<1&&e>.01&&(t=Math.round(40*e)/40);const i=(e=>Lt(o().duration(e,"seconds").asMilliseconds()))(t||.001);return i.replace(/\s/g,"")},Mt=e=>{const t=e.match(/\d+/g),n=e.match(/[a-zA-Z]+/g);if(n&&t&&Ct.includes(n[0]))return{[n[0]]:t[0]}},Tt=(e,t)=>Et(e/(t?kt:wt)),Nt=(e,t)=>{const n=(t||o()().toDate()).valueOf()/1e3,r=(e=>{const t=At.map((e=>e.short)).join("|"),n=new RegExp("\\d+(\\.\\d+)?[".concat(t,"]+"),"g"),r=(e.match(n)||[]).reduce(((e,t)=>{const n=Mt(t);return n?{...e,...n}:{...e}}),{});return o().duration(r).asSeconds()})(e);return{start:n-r,end:n,step:Tt(r),date:Ot(t||o()().toDate())}},Ot=e=>o().tz(e).utc().format(bt),Pt=e=>o().tz(e).format(bt),Lt=e=>{const t=Math.floor(e%1e3),n=Math.floor(e/1e3%60),r=Math.floor(e/1e3/60%60),o=Math.floor(e/1e3/3600%24),i=Math.floor(e/864e5),a=["d","h","m","s","ms"],l=[i,o,r,n,t].map(((e,t)=>e?"".concat(e).concat(a[t]):""));return l.filter((e=>e)).join("")},Rt=e=>{const t=o()(1e3*e);return t.isValid()?t.toDate():new Date},zt=[{title:"Last 5 minutes",duration:"5m"},{title:"Last 15 minutes",duration:"15m"},{title:"Last 30 minutes",duration:"30m",isDefault:!0},{title:"Last 1 hour",duration:"1h"},{title:"Last 3 hours",duration:"3h"},{title:"Last 6 hours",duration:"6h"},{title:"Last 12 hours",duration:"12h"},{title:"Last 24 hours",duration:"24h"},{title:"Last 2 days",duration:"2d"},{title:"Last 7 days",duration:"7d"},{title:"Last 30 days",duration:"30d"},{title:"Last 90 days",duration:"90d"},{title:"Last 180 days",duration:"180d"},{title:"Last 1 year",duration:"1y"},{title:"Yesterday",duration:"1d",until:()=>o()().tz().subtract(1,"day").endOf("day").toDate()},{title:"Today",duration:"1d",until:()=>o()().tz().endOf("day").toDate()}].map((e=>({id:e.title.replace(/\s/g,"_").toLocaleLowerCase(),until:e.until?e.until:()=>o()().tz().toDate(),...e}))),Dt=e=>{var t;let{relativeTimeId:n,defaultDuration:r,defaultEndInput:o}=e;const i=null===(t=zt.find((e=>e.isDefault)))||void 0===t?void 0:t.id,a=n||Xe("g0.relative_time",i),l=zt.find((e=>e.id===a));return{relativeTimeId:l?a:"none",duration:l?l.duration:r,endInput:l?l.until():o}},It=e=>{const t=o()().tz(e);return"UTC".concat(t.format("Z"))},$t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=new RegExp(e,"i");return St.reduce(((n,r)=>{const o=(r.match(/^(.*?)\//)||[])[1]||"unknown",i=It(r),a=i.replace(/UTC|0/,""),l=r.replace(/[/_]/g," "),s={region:r,utc:i,search:"".concat(r," ").concat(i," ").concat(l," ").concat(a)},c=!e||e&&t.test(s.search);return c&&n[o]?n[o].push(s):c&&(n[o]=[s]),n}),{})},Ft=e=>{o().tz.setDefault(e)},jt=()=>{const e=o().tz.guess(),t=(e=>{try{return o()().tz(e),!0}catch(Au){return!1}})(e);return{isValid:t,title:t?"Browser Time (".concat(e,")"):"Browser timezone (UTC)",region:t?e:"UTC"}},Vt=We("TIMEZONE")||jt().region;Ft(Vt);const Ht=Xe("g0.range_input"),{duration:Ut,endInput:Bt,relativeTimeId:Wt}=Dt({defaultDuration:Ht||"1h",defaultEndInput:(Yt=Xe("g0.end_input",o()().utc().format(bt)),o()(Yt).utcOffset(0,!0).toDate()),relativeTimeId:Ht?Xe("g0.relative_time","none"):void 0});var Yt;const Zt={duration:Ut,period:Nt(Ut,Bt),relativeTime:Wt,timezone:Vt};function qt(e,t){switch(t.type){case"SET_DURATION":return{...e,duration:t.payload,period:Nt(t.payload,Rt(e.period.end)),relativeTime:"none"};case"SET_RELATIVE_TIME":return{...e,duration:t.payload.duration,period:Nt(t.payload.duration,t.payload.until),relativeTime:t.payload.id};case"SET_PERIOD":const n=(e=>{const t=e.to.valueOf()-e.from.valueOf();return Lt(t)})(t.payload);return{...e,duration:n,period:Nt(n,t.payload.to),relativeTime:"none"};case"RUN_QUERY":const{duration:r,endInput:o}=Dt({relativeTimeId:e.relativeTime,defaultDuration:e.duration,defaultEndInput:Rt(e.period.end)});return{...e,period:Nt(r,o)};case"RUN_QUERY_TO_NOW":return{...e,period:Nt(e.duration)};case"SET_TIMEZONE":return Ft(t.payload),Be("TIMEZONE",t.payload),e.defaultTimezone&&Be("DISABLED_DEFAULT_TIMEZONE",t.payload!==e.defaultTimezone),{...e,timezone:t.payload};case"SET_DEFAULT_TIMEZONE":return{...e,defaultTimezone:t.payload};default:throw new Error}}const Kt=(0,t.createContext)({}),Gt=()=>(0,t.useContext)(Kt).state,Qt=()=>(0,t.useContext)(Kt).dispatch,Jt=e=>{const t=e.map((e=>e.values[e.index])),n=(e=>{const t=We(e);return t?JSON.parse(t):[]})("QUERY_HISTORY");n[0]||(n[0]=[]);const r=n[0];t.forEach((e=>{!r.includes(e)&&e&&r.unshift(e),r.length>100&&r.shift()})),Be("QUERY_HISTORY",JSON.stringify(n))},Xt=50,en=1e3,tn=1e3;const nn=(()=>{var e;const t=(null===(e=(window.location.hash.split("?")[1]||"").match(/g\d+\.expr/g))||void 0===e?void 0:e.length)||1;return new Array(t>4?4:t).fill(1).map(((e,t)=>Xe("g".concat(t,".expr"),"")))})(),rn={query:nn,queryHistory:nn.map((e=>({index:0,values:[e]}))),autocomplete:We("AUTOCOMPLETE")||!1,autocompleteQuick:!1,autocompleteCache:new class{constructor(){this.maxSize=void 0,this.map=void 0,this.maxSize=tn,this.map=new Map}get(e){for(const[t,n]of this.map){const r=JSON.parse(t),o=r.start===e.start&&r.end===e.end,i=r.type===e.type,a=e.value&&r.value&&e.value.includes(r.value),l=r.match===e.match||a,s=n.length=this.maxSize){const e=this.map.keys().next().value;this.map.delete(e)}this.map.set(JSON.stringify(e),t)}},metricsQLFunctions:[]};function on(e,t){switch(t.type){case"SET_QUERY":return{...e,query:t.payload.map((e=>e))};case"SET_QUERY_HISTORY":return Jt(t.payload),{...e,queryHistory:t.payload};case"SET_QUERY_HISTORY_BY_INDEX":return e.queryHistory.splice(t.payload.queryNumber,1,t.payload.value),{...e,queryHistory:e.queryHistory};case"TOGGLE_AUTOCOMPLETE":return Be("AUTOCOMPLETE",!e.autocomplete),{...e,autocomplete:!e.autocomplete};case"SET_AUTOCOMPLETE_QUICK":return{...e,autocompleteQuick:t.payload};case"SET_AUTOCOMPLETE_CACHE":return e.autocompleteCache.put(t.payload.key,t.payload.value),{...e};case"SET_METRICSQL_FUNCTIONS":return{...e,metricsQLFunctions:t.payload};default:throw new Error}}const an=(0,t.createContext)({}),ln=()=>(0,t.useContext)(an).state,sn=()=>(0,t.useContext)(an).dispatch,cn=()=>pt("svg",{viewBox:"0 0 74 24",fill:"currentColor",children:pt("path",{d:"M6.12 10.48c.36.28.8.43 1.26.43h.05c.48 0 .96-.19 1.25-.44 1.5-1.28 5.88-5.29 5.88-5.29C15.73 4.1 12.46 3.01 7.43 3h-.06C2.33 3-.93 4.1.24 5.18c0 0 4.37 4 5.88 5.3Zm2.56 2.16c-.36.28-.8.44-1.26.45h-.04c-.46 0-.9-.17-1.26-.45-1.04-.88-4.74-4.22-6.12-5.5v1.94c0 .21.08.5.22.63l.07.06c1.05.96 4.55 4.16 5.83 5.25.36.28.8.43 1.26.44h.04c.49-.02.96-.2 1.26-.44 1.3-1.11 4.94-4.45 5.88-5.31.15-.14.23-.42.23-.63V7.15a454.94 454.94 0 0 1-6.11 5.5Zm-1.26 4.99c.46 0 .9-.16 1.26-.44a454.4 454.4 0 0 0 6.1-5.5v1.94c0 .2-.07.48-.22.62-.94.87-4.57 4.2-5.88 5.3-.3.26-.77.44-1.26.45h-.04c-.46 0-.9-.16-1.26-.44-1.2-1.02-4.38-3.92-5.62-5.06l-.28-.25c-.14-.14-.22-.42-.22-.62v-1.94c1.38 1.26 5.08 4.6 6.12 5.5.36.28.8.43 1.26.44h.04ZM35 5l-5.84 14.46h-2.43L20.89 5h2.16a.9.9 0 0 1 .9.61l3.41 8.82a18.8 18.8 0 0 1 .62 2.02 19.44 19.44 0 0 1 .57-2.02l3.39-8.82c.05-.15.16-.3.31-.42a.9.9 0 0 1 .58-.19H35Zm17.18 0v14.46H49.8v-9.34c0-.37.02-.78.06-1.21l-4.37 8.21c-.21.4-.53.59-.95.59h-.38c-.43 0-.75-.2-.95-.59L38.8 8.88a22.96 22.96 0 0 1 .07 1.24v9.34H36.5V5h2.03l.3.01c.1 0 .17.02.24.05.07.03.13.07.19.13a1 1 0 0 1 .17.24l4.33 8.03a16.97 16.97 0 0 1 .6 1.36 14.34 14.34 0 0 1 .6-1.38l4.28-8.01c.05-.1.1-.18.17-.24.06-.06.12-.1.19-.13a.9.9 0 0 1 .24-.05l.3-.01h2.04Zm8.88 13.73a4.5 4.5 0 0 0 1.82-.35 3.96 3.96 0 0 0 2.22-2.47c.2-.57.3-1.19.3-1.85V5.31h1.02v8.75c0 .78-.12 1.51-.37 2.19a4.88 4.88 0 0 1-2.76 2.95c-.66.29-1.4.43-2.23.43-.82 0-1.57-.14-2.24-.43a5.01 5.01 0 0 1-2.75-2.95 6.37 6.37 0 0 1-.37-2.19V5.31h1.03v8.74c0 .66.1 1.28.3 1.85a3.98 3.98 0 0 0 2.21 2.47c.53.24 1.14.36 1.82.36Zm10.38.73h-1.03V5.31h1.03v14.15Z"})}),un=()=>pt("svg",{viewBox:"0 0 85 38",fill:"currentColor",children:[pt("path",{d:"M11.12 10.48c.36.28.8.43 1.26.43h.05c.48 0 .96-.19 1.25-.44 1.5-1.28 5.88-5.29 5.88-5.29 1.17-1.09-2.1-2.17-7.13-2.18h-.06c-5.04 0-8.3 1.1-7.13 2.18 0 0 4.37 4 5.88 5.3Zm2.56 2.16c-.36.28-.8.44-1.26.45h-.04c-.46 0-.9-.17-1.26-.45-1.04-.88-4.74-4.22-6.12-5.5v1.94c0 .21.08.5.22.63l.07.06c1.05.96 4.55 4.16 5.83 5.25.36.28.8.43 1.26.44h.04c.49-.02.96-.2 1.26-.44 1.3-1.11 4.94-4.45 5.88-5.31.15-.14.23-.42.23-.63V7.15a455.13 455.13 0 0 1-6.11 5.5Zm-1.26 4.99c.46 0 .9-.16 1.26-.44 2.05-1.82 4.09-3.65 6.1-5.5v1.94c0 .2-.07.48-.22.62-.94.87-4.57 4.2-5.88 5.3-.3.26-.77.44-1.26.45h-.04c-.46 0-.9-.16-1.26-.44-1.2-1.02-4.38-3.92-5.62-5.06l-.28-.25c-.14-.14-.22-.42-.22-.62v-1.94c1.38 1.26 5.08 4.6 6.12 5.5.36.28.8.43 1.26.44h.04ZM40 5l-5.84 14.46h-2.43L25.89 5h2.16a.9.9 0 0 1 .9.61l3.41 8.82a18.8 18.8 0 0 1 .62 2.02 19.44 19.44 0 0 1 .57-2.02l3.39-8.82c.05-.15.16-.3.31-.42a.9.9 0 0 1 .58-.19H40Zm17.18 0v14.46H54.8v-9.34c0-.37.02-.78.06-1.21l-4.37 8.21c-.21.4-.53.59-.95.59h-.38c-.43 0-.75-.2-.95-.59L43.8 8.88a22.96 22.96 0 0 1 .07 1.24v9.34H41.5V5h2.03l.3.01c.1 0 .17.02.24.05.07.03.13.07.19.13a1 1 0 0 1 .17.24l4.33 8.03a16.97 16.97 0 0 1 .6 1.36 14.34 14.34 0 0 1 .6-1.38l4.28-8.01c.05-.1.1-.18.17-.24.06-.06.12-.1.19-.13a.9.9 0 0 1 .24-.05l.3-.01h2.04Zm8.88 13.73a4.5 4.5 0 0 0 1.82-.35 3.96 3.96 0 0 0 2.22-2.47c.2-.57.3-1.19.3-1.85V5.31h1.02v8.75c0 .78-.12 1.51-.37 2.19a4.88 4.88 0 0 1-2.76 2.95c-.66.29-1.4.43-2.23.43-.82 0-1.57-.14-2.24-.43a5.01 5.01 0 0 1-2.75-2.95 6.37 6.37 0 0 1-.37-2.19V5.31h1.03v8.74c0 .66.1 1.28.3 1.85a3.98 3.98 0 0 0 2.21 2.47c.53.24 1.14.36 1.82.36Zm10.38.73h-1.03V5.31h1.03v14.15ZM1.73 36v-5.17l-.67-.07a.6.6 0 0 1-.21-.1.23.23 0 0 1-.08-.18v-.44h.96v-.59c0-.34.05-.65.14-.92a1.79 1.79 0 0 1 1.08-1.11 2.45 2.45 0 0 1 1.62-.02l-.03.53c0 .1-.06.15-.16.16H4c-.18 0-.35.03-.5.08a.95.95 0 0 0-.39.23c-.1.11-.19.25-.25.43-.05.18-.08.4-.08.65v.56h1.75v.78H2.8V36H1.73Zm6.17-6.17c.45 0 .85.07 1.2.22a2.57 2.57 0 0 1 1.5 1.62c.13.38.2.81.2 1.29s-.07.91-.2 1.3a2.57 2.57 0 0 1-1.49 1.61c-.36.14-.76.21-1.2.21-.45 0-.86-.07-1.22-.21a2.57 2.57 0 0 1-1.5-1.62c-.12-.38-.19-.81-.19-1.3 0-.47.07-.9.2-1.28a2.57 2.57 0 0 1 1.5-1.62c.35-.15.76-.22 1.2-.22Zm0 5.42c.6 0 1.05-.2 1.35-.6.3-.4.44-.97.44-1.69s-.15-1.28-.44-1.69c-.3-.4-.75-.6-1.35-.6-.3 0-.57.05-.8.15-.22.1-.4.26-.56.45-.15.2-.26.44-.33.73-.08.28-.11.6-.11.96 0 .72.15 1.29.44 1.69.3.4.76.6 1.36.6Zm5.26-4.11c.2-.42.43-.74.71-.97.28-.24.62-.36 1.03-.36.13 0 .25.02.36.05.12.02.23.07.32.13l-.08.8c-.02.1-.08.15-.18.15l-.24-.04a1.7 1.7 0 0 0-.88.05c-.15.05-.29.14-.4.25-.12.1-.23.24-.32.4-.1.17-.18.35-.26.56V36h-1.07v-6.08h.61c.12 0 .2.02.24.07.05.04.08.12.1.23l.06.92Zm13.73-3.82L23.39 36h-1.46l-3.5-8.68h1.29a.54.54 0 0 1 .54.37l2.04 5.3a11.31 11.31 0 0 1 .37 1.21 11.65 11.65 0 0 1 .35-1.22l2.03-5.29c.03-.1.1-.18.19-.25.1-.08.21-.12.35-.12h1.3Zm2.2 2.52V36H27.6v-6.16h1.49Zm.2-1.79c0 .13-.02.25-.08.36a1 1 0 0 1-.51.5.96.96 0 0 1-.73 0 1.02 1.02 0 0 1-.5-.5.96.96 0 0 1 0-.73.93.93 0 0 1 .86-.58.9.9 0 0 1 .37.08c.12.05.22.11.3.2a.94.94 0 0 1 .3.67Zm5.72 3.1a.68.68 0 0 1-.13.13c-.04.03-.1.05-.18.05a.42.42 0 0 1-.22-.07 3.95 3.95 0 0 0-.62-.31c-.14-.05-.3-.07-.51-.07-.26 0-.5.04-.69.14-.2.1-.36.23-.49.4-.13.18-.22.4-.29.64-.06.25-.1.53-.1.85 0 .33.04.62.1.88.08.25.18.47.32.64.13.18.29.3.48.4.18.09.4.13.63.13a1.6 1.6 0 0 0 .94-.27l.26-.2a.4.4 0 0 1 .25-.09.3.3 0 0 1 .27.14l.43.54a2.76 2.76 0 0 1-1.77.96c-.22.03-.43.05-.65.05a2.57 2.57 0 0 1-1.96-.83c-.25-.28-.45-.6-.6-1-.14-.4-.21-.85-.21-1.35 0-.45.06-.87.2-1.25a2.61 2.61 0 0 1 1.51-1.67c.37-.16.8-.24 1.28-.24.46 0 .86.07 1.2.22.35.15.66.36.94.64l-.4.54Zm3.43 4.95c-.54 0-.95-.15-1.24-.45-.28-.3-.42-.73-.42-1.26v-3.44h-.63a.29.29 0 0 1-.2-.07c-.06-.06-.09-.13-.09-.24v-.59l.99-.16.31-1.68a.33.33 0 0 1 .12-.18.34.34 0 0 1 .21-.07h.77v1.94h1.64v1.05h-1.64v3.34c0 .2.05.34.14.45.1.1.22.16.39.16a.73.73 0 0 0 .39-.1l.12-.07a.2.2 0 0 1 .11-.03c.05 0 .08.01.11.03l.09.1.44.72c-.21.18-.46.32-.74.4-.28.1-.57.15-.87.15Zm5.09-6.35c.46 0 .87.07 1.24.22a2.7 2.7 0 0 1 1.58 1.63c.14.39.22.83.22 1.31 0 .49-.08.93-.22 1.32-.14.4-.35.73-.62 1-.26.28-.58.49-.96.64-.37.15-.78.22-1.24.22a3.4 3.4 0 0 1-1.25-.22 2.71 2.71 0 0 1-1.59-1.64 3.8 3.8 0 0 1-.21-1.32c0-.48.07-.92.21-1.31a2.75 2.75 0 0 1 1.58-1.63c.38-.15.8-.22 1.26-.22Zm0 5.2c.51 0 .89-.17 1.13-.52.25-.34.38-.84.38-1.5a2.6 2.6 0 0 0-.38-1.53c-.24-.34-.62-.52-1.13-.52-.52 0-.9.18-1.16.53-.25.35-.37.85-.37 1.51s.12 1.17.37 1.51c.25.35.64.52 1.16.52Zm5.56-4.04c.2-.37.42-.65.69-.86.26-.21.57-.32.94-.32.28 0 .5.06.68.19l-.1 1.1a.3.3 0 0 1-.09.16.24.24 0 0 1-.15.04 1.8 1.8 0 0 1-.27-.03 2.01 2.01 0 0 0-.34-.03c-.16 0-.3.03-.44.08a1.1 1.1 0 0 0-.34.2c-.1.1-.2.2-.27.33-.08.13-.15.27-.22.44V36H47.7v-6.16h.87c.15 0 .26.03.31.09.06.05.1.15.13.29l.09.7Zm4.62-1.07V36h-1.49v-6.16h1.49Zm.2-1.79c0 .13-.02.25-.07.36a1 1 0 0 1-.51.5.96.96 0 0 1-.74 0 1.02 1.02 0 0 1-.5-.5.96.96 0 0 1 0-.73.93.93 0 0 1 .86-.58.9.9 0 0 1 .38.08c.11.05.21.11.3.2a.94.94 0 0 1 .28.67Zm4.56 5.32a7.8 7.8 0 0 0-1.08.12c-.29.05-.52.12-.7.2a.92.92 0 0 0-.38.3.64.64 0 0 0-.11.36c0 .26.07.45.23.56.15.11.35.17.6.17.3 0 .57-.06.79-.17.22-.1.44-.28.65-.5v-1.04Zm-3.4-2.67c.71-.65 1.57-.97 2.56-.97.36 0 .68.06.97.18a1.99 1.99 0 0 1 1.16 1.24c.1.3.16.61.16.96V36h-.67a.7.7 0 0 1-.33-.06c-.07-.04-.13-.13-.18-.26l-.13-.44c-.16.14-.3.26-.46.37a2.8 2.8 0 0 1-.97.43 2.77 2.77 0 0 1-1.32-.05 1.62 1.62 0 0 1-.57-.31 1.41 1.41 0 0 1-.38-.53 1.85 1.85 0 0 1-.05-1.18c.05-.16.14-.3.25-.45.12-.14.28-.27.46-.4a3 3 0 0 1 .7-.32 9.19 9.19 0 0 1 2.2-.33v-.36c0-.41-.09-.71-.26-.91-.18-.2-.43-.3-.76-.3a1.84 1.84 0 0 0-1.02.28l-.33.18c-.1.06-.2.09-.32.09-.1 0-.2-.03-.27-.08a.72.72 0 0 1-.17-.2l-.26-.47Zm11.49 4.32V36h-4.88v-8.6h1.16v7.62h3.72Zm3.16-5.2c.44 0 .84.08 1.2.23a2.57 2.57 0 0 1 1.49 1.62c.13.38.2.81.2 1.29s-.07.91-.2 1.3a2.57 2.57 0 0 1-1.49 1.61c-.36.14-.76.21-1.2.21-.45 0-.85-.07-1.21-.21a2.57 2.57 0 0 1-1.5-1.62c-.13-.38-.2-.81-.2-1.3 0-.47.07-.9.2-1.28.14-.39.33-.72.59-1 .25-.26.55-.47.9-.62.37-.15.77-.22 1.22-.22Zm0 5.43c.6 0 1.05-.2 1.34-.6.3-.4.45-.97.45-1.69s-.15-1.28-.45-1.69c-.3-.4-.74-.6-1.34-.6-.3 0-.57.05-.8.15-.22.1-.4.26-.56.45-.15.2-.26.44-.34.73-.07.28-.1.6-.1.96 0 .72.14 1.29.44 1.69.3.4.75.6 1.36.6Zm6.33-2.22c.22 0 .4-.03.57-.09.16-.06.3-.14.41-.25.12-.11.2-.24.26-.39.05-.15.08-.31.08-.5 0-.37-.11-.66-.34-.88-.23-.22-.55-.33-.98-.33-.43 0-.76.1-.99.33-.22.22-.34.51-.34.89 0 .18.03.34.09.5a1.1 1.1 0 0 0 .67.63c.16.06.35.09.57.09Zm1.93 3.3a.51.51 0 0 0-.13-.36.84.84 0 0 0-.34-.22 8.57 8.57 0 0 0-1.73-.2 7.5 7.5 0 0 1-.62-.05c-.23.1-.41.23-.56.4a.8.8 0 0 0-.1.92c.07.12.18.22.32.3.14.1.32.16.54.21a3.5 3.5 0 0 0 1.55 0c.23-.05.42-.12.57-.22.16-.1.29-.21.37-.34a.8.8 0 0 0 .13-.44Zm1.08-6.17v.4c0 .13-.08.21-.25.25l-.69.09c.14.26.2.56.2.88a1.86 1.86 0 0 1-1.36 1.82 3.07 3.07 0 0 1-1.72.04c-.12.08-.22.16-.29.25a.44.44 0 0 0-.1.27c0 .15.06.26.17.33.12.08.28.13.47.16a5 5 0 0 0 .66.06 16.56 16.56 0 0 1 1.5.13c.26.05.48.12.67.22.19.1.34.24.46.41.12.18.18.4.18.69 0 .26-.07.5-.2.75s-.31.46-.56.65c-.24.2-.54.34-.9.46a4.57 4.57 0 0 1-2.36.04c-.33-.09-.6-.2-.82-.36a1.56 1.56 0 0 1-.5-.51c-.1-.2-.16-.4-.16-.6 0-.3.1-.56.28-.77.19-.2.45-.37.77-.5a1.15 1.15 0 0 1-.43-.32.88.88 0 0 1-.15-.54c0-.09.01-.18.04-.27.04-.1.08-.2.15-.28a1.55 1.55 0 0 1 .58-.5c-.3-.16-.53-.39-.7-.66-.17-.28-.25-.6-.25-.97 0-.3.05-.57.16-.8.12-.25.28-.46.48-.63.2-.17.45-.3.73-.4a3 3 0 0 1 2.3.21h1.64Zm4.65.76a.24.24 0 0 1-.23.14.42.42 0 0 1-.2-.07 3.59 3.59 0 0 0-.67-.3 1.8 1.8 0 0 0-1.03 0c-.14.05-.27.11-.37.2a.87.87 0 0 0-.23.27.75.75 0 0 0-.08.35c0 .15.04.28.13.39.1.1.21.19.36.27.15.07.32.14.5.2a13.63 13.63 0 0 1 1.16.4c.2.08.36.18.5.3a1.33 1.33 0 0 1 .5 1.07 2 2 0 0 1-.15.78c-.1.24-.25.44-.45.62-.2.17-.43.3-.72.4a3.1 3.1 0 0 1-2.14-.05 2.97 2.97 0 0 1-.87-.53l.25-.41c.04-.05.07-.1.12-.12a.3.3 0 0 1 .17-.04.4.4 0 0 1 .22.08l.3.19a1.91 1.91 0 0 0 1.03.27c.2 0 .38-.03.54-.08.16-.06.29-.13.4-.22a.96.96 0 0 0 .3-.7c0-.17-.05-.31-.14-.42-.09-.11-.2-.2-.36-.28a2.6 2.6 0 0 0-.5-.2l-.59-.19c-.2-.06-.39-.14-.58-.22a2.14 2.14 0 0 1-.5-.3 1.45 1.45 0 0 1-.36-.46c-.1-.19-.14-.41-.14-.67a1.6 1.6 0 0 1 .57-1.23c.18-.16.4-.3.68-.39.26-.1.57-.14.91-.14a2.84 2.84 0 0 1 1.9.7l-.23.4Z"}),pt("defs",{children:pt("path",{d:"M0 0h85v38H0z"})})]}),dn=()=>pt("svg",{viewBox:"0 0 85 38",fill:"currentColor",children:pt("path",{d:"M11.118 10.476c.36.28.801.433 1.257.436h.052c.48-.007.961-.192 1.25-.444 1.509-1.279 5.88-5.287 5.88-5.287 1.168-1.087-2.093-2.174-7.13-2.181h-.06c-5.036.007-8.298 1.094-7.13 2.181 0 0 4.372 4.008 5.88 5.295zm2.559 2.166c-.359.283-.801.439-1.258.444h-.044a2.071 2.071 0 0 1-1.257-.444C10.082 11.755 6.384 8.42 5 7.148v1.93c0 .215.081.496.222.629l.07.064c1.045.955 4.546 4.154 5.825 5.245.358.283.8.438 1.257.444h.044c.489-.015.962-.2 1.258-.444 1.309-1.11 4.948-4.444 5.887-5.31.148-.132.222-.413.222-.628v-1.93a455.127 455.127 0 0 1-6.11 5.494zm-1.258 4.984a2.071 2.071 0 0 0 1.258-.436c2.053-1.815 4.09-3.65 6.11-5.502v1.938c0 .207-.075.488-.223.621-.94.873-4.578 4.2-5.887 5.31-.296.25-.77.436-1.258.443h-.044a2.071 2.071 0 0 1-1.257-.436c-1.204-1.027-4.376-3.928-5.616-5.062l-.28-.255c-.14-.133-.221-.414-.221-.621v-1.938c1.383 1.265 5.081 4.607 6.117 5.495.358.282.8.438 1.257.443h.044zM40 5l-5.84 14.46h-2.43L25.89 5h2.16c.233 0 .423.057.57.17.146.113.256.26.33.44l3.41 8.82c.113.287.22.603.32.95.106.34.206.697.3 1.07.08-.373.166-.73.26-1.07a8.84 8.84 0 0 1 .31-.95l3.39-8.82a.959.959 0 0 1 .31-.42.906.906 0 0 1 .58-.19H40zm17.176 0v14.46h-2.37v-9.34c0-.373.02-.777.06-1.21l-4.37 8.21c-.206.393-.523.59-.95.59h-.38c-.426 0-.743-.197-.95-.59l-4.42-8.24c.02.22.037.437.05.65.014.213.02.41.02.59v9.34h-2.37V5h2.03c.12 0 .224.003.31.01a.778.778 0 0 1 .23.05c.074.027.137.07.19.13.06.06.117.14.17.24l4.33 8.03c.114.213.217.433.31.66.1.227.197.46.29.7.094-.247.19-.483.29-.71.1-.233.207-.457.32-.67l4.27-8.01c.054-.1.11-.18.17-.24a.57.57 0 0 1 .19-.13.903.903 0 0 1 .24-.05c.087-.007.19-.01.31-.01h2.03zm8.887 13.73c.68 0 1.286-.117 1.82-.35.54-.24.996-.57 1.37-.99a4.28 4.28 0 0 0 .85-1.48c.2-.573.3-1.19.3-1.85V5.31h1.02v8.75c0 .78-.124 1.51-.37 2.19a5.248 5.248 0 0 1-1.07 1.77c-.46.5-1.024.893-1.69 1.18-.66.287-1.404.43-2.23.43-.827 0-1.574-.143-2.24-.43a5.012 5.012 0 0 1-1.69-1.18 5.33 5.33 0 0 1-1.06-1.77 6.373 6.373 0 0 1-.37-2.19V5.31h1.03v8.74c0 .66.096 1.277.29 1.85.2.567.483 1.06.85 1.48.373.42.826.75 1.36.99.54.24 1.15.36 1.83.36zm10.38.73h-1.03V5.31h1.03v14.15zM4.242 35v-5.166l-.672-.078a.595.595 0 0 1-.21-.09.23.23 0 0 1-.078-.186v-.438h.96v-.588c0-.348.048-.656.144-.924.1-.272.24-.5.42-.684a1.79 1.79 0 0 1 .66-.426c.256-.096.544-.144.864-.144.272 0 .522.04.75.12l-.024.534c-.008.096-.062.148-.162.156a4.947 4.947 0 0 1-.39.012c-.184 0-.352.024-.504.072a.949.949 0 0 0-.384.234c-.108.108-.192.25-.252.426a2.184 2.184 0 0 0-.084.654v.558h1.752v.774H5.316V35H4.242zM10.416 28.826a3.1 3.1 0 0 1 1.2.222c.356.148.66.358.912.63s.444.602.576.99c.136.384.204.814.204 1.29 0 .48-.068.912-.204 1.296a2.735 2.735 0 0 1-.576.984 2.572 2.572 0 0 1-.912.63 3.175 3.175 0 0 1-1.2.216c-.448 0-.852-.072-1.212-.216a2.572 2.572 0 0 1-.912-.63 2.805 2.805 0 0 1-.582-.984 3.972 3.972 0 0 1-.198-1.296c0-.476.066-.906.198-1.29.136-.388.33-.718.582-.99.252-.272.556-.482.912-.63.36-.148.764-.222 1.212-.222zm0 5.424c.6 0 1.048-.2 1.344-.6.296-.404.444-.966.444-1.686 0-.724-.148-1.288-.444-1.692-.296-.404-.744-.606-1.344-.606-.304 0-.57.052-.798.156a1.507 1.507 0 0 0-.564.45c-.148.196-.26.438-.336.726a3.941 3.941 0 0 0-.108.966c0 .72.148 1.282.444 1.686.3.4.754.6 1.362.6zM15.677 30.14c.192-.416.428-.74.708-.972.28-.236.622-.354 1.026-.354.128 0 .25.014.366.042.12.028.226.072.318.132l-.078.798c-.024.1-.084.15-.18.15-.056 0-.138-.012-.246-.036a1.694 1.694 0 0 0-.366-.036c-.192 0-.364.028-.516.084-.148.056-.282.14-.402.252a1.782 1.782 0 0 0-.318.408c-.092.16-.176.344-.252.552V35h-1.074v-6.078h.612c.116 0 .196.022.24.066.044.044.074.12.09.228l.072.924zM26.761 28.922 24.283 35h-.96l-2.478-6.078h.87a.33.33 0 0 1 .33.222l1.542 3.912c.048.148.09.292.126.432.036.14.07.28.102.42.032-.14.066-.28.102-.42.036-.14.08-.284.132-.432l1.56-3.912a.33.33 0 0 1 .12-.156.311.311 0 0 1 .198-.066h.834zM27.74 35v-6.078h.643c.152 0 .246.074.282.222l.078.624c.224-.276.476-.502.756-.678.28-.176.604-.264.972-.264.408 0 .738.114.99.342.256.228.44.536.552.924.088-.22.2-.41.336-.57a1.987 1.987 0 0 1 1.014-.624c.196-.048.394-.072.594-.072.32 0 .604.052.852.156.252.1.464.248.636.444.176.196.31.438.402.726.092.284.138.61.138.978V35H34.91v-3.87c0-.476-.104-.836-.312-1.08-.208-.248-.508-.372-.9-.372-.176 0-.344.032-.504.096-.156.06-.294.15-.414.27-.12.12-.216.272-.288.456-.068.18-.102.39-.102.63V35h-1.074v-3.87c0-.488-.098-.852-.294-1.092-.196-.24-.482-.36-.858-.36-.264 0-.508.072-.732.216a2.38 2.38 0 0 0-.618.576V35H27.74zM40.746 32.372c-.428.02-.788.058-1.08.114-.292.052-.526.12-.702.204a.923.923 0 0 0-.378.294.639.639 0 0 0-.114.366c0 .26.076.446.228.558.156.112.358.168.606.168.304 0 .566-.054.786-.162.224-.112.442-.28.654-.504v-1.038zm-3.396-2.67c.708-.648 1.56-.972 2.556-.972.36 0 .682.06.966.18.284.116.524.28.72.492.196.208.344.458.444.75.104.292.156.612.156.96V35h-.672a.708.708 0 0 1-.324-.06c-.076-.044-.136-.13-.18-.258l-.132-.444c-.156.14-.308.264-.456.372a2.804 2.804 0 0 1-.462.264c-.16.072-.332.126-.516.162-.18.04-.38.06-.6.06-.26 0-.5-.034-.72-.102a1.618 1.618 0 0 1-.57-.318 1.414 1.414 0 0 1-.372-.522 1.852 1.852 0 0 1-.132-.726 1.419 1.419 0 0 1 .33-.906c.12-.14.274-.272.462-.396s.418-.232.69-.324c.276-.092.596-.166.96-.222.364-.06.78-.096 1.248-.108v-.36c0-.412-.088-.716-.264-.912-.176-.2-.43-.3-.762-.3-.24 0-.44.028-.6.084-.156.056-.294.12-.414.192l-.33.186a.631.631 0 0 1-.324.084.439.439 0 0 1-.264-.078.716.716 0 0 1-.174-.192l-.264-.474zM44.974 29.6c.124-.124.254-.238.39-.342a2.395 2.395 0 0 1 .936-.444c.176-.044.368-.066.576-.066.336 0 .634.058.894.174.26.112.476.272.648.48.176.204.308.45.396.738.092.284.138.598.138.942V35H47.47v-3.918c0-.376-.086-.666-.258-.87-.172-.208-.434-.312-.786-.312-.256 0-.496.058-.72.174a2.58 2.58 0 0 0-.636.474V35h-1.482v-6.156h.906c.192 0 .318.09.378.27l.102.486zM53.085 28.748c.456 0 .87.074 1.242.222a2.692 2.692 0 0 1 1.578 1.626c.144.392.216.83.216 1.314 0 .488-.072.928-.216 1.32-.144.392-.35.726-.618 1.002a2.653 2.653 0 0 1-.96.636 3.333 3.333 0 0 1-1.242.222c-.46 0-.878-.074-1.254-.222a2.712 2.712 0 0 1-.966-.636 2.922 2.922 0 0 1-.618-1.002 3.807 3.807 0 0 1-.216-1.32c0-.484.072-.922.216-1.314.148-.392.354-.724.618-.996.268-.272.59-.482.966-.63a3.397 3.397 0 0 1 1.254-.222zm0 5.202c.512 0 .89-.172 1.134-.516.248-.344.372-.848.372-1.512s-.124-1.17-.372-1.518c-.244-.348-.622-.522-1.134-.522-.52 0-.906.176-1.158.528-.248.348-.372.852-.372 1.512s.124 1.164.372 1.512c.252.344.638.516 1.158.516zM57.252 35v-6.156h.906c.192 0 .318.09.378.27l.096.456c.108-.12.22-.23.336-.33a2.017 2.017 0 0 1 1.32-.492c.388 0 .706.106.954.318.252.208.44.486.564.834a1.93 1.93 0 0 1 .834-.882c.172-.092.354-.16.546-.204.196-.044.392-.066.588-.066.34 0 .642.052.906.156.264.104.486.256.666.456.18.2.316.444.408.732.096.288.144.618.144.99V35h-1.482v-3.918c0-.392-.086-.686-.258-.882-.172-.2-.424-.3-.756-.3-.152 0-.294.026-.426.078a1.026 1.026 0 0 0-.342.228 1.019 1.019 0 0 0-.228.366 1.435 1.435 0 0 0-.084.51V35h-1.488v-3.918c0-.412-.084-.712-.252-.9-.164-.188-.406-.282-.726-.282-.216 0-.418.054-.606.162a1.979 1.979 0 0 0-.516.432V35h-1.482zM70.558 32.372c-.428.02-.788.058-1.08.114-.292.052-.526.12-.702.204a.923.923 0 0 0-.378.294.639.639 0 0 0-.114.366c0 .26.076.446.228.558.156.112.358.168.606.168.304 0 .566-.054.786-.162.224-.112.442-.28.654-.504v-1.038zm-3.396-2.67c.708-.648 1.56-.972 2.556-.972.36 0 .682.06.966.18.284.116.524.28.72.492.196.208.344.458.444.75.104.292.156.612.156.96V35h-.672a.708.708 0 0 1-.324-.06c-.076-.044-.136-.13-.18-.258l-.132-.444c-.156.14-.308.264-.456.372a2.804 2.804 0 0 1-.462.264c-.16.072-.332.126-.516.162-.18.04-.38.06-.6.06-.26 0-.5-.034-.72-.102a1.618 1.618 0 0 1-.57-.318 1.414 1.414 0 0 1-.372-.522 1.852 1.852 0 0 1-.132-.726 1.419 1.419 0 0 1 .33-.906c.12-.14.274-.272.462-.396s.418-.232.69-.324c.276-.092.596-.166.96-.222.364-.06.78-.096 1.248-.108v-.36c0-.412-.088-.716-.264-.912-.176-.2-.43-.3-.762-.3-.24 0-.44.028-.6.084-.156.056-.294.12-.414.192l-.33.186a.631.631 0 0 1-.324.084.439.439 0 0 1-.264-.078.716.716 0 0 1-.174-.192l-.264-.474zM74.9 26.084V35h-1.482v-8.916H74.9zM81.969 28.844l-3.354 7.848a.538.538 0 0 1-.174.234c-.068.056-.174.084-.318.084h-1.104l1.152-2.472-2.49-5.694h1.302c.116 0 .206.028.27.084.068.056.118.12.15.192l1.308 3.192c.044.108.08.216.108.324.032.108.062.218.09.33a32.3 32.3 0 0 1 .108-.33c.036-.112.076-.222.12-.33l1.236-3.186a.437.437 0 0 1 .408-.276h1.188z"})}),hn=()=>pt("svg",{viewBox:"0 0 15 17",fill:"currentColor",children:pt("path",{d:"M6.11767 7.47586C6.47736 7.75563 6.91931 7.90898 7.37503 7.91213H7.42681C7.90756 7.90474 8.38832 7.71987 8.67677 7.46846C10.1856 6.18921 14.5568 2.18138 14.5568 2.18138C15.7254 1.09438 12.4637 0.00739 7.42681 0H7.36764C2.3308 0.00739 -0.930935 1.09438 0.237669 2.18138C0.237669 2.18138 4.60884 6.18921 6.11767 7.47586ZM8.67677 9.64243C8.31803 9.92483 7.87599 10.0808 7.41941 10.0861H7.37503C6.91845 10.0808 6.47641 9.92483 6.11767 9.64243C5.0822 8.75513 1.38409 5.42018 0.000989555 4.14832V6.07829C0.000989555 6.29273 0.0823481 6.57372 0.222877 6.70682L0.293316 6.7712L0.293344 6.77122C1.33784 7.72579 4.83903 10.9255 6.11767 12.0161C6.47641 12.2985 6.91845 12.4545 7.37503 12.4597H7.41941C7.90756 12.4449 8.38092 12.2601 8.67677 12.0161C9.9859 10.9069 13.6249 7.57198 14.5642 6.70682C14.7121 6.57372 14.7861 6.29273 14.7861 6.07829V4.14832C12.7662 5.99804 10.7297 7.82949 8.67677 9.64243ZM7.41941 14.6263C7.87513 14.6232 8.31708 14.4698 8.67677 14.19C10.7298 12.3746 12.7663 10.5407 14.7861 8.68853V10.6259C14.7861 10.8329 14.7121 11.1139 14.5642 11.247C13.6249 12.1196 9.9859 15.4471 8.67677 16.5563C8.38092 16.8077 7.90756 16.9926 7.41941 17H7.37503C6.91931 16.9968 6.47736 16.8435 6.11767 16.5637C4.91427 15.5373 1.74219 12.6364 0.502294 11.5025C0.393358 11.4029 0.299337 11.3169 0.222877 11.247C0.0823481 11.1139 0.000989555 10.8329 0.000989555 10.6259V8.68853C1.38409 9.95303 5.0822 13.2953 6.11767 14.1827C6.47641 14.4651 6.91845 14.6211 7.37503 14.6263H7.41941Z"})}),fn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"})}),pn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}),mn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8zm-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91z"})}),vn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),gn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),yn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),_n=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}),bn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z"})}),wn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})}),kn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"m7 10 5 5 5-5z"})}),xn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:[pt("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),pt("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),Sn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V8h16v13z"})}),An=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"m22 5.72-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM7.88 3.39 6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM12.5 8H11v6l4.75 2.85.75-1.23-4-2.37V8zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"})}),Cn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-9 3h2v2h-2V8zm0 3h2v2h-2v-2zM8 8h2v2H8V8zm0 3h2v2H8v-2zm-1 2H5v-2h2v2zm0-3H5V8h2v2zm9 7H8v-2h8v2zm0-4h-2v-2h2v2zm0-3h-2V8h2v2zm3 3h-2v-2h2v2zm0-3h-2V8h2v2z"})}),En=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M8 5v14l11-7z"})}),Mn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"m3.5 18.49 6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"})}),Tn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M10 10.02h5V21h-5zM17 21h3c1.1 0 2-.9 2-2v-9h-5v11zm3-18H5c-1.1 0-2 .9-2 2v3h19V5c0-1.1-.9-2-2-2zM3 19c0 1.1.9 2 2 2h3V10H3v9z"})}),Nn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"})}),On=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M8.9999 14.7854L18.8928 4.8925C19.0803 4.70497 19.3347 4.59961 19.5999 4.59961C19.8651 4.59961 20.1195 4.70497 20.307 4.8925L21.707 6.2925C22.0975 6.68303 22.0975 7.31619 21.707 7.70672L9.70701 19.7067C9.31648 20.0972 8.68332 20.0972 8.2928 19.7067L2.6928 14.1067C2.50526 13.9192 2.3999 13.6648 2.3999 13.3996C2.3999 13.1344 2.50526 12.88 2.6928 12.6925L4.0928 11.2925C4.48332 10.902 5.11648 10.902 5.50701 11.2925L8.9999 14.7854Z"})}),Pn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})}),Ln=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),Rn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M20 9H4v2h16V9zM4 15h16v-2H4v2z"})}),zn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:[pt("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21 5C19.89 4.65 18.67 4.5 17.5 4.5C15.55 4.5 13.45 4.9 12 6C10.55 4.9 8.45 4.5 6.5 4.5C5.33 4.5 4.11 4.65 3 5C2.25 5.25 1.6 5.55 1 6V20.6C1 20.85 1.25 21.1 1.5 21.1C1.6 21.1 1.65 21.1 1.75 21.05C3.15 20.3 4.85 20 6.5 20C8.2 20 10.65 20.65 12 21.5C13.35 20.65 15.8 20 17.5 20C19.15 20 20.85 20.3 22.25 21.05C22.35 21.1 22.4 21.1 22.5 21.1C22.75 21.1 23 20.85 23 20.6V6C22.4 5.55 21.75 5.25 21 5ZM21 18.5C19.9 18.15 18.7 18 17.5 18C15.8 18 13.35 18.65 12 19.5C10.65 18.65 8.2 18 6.5 18C5.3 18 4.1 18.15 3 18.5V7C4.1 6.65 5.3 6.5 6.5 6.5C8.2 6.5 10.65 7.15 12 8C13.35 7.15 15.8 6.5 17.5 6.5C18.7 6.5 19.9 6.65 21 7V18.5Z"}),pt("path",{d:"M17.5 10.5C18.38 10.5 19.23 10.59 20 10.76V9.24C19.21 9.09 18.36 9 17.5 9C15.8 9 14.26 9.29 13 9.83V11.49C14.13 10.85 15.7 10.5 17.5 10.5ZM13 12.49V14.15C14.13 13.51 15.7 13.16 17.5 13.16C18.38 13.16 19.23 13.25 20 13.42V11.9C19.21 11.75 18.36 11.66 17.5 11.66C15.8 11.66 14.26 11.96 13 12.49ZM17.5 14.33C15.8 14.33 14.26 14.62 13 15.16V16.82C14.13 16.18 15.7 15.83 17.5 15.83C18.38 15.83 19.23 15.92 20 16.09V14.57C19.21 14.41 18.36 14.33 17.5 14.33Z"}),pt("path",{d:"M6.5 10.5C5.62 10.5 4.77 10.59 4 10.76V9.24C4.79 9.09 5.64 9 6.5 9C8.2 9 9.74 9.29 11 9.83V11.49C9.87 10.85 8.3 10.5 6.5 10.5ZM11 12.49V14.15C9.87 13.51 8.3 13.16 6.5 13.16C5.62 13.16 4.77 13.25 4 13.42V11.9C4.79 11.75 5.64 11.66 6.5 11.66C8.2 11.66 9.74 11.96 11 12.49ZM6.5 14.33C8.2 14.33 9.74 14.62 11 15.16V16.82C9.87 16.18 8.3 15.83 6.5 15.83C5.62 15.83 4.77 15.92 4 16.09V14.57C4.79 14.41 5.64 14.33 6.5 14.33Z"})]}),Dn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3-8c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3 3 1.34 3 3z"})}),In=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M4 20h16c1.1 0 2-.9 2-2s-.9-2-2-2H4c-1.1 0-2 .9-2 2s.9 2 2 2zm0-3h2v2H4v-2zM2 6c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2s-.9-2-2-2H4c-1.1 0-2 .9-2 2zm4 1H4V5h2v2zm-2 7h16c1.1 0 2-.9 2-2s-.9-2-2-2H4c-1.1 0-2 .9-2 2s.9 2 2 2zm0-3h2v2H4v-2z"})}),$n=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),Fn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M7 20h4c0 1.1-.9 2-2 2s-2-.9-2-2zm-2-1h8v-2H5v2zm11.5-9.5c0 3.82-2.66 5.86-3.77 6.5H5.27c-1.11-.64-3.77-2.68-3.77-6.5C1.5 5.36 4.86 2 9 2s7.5 3.36 7.5 7.5zm4.87-2.13L20 8l1.37.63L22 10l.63-1.37L24 8l-1.37-.63L22 6l-.63 1.37zM19 6l.94-2.06L22 3l-2.06-.94L19 0l-.94 2.06L16 3l2.06.94L19 6z"})}),jn=()=>pt("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:pt("path",{d:"M3 14h4v-4H3v4zm0 5h4v-4H3v4zM3 9h4V5H3v4zm5 5h13v-4H8v4zm0 5h13v-4H8v4zM8 5v4h13V5H8z"})}),Vn=()=>pt("svg",{viewBox:"0 0 16 16",fill:it("color-error"),children:pt("path",{d:"M13.5095 4L8.50952 1H7.50952L2.50952 4L2.01953 4.85999V10.86L2.50952 11.71L7.50952 14.71H8.50952L13.5095 11.71L13.9995 10.86V4.85999L13.5095 4ZM7.50952 13.5601L3.00952 10.86V5.69995L7.50952 8.15002V13.5601ZM3.26953 4.69995L8.00952 1.85999L12.7495 4.69995L8.00952 7.29004L3.26953 4.69995ZM13.0095 10.86L8.50952 13.5601V8.15002L13.0095 5.69995V10.86Z"})}),Hn=()=>pt("svg",{viewBox:"0 0 16 16",fill:it("color-primary"),children:pt("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5H4V4H1.5L1 4.5V12.5L1.5 13H4V12H2V5ZM14.5 4H12V5H14V12H12V13H14.5L15 12.5V4.5L14.5 4ZM11.76 6.56995L12 7V9.51001L11.7 9.95996L7.19995 11.96H6.73999L4.23999 10.46L4 10.03V7.53003L4.30005 7.06995L8.80005 5.06995H9.26001L11.76 6.56995ZM5 9.70996L6.5 10.61V9.28003L5 8.38V9.70996ZM5.57996 7.56006L7.03003 8.43005L10.42 6.93005L8.96997 6.06006L5.57996 7.56006ZM7.53003 10.73L11.03 9.17004V7.77002L7.53003 9.31995V10.73Z"})}),Un=()=>pt("svg",{viewBox:"0 0 16 16",fill:it("color-warning"),children:pt("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 2H8L7 3V6H8V3H14V8H10V9H14L15 8V3L14 2ZM9 6H13V7H9.41L9 6.59V6ZM7 7H2L1 8V13L2 14H8L9 13V8L8 7H7ZM8 13H2V8H8V9V13ZM3 9H7V10H3V9ZM3 11H7V12H3V11ZM9 4H13V5H9V4Z"})}),Bn=()=>pt("svg",{viewBox:"0 0 16 16",fill:it("color-primary"),children:pt("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 3L8 2H14L15 3V8L14 9H10V8H14V3H8V6H7V3ZM9 9V8L8 7H7H2L1 8V13L2 14H8L9 13V9ZM8 8V9V13H2V8H7H8ZM9.41421 7L9 6.58579V6H13V7H9.41421ZM9 4H13V5H9V4ZM7 10H3V11H7V10Z"})});var Wn=n(738),Yn=n.n(Wn);const Zn=e=>{let{to:t,isNavLink:n,children:r,...o}=e;return n?pt(Re,{to:t,...o,children:r}):pt("div",{...o,children:r})},qn=e=>{let{activeItem:t,item:n,color:r=it("color-primary"),activeNavRef:o,onChange:i,isNavLink:a}=e;return pt(Zn,{className:Yn()({"vm-tabs-item":!0,"vm-tabs-item_active":t===n.value,[n.className||""]:n.className}),isNavLink:a,to:n.value,style:{color:r},onClick:(l=n.value,()=>{i&&i(l)}),ref:t===n.value?o:void 0,children:[n.icon&&pt("div",{className:Yn()({"vm-tabs-item__icon":!0,"vm-tabs-item__icon_single":!n.label}),children:n.icon}),n.label]});var l},Kn="undefined"!==typeof window?t.useLayoutEffect:t.useEffect;const Gn=function(e,n,r,o){const i=(0,t.useRef)(n);Kn((()=>{i.current=n}),[n]),(0,t.useEffect)((()=>{var t;const n=null!==(t=null===r||void 0===r?void 0:r.current)&&void 0!==t?t:window;if(!n||!n.addEventListener)return;const a=e=>i.current(e);return n.addEventListener(e,a,o),()=>{n.removeEventListener(e,a,o)}}),[e,r,o])},Qn=()=>{const[e,n]=(0,t.useState)({width:0,height:0}),r=()=>{n({width:window.innerWidth,height:window.innerHeight})};return Gn("resize",r),Kn(r,[]),e},Jn=e=>{let{activeItem:n,items:r,color:o=it("color-primary"),onChange:i,indicatorPlacement:a="bottom",isNavLink:l}=e;const s=Qn(),c=(0,t.useRef)(null),[u,d]=(0,t.useState)({left:0,width:0,bottom:0});return(0,t.useEffect)((()=>{var e;if((null===(e=c.current)||void 0===e?void 0:e.base)instanceof HTMLElement){const{offsetLeft:e,offsetWidth:t,offsetHeight:n}=c.current.base;d({left:e,width:t,bottom:"top"===a?n-2:0})}}),[s,n,c,r]),pt("div",{className:"vm-tabs",children:[r.map((e=>pt(qn,{activeItem:n,item:e,onChange:i,color:o,activeNavRef:c,isNavLink:l},e.value))),pt("div",{className:"vm-tabs__indicator",style:{...u,borderColor:o}})]})},Xn=[{value:tt.chart,icon:pt(Mn,{}),label:"Graph",prometheusCode:0},{value:tt.code,icon:pt(Nn,{}),label:"JSON",prometheusCode:3},{value:tt.table,icon:pt(Tn,{}),label:"Table",prometheusCode:1}],er=Xe("g0.tab",0),tr=Xn.find((e=>e.prometheusCode===+er||e.value===er)),nr=We("SERIES_LIMITS"),rr={displayType:(null===tr||void 0===tr?void 0:tr.value)||tt.chart,nocache:!1,isTracingEnabled:!1,seriesLimits:nr?JSON.parse(nr):Je,tableCompact:We("TABLE_COMPACT")||!1};function or(e,t){switch(t.type){case"SET_DISPLAY_TYPE":return{...e,displayType:t.payload};case"SET_SERIES_LIMITS":return Be("SERIES_LIMITS",JSON.stringify(t.payload)),{...e,seriesLimits:t.payload};case"TOGGLE_QUERY_TRACING":return{...e,isTracingEnabled:!e.isTracingEnabled};case"TOGGLE_NO_CACHE":return{...e,nocache:!e.nocache};case"TOGGLE_TABLE_COMPACT":return Be("TABLE_COMPACT",!e.tableCompact),{...e,tableCompact:!e.tableCompact};default:throw new Error}}const ir=(0,t.createContext)({}),ar={customStep:Xe("g0.step_input",""),yaxis:{limits:{enable:!1,range:{1:[0,0]}}},isHistogram:!1,spanGaps:!1};function lr(e,t){switch(t.type){case"TOGGLE_ENABLE_YAXIS_LIMITS":return{...e,yaxis:{...e.yaxis,limits:{...e.yaxis.limits,enable:!e.yaxis.limits.enable}}};case"SET_CUSTOM_STEP":return{...e,customStep:t.payload};case"SET_YAXIS_LIMITS":return{...e,yaxis:{...e.yaxis,limits:{...e.yaxis.limits,range:t.payload}}};case"SET_IS_HISTOGRAM":return{...e,isHistogram:t.payload};case"SET_SPAN_GAPS":return{...e,spanGaps:t.payload};default:throw new Error}}const sr=(0,t.createContext)({}),cr={windows:"Windows",mac:"Mac OS",linux:"Linux"},ur=()=>(Object.values(cr).find((e=>navigator.userAgent.indexOf(e)>=0))||"unknown")===cr.mac;function dr(){const e=Qn(),n=()=>{const e=["Android","webOS","iPhone","iPad","iPod","BlackBerry","Windows Phone"].map((e=>navigator.userAgent.match(new RegExp(e,"i")))).some((e=>e)),t=window.innerWidth<500;return e||t},[r,o]=(0,t.useState)(n());return(0,t.useEffect)((()=>{o(n())}),[e]),{isMobile:r}}const hr={success:pt(_n,{}),error:pt(yn,{}),warning:pt(gn,{}),info:pt(vn,{})},fr=e=>{let{variant:t,children:n}=e;const{isDarkTheme:r}=vt(),{isMobile:o}=dr();return pt("div",{className:Yn()({"vm-alert":!0,["vm-alert_".concat(t)]:t,"vm-alert_dark":r,"vm-alert_mobile":o}),children:[pt("div",{className:"vm-alert__icon",children:hr[t||"info"]}),pt("div",{className:"vm-alert__content",children:n})]})},pr=(0,t.createContext)({showInfoMessage:()=>{}}),mr={dashboardsSettings:[],dashboardsLoading:!1,dashboardsError:""};function vr(e,t){switch(t.type){case"SET_DASHBOARDS_SETTINGS":return{...e,dashboardsSettings:t.payload};case"SET_DASHBOARDS_LOADING":return{...e,dashboardsLoading:t.payload};case"SET_DASHBOARDS_ERROR":return{...e,dashboardsError:t.payload};default:throw new Error}}const gr=(0,t.createContext)({}),yr=function(){for(var e=arguments.length,t=new Array(e),n=0;nn=>{let{children:r}=n;return pt(e,{children:pt(t,{children:r})})}),(e=>{let{children:t}=e;return pt(ht.FK,{children:t})}))}(...[e=>{let{children:n}=e;const[r,o]=(0,t.useReducer)(dt,yt),i=(0,t.useMemo)((()=>({state:r,dispatch:o})),[r,o]);return pt(mt.Provider,{value:i,children:n})},e=>{let{children:n}=e;const[r,o]=(0,t.useReducer)(qt,Zt),i=(0,t.useMemo)((()=>({state:r,dispatch:o})),[r,o]);return pt(Kt.Provider,{value:i,children:n})},e=>{let{children:n}=e;const[r,o]=(0,t.useReducer)(on,rn),i=(0,t.useMemo)((()=>({state:r,dispatch:o})),[r,o]);return pt(an.Provider,{value:i,children:n})},e=>{let{children:n}=e;const[r,o]=(0,t.useReducer)(or,rr),i=(0,t.useMemo)((()=>({state:r,dispatch:o})),[r,o]);return pt(ir.Provider,{value:i,children:n})},e=>{let{children:n}=e;const[r,o]=(0,t.useReducer)(lr,ar),i=(0,t.useMemo)((()=>({state:r,dispatch:o})),[r,o]);return pt(sr.Provider,{value:i,children:n})},e=>{let{children:n}=e;const{isMobile:r}=dr(),[o,i]=(0,t.useState)({}),[a,l]=(0,t.useState)(!1),[s,c]=(0,t.useState)(void 0);(0,t.useEffect)((()=>{if(!s)return;i({message:s.text,variant:s.type,key:Date.now()}),l(!0);const e=setTimeout(u,4e3);return()=>clearTimeout(e)}),[s]);const u=()=>{c(void 0),l(!1)};return pt(pr.Provider,{value:{showInfoMessage:c},children:[a&&pt("div",{className:Yn()({"vm-snackbar":!0,"vm-snackbar_mobile":r}),children:pt(fr,{variant:o.variant,children:pt("div",{className:"vm-snackbar-content",children:[pt("span",{children:o.message}),pt("div",{className:"vm-snackbar-content__close",onClick:u,children:pt(pn,{})})]})})}),n]})},e=>{let{children:n}=e;const[r,o]=(0,t.useReducer)(vr,mr),i=(0,t.useMemo)((()=>({state:r,dispatch:o})),[r,o]);return pt(gr.Provider,{value:i,children:n})}]),_r=(et.yhatUpper,et.yhatLower,et.yhat,et.anomaly,et.anomalyScore,et.actual,et.training,"rgba(".concat((e=>{if(7!=e.length)return"0, 0, 0";const t=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16);return"".concat(t,", ").concat(n,", ").concat(r)})("#203ea9"),", 0.2)"),{"color-primary":"#589DF6","color-secondary":"#316eca","color-error":"#e5534b","color-warning":"#c69026","color-info":"#539bf5","color-success":"#57ab5a","color-background-body":"#22272e","color-background-block":"#2d333b","color-background-tooltip":"rgba(22, 22, 22, 0.8)","color-text":"#cdd9e5","color-text-secondary":"#768390","color-text-disabled":"#636e7b","box-shadow":"rgba(0, 0, 0, 0.16) 1px 2px 6px","box-shadow-popper":"rgba(0, 0, 0, 0.2) 0px 2px 8px 0px","border-divider":"1px solid rgba(99, 110, 123, 0.5)","color-hover-black":"rgba(0, 0, 0, 0.12)"}),br={"color-primary":"#3F51B5","color-secondary":"#E91E63","color-error":"#FD080E","color-warning":"#FF8308","color-info":"#03A9F4","color-success":"#4CAF50","color-background-body":"#FEFEFF","color-background-block":"#FFFFFF","color-background-tooltip":"rgba(80,80,80,0.9)","color-text":"#110f0f","color-text-secondary":"#706F6F","color-text-disabled":"#A09F9F","box-shadow":"rgba(0, 0, 0, 0.08) 1px 2px 6px","box-shadow-popper":"rgba(0, 0, 0, 0.1) 0px 2px 8px 0px","border-divider":"1px solid rgba(0, 0, 0, 0.15)","color-hover-black":"rgba(0, 0, 0, 0.06)"},wr=()=>{const[e,n]=(0,t.useState)(lt()),r=e=>{n(e.matches)};return(0,t.useEffect)((()=>{const e=window.matchMedia("(prefers-color-scheme: dark)");return e.addEventListener("change",r),()=>e.removeEventListener("change",r)}),[]),e},kr=["primary","secondary","error","warning","info","success"],xr=e=>{let{onLoaded:n}=e;const r=je(),{palette:o={}}=Fe(),{theme:i}=vt(),a=wr(),l=gt(),s=Qn(),[c,u]=(0,t.useState)({[rt.dark]:_r,[rt.light]:br,[rt.system]:lt()?_r:br}),d=()=>{const{innerWidth:e,innerHeight:t}=window,{clientWidth:n,clientHeight:r}=document.documentElement;at("scrollbar-width","".concat(e-n,"px")),at("scrollbar-height","".concat(t-r,"px")),at("vh","".concat(.01*t,"px"))},h=()=>{kr.forEach(((e,t)=>{const r=(e=>{let t=e.replace("#","").trim();if(3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6!==t.length)throw new Error("Invalid HEX color.");return(299*parseInt(t.slice(0,2),16)+587*parseInt(t.slice(2,4),16)+114*parseInt(t.slice(4,6),16))/1e3>=128?"#000000":"#FFFFFF"})(it("color-".concat(e)));at("".concat(e,"-text"),r),t===kr.length-1&&(l({type:"SET_DARK_THEME"}),n(!0))}))},f=()=>{const e=We("THEME")||rt.system,t=c[e];Object.entries(t).forEach((e=>{let[t,n]=e;at(t,n)})),h(),r&&(kr.forEach((e=>{const t=o[e];t&&at("color-".concat(e),t)})),h())};return(0,t.useEffect)((()=>{d(),f()}),[c]),(0,t.useEffect)(d,[s]),(0,t.useEffect)((()=>{const e=lt()?_r:br;c[rt.system]!==e?u((t=>({...t,[rt.system]:e}))):f()}),[i,a]),(0,t.useEffect)((()=>{r&&l({type:"SET_THEME",payload:rt.light})}),[]),null},Sr=()=>{const{showInfoMessage:e}=(0,t.useContext)(pr);return async(t,n)=>{var r;if(null===(r=navigator)||void 0===r||!r.clipboard)return e({text:"Clipboard not supported",type:"error"}),console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(t),n&&e({text:n,type:"success"}),!0}catch(o){return o instanceof Error&&e({text:"".concat(o.name,": ").concat(o.message),type:"error"}),console.warn("Copy failed",o),!1}}},Ar=e=>{let{variant:t="contained",color:n="primary",size:r="medium",ariaLabel:o,children:i,endIcon:a,startIcon:l,fullWidth:s=!1,className:c,disabled:u,onClick:d,onMouseDown:h}=e;return pt("button",{className:Yn()({"vm-button":!0,["vm-button_".concat(t,"_").concat(n)]:!0,["vm-button_".concat(r)]:r,"vm-button_icon":(l||a)&&!i,"vm-button_full-width":s,"vm-button_with-icon":l||a,"vm-button_disabled":u,[c||""]:c}),disabled:u,"aria-label":o,onClick:d,onMouseDown:h,children:pt(ht.FK,{children:[l&&pt("span",{className:"vm-button__start-icon",children:l}),i&&pt("span",{children:i}),a&&pt("span",{className:"vm-button__end-icon",children:a})]})})},Cr=e=>{let{data:n}=e;const r=Sr(),o=(0,t.useMemo)((()=>JSON.stringify(n,null,2)),[n]);return pt("div",{className:"vm-json-view",children:[pt("div",{className:"vm-json-view__copy",children:pt(Ar,{variant:"outlined",onClick:async()=>{await r(o,"Formatted JSON has been copied")},children:"Copy JSON"})}),pt("pre",{className:"vm-json-view__code",children:pt("code",{children:o})})]})},Er=(e,n)=>{const[r]=$e(),o=r.get(n)?r.get(n):e,[i,a]=(0,t.useState)(o);return(0,t.useEffect)((()=>{o!==i&&a(o)}),[o]),[i,a]},Mr=()=>{const e=re(),[n,r]=$e();return{setSearchParamsFromKeys:(0,t.useCallback)((t=>{const o=!!Array.from(n.values()).length;let i=!1;Object.entries(t).forEach((e=>{let[t,r]=e;n.get(t)!=="".concat(r)&&(n.set(t,"".concat(r)),i=!0)})),i&&(o?r(n):e("?".concat(n.toString()),{replace:!0}))}),[n,e])}},Tr=(e,n,r)=>{const o=(0,t.useCallback)((t=>{const o=null===e||void 0===e?void 0:e.current,i=t.target,a=(null===r||void 0===r?void 0:r.current)&&r.current.contains(i);!o||o.contains((null===t||void 0===t?void 0:t.target)||null)||a||n(t)}),[e,n]);Gn("mousedown",o),Gn("touchstart",o)},Nr=e=>{let{children:n,buttonRef:r,placement:o="bottom-left",open:i=!1,onClose:a,offset:l={top:6,left:0},clickOutside:s=!0,fullWidth:c,title:u,disabledFullScreen:d,variant:h}=e;const{isMobile:f}=dr(),p=re(),m=te(),[v,g]=(0,t.useState)({width:0,height:0}),[y,_]=(0,t.useState)(!1),b=(0,t.useRef)(null);(0,t.useEffect)((()=>(_(i),!i&&a&&a(),i&&f&&!d&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow="auto"})),[i]),(0,t.useEffect)((()=>{var e,t;g({width:(null===b||void 0===b||null===(e=b.current)||void 0===e?void 0:e.clientWidth)||0,height:(null===b||void 0===b||null===(t=b.current)||void 0===t?void 0:t.clientHeight)||0}),_(!1)}),[b]);const w=(0,t.useMemo)((()=>{const e=r.current;if(!e||!y)return{};const t=e.getBoundingClientRect(),n={top:0,left:0,width:"auto"},i="bottom-right"===o||"top-right"===o,a=null===o||void 0===o?void 0:o.includes("top"),s=(null===l||void 0===l?void 0:l.top)||0,u=(null===l||void 0===l?void 0:l.left)||0;n.left=n.left=t.left+u,n.top=t.height+t.top+s,i&&(n.left=t.right-v.width),a&&(n.top=t.top-v.height-s);const{innerWidth:d,innerHeight:h}=window,f=n.top+v.height+20>h,p=n.top-20<0,m=n.left+v.width+20>d,g=n.left-20<0;return f&&(n.top=t.top-v.height-s),p&&(n.top=t.height+t.top+s),m&&(n.left=t.right-v.width-u),g&&(n.left=t.left+u),c&&(n.width="".concat(t.width,"px")),n.top<0&&(n.top=20),n.left<0&&(n.left=20),n}),[r,o,y,n,c]),k=()=>{_(!1),a()};(0,t.useEffect)((()=>{if(!b.current||!y||f&&!d)return;const{right:e,width:t}=b.current.getBoundingClientRect();if(e>window.innerWidth){const e=window.innerWidth-20-t;b.current.style.left=e{y&&f&&!d&&(p(m,{replace:!0}),a())}),[y,f,d,m,a]);return Gn("scroll",k),Gn("popstate",x),Tr(b,(()=>{s&&k()}),r),pt(ht.FK,{children:(y||!v.width)&&t.default.createPortal(pt("div",{className:Yn()({"vm-popper":!0,["vm-popper_".concat(h)]:h,"vm-popper_mobile":f&&!d,"vm-popper_open":(f||Object.keys(w).length)&&y}),ref:b,style:f&&!d?{}:w,children:[(u||f&&!d)&&pt("div",{className:"vm-popper-header",children:[pt("p",{className:"vm-popper-header__title",children:u}),pt(Ar,{variant:"text",color:"dark"===h?"white":"primary",size:"small",onClick:e=>{e.stopPropagation(),a()},ariaLabel:"close",children:pt(pn,{})})]}),n]}),document.body)})},Or=e=>{let{checked:t=!1,disabled:n=!1,label:r,color:o="secondary",onChange:i}=e;return pt("div",{className:Yn()({"vm-checkbox":!0,"vm-checkbox_disabled":n,"vm-checkbox_active":t,["vm-checkbox_".concat(o,"_active")]:t,["vm-checkbox_".concat(o)]:o}),onClick:()=>{n||i(!t)},children:[pt("div",{className:"vm-checkbox-track",children:pt("div",{className:"vm-checkbox-track__thumb",children:pt(On,{})})}),r&&pt("span",{className:"vm-checkbox__label",children:r})]})},Pr=e=>{let{children:n,title:r,open:o,placement:i="bottom-center",offset:a={top:6,left:0}}=e;const{isMobile:l}=dr(),[s,c]=(0,t.useState)(!1),[u,d]=(0,t.useState)({width:0,height:0}),h=(0,t.useRef)(null),f=(0,t.useRef)(null),p=()=>c(!1);(0,t.useEffect)((()=>{if(f.current&&s)return d({width:f.current.clientWidth,height:f.current.clientHeight}),window.addEventListener("scroll",p),()=>{window.removeEventListener("scroll",p)}}),[s,r]);const m=(0,t.useMemo)((()=>{var e;const t=null===h||void 0===h||null===(e=h.current)||void 0===e?void 0:e.base;if(!t||!s)return{};const n=t.getBoundingClientRect(),r={top:0,left:0},o="bottom-right"===i||"top-right"===i,l="bottom-left"===i||"top-left"===i,c=null===i||void 0===i?void 0:i.includes("top"),d=(null===a||void 0===a?void 0:a.top)||0,f=(null===a||void 0===a?void 0:a.left)||0;r.left=n.left-(u.width-n.width)/2+f,r.top=n.height+n.top+d,o&&(r.left=n.right-u.width),l&&(r.left=n.left+f),c&&(r.top=n.top-u.height-d);const{innerWidth:p,innerHeight:m}=window,v=r.top+u.height+20>m,g=r.top-20<0,y=r.left+u.width+20>p,_=r.left-20<0;return v&&(r.top=n.top-u.height-d),g&&(r.top=n.height+n.top+d),y&&(r.left=n.right-u.width-f),_&&(r.left=n.left+f),r.top<0&&(r.top=20),r.left<0&&(r.left=20),r}),[h,i,s,u]),v=()=>{"boolean"!==typeof o&&c(!0)},g=()=>{c(!1)};return(0,t.useEffect)((()=>{"boolean"===typeof o&&c(o)}),[o]),(0,t.useEffect)((()=>{var e;const t=null===h||void 0===h||null===(e=h.current)||void 0===e?void 0:e.base;if(t)return t.addEventListener("mouseenter",v),t.addEventListener("mouseleave",g),()=>{t.removeEventListener("mouseenter",v),t.removeEventListener("mouseleave",g)}}),[h]),pt(ht.FK,{children:[pt(t.Fragment,{ref:h,children:n}),!l&&s&&t.default.createPortal(pt("div",{className:"vm-tooltip",ref:f,style:m,children:r}),document.body)]})},Lr=e=>{let{value:t=!1,disabled:n=!1,label:r,color:o="secondary",fullWidth:i,onChange:a}=e;return pt("div",{className:Yn()({"vm-switch":!0,"vm-switch_full-width":i,"vm-switch_disabled":n,"vm-switch_active":t,["vm-switch_".concat(o,"_active")]:t,["vm-switch_".concat(o)]:o}),onClick:()=>{n||a(!t)},children:[pt("div",{className:"vm-switch-track",children:pt("div",{className:"vm-switch-track__thumb"})}),r&&pt("span",{className:"vm-switch__label",children:r})]})};const Rr=e=>{const[n,r]=(0,t.useState)(!!e),o=(0,t.useCallback)((()=>r(!0)),[]),i=(0,t.useCallback)((()=>r(!1)),[]),a=(0,t.useCallback)((()=>r((e=>!e))),[]);return{value:n,setValue:r,setTrue:o,setFalse:i,toggle:a}},zr="Table settings",Dr=e=>{let{columns:n,defaultColumns:r=[],tableCompact:o,onChangeColumns:i,toggleTableCompact:a}=e;const{isMobile:l}=dr(),s=(0,t.useRef)(null),{value:c,toggle:u,setFalse:d}=Rr(!1),h=(0,t.useMemo)((()=>!n.length),[n]),f=e=>()=>{(e=>{i(r.includes(e)?r.filter((t=>t!==e)):[...r,e])})(e)};return(0,t.useEffect)((()=>{((e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n])))(n,r)||i(n)}),[n]),pt("div",{className:"vm-table-settings",children:[pt(Pr,{title:zr,children:pt("div",{ref:s,children:pt(Ar,{variant:"text",startIcon:pt(fn,{}),onClick:u,disabled:h,ariaLabel:"table settings"})})}),pt(Nr,{open:c,onClose:d,placement:"bottom-right",buttonRef:s,title:zr,children:pt("div",{className:Yn()({"vm-table-settings-popper":!0,"vm-table-settings-popper_mobile":l}),children:[pt("div",{className:"vm-table-settings-popper-list vm-table-settings-popper-list_first",children:pt(Lr,{label:"Compact view",value:o,onChange:a})}),pt("div",{className:"vm-table-settings-popper-list",children:[pt("div",{className:"vm-table-settings-popper-list-header",children:[pt("h3",{className:"vm-table-settings-popper-list-header__title",children:"Display columns"}),pt(Pr,{title:"Reset to default",children:pt(Ar,{color:"primary",variant:"text",size:"small",onClick:()=>{d(),i(n)},startIcon:pt(mn,{}),ariaLabel:"reset columns"})})]}),n.map((e=>pt("div",{className:"vm-table-settings-popper-list__item",children:pt(Or,{checked:r.includes(e),onChange:f(e),label:e,disabled:o})},e)))]})]})})]})},Ir=["date","timestamp","time"];function $r(e,t,n){const r=e[n],i=t[n],a=Ir.includes("".concat(n))?o()("".concat(r)).unix():r,l=Ir.includes("".concat(n))?o()("".concat(i)).unix():i;return la?1:0}const Fr=e=>{let{rows:n,columns:r,defaultOrderBy:o,copyToClipboard:i,paginationOffset:a}=e;const[l,s]=(0,t.useState)(o),[c,u]=(0,t.useState)("desc"),[d,h]=(0,t.useState)(null),f=(0,t.useMemo)((()=>{const{startIndex:e,endIndex:t}=a;return function(e,t){const n=e.map(((e,t)=>[e,t]));return n.sort(((e,n)=>{const r=t(e[0],n[0]);return 0!==r?r:e[1]-n[1]})),n.map((e=>e[0]))}(n,function(e,t){return"desc"===e?(e,n)=>$r(e,n,t):(e,n)=>-$r(e,n,t)}(c,l)).slice(e,t)}),[n,l,c,a]),p=(e,t)=>async()=>{if(d!==t)try{await navigator.clipboard.writeText(String(e)),h(t)}catch(Au){console.error(Au)}};return(0,t.useEffect)((()=>{if(null===d)return;const e=setTimeout((()=>h(null)),2e3);return()=>clearTimeout(e)}),[d]),pt("table",{className:"vm-table",children:[pt("thead",{className:"vm-table-header",children:pt("tr",{className:"vm-table__row vm-table__row_header",children:[r.map((e=>{return pt("th",{className:"vm-table-cell vm-table-cell_header vm-table-cell_sort",onClick:(t=e.key,()=>{u((e=>"asc"===e&&l===t?"desc":"asc")),s(t)}),children:pt("div",{className:"vm-table-cell__content",children:[pt("div",{children:String(e.title||e.key)}),pt("div",{className:Yn()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":l===e.key,"vm-table__sort-icon_desc":"desc"===c&&l===e.key}),children:pt(kn,{})})]})},String(e.key));var t})),i&&pt("th",{className:"vm-table-cell vm-table-cell_header"})]})}),pt("tbody",{className:"vm-table-body",children:f.map(((e,t)=>pt("tr",{className:"vm-table__row",children:[r.map((t=>pt("td",{className:Yn()({"vm-table-cell":!0,["".concat(t.className)]:t.className}),children:e[t.key]||"-"},String(t.key)))),i&&pt("td",{className:"vm-table-cell vm-table-cell_right",children:e[i]&&pt("div",{className:"vm-table-cell__content",children:pt(Pr,{title:d===t?"Copied":"Copy row",children:pt(Ar,{variant:"text",color:d===t?"success":"gray",size:"small",startIcon:pt(d===t?On:Ln,{}),onClick:p(e[i],t),ariaLabel:"copy row"})})})})]},t)))})]})},jr=e=>{let{logs:n,displayColumns:r,tableCompact:o,columns:i}=e;const a=e=>{switch(e){case"time":return"vm-table-cell_logs-time";case"data":return"vm-table-cell_logs vm-table-cell_pre";default:return"vm-table-cell_logs"}},l=(0,t.useMemo)((()=>o?[{key:"data",title:"Data",className:a("data")}]:i.map((e=>({key:e,title:e,className:a(e)})))),[o,i]),s=(0,t.useMemo)((()=>null===r||void 0===r||!r.length||o?l:l.filter((e=>r.includes(e.key)))),[l,r,o]);return pt(ht.FK,{children:pt(Fr,{rows:n,columns:s,defaultOrderBy:"time",copyToClipboard:"data",paginationOffset:{startIndex:0,endIndex:1/0}})})},Vr=e=>{let{defaultExpanded:n=!1,onChange:r,title:o,children:i}=e;const[a,l]=(0,t.useState)(n);return(0,t.useEffect)((()=>{r&&r(a)}),[a]),pt(ht.FK,{children:[pt("header",{className:"vm-accordion-header ".concat(a&&"vm-accordion-header_open"),onClick:()=>{l((e=>!e))},children:[o,pt("div",{className:"vm-accordion-header__arrow ".concat(a&&"vm-accordion-header__arrow_open"),children:pt(wn,{})})]}),a&&pt("section",{className:"vm-accordion-section",children:i},"content")]})},Hr=e=>{let{logs:n,columns:r}=e;const o=(0,t.useMemo)((()=>{const e=["_msg","time","data","_time"],t=r.filter((t=>!e.includes(t)));return function(e,t){const n=e.reduce(((e,n)=>{const r=t.map((e=>"".concat(e,": ").concat(n[e]||"-"))).join("|");return(e[r]=e[r]||[]).push(n),e}),{});return Object.entries(n).map((e=>{let[t,n]=e;return{keys:t.split("|"),values:n}}))}(n,t)}),[n]);return pt("div",{className:"vm-explore-logs-body-content",children:o.map((e=>pt("div",{className:"vm-explore-logs-body-content-group",children:pt(Vr,{defaultExpanded:!0,title:pt("div",{className:"vm-explore-logs-body-content-group-keys",children:[pt("span",{className:"vm-explore-logs-body-content-group-keys__title",children:"Group by:"}),e.keys.map((e=>pt("div",{className:"vm-explore-logs-body-content-group-keys__key",children:e},e)))]}),children:pt("div",{className:"vm-explore-logs-body-content-group-rows",children:e.values.map((e=>pt("div",{className:"vm-explore-logs-body-content-group-rows-item",children:[pt("div",{className:"vm-explore-logs-body-content-group-rows-item__time",children:e.time}),pt("div",{className:"vm-explore-logs-body-content-group-rows-item__msg",children:e._msg})]},"".concat(e._msg).concat(e._time))))})})},e.keys.join(""))))})};var Ur=function(e){return e.group="group",e.table="table",e.json="json",e}(Ur||{});const Br=[{label:"Group",value:Ur.group,icon:pt(jn,{})},{label:"Table",value:Ur.table,icon:pt(Tn,{})},{label:"JSON",value:Ur.json,icon:pt(Nn,{})}],Wr=e=>{let{data:n,loaded:r}=e;const{isMobile:i}=dr(),{timezone:a}=Gt(),{setSearchParamsFromKeys:l}=Mr(),[s,c]=Er(Ur.group,"view"),[u,d]=(0,t.useState)([]),{value:h,toggle:f}=Rr(!1),p=(0,t.useMemo)((()=>n.map((e=>({time:o()(e._time).tz().format("MMM DD, YYYY \nHH:mm:ss.SSS"),data:JSON.stringify(e,null,2),...e})))),[n,a]),m=(0,t.useMemo)((()=>{if(null===p||void 0===p||!p.length)return[];const e=["data","_time"],t=new Set;for(const n of p)for(const e in n)t.add(e);return Array.from(t).filter((t=>!e.includes(t)))}),[p]);return pt("div",{className:Yn()({"vm-explore-logs-body":!0,"vm-block":!0,"vm-block_mobile":i}),children:[pt("div",{className:Yn()({"vm-explore-logs-body-header":!0,"vm-section-header":!0,"vm-explore-logs-body-header_mobile":i}),children:[pt("div",{className:"vm-section-header__tabs",children:pt(Jn,{activeItem:String(s),items:Br,onChange:e=>{c(e),l({view:e})}})}),s===Ur.table&&pt("div",{className:"vm-explore-logs-body-header__settings",children:pt(Dr,{columns:m,defaultColumns:u,onChangeColumns:d,tableCompact:h,toggleTableCompact:f})})]}),pt("div",{className:Yn()({"vm-explore-logs-body__table":!0,"vm-explore-logs-body__table_mobile":i}),children:[!n.length&&pt("div",{className:"vm-explore-logs-body__empty",children:r?"No logs found":"Run query to see logs"}),!!n.length&&pt(ht.FK,{children:[s===Ur.table&&pt(jr,{logs:p,displayColumns:u,tableCompact:h,columns:m}),s===Ur.group&&pt(Hr,{logs:p,columns:m}),s===Ur.json&&pt(Cr,{data:n})]})]})]})},Yr=e=>{let{containerStyles:t={},message:n}=e;const{isDarkTheme:r}=vt();return pt("div",{className:Yn()({"vm-spinner":!0,"vm-spinner_dark":r}),style:t&&{},children:[pt("div",{className:"half-circle-spinner",children:[pt("div",{className:"circle circle-1"}),pt("div",{className:"circle circle-2"})]}),n&&pt("div",{className:"vm-spinner__message",children:n})]})},Zr=e=>{let{error:n,warning:r,info:o}=e;const i=(0,t.useRef)(null),[a,l]=(0,t.useState)(!1),[s,c]=(0,t.useState)(!1),u=(0,t.useMemo)((()=>n?"ERROR: ":r?"WARNING: ":""),[n,r]),d="".concat(u).concat(n||r||o),h=()=>{const e=i.current;if(e){const{offsetWidth:t,scrollWidth:n,offsetHeight:r,scrollHeight:o}=e;l(t+1{c(!1),h()}),[i,d]),Gn("resize",h),n||r||o?pt("span",{className:Yn()({"vm-text-field__error":!0,"vm-text-field__warning":r&&!n,"vm-text-field__helper-text":!r&&!n,"vm-text-field__error_overflowed":a,"vm-text-field__error_full":s}),"data-show":!!d,ref:i,onClick:()=>{a&&(c(!0),l(!1))},children:d}):null},qr=e=>{let{label:n,value:r,type:o="text",error:i="",warning:a="",helperText:l="",placeholder:s,endIcon:c,startIcon:u,disabled:d=!1,autofocus:h=!1,inputmode:f="text",onChange:p,onEnter:m,onKeyDown:v,onFocus:g,onBlur:y,onChangeCaret:_}=e;const{isDarkTheme:b}=vt(),{isMobile:w}=dr(),k=(0,t.useRef)(null),x=(0,t.useRef)(null),S=(0,t.useMemo)((()=>"textarea"===o?x:k),[o]),A=Yn()({"vm-text-field__input":!0,"vm-text-field__input_error":i,"vm-text-field__input_warning":!i&&a,"vm-text-field__input_icon-start":u,"vm-text-field__input_disabled":d,"vm-text-field__input_textarea":"textarea"===o}),C=e=>{const{selectionStart:t,selectionEnd:n}=e;_&&_([t||0,n||0])},E=e=>{C(e.currentTarget)},M=e=>{v&&v(e);const{key:t,ctrlKey:n,metaKey:r}=e,i="Enter"===t;("textarea"!==o?i:i&&(r||n))&&m&&(e.preventDefault(),m())},T=e=>{C(e.currentTarget)},N=e=>{d||(p&&p(e.currentTarget.value),C(e.currentTarget))};(0,t.useEffect)((()=>{var e;h&&!w&&(null===S||void 0===S||null===(e=S.current)||void 0===e?void 0:e.focus)&&S.current.focus()}),[S,h]);const O=()=>{g&&g()},P=()=>{y&&y()};return pt("label",{className:Yn()({"vm-text-field":!0,"vm-text-field_textarea":"textarea"===o,"vm-text-field_dark":b}),"data-replicated-value":r,children:[u&&pt("div",{className:"vm-text-field__icon-start",children:u}),c&&pt("div",{className:"vm-text-field__icon-end",children:c}),"textarea"===o?pt("textarea",{className:A,disabled:d,ref:x,value:r,rows:1,inputMode:f,placeholder:s,autoCapitalize:"none",onInput:N,onKeyDown:M,onKeyUp:T,onFocus:O,onBlur:P,onMouseUp:E}):pt("input",{className:A,disabled:d,ref:k,value:r,type:o,placeholder:s,inputMode:f,autoCapitalize:"none",onInput:N,onKeyDown:M,onKeyUp:T,onFocus:O,onBlur:P,onMouseUp:E}),n&&pt("span",{className:"vm-text-field__label",children:n}),pt(Zr,{error:i,warning:a,info:l})]})};var Kr=function(e){return e[e.mouse=0]="mouse",e[e.keyboard=1]="keyboard",e}(Kr||{});const Gr=e=>{var n;let{value:r,options:o,anchor:i,disabled:a,minLength:l=2,fullWidth:s,selected:c,noOptionsText:u,label:d,disabledFullScreen:h,offset:f,maxDisplayResults:p,loading:m,onSelect:v,onOpenAutocomplete:g,onFoundOptions:y,onChangeWrapperRef:_}=e;const{isMobile:b}=dr(),w=(0,t.useRef)(null),[k,x]=(0,t.useState)({index:-1}),[S,A]=(0,t.useState)(""),[C,E]=(0,t.useState)(0),{value:M,setValue:T,setFalse:N}=Rr(!1),O=(0,t.useMemo)((()=>{if(!M)return[];try{const e=new RegExp(String(r.trim()),"i"),t=o.filter((t=>e.test(t.value))).sort(((t,n)=>{var o,i;return t.value.toLowerCase()===r.trim().toLowerCase()?-1:n.value.toLowerCase()===r.trim().toLowerCase()?1:((null===(o=t.value.match(e))||void 0===o?void 0:o.index)||0)-((null===(i=n.value.match(e))||void 0===i?void 0:i.index)||0)}));return E(t.length),A(t.length>Number(null===p||void 0===p?void 0:p.limit)&&(null===p||void 0===p?void 0:p.message)||""),null!==p&&void 0!==p&&p.limit?t.slice(0,p.limit):t}catch(Au){return[]}}),[M,o,r]),P=(0,t.useMemo)((()=>{var e;return 1===O.length&&(null===(e=O[0])||void 0===e?void 0:e.value)===r}),[O]),L=(0,t.useMemo)((()=>u&&!O.length),[u,O]),R=()=>{x({index:-1})},z=(0,t.useCallback)((e=>{const{key:t,ctrlKey:n,metaKey:r,shiftKey:o}=e,i=n||r||o,a=O.length;if("ArrowUp"===t&&!i&&a&&(e.preventDefault(),x((e=>{let{index:t}=e;return{index:t<=0?0:t-1,type:Kr.keyboard}}))),"ArrowDown"===t&&!i&&a){e.preventDefault();const t=O.length-1;x((e=>{let{index:n}=e;return{index:n>=t?t:n+1,type:Kr.keyboard}}))}if("Enter"===t){const e=O[k.index];e&&v(e.value),c||N()}"Escape"===t&&N()}),[k,O,N,v,c]);return(0,t.useEffect)((()=>{T(r.length>=l)}),[r,o]),Gn("keydown",z),(0,t.useEffect)((()=>{if(!w.current||k.type===Kr.mouse)return;const e=w.current.childNodes[k.index];null!==e&&void 0!==e&&e.scrollIntoView&&e.scrollIntoView({block:"center"})}),[k,O]),(0,t.useEffect)((()=>{x({index:-1})}),[O]),(0,t.useEffect)((()=>{g&&g(M)}),[M]),(0,t.useEffect)((()=>{y&&y(P?[]:O)}),[O,P]),(0,t.useEffect)((()=>{_&&_(w)}),[w]),pt(Nr,{open:M,buttonRef:i,placement:"bottom-left",onClose:N,fullWidth:s,title:b?d:void 0,disabledFullScreen:h,offset:f,children:[pt("div",{className:Yn()({"vm-autocomplete":!0,"vm-autocomplete_mobile":b&&!h}),ref:w,children:[m&&pt("div",{className:"vm-autocomplete__loader",children:[pt(bn,{}),pt("span",{children:"Loading..."})]}),L&&pt("div",{className:"vm-autocomplete__no-options",children:u}),!P&&O.map(((e,t)=>{return pt("div",{className:Yn()({"vm-list-item":!0,"vm-list-item_mobile":b,"vm-list-item_active":t===k.index,"vm-list-item_multiselect":c,"vm-list-item_multiselect_selected":null===c||void 0===c?void 0:c.includes(e.value),"vm-list-item_with-icon":e.icon}),id:"$autocomplete$".concat(e.value),onClick:(r=e.value,()=>{a||(v(r),c||N())}),onMouseEnter:(n=t,()=>{x({index:n,type:Kr.mouse})}),onMouseLeave:R,children:[(null===c||void 0===c?void 0:c.includes(e.value))&&pt(On,{}),pt(ht.FK,{children:e.icon}),pt("span",{children:e.value})]},"".concat(t).concat(e.value));var n,r}))]}),S&&pt("div",{className:"vm-autocomplete-message",children:["Shown ",null===p||void 0===p?void 0:p.limit," results out of ",C,". ",S]}),(null===(n=O[k.index])||void 0===n?void 0:n.description)&&pt("div",{className:"vm-autocomplete-info",children:[pt("div",{className:"vm-autocomplete-info__type",children:O[k.index].type}),pt("div",{className:"vm-autocomplete-info__description",dangerouslySetInnerHTML:{__html:O[k.index].description||""}})]})]})};var Qr=n(267),Jr=n.n(Qr);const Xr=e=>e.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&"),eo=e=>JSON.stringify(e).slice(1,-1);var to=function(e){return e.metric="metric",e.label="label",e.labelValue="labelValue",e}(to||{});const no={[to.metric]:pt(Vn,{}),[to.label]:pt(Un,{}),[to.labelValue]:pt(Bn,{})},ro="u-off",oo="u-label",io="width",ao="height",lo="top",so="bottom",co="left",uo="right",ho="#000",fo=ho+"0",po="mousemove",mo="mousedown",vo="mouseup",go="mouseenter",yo="mouseleave",_o="dblclick",bo="change",wo="dppxchange",ko="--",xo="undefined"!=typeof window,So=xo?document:null,Ao=xo?window:null,Co=xo?navigator:null;let Eo,Mo;function To(e,t){if(null!=t){let n=e.classList;!n.contains(t)&&n.add(t)}}function No(e,t){let n=e.classList;n.contains(t)&&n.remove(t)}function Oo(e,t,n){e.style[t]=n+"px"}function Po(e,t,n,r){let o=So.createElement(e);return null!=t&&To(o,t),null!=n&&n.insertBefore(o,r),o}function Lo(e,t){return Po("div",e,t)}const Ro=new WeakMap;function zo(e,t,n,r,o){let i="translate("+t+"px,"+n+"px)";i!=Ro.get(e)&&(e.style.transform=i,Ro.set(e,i),t<0||n<0||t>r||n>o?To(e,ro):No(e,ro))}const Do=new WeakMap;function Io(e,t,n){let r=t+n;r!=Do.get(e)&&(Do.set(e,r),e.style.background=t,e.style.borderColor=n)}const $o=new WeakMap;function Fo(e,t,n,r){let o=t+""+n;o!=$o.get(e)&&($o.set(e,o),e.style.height=n+"px",e.style.width=t+"px",e.style.marginLeft=r?-t/2+"px":0,e.style.marginTop=r?-n/2+"px":0)}const jo={passive:!0},Vo={...jo,capture:!0};function Ho(e,t,n,r){t.addEventListener(e,n,r?Vo:jo)}function Uo(e,t,n,r){t.removeEventListener(e,n,r?Vo:jo)}function Bo(e,t,n,r){let o;n=n||0;let i=(r=r||t.length-1)<=2147483647;for(;r-n>1;)o=i?n+r>>1:ai((n+r)/2),t[o]=t&&o<=n;o+=r)if(null!=e[o])return o;return-1}function Yo(e,t,n,r){let o=hi(e),i=hi(t);e==t&&(-1==o?(e*=n,t/=n):(e/=n,t*=n));let a=10==n?fi:pi,l=1==i?si:ai,s=(1==o?ai:si)(a(ii(e))),c=l(a(ii(t))),u=di(n,s),d=di(n,c);return 10==n&&(s<0&&(u=Ti(u,-s)),c<0&&(d=Ti(d,-c))),r||2==n?(e=u*o,t=d*i):(e=Mi(e,u),t=Ei(t,d)),[e,t]}function Zo(e,t,n,r){let o=Yo(e,t,n,r);return 0==e&&(o[0]=0),0==t&&(o[1]=0),o}xo&&function e(){let t=devicePixelRatio;Eo!=t&&(Eo=t,Mo&&Uo(bo,Mo,e),Mo=matchMedia("(min-resolution: ".concat(Eo-.001,"dppx) and (max-resolution: ").concat(Eo+.001,"dppx)")),Ho(bo,Mo,e),Ao.dispatchEvent(new CustomEvent(wo)))}();const qo=.1,Ko={mode:3,pad:qo},Go={pad:0,soft:null,mode:0},Qo={min:Go,max:Go};function Jo(e,t,n,r){return Fi(n)?ei(e,t,n):(Go.pad=n,Go.soft=r?0:null,Go.mode=r?3:0,ei(e,t,Qo))}function Xo(e,t){return null==e?t:e}function ei(e,t,n){let r=n.min,o=n.max,i=Xo(r.pad,0),a=Xo(o.pad,0),l=Xo(r.hard,-vi),s=Xo(o.hard,vi),c=Xo(r.soft,vi),u=Xo(o.soft,-vi),d=Xo(r.mode,0),h=Xo(o.mode,0),f=t-e,p=fi(f),m=ui(ii(e),ii(t)),v=fi(m),g=ii(v-p);(f<1e-9||g>10)&&(f=0,0!=e&&0!=t||(f=1e-9,2==d&&c!=vi&&(i=0),2==h&&u!=-vi&&(a=0)));let y=f||m||1e3,_=fi(y),b=di(10,ai(_)),w=Ti(Mi(e-y*(0==f?0==e?.1:1:i),b/10),9),k=e>=c&&(1==d||3==d&&w<=c||2==d&&w>=c)?c:vi,x=ui(l,w=k?k:ci(k,w)),S=Ti(Ei(t+y*(0==f?0==t?.1:1:a),b/10),9),A=t<=u&&(1==h||3==h&&S>=u||2==h&&S<=u)?u:-vi,C=ci(s,S>A&&t<=A?A:ui(A,S));return x==C&&0==x&&(C=100),[x,C]}const ti=new Intl.NumberFormat(xo?Co.language:"en-US"),ni=e=>ti.format(e),ri=Math,oi=ri.PI,ii=ri.abs,ai=ri.floor,li=ri.round,si=ri.ceil,ci=ri.min,ui=ri.max,di=ri.pow,hi=ri.sign,fi=ri.log10,pi=ri.log2,mi=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return ri.asinh(e/t)},vi=1/0;function gi(e){return 1+(0|fi((e^e>>31)-(e>>31)))}function yi(e,t,n){return ci(ui(e,t),n)}function _i(e){return"function"==typeof e?e:()=>e}const bi=e=>e,wi=(e,t)=>t,ki=e=>null,xi=e=>!0,Si=(e,t)=>e==t,Ai=e=>Ti(e,14);function Ci(e,t){return Ai(Ti(Ai(e/t))*t)}function Ei(e,t){return Ai(si(Ai(e/t))*t)}function Mi(e,t){return Ai(ai(Ai(e/t))*t)}function Ti(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(Ii(e))return e;let n=10**t,r=e*n*(1+Number.EPSILON);return li(r)/n}const Ni=new Map;function Oi(e){return((""+e).split(".")[1]||"").length}function Pi(e,t,n,r){let o=[],i=r.map(Oi);for(let a=t;a=0&&a>=0?0:t)+(a>=i[e]?0:i[e]),c=Ti(l,s);o.push(c),Ni.set(c,s)}}return o}const Li={},Ri=[],zi=[null,null],Di=Array.isArray,Ii=Number.isInteger;function $i(e){return"string"==typeof e}function Fi(e){let t=!1;if(null!=e){let n=e.constructor;t=null==n||n==Object}return t}function ji(e){return null!=e&&"object"==typeof e}const Vi=Object.getPrototypeOf(Uint8Array);function Hi(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fi;if(Di(e)){let r=e.find((e=>null!=e));if(Di(r)||n(r)){t=Array(e.length);for(let r=0;ri){for(r=a-1;r>=0&&null==e[r];)e[r--]=null;for(r=a+1;rPromise.resolve().then(e):queueMicrotask;const Yi=["January","February","March","April","May","June","July","August","September","October","November","December"],Zi=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function qi(e){return e.slice(0,3)}const Ki=Zi.map(qi),Gi=Yi.map(qi),Qi={MMMM:Yi,MMM:Gi,WWWW:Zi,WWW:Ki};function Ji(e){return(e<10?"0":"")+e}const Xi={YYYY:e=>e.getFullYear(),YY:e=>(e.getFullYear()+"").slice(2),MMMM:(e,t)=>t.MMMM[e.getMonth()],MMM:(e,t)=>t.MMM[e.getMonth()],MM:e=>Ji(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>Ji(e.getDate()),D:e=>e.getDate(),WWWW:(e,t)=>t.WWWW[e.getDay()],WWW:(e,t)=>t.WWW[e.getDay()],HH:e=>Ji(e.getHours()),H:e=>e.getHours(),h:e=>{let t=e.getHours();return 0==t?12:t>12?t-12:t},AA:e=>e.getHours()>=12?"PM":"AM",aa:e=>e.getHours()>=12?"pm":"am",a:e=>e.getHours()>=12?"p":"a",mm:e=>Ji(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>Ji(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>{return((t=e.getMilliseconds())<10?"00":t<100?"0":"")+t;var t}};function ea(e,t){t=t||Qi;let n,r=[],o=/\{([a-z]+)\}|[^{]+/gi;for(;n=o.exec(e);)r.push("{"==n[0][0]?Xi[n[1]]:n[0]);return e=>{let n="";for(let o=0;oe%1==0,ra=[1,2,2.5,5],oa=Pi(10,-16,0,ra),ia=Pi(10,0,16,ra),aa=ia.filter(na),la=oa.concat(ia),sa="{YYYY}",ca="\n"+sa,ua="{M}/{D}",da="\n"+ua,ha=da+"/{YY}",fa="{aa}",pa="{h}:{mm}"+fa,ma="\n"+pa,va=":{ss}",ga=null;function ya(e){let t=1e3*e,n=60*t,r=60*n,o=24*r,i=30*o,a=365*o;return[(1==e?Pi(10,0,3,ra).filter(na):Pi(10,-3,0,ra)).concat([t,5*t,10*t,15*t,30*t,n,5*n,10*n,15*n,30*n,r,2*r,3*r,4*r,6*r,8*r,12*r,o,2*o,3*o,4*o,5*o,6*o,7*o,8*o,9*o,10*o,15*o,i,2*i,3*i,4*i,6*i,a,2*a,5*a,10*a,25*a,50*a,100*a]),[[a,sa,ga,ga,ga,ga,ga,ga,1],[28*o,"{MMM}",ca,ga,ga,ga,ga,ga,1],[o,ua,ca,ga,ga,ga,ga,ga,1],[r,"{h}"+fa,ha,ga,da,ga,ga,ga,1],[n,pa,ha,ga,da,ga,ga,ga,1],[t,va,ha+" "+pa,ga,da+" "+pa,ga,ma,ga,1],[e,va+".{fff}",ha+" "+pa,ga,da+" "+pa,ga,ma,ga,1]],function(t){return(l,s,c,u,d,h)=>{let f=[],p=d>=a,m=d>=i&&d=o?o:d,a=_+(ai(c)-ai(g))+Ei(g-_,i);f.push(a);let p=t(a),m=p.getHours()+p.getMinutes()/n+p.getSeconds()/r,v=d/r,y=h/l.axes[s]._space;for(;a=Ti(a+d,1==e?0:3),!(a>u);)if(v>1){let e=ai(Ti(m+v,6))%24,n=t(a).getHours()-e;n>1&&(n=-1),a-=n*r,m=(m+v)%24,Ti((a-f[f.length-1])/d,3)*y>=.7&&f.push(a)}else f.push(a)}return f}}]}const[_a,ba,wa]=ya(1),[ka,xa,Sa]=ya(.001);function Aa(e,t){return e.map((e=>e.map(((n,r)=>0==r||8==r||null==n?n:t(1==r||0==e[8]?n:e[1]+n)))))}function Ca(e,t){return(n,r,o,i,a)=>{let l,s,c,u,d,h,f=t.find((e=>a>=e[0]))||t[t.length-1];return r.map((t=>{let n=e(t),r=n.getFullYear(),o=n.getMonth(),i=n.getDate(),a=n.getHours(),p=n.getMinutes(),m=n.getSeconds(),v=r!=l&&f[2]||o!=s&&f[3]||i!=c&&f[4]||a!=u&&f[5]||p!=d&&f[6]||m!=h&&f[7]||f[1];return l=r,s=o,c=i,u=a,d=p,h=m,v(n)}))}}function Ea(e,t,n){return new Date(e,t,n)}function Ma(e,t){return t(e)}Pi(2,-53,53,[1]);function Ta(e,t){return(n,r,o,i)=>null==i?ko:t(e(r))}const Na={show:!0,live:!0,isolate:!1,mount:()=>{},markers:{show:!0,width:2,stroke:function(e,t){let n=e.series[t];return n.width?n.stroke(e,t):n.points.width?n.points.stroke(e,t):null},fill:function(e,t){return e.series[t].fill(e,t)},dash:"solid"},idx:null,idxs:null,values:[]};const Oa=[0,0];function Pa(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return e=>{0==e.button&&(!r||e.target==t)&&n(e)}}function La(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return e=>{(!r||e.target==t)&&n(e)}}const Ra={show:!0,x:!0,y:!0,lock:!1,move:function(e,t,n){return Oa[0]=t,Oa[1]=n,Oa},points:{show:function(e,t){let n=e.cursor.points,r=Lo(),o=n.size(e,t);Oo(r,io,o),Oo(r,ao,o);let i=o/-2;Oo(r,"marginLeft",i),Oo(r,"marginTop",i);let a=n.width(e,t,o);return a&&Oo(r,"borderWidth",a),r},size:function(e,t){return e.series[t].points.size},width:0,stroke:function(e,t){let n=e.series[t].points;return n._stroke||n._fill},fill:function(e,t){let n=e.series[t].points;return n._fill||n._stroke}},bind:{mousedown:Pa,mouseup:Pa,click:Pa,dblclick:Pa,mousemove:La,mouseleave:La,mouseenter:La},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(e,t)=>{t.stopPropagation(),t.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(e,t,n,r,o)=>r-o,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},za={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},Da=Ui({},za,{filter:wi}),Ia=Ui({},Da,{size:10}),$a=Ui({},za,{show:!1}),Fa='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',ja="bold "+Fa,Va={show:!0,scale:"x",stroke:ho,space:50,gap:5,size:50,labelGap:0,labelSize:30,labelFont:ja,side:2,grid:Da,ticks:Ia,border:$a,font:Fa,lineGap:1.5,rotate:0},Ha={show:!0,scale:"x",auto:!1,sorted:1,min:vi,max:-vi,idxs:[]};function Ua(e,t,n,r,o){return t.map((e=>null==e?"":ni(e)))}function Ba(e,t,n,r,o,i,a){let l=[],s=Ni.get(o)||0;for(let c=n=a?n:Ti(Ei(n,o),s);c<=r;c=Ti(c+o,s))l.push(Object.is(c,-0)?0:c);return l}function Wa(e,t,n,r,o,i,a){const l=[],s=e.scales[e.axes[t].scale].log,c=ai((10==s?fi:pi)(n));o=di(s,c),10==s&&c<0&&(o=Ti(o,-c));let u=n;do{l.push(u),u+=o,10==s&&(u=Ti(u,Ni.get(o))),u>=o*s&&(o=u)}while(u<=r);return l}function Ya(e,t,n,r,o,i,a){let l=e.scales[e.axes[t].scale].asinh,s=r>l?Wa(e,t,ui(l,n),r,o):[l],c=r>=0&&n<=0?[0]:[];return(n<-l?Wa(e,t,ui(l,-r),-n,o):[l]).reverse().map((e=>-e)).concat(c,s)}const Za=/./,qa=/[12357]/,Ka=/[125]/,Ga=/1/,Qa=(e,t,n,r)=>e.map(((e,o)=>4==t&&0==e||o%r==0&&n.test(e.toExponential()[e<0?1:0])?e:null));function Ja(e,t,n,r,o){let i=e.axes[n],a=i.scale,l=e.scales[a],s=e.valToPos,c=i._space,u=s(10,a),d=s(9,a)-u>=c?Za:s(7,a)-u>=c?qa:s(5,a)-u>=c?Ka:Ga;if(d==Ga){let e=ii(s(1,a)-u);if(eo,ol={show:!0,auto:!0,sorted:0,gaps:rl,alpha:1,facets:[Ui({},nl,{scale:"x"}),Ui({},nl,{scale:"y"})]},il={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:rl,alpha:1,points:{show:function(e,t){let{scale:n,idxs:r}=e.series[0],o=e._data[0],i=e.valToPos(o[r[0]],n,!0),a=e.valToPos(o[r[1]],n,!0),l=ii(a-i)/(e.series[t].points.space*Eo);return r[1]-r[0]<=l},filter:null},values:null,min:vi,max:-vi,idxs:[],path:null,clip:null};function al(e,t,n,r,o){return n/10}const ll={time:!0,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},sl=Ui({},ll,{time:!1,ori:1}),cl={};function ul(e,t){let n=cl[e];return n||(n={key:e,plots:[],sub(e){n.plots.push(e)},unsub(e){n.plots=n.plots.filter((t=>t!=e))},pub(e,t,r,o,i,a,l){for(let s=0;s{let m=e.pxRound;const v=l.dir*(0==l.ori?1:-1),g=0==l.ori?kl:xl;let y,_;1==v?(y=n,_=r):(y=r,_=n);let b=m(c(t[y],l,f,d)),w=m(u(a[y],s,p,h)),k=m(c(t[_],l,f,d)),x=m(u(1==i?s.max:s.min,s,p,h)),S=new Path2D(o);return g(S,k,x),g(S,b,x),g(S,b,w),S}))}function vl(e,t,n,r,o,i){let a=null;if(e.length>0){a=new Path2D;const l=0==t?Sl:Al;let s=n;for(let t=0;tn[0]){let e=n[0]-s;e>0&&l(a,s,r,e,r+i),s=n[1]}}let c=n+o-s,u=10;c>0&&l(a,s,r-u/2,c,r+i+u)}return a}function gl(e,t,n,r,o,i,a){let l=[],s=e.length;for(let c=1==o?n:r;c>=n&&c<=r;c+=o){if(null===t[c]){let u=c,d=c;if(1==o)for(;++c<=r&&null===t[c];)d=c;else for(;--c>=n&&null===t[c];)d=c;let h=i(e[u]),f=d==u?h:i(e[d]),p=u-o;h=a<=0&&p>=0&&p=0&&m>=0&&m=h&&l.push([h,f])}}return l}function yl(e){return 0==e?bi:1==e?li:t=>Ci(t,e)}function _l(e){let t=0==e?bl:wl,n=0==e?(e,t,n,r,o,i)=>{e.arcTo(t,n,r,o,i)}:(e,t,n,r,o,i)=>{e.arcTo(n,t,o,r,i)},r=0==e?(e,t,n,r,o)=>{e.rect(t,n,r,o)}:(e,t,n,r,o)=>{e.rect(n,t,o,r)};return function(e,o,i,a,l){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;0==s&&0==c?r(e,o,i,a,l):(s=ci(s,a/2,l/2),c=ci(c,a/2,l/2),t(e,o+s,i),n(e,o+a,i,o+a,i+l,s),n(e,o+a,i+l,o,i+l,c),n(e,o,i+l,o,i,c),n(e,o,i,o+a,i,s),e.closePath())}}const bl=(e,t,n)=>{e.moveTo(t,n)},wl=(e,t,n)=>{e.moveTo(n,t)},kl=(e,t,n)=>{e.lineTo(t,n)},xl=(e,t,n)=>{e.lineTo(n,t)},Sl=_l(0),Al=_l(1),Cl=(e,t,n,r,o,i)=>{e.arc(t,n,r,o,i)},El=(e,t,n,r,o,i)=>{e.arc(n,t,r,o,i)},Ml=(e,t,n,r,o,i,a)=>{e.bezierCurveTo(t,n,r,o,i,a)},Tl=(e,t,n,r,o,i,a)=>{e.bezierCurveTo(n,t,o,r,a,i)};function Nl(e){return(e,t,n,r,o)=>hl(e,t,((t,i,a,l,s,c,u,d,h,f,p)=>{let m,v,{pxRound:g,points:y}=t;0==l.ori?(m=bl,v=Cl):(m=wl,v=El);const _=Ti(y.width*Eo,3);let b=(y.size-y.width)/2*Eo,w=Ti(2*b,3),k=new Path2D,x=new Path2D,{left:S,top:A,width:C,height:E}=e.bbox;Sl(x,S-w,A-w,C+2*w,E+2*w);const M=e=>{if(null!=a[e]){let t=g(c(i[e],l,f,d)),n=g(u(a[e],s,p,h));m(k,t+b,n),v(k,t,n,b,0,2*oi)}};if(o)o.forEach(M);else for(let e=n;e<=r;e++)M(e);return{stroke:_>0?k:null,fill:k,clip:x,flags:2|dl}}))}function Ol(e){return(t,n,r,o,i,a)=>{r!=o&&(i!=r&&a!=r&&e(t,n,r),i!=o&&a!=o&&e(t,n,o),e(t,n,a))}}const Pl=Ol(kl),Ll=Ol(xl);function Rl(e){const t=Xo(null===e||void 0===e?void 0:e.alignGaps,0);return(e,n,r,o)=>hl(e,n,((i,a,l,s,c,u,d,h,f,p,m)=>{let v,g,y=i.pxRound,_=e=>y(u(e,s,p,h)),b=e=>y(d(e,c,m,f));0==s.ori?(v=kl,g=Pl):(v=xl,g=Ll);const w=s.dir*(0==s.ori?1:-1),k={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:dl},x=k.stroke;let S,A,C,E=vi,M=-vi,T=_(a[1==w?r:o]),N=Wo(l,r,o,1*w),O=Wo(l,r,o,-1*w),P=_(a[N]),L=_(a[O]),R=!1;for(let e=1==w?r:o;e>=r&&e<=o;e+=w){let t=_(a[e]),n=l[e];t==T?null!=n?(A=b(n),E==vi&&(v(x,t,A),S=A),E=ci(A,E),M=ui(A,M)):null===n&&(R=!0):(E!=vi&&(g(x,T,E,M,S,A),C=T),null!=n?(A=b(n),v(x,t,A),E=M=S=A):(E=vi,M=-vi,null===n&&(R=!0)),T=t)}E!=vi&&E!=M&&C!=T&&g(x,T,E,M,S,A);let[z,D]=fl(e,n);if(null!=i.fill||0!=z){let t=k.fill=new Path2D(x),r=b(i.fillTo(e,n,i.min,i.max,z));v(t,L,r),v(t,P,r)}if(!i.spanGaps){let c=[];R&&c.push(...gl(a,l,r,o,w,_,t)),k.gaps=c=i.gaps(e,n,r,o,c),k.clip=vl(c,s.ori,h,f,p,m)}return 0!=D&&(k.band=2==D?[ml(e,n,r,o,x,-1),ml(e,n,r,o,x,1)]:ml(e,n,r,o,x,D)),k}))}function zl(e,t,n,r,o,i){let a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:vi;if(e.length>1){let l=null;for(let s=0,c=1/0;s0!==r[e]>0?n[e]=0:(n[e]=3*(s[e-1]+s[e])/((2*s[e]+s[e-1])/r[e-1]+(s[e]+2*s[e-1])/r[e]),isFinite(n[e])||(n[e]=0));n[a-1]=r[a-2];for(let c=0;c{Xl.pxRatio=Eo})));const Fl=Rl(),jl=Nl();function Vl(e,t,n,r){return(r?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map(((e,r)=>Hl(e,r,t,n)))}function Hl(e,t,n,r){return Ui({},0==t?n:r,e)}function Ul(e,t,n){return null==t?zi:[t,n]}const Bl=Ul;function Wl(e,t,n){return null==t?zi:Jo(t,n,qo,!0)}function Yl(e,t,n,r){return null==t?zi:Yo(t,n,e.scales[r].log,!1)}const Zl=Yl;function ql(e,t,n,r){return null==t?zi:Zo(t,n,e.scales[r].log,!1)}const Kl=ql;function Gl(e,t,n,r,o){let i=ui(gi(e),gi(t)),a=t-e,l=Bo(o/r*a,n);do{let e=n[l],t=r*e/a;if(t>=o&&i+(e<5?Ni.get(e):0)<=17)return[e,t]}while(++l(t=li((n=+r)*Eo))+"px")),t,n]}function Jl(e){e.show&&[e.font,e.labelFont].forEach((e=>{let t=Ti(e[2]*Eo,1);e[0]=e[0].replace(/[0-9.]+px/,t+"px"),e[1]=t}))}function Xl(e,t,n){const r={mode:Xo(e.mode,1)},o=r.mode;function i(e,t){return((3==t.distr?fi(e>0?e:t.clamp(r,e,t.min,t.max,t.key)):4==t.distr?mi(e,t.asinh):e)-t._min)/(t._max-t._min)}function a(e,t,n,r){let o=i(e,t);return r+n*(-1==t.dir?1-o:o)}function l(e,t,n,r){let o=i(e,t);return r+n*(-1==t.dir?o:1-o)}function s(e,t,n,r){return 0==t.ori?a(e,t,n,r):l(e,t,n,r)}r.valToPosH=a,r.valToPosV=l;let c=!1;r.status=0;const u=r.root=Lo("uplot");if(null!=e.id&&(u.id=e.id),To(u,e.class),e.title){Lo("u-title",u).textContent=e.title}const d=Po("canvas"),h=r.ctx=d.getContext("2d"),f=Lo("u-wrap",u);Ho("click",f,(e=>{if(e.target===m){(Tt!=At||Nt!=Ct)&&Ft.click(r,e)}}),!0);const p=r.under=Lo("u-under",f);f.appendChild(d);const m=r.over=Lo("u-over",f),v=+Xo((e=Hi(e)).pxAlign,1),g=yl(v);(e.plugins||[]).forEach((t=>{t.opts&&(e=t.opts(r,e)||e)}));const y=e.ms||.001,_=r.series=1==o?Vl(e.series||[],Ha,il,!1):(b=e.series||[null],w=ol,b.map(((e,t)=>0==t?null:Ui({},w,e))));var b,w;const k=r.axes=Vl(e.axes||[],Va,tl,!0),x=r.scales={},S=r.bands=e.bands||[];S.forEach((e=>{e.fill=_i(e.fill||null),e.dir=Xo(e.dir,-1)}));const A=2==o?_[1].facets[0].scale:_[0].scale,C={axes:function(){for(let e=0;ett[e])):y,b=2==f.distr?tt[y[1]]-tt[y[0]]:u,w=t.ticks,S=t.border,A=w.show?li(w.size*Eo):0,C=t._rotate*-oi/180,E=g(t._pos*Eo),M=E+(A+v)*c;o=0==a?M:0,n=1==a?M:0,at(t.font[0],l,1==t.align?co:2==t.align?uo:C>0?co:C<0?uo:0==a?"center":3==i?uo:co,C||1==a?"middle":2==i?lo:so);let T=t.font[1]*t.lineGap,N=y.map((e=>g(s(e,f,p,m)))),O=t._values;for(let e=0;e0&&(_.forEach(((e,n)=>{if(n>0&&e.show&&(ct(n,!1),ct(n,!0),null==e._paths)){et!=e.alpha&&(h.globalAlpha=et=e.alpha);let i=2==o?[0,t[n][0].length-1]:function(e){let t=yi(He-1,0,Ve-1),n=yi(Ue+1,0,Ve-1);for(;null==e[t]&&t>0;)t--;for(;null==e[n]&&n{if(t>0&&e.show){et!=e.alpha&&(h.globalAlpha=et=e.alpha),null!=e._paths&&ut(t,!1);{let n=null!=e._paths?e._paths.gaps:null,o=e.points.show(r,t,He,Ue,n),i=e.points.filter(r,t,o,n);(o||i)&&(e.points._paths=e.points.paths(r,t,He,Ue,i),ut(t,!0))}1!=et&&(h.globalAlpha=et=1),kn("drawSeries",t)}})))}},E=(e.drawOrder||["axes","series"]).map((e=>C[e]));function M(t){let n=x[t];if(null==n){let r=(e.scales||Li)[t]||Li;if(null!=r.from)M(r.from),x[t]=Ui({},x[r.from],r,{key:t});else{n=x[t]=Ui({},t==A?ll:sl,r),n.key=t;let e=n.time,i=n.range,a=Di(i);if((t!=A||2==o&&!e)&&(!a||null!=i[0]&&null!=i[1]||(i={min:null==i[0]?Ko:{mode:1,hard:i[0],soft:i[0]},max:null==i[1]?Ko:{mode:1,hard:i[1],soft:i[1]}},a=!1),!a&&Fi(i))){let e=i;i=(t,n,r)=>null==n?zi:Jo(n,r,e)}n.range=_i(i||(e?Bl:t==A?3==n.distr?Zl:4==n.distr?Kl:Ul:3==n.distr?Yl:4==n.distr?ql:Wl)),n.auto=_i(!a&&n.auto),n.clamp=_i(n.clamp||al),n._min=n._max=null}}}M("x"),M("y"),1==o&&_.forEach((e=>{M(e.scale)})),k.forEach((e=>{M(e.scale)}));for(let Tn in e.scales)M(Tn);const T=x[A],N=T.distr;let O,P;0==T.ori?(To(u,"u-hz"),O=a,P=l):(To(u,"u-vt"),O=l,P=a);const L={};for(let Tn in x){let e=x[Tn];null==e.min&&null==e.max||(L[Tn]={min:e.min,max:e.max},e.min=e.max=null)}const R=e.tzDate||(e=>new Date(li(e/y))),z=e.fmtDate||ea,D=1==y?wa(R):Sa(R),I=Ca(R,Aa(1==y?ba:xa,z)),$=Ta(R,Ma("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",z)),F=[],j=r.legend=Ui({},Na,e.legend),V=j.show,H=j.markers;let U,B,W;j.idxs=F,H.width=_i(H.width),H.dash=_i(H.dash),H.stroke=_i(H.stroke),H.fill=_i(H.fill);let Y,Z=[],q=[],K=!1,G={};if(j.live){const e=_[1]?_[1].values:null;K=null!=e,Y=K?e(r,1,0):{_:0};for(let t in Y)G[t]=ko}if(V)if(U=Po("table","u-legend",u),W=Po("tbody",null,U),j.mount(r,U),K){B=Po("thead",null,U,W);let e=Po("tr",null,B);for(var Q in Po("th",null,e),Y)Po("th",oo,e).textContent=Q}else To(U,"u-inline"),j.live&&To(U,"u-live");const J={show:!0},X={show:!1};const ee=new Map;function te(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const i=ee.get(t)||{},a=Ce.bind[e](r,t,n,o);a&&(Ho(e,t,i[e]=a),ee.set(t,i))}function ne(e,t,n){const r=ee.get(t)||{};for(let o in r)null!=e&&o!=e||(Uo(o,t,r[o]),delete r[o]);null==e&&ee.delete(t)}let re=0,oe=0,ie=0,ae=0,le=0,se=0,ce=le,ue=se,de=ie,he=ae,fe=0,pe=0,me=0,ve=0;r.bbox={};let ge=!1,ye=!1,_e=!1,be=!1,we=!1,ke=!1;function xe(e,t,n){(n||e!=r.width||t!=r.height)&&Se(e,t),yt(!1),_e=!0,ye=!0,zt()}function Se(e,t){r.width=re=ie=e,r.height=oe=ae=t,le=se=0,function(){let e=!1,t=!1,n=!1,r=!1;k.forEach(((o,i)=>{if(o.show&&o._show){let{side:i,_size:a}=o,l=i%2,s=a+(null!=o.label?o.labelSize:0);s>0&&(l?(ie-=s,3==i?(le+=s,r=!0):n=!0):(ae-=s,0==i?(se+=s,e=!0):t=!0))}})),Ie[0]=e,Ie[1]=n,Ie[2]=t,Ie[3]=r,ie-=je[1]+je[3],le+=je[3],ae-=je[2]+je[0],se+=je[0]}(),function(){let e=le+ie,t=se+ae,n=le,r=se;function o(o,i){switch(o){case 1:return e+=i,e-i;case 2:return t+=i,t-i;case 3:return n-=i,n+i;case 0:return r-=i,r+i}}k.forEach(((e,t)=>{if(e.show&&e._show){let t=e.side;e._pos=o(t,e._size),null!=e.label&&(e._lpos=o(t,e.labelSize))}}))}();let n=r.bbox;fe=n.left=Ci(le*Eo,.5),pe=n.top=Ci(se*Eo,.5),me=n.width=Ci(ie*Eo,.5),ve=n.height=Ci(ae*Eo,.5)}const Ae=3;r.setSize=function(e){let{width:t,height:n}=e;xe(t,n)};const Ce=r.cursor=Ui({},Ra,{drag:{y:2==o}},e.cursor);if(null==Ce.dataIdx){var Ee,Me;let e=Ce.hover,n=e.skip=new Set(null!==(Ee=e.skip)&&void 0!==Ee?Ee:[]);n.add(void 0);let r=e.prox=_i(e.prox),o=null!==(Me=e.bias)&&void 0!==Me?Me:e.bias=0;Ce.dataIdx=(e,i,a,l)=>{var s;if(0==i)return a;let c=a,u=null!==(s=r(e,i,a,l))&&void 0!==s?s:vi,d=u>=0&&u0;)n.has(m[e])||(t=e);if(0==o||1==o)for(e=a;null==r&&e++u&&(c=null)}return c}}const Te=e=>{Ce.event=e};Ce.idxs=F,Ce._lock=!1;let Ne=Ce.points;Ne.show=_i(Ne.show),Ne.size=_i(Ne.size),Ne.stroke=_i(Ne.stroke),Ne.width=_i(Ne.width),Ne.fill=_i(Ne.fill);const Oe=r.focus=Ui({},e.focus||{alpha:.3},Ce.focus),Pe=Oe.prox>=0;let Le=[null],Re=[null],ze=[null];function De(e,t){if(1==o||t>0){let t=1==o&&x[e.scale].time,n=e.value;e.value=t?$i(n)?Ta(R,Ma(n,z)):n||$:n||el,e.label=e.label||(t?"Time":"Value")}if(t>0){e.width=null==e.width?1:e.width,e.paths=e.paths||Fl||ki,e.fillTo=_i(e.fillTo||pl),e.pxAlign=+Xo(e.pxAlign,v),e.pxRound=yl(e.pxAlign),e.stroke=_i(e.stroke||null),e.fill=_i(e.fill||null),e._stroke=e._fill=e._paths=e._focus=null;let t=Ti((3+2*(ui(1,e.width)||1))*1,3),n=e.points=Ui({},{size:t,width:ui(1,.2*t),stroke:e.stroke,space:2*t,paths:jl,_stroke:null,_fill:null},e.points);n.show=_i(n.show),n.filter=_i(n.filter),n.fill=_i(n.fill),n.stroke=_i(n.stroke),n.paths=_i(n.paths),n.pxAlign=e.pxAlign}if(V){let n=function(e,t){if(0==t&&(K||!j.live||2==o))return zi;let n=[],i=Po("tr","u-series",W,W.childNodes[t]);To(i,e.class),e.show||To(i,ro);let a=Po("th",null,i);if(H.show){let e=Lo("u-marker",a);if(t>0){let n=H.width(r,t);n&&(e.style.border=n+"px "+H.dash(r,t)+" "+H.stroke(r,t)),e.style.background=H.fill(r,t)}}let l=Lo(oo,a);for(var s in l.textContent=e.label,t>0&&(H.show||(l.style.color=e.width>0?H.stroke(r,t):H.fill(r,t)),te("click",a,(t=>{if(Ce._lock)return;Te(t);let n=_.indexOf(e);if((t.ctrlKey||t.metaKey)!=j.isolate){let e=_.some(((e,t)=>t>0&&t!=n&&e.show));_.forEach(((t,r)=>{r>0&&Yt(r,e?r==n?J:X:J,!0,Sn.setSeries)}))}else Yt(n,{show:!e.show},!0,Sn.setSeries)}),!1),Pe&&te(go,a,(t=>{Ce._lock||(Te(t),Yt(_.indexOf(e),Gt,!0,Sn.setSeries))}),!1)),Y){let e=Po("td","u-value",i);e.textContent="--",n.push(e)}return[i,n]}(e,t);Z.splice(t,0,n[0]),q.splice(t,0,n[1]),j.values.push(null)}if(Ce.show){F.splice(t,0,null);let n=function(e,t){if(t>0){let n=Ce.points.show(r,t);if(n)return To(n,"u-cursor-pt"),To(n,e.class),zo(n,-10,-10,ie,ae),m.insertBefore(n,Le[t]),n}}(e,t);null!=n&&(Le.splice(t,0,n),Re.splice(t,0,0),ze.splice(t,0,0))}kn("addSeries",t)}r.addSeries=function(e,t){t=null==t?_.length:t,e=1==o?Hl(e,t,Ha,il):Hl(e,t,null,ol),_.splice(t,0,e),De(_[t],t)},r.delSeries=function(e){if(_.splice(e,1),V){j.values.splice(e,1),q.splice(e,1);let t=Z.splice(e,1)[0];ne(null,t.firstChild),t.remove()}Ce.show&&(F.splice(e,1),Le.length>1&&(Le.splice(e,1)[0].remove(),Re.splice(e,1),ze.splice(e,1))),kn("delSeries",e)};const Ie=[!1,!1,!1,!1];function $e(e,t,n,r){let[o,i,a,l]=n,s=t%2,c=0;return 0==s&&(l||i)&&(c=0==t&&!o||2==t&&!a?li(Va.size/3):0),1==s&&(o||a)&&(c=1==t&&!i||3==t&&!l?li(tl.size/2):0),c}const Fe=r.padding=(e.padding||[$e,$e,$e,$e]).map((e=>_i(Xo(e,$e)))),je=r._padding=Fe.map(((e,t)=>e(r,t,Ie,0)));let Ve,He=null,Ue=null;const Be=1==o?_[0].idxs:null;let We,Ye,Ze,qe,Ke,Ge,Qe,Je,Xe,et,tt=null,nt=!1;function rt(e,n){if(t=null==e?[]:e,r.data=r._data=t,2==o){Ve=0;for(let e=1;e<_.length;e++)Ve+=t[e][0].length}else{0==t.length&&(r.data=r._data=t=[[]]),tt=t[0],Ve=tt.length;let e=t;if(2==N){e=t.slice();let n=e[0]=Array(Ve);for(let e=0;e=0,ke=!0,zt()}}function ot(){let e,n;nt=!0,1==o&&(Ve>0?(He=Be[0]=0,Ue=Be[1]=Ve-1,e=t[0][He],n=t[0][Ue],2==N?(e=He,n=Ue):e==n&&(3==N?[e,n]=Yo(e,e,T.log,!1):4==N?[e,n]=Zo(e,e,T.log,!1):T.time?n=e+li(86400/y):[e,n]=Jo(e,n,qo,!0))):(He=Be[0]=e=null,Ue=Be[1]=n=null)),Wt(A,e,n)}function it(e,t,n,r,o,i){var a,l,s,c,u;null!==(a=e)&&void 0!==a||(e=fo),null!==(l=n)&&void 0!==l||(n=Ri),null!==(s=r)&&void 0!==s||(r="butt"),null!==(c=o)&&void 0!==c||(o=fo),null!==(u=i)&&void 0!==u||(i="round"),e!=We&&(h.strokeStyle=We=e),o!=Ye&&(h.fillStyle=Ye=o),t!=Ze&&(h.lineWidth=Ze=t),i!=Ke&&(h.lineJoin=Ke=i),r!=Ge&&(h.lineCap=Ge=r),n!=qe&&h.setLineDash(qe=n)}function at(e,t,n,r){t!=Ye&&(h.fillStyle=Ye=t),e!=Qe&&(h.font=Qe=e),n!=Je&&(h.textAlign=Je=n),r!=Xe&&(h.textBaseline=Xe=r)}function lt(e,t,n,o){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(o.length>0&&e.auto(r,nt)&&(null==t||null==t.min)){let t=Xo(He,0),r=Xo(Ue,o.length-1),a=null==n.min?3==e.distr?function(e,t,n){let r=vi,o=-vi;for(let i=t;i<=n;i++){let t=e[i];null!=t&&t>0&&(to&&(o=t))}return[r,o]}(o,t,r):function(e,t,n,r){let o=vi,i=-vi;if(1==r)o=e[t],i=e[n];else if(-1==r)o=e[n],i=e[t];else for(let a=t;a<=n;a++){let t=e[a];null!=t&&(ti&&(i=t))}return[o,i]}(o,t,r,i):[n.min,n.max];e.min=ci(e.min,n.min=a[0]),e.max=ui(e.max,n.max=a[1])}}r.setData=rt;const st={min:null,max:null};function ct(e,t){let n=t?_[e].points:_[e];n._stroke=n.stroke(r,e),n._fill=n.fill(r,e)}function ut(e,n){let o=n?_[e].points:_[e],{stroke:i,fill:a,clip:l,flags:s,_stroke:c=o._stroke,_fill:u=o._fill,_width:d=o.width}=o._paths;d=Ti(d*Eo,3);let f=null,p=d%2/2;n&&null==u&&(u=d>0?"#fff":c);let m=1==o.pxAlign&&p>0;if(m&&h.translate(p,p),!n){let e=fe-d/2,t=pe-d/2,n=me+d,r=ve+d;f=new Path2D,f.rect(e,t,n,r)}n?ht(c,d,o.dash,o.cap,u,i,a,s,l):function(e,n,o,i,a,l,s,c,u,d,h){let f=!1;0!=u&&S.forEach(((p,m)=>{if(p.series[0]==e){let e,v=_[p.series[1]],g=t[p.series[1]],y=(v._paths||Li).band;Di(y)&&(y=1==p.dir?y[0]:y[1]);let b=null;v.show&&y&&function(e,t,n){for(t=Xo(t,0),n=Xo(n,e.length-1);t<=n;){if(null!=e[t])return!0;t++}return!1}(g,He,Ue)?(b=p.fill(r,m)||l,e=v._paths.clip):y=null,ht(n,o,i,a,b,s,c,u,d,h,e,y),f=!0}})),f||ht(n,o,i,a,l,s,c,u,d,h)}(e,c,d,o.dash,o.cap,u,i,a,s,f,l),m&&h.translate(-p,-p)}const dt=2|dl;function ht(e,t,n,r,o,i,a,l,s,c,u,d){it(e,t,n,r,o),(s||c||d)&&(h.save(),s&&h.clip(s),c&&h.clip(c)),d?(l&dt)==dt?(h.clip(d),u&&h.clip(u),pt(o,a),ft(e,i,t)):2&l?(pt(o,a),h.clip(d),ft(e,i,t)):l&dl&&(h.save(),h.clip(d),u&&h.clip(u),pt(o,a),h.restore(),ft(e,i,t)):(pt(o,a),ft(e,i,t)),(s||c||d)&&h.restore()}function ft(e,t,n){n>0&&(t instanceof Map?t.forEach(((e,t)=>{h.strokeStyle=We=t,h.stroke(e)})):null!=t&&e&&h.stroke(t))}function pt(e,t){t instanceof Map?t.forEach(((e,t)=>{h.fillStyle=Ye=t,h.fill(e)})):null!=t&&e&&h.fill(t)}function mt(e,t,n,r,o,i,a,l,s,c){let u=a%2/2;1==v&&h.translate(u,u),it(l,a,s,c,l),h.beginPath();let d,f,p,m,g=o+(0==r||3==r?-i:i);0==n?(f=o,m=g):(d=o,p=g);for(let v=0;v{if(!n.show)return;let i=x[n.scale];if(null==i.min)return void(n._show&&(t=!1,n._show=!1,yt(!1)));n._show||(t=!1,n._show=!0,yt(!1));let a=n.side,l=a%2,{min:s,max:c}=i,[u,d]=function(e,t,n,o){let i,a=k[e];if(o<=0)i=[0,0];else{let l=a._space=a.space(r,e,t,n,o);i=Gl(t,n,a._incrs=a.incrs(r,e,t,n,o,l),o,l)}return a._found=i}(o,s,c,0==l?ie:ae);if(0==d)return;let h=2==i.distr,f=n._splits=n.splits(r,o,s,c,u,d,h),p=2==i.distr?f.map((e=>tt[e])):f,m=2==i.distr?tt[f[1]]-tt[f[0]]:u,v=n._values=n.values(r,n.filter(r,p,o,d,m),o,d,m);n._rotate=2==a?n.rotate(r,v,o,d):0;let g=n._size;n._size=si(n.size(r,v,o,e)),null!=g&&n._size!=g&&(t=!1)})),t}function gt(e){let t=!0;return Fe.forEach(((n,o)=>{let i=n(r,o,Ie,e);i!=je[o]&&(t=!1),je[o]=i})),t}function yt(e){_.forEach(((t,n)=>{n>0&&(t._paths=null,e&&(1==o?(t.min=null,t.max=null):t.facets.forEach((e=>{e.min=null,e.max=null}))))}))}let _t,bt,wt,kt,xt,St,At,Ct,Et,Mt,Tt,Nt,Ot=!1,Pt=!1,Lt=[];function Rt(){Pt=!1;for(let e=0;e0){_.forEach(((n,i)=>{if(1==o){let o=n.scale,a=L[o];if(null==a)return;let l=e[o];if(0==i){let e=l.range(r,l.min,l.max,o);l.min=e[0],l.max=e[1],He=Bo(l.min,t[0]),Ue=Bo(l.max,t[0]),Ue-He>1&&(t[0][He]l.max&&Ue--),n.min=tt[He],n.max=tt[Ue]}else n.show&&n.auto&<(l,a,n,t[i],n.sorted);n.idxs[0]=He,n.idxs[1]=Ue}else if(i>0&&n.show&&n.auto){let[r,o]=n.facets,a=r.scale,l=o.scale,[s,c]=t[i],u=e[a],d=e[l];null!=u&<(u,L[a],r,s,r.sorted),null!=d&<(d,L[l],o,c,o.sorted),n.min=o.min,n.max=o.max}}));for(let t in e){let n=e[t],o=L[t];if(null==n.from&&(null==o||null==o.min)){let e=n.range(r,n.min==vi?null:n.min,n.max==-vi?null:n.max,t);n.min=e[0],n.max=e[1]}}}for(let t in e){let n=e[t];if(null!=n.from){let o=e[n.from];if(null==o.min)n.min=n.max=null;else{let e=n.range(r,o.min,o.max,t);n.min=e[0],n.max=e[1]}}}let n={},i=!1;for(let t in e){let r=e[t],o=x[t];if(o.min!=r.min||o.max!=r.max){o.min=r.min,o.max=r.max;let e=o.distr;o._min=3==e?fi(o.min):4==e?mi(o.min,o.asinh):o.min,o._max=3==e?fi(o.max):4==e?mi(o.max,o.asinh):o.max,n[t]=i=!0}}if(i){_.forEach(((e,t)=>{2==o?t>0&&n.y&&(e._paths=null):n[e.scale]&&(e._paths=null)}));for(let e in n)_e=!0,kn("setScale",e);Ce.show&&Ce.left>=0&&(be=ke=!0)}for(let t in L)L[t]=null}(),ge=!1),_e&&(!function(){let e=!1,t=0;for(;!e;){t++;let n=vt(t),o=gt(t);e=t==Ae||n&&o,e||(Se(r.width,r.height),ye=!0)}}(),_e=!1),ye){if(Oo(p,co,le),Oo(p,lo,se),Oo(p,io,ie),Oo(p,ao,ae),Oo(m,co,le),Oo(m,lo,se),Oo(m,io,ie),Oo(m,ao,ae),Oo(f,io,re),Oo(f,ao,oe),d.width=li(re*Eo),d.height=li(oe*Eo),k.forEach((e=>{let{_el:t,_show:n,_size:r,_pos:o,side:i}=e;if(null!=t)if(n){let e=i%2==1;Oo(t,e?"left":"top",o-(3===i||0===i?r:0)),Oo(t,e?"width":"height",r),Oo(t,e?"top":"left",e?se:le),Oo(t,e?"height":"width",e?ae:ie),No(t,ro)}else To(t,ro)})),We=Ye=Ze=Ke=Ge=Qe=Je=Xe=qe=null,et=1,ln(!0),le!=ce||se!=ue||ie!=de||ae!=he){yt(!1);let e=ie/de,t=ae/he;if(Ce.show&&!be&&Ce.left>=0){Ce.left*=e,Ce.top*=t,wt&&zo(wt,li(Ce.left),0,ie,ae),kt&&zo(kt,0,li(Ce.top),ie,ae);for(let n=1;n=0&&Ht.width>0){Ht.left*=e,Ht.width*=e,Ht.top*=t,Ht.height*=t;for(let e in un)Oo(Ut,e,Ht[e])}ce=le,ue=se,de=ie,he=ae}kn("setSize"),ye=!1}re>0&&oe>0&&(h.clearRect(0,0,d.width,d.height),kn("drawClear"),E.forEach((e=>e())),kn("draw")),Ht.show&&we&&(Bt(Ht),we=!1),Ce.show&&be&&(on(null,!0,!1),be=!1),j.show&&j.live&&ke&&(nn(),ke=!1),c||(c=!0,r.status=1,kn("ready")),nt=!1,Ot=!1}function It(e,n){let o=x[e];if(null==o.from){if(0==Ve){let t=o.range(r,n.min,n.max,e);n.min=t[0],n.max=t[1]}if(n.min>n.max){let e=n.min;n.min=n.max,n.max=e}if(Ve>1&&null!=n.min&&null!=n.max&&n.max-n.min<1e-16)return;e==A&&2==o.distr&&Ve>0&&(n.min=Bo(n.min,t[0]),n.max=Bo(n.max,t[0]),n.min==n.max&&n.max++),L[e]=n,ge=!0,zt()}}r.batch=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Ot=!0,Pt=t,e(r),Dt(),t&&Lt.length>0&&queueMicrotask(Rt)},r.redraw=(e,t)=>{_e=t||!1,!1!==e?Wt(A,T.min,T.max):zt()},r.setScale=It;let $t=!1;const Ft=Ce.drag;let jt=Ft.x,Vt=Ft.y;Ce.show&&(Ce.x&&(_t=Lo("u-cursor-x",m)),Ce.y&&(bt=Lo("u-cursor-y",m)),0==T.ori?(wt=_t,kt=bt):(wt=bt,kt=_t),Tt=Ce.left,Nt=Ce.top);const Ht=r.select=Ui({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),Ut=Ht.show?Lo("u-select",Ht.over?m:p):null;function Bt(e,t){if(Ht.show){for(let t in e)Ht[t]=e[t],t in un&&Oo(Ut,t,e[t]);!1!==t&&kn("setSelect")}}function Wt(e,t,n){It(e,{min:t,max:n})}function Yt(e,t,n,i){null!=t.focus&&function(e){if(e!=Kt){let t=null==e,n=1!=Oe.alpha;_.forEach(((r,i)=>{if(1==o||i>0){let o=t||0==i||i==e;r._focus=t?null:o,n&&function(e,t){_[e].alpha=t,Ce.show&&Le[e]&&(Le[e].style.opacity=t);V&&Z[e]&&(Z[e].style.opacity=t)}(i,o?1:Oe.alpha)}})),Kt=e,n&&zt()}}(e),null!=t.show&&_.forEach(((n,r)=>{r>0&&(e==r||null==e)&&(n.show=t.show,function(e,t){let n=_[e],r=V?Z[e]:null;n.show?r&&No(r,ro):(r&&To(r,ro),Le.length>1&&zo(Le[e],-10,-10,ie,ae))}(r,t.show),2==o?(Wt(n.facets[0].scale,null,null),Wt(n.facets[1].scale,null,null)):Wt(n.scale,null,null),zt())})),!1!==n&&kn("setSeries",e,t),i&&En("setSeries",r,e,t)}let Zt,qt,Kt;r.setSelect=Bt,r.setSeries=Yt,r.addBand=function(e,t){e.fill=_i(e.fill||null),e.dir=Xo(e.dir,-1),t=null==t?S.length:t,S.splice(t,0,e)},r.setBand=function(e,t){Ui(S[e],t)},r.delBand=function(e){null==e?S.length=0:S.splice(e,1)};const Gt={focus:!0};function Qt(e,t,n){let r=x[t];n&&(e=e/Eo-(1==r.ori?se:le));let o=ie;1==r.ori&&(o=ae,e=o-e),-1==r.dir&&(e=o-e);let i=r._min,a=i+(r._max-i)*(e/o),l=r.distr;return 3==l?di(10,a):4==l?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return ri.sinh(e)*t}(a,r.asinh):a}function Jt(e,t){Oo(Ut,co,Ht.left=e),Oo(Ut,io,Ht.width=t)}function Xt(e,t){Oo(Ut,lo,Ht.top=e),Oo(Ut,ao,Ht.height=t)}V&&Pe&&te(yo,U,(e=>{Ce._lock||(Te(e),null!=Kt&&Yt(null,Gt,!0,Sn.setSeries))})),r.valToIdx=e=>Bo(e,t[0]),r.posToIdx=function(e,n){return Bo(Qt(e,A,n),t[0],He,Ue)},r.posToVal=Qt,r.valToPos=(e,t,n)=>0==x[t].ori?a(e,x[t],n?me:ie,n?fe:0):l(e,x[t],n?ve:ae,n?pe:0),r.setCursor=(e,t,n)=>{Tt=e.left,Nt=e.top,on(null,t,n)};let en=0==T.ori?Jt:Xt,tn=1==T.ori?Jt:Xt;function nn(e,t){null!=e&&(e.idxs?e.idxs.forEach(((e,t)=>{F[t]=e})):void 0!==e.idx&&F.fill(e.idx),j.idx=F[0]);for(let n=0;n<_.length;n++)(n>0||1==o&&!K)&&rn(n,F[n]);V&&j.live&&function(){if(V&&j.live)for(let e=2==o?1:0;e<_.length;e++){if(0==e&&K)continue;let t=j.values[e],n=0;for(let r in t)q[e][n++].firstChild.nodeValue=t[r]}}(),ke=!1,!1!==t&&kn("setLegend")}function rn(e,n){var o;let i,a=_[e],l=0==e&&2==N?tt:t[e];K?i=null!==(o=a.values(r,e,n))&&void 0!==o?o:G:(i=a.value(r,null==n?null:l[n],e,n),i=null==i?G:{_:i}),j.values[e]=i}function on(e,n,i){let a;Et=Tt,Mt=Nt,[Tt,Nt]=Ce.move(r,Tt,Nt),Ce.left=Tt,Ce.top=Nt,Ce.show&&(wt&&zo(wt,li(Tt),0,ie,ae),kt&&zo(kt,0,li(Nt),ie,ae));let l=He>Ue;Zt=vi;let s=0==T.ori?ie:ae,c=1==T.ori?ie:ae;if(Tt<0||0==Ve||l){a=Ce.idx=null;for(let e=0;e<_.length;e++)e>0&&Le.length>1&&zo(Le[e],-10,-10,ie,ae);Pe&&Yt(null,Gt,!0,null==e&&Sn.setSeries),j.live&&(F.fill(a),ke=!0)}else{let e,n,i;1==o&&(e=0==T.ori?Tt:Nt,n=Qt(e,A),a=Ce.idx=Bo(n,t[0],He,Ue),i=O(t[0][a],T,s,0));for(let l=2==o?1:0;l<_.length;l++){let e=_[l],u=F[l],d=null==u?null:1==o?t[l][u]:t[l][1][u],h=Ce.dataIdx(r,l,a,n),f=null==h?null:1==o?t[l][h]:t[l][1][h];ke=ke||f!=d||h!=u,F[l]=h;let p=h==a?i:O(1==o?t[0][h]:t[l][0][h],T,s,0);if(l>0&&e.show){let t,n,i=null==f?-10:P(f,1==o?x[e.scale]:x[e.facets[1].scale],c,0);if(Pe&&null!=f){let t=1==T.ori?Tt:Nt,n=ii(Oe.dist(r,l,h,i,t));if(n=0?1:-1;i==(f>=0?1:-1)&&(1==i?1==r?f>=o:f<=o:1==r?f<=o:f>=o)&&(Zt=n,qt=l)}else Zt=n,qt=l}}if(0==T.ori?(t=p,n=i):(t=i,n=p),ke&&Le.length>1){Io(Le[l],Ce.points.fill(r,l),Ce.points.stroke(r,l));let e,o,i,a,s=!0,c=Ce.points.bbox;if(null!=c){s=!1;let t=c(r,l);i=t.left,a=t.top,e=t.width,o=t.height}else i=t,a=n,e=o=Ce.points.size(r,l);Fo(Le[l],e,o,s),Re[l]=i,ze[l]=a,zo(Le[l],Ei(i,1),Ei(a,1),ie,ae)}}}}if(Ht.show&&$t)if(null!=e){let[t,n]=Sn.scales,[r,o]=Sn.match,[i,a]=e.cursor.sync.scales,l=e.cursor.drag;if(jt=l._x,Vt=l._y,jt||Vt){let l,u,d,h,f,{left:p,top:m,width:v,height:g}=e.select,y=e.scales[t].ori,_=e.posToVal,b=null!=t&&r(t,i),w=null!=n&&o(n,a);b&&jt?(0==y?(l=p,u=v):(l=m,u=g),d=x[t],h=O(_(l,i),d,s,0),f=O(_(l+u,i),d,s,0),en(ci(h,f),ii(f-h))):en(0,s),w&&Vt?(1==y?(l=p,u=v):(l=m,u=g),d=x[n],h=P(_(l,a),d,c,0),f=P(_(l+u,a),d,c,0),tn(ci(h,f),ii(f-h))):tn(0,c)}else dn()}else{let e=ii(Et-xt),t=ii(Mt-St);if(1==T.ori){let n=e;e=t,t=n}jt=Ft.x&&e>=Ft.dist,Vt=Ft.y&&t>=Ft.dist;let n,r,o=Ft.uni;null!=o?jt&&Vt&&(jt=e>=o,Vt=t>=o,jt||Vt||(t>e?Vt=!0:jt=!0)):Ft.x&&Ft.y&&(jt||Vt)&&(jt=Vt=!0),jt&&(0==T.ori?(n=At,r=Tt):(n=Ct,r=Nt),en(ci(n,r),ii(r-n)),Vt||tn(0,c)),Vt&&(1==T.ori?(n=At,r=Tt):(n=Ct,r=Nt),tn(ci(n,r),ii(r-n)),jt||en(0,s)),jt||Vt||(en(0,0),tn(0,0))}if(Ft._x=jt,Ft._y=Vt,null==e){if(i){if(null!=An){let[e,t]=Sn.scales;Sn.values[0]=null!=e?Qt(0==T.ori?Tt:Nt,e):null,Sn.values[1]=null!=t?Qt(1==T.ori?Tt:Nt,t):null}En(po,r,Tt,Nt,ie,ae,a)}if(Pe){let e=i&&Sn.setSeries,t=Oe.prox;null==Kt?Zt<=t&&Yt(qt,Gt,!0,e):Zt>t?Yt(null,Gt,!0,e):qt!=Kt&&Yt(qt,Gt,!0,e)}}ke&&(j.idx=a,nn()),!1!==n&&kn("setCursor")}r.setLegend=nn;let an=null;function ln(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]?an=null:(an=m.getBoundingClientRect(),kn("syncRect",an))}function sn(e,t,n,r,o,i,a){Ce._lock||$t&&null!=e&&0==e.movementX&&0==e.movementY||(cn(e,t,n,r,o,i,a,!1,null!=e),null!=e?on(null,!0,!0):on(t,!0,!1))}function cn(e,t,n,o,i,a,l,c,u){if(null==an&&ln(!1),Te(e),null!=e)n=e.clientX-an.left,o=e.clientY-an.top;else{if(n<0||o<0)return Tt=-10,void(Nt=-10);let[e,r]=Sn.scales,l=t.cursor.sync,[c,u]=l.values,[d,h]=l.scales,[f,p]=Sn.match,m=t.axes[0].side%2==1,v=0==T.ori?ie:ae,g=1==T.ori?ie:ae,y=m?a:i,_=m?i:a,b=m?o:n,w=m?n:o;if(n=null!=d?f(e,d)?s(c,x[e],v,0):-10:v*(b/y),o=null!=h?p(r,h)?s(u,x[r],g,0):-10:g*(w/_),1==T.ori){let e=n;n=o,o=e}}u&&((n<=1||n>=ie-1)&&(n=Ci(n,ie)),(o<=1||o>=ae-1)&&(o=Ci(o,ae))),c?(xt=n,St=o,[At,Ct]=Ce.move(r,n,o)):(Tt=n,Nt=o)}Object.defineProperty(r,"rect",{get:()=>(null==an&&ln(!1),an)});const un={width:0,height:0,left:0,top:0};function dn(){Bt(un,!1)}let hn,fn,pn,mn;function vn(e,t,n,o,i,a,l){$t=!0,jt=Vt=Ft._x=Ft._y=!1,cn(e,t,n,o,i,a,0,!0,!1),null!=e&&(te(vo,So,gn,!1),En(mo,r,At,Ct,ie,ae,null));let{left:s,top:c,width:u,height:d}=Ht;hn=s,fn=c,pn=u,mn=d,dn()}function gn(e,t,n,o,i,a,l){$t=Ft._x=Ft._y=!1,cn(e,t,n,o,i,a,0,!1,!0);let{left:s,top:c,width:u,height:d}=Ht,h=u>0||d>0,f=hn!=s||fn!=c||pn!=u||mn!=d;if(h&&f&&Bt(Ht),Ft.setScale&&h&&f){let e=s,t=u,n=c,r=d;if(1==T.ori&&(e=c,t=d,n=s,r=u),jt&&Wt(A,Qt(e,A),Qt(e+t,A)),Vt)for(let o in x){let e=x[o];o!=A&&null==e.from&&e.min!=vi&&Wt(o,Qt(n+r,o),Qt(n,o))}dn()}else Ce.lock&&(Ce._lock=!Ce._lock,Ce._lock||on(null,!0,!1));null!=e&&(ne(vo,So),En(vo,r,Tt,Nt,ie,ae,null))}function yn(e,t,n,o,i,a,l){Ce._lock||(Te(e),ot(),dn(),null!=e&&En(_o,r,Tt,Nt,ie,ae,null))}function _n(){k.forEach(Jl),xe(r.width,r.height,!0)}Ho(wo,Ao,_n);const bn={};bn.mousedown=vn,bn.mousemove=sn,bn.mouseup=gn,bn.dblclick=yn,bn.setSeries=(e,t,n,o)=>{-1!=(n=(0,Sn.match[2])(r,t,n))&&Yt(n,o,!0,!1)},Ce.show&&(te(mo,m,vn),te(po,m,sn),te(go,m,(e=>{Te(e),ln(!1)})),te(yo,m,(function(e,t,n,r,o,i,a){if(Ce._lock)return;Te(e);let l=$t;if($t){let e,t,n=!0,r=!0,o=10;0==T.ori?(e=jt,t=Vt):(e=Vt,t=jt),e&&t&&(n=Tt<=o||Tt>=ie-o,r=Nt<=o||Nt>=ae-o),e&&n&&(Tt=Tt{e.call(null,r,t,n)}))}(e.plugins||[]).forEach((e=>{for(let t in e.hooks)wn[t]=(wn[t]||[]).concat(e.hooks[t])}));const xn=(e,t,n)=>n,Sn=Ui({key:null,setSeries:!1,filters:{pub:xi,sub:xi},scales:[A,_[1]?_[1].scale:null],match:[Si,Si,xn],values:[null,null]},Ce.sync);2==Sn.match.length&&Sn.match.push(xn),Ce.sync=Sn;const An=Sn.key,Cn=ul(An);function En(e,t,n,r,o,i,a){Sn.filters.pub(e,t,n,r,o,i,a)&&Cn.pub(e,t,n,r,o,i,a)}function Mn(){kn("init",e,t),rt(t||e.data,!1),L[A]?It(A,L[A]):ot(),we=Ht.show&&(Ht.width>0||Ht.height>0),be=ke=!0,xe(e.width,e.height)}return Cn.sub(r),r.pub=function(e,t,n,r,o,i,a){Sn.filters.sub(e,t,n,r,o,i,a)&&bn[e](null,t,n,r,o,i,a)},r.destroy=function(){var e;Cn.unsub(r),Il.delete(r),ee.clear(),Uo(wo,Ao,_n),u.remove(),null===(e=U)||void 0===e||e.remove(),kn("destroy")},_.forEach(De),k.forEach((function(e,t){if(e._show=e.show,e.show){let n=e.side%2,o=x[e.scale];null==o&&(e.scale=n?_[1].scale:A,o=x[e.scale]);let i=o.time;e.size=_i(e.size),e.space=_i(e.space),e.rotate=_i(e.rotate),Di(e.incrs)&&e.incrs.forEach((e=>{!Ni.has(e)&&Ni.set(e,Oi(e))})),e.incrs=_i(e.incrs||(2==o.distr?aa:i?1==y?_a:ka:la)),e.splits=_i(e.splits||(i&&1==o.distr?D:3==o.distr?Wa:4==o.distr?Ya:Ba)),e.stroke=_i(e.stroke),e.grid.stroke=_i(e.grid.stroke),e.ticks.stroke=_i(e.ticks.stroke),e.border.stroke=_i(e.border.stroke);let a=e.values;e.values=Di(a)&&!Di(a[0])?_i(a):i?Di(a)?Ca(R,Aa(a,z)):$i(a)?function(e,t){let n=ea(t);return(t,r,o,i,a)=>r.map((t=>n(e(t))))}(R,a):a||I:a||Ua,e.filter=_i(e.filter||(o.distr>=3&&10==o.log?Ja:3==o.distr&&2==o.log?Xa:wi)),e.font=Ql(e.font),e.labelFont=Ql(e.labelFont),e._size=e.size(r,null,t,0),e._space=e._rotate=e._incrs=e._found=e._splits=e._values=null,e._size>0&&(Ie[t]=!0,e._el=Lo("u-axis",f))}})),n?n instanceof HTMLElement?(n.appendChild(u),Mn()):n(r,Mn):Mn(),r}Xl.assign=Ui,Xl.fmtNum=ni,Xl.rangeNum=Jo,Xl.rangeLog=Yo,Xl.rangeAsinh=Zo,Xl.orient=hl,Xl.pxRatio=Eo,Xl.join=function(e,t){if(function(e){let t=e[0][0],n=t.length;for(let r=1;r1&&void 0!==arguments[1]?arguments[1]:100;const n=e.length;if(n<=1)return!0;let r=0,o=n-1;for(;r<=o&&null==e[r];)r++;for(;o>=r&&null==e[o];)o--;if(o<=r)return!0;const i=ui(1,ai((o-r+1)/t));for(let a=e[r],l=r+i;l<=o;l+=i){const t=e[l];if(null!=t){if(t<=a)return!1;a=t}}return!0}(t[0])||(t=function(e){let t=e[0],n=t.length,r=Array(n);for(let i=0;it[e]-t[n]));let o=[];for(let i=0;ie-t))],o=r[0].length,i=new Map;for(let a=0;ahl(e,i,((s,c,u,d,h,f,p,m,v,g,y)=>{let _=s.pxRound,{left:b,width:w}=e.bbox,k=e=>_(f(e,d,g,m)),x=e=>_(p(e,h,y,v)),S=0==d.ori?kl:xl;const A={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:dl},C=A.stroke,E=d.dir*(0==d.ori?1:-1);a=Wo(u,a,l,1),l=Wo(u,a,l,-1);let M=x(u[1==E?a:l]),T=k(c[1==E?a:l]),N=T,O=T;o&&-1==t&&(O=b,S(C,O,M)),S(C,T,M);for(let e=1==E?a:l;e>=a&&e<=l;e+=E){let n=u[e];if(null==n)continue;let r=k(c[e]),o=x(n);1==t?S(C,r,M):S(C,N,o),S(C,r,o),M=o,N=r}let P=N;o&&1==t&&(P=b+w,S(C,P,M));let[L,R]=fl(e,i);if(null!=s.fill||0!=L){let t=A.fill=new Path2D(C),n=x(s.fillTo(e,i,s.min,s.max,L));S(t,P,n),S(t,O,n)}if(!s.spanGaps){let o=[];o.push(...gl(c,u,a,l,E,k,r));let h=s.width*Eo/2,f=n||1==t?h:-h,p=n||-1==t?-h:h;o.forEach((e=>{e[0]+=f,e[1]+=p})),A.gaps=o=s.gaps(e,i,a,l,o),A.clip=vl(o,d.ori,m,v,g,y)}return 0!=R&&(A.band=2==R?[ml(e,i,a,l,C,-1),ml(e,i,a,l,C,1)]:ml(e,i,a,l,C,R)),A}))},e.bars=function(e){const t=Xo((e=e||Li).size,[.6,vi,1]),n=e.align||0,r=e.gap||0;let o=e.radius;o=null==o?[0,0]:"number"==typeof o?[o,0]:o;const i=_i(o),a=1-t[0],l=Xo(t[1],vi),s=Xo(t[2],1),c=Xo(e.disp,Li),u=Xo(e.each,(e=>{})),{fill:d,stroke:h}=c;return(e,t,o,f)=>hl(e,t,((p,m,v,g,y,_,b,w,k,x,S)=>{let A,C,E=p.pxRound,M=n,T=r*Eo,N=l*Eo,O=s*Eo;0==g.ori?[A,C]=i(e,t):[C,A]=i(e,t);const P=g.dir*(0==g.ori?1:-1);let L,R,z,D=0==g.ori?Sl:Al,I=0==g.ori?u:(e,t,n,r,o,i,a)=>{u(e,t,n,o,r,a,i)},$=Xo(e.bands,Ri).find((e=>e.series[0]==t)),F=null!=$?$.dir:0,j=p.fillTo(e,t,p.min,p.max,F),V=E(b(j,y,S,k)),H=x,U=E(p.width*Eo),B=!1,W=null,Y=null,Z=null,q=null;null==d||0!=U&&null==h||(B=!0,W=d.values(e,t,o,f),Y=new Map,new Set(W).forEach((e=>{null!=e&&Y.set(e,new Path2D)})),U>0&&(Z=h.values(e,t,o,f),q=new Map,new Set(Z).forEach((e=>{null!=e&&q.set(e,new Path2D)}))));let{x0:K,size:G}=c;if(null!=K&&null!=G){M=1,m=K.values(e,t,o,f),2==K.unit&&(m=m.map((t=>e.posToVal(w+t*x,g.key,!0))));let n=G.values(e,t,o,f);R=2==G.unit?n[0]*x:_(n[0],g,x,w)-_(0,g,x,w),H=zl(m,v,_,g,x,w,H),z=H-R+T}else H=zl(m,v,_,g,x,w,H),z=H*a+T,R=H-z;z<1&&(z=0),U>=R/2&&(U=0),z<5&&(E=bi);let Q=z>0;R=E(yi(H-z-(Q?U:0),O,N)),L=(0==M?R/2:M==P?0:R)-M*P*((0==M?T/2:0)+(Q?U/2:0));const J={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},X=B?null:new Path2D;let ee=null;if(null!=$)ee=e.data[$.series[1]];else{let{y0:n,y1:r}=c;null!=n&&null!=r&&(v=r.values(e,t,o,f),ee=n.values(e,t,o,f))}let te=A*R,ne=C*R;for(let n=1==P?o:f;n>=o&&n<=f;n+=P){let r=v[n];if(null==r)continue;if(null!=ee){var re;let e=null!==(re=ee[n])&&void 0!==re?re:0;if(r-e==0)continue;V=b(e,y,S,k)}let o=_(2!=g.distr||null!=c?m[n]:n,g,x,w),i=b(Xo(r,j),y,S,k),a=E(o-L),l=E(ui(i,V)),s=E(ci(i,V)),u=l-s;if(null!=r){let o=r<0?ne:te,i=r<0?te:ne;B?(U>0&&null!=Z[n]&&D(q.get(Z[n]),a,s+ai(U/2),R,ui(0,u-U),o,i),null!=W[n]&&D(Y.get(W[n]),a,s+ai(U/2),R,ui(0,u-U),o,i)):D(X,a,s+ai(U/2),R,ui(0,u-U),o,i),I(e,t,n,a-U/2,s,R+U,u)}}if(U>0)J.stroke=B?q:X;else if(!B){var oe;J._fill=0==p.width?p._fill:null!==(oe=p._stroke)&&void 0!==oe?oe:p._fill,J.width=0}return J.fill=B?Y:X,J}))},e.spline=function(e){return function(e,t){const n=Xo(null===t||void 0===t?void 0:t.alignGaps,0);return(t,r,o,i)=>hl(t,r,((a,l,s,c,u,d,h,f,p,m,v)=>{let g,y,_,b=a.pxRound,w=e=>b(d(e,c,m,f)),k=e=>b(h(e,u,v,p));0==c.ori?(g=bl,_=kl,y=Ml):(g=wl,_=xl,y=Tl);const x=c.dir*(0==c.ori?1:-1);o=Wo(s,o,i,1),i=Wo(s,o,i,-1);let S=w(l[1==x?o:i]),A=S,C=[],E=[];for(let e=1==x?o:i;e>=o&&e<=i;e+=x)if(null!=s[e]){let t=w(l[e]);C.push(A=t),E.push(k(s[e]))}const M={stroke:e(C,E,g,_,y,b),fill:null,clip:null,band:null,gaps:null,flags:dl},T=M.stroke;let[N,O]=fl(t,r);if(null!=a.fill||0!=N){let e=M.fill=new Path2D(T),n=k(a.fillTo(t,r,a.min,a.max,N));_(e,A,n),_(e,S,n)}if(!a.spanGaps){let e=[];e.push(...gl(l,s,o,i,x,w,n)),M.gaps=e=a.gaps(t,r,o,i,e),M.clip=vl(e,c.ori,f,p,m,v)}return 0!=O&&(M.band=2==O?[ml(t,r,o,i,T,-1),ml(t,r,o,i,T,1)]:ml(t,r,o,i,T,O)),M}))}(Dl,e)}}((e,t,n)=>{const r=[];for(let o=0;oMath.round(e))).join(", "))}r.map((e=>"rgb(".concat(e,")")))})([246,226,219],[127,39,4],16);function es(e,t){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.add(e)}function ts(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function ns(e){return ns="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ns(e)}function rs(e){var t=function(e,t){if("object"!=ns(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ns(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ns(t)?t:String(t)}function os(e,t,n){return(t=rs(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function is(){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 as={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};function ls(e){as=e}const ss=/[&<>"']/,cs=new RegExp(ss.source,"g"),us=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ds=new RegExp(us.source,"g"),hs={"&":"&","<":"<",">":">",'"':""","'":"'"},fs=e=>hs[e];function ps(e,t){if(t){if(ss.test(e))return e.replace(cs,fs)}else if(us.test(e))return e.replace(ds,fs);return e}const ms=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function vs(e){return e.replace(ms,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const gs=/(^|[^\[])\^/g;function ys(e,t){e="string"===typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(gs,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}const _s=/[^\w:]/g,bs=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ws(e,t,n){if(e){let e;try{e=decodeURIComponent(vs(n)).replace(_s,"").toLowerCase()}catch(Au){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!bs.test(n)&&(n=function(e,t){ks[" "+e]||(xs.test(e)?ks[" "+e]=e+"/":ks[" "+e]=Ms(e,"/",!0));e=ks[" "+e];const n=-1===e.indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(Ss,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(As,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(Au){return null}return n}const ks={},xs=/^[^:]+:\/*[^/]*$/,Ss=/^([^:]+:)[\s\S]*$/,As=/^([^:]+:\/*[^/]*)[\s\S]*$/;const Cs={exec:function(){}};function Es(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Ms(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=Ms(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,r,o,i,a,l,s,c,u,d,h,f,p=t[1].trim();const m=p.length>1,v={type:"list",raw:"",ordered:m,start:m?+p.slice(0,-1):"",loose:!1,items:[]};p=m?"\\d{1,9}\\".concat(p.slice(-1)):"\\".concat(p),this.options.pedantic&&(p=m?p:"[*+-]");const g=new RegExp("^( {0,3}".concat(p,")((?:[\t ][^\\n]*)?(?:\\n|$))"));for(;e&&(f=!1,t=g.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),c=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),u=e.split("\n",1)[0],this.options.pedantic?(i=2,h=c.trimLeft()):(i=t[2].search(/[^ ]/),i=i>4?1:i,h=c.slice(i),i+=t[1].length),l=!1,!c&&/^ *$/.test(u)&&(n+=u+"\n",e=e.substring(u.length+1),f=!0),!f){const t=new RegExp("^ {0,".concat(Math.min(3,i-1),"}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))")),r=new RegExp("^ {0,".concat(Math.min(3,i-1),"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)")),o=new RegExp("^ {0,".concat(Math.min(3,i-1),"}(?:```|~~~)")),a=new RegExp("^ {0,".concat(Math.min(3,i-1),"}#"));for(;e&&(d=e.split("\n",1)[0],u=d,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!o.test(u))&&!a.test(u)&&!t.test(u)&&!r.test(e);){if(u.search(/[^ ]/)>=i||!u.trim())h+="\n"+u.slice(i);else{if(l)break;if(c.search(/[^ ]/)>=4)break;if(o.test(c))break;if(a.test(c))break;if(r.test(c))break;h+="\n"+u}l||u.trim()||(l=!0),n+=d+"\n",e=e.substring(d.length+1),c=u.slice(i)}}v.loose||(s?v.loose=!0:/\n *\n *$/.test(n)&&(s=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(h),r&&(o="[ ] "!==r[0],h=h.replace(/^\[[ xX]\] +/,""))),v.items.push({type:"list_item",raw:n,task:!!r,checked:o,loose:!1,text:h}),v.raw+=n}v.items[v.items.length-1].raw=n.trimRight(),v.items[v.items.length-1].text=h.trimRight(),v.raw=v.raw.trimRight();const y=v.items.length;for(a=0;a"space"===e.type)),t=e.length>0&&e.some((e=>/\n.*\n/.test(e.raw)));v.loose=t}if(v.loose)for(a=0;a$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:Es(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,r,o,i,a=e.align.length;for(n=0;n({text:e})));for(a=e.header.length,r=0;r/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):ps(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=Ms(e.slice(0,-1),"\\");if((e.length-t.length)%2===0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,o=0;for(;o-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),Ts(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return Ts(n,e,n[0],this.lexer)}}emStrong(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=r[0].length-1;let o,i,a=n,l=0;const s="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(s.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=s.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(i=o.length,r[3]||r[4]){a+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){l+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a+l);const t=e.slice(0,n+r.index+i+1);if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const s=t.slice(2,-2);return{type:"strong",raw:t,text:s,tokens:this.lexer.inlineTokens(s)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=ps(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,r;return"@"===n[2]?(e=ps(this.options.mangle?t(n[1]):n[1]),r="mailto:"+e):(e=ps(n[1]),r=e),{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,r;if("@"===n[2])e=ps(this.options.mangle?t(n[0]):n[0]),r="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=ps(n[0]),r="www."===n[1]?"http://"+n[0]:n[0]}return{type:"link",raw:n[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):ps(n[0]):n[0]:ps(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const Os={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:Cs,lheading:/^((?:(?!^bull ).|\n(?!\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Os.def=ys(Os.def).replace("label",Os._label).replace("title",Os._title).getRegex(),Os.bullet=/(?:[*+-]|\d{1,9}[.)])/,Os.listItemStart=ys(/^( *)(bull) */).replace("bull",Os.bullet).getRegex(),Os.list=ys(Os.list).replace(/bull/g,Os.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Os.def.source+")").getRegex(),Os._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",Os._comment=/|$)/,Os.html=ys(Os.html,"i").replace("comment",Os._comment).replace("tag",Os._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Os.lheading=ys(Os.lheading).replace(/bull/g,Os.bullet).getRegex(),Os.paragraph=ys(Os._paragraph).replace("hr",Os.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",Os._tag).getRegex(),Os.blockquote=ys(Os.blockquote).replace("paragraph",Os.paragraph).getRegex(),Os.normal={...Os},Os.gfm={...Os.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},Os.gfm.table=ys(Os.gfm.table).replace("hr",Os.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",Os._tag).getRegex(),Os.gfm.paragraph=ys(Os._paragraph).replace("hr",Os.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Os.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",Os._tag).getRegex(),Os.pedantic={...Os.normal,html:ys("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Os._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:Cs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ys(Os.normal._paragraph).replace("hr",Os.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Os.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Ps={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Cs,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:Cs,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}Ps._punctuation="\\p{P}$+<=>`^|~",Ps.punctuation=ys(Ps.punctuation,"u").replace(/punctuation/g,Ps._punctuation).getRegex(),Ps.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,Ps.anyPunctuation=/\\[punct]/g,Ps._escapes=/\\([punct])/g,Ps._comment=ys(Os._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ps.emStrong.lDelim=ys(Ps.emStrong.lDelim,"u").replace(/punct/g,Ps._punctuation).getRegex(),Ps.emStrong.rDelimAst=ys(Ps.emStrong.rDelimAst,"gu").replace(/punct/g,Ps._punctuation).getRegex(),Ps.emStrong.rDelimUnd=ys(Ps.emStrong.rDelimUnd,"gu").replace(/punct/g,Ps._punctuation).getRegex(),Ps.anyPunctuation=ys(Ps.anyPunctuation,"gu").replace(/punct/g,Ps._punctuation).getRegex(),Ps._escapes=ys(Ps._escapes,"gu").replace(/punct/g,Ps._punctuation).getRegex(),Ps._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ps._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])?)+(?![-_])/,Ps.autolink=ys(Ps.autolink).replace("scheme",Ps._scheme).replace("email",Ps._email).getRegex(),Ps._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ps.tag=ys(Ps.tag).replace("comment",Ps._comment).replace("attribute",Ps._attribute).getRegex(),Ps._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ps._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ps._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ps.link=ys(Ps.link).replace("label",Ps._label).replace("href",Ps._href).replace("title",Ps._title).getRegex(),Ps.reflink=ys(Ps.reflink).replace("label",Ps._label).replace("ref",Os._label).getRegex(),Ps.nolink=ys(Ps.nolink).replace("ref",Os._label).getRegex(),Ps.reflinkSearch=ys(Ps.reflinkSearch,"g").replace("reflink",Ps.reflink).replace("nolink",Ps.nolink).getRegex(),Ps.normal={...Ps},Ps.pedantic={...Ps.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:ys(/^!?\[(label)\]\((.*?)\)/).replace("label",Ps._label).getRegex(),reflink:ys(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ps._label).getRegex()},Ps.gfm={...Ps.normal,escape:ys(Ps.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]*?(?:(?=[\\1&&void 0!==arguments[1]?arguments[1]:[];for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((n=>!!(t=n.call({lexer:this},e,i))&&(e=e.substring(t.raw.length),i.push(t),!0)))))if(t=this.tokenizer.space(e))e=e.substring(t.raw.length),1===t.raw.length&&i.length>0?i[i.length-1].raw+="\n":i.push(t);else if(t=this.tokenizer.code(e))e=e.substring(t.raw.length),n=i[i.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?i.push(t):(n.raw+="\n"+t.raw,n.text+="\n"+t.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(t=this.tokenizer.fences(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.heading(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.hr(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.blockquote(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.list(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.html(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.def(e))e=e.substring(t.raw.length),n=i[i.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title}):(n.raw+="\n"+t.raw,n.text+="\n"+t.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(t=this.tokenizer.table(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.lheading(e))e=e.substring(t.raw.length),i.push(t);else{if(r=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let o;this.options.extensions.startBlock.forEach((function(e){o=e.call({lexer:this},n),"number"===typeof o&&o>=0&&(t=Math.min(t,o))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(this.state.top&&(t=this.tokenizer.paragraph(r)))n=i[i.length-1],o&&"paragraph"===n.type?(n.raw+="\n"+t.raw,n.text+="\n"+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):i.push(t),o=r.length!==e.length,e=e.substring(t.raw.length);else if(t=this.tokenizer.text(e))e=e.substring(t.raw.length),n=i[i.length-1],n&&"text"===n.type?(n.raw+="\n"+t.raw,n.text+="\n"+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):i.push(t);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,i}inline(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e){let t,n,r,o,i,a,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(s));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(s));)s=s.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.anyPunctuation.exec(s));)s=s.slice(0,o.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(i||(a=""),i=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((n=>!!(t=n.call({lexer:this},e,l))&&(e=e.substring(t.raw.length),l.push(t),!0)))))if(t=this.tokenizer.escape(e))e=e.substring(t.raw.length),l.push(t);else if(t=this.tokenizer.tag(e))e=e.substring(t.raw.length),n=l[l.length-1],n&&"text"===t.type&&"text"===n.type?(n.raw+=t.raw,n.text+=t.text):l.push(t);else if(t=this.tokenizer.link(e))e=e.substring(t.raw.length),l.push(t);else if(t=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(t.raw.length),n=l[l.length-1],n&&"text"===t.type&&"text"===n.type?(n.raw+=t.raw,n.text+=t.text):l.push(t);else if(t=this.tokenizer.emStrong(e,s,a))e=e.substring(t.raw.length),l.push(t);else if(t=this.tokenizer.codespan(e))e=e.substring(t.raw.length),l.push(t);else if(t=this.tokenizer.br(e))e=e.substring(t.raw.length),l.push(t);else if(t=this.tokenizer.del(e))e=e.substring(t.raw.length),l.push(t);else if(t=this.tokenizer.autolink(e,Rs))e=e.substring(t.raw.length),l.push(t);else if(this.state.inLink||!(t=this.tokenizer.url(e,Rs))){if(r=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let o;this.options.extensions.startInline.forEach((function(e){o=e.call({lexer:this},n),"number"===typeof o&&o>=0&&(t=Math.min(t,o))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(t=this.tokenizer.inlineText(r,Ls))e=e.substring(t.raw.length),"_"!==t.raw.slice(-1)&&(a=t.raw.slice(-1)),i=!0,n=l[l.length-1],n&&"text"===n.type?(n.raw+=t.raw,n.text+=t.text):l.push(t);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(t.raw.length),l.push(t);return l}}class Ds{constructor(e){this.options=e||as}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",r?'
    '+(n?e:ps(e,!0))+"
    \n":"
    "+(n?e:ps(e,!0))+"
    \n"}blockquote(e){return"
    \n".concat(e,"
    \n")}html(e,t){return e}heading(e,t,n,r){if(this.options.headerIds){const o=this.options.headerPrefix+r.slug(n);return"').concat(e,"\n")}return"").concat(e,"\n")}hr(){return this.options.xhtml?"
    \n":"
    \n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e){return"
  • ".concat(e,"
  • \n")}checkbox(e){return" "}paragraph(e){return"

    ".concat(e,"

    \n")}table(e,t){return t&&(t="".concat(t,"")),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return"\n".concat(e,"\n")}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<".concat(n,' align="').concat(t.align,'">'):"<".concat(n,">"))+e+"\n")}strong(e){return"".concat(e,"")}em(e){return"".concat(e,"")}codespan(e){return"".concat(e,"")}br(){return this.options.xhtml?"
    ":"
    "}del(e){return"".concat(e,"")}link(e,t,n){if(null===(e=ws(this.options.sanitize,this.options.baseUrl,e)))return n;let r='
    ",r}image(e,t,n){if(null===(e=ws(this.options.sanitize,this.options.baseUrl,e)))return n;let r='').concat(n,'":">",r}text(e){return e}}class Is{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class $s{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{r++,n=e+"-"+r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class Fs{constructor(e){this.options=e||as,this.options.renderer=this.options.renderer||new Ds,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Is,this.slugger=new $s}static parse(e,t){return new Fs(t).parse(e)}static parseInline(e,t){return new Fs(t).parseInline(e)}parse(e){let t,n,r,o,i,a,l,s,c,u,d,h,f,p,m,v,g,y,_,b=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],w="";const k=e.length;for(t=0;t0&&"paragraph"===m.tokens[0].type?(m.tokens[0].text=y+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&"text"===m.tokens[0].tokens[0].type&&(m.tokens[0].tokens[0].text=y+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:y}):p+=y),p+=this.parse(m.tokens,f),c+=this.renderer.listitem(p,g,v);w+=this.renderer.list(c,d,h);continue;case"html":w+=this.renderer.html(u.text,u.block);continue;case"paragraph":w+=this.renderer.paragraph(this.parseInline(u.tokens));continue;case"text":for(c=u.tokens?this.parseInline(u.tokens):u.text;t+1{"function"===typeof r&&(o=r,r=null);const i={...r};r={...this.defaults,...i};const a=ts(this,Hs,Bs).call(this,r.silent,r.async,o);if("undefined"===typeof n||null===n)return a(new Error("marked(): input parameter is undefined or null"));if("string"!==typeof n)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(function(e,t){e&&!e.silent&&(t&&console.warn("marked(): callback is deprecated since version 5.0.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/using_pro#async"),(e.sanitize||e.sanitizer)&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options"),(e.highlight||"language-"!==e.langPrefix)&&console.warn("marked(): highlight and langPrefix parameters are deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-highlight."),e.mangle&&console.warn("marked(): mangle parameter is enabled by default, but is deprecated since version 5.0.0, and will be removed in the future. To clear this warning, install https://www.npmjs.com/package/marked-mangle, or disable by setting `{mangle: false}`."),e.baseUrl&&console.warn("marked(): baseUrl parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-base-url."),e.smartypants&&console.warn("marked(): smartypants parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-smartypants."),e.xhtml&&console.warn("marked(): xhtml parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-xhtml."),(e.headerIds||e.headerPrefix)&&console.warn("marked(): headerIds and headerPrefix parameters enabled by default, but are deprecated since version 5.0.0, and will be removed in the future. To clear this warning, install https://www.npmjs.com/package/marked-gfm-heading-id, or disable by setting `{headerIds: false}`."))}(r,o),r.hooks&&(r.hooks.options=r),o){const i=r.highlight;let l;try{r.hooks&&(n=r.hooks.preprocess(n)),l=e(n,r)}catch(Au){return a(Au)}const s=e=>{let n;if(!e)try{r.walkTokens&&this.walkTokens(l,r.walkTokens),n=t(l,r),r.hooks&&(n=r.hooks.postprocess(n))}catch(Au){e=Au}return r.highlight=i,e?a(e):o(null,n)};if(!i||i.length<3)return s();if(delete r.highlight,!l.length)return s();let c=0;return this.walkTokens(l,(e=>{"code"===e.type&&(c++,setTimeout((()=>{i(e.text,e.lang,((t,n)=>{if(t)return s(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),c--,0===c&&s()}))}),0))})),void(0===c&&s())}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then((t=>e(t,r))).then((e=>r.walkTokens?Promise.all(this.walkTokens(e,r.walkTokens)).then((()=>e)):e)).then((e=>t(e,r))).then((e=>r.hooks?r.hooks.postprocess(e):e)).catch(a);try{r.hooks&&(n=r.hooks.preprocess(n));const o=e(n,r);r.walkTokens&&this.walkTokens(o,r.walkTokens);let i=t(o,r);return r.hooks&&(i=r.hooks.postprocess(i)),i}catch(Au){return a(Au)}}}function Bs(e,t,n){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+ps(r.message+"",!0)+"
    ";return t?Promise.resolve(e):n?void n(null,e):e}if(t)return Promise.reject(r);if(!n)throw r;n(r)}}const Ws=new class{constructor(){es(this,Hs),es(this,Vs),os(this,"defaults",{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}),os(this,"options",this.setOptions),os(this,"parse",ts(this,Vs,Us).call(this,zs.lex,Fs.parse)),os(this,"parseInline",ts(this,Vs,Us).call(this,zs.lexInline,Fs.parseInline)),os(this,"Parser",Fs),os(this,"parser",Fs.parse),os(this,"Renderer",Ds),os(this,"TextRenderer",Is),os(this,"Lexer",zs),os(this,"lexer",zs.lex),os(this,"Tokenizer",Ns),os(this,"Slugger",$s),os(this,"Hooks",js),this.use(...arguments)}walkTokens(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":for(const e of r.header)n=n.concat(this.walkTokens(e.tokens,t));for(const e of r.rows)for(const r of e)n=n.concat(this.walkTokens(r.tokens,t));break;case"list":n=n.concat(this.walkTokens(r.items,t));break;default:this.defaults.extensions&&this.defaults.extensions.childTokens&&this.defaults.extensions.childTokens[r.type]?this.defaults.extensions.childTokens[r.type].forEach((e=>{n=n.concat(this.walkTokens(r[e],t))})):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,t)))}return n}use(){const e=this.defaults.extensions||{renderers:{},childTokens:{}};for(var t=arguments.length,n=new Array(t),r=0;r{const n={...t};if(n.async=this.defaults.async||n.async||!1,t.extensions&&(t.extensions.forEach((t=>{if(!t.name)throw new Error("extension name required");if(t.renderer){const n=e.renderers[t.name];e.renderers[t.name]=n?function(){for(var e=arguments.length,r=new Array(e),o=0;o{if(this.defaults.async)return Promise.resolve(t.hooks[n].call(e,o)).then((t=>r.call(e,t)));const i=t.hooks[n].call(e,o);return r.call(e,i)}:e[n]=function(){for(var o=arguments.length,i=new Array(o),a=0;a{const t='$1 target="_blank" class="'.concat("vm-link vm-link_colored",'" $2').concat("https://docs.victoriametrics.com/MetricsQL.html","#");return e.replace(/({var n;const r="h3"===e.tagName.toLowerCase();return t=r?null!==(n=e.textContent)&&void 0!==n?n:"":t,r?null:((e,t)=>{var n;const r=null!==(n=t.textContent)&&void 0!==n?n:"",o=(e=>{const t=[];let n=e.nextElementSibling;for(;n&&"p"===n.tagName.toLowerCase();)n&&t.push(n),n=n.nextElementSibling;return t})(t).map((e=>{var t;return null!==(t=e.outerHTML)&&void 0!==t?t:""})).join("\n");return{type:e,value:r,description:qs(o),icon:pt(Hn,{})}})(t,e)})).filter(Boolean)},Gs=()=>{const{metricsQLFunctions:e}=ln(),n=sn();return(0,t.useEffect)((()=>{e.length||(async()=>{try{const e=await fetch(Zs),t=(e=>{const t=document.createElement("div");t.innerHTML=Ys(e);const n=t.querySelectorAll("".concat("h3",", ").concat("h4"));return Ks(n)})(await e.text());n({type:"SET_METRICSQL_FUNCTIONS",payload:t})}catch(Au){console.error("Error fetching or processing the MetricsQL.md file:",Au)}})()}),[]),e},Qs=e=>{let{value:n,anchorEl:r,caretPosition:i,onSelect:a,onFoundOptions:l}=e;const[s,c]=(0,t.useState)(0),u=Gs(),d=(0,t.useMemo)((()=>{const e=n.split("}");return e[e.length-1]}),[n]),h=(0,t.useMemo)((()=>{const e=d.match(/\b[^{}(),\s]+(?={|$)/g);return e?e[0]:""}),[d]),f=(0,t.useMemo)((()=>{const e=d.match(/[a-z_:-][\w\-.:/]*\b(?=\s*(=|!=|=~|!~))/g);return e?e[e.length-1]:""}),[d]),p=(0,t.useMemo)((()=>{if(!n||n.endsWith("}")||(e=>{const t=e.split(/\s+/),n=t.length,r=t[n-1],o=t[n-2],i=!r&&(e=>{const t=e.match(/"/g);return!!t&&t.length%2!==0})(e),a=(!r||t.length>1)&&!/([(),+\-*/^]|\b(?:or|and|unless|default|ifnot|if|group_left|group_right)\b)/.test(o);return i||a})(n))return ot.empty;const e=/\{[^}]*$/;switch(!0){case new RegExp("(".concat(Xr(h),")?{?.+").concat(Xr(f),'(=|!=|=~|!~)"?([^"]*)$'),"g").test(n):return ot.labelValue;case e.test(n):return ot.label;default:return ot.metricsql}}),[n,h,f]),m=(0,t.useMemo)((()=>{const e=n.match(/([\w_\-.:/]+(?![},]))$/);return e?e[0]:""}),[n]),{metrics:v,labels:g,labelValues:y,loading:_}=(e=>{let{valueByContext:n,metric:r,label:i,context:a}=e;const{serverUrl:l}=vt(),{period:{start:s,end:c}}=Gt(),{autocompleteCache:u}=ln(),d=sn(),[h,f]=(0,t.useState)(!1),[p,m]=(0,t.useState)(n),v=Jr()(m,500);(0,t.useEffect)((()=>(v(n),v.cancel)),[n,v]);const[g,y]=(0,t.useState)([]),[_,b]=(0,t.useState)([]),[w,k]=(0,t.useState)([]),x=(0,t.useRef)(new AbortController),S=(0,t.useCallback)((e=>{const t=o()(1e3*s).startOf("day").valueOf()/1e3,n=o()(1e3*c).endOf("day").valueOf()/1e3;return new URLSearchParams({...e||{},limit:"".concat(en),start:"".concat(t),end:"".concat(n)})}),[s,c]),A=(e,t)=>e.map((e=>({value:e,type:"".concat(t),icon:no[t]}))),C=async e=>{let{value:t,urlSuffix:n,setter:r,type:o,params:i}=e;if(!t&&o===to.metric)return;x.current.abort(),x.current=new AbortController;const{signal:a}=x.current,s={type:o,value:t,start:(null===i||void 0===i?void 0:i.get("start"))||"",end:(null===i||void 0===i?void 0:i.get("end"))||"",match:(null===i||void 0===i?void 0:i.get("match[]"))||""};f(!0);try{const e=u.get(s);if(e)return void r(A(e,o));const t=await fetch("".concat(l,"/api/v1/").concat(n,"?").concat(i),{signal:a});if(t.ok){const{data:e}=await t.json();r(A(e,o)),d({type:"SET_AUTOCOMPLETE_CACHE",payload:{key:s,value:e}})}}catch(Au){Au instanceof Error&&"AbortError"!==Au.name&&(d({type:"SET_AUTOCOMPLETE_CACHE",payload:{key:s,value:[]}}),console.error(Au))}finally{f(!1)}};return(0,t.useEffect)((()=>{const e=a!==ot.metricsql&&a!==ot.empty;if(!l||!r||e)return;y([]);const t=eo(Xr(r));return C({value:p,urlSuffix:"label/__name__/values",setter:y,type:to.metric,params:S({"match[]":'{__name__=~".*'.concat(t,'.*"}')})}),()=>{var e;return null===(e=x.current)||void 0===e?void 0:e.abort()}}),[l,p,a,r]),(0,t.useEffect)((()=>{if(!l||!r||a!==ot.label)return;b([]);const e=eo(r);return C({value:p,urlSuffix:"labels",setter:b,type:to.label,params:S({"match[]":'{__name__="'.concat(e,'"}')})}),()=>{var e;return null===(e=x.current)||void 0===e?void 0:e.abort()}}),[l,p,a,r]),(0,t.useEffect)((()=>{if(!l||!r||!i||a!==ot.labelValue)return;k([]);const e=eo(r),t=eo(Xr(p));return C({value:p,urlSuffix:"label/".concat(i,"/values"),setter:k,type:to.labelValue,params:S({"match[]":'{__name__="'.concat(e,'", ').concat(i,'=~".*').concat(t,'.*"}')})}),()=>{var e;return null===(e=x.current)||void 0===e?void 0:e.abort()}}),[l,p,a,r,i]),{metrics:g,labels:_,labelValues:w,loading:h}})({valueByContext:m,metric:h,label:f,context:p}),b=(0,t.useMemo)((()=>{switch(p){case ot.metricsql:return[...v,...u];case ot.label:return g;case ot.labelValue:return y;default:return[]}}),[p,v,g,y]);return(0,t.useEffect)((()=>{if(!r.current)return void c(0);const e=window.getComputedStyle(r.current),t="".concat(e.getPropertyValue("font-size")),o="".concat(e.getPropertyValue("font-family")),i=((e,t)=>{const n=document.createElement("span");n.innerText=e,n.style.cssText="position: absolute; z-index: -1; pointer-events: none; opacity: 0; font: ".concat(t),document.body.appendChild(n);const r=n.offsetWidth;return n.remove(),r})(n,"".concat(t," ").concat(o));c(i)}),[r,i]),pt(ht.FK,{children:pt(Gr,{loading:_,disabledFullScreen:!0,value:m,options:b,anchor:r,minLength:0,offset:{top:0,left:s},onSelect:e=>{const t=n.lastIndexOf(m,i[0]),r=t+m.length,o=n.substring(0,t),l=n.substring(r);if(p===ot.labelValue){const t='"',n=/(?:=|!=|=~|!~)$/.test(o);e="".concat(n?t:"").concat(e)}const s="".concat(o).concat(e).concat(l);a(s)},onFoundOptions:l,maxDisplayResults:{limit:Xt,message:"Please, specify the query more precisely."}})})},Js="No match! \nThis query hasn't selected any time series from database.\nEither the requested metrics are missing in the database,\nor there is a typo in series selector.",Xs="The shown results are marked as PARTIAL.\nThe result is marked as partial if one or more vmstorage nodes failed to respond to the query.",ec=e=>{let{value:n,onChange:r,onEnter:o,onArrowUp:i,onArrowDown:a,autocomplete:l,error:s,stats:c,label:u,disabled:d=!1}=e;const{autocompleteQuick:h}=ln(),{isMobile:f}=dr(),[p,m]=(0,t.useState)(!1),[v,g]=(0,t.useState)([0,0]),y=(0,t.useRef)(null),_=[{show:"0"===(null===c||void 0===c?void 0:c.seriesFetched)&&!c.resultLength,text:Js},{show:null===c||void 0===c?void 0:c.isPartial,text:Xs}].filter((e=>e.show)).map((e=>e.text)).join("");c&&(u="".concat(u," (").concat(c.executionTimeMsec||0,"ms)"));return(0,t.useEffect)((()=>{m(l)}),[h]),pt("div",{className:"vm-query-editor",ref:y,children:[pt(qr,{value:n,label:u,type:"textarea",autofocus:!f,error:s,warning:_,onKeyDown:e=>{const{key:t,ctrlKey:n,metaKey:r,shiftKey:l}=e,s=(e.target.value||"").split("\n").length>1,c=n||r,u="ArrowDown"===t,d="Enter"===t;"ArrowUp"===t&&c&&(e.preventDefault(),i()),u&&c&&(e.preventDefault(),a()),d&&p&&e.preventDefault(),!d||l||s&&!c||p||(e.preventDefault(),o())},onChange:r,onChangeCaret:e=>{g(e)},disabled:d,inputmode:"search"}),l&&pt(Qs,{value:n,anchorEl:y,caretPosition:v,onSelect:e=>{r(e)},onFoundOptions:e=>{m(!!e.length)}})]})},tc=e=>{let{query:n,limit:r,error:o,onChange:i,onChangeLimit:a,onRun:l}=e;const{isMobile:s}=dr(),[c,u]=(0,t.useState)(""),[d,h]=(0,t.useState)(r);return(0,t.useEffect)((()=>{h(r)}),[r]),pt("div",{className:Yn()({"vm-explore-logs-header":!0,"vm-block":!0,"vm-block_mobile":s}),children:[pt("div",{className:"vm-explore-logs-header-top",children:[pt(ec,{value:n,autocomplete:!1,onArrowUp:()=>null,onArrowDown:()=>null,onEnter:l,onChange:i,label:"Log query",error:o}),pt(qr,{label:"Limit entries",type:"number",value:d,error:c,onChange:e=>{const t=+e;h(t),isNaN(t)||t<0?u("Number must be bigger than zero"):(u(""),a(t))},onEnter:l})]}),pt("div",{className:"vm-explore-logs-header-bottom",children:[pt("div",{className:"vm-explore-logs-header-bottom-helpful",children:[pt("a",{className:"vm-link vm-link_with-icon",target:"_blank",href:"https://docs.victoriametrics.com/VictoriaLogs/LogsQL.html",rel:"help noreferrer",children:[pt(vn,{}),"Query language docs"]}),pt("a",{className:"vm-link vm-link_with-icon",target:"_blank",href:"https://docs.victoriametrics.com/VictoriaLogs/",rel:"help noreferrer",children:[pt(zn,{}),"Documentation"]})]}),pt("div",{className:"vm-explore-logs-header-bottom__execute",children:pt(Ar,{startIcon:pt(En,{}),onClick:l,fullWidth:!0,children:"Execute Query"})})]})]})},nc=Number(We("LOGS_LIMIT")),rc=isNaN(nc)?1e3:nc,oc=()=>{const{serverUrl:e}=vt(),{duration:n,relativeTime:r,period:i}=Gt(),{setSearchParamsFromKeys:a}=Mr(),[l,s]=Er(rc,"limit"),[c,u]=Er("","query"),{logs:d,isLoading:h,error:f,fetchLogs:p}=((e,n,r)=>{const{period:i}=Gt(),[a,l]=(0,t.useState)([]),[s,c]=(0,t.useState)(!1),[u,d]=(0,t.useState)(),h=(0,t.useMemo)((()=>(e=>"".concat(e,"/select/logsql/query"))(e)),[e]),f=(0,t.useMemo)((()=>{if(!/_time/.test(n)){const e=o()(1e3*i.start).tz().toISOString(),t=o()(1e3*i.end).tz().toISOString(),r="_time:[".concat(e,", ").concat(t,"]");return"".concat(r," AND (").concat(n,")")}return n}),[n,i]),p=(0,t.useMemo)((()=>({method:"POST",headers:{Accept:"application/stream+json"},body:new URLSearchParams({query:f.trim(),limit:"".concat(r)})})),[f,r]),m=e=>{try{return JSON.parse(e)}catch(Au){return null}},v=(0,t.useCallback)((async()=>{const e=Number(p.body.get("limit"))+1;c(!0),d(void 0);try{const t=await fetch(h,p);if(!t.ok||!t.body){const e=await t.text();return d(e),l([]),void c(!1)}const n=t.body.getReader(),r=new TextDecoder("utf-8"),o=[];for(;n;){const{done:t,value:i}=await n.read();if(t)break;const a=r.decode(i,{stream:!0}).split("\n");if(o.push(...a),o.length>e&&o.splice(0,o.length-e),o.length>=e){n.cancel();break}}const i=o.map(m).filter((e=>e));l(i)}catch(Au){console.error(Au),l([]),Au instanceof Error&&d("".concat(Au.name,": ").concat(Au.message))}c(!1)}),[h,p]);return{logs:a,isLoading:s,error:u,fetchLogs:v}})(e,c,l),[m,v]=(0,t.useState)(""),[g,y]=(0,t.useState)(!1),_=()=>{c?(p().then((()=>{y(!0)})),a({query:c,"g0.range_input":n,"g0.end_input":i.date,"g0.relative_time":r||"none"})):v(nt.validQuery)};return(0,t.useEffect)((()=>{c&&_()}),[i]),(0,t.useEffect)((()=>{v("")}),[c]),pt("div",{className:"vm-explore-logs",children:[pt(tc,{query:c,error:m,limit:l,onChange:u,onChangeLimit:e=>{s(e),a({limit:e}),Be("LOGS_LIMIT","".concat(e))},onRun:_}),h&&pt(Yr,{}),f&&pt(fr,{variant:"error",children:f}),pt(Wr,{data:d,loaded:g})]})},ic={home:"/",metrics:"/metrics",dashboards:"/dashboards",cardinality:"/cardinality",topQueries:"/top-queries",trace:"/trace",withTemplate:"/expand-with-exprs",relabel:"/relabeling",logs:"/logs",activeQueries:"/active-queries",queryAnalyzer:"/query-analyzer",icons:"/icons",anomaly:"/anomaly",query:"/query"},{REACT_APP_TYPE:ac}={REACT_APP_TYPE:"logs"},lc=ac===Ue.logs,sc={header:{tenant:!0,stepControl:!lc,timeSelector:!lc,executionControls:!lc}},cc={[ic.home]:{title:"Query",...sc},[ic.metrics]:{title:"Explore Prometheus metrics",header:{tenant:!0,stepControl:!0,timeSelector:!0}},[ic.cardinality]:{title:"Explore cardinality",header:{tenant:!0,cardinalityDatePicker:!0}},[ic.topQueries]:{title:"Top queries",header:{tenant:!0}},[ic.trace]:{title:"Trace analyzer",header:{}},[ic.queryAnalyzer]:{title:"Query analyzer",header:{}},[ic.dashboards]:{title:"Dashboards",...sc},[ic.withTemplate]:{title:"WITH templates",header:{}},[ic.relabel]:{title:"Metric relabel debug",header:{}},[ic.logs]:{title:"Logs Explorer",header:{}},[ic.activeQueries]:{title:"Active Queries",header:{}},[ic.icons]:{title:"Icons",header:{}},[ic.anomaly]:{title:"Anomaly exploration",...sc},[ic.query]:{title:"Query",...sc}},uc=ic,dc=e=>{let{activeMenu:t,label:n,value:r,color:o}=e;return pt(Re,{className:Yn()({"vm-header-nav-item":!0,"vm-header-nav-item_active":t===r}),style:{color:o},to:r,children:n})},hc=e=>{let{activeMenu:n,label:r,color:o,background:i,submenu:a,direction:l}=e;const{pathname:s}=te(),[c,u]=(0,t.useState)(null),d=(0,t.useRef)(null),{value:h,setFalse:f,setTrue:p}=Rr(!1),m=()=>{c&&clearTimeout(c);const e=setTimeout(f,300);u(e)};return(0,t.useEffect)((()=>{f()}),[s]),"column"===l?pt(ht.FK,{children:a.map((e=>pt(dc,{activeMenu:n,value:e.value||"",label:e.label||""},e.value)))}):pt("div",{className:Yn()({"vm-header-nav-item":!0,"vm-header-nav-item_sub":!0,"vm-header-nav-item_open":h,"vm-header-nav-item_active":a.find((e=>e.value===n))}),style:{color:o},onMouseEnter:()=>{p(),c&&clearTimeout(c)},onMouseLeave:m,ref:d,children:[r,pt(kn,{}),pt(Nr,{open:h,placement:"bottom-left",offset:{top:12,left:0},onClose:f,buttonRef:d,children:pt("div",{className:"vm-header-nav-item-submenu",style:{background:i},onMouseLeave:m,onMouseEnter:()=>{c&&clearTimeout(c)},children:a.map((e=>pt(dc,{activeMenu:n,value:e.value||"",label:e.label||"",color:o},e.value)))})})]})},fc={label:"Explore",submenu:[{label:cc[uc.metrics].title,value:uc.metrics},{label:cc[uc.cardinality].title,value:uc.cardinality},{label:cc[uc.topQueries].title,value:uc.topQueries},{label:cc[uc.activeQueries].title,value:uc.activeQueries}]},pc={label:"Tools",submenu:[{label:cc[uc.trace].title,value:uc.trace},{label:cc[uc.queryAnalyzer].title,value:uc.queryAnalyzer},{label:cc[uc.withTemplate].title,value:uc.withTemplate},{label:cc[uc.relabel].title,value:uc.relabel}]},mc=[{label:cc[uc.logs].title,value:uc.home}],vc=[{label:cc[uc.anomaly].title,value:uc.home}],gc=[{label:cc[uc.home].title,value:uc.home},fc,pc],yc=e=>{let{color:n,background:r,direction:o}=e;const i=je(),{dashboardsSettings:a}=(0,t.useContext)(gr).state,{pathname:l}=te(),[s,c]=(0,t.useState)(l),u=(0,t.useMemo)((()=>{switch("logs"){case Ue.logs:return mc;case Ue.anomaly:return vc;default:return[...gc,{label:cc[uc.dashboards].title,value:uc.dashboards,hide:i||!a.length}].filter((e=>!e.hide))}}),[i,a]);return(0,t.useEffect)((()=>{c(l)}),[l]),pt("nav",{className:Yn()({"vm-header-nav":!0,["vm-header-nav_".concat(o)]:o}),children:u.map((e=>e.submenu?pt(hc,{activeMenu:s,label:e.label||"",submenu:e.submenu,color:n,background:r,direction:o},e.label):pt(dc,{activeMenu:s,value:e.value||"",label:e.label||"",color:n},e.value)))})},_c=e=>{let{title:n,children:r,onClose:o,className:i,isOpen:a=!0}=e;const{isMobile:l}=dr(),s=re(),c=te(),u=(0,t.useCallback)((e=>{a&&"Escape"===e.key&&o()}),[a]),d=e=>{e.stopPropagation()},h=(0,t.useCallback)((()=>{a&&(s(c,{replace:!0}),o())}),[a,c,o]);return(0,t.useEffect)((()=>{if(a)return document.body.style.overflow="hidden",()=>{document.body.style.overflow="auto"}}),[a]),Gn("popstate",h),Gn("keyup",u),t.default.createPortal(pt("div",{className:Yn()({"vm-modal":!0,"vm-modal_mobile":l,["".concat(i)]:i}),onMouseDown:o,children:pt("div",{className:"vm-modal-content",children:[pt("div",{className:"vm-modal-content-header",onMouseDown:d,children:[n&&pt("div",{className:"vm-modal-content-header__title",children:n}),pt("div",{className:"vm-modal-header__close",children:pt(Ar,{variant:"text",size:"small",onClick:o,ariaLabel:"close",children:pt(pn,{})})})]}),pt("div",{className:"vm-modal-content-body",onMouseDown:d,children:r})]})}),document.body)},bc=pt("code",{children:ur()?"Cmd":"Ctrl"}),wc=[{title:"Zoom in",description:pt(ht.FK,{children:["To zoom in, hold down the ",bc," + ",pt("code",{children:"scroll up"}),", or press the ",pt("code",{children:"+"}),". Also, you can zoom in on a range on the graph by holding down your mouse button and selecting the range."]})},{title:"Zoom out",description:pt(ht.FK,{children:["To zoom out, hold down the ",bc," + ",pt("code",{children:"scroll down"}),", or press the ",pt("code",{children:"-"}),"."]})},{title:"Move horizontal axis",description:pt(ht.FK,{children:["To move the graph, hold down the ",bc," + ",pt("code",{children:"drag"})," the graph to the right or left."]})},{title:"Fixing a tooltip",description:pt(ht.FK,{children:["To fix the tooltip, ",pt("code",{children:"click"})," mouse when it's open. Then, you can drag the fixed tooltip by ",pt("code",{children:"clicking"})," and ",pt("code",{children:"dragging"})," on the ",pt(Rn,{})," icon."]})},{title:"Set a custom range for the vertical axis",description:pt(ht.FK,{children:["To set a custom range for the vertical axis, click on the ",pt(fn,{})," icon located in the upper right corner of the graph, activate the toggle, and set the values."]})}],kc=[{title:"Show/hide a legend item",description:pt(ht.FK,{children:[pt("code",{children:"click"})," on a legend item to isolate it on the graph.",bc," + ",pt("code",{children:"click"})," on a legend item to remove it from the graph. To revert to the previous state, click again."]})},{title:"Copy label key-value pairs",description:pt(ht.FK,{children:[pt("code",{children:"click"})," on a label key-value pair to save it to the clipboard."]})},{title:"Collapse/Expand the legend group",description:pt(ht.FK,{children:[pt("code",{children:"click"})," on the group name (e.g. ",pt("b",{children:'Query 1: {__name__!=""}'}),") to collapse or expand the legend."]})}],xc=wc.concat(kc),Sc=()=>{const{value:e,setFalse:t,setTrue:n}=Rr(!1);return pt(ht.FK,{children:[pt(Pr,{title:"Show tips on working with the graph",children:pt(Ar,{variant:"text",color:"gray",startIcon:pt(Fn,{}),onClick:n,ariaLabel:"open the tips"})}),e&&pt(_c,{title:"Tips on working with the graph and the legend",onClose:t,children:pt("div",{className:"fc-graph-tips",children:xc.map((e=>{let{title:t,description:n}=e;return pt("div",{className:"fc-graph-tips-item",children:[pt("h4",{className:"fc-graph-tips-item__action",children:t}),pt("p",{className:"fc-graph-tips-item__description",children:n})]},t)}))})})]})},Ac=pt("code",{children:ur()?"Cmd":"Ctrl"}),Cc=pt(ht.FK,{children:[pt("code",{children:ur()?"Option":"Ctrl"})," + ",pt("code",{children:"Space"})]}),Ec=[{title:"Query",list:[{keys:pt("code",{children:"Enter"}),description:"Run"},{keys:pt(ht.FK,{children:[pt("code",{children:"Shift"})," + ",pt("code",{children:"Enter"})]}),description:"Multi-line queries"},{keys:pt(ht.FK,{children:[Ac," + ",pt("code",{children:"Arrow Up"})]}),description:"Previous command from the Query history"},{keys:pt(ht.FK,{children:[Ac," + ",pt("code",{children:"Arrow Down"})]}),description:"Next command from the Query history"},{keys:pt(ht.FK,{children:[Ac," + ",pt("code",{children:"click"})," by ",pt(Pn,{})]}),description:"Toggle multiple queries"},{keys:Cc,description:"Show quick autocomplete tips"}]},{title:"Graph",readMore:pt(Sc,{}),list:[{keys:pt(ht.FK,{children:[Ac," + ",pt("code",{children:"scroll Up"})," or ",pt("code",{children:"+"})]}),description:"Zoom in"},{keys:pt(ht.FK,{children:[Ac," + ",pt("code",{children:"scroll Down"})," or ",pt("code",{children:"-"})]}),description:"Zoom out"},{keys:pt(ht.FK,{children:[Ac," + ",pt("code",{children:"drag"})]}),description:"Move the graph left/right"},{keys:pt(ht.FK,{children:pt("code",{children:"click"})}),description:"Select the series in the legend"},{keys:pt(ht.FK,{children:[Ac," + ",pt("code",{children:"click"})]}),description:"Toggle multiple series in the legend"}]}],Mc="Shortcut keys",Tc=ur(),Nc=Tc?"Cmd + /":"F1",Oc=e=>{let{showTitle:n}=e;const r=je(),{value:o,setTrue:i,setFalse:a}=Rr(!1),l=(0,t.useCallback)((e=>{const t=Tc&&"/"===e.key&&e.metaKey,n=!Tc&&"F1"===e.key&&!e.metaKey;(t||n)&&i()}),[i]);return Gn("keydown",l),pt(ht.FK,{children:[pt(Pr,{open:!0!==n&&void 0,title:"".concat(Mc," (").concat(Nc,")"),placement:"bottom-center",children:pt(Ar,{className:r?"":"vm-header-button",variant:"contained",color:"primary",startIcon:pt(Cn,{}),onClick:i,ariaLabel:Mc,children:n&&Mc})}),o&&pt(_c,{title:"Shortcut keys",onClose:a,children:pt("div",{className:"vm-shortcuts",children:Ec.map((e=>pt("div",{className:"vm-shortcuts-section",children:[e.readMore&&pt("div",{className:"vm-shortcuts-section__read-more",children:e.readMore}),pt("h3",{className:"vm-shortcuts-section__title",children:e.title}),pt("div",{className:"vm-shortcuts-section-list",children:e.list.map(((t,n)=>pt("div",{className:"vm-shortcuts-section-list-item",children:[pt("div",{className:"vm-shortcuts-section-list-item__key",children:t.keys}),pt("p",{className:"vm-shortcuts-section-list-item__description",children:t.description})]},"".concat(e.title,"_").concat(n))))})]},e.title)))})})]})},Pc=e=>{let{open:t}=e;return pt("button",{className:Yn()({"vm-menu-burger":!0,"vm-menu-burger_opened":t}),"aria-label":"menu",children:pt("span",{})})},{REACT_APP_TYPE:Lc}={REACT_APP_TYPE:"logs"},Rc=Lc===Ue.logs,zc=e=>{let{background:n,color:r}=e;const{pathname:o}=te(),{isMobile:i}=dr(),a=(0,t.useRef)(null),{value:l,toggle:s,setFalse:c}=Rr(!1);return(0,t.useEffect)(c,[o]),Tr(a,c),pt("div",{className:"vm-header-sidebar",ref:a,children:[pt("div",{className:Yn()({"vm-header-sidebar-button":!0,"vm-header-sidebar-button_open":l}),onClick:s,children:pt(Pc,{open:l})}),pt("div",{className:Yn()({"vm-header-sidebar-menu":!0,"vm-header-sidebar-menu_open":l}),children:[pt("div",{children:pt(yc,{color:r,background:n,direction:"column"})}),pt("div",{className:"vm-header-sidebar-menu-settings",children:!i&&!Rc&&pt(Oc,{showTitle:!0})})]})]})},Dc=e=>{let{controlsComponent:n,isMobile:r,...o}=e;const i=je(),{pathname:a}=te(),{accountIds:l}=(()=>{const{useTenantID:e}=Fe(),n=je(),{serverUrl:r}=vt(),[o,i]=(0,t.useState)(!1),[a,l]=(0,t.useState)(),[s,c]=(0,t.useState)([]),u=(0,t.useMemo)((()=>"".concat(r.replace(/^(.+)(\/select.+)/,"$1"),"/admin/tenants")),[r]),d=(0,t.useMemo)((()=>!!He(r)),[r]),h=n?!e:!d;return(0,t.useEffect)((()=>{h||(async()=>{i(!0);try{const e=await fetch(u),t=await e.json(),n=t.data||[];c(n.sort(((e,t)=>e.localeCompare(t)))),e.ok?l(void 0):l("".concat(t.errorType,"\r\n").concat(null===t||void 0===t?void 0:t.error))}catch(Au){Au instanceof Error&&l("".concat(Au.name,": ").concat(Au.message))}i(!1)})().catch(console.error)}),[u]),{accountIds:s,isLoading:o,error:a}})(),{value:s,toggle:c,setFalse:u}=Rr(!1),d=pt(n,{...o,isMobile:r,accountIds:l,headerSetup:(0,t.useMemo)((()=>(cc[a]||{}).header||{}),[a])});return r?pt(ht.FK,{children:[pt("div",{children:pt(Ar,{className:Yn()({"vm-header-button":!i}),startIcon:pt($n,{}),onClick:c,ariaLabel:"controls"})}),pt(_c,{title:"Controls",onClose:u,isOpen:s,className:Yn()({"vm-header-controls-modal":!0,"vm-header-controls-modal_open":s}),children:d})]}):d},{REACT_APP_TYPE:Ic}={REACT_APP_TYPE:"logs"},$c=Ic===Ue.logs||Ic===Ue.anomaly,Fc=()=>{switch(Ic){case Ue.logs:return pt(un,{});case Ue.anomaly:return pt(dn,{});default:return pt(cn,{})}},jc=e=>{let{controlsComponent:n}=e;const{isMobile:r}=dr(),o=Qn(),i=(0,t.useMemo)((()=>window.innerWidth<1e3),[o]),{isDarkTheme:a}=vt(),l=je(),s=(0,t.useMemo)((()=>it(a?"color-background-block":"color-primary")),[a]),{background:c,color:u}=(0,t.useMemo)((()=>{const{headerStyles:{background:e=(l?"#FFF":s),color:t=(l?s:"#FFF")}={}}=Fe();return{background:e,color:t}}),[s]),d=re(),h=()=>{d({pathname:uc.home}),window.location.reload()};return pt("header",{className:Yn()({"vm-header":!0,"vm-header_app":l,"vm-header_dark":a,"vm-header_sidebar":i,"vm-header_mobile":r}),style:{background:c,color:u},children:[i?pt(zc,{background:c,color:u}):pt(ht.FK,{children:[!l&&pt("div",{className:Yn()({"vm-header-logo":!0,"vm-header-logo_logs":$c}),onClick:h,style:{color:u},children:pt(Fc,{})}),pt(yc,{color:u,background:c})]}),i&&pt("div",{className:Yn()({"vm-header-logo":!0,"vm-header-logo_mobile":!0,"vm-header-logo_logs":$c}),onClick:h,style:{color:u},children:pt(Fc,{})}),pt(Dc,{controlsComponent:n,displaySidebar:i,isMobile:r})]})},Vc=(0,t.memo)((()=>{const e="2019-".concat((new Date).getFullYear());return pt("footer",{className:"vm-footer",children:[pt("a",{className:"vm-link vm-footer__website",target:"_blank",href:"https://victoriametrics.com/",rel:"me noreferrer",children:[pt(hn,{}),"victoriametrics.com"]}),pt("a",{className:"vm-link vm-footer__link",target:"_blank",href:"https://docs.victoriametrics.com/MetricsQL.html",rel:"help noreferrer",children:[pt(Nn,{}),"MetricsQL"]}),pt("a",{className:"vm-link vm-footer__link",target:"_blank",href:"https://docs.victoriametrics.com/#vmui",rel:"help noreferrer",children:[pt(zn,{}),"Documentation"]}),pt("a",{className:"vm-link vm-footer__link",target:"_blank",href:"https://github.com/VictoriaMetrics/VictoriaMetrics/issues/new/choose",rel:"noreferrer",children:[pt(Dn,{}),"Create an issue"]}),pt("div",{className:"vm-footer__copyright",children:["\xa9 ",e," VictoriaMetrics"]})]})})),Hc="Enable to save the modified server URL to local storage, preventing reset upon page refresh.",Uc="Disable to stop saving the server URL to local storage, reverting to the default URL on page refresh.",Bc=e=>{let{serverUrl:n,stateServerUrl:r,onChange:o,onEnter:i}=e;const{value:a,toggle:l}=Rr(!!We("SERVER_URL")),[s,c]=(0,t.useState)("");return(0,t.useEffect)((()=>{r||c(nt.emptyServer),(e=>{let t;try{t=new URL(e)}catch(n){return!1}return"http:"===t.protocol||"https:"===t.protocol})(r)||c(nt.validServer)}),[r]),(0,t.useEffect)((()=>{a?Be("SERVER_URL",n):Ye(["SERVER_URL"])}),[a]),(0,t.useEffect)((()=>{a&&Be("SERVER_URL",n)}),[n]),pt("div",{children:[pt("div",{className:"vm-server-configurator__title",children:"Server URL"}),pt("div",{className:"vm-server-configurator-url",children:[pt(qr,{autofocus:!0,value:n,error:s,onChange:e=>{o(e||""),c("")},onEnter:i,inputmode:"url"}),pt(Pr,{title:a?Uc:Hc,children:pt(Ar,{className:"vm-server-configurator-url__button",variant:"text",color:a?"primary":"gray",onClick:l,startIcon:pt(In,{})})})]})]})},Wc=[{label:"Graph",type:tt.chart},{label:"JSON",type:tt.code},{label:"Table",type:tt.table}],Yc=e=>{let{limits:n,onChange:r,onEnter:o}=e;const{isMobile:i}=dr(),[a,l]=(0,t.useState)({table:"",chart:"",code:""}),s=e=>t=>{((e,t)=>{const o=e||"";l((e=>({...e,[t]:+o<0?nt.positiveNumber:""}))),r({...n,[t]:o||1/0})})(t,e)};return pt("div",{className:"vm-limits-configurator",children:[pt("div",{className:"vm-server-configurator__title",children:["Series limits by tabs",pt(Pr,{title:"Set to 0 to disable the limit",children:pt(Ar,{variant:"text",color:"primary",size:"small",startIcon:pt(vn,{})})}),pt("div",{className:"vm-limits-configurator-title__reset",children:pt(Ar,{variant:"text",color:"primary",size:"small",startIcon:pt(mn,{}),onClick:()=>{r(Je)},children:"Reset limits"})})]}),pt("div",{className:Yn()({"vm-limits-configurator__inputs":!0,"vm-limits-configurator__inputs_mobile":i}),children:Wc.map((e=>pt("div",{children:pt(qr,{label:e.label,value:n[e.type],error:a[e.type],onChange:s(e.type),onEnter:o,type:"number"})},e.type)))})]})},Zc=()=>pt(Pr,{title:"Browser timezone is not recognized, supported, or could not be determined.",children:pt(gn,{})}),qc=jt(),Kc=e=>{let{timezoneState:n,defaultTimezone:r,onChange:o}=e;const{isMobile:i}=dr(),a=$t(),[l,s]=(0,t.useState)(""),c=(0,t.useRef)(null),{value:u,toggle:d,setFalse:h}=Rr(!1),f=(0,t.useMemo)((()=>[{title:"Default time (".concat(r,")"),region:r,utc:r?It(r):"UTC"},{title:qc.title,region:qc.region,utc:It(qc.region),isInvalid:!qc.isValid},{title:"UTC (Coordinated Universal Time)",region:"UTC",utc:"UTC"}].filter((e=>e.region))),[r]),p=(0,t.useMemo)((()=>{if(!l)return a;try{return $t(l)}catch(Au){return{}}}),[l,a]),m=(0,t.useMemo)((()=>Object.keys(p)),[p]),v=(0,t.useMemo)((()=>({region:n,utc:It(n)})),[n]),g=e=>()=>{(e=>{o(e.region),s(""),h()})(e)};return pt("div",{className:"vm-timezones",children:[pt("div",{className:"vm-server-configurator__title",children:"Time zone"}),pt("div",{className:"vm-timezones-item vm-timezones-item_selected",onClick:d,ref:c,children:[pt("div",{className:"vm-timezones-item__title",children:v.region}),pt("div",{className:"vm-timezones-item__utc",children:v.utc}),pt("div",{className:Yn()({"vm-timezones-item__icon":!0,"vm-timezones-item__icon_open":u}),children:pt(kn,{})})]}),pt(Nr,{open:u,buttonRef:c,placement:"bottom-left",onClose:h,fullWidth:!0,title:i?"Time zone":void 0,children:pt("div",{className:Yn()({"vm-timezones-list":!0,"vm-timezones-list_mobile":i}),children:[pt("div",{className:"vm-timezones-list-header",children:[pt("div",{className:"vm-timezones-list-header__search",children:pt(qr,{autofocus:!0,label:"Search",value:l,onChange:e=>{s(e)}})}),f.map(((e,t)=>e&&pt("div",{className:"vm-timezones-item vm-timezones-list-group-options__item",onClick:g(e),children:[pt("div",{className:"vm-timezones-item__title",children:[e.title,e.isInvalid&&pt(Zc,{})]}),pt("div",{className:"vm-timezones-item__utc",children:e.utc})]},"".concat(t,"_").concat(e.region))))]}),m.map((e=>pt("div",{className:"vm-timezones-list-group",children:pt(Vr,{defaultExpanded:!0,title:pt("div",{className:"vm-timezones-list-group__title",children:e}),children:pt("div",{className:"vm-timezones-list-group-options",children:p[e]&&p[e].map((e=>pt("div",{className:"vm-timezones-item vm-timezones-list-group-options__item",onClick:g(e),children:[pt("div",{className:"vm-timezones-item__title",children:e.region}),pt("div",{className:"vm-timezones-item__utc",children:e.utc})]},e.search)))})})},e)))]})})]})},Gc=e=>{let{options:n,value:r,label:o,onChange:i}=e;const a=(0,t.useRef)(null),[l,s]=(0,t.useState)({width:"0px",left:"0px",borderRadius:"0px"}),c=e=>()=>{i(e)};return(0,t.useEffect)((()=>{if(!a.current)return void s({width:"0px",left:"0px",borderRadius:"0px"});const e=n.findIndex((e=>e.value===r)),{width:t}=a.current.getBoundingClientRect();let o=t,i=e*o,l="0";0===e&&(l="16px 0 0 16px"),e===n.length-1&&(l="10px",i-=1,l="0 16px 16px 0"),0!==e&&e!==n.length-1&&(o+=1,i-=1),s({width:"".concat(o,"px"),left:"".concat(i,"px"),borderRadius:l})}),[a,r,n]),pt("div",{className:"vm-toggles",children:[o&&pt("label",{className:"vm-toggles__label",children:o}),pt("div",{className:"vm-toggles-group",style:{gridTemplateColumns:"repeat(".concat(n.length,", 1fr)")},children:[l.borderRadius&&pt("div",{className:"vm-toggles-group__highlight",style:l}),n.map(((e,t)=>pt("div",{className:Yn()({"vm-toggles-group-item":!0,"vm-toggles-group-item_first":0===t,"vm-toggles-group-item_active":e.value===r,"vm-toggles-group-item_icon":e.icon&&e.title}),onClick:c(e.value),ref:e.value===r?a:null,children:[e.icon,e.title]},e.value)))]})]})},Qc=Object.values(rt).map((e=>({title:e,value:e}))),Jc=e=>{let{theme:t,onChange:n}=e;const{isMobile:r}=dr();return pt("div",{className:Yn()({"vm-theme-control":!0,"vm-theme-control_mobile":r}),children:[pt("div",{className:"vm-server-configurator__title",children:"Theme preferences"}),pt("div",{className:"vm-theme-control__toggle",children:pt(Gc,{options:Qc,value:t,onChange:e=>{n(e)}})},"".concat(r))]})},Xc="Settings",{REACT_APP_TYPE:eu}={REACT_APP_TYPE:"logs"},tu=eu===Ue.logs,nu=()=>{const{isMobile:e}=dr(),n=je(),{serverUrl:r,theme:o}=vt(),{timezone:i,defaultTimezone:a}=Gt(),{seriesLimits:l}=(0,t.useContext)(ir).state,s=gt(),c=Qt(),u=(0,t.useContext)(ir).dispatch,[d,h]=(0,t.useState)(r),[f,p]=(0,t.useState)(l),[m,v]=(0,t.useState)(i),{value:g,setTrue:y,setFalse:_}=Rr(!1),b=()=>{_(),h(r),p(l),v(i)},w=()=>{const e=He(d);""!==e&&s({type:"SET_TENANT_ID",payload:e}),s({type:"SET_SERVER",payload:d}),c({type:"SET_TIMEZONE",payload:m}),u({type:"SET_SERIES_LIMITS",payload:f}),_()};(0,t.useEffect)((()=>{r!==d&&h(r)}),[r]),(0,t.useEffect)((()=>{v(i)}),[i]);const k=[{show:!n&&!tu,component:pt(Bc,{stateServerUrl:r,serverUrl:d,onChange:h,onEnter:w})},{show:!tu,component:pt(Yc,{limits:f,onChange:p,onEnter:w})},{show:!0,component:pt(Kc,{timezoneState:m,defaultTimezone:a,onChange:v})},{show:!n,component:pt(Jc,{theme:o,onChange:e=>{s({type:"SET_THEME",payload:e})}})}].filter((e=>e.show));return pt(ht.FK,{children:[e?pt("div",{className:"vm-mobile-option",onClick:y,children:[pt("span",{className:"vm-mobile-option__icon",children:pt(fn,{})}),pt("div",{className:"vm-mobile-option-text",children:pt("span",{className:"vm-mobile-option-text__label",children:Xc})}),pt("span",{className:"vm-mobile-option__arrow",children:pt(wn,{})})]}):pt(Pr,{title:Xc,children:pt(Ar,{className:Yn()({"vm-header-button":!n}),variant:"contained",color:"primary",startIcon:pt(fn,{}),onClick:y,ariaLabel:"settings"})}),g&&pt(_c,{title:Xc,onClose:b,children:pt("div",{className:Yn()({"vm-server-configurator":!0,"vm-server-configurator_mobile":e}),children:[k.map(((e,t)=>pt("div",{className:"vm-server-configurator__input",children:e.component},t))),pt("div",{className:"vm-server-configurator-footer",children:[pt(Ar,{color:"error",variant:"outlined",onClick:b,children:"Cancel"}),pt(Ar,{color:"primary",variant:"contained",onClick:w,children:"Apply"})]})]})})]})},ru=e=>{let{relativeTime:t,setDuration:n}=e;const{isMobile:r}=dr();return pt("div",{className:Yn()({"vm-time-duration":!0,"vm-time-duration_mobile":r}),children:zt.map((e=>{let{id:o,duration:i,until:a,title:l}=e;return pt("div",{className:Yn()({"vm-list-item":!0,"vm-list-item_mobile":r,"vm-list-item_active":o===t}),onClick:(s={duration:i,until:a(),id:o},()=>{n(s)}),children:l||i},o);var s}))})},ou=e=>{let{viewDate:t,showArrowNav:n,onChangeViewDate:r,toggleDisplayYears:o}=e;return pt("div",{className:"vm-calendar-header",children:[pt("div",{className:"vm-calendar-header-left",onClick:o,children:[pt("span",{className:"vm-calendar-header-left__date",children:t.format("MMMM YYYY")}),pt("div",{className:"vm-calendar-header-left__select-year",children:pt(kn,{})})]}),n&&pt("div",{className:"vm-calendar-header-right",children:[pt("div",{className:"vm-calendar-header-right__prev",onClick:()=>{r(t.subtract(1,"month"))},children:pt(wn,{})}),pt("div",{className:"vm-calendar-header-right__next",onClick:()=>{r(t.add(1,"month"))},children:pt(wn,{})})]})]})},iu=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],au=e=>{let{viewDate:n,selectDate:r,onChangeSelectDate:i}=e;const a="YYYY-MM-DD",l=o()().tz().startOf("day"),s=(0,t.useMemo)((()=>{const e=new Array(42).fill(null),t=n.startOf("month"),r=n.endOf("month").diff(t,"day")+1,o=new Array(r).fill(t).map(((e,t)=>e.add(t,"day"))),i=t.day();return e.splice(i,r,...o),e}),[n]),c=e=>()=>{e&&i(e)};return pt("div",{className:"vm-calendar-body",children:[iu.map((e=>pt("div",{className:"vm-calendar-body-cell vm-calendar-body-cell_weekday",children:e[0]},e))),s.map(((e,t)=>pt("div",{className:Yn()({"vm-calendar-body-cell":!0,"vm-calendar-body-cell_day":!0,"vm-calendar-body-cell_day_empty":!e,"vm-calendar-body-cell_day_active":(e&&e.format(a))===r.format(a),"vm-calendar-body-cell_day_today":(e&&e.format(a))===l.format(a)}),onClick:c(e),children:e&&e.format("D")},e?e.format(a):t)))]})},lu=e=>{let{viewDate:n,onChangeViewDate:r}=e;const i=o()().format("YYYY"),a=(0,t.useMemo)((()=>n.format("YYYY")),[n]),l=(0,t.useMemo)((()=>{const e=o()().subtract(9,"year");return new Array(18).fill(e).map(((e,t)=>e.add(t,"year")))}),[n]);(0,t.useEffect)((()=>{const e=document.getElementById("vm-calendar-year-".concat(a));e&&e.scrollIntoView({block:"center"})}),[]);return pt("div",{className:"vm-calendar-years",children:l.map((e=>{return pt("div",{className:Yn()({"vm-calendar-years__year":!0,"vm-calendar-years__year_selected":e.format("YYYY")===a,"vm-calendar-years__year_today":e.format("YYYY")===i}),id:"vm-calendar-year-".concat(e.format("YYYY")),onClick:(t=e,()=>{r(t)}),children:e.format("YYYY")},e.format("YYYY"));var t}))})},su=e=>{let{viewDate:n,selectDate:r,onChangeViewDate:i}=e;const a=o()().format("MM"),l=(0,t.useMemo)((()=>r.format("MM")),[r]),s=(0,t.useMemo)((()=>new Array(12).fill("").map(((e,t)=>o()(n).month(t)))),[n]);(0,t.useEffect)((()=>{const e=document.getElementById("vm-calendar-year-".concat(l));e&&e.scrollIntoView({block:"center"})}),[]);const c=e=>()=>{i(e)};return pt("div",{className:"vm-calendar-years",children:s.map((e=>pt("div",{className:Yn()({"vm-calendar-years__year":!0,"vm-calendar-years__year_selected":e.format("MM")===l,"vm-calendar-years__year_today":e.format("MM")===a}),id:"vm-calendar-year-".concat(e.format("MM")),onClick:c(e),children:e.format("MMMM")},e.format("MM"))))})};var cu=function(e){return e[e.days=0]="days",e[e.months=1]="months",e[e.years=2]="years",e}(cu||{});const uu=e=>{let{date:n,format:r=_t,onChange:i}=e;const[a,l]=(0,t.useState)(cu.days),[s,c]=(0,t.useState)(o().tz(n)),[u,d]=(0,t.useState)(o().tz(n)),h=o()().startOf("day").tz(),f=h.format()===s.format(),{isMobile:p}=dr(),m=e=>{c(e),l((e=>e===cu.years?cu.months:cu.days))};return(0,t.useEffect)((()=>{u.format()!==o().tz(n).format()&&i(u.format(r))}),[u]),(0,t.useEffect)((()=>{const e=o().tz(n);c(e),d(e)}),[n]),pt("div",{className:Yn()({"vm-calendar":!0,"vm-calendar_mobile":p}),children:[pt(ou,{viewDate:s,onChangeViewDate:m,toggleDisplayYears:()=>{l((e=>e===cu.years?cu.days:cu.years))},showArrowNav:a===cu.days}),a===cu.days&&pt(au,{viewDate:s,selectDate:u,onChangeSelectDate:e=>{d(e)}}),a===cu.years&&pt(lu,{viewDate:s,onChangeViewDate:m}),a===cu.months&&pt(su,{selectDate:u,viewDate:s,onChangeViewDate:m}),!f&&a===cu.days&&pt("div",{className:"vm-calendar-footer",children:pt(Ar,{variant:"text",size:"small",onClick:()=>{c(h)},children:"show today"})})]})},du=(0,t.forwardRef)(((e,n)=>{let{date:r,targetRef:i,format:a=_t,onChange:l,label:s}=e;const c=(0,t.useMemo)((()=>o()(r).isValid()?o().tz(r):o()().tz()),[r]),{isMobile:u}=dr(),{value:d,toggle:h,setFalse:f}=Rr(!1);return Gn("click",h,i),Gn("keyup",(e=>{"Escape"!==e.key&&"Enter"!==e.key||f()})),pt(ht.FK,{children:pt(Nr,{open:d,buttonRef:i,placement:"bottom-right",onClose:f,title:u?s:void 0,children:pt("div",{ref:n,children:pt(uu,{date:c,format:a,onChange:e=>{l(e),f()}})})})})})),hu=du;var fu=n(494),pu=n.n(fu);const mu=e=>o()(e).isValid()?o().tz(e).format(_t):e,vu=e=>{let{value:n="",label:r,pickerLabel:i,pickerRef:a,onChange:l,onEnter:s}=e;const c=(0,t.useRef)(null),[u,d]=(0,t.useState)(null),[h,f]=(0,t.useState)(mu(n)),[p,m]=(0,t.useState)(!1),[v,g]=(0,t.useState)(!1),y=o()(h).isValid()?"":"Invalid date format";return(0,t.useEffect)((()=>{const e=mu(n);e!==h&&f(e),v&&(s(),g(!1))}),[n]),(0,t.useEffect)((()=>{p&&u&&(u.focus(),u.setSelectionRange(11,11),m(!1))}),[p]),pt("div",{className:Yn()({"vm-date-time-input":!0,"vm-date-time-input_error":y}),children:[pt("label",{children:r}),pt(pu(),{tabIndex:1,inputRef:d,mask:"9999-99-99 99:99:99",placeholder:"YYYY-MM-DD HH:mm:ss",value:h,autoCapitalize:"none",inputMode:"numeric",maskChar:null,onChange:e=>{f(e.currentTarget.value)},onBlur:()=>{l(h)},onKeyUp:e=>{"Enter"===e.key&&(l(h),g(!0))}}),y&&pt("span",{className:"vm-date-time-input__error-text",children:y}),pt("div",{className:"vm-date-time-input__icon",ref:c,children:pt(Ar,{variant:"text",color:"gray",size:"small",startIcon:pt(Sn,{}),ariaLabel:"calendar"})}),pt(hu,{label:i,ref:a,date:h,onChange:e=>{f(e),m(!0)},targetRef:c})]})};const gu=function(e){const n=(0,t.useRef)();return(0,t.useEffect)((()=>{n.current=e}),[e]),n.current},yu=()=>{const{isMobile:e}=dr(),{isDarkTheme:n}=vt(),r=(0,t.useRef)(null),i=Qn(),a=(0,t.useMemo)((()=>i.width>1120),[i]),[l,s]=(0,t.useState)(),[c,u]=(0,t.useState)(),{period:{end:d,start:h},relativeTime:f,timezone:p,duration:m}=Gt(),v=Qt(),g=je(),y=gu(p),{value:_,toggle:b,setFalse:w}=Rr(!1),k=(0,t.useMemo)((()=>({region:p,utc:It(p)})),[p]);(0,t.useEffect)((()=>{s(Pt(Rt(d)))}),[p,d]),(0,t.useEffect)((()=>{u(Pt(Rt(h)))}),[p,h]);const x=e=>{let{duration:t,until:n,id:r}=e;v({type:"SET_RELATIVE_TIME",payload:{duration:t,until:n,id:r}}),w()},S=(0,t.useMemo)((()=>({start:o().tz(Rt(h)).format(_t),end:o().tz(Rt(d)).format(_t)})),[h,d,p]),A=(0,t.useMemo)((()=>f&&"none"!==f?f.replace(/_/g," "):"".concat(S.start," - ").concat(S.end)),[f,S]),C=(0,t.useRef)(null),E=(0,t.useRef)(null),M=(0,t.useRef)(null),T=()=>{c&&l&&v({type:"SET_PERIOD",payload:{from:o().tz(c).toDate(),to:o().tz(l).toDate()}}),w()};return(0,t.useEffect)((()=>{const e=Dt({relativeTimeId:f,defaultDuration:m,defaultEndInput:Rt(d)});y&&p!==y&&x({id:e.relativeTimeId,duration:e.duration,until:e.endInput})}),[p,y]),Tr(r,(t=>{var n,r;if(e)return;const o=t.target,i=(null===C||void 0===C?void 0:C.current)&&(null===C||void 0===C||null===(n=C.current)||void 0===n?void 0:n.contains(o)),a=(null===E||void 0===E?void 0:E.current)&&(null===E||void 0===E||null===(r=E.current)||void 0===r?void 0:r.contains(o));i||a||w()})),pt(ht.FK,{children:[pt("div",{ref:M,children:e?pt("div",{className:"vm-mobile-option",onClick:b,children:[pt("span",{className:"vm-mobile-option__icon",children:pt(xn,{})}),pt("div",{className:"vm-mobile-option-text",children:[pt("span",{className:"vm-mobile-option-text__label",children:"Time range"}),pt("span",{className:"vm-mobile-option-text__value",children:A})]}),pt("span",{className:"vm-mobile-option__arrow",children:pt(wn,{})})]}):pt(Pr,{title:a?"Time range controls":A,children:pt(Ar,{className:g?"":"vm-header-button",variant:"contained",color:"primary",startIcon:pt(xn,{}),onClick:b,ariaLabel:"time range controls",children:a&&pt("span",{children:A})})})}),pt(Nr,{open:_,buttonRef:M,placement:"bottom-right",onClose:w,clickOutside:!1,title:e?"Time range controls":"",children:pt("div",{className:Yn()({"vm-time-selector":!0,"vm-time-selector_mobile":e}),ref:r,children:[pt("div",{className:"vm-time-selector-left",children:[pt("div",{className:Yn()({"vm-time-selector-left-inputs":!0,"vm-time-selector-left-inputs_dark":n}),children:[pt(vu,{value:c,label:"From:",pickerLabel:"Date From",pickerRef:C,onChange:u,onEnter:T}),pt(vu,{value:l,label:"To:",pickerLabel:"Date To",pickerRef:E,onChange:s,onEnter:T})]}),pt("div",{className:"vm-time-selector-left-timezone",children:[pt("div",{className:"vm-time-selector-left-timezone__title",children:k.region}),pt("div",{className:"vm-time-selector-left-timezone__utc",children:k.utc})]}),pt(Ar,{variant:"text",startIcon:pt(An,{}),onClick:()=>v({type:"RUN_QUERY_TO_NOW"}),children:"switch to now"}),pt("div",{className:"vm-time-selector-left__controls",children:[pt(Ar,{color:"error",variant:"outlined",onClick:()=>{s(Pt(Rt(d))),u(Pt(Rt(h))),w()},children:"Cancel"}),pt(Ar,{color:"primary",onClick:T,children:"Apply"})]})]}),pt(ru,{relativeTime:f||"",setDuration:x})]})})]})},_u=e=>{let{isMobile:t}=e;return pt("div",{className:Yn()({"vm-header-controls":!0,"vm-header-controls_mobile":t}),children:[pt(yu,{}),pt(nu,{})]})},bu=(Boolean(We("DISABLED_DEFAULT_TIMEZONE")),()=>{const{serverUrl:e}=vt(),[n,r]=(Qt(),(0,t.useState)(!1)),[o,i]=(0,t.useState)(""),a=async()=>{};return(0,t.useEffect)((()=>{a()}),[e]),{isLoading:n,error:o}}),wu=()=>{const e=je(),{isMobile:n}=dr(),{pathname:r}=te();bu();return(0,t.useEffect)((()=>{var e;const t="vmui for VictoriaLogs",n=null===(e=cc[uc.logs])||void 0===e?void 0:e.title;document.title=n?"".concat(n," - ").concat(t):t}),[r]),pt("section",{className:"vm-container",children:[pt(jc,{controlsComponent:_u}),pt("div",{className:Yn()({"vm-container-body":!0,"vm-container-body_mobile":n,"vm-container-body_app":e}),children:pt(ye,{})}),!e&&pt(Vc,{})]})},ku=()=>{const[e,n]=(0,t.useState)(!1);return pt(ht.FK,{children:pt(Ne,{children:pt(yr,{children:pt(ht.FK,{children:[pt(xr,{onLoaded:n}),e&&pt(we,{children:pt(_e,{path:"/",element:pt(wu,{}),children:pt(_e,{path:"/",element:pt(oc,{})})})})]})})})})},xu=e=>{e&&n.e(685).then(n.bind(n,685)).then((t=>{let{getCLS:n,getFID:r,getFCP:o,getLCP:i,getTTFB:a}=t;n(e),r(e),o(e),i(e),a(e)}))},Su=document.getElementById("root");Su&&(0,t.render)(pt(ku,{}),Su),xu()})()})(); \ No newline at end of file diff --git a/app/vlselect/vmui/static/js/main.034044a7.js.LICENSE.txt b/app/vlselect/vmui/static/js/main.8e7757ef.js.LICENSE.txt similarity index 100% rename from app/vlselect/vmui/static/js/main.034044a7.js.LICENSE.txt rename to app/vlselect/vmui/static/js/main.8e7757ef.js.LICENSE.txt diff --git a/app/vlselect/vmui/static/media/MetricsQL.10add6e7bdf0f1d98cf7.md b/app/vlselect/vmui/static/media/MetricsQL.10add6e7bdf0f1d98cf7.md deleted file mode 100644 index 3dfe43dca..000000000 --- a/app/vlselect/vmui/static/media/MetricsQL.10add6e7bdf0f1d98cf7.md +++ /dev/null @@ -1,2247 +0,0 @@ ---- -sort: 23 -weight: 23 -title: MetricsQL -menu: - docs: - parent: 'victoriametrics' - weight: 23 -aliases: -- /ExtendedPromQL.html -- /MetricsQL.html ---- - -# MetricsQL - -[VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics) implements MetricsQL - -query language inspired by [PromQL](https://prometheus.io/docs/prometheus/latest/querying/basics/). -MetricsQL is backwards-compatible with PromQL, so Grafana dashboards backed by Prometheus datasource should work -the same after switching from Prometheus to VictoriaMetrics. -However, there are some [intentional differences](https://medium.com/@romanhavronenko/victoriametrics-promql-compliance-d4318203f51e) between these two languages. - -[Standalone MetricsQL package](https://godoc.org/github.com/VictoriaMetrics/metricsql) can be used for parsing MetricsQL in external apps. - -If you are unfamiliar with PromQL, then it is suggested reading [this tutorial for beginners](https://medium.com/@valyala/promql-tutorial-for-beginners-9ab455142085) -and introduction into [basic querying via MetricsQL](https://docs.victoriametrics.com/keyConcepts.html#metricsql). - -The following functionality is implemented differently in MetricsQL compared to PromQL. This improves user experience: - -* MetricsQL takes into account the last [raw sample](https://docs.victoriametrics.com/keyconcepts/#raw-samples) before the lookbehind window - in square brackets for [increase](#increase) and [rate](#rate) functions. This allows returning the exact results users expect for `increase(metric[$__interval])` queries - instead of incomplete results Prometheus returns for such queries. Prometheus misses the increase between the last sample before the lookbehind window - and the first sample inside the lookbehind window. -* MetricsQL doesn't extrapolate [rate](#rate) and [increase](#increase) function results, so it always returns the expected results. For example, it returns - integer results from `increase()` over slow-changing integer counter. Prometheus in this case returns unexpected fractional results, - which may significantly differ from the expected results. This addresses [this issue from Prometheus](https://github.com/prometheus/prometheus/issues/3746). - See technical details about VictoriaMetrics and Prometheus calculations for [rate](#rate) - and [increase](#increase) [in this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1215#issuecomment-850305711). -* MetricsQL returns the expected non-empty responses for [rate](#rate) function when Grafana or [vmui](https://docs.victoriametrics.com/#vmui) - passes `step` values smaller than the interval between [raw samples](https://docs.victoriametrics.com/keyconcepts/#raw-samples) - to [/api/v1/query_range](https://docs.victoriametrics.com/keyconcepts/#range-query). - This addresses [this issue from Grafana](https://github.com/grafana/grafana/issues/11451). - See also [this blog post](https://www.percona.com/blog/2020/02/28/better-prometheus-rate-function-with-victoriametrics/). -* MetricsQL treats `scalar` type the same as `instant vector` without labels, since subtle differences between these types usually confuse users. - See [the corresponding Prometheus docs](https://prometheus.io/docs/prometheus/latest/querying/basics/#expression-language-data-types) for details. -* MetricsQL removes all the `NaN` values from the output, so some queries like `(-1)^0.5` return empty results in VictoriaMetrics, - while returning a series of `NaN` values in Prometheus. Note that Grafana doesn't draw any lines or dots for `NaN` values, - so the end result looks the same for both VictoriaMetrics and Prometheus. -* MetricsQL keeps metric names after applying functions, which don't change the meaning of the original time series. - For example, [min_over_time(foo)](#min_over_time) or [round(foo)](#round) leaves `foo` metric name in the result. - See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/674) for details. - -Read more about the differences between PromQL and MetricsQL in [this article](https://medium.com/@romanhavronenko/victoriametrics-promql-compliance-d4318203f51e). - -Other PromQL functionality should work the same in MetricsQL. -[File an issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues) if you notice discrepancies between PromQL and MetricsQL results other than mentioned above. - -## MetricsQL features - -MetricsQL implements [PromQL](https://medium.com/@valyala/promql-tutorial-for-beginners-9ab455142085) -and provides additional functionality mentioned below, which is aimed towards solving practical cases. -Feel free [filing a feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues) if you think MetricsQL misses certain useful functionality. - -This functionality can be evaluated at [VictoriaMetrics playground](https://play.victoriametrics.com/select/accounting/1/6a716b0f-38bc-4856-90ce-448fd713e3fe/prometheus/graph/) -or at your own [VictoriaMetrics instance](https://docs.victoriametrics.com/#how-to-start-victoriametrics). - -The list of MetricsQL features on top of PromQL: - -* Graphite-compatible filters can be passed via `{__graphite__="foo.*.bar"}` syntax. - See [these docs](https://docs.victoriametrics.com/#selecting-graphite-metrics). - VictoriaMetrics can be used as Graphite datasource in Grafana. See [these docs](https://docs.victoriametrics.com/#graphite-api-usage) for details. - See also [label_graphite_group](#label_graphite_group) function, which can be used for extracting the given groups from Graphite metric name. -* Lookbehind window in square brackets for [rollup functions](#rollup-functions) may be omitted. VictoriaMetrics automatically selects the lookbehind window - depending on the `step` query arg passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyConcepts.html#range-query) - and the real interval between [raw samples](https://docs.victoriametrics.com/keyconcepts/#raw-samples) (aka `scrape_interval`). - For instance, the following query is valid in VictoriaMetrics: `rate(node_network_receive_bytes_total)`. - It is roughly equivalent to `rate(node_network_receive_bytes_total[$__interval])` when used in Grafana. - The difference is documented in [rate() docs](#rate). -* Numeric values can contain `_` delimiters for better readability. For example, `1_234_567_890` can be used in queries instead of `1234567890`. -* [Series selectors](https://docs.victoriametrics.com/keyConcepts.html#filtering) accept multiple `or` filters. For example, `{env="prod",job="a" or env="dev",job="b"}` - selects series with `{env="prod",job="a"}` or `{env="dev",job="b"}` labels. - See [these docs](https://docs.victoriametrics.com/keyConcepts.html#filtering-by-multiple-or-filters) for details. -* Support for `group_left(*)` and `group_right(*)` for copying all the labels from time series on the `one` side - of [many-to-one operations](https://prometheus.io/docs/prometheus/latest/querying/operators/#many-to-one-and-one-to-many-vector-matches). - The copied label names may clash with the existing label names, so MetricsQL provides an ability to add prefix to the copied metric names - via `group_left(*) prefix "..."` syntax. - For example, the following query copies all the `namespace`-related labels from `kube_namespace_labels` to `kube_pod_info` series, - while adding `ns_` prefix to the copied labels: `kube_pod_info * on(namespace) group_left(*) prefix "ns_" kube_namespace_labels`. - Labels from the `on()` list aren't copied. -* [Aggregate functions](#aggregate-functions) accept arbitrary number of args. - For example, `avg(q1, q2, q3)` would return the average values for every point across time series returned by `q1`, `q2` and `q3`. -* [@ modifier](https://prometheus.io/docs/prometheus/latest/querying/basics/#modifier) can be put anywhere in the query. - For example, `sum(foo) @ end()` calculates `sum(foo)` at the `end` timestamp of the selected time range `[start ... end]`. -* Arbitrary subexpression can be used as [@ modifier](https://prometheus.io/docs/prometheus/latest/querying/basics/#modifier). - For example, `foo @ (end() - 1h)` calculates `foo` at the `end - 1 hour` timestamp on the selected time range `[start ... end]`. -* [offset](https://prometheus.io/docs/prometheus/latest/querying/basics/#offset-modifier), lookbehind window in square brackets - and `step` value for [subquery](#subqueries) may refer to the current step aka `$__interval` value from Grafana with `[Ni]` syntax. - For instance, `rate(metric[10i] offset 5i)` would return per-second rate over a range covering 10 previous steps with the offset of 5 steps. -* [offset](https://prometheus.io/docs/prometheus/latest/querying/basics/#offset-modifier) may be put anywhere in the query. For instance, `sum(foo) offset 24h`. -* Lookbehind window in square brackets and [offset](https://prometheus.io/docs/prometheus/latest/querying/basics/#offset-modifier) may be fractional. - For instance, `rate(node_network_receive_bytes_total[1.5m] offset 0.5d)`. -* The duration suffix is optional. The duration is in seconds if the suffix is missing. - For example, `rate(m[300] offset 1800)` is equivalent to `rate(m[5m]) offset 30m`. -* The duration can be placed anywhere in the query. For example, `sum_over_time(m[1h]) / 1h` is equivalent to `sum_over_time(m[1h]) / 3600`. -* Numeric values can have `K`, `Ki`, `M`, `Mi`, `G`, `Gi`, `T` and `Ti` suffixes. For example, `8K` is equivalent to `8000`, while `1.2Mi` is equivalent to `1.2*1024*1024`. -* Trailing commas on all the lists are allowed - label filters, function args and with expressions. - For instance, the following queries are valid: `m{foo="bar",}`, `f(a, b,)`, `WITH (x=y,) x`. - This simplifies maintenance of multi-line queries. -* Metric names and label names may contain any unicode letter. For example `температура{город="Київ"}` is a value MetricsQL expression. -* Metric names and labels names may contain escaped chars. For example, `foo\-bar{baz\=aa="b"}` is valid expression. - It returns time series with name `foo-bar` containing label `baz=aa` with value `b`. - Additionally, the following escape sequences are supported: - - `\xXX`, where `XX` is hexadecimal representation of the escaped ascii char. - - `\uXXXX`, where `XXXX` is a hexadecimal representation of the escaped unicode char. -* Aggregate functions support optional `limit N` suffix in order to limit the number of output series. - For example, `sum(x) by (y) limit 3` limits the number of output time series after the aggregation to 3. - All the other time series are dropped. -* [histogram_quantile](#histogram_quantile) accepts optional third arg - `boundsLabel`. - In this case it returns `lower` and `upper` bounds for the estimated percentile. - See [this issue for details](https://github.com/prometheus/prometheus/issues/5706). -* `default` binary operator. `q1 default q2` fills gaps in `q1` with the corresponding values from `q2`. See also [drop_empty_series](#drop_empty_series). -* `if` binary operator. `q1 if q2` removes values from `q1` for missing values from `q2`. -* `ifnot` binary operator. `q1 ifnot q2` removes values from `q1` for existing values from `q2`. -* `WITH` templates. This feature simplifies writing and managing complex queries. - Go to [WITH templates playground](https://play.victoriametrics.com/select/accounting/1/6a716b0f-38bc-4856-90ce-448fd713e3fe/expand-with-exprs) and try it. -* String literals may be concatenated. This is useful with `WITH` templates: - `WITH (commonPrefix="long_metric_prefix_") {__name__=commonPrefix+"suffix1"} / {__name__=commonPrefix+"suffix2"}`. -* `keep_metric_names` modifier can be applied to all the [rollup functions](#rollup-functions), [transform functions](#transform-functions) - and [binary operators](https://prometheus.io/docs/prometheus/latest/querying/operators/#binary-operators). - This modifier prevents from dropping metric names in function results. See [these docs](#keep_metric_names). - -## keep_metric_names - -By default, metric names are dropped after applying functions or [binary operators](https://prometheus.io/docs/prometheus/latest/querying/operators/#binary-operators), -since they may change the meaning of the original time series. -This may result in `duplicate time series` error when the function is applied to multiple time series with different names. -This error can be fixed by applying `keep_metric_names` modifier to the function or binary operator. - -For example: -- `rate({__name__=~"foo|bar"}) keep_metric_names` leaves `foo` and `bar` metric names in the returned time series. -- `({__name__=~"foo|bar"} / 10) keep_metric_names` leaves `foo` and `bar` metric names in the returned time series. - -## MetricsQL functions - -If you are unfamiliar with PromQL, then please read [this tutorial](https://medium.com/@valyala/promql-tutorial-for-beginners-9ab455142085) at first. - -MetricsQL provides the following functions: - -* [Rollup functions](#rollup-functions) -* [Transform functions](#transform-functions) -* [Label manipulation functions](#label-manipulation-functions) -* [Aggregate functions](#aggregate-functions) - -### Rollup functions - -**Rollup functions** (aka range functions or window functions) calculate rollups over **raw samples** -on the given lookbehind window for the [selected time series](https://docs.victoriametrics.com/keyConcepts.html#filtering). -For example, `avg_over_time(temperature[24h])` calculates the average temperature over raw samples for the last 24 hours. - -Additional details: - -* If rollup functions are used for building graphs in Grafana, then the rollup is calculated independently per each point on the graph. - For example, every point for `avg_over_time(temperature[24h])` graph shows the average temperature for the last 24 hours ending at this point. - The interval between points is set as `step` query arg passed by Grafana to [/api/v1/query_range](https://docs.victoriametrics.com/keyConcepts.html#range-query). -* If the given [series selector](https://docs.victoriametrics.com/keyConcepts.html#filtering) returns multiple time series, - then rollups are calculated individually per each returned series. -* If lookbehind window in square brackets is missing, then it is automatically set to the following value: - - To `step` value passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyConcepts.html#range-query) or [/api/v1/query](https://docs.victoriametrics.com/keyconcepts/#instant-query) - for all the [rollup functions](#rollup-functions) except of [default_rollup](#default_rollup) and [rate](#rate). This value is known as `$__interval` in Grafana or `1i` in MetricsQL. - For example, `avg_over_time(temperature)` is automatically transformed to `avg_over_time(temperature[1i])`. - - To the `max(step, scrape_interval)`, where `scrape_interval` is the interval between [raw samples](https://docs.victoriametrics.com/keyconcepts/#raw-samples) - for [default_rollup](#default_rollup) and [rate](#rate) functions. This allows avoiding unexpected gaps on the graph when `step` is smaller than `scrape_interval`. -* Every [series selector](https://docs.victoriametrics.com/keyConcepts.html#filtering) in MetricsQL must be wrapped into a rollup function. - Otherwise, it is automatically wrapped into [default_rollup](#default_rollup). For example, `foo{bar="baz"}` - is automatically converted to `default_rollup(foo{bar="baz"})` before performing the calculations. -* If something other than [series selector](https://docs.victoriametrics.com/keyConcepts.html#filtering) is passed to rollup function, - then the inner arg is automatically converted to a [subquery](#subqueries). -* All the rollup functions accept optional `keep_metric_names` modifier. If it is set, then the function keeps metric names in results. - See [these docs](#keep_metric_names). - -See also [implicit query conversions](#implicit-query-conversions). - -The list of supported rollup functions: - -#### absent_over_time - -`absent_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which returns 1 -if the given lookbehind window `d` doesn't contain raw samples. Otherwise, it returns an empty result. - -This function is supported by PromQL. - -See also [present_over_time](#present_over_time). - -#### aggr_over_time - -`aggr_over_time(("rollup_func1", "rollup_func2", ...), series_selector[d])` is a [rollup function](#rollup-functions), -which calculates all the listed `rollup_func*` for raw samples on the given lookbehind window `d`. -The calculations are performed individually per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -`rollup_func*` can contain any rollup function. For instance, `aggr_over_time(("min_over_time", "max_over_time", "rate"), m[d])` -would calculate [min_over_time](#min_over_time), [max_over_time](#max_over_time) and [rate](#rate) for `m[d]`. - -#### ascent_over_time - -`ascent_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates -ascent of raw sample values on the given lookbehind window `d`. The calculations are performed individually -per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -This function is useful for tracking height gains in GPS tracking. Metric names are stripped from the resulting rollups. - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [descent_over_time](#descent_over_time). - -#### avg_over_time - -`avg_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the average value -over raw samples on the given lookbehind window `d` per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -This function is supported by PromQL. - -See also [median_over_time](#median_over_time). - -#### changes - -`changes(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the number of times -the raw samples changed on the given lookbehind window `d` per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Unlike `changes()` in Prometheus it takes into account the change from the last sample before the given lookbehind window `d`. -See [this article](https://medium.com/@romanhavronenko/victoriametrics-promql-compliance-d4318203f51e) for details. - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [changes_prometheus](#changes_prometheus). - -#### changes_prometheus - -`changes_prometheus(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the number of times -the raw samples changed on the given lookbehind window `d` per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -It doesn't take into account the change from the last sample before the given lookbehind window `d` in the same way as Prometheus does. -See [this article](https://medium.com/@romanhavronenko/victoriametrics-promql-compliance-d4318203f51e) for details. - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [changes](#changes). - -#### count_eq_over_time - -`count_eq_over_time(series_selector[d], eq)` is a [rollup function](#rollup-functions), which calculates the number of raw samples -on the given lookbehind window `d`, which are equal to `eq`. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [count_over_time](#count_over_time), [share_eq_over_time](#share_eq_over_time) and [count_values_over_time](#count_values_over_time). - -#### count_gt_over_time - -`count_gt_over_time(series_selector[d], gt)` is a [rollup function](#rollup-functions), which calculates the number of raw samples -on the given lookbehind window `d`, which are bigger than `gt`. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [count_over_time](#count_over_time) and [share_gt_over_time](#share_gt_over_time). - -#### count_le_over_time - -`count_le_over_time(series_selector[d], le)` is a [rollup function](#rollup-functions), which calculates the number of raw samples -on the given lookbehind window `d`, which don't exceed `le`. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [count_over_time](#count_over_time) and [share_le_over_time](#share_le_over_time). - -#### count_ne_over_time - -`count_ne_over_time(series_selector[d], ne)` is a [rollup function](#rollup-functions), which calculates the number of raw samples -on the given lookbehind window `d`, which aren't equal to `ne`. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [count_over_time](#count_over_time). - -#### count_over_time - -`count_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the number of raw samples -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [count_le_over_time](#count_le_over_time), [count_gt_over_time](#count_gt_over_time), [count_eq_over_time](#count_eq_over_time) and [count_ne_over_time](#count_ne_over_time). - -#### count_values_over_time - -`count_values_over_time("label", series_selector[d])` is a [rollup function](#rollup-functions), which counts the number of raw samples -with the same value over the given lookbehind window and stores the counts in a time series with an additional `label`, which contains each initial value. -The results are calculated independently per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [count_eq_over_time](#count_eq_over_time), [count_values](#count_values) and [distinct_over_time](#distinct_over_time) and [label_match](#label_match). - -#### decreases_over_time - -`decreases_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the number of raw sample value decreases -over the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [increases_over_time](#increases_over_time). - -#### default_rollup - -`default_rollup(series_selector[d])` is a [rollup function](#rollup-functions), which returns the last raw sample value on the given lookbehind window `d` -per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -If the lookbehind window is skipped in square brackets, then it is automatically calculated as `max(step, scrape_interval)`, where `step` is the query arg value -passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyconcepts/#range-query) or [/api/v1/query](https://docs.victoriametrics.com/keyconcepts/#instant-query), -while `scrape_interval` is the interval between [raw samples](https://docs.victoriametrics.com/keyconcepts/#raw-samples) for the selected time series. -This allows avoiding unexpected gaps on the graph when `step` is smaller than the `scrape_interval`. - -#### delta - -`delta(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the difference between -the last sample before the given lookbehind window `d` and the last sample at the given lookbehind window `d` -per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -The behaviour of `delta()` function in MetricsQL is slightly different to the behaviour of `delta()` function in Prometheus. -See [this article](https://medium.com/@romanhavronenko/victoriametrics-promql-compliance-d4318203f51e) for details. - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [increase](#increase) and [delta_prometheus](#delta_prometheus). - -#### delta_prometheus - -`delta_prometheus(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the difference between -the first and the last samples at the given lookbehind window `d` per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -The behaviour of `delta_prometheus()` is close to the behaviour of `delta()` function in Prometheus. -See [this article](https://medium.com/@romanhavronenko/victoriametrics-promql-compliance-d4318203f51e) for details. - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [delta](#delta). - -#### deriv - -`deriv(series_selector[d])` is a [rollup function](#rollup-functions), which calculates per-second derivative over the given lookbehind window `d` -per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). -The derivative is calculated using linear regression. - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [deriv_fast](#deriv_fast) and [ideriv](#ideriv). - -#### deriv_fast - -`deriv_fast(series_selector[d])` is a [rollup function](#rollup-functions), which calculates per-second derivative -using the first and the last raw samples on the given lookbehind window `d` per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [deriv](#deriv) and [ideriv](#ideriv). - -#### descent_over_time - -`descent_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates descent of raw sample values -on the given lookbehind window `d`. The calculations are performed individually per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -This function is useful for tracking height loss in GPS tracking. - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [ascent_over_time](#ascent_over_time). - -#### distinct_over_time - -`distinct_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which returns the number of distinct raw sample values -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [count_values_over_time](#count_values_over_time). - -#### duration_over_time - -`duration_over_time(series_selector[d], max_interval)` is a [rollup function](#rollup-functions), which returns the duration in seconds -when time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering) were present -over the given lookbehind window `d`. It is expected that intervals between adjacent samples per each series don't exceed the `max_interval`. -Otherwise, such intervals are considered as gaps and aren't counted. - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [lifetime](#lifetime) and [lag](#lag). - -#### first_over_time - -`first_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which returns the first raw sample value -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -See also [last_over_time](#last_over_time) and [tfirst_over_time](#tfirst_over_time). - -#### geomean_over_time - -`geomean_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates [geometric mean](https://en.wikipedia.org/wiki/Geometric_mean) -over raw samples on the given lookbehind window `d` per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -#### histogram_over_time - -`histogram_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates -[VictoriaMetrics histogram](https://godoc.org/github.com/VictoriaMetrics/metrics#Histogram) over raw samples on the given lookbehind window `d`. -It is calculated individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). -The resulting histograms are useful to pass to [histogram_quantile](#histogram_quantile) for calculating quantiles -over multiple [gauges](https://docs.victoriametrics.com/keyConcepts.html#gauge). -For example, the following query calculates median temperature by country over the last 24 hours: - -`histogram_quantile(0.5, sum(histogram_over_time(temperature[24h])) by (vmrange,country))`. - -#### hoeffding_bound_lower - -`hoeffding_bound_lower(phi, series_selector[d])` is a [rollup function](#rollup-functions), which calculates -lower [Hoeffding bound](https://en.wikipedia.org/wiki/Hoeffding%27s_inequality) for the given `phi` in the range `[0...1]`. - -See also [hoeffding_bound_upper](#hoeffding_bound_upper). - -#### hoeffding_bound_upper - -`hoeffding_bound_upper(phi, series_selector[d])` is a [rollup function](#rollup-functions), which calculates -upper [Hoeffding bound](https://en.wikipedia.org/wiki/Hoeffding%27s_inequality) for the given `phi` in the range `[0...1]`. - -See also [hoeffding_bound_lower](#hoeffding_bound_lower). - -#### holt_winters - -`holt_winters(series_selector[d], sf, tf)` is a [rollup function](#rollup-functions), which calculates Holt-Winters value -(aka [double exponential smoothing](https://en.wikipedia.org/wiki/Exponential_smoothing#Double_exponential_smoothing)) for raw samples -over the given lookbehind window `d` using the given smoothing factor `sf` and the given trend factor `tf`. -Both `sf` and `tf` must be in the range `[0...1]`. It is expected that the [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering) -returns time series of [gauge type](https://docs.victoriametrics.com/keyConcepts.html#gauge). - -This function is supported by PromQL. - -See also [range_linear_regression](#range_linear_regression). - -#### idelta - -`idelta(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the difference between the last two raw samples -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [delta](#delta). - -#### ideriv - -`ideriv(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the per-second derivative based on the last two raw samples -over the given lookbehind window `d`. The derivative is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [deriv](#deriv). - -#### increase - -`increase(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the increase over the given lookbehind window `d` -per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). -It is expected that the `series_selector` returns time series of [counter type](https://docs.victoriametrics.com/keyConcepts.html#counter). - -Unlike Prometheus, it takes into account the last sample before the given lookbehind window `d` when calculating the result. -See [this article](https://medium.com/@romanhavronenko/victoriametrics-promql-compliance-d4318203f51e) for details. - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [increase_pure](#increase_pure), [increase_prometheus](#increase_prometheus) and [delta](#delta). - -#### increase_prometheus - -`increase_prometheus(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the increase -over the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). -It is expected that the `series_selector` returns time series of [counter type](https://docs.victoriametrics.com/keyConcepts.html#counter). -It doesn't take into account the last sample before the given lookbehind window `d` when calculating the result in the same way as Prometheus does. -See [this article](https://medium.com/@romanhavronenko/victoriametrics-promql-compliance-d4318203f51e) for details. - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [increase_pure](#increase_pure) and [increase](#increase). - -#### increase_pure - -`increase_pure(series_selector[d])` is a [rollup function](#rollup-functions), which works the same as [increase](#increase) except -of the following corner case - it assumes that [counters](https://docs.victoriametrics.com/keyConcepts.html#counter) always start from 0, -while [increase](#increase) ignores the first value in a series if it is too big. - -#### increases_over_time - -`increases_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the number of raw sample value increases -over the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [decreases_over_time](#decreases_over_time). - -#### integrate - -`integrate(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the integral over raw samples on the given lookbehind window `d` -per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -#### irate - -`irate(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the "instant" per-second increase rate over the last two raw samples -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). -It is expected that the `series_selector` returns time series of [counter type](https://docs.victoriametrics.com/keyConcepts.html#counter). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [rate](#rate) and [rollup_rate](#rollup_rate). - -#### lag - -`lag(series_selector[d])` is a [rollup function](#rollup-functions), which returns the duration in seconds between the last sample -on the given lookbehind window `d` and the timestamp of the current point. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [lifetime](#lifetime) and [duration_over_time](#duration_over_time). - -#### last_over_time - -`last_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which returns the last raw sample value on the given lookbehind window `d` -per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -This function is supported by PromQL. - -See also [first_over_time](#first_over_time) and [tlast_over_time](#tlast_over_time). - -#### lifetime - -`lifetime(series_selector[d])` is a [rollup function](#rollup-functions), which returns the duration in seconds between the last and the first sample -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [duration_over_time](#duration_over_time) and [lag](#lag). - -#### mad_over_time - -`mad_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates [median absolute deviation](https://en.wikipedia.org/wiki/Median_absolute_deviation) -over raw samples on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -See also [mad](#mad), [range_mad](#range_mad) and [outlier_iqr_over_time](#outlier_iqr_over_time). - -#### max_over_time - -`max_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the maximum value over raw samples -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -This function is supported by PromQL. - -See also [tmax_over_time](#tmax_over_time). - -#### median_over_time - -`median_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates median value over raw samples -on the given lookbehind window `d` per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -See also [avg_over_time](#avg_over_time). - -#### min_over_time - -`min_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the minimum value over raw samples -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -This function is supported by PromQL. - -See also [tmin_over_time](#tmin_over_time). - -#### mode_over_time - -`mode_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates [mode](https://en.wikipedia.org/wiki/Mode_(statistics)) -for raw samples on the given lookbehind window `d`. It is calculated individually per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). It is expected that raw sample values are discrete. - -#### outlier_iqr_over_time - -`outlier_iqr_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which returns the last sample on the given lookbehind window `d` -if its value is either smaller than the `q25-1.5*iqr` or bigger than `q75+1.5*iqr` where: -- `iqr` is an [Interquartile range](https://en.wikipedia.org/wiki/Interquartile_range) over raw samples on the lookbehind window `d` -- `q25` and `q75` are 25th and 75th [percentiles](https://en.wikipedia.org/wiki/Percentile) over raw samples on the lookbehind window `d`. - -The `outlier_iqr_over_time()` is useful for detecting anomalies in gauge values based on the previous history of values. -For example, `outlier_iqr_over_time(memory_usage_bytes[1h])` triggers when `memory_usage_bytes` suddenly goes outside the usual value range for the last hour. - -See also [outliers_iqr](#outliers_iqr). - -#### predict_linear - -`predict_linear(series_selector[d], t)` is a [rollup function](#rollup-functions), which calculates the value `t` seconds in the future using -linear interpolation over raw samples on the given lookbehind window `d`. The predicted value is calculated individually per each time series -returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -This function is supported by PromQL. - -See also [range_linear_regression](#range_linear_regression). - -#### present_over_time - -`present_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which returns 1 if there is at least a single raw sample -on the given lookbehind window `d`. Otherwise, an empty result is returned. - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -#### quantile_over_time - -`quantile_over_time(phi, series_selector[d])` is a [rollup function](#rollup-functions), which calculates `phi`-quantile over raw samples -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). -The `phi` value must be in the range `[0...1]`. - -This function is supported by PromQL. - -See also [quantiles_over_time](#quantiles_over_time). - -#### quantiles_over_time - -`quantiles_over_time("phiLabel", phi1, ..., phiN, series_selector[d])` is a [rollup function](#rollup-functions), which calculates `phi*`-quantiles -over raw samples on the given lookbehind window `d` per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). -The function returns individual series per each `phi*` with `{phiLabel="phi*"}` label. `phi*` values must be in the range `[0...1]`. - -See also [quantile_over_time](#quantile_over_time). - -#### range_over_time - -`range_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates value range over raw samples -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). -E.g. it calculates `max_over_time(series_selector[d]) - min_over_time(series_selector[d])`. - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -#### rate - -`rate(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the average per-second increase rate -over the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). -It is expected that the `series_selector` returns time series of [counter type](https://docs.victoriametrics.com/keyConcepts.html#counter). - -If the lookbehind window is skipped in square brackets, then it is automatically calculated as `max(step, scrape_interval)`, where `step` is the query arg value -passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyconcepts/#range-query) or [/api/v1/query](https://docs.victoriametrics.com/keyconcepts/#instant-query), -while `scrape_interval` is the interval between [raw samples](https://docs.victoriametrics.com/keyconcepts/#raw-samples) for the selected time series. -This allows avoiding unexpected gaps on the graph when `step` is smaller than the `scrape_interval`. - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [irate](#irate) and [rollup_rate](#rollup_rate). - -#### rate_over_sum - -`rate_over_sum(series_selector[d])` is a [rollup function](#rollup-functions), which calculates per-second rate over the sum of raw samples -on the given lookbehind window `d`. The calculations are performed individually per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -#### resets - -`resets(series_selector[d])` is a [rollup function](#rollup-functions), which returns the number -of [counter](https://docs.victoriametrics.com/keyConcepts.html#counter) resets over the given lookbehind window `d` -per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). -It is expected that the `series_selector` returns time series of [counter type](https://docs.victoriametrics.com/keyConcepts.html#counter). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -#### rollup - -`rollup(series_selector[d])` is a [rollup function](#rollup-functions), which calculates `min`, `max` and `avg` values for raw samples -on the given lookbehind window `d` and returns them in time series with `rollup="min"`, `rollup="max"` and `rollup="avg"` additional labels. -These values are calculated individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Optional 2nd argument `"min"`, `"max"` or `"avg"` can be passed to keep only one calculation result and without adding a label. -See also [label_match](#label_match). - -#### rollup_candlestick - -`rollup_candlestick(series_selector[d])` is a [rollup function](#rollup-functions), which calculates `open`, `high`, `low` and `close` values (aka OHLC) -over raw samples on the given lookbehind window `d` and returns them in time series with `rollup="open"`, `rollup="high"`, `rollup="low"` and `rollup="close"` additional labels. -The calculations are performed individually per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). This function is useful for financial applications. - -Optional 2nd argument `"open"`, `"high"` or `"low"` or `"close"` can be passed to keep only one calculation result and without adding a label. -See also [label_match](#label_match). - -#### rollup_delta - -`rollup_delta(series_selector[d])` is a [rollup function](#rollup-functions), which calculates differences between adjacent raw samples -on the given lookbehind window `d` and returns `min`, `max` and `avg` values for the calculated differences -and returns them in time series with `rollup="min"`, `rollup="max"` and `rollup="avg"` additional labels. -The calculations are performed individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Optional 2nd argument `"min"`, `"max"` or `"avg"` can be passed to keep only one calculation result and without adding a label. -See also [label_match](#label_match). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [rollup_increase](#rollup_increase). - -#### rollup_deriv - -`rollup_deriv(series_selector[d])` is a [rollup function](#rollup-functions), which calculates per-second derivatives -for adjacent raw samples on the given lookbehind window `d` and returns `min`, `max` and `avg` values for the calculated per-second derivatives -and returns them in time series with `rollup="min"`, `rollup="max"` and `rollup="avg"` additional labels. -The calculations are performed individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Optional 2nd argument `"min"`, `"max"` or `"avg"` can be passed to keep only one calculation result and without adding a label. -See also [label_match](#label_match). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -#### rollup_increase - -`rollup_increase(series_selector[d])` is a [rollup function](#rollup-functions), which calculates increases for adjacent raw samples -on the given lookbehind window `d` and returns `min`, `max` and `avg` values for the calculated increases -and returns them in time series with `rollup="min"`, `rollup="max"` and `rollup="avg"` additional labels. -The calculations are performed individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Optional 2nd argument `"min"`, `"max"` or `"avg"` can be passed to keep only one calculation result and without adding a label. -See also [label_match](#label_match). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. See also [rollup_delta](#rollup_delta). - -#### rollup_rate - -`rollup_rate(series_selector[d])` is a [rollup function](#rollup-functions), which calculates per-second change rates for adjacent raw samples -on the given lookbehind window `d` and returns `min`, `max` and `avg` values for the calculated per-second change rates -and returns them in time series with `rollup="min"`, `rollup="max"` and `rollup="avg"` additional labels. - -See [this article](https://valyala.medium.com/why-irate-from-prometheus-doesnt-capture-spikes-45f9896d7832) in order to understand better -when to use `rollup_rate()`. - -Optional 2nd argument `"min"`, `"max"` or `"avg"` can be passed to keep only one calculation result and without adding a label. -See also [label_match](#label_match). - -The calculations are performed individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -#### rollup_scrape_interval - -`rollup_scrape_interval(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the interval in seconds between -adjacent raw samples on the given lookbehind window `d` and returns `min`, `max` and `avg` values for the calculated interval -and returns them in time series with `rollup="min"`, `rollup="max"` and `rollup="avg"` additional labels. -The calculations are performed individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Optional 2nd argument `"min"`, `"max"` or `"avg"` can be passed to keep only one calculation result and without adding a label. -See also [label_match](#label_match). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. See also [scrape_interval](#scrape_interval). - -#### scrape_interval - -`scrape_interval(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the average interval in seconds between raw samples -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [rollup_scrape_interval](#rollup_scrape_interval). - -#### share_gt_over_time - -`share_gt_over_time(series_selector[d], gt)` is a [rollup function](#rollup-functions), which returns share (in the range `[0...1]`) of raw samples -on the given lookbehind window `d`, which are bigger than `gt`. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -This function is useful for calculating SLI and SLO. Example: `share_gt_over_time(up[24h], 0)` - returns service availability for the last 24 hours. - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [share_le_over_time](#share_le_over_time) and [count_gt_over_time](#count_gt_over_time). - -#### share_le_over_time - -`share_le_over_time(series_selector[d], le)` is a [rollup function](#rollup-functions), which returns share (in the range `[0...1]`) of raw samples -on the given lookbehind window `d`, which are smaller or equal to `le`. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -This function is useful for calculating SLI and SLO. Example: `share_le_over_time(memory_usage_bytes[24h], 100*1024*1024)` returns -the share of time series values for the last 24 hours when memory usage was below or equal to 100MB. - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [share_gt_over_time](#share_gt_over_time) and [count_le_over_time](#count_le_over_time). - -#### share_eq_over_time - -`share_eq_over_time(series_selector[d], eq)` is a [rollup function](#rollup-functions), which returns share (in the range `[0...1]`) of raw samples -on the given lookbehind window `d`, which are equal to `eq`. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [count_eq_over_time](#count_eq_over_time). - -#### stale_samples_over_time - -`stale_samples_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the number -of [staleness markers](https://docs.victoriametrics.com/vmagent.html#prometheus-staleness-markers) on the given lookbehind window `d` -per each time series matching the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -#### stddev_over_time - -`stddev_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates standard deviation over raw samples -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [stdvar_over_time](#stdvar_over_time). - -#### stdvar_over_time - -`stdvar_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates standard variance over raw samples -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [stddev_over_time](#stddev_over_time). - -#### sum_eq_over_time - -`sum_eq_over_time(series_selector[d], eq)` is a [rollup function](#rollup-function), which calculates the sum of raw sample values equal to `eq` -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [sum_over_time](#sum_over_time) and [count_eq_over_time](#count_eq_over_time). - -#### sum_gt_over_time - -`sum_gt_over_time(series_selector[d], gt)` is a [rollup function](#rollup-function), which calculates the sum of raw sample values bigger than `gt` -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [sum_over_time](#sum_over_time) and [count_gt_over_time](#count_gt_over_time). - -#### sum_le_over_time - -`sum_le_over_time(series_selector[d], le)` is a [rollup function](#rollup-function), which calculates the sum of raw sample values smaller or equal to `le` -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [sum_over_time](#sum_over_time) and [count_le_over_time](#count_le_over_time). - -#### sum_over_time - -`sum_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the sum of raw sample values -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -#### sum2_over_time - -`sum2_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the sum of squares for raw sample values -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -#### timestamp - -`timestamp(series_selector[d])` is a [rollup function](#rollup-functions), which returns the timestamp in seconds with millisecond precision for the last raw sample -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [time](#time) and [now](#now). - -#### timestamp_with_name - -`timestamp_with_name(series_selector[d])` is a [rollup function](#rollup-functions), which returns the timestamp in seconds with millisecond precision for the last raw sample -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are preserved in the resulting rollups. - -See also [timestamp](#timestamp) and [keep_metric_names](#keep_metric_names) modifier. - -#### tfirst_over_time - -`tfirst_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which returns the timestamp in seconds with millisecond precision for the first raw sample -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [first_over_time](#first_over_time). - -#### tlast_change_over_time - -`tlast_change_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which returns the timestamp in seconds with millisecond precision for the last change -per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering) on the given lookbehind window `d`. - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [last_over_time](#last_over_time). - -#### tlast_over_time - -`tlast_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which is an alias for [timestamp](#timestamp). - -See also [tlast_change_over_time](#tlast_change_over_time). - -#### tmax_over_time - -`tmax_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which returns the timestamp in seconds with millisecond precision for the raw sample -with the maximum value on the given lookbehind window `d`. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [max_over_time](#max_over_time). - -#### tmin_over_time - -`tmin_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which returns the timestamp in seconds with millisecond precision for the raw sample -with the minimum value on the given lookbehind window `d`. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [min_over_time](#min_over_time). - -#### zscore_over_time - -`zscore_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which returns [z-score](https://en.wikipedia.org/wiki/Standard_score) -for raw samples on the given lookbehind window `d`. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). - -Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -See also [zscore](#zscore), [range_trim_zscore](#range_trim_zscore) and [outlier_iqr_over_time](#outlier_iqr_over_time). - - -### Transform functions - -**Transform functions** calculate transformations over [rollup results](#rollup-functions). -For example, `abs(delta(temperature[24h]))` calculates the absolute value for every point of every time series -returned from the rollup `delta(temperature[24h])`. - -Additional details: - -* If transform function is applied directly to a [series selector](https://docs.victoriametrics.com/keyConcepts.html#filtering), - then the [default_rollup()](#default_rollup) function is automatically applied before calculating the transformations. - For example, `abs(temperature)` is implicitly transformed to `abs(default_rollup(temperature))`. -* All the transform functions accept optional `keep_metric_names` modifier. If it is set, - then the function doesn't drop metric names from the resulting time series. See [these docs](#keep_metric_names). - -See also [implicit query conversions](#implicit-query-conversions). - -The list of supported transform functions: - -#### abs - -`abs(q)` is a [transform function](#transform-functions), which calculates the absolute value for every point of every time series returned by `q`. - -This function is supported by PromQL. - -#### absent - -`absent(q)` is a [transform function](#transform-functions), which returns 1 if `q` has no points. Otherwise, returns an empty result. - -This function is supported by PromQL. - -See also [absent_over_time](#absent_over_time). - -#### acos - -`acos(q)` is a [transform function](#transform-functions), which returns [inverse cosine](https://en.wikipedia.org/wiki/Inverse_trigonometric_functions) -for every point of every time series returned by `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [asin](#asin) and [cos](#cos). - -#### acosh - -`acosh(q)` is a [transform function](#transform-functions), which returns -[inverse hyperbolic cosine](https://en.wikipedia.org/wiki/Inverse_hyperbolic_functions#Inverse_hyperbolic_cosine) for every point of every time series returned by `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [sinh](#cosh). - -#### asin - -`asin(q)` is a [transform function](#transform-functions), which returns [inverse sine](https://en.wikipedia.org/wiki/Inverse_trigonometric_functions) -for every point of every time series returned by `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [acos](#acos) and [sin](#sin). - -#### asinh - -`asinh(q)` is a [transform function](#transform-functions), which returns -[inverse hyperbolic sine](https://en.wikipedia.org/wiki/Inverse_hyperbolic_functions#Inverse_hyperbolic_sine) for every point of every time series returned by `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [sinh](#sinh). - -#### atan - -`atan(q)` is a [transform function](#transform-functions), which returns [inverse tangent](https://en.wikipedia.org/wiki/Inverse_trigonometric_functions) -for every point of every time series returned by `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [tan](#tan). - -#### atanh - -`atanh(q)` is a [transform function](#transform-functions), which returns -[inverse hyperbolic tangent](https://en.wikipedia.org/wiki/Inverse_hyperbolic_functions#Inverse_hyperbolic_tangent) for every point of every time series returned by `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [tanh](#tanh). - -#### bitmap_and - -`bitmap_and(q, mask)` is a [transform function](#transform-functions), which calculates bitwise `v & mask` for every `v` point of every time series returned from `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -#### bitmap_or - -`bitmap_or(q, mask)` is a [transform function](#transform-functions), which calculates bitwise `v | mask` for every `v` point of every time series returned from `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -#### bitmap_xor - -`bitmap_xor(q, mask)` is a [transform function](#transform-functions), which calculates bitwise `v ^ mask` for every `v` point of every time series returned from `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -#### buckets_limit - -`buckets_limit(limit, buckets)` is a [transform function](#transform-functions), which limits the number -of [histogram buckets](https://valyala.medium.com/improving-histogram-usability-for-prometheus-and-grafana-bc7e5df0e350) to the given `limit`. - -See also [prometheus_buckets](#prometheus_buckets) and [histogram_quantile](#histogram_quantile). - -#### ceil - -`ceil(q)` is a [transform function](#transform-functions), which rounds every point for every time series returned by `q` to the upper nearest integer. - -This function is supported by PromQL. - -See also [floor](#floor) and [round](#round). - -#### clamp - -`clamp(q, min, max)` is a [transform function](#transform-functions), which clamps every point for every time series returned by `q` with the given `min` and `max` values. - -This function is supported by PromQL. - -See also [clamp_min](#clamp_min) and [clamp_max](#clamp_max). - -#### clamp_max - -`clamp_max(q, max)` is a [transform function](#transform-functions), which clamps every point for every time series returned by `q` with the given `max` value. - -This function is supported by PromQL. - -See also [clamp](#clamp) and [clamp_min](#clamp_min). - -#### clamp_min - -`clamp_min(q, min)` is a [transform function](#transform-functions), which clamps every point for every time series returned by `q` with the given `min` value. - -This function is supported by PromQL. - -See also [clamp](#clamp) and [clamp_max](#clamp_max). - -#### cos - -`cos(q)` is a [transform function](#transform-functions), which returns `cos(v)` for every `v` point of every time series returned by `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [sin](#sin). - -#### cosh - -`cosh(q)` is a [transform function](#transform-functions), which returns [hyperbolic cosine](https://en.wikipedia.org/wiki/Hyperbolic_functions) -for every point of every time series returned by `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [acosh](#acosh). - -#### day_of_month - -`day_of_month(q)` is a [transform function](#transform-functions), which returns the day of month for every point of every time series returned by `q`. -It is expected that `q` returns unix timestamps. The returned values are in the range `[1...31]`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [day_of_week](#day_of_week) and [day_of_year](#day_of_year). - -#### day_of_week - -`day_of_week(q)` is a [transform function](#transform-functions), which returns the day of week for every point of every time series returned by `q`. -It is expected that `q` returns unix timestamps. The returned values are in the range `[0...6]`, where `0` means Sunday and `6` means Saturday. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [day_of_month](#day_of_month) and [day_of_year](#day_of_year). - -#### day_of_year - -`day_of_year(q)` is a [transform function](#transform-functions), which returns the day of year for every point of every time series returned by `q`. -It is expected that `q` returns unix timestamps. The returned values are in the range `[1...365]` for non-leap years, and `[1 to 366]` in leap years. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [day_of_week](#day_of_week) and [day_of_month](#day_of_month). - -#### days_in_month - -`days_in_month(q)` is a [transform function](#transform-functions), which returns the number of days in the month identified -by every point of every time series returned by `q`. It is expected that `q` returns unix timestamps. -The returned values are in the range `[28...31]`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -#### deg - -`deg(q)` is a [transform function](#transform-functions), which converts [Radians to degrees](https://en.wikipedia.org/wiki/Radian#Conversions) -for every point of every time series returned by `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [rad](#rad). - -#### drop_empty_series - -`drop_empty_series(q)` is a [transform function](#transform-functions), which drops empty series from `q`. - -This function can be used when `default` operator should be applied only to non-empty series. For example, -`drop_empty_series(temperature < 30) default 42` returns series, which have at least a single sample smaller than 30 on the selected time range, -while filling gaps in the returned series with 42. - -On the other hand `(temperature < 30) default 40` returns all the `temperature` series, even if they have no samples smaller than 30, -by replacing all the values bigger or equal to 30 with 40. - -#### end - -`end()` is a [transform function](#transform-functions), which returns the unix timestamp in seconds for the last point. -It is known as `end` query arg passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyConcepts.html#range-query). - -See also [start](#start), [time](#time) and [now](#now). - -#### exp - -`exp(q)` is a [transform function](#transform-functions), which calculates the `e^v` for every point `v` of every time series returned by `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [ln](#ln). - -#### floor - -`floor(q)` is a [transform function](#transform-functions), which rounds every point for every time series returned by `q` to the lower nearest integer. - -This function is supported by PromQL. - -See also [ceil](#ceil) and [round](#round). - -#### histogram_avg - -`histogram_avg(buckets)` is a [transform function](#transform-functions), which calculates the average value for the given `buckets`. -It can be used for calculating the average over the given time range across multiple time series. -For example, `histogram_avg(sum(histogram_over_time(response_time_duration_seconds[5m])) by (vmrange,job))` would return the average response time -per each `job` over the last 5 minutes. - -#### histogram_quantile - -`histogram_quantile(phi, buckets)` is a [transform function](#transform-functions), which calculates `phi`-[percentile](https://en.wikipedia.org/wiki/Percentile) -over the given [histogram buckets](https://valyala.medium.com/improving-histogram-usability-for-prometheus-and-grafana-bc7e5df0e350). -`phi` must be in the range `[0...1]`. For example, `histogram_quantile(0.5, sum(rate(http_request_duration_seconds_bucket[5m])) by (le))` -would return median request duration for all the requests during the last 5 minutes. - -The function accepts optional third arg - `boundsLabel`. In this case it returns `lower` and `upper` bounds for the estimated percentile with the given `boundsLabel` label. -See [this issue for details](https://github.com/prometheus/prometheus/issues/5706). - -When the [percentile](https://en.wikipedia.org/wiki/Percentile) is calculated over multiple histograms, -then all the input histograms **must** have buckets with identical boundaries, e.g. they must have the same set of `le` or `vmrange` labels. -Otherwise, the returned result may be invalid. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3231) for details. - -This function is supported by PromQL (except of the `boundLabel` arg). - -See also [histogram_quantiles](#histogram_quantiles), [histogram_share](#histogram_share) and [quantile](#quantile). - -#### histogram_quantiles - -`histogram_quantiles("phiLabel", phi1, ..., phiN, buckets)` is a [transform function](#transform-functions), which calculates the given `phi*`-quantiles -over the given [histogram buckets](https://valyala.medium.com/improving-histogram-usability-for-prometheus-and-grafana-bc7e5df0e350). -Argument `phi*` must be in the range `[0...1]`. For example, `histogram_quantiles('le', 0.3, 0.5, sum(rate(http_request_duration_seconds_bucket[5m]) by (le))`. -Each calculated quantile is returned in a separate time series with the corresponding `{phiLabel="phi*"}` label. - -See also [histogram_quantile](#histogram_quantile). - -#### histogram_share - -`histogram_share(le, buckets)` is a [transform function](#transform-functions), which calculates the share (in the range `[0...1]`) -for `buckets` that fall below `le`. This function is useful for calculating SLI and SLO. This is inverse to [histogram_quantile](#histogram_quantile). - -The function accepts optional third arg - `boundsLabel`. In this case it returns `lower` and `upper` bounds for the estimated share with the given `boundsLabel` label. - -#### histogram_stddev - -`histogram_stddev(buckets)` is a [transform function](#transform-functions), which calculates standard deviation for the given `buckets`. - -#### histogram_stdvar - -`histogram_stdvar(buckets)` is a [transform function](#transform-functions), which calculates standard variance for the given `buckets`. -It can be used for calculating standard deviation over the given time range across multiple time series. -For example, `histogram_stdvar(sum(histogram_over_time(temperature[24])) by (vmrange,country))` would return standard deviation -for the temperature per each country over the last 24 hours. - -#### hour - -`hour(q)` is a [transform function](#transform-functions), which returns the hour for every point of every time series returned by `q`. -It is expected that `q` returns unix timestamps. The returned values are in the range `[0...23]`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -#### interpolate - -`interpolate(q)` is a [transform function](#transform-functions), which fills gaps with linearly interpolated values calculated -from the last and the next non-empty points per each time series returned by `q`. - -See also [keep_last_value](#keep_last_value) and [keep_next_value](#keep_next_value). - -#### keep_last_value - -`keep_last_value(q)` is a [transform function](#transform-functions), which fills gaps with the value of the last non-empty point -in every time series returned by `q`. - -See also [keep_next_value](#keep_next_value) and [interpolate](#interpolate). - -#### keep_next_value - -`keep_next_value(q)` is a [transform function](#transform-functions), which fills gaps with the value of the next non-empty point -in every time series returned by `q`. - -See also [keep_last_value](#keep_last_value) and [interpolate](#interpolate). - -#### limit_offset - -`limit_offset(limit, offset, q)` is a [transform function](#transform-functions), which skips `offset` time series from series returned by `q` -and then returns up to `limit` of the remaining time series per each group. - -This allows implementing simple paging for `q` time series. See also [limitk](#limitk). - -#### ln - -`ln(q)` is a [transform function](#transform-functions), which calculates `ln(v)` for every point `v` of every time series returned by `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [exp](#exp) and [log2](#log2). - -#### log2 - -`log2(q)` is a [transform function](#transform-functions), which calculates `log2(v)` for every point `v` of every time series returned by `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [log10](#log10) and [ln](#ln). - -#### log10 - -`log10(q)` is a [transform function](#transform-functions), which calculates `log10(v)` for every point `v` of every time series returned by `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [log2](#log2) and [ln](#ln). - -#### minute - -`minute(q)` is a [transform function](#transform-functions), which returns the minute for every point of every time series returned by `q`. -It is expected that `q` returns unix timestamps. The returned values are in the range `[0...59]`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -#### month - -`month(q)` is a [transform function](#transform-functions), which returns the month for every point of every time series returned by `q`. -It is expected that `q` returns unix timestamps. The returned values are in the range `[1...12]`, where `1` means January and `12` means December. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -#### now - -`now()` is a [transform function](#transform-functions), which returns the current timestamp as a floating-point value in seconds. - -See also [time](#time). - -#### pi - -`pi()` is a [transform function](#transform-functions), which returns [Pi number](https://en.wikipedia.org/wiki/Pi). - -This function is supported by PromQL. - -#### rad - -`rad(q)` is a [transform function](#transform-functions), which converts [degrees to Radians](https://en.wikipedia.org/wiki/Radian#Conversions) -for every point of every time series returned by `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -See also [deg](#deg). - -#### prometheus_buckets - -`prometheus_buckets(buckets)` is a [transform function](#transform-functions), which converts -[VictoriaMetrics histogram buckets](https://valyala.medium.com/improving-histogram-usability-for-prometheus-and-grafana-bc7e5df0e350) with `vmrange` labels -to Prometheus histogram buckets with `le` labels. This may be useful for building heatmaps in Grafana. - -See also [histogram_quantile](#histogram_quantile) and [buckets_limit](#buckets_limit). - -#### rand - -`rand(seed)` is a [transform function](#transform-functions), which returns pseudo-random numbers on the range `[0...1]` with even distribution. -Optional `seed` can be used as a seed for pseudo-random number generator. - -See also [rand_normal](#rand_normal) and [rand_exponential](#rand_exponential). - -#### rand_exponential - -`rand_exponential(seed)` is a [transform function](#transform-functions), which returns pseudo-random numbers -with [exponential distribution](https://en.wikipedia.org/wiki/Exponential_distribution). Optional `seed` can be used as a seed for pseudo-random number generator. - -See also [rand](#rand) and [rand_normal](#rand_normal). - -#### rand_normal - -`rand_normal(seed)` is a [transform function](#transform-functions), which returns pseudo-random numbers -with [normal distribution](https://en.wikipedia.org/wiki/Normal_distribution). Optional `seed` can be used as a seed for pseudo-random number generator. - -See also [rand](#rand) and [rand_exponential](#rand_exponential). - -#### range_avg - -`range_avg(q)` is a [transform function](#transform-functions), which calculates the avg value across points per each time series returned by `q`. - -#### range_first - -`range_first(q)` is a [transform function](#transform-functions), which returns the value for the first point per each time series returned by `q`. - -#### range_last - -`range_last(q)` is a [transform function](#transform-functions), which returns the value for the last point per each time series returned by `q`. - -#### range_linear_regression - -`range_linear_regression(q)` is a [transform function](#transform-functions), which calculates [simple linear regression](https://en.wikipedia.org/wiki/Simple_linear_regression) -over the selected time range per each time series returned by `q`. This function is useful for capacity planning and predictions. - -#### range_mad - -`range_mad(q)` is a [transform function](#transform-functions), which calculates the [median absolute deviation](https://en.wikipedia.org/wiki/Median_absolute_deviation) -across points per each time series returned by `q`. - -See also [mad](#mad) and [mad_over_time](#mad_over_time). - -#### range_max - -`range_max(q)` is a [transform function](#transform-functions), which calculates the max value across points per each time series returned by `q`. - -#### range_median - -`range_median(q)` is a [transform function](#transform-functions), which calculates the median value across points per each time series returned by `q`. - -#### range_min - -`range_min(q)` is a [transform function](#transform-functions), which calculates the min value across points per each time series returned by `q`. - -#### range_normalize - -`range_normalize(q1, ...)` is a [transform function](#transform-functions), which normalizes values for time series returned by `q1, ...` into `[0 ... 1]` range. -This function is useful for correlating time series with distinct value ranges. - -See also [share](#share). - -#### range_quantile - -`range_quantile(phi, q)` is a [transform function](#transform-functions), which returns `phi`-quantile across points per each time series returned by `q`. -`phi` must be in the range `[0...1]`. - -#### range_stddev - -`range_stddev(q)` is a [transform function](#transform-functions), which calculates [standard deviation](https://en.wikipedia.org/wiki/Standard_deviation) -per each time series returned by `q` on the selected time range. - -#### range_stdvar - -`range_stdvar(q)` is a [transform function](#transform-functions), which calculates [standard variance](https://en.wikipedia.org/wiki/Variance) -per each time series returned by `q` on the selected time range. - -#### range_sum - -`range_sum(q)` is a [transform function](#transform-functions), which calculates the sum of points per each time series returned by `q`. - -#### range_trim_outliers - -`range_trim_outliers(k, q)` is a [transform function](#transform-functions), which drops points located farther than `k*range_mad(q)` -from the `range_median(q)`. E.g. it is equivalent to the following query: `q ifnot (abs(q - range_median(q)) > k*range_mad(q))`. - -See also [range_trim_spikes](#range_trim_spikes) and [range_trim_zscore](#range_trim_zscore). - -#### range_trim_spikes - -`range_trim_spikes(phi, q)` is a [transform function](#transform-functions), which drops `phi` percent of biggest spikes from time series returned by `q`. -The `phi` must be in the range `[0..1]`, where `0` means `0%` and `1` means `100%`. - -See also [range_trim_outliers](#range_trim_outliers) and [range_trim_zscore](#range_trim_zscore). - -#### range_trim_zscore - -`range_trim_zscore(z, q)` is a [transform function](#transform-functions), which drops points located farther than `z*range_stddev(q)` -from the `range_avg(q)`. E.g. it is equivalent to the following query: `q ifnot (abs(q - range_avg(q)) > z*range_avg(q))`. - -See also [range_trim_outliers](#range_trim_outliers) and [range_trim_spikes](#range_trim_spikes). - -#### range_zscore - -`range_zscore(q)` is a [transform function](#transform-functions), which calculates [z-score](https://en.wikipedia.org/wiki/Standard_score) -for points returned by `q`, e.g. it is equivalent to the following query: `(q - range_avg(q)) / range_stddev(q)`. - -#### remove_resets - -`remove_resets(q)` is a [transform function](#transform-functions), which removes counter resets from time series returned by `q`. - -#### round - -`round(q, nearest)` is a [transform function](#transform-functions), which rounds every point of every time series returned by `q` to the `nearest` multiple. -If `nearest` is missing then the rounding is performed to the nearest integer. - -This function is supported by PromQL. - -See also [floor](#floor) and [ceil](#ceil). - -#### ru - -`ru(free, max)` is a [transform function](#transform-functions), which calculates resource utilization in the range `[0%...100%]` for the given `free` and `max` resources. -For instance, `ru(node_memory_MemFree_bytes, node_memory_MemTotal_bytes)` returns memory utilization over [node_exporter](https://github.com/prometheus/node_exporter) metrics. - -#### running_avg - -`running_avg(q)` is a [transform function](#transform-functions), which calculates the running avg per each time series returned by `q`. - -#### running_max - -`running_max(q)` is a [transform function](#transform-functions), which calculates the running max per each time series returned by `q`. - -#### running_min - -`running_min(q)` is a [transform function](#transform-functions), which calculates the running min per each time series returned by `q`. - -#### running_sum - -`running_sum(q)` is a [transform function](#transform-functions), which calculates the running sum per each time series returned by `q`. - -#### scalar - -`scalar(q)` is a [transform function](#transform-functions), which returns `q` if `q` contains only a single time series. Otherwise, it returns nothing. - -This function is supported by PromQL. - -#### sgn - -`sgn(q)` is a [transform function](#transform-functions), which returns `1` if `v>0`, `-1` if `v<0` and `0` if `v==0` for every point `v` -of every time series returned by `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -#### sin - -`sin(q)` is a [transform function](#transform-functions), which returns `sin(v)` for every `v` point of every time series returned by `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by MetricsQL. - -See also [cos](#cos). - -#### sinh - -`sinh(q)` is a [transform function](#transform-functions), which returns [hyperbolic sine](https://en.wikipedia.org/wiki/Hyperbolic_functions) -for every point of every time series returned by `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by MetricsQL. - -See also [cosh](#cosh). - -#### tan - -`tan(q)` is a [transform function](#transform-functions), which returns `tan(v)` for every `v` point of every time series returned by `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by MetricsQL. - -See also [atan](#atan). - -#### tanh - -`tanh(q)` is a [transform function](#transform-functions), which returns [hyperbolic tangent](https://en.wikipedia.org/wiki/Hyperbolic_functions) -for every point of every time series returned by `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by MetricsQL. - -See also [atanh](#atanh). - -#### smooth_exponential - -`smooth_exponential(q, sf)` is a [transform function](#transform-functions), which smooths points per each time series returned -by `q` using [exponential moving average](https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average) with the given smooth factor `sf`. - -#### sort - -`sort(q)` is a [transform function](#transform-functions), which sorts series in ascending order by the last point in every time series returned by `q`. - -This function is supported by PromQL. - -See also [sort_desc](#sort_desc) and [sort_by_label](#sort_by_label). - -#### sort_desc - -`sort_desc(q)` is a [transform function](#transform-functions), which sorts series in descending order by the last point in every time series returned by `q`. - -This function is supported by PromQL. - -See also [sort](#sort) and [sort_by_label](#sort_by_label_desc). - -#### sqrt - -`sqrt(q)` is a [transform function](#transform-functions), which calculates square root for every point of every time series returned by `q`. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -#### start - -`start()` is a [transform function](#transform-functions), which returns unix timestamp in seconds for the first point. - -It is known as `start` query arg passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyConcepts.html#range-query). - -See also [end](#end), [time](#time) and [now](#now). - -#### step - -`step()` is a [transform function](#transform-functions), which returns the step in seconds (aka interval) between the returned points. -It is known as `step` query arg passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyConcepts.html#range-query). - -See also [start](#start) and [end](#end). - -#### time - -`time()` is a [transform function](#transform-functions), which returns unix timestamp for every returned point. - -This function is supported by PromQL. - -See also [timestamp](#timestamp), [now](#now), [start](#start) and [end](#end). - -#### timezone_offset - -`timezone_offset(tz)` is a [transform function](#transform-functions), which returns offset in seconds for the given timezone `tz` relative to UTC. -This can be useful when combining with datetime-related functions. For example, `day_of_week(time()+timezone_offset("America/Los_Angeles"))` -would return weekdays for `America/Los_Angeles` time zone. - -Special `Local` time zone can be used for returning an offset for the time zone set on the host where VictoriaMetrics runs. - -See [the list of supported timezones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - -#### ttf - -`ttf(free)` is a [transform function](#transform-functions), which estimates the time in seconds needed to exhaust `free` resources. -For instance, `ttf(node_filesystem_avail_byte)` returns the time to storage space exhaustion. This function may be useful for capacity planning. - -#### union - -`union(q1, ..., qN)` is a [transform function](#transform-functions), which returns a union of time series returned from `q1`, ..., `qN`. -The `union` function name can be skipped - the following queries are equivalent: `union(q1, q2)` and `(q1, q2)`. - -It is expected that each `q*` query returns time series with unique sets of labels. -Otherwise, only the first time series out of series with identical set of labels is returned. -Use [alias](#alias) and [label_set](#label_set) functions for giving unique labelsets per each `q*` query: - -#### vector - -`vector(q)` is a [transform function](#transform-functions), which returns `q`, e.g. it does nothing in MetricsQL. - -This function is supported by PromQL. - -#### year - -`year(q)` is a [transform function](#transform-functions), which returns the year for every point of every time series returned by `q`. -It is expected that `q` returns unix timestamps. - -Metric names are stripped from the resulting series. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. - -This function is supported by PromQL. - -### Label manipulation functions - -**Label manipulation functions** perform manipulations with labels on the selected [rollup results](#rollup-functions). - -Additional details: - -* If label manipulation function is applied directly to a [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering), - then the [default_rollup()](#default_rollup) function is automatically applied before performing the label transformation. - For example, `alias(temperature, "foo")` is implicitly transformed to `alias(default_rollup(temperature), "foo")`. - -See also [implicit query conversions](#implicit-query-conversions). - -The list of supported label manipulation functions: - -#### alias - -`alias(q, "name")` is [label manipulation function](#label-manipulation-functions), which sets the given `name` to all the time series returned by `q`. -For example, `alias(up, "foobar")` would rename `up` series to `foobar` series. - - -#### drop_common_labels - -`drop_common_labels(q1, ...., qN)` is [label manipulation function](#label-manipulation-functions), which drops common `label="value"` pairs -among time series returned from `q1, ..., qN`. - -#### label_copy - -`label_copy(q, "src_label1", "dst_label1", ..., "src_labelN", "dst_labelN")` is [label manipulation function](#label-manipulation-functions), -which copies label values from `src_label*` to `dst_label*` for all the time series returned by `q`. -If `src_label` is empty, then the corresponding `dst_label` is left untouched. - -#### label_del - -`label_del(q, "label1", ..., "labelN")` is [label manipulation function](#label-manipulation-functions), which deletes the given `label*` labels -from all the time series returned by `q`. - -#### label_graphite_group - -`label_graphite_group(q, groupNum1, ... groupNumN)` is [label manipulation function](#label-manipulation-functions), which replaces metric names -returned from `q` with the given Graphite group values concatenated via `.` char. - -For example, `label_graphite_group({__graphite__="foo*.bar.*"}, 0, 2)` would substitute `foo.bar.` metric names with `foo.`. - -This function is useful for aggregating Graphite metrics with [aggregate functions](#aggregate-functions). For example, the following query would return per-app memory usage: - -``` -sum by (__name__) ( - label_graphite_group({__graphite__="app*.host*.memory_usage"}, 0) -) -``` - -#### label_join - -`label_join(q, "dst_label", "separator", "src_label1", ..., "src_labelN")` is [label manipulation function](#label-manipulation-functions), -which joins `src_label*` values with the given `separator` and stores the result in `dst_label`. -This is performed individually per each time series returned by `q`. -For example, `label_join(up{instance="xxx",job="yyy"}, "foo", "-", "instance", "job")` would store `xxx-yyy` label value into `foo` label. - -This function is supported by PromQL. - -#### label_keep - -`label_keep(q, "label1", ..., "labelN")` is [label manipulation function](#label-manipulation-functions), which deletes all the labels -except of the listed `label*` labels in all the time series returned by `q`. - -#### label_lowercase - -`label_lowercase(q, "label1", ..., "labelN")` is [label manipulation function](#label-manipulation-functions), which lowercases values -for the given `label*` labels in all the time series returned by `q`. - -#### label_map - -`label_map(q, "label", "src_value1", "dst_value1", ..., "src_valueN", "dst_valueN")` is [label manipulation function](#label-manipulation-functions), -which maps `label` values from `src_*` to `dst*` for all the time series returned by `q`. - -#### label_match - -`label_match(q, "label", "regexp")` is [label manipulation function](#label-manipulation-functions), -which drops time series from `q` with `label` not matching the given `regexp`. -This function can be useful after [rollup](#rollup)-like functions, which may return multiple time series for every input series. - -See also [label_mismatch](#label_mismatch) and [labels_equal](#labels_equal). - -#### label_mismatch - -`label_mismatch(q, "label", "regexp")` is [label manipulation function](#label-manipulation-functions), -which drops time series from `q` with `label` matching the given `regexp`. -This function can be useful after [rollup](#rollup)-like functions, which may return multiple time series for every input series. - -See also [label_match](#label_match) and [labels_equal](#labels_equal). - -#### label_move - -`label_move(q, "src_label1", "dst_label1", ..., "src_labelN", "dst_labelN")` is [label manipulation function](#label-manipulation-functions), -which moves label values from `src_label*` to `dst_label*` for all the time series returned by `q`. -If `src_label` is empty, then the corresponding `dst_label` is left untouched. - -#### label_replace - -`label_replace(q, "dst_label", "replacement", "src_label", "regex")` is [label manipulation function](#label-manipulation-functions), -which applies the given `regex` to `src_label` and stores the `replacement` in `dst_label` if the given `regex` matches `src_label`. -The `replacement` may contain references to regex captures such as `$1`, `$2`, etc. -These references are substituted by the corresponding regex captures. -For example, `label_replace(up{job="node-exporter"}, "foo", "bar-$1", "job", "node-(.+)")` would store `bar-exporter` label value into `foo` label. - -This function is supported by PromQL. - -#### label_set - -`label_set(q, "label1", "value1", ..., "labelN", "valueN")` is [label manipulation function](#label-manipulation-functions), -which sets `{label1="value1", ..., labelN="valueN"}` labels to all the time series returned by `q`. - -#### label_transform - -`label_transform(q, "label", "regexp", "replacement")` is [label manipulation function](#label-manipulation-functions), -which substitutes all the `regexp` occurrences by the given `replacement` in the given `label`. - -#### label_uppercase - -`label_uppercase(q, "label1", ..., "labelN")` is [label manipulation function](#label-manipulation-functions), -which uppercases values for the given `label*` labels in all the time series returned by `q`. - -See also [label_lowercase](#label_lowercase). - -#### label_value - -`label_value(q, "label")` is [label manipulation function](#label-manipulation-functions), which returns numeric values -for the given `label` for every time series returned by `q`. - -For example, if `label_value(foo, "bar")` is applied to `foo{bar="1.234"}`, then it will return a time series -`foo{bar="1.234"}` with `1.234` value. Function will return no data for non-numeric label values. - -#### labels_equal - -`labels_equal(q, "label1", "label2", ...)` is [label manipulation function](#label-manipulation-functions), which returns `q` series with identical values for the listed labels -"label1", "label2", etc. - -See also [label_match](#label_match) and [label_mismatch](#label_mismatch). - -#### sort_by_label - -`sort_by_label(q, "label1", ... "labelN")` is [label manipulation function](#label-manipulation-functions), which sorts series in ascending order by the given set of labels. -For example, `sort_by_label(foo, "bar")` would sort `foo` series by values of the label `bar` in these series. - -See also [sort_by_label_desc](#sort_by_label_desc) and [sort_by_label_numeric](#sort_by_label_numeric). - -#### sort_by_label_desc - -`sort_by_label_desc(q, "label1", ... "labelN")` is [label manipulation function](#label-manipulation-functions), which sorts series in descending order by the given set of labels. -For example, `sort_by_label(foo, "bar")` would sort `foo` series by values of the label `bar` in these series. - -See also [sort_by_label](#sort_by_label) and [sort_by_label_numeric_desc](#sort_by_label_numeric_desc). - -#### sort_by_label_numeric - -`sort_by_label_numeric(q, "label1", ... "labelN")` is [label manipulation function](#label-manipulation-functions), which sorts series in ascending order by the given set of labels -using [numeric sort](https://www.gnu.org/software/coreutils/manual/html_node/Version-sort-is-not-the-same-as-numeric-sort.html). -For example, if `foo` series have `bar` label with values `1`, `101`, `15` and `2`, then `sort_by_label_numeric(foo, "bar")` would return series -in the following order of `bar` label values: `1`, `2`, `15` and `101`. - -See also [sort_by_label_numeric_desc](#sort_by_label_numeric_desc) and [sort_by_label](#sort_by_label). - -#### sort_by_label_numeric_desc - -`sort_by_label_numeric_desc(q, "label1", ... "labelN")` is [label manipulation function](#label-manipulation-functions), which sorts series in descending order -by the given set of labels using [numeric sort](https://www.gnu.org/software/coreutils/manual/html_node/Version-sort-is-not-the-same-as-numeric-sort.html). -For example, if `foo` series have `bar` label with values `1`, `101`, `15` and `2`, then `sort_by_label_numeric(foo, "bar")` -would return series in the following order of `bar` label values: `101`, `15`, `2` and `1`. - -See also [sort_by_label_numeric](#sort_by_label_numeric) and [sort_by_label_desc](#sort_by_label_desc). - - -### Aggregate functions - -**Aggregate functions** calculate aggregates over groups of [rollup results](#rollup-functions). - -Additional details: - -* By default, a single group is used for aggregation. Multiple independent groups can be set up by specifying grouping labels - in `by` and `without` modifiers. For example, `count(up) by (job)` would group [rollup results](#rollup-functions) by `job` label value - and calculate the [count](#count) aggregate function independently per each group, while `count(up) without (instance)` - would group [rollup results](#rollup-functions) by all the labels except `instance` before calculating [count](#count) aggregate function independently per each group. - Multiple labels can be put in `by` and `without` modifiers. -* If the aggregate function is applied directly to a [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering), - then the [default_rollup()](#default_rollup) function is automatically applied before calculating the aggregate. - For example, `count(up)` is implicitly transformed to `count(default_rollup(up))`. -* Aggregate functions accept arbitrary number of args. For example, `avg(q1, q2, q3)` would return the average values for every point - across time series returned by `q1`, `q2` and `q3`. -* Aggregate functions support optional `limit N` suffix, which can be used for limiting the number of output groups. - For example, `sum(x) by (y) limit 3` limits the number of groups for the aggregation to 3. All the other groups are ignored. - -See also [implicit query conversions](#implicit-query-conversions). - -The list of supported aggregate functions: - -#### any - -`any(q) by (group_labels)` is [aggregate function](#aggregate-functions), which returns a single series per `group_labels` out of time series returned by `q`. - -See also [group](#group). - -#### avg - -`avg(q) by (group_labels)` is [aggregate function](#aggregate-functions), which returns the average value per `group_labels` for time series returned by `q`. -The aggregate is calculated individually per each group of points with the same timestamp. - -This function is supported by PromQL. - -#### bottomk - -`bottomk(k, q)` is [aggregate function](#aggregate-functions), which returns up to `k` points with the smallest values across all the time series returned by `q`. -The aggregate is calculated individually per each group of points with the same timestamp. - -This function is supported by PromQL. - -See also [topk](#topk), [bottomk_min](#bottomk_min) and [#bottomk_last](#bottomk_last). - -#### bottomk_avg - -`bottomk_avg(k, q, "other_label=other_value")` is [aggregate function](#aggregate-functions), which returns up to `k` time series from `q` with the smallest averages. -If an optional `other_label=other_value` arg is set, then the sum of the remaining time series is returned with the given label. -For example, `bottomk_avg(3, sum(process_resident_memory_bytes) by (job), "job=other")` would return up to 3 time series -with the smallest averages plus a time series with `{job="other"}` label with the sum of the remaining series if any. - -See also [topk_avg](#topk_avg). - -#### bottomk_last - -`bottomk_last(k, q, "other_label=other_value")` is [aggregate function](#aggregate-functions), which returns up to `k` time series from `q` with the smallest last values. -If an optional `other_label=other_value` arg is set, then the sum of the remaining time series is returned with the given label. -For example, `bottomk_max(3, sum(process_resident_memory_bytes) by (job), "job=other")` would return up to 3 time series -with the smallest maximums plus a time series with `{job="other"}` label with the sum of the remaining series if any. - -See also [topk_last](#topk_last). - -#### bottomk_max - -`bottomk_max(k, q, "other_label=other_value")` is [aggregate function](#aggregate-functions), which returns up to `k` time series from `q` with the smallest maximums. -If an optional `other_label=other_value` arg is set, then the sum of the remaining time series is returned with the given label. -For example, `bottomk_max(3, sum(process_resident_memory_bytes) by (job), "job=other")` would return up to 3 time series -with the smallest maximums plus a time series with `{job="other"}` label with the sum of the remaining series if any. - -See also [topk_max](#topk_max). - -#### bottomk_median - -`bottomk_median(k, q, "other_label=other_value")` is [aggregate function](#aggregate-functions), which returns up to `k` time series from `q` with the smallest medians. -If an optional`other_label=other_value` arg is set, then the sum of the remaining time series is returned with the given label. -For example, `bottomk_median(3, sum(process_resident_memory_bytes) by (job), "job=other")` would return up to 3 time series -with the smallest medians plus a time series with `{job="other"}` label with the sum of the remaining series if any. - -See also [topk_median](#topk_median). - -#### bottomk_min - -`bottomk_min(k, q, "other_label=other_value")` is [aggregate function](#aggregate-functions), which returns up to `k` time series from `q` with the smallest minimums. -If an optional `other_label=other_value` arg is set, then the sum of the remaining time series is returned with the given label. -For example, `bottomk_min(3, sum(process_resident_memory_bytes) by (job), "job=other")` would return up to 3 time series -with the smallest minimums plus a time series with `{job="other"}` label with the sum of the remaining series if any. - -See also [topk_min](#topk_min). - -#### count - -`count(q) by (group_labels)` is [aggregate function](#aggregate-functions), which returns the number of non-empty points per `group_labels` -for time series returned by `q`. The aggregate is calculated individually per each group of points with the same timestamp. - -This function is supported by PromQL. - -#### count_values - -`count_values("label", q)` is [aggregate function](#aggregate-functions), which counts the number of points with the same value -and stores the counts in a time series with an additional `label`, which contains each initial value. -The aggregate is calculated individually per each group of points with the same timestamp. - -This function is supported by PromQL. - -See also [count_values_over_time](#count_values_over_time) and [label_match](#label_match). - -#### distinct - -`distinct(q)` is [aggregate function](#aggregate-functions), which calculates the number of unique values per each group of points with the same timestamp. - -See also [distinct_over_time](#distinct_over_time). - -#### geomean - -`geomean(q)` is [aggregate function](#aggregate-functions), which calculates geometric mean per each group of points with the same timestamp. - -#### group - -`group(q) by (group_labels)` is [aggregate function](#aggregate-functions), which returns `1` per each `group_labels` for time series returned by `q`. - -This function is supported by PromQL. See also [any](#any). - -#### histogram - -`histogram(q)` is [aggregate function](#aggregate-functions), which calculates -[VictoriaMetrics histogram](https://valyala.medium.com/improving-histogram-usability-for-prometheus-and-grafana-bc7e5df0e350) -per each group of points with the same timestamp. Useful for visualizing big number of time series via a heatmap. -See [this article](https://medium.com/@valyala/improving-histogram-usability-for-prometheus-and-grafana-bc7e5df0e350) for more details. - -See also [histogram_over_time](#histogram_over_time) and [histogram_quantile](#histogram_quantile). - -#### limitk - -`limitk(k, q) by (group_labels)` is [aggregate function](#aggregate-functions), which returns up to `k` time series per each `group_labels` -out of time series returned by `q`. The returned set of time series remain the same across calls. - -See also [limit_offset](#limit_offset). - -#### mad - -`mad(q) by (group_labels)` is [aggregate function](#aggregate-functions), which returns the [Median absolute deviation](https://en.wikipedia.org/wiki/Median_absolute_deviation) -per each `group_labels` for all the time series returned by `q`. The aggregate is calculated individually per each group of points with the same timestamp. - -See also [range_mad](#range_mad), [mad_over_time](#mad_over_time), [outliers_mad](#outliers_mad) and [stddev](#stddev). - -#### max - -`max(q) by (group_labels)` is [aggregate function](#aggregate-functions), which returns the maximum value per each `group_labels` -for all the time series returned by `q`. The aggregate is calculated individually per each group of points with the same timestamp. - -This function is supported by PromQL. - -#### median - -`median(q) by (group_labels)` is [aggregate function](#aggregate-functions), which returns the median value per each `group_labels` -for all the time series returned by `q`. The aggregate is calculated individually per each group of points with the same timestamp. - -#### min - -`min(q) by (group_labels)` is [aggregate function](#aggregate-functions), which returns the minimum value per each `group_labels` -for all the time series returned by `q`. The aggregate is calculated individually per each group of points with the same timestamp. - -This function is supported by PromQL. - -#### mode - -`mode(q) by (group_labels)` is [aggregate function](#aggregate-functions), which returns [mode](https://en.wikipedia.org/wiki/Mode_(statistics)) -per each `group_labels` for all the time series returned by `q`. The aggregate is calculated individually per each group of points with the same timestamp. - -#### outliers_iqr - -`outliers_iqr(q)` is [aggregate function](#aggregate-functions), which returns time series from `q` with at least a single point -outside e.g. [Interquartile range outlier bounds](https://en.wikipedia.org/wiki/Interquartile_range) `[q25-1.5*iqr .. q75+1.5*iqr]` -comparing to other time series at the given point, where: -- `iqr` is an [Interquartile range](https://en.wikipedia.org/wiki/Interquartile_range) calculated independently per each point on the graph across `q` series. -- `q25` and `q75` are 25th and 75th [percentiles](https://en.wikipedia.org/wiki/Percentile) calculated independently per each point on the graph across `q` series. - -The `outliers_iqr()` is useful for detecting anomalous series in the group of series. For example, `outliers_iqr(temperature) by (country)` returns -per-country series with anomalous outlier values comparing to the rest of per-country series. - -See also [outliers_mad](#outliers_mad), [outliersk](#outliersk) and [outlier_iqr_over_time](#outlier_iqr_over_time). - -#### outliers_mad - -`outliers_mad(tolerance, q)` is [aggregate function](#aggregate-functions), which returns time series from `q` with at least -a single point outside [Median absolute deviation](https://en.wikipedia.org/wiki/Median_absolute_deviation) (aka MAD) multiplied by `tolerance`. -E.g. it returns time series with at least a single point below `median(q) - mad(q)` or a single point above `median(q) + mad(q)`. - -See also [outliers_iqr](#outliers_iqr), [outliersk](#outliersk) and [mad](#mad). - -#### outliersk - -`outliersk(k, q)` is [aggregate function](#aggregate-functions), which returns up to `k` time series with the biggest standard deviation (aka outliers) -out of time series returned by `q`. - -See also [outliers_iqr](#outliers_iqr) and [outliers_mad](#outliers_mad). - -#### quantile - -`quantile(phi, q) by (group_labels)` is [aggregate function](#aggregate-functions), which calculates `phi`-quantile per each `group_labels` -for all the time series returned by `q`. `phi` must be in the range `[0...1]`. -The aggregate is calculated individually per each group of points with the same timestamp. - -This function is supported by PromQL. - -See also [quantiles](#quantiles) and [histogram_quantile](#histogram_quantile). - -#### quantiles - -`quantiles("phiLabel", phi1, ..., phiN, q)` is [aggregate function](#aggregate-functions), which calculates `phi*`-quantiles for all the time series -returned by `q` and return them in time series with `{phiLabel="phi*"}` label. `phi*` must be in the range `[0...1]`. -The aggregate is calculated individually per each group of points with the same timestamp. - -See also [quantile](#quantile). - -#### share - -`share(q) by (group_labels)` is [aggregate function](#aggregate-functions), which returns shares in the range `[0..1]` -for every non-negative points returned by `q` per each timestamp, so the sum of shares per each `group_labels` equals 1. - -This function is useful for normalizing [histogram bucket](https://docs.victoriametrics.com/keyConcepts.html#histogram) shares -into `[0..1]` range: - -```metricsql -share( - sum( - rate(http_request_duration_seconds_bucket[5m]) - ) by (le, vmrange) -) -``` - -See also [range_normalize](#range_normalize). - -#### stddev - -`stddev(q) by (group_labels)` is [aggregate function](#aggregate-functions), which calculates standard deviation per each `group_labels` -for all the time series returned by `q`. The aggregate is calculated individually per each group of points with the same timestamp. - -This function is supported by PromQL. - -#### stdvar - -`stdvar(q) by (group_labels)` is [aggregate function](#aggregate-functions), which calculates standard variance per each `group_labels` -for all the time series returned by `q`. The aggregate is calculated individually per each group of points with the same timestamp. - -This function is supported by PromQL. - -#### sum - -`sum(q) by (group_labels)` is [aggregate function](#aggregate-functions), which returns the sum per each `group_labels` -for all the time series returned by `q`. The aggregate is calculated individually per each group of points with the same timestamp. - -This function is supported by PromQL. - -#### sum2 - -`sum2(q) by (group_labels)` is [aggregate function](#aggregate-functions), which calculates the sum of squares per each `group_labels` -for all the time series returned by `q`. The aggregate is calculated individually per each group of points with the same timestamp. - -#### topk - -`topk(k, q)` is [aggregate function](#aggregate-functions), which returns up to `k` points with the biggest values across all the time series returned by `q`. -The aggregate is calculated individually per each group of points with the same timestamp. - -This function is supported by PromQL. - -See also [bottomk](#bottomk), [topk_max](#topk_max) and [topk_last](#topk_last). - -#### topk_avg - -`topk_avg(k, q, "other_label=other_value")` is [aggregate function](#aggregate-functions), which returns up to `k` time series from `q` with the biggest averages. -If an optional `other_label=other_value` arg is set, then the sum of the remaining time series is returned with the given label. -For example, `topk_avg(3, sum(process_resident_memory_bytes) by (job), "job=other")` would return up to 3 time series with the biggest averages -plus a time series with `{job="other"}` label with the sum of the remaining series if any. - -See also [bottomk_avg](#bottomk_avg). - -#### topk_last - -`topk_last(k, q, "other_label=other_value")` is [aggregate function](#aggregate-functions), which returns up to `k` time series from `q` with the biggest last values. -If an optional `other_label=other_value` arg is set, then the sum of the remaining time series is returned with the given label. -For example, `topk_max(3, sum(process_resident_memory_bytes) by (job), "job=other")` would return up to 3 time series with the biggest maximums -plus a time series with `{job="other"}` label with the sum of the remaining series if any. - -See also [bottomk_last](#bottomk_last). - -#### topk_max - -`topk_max(k, q, "other_label=other_value")` is [aggregate function](#aggregate-functions), which returns up to `k` time series from `q` with the biggest maximums. -If an optional `other_label=other_value` arg is set, then the sum of the remaining time series is returned with the given label. -For example, `topk_max(3, sum(process_resident_memory_bytes) by (job), "job=other")` would return up to 3 time series with the biggest maximums -plus a time series with `{job="other"}` label with the sum of the remaining series if any. - -See also [bottomk_max](#bottomk_max). - -#### topk_median - -`topk_median(k, q, "other_label=other_value")` is [aggregate function](#aggregate-functions), which returns up to `k` time series from `q` with the biggest medians. -If an optional `other_label=other_value` arg is set, then the sum of the remaining time series is returned with the given label. -For example, `topk_median(3, sum(process_resident_memory_bytes) by (job), "job=other")` would return up to 3 time series with the biggest medians -plus a time series with `{job="other"}` label with the sum of the remaining series if any. - -See also [bottomk_median](#bottomk_median). - -#### topk_min - -`topk_min(k, q, "other_label=other_value")` is [aggregate function](#aggregate-functions), which returns up to `k` time series from `q` with the biggest minimums. -If an optional `other_label=other_value` arg is set, then the sum of the remaining time series is returned with the given label. -For example, `topk_min(3, sum(process_resident_memory_bytes) by (job), "job=other")` would return up to 3 time series with the biggest minimums -plus a time series with `{job="other"}` label with the sum of the remaining series if any. - -See also [bottomk_min](#bottomk_min). - -#### zscore - -`zscore(q) by (group_labels)` is [aggregate function](#aggregate-functions), which returns [z-score](https://en.wikipedia.org/wiki/Standard_score) values -per each `group_labels` for all the time series returned by `q`. The aggregate is calculated individually per each group of points with the same timestamp. -This function is useful for detecting anomalies in the group of related time series. - -See also [zscore_over_time](#zscore_over_time), [range_trim_zscore](#range_trim_zscore) and [outliers_iqr](#outliers_iqr). - -## Subqueries - -MetricsQL supports and extends PromQL subqueries. See [this article](https://valyala.medium.com/prometheus-subqueries-in-victoriametrics-9b1492b720b3) for details. -Any [rollup function](#rollup-functions) for something other than [series selector](https://docs.victoriametrics.com/keyConcepts.html#filtering) form a subquery. -Nested rollup functions can be implicit thanks to the [implicit query conversions](#implicit-query-conversions). -For example, `delta(sum(m))` is implicitly converted to `delta(sum(default_rollup(m))[1i:1i])`, so it becomes a subquery, -since it contains [default_rollup](#default_rollup) nested into [delta](#delta). - -VictoriaMetrics performs subqueries in the following way: - -* It calculates the inner rollup function using the `step` value from the outer rollup function. - For example, for expression `max_over_time(rate(http_requests_total[5m])[1h:30s])` the inner function `rate(http_requests_total[5m])` - is calculated with `step=30s`. The resulting data points are aligned by the `step`. -* It calculates the outer rollup function over the results of the inner rollup function using the `step` value - passed by Grafana to [/api/v1/query_range](https://docs.victoriametrics.com/keyConcepts.html#range-query). - -## Implicit query conversions - -VictoriaMetrics performs the following implicit conversions for incoming queries before starting the calculations: - -* If lookbehind window in square brackets is missing inside [rollup function](#rollup-functions), then it is automatically set to the following value: - - To `step` value passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyConcepts.html#range-query) or [/api/v1/query](https://docs.victoriametrics.com/keyconcepts/#instant-query) - for all the [rollup functions](#rollup-functions) except of [default_rollup](#default_rollup) and [rate](#rate). This value is known as `$__interval` in Grafana or `1i` in MetricsQL. - For example, `avg_over_time(temperature)` is automatically transformed to `avg_over_time(temperature[1i])`. - - To the `max(step, scrape_interval)`, where `scrape_interval` is the interval between [raw samples](https://docs.victoriametrics.com/keyconcepts/#raw-samples) - for [default_rollup](#default_rollup) and [rate](#rate) functions. This allows avoiding unexpected gaps on the graph when `step` is smaller than `scrape_interval`. -* All the [series selectors](https://docs.victoriametrics.com/keyConcepts.html#filtering), - which aren't wrapped into [rollup functions](#rollup-functions), are automatically wrapped into [default_rollup](#default_rollup) function. - Examples: - * `foo` is transformed to `default_rollup(foo)` - * `foo + bar` is transformed to `default_rollup(foo) + default_rollup(bar)` - * `count(up)` is transformed to `count(default_rollup(up))`, because [count](#count) isn't a [rollup function](#rollup-functions) - - it is [aggregate function](#aggregate-functions) - * `abs(temperature)` is transformed to `abs(default_rollup(temperature))`, because [abs](#abs) isn't a [rollup function](#rollup-functions) - - it is [transform function](#transform-functions) -* If `step` in square brackets is missing inside [subquery](#subqueries), then `1i` step is automatically added there. - For example, `avg_over_time(rate(http_requests_total[5m])[1h])` is automatically converted to `avg_over_time(rate(http_requests_total[5m])[1h:1i])`. -* If something other than [series selector](https://docs.victoriametrics.com/keyConcepts.html#filtering) - is passed to [rollup function](#rollup-functions), then a [subquery](#subqueries) with `1i` lookbehind window and `1i` step is automatically formed. - For example, `rate(sum(up))` is automatically converted to `rate((sum(default_rollup(up)))[1i:1i])`. diff --git a/app/vmselect/vmui/static/media/MetricsQL.10add6e7bdf0f1d98cf7.md b/app/vlselect/vmui/static/media/MetricsQL.da86c2db4f0b05e286b0.md similarity index 95% rename from app/vmselect/vmui/static/media/MetricsQL.10add6e7bdf0f1d98cf7.md rename to app/vlselect/vmui/static/media/MetricsQL.da86c2db4f0b05e286b0.md index 3dfe43dca..7f3ccc498 100644 --- a/app/vmselect/vmui/static/media/MetricsQL.10add6e7bdf0f1d98cf7.md +++ b/app/vlselect/vmui/static/media/MetricsQL.da86c2db4f0b05e286b0.md @@ -22,7 +22,7 @@ However, there are some [intentional differences](https://medium.com/@romanhavro [Standalone MetricsQL package](https://godoc.org/github.com/VictoriaMetrics/metricsql) can be used for parsing MetricsQL in external apps. If you are unfamiliar with PromQL, then it is suggested reading [this tutorial for beginners](https://medium.com/@valyala/promql-tutorial-for-beginners-9ab455142085) -and introduction into [basic querying via MetricsQL](https://docs.victoriametrics.com/keyConcepts.html#metricsql). +and introduction into [basic querying via MetricsQL](https://docs.victoriametrics.com/keyconcepts/#metricsql). The following functionality is implemented differently in MetricsQL compared to PromQL. This improves user experience: @@ -70,15 +70,15 @@ The list of MetricsQL features on top of PromQL: VictoriaMetrics can be used as Graphite datasource in Grafana. See [these docs](https://docs.victoriametrics.com/#graphite-api-usage) for details. See also [label_graphite_group](#label_graphite_group) function, which can be used for extracting the given groups from Graphite metric name. * Lookbehind window in square brackets for [rollup functions](#rollup-functions) may be omitted. VictoriaMetrics automatically selects the lookbehind window - depending on the `step` query arg passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyConcepts.html#range-query) + depending on the `step` query arg passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyconcepts/#range-query) and the real interval between [raw samples](https://docs.victoriametrics.com/keyconcepts/#raw-samples) (aka `scrape_interval`). For instance, the following query is valid in VictoriaMetrics: `rate(node_network_receive_bytes_total)`. It is roughly equivalent to `rate(node_network_receive_bytes_total[$__interval])` when used in Grafana. The difference is documented in [rate() docs](#rate). * Numeric values can contain `_` delimiters for better readability. For example, `1_234_567_890` can be used in queries instead of `1234567890`. -* [Series selectors](https://docs.victoriametrics.com/keyConcepts.html#filtering) accept multiple `or` filters. For example, `{env="prod",job="a" or env="dev",job="b"}` +* [Series selectors](https://docs.victoriametrics.com/keyconcepts/#filtering) accept multiple `or` filters. For example, `{env="prod",job="a" or env="dev",job="b"}` selects series with `{env="prod",job="a"}` or `{env="dev",job="b"}` labels. - See [these docs](https://docs.victoriametrics.com/keyConcepts.html#filtering-by-multiple-or-filters) for details. + See [these docs](https://docs.victoriametrics.com/keyconcepts/#filtering-by-multiple-or-filters) for details. * Support for `group_left(*)` and `group_right(*)` for copying all the labels from time series on the `one` side of [many-to-one operations](https://prometheus.io/docs/prometheus/latest/querying/operators/#many-to-one-and-one-to-many-vector-matches). The copied label names may clash with the existing label names, so MetricsQL provides an ability to add prefix to the copied metric names @@ -153,26 +153,26 @@ MetricsQL provides the following functions: ### Rollup functions **Rollup functions** (aka range functions or window functions) calculate rollups over **raw samples** -on the given lookbehind window for the [selected time series](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window for the [selected time series](https://docs.victoriametrics.com/keyconcepts/#filtering). For example, `avg_over_time(temperature[24h])` calculates the average temperature over raw samples for the last 24 hours. Additional details: * If rollup functions are used for building graphs in Grafana, then the rollup is calculated independently per each point on the graph. For example, every point for `avg_over_time(temperature[24h])` graph shows the average temperature for the last 24 hours ending at this point. - The interval between points is set as `step` query arg passed by Grafana to [/api/v1/query_range](https://docs.victoriametrics.com/keyConcepts.html#range-query). -* If the given [series selector](https://docs.victoriametrics.com/keyConcepts.html#filtering) returns multiple time series, + The interval between points is set as `step` query arg passed by Grafana to [/api/v1/query_range](https://docs.victoriametrics.com/keyconcepts/#range-query). +* If the given [series selector](https://docs.victoriametrics.com/keyconcepts/#filtering) returns multiple time series, then rollups are calculated individually per each returned series. * If lookbehind window in square brackets is missing, then it is automatically set to the following value: - - To `step` value passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyConcepts.html#range-query) or [/api/v1/query](https://docs.victoriametrics.com/keyconcepts/#instant-query) + - To `step` value passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyconcepts/#range-query) or [/api/v1/query](https://docs.victoriametrics.com/keyconcepts/#instant-query) for all the [rollup functions](#rollup-functions) except of [default_rollup](#default_rollup) and [rate](#rate). This value is known as `$__interval` in Grafana or `1i` in MetricsQL. For example, `avg_over_time(temperature)` is automatically transformed to `avg_over_time(temperature[1i])`. - To the `max(step, scrape_interval)`, where `scrape_interval` is the interval between [raw samples](https://docs.victoriametrics.com/keyconcepts/#raw-samples) for [default_rollup](#default_rollup) and [rate](#rate) functions. This allows avoiding unexpected gaps on the graph when `step` is smaller than `scrape_interval`. -* Every [series selector](https://docs.victoriametrics.com/keyConcepts.html#filtering) in MetricsQL must be wrapped into a rollup function. +* Every [series selector](https://docs.victoriametrics.com/keyconcepts/#filtering) in MetricsQL must be wrapped into a rollup function. Otherwise, it is automatically wrapped into [default_rollup](#default_rollup). For example, `foo{bar="baz"}` is automatically converted to `default_rollup(foo{bar="baz"})` before performing the calculations. -* If something other than [series selector](https://docs.victoriametrics.com/keyConcepts.html#filtering) is passed to rollup function, +* If something other than [series selector](https://docs.victoriametrics.com/keyconcepts/#filtering) is passed to rollup function, then the inner arg is automatically converted to a [subquery](#subqueries). * All the rollup functions accept optional `keep_metric_names` modifier. If it is set, then the function keeps metric names in results. See [these docs](#keep_metric_names). @@ -195,7 +195,7 @@ See also [present_over_time](#present_over_time). `aggr_over_time(("rollup_func1", "rollup_func2", ...), series_selector[d])` is a [rollup function](#rollup-functions), which calculates all the listed `rollup_func*` for raw samples on the given lookbehind window `d`. The calculations are performed individually per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). `rollup_func*` can contain any rollup function. For instance, `aggr_over_time(("min_over_time", "max_over_time", "rate"), m[d])` would calculate [min_over_time](#min_over_time), [max_over_time](#max_over_time) and [rate](#rate) for `m[d]`. @@ -204,7 +204,7 @@ would calculate [min_over_time](#min_over_time), [max_over_time](#max_over_time) `ascent_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates ascent of raw sample values on the given lookbehind window `d`. The calculations are performed individually -per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). This function is useful for tracking height gains in GPS tracking. Metric names are stripped from the resulting rollups. @@ -216,7 +216,7 @@ See also [descent_over_time](#descent_over_time). `avg_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the average value over raw samples on the given lookbehind window `d` per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). This function is supported by PromQL. @@ -226,7 +226,7 @@ See also [median_over_time](#median_over_time). `changes(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the number of times the raw samples changed on the given lookbehind window `d` per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Unlike `changes()` in Prometheus it takes into account the change from the last sample before the given lookbehind window `d`. See [this article](https://medium.com/@romanhavronenko/victoriametrics-promql-compliance-d4318203f51e) for details. @@ -241,7 +241,7 @@ See also [changes_prometheus](#changes_prometheus). `changes_prometheus(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the number of times the raw samples changed on the given lookbehind window `d` per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). It doesn't take into account the change from the last sample before the given lookbehind window `d` in the same way as Prometheus does. See [this article](https://medium.com/@romanhavronenko/victoriametrics-promql-compliance-d4318203f51e) for details. @@ -256,7 +256,7 @@ See also [changes](#changes). `count_eq_over_time(series_selector[d], eq)` is a [rollup function](#rollup-functions), which calculates the number of raw samples on the given lookbehind window `d`, which are equal to `eq`. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -266,7 +266,7 @@ See also [count_over_time](#count_over_time), [share_eq_over_time](#share_eq_ove `count_gt_over_time(series_selector[d], gt)` is a [rollup function](#rollup-functions), which calculates the number of raw samples on the given lookbehind window `d`, which are bigger than `gt`. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -276,7 +276,7 @@ See also [count_over_time](#count_over_time) and [share_gt_over_time](#share_gt_ `count_le_over_time(series_selector[d], le)` is a [rollup function](#rollup-functions), which calculates the number of raw samples on the given lookbehind window `d`, which don't exceed `le`. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -286,7 +286,7 @@ See also [count_over_time](#count_over_time) and [share_le_over_time](#share_le_ `count_ne_over_time(series_selector[d], ne)` is a [rollup function](#rollup-functions), which calculates the number of raw samples on the given lookbehind window `d`, which aren't equal to `ne`. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -295,7 +295,7 @@ See also [count_over_time](#count_over_time). #### count_over_time `count_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the number of raw samples -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -307,7 +307,7 @@ See also [count_le_over_time](#count_le_over_time), [count_gt_over_time](#count_ `count_values_over_time("label", series_selector[d])` is a [rollup function](#rollup-functions), which counts the number of raw samples with the same value over the given lookbehind window and stores the counts in a time series with an additional `label`, which contains each initial value. -The results are calculated independently per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +The results are calculated independently per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -316,7 +316,7 @@ See also [count_eq_over_time](#count_eq_over_time), [count_values](#count_values #### decreases_over_time `decreases_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the number of raw sample value decreases -over the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +over the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -325,7 +325,7 @@ See also [increases_over_time](#increases_over_time). #### default_rollup `default_rollup(series_selector[d])` is a [rollup function](#rollup-functions), which returns the last raw sample value on the given lookbehind window `d` -per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). If the lookbehind window is skipped in square brackets, then it is automatically calculated as `max(step, scrape_interval)`, where `step` is the query arg value passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyconcepts/#range-query) or [/api/v1/query](https://docs.victoriametrics.com/keyconcepts/#instant-query), @@ -336,7 +336,7 @@ This allows avoiding unexpected gaps on the graph when `step` is smaller than th `delta(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the difference between the last sample before the given lookbehind window `d` and the last sample at the given lookbehind window `d` -per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). The behaviour of `delta()` function in MetricsQL is slightly different to the behaviour of `delta()` function in Prometheus. See [this article](https://medium.com/@romanhavronenko/victoriametrics-promql-compliance-d4318203f51e) for details. @@ -351,7 +351,7 @@ See also [increase](#increase) and [delta_prometheus](#delta_prometheus). `delta_prometheus(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the difference between the first and the last samples at the given lookbehind window `d` per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). The behaviour of `delta_prometheus()` is close to the behaviour of `delta()` function in Prometheus. See [this article](https://medium.com/@romanhavronenko/victoriametrics-promql-compliance-d4318203f51e) for details. @@ -363,7 +363,7 @@ See also [delta](#delta). #### deriv `deriv(series_selector[d])` is a [rollup function](#rollup-functions), which calculates per-second derivative over the given lookbehind window `d` -per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). The derivative is calculated using linear regression. Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -376,7 +376,7 @@ See also [deriv_fast](#deriv_fast) and [ideriv](#ideriv). `deriv_fast(series_selector[d])` is a [rollup function](#rollup-functions), which calculates per-second derivative using the first and the last raw samples on the given lookbehind window `d` per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -386,7 +386,7 @@ See also [deriv](#deriv) and [ideriv](#ideriv). `descent_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates descent of raw sample values on the given lookbehind window `d`. The calculations are performed individually per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). This function is useful for tracking height loss in GPS tracking. @@ -397,7 +397,7 @@ See also [ascent_over_time](#ascent_over_time). #### distinct_over_time `distinct_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which returns the number of distinct raw sample values -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -406,7 +406,7 @@ See also [count_values_over_time](#count_values_over_time). #### duration_over_time `duration_over_time(series_selector[d], max_interval)` is a [rollup function](#rollup-functions), which returns the duration in seconds -when time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering) were present +when time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering) were present over the given lookbehind window `d`. It is expected that intervals between adjacent samples per each series don't exceed the `max_interval`. Otherwise, such intervals are considered as gaps and aren't counted. @@ -417,7 +417,7 @@ See also [lifetime](#lifetime) and [lag](#lag). #### first_over_time `first_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which returns the first raw sample value -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). See also [last_over_time](#last_over_time) and [tfirst_over_time](#tfirst_over_time). @@ -425,7 +425,7 @@ See also [last_over_time](#last_over_time) and [tfirst_over_time](#tfirst_over_t `geomean_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates [geometric mean](https://en.wikipedia.org/wiki/Geometric_mean) over raw samples on the given lookbehind window `d` per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -433,9 +433,9 @@ Metric names are stripped from the resulting rollups. Add [keep_metric_names](#k `histogram_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates [VictoriaMetrics histogram](https://godoc.org/github.com/VictoriaMetrics/metrics#Histogram) over raw samples on the given lookbehind window `d`. -It is calculated individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +It is calculated individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). The resulting histograms are useful to pass to [histogram_quantile](#histogram_quantile) for calculating quantiles -over multiple [gauges](https://docs.victoriametrics.com/keyConcepts.html#gauge). +over multiple [gauges](https://docs.victoriametrics.com/keyconcepts/#gauge). For example, the following query calculates median temperature by country over the last 24 hours: `histogram_quantile(0.5, sum(histogram_over_time(temperature[24h])) by (vmrange,country))`. @@ -459,8 +459,8 @@ See also [hoeffding_bound_lower](#hoeffding_bound_lower). `holt_winters(series_selector[d], sf, tf)` is a [rollup function](#rollup-functions), which calculates Holt-Winters value (aka [double exponential smoothing](https://en.wikipedia.org/wiki/Exponential_smoothing#Double_exponential_smoothing)) for raw samples over the given lookbehind window `d` using the given smoothing factor `sf` and the given trend factor `tf`. -Both `sf` and `tf` must be in the range `[0...1]`. It is expected that the [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering) -returns time series of [gauge type](https://docs.victoriametrics.com/keyConcepts.html#gauge). +Both `sf` and `tf` must be in the range `[0...1]`. It is expected that the [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering) +returns time series of [gauge type](https://docs.victoriametrics.com/keyconcepts/#gauge). This function is supported by PromQL. @@ -469,7 +469,7 @@ See also [range_linear_regression](#range_linear_regression). #### idelta `idelta(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the difference between the last two raw samples -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -481,7 +481,7 @@ See also [delta](#delta). `ideriv(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the per-second derivative based on the last two raw samples over the given lookbehind window `d`. The derivative is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -490,8 +490,8 @@ See also [deriv](#deriv). #### increase `increase(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the increase over the given lookbehind window `d` -per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). -It is expected that the `series_selector` returns time series of [counter type](https://docs.victoriametrics.com/keyConcepts.html#counter). +per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). +It is expected that the `series_selector` returns time series of [counter type](https://docs.victoriametrics.com/keyconcepts/#counter). Unlike Prometheus, it takes into account the last sample before the given lookbehind window `d` when calculating the result. See [this article](https://medium.com/@romanhavronenko/victoriametrics-promql-compliance-d4318203f51e) for details. @@ -505,8 +505,8 @@ See also [increase_pure](#increase_pure), [increase_prometheus](#increase_promet #### increase_prometheus `increase_prometheus(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the increase -over the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). -It is expected that the `series_selector` returns time series of [counter type](https://docs.victoriametrics.com/keyConcepts.html#counter). +over the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). +It is expected that the `series_selector` returns time series of [counter type](https://docs.victoriametrics.com/keyconcepts/#counter). It doesn't take into account the last sample before the given lookbehind window `d` when calculating the result in the same way as Prometheus does. See [this article](https://medium.com/@romanhavronenko/victoriametrics-promql-compliance-d4318203f51e) for details. @@ -517,13 +517,13 @@ See also [increase_pure](#increase_pure) and [increase](#increase). #### increase_pure `increase_pure(series_selector[d])` is a [rollup function](#rollup-functions), which works the same as [increase](#increase) except -of the following corner case - it assumes that [counters](https://docs.victoriametrics.com/keyConcepts.html#counter) always start from 0, +of the following corner case - it assumes that [counters](https://docs.victoriametrics.com/keyconcepts/#counter) always start from 0, while [increase](#increase) ignores the first value in a series if it is too big. #### increases_over_time `increases_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the number of raw sample value increases -over the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +over the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -532,15 +532,15 @@ See also [decreases_over_time](#decreases_over_time). #### integrate `integrate(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the integral over raw samples on the given lookbehind window `d` -per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. #### irate `irate(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the "instant" per-second increase rate over the last two raw samples -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). -It is expected that the `series_selector` returns time series of [counter type](https://docs.victoriametrics.com/keyConcepts.html#counter). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). +It is expected that the `series_selector` returns time series of [counter type](https://docs.victoriametrics.com/keyconcepts/#counter). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -552,7 +552,7 @@ See also [rate](#rate) and [rollup_rate](#rollup_rate). `lag(series_selector[d])` is a [rollup function](#rollup-functions), which returns the duration in seconds between the last sample on the given lookbehind window `d` and the timestamp of the current point. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -561,7 +561,7 @@ See also [lifetime](#lifetime) and [duration_over_time](#duration_over_time). #### last_over_time `last_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which returns the last raw sample value on the given lookbehind window `d` -per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). This function is supported by PromQL. @@ -570,7 +570,7 @@ See also [first_over_time](#first_over_time) and [tlast_over_time](#tlast_over_t #### lifetime `lifetime(series_selector[d])` is a [rollup function](#rollup-functions), which returns the duration in seconds between the last and the first sample -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -579,14 +579,14 @@ See also [duration_over_time](#duration_over_time) and [lag](#lag). #### mad_over_time `mad_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates [median absolute deviation](https://en.wikipedia.org/wiki/Median_absolute_deviation) -over raw samples on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +over raw samples on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). See also [mad](#mad), [range_mad](#range_mad) and [outlier_iqr_over_time](#outlier_iqr_over_time). #### max_over_time `max_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the maximum value over raw samples -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). This function is supported by PromQL. @@ -596,14 +596,14 @@ See also [tmax_over_time](#tmax_over_time). `median_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates median value over raw samples on the given lookbehind window `d` per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). See also [avg_over_time](#avg_over_time). #### min_over_time `min_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the minimum value over raw samples -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). This function is supported by PromQL. @@ -613,7 +613,7 @@ See also [tmin_over_time](#tmin_over_time). `mode_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates [mode](https://en.wikipedia.org/wiki/Mode_(statistics)) for raw samples on the given lookbehind window `d`. It is calculated individually per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). It is expected that raw sample values are discrete. +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). It is expected that raw sample values are discrete. #### outlier_iqr_over_time @@ -631,7 +631,7 @@ See also [outliers_iqr](#outliers_iqr). `predict_linear(series_selector[d], t)` is a [rollup function](#rollup-functions), which calculates the value `t` seconds in the future using linear interpolation over raw samples on the given lookbehind window `d`. The predicted value is calculated individually per each time series -returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). This function is supported by PromQL. @@ -649,7 +649,7 @@ This function is supported by PromQL. #### quantile_over_time `quantile_over_time(phi, series_selector[d])` is a [rollup function](#rollup-functions), which calculates `phi`-quantile over raw samples -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). The `phi` value must be in the range `[0...1]`. This function is supported by PromQL. @@ -660,7 +660,7 @@ See also [quantiles_over_time](#quantiles_over_time). `quantiles_over_time("phiLabel", phi1, ..., phiN, series_selector[d])` is a [rollup function](#rollup-functions), which calculates `phi*`-quantiles over raw samples on the given lookbehind window `d` per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). The function returns individual series per each `phi*` with `{phiLabel="phi*"}` label. `phi*` values must be in the range `[0...1]`. See also [quantile_over_time](#quantile_over_time). @@ -668,7 +668,7 @@ See also [quantile_over_time](#quantile_over_time). #### range_over_time `range_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates value range over raw samples -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). E.g. it calculates `max_over_time(series_selector[d]) - min_over_time(series_selector[d])`. Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -676,8 +676,8 @@ Metric names are stripped from the resulting rollups. Add [keep_metric_names](#k #### rate `rate(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the average per-second increase rate -over the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). -It is expected that the `series_selector` returns time series of [counter type](https://docs.victoriametrics.com/keyConcepts.html#counter). +over the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). +It is expected that the `series_selector` returns time series of [counter type](https://docs.victoriametrics.com/keyconcepts/#counter). If the lookbehind window is skipped in square brackets, then it is automatically calculated as `max(step, scrape_interval)`, where `step` is the query arg value passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyconcepts/#range-query) or [/api/v1/query](https://docs.victoriametrics.com/keyconcepts/#instant-query), @@ -694,16 +694,16 @@ See also [irate](#irate) and [rollup_rate](#rollup_rate). `rate_over_sum(series_selector[d])` is a [rollup function](#rollup-functions), which calculates per-second rate over the sum of raw samples on the given lookbehind window `d`. The calculations are performed individually per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. #### resets `resets(series_selector[d])` is a [rollup function](#rollup-functions), which returns the number -of [counter](https://docs.victoriametrics.com/keyConcepts.html#counter) resets over the given lookbehind window `d` -per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). -It is expected that the `series_selector` returns time series of [counter type](https://docs.victoriametrics.com/keyConcepts.html#counter). +of [counter](https://docs.victoriametrics.com/keyconcepts/#counter) resets over the given lookbehind window `d` +per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). +It is expected that the `series_selector` returns time series of [counter type](https://docs.victoriametrics.com/keyconcepts/#counter). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -713,7 +713,7 @@ This function is supported by PromQL. `rollup(series_selector[d])` is a [rollup function](#rollup-functions), which calculates `min`, `max` and `avg` values for raw samples on the given lookbehind window `d` and returns them in time series with `rollup="min"`, `rollup="max"` and `rollup="avg"` additional labels. -These values are calculated individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +These values are calculated individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Optional 2nd argument `"min"`, `"max"` or `"avg"` can be passed to keep only one calculation result and without adding a label. See also [label_match](#label_match). @@ -723,7 +723,7 @@ See also [label_match](#label_match). `rollup_candlestick(series_selector[d])` is a [rollup function](#rollup-functions), which calculates `open`, `high`, `low` and `close` values (aka OHLC) over raw samples on the given lookbehind window `d` and returns them in time series with `rollup="open"`, `rollup="high"`, `rollup="low"` and `rollup="close"` additional labels. The calculations are performed individually per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). This function is useful for financial applications. +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). This function is useful for financial applications. Optional 2nd argument `"open"`, `"high"` or `"low"` or `"close"` can be passed to keep only one calculation result and without adding a label. See also [label_match](#label_match). @@ -733,7 +733,7 @@ See also [label_match](#label_match). `rollup_delta(series_selector[d])` is a [rollup function](#rollup-functions), which calculates differences between adjacent raw samples on the given lookbehind window `d` and returns `min`, `max` and `avg` values for the calculated differences and returns them in time series with `rollup="min"`, `rollup="max"` and `rollup="avg"` additional labels. -The calculations are performed individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +The calculations are performed individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Optional 2nd argument `"min"`, `"max"` or `"avg"` can be passed to keep only one calculation result and without adding a label. See also [label_match](#label_match). @@ -747,7 +747,7 @@ See also [rollup_increase](#rollup_increase). `rollup_deriv(series_selector[d])` is a [rollup function](#rollup-functions), which calculates per-second derivatives for adjacent raw samples on the given lookbehind window `d` and returns `min`, `max` and `avg` values for the calculated per-second derivatives and returns them in time series with `rollup="min"`, `rollup="max"` and `rollup="avg"` additional labels. -The calculations are performed individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +The calculations are performed individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Optional 2nd argument `"min"`, `"max"` or `"avg"` can be passed to keep only one calculation result and without adding a label. See also [label_match](#label_match). @@ -759,7 +759,7 @@ Metric names are stripped from the resulting rollups. Add [keep_metric_names](#k `rollup_increase(series_selector[d])` is a [rollup function](#rollup-functions), which calculates increases for adjacent raw samples on the given lookbehind window `d` and returns `min`, `max` and `avg` values for the calculated increases and returns them in time series with `rollup="min"`, `rollup="max"` and `rollup="avg"` additional labels. -The calculations are performed individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +The calculations are performed individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Optional 2nd argument `"min"`, `"max"` or `"avg"` can be passed to keep only one calculation result and without adding a label. See also [label_match](#label_match). @@ -778,7 +778,7 @@ when to use `rollup_rate()`. Optional 2nd argument `"min"`, `"max"` or `"avg"` can be passed to keep only one calculation result and without adding a label. See also [label_match](#label_match). -The calculations are performed individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +The calculations are performed individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -787,7 +787,7 @@ Metric names are stripped from the resulting rollups. Add [keep_metric_names](#k `rollup_scrape_interval(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the interval in seconds between adjacent raw samples on the given lookbehind window `d` and returns `min`, `max` and `avg` values for the calculated interval and returns them in time series with `rollup="min"`, `rollup="max"` and `rollup="avg"` additional labels. -The calculations are performed individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +The calculations are performed individually per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Optional 2nd argument `"min"`, `"max"` or `"avg"` can be passed to keep only one calculation result and without adding a label. See also [label_match](#label_match). @@ -797,7 +797,7 @@ Metric names are stripped from the resulting rollups. Add [keep_metric_names](#k #### scrape_interval `scrape_interval(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the average interval in seconds between raw samples -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -807,7 +807,7 @@ See also [rollup_scrape_interval](#rollup_scrape_interval). `share_gt_over_time(series_selector[d], gt)` is a [rollup function](#rollup-functions), which returns share (in the range `[0...1]`) of raw samples on the given lookbehind window `d`, which are bigger than `gt`. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). This function is useful for calculating SLI and SLO. Example: `share_gt_over_time(up[24h], 0)` - returns service availability for the last 24 hours. @@ -819,7 +819,7 @@ See also [share_le_over_time](#share_le_over_time) and [count_gt_over_time](#cou `share_le_over_time(series_selector[d], le)` is a [rollup function](#rollup-functions), which returns share (in the range `[0...1]`) of raw samples on the given lookbehind window `d`, which are smaller or equal to `le`. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). This function is useful for calculating SLI and SLO. Example: `share_le_over_time(memory_usage_bytes[24h], 100*1024*1024)` returns the share of time series values for the last 24 hours when memory usage was below or equal to 100MB. @@ -832,7 +832,7 @@ See also [share_gt_over_time](#share_gt_over_time) and [count_le_over_time](#cou `share_eq_over_time(series_selector[d], eq)` is a [rollup function](#rollup-functions), which returns share (in the range `[0...1]`) of raw samples on the given lookbehind window `d`, which are equal to `eq`. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -841,15 +841,15 @@ See also [count_eq_over_time](#count_eq_over_time). #### stale_samples_over_time `stale_samples_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the number -of [staleness markers](https://docs.victoriametrics.com/vmagent.html#prometheus-staleness-markers) on the given lookbehind window `d` -per each time series matching the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +of [staleness markers](https://docs.victoriametrics.com/vmagent/#prometheus-staleness-markers) on the given lookbehind window `d` +per each time series matching the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. #### stddev_over_time `stddev_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates standard deviation over raw samples -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -860,7 +860,7 @@ See also [stdvar_over_time](#stdvar_over_time). #### stdvar_over_time `stdvar_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates standard variance over raw samples -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -871,7 +871,7 @@ See also [stddev_over_time](#stddev_over_time). #### sum_eq_over_time `sum_eq_over_time(series_selector[d], eq)` is a [rollup function](#rollup-function), which calculates the sum of raw sample values equal to `eq` -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -880,7 +880,7 @@ See also [sum_over_time](#sum_over_time) and [count_eq_over_time](#count_eq_over #### sum_gt_over_time `sum_gt_over_time(series_selector[d], gt)` is a [rollup function](#rollup-function), which calculates the sum of raw sample values bigger than `gt` -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -889,7 +889,7 @@ See also [sum_over_time](#sum_over_time) and [count_gt_over_time](#count_gt_over #### sum_le_over_time `sum_le_over_time(series_selector[d], le)` is a [rollup function](#rollup-function), which calculates the sum of raw sample values smaller or equal to `le` -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -898,7 +898,7 @@ See also [sum_over_time](#sum_over_time) and [count_le_over_time](#count_le_over #### sum_over_time `sum_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the sum of raw sample values -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -907,14 +907,14 @@ This function is supported by PromQL. #### sum2_over_time `sum2_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which calculates the sum of squares for raw sample values -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. #### timestamp `timestamp(series_selector[d])` is a [rollup function](#rollup-functions), which returns the timestamp in seconds with millisecond precision for the last raw sample -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -925,7 +925,7 @@ See also [time](#time) and [now](#now). #### timestamp_with_name `timestamp_with_name(series_selector[d])` is a [rollup function](#rollup-functions), which returns the timestamp in seconds with millisecond precision for the last raw sample -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are preserved in the resulting rollups. @@ -934,7 +934,7 @@ See also [timestamp](#timestamp) and [keep_metric_names](#keep_metric_names) mod #### tfirst_over_time `tfirst_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which returns the timestamp in seconds with millisecond precision for the first raw sample -on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +on the given lookbehind window `d` per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -943,7 +943,7 @@ See also [first_over_time](#first_over_time). #### tlast_change_over_time `tlast_change_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which returns the timestamp in seconds with millisecond precision for the last change -per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering) on the given lookbehind window `d`. +per each time series returned from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering) on the given lookbehind window `d`. Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -959,7 +959,7 @@ See also [tlast_change_over_time](#tlast_change_over_time). `tmax_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which returns the timestamp in seconds with millisecond precision for the raw sample with the maximum value on the given lookbehind window `d`. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -969,7 +969,7 @@ See also [max_over_time](#max_over_time). `tmin_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which returns the timestamp in seconds with millisecond precision for the raw sample with the minimum value on the given lookbehind window `d`. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -979,7 +979,7 @@ See also [min_over_time](#min_over_time). `zscore_over_time(series_selector[d])` is a [rollup function](#rollup-functions), which returns [z-score](https://en.wikipedia.org/wiki/Standard_score) for raw samples on the given lookbehind window `d`. It is calculated independently per each time series returned -from the given [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering). +from the given [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering). Metric names are stripped from the resulting rollups. Add [keep_metric_names](#keep_metric_names) modifier in order to keep metric names. @@ -994,7 +994,7 @@ returned from the rollup `delta(temperature[24h])`. Additional details: -* If transform function is applied directly to a [series selector](https://docs.victoriametrics.com/keyConcepts.html#filtering), +* If transform function is applied directly to a [series selector](https://docs.victoriametrics.com/keyconcepts/#filtering), then the [default_rollup()](#default_rollup) function is automatically applied before calculating the transformations. For example, `abs(temperature)` is implicitly transformed to `abs(default_rollup(temperature))`. * All the transform functions accept optional `keep_metric_names` modifier. If it is set, @@ -1230,7 +1230,7 @@ by replacing all the values bigger or equal to 30 with 40. #### end `end()` is a [transform function](#transform-functions), which returns the unix timestamp in seconds for the last point. -It is known as `end` query arg passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyConcepts.html#range-query). +It is known as `end` query arg passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyconcepts/#range-query). See also [start](#start), [time](#time) and [now](#now). @@ -1653,14 +1653,14 @@ This function is supported by PromQL. `start()` is a [transform function](#transform-functions), which returns unix timestamp in seconds for the first point. -It is known as `start` query arg passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyConcepts.html#range-query). +It is known as `start` query arg passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyconcepts/#range-query). See also [end](#end), [time](#time) and [now](#now). #### step `step()` is a [transform function](#transform-functions), which returns the step in seconds (aka interval) between the returned points. -It is known as `step` query arg passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyConcepts.html#range-query). +It is known as `step` query arg passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyconcepts/#range-query). See also [start](#start) and [end](#end). @@ -1717,7 +1717,7 @@ This function is supported by PromQL. Additional details: -* If label manipulation function is applied directly to a [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering), +* If label manipulation function is applied directly to a [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering), then the [default_rollup()](#default_rollup) function is automatically applied before performing the label transformation. For example, `alias(temperature, "foo")` is implicitly transformed to `alias(default_rollup(temperature), "foo")`. @@ -1894,7 +1894,7 @@ Additional details: and calculate the [count](#count) aggregate function independently per each group, while `count(up) without (instance)` would group [rollup results](#rollup-functions) by all the labels except `instance` before calculating [count](#count) aggregate function independently per each group. Multiple labels can be put in `by` and `without` modifiers. -* If the aggregate function is applied directly to a [series_selector](https://docs.victoriametrics.com/keyConcepts.html#filtering), +* If the aggregate function is applied directly to a [series_selector](https://docs.victoriametrics.com/keyconcepts/#filtering), then the [default_rollup()](#default_rollup) function is automatically applied before calculating the aggregate. For example, `count(up)` is implicitly transformed to `count(default_rollup(up))`. * Aggregate functions accept arbitrary number of args. For example, `avg(q1, q2, q3)` would return the average values for every point @@ -2104,7 +2104,7 @@ See also [quantile](#quantile). `share(q) by (group_labels)` is [aggregate function](#aggregate-functions), which returns shares in the range `[0..1]` for every non-negative points returned by `q` per each timestamp, so the sum of shares per each `group_labels` equals 1. -This function is useful for normalizing [histogram bucket](https://docs.victoriametrics.com/keyConcepts.html#histogram) shares +This function is useful for normalizing [histogram bucket](https://docs.victoriametrics.com/keyconcepts/#histogram) shares into `[0..1]` range: ```metricsql @@ -2208,7 +2208,7 @@ See also [zscore_over_time](#zscore_over_time), [range_trim_zscore](#range_trim_ ## Subqueries MetricsQL supports and extends PromQL subqueries. See [this article](https://valyala.medium.com/prometheus-subqueries-in-victoriametrics-9b1492b720b3) for details. -Any [rollup function](#rollup-functions) for something other than [series selector](https://docs.victoriametrics.com/keyConcepts.html#filtering) form a subquery. +Any [rollup function](#rollup-functions) for something other than [series selector](https://docs.victoriametrics.com/keyconcepts/#filtering) form a subquery. Nested rollup functions can be implicit thanks to the [implicit query conversions](#implicit-query-conversions). For example, `delta(sum(m))` is implicitly converted to `delta(sum(default_rollup(m))[1i:1i])`, so it becomes a subquery, since it contains [default_rollup](#default_rollup) nested into [delta](#delta). @@ -2219,19 +2219,19 @@ VictoriaMetrics performs subqueries in the following way: For example, for expression `max_over_time(rate(http_requests_total[5m])[1h:30s])` the inner function `rate(http_requests_total[5m])` is calculated with `step=30s`. The resulting data points are aligned by the `step`. * It calculates the outer rollup function over the results of the inner rollup function using the `step` value - passed by Grafana to [/api/v1/query_range](https://docs.victoriametrics.com/keyConcepts.html#range-query). + passed by Grafana to [/api/v1/query_range](https://docs.victoriametrics.com/keyconcepts/#range-query). ## Implicit query conversions VictoriaMetrics performs the following implicit conversions for incoming queries before starting the calculations: * If lookbehind window in square brackets is missing inside [rollup function](#rollup-functions), then it is automatically set to the following value: - - To `step` value passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyConcepts.html#range-query) or [/api/v1/query](https://docs.victoriametrics.com/keyconcepts/#instant-query) + - To `step` value passed to [/api/v1/query_range](https://docs.victoriametrics.com/keyconcepts/#range-query) or [/api/v1/query](https://docs.victoriametrics.com/keyconcepts/#instant-query) for all the [rollup functions](#rollup-functions) except of [default_rollup](#default_rollup) and [rate](#rate). This value is known as `$__interval` in Grafana or `1i` in MetricsQL. For example, `avg_over_time(temperature)` is automatically transformed to `avg_over_time(temperature[1i])`. - To the `max(step, scrape_interval)`, where `scrape_interval` is the interval between [raw samples](https://docs.victoriametrics.com/keyconcepts/#raw-samples) for [default_rollup](#default_rollup) and [rate](#rate) functions. This allows avoiding unexpected gaps on the graph when `step` is smaller than `scrape_interval`. -* All the [series selectors](https://docs.victoriametrics.com/keyConcepts.html#filtering), +* All the [series selectors](https://docs.victoriametrics.com/keyconcepts/#filtering), which aren't wrapped into [rollup functions](#rollup-functions), are automatically wrapped into [default_rollup](#default_rollup) function. Examples: * `foo` is transformed to `default_rollup(foo)` @@ -2242,6 +2242,6 @@ VictoriaMetrics performs the following implicit conversions for incoming queries it is [transform function](#transform-functions) * If `step` in square brackets is missing inside [subquery](#subqueries), then `1i` step is automatically added there. For example, `avg_over_time(rate(http_requests_total[5m])[1h])` is automatically converted to `avg_over_time(rate(http_requests_total[5m])[1h:1i])`. -* If something other than [series selector](https://docs.victoriametrics.com/keyConcepts.html#filtering) +* If something other than [series selector](https://docs.victoriametrics.com/keyconcepts/#filtering) is passed to [rollup function](#rollup-functions), then a [subquery](#subqueries) with `1i` lookbehind window and `1i` step is automatically formed. For example, `rate(sum(up))` is automatically converted to `rate((sum(default_rollup(up)))[1i:1i])`. diff --git a/app/vmagent/README.md b/app/vmagent/README.md index 62a621975..32929b787 100644 --- a/app/vmagent/README.md +++ b/app/vmagent/README.md @@ -1,3 +1,3 @@ -See vmagent docs [here](https://docs.victoriametrics.com/vmagent.html). +See vmagent docs [here](https://docs.victoriametrics.com/vmagent/). -vmagent docs can be edited at [docs/vmagent.md](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/docs/vmagent.md). \ No newline at end of file +vmagent docs can be edited at [docs/vmagent.md](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/docs/vmagent.md). diff --git a/app/vmagent/common/push_ctx.go b/app/vmagent/common/push_ctx.go index e25ddd03a..1147a3e85 100644 --- a/app/vmagent/common/push_ctx.go +++ b/app/vmagent/common/push_ctx.go @@ -3,13 +3,15 @@ package common import ( "sync" - "github.com/VictoriaMetrics/VictoriaMetrics/lib/cgroup" "github.com/VictoriaMetrics/VictoriaMetrics/lib/prompbmarshal" "github.com/VictoriaMetrics/VictoriaMetrics/lib/promrelabel" ) // PushCtx is a context used for populating WriteRequest. type PushCtx struct { + // WriteRequest contains the WriteRequest, which must be pushed later to remote storage. + // + // The actual labels and samples for the time series are stored in Labels and Samples fields. WriteRequest prompbmarshal.WriteRequest // Labels contains flat list of all the labels used in WriteRequest. @@ -21,13 +23,7 @@ type PushCtx struct { // Reset resets ctx. func (ctx *PushCtx) Reset() { - tss := ctx.WriteRequest.Timeseries - for i := range tss { - ts := &tss[i] - ts.Labels = nil - ts.Samples = nil - } - ctx.WriteRequest.Timeseries = ctx.WriteRequest.Timeseries[:0] + ctx.WriteRequest.Reset() promrelabel.CleanLabels(ctx.Labels) ctx.Labels = ctx.Labels[:0] @@ -39,15 +35,10 @@ func (ctx *PushCtx) Reset() { // // Call PutPushCtx when the ctx is no longer needed. func GetPushCtx() *PushCtx { - select { - case ctx := <-pushCtxPoolCh: - return ctx - default: - if v := pushCtxPool.Get(); v != nil { - return v.(*PushCtx) - } - return &PushCtx{} + if v := pushCtxPool.Get(); v != nil { + return v.(*PushCtx) } + return &PushCtx{} } // PutPushCtx returns ctx to the pool. @@ -55,12 +46,7 @@ func GetPushCtx() *PushCtx { // ctx mustn't be used after returning to the pool. func PutPushCtx(ctx *PushCtx) { ctx.Reset() - select { - case pushCtxPoolCh <- ctx: - default: - pushCtxPool.Put(ctx) - } + pushCtxPool.Put(ctx) } var pushCtxPool sync.Pool -var pushCtxPoolCh = make(chan *PushCtx, cgroup.AvailableCPUs()) diff --git a/app/vmagent/influx/request_handler.go b/app/vmagent/influx/request_handler.go index df1645677..b8255e86f 100644 --- a/app/vmagent/influx/request_handler.go +++ b/app/vmagent/influx/request_handler.go @@ -10,7 +10,6 @@ import ( "github.com/VictoriaMetrics/VictoriaMetrics/app/vmagent/remotewrite" "github.com/VictoriaMetrics/VictoriaMetrics/lib/auth" "github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil" - "github.com/VictoriaMetrics/VictoriaMetrics/lib/cgroup" "github.com/VictoriaMetrics/VictoriaMetrics/lib/prompbmarshal" "github.com/VictoriaMetrics/VictoriaMetrics/lib/promrelabel" parserCommon "github.com/VictoriaMetrics/VictoriaMetrics/lib/protoparser/common" @@ -160,25 +159,15 @@ func (ctx *pushCtx) reset() { } func getPushCtx() *pushCtx { - select { - case ctx := <-pushCtxPoolCh: - return ctx - default: - if v := pushCtxPool.Get(); v != nil { - return v.(*pushCtx) - } - return &pushCtx{} + if v := pushCtxPool.Get(); v != nil { + return v.(*pushCtx) } + return &pushCtx{} } func putPushCtx(ctx *pushCtx) { ctx.reset() - select { - case pushCtxPoolCh <- ctx: - default: - pushCtxPool.Put(ctx) - } + pushCtxPool.Put(ctx) } var pushCtxPool sync.Pool -var pushCtxPoolCh = make(chan *pushCtx, cgroup.AvailableCPUs()) diff --git a/app/vmagent/main.go b/app/vmagent/main.go index a463ae6fd..0d8c910ed 100644 --- a/app/vmagent/main.go +++ b/app/vmagent/main.go @@ -225,7 +225,7 @@ func requestHandler(w http.ResponseWriter, r *http.Request) bool { } w.Header().Add("Content-Type", "text/html; charset=utf-8") fmt.Fprintf(w, "

    vmagent

    ") - fmt.Fprintf(w, "See docs at
    https://docs.victoriametrics.com/vmagent.html
    ") + fmt.Fprintf(w, "See docs at https://docs.victoriametrics.com/vmagent/
    ") fmt.Fprintf(w, "Useful endpoints:
    ") httpserver.WriteAPIHelp(w, [][2]string{ {"targets", "status for discovered active targets"}, @@ -718,7 +718,7 @@ func usage() { const s = ` vmagent collects metrics data via popular data ingestion protocols and routes it to VictoriaMetrics. -See the docs at https://docs.victoriametrics.com/vmagent.html . +See the docs at https://docs.victoriametrics.com/vmagent/ . ` flagutil.Usage(s) } diff --git a/app/vmagent/remotewrite/client.go b/app/vmagent/remotewrite/client.go index 84e4d46b8..ae5412c32 100644 --- a/app/vmagent/remotewrite/client.go +++ b/app/vmagent/remotewrite/client.go @@ -25,9 +25,9 @@ import ( var ( forcePromProto = flagutil.NewArrayBool("remoteWrite.forcePromProto", "Whether to force Prometheus remote write protocol for sending data "+ - "to the corresponding -remoteWrite.url . See https://docs.victoriametrics.com/vmagent.html#victoriametrics-remote-write-protocol") + "to the corresponding -remoteWrite.url . See https://docs.victoriametrics.com/vmagent/#victoriametrics-remote-write-protocol") forceVMProto = flagutil.NewArrayBool("remoteWrite.forceVMProto", "Whether to force VictoriaMetrics remote write protocol for sending data "+ - "to the corresponding -remoteWrite.url . See https://docs.victoriametrics.com/vmagent.html#victoriametrics-remote-write-protocol") + "to the corresponding -remoteWrite.url . See https://docs.victoriametrics.com/vmagent/#victoriametrics-remote-write-protocol") rateLimit = flagutil.NewArrayInt("remoteWrite.rateLimit", 0, "Optional rate limit in bytes per second for data sent to the corresponding -remoteWrite.url. "+ "By default, the rate limit is disabled. It can be useful for limiting load on remote storage when big amounts of buffered data "+ @@ -164,7 +164,7 @@ func newHTTPClient(argIdx int, remoteWriteURL, sanitizedURL string, fq *persiste useVMProto = common.HandleVMProtoClientHandshake(c.remoteWriteURL, doRequest) if !useVMProto { logger.Infof("the remote storage at %q doesn't support VictoriaMetrics remote write protocol. Switching to Prometheus remote write protocol. "+ - "See https://docs.victoriametrics.com/vmagent.html#victoriametrics-remote-write-protocol", sanitizedURL) + "See https://docs.victoriametrics.com/vmagent/#victoriametrics-remote-write-protocol", sanitizedURL) } } c.useVMProto = useVMProto diff --git a/app/vmagent/remotewrite/pendingseries.go b/app/vmagent/remotewrite/pendingseries.go index 2e31c8e3f..efd760e6f 100644 --- a/app/vmagent/remotewrite/pendingseries.go +++ b/app/vmagent/remotewrite/pendingseries.go @@ -28,7 +28,7 @@ var ( maxRowsPerBlock = flag.Int("remoteWrite.maxRowsPerBlock", 10000, "The maximum number of samples to send in each block to remote storage. Higher number may improve performance at the cost of the increased memory usage. See also -remoteWrite.maxBlockSize") vmProtoCompressLevel = flag.Int("remoteWrite.vmProtoCompressLevel", 0, "The compression level for VictoriaMetrics remote write protocol. "+ "Higher values reduce network traffic at the cost of higher CPU usage. Negative values reduce CPU usage at the cost of increased network traffic. "+ - "See https://docs.victoriametrics.com/vmagent.html#victoriametrics-remote-write-protocol") + "See https://docs.victoriametrics.com/vmagent/#victoriametrics-remote-write-protocol") ) type pendingSeries struct { @@ -122,11 +122,7 @@ func (wr *writeRequest) reset() { wr.wr.Timeseries = nil - for i := range wr.tss { - ts := &wr.tss[i] - ts.Labels = nil - ts.Samples = nil - } + clear(wr.tss) wr.tss = wr.tss[:0] promrelabel.CleanLabels(wr.labels) diff --git a/app/vmagent/remotewrite/relabel.go b/app/vmagent/remotewrite/relabel.go index a0e0737b2..359c87e92 100644 --- a/app/vmagent/remotewrite/relabel.go +++ b/app/vmagent/remotewrite/relabel.go @@ -19,10 +19,10 @@ var ( relabelConfigPathGlobal = flag.String("remoteWrite.relabelConfig", "", "Optional path to file with relabeling configs, which are applied "+ "to all the metrics before sending them to -remoteWrite.url. See also -remoteWrite.urlRelabelConfig. "+ "The path can point either to local file or to http url. "+ - "See https://docs.victoriametrics.com/vmagent.html#relabeling") + "See https://docs.victoriametrics.com/vmagent/#relabeling") relabelConfigPaths = flagutil.NewArrayString("remoteWrite.urlRelabelConfig", "Optional path to relabel configs for the corresponding -remoteWrite.url. "+ "See also -remoteWrite.relabelConfig. The path can point either to local file or to http url. "+ - "See https://docs.victoriametrics.com/vmagent.html#relabeling") + "See https://docs.victoriametrics.com/vmagent/#relabeling") usePromCompatibleNaming = flag.Bool("usePromCompatibleNaming", false, "Whether to replace characters unsupported by Prometheus with underscores "+ "in the ingested metric names and label names. For example, foo.bar{a.b='c'} is transformed into foo_bar{a_b='c'} during data ingestion if this flag is set. "+ diff --git a/app/vmagent/remotewrite/remotewrite.go b/app/vmagent/remotewrite/remotewrite.go index 0c6c5f774..93e41b50d 100644 --- a/app/vmagent/remotewrite/remotewrite.go +++ b/app/vmagent/remotewrite/remotewrite.go @@ -40,21 +40,26 @@ var ( "Pass multiple -remoteWrite.url options in order to replicate the collected data to multiple remote storage systems. "+ "The data can be sharded among the configured remote storage systems if -remoteWrite.shardByURL flag is set") remoteWriteMultitenantURLs = flagutil.NewArrayString("remoteWrite.multitenantURL", "Base path for multitenant remote storage URL to write data to. "+ - "See https://docs.victoriametrics.com/vmagent.html#multitenancy for details. Example url: http://:8480 . "+ + "See https://docs.victoriametrics.com/vmagent/#multitenancy for details. Example url: http://:8480 . "+ "Pass multiple -remoteWrite.multitenantURL flags in order to replicate data to multiple remote storage systems. "+ - "This flag is deprecated in favor of -enableMultitenantHandlers . See https://docs.victoriametrics.com/vmagent.html#multitenancy") + "This flag is deprecated in favor of -enableMultitenantHandlers . See https://docs.victoriametrics.com/vmagent/#multitenancy") enableMultitenantHandlers = flag.Bool("enableMultitenantHandlers", false, "Whether to process incoming data via multitenant insert handlers according to "+ - "https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format . By default incoming data is processed via single-node insert handlers "+ + "https://docs.victoriametrics.com/cluster-victoriametrics/#url-format . By default incoming data is processed via single-node insert handlers "+ "according to https://docs.victoriametrics.com/#how-to-import-time-series-data ."+ - "See https://docs.victoriametrics.com/vmagent.html#multitenancy for details") + "See https://docs.victoriametrics.com/vmagent/#multitenancy for details") + shardByURL = flag.Bool("remoteWrite.shardByURL", false, "Whether to shard outgoing series across all the remote storage systems enumerated via -remoteWrite.url . "+ - "By default the data is replicated across all the -remoteWrite.url . See https://docs.victoriametrics.com/vmagent.html#sharding-among-remote-storages") + "By default the data is replicated across all the -remoteWrite.url . See https://docs.victoriametrics.com/vmagent/#sharding-among-remote-storages . "+ + "See also -remoteWrite.shardByURLReplicas") + shardByURLReplicas = flag.Int("remoteWrite.shardByURLReplicas", 1, "How many copies of data to make among remote storage systems enumerated via -remoteWrite.url "+ + "when -remoteWrite.shardByURL is set. See https://docs.victoriametrics.com/vmagent/#sharding-among-remote-storages") shardByURLLabels = flagutil.NewArrayString("remoteWrite.shardByURL.labels", "Optional list of labels, which must be used for sharding outgoing samples "+ "among remote storage systems if -remoteWrite.shardByURL command-line flag is set. By default all the labels are used for sharding in order to gain "+ "even distribution of series over the specified -remoteWrite.url systems. See also -remoteWrite.shardByURL.ignoreLabels") shardByURLIgnoreLabels = flagutil.NewArrayString("remoteWrite.shardByURL.ignoreLabels", "Optional list of labels, which must be ignored when sharding outgoing samples "+ "among remote storage systems if -remoteWrite.shardByURL command-line flag is set. By default all the labels are used for sharding in order to gain "+ "even distribution of series over the specified -remoteWrite.url systems. See also -remoteWrite.shardByURL.labels") + tmpDataPath = flag.String("remoteWrite.tmpDataPath", "vmagent-remotewrite-data", "Path to directory for storing pending data, which isn't sent to the configured -remoteWrite.url . "+ "See also -remoteWrite.maxDiskUsagePerURL and -remoteWrite.disableOnDiskQueue") keepDanglingQueues = flag.Bool("remoteWrite.keepDanglingQueues", false, "Keep persistent queues contents at -remoteWrite.tmpDataPath in case there are no matching -remoteWrite.url. "+ @@ -81,33 +86,35 @@ var ( `For example, if m{k1="v1",k2="v2"} may be sent as m{k2="v2",k1="v1"}`+ `Enabled sorting for labels can slow down ingestion performance a bit`) maxHourlySeries = flag.Int("remoteWrite.maxHourlySeries", 0, "The maximum number of unique series vmagent can send to remote storage systems during the last hour. "+ - "Excess series are logged and dropped. This can be useful for limiting series cardinality. See https://docs.victoriametrics.com/vmagent.html#cardinality-limiter") + "Excess series are logged and dropped. This can be useful for limiting series cardinality. See https://docs.victoriametrics.com/vmagent/#cardinality-limiter") maxDailySeries = flag.Int("remoteWrite.maxDailySeries", 0, "The maximum number of unique series vmagent can send to remote storage systems during the last 24 hours. "+ - "Excess series are logged and dropped. This can be useful for limiting series churn rate. See https://docs.victoriametrics.com/vmagent.html#cardinality-limiter") + "Excess series are logged and dropped. This can be useful for limiting series churn rate. See https://docs.victoriametrics.com/vmagent/#cardinality-limiter") maxIngestionRate = flag.Int("maxIngestionRate", 0, "The maximum number of samples vmagent can receive per second. Data ingestion is paused when the limit is exceeded. "+ "By default there are no limits on samples ingestion rate. See also -remoteWrite.rateLimit") streamAggrConfig = flagutil.NewArrayString("remoteWrite.streamAggr.config", "Optional path to file with stream aggregation config. "+ - "See https://docs.victoriametrics.com/stream-aggregation.html . "+ + "See https://docs.victoriametrics.com/stream-aggregation/ . "+ "See also -remoteWrite.streamAggr.keepInput, -remoteWrite.streamAggr.dropInput and -remoteWrite.streamAggr.dedupInterval") streamAggrKeepInput = flagutil.NewArrayBool("remoteWrite.streamAggr.keepInput", "Whether to keep all the input samples after the aggregation "+ "with -remoteWrite.streamAggr.config. By default, only aggregates samples are dropped, while the remaining samples "+ - "are written to the corresponding -remoteWrite.url . See also -remoteWrite.streamAggr.dropInput and https://docs.victoriametrics.com/stream-aggregation.html") + "are written to the corresponding -remoteWrite.url . See also -remoteWrite.streamAggr.dropInput and https://docs.victoriametrics.com/stream-aggregation/") streamAggrDropInput = flagutil.NewArrayBool("remoteWrite.streamAggr.dropInput", "Whether to drop all the input samples after the aggregation "+ "with -remoteWrite.streamAggr.config. By default, only aggregates samples are dropped, while the remaining samples "+ - "are written to the corresponding -remoteWrite.url . See also -remoteWrite.streamAggr.keepInput and https://docs.victoriametrics.com/stream-aggregation.html") + "are written to the corresponding -remoteWrite.url . See also -remoteWrite.streamAggr.keepInput and https://docs.victoriametrics.com/stream-aggregation/") streamAggrDedupInterval = flagutil.NewArrayDuration("remoteWrite.streamAggr.dedupInterval", 0, "Input samples are de-duplicated with this interval before optional aggregation "+ - "with -remoteWrite.streamAggr.config . See also -dedup.minScrapeInterval and https://docs.victoriametrics.com/stream-aggregation.html#deduplication") + "with -remoteWrite.streamAggr.config . See also -dedup.minScrapeInterval and https://docs.victoriametrics.com/stream-aggregation/#deduplication") streamAggrIgnoreOldSamples = flagutil.NewArrayBool("remoteWrite.streamAggr.ignoreOldSamples", "Whether to ignore input samples with old timestamps outside the current aggregation interval "+ - "for the corresponding -remoteWrite.streamAggr.config . See https://docs.victoriametrics.com/stream-aggregation.html#ignoring-old-samples") + "for the corresponding -remoteWrite.streamAggr.config . See https://docs.victoriametrics.com/stream-aggregation/#ignoring-old-samples") + streamAggrIgnoreFirstIntervals = flag.Int("remoteWrite.streamAggr.ignoreFirstIntervals", 0, "Number of aggregation intervals to skip after the start. Increase this value if you observe incorrect aggregation results after vmagent restarts. It could be caused by receiving unordered delayed data from clients pushing data into the vmagent. "+ + "See https://docs.victoriametrics.com/stream-aggregation/#ignore-aggregation-intervals-on-start") streamAggrDropInputLabels = flagutil.NewArrayString("streamAggr.dropInputLabels", "An optional list of labels to drop from samples "+ - "before stream de-duplication and aggregation . See https://docs.victoriametrics.com/stream-aggregation.html#dropping-unneeded-labels") + "before stream de-duplication and aggregation . See https://docs.victoriametrics.com/stream-aggregation/#dropping-unneeded-labels") disableOnDiskQueue = flag.Bool("remoteWrite.disableOnDiskQueue", false, "Whether to disable storing pending data to -remoteWrite.tmpDataPath "+ - "when the configured remote storage systems cannot keep up with the data ingestion rate. See https://docs.victoriametrics.com/vmagent.html#disabling-on-disk-persistence ."+ + "when the configured remote storage systems cannot keep up with the data ingestion rate. See https://docs.victoriametrics.com/vmagent/#disabling-on-disk-persistence ."+ "See also -remoteWrite.dropSamplesOnOverload") dropSamplesOnOverload = flag.Bool("remoteWrite.dropSamplesOnOverload", false, "Whether to drop samples when -remoteWrite.disableOnDiskQueue is set and if the samples "+ - "cannot be pushed into the configured remote storage systems in a timely manner. See https://docs.victoriametrics.com/vmagent.html#disabling-on-disk-persistence") + "cannot be pushed into the configured remote storage systems in a timely manner. See https://docs.victoriametrics.com/vmagent/#disabling-on-disk-persistence") ) var ( @@ -125,7 +132,7 @@ var ( ErrQueueFullHTTPRetry = &httpserver.ErrorWithStatusCode{ Err: fmt.Errorf("remote storage systems cannot keep up with the data ingestion rate; retry the request later " + "or remove -remoteWrite.disableOnDiskQueue from vmagent command-line flags, so it could save pending data to -remoteWrite.tmpDataPath; " + - "see https://docs.victoriametrics.com/vmagent.html#disabling-on-disk-persistence"), + "see https://docs.victoriametrics.com/vmagent/#disabling-on-disk-persistence"), StatusCode: http.StatusTooManyRequests, } ) @@ -252,6 +259,9 @@ func dropDanglingQueues() { // This is required for the case when the number of queues has been changed or URL have been changed. // See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4014 // + // In case if there were many persistent queues with identical *remoteWriteURLs + // the queue with the last index will be dropped. + // See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6140 existingQueues := make(map[string]struct{}, len(rwctxsDefault)) for _, rwctx := range rwctxsDefault { existingQueues[rwctx.fq.Dirname()] = struct{}{} @@ -338,7 +348,7 @@ func newRemoteWriteCtxs(at *auth.Token, urls []string) []*remoteWriteCtx { } sanitizedURL := fmt.Sprintf("%d:secret-url", i+1) if at != nil { - // Construct full remote_write url for the given tenant according to https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format + // Construct full remote_write url for the given tenant according to https://docs.victoriametrics.com/cluster-victoriametrics/#url-format remoteWriteURL.Path = fmt.Sprintf("%s/insert/%d:%d/prometheus/api/v1/write", remoteWriteURL.Path, at.AccountID, at.ProjectID) sanitizedURL = fmt.Sprintf("%s:%d:%d", sanitizedURL, at.AccountID, at.ProjectID) } @@ -562,58 +572,17 @@ func tryPushBlockToRemoteStorages(rwctxs []*remoteWriteCtx, tssBlock []prompbmar // We need to push tssBlock to multiple remote storages. // This is either sharding or replication depending on -remoteWrite.shardByURL command-line flag value. - if *shardByURL { - // Shard the data among rwctxs - tssByURL := make([][]prompbmarshal.TimeSeries, len(rwctxs)) - tmpLabels := promutils.GetLabels() - for _, ts := range tssBlock { - hashLabels := ts.Labels - if len(shardByURLLabelsMap) > 0 { - hashLabels = tmpLabels.Labels[:0] - for _, label := range ts.Labels { - if _, ok := shardByURLLabelsMap[label.Name]; ok { - hashLabels = append(hashLabels, label) - } - } - tmpLabels.Labels = hashLabels - } else if len(shardByURLIgnoreLabelsMap) > 0 { - hashLabels = tmpLabels.Labels[:0] - for _, label := range ts.Labels { - if _, ok := shardByURLIgnoreLabelsMap[label.Name]; !ok { - hashLabels = append(hashLabels, label) - } - } - tmpLabels.Labels = hashLabels - } - h := getLabelsHash(hashLabels) - idx := h % uint64(len(tssByURL)) - tssByURL[idx] = append(tssByURL[idx], ts) + if *shardByURL && *shardByURLReplicas < len(rwctxs) { + // Shard tssBlock samples among rwctxs. + replicas := *shardByURLReplicas + if replicas <= 0 { + replicas = 1 } - promutils.PutLabels(tmpLabels) - - // Push sharded data to remote storages in parallel in order to reduce - // the time needed for sending the data to multiple remote storage systems. - var wg sync.WaitGroup - var anyPushFailed atomic.Bool - for i, rwctx := range rwctxs { - tssShard := tssByURL[i] - if len(tssShard) == 0 { - continue - } - wg.Add(1) - go func(rwctx *remoteWriteCtx, tss []prompbmarshal.TimeSeries) { - defer wg.Done() - if !rwctx.TryPush(tss) { - anyPushFailed.Store(true) - } - }(rwctx, tssShard) - } - wg.Wait() - return !anyPushFailed.Load() + return tryShardingBlockAmongRemoteStorages(rwctxs, tssBlock, replicas) } - // Replicate data among rwctxs. - // Push block to remote storages in parallel in order to reduce + // Replicate tssBlock samples among rwctxs. + // Push tssBlock to remote storage systems in parallel in order to reduce // the time needed for sending the data to multiple remote storage systems. var wg sync.WaitGroup wg.Add(len(rwctxs)) @@ -630,6 +599,97 @@ func tryPushBlockToRemoteStorages(rwctxs []*remoteWriteCtx, tssBlock []prompbmar return !anyPushFailed.Load() } +func tryShardingBlockAmongRemoteStorages(rwctxs []*remoteWriteCtx, tssBlock []prompbmarshal.TimeSeries, replicas int) bool { + x := getTSSShards(len(rwctxs)) + defer putTSSShards(x) + + shards := x.shards + tmpLabels := promutils.GetLabels() + for _, ts := range tssBlock { + hashLabels := ts.Labels + if len(shardByURLLabelsMap) > 0 { + hashLabels = tmpLabels.Labels[:0] + for _, label := range ts.Labels { + if _, ok := shardByURLLabelsMap[label.Name]; ok { + hashLabels = append(hashLabels, label) + } + } + tmpLabels.Labels = hashLabels + } else if len(shardByURLIgnoreLabelsMap) > 0 { + hashLabels = tmpLabels.Labels[:0] + for _, label := range ts.Labels { + if _, ok := shardByURLIgnoreLabelsMap[label.Name]; !ok { + hashLabels = append(hashLabels, label) + } + } + tmpLabels.Labels = hashLabels + } + h := getLabelsHash(hashLabels) + idx := h % uint64(len(shards)) + i := 0 + for { + shards[idx] = append(shards[idx], ts) + i++ + if i >= replicas { + break + } + idx++ + if idx >= uint64(len(shards)) { + idx = 0 + } + } + } + promutils.PutLabels(tmpLabels) + + // Push sharded samples to remote storage systems in parallel in order to reduce + // the time needed for sending the data to multiple remote storage systems. + var wg sync.WaitGroup + var anyPushFailed atomic.Bool + for i, rwctx := range rwctxs { + shard := shards[i] + if len(shard) == 0 { + continue + } + wg.Add(1) + go func(rwctx *remoteWriteCtx, tss []prompbmarshal.TimeSeries) { + defer wg.Done() + if !rwctx.TryPush(tss) { + anyPushFailed.Store(true) + } + }(rwctx, shard) + } + wg.Wait() + return !anyPushFailed.Load() +} + +type tssShards struct { + shards [][]prompbmarshal.TimeSeries +} + +func getTSSShards(n int) *tssShards { + v := tssShardsPool.Get() + if v == nil { + v = &tssShards{} + } + x := v.(*tssShards) + if cap(x.shards) < n { + x.shards = make([][]prompbmarshal.TimeSeries, n) + } + x.shards = x.shards[:n] + return x +} + +func putTSSShards(x *tssShards) { + shards := x.shards + for i := range shards { + clear(shards[i]) + shards[i] = shards[i][:0] + } + tssShardsPool.Put(x) +} + +var tssShardsPool sync.Pool + // sortLabelsIfNeeded sorts labels if -sortLabels command-line flag is set. func sortLabelsIfNeeded(tss []prompbmarshal.TimeSeries) { if !*sortLabels { @@ -802,9 +862,10 @@ func newRemoteWriteCtx(argIdx int, remoteWriteURL *url.URL, maxInmemoryBlocks in ignoreOldSamples := streamAggrIgnoreOldSamples.GetOptionalArg(argIdx) if sasFile != "" { opts := &streamaggr.Options{ - DedupInterval: dedupInterval, - DropInputLabels: *streamAggrDropInputLabels, - IgnoreOldSamples: ignoreOldSamples, + DedupInterval: dedupInterval, + DropInputLabels: *streamAggrDropInputLabels, + IgnoreOldSamples: ignoreOldSamples, + IgnoreFirstIntervals: *streamAggrIgnoreFirstIntervals, } sas, err := streamaggr.LoadFromFile(sasFile, rwctx.pushInternalTrackDropped, opts) if err != nil { diff --git a/app/vmagent/remotewrite/remotewrite_test.go b/app/vmagent/remotewrite/remotewrite_test.go new file mode 100644 index 000000000..16c404ef2 --- /dev/null +++ b/app/vmagent/remotewrite/remotewrite_test.go @@ -0,0 +1,48 @@ +package remotewrite + +import ( + "fmt" + "math" + "testing" + + "github.com/VictoriaMetrics/VictoriaMetrics/lib/prompbmarshal" +) + +func TestGetLabelsHash_Distribution(t *testing.T) { + f := func(bucketsCount int) { + t.Helper() + + // Distribute itemsCount hashes returned by getLabelsHash() across bucketsCount buckets. + itemsCount := 1_000 * bucketsCount + m := make([]int, bucketsCount) + var labels []prompbmarshal.Label + for i := 0; i < itemsCount; i++ { + labels = append(labels[:0], prompbmarshal.Label{ + Name: "__name__", + Value: fmt.Sprintf("some_name_%d", i), + }) + for j := 0; j < 10; j++ { + labels = append(labels, prompbmarshal.Label{ + Name: fmt.Sprintf("label_%d", j), + Value: fmt.Sprintf("value_%d_%d", i, j), + }) + } + h := getLabelsHash(labels) + m[h%uint64(bucketsCount)]++ + } + + // Verify that the distribution is even + expectedItemsPerBucket := itemsCount / bucketsCount + for _, n := range m { + if math.Abs(1-float64(n)/float64(expectedItemsPerBucket)) > 0.04 { + t.Fatalf("unexpected items in the bucket for %d buckets; got %d; want around %d", bucketsCount, n, expectedItemsPerBucket) + } + } + } + + f(2) + f(3) + f(4) + f(5) + f(10) +} diff --git a/app/vmagent/remotewrite/statconn.go b/app/vmagent/remotewrite/statconn.go index ff28e7580..924835496 100644 --- a/app/vmagent/remotewrite/statconn.go +++ b/app/vmagent/remotewrite/statconn.go @@ -3,34 +3,15 @@ package remotewrite import ( "context" "net" - "sync" "sync/atomic" - "time" "github.com/VictoriaMetrics/VictoriaMetrics/lib/netutil" "github.com/VictoriaMetrics/metrics" ) -func getStdDialer() *net.Dialer { - stdDialerOnce.Do(func() { - stdDialer = &net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: netutil.TCP6Enabled(), - } - }) - return stdDialer -} - -var ( - stdDialer *net.Dialer - stdDialerOnce sync.Once -) - func statDial(ctx context.Context, _, addr string) (conn net.Conn, err error) { network := netutil.GetTCPNetwork() - d := getStdDialer() - conn, err = d.DialContext(ctx, network, addr) + conn, err = netutil.DialMaybeSRV(ctx, network, addr) dialsTotal.Inc() if err != nil { dialErrors.Inc() diff --git a/app/vmalert/README.md b/app/vmalert/README.md index 5b3b4773b..108f6e5a4 100644 --- a/app/vmalert/README.md +++ b/app/vmalert/README.md @@ -1,3 +1,3 @@ -See vmalert docs [here](https://docs.victoriametrics.com/vmalert.html). +See vmalert docs [here](https://docs.victoriametrics.com/vmalert/). vmalert docs can be edited at [docs/vmalert.md](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/docs/vmalert.md). diff --git a/app/vmalert/main.go b/app/vmalert/main.go index 97e4f8e85..f7ff36ef4 100644 --- a/app/vmalert/main.go +++ b/app/vmalert/main.go @@ -44,7 +44,7 @@ Enterprise version of vmalert supports S3 and GCS paths to rules. For example: gs://bucket/path/to/rules, s3://bucket/path/to/rules S3 and GCS paths support only matching by prefix, e.g. s3://bucket/dir/rule_ matches all files with prefix rule_ in folder dir. -See https://docs.victoriametrics.com/vmalert.html#reading-rules-from-object-storage +See https://docs.victoriametrics.com/vmalert/#reading-rules-from-object-storage `) ruleTemplatesPath = flagutil.NewArrayString("rule.templates", `Path or glob pattern to location with go template definitions `+ @@ -71,7 +71,7 @@ absolute path to all .tpl files in root. externalURL = flag.String("external.url", "", "External URL is used as alert's source for sent alerts to the notifier. By default, hostname is used as address.") externalAlertSource = flag.String("external.alert.source", "", `External Alert Source allows to override the Source link for alerts sent to AlertManager `+ `for cases where you want to build a custom link to Grafana, Prometheus or any other service. `+ - `Supports templating - see https://docs.victoriametrics.com/vmalert.html#templating . `+ + `Supports templating - see https://docs.victoriametrics.com/vmalert/#templating . `+ `For example, link to Grafana: -external.alert.source='explore?orgId=1&left={"datasource":"VictoriaMetrics","queries":[{"expr":{{$expr|jsonEscape|queryEscape}},"refId":"A"}],"range":{"from":"now-1h","to":"now"}}'. `+ `Link to VMUI: -external.alert.source='vmui/#/?g0.expr={{.Expr|queryEscape}}'. `+ `If empty 'vmalert/alert?group_id={{.GroupID}}&alert_id={{.AlertID}}' is used.`) @@ -319,7 +319,7 @@ func usage() { const s = ` vmalert processes alerts and recording rules. -See the docs at https://docs.victoriametrics.com/vmalert.html . +See the docs at https://docs.victoriametrics.com/vmalert/ . ` flagutil.Usage(s) } diff --git a/app/vmalert/notifier/alertmanager.go b/app/vmalert/notifier/alertmanager.go index 8616f7aef..8bc2eec5f 100644 --- a/app/vmalert/notifier/alertmanager.go +++ b/app/vmalert/notifier/alertmanager.go @@ -105,7 +105,7 @@ func (am *AlertManager) send(ctx context.Context, alerts []Alert, headers map[st if *showNotifierURL { amURL = am.addr.String() } - if resp.StatusCode != http.StatusOK { + if resp.StatusCode/100 != 2 { body, err := io.ReadAll(resp.Body) if err != nil { return fmt.Errorf("failed to read response from %q: %w", amURL, err) diff --git a/app/vmalert/rule/alerting.go b/app/vmalert/rule/alerting.go index 8f6d0e980..81fbd2cf2 100644 --- a/app/vmalert/rule/alerting.go +++ b/app/vmalert/rule/alerting.go @@ -314,23 +314,20 @@ func (ar *AlertingRule) execRange(ctx context.Context, start, end time.Time) ([] return nil, fmt.Errorf("`query` template isn't supported in replay mode") } for _, s := range res.Data { - ls, err := ar.toLabels(s, qFn) + ls, as, err := ar.expandTemplates(s, qFn, time.Time{}) if err != nil { - return nil, fmt.Errorf("failed to expand labels: %s", err) - } - h := hash(ls.processed) - a, err := ar.newAlert(s, nil, time.Time{}, qFn) // initial alert - if err != nil { - return nil, fmt.Errorf("failed to create alert: %w", err) + return nil, fmt.Errorf("failed to expand templates: %s", err) } + alertID := hash(ls.processed) + a := ar.newAlert(s, time.Time{}, ls.processed, as) // initial alert prevT := time.Time{} for i := range s.Values { at := time.Unix(s.Timestamps[i], 0) // try to restore alert's state on the first iteration if at.Equal(start) { - if _, ok := ar.alerts[h]; ok { - a = ar.alerts[h] + if _, ok := ar.alerts[alertID]; ok { + a = ar.alerts[alertID] prevT = at } } @@ -352,7 +349,7 @@ func (ar *AlertingRule) execRange(ctx context.Context, start, end time.Time) ([] // save alert's state on last iteration, so it can be used on the next execRange call if at.Equal(end) { - holdAlertState[h] = a + holdAlertState[alertID] = a } } } @@ -386,15 +383,34 @@ func (ar *AlertingRule) exec(ctx context.Context, ts time.Time, limit int) ([]pr } }() - ar.alertsMu.Lock() - defer ar.alertsMu.Unlock() - if err != nil { return nil, fmt.Errorf("failed to execute query %q: %w", ar.Expr, err) } - ar.logDebugf(ts, nil, "query returned %d samples (elapsed: %s)", curState.Samples, curState.Duration) + qFn := func(query string) ([]datasource.Metric, error) { + res, _, err := ar.q.Query(ctx, query, ts) + return res.Data, err + } + + // template labels and annotations before updating ar.alerts, + // since they could use `query` function which takes a while to execute, + // see https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6079. + expandedLabels := make([]*labelSet, len(res.Data)) + expandedAnnotations := make([]map[string]string, len(res.Data)) + for i, m := range res.Data { + ls, as, err := ar.expandTemplates(m, qFn, ts) + if err != nil { + curState.Err = fmt.Errorf("failed to expand templates: %w", err) + return nil, curState.Err + } + expandedLabels[i] = ls + expandedAnnotations[i] = as + } + + ar.alertsMu.Lock() + defer ar.alertsMu.Unlock() + for h, a := range ar.alerts { // cleanup inactive alerts from previous Exec if a.State == notifier.StateInactive && ts.Sub(a.ResolvedAt) > resolvedRetention { @@ -403,26 +419,18 @@ func (ar *AlertingRule) exec(ctx context.Context, ts time.Time, limit int) ([]pr } } - qFn := func(query string) ([]datasource.Metric, error) { - res, _, err := ar.q.Query(ctx, query, ts) - return res.Data, err - } updated := make(map[uint64]struct{}) // update list of active alerts - for _, m := range res.Data { - ls, err := ar.toLabels(m, qFn) - if err != nil { - curState.Err = fmt.Errorf("failed to expand labels: %w", err) - return nil, curState.Err - } - h := hash(ls.processed) - if _, ok := updated[h]; ok { + for i, m := range res.Data { + labels, annotations := expandedLabels[i], expandedAnnotations[i] + alertID := hash(labels.processed) + if _, ok := updated[alertID]; ok { // duplicate may be caused the removal of `__name__` label - curState.Err = fmt.Errorf("labels %v: %w", ls.processed, errDuplicate) + curState.Err = fmt.Errorf("labels %v: %w", labels.processed, errDuplicate) return nil, curState.Err } - updated[h] = struct{}{} - if a, ok := ar.alerts[h]; ok { + updated[alertID] = struct{}{} + if a, ok := ar.alerts[alertID]; ok { if a.State == notifier.StateInactive { // alert could be in inactive state for resolvedRetention // so when we again receive metrics for it - we switch it @@ -432,22 +440,17 @@ func (ar *AlertingRule) exec(ctx context.Context, ts time.Time, limit int) ([]pr ar.logDebugf(ts, a, "INACTIVE => PENDING") } a.Value = m.Values[0] - // re-exec template since Value or query can be used in annotations - a.Annotations, err = a.ExecTemplate(qFn, ls.origin, ar.Annotations) + a.Annotations = annotations if err != nil { return nil, err } a.KeepFiringSince = time.Time{} continue } - a, err := ar.newAlert(m, ls, ts, qFn) - if err != nil { - curState.Err = fmt.Errorf("failed to create alert: %w", err) - return nil, curState.Err - } - a.ID = h + a := ar.newAlert(m, ts, labels.processed, annotations) + a.ID = alertID a.State = notifier.StatePending - ar.alerts[h] = a + ar.alerts[alertID] = a ar.logDebugf(ts, a, "created in state PENDING") } var numActivePending int @@ -497,6 +500,28 @@ func (ar *AlertingRule) exec(ctx context.Context, ts time.Time, limit int) ([]pr return ar.toTimeSeries(ts.Unix()), nil } +func (ar *AlertingRule) expandTemplates(m datasource.Metric, qFn templates.QueryFn, ts time.Time) (*labelSet, map[string]string, error) { + ls, err := ar.toLabels(m, qFn) + if err != nil { + return nil, nil, fmt.Errorf("failed to expand labels: %w", err) + } + + tplData := notifier.AlertTplData{ + Value: m.Values[0], + Labels: ls.origin, + Expr: ar.Expr, + AlertID: hash(ls.processed), + GroupID: ar.GroupID, + ActiveAt: ts, + For: ar.For, + } + as, err := notifier.ExecTemplate(qFn, ar.Annotations, tplData) + if err != nil { + return nil, nil, fmt.Errorf("failed to template annotations: %w", err) + } + return ls, as, nil +} + func (ar *AlertingRule) toTimeSeries(timestamp int64) []prompbmarshal.TimeSeries { var tss []prompbmarshal.TimeSeries for _, a := range ar.alerts { @@ -530,25 +555,25 @@ func hash(labels map[string]string) uint64 { return hash.Sum64() } -func (ar *AlertingRule) newAlert(m datasource.Metric, ls *labelSet, start time.Time, qFn templates.QueryFn) (*notifier.Alert, error) { - var err error - if ls == nil { - ls, err = ar.toLabels(m, qFn) - if err != nil { - return nil, fmt.Errorf("failed to expand labels: %w", err) - } +func (ar *AlertingRule) newAlert(m datasource.Metric, start time.Time, labels, annotations map[string]string) *notifier.Alert { + as := make(map[string]string) + if annotations != nil { + as = annotations } - a := ¬ifier.Alert{ - GroupID: ar.GroupID, - Name: ar.Name, - Labels: ls.processed, - Value: m.Values[0], - ActiveAt: start, - Expr: ar.Expr, - For: ar.For, + ls := make(map[string]string) + if labels != nil { + ls = labels + } + return ¬ifier.Alert{ + GroupID: ar.GroupID, + Name: ar.Name, + Expr: ar.Expr, + For: ar.For, + ActiveAt: start, + Value: m.Values[0], + Labels: ls, + Annotations: as, } - a.Annotations, err = a.ExecTemplate(qFn, ls.origin, ar.Annotations) - return a, err } const ( @@ -604,9 +629,6 @@ func (ar *AlertingRule) restore(ctx context.Context, q datasource.Querier, ts ti return nil } - ar.alertsMu.Lock() - defer ar.alertsMu.Unlock() - if len(ar.alerts) < 1 { return nil } @@ -631,6 +653,10 @@ func (ar *AlertingRule) restore(ctx context.Context, q datasource.Querier, ts ti ar.logDebugf(ts, nil, "no response was received from restore query") return nil } + + ar.alertsMu.Lock() + defer ar.alertsMu.Unlock() + for _, series := range res.Data { series.DelLabel("__name__") labelSet := make(map[string]string, len(series.Labels)) diff --git a/app/vmalert/rule/group.go b/app/vmalert/rule/group.go index bf0c24e0d..f4e6cd0dd 100644 --- a/app/vmalert/rule/group.go +++ b/app/vmalert/rule/group.go @@ -724,7 +724,7 @@ func (e *executor) exec(ctx context.Context, r Rule, ts time.Time, resolveDurati return errGr.Err() } -// getStaledSeries checks whether there are stale series from previously sent ones. +// getStaleSeries checks whether there are stale series from previously sent ones. func (e *executor) getStaleSeries(r Rule, tss []prompbmarshal.TimeSeries, timestamp time.Time) []prompbmarshal.TimeSeries { ruleLabels := make(map[string][]prompbmarshal.Label, len(tss)) for _, ts := range tss { diff --git a/app/vmalert/rule/group_test.go b/app/vmalert/rule/group_test.go index d1777b6c5..0ff6adec0 100644 --- a/app/vmalert/rule/group_test.go +++ b/app/vmalert/rule/group_test.go @@ -217,20 +217,21 @@ func TestGroupStart(t *testing.T) { const evalInterval = time.Millisecond g := NewGroup(groups[0], fs, evalInterval, map[string]string{"cluster": "east-1"}) - g.Concurrency = 2 const inst1, inst2, job = "foo", "bar", "baz" m1 := metricWithLabels(t, "instance", inst1, "job", job) m2 := metricWithLabels(t, "instance", inst2, "job", job) r := g.Rules[0].(*AlertingRule) - alert1, err := r.newAlert(m1, nil, time.Now(), nil) - if err != nil { - t.Fatalf("faield to create alert: %s", err) - } + alert1 := r.newAlert(m1, time.Now(), nil, nil) alert1.State = notifier.StateFiring + // add annotations + alert1.Annotations["summary"] = "1" // add external label alert1.Labels["cluster"] = "east-1" + // add labels from response + alert1.Labels["job"] = job + alert1.Labels["instance"] = inst1 // add rule labels alert1.Labels["label"] = "bar" alert1.Labels["host"] = inst1 @@ -239,13 +240,15 @@ func TestGroupStart(t *testing.T) { alert1.Labels[alertGroupNameLabel] = g.Name alert1.ID = hash(alert1.Labels) - alert2, err := r.newAlert(m2, nil, time.Now(), nil) - if err != nil { - t.Fatalf("faield to create alert: %s", err) - } + alert2 := r.newAlert(m2, time.Now(), nil, nil) alert2.State = notifier.StateFiring + // add annotations + alert2.Annotations["summary"] = "1" // add external label alert2.Labels["cluster"] = "east-1" + // add labels from response + alert2.Labels["job"] = job + alert2.Labels["instance"] = inst2 // add rule labels alert2.Labels["label"] = "bar" alert2.Labels["host"] = inst2 @@ -262,8 +265,25 @@ func TestGroupStart(t *testing.T) { close(finished) }() - // wait for multiple evals - time.Sleep(20 * evalInterval) + waitForIterations := func(n int, interval time.Duration) { + t.Helper() + + var cur uint64 + prev := g.metrics.iterationTotal.Get() + for i := 0; ; i++ { + if i > 40 { + t.Fatalf("group wasn't able to perform %d evaluations during %d eval intervals", n, i) + } + cur = g.metrics.iterationTotal.Get() + if int(cur-prev) >= n { + return + } + time.Sleep(interval) + } + } + + // wait for multiple evaluation iterations + waitForIterations(4, evalInterval) gotAlerts := fn.GetAlerts() expectedAlerts := []notifier.Alert{*alert1, *alert2} @@ -280,8 +300,8 @@ func TestGroupStart(t *testing.T) { // and set only one datapoint for response fs.Add(m1) - // wait for multiple evals - time.Sleep(20 * evalInterval) + // wait for multiple evaluation iterations + waitForIterations(4, evalInterval) gotAlerts = fn.GetAlerts() alert2.State = notifier.StateInactive diff --git a/app/vmalert/rule/rule.go b/app/vmalert/rule/rule.go index 0bad2ff65..46e388c7f 100644 --- a/app/vmalert/rule/rule.go +++ b/app/vmalert/rule/rule.go @@ -32,7 +32,7 @@ type Rule interface { close() } -var errDuplicate = errors.New("result contains metrics with the same labelset after applying rule labels. See https://docs.victoriametrics.com/vmalert.html#series-with-the-same-labelset for details") +var errDuplicate = errors.New("result contains metrics with the same labelset after applying rule labels. See https://docs.victoriametrics.com/vmalert/#series-with-the-same-labelset for details") type ruleState struct { sync.RWMutex diff --git a/app/vmalert/static/js/custom.js b/app/vmalert/static/js/custom.js index 25adebd2b..c79d342d2 100644 --- a/app/vmalert/static/js/custom.js +++ b/app/vmalert/static/js/custom.js @@ -13,6 +13,20 @@ function collapseAll() { $('.collapse').removeClass('show'); } +function showByID(id) { + if (!id) { + return + } + let parent = $("#" + id).parent(); + if (!parent) { + return + } + let target = $("#" + parent.attr("data-bs-target")); + if (target.length > 0) { + target.addClass('show'); + } +} + function toggleByID(id) { if (id) { let el = $("#" + id); @@ -61,7 +75,7 @@ function search() { function setParamURL(key, value) { let url = new URL(location.href) url.searchParams.set(key, value); - window.history.replaceState(null, null, `?${url.searchParams.toString()}`); + window.history.replaceState(null, null, `?${url.searchParams.toString()}${url.hash}`); } function getParamURL(key) { @@ -141,7 +155,7 @@ $(document).ready(function () { search() let hash = window.location.hash.substr(1); - toggleByID(hash); + showByID(hash); }); $(document).ready(function () { diff --git a/app/vmalert/web.go b/app/vmalert/web.go index 152373f46..5de5326ab 100644 --- a/app/vmalert/web.go +++ b/app/vmalert/web.go @@ -39,7 +39,7 @@ var ( {Name: "Groups", Url: "groups"}, {Name: "Alerts", Url: "alerts"}, {Name: "Notifiers", Url: "notifiers"}, - {Name: "Docs", Url: "https://docs.victoriametrics.com/vmalert.html"}, + {Name: "Docs", Url: "https://docs.victoriametrics.com/vmalert/"}, } ) diff --git a/app/vmauth/README.md b/app/vmauth/README.md index 34491ac22..7843ba7b3 100644 --- a/app/vmauth/README.md +++ b/app/vmauth/README.md @@ -1,3 +1,3 @@ -See vmauth docs [here](https://docs.victoriametrics.com/vmauth.html). +See vmauth docs [here](https://docs.victoriametrics.com/vmauth/). vmauth docs can be edited at [docs/vmauth.md](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/docs/vmauth.md). diff --git a/app/vmauth/auth_config.go b/app/vmauth/auth_config.go index 69ec0b1a9..e2e38edf0 100644 --- a/app/vmauth/auth_config.go +++ b/app/vmauth/auth_config.go @@ -7,7 +7,6 @@ import ( "flag" "fmt" "math" - "net" "net/http" "net/url" "os" @@ -27,20 +26,21 @@ import ( "github.com/VictoriaMetrics/VictoriaMetrics/lib/flagutil" "github.com/VictoriaMetrics/VictoriaMetrics/lib/fs/fscore" "github.com/VictoriaMetrics/VictoriaMetrics/lib/logger" + "github.com/VictoriaMetrics/VictoriaMetrics/lib/netutil" "github.com/VictoriaMetrics/VictoriaMetrics/lib/procutil" ) var ( authConfigPath = flag.String("auth.config", "", "Path to auth config. It can point either to local file or to http url. "+ - "See https://docs.victoriametrics.com/vmauth.html for details on the format of this auth config") + "See https://docs.victoriametrics.com/vmauth/ for details on the format of this auth config") configCheckInterval = flag.Duration("configCheckInterval", 0, "interval for config file re-read. "+ "Zero value disables config re-reading. By default, refreshing is disabled, send SIGHUP for config refresh.") defaultRetryStatusCodes = flagutil.NewArrayInt("retryStatusCodes", 0, "Comma-separated list of default HTTP response status codes when vmauth re-tries the request on other backends. "+ - "See https://docs.victoriametrics.com/vmauth.html#load-balancing for details") + "See https://docs.victoriametrics.com/vmauth/#load-balancing for details") defaultLoadBalancingPolicy = flag.String("loadBalancingPolicy", "least_loaded", "The default load balancing policy to use for backend urls specified inside url_prefix section. "+ - "Supported policies: least_loaded, first_available. See https://docs.victoriametrics.com/vmauth.html#load-balancing") + "Supported policies: least_loaded, first_available. See https://docs.victoriametrics.com/vmauth/#load-balancing") discoverBackendIPsGlobal = flag.Bool("discoverBackendIPs", false, "Whether to discover backend IPs via periodic DNS queries to hostnames specified in url_prefix. "+ - "This may be useful when url_prefix points to a hostname with dynamically scaled instances behind it. See https://docs.victoriametrics.com/vmauth.html#discovering-backend-ips") + "This may be useful when url_prefix points to a hostname with dynamically scaled instances behind it. See https://docs.victoriametrics.com/vmauth/#discovering-backend-ips") discoverBackendIPsInterval = flag.Duration("discoverBackendIPsInterval", 10*time.Second, "The interval for re-discovering backend IPs if -discoverBackendIPs command-line flag is set. "+ "Too low value may lead to DNS errors") httpAuthHeader = flagutil.NewArrayString("httpAuthHeader", "HTTP request header to use for obtaining authorization tokens. By default auth tokens are read from Authorization request header") @@ -73,15 +73,18 @@ type UserInfo struct { RetryStatusCodes []int `yaml:"retry_status_codes,omitempty"` LoadBalancingPolicy string `yaml:"load_balancing_policy,omitempty"` DropSrcPathPrefixParts *int `yaml:"drop_src_path_prefix_parts,omitempty"` - TLSInsecureSkipVerify *bool `yaml:"tls_insecure_skip_verify,omitempty"` TLSCAFile string `yaml:"tls_ca_file,omitempty"` + TLSCertFile string `yaml:"tls_cert_file,omitempty"` + TLSKeyFile string `yaml:"tls_key_file,omitempty"` + TLSServerName string `yaml:"tls_server_name,omitempty"` + TLSInsecureSkipVerify *bool `yaml:"tls_insecure_skip_verify,omitempty"` MetricLabels map[string]string `yaml:"metric_labels,omitempty"` concurrencyLimitCh chan struct{} concurrencyLimitReached *metrics.Counter - httpTransport *http.Transport + rt http.RoundTripper requests *metrics.Counter backendErrors *metrics.Counter @@ -90,8 +93,8 @@ type UserInfo struct { // HeadersConf represents config for request and response headers. type HeadersConf struct { - RequestHeaders []Header `yaml:"headers,omitempty"` - ResponseHeaders []Header `yaml:"response_headers,omitempty"` + RequestHeaders []*Header `yaml:"headers,omitempty"` + ResponseHeaders []*Header `yaml:"response_headers,omitempty"` } func (ui *UserInfo) beginConcurrencyLimit() error { @@ -155,10 +158,10 @@ type URLMap struct { SrcHosts []*Regex `yaml:"src_hosts,omitempty"` // SrcQueryArgs is an optional list of query args, which must match request URL query args. - SrcQueryArgs []QueryArg `yaml:"src_query_args,omitempty"` + SrcQueryArgs []*QueryArg `yaml:"src_query_args,omitempty"` // SrcHeaders is an optional list of headers, which must match request headers. - SrcHeaders []Header `yaml:"src_headers,omitempty"` + SrcHeaders []*Header `yaml:"src_headers,omitempty"` // UrlPrefix contains backend url prefixes for the proxied request url. URLPrefix *URLPrefix `yaml:"url_prefix,omitempty"` @@ -179,22 +182,15 @@ type URLMap struct { DropSrcPathPrefixParts *int `yaml:"drop_src_path_prefix_parts,omitempty"` } -// Regex represents a regex -type Regex struct { - re *regexp.Regexp - - sOriginal string -} - // QueryArg represents HTTP query arg type QueryArg struct { Name string - Value string + Value *Regex sOriginal string } -// UnmarshalYAML unmarshals up from yaml. +// UnmarshalYAML unmarshals qa from yaml. func (qa *QueryArg) UnmarshalYAML(f func(interface{}) error) error { var s string if err := f(&s); err != nil { @@ -203,14 +199,27 @@ func (qa *QueryArg) UnmarshalYAML(f func(interface{}) error) error { qa.sOriginal = s n := strings.IndexByte(s, '=') - if n >= 0 { - qa.Name = s[:n] - qa.Value = s[n+1:] + if n < 0 { + return nil } + + qa.Name = s[:n] + expr := s[n+1:] + if !strings.HasPrefix(expr, "~") { + expr = regexp.QuoteMeta(expr) + } else { + expr = expr[1:] + } + + var re Regex + if err := yaml.Unmarshal([]byte(expr), &re); err != nil { + return fmt.Errorf("cannot unmarshal regex for %q query arg: %w", qa.Name, err) + } + qa.Value = &re return nil } -// MarshalYAML marshals up to yaml. +// MarshalYAML marshals qa to yaml. func (qa *QueryArg) MarshalYAML() (interface{}, error) { return qa.sOriginal, nil } @@ -293,7 +302,7 @@ func (up *URLPrefix) getBackendsCount() int { // // backendURL.put() must be called on the returned backendURL after the request is complete. func (up *URLPrefix) getBackendURL() *backendURL { - up.discoverBackendIPsIfNeeded() + up.discoverBackendAddrsIfNeeded() pbus := up.bus.Load() bus := *pbus @@ -303,7 +312,7 @@ func (up *URLPrefix) getBackendURL() *backendURL { return getLeastLoadedBackendURL(bus, &up.n) } -func (up *URLPrefix) discoverBackendIPsIfNeeded() { +func (up *URLPrefix) discoverBackendAddrsIfNeeded() { if !up.discoverBackendIPs { // The discovery is disabled. return @@ -328,27 +337,42 @@ func (up *URLPrefix) discoverBackendIPsIfNeeded() { // Discover ips for all the backendURLs ctx, cancel := context.WithTimeout(context.Background(), time.Second*time.Duration(intervalSec)) - hostToIPs := make(map[string][]string) + hostToAddrs := make(map[string][]string) for _, bu := range up.busOriginal { host := bu.Hostname() - if hostToIPs[host] != nil { + if hostToAddrs[host] != nil { // ips for the given host have been already discovered continue } - addrs, err := resolver.LookupIPAddr(ctx, host) - var ips []string - if err != nil { - logger.Warnf("cannot discover backend IPs for %s: %s; use it literally", bu, err) - ips = []string{host} - } else { - ips = make([]string, len(addrs)) - for i, addr := range addrs { - ips[i] = addr.String() + var resolvedAddrs []string + if strings.HasPrefix(host, "srv+") { + // The host has the format 'srv+realhost'. Strip 'srv+' prefix before performing the lookup. + host = strings.TrimPrefix(host, "srv+") + _, addrs, err := netutil.Resolver.LookupSRV(ctx, "", "", host) + if err != nil { + logger.Warnf("cannot discover backend SRV records for %s: %s; use it literally", bu, err) + resolvedAddrs = []string{host} + } else { + resolvedAddrs := make([]string, len(addrs)) + for i, addr := range addrs { + resolvedAddrs[i] = fmt.Sprintf("%s:%d", addr.Target, addr.Port) + } + } + } else { + addrs, err := netutil.Resolver.LookupIPAddr(ctx, host) + if err != nil { + logger.Warnf("cannot discover backend IPs for %s: %s; use it literally", bu, err) + resolvedAddrs = []string{host} + } else { + resolvedAddrs = make([]string, len(addrs)) + for i, addr := range addrs { + resolvedAddrs[i] = addr.String() + } } - // sort ips, so they could be compared below in areEqualBackendURLs() - sort.Strings(ips) } - hostToIPs[host] = ips + // sort resolvedAddrs, so they could be compared below in areEqualBackendURLs() + sort.Strings(resolvedAddrs) + hostToAddrs[host] = resolvedAddrs } cancel() @@ -357,10 +381,14 @@ func (up *URLPrefix) discoverBackendIPsIfNeeded() { for _, bu := range up.busOriginal { host := bu.Hostname() port := bu.Port() - for _, ip := range hostToIPs[host] { + for _, addr := range hostToAddrs[host] { buCopy := *bu - buCopy.Host = ip + buCopy.Host = addr if port != "" { + if n := strings.IndexByte(buCopy.Host, ':'); n >= 0 { + // Drop the discovered port and substitute it the the port specified in bu. + buCopy.Host = buCopy.Host[:n] + } buCopy.Host += ":" + port } busNew = append(busNew, &backendURL{ @@ -391,11 +419,6 @@ func areEqualBackendURLs(a, b []*backendURL) bool { return true } -var resolver = &net.Resolver{ - PreferGo: true, - StrictErrors: true, -} - // getFirstAvailableBackendURL returns the first available backendURL, which isn't broken. // // backendURL.put() must be called on the returned backendURL after the request is complete. @@ -508,6 +531,13 @@ func (up *URLPrefix) MarshalYAML() (interface{}, error) { return up.vOriginal, nil } +// Regex represents a regex +type Regex struct { + re *regexp.Regexp + + sOriginal string +} + func (r *Regex) match(s string) bool { prefix, ok := r.re.LiteralPrefix() if ok { @@ -716,11 +746,11 @@ func parseAuthConfig(data []byte) (*AuthConfig, error) { return float64(len(ui.concurrencyLimitCh)) }) - tr, err := getTransport(ui.TLSInsecureSkipVerify, ui.TLSCAFile) + rt, err := newRoundTripper(ui.TLSCAFile, ui.TLSCertFile, ui.TLSKeyFile, ui.TLSServerName, ui.TLSInsecureSkipVerify) if err != nil { - return nil, fmt.Errorf("cannot initialize HTTP transport: %w", err) + return nil, fmt.Errorf("cannot initialize HTTP RoundTripper: %w", err) } - ui.httpTransport = tr + ui.rt = rt } return ac, nil } @@ -764,11 +794,11 @@ func parseAuthConfigUsers(ac *AuthConfig) (map[string]*UserInfo, error) { return float64(len(ui.concurrencyLimitCh)) }) - tr, err := getTransport(ui.TLSInsecureSkipVerify, ui.TLSCAFile) + rt, err := newRoundTripper(ui.TLSCAFile, ui.TLSCertFile, ui.TLSKeyFile, ui.TLSServerName, ui.TLSInsecureSkipVerify) if err != nil { - return nil, fmt.Errorf("cannot initialize HTTP transport: %w", err) + return nil, fmt.Errorf("cannot initialize HTTP RoundTripper: %w", err) } - ui.httpTransport = tr + ui.rt = rt for _, at := range ats { byAuthToken[at] = ui diff --git a/app/vmauth/auth_config_test.go b/app/vmauth/auth_config_test.go index f6ae94ba9..b7f8eea4f 100644 --- a/app/vmauth/auth_config_test.go +++ b/app/vmauth/auth_config_test.go @@ -4,10 +4,11 @@ import ( "bytes" "fmt" "net/url" - "regexp" "testing" "gopkg.in/yaml.v2" + + "github.com/VictoriaMetrics/VictoriaMetrics/lib/logger" ) func TestParseAuthConfigFailure(t *testing.T) { @@ -315,43 +316,54 @@ users: f(` users: - auth_token: foo - url_prefix: http://aaa:343/bbb + url_prefix: https://aaa:343/bbb max_concurrent_requests: 5 tls_insecure_skip_verify: true + tls_server_name: "foo.bar" + tls_ca_file: "foo/bar" + tls_cert_file: "foo/baz" + tls_key_file: "foo/foo" `, map[string]*UserInfo{ getHTTPAuthToken("foo"): { AuthToken: "foo", - URLPrefix: mustParseURL("http://aaa:343/bbb"), + URLPrefix: mustParseURL("https://aaa:343/bbb"), MaxConcurrentRequests: 5, TLSInsecureSkipVerify: &insecureSkipVerifyTrue, + TLSServerName: "foo.bar", + TLSCAFile: "foo/bar", + TLSCertFile: "foo/baz", + TLSKeyFile: "foo/foo", }, }) // Multiple url_prefix entries insecureSkipVerifyFalse := false + discoverBackendIPsTrue := true f(` users: - username: foo password: bar url_prefix: - http://node1:343/bbb - - http://node2:343/bbb + - http://srv+node2:343/bbb tls_insecure_skip_verify: false retry_status_codes: [500, 501] load_balancing_policy: first_available drop_src_path_prefix_parts: 1 + discover_backend_ips: true `, map[string]*UserInfo{ getHTTPAuthBasicToken("foo", "bar"): { Username: "foo", Password: "bar", URLPrefix: mustParseURLs([]string{ "http://node1:343/bbb", - "http://node2:343/bbb", + "http://srv+node2:343/bbb", }), TLSInsecureSkipVerify: &insecureSkipVerifyFalse, RetryStatusCodes: []int{500, 501}, LoadBalancingPolicy: "first_available", DropSrcPathPrefixParts: intp(1), + DiscoverBackendIPs: &discoverBackendIPsTrue, }, }) @@ -384,32 +396,21 @@ users: { SrcHosts: getRegexs([]string{"foo\\.bar", "baz:1234"}), SrcPaths: getRegexs([]string{"/api/v1/write"}), - SrcQueryArgs: []QueryArg{ - { - Name: "foo", - Value: "bar", - }, + SrcQueryArgs: []*QueryArg{ + mustNewQueryArg("foo=b.+ar"), + mustNewQueryArg("baz=~.*x=y.+"), }, - SrcHeaders: []Header{ - { - Name: "TenantID", - Value: "345", - }, + SrcHeaders: []*Header{ + mustNewHeader("'TenantID: 345'"), }, URLPrefix: mustParseURLs([]string{ "http://vminsert1/insert/0/prometheus", "http://vminsert2/insert/0/prometheus", }), HeadersConf: HeadersConf{ - RequestHeaders: []Header{ - { - Name: "foo", - Value: "bar", - }, - { - Name: "xxx", - Value: "y", - }, + RequestHeaders: []*Header{ + mustNewHeader("'foo: bar'"), + mustNewHeader("'xxx: y'"), }, }, }, @@ -423,7 +424,7 @@ users: url_prefix: http://vmselect/select/0/prometheus - src_paths: ["/api/v1/write"] src_hosts: ["foo\\.bar", "baz:1234"] - src_query_args: ['foo=bar'] + src_query_args: ['foo=b.+ar', 'baz=~.*x=y.+'] src_headers: ['TenantID: 345'] url_prefix: ["http://vminsert1/insert/0/prometheus","http://vminsert2/insert/0/prometheus"] headers: @@ -486,15 +487,9 @@ users: "http://vminsert2/insert/0/prometheus", }), HeadersConf: HeadersConf{ - RequestHeaders: []Header{ - { - Name: "foo", - Value: "bar", - }, - { - Name: "xxx", - Value: "y", - }, + RequestHeaders: []*Header{ + mustNewHeader("'foo: bar'"), + mustNewHeader("'xxx: y'"), }, }, }, @@ -518,15 +513,9 @@ users: "http://vminsert2/insert/0/prometheus", }), HeadersConf: HeadersConf{ - RequestHeaders: []Header{ - { - Name: "foo", - Value: "bar", - }, - { - Name: "xxx", - Value: "y", - }, + RequestHeaders: []*Header{ + mustNewHeader("'foo: bar'"), + mustNewHeader("'xxx: y'"), }, }, }, @@ -600,11 +589,11 @@ unauthorized_user: } ui := m[getHTTPAuthBasicToken("foo", "bar")] - if !isSetBool(ui.TLSInsecureSkipVerify, true) || !ui.httpTransport.TLSClientConfig.InsecureSkipVerify { + if !isSetBool(ui.TLSInsecureSkipVerify, true) { t.Fatalf("unexpected TLSInsecureSkipVerify value for user foo") } - if !isSetBool(ac.UnauthorizedUser.TLSInsecureSkipVerify, false) || ac.UnauthorizedUser.httpTransport.TLSClientConfig.InsecureSkipVerify { + if !isSetBool(ac.UnauthorizedUser.TLSInsecureSkipVerify, false) { t.Fatalf("unexpected TLSInsecureSkipVerify value for unauthorized_user") } } @@ -699,10 +688,7 @@ func isSetBool(boolP *bool, expectedValue bool) bool { func getRegexs(paths []string) []*Regex { var sps []*Regex for _, path := range paths { - sps = append(sps, &Regex{ - sOriginal: path, - re: regexp.MustCompile("^(?:" + path + ")$"), - }) + sps = append(sps, mustNewRegex(path)) } return sps } @@ -759,3 +745,27 @@ func mustParseURLs(us []string) *URLPrefix { func intp(n int) *int { return &n } + +func mustNewRegex(s string) *Regex { + var re Regex + if err := yaml.Unmarshal([]byte(s), &re); err != nil { + logger.Panicf("cannot unmarshal regex %q: %s", s, err) + } + return &re +} + +func mustNewQueryArg(s string) *QueryArg { + var qa QueryArg + if err := yaml.Unmarshal([]byte(s), &qa); err != nil { + logger.Panicf("cannot unmarshal query arg filter %q: %s", s, err) + } + return &qa +} + +func mustNewHeader(s string) *Header { + var h Header + if err := yaml.Unmarshal([]byte(s), &h); err != nil { + logger.Panicf("cannot unmarshal header filter %q: %s", s, err) + } + return &h +} diff --git a/app/vmauth/main.go b/app/vmauth/main.go index bcfc275f1..92d906689 100644 --- a/app/vmauth/main.go +++ b/app/vmauth/main.go @@ -2,8 +2,6 @@ package main import ( "context" - "crypto/tls" - "crypto/x509" "errors" "flag" "fmt" @@ -22,14 +20,13 @@ import ( "github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo" "github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil" - "github.com/VictoriaMetrics/VictoriaMetrics/lib/encoding" "github.com/VictoriaMetrics/VictoriaMetrics/lib/envflag" "github.com/VictoriaMetrics/VictoriaMetrics/lib/flagutil" - "github.com/VictoriaMetrics/VictoriaMetrics/lib/fs/fscore" "github.com/VictoriaMetrics/VictoriaMetrics/lib/httpserver" "github.com/VictoriaMetrics/VictoriaMetrics/lib/logger" "github.com/VictoriaMetrics/VictoriaMetrics/lib/netutil" "github.com/VictoriaMetrics/VictoriaMetrics/lib/procutil" + "github.com/VictoriaMetrics/VictoriaMetrics/lib/promauth" "github.com/VictoriaMetrics/VictoriaMetrics/lib/pushmetrics" ) @@ -53,9 +50,15 @@ var ( maxRequestBodySizeToRetry = flagutil.NewBytes("maxRequestBodySizeToRetry", 16*1024, "The maximum request body size, which can be cached and re-tried at other backends. "+ "Bigger values may require more memory") backendTLSInsecureSkipVerify = flag.Bool("backend.tlsInsecureSkipVerify", false, "Whether to skip TLS verification when connecting to backends over HTTPS. "+ - "See https://docs.victoriametrics.com/vmauth.html#backend-tls-setup") + "See https://docs.victoriametrics.com/vmauth/#backend-tls-setup") backendTLSCAFile = flag.String("backend.TLSCAFile", "", "Optional path to TLS root CA file, which is used for TLS verification when connecting to backends over HTTPS. "+ - "See https://docs.victoriametrics.com/vmauth.html#backend-tls-setup") + "See https://docs.victoriametrics.com/vmauth/#backend-tls-setup") + backendTLSCertFile = flag.String("backend.TLSCertFile", "", "Optional path to TLS client certificate file, which must be sent to HTTPS backend. "+ + "See https://docs.victoriametrics.com/vmauth/#backend-tls-setup") + backendTLSKeyFile = flag.String("backend.TLSKeyFile", "", "Optional path to TLS client key file, which must be sent to HTTPS backend. "+ + "See https://docs.victoriametrics.com/vmauth/#backend-tls-setup") + backendTLSServerName = flag.String("backend.TLSServerName", "", "Optional TLS ServerName, which must be sent to HTTPS backend. "+ + "See https://docs.victoriametrics.com/vmauth/#backend-tls-setup") ) func main() { @@ -161,20 +164,12 @@ func processUserRequest(w http.ResponseWriter, r *http.Request, ui *UserInfo) { if err := ui.beginConcurrencyLimit(); err != nil { handleConcurrencyLimitError(w, r, err) <-concurrencyLimitCh - - // Requests failed because of concurrency limit must be counted as errors, - // since this usually means the backend cannot keep up with the current load. - ui.backendErrors.Inc() return } default: concurrentRequestsLimitReached.Inc() err := fmt.Errorf("cannot serve more than -maxConcurrentRequests=%d concurrent requests", cap(concurrencyLimitCh)) handleConcurrencyLimitError(w, r, err) - - // Requests failed because of concurrency limit must be counted as errors, - // since this usually means the backend cannot keep up with the current load. - ui.backendErrors.Inc() return } processRequest(w, r, ui) @@ -248,7 +243,7 @@ func tryProcessingRequest(w http.ResponseWriter, r *http.Request, targetURL *url req.Host = targetURL.Host } updateHeadersByConfig(req.Header, hc.RequestHeaders) - res, err := ui.httpTransport.RoundTrip(req) + res, err := ui.rt.RoundTrip(req) rtb, rtbOK := req.Body.(*readTrackingBody) if err != nil { if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) { @@ -331,7 +326,7 @@ func copyHeader(dst, src http.Header) { } } -func updateHeadersByConfig(headers http.Header, config []Header) { +func updateHeadersByConfig(headers http.Header, config []*Header) { for _, h := range config { if h.Value == "" { headers.Del(h.Name) @@ -400,50 +395,41 @@ var ( missingRouteRequests = metrics.NewCounter(`vmauth_http_request_errors_total{reason="missing_route"}`) ) -func getTransport(insecureSkipVerifyP *bool, caFile string) (*http.Transport, error) { - if insecureSkipVerifyP == nil { - insecureSkipVerifyP = backendTLSInsecureSkipVerify +func newRoundTripper(caFileOpt, certFileOpt, keyFileOpt, serverNameOpt string, insecureSkipVerifyP *bool) (http.RoundTripper, error) { + caFile := *backendTLSCAFile + if caFileOpt != "" { + caFile = caFileOpt } - insecureSkipVerify := *insecureSkipVerifyP - if caFile == "" { - caFile = *backendTLSCAFile + certFile := *backendTLSCertFile + if certFileOpt != "" { + certFile = certFileOpt + } + keyFile := *backendTLSKeyFile + if keyFileOpt != "" { + keyFile = keyFileOpt + } + serverName := *backendTLSServerName + if serverNameOpt != "" { + serverName = serverNameOpt + } + insecureSkipVerify := *backendTLSInsecureSkipVerify + if p := insecureSkipVerifyP; p != nil { + insecureSkipVerify = *p + } + opts := &promauth.Options{ + TLSConfig: &promauth.TLSConfig{ + CAFile: caFile, + CertFile: certFile, + KeyFile: keyFile, + ServerName: serverName, + InsecureSkipVerify: insecureSkipVerify, + }, + } + cfg, err := opts.NewConfig() + if err != nil { + return nil, fmt.Errorf("cannot initialize promauth.Config: %w", err) } - bb := bbPool.Get() - defer bbPool.Put(bb) - - bb.B = appendTransportKey(bb.B[:0], insecureSkipVerify, caFile) - - transportMapLock.Lock() - defer transportMapLock.Unlock() - - tr := transportMap[string(bb.B)] - if tr == nil { - trLocal, err := newTransport(insecureSkipVerify, caFile) - if err != nil { - return nil, err - } - transportMap[string(bb.B)] = trLocal - tr = trLocal - } - - return tr, nil -} - -var ( - transportMap = make(map[string]*http.Transport) - transportMapLock sync.Mutex -) - -func appendTransportKey(dst []byte, insecureSkipVerify bool, caFile string) []byte { - dst = encoding.MarshalBool(dst, insecureSkipVerify) - dst = encoding.MarshalBytes(dst, bytesutil.ToUnsafeBytes(caFile)) - return dst -} - -var bbPool bytesutil.ByteBufferPool - -func newTransport(insecureSkipVerify bool, caFile string) (*http.Transport, error) { tr := http.DefaultTransport.(*http.Transport).Clone() tr.ResponseHeaderTimeout = *responseTimeout // Automatic compression must be disabled in order to fix https://github.com/VictoriaMetrics/VictoriaMetrics/issues/535 @@ -452,27 +438,10 @@ func newTransport(insecureSkipVerify bool, caFile string) (*http.Transport, erro if tr.MaxIdleConns != 0 && tr.MaxIdleConns < tr.MaxIdleConnsPerHost { tr.MaxIdleConns = tr.MaxIdleConnsPerHost } - tlsCfg := tr.TLSClientConfig - if tlsCfg == nil { - tlsCfg = &tls.Config{} - tr.TLSClientConfig = tlsCfg - } - if insecureSkipVerify || caFile != "" { - tlsCfg.ClientSessionCache = tls.NewLRUClientSessionCache(0) - tlsCfg.InsecureSkipVerify = insecureSkipVerify - if caFile != "" { - data, err := fscore.ReadFileOrHTTP(caFile) - if err != nil { - return nil, fmt.Errorf("cannot read tls_ca_file: %w", err) - } - rootCA := x509.NewCertPool() - if !rootCA.AppendCertsFromPEM(data) { - return nil, fmt.Errorf("cannot parse data read from tls_ca_file %q", caFile) - } - tlsCfg.RootCAs = rootCA - } - } - return tr, nil + tr.DialContext = netutil.DialMaybeSRV + + rt := cfg.NewRoundTripper(tr) + return rt, nil } var ( @@ -496,7 +465,7 @@ func usage() { const s = ` vmauth authenticates and authorizes incoming requests and proxies them to VictoriaMetrics. -See the docs at https://docs.victoriametrics.com/vmauth.html . +See the docs at https://docs.victoriametrics.com/vmauth/ . ` flagutil.Usage(s) } diff --git a/app/vmauth/target_url.go b/app/vmauth/target_url.go index 9d43ef828..443a778fd 100644 --- a/app/vmauth/target_url.go +++ b/app/vmauth/target_url.go @@ -86,19 +86,25 @@ func matchAnyRegex(rs []*Regex, s string) bool { return false } -func matchAnyQueryArg(qas []QueryArg, args url.Values) bool { +func matchAnyQueryArg(qas []*QueryArg, args url.Values) bool { if len(qas) == 0 { return true } for _, qa := range qas { - if slices.Contains(args[qa.Name], qa.Value) { - return true + vs, ok := args[qa.Name] + if !ok { + continue + } + for _, v := range vs { + if qa.Value.match(v) { + return true + } } } return false } -func matchAnyHeader(headers []Header, h http.Header) bool { +func matchAnyHeader(headers []*Header, h http.Header) bool { if len(headers) == 0 { return true } diff --git a/app/vmauth/target_url_test.go b/app/vmauth/target_url_test.go index 17e298308..56871428d 100644 --- a/app/vmauth/target_url_test.go +++ b/app/vmauth/target_url_test.go @@ -97,8 +97,10 @@ func TestCreateTargetURLSuccess(t *testing.T) { bu := up.getBackendURL() target := mergeURLs(bu.url, u, up.dropSrcPathPrefixParts) bu.put() - if target.String() != expectedTarget { - t.Fatalf("unexpected target; got %q; want %q", target, expectedTarget) + + gotTarget := target.String() + if gotTarget != expectedTarget { + t.Fatalf("unexpected target; \ngot:\n%q;\nwant:\n%q", gotTarget, expectedTarget) } if s := headersToString(hc.RequestHeaders); s != expectedRequestHeaders { t.Fatalf("unexpected request headers; got %q; want %q", s, expectedRequestHeaders) @@ -123,17 +125,11 @@ func TestCreateTargetURLSuccess(t *testing.T) { f(&UserInfo{ URLPrefix: mustParseURL("http://foo.bar"), HeadersConf: HeadersConf{ - RequestHeaders: []Header{ - { - Name: "bb", - Value: "aaa", - }, + RequestHeaders: []*Header{ + mustNewHeader("'bb: aaa'"), }, - ResponseHeaders: []Header{ - { - Name: "x", - Value: "y", - }, + ResponseHeaders: []*Header{ + mustNewHeader("'x: y'"), }, }, RetryStatusCodes: []int{503, 501}, @@ -162,29 +158,17 @@ func TestCreateTargetURLSuccess(t *testing.T) { { SrcHosts: getRegexs([]string{"host42"}), SrcPaths: getRegexs([]string{"/vmsingle/api/v1/query"}), - SrcQueryArgs: []QueryArg{ - { - Name: "db", - Value: "foo", - }, + SrcQueryArgs: []*QueryArg{ + mustNewQueryArg("db=foo"), }, URLPrefix: mustParseURL("http://vmselect/0/prometheus"), HeadersConf: HeadersConf{ - RequestHeaders: []Header{ - { - Name: "xx", - Value: "aa", - }, - { - Name: "yy", - Value: "asdf", - }, + RequestHeaders: []*Header{ + mustNewHeader("'xx: aa'"), + mustNewHeader("'yy: asdf'"), }, - ResponseHeaders: []Header{ - { - Name: "qwe", - Value: "rty", - }, + ResponseHeaders: []*Header{ + mustNewHeader("'qwe: rty'"), }, }, RetryStatusCodes: []int{503, 500, 501}, @@ -200,14 +184,12 @@ func TestCreateTargetURLSuccess(t *testing.T) { }, URLPrefix: mustParseURL("http://default-server"), HeadersConf: HeadersConf{ - RequestHeaders: []Header{{ - Name: "bb", - Value: "aaa", - }}, - ResponseHeaders: []Header{{ - Name: "x", - Value: "y", - }}, + RequestHeaders: []*Header{ + mustNewHeader("'bb: aaa'"), + }, + ResponseHeaders: []*Header{ + mustNewHeader("'x: y'"), + }, }, RetryStatusCodes: []int{502}, DropSrcPathPrefixParts: intp(2), @@ -250,6 +232,30 @@ func TestCreateTargetURLSuccess(t *testing.T) { f(&UserInfo{ URLPrefix: mustParseURL("http://foo.bar?extra_label=team=mobile"), }, "/api/v1/query?extra_label=team=dev", "http://foo.bar/api/v1/query?extra_label=team%3Dmobile", "", "", nil, "least_loaded", 0) + + // Complex routing regexp query args in `url_map` + ui = &UserInfo{ + URLMaps: []URLMap{ + { + SrcPaths: getRegexs([]string{"/api/v1/query"}), + SrcQueryArgs: []*QueryArg{ + mustNewQueryArg(`query=~.*{.*env="dev".*}*.`), + }, + URLPrefix: mustParseURL("http://vmselect/0/prometheus"), + }, + { + SrcPaths: getRegexs([]string{"/api/v1/query"}), + SrcQueryArgs: []*QueryArg{ + mustNewQueryArg(`query=~.*{.*env="prod".*}.*`), + }, + URLPrefix: mustParseURL("http://vmselect/1/prometheus"), + }, + }, + URLPrefix: mustParseURL("http://default-server"), + } + f(ui, `/api/v1/query?query=up{env="prod"}`, `http://vmselect/1/prometheus/api/v1/query?query=up%7Benv%3D%22prod%22%7D`, "", "", nil, "least_loaded", 0) + f(ui, `/api/v1/query?query=up{foo="bar",env="dev",pod!=""}`, `http://vmselect/0/prometheus/api/v1/query?query=up%7Bfoo%3D%22bar%22%2Cenv%3D%22dev%22%2Cpod%21%3D%22%22%7D`, "", "", nil, "least_loaded", 0) + f(ui, `/api/v1/query?query=up{foo="bar"}`, `http://default-server/api/v1/query?query=up%7Bfoo%3D%22bar%22%7D`, "", "", nil, "least_loaded", 0) } func TestCreateTargetURLFailure(t *testing.T) { @@ -265,10 +271,10 @@ func TestCreateTargetURLFailure(t *testing.T) { t.Fatalf("unexpected non-empty up=%#v", up) } if hc.RequestHeaders != nil { - t.Fatalf("unexpected non-empty request headers=%q", hc.RequestHeaders) + t.Fatalf("unexpected non-empty request headers: %s", headersToString(hc.RequestHeaders)) } if hc.ResponseHeaders != nil { - t.Fatalf("unexpected non-empty response headers=%q", hc.ResponseHeaders) + t.Fatalf("unexpected non-empty response headers: %s", headersToString(hc.ResponseHeaders)) } } f(&UserInfo{}, "/foo/bar") @@ -282,7 +288,7 @@ func TestCreateTargetURLFailure(t *testing.T) { }, "/api/v1/write") } -func headersToString(hs []Header) string { +func headersToString(hs []*Header) string { a := make([]string, len(hs)) for i, h := range hs { a[i] = fmt.Sprintf("%s: %s", h.Name, h.Value) diff --git a/app/vmbackup/README.md b/app/vmbackup/README.md index 3a2d1f010..b4f35239a 100644 --- a/app/vmbackup/README.md +++ b/app/vmbackup/README.md @@ -1,3 +1,3 @@ -See vmbackup docs [here](https://docs.victoriametrics.com/vmbackup.html). +See vmbackup docs [here](https://docs.victoriametrics.com/vmbackup/). vmbackup docs can be edited at [docs/vmbackup.md](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/docs/vmbackup.md). diff --git a/app/vmbackup/main.go b/app/vmbackup/main.go index a6c6089e5..3603f2105 100644 --- a/app/vmbackup/main.go +++ b/app/vmbackup/main.go @@ -26,7 +26,7 @@ import ( var ( httpListenAddr = flag.String("httpListenAddr", ":8420", "TCP address for exporting metrics at /metrics page") storageDataPath = flag.String("storageDataPath", "victoria-metrics-data", "Path to VictoriaMetrics data. Must match -storageDataPath from VictoriaMetrics or vmstorage") - snapshotName = flag.String("snapshotName", "", "Name for the snapshot to backup. See https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#how-to-work-with-snapshots. There is no need in setting -snapshotName if -snapshot.createURL is set") + snapshotName = flag.String("snapshotName", "", "Name for the snapshot to backup. See https://docs.victoriametrics.com/single-server-victoriametrics/#how-to-work-with-snapshots. There is no need in setting -snapshotName if -snapshot.createURL is set") snapshotCreateURL = flag.String("snapshot.createURL", "", "VictoriaMetrics create snapshot url. When this is given a snapshot will automatically be created during backup. "+ "Example: http://victoriametrics:8428/snapshot/create . There is no need in setting -snapshotName if -snapshot.createURL is set") snapshotDeleteURL = flag.String("snapshot.deleteURL", "", "VictoriaMetrics delete snapshot url. Optional. Will be generated from -snapshot.createURL if not provided. "+ @@ -164,7 +164,7 @@ func usage() { vmbackup performs backups for VictoriaMetrics data from instant snapshots to gcs, s3, azblob or local filesystem. Backed up data can be restored with vmrestore. -See the docs at https://docs.victoriametrics.com/vmbackup.html . +See the docs at https://docs.victoriametrics.com/vmbackup/ . ` flagutil.Usage(s) } diff --git a/app/vmbackupmanager/README.md b/app/vmbackupmanager/README.md index 418e63721..de7487de1 100644 --- a/app/vmbackupmanager/README.md +++ b/app/vmbackupmanager/README.md @@ -1,3 +1,3 @@ -See vmbackupmanager docs [here](https://docs.victoriametrics.com/vmbackupmanager.html). +See vmbackupmanager docs [here](https://docs.victoriametrics.com/vmbackupmanager/). vmbackupmanager docs can be edited at [docs/vmbackupmanager.md](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/docs/vmbackupmanager.md). diff --git a/app/vmctl/README.md b/app/vmctl/README.md index a45c529d1..52769161d 100644 --- a/app/vmctl/README.md +++ b/app/vmctl/README.md @@ -1,3 +1,3 @@ -See vmctl docs [here](https://docs.victoriametrics.com/vmctl.html). +See vmctl docs [here](https://docs.victoriametrics.com/vmctl/). vmctl docs can be edited at [docs/vmctl.md](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/docs/vmctl.md). diff --git a/app/vmctl/flags.go b/app/vmctl/flags.go index e451d83fc..51146880e 100644 --- a/app/vmctl/flags.go +++ b/app/vmctl/flags.go @@ -442,12 +442,12 @@ var ( }, &cli.StringFlag{ Name: vmNativeFilterTimeStart, - Usage: "The time filter may contain different timestamp formats. See more details here https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#timestamp-formats", + Usage: "The time filter may contain different timestamp formats. See more details here https://docs.victoriametrics.com/single-server-victoriametrics/#timestamp-formats", Required: true, }, &cli.StringFlag{ Name: vmNativeFilterTimeEnd, - Usage: "The time filter may contain different timestamp formats. See more details here https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#timestamp-formats", + Usage: "The time filter may contain different timestamp formats. See more details here https://docs.victoriametrics.com/single-server-victoriametrics/#timestamp-formats", }, &cli.StringFlag{ Name: vmNativeStepInterval, @@ -469,7 +469,7 @@ var ( Name: vmNativeSrcAddr, Usage: "VictoriaMetrics address to perform export from. \n" + " Should be the same as --httpListenAddr value for single-node version or vmselect component." + - " If exporting from cluster version see https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format", + " If exporting from cluster version see https://docs.victoriametrics.com/cluster-victoriametrics/#url-format", Required: true, }, &cli.StringFlag{ @@ -518,7 +518,7 @@ var ( Name: vmNativeDstAddr, Usage: "VictoriaMetrics address to perform import to. \n" + " Should be the same as --httpListenAddr value for single-node version or vminsert component." + - " If importing into cluster version see https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format", + " If importing into cluster version see https://docs.victoriametrics.com/cluster-victoriametrics/#url-format", Required: true, }, &cli.StringFlag{ diff --git a/app/vmctl/main.go b/app/vmctl/main.go index ee2678073..10ca56d35 100644 --- a/app/vmctl/main.go +++ b/app/vmctl/main.go @@ -372,6 +372,7 @@ func main() { if err != nil { return cli.Exit(fmt.Errorf("cannot open exported block at path=%q err=%w", blockPath, err), 1) } + defer f.Close() var blocksCount atomic.Uint64 if err := stream.Parse(f, isBlockGzipped, func(_ *stream.Block) error { blocksCount.Add(1) diff --git a/app/vmctl/vm/vm.go b/app/vmctl/vm/vm.go index 1936ee721..539976770 100644 --- a/app/vmctl/vm/vm.go +++ b/app/vmctl/vm/vm.go @@ -123,7 +123,7 @@ func NewImporter(ctx context.Context, cfg Config) (*Importer, error) { importPath := addr + "/api/v1/import" if cfg.AccountID != "" { // if cluster version - // see https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format + // see https://docs.victoriametrics.com/cluster-victoriametrics/#url-format importPath = fmt.Sprintf("%s/insert/%s/prometheus/api/v1/import", addr, cfg.AccountID) } importPath, err := AddExtraLabelsToImportPath(importPath, cfg.ExtraLabels) diff --git a/app/vmgateway/README.md b/app/vmgateway/README.md index 32a5da543..b5cd76087 100644 --- a/app/vmgateway/README.md +++ b/app/vmgateway/README.md @@ -1,3 +1,3 @@ -See vmgateway docs [here](https://docs.victoriametrics.com/vmgateway.html). +See vmgateway docs [here](https://docs.victoriametrics.com/vmgateway/). vmgateway docs can be edited at [docs/vmgateway.md](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/docs/vmgateway.md). diff --git a/app/vminsert/common/insert_ctx_pool.go b/app/vminsert/common/insert_ctx_pool.go index 4fb20fb9c..8f8a617d2 100644 --- a/app/vminsert/common/insert_ctx_pool.go +++ b/app/vminsert/common/insert_ctx_pool.go @@ -2,23 +2,16 @@ package common import ( "sync" - - "github.com/VictoriaMetrics/VictoriaMetrics/lib/cgroup" ) // GetInsertCtx returns InsertCtx from the pool. // // Call PutInsertCtx for returning it to the pool. func GetInsertCtx() *InsertCtx { - select { - case ctx := <-insertCtxPoolCh: - return ctx - default: - if v := insertCtxPool.Get(); v != nil { - return v.(*InsertCtx) - } - return &InsertCtx{} + if v := insertCtxPool.Get(); v != nil { + return v.(*InsertCtx) } + return &InsertCtx{} } // PutInsertCtx returns ctx to the pool. @@ -26,12 +19,7 @@ func GetInsertCtx() *InsertCtx { // ctx cannot be used after the call. func PutInsertCtx(ctx *InsertCtx) { ctx.Reset(0) - select { - case insertCtxPoolCh <- ctx: - default: - insertCtxPool.Put(ctx) - } + insertCtxPool.Put(ctx) } var insertCtxPool sync.Pool -var insertCtxPoolCh = make(chan *InsertCtx, cgroup.AvailableCPUs()) diff --git a/app/vminsert/common/streamaggr.go b/app/vminsert/common/streamaggr.go index 24ff870b5..7a8ae0e11 100644 --- a/app/vminsert/common/streamaggr.go +++ b/app/vminsert/common/streamaggr.go @@ -20,20 +20,22 @@ import ( var ( streamAggrConfig = flag.String("streamAggr.config", "", "Optional path to file with stream aggregation config. "+ - "See https://docs.victoriametrics.com/stream-aggregation.html . "+ + "See https://docs.victoriametrics.com/stream-aggregation/ . "+ "See also -streamAggr.keepInput, -streamAggr.dropInput and -streamAggr.dedupInterval") streamAggrKeepInput = flag.Bool("streamAggr.keepInput", false, "Whether to keep all the input samples after the aggregation with -streamAggr.config. "+ "By default, only aggregated samples are dropped, while the remaining samples are stored in the database. "+ - "See also -streamAggr.dropInput and https://docs.victoriametrics.com/stream-aggregation.html") + "See also -streamAggr.dropInput and https://docs.victoriametrics.com/stream-aggregation/") streamAggrDropInput = flag.Bool("streamAggr.dropInput", false, "Whether to drop all the input samples after the aggregation with -streamAggr.config. "+ "By default, only aggregated samples are dropped, while the remaining samples are stored in the database. "+ - "See also -streamAggr.keepInput and https://docs.victoriametrics.com/stream-aggregation.html") + "See also -streamAggr.keepInput and https://docs.victoriametrics.com/stream-aggregation/") streamAggrDedupInterval = flag.Duration("streamAggr.dedupInterval", 0, "Input samples are de-duplicated with this interval before optional aggregation with -streamAggr.config . "+ - "See also -streamAggr.dropInputLabels and -dedup.minScrapeInterval and https://docs.victoriametrics.com/stream-aggregation.html#deduplication") + "See also -streamAggr.dropInputLabels and -dedup.minScrapeInterval and https://docs.victoriametrics.com/stream-aggregation/#deduplication") streamAggrDropInputLabels = flagutil.NewArrayString("streamAggr.dropInputLabels", "An optional list of labels to drop from samples "+ - "before stream de-duplication and aggregation . See https://docs.victoriametrics.com/stream-aggregation.html#dropping-unneeded-labels") + "before stream de-duplication and aggregation . See https://docs.victoriametrics.com/stream-aggregation/#dropping-unneeded-labels") + streamAggrIgnoreFirstIntervals = flag.Int("streamAggr.ignoreFirstIntervals", 0, "Number of aggregation intervals to skip after the start. Increase this value if you observe incorrect aggregation results after restarts. It could be caused by receiving unordered delayed data from clients pushing data into the database. "+ + "See https://docs.victoriametrics.com/stream-aggregation/#ignore-aggregation-intervals-on-start") streamAggrIgnoreOldSamples = flag.Bool("streamAggr.ignoreOldSamples", false, "Whether to ignore input samples with old timestamps outside the current aggregation interval. "+ - "See https://docs.victoriametrics.com/stream-aggregation.html#ignoring-old-samples") + "See https://docs.victoriametrics.com/stream-aggregation/#ignoring-old-samples") ) var ( @@ -56,9 +58,10 @@ func CheckStreamAggrConfig() error { } pushNoop := func(_ []prompbmarshal.TimeSeries) {} opts := &streamaggr.Options{ - DedupInterval: *streamAggrDedupInterval, - DropInputLabels: *streamAggrDropInputLabels, - IgnoreOldSamples: *streamAggrIgnoreOldSamples, + DedupInterval: *streamAggrDedupInterval, + DropInputLabels: *streamAggrDropInputLabels, + IgnoreOldSamples: *streamAggrIgnoreOldSamples, + IgnoreFirstIntervals: *streamAggrIgnoreFirstIntervals, } sas, err := streamaggr.LoadFromFile(*streamAggrConfig, pushNoop, opts) if err != nil { @@ -84,9 +87,10 @@ func InitStreamAggr() { sighupCh := procutil.NewSighupChan() opts := &streamaggr.Options{ - DedupInterval: *streamAggrDedupInterval, - DropInputLabels: *streamAggrDropInputLabels, - IgnoreOldSamples: *streamAggrIgnoreOldSamples, + DedupInterval: *streamAggrDedupInterval, + DropInputLabels: *streamAggrDropInputLabels, + IgnoreOldSamples: *streamAggrIgnoreOldSamples, + IgnoreFirstIntervals: *streamAggrIgnoreFirstIntervals, } sas, err := streamaggr.LoadFromFile(*streamAggrConfig, pushAggregateSeries, opts) if err != nil { @@ -117,9 +121,10 @@ func reloadStreamAggrConfig() { saCfgReloads.Inc() opts := &streamaggr.Options{ - DedupInterval: *streamAggrDedupInterval, - DropInputLabels: *streamAggrDropInputLabels, - IgnoreOldSamples: *streamAggrIgnoreOldSamples, + DedupInterval: *streamAggrDedupInterval, + DropInputLabels: *streamAggrDropInputLabels, + IgnoreOldSamples: *streamAggrIgnoreOldSamples, + IgnoreFirstIntervals: *streamAggrIgnoreFirstIntervals, } sasNew, err := streamaggr.LoadFromFile(*streamAggrConfig, pushAggregateSeries, opts) if err != nil { diff --git a/app/vminsert/influx/request_handler.go b/app/vminsert/influx/request_handler.go index 39108a188..9e9d174b0 100644 --- a/app/vminsert/influx/request_handler.go +++ b/app/vminsert/influx/request_handler.go @@ -9,7 +9,6 @@ import ( "github.com/VictoriaMetrics/VictoriaMetrics/app/vminsert/common" "github.com/VictoriaMetrics/VictoriaMetrics/app/vminsert/relabel" "github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil" - "github.com/VictoriaMetrics/VictoriaMetrics/lib/cgroup" "github.com/VictoriaMetrics/VictoriaMetrics/lib/prompb" "github.com/VictoriaMetrics/VictoriaMetrics/lib/prompbmarshal" parserCommon "github.com/VictoriaMetrics/VictoriaMetrics/lib/protoparser/common" @@ -166,25 +165,15 @@ func (ctx *pushCtx) reset() { } func getPushCtx() *pushCtx { - select { - case ctx := <-pushCtxPoolCh: - return ctx - default: - if v := pushCtxPool.Get(); v != nil { - return v.(*pushCtx) - } - return &pushCtx{} + if v := pushCtxPool.Get(); v != nil { + return v.(*pushCtx) } + return &pushCtx{} } func putPushCtx(ctx *pushCtx) { ctx.reset() - select { - case pushCtxPoolCh <- ctx: - default: - pushCtxPool.Put(ctx) - } + pushCtxPool.Put(ctx) } var pushCtxPool sync.Pool -var pushCtxPoolCh = make(chan *pushCtx, cgroup.AvailableCPUs()) diff --git a/app/vminsert/native/request_handler.go b/app/vminsert/native/request_handler.go index f5e7cd714..16d83e2f4 100644 --- a/app/vminsert/native/request_handler.go +++ b/app/vminsert/native/request_handler.go @@ -6,7 +6,6 @@ import ( "github.com/VictoriaMetrics/VictoriaMetrics/app/vminsert/common" "github.com/VictoriaMetrics/VictoriaMetrics/app/vminsert/relabel" - "github.com/VictoriaMetrics/VictoriaMetrics/lib/cgroup" "github.com/VictoriaMetrics/VictoriaMetrics/lib/logger" "github.com/VictoriaMetrics/VictoriaMetrics/lib/prompbmarshal" parserCommon "github.com/VictoriaMetrics/VictoriaMetrics/lib/protoparser/common" @@ -90,25 +89,15 @@ func (ctx *pushCtx) reset() { } func getPushCtx() *pushCtx { - select { - case ctx := <-pushCtxPoolCh: - return ctx - default: - if v := pushCtxPool.Get(); v != nil { - return v.(*pushCtx) - } - return &pushCtx{} + if v := pushCtxPool.Get(); v != nil { + return v.(*pushCtx) } + return &pushCtx{} } func putPushCtx(ctx *pushCtx) { ctx.reset() - select { - case pushCtxPoolCh <- ctx: - default: - pushCtxPool.Put(ctx) - } + pushCtxPool.Put(ctx) } var pushCtxPool sync.Pool -var pushCtxPoolCh = make(chan *pushCtx, cgroup.AvailableCPUs()) diff --git a/app/vminsert/vmimport/request_handler.go b/app/vminsert/vmimport/request_handler.go index f5357cff8..54a5d5435 100644 --- a/app/vminsert/vmimport/request_handler.go +++ b/app/vminsert/vmimport/request_handler.go @@ -6,7 +6,6 @@ import ( "github.com/VictoriaMetrics/VictoriaMetrics/app/vminsert/common" "github.com/VictoriaMetrics/VictoriaMetrics/app/vminsert/relabel" - "github.com/VictoriaMetrics/VictoriaMetrics/lib/cgroup" "github.com/VictoriaMetrics/VictoriaMetrics/lib/logger" "github.com/VictoriaMetrics/VictoriaMetrics/lib/prompbmarshal" parserCommon "github.com/VictoriaMetrics/VictoriaMetrics/lib/protoparser/common" @@ -96,25 +95,15 @@ func (ctx *pushCtx) reset() { } func getPushCtx() *pushCtx { - select { - case ctx := <-pushCtxPoolCh: - return ctx - default: - if v := pushCtxPool.Get(); v != nil { - return v.(*pushCtx) - } - return &pushCtx{} + if v := pushCtxPool.Get(); v != nil { + return v.(*pushCtx) } + return &pushCtx{} } func putPushCtx(ctx *pushCtx) { ctx.reset() - select { - case pushCtxPoolCh <- ctx: - default: - pushCtxPool.Put(ctx) - } + pushCtxPool.Put(ctx) } var pushCtxPool sync.Pool -var pushCtxPoolCh = make(chan *pushCtx, cgroup.AvailableCPUs()) diff --git a/app/vmrestore/README.md b/app/vmrestore/README.md index a2ee4e72c..cc4c005f2 100644 --- a/app/vmrestore/README.md +++ b/app/vmrestore/README.md @@ -1,3 +1,3 @@ -See vmrestore docs [here](https://docs.victoriametrics.com/vmrestore.html). +See vmrestore docs [here](https://docs.victoriametrics.com/vmrestore/). vmrestore docs can be edited at [docs/vmrestore.md](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/docs/vmrestore.md). diff --git a/app/vmrestore/main.go b/app/vmrestore/main.go index 98448ddca..74ac19518 100644 --- a/app/vmrestore/main.go +++ b/app/vmrestore/main.go @@ -74,7 +74,7 @@ func usage() { const s = ` vmrestore restores VictoriaMetrics data from backups made by vmbackup. -See the docs at https://docs.victoriametrics.com/vmrestore.html . +See the docs at https://docs.victoriametrics.com/vmrestore/ . ` flagutil.Usage(s) } diff --git a/app/vmselect/main.go b/app/vmselect/main.go index 1857f3d80..353363e11 100644 --- a/app/vmselect/main.go +++ b/app/vmselect/main.go @@ -99,7 +99,7 @@ func RequestHandler(w http.ResponseWriter, r *http.Request) bool { // Strip /prometheus and /graphite prefixes in order to provide path compatibility with cluster version // - // See https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#url-format + // See https://docs.victoriametrics.com/cluster-victoriametrics/#url-format switch { case strings.HasPrefix(path, "/prometheus/"): path = path[len("/prometheus"):] diff --git a/app/vmselect/prometheus/expand-with-exprs.qtpl b/app/vmselect/prometheus/expand-with-exprs.qtpl index 8f2d742ac..722c376d9 100644 --- a/app/vmselect/prometheus/expand-with-exprs.qtpl +++ b/app/vmselect/prometheus/expand-with-exprs.qtpl @@ -21,13 +21,13 @@ textarea { margin: 1em }

    - MetricsQL query with optional WITH expressions: + MetricsQL query with optional WITH expressions:


    - MetricsQL query after expanding WITH expressions and applying other optimizations: + MetricsQL query after expanding WITH expressions and applying other optimizations:

    @@ -79,7 +79,7 @@ textarea { margin: 1em } {% endstripspace %} {% func withExprsTutorial() %} -

    Tutorial for WITH expressions in MetricsQL

    +

    Tutorial for WITH expressions in MetricsQL

    Let's look at the following real query from Node Exporter Full dashboard: diff --git a/app/vmselect/prometheus/expand-with-exprs.qtpl.go b/app/vmselect/prometheus/expand-with-exprs.qtpl.go index dd2f4c025..05928f039 100644 --- a/app/vmselect/prometheus/expand-with-exprs.qtpl.go +++ b/app/vmselect/prometheus/expand-with-exprs.qtpl.go @@ -28,11 +28,11 @@ var ( //line app/vmselect/prometheus/expand-with-exprs.qtpl:9 func StreamExpandWithExprsResponse(qw422016 *qt422016.Writer, q string) { //line app/vmselect/prometheus/expand-with-exprs.qtpl:9 - qw422016.N().S(`Expand WITH expressions

    MetricsQL query with optional WITH expressions:


    MetricsQL query after expanding WITH expressions and applying other optimizations:


    MetricsQL query after expanding WITH expressions and applying other optimizations: